@openclaw/openshell-sandbox 2026.9.5 → 2026.9.6

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 (1123) hide show
  1. package/dist/index.js +17 -49
  2. package/node_modules/@openclaw/fs-safe/CHANGELOG.md +202 -0
  3. package/node_modules/@openclaw/fs-safe/README.md +45 -10
  4. package/node_modules/@openclaw/fs-safe/dist/absolute-path.d.ts +0 -1
  5. package/node_modules/@openclaw/fs-safe/dist/absolute-path.js +2 -8
  6. package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +6 -3
  7. package/node_modules/@openclaw/fs-safe/dist/advanced.js +4 -1
  8. package/node_modules/@openclaw/fs-safe/dist/archive-crc32.d.ts +0 -1
  9. package/node_modules/@openclaw/fs-safe/dist/archive-deadline.d.ts +0 -1
  10. package/node_modules/@openclaw/fs-safe/dist/archive-deadline.js +22 -23
  11. package/node_modules/@openclaw/fs-safe/dist/archive-durability.d.ts +1 -2
  12. package/node_modules/@openclaw/fs-safe/dist/archive-entry.d.ts +0 -1
  13. package/node_modules/@openclaw/fs-safe/dist/archive-errors.d.ts +0 -1
  14. package/node_modules/@openclaw/fs-safe/dist/archive-gzip-tail.d.ts +0 -1
  15. package/node_modules/@openclaw/fs-safe/dist/archive-input.d.ts +0 -1
  16. package/node_modules/@openclaw/fs-safe/dist/archive-kind.d.ts +0 -2
  17. package/node_modules/@openclaw/fs-safe/dist/archive-kind.js +5 -17
  18. package/node_modules/@openclaw/fs-safe/dist/archive-limits.d.ts +0 -1
  19. package/node_modules/@openclaw/fs-safe/dist/archive-merge.d.ts +3 -4
  20. package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +129 -52
  21. package/node_modules/@openclaw/fs-safe/dist/archive-parser-errors.d.ts +0 -1
  22. package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
  23. package/node_modules/@openclaw/fs-safe/dist/archive-plan.d.ts +72 -2
  24. package/node_modules/@openclaw/fs-safe/dist/archive-plan.js +86 -22
  25. package/node_modules/@openclaw/fs-safe/dist/archive-read.d.ts +0 -1
  26. package/node_modules/@openclaw/fs-safe/dist/archive-read.js +10 -11
  27. package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +0 -1
  28. package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.d.ts +3 -1
  29. package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.js +56 -37
  30. package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.d.ts +17 -6
  31. package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.js +134 -34
  32. package/node_modules/@openclaw/fs-safe/dist/archive-zip-admission.d.ts +0 -1
  33. package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.d.ts +0 -1
  34. package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.js +21 -1
  35. package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.d.ts +5 -2
  36. package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.js +25 -1
  37. package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.d.ts +6 -3
  38. package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.js +24 -9
  39. package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.d.ts +0 -1
  40. package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.js +3 -4
  41. package/node_modules/@openclaw/fs-safe/dist/archive-zip-loader.d.ts +2 -1
  42. package/node_modules/@openclaw/fs-safe/dist/archive-zip-loader.js +114 -31
  43. package/node_modules/@openclaw/fs-safe/dist/archive-zip-manifest.d.ts +0 -1
  44. package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.d.ts +1 -1
  45. package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.js +13 -2
  46. package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.d.ts +0 -1
  47. package/node_modules/@openclaw/fs-safe/dist/archive.d.ts +8 -6
  48. package/node_modules/@openclaw/fs-safe/dist/archive.js +214 -172
  49. package/node_modules/@openclaw/fs-safe/dist/async-lock.d.ts +0 -1
  50. package/node_modules/@openclaw/fs-safe/dist/atomic.d.ts +3 -2
  51. package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.d.ts +0 -2
  52. package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.js +0 -6
  53. package/node_modules/@openclaw/fs-safe/dist/bounded-read.d.ts +0 -1
  54. package/node_modules/@openclaw/fs-safe/dist/byte-budget.d.ts +0 -1
  55. package/node_modules/@openclaw/fs-safe/dist/byte-view.d.ts +2 -0
  56. package/node_modules/@openclaw/fs-safe/dist/byte-view.js +13 -0
  57. package/node_modules/@openclaw/fs-safe/dist/clone-metadata.d.ts +1 -1
  58. package/node_modules/@openclaw/fs-safe/dist/clone-metadata.js +6 -2
  59. package/node_modules/@openclaw/fs-safe/dist/config.d.ts +0 -1
  60. package/node_modules/@openclaw/fs-safe/dist/containment.d.ts +0 -1
  61. package/node_modules/@openclaw/fs-safe/dist/copy-file-input.d.ts +0 -1
  62. package/node_modules/@openclaw/fs-safe/dist/copy-policy.d.ts +0 -1
  63. package/node_modules/@openclaw/fs-safe/dist/copy-publication.d.ts +7 -2
  64. package/node_modules/@openclaw/fs-safe/dist/copy-publication.js +3 -0
  65. package/node_modules/@openclaw/fs-safe/dist/copy-tree-portable.d.ts +0 -1
  66. package/node_modules/@openclaw/fs-safe/dist/copy-tree-portable.js +51 -28
  67. package/node_modules/@openclaw/fs-safe/dist/copy.d.ts +0 -1
  68. package/node_modules/@openclaw/fs-safe/dist/copy.js +34 -16
  69. package/node_modules/@openclaw/fs-safe/dist/create-owned-file.d.ts +7 -0
  70. package/node_modules/@openclaw/fs-safe/dist/create-owned-file.js +16 -0
  71. package/node_modules/@openclaw/fs-safe/dist/create.d.ts +17 -0
  72. package/node_modules/@openclaw/fs-safe/dist/create.js +388 -0
  73. package/node_modules/@openclaw/fs-safe/dist/creation-boundary.d.ts +60 -0
  74. package/node_modules/@openclaw/fs-safe/dist/creation-boundary.js +371 -0
  75. package/node_modules/@openclaw/fs-safe/dist/deny-mutations.d.ts +2 -3
  76. package/node_modules/@openclaw/fs-safe/dist/deny-mutations.js +55 -35
  77. package/node_modules/@openclaw/fs-safe/dist/device-path.d.ts +0 -1
  78. package/node_modules/@openclaw/fs-safe/dist/directory-durability.d.ts +7 -8
  79. package/node_modules/@openclaw/fs-safe/dist/directory-durability.js +22 -80
  80. package/node_modules/@openclaw/fs-safe/dist/directory-entry-path.d.ts +0 -1
  81. package/node_modules/@openclaw/fs-safe/dist/directory-guard.d.ts +5 -7
  82. package/node_modules/@openclaw/fs-safe/dist/directory-guard.js +25 -56
  83. package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.d.ts +2 -1
  84. package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.js +20 -2
  85. package/node_modules/@openclaw/fs-safe/dist/directory-mode-owner.d.ts +0 -1
  86. package/node_modules/@openclaw/fs-safe/dist/directory-mode-owner.js +5 -5
  87. package/node_modules/@openclaw/fs-safe/dist/directory-receipt.d.ts +23 -0
  88. package/node_modules/@openclaw/fs-safe/dist/directory-receipt.js +123 -0
  89. package/node_modules/@openclaw/fs-safe/dist/durability.d.ts +2 -2
  90. package/node_modules/@openclaw/fs-safe/dist/effective-uid.d.ts +0 -1
  91. package/node_modules/@openclaw/fs-safe/dist/error-detail.d.ts +0 -1
  92. package/node_modules/@openclaw/fs-safe/dist/errors.d.ts +0 -1
  93. package/node_modules/@openclaw/fs-safe/dist/file-cleanup.d.ts +19 -0
  94. package/node_modules/@openclaw/fs-safe/dist/file-cleanup.js +81 -0
  95. package/node_modules/@openclaw/fs-safe/dist/file-contents.d.ts +5 -0
  96. package/node_modules/@openclaw/fs-safe/dist/file-contents.js +40 -0
  97. package/node_modules/@openclaw/fs-safe/dist/file-handle-transfer.d.ts +2 -1
  98. package/node_modules/@openclaw/fs-safe/dist/file-handle-transfer.js +57 -2
  99. package/node_modules/@openclaw/fs-safe/dist/file-hash.d.ts +0 -1
  100. package/node_modules/@openclaw/fs-safe/dist/file-hash.js +186 -70
  101. package/node_modules/@openclaw/fs-safe/dist/file-identity.d.ts +0 -1
  102. package/node_modules/@openclaw/fs-safe/dist/file-identity.js +18 -4
  103. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-acquisition.d.ts +22 -0
  104. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-acquisition.js +98 -0
  105. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.d.ts +17 -0
  106. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.js +54 -0
  107. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.d.ts +3 -0
  108. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +303 -0
  109. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.d.ts +17 -0
  110. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.js +66 -0
  111. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-held.d.ts +32 -0
  112. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-held.js +395 -0
  113. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.d.ts +43 -0
  114. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.js +209 -0
  115. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-mutation.d.ts +16 -0
  116. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-mutation.js +275 -0
  117. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-options.d.ts +19 -0
  118. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-options.js +58 -0
  119. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-registration.d.ts +1 -0
  120. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-registration.js +90 -0
  121. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root.d.ts +36 -0
  122. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root.js +288 -0
  123. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.d.ts +19 -0
  124. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.js +199 -0
  125. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.d.ts +4 -22
  126. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.js +207 -249
  127. package/node_modules/@openclaw/fs-safe/dist/file-lock.d.ts +0 -1
  128. package/node_modules/@openclaw/fs-safe/dist/file-observation.d.ts +1 -2
  129. package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.d.ts +9 -8
  130. package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.js +67 -36
  131. package/node_modules/@openclaw/fs-safe/dist/file-store-prune.d.ts +0 -1
  132. package/node_modules/@openclaw/fs-safe/dist/file-store-prune.js +5 -1
  133. package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.d.ts +0 -1
  134. package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.js +197 -227
  135. package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.d.ts +0 -1
  136. package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.js +22 -36
  137. package/node_modules/@openclaw/fs-safe/dist/file-store.d.ts +0 -1
  138. package/node_modules/@openclaw/fs-safe/dist/file-store.js +54 -25
  139. package/node_modules/@openclaw/fs-safe/dist/file-sync.d.ts +0 -1
  140. package/node_modules/@openclaw/fs-safe/dist/filename.d.ts +0 -1
  141. package/node_modules/@openclaw/fs-safe/dist/filename.js +1 -7
  142. package/node_modules/@openclaw/fs-safe/dist/fs.d.ts +0 -1
  143. package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.d.ts +2 -2
  144. package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.js +27 -19
  145. package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.d.ts +0 -7
  146. package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.js +6 -11
  147. package/node_modules/@openclaw/fs-safe/dist/guest-dispatch-python.d.ts +0 -1
  148. package/node_modules/@openclaw/fs-safe/dist/guest-dispatch-python.js +41 -90
  149. package/node_modules/@openclaw/fs-safe/dist/guest-native-python.d.ts +0 -1
  150. package/node_modules/@openclaw/fs-safe/dist/guest.d.ts +0 -1
  151. package/node_modules/@openclaw/fs-safe/dist/home-dir.d.ts +0 -1
  152. package/node_modules/@openclaw/fs-safe/dist/index.d.ts +9 -7
  153. package/node_modules/@openclaw/fs-safe/dist/install-path.d.ts +0 -1
  154. package/node_modules/@openclaw/fs-safe/dist/install-path.js +2 -5
  155. package/node_modules/@openclaw/fs-safe/dist/json-document-store.d.ts +0 -1
  156. package/node_modules/@openclaw/fs-safe/dist/json-document-store.js +22 -15
  157. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.d.ts +13 -1
  158. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.js +134 -0
  159. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.d.ts +0 -2
  160. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.js +43 -72
  161. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-read.d.ts +0 -1
  162. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-read.js +13 -9
  163. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.d.ts +0 -1
  164. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.js +18 -141
  165. package/node_modules/@openclaw/fs-safe/dist/json-store.d.ts +0 -1
  166. package/node_modules/@openclaw/fs-safe/dist/json-store.js +1 -2
  167. package/node_modules/@openclaw/fs-safe/dist/json-stringify.d.ts +0 -1
  168. package/node_modules/@openclaw/fs-safe/dist/json.d.ts +0 -1
  169. package/node_modules/@openclaw/fs-safe/dist/json.js +39 -92
  170. package/node_modules/@openclaw/fs-safe/dist/local-file-access.d.ts +0 -1
  171. package/node_modules/@openclaw/fs-safe/dist/local-file-access.js +3 -10
  172. package/node_modules/@openclaw/fs-safe/dist/local-file-descriptor.d.ts +0 -1
  173. package/node_modules/@openclaw/fs-safe/dist/local-roots.d.ts +0 -1
  174. package/node_modules/@openclaw/fs-safe/dist/local-roots.js +19 -21
  175. package/node_modules/@openclaw/fs-safe/dist/lock-config.d.ts +0 -1
  176. package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.d.ts +5 -20
  177. package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.js +57 -21
  178. package/node_modules/@openclaw/fs-safe/dist/move-path-stage.d.ts +0 -1
  179. package/node_modules/@openclaw/fs-safe/dist/move-path.d.ts +0 -1
  180. package/node_modules/@openclaw/fs-safe/dist/move-path.js +64 -42
  181. package/node_modules/@openclaw/fs-safe/dist/mutation-authority.d.ts +0 -1
  182. package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +19 -2
  183. package/node_modules/@openclaw/fs-safe/dist/native-config.d.ts +0 -1
  184. package/node_modules/@openclaw/fs-safe/dist/native-directory-observation.d.ts +0 -1
  185. package/node_modules/@openclaw/fs-safe/dist/native-fallback-warning.d.ts +3 -0
  186. package/node_modules/@openclaw/fs-safe/dist/native-fallback-warning.js +11 -0
  187. package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts +1 -7
  188. package/node_modules/@openclaw/fs-safe/dist/native-operations.js +2 -31
  189. package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.d.ts +5 -3
  190. package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.js +27 -7
  191. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.d.ts +2 -3
  192. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.js +174 -29
  193. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.d.ts +1 -2
  194. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.js +224 -187
  195. package/node_modules/@openclaw/fs-safe/dist/native-policy-directory-observation.d.ts +11 -0
  196. package/node_modules/@openclaw/fs-safe/dist/native-policy-directory-observation.js +61 -0
  197. package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.d.ts +13 -0
  198. package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.js +209 -0
  199. package/node_modules/@openclaw/fs-safe/dist/native-rename-outcome.d.ts +3 -0
  200. package/node_modules/@openclaw/fs-safe/dist/native-rename-outcome.js +8 -0
  201. package/node_modules/@openclaw/fs-safe/dist/native-staged-file.d.ts +20 -6
  202. package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +149 -106
  203. package/node_modules/@openclaw/fs-safe/dist/native.d.ts +0 -1
  204. package/node_modules/@openclaw/fs-safe/dist/native.js +2 -2
  205. package/node_modules/@openclaw/fs-safe/dist/opened-file-failure.d.ts +0 -1
  206. package/node_modules/@openclaw/fs-safe/dist/opened-realpath.d.ts +0 -1
  207. package/node_modules/@openclaw/fs-safe/dist/opened-realpath.js +11 -2
  208. package/node_modules/@openclaw/fs-safe/dist/output.d.ts +0 -1
  209. package/node_modules/@openclaw/fs-safe/dist/output.js +12 -8
  210. package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.d.ts +0 -1
  211. package/node_modules/@openclaw/fs-safe/dist/owner-dacl.d.ts +0 -1
  212. package/node_modules/@openclaw/fs-safe/dist/owner-dacl.js +10 -4
  213. package/node_modules/@openclaw/fs-safe/dist/path-case.d.ts +0 -1
  214. package/node_modules/@openclaw/fs-safe/dist/path-policy.d.ts +0 -1
  215. package/node_modules/@openclaw/fs-safe/dist/path-prefix.d.ts +0 -1
  216. package/node_modules/@openclaw/fs-safe/dist/path-prefix.js +30 -8
  217. package/node_modules/@openclaw/fs-safe/dist/path-scope-lexical.d.ts +0 -1
  218. package/node_modules/@openclaw/fs-safe/dist/path-segment-route.d.ts +0 -1
  219. package/node_modules/@openclaw/fs-safe/dist/path-suffix-aliases.d.ts +2 -1
  220. package/node_modules/@openclaw/fs-safe/dist/path-suffix-aliases.js +25 -17
  221. package/node_modules/@openclaw/fs-safe/dist/path.d.ts +0 -1
  222. package/node_modules/@openclaw/fs-safe/dist/path.js +2 -1
  223. package/node_modules/@openclaw/fs-safe/dist/permission-exec.d.ts +2 -1
  224. package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +144 -21
  225. package/node_modules/@openclaw/fs-safe/dist/permissions-public.d.ts +0 -1
  226. package/node_modules/@openclaw/fs-safe/dist/permissions-windows.d.ts +2 -10
  227. package/node_modules/@openclaw/fs-safe/dist/permissions-windows.js +11 -31
  228. package/node_modules/@openclaw/fs-safe/dist/permissions.d.ts +0 -1
  229. package/node_modules/@openclaw/fs-safe/dist/permissions.js +11 -33
  230. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.d.ts +1 -2
  231. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.js +23 -29
  232. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-observation.d.ts +7 -3
  233. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-observation.js +81 -18
  234. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-shared-route.d.ts +1 -1
  235. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-shared-route.js +1 -1
  236. package/node_modules/@openclaw/fs-safe/dist/pinned-open.d.ts +1 -1
  237. package/node_modules/@openclaw/fs-safe/dist/pinned-open.js +7 -2
  238. package/node_modules/@openclaw/fs-safe/dist/pinned-operation.d.ts +1 -2
  239. package/node_modules/@openclaw/fs-safe/dist/pinned-operation.js +3 -16
  240. package/node_modules/@openclaw/fs-safe/dist/pinned-write-input.d.ts +3 -0
  241. package/node_modules/@openclaw/fs-safe/dist/pinned-write-input.js +35 -0
  242. package/node_modules/@openclaw/fs-safe/dist/pinned-write-mode.d.ts +4 -0
  243. package/node_modules/@openclaw/fs-safe/dist/pinned-write-mode.js +31 -0
  244. package/node_modules/@openclaw/fs-safe/dist/pinned-write-staged.d.ts +5 -0
  245. package/node_modules/@openclaw/fs-safe/dist/pinned-write-staged.js +185 -0
  246. package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.d.ts +14 -21
  247. package/node_modules/@openclaw/fs-safe/dist/pinned-write.d.ts +0 -2
  248. package/node_modules/@openclaw/fs-safe/dist/pinned-write.js +43 -151
  249. package/node_modules/@openclaw/fs-safe/dist/positional-read.d.ts +0 -1
  250. package/node_modules/@openclaw/fs-safe/dist/private-directory.d.ts +0 -1
  251. package/node_modules/@openclaw/fs-safe/dist/private-directory.js +18 -4
  252. package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff-sync.d.ts +3 -0
  253. package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff-sync.js +72 -0
  254. package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff.d.ts +42 -5
  255. package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff.js +166 -80
  256. package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.d.ts +0 -1
  257. package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +56 -128
  258. package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.d.ts +3 -3
  259. package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.js +16 -7
  260. package/node_modules/@openclaw/fs-safe/dist/publish-file-failure.d.ts +0 -1
  261. package/node_modules/@openclaw/fs-safe/dist/publish-file.d.ts +2 -4
  262. package/node_modules/@openclaw/fs-safe/dist/publish-file.js +59 -100
  263. package/node_modules/@openclaw/fs-safe/dist/read-open-flags.d.ts +0 -1
  264. package/node_modules/@openclaw/fs-safe/dist/read-opened-file.d.ts +0 -1
  265. package/node_modules/@openclaw/fs-safe/dist/realpath.d.ts +0 -1
  266. package/node_modules/@openclaw/fs-safe/dist/recursive-mkdir-path.d.ts +0 -1
  267. package/node_modules/@openclaw/fs-safe/dist/regular-file.d.ts +0 -1
  268. package/node_modules/@openclaw/fs-safe/dist/regular-file.js +108 -193
  269. package/node_modules/@openclaw/fs-safe/dist/replace-directory.d.ts +0 -1
  270. package/node_modules/@openclaw/fs-safe/dist/replace-directory.js +257 -20
  271. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.d.ts +0 -1
  272. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +90 -85
  273. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.d.ts +0 -1
  274. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.js +27 -33
  275. package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts +0 -1
  276. package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +16 -17
  277. package/node_modules/@openclaw/fs-safe/dist/replace-file-mode.d.ts +0 -1
  278. package/node_modules/@openclaw/fs-safe/dist/replace-file-rename-policy.d.ts +1 -3
  279. package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.d.ts +17 -22
  280. package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.js +110 -145
  281. package/node_modules/@openclaw/fs-safe/dist/replace-file.d.ts +3 -4
  282. package/node_modules/@openclaw/fs-safe/dist/replace-file.js +16 -20
  283. package/node_modules/@openclaw/fs-safe/dist/retained-directory-replacement.d.ts +25 -0
  284. package/node_modules/@openclaw/fs-safe/dist/retained-directory-replacement.js +193 -0
  285. package/node_modules/@openclaw/fs-safe/dist/root-boundary.d.ts +1 -1
  286. package/node_modules/@openclaw/fs-safe/dist/root-boundary.js +4 -0
  287. package/node_modules/@openclaw/fs-safe/dist/root-context.d.ts +0 -9
  288. package/node_modules/@openclaw/fs-safe/dist/root-context.js +3 -10
  289. package/node_modules/@openclaw/fs-safe/dist/root-create-input.d.ts +9 -3
  290. package/node_modules/@openclaw/fs-safe/dist/root-create-input.js +17 -4
  291. package/node_modules/@openclaw/fs-safe/dist/root-directory-creation.d.ts +4 -5
  292. package/node_modules/@openclaw/fs-safe/dist/root-directory-creation.js +20 -7
  293. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +1 -1
  294. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +24 -10
  295. package/node_modules/@openclaw/fs-safe/dist/root-directory.d.ts +0 -1
  296. package/node_modules/@openclaw/fs-safe/dist/root-entries.d.ts +0 -1
  297. package/node_modules/@openclaw/fs-safe/dist/root-entries.js +2 -2
  298. package/node_modules/@openclaw/fs-safe/dist/root-errors.d.ts +4 -1
  299. package/node_modules/@openclaw/fs-safe/dist/root-errors.js +5 -3
  300. package/node_modules/@openclaw/fs-safe/dist/root-file-final-admission.d.ts +1 -2
  301. package/node_modules/@openclaw/fs-safe/dist/root-file-final-admission.js +5 -2
  302. package/node_modules/@openclaw/fs-safe/dist/root-file.d.ts +0 -1
  303. package/node_modules/@openclaw/fs-safe/dist/root-file.js +3 -2
  304. package/node_modules/@openclaw/fs-safe/dist/root-impl.d.ts +2 -15
  305. package/node_modules/@openclaw/fs-safe/dist/root-impl.js +232 -148
  306. package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.d.ts +2 -1
  307. package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.js +28 -25
  308. package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.d.ts +0 -1
  309. package/node_modules/@openclaw/fs-safe/dist/root-observed-path.d.ts +0 -1
  310. package/node_modules/@openclaw/fs-safe/dist/root-observed-path.js +2 -4
  311. package/node_modules/@openclaw/fs-safe/dist/root-options.d.ts +13 -6
  312. package/node_modules/@openclaw/fs-safe/dist/root-path-errors.d.ts +1 -1
  313. package/node_modules/@openclaw/fs-safe/dist/root-path-errors.js +11 -2
  314. package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts +3 -1
  315. package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +45 -50
  316. package/node_modules/@openclaw/fs-safe/dist/root-path-observation.d.ts +0 -1
  317. package/node_modules/@openclaw/fs-safe/dist/root-path-stat.d.ts +0 -1
  318. package/node_modules/@openclaw/fs-safe/dist/root-path-stat.js +61 -11
  319. package/node_modules/@openclaw/fs-safe/dist/root-path.d.ts +0 -1
  320. package/node_modules/@openclaw/fs-safe/dist/root-path.js +60 -200
  321. package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.d.ts +0 -1
  322. package/node_modules/@openclaw/fs-safe/dist/root-paths.d.ts +0 -1
  323. package/node_modules/@openclaw/fs-safe/dist/root-public-types.d.ts +11 -0
  324. package/node_modules/@openclaw/fs-safe/dist/root-read-admission.d.ts +0 -1
  325. package/node_modules/@openclaw/fs-safe/dist/root-read-admission.js +31 -39
  326. package/node_modules/@openclaw/fs-safe/dist/root-remove-identity.d.ts +0 -1
  327. package/node_modules/@openclaw/fs-safe/dist/root-remove-identity.js +2 -4
  328. package/node_modules/@openclaw/fs-safe/dist/root-remove-receipt.d.ts +0 -1
  329. package/node_modules/@openclaw/fs-safe/dist/root-remove.d.ts +1 -1
  330. package/node_modules/@openclaw/fs-safe/dist/root-remove.js +21 -5
  331. package/node_modules/@openclaw/fs-safe/dist/root-symlink-policy.d.ts +0 -1
  332. package/node_modules/@openclaw/fs-safe/dist/root-walk.d.ts +1 -2
  333. package/node_modules/@openclaw/fs-safe/dist/root-walk.js +17 -2
  334. package/node_modules/@openclaw/fs-safe/dist/root-write-admission.d.ts +1 -4
  335. package/node_modules/@openclaw/fs-safe/dist/root-write-admission.js +4 -22
  336. package/node_modules/@openclaw/fs-safe/dist/root-write-compatibility.d.ts +1 -3
  337. package/node_modules/@openclaw/fs-safe/dist/root-write-compatibility.js +17 -68
  338. package/node_modules/@openclaw/fs-safe/dist/root-write-complete-parent.d.ts +0 -1
  339. package/node_modules/@openclaw/fs-safe/dist/root-write-complete-parent.js +12 -27
  340. package/node_modules/@openclaw/fs-safe/dist/root-write-lock-binding.d.ts +14 -0
  341. package/node_modules/@openclaw/fs-safe/dist/root-write-lock-binding.js +162 -0
  342. package/node_modules/@openclaw/fs-safe/dist/root-write-mode.d.ts +0 -1
  343. package/node_modules/@openclaw/fs-safe/dist/root-write-publication.d.ts +0 -1
  344. package/node_modules/@openclaw/fs-safe/dist/root-write-publication.js +1 -1
  345. package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts +1 -2
  346. package/node_modules/@openclaw/fs-safe/dist/root-write-verification.js +29 -42
  347. package/node_modules/@openclaw/fs-safe/dist/root.d.ts +2 -7
  348. package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.d.ts +1 -2
  349. package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.js +2 -5
  350. package/node_modules/@openclaw/fs-safe/dist/secret-file.d.ts +0 -1
  351. package/node_modules/@openclaw/fs-safe/dist/secret-file.js +10 -42
  352. package/node_modules/@openclaw/fs-safe/dist/secret-read-async.d.ts +0 -1
  353. package/node_modules/@openclaw/fs-safe/dist/secret-read-async.js +6 -27
  354. package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.d.ts +6 -3
  355. package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.js +26 -2
  356. package/node_modules/@openclaw/fs-safe/dist/secret.d.ts +0 -1
  357. package/node_modules/@openclaw/fs-safe/dist/secure-file-windows.d.ts +3 -3
  358. package/node_modules/@openclaw/fs-safe/dist/secure-file-windows.js +38 -136
  359. package/node_modules/@openclaw/fs-safe/dist/secure-file.d.ts +0 -1
  360. package/node_modules/@openclaw/fs-safe/dist/secure-file.js +11 -11
  361. package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.d.ts +0 -1
  362. package/node_modules/@openclaw/fs-safe/dist/secure-temp-repair.d.ts +0 -1
  363. package/node_modules/@openclaw/fs-safe/dist/secure-temp-repair.js +5 -1
  364. package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.d.ts +0 -1
  365. package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.js +32 -39
  366. package/node_modules/@openclaw/fs-safe/dist/sibling-temp.d.ts +0 -1
  367. package/node_modules/@openclaw/fs-safe/dist/sibling-temp.js +23 -12
  368. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.d.ts +2 -29
  369. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +279 -216
  370. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-context.d.ts +18 -0
  371. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-context.js +60 -0
  372. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-parser.d.ts +42 -0
  373. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-parser.js +113 -0
  374. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.d.ts +31 -0
  375. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.js +1 -0
  376. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.d.ts +3 -1
  377. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.js +6 -0
  378. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.d.ts +4 -1
  379. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.js +23 -0
  380. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.d.ts +10 -6
  381. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.js +91 -33
  382. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-registration.d.ts +13 -0
  383. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-registration.js +47 -0
  384. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.d.ts +0 -1
  385. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.js +2 -1
  386. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-stale-admission.d.ts +38 -0
  387. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-stale-admission.js +228 -0
  388. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-target.d.ts +7 -0
  389. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-target.js +55 -0
  390. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-types.d.ts +22 -17
  391. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.d.ts +0 -1
  392. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +43 -28
  393. package/node_modules/@openclaw/fs-safe/dist/staged-directory.d.ts +7 -5
  394. package/node_modules/@openclaw/fs-safe/dist/staged-directory.js +43 -7
  395. package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.d.ts +16 -0
  396. package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.js +57 -0
  397. package/node_modules/@openclaw/fs-safe/dist/staged-file-types.d.ts +0 -1
  398. package/node_modules/@openclaw/fs-safe/dist/stat-observation.d.ts +0 -1
  399. package/node_modules/@openclaw/fs-safe/dist/store.d.ts +0 -1
  400. package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.d.ts +1 -2
  401. package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.js +9 -9
  402. package/node_modules/@openclaw/fs-safe/dist/string-coerce.d.ts +0 -1
  403. package/node_modules/@openclaw/fs-safe/dist/suppressed-error.d.ts +0 -1
  404. package/node_modules/@openclaw/fs-safe/dist/symlink-parents.d.ts +0 -1
  405. package/node_modules/@openclaw/fs-safe/dist/symlink-parents.js +2 -27
  406. package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.d.ts +0 -1
  407. package/node_modules/@openclaw/fs-safe/dist/temp-target.d.ts +0 -1
  408. package/node_modules/@openclaw/fs-safe/dist/temp-target.js +7 -46
  409. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.d.ts +0 -8
  410. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.js +29 -11
  411. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +16 -6
  412. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +71 -15
  413. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.d.ts +1 -7
  414. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.js +10 -31
  415. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.d.ts +1 -1
  416. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.js +49 -26
  417. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-types.d.ts +0 -1
  418. package/node_modules/@openclaw/fs-safe/dist/temp.d.ts +0 -1
  419. package/node_modules/@openclaw/fs-safe/dist/test-hooks.d.ts +0 -1
  420. package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts +0 -1
  421. package/node_modules/@openclaw/fs-safe/dist/text-atomic.js +1 -1
  422. package/node_modules/@openclaw/fs-safe/dist/timing.d.ts +0 -1
  423. package/node_modules/@openclaw/fs-safe/dist/trash.d.ts +0 -1
  424. package/node_modules/@openclaw/fs-safe/dist/types.d.ts +0 -1
  425. package/node_modules/@openclaw/fs-safe/dist/unicode-path.d.ts +0 -1
  426. package/node_modules/@openclaw/fs-safe/dist/unicode-path.js +3 -0
  427. package/node_modules/@openclaw/fs-safe/dist/walk.d.ts +5 -2
  428. package/node_modules/@openclaw/fs-safe/dist/walk.js +23 -8
  429. package/node_modules/@openclaw/fs-safe/dist/windows-command.d.ts +0 -1
  430. package/node_modules/@openclaw/fs-safe/dist/windows-owner.d.ts +0 -1
  431. package/node_modules/@openclaw/fs-safe/dist/windows-owner.js +8 -4
  432. package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.d.ts +1 -1
  433. package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.js +12 -43
  434. package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.d.ts +5 -0
  435. package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.js +21 -0
  436. package/node_modules/@openclaw/fs-safe/dist/windows-security-bridge.cs +336 -0
  437. package/node_modules/@openclaw/fs-safe/dist/windows-security-bridge.ps1 +15 -0
  438. package/node_modules/@openclaw/fs-safe/dist/windows-security-command.d.ts +25 -0
  439. package/node_modules/@openclaw/fs-safe/dist/windows-security-command.js +363 -0
  440. package/node_modules/@openclaw/fs-safe/dist/windows-security-facts.d.ts +5 -0
  441. package/node_modules/@openclaw/fs-safe/dist/windows-security-facts.js +108 -0
  442. package/node_modules/@openclaw/fs-safe/dist/write-file-handle.d.ts +7 -1
  443. package/node_modules/@openclaw/fs-safe/dist/write-file-handle.js +23 -0
  444. package/node_modules/@openclaw/fs-safe/dist/write-open-flags.d.ts +0 -1
  445. package/node_modules/@openclaw/fs-safe/dist/write-open-flags.js +1 -8
  446. package/node_modules/@openclaw/fs-safe/dist/write-queue.d.ts +0 -1
  447. package/node_modules/@openclaw/fs-safe/dist/write-queue.js +1 -4
  448. package/node_modules/@openclaw/fs-safe/docs/advanced.md +75 -4
  449. package/node_modules/@openclaw/fs-safe/docs/archive.md +138 -48
  450. package/node_modules/@openclaw/fs-safe/docs/atomic.md +125 -10
  451. package/node_modules/@openclaw/fs-safe/docs/config.md +6 -2
  452. package/node_modules/@openclaw/fs-safe/docs/contributing.md +48 -4
  453. package/node_modules/@openclaw/fs-safe/docs/copy.md +39 -0
  454. package/node_modules/@openclaw/fs-safe/docs/creation.md +132 -0
  455. package/node_modules/@openclaw/fs-safe/docs/durability.md +59 -0
  456. package/node_modules/@openclaw/fs-safe/docs/file-contents.md +68 -0
  457. package/node_modules/@openclaw/fs-safe/docs/file-store.md +19 -0
  458. package/node_modules/@openclaw/fs-safe/docs/guest.md +1 -1
  459. package/node_modules/@openclaw/fs-safe/docs/install.md +31 -7
  460. package/node_modules/@openclaw/fs-safe/docs/json-store.md +5 -0
  461. package/node_modules/@openclaw/fs-safe/docs/json.md +5 -4
  462. package/node_modules/@openclaw/fs-safe/docs/local-roots.md +2 -0
  463. package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.5.md +15 -6
  464. package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.6.md +9 -4
  465. package/node_modules/@openclaw/fs-safe/docs/mutation-policy-proof.md +11 -7
  466. package/node_modules/@openclaw/fs-safe/docs/native-helper.md +32 -12
  467. package/node_modules/@openclaw/fs-safe/docs/native.md +55 -15
  468. package/node_modules/@openclaw/fs-safe/docs/output.md +6 -0
  469. package/node_modules/@openclaw/fs-safe/docs/path-prefix.md +10 -0
  470. package/node_modules/@openclaw/fs-safe/docs/path-suffix-aliases.md +51 -6
  471. package/node_modules/@openclaw/fs-safe/docs/path.md +4 -4
  472. package/node_modules/@openclaw/fs-safe/docs/permissions.md +56 -14
  473. package/node_modules/@openclaw/fs-safe/docs/public-api.md +8 -2
  474. package/node_modules/@openclaw/fs-safe/docs/quickstart.md +1 -1
  475. package/node_modules/@openclaw/fs-safe/docs/reading.md +2 -2
  476. package/node_modules/@openclaw/fs-safe/docs/regular-file.md +3 -0
  477. package/node_modules/@openclaw/fs-safe/docs/root.md +75 -3
  478. package/node_modules/@openclaw/fs-safe/docs/secret-file.md +19 -2
  479. package/node_modules/@openclaw/fs-safe/docs/secure-file.md +9 -4
  480. package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +127 -9
  481. package/node_modules/@openclaw/fs-safe/docs/staged-file.md +16 -6
  482. package/node_modules/@openclaw/fs-safe/docs/store.md +9 -1
  483. package/node_modules/@openclaw/fs-safe/docs/temp.md +32 -5
  484. package/node_modules/@openclaw/fs-safe/docs/types.md +18 -2
  485. package/node_modules/@openclaw/fs-safe/docs/walk.md +74 -1
  486. package/node_modules/@openclaw/fs-safe/docs/writing.md +105 -11
  487. package/node_modules/@openclaw/fs-safe/package.json +19 -17
  488. package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
  489. package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
  490. package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
  491. package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
  492. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
  493. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
  494. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
  495. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
  496. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
  497. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
  498. package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
  499. package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
  500. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
  501. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
  502. package/node_modules/zod/README.md +2 -2
  503. package/node_modules/zod/compile.cjs +19 -0
  504. package/node_modules/zod/index.cjs +19 -0
  505. package/node_modules/zod/locales/index.cjs +19 -0
  506. package/node_modules/zod/mini/index.cjs +19 -0
  507. package/node_modules/zod/package.json +8 -7
  508. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  509. package/node_modules/zod/src/v4/classic/external.ts +2 -0
  510. package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
  511. package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
  512. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
  513. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
  514. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
  515. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
  516. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
  517. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
  518. package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
  519. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
  520. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  521. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
  522. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
  523. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
  524. package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
  525. package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
  526. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
  527. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  528. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  529. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
  530. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  531. package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
  532. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
  533. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
  534. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
  535. package/node_modules/zod/src/v4/core/api.ts +44 -28
  536. package/node_modules/zod/src/v4/core/checks.ts +62 -102
  537. package/node_modules/zod/src/v4/core/compile.ts +218 -93
  538. package/node_modules/zod/src/v4/core/core.ts +1 -3
  539. package/node_modules/zod/src/v4/core/doc.ts +6 -2
  540. package/node_modules/zod/src/v4/core/errors.ts +3 -6
  541. package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
  542. package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
  543. package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
  544. package/node_modules/zod/src/v4/core/parse.ts +37 -16
  545. package/node_modules/zod/src/v4/core/regexes.ts +14 -4
  546. package/node_modules/zod/src/v4/core/schemas.ts +296 -132
  547. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  548. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
  549. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  550. package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
  551. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  552. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  553. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  554. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
  555. package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
  556. package/node_modules/zod/src/v4/core/util.ts +218 -147
  557. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  558. package/node_modules/zod/src/v4/locales/ar.ts +2 -0
  559. package/node_modules/zod/src/v4/locales/az.ts +2 -0
  560. package/node_modules/zod/src/v4/locales/be.ts +2 -0
  561. package/node_modules/zod/src/v4/locales/bg.ts +2 -0
  562. package/node_modules/zod/src/v4/locales/bn.ts +2 -0
  563. package/node_modules/zod/src/v4/locales/ca.ts +2 -0
  564. package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
  565. package/node_modules/zod/src/v4/locales/cs.ts +2 -0
  566. package/node_modules/zod/src/v4/locales/da.ts +2 -0
  567. package/node_modules/zod/src/v4/locales/de.ts +2 -0
  568. package/node_modules/zod/src/v4/locales/el.ts +2 -0
  569. package/node_modules/zod/src/v4/locales/en.ts +2 -0
  570. package/node_modules/zod/src/v4/locales/eo.ts +2 -0
  571. package/node_modules/zod/src/v4/locales/es.ts +2 -0
  572. package/node_modules/zod/src/v4/locales/fa.ts +2 -0
  573. package/node_modules/zod/src/v4/locales/fi.ts +2 -0
  574. package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
  575. package/node_modules/zod/src/v4/locales/fr.ts +2 -0
  576. package/node_modules/zod/src/v4/locales/gu.ts +2 -0
  577. package/node_modules/zod/src/v4/locales/he.ts +2 -0
  578. package/node_modules/zod/src/v4/locales/hi.ts +2 -0
  579. package/node_modules/zod/src/v4/locales/hr.ts +2 -0
  580. package/node_modules/zod/src/v4/locales/hu.ts +2 -0
  581. package/node_modules/zod/src/v4/locales/hy.ts +2 -0
  582. package/node_modules/zod/src/v4/locales/id.ts +2 -0
  583. package/node_modules/zod/src/v4/locales/index.ts +1 -0
  584. package/node_modules/zod/src/v4/locales/is.ts +2 -0
  585. package/node_modules/zod/src/v4/locales/it.ts +2 -0
  586. package/node_modules/zod/src/v4/locales/ja.ts +2 -0
  587. package/node_modules/zod/src/v4/locales/ka.ts +2 -0
  588. package/node_modules/zod/src/v4/locales/km.ts +2 -0
  589. package/node_modules/zod/src/v4/locales/kn.ts +2 -0
  590. package/node_modules/zod/src/v4/locales/ko.ts +2 -0
  591. package/node_modules/zod/src/v4/locales/lt.ts +2 -0
  592. package/node_modules/zod/src/v4/locales/mk.ts +2 -0
  593. package/node_modules/zod/src/v4/locales/ms.ts +2 -0
  594. package/node_modules/zod/src/v4/locales/ne.ts +2 -0
  595. package/node_modules/zod/src/v4/locales/nl.ts +2 -0
  596. package/node_modules/zod/src/v4/locales/nn.ts +2 -0
  597. package/node_modules/zod/src/v4/locales/no.ts +2 -0
  598. package/node_modules/zod/src/v4/locales/ota.ts +2 -0
  599. package/node_modules/zod/src/v4/locales/pl.ts +2 -0
  600. package/node_modules/zod/src/v4/locales/ps.ts +2 -0
  601. package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
  602. package/node_modules/zod/src/v4/locales/pt.ts +2 -0
  603. package/node_modules/zod/src/v4/locales/ro.ts +2 -0
  604. package/node_modules/zod/src/v4/locales/ru.ts +2 -0
  605. package/node_modules/zod/src/v4/locales/sk.ts +2 -0
  606. package/node_modules/zod/src/v4/locales/sl.ts +2 -0
  607. package/node_modules/zod/src/v4/locales/sv.ts +2 -0
  608. package/node_modules/zod/src/v4/locales/ta.ts +2 -0
  609. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  610. package/node_modules/zod/src/v4/locales/th.ts +2 -0
  611. package/node_modules/zod/src/v4/locales/tk.ts +2 -0
  612. package/node_modules/zod/src/v4/locales/tr.ts +2 -0
  613. package/node_modules/zod/src/v4/locales/uk.ts +2 -0
  614. package/node_modules/zod/src/v4/locales/ur.ts +2 -0
  615. package/node_modules/zod/src/v4/locales/uz.ts +2 -0
  616. package/node_modules/zod/src/v4/locales/vi.ts +2 -0
  617. package/node_modules/zod/src/v4/locales/yo.ts +2 -0
  618. package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
  619. package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
  620. package/node_modules/zod/src/v4/mini/external.ts +2 -0
  621. package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
  622. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
  623. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  624. package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
  625. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  626. package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
  627. package/node_modules/zod/v3/ZodError.cjs +19 -0
  628. package/node_modules/zod/v3/errors.cjs +19 -0
  629. package/node_modules/zod/v3/external.cjs +19 -0
  630. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  631. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  632. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  633. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  634. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  635. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  636. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  637. package/node_modules/zod/v3/index.cjs +19 -0
  638. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  639. package/node_modules/zod/v3/types.cjs +19 -0
  640. package/node_modules/zod/v4/classic/checks.cjs +19 -0
  641. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  642. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  643. package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
  644. package/node_modules/zod/v4/classic/errors.cjs +19 -0
  645. package/node_modules/zod/v4/classic/external.cjs +22 -1
  646. package/node_modules/zod/v4/classic/external.d.cts +1 -1
  647. package/node_modules/zod/v4/classic/external.d.ts +1 -1
  648. package/node_modules/zod/v4/classic/external.js +1 -1
  649. package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
  650. package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
  651. package/node_modules/zod/v4/classic/in-out.cjs +19 -0
  652. package/node_modules/zod/v4/classic/index.cjs +19 -0
  653. package/node_modules/zod/v4/classic/iso.cjs +19 -0
  654. package/node_modules/zod/v4/classic/parse.cjs +19 -0
  655. package/node_modules/zod/v4/classic/schemas.cjs +100 -35
  656. package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
  657. package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
  658. package/node_modules/zod/v4/classic/schemas.js +77 -33
  659. package/node_modules/zod/v4/core/api.cjs +45 -22
  660. package/node_modules/zod/v4/core/api.d.cts +12 -6
  661. package/node_modules/zod/v4/core/api.d.ts +12 -6
  662. package/node_modules/zod/v4/core/api.js +25 -22
  663. package/node_modules/zod/v4/core/checks.cjs +51 -97
  664. package/node_modules/zod/v4/core/checks.d.cts +17 -1
  665. package/node_modules/zod/v4/core/checks.d.ts +17 -1
  666. package/node_modules/zod/v4/core/checks.js +31 -96
  667. package/node_modules/zod/v4/core/compile.cjs +173 -78
  668. package/node_modules/zod/v4/core/compile.d.cts +18 -4
  669. package/node_modules/zod/v4/core/compile.d.ts +18 -4
  670. package/node_modules/zod/v4/core/compile.js +154 -79
  671. package/node_modules/zod/v4/core/core.cjs +20 -1
  672. package/node_modules/zod/v4/core/core.js +1 -1
  673. package/node_modules/zod/v4/core/doc.cjs +26 -2
  674. package/node_modules/zod/v4/core/doc.js +7 -2
  675. package/node_modules/zod/v4/core/errors.cjs +21 -5
  676. package/node_modules/zod/v4/core/errors.js +2 -5
  677. package/node_modules/zod/v4/core/index.cjs +19 -0
  678. package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
  679. package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
  680. package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
  681. package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
  682. package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
  683. package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
  684. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  685. package/node_modules/zod/v4/core/memoizer.cjs +111 -23
  686. package/node_modules/zod/v4/core/memoizer.js +69 -23
  687. package/node_modules/zod/v4/core/parse.cjs +56 -16
  688. package/node_modules/zod/v4/core/parse.js +37 -16
  689. package/node_modules/zod/v4/core/regexes.cjs +31 -6
  690. package/node_modules/zod/v4/core/regexes.d.cts +3 -0
  691. package/node_modules/zod/v4/core/regexes.d.ts +3 -0
  692. package/node_modules/zod/v4/core/regexes.js +10 -4
  693. package/node_modules/zod/v4/core/registries.cjs +19 -0
  694. package/node_modules/zod/v4/core/schemas.cjs +302 -114
  695. package/node_modules/zod/v4/core/schemas.d.cts +28 -8
  696. package/node_modules/zod/v4/core/schemas.d.ts +28 -8
  697. package/node_modules/zod/v4/core/schemas.js +279 -113
  698. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  699. package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
  700. package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
  701. package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
  702. package/node_modules/zod/v4/core/to-json-schema.js +7 -6
  703. package/node_modules/zod/v4/core/util.cjs +177 -143
  704. package/node_modules/zod/v4/core/util.d.cts +25 -4
  705. package/node_modules/zod/v4/core/util.d.ts +25 -4
  706. package/node_modules/zod/v4/core/util.js +156 -143
  707. package/node_modules/zod/v4/core/versions.cjs +21 -2
  708. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  709. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  710. package/node_modules/zod/v4/core/versions.js +2 -2
  711. package/node_modules/zod/v4/core/visit.cjs +19 -0
  712. package/node_modules/zod/v4/index.cjs +19 -0
  713. package/node_modules/zod/v4/locales/ar.cjs +2 -0
  714. package/node_modules/zod/v4/locales/ar.js +2 -0
  715. package/node_modules/zod/v4/locales/az.cjs +2 -0
  716. package/node_modules/zod/v4/locales/az.js +2 -0
  717. package/node_modules/zod/v4/locales/be.cjs +2 -0
  718. package/node_modules/zod/v4/locales/be.js +2 -0
  719. package/node_modules/zod/v4/locales/bg.cjs +2 -0
  720. package/node_modules/zod/v4/locales/bg.js +2 -0
  721. package/node_modules/zod/v4/locales/bn.cjs +2 -0
  722. package/node_modules/zod/v4/locales/bn.js +2 -0
  723. package/node_modules/zod/v4/locales/ca.cjs +2 -0
  724. package/node_modules/zod/v4/locales/ca.js +2 -0
  725. package/node_modules/zod/v4/locales/ckb.cjs +2 -0
  726. package/node_modules/zod/v4/locales/ckb.js +2 -0
  727. package/node_modules/zod/v4/locales/cs.cjs +2 -0
  728. package/node_modules/zod/v4/locales/cs.js +2 -0
  729. package/node_modules/zod/v4/locales/da.cjs +2 -0
  730. package/node_modules/zod/v4/locales/da.js +2 -0
  731. package/node_modules/zod/v4/locales/de.cjs +2 -0
  732. package/node_modules/zod/v4/locales/de.js +2 -0
  733. package/node_modules/zod/v4/locales/el.cjs +2 -0
  734. package/node_modules/zod/v4/locales/el.js +2 -0
  735. package/node_modules/zod/v4/locales/en.cjs +2 -0
  736. package/node_modules/zod/v4/locales/en.js +2 -0
  737. package/node_modules/zod/v4/locales/eo.cjs +2 -0
  738. package/node_modules/zod/v4/locales/eo.js +2 -0
  739. package/node_modules/zod/v4/locales/es.cjs +2 -0
  740. package/node_modules/zod/v4/locales/es.js +2 -0
  741. package/node_modules/zod/v4/locales/fa.cjs +2 -0
  742. package/node_modules/zod/v4/locales/fa.js +2 -0
  743. package/node_modules/zod/v4/locales/fi.cjs +2 -0
  744. package/node_modules/zod/v4/locales/fi.js +2 -0
  745. package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
  746. package/node_modules/zod/v4/locales/fr-CA.js +2 -0
  747. package/node_modules/zod/v4/locales/fr.cjs +2 -0
  748. package/node_modules/zod/v4/locales/fr.js +2 -0
  749. package/node_modules/zod/v4/locales/gu.cjs +2 -0
  750. package/node_modules/zod/v4/locales/gu.js +2 -0
  751. package/node_modules/zod/v4/locales/he.cjs +2 -0
  752. package/node_modules/zod/v4/locales/he.js +2 -0
  753. package/node_modules/zod/v4/locales/hi.cjs +2 -0
  754. package/node_modules/zod/v4/locales/hi.js +2 -0
  755. package/node_modules/zod/v4/locales/hr.cjs +2 -0
  756. package/node_modules/zod/v4/locales/hr.js +2 -0
  757. package/node_modules/zod/v4/locales/hu.cjs +2 -0
  758. package/node_modules/zod/v4/locales/hu.js +2 -0
  759. package/node_modules/zod/v4/locales/hy.cjs +2 -0
  760. package/node_modules/zod/v4/locales/hy.js +2 -0
  761. package/node_modules/zod/v4/locales/id.cjs +2 -0
  762. package/node_modules/zod/v4/locales/id.js +2 -0
  763. package/node_modules/zod/v4/locales/index.cjs +22 -1
  764. package/node_modules/zod/v4/locales/index.d.cts +1 -0
  765. package/node_modules/zod/v4/locales/index.d.ts +1 -0
  766. package/node_modules/zod/v4/locales/index.js +1 -0
  767. package/node_modules/zod/v4/locales/is.cjs +2 -0
  768. package/node_modules/zod/v4/locales/is.js +2 -0
  769. package/node_modules/zod/v4/locales/it.cjs +2 -0
  770. package/node_modules/zod/v4/locales/it.js +2 -0
  771. package/node_modules/zod/v4/locales/ja.cjs +2 -0
  772. package/node_modules/zod/v4/locales/ja.js +2 -0
  773. package/node_modules/zod/v4/locales/ka.cjs +2 -0
  774. package/node_modules/zod/v4/locales/ka.js +2 -0
  775. package/node_modules/zod/v4/locales/km.cjs +2 -0
  776. package/node_modules/zod/v4/locales/km.js +2 -0
  777. package/node_modules/zod/v4/locales/kn.cjs +2 -0
  778. package/node_modules/zod/v4/locales/kn.js +2 -0
  779. package/node_modules/zod/v4/locales/ko.cjs +2 -0
  780. package/node_modules/zod/v4/locales/ko.js +2 -0
  781. package/node_modules/zod/v4/locales/lt.cjs +2 -0
  782. package/node_modules/zod/v4/locales/lt.js +2 -0
  783. package/node_modules/zod/v4/locales/mk.cjs +2 -0
  784. package/node_modules/zod/v4/locales/mk.js +2 -0
  785. package/node_modules/zod/v4/locales/ms.cjs +2 -0
  786. package/node_modules/zod/v4/locales/ms.js +2 -0
  787. package/node_modules/zod/v4/locales/ne.cjs +2 -0
  788. package/node_modules/zod/v4/locales/ne.js +2 -0
  789. package/node_modules/zod/v4/locales/nl.cjs +2 -0
  790. package/node_modules/zod/v4/locales/nl.js +2 -0
  791. package/node_modules/zod/v4/locales/nn.cjs +2 -0
  792. package/node_modules/zod/v4/locales/nn.js +2 -0
  793. package/node_modules/zod/v4/locales/no.cjs +2 -0
  794. package/node_modules/zod/v4/locales/no.js +2 -0
  795. package/node_modules/zod/v4/locales/ota.cjs +2 -0
  796. package/node_modules/zod/v4/locales/ota.js +2 -0
  797. package/node_modules/zod/v4/locales/pl.cjs +2 -0
  798. package/node_modules/zod/v4/locales/pl.js +2 -0
  799. package/node_modules/zod/v4/locales/ps.cjs +2 -0
  800. package/node_modules/zod/v4/locales/ps.js +2 -0
  801. package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
  802. package/node_modules/zod/v4/locales/pt-BR.js +2 -0
  803. package/node_modules/zod/v4/locales/pt.cjs +2 -0
  804. package/node_modules/zod/v4/locales/pt.js +2 -0
  805. package/node_modules/zod/v4/locales/ro.cjs +2 -0
  806. package/node_modules/zod/v4/locales/ro.js +2 -0
  807. package/node_modules/zod/v4/locales/ru.cjs +2 -0
  808. package/node_modules/zod/v4/locales/ru.js +2 -0
  809. package/node_modules/zod/v4/locales/sk.cjs +2 -0
  810. package/node_modules/zod/v4/locales/sk.js +2 -0
  811. package/node_modules/zod/v4/locales/sl.cjs +2 -0
  812. package/node_modules/zod/v4/locales/sl.js +2 -0
  813. package/node_modules/zod/v4/locales/sv.cjs +2 -0
  814. package/node_modules/zod/v4/locales/sv.js +2 -0
  815. package/node_modules/zod/v4/locales/ta.cjs +2 -0
  816. package/node_modules/zod/v4/locales/ta.js +2 -0
  817. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  818. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  819. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  820. package/node_modules/zod/v4/locales/tg.js +117 -0
  821. package/node_modules/zod/v4/locales/th.cjs +2 -0
  822. package/node_modules/zod/v4/locales/th.js +2 -0
  823. package/node_modules/zod/v4/locales/tk.cjs +2 -0
  824. package/node_modules/zod/v4/locales/tk.js +2 -0
  825. package/node_modules/zod/v4/locales/tr.cjs +2 -0
  826. package/node_modules/zod/v4/locales/tr.js +2 -0
  827. package/node_modules/zod/v4/locales/uk.cjs +2 -0
  828. package/node_modules/zod/v4/locales/uk.js +2 -0
  829. package/node_modules/zod/v4/locales/ur.cjs +2 -0
  830. package/node_modules/zod/v4/locales/ur.js +2 -0
  831. package/node_modules/zod/v4/locales/uz.cjs +2 -0
  832. package/node_modules/zod/v4/locales/uz.js +2 -0
  833. package/node_modules/zod/v4/locales/vi.cjs +2 -0
  834. package/node_modules/zod/v4/locales/vi.js +2 -0
  835. package/node_modules/zod/v4/locales/yo.cjs +2 -0
  836. package/node_modules/zod/v4/locales/yo.js +2 -0
  837. package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
  838. package/node_modules/zod/v4/locales/zh-CN.js +2 -0
  839. package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
  840. package/node_modules/zod/v4/locales/zh-TW.js +2 -0
  841. package/node_modules/zod/v4/mini/checks.cjs +19 -0
  842. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  843. package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
  844. package/node_modules/zod/v4/mini/external.cjs +22 -1
  845. package/node_modules/zod/v4/mini/external.d.cts +1 -1
  846. package/node_modules/zod/v4/mini/external.d.ts +1 -1
  847. package/node_modules/zod/v4/mini/external.js +1 -1
  848. package/node_modules/zod/v4/mini/in-out.cjs +19 -0
  849. package/node_modules/zod/v4/mini/index.cjs +19 -0
  850. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  851. package/node_modules/zod/v4/mini/parse.cjs +19 -0
  852. package/node_modules/zod/v4/mini/schemas.cjs +44 -8
  853. package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
  854. package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
  855. package/node_modules/zod/v4/mini/schemas.js +21 -6
  856. package/node_modules/zod/v4-mini/index.cjs +19 -0
  857. package/package.json +6 -6
  858. package/node_modules/@openclaw/fs-safe/dist/absolute-path.d.ts.map +0 -1
  859. package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts.map +0 -1
  860. package/node_modules/@openclaw/fs-safe/dist/archive-crc32.d.ts.map +0 -1
  861. package/node_modules/@openclaw/fs-safe/dist/archive-deadline.d.ts.map +0 -1
  862. package/node_modules/@openclaw/fs-safe/dist/archive-durability.d.ts.map +0 -1
  863. package/node_modules/@openclaw/fs-safe/dist/archive-entry.d.ts.map +0 -1
  864. package/node_modules/@openclaw/fs-safe/dist/archive-errors.d.ts.map +0 -1
  865. package/node_modules/@openclaw/fs-safe/dist/archive-gzip-tail.d.ts.map +0 -1
  866. package/node_modules/@openclaw/fs-safe/dist/archive-input.d.ts.map +0 -1
  867. package/node_modules/@openclaw/fs-safe/dist/archive-kind.d.ts.map +0 -1
  868. package/node_modules/@openclaw/fs-safe/dist/archive-limits.d.ts.map +0 -1
  869. package/node_modules/@openclaw/fs-safe/dist/archive-merge.d.ts.map +0 -1
  870. package/node_modules/@openclaw/fs-safe/dist/archive-native.d.ts +0 -21
  871. package/node_modules/@openclaw/fs-safe/dist/archive-native.d.ts.map +0 -1
  872. package/node_modules/@openclaw/fs-safe/dist/archive-native.js +0 -97
  873. package/node_modules/@openclaw/fs-safe/dist/archive-options.d.ts +0 -23
  874. package/node_modules/@openclaw/fs-safe/dist/archive-options.d.ts.map +0 -1
  875. package/node_modules/@openclaw/fs-safe/dist/archive-parser-errors.d.ts.map +0 -1
  876. package/node_modules/@openclaw/fs-safe/dist/archive-plan.d.ts.map +0 -1
  877. package/node_modules/@openclaw/fs-safe/dist/archive-policy.d.ts +0 -22
  878. package/node_modules/@openclaw/fs-safe/dist/archive-policy.d.ts.map +0 -1
  879. package/node_modules/@openclaw/fs-safe/dist/archive-policy.js +0 -38
  880. package/node_modules/@openclaw/fs-safe/dist/archive-read.d.ts.map +0 -1
  881. package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts.map +0 -1
  882. package/node_modules/@openclaw/fs-safe/dist/archive-tar-inspect.d.ts +0 -7
  883. package/node_modules/@openclaw/fs-safe/dist/archive-tar-inspect.d.ts.map +0 -1
  884. package/node_modules/@openclaw/fs-safe/dist/archive-tar-inspect.js +0 -62
  885. package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.d.ts.map +0 -1
  886. package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.d.ts.map +0 -1
  887. package/node_modules/@openclaw/fs-safe/dist/archive-tar.d.ts +0 -19
  888. package/node_modules/@openclaw/fs-safe/dist/archive-tar.d.ts.map +0 -1
  889. package/node_modules/@openclaw/fs-safe/dist/archive-tar.js +0 -21
  890. package/node_modules/@openclaw/fs-safe/dist/archive-zip-admission.d.ts.map +0 -1
  891. package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.d.ts.map +0 -1
  892. package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.d.ts.map +0 -1
  893. package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.d.ts.map +0 -1
  894. package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.d.ts.map +0 -1
  895. package/node_modules/@openclaw/fs-safe/dist/archive-zip-loader.d.ts.map +0 -1
  896. package/node_modules/@openclaw/fs-safe/dist/archive-zip-manifest.d.ts.map +0 -1
  897. package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.d.ts.map +0 -1
  898. package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.d.ts.map +0 -1
  899. package/node_modules/@openclaw/fs-safe/dist/archive.d.ts.map +0 -1
  900. package/node_modules/@openclaw/fs-safe/dist/async-lock.d.ts.map +0 -1
  901. package/node_modules/@openclaw/fs-safe/dist/atomic.d.ts.map +0 -1
  902. package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.d.ts.map +0 -1
  903. package/node_modules/@openclaw/fs-safe/dist/bounded-read.d.ts.map +0 -1
  904. package/node_modules/@openclaw/fs-safe/dist/byte-budget.d.ts.map +0 -1
  905. package/node_modules/@openclaw/fs-safe/dist/clone-metadata.d.ts.map +0 -1
  906. package/node_modules/@openclaw/fs-safe/dist/config.d.ts.map +0 -1
  907. package/node_modules/@openclaw/fs-safe/dist/containment.d.ts.map +0 -1
  908. package/node_modules/@openclaw/fs-safe/dist/copy-file-input.d.ts.map +0 -1
  909. package/node_modules/@openclaw/fs-safe/dist/copy-policy.d.ts.map +0 -1
  910. package/node_modules/@openclaw/fs-safe/dist/copy-publication.d.ts.map +0 -1
  911. package/node_modules/@openclaw/fs-safe/dist/copy-tree-portable.d.ts.map +0 -1
  912. package/node_modules/@openclaw/fs-safe/dist/copy.d.ts.map +0 -1
  913. package/node_modules/@openclaw/fs-safe/dist/darwin-acl.d.ts +0 -4
  914. package/node_modules/@openclaw/fs-safe/dist/darwin-acl.d.ts.map +0 -1
  915. package/node_modules/@openclaw/fs-safe/dist/darwin-acl.js +0 -24
  916. package/node_modules/@openclaw/fs-safe/dist/deny-mutations.d.ts.map +0 -1
  917. package/node_modules/@openclaw/fs-safe/dist/device-path.d.ts.map +0 -1
  918. package/node_modules/@openclaw/fs-safe/dist/directory-durability.d.ts.map +0 -1
  919. package/node_modules/@openclaw/fs-safe/dist/directory-entry-path.d.ts.map +0 -1
  920. package/node_modules/@openclaw/fs-safe/dist/directory-guard.d.ts.map +0 -1
  921. package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.d.ts.map +0 -1
  922. package/node_modules/@openclaw/fs-safe/dist/directory-mode-owner.d.ts.map +0 -1
  923. package/node_modules/@openclaw/fs-safe/dist/durability.d.ts.map +0 -1
  924. package/node_modules/@openclaw/fs-safe/dist/effective-uid.d.ts.map +0 -1
  925. package/node_modules/@openclaw/fs-safe/dist/error-detail.d.ts.map +0 -1
  926. package/node_modules/@openclaw/fs-safe/dist/errors.d.ts.map +0 -1
  927. package/node_modules/@openclaw/fs-safe/dist/file-handle-transfer.d.ts.map +0 -1
  928. package/node_modules/@openclaw/fs-safe/dist/file-hash.d.ts.map +0 -1
  929. package/node_modules/@openclaw/fs-safe/dist/file-identity.d.ts.map +0 -1
  930. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.d.ts.map +0 -1
  931. package/node_modules/@openclaw/fs-safe/dist/file-lock.d.ts.map +0 -1
  932. package/node_modules/@openclaw/fs-safe/dist/file-observation.d.ts.map +0 -1
  933. package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.d.ts.map +0 -1
  934. package/node_modules/@openclaw/fs-safe/dist/file-store-copy-source.d.ts +0 -5
  935. package/node_modules/@openclaw/fs-safe/dist/file-store-copy-source.d.ts.map +0 -1
  936. package/node_modules/@openclaw/fs-safe/dist/file-store-copy-source.js +0 -31
  937. package/node_modules/@openclaw/fs-safe/dist/file-store-limit.d.ts +0 -2
  938. package/node_modules/@openclaw/fs-safe/dist/file-store-limit.d.ts.map +0 -1
  939. package/node_modules/@openclaw/fs-safe/dist/file-store-limit.js +0 -8
  940. package/node_modules/@openclaw/fs-safe/dist/file-store-path.d.ts +0 -3
  941. package/node_modules/@openclaw/fs-safe/dist/file-store-path.d.ts.map +0 -1
  942. package/node_modules/@openclaw/fs-safe/dist/file-store-path.js +0 -30
  943. package/node_modules/@openclaw/fs-safe/dist/file-store-prune.d.ts.map +0 -1
  944. package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.d.ts.map +0 -1
  945. package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.d.ts.map +0 -1
  946. package/node_modules/@openclaw/fs-safe/dist/file-store.d.ts.map +0 -1
  947. package/node_modules/@openclaw/fs-safe/dist/file-sync.d.ts.map +0 -1
  948. package/node_modules/@openclaw/fs-safe/dist/filename.d.ts.map +0 -1
  949. package/node_modules/@openclaw/fs-safe/dist/fs.d.ts.map +0 -1
  950. package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.d.ts.map +0 -1
  951. package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.d.ts.map +0 -1
  952. package/node_modules/@openclaw/fs-safe/dist/guest-dispatch-python.d.ts.map +0 -1
  953. package/node_modules/@openclaw/fs-safe/dist/guest-native-python.d.ts.map +0 -1
  954. package/node_modules/@openclaw/fs-safe/dist/guest.d.ts.map +0 -1
  955. package/node_modules/@openclaw/fs-safe/dist/home-dir.d.ts.map +0 -1
  956. package/node_modules/@openclaw/fs-safe/dist/index.d.ts.map +0 -1
  957. package/node_modules/@openclaw/fs-safe/dist/install-path.d.ts.map +0 -1
  958. package/node_modules/@openclaw/fs-safe/dist/json-document-store.d.ts.map +0 -1
  959. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.d.ts.map +0 -1
  960. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.d.ts.map +0 -1
  961. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-paths.d.ts +0 -11
  962. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-paths.d.ts.map +0 -1
  963. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-paths.js +0 -42
  964. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-read.d.ts.map +0 -1
  965. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.d.ts.map +0 -1
  966. package/node_modules/@openclaw/fs-safe/dist/json-store.d.ts.map +0 -1
  967. package/node_modules/@openclaw/fs-safe/dist/json-stringify.d.ts.map +0 -1
  968. package/node_modules/@openclaw/fs-safe/dist/json.d.ts.map +0 -1
  969. package/node_modules/@openclaw/fs-safe/dist/local-file-access.d.ts.map +0 -1
  970. package/node_modules/@openclaw/fs-safe/dist/local-file-descriptor.d.ts.map +0 -1
  971. package/node_modules/@openclaw/fs-safe/dist/local-roots.d.ts.map +0 -1
  972. package/node_modules/@openclaw/fs-safe/dist/lock-config.d.ts.map +0 -1
  973. package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.d.ts.map +0 -1
  974. package/node_modules/@openclaw/fs-safe/dist/move-path-stage.d.ts.map +0 -1
  975. package/node_modules/@openclaw/fs-safe/dist/move-path.d.ts.map +0 -1
  976. package/node_modules/@openclaw/fs-safe/dist/mutation-authority.d.ts.map +0 -1
  977. package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts.map +0 -1
  978. package/node_modules/@openclaw/fs-safe/dist/native-config.d.ts.map +0 -1
  979. package/node_modules/@openclaw/fs-safe/dist/native-directory-observation.d.ts.map +0 -1
  980. package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts.map +0 -1
  981. package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.d.ts.map +0 -1
  982. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.d.ts.map +0 -1
  983. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.d.ts.map +0 -1
  984. package/node_modules/@openclaw/fs-safe/dist/native-staged-file.d.ts.map +0 -1
  985. package/node_modules/@openclaw/fs-safe/dist/native.d.ts.map +0 -1
  986. package/node_modules/@openclaw/fs-safe/dist/opened-file-failure.d.ts.map +0 -1
  987. package/node_modules/@openclaw/fs-safe/dist/opened-realpath.d.ts.map +0 -1
  988. package/node_modules/@openclaw/fs-safe/dist/output.d.ts.map +0 -1
  989. package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.d.ts.map +0 -1
  990. package/node_modules/@openclaw/fs-safe/dist/owner-dacl.d.ts.map +0 -1
  991. package/node_modules/@openclaw/fs-safe/dist/path-case.d.ts.map +0 -1
  992. package/node_modules/@openclaw/fs-safe/dist/path-policy.d.ts.map +0 -1
  993. package/node_modules/@openclaw/fs-safe/dist/path-prefix.d.ts.map +0 -1
  994. package/node_modules/@openclaw/fs-safe/dist/path-scope-lexical.d.ts.map +0 -1
  995. package/node_modules/@openclaw/fs-safe/dist/path-segment-route.d.ts.map +0 -1
  996. package/node_modules/@openclaw/fs-safe/dist/path-suffix-aliases.d.ts.map +0 -1
  997. package/node_modules/@openclaw/fs-safe/dist/path.d.ts.map +0 -1
  998. package/node_modules/@openclaw/fs-safe/dist/permission-exec.d.ts.map +0 -1
  999. package/node_modules/@openclaw/fs-safe/dist/permissions-public.d.ts.map +0 -1
  1000. package/node_modules/@openclaw/fs-safe/dist/permissions-windows.d.ts.map +0 -1
  1001. package/node_modules/@openclaw/fs-safe/dist/permissions.d.ts.map +0 -1
  1002. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.d.ts.map +0 -1
  1003. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-observation.d.ts.map +0 -1
  1004. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-shared-route.d.ts.map +0 -1
  1005. package/node_modules/@openclaw/fs-safe/dist/pinned-open.d.ts.map +0 -1
  1006. package/node_modules/@openclaw/fs-safe/dist/pinned-operation.d.ts.map +0 -1
  1007. package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.d.ts.map +0 -1
  1008. package/node_modules/@openclaw/fs-safe/dist/pinned-write.d.ts.map +0 -1
  1009. package/node_modules/@openclaw/fs-safe/dist/positional-read.d.ts.map +0 -1
  1010. package/node_modules/@openclaw/fs-safe/dist/private-directory.d.ts.map +0 -1
  1011. package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff.d.ts.map +0 -1
  1012. package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.d.ts.map +0 -1
  1013. package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.d.ts.map +0 -1
  1014. package/node_modules/@openclaw/fs-safe/dist/publish-file-failure.d.ts.map +0 -1
  1015. package/node_modules/@openclaw/fs-safe/dist/publish-file.d.ts.map +0 -1
  1016. package/node_modules/@openclaw/fs-safe/dist/read-open-flags.d.ts.map +0 -1
  1017. package/node_modules/@openclaw/fs-safe/dist/read-opened-file.d.ts.map +0 -1
  1018. package/node_modules/@openclaw/fs-safe/dist/realpath.d.ts.map +0 -1
  1019. package/node_modules/@openclaw/fs-safe/dist/recursive-mkdir-path.d.ts.map +0 -1
  1020. package/node_modules/@openclaw/fs-safe/dist/regular-file.d.ts.map +0 -1
  1021. package/node_modules/@openclaw/fs-safe/dist/replace-directory.d.ts.map +0 -1
  1022. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.d.ts.map +0 -1
  1023. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.d.ts.map +0 -1
  1024. package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts.map +0 -1
  1025. package/node_modules/@openclaw/fs-safe/dist/replace-file-mode.d.ts.map +0 -1
  1026. package/node_modules/@openclaw/fs-safe/dist/replace-file-rename-policy.d.ts.map +0 -1
  1027. package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.d.ts.map +0 -1
  1028. package/node_modules/@openclaw/fs-safe/dist/replace-file.d.ts.map +0 -1
  1029. package/node_modules/@openclaw/fs-safe/dist/root-boundary.d.ts.map +0 -1
  1030. package/node_modules/@openclaw/fs-safe/dist/root-context.d.ts.map +0 -1
  1031. package/node_modules/@openclaw/fs-safe/dist/root-create-input.d.ts.map +0 -1
  1032. package/node_modules/@openclaw/fs-safe/dist/root-directory-creation.d.ts.map +0 -1
  1033. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts.map +0 -1
  1034. package/node_modules/@openclaw/fs-safe/dist/root-directory.d.ts.map +0 -1
  1035. package/node_modules/@openclaw/fs-safe/dist/root-entries.d.ts.map +0 -1
  1036. package/node_modules/@openclaw/fs-safe/dist/root-errors.d.ts.map +0 -1
  1037. package/node_modules/@openclaw/fs-safe/dist/root-file-final-admission.d.ts.map +0 -1
  1038. package/node_modules/@openclaw/fs-safe/dist/root-file.d.ts.map +0 -1
  1039. package/node_modules/@openclaw/fs-safe/dist/root-impl.d.ts.map +0 -1
  1040. package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.d.ts.map +0 -1
  1041. package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.d.ts.map +0 -1
  1042. package/node_modules/@openclaw/fs-safe/dist/root-observed-path.d.ts.map +0 -1
  1043. package/node_modules/@openclaw/fs-safe/dist/root-options.d.ts.map +0 -1
  1044. package/node_modules/@openclaw/fs-safe/dist/root-path-errors.d.ts.map +0 -1
  1045. package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts.map +0 -1
  1046. package/node_modules/@openclaw/fs-safe/dist/root-path-observation.d.ts.map +0 -1
  1047. package/node_modules/@openclaw/fs-safe/dist/root-path-stat.d.ts.map +0 -1
  1048. package/node_modules/@openclaw/fs-safe/dist/root-path-symlink.d.ts +0 -7
  1049. package/node_modules/@openclaw/fs-safe/dist/root-path-symlink.d.ts.map +0 -1
  1050. package/node_modules/@openclaw/fs-safe/dist/root-path-symlink.js +0 -55
  1051. package/node_modules/@openclaw/fs-safe/dist/root-path.d.ts.map +0 -1
  1052. package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.d.ts.map +0 -1
  1053. package/node_modules/@openclaw/fs-safe/dist/root-paths.d.ts.map +0 -1
  1054. package/node_modules/@openclaw/fs-safe/dist/root-read-admission.d.ts.map +0 -1
  1055. package/node_modules/@openclaw/fs-safe/dist/root-remove-identity.d.ts.map +0 -1
  1056. package/node_modules/@openclaw/fs-safe/dist/root-remove-receipt.d.ts.map +0 -1
  1057. package/node_modules/@openclaw/fs-safe/dist/root-remove.d.ts.map +0 -1
  1058. package/node_modules/@openclaw/fs-safe/dist/root-symlink-policy.d.ts.map +0 -1
  1059. package/node_modules/@openclaw/fs-safe/dist/root-walk.d.ts.map +0 -1
  1060. package/node_modules/@openclaw/fs-safe/dist/root-write-admission.d.ts.map +0 -1
  1061. package/node_modules/@openclaw/fs-safe/dist/root-write-compatibility.d.ts.map +0 -1
  1062. package/node_modules/@openclaw/fs-safe/dist/root-write-complete-parent.d.ts.map +0 -1
  1063. package/node_modules/@openclaw/fs-safe/dist/root-write-mode.d.ts.map +0 -1
  1064. package/node_modules/@openclaw/fs-safe/dist/root-write-publication.d.ts.map +0 -1
  1065. package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts.map +0 -1
  1066. package/node_modules/@openclaw/fs-safe/dist/root.d.ts.map +0 -1
  1067. package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.d.ts.map +0 -1
  1068. package/node_modules/@openclaw/fs-safe/dist/secret-file.d.ts.map +0 -1
  1069. package/node_modules/@openclaw/fs-safe/dist/secret-read-async.d.ts.map +0 -1
  1070. package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.d.ts.map +0 -1
  1071. package/node_modules/@openclaw/fs-safe/dist/secret.d.ts.map +0 -1
  1072. package/node_modules/@openclaw/fs-safe/dist/secure-file-windows.d.ts.map +0 -1
  1073. package/node_modules/@openclaw/fs-safe/dist/secure-file.d.ts.map +0 -1
  1074. package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.d.ts.map +0 -1
  1075. package/node_modules/@openclaw/fs-safe/dist/secure-temp-repair.d.ts.map +0 -1
  1076. package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.d.ts.map +0 -1
  1077. package/node_modules/@openclaw/fs-safe/dist/sibling-temp.d.ts.map +0 -1
  1078. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.d.ts.map +0 -1
  1079. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.d.ts.map +0 -1
  1080. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.d.ts.map +0 -1
  1081. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.d.ts.map +0 -1
  1082. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.d.ts.map +0 -1
  1083. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-types.d.ts.map +0 -1
  1084. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.d.ts.map +0 -1
  1085. package/node_modules/@openclaw/fs-safe/dist/staged-directory.d.ts.map +0 -1
  1086. package/node_modules/@openclaw/fs-safe/dist/staged-file-types.d.ts.map +0 -1
  1087. package/node_modules/@openclaw/fs-safe/dist/standalone-publication-path.d.ts +0 -2
  1088. package/node_modules/@openclaw/fs-safe/dist/standalone-publication-path.d.ts.map +0 -1
  1089. package/node_modules/@openclaw/fs-safe/dist/standalone-publication-path.js +0 -6
  1090. package/node_modules/@openclaw/fs-safe/dist/stat-observation.d.ts.map +0 -1
  1091. package/node_modules/@openclaw/fs-safe/dist/store.d.ts.map +0 -1
  1092. package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.d.ts.map +0 -1
  1093. package/node_modules/@openclaw/fs-safe/dist/string-coerce.d.ts.map +0 -1
  1094. package/node_modules/@openclaw/fs-safe/dist/suppressed-error.d.ts.map +0 -1
  1095. package/node_modules/@openclaw/fs-safe/dist/symlink-parents.d.ts.map +0 -1
  1096. package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.d.ts.map +0 -1
  1097. package/node_modules/@openclaw/fs-safe/dist/temp-target.d.ts.map +0 -1
  1098. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.d.ts.map +0 -1
  1099. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts.map +0 -1
  1100. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.d.ts.map +0 -1
  1101. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-identity.d.ts +0 -15
  1102. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-identity.d.ts.map +0 -1
  1103. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-identity.js +0 -41
  1104. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.d.ts.map +0 -1
  1105. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-permissions.d.ts +0 -4
  1106. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-permissions.d.ts.map +0 -1
  1107. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-permissions.js +0 -32
  1108. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-types.d.ts.map +0 -1
  1109. package/node_modules/@openclaw/fs-safe/dist/temp.d.ts.map +0 -1
  1110. package/node_modules/@openclaw/fs-safe/dist/test-hooks.d.ts.map +0 -1
  1111. package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts.map +0 -1
  1112. package/node_modules/@openclaw/fs-safe/dist/timing.d.ts.map +0 -1
  1113. package/node_modules/@openclaw/fs-safe/dist/trash.d.ts.map +0 -1
  1114. package/node_modules/@openclaw/fs-safe/dist/types.d.ts.map +0 -1
  1115. package/node_modules/@openclaw/fs-safe/dist/unicode-path.d.ts.map +0 -1
  1116. package/node_modules/@openclaw/fs-safe/dist/walk.d.ts.map +0 -1
  1117. package/node_modules/@openclaw/fs-safe/dist/windows-command.d.ts.map +0 -1
  1118. package/node_modules/@openclaw/fs-safe/dist/windows-owner.d.ts.map +0 -1
  1119. package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.d.ts.map +0 -1
  1120. package/node_modules/@openclaw/fs-safe/dist/write-file-handle.d.ts.map +0 -1
  1121. package/node_modules/@openclaw/fs-safe/dist/write-open-flags.d.ts.map +0 -1
  1122. package/node_modules/@openclaw/fs-safe/dist/write-queue.d.ts.map +0 -1
  1123. /package/node_modules/@openclaw/fs-safe/dist/{archive-options.js → root-public-types.js} +0 -0
@@ -56,6 +56,7 @@ import fs from "node:fs/promises";
56
56
  import path from "node:path";
57
57
  import { normalizeMaxBytes } from "./byte-budget.js";
58
58
  import { assertCopySourceCurrent, resolveFileCopyCloneMode } from "./copy-file-input.js";
59
+ import { assertPrivateFileCreationAvailable, resolveCreationPermissions } from "./creation-boundary.js";
59
60
  import { assertAsyncDirectoryGuard, assertSyncDirectoryGuard, createAsyncDirectoryGuard, createNearestExistingDirectoryGuard } from "./directory-guard.js";
60
61
  import { FsSafeError } from "./errors.js";
61
62
  import { syncDirectoryBestEffort } from "./directory-durability.js";
@@ -67,23 +68,25 @@ import { openedPathResolutionError, recordExclusiveCreateFailure, recordOpenedFi
67
68
  import { runPinnedWriteHelper, runPinnedWriteWithRenamePolicy } from "./pinned-write.js";
68
69
  import { preparePinnedWriteMutationAdmission, snapshotPinnedMutationPolicy } from "./pinned-mutation-admission.js";
69
70
  import { getNativeBinding } from "./native.js";
70
- import { validatePinnedOperationPayload } from "./pinned-operation.js";
71
+ import { validatePinnedRelativePath } from "./pinned-operation.js";
71
72
  import { PATH_ALIAS_POLICIES } from "./path-policy.js";
72
73
  import { assertNoNulPathInput, hasNodeErrorCode, isNotFoundPathError, isSymlinkOpenError, } from "./path.js";
73
74
  import { readOpenedFileSafely } from "./read-opened-file.js";
74
- import { cleanupPinnedFilePath, removePathIfIdentityUnchanged } from "./replace-file-temp-owner.js";
75
+ import { cleanupPinnedFilePath } from "./file-cleanup.js";
76
+ import { sameFileIdentity } from "./file-identity.js";
77
+ import { removePathIfIdentityUnchanged } from "./replace-file-temp-owner.js";
75
78
  import { realpathSync } from "./realpath.js";
76
79
  import { mkdirPathFallback, prepareRootWriteTarget, tryMkdirAtExactParent } from "./root-directory-creation.js";
77
80
  import { isNonRegularWriteOpenError, resolveNonblockingWriteFlag } from "./write-open-flags.js";
78
- import { resolveRootPath, resolveRootPathForRemoval } from "./root-path.js";
81
+ import { resolveRootPath, resolveRootPathSync, resolveRootPathForRemoval } from "./root-path.js";
79
82
  import { RemovalPathReceipts } from "./root-remove-receipt.js";
80
83
  import { admitPathInsideRoot } from "./root-boundary.js";
81
84
  import { listDirectoryPath, openRootDirectoryListing } from "./root-directory-list.js";
82
85
  import { statResolvedPathInRoot } from "./root-path-stat.js";
83
86
  import { entriesInRoot } from "./root-entries.js";
84
87
  import { assertMoveMutationAllowed } from "./root-move-preflight.js";
85
- import { assertRootIdentityCurrent, assertValidRootDestinationPath, assertValidRootRelativePath, ensureTrailingSep, expandRelativePathWithHome, resolvePathInRoot, resolveRootContext, rootRelativeReadPath, } from "./root-context.js";
86
- import { fileNotFoundError, hardlinkedPathNotAllowedError, isAlreadyExistsError, normalizePinnedPathError, normalizePinnedWriteError, outsideWorkspaceError, } from "./root-errors.js";
88
+ import { assertRootIdentityCurrent, assertRootIdentityCurrentSync, assertValidRootDestinationPath, assertValidRootRelativePath, ensureTrailingSep, expandRelativePathWithHome, resolvePathInRoot, resolveRootContext, rootRelativeReadPath, } from "./root-context.js";
89
+ import { errorCauseOptions, fileNotFoundError, hardlinkedPathNotAllowedError, isAlreadyExistsError, normalizePinnedPathError, normalizePinnedWriteError, outsideWorkspaceError, } from "./root-errors.js";
87
90
  import { getFsSafeTestHooks } from "./test-hooks.js";
88
91
  import { stringifyJsonDocument } from "./json-stringify.js";
89
92
  import { walkRoot } from "./root-walk.js";
@@ -91,19 +94,21 @@ import { registerTempPathForExit } from "./temp-cleanup.js";
91
94
  import { removePathInRootFallback, validateRemoveOptions } from "./root-remove.js";
92
95
  import { serializePathWrite } from "./write-queue.js";
93
96
  import { verifyAtomicWriteResult } from "./root-write-verification.js";
94
- import { assertRootWritePathSelectionSync, assertRootWriteSelectionSync, createRootWriteSelectionForFd, prepareGuardedRootWritePathSelection, resolveGuardedWritePathInRoot, resolveGuardedWriteTargetInRoot, resolvePinnedWriteTargetInRoot, refreshRetainedRootWriteAdmission, refreshRootWritePathSelection, retainRootWriteSelection, takeRootWriteSelection, } from "./root-write-admission.js";
97
+ import { assertRootWritePathSelectionSync, assertRootWriteSelectionSync, createRootWriteSelectionForFd, prepareGuardedRootWritePathSelection, resolveGuardedWritePathInRoot, resolveGuardedWriteTargetInRoot, resolvePinnedWriteTargetInRoot, refreshRetainedRootWriteAdmission, refreshRootWritePathSelection, } from "./root-write-admission.js";
95
98
  import { prepareSharedRootWriteTarget } from "./root-write-complete-parent.js";
96
99
  import { finishRootFallbackWrite } from "./root-write-publication.js";
97
- import { assertRootFallbackWritePath, withRootFallbackCompatibilityLock } from "./root-write-compatibility.js";
100
+ import { withRootFallbackCompatibilityLock } from "./root-write-compatibility.js";
101
+ import { assertRootFallbackWritePath } from "./root-write-lock-binding.js";
98
102
  import { inspectFileIdentity, inspectFileIdentitySync } from "./strict-file-identity.js";
99
- import { movePathNoReplaceNative } from "./root-move-noreplace.js";
103
+ import { admitMoveSourceStat, movePathNoReplaceNative } from "./root-move-noreplace.js";
100
104
  import { admitRootReadHandle, inspectOpenedPathIdentitySync } from "./root-read-admission.js";
101
- import { createCopyPublicationObserver, onCopyPublication } from "./copy-publication.js";
105
+ import { createCopyPublicationObserver, onCopyPublication, onCopySourceAdmission } from "./copy-publication.js";
102
106
  import { writeAllToFile } from "./write-file-handle.js";
103
107
  import { createInputOptions, rethrowCreateInputError, rootWriteInput } from "./root-create-input.js";
104
108
  import { assertFinalSymlinkRejected, mutationSymlinkResolution, readSymlinkResolution } from "./root-symlink-policy.js";
105
109
  import { assertNoWindowsPathAlias, resolvePathPreservingWindowsRoot } from "./windows-path-alias.js";
106
110
  import { resolvePinnedObservedPathInRoot } from "./root-observed-path.js";
111
+ import { registerFileLockSyncRootAdapter } from "./file-lock-sync-root.js";
107
112
  import { mergeReadOptions, readDefaults, } from "./root-options.js";
108
113
  import { composeMutationAssertions, MutationAuthorityError, rethrowMutationAuthorityError } from "./mutation-authority.js";
109
114
  export { DEFAULT_ROOT_MAX_BYTES } from "./root-options.js";
@@ -182,28 +187,18 @@ async function openVerifiedLocalFile(filePath, options) {
182
187
  }
183
188
  }
184
189
  export class RootHandle {
185
- rootGuard;
186
- rootIdentity;
190
+ context;
187
191
  rootDir;
188
192
  rootReal;
189
193
  rootWithSep;
190
194
  defaults;
191
195
  constructor(context, defaults = {}) {
192
- this.rootGuard = context.rootGuard;
193
- this.rootIdentity = context.rootIdentity;
196
+ this.context = context;
194
197
  this.rootDir = context.rootDir;
195
198
  this.rootReal = context.rootReal;
196
199
  this.rootWithSep = context.rootWithSep;
197
200
  this.defaults = defaults;
198
- }
199
- get context() {
200
- return {
201
- rootDir: this.rootDir,
202
- rootGuard: this.rootGuard,
203
- rootIdentity: this.rootIdentity,
204
- rootReal: this.rootReal,
205
- rootWithSep: this.rootWithSep,
206
- };
201
+ registerFileLockSyncRootAdapter(this, context, defaults);
207
202
  }
208
203
  mutationOptions(options) {
209
204
  return {
@@ -219,9 +214,9 @@ export class RootHandle {
219
214
  }
220
215
  async open(relativePath, options = {}) {
221
216
  return await openFileInRoot(this.context, {
222
- relativePath,
223
217
  ...readDefaults(this.defaults),
224
218
  ...options,
219
+ relativePath,
225
220
  });
226
221
  }
227
222
  async read(relativePath, options = {}) {
@@ -241,9 +236,11 @@ export class RootHandle {
241
236
  return JSON.parse(await this.readText(relativePath, options));
242
237
  }
243
238
  async readAbsolute(filePath, options = {}) {
244
- return await readPathInRoot(this.context, {
245
- filePath,
246
- ...mergeReadOptions(this.defaults, options),
239
+ const context = this.context;
240
+ const readOptions = mergeReadOptions(this.defaults, options);
241
+ return await readFileInRoot(context, {
242
+ relativePath: rootRelativeReadPath(context, filePath),
243
+ ...readOptions,
247
244
  });
248
245
  }
249
246
  reader(options = {}) {
@@ -255,10 +252,11 @@ export class RootHandle {
255
252
  assertValidRootDestinationPath(relativePath);
256
253
  const writeMode = options.writeMode ?? "replace";
257
254
  const target = await openWritableFileInRoot(this.context, {
258
- relativePath,
259
255
  mkdir: this.defaults.mkdir,
260
256
  mode: this.defaults.mode,
261
257
  ...this.mutationOptions(options),
258
+ relativePath,
259
+ expectedWritePath: undefined,
262
260
  append: writeMode === "append",
263
261
  truncateExisting: writeMode === "replace",
264
262
  }).catch(rethrowMutationAuthorityError);
@@ -267,11 +265,11 @@ export class RootHandle {
267
265
  async append(relativePath, data, options = {}) {
268
266
  assertValidRootDestinationPath(relativePath);
269
267
  await appendFileInRoot(this.context, {
270
- relativePath,
271
- data,
272
268
  mkdir: this.defaults.mkdir,
273
269
  mode: this.defaults.mode,
274
270
  ...this.mutationOptions(options),
271
+ relativePath,
272
+ data,
275
273
  durable: options.durable ?? this.defaults.durable ?? true,
276
274
  }).catch(rethrowMutationAuthorityError);
277
275
  }
@@ -280,45 +278,51 @@ export class RootHandle {
280
278
  validateRemoveOptions(options);
281
279
  options.signal?.throwIfAborted();
282
280
  await removePathInRoot(this.context, {
283
- relativePath,
284
281
  ...this.mutationOptions(options),
282
+ relativePath,
285
283
  }).catch(rethrowMutationAuthorityError);
286
284
  }
287
285
  async mkdir(relativePath, options = {}) {
288
286
  assertValidRootDestinationPath(relativePath);
289
287
  await mkdirPathInRoot(this.context, {
290
- relativePath,
291
288
  ...this.mutationOptions(options),
289
+ relativePath,
290
+ allowRoot: false,
292
291
  }).catch(rethrowMutationAuthorityError);
293
292
  }
294
293
  async ensureRoot(options = {}) {
295
294
  await mkdirPathInRoot(this.context, {
295
+ ...this.mutationOptions(options),
296
296
  relativePath: "",
297
297
  allowRoot: true,
298
- ...this.mutationOptions(options),
299
298
  }).catch(rethrowMutationAuthorityError);
300
299
  }
301
300
  async write(relativePath, data, options = {}) {
302
301
  assertValidRootDestinationPath(relativePath);
303
302
  await writeFileInRoot(this.context, {
304
- relativePath,
305
- data,
306
303
  mkdir: this.defaults.mkdir,
307
304
  mode: this.defaults.mode,
308
305
  renameIdentity: this.defaults.renameIdentity,
309
306
  ...this.mutationOptions(options),
307
+ atomic: undefined,
308
+ private: undefined,
309
+ strictFileSync: undefined,
310
+ relativePath,
311
+ data,
310
312
  durable: options.durable ?? this.defaults.durable ?? true,
311
313
  }).catch(rethrowMutationAuthorityError);
312
314
  }
313
315
  async create(relativePath, data, options = {}) {
314
316
  assertValidRootDestinationPath(relativePath);
317
+ const durable = options.durable ?? this.defaults.durable ?? true;
315
318
  await writeFileInRoot(this.context, {
316
- relativePath,
317
- data,
318
319
  mkdir: this.defaults.mkdir,
319
320
  mode: this.defaults.mode,
320
321
  ...this.mutationOptions(createInputOptions(data, options, this.defaults.maxBytes)),
321
- durable: options.durable ?? this.defaults.durable ?? true,
322
+ relativePath,
323
+ data,
324
+ durable: durable !== false,
325
+ strictFileSync: durable === "file",
322
326
  overwrite: false,
323
327
  }).catch(rethrowMutationAuthorityError).catch(rethrowCreateInputError);
324
328
  }
@@ -336,15 +340,17 @@ export class RootHandle {
336
340
  options.signal?.throwIfAborted();
337
341
  assertValidRootDestinationPath(relativePath);
338
342
  const { maxBytes, ...copyOptions } = this.mutationOptions(options);
343
+ const copySource = typeof source === "string" ? source : { root: source.root, relativePath: source.relativePath };
339
344
  await copyFileInRoot(this.context, {
340
- source: typeof source === "string" ? source : { root: source.root, relativePath: source.relativePath },
341
- relativePath,
342
345
  maxBytes: normalizeMaxBytes(maxBytes, { defaultValue: this.defaults.maxBytes }),
343
346
  mkdir: this.defaults.mkdir,
344
347
  ...copyOptions,
348
+ source: copySource,
349
+ relativePath,
345
350
  mode: options.mode ?? this.defaults.mode,
346
351
  durable: options.durable ?? this.defaults.durable ?? true,
347
352
  verifyPublished: options[onCopyPublication],
353
+ admitSource: options[onCopySourceAdmission],
348
354
  }).catch(rethrowMutationAuthorityError);
349
355
  }
350
356
  async exists(relativePath) {
@@ -361,19 +367,22 @@ export class RootHandle {
361
367
  }
362
368
  async stat(relativePath) {
363
369
  assertValidRootRelativePath(relativePath);
364
- validatePinnedOperationPayload({ relativePath });
370
+ validatePinnedRelativePath(relativePath);
365
371
  return await statPathFallback(this.context, relativePath);
366
372
  }
367
373
  async list(relativePath, options = {}) {
368
374
  assertValidRootRelativePath(relativePath);
369
- validatePinnedOperationPayload({ relativePath });
375
+ validatePinnedRelativePath(relativePath);
370
376
  return await listPathFallback(this.context, relativePath, options.withFileTypes === true);
371
377
  }
372
378
  async move(fromRelative, toRelative, options = {}) {
373
379
  assertValidRootRelativePath(fromRelative);
374
380
  assertValidRootDestinationPath(toRelative);
375
- validatePinnedOperationPayload({ from: fromRelative, to: toRelative });
376
- const { denyMutations, assertBeforeMutation, mutationSymlinks } = this.mutationOptions(options);
381
+ validatePinnedRelativePath(fromRelative);
382
+ validatePinnedRelativePath(toRelative);
383
+ const mutationOptions = this.mutationOptions(options);
384
+ const { assertBeforeMutation } = mutationOptions;
385
+ const { denyMutations, mutationSymlinks } = snapshotPinnedMutationPolicy(mutationOptions.denyMutations, mutationOptions.mutationSymlinks) ?? {};
377
386
  const overwrite = options.overwrite ?? false;
378
387
  await assertMoveMutationAllowed(this.context, {
379
388
  fromRelative,
@@ -399,10 +408,10 @@ export class RootHandle {
399
408
  walk(relativePath, options) {
400
409
  assertValidRootRelativePath(relativePath);
401
410
  return walkRoot({
402
- rootReal: this.rootReal,
411
+ rootReal: this.context.rootReal,
403
412
  stat: relative => this.stat(relative),
404
413
  list: async (relative, listingOptions) => {
405
- validatePinnedOperationPayload({ relativePath: relative });
414
+ validatePinnedRelativePath(relative);
406
415
  const resolved = await resolvePinnedPathInRoot(this.context, { relativePath: relative, allowRoot: true });
407
416
  return await openRootDirectoryListing(this.context, resolved.resolved, listingOptions);
408
417
  },
@@ -458,15 +467,6 @@ async function readFileInRoot(root, params) {
458
467
  await opened.handle.close().catch(() => { });
459
468
  }
460
469
  }
461
- async function readPathInRoot(root, params) {
462
- const relativePath = rootRelativeReadPath(root, params.filePath);
463
- return await readFileInRoot(root, {
464
- relativePath,
465
- hardlinks: params.hardlinks,
466
- maxBytes: params.maxBytes,
467
- symlinks: params.symlinks,
468
- });
469
- }
470
470
  export async function readLocalFileSafely(params) {
471
471
  const maxBytes = normalizeMaxBytes(params.maxBytes);
472
472
  const opened = await openLocalFileSafely({ filePath: params.filePath });
@@ -492,7 +492,7 @@ function buildAtomicWriteTempPath(targetPath) {
492
492
  function rootWriteQueueKey(root, relativePath) {
493
493
  return `${root.rootReal}\0${relativePath}`;
494
494
  }
495
- async function openWritableFileInRoot(root, params) {
495
+ async function openWritableFileInRoot(root, params, options) {
496
496
  const guardedTarget = params.denyMutations === undefined && params.mutationSymlinks === undefined
497
497
  ? undefined
498
498
  : await resolveGuardedWriteTargetInRoot(root, {
@@ -507,7 +507,6 @@ async function openWritableFileInRoot(root, params) {
507
507
  relativePath: params.relativePath, guardedTarget, mkdir: params.mkdir,
508
508
  assertBeforeMutation: params.assertBeforeMutation,
509
509
  }) : undefined;
510
- const mutationAdmission = prepared?.mutationAdmission;
511
510
  const preparedParent = prepared?.preparedParent;
512
511
  let ioPath = prepared?.targetPath ?? (params.mkdir === false ? resolved :
513
512
  await prepareRootWriteTarget(root, resolved, params.assertBeforeMutation));
@@ -556,6 +555,17 @@ async function openWritableFileInRoot(root, params) {
556
555
  if (!isNotFoundPathError(err)) {
557
556
  throw err;
558
557
  }
558
+ if (options?.createIfMissing === false) {
559
+ const parentGuard = writePathSelection?.parentGuard ??
560
+ await createAsyncDirectoryGuard(path.dirname(ioPath), { bigint: true });
561
+ assertRootIdentityCurrentSync(root);
562
+ if (!admitPathInsideRoot({
563
+ rootPath: root.rootReal, candidatePath: parentGuard.realPath, rootIdentity: root.rootIdentity,
564
+ }))
565
+ throw outsideWorkspaceError();
566
+ assertSyncDirectoryGuard(parentGuard);
567
+ return { missing: true, targetPath: ioPath, parentGuard, writeSelection: writePathSelection };
568
+ }
559
569
  if (writePathSelection)
560
570
  await refreshRootWritePathSelection(writePathSelection);
561
571
  params.assertBeforeMutation?.();
@@ -673,9 +683,7 @@ async function openWritableFileInRoot(root, params) {
673
683
  stat,
674
684
  [Symbol.asyncDispose]: () => handle.close().catch(() => undefined),
675
685
  };
676
- if (writeSelection)
677
- retainRootWriteSelection(result, writeSelection);
678
- return { opened: result, identity };
686
+ return { opened: result, identity, writeSelection };
679
687
  }
680
688
  catch (err) {
681
689
  const cleanupCreatedPath = createdForWrite && err instanceof FsSafeError;
@@ -715,8 +723,9 @@ async function appendFileInRoot(root, params) {
715
723
  if (params.prependNewlineIfNeeded === true &&
716
724
  !target.createdForWrite &&
717
725
  target.stat.size > 0 &&
726
+ params.data.length > 0 &&
718
727
  ((typeof params.data === "string" && !params.data.startsWith("\n")) ||
719
- (Buffer.isBuffer(params.data) && params.data.length > 0 && params.data[0] !== 0x0a))) {
728
+ (Buffer.isBuffer(params.data) && params.data[0] !== 0x0a))) {
720
729
  const newline = Buffer.from("\n", typeof params.data === "string" ? params.encoding : "utf8");
721
730
  const tail = Buffer.alloc(newline.length);
722
731
  const { bytesRead } = await target.handle.read(tail, 0, tail.length, Math.max(0, target.stat.size - tail.length));
@@ -757,7 +766,7 @@ async function appendFileInRoot(root, params) {
757
766
  }
758
767
  }
759
768
  async function removePathInRoot(root, params) {
760
- validatePinnedOperationPayload({ relativePath: params.relativePath });
769
+ validatePinnedRelativePath(params.relativePath);
761
770
  const removalReceipts = params.recursive ? undefined : new RemovalPathReceipts();
762
771
  const resolved = await resolvePinnedPathInRoot(root, {
763
772
  relativePath: params.relativePath,
@@ -776,20 +785,16 @@ async function removePathInRoot(root, params) {
776
785
  }
777
786
  }
778
787
  async function mkdirPathInRoot(root, params) {
779
- validatePinnedOperationPayload({ relativePath: params.relativePath });
788
+ const privateMode = resolveCreationPermissions(params, true).private;
789
+ validatePinnedRelativePath(params.relativePath);
780
790
  const policy = params.denyMutations === undefined && params.mutationSymlinks === undefined
781
791
  ? undefined
782
792
  : snapshotPinnedMutationPolicy(params.denyMutations, params.mutationSymlinks);
793
+ const resolution = { relativePath: params.relativePath, allowRoot: params.allowRoot, ...policy };
783
794
  const resolveCurrent = policy
784
- ? async () => await resolvePinnedPathInRoot(root, {
785
- ...params,
786
- denyMutations: policy.denyMutations,
787
- mutationSymlinks: policy.mutationSymlinks,
788
- })
795
+ ? async () => await resolvePinnedPathInRoot(root, resolution)
789
796
  : undefined;
790
- const resolved = resolveCurrent
791
- ? await resolveCurrent()
792
- : await resolvePinnedPathInRoot(root, params);
797
+ const resolved = await resolvePinnedPathInRoot(root, resolution);
793
798
  const prepared = policy && resolved.relativePosix !== ""
794
799
  ? await preparePinnedWriteMutationAdmission({
795
800
  rootReal: resolved.rootReal,
@@ -808,19 +813,23 @@ async function mkdirPathInRoot(root, params) {
808
813
  await getFsSafeTestHooks()?.beforePinnedWriteParentAdmission?.(resolved.resolved);
809
814
  }
810
815
  try {
811
- if (prepared?.mutationAdmission && params.assertBeforeMutation === undefined &&
816
+ if (!privateMode && prepared?.mutationAdmission && params.assertBeforeMutation === undefined &&
812
817
  await tryMkdirAtExactParent(root, resolved.resolved, prepared.mutationAdmission))
813
818
  return;
814
- await mkdirPathFallback(root, resolved, params.assertBeforeMutation, policy?.mutationSymlinks !== undefined, prepared?.mutationAdmission);
819
+ await mkdirPathFallback(root, resolved, params.assertBeforeMutation, policy?.mutationSymlinks !== undefined, prepared?.mutationAdmission, privateMode);
815
820
  }
816
821
  catch (error) {
817
822
  throw normalizePinnedPathError(error);
818
823
  }
819
824
  }
820
825
  async function writeFileInRoot(root, params) {
826
+ if (params.private !== undefined) {
827
+ const permissions = resolveCreationPermissions(params, false);
828
+ params = { ...params, private: permissions.private, mode: permissions.mode };
829
+ }
821
830
  const input = rootWriteInput(params);
822
831
  await serializePathWrite(rootWriteQueueKey(root, params.relativePath), async () => {
823
- if (input.kind === "buffer" && process.platform === "win32" &&
832
+ if (!params.private && input.kind === "buffer" && !input.stageBeforePublish && process.platform === "win32" &&
824
833
  (params.renameIdentity === "verify-content-with-lock" || !getNativeBinding())) {
825
834
  await writeFileFallback(root, { ...params, data: input.data });
826
835
  return;
@@ -834,19 +843,29 @@ async function writeFileInRoot(root, params) {
834
843
  async function commitPinnedWriteInRoot(root, pinned, params, input) {
835
844
  let verifyingPublication = false;
836
845
  try {
846
+ if (params.private)
847
+ assertPrivateFileCreationAvailable();
848
+ if (params.private && params.mkdir !== false) {
849
+ const target = await prepareRootWriteTarget(root, pinned.targetPath, params.assertBeforeMutation, pinned.mutationAdmission, true);
850
+ if (target !== pinned.targetPath) {
851
+ throw new FsSafeError("path-mismatch", "private creation parent changed during admission");
852
+ }
853
+ }
837
854
  await runPinnedWriteWithRenamePolicy({
838
855
  rootPath: pinned.rootReal,
839
856
  relativeParentPath: pinned.relativeParentPath,
840
857
  basename: pinned.basename,
841
858
  targetPath: pinned.targetPath,
842
859
  renameIdentity: params.renameIdentity,
843
- mkdir: params.mkdir !== false,
860
+ mkdir: !params.private && params.mkdir !== false,
861
+ private: params.private,
844
862
  mode: params.mode ?? pinned.mode,
845
863
  sync: params.durable !== false,
864
+ strictFileSync: params.strictFileSync,
846
865
  overwrite: params.overwrite,
847
866
  rejectFinalSymlink: params.mutationSymlinks !== undefined,
848
867
  input,
849
- maxBytes: params.maxBytes,
868
+ maxBytes: input.kind === "buffer" ? undefined : params.maxBytes,
850
869
  rootIdentity: root.rootIdentity,
851
870
  mutationAdmission: pinned.mutationAdmission,
852
871
  assertBeforeMutation: params.assertBeforeMutation,
@@ -876,9 +895,7 @@ async function commitPinnedWriteInRoot(root, pinned, params, input) {
876
895
  throw error;
877
896
  }
878
897
  if (params.overwrite === false && isAlreadyExistsError(error)) {
879
- throw new FsSafeError("already-exists", "file already exists", {
880
- cause: error instanceof Error ? error : undefined,
881
- });
898
+ throw new FsSafeError("already-exists", "file already exists", errorCauseOptions(error));
882
899
  }
883
900
  throw normalizePinnedWriteError(error);
884
901
  }
@@ -910,12 +927,20 @@ async function copyFileInRoot(root, params) {
910
927
  throw new FsSafeError("too-large", `file exceeds limit of ${params.maxBytes} bytes (got ${source.stat.size})`);
911
928
  }
912
929
  try {
930
+ const sourceAdmission = params.admitSource?.(sourceIdentity, source.realPath);
931
+ const mode = sourceAdmission?.mode ?? params.mode;
913
932
  await serializePathWrite(rootWriteQueueKey(root, params.relativePath), async () => {
914
- const pinned = await resolvePinnedWriteTargetInRoot(root, params.relativePath, params.mode ?? (params.preserveSourceMode ? Number(sourceIdentity.mode & 4095n) : undefined), params.denyMutations, params.overwrite !== false, params.mutationSymlinks);
933
+ const pinned = await resolvePinnedWriteTargetInRoot(root, params.relativePath, mode ?? (params.preserveSourceMode ? Number(sourceIdentity.mode & 4095n) : undefined), params.denyMutations, params.overwrite !== false, params.mutationSymlinks);
915
934
  await serializePathWrite(pinned.targetPath, async () => {
916
935
  await assertCopySourceCurrent(source, sourceIdentity);
917
936
  const verifySource = async () => {
918
937
  params.signal?.throwIfAborted();
938
+ try {
939
+ sourceAdmission?.verify();
940
+ }
941
+ catch (error) {
942
+ throw new MutationAuthorityError(error);
943
+ }
919
944
  if (typeof params.source !== "string") {
920
945
  await params.source.root.stat(".");
921
946
  }
@@ -933,11 +958,11 @@ async function copyFileInRoot(root, params) {
933
958
  rejectFinalSymlink: params.mutationSymlinks !== undefined,
934
959
  maxBytes: params.maxBytes,
935
960
  sync: params.durable !== false,
936
- assertBeforeMutation: () => {
961
+ assertBeforeMutation: params.signal || params.assertBeforeMutation ? () => {
937
962
  if (params.signal?.aborted)
938
963
  throw new MutationAuthorityError(params.signal.reason);
939
964
  params.assertBeforeMutation?.();
940
- },
965
+ } : undefined,
941
966
  verifyPublished: params.verifyPublished,
942
967
  onPublished: observer.onPublished,
943
968
  input: { kind: "file", handle: source.handle, size: source.stat.size, clone, signal: params.signal, verifySource },
@@ -963,20 +988,9 @@ async function copyFileInRoot(root, params) {
963
988
  }
964
989
  }
965
990
  async function resolvePinnedPathInRoot(root, params) {
966
- return await resolvePinnedOperationPathInRoot(root, {
967
- allowRoot: params.allowRoot,
968
- denyMutations: params.denyMutations,
969
- mutationSymlinks: params.mutationSymlinks,
970
- protectDenyMutationAncestors: params.remove === true,
971
- relativePath: params.relativePath,
972
- policy: params.remove ? PATH_ALIAS_POLICIES.unlinkTarget : PATH_ALIAS_POLICIES.strict,
973
- removalReceipts: params.removalReceipts,
974
- });
975
- }
976
- async function resolvePinnedOperationPathInRoot(root, params) {
977
991
  const resolved = await resolvePinnedRootPathInRoot(root, {
978
992
  relativePath: params.relativePath,
979
- policy: params.policy,
993
+ policy: params.remove ? PATH_ALIAS_POLICIES.unlinkTarget : PATH_ALIAS_POLICIES.strict,
980
994
  mutationSymlinks: params.mutationSymlinks,
981
995
  removalReceipts: params.removalReceipts,
982
996
  });
@@ -1003,7 +1017,7 @@ async function resolvePinnedOperationPathInRoot(root, params) {
1003
1017
  }
1004
1018
  resolved.canonicalPath = admittedCanonicalPath.path;
1005
1019
  await assertMutationNotDenied(resolved.canonicalPath, params.denyMutations, {
1006
- protectAncestors: params.protectDenyMutationAncestors,
1020
+ protectAncestors: params.remove === true,
1007
1021
  });
1008
1022
  return { rootReal: resolved.rootReal, resolved: resolved.canonicalPath, relativePosix };
1009
1023
  }
@@ -1054,6 +1068,8 @@ async function listPathFallback(root, relativePath, withFileTypes) {
1054
1068
  return await listDirectoryPath(root, resolved.resolved, withFileTypes, resolved.receipt);
1055
1069
  }
1056
1070
  async function movePathFallback(root, params) {
1071
+ const originalRoutes = params.overwrite && params.assertBeforeMutation
1072
+ ? await Promise.all([params.fromRelative, params.toRelative].map(expandRelativePathWithHome)) : undefined;
1057
1073
  const source = await resolvePathInRoot(root, params.fromRelative, {
1058
1074
  aliasErrorCode: "path-alias",
1059
1075
  allowFinalSymlink: true,
@@ -1089,9 +1105,14 @@ async function movePathFallback(root, params) {
1089
1105
  targetStat?.isSymbolicLink() === true);
1090
1106
  },
1091
1107
  });
1092
- let sourceStat;
1108
+ let sourceIdentity;
1093
1109
  try {
1094
- sourceStat = fsSync.lstatSync(source.resolved);
1110
+ if (params.overwrite && params.assertBeforeMutation) {
1111
+ sourceIdentity = inspectFileIdentitySync(() => admitMoveSourceStat(fsSync.lstatSync(source.resolved, { bigint: true }), true));
1112
+ }
1113
+ else {
1114
+ admitMoveSourceStat(fsSync.lstatSync(source.resolved), params.overwrite);
1115
+ }
1095
1116
  }
1096
1117
  catch (error) {
1097
1118
  if (isNotFoundPathError(error)) {
@@ -1099,19 +1120,10 @@ async function movePathFallback(root, params) {
1099
1120
  }
1100
1121
  throw error;
1101
1122
  }
1102
- if (sourceStat.isSymbolicLink()) {
1103
- throw new FsSafeError("symlink", "symlink not allowed");
1104
- }
1105
- if (sourceStat.isFile() && sourceStat.nlink > 1) {
1106
- throw hardlinkedPathNotAllowedError();
1107
- }
1108
- if (!params.overwrite && sourceStat.isDirectory()) {
1109
- throw new FsSafeError("invalid-path", "directory moves require overwrite: true");
1123
+ if (!pinnedTarget) {
1124
+ throw new FsSafeError("path-mismatch", "destination admission was not completed");
1110
1125
  }
1111
1126
  if (!params.overwrite) {
1112
- if (!pinnedTarget) {
1113
- throw new FsSafeError("path-mismatch", "destination admission was not completed");
1114
- }
1115
1127
  await movePathNoReplaceNative(root, params, {
1116
1128
  sourcePath: source.resolved,
1117
1129
  sourceParentPath: path.dirname(pinnedSource.canonicalPath),
@@ -1120,8 +1132,9 @@ async function movePathFallback(root, params) {
1120
1132
  });
1121
1133
  return;
1122
1134
  }
1123
- const sourceParentGuard = await createAsyncDirectoryGuard(path.dirname(source.resolved));
1124
- const targetParentGuard = await createNearestExistingDirectoryGuard(target.rootReal, path.dirname(target.resolved));
1135
+ const guardOptions = { bigint: sourceIdentity !== undefined };
1136
+ const sourceParentGuard = await createAsyncDirectoryGuard(path.dirname(source.resolved), guardOptions);
1137
+ const targetParentGuard = await createNearestExistingDirectoryGuard(target.rootReal, path.dirname(target.resolved), guardOptions);
1125
1138
  await getFsSafeTestHooks()?.beforeRootFallbackMutation?.("move", target.resolved);
1126
1139
  await assertAsyncDirectoryGuard(sourceParentGuard);
1127
1140
  await assertAsyncDirectoryGuard(targetParentGuard);
@@ -1129,6 +1142,31 @@ async function movePathFallback(root, params) {
1129
1142
  assertFinalSymlinkRejected(source.resolved, params.mutationSymlinks !== undefined);
1130
1143
  assertFinalSymlinkRejected(target.resolved, params.mutationSymlinks !== undefined);
1131
1144
  params.assertBeforeMutation?.();
1145
+ if (sourceIdentity) {
1146
+ assertRootIdentityCurrentSync(root);
1147
+ assertSyncDirectoryGuard(sourceParentGuard);
1148
+ assertSyncDirectoryGuard(targetParentGuard);
1149
+ for (const [route, selected, expected, policy] of [
1150
+ [originalRoutes[0], source.resolved, pinnedSource.canonicalPath, PATH_ALIAS_POLICIES.strict],
1151
+ [originalRoutes[1], target.resolved, pinnedTarget.canonicalPath, PATH_ALIAS_POLICIES.unlinkTarget],
1152
+ ]) {
1153
+ for (const absolutePath of new Set([path.isAbsolute(route) ? route : `${root.rootWithSep}${route}`, selected])) {
1154
+ try {
1155
+ const current = resolveRootPathSync({
1156
+ absolutePath, rootPath: root.rootReal, rootCanonicalPath: root.rootReal,
1157
+ rootIdentity: root.rootIdentity, boundaryLabel: "root", policy,
1158
+ ...mutationSymlinkResolution(params.mutationSymlinks),
1159
+ });
1160
+ if (current.canonicalPath !== expected)
1161
+ throw new FsSafeError("path-mismatch", "move route changed during authorization");
1162
+ }
1163
+ catch (error) {
1164
+ throw normalizePinnedPathError(error);
1165
+ }
1166
+ }
1167
+ }
1168
+ inspectFileIdentitySync(() => admitMoveSourceStat(fsSync.lstatSync(source.resolved, { bigint: true }), true), sourceIdentity);
1169
+ }
1132
1170
  await fs.rename(source.resolved, target.resolved);
1133
1171
  }
1134
1172
  catch (error) {
@@ -1136,9 +1174,7 @@ async function movePathFallback(root, params) {
1136
1174
  throw fileNotFoundError(error instanceof Error ? error : undefined);
1137
1175
  }
1138
1176
  if (hasNodeErrorCode(error, "EEXIST")) {
1139
- throw new FsSafeError("already-exists", "destination exists", {
1140
- cause: error instanceof Error ? error : undefined,
1141
- });
1177
+ throw new FsSafeError("already-exists", "destination exists", errorCauseOptions(error));
1142
1178
  }
1143
1179
  throw error;
1144
1180
  }
@@ -1156,7 +1192,11 @@ async function writeFileFallback(root, params) {
1156
1192
  const policy = snapshotPinnedMutationPolicy(params.denyMutations, params.mutationSymlinks);
1157
1193
  if (policy)
1158
1194
  params = { ...params, ...policy };
1159
- const { rootReal, resolved } = await resolveGuardedWritePathInRoot(root, params);
1195
+ const { rootReal, resolved } = await resolveGuardedWritePathInRoot(root, {
1196
+ relativePath: params.relativePath,
1197
+ denyMutations: params.denyMutations,
1198
+ mutationSymlinks: params.mutationSymlinks,
1199
+ });
1160
1200
  await withRootFallbackCompatibilityLock({
1161
1201
  rootPath: rootReal, rootIdentity: root.rootIdentity, targetPath: resolved, assertBeforeMutation: params.assertBeforeMutation,
1162
1202
  }, async ({ targetPath, ...binding }) => await writeFileFallbackUnlocked(root, { ...params, ...binding }, targetPath));
@@ -1166,49 +1206,59 @@ async function writeFileFallbackUnlocked(root, params, expectedWritePath) {
1166
1206
  await writeMissingFileFallback(root, params, expectedWritePath);
1167
1207
  return;
1168
1208
  }
1169
- const { opened: target, identity: targetIdentity } = await openWritableFileInRoot(root, {
1209
+ const admissionParams = {
1170
1210
  relativePath: params.relativePath,
1171
1211
  mkdir: params.mkdir,
1172
- // Private, writable placeholder: Windows cannot rename over a read-only file.
1173
- mode: 0o600,
1174
1212
  denyMutations: params.denyMutations,
1175
1213
  assertBeforeMutation: params.assertBeforeMutation,
1176
1214
  mutationSymlinks: params.mutationSymlinks,
1177
1215
  truncateExisting: false,
1178
1216
  expectedWritePath,
1179
- });
1217
+ };
1218
+ const admission = await openWritableFileInRoot(root, admissionParams, { createIfMissing: false });
1219
+ const existing = "missing" in admission ? undefined : admission;
1220
+ const target = existing?.opened;
1221
+ const retainedSelection = existing?.writeSelection;
1222
+ const missingSelection = "missing" in admission ? admission.writeSelection : undefined;
1180
1223
  const policyEnabled = params.denyMutations !== undefined || params.mutationSymlinks !== undefined;
1181
- const retainedSelection = policyEnabled ? takeRootWriteSelection(target) : undefined;
1182
- const destinationPath = retainedSelection?.selectedPath ?? target.realPath;
1183
- const mode = params.mode ?? (target.stat.mode & 0o777);
1184
- if (policyEnabled && !retainedSelection) {
1185
- await target.handle.close().catch(() => undefined);
1224
+ const destinationPath = "missing" in admission ? admission.targetPath
1225
+ : retainedSelection?.selectedPath ?? admission.opened.realPath;
1226
+ let mode = params.mode ?? (target ? target.stat.mode & 0o777 : undefined);
1227
+ if (policyEnabled && !retainedSelection && !missingSelection) {
1228
+ await target?.handle.close().catch(() => undefined);
1186
1229
  throw new FsSafeError("path-mismatch", "write admission state was not retained");
1187
1230
  }
1188
- const destinationGuard = retainedSelection?.parentGuard ??
1231
+ const destinationGuard = "missing" in admission ? admission.parentGuard : retainedSelection?.parentGuard ??
1189
1232
  await createAsyncDirectoryGuard(path.dirname(destinationPath), { bigint: true }).catch(async (error) => {
1190
- await target.handle.close().catch(() => undefined);
1233
+ await target?.handle.close().catch(() => undefined);
1191
1234
  throw error;
1192
1235
  });
1193
1236
  let tempPath = null;
1194
1237
  let unregisterTempPath = null;
1195
1238
  let writtenHandle;
1196
1239
  let writtenIdentity;
1197
- let placeholderIdentity;
1198
- let published = false;
1240
+ let lateTargetHandle;
1199
1241
  try {
1200
- if (target.createdForWrite)
1201
- placeholderIdentity = targetIdentity;
1202
1242
  tempPath = buildAtomicWriteTempPath(destinationPath);
1203
1243
  if (retainedSelection) {
1204
- await refreshRetainedRootWriteAdmission(root, retainedSelection, true, target.handle.fd);
1244
+ await refreshRetainedRootWriteAdmission(root, retainedSelection, true, target?.handle.fd);
1245
+ }
1246
+ else if (missingSelection) {
1247
+ await refreshRootWritePathSelection(missingSelection);
1205
1248
  }
1206
1249
  params.assertBeforeMutation?.();
1207
1250
  if (retainedSelection) {
1208
- assertRootWriteSelectionSync(root, retainedSelection, true, target.handle.fd);
1251
+ assertRootWriteSelectionSync(root, retainedSelection, true, target?.handle.fd);
1252
+ }
1253
+ else if (missingSelection) {
1254
+ assertRootWritePathSelectionSync(root, missingSelection);
1209
1255
  }
1256
+ assertRootIdentityCurrentSync(root);
1257
+ assertSyncDirectoryGuard(destinationGuard);
1210
1258
  writtenHandle = await fs.open(tempPath, OPEN_WRITE_CREATE_FLAGS, 0o600);
1211
1259
  writtenIdentity = fsSync.fstatSync(writtenHandle.fd, { bigint: true });
1260
+ // Preserve the creation mask when no existing destination supplies a mode.
1261
+ mode ??= Number(writtenIdentity.mode & 511n);
1212
1262
  unregisterTempPath = registerTempPathForExit(tempPath, { identity: writtenIdentity, singleLinkFile: true });
1213
1263
  await writeAllToFile(writtenHandle, params.data, {
1214
1264
  encoding: params.encoding, assertBeforeMutation: params.assertBeforeMutation,
@@ -1223,24 +1273,42 @@ async function writeFileFallbackUnlocked(root, params, expectedWritePath) {
1223
1273
  root, targetPath: commitTempPath, fd: commitHandle.fd,
1224
1274
  expectedIdentity: commitIdentity, parentGuard: destinationGuard,
1225
1275
  });
1226
- if (target.createdForWrite) {
1227
- await cleanupPinnedFilePath({
1228
- pathname: destinationPath, handle: target.handle, identity: placeholderIdentity, parentGuard: destinationGuard,
1229
- });
1276
+ assertRootIdentityCurrentSync(root);
1277
+ assertSyncDirectoryGuard(destinationGuard);
1278
+ let publicationIdentity = inspectFallbackReplacementDestination(destinationPath);
1279
+ // A raced file needs its own access admission, not the old handle's rights.
1280
+ if (publicationIdentity && (!existing || !sameFileIdentity(publicationIdentity, existing.identity))) {
1281
+ const admitted = await openWritableFileInRoot(root, {
1282
+ ...admissionParams, mkdir: false, expectedWritePath: destinationPath,
1283
+ }, { createIfMissing: false });
1284
+ lateTargetHandle = "missing" in admitted ? undefined : admitted.opened.handle;
1285
+ publicationIdentity = "missing" in admitted ? undefined : admitted.identity;
1286
+ await lateTargetHandle?.close();
1230
1287
  }
1231
1288
  // Windows cannot replace a destination while its old handle remains open.
1232
- await target.handle.close();
1289
+ await target?.handle.close();
1233
1290
  if (retainedSelection) {
1234
- await refreshRetainedRootWriteAdmission(root, retainedSelection, !target.createdForWrite);
1291
+ await refreshRetainedRootWriteAdmission(root, retainedSelection, true);
1292
+ }
1293
+ else if (missingSelection) {
1294
+ await refreshRootWritePathSelection(missingSelection);
1235
1295
  }
1236
1296
  assertFinalSymlinkRejected(destinationPath, params.mutationSymlinks !== undefined);
1237
1297
  params.assertBeforeMutation?.();
1238
1298
  if (retainedSelection) {
1239
- assertRootWriteSelectionSync(root, retainedSelection, !target.createdForWrite);
1299
+ assertRootWriteSelectionSync(root, retainedSelection, true);
1300
+ }
1301
+ else if (missingSelection) {
1302
+ assertRootWritePathSelectionSync(root, missingSelection);
1303
+ }
1304
+ assertRootIdentityCurrentSync(root);
1305
+ assertSyncDirectoryGuard(destinationGuard);
1306
+ const current = inspectFallbackReplacementDestination(destinationPath);
1307
+ if (publicationIdentity ? !current || !sameFileIdentity(current, publicationIdentity) : current) {
1308
+ throw new FsSafeError("path-mismatch", "write destination changed before publication");
1240
1309
  }
1241
1310
  await fs.rename(commitTempPath, destinationPath);
1242
1311
  tempPath = null;
1243
- published = true;
1244
1312
  });
1245
1313
  unregisterTempPath();
1246
1314
  unregisterTempPath = null;
@@ -1253,12 +1321,8 @@ async function writeFileFallbackUnlocked(root, params, expectedWritePath) {
1253
1321
  });
1254
1322
  }
1255
1323
  finally {
1256
- if (!published && target.createdForWrite) {
1257
- await cleanupPinnedFilePath({
1258
- pathname: destinationPath, handle: target.handle, identity: placeholderIdentity, parentGuard: destinationGuard,
1259
- });
1260
- }
1261
- await target.handle.close().catch(() => undefined);
1324
+ await target?.handle.close().catch(() => undefined);
1325
+ await lateTargetHandle?.close().catch(() => undefined);
1262
1326
  if (tempPath && writtenHandle) {
1263
1327
  await cleanupPinnedFilePath({
1264
1328
  pathname: tempPath, handle: writtenHandle, identity: writtenIdentity, parentGuard: destinationGuard,
@@ -1268,6 +1332,23 @@ async function writeFileFallbackUnlocked(root, params, expectedWritePath) {
1268
1332
  unregisterTempPath?.();
1269
1333
  }
1270
1334
  }
1335
+ function inspectFallbackReplacementDestination(targetPath) {
1336
+ let current;
1337
+ try {
1338
+ current = inspectFileIdentitySync(() => fsSync.lstatSync(targetPath, { bigint: true }));
1339
+ }
1340
+ catch (error) {
1341
+ if (isNotFoundPathError(error))
1342
+ return;
1343
+ throw error;
1344
+ }
1345
+ if (current.isSymbolicLink() || !current.isFile()) {
1346
+ throw new FsSafeError("path-mismatch", "write destination changed before publication");
1347
+ }
1348
+ if (current.nlink > 1n)
1349
+ throw hardlinkedPathNotAllowedError();
1350
+ return current;
1351
+ }
1271
1352
  async function writeMissingFileFallback(root, params, expectedWritePath) {
1272
1353
  const guardedTarget = params.denyMutations === undefined && params.mutationSymlinks === undefined
1273
1354
  ? undefined
@@ -1294,6 +1375,7 @@ async function writeMissingFileFallback(root, params, expectedWritePath) {
1294
1375
  const parentGuard = pathSelection?.parentGuard ??
1295
1376
  await createAsyncDirectoryGuard(path.dirname(targetPath), { bigint: true });
1296
1377
  let created = false;
1378
+ let completed = false;
1297
1379
  let createdIdentity;
1298
1380
  let writtenHandle;
1299
1381
  let verifyingPublication = false;
@@ -1337,14 +1419,13 @@ async function writeMissingFileFallback(root, params, expectedWritePath) {
1337
1419
  });
1338
1420
  if (params.durable !== false)
1339
1421
  await syncDirectoryBestEffort(path.dirname(targetPath));
1422
+ completed = true;
1340
1423
  }
1341
1424
  catch (err) {
1342
1425
  if (verifyingPublication)
1343
1426
  throw err;
1344
1427
  if (hasNodeErrorCode(err, "EEXIST")) {
1345
- throw new FsSafeError("already-exists", "file already exists", {
1346
- cause: err instanceof Error ? err : undefined,
1347
- });
1428
+ throw new FsSafeError("already-exists", "file already exists", errorCauseOptions(err));
1348
1429
  }
1349
1430
  throw err;
1350
1431
  }
@@ -1354,6 +1435,9 @@ async function writeMissingFileFallback(root, params, expectedWritePath) {
1354
1435
  pathname: targetPath, handle: writtenHandle, identity: createdIdentity, parentGuard,
1355
1436
  });
1356
1437
  }
1357
- await writtenHandle?.close().catch(() => undefined);
1438
+ if (completed)
1439
+ await writtenHandle?.close();
1440
+ else
1441
+ await writtenHandle?.close().catch(() => undefined);
1358
1442
  }
1359
1443
  }