@openclaw/fs-safe 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/README.md +38 -10
  3. package/dist/advanced.d.ts +2 -1
  4. package/dist/advanced.d.ts.map +1 -1
  5. package/dist/advanced.js +2 -1
  6. package/dist/archive-kind.d.ts +0 -1
  7. package/dist/archive-kind.d.ts.map +1 -1
  8. package/dist/archive-kind.js +5 -17
  9. package/dist/archive-merge.d.ts.map +1 -1
  10. package/dist/archive-merge.js +113 -46
  11. package/dist/archive-parser.wasm +0 -0
  12. package/dist/archive-read.d.ts.map +1 -1
  13. package/dist/archive-read.js +10 -11
  14. package/dist/archive-tar-stream.d.ts +3 -0
  15. package/dist/archive-tar-stream.d.ts.map +1 -1
  16. package/dist/archive-tar-stream.js +56 -37
  17. package/dist/archive-tar-wasm.d.ts +16 -4
  18. package/dist/archive-tar-wasm.d.ts.map +1 -1
  19. package/dist/archive-tar-wasm.js +134 -34
  20. package/dist/archive-zip-directory.d.ts +4 -0
  21. package/dist/archive-zip-directory.d.ts.map +1 -1
  22. package/dist/archive-zip-directory.js +2 -0
  23. package/dist/archive-zip-entry.d.ts +6 -2
  24. package/dist/archive-zip-entry.d.ts.map +1 -1
  25. package/dist/archive-zip-entry.js +23 -8
  26. package/dist/archive-zip-integrity.d.ts.map +1 -1
  27. package/dist/archive-zip-integrity.js +3 -4
  28. package/dist/archive-zip-loader.d.ts.map +1 -1
  29. package/dist/archive-zip-loader.js +107 -31
  30. package/dist/archive-zip-names.d.ts +1 -0
  31. package/dist/archive-zip-names.d.ts.map +1 -1
  32. package/dist/archive-zip-names.js +6 -0
  33. package/dist/archive.d.ts.map +1 -1
  34. package/dist/archive.js +11 -11
  35. package/dist/bounded-read-stream.d.ts +0 -1
  36. package/dist/bounded-read-stream.d.ts.map +1 -1
  37. package/dist/bounded-read-stream.js +0 -6
  38. package/dist/clone-metadata.d.ts +1 -0
  39. package/dist/clone-metadata.d.ts.map +1 -1
  40. package/dist/clone-metadata.js +6 -2
  41. package/dist/copy-publication.d.ts +6 -0
  42. package/dist/copy-publication.d.ts.map +1 -1
  43. package/dist/copy-publication.js +3 -0
  44. package/dist/copy-tree-portable.d.ts.map +1 -1
  45. package/dist/copy-tree-portable.js +44 -24
  46. package/dist/copy.d.ts.map +1 -1
  47. package/dist/copy.js +29 -11
  48. package/dist/create-directory.d.ts +20 -0
  49. package/dist/create-directory.d.ts.map +1 -0
  50. package/dist/create-directory.js +130 -0
  51. package/dist/create-file-async.d.ts +7 -0
  52. package/dist/create-file-async.d.ts.map +1 -0
  53. package/dist/create-file-async.js +121 -0
  54. package/dist/create-file.d.ts +8 -0
  55. package/dist/create-file.d.ts.map +1 -0
  56. package/dist/create-file.js +190 -0
  57. package/dist/create-owned-file.d.ts +8 -0
  58. package/dist/create-owned-file.d.ts.map +1 -0
  59. package/dist/create-owned-file.js +16 -0
  60. package/dist/create.d.ts +4 -0
  61. package/dist/create.d.ts.map +1 -0
  62. package/dist/create.js +2 -0
  63. package/dist/creation-darwin.d.ts +7 -0
  64. package/dist/creation-darwin.d.ts.map +1 -0
  65. package/dist/creation-darwin.js +79 -0
  66. package/dist/creation-file-state.d.ts +19 -0
  67. package/dist/creation-file-state.d.ts.map +1 -0
  68. package/dist/creation-file-state.js +118 -0
  69. package/dist/creation-path.d.ts +21 -0
  70. package/dist/creation-path.d.ts.map +1 -0
  71. package/dist/creation-path.js +71 -0
  72. package/dist/creation-permissions.d.ts +19 -0
  73. package/dist/creation-permissions.d.ts.map +1 -0
  74. package/dist/creation-permissions.js +125 -0
  75. package/dist/directory-durability.d.ts +1 -1
  76. package/dist/directory-durability.d.ts.map +1 -1
  77. package/dist/directory-durability.js +22 -80
  78. package/dist/directory-guard.d.ts +3 -0
  79. package/dist/directory-guard.d.ts.map +1 -1
  80. package/dist/directory-mode-node.d.ts +2 -0
  81. package/dist/directory-mode-node.d.ts.map +1 -1
  82. package/dist/directory-mode-node.js +8 -0
  83. package/dist/directory-mode-owner.js +5 -5
  84. package/dist/directory-receipt.d.ts +24 -0
  85. package/dist/directory-receipt.d.ts.map +1 -0
  86. package/dist/directory-receipt.js +127 -0
  87. package/dist/file-cleanup.d.ts +19 -0
  88. package/dist/file-cleanup.d.ts.map +1 -0
  89. package/dist/file-cleanup.js +78 -0
  90. package/dist/file-handle-transfer.d.ts +2 -0
  91. package/dist/file-handle-transfer.d.ts.map +1 -1
  92. package/dist/file-handle-transfer.js +57 -2
  93. package/dist/file-identity.d.ts.map +1 -1
  94. package/dist/file-identity.js +18 -4
  95. package/dist/file-lock-sync-admission.d.ts +19 -0
  96. package/dist/file-lock-sync-admission.d.ts.map +1 -0
  97. package/dist/file-lock-sync-admission.js +93 -0
  98. package/dist/file-lock-sync-root-acquire.d.ts +4 -0
  99. package/dist/file-lock-sync-root-acquire.d.ts.map +1 -0
  100. package/dist/file-lock-sync-root-acquire.js +370 -0
  101. package/dist/file-lock-sync-root-arbitration.d.ts +18 -0
  102. package/dist/file-lock-sync-root-arbitration.d.ts.map +1 -0
  103. package/dist/file-lock-sync-root-arbitration.js +66 -0
  104. package/dist/file-lock-sync-root-held.d.ts +34 -0
  105. package/dist/file-lock-sync-root-held.d.ts.map +1 -0
  106. package/dist/file-lock-sync-root-held.js +393 -0
  107. package/dist/file-lock-sync-root-io.d.ts +44 -0
  108. package/dist/file-lock-sync-root-io.d.ts.map +1 -0
  109. package/dist/file-lock-sync-root-io.js +209 -0
  110. package/dist/file-lock-sync-root-mutation.d.ts +17 -0
  111. package/dist/file-lock-sync-root-mutation.d.ts.map +1 -0
  112. package/dist/file-lock-sync-root-mutation.js +277 -0
  113. package/dist/file-lock-sync-root-options.d.ts +20 -0
  114. package/dist/file-lock-sync-root-options.d.ts.map +1 -0
  115. package/dist/file-lock-sync-root-options.js +58 -0
  116. package/dist/file-lock-sync-root-registration.d.ts +2 -0
  117. package/dist/file-lock-sync-root-registration.d.ts.map +1 -0
  118. package/dist/file-lock-sync-root-registration.js +90 -0
  119. package/dist/file-lock-sync-root.d.ts +36 -0
  120. package/dist/file-lock-sync-root.d.ts.map +1 -0
  121. package/dist/file-lock-sync-root.js +361 -0
  122. package/dist/file-lock-sync-stale-admission.d.ts +24 -0
  123. package/dist/file-lock-sync-stale-admission.d.ts.map +1 -0
  124. package/dist/file-lock-sync-stale-admission.js +205 -0
  125. package/dist/file-lock-sync.d.ts.map +1 -1
  126. package/dist/file-lock-sync.js +245 -205
  127. package/dist/file-observation.d.ts +1 -1
  128. package/dist/file-observation.d.ts.map +1 -1
  129. package/dist/file-store-boundary.d.ts +2 -6
  130. package/dist/file-store-boundary.d.ts.map +1 -1
  131. package/dist/file-store-boundary.js +3 -9
  132. package/dist/file-store-prune.d.ts.map +1 -1
  133. package/dist/file-store-prune.js +5 -1
  134. package/dist/file-store-sync-write.d.ts.map +1 -1
  135. package/dist/file-store-sync-write.js +5 -8
  136. package/dist/file-store.d.ts.map +1 -1
  137. package/dist/file-store.js +47 -12
  138. package/dist/guarded-mkdir.d.ts +1 -0
  139. package/dist/guarded-mkdir.d.ts.map +1 -1
  140. package/dist/guarded-mkdir.js +36 -7
  141. package/dist/json-document-store.d.ts.map +1 -1
  142. package/dist/json-document-store.js +22 -15
  143. package/dist/json-durable-queue-ownership.d.ts +0 -1
  144. package/dist/json-durable-queue-ownership.d.ts.map +1 -1
  145. package/dist/json-durable-queue-ownership.js +0 -6
  146. package/dist/move-path.js +1 -1
  147. package/dist/native-binding.d.ts +13 -1
  148. package/dist/native-binding.d.ts.map +1 -1
  149. package/dist/native-fallback-warning.d.ts +4 -0
  150. package/dist/native-fallback-warning.d.ts.map +1 -0
  151. package/dist/native-fallback-warning.js +11 -0
  152. package/dist/native-operations.d.ts +0 -2
  153. package/dist/native-operations.d.ts.map +1 -1
  154. package/dist/native-operations.js +0 -24
  155. package/dist/native-parent-admission.d.ts +5 -2
  156. package/dist/native-parent-admission.d.ts.map +1 -1
  157. package/dist/native-parent-admission.js +27 -7
  158. package/dist/native-pinned-write-windows.d.ts +1 -1
  159. package/dist/native-pinned-write-windows.d.ts.map +1 -1
  160. package/dist/native-pinned-write-windows.js +174 -29
  161. package/dist/native-pinned-write.d.ts.map +1 -1
  162. package/dist/native-pinned-write.js +26 -14
  163. package/dist/native-policy-parent-windows.d.ts +14 -0
  164. package/dist/native-policy-parent-windows.d.ts.map +1 -0
  165. package/dist/native-policy-parent-windows.js +209 -0
  166. package/dist/native-rename-outcome.d.ts +4 -0
  167. package/dist/native-rename-outcome.d.ts.map +1 -0
  168. package/dist/native-rename-outcome.js +8 -0
  169. package/dist/native-staged-file.d.ts +3 -2
  170. package/dist/native-staged-file.d.ts.map +1 -1
  171. package/dist/native-staged-file.js +121 -72
  172. package/dist/output.d.ts.map +1 -1
  173. package/dist/output.js +12 -8
  174. package/dist/owner-dacl.d.ts.map +1 -1
  175. package/dist/owner-dacl.js +10 -4
  176. package/dist/path-prefix.d.ts.map +1 -1
  177. package/dist/path-prefix.js +30 -8
  178. package/dist/path-suffix-aliases.d.ts +2 -0
  179. package/dist/path-suffix-aliases.d.ts.map +1 -1
  180. package/dist/path-suffix-aliases.js +25 -17
  181. package/dist/permission-exec.d.ts +2 -0
  182. package/dist/permission-exec.d.ts.map +1 -1
  183. package/dist/permission-exec.js +150 -21
  184. package/dist/permissions-windows.js +1 -1
  185. package/dist/pinned-mutation-admission.d.ts.map +1 -1
  186. package/dist/pinned-mutation-admission.js +10 -5
  187. package/dist/pinned-mutation-observation.d.ts +0 -1
  188. package/dist/pinned-mutation-observation.d.ts.map +1 -1
  189. package/dist/pinned-mutation-observation.js +0 -19
  190. package/dist/pinned-mutation-shared-route.d.ts +1 -0
  191. package/dist/pinned-mutation-shared-route.d.ts.map +1 -1
  192. package/dist/pinned-mutation-shared-route.js +1 -1
  193. package/dist/pinned-write-input.d.ts +4 -0
  194. package/dist/pinned-write-input.d.ts.map +1 -0
  195. package/dist/pinned-write-input.js +25 -0
  196. package/dist/pinned-write-mode.d.ts +5 -0
  197. package/dist/pinned-write-mode.d.ts.map +1 -0
  198. package/dist/pinned-write-mode.js +24 -0
  199. package/dist/pinned-write-staged.d.ts +6 -0
  200. package/dist/pinned-write-staged.d.ts.map +1 -0
  201. package/dist/pinned-write-staged.js +187 -0
  202. package/dist/pinned-write-types.d.ts +5 -0
  203. package/dist/pinned-write-types.d.ts.map +1 -1
  204. package/dist/pinned-write.d.ts.map +1 -1
  205. package/dist/pinned-write.js +35 -145
  206. package/dist/private-directory.d.ts.map +1 -1
  207. package/dist/private-directory.js +18 -4
  208. package/dist/private-producer-handoff-sync.d.ts +14 -0
  209. package/dist/private-producer-handoff-sync.d.ts.map +1 -0
  210. package/dist/private-producer-handoff-sync.js +114 -0
  211. package/dist/private-producer-handoff.d.ts +22 -4
  212. package/dist/private-producer-handoff.d.ts.map +1 -1
  213. package/dist/private-producer-handoff.js +140 -77
  214. package/dist/private-temp-workspace.d.ts.map +1 -1
  215. package/dist/private-temp-workspace.js +75 -121
  216. package/dist/publish-copy-stage.d.ts +2 -1
  217. package/dist/publish-copy-stage.d.ts.map +1 -1
  218. package/dist/publish-copy-stage.js +16 -7
  219. package/dist/publish-file.d.ts.map +1 -1
  220. package/dist/publish-file.js +2 -2
  221. package/dist/regular-file.d.ts.map +1 -1
  222. package/dist/regular-file.js +1 -15
  223. package/dist/replace-directory.d.ts.map +1 -1
  224. package/dist/replace-directory.js +256 -18
  225. package/dist/replace-file-copy-fallback.d.ts.map +1 -1
  226. package/dist/replace-file-copy-fallback.js +62 -70
  227. package/dist/replace-file-copy-source.d.ts.map +1 -1
  228. package/dist/replace-file-copy-source.js +10 -12
  229. package/dist/replace-file-temp-owner.d.ts +5 -9
  230. package/dist/replace-file-temp-owner.d.ts.map +1 -1
  231. package/dist/replace-file-temp-owner.js +56 -72
  232. package/dist/replace-file.js +6 -6
  233. package/dist/retained-directory-replacement.d.ts +26 -0
  234. package/dist/retained-directory-replacement.d.ts.map +1 -0
  235. package/dist/retained-directory-replacement.js +193 -0
  236. package/dist/root-boundary.d.ts +1 -0
  237. package/dist/root-boundary.d.ts.map +1 -1
  238. package/dist/root-boundary.js +4 -0
  239. package/dist/root-context.d.ts +0 -8
  240. package/dist/root-context.d.ts.map +1 -1
  241. package/dist/root-context.js +0 -3
  242. package/dist/root-create-input.d.ts +8 -1
  243. package/dist/root-create-input.d.ts.map +1 -1
  244. package/dist/root-create-input.js +17 -4
  245. package/dist/root-directory-creation.d.ts +3 -3
  246. package/dist/root-directory-creation.d.ts.map +1 -1
  247. package/dist/root-directory-creation.js +15 -3
  248. package/dist/root-directory-list.d.ts +1 -0
  249. package/dist/root-directory-list.d.ts.map +1 -1
  250. package/dist/root-directory-list.js +1 -0
  251. package/dist/root-impl.d.ts.map +1 -1
  252. package/dist/root-impl.js +46 -17
  253. package/dist/root-move-noreplace.d.ts.map +1 -1
  254. package/dist/root-move-noreplace.js +24 -15
  255. package/dist/root-options.d.ts +12 -4
  256. package/dist/root-options.d.ts.map +1 -1
  257. package/dist/root-path-errors.d.ts +1 -0
  258. package/dist/root-path-errors.d.ts.map +1 -1
  259. package/dist/root-path-errors.js +11 -2
  260. package/dist/root-path-existing.d.ts.map +1 -1
  261. package/dist/root-path-existing.js +11 -35
  262. package/dist/root-path-stat.d.ts.map +1 -1
  263. package/dist/root-path-stat.js +59 -7
  264. package/dist/root-path.js +1 -13
  265. package/dist/root-remove.d.ts +1 -0
  266. package/dist/root-remove.d.ts.map +1 -1
  267. package/dist/root-remove.js +4 -0
  268. package/dist/root-walk.d.ts +1 -1
  269. package/dist/root-walk.d.ts.map +1 -1
  270. package/dist/root-walk.js +17 -2
  271. package/dist/root-write-admission.d.ts +0 -2
  272. package/dist/root-write-admission.d.ts.map +1 -1
  273. package/dist/root-write-admission.js +1 -15
  274. package/dist/root-write-complete-parent.d.ts.map +1 -1
  275. package/dist/root-write-complete-parent.js +7 -23
  276. package/dist/root-write-publication.js +1 -1
  277. package/dist/root-write-verification.d.ts.map +1 -1
  278. package/dist/root-write-verification.js +29 -42
  279. package/dist/secret-file.d.ts.map +1 -1
  280. package/dist/secret-file.js +3 -24
  281. package/dist/secret-read-async.d.ts.map +1 -1
  282. package/dist/secret-read-async.js +3 -24
  283. package/dist/secret-read-policy.d.ts +6 -2
  284. package/dist/secret-read-policy.d.ts.map +1 -1
  285. package/dist/secret-read-policy.js +26 -2
  286. package/dist/secure-file-windows.d.ts +6 -0
  287. package/dist/secure-file-windows.d.ts.map +1 -1
  288. package/dist/secure-file-windows.js +34 -117
  289. package/dist/secure-file.js +2 -2
  290. package/dist/sibling-temp.d.ts.map +1 -1
  291. package/dist/sibling-temp.js +23 -12
  292. package/dist/sidecar-lock-acquire.d.ts +2 -28
  293. package/dist/sidecar-lock-acquire.d.ts.map +1 -1
  294. package/dist/sidecar-lock-acquire.js +288 -199
  295. package/dist/sidecar-lock-admission-context.d.ts +19 -0
  296. package/dist/sidecar-lock-admission-context.d.ts.map +1 -0
  297. package/dist/sidecar-lock-admission-context.js +60 -0
  298. package/dist/sidecar-lock-admission-parser.d.ts +43 -0
  299. package/dist/sidecar-lock-admission-parser.d.ts.map +1 -0
  300. package/dist/sidecar-lock-admission-parser.js +113 -0
  301. package/dist/sidecar-lock-admission.d.ts +35 -0
  302. package/dist/sidecar-lock-admission.d.ts.map +1 -0
  303. package/dist/sidecar-lock-admission.js +7 -0
  304. package/dist/sidecar-lock-reclaim.d.ts +9 -4
  305. package/dist/sidecar-lock-reclaim.d.ts.map +1 -1
  306. package/dist/sidecar-lock-reclaim.js +80 -25
  307. package/dist/sidecar-lock-root.d.ts.map +1 -1
  308. package/dist/sidecar-lock-root.js +2 -1
  309. package/dist/sidecar-lock-stale-admission.d.ts +39 -0
  310. package/dist/sidecar-lock-stale-admission.d.ts.map +1 -0
  311. package/dist/sidecar-lock-stale-admission.js +232 -0
  312. package/dist/sidecar-lock-target.d.ts +8 -0
  313. package/dist/sidecar-lock-target.d.ts.map +1 -0
  314. package/dist/sidecar-lock-target.js +55 -0
  315. package/dist/sidecar-lock.d.ts.map +1 -1
  316. package/dist/sidecar-lock.js +100 -16
  317. package/dist/staged-directory.d.ts.map +1 -1
  318. package/dist/staged-directory.js +6 -6
  319. package/dist/staged-file-settlement.d.ts +17 -0
  320. package/dist/staged-file-settlement.d.ts.map +1 -0
  321. package/dist/staged-file-settlement.js +57 -0
  322. package/dist/temp-workspace-descriptor.d.ts.map +1 -1
  323. package/dist/temp-workspace-descriptor.js +9 -27
  324. package/dist/temp-workspace-owner.d.ts.map +1 -1
  325. package/dist/temp-workspace-owner.js +8 -8
  326. package/dist/walk.d.ts +5 -1
  327. package/dist/walk.d.ts.map +1 -1
  328. package/dist/walk.js +19 -6
  329. package/dist/windows-owner.d.ts.map +1 -1
  330. package/dist/windows-owner.js +4 -3
  331. package/dist/windows-security-bridge.cs +336 -0
  332. package/dist/windows-security-bridge.ps1 +15 -0
  333. package/dist/windows-security-command.d.ts +26 -0
  334. package/dist/windows-security-command.d.ts.map +1 -0
  335. package/dist/windows-security-command.js +363 -0
  336. package/dist/windows-security-facts.d.ts +6 -0
  337. package/dist/windows-security-facts.d.ts.map +1 -0
  338. package/dist/windows-security-facts.js +108 -0
  339. package/docs/advanced.md +4 -2
  340. package/docs/archive.md +97 -46
  341. package/docs/atomic.md +85 -8
  342. package/docs/config.md +6 -2
  343. package/docs/contributing.md +44 -4
  344. package/docs/copy.md +37 -0
  345. package/docs/creation.md +128 -0
  346. package/docs/durability.md +24 -0
  347. package/docs/file-store.md +19 -0
  348. package/docs/install.md +31 -7
  349. package/docs/json-store.md +5 -0
  350. package/docs/migrating-to-0.5.md +15 -6
  351. package/docs/migrating-to-0.6.md +9 -4
  352. package/docs/native-helper.md +32 -12
  353. package/docs/native.md +38 -7
  354. package/docs/output.md +6 -0
  355. package/docs/path-prefix.md +10 -0
  356. package/docs/path-suffix-aliases.md +51 -6
  357. package/docs/permissions.md +50 -14
  358. package/docs/public-api.md +3 -2
  359. package/docs/root.md +56 -3
  360. package/docs/secret-file.md +11 -2
  361. package/docs/secure-file.md +9 -4
  362. package/docs/sidecar-lock.md +114 -8
  363. package/docs/staged-file.md +12 -3
  364. package/docs/temp.md +20 -3
  365. package/docs/walk.md +67 -1
  366. package/docs/writing.md +76 -6
  367. package/package.json +19 -16
  368. package/dist/darwin-acl.d.ts +0 -4
  369. package/dist/darwin-acl.d.ts.map +0 -1
  370. package/dist/darwin-acl.js +0 -24
@@ -0,0 +1,370 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { FsSafeError } from "./errors.js";
4
+ import { captureRootSyncAcquireOptions } from "./file-lock-sync-root-options.js";
5
+ import { defaultSyncShouldReclaim, foreignSyncHeldLock, getSyncLockAdmissions, syncLockTimeout } from "./file-lock-sync-admission.js";
6
+ import { computeSidecarLockDelayMs, isTransientLockFileDenial, maxTransientLockDenials, } from "./sidecar-lock-policy.js";
7
+ import { serializeSidecarLockPayload, } from "./sidecar-lock-reclaim.js";
8
+ import { createSuppressedError } from "./suppressed-error.js";
9
+ import { sleepSync } from "./timing.js";
10
+ import { assertNoWindowsPathAlias } from "./windows-path-alias.js";
11
+ import { admitFileLockSyncRootPath, assertFileLockSyncRootPathsCurrent, captureFileLockSyncRootAuthority, normalizeFileLockSyncTargetWithRoot, } from "./file-lock-sync-root.js";
12
+ import { cleanupCreatedRootSyncLock, FileLockSyncRootArbitrationCollision, tryReuseCurrentRootSyncHeldLock, } from "./file-lock-sync-root-arbitration.js";
13
+ import { fileLockSyncRootSnapshotStillCurrent, } from "./file-lock-sync-root-io.js";
14
+ import { createFileLockSyncRootDirectory, createFileLockSyncRootFile, fileLockSyncRootGuardExists, fileLockSyncRootDirectoryReceiptStillCurrent, refreshFileLockSyncRootFileReceipt, removeFileLockSyncRootDirectory, removeFileLockSyncRootFile, } from "./file-lock-sync-root-mutation.js";
15
+ import { createRootSyncHeldLockHandle, ensureRootSyncExitCleanupRegistered, getRootSyncHeldLocks, readRootSidecarSnapshotSync, } from "./file-lock-sync-root-held.js";
16
+ export function acquireFileLockSyncWithRoot(targetPath, inputOptions, lockRoot) {
17
+ // The public dispatcher already read lockRoot exactly once. Validate and
18
+ // snapshot that genuine Root before any remaining option or retry getter can
19
+ // mutate its defaults or retained policy inputs.
20
+ const authority = captureFileLockSyncRootAuthority(lockRoot);
21
+ const options = captureRootSyncAcquireOptions(inputOptions);
22
+ ensureRootSyncExitCleanupRegistered();
23
+ assertNoWindowsPathAlias(targetPath);
24
+ if (options.lockPath !== undefined)
25
+ assertNoWindowsPathAlias(options.lockPath);
26
+ const resolvedTargetPath = path.resolve(targetPath);
27
+ const normalizedTargetPath = normalizeFileLockSyncTargetWithRoot(authority, resolvedTargetPath);
28
+ const requestedLockPath = path.resolve(options.lockPath ?? `${normalizedTargetPath}.lock`);
29
+ const lockRootPath = admitFileLockSyncRootPath(authority, requestedLockPath);
30
+ // A followed final alias and its admitted canonical spelling name the same
31
+ // sidecar. Derive their arbitration guard from that shared admitted path,
32
+ // then independently admit the derived mutation target under Root policy.
33
+ const reclaimRootPath = admitFileLockSyncRootPath(authority, `${lockRootPath.path}.reclaim`);
34
+ const guardedPaths = Object.freeze([lockRootPath, reclaimRootPath]);
35
+ const lockPath = lockRootPath.path;
36
+ const heldLocks = getRootSyncHeldLocks();
37
+ const currentTargetHolder = () => heldLocks.get(normalizedTargetPath) ??
38
+ foreignSyncHeldLock("root", normalizedTargetPath);
39
+ const admissions = getSyncLockAdmissions();
40
+ const admissionToken = {};
41
+ let ownsAdmission = false;
42
+ const assertAdmission = () => {
43
+ if (admissions.get(normalizedTargetPath) !== admissionToken) {
44
+ throw syncLockTimeout(lockPath, normalizedTargetPath);
45
+ }
46
+ };
47
+ const releaseAdmission = () => {
48
+ if (ownsAdmission && admissions.get(normalizedTargetPath) === admissionToken) {
49
+ admissions.delete(normalizedTargetPath);
50
+ }
51
+ ownsAdmission = false;
52
+ };
53
+ const arbitration = Object.freeze({
54
+ authority,
55
+ heldLocks,
56
+ lockRootPath,
57
+ normalizedTargetPath,
58
+ reentrantOwner: options.reentrantOwner,
59
+ });
60
+ if (heldLocks.has(normalizedTargetPath) && !foreignSyncHeldLock("root", normalizedTargetPath)) {
61
+ assertFileLockSyncRootPathsCurrent(guardedPaths, true, true);
62
+ const initiallyReusable = tryReuseCurrentRootSyncHeldLock(arbitration);
63
+ if (initiallyReusable)
64
+ return initiallyReusable;
65
+ }
66
+ const startedAt = Date.now();
67
+ let attempt = 0;
68
+ let transientDenials = 0;
69
+ let ownedReclaimGuard;
70
+ let reclaimCleanupAttempted = false;
71
+ const reuseCurrentHeld = () => ownedReclaimGuard ? undefined : tryReuseCurrentRootSyncHeldLock(arbitration);
72
+ const waitForRetry = () => {
73
+ releaseAdmission();
74
+ const elapsed = Date.now() - startedAt;
75
+ const timedOut = options.timeoutMs !== undefined && elapsed >= options.timeoutMs;
76
+ if (timedOut || (options.retry.retries !== undefined && attempt >= options.retry.retries)) {
77
+ throw syncLockTimeout(lockPath, normalizedTargetPath);
78
+ }
79
+ const remaining = options.timeoutMs === undefined || options.timeoutMs === Number.POSITIVE_INFINITY
80
+ ? Number.POSITIVE_INFINITY
81
+ : Math.max(0, options.timeoutMs - elapsed);
82
+ sleepSync(Math.min(computeSidecarLockDelayMs(options.retry, attempt), remaining));
83
+ attempt += 1;
84
+ };
85
+ const retryLockFileDenial = (error) => {
86
+ if (!isTransientLockFileDenial(error, lockPath) ||
87
+ ++transientDenials > maxTransientLockDenials)
88
+ return false;
89
+ try {
90
+ waitForRetry();
91
+ }
92
+ catch (waitError) {
93
+ if (waitError.code === "file_lock_timeout")
94
+ throw error;
95
+ throw waitError;
96
+ }
97
+ return true;
98
+ };
99
+ const releaseReclaimGuard = () => {
100
+ const receipt = ownedReclaimGuard;
101
+ if (!receipt)
102
+ return;
103
+ reclaimCleanupAttempted = true;
104
+ if (!removeFileLockSyncRootDirectory(reclaimRootPath, receipt)) {
105
+ throw new FsSafeError("path-mismatch", "owned sidecar reclaim guard changed before release");
106
+ }
107
+ ownedReclaimGuard = undefined;
108
+ reclaimCleanupAttempted = false;
109
+ };
110
+ const assertOwnedReclaimGuardCurrent = () => {
111
+ const receipt = ownedReclaimGuard;
112
+ if (!receipt || !fileLockSyncRootDirectoryReceiptStillCurrent(reclaimRootPath, receipt)) {
113
+ throw new FsSafeError("path-mismatch", "owned sidecar reclaim guard changed during acquisition");
114
+ }
115
+ };
116
+ try {
117
+ while (true) {
118
+ if (!ownsAdmission) {
119
+ if (admissions.has(normalizedTargetPath))
120
+ throw syncLockTimeout(lockPath, normalizedTargetPath);
121
+ admissions.set(normalizedTargetPath, admissionToken);
122
+ ownsAdmission = true;
123
+ }
124
+ assertAdmission();
125
+ assertFileLockSyncRootPathsCurrent(guardedPaths, true, true);
126
+ assertAdmission();
127
+ if (ownedReclaimGuard)
128
+ assertOwnedReclaimGuardCurrent();
129
+ if (!ownedReclaimGuard && fileLockSyncRootGuardExists(reclaimRootPath, true)) {
130
+ waitForRetry();
131
+ continue;
132
+ }
133
+ if (currentTargetHolder() !== undefined) {
134
+ const reused = reuseCurrentHeld();
135
+ if (reused)
136
+ return reused;
137
+ }
138
+ const payload = Reflect.apply(options.payload, options.optionsReceiver, []);
139
+ assertAdmission();
140
+ const { raw, ownershipToken } = serializeSidecarLockPayload(payload);
141
+ assertAdmission();
142
+ if (ownedReclaimGuard)
143
+ assertOwnedReclaimGuardCurrent();
144
+ if (currentTargetHolder() !== undefined) {
145
+ const reused = reuseCurrentHeld();
146
+ if (reused)
147
+ return reused;
148
+ waitForRetry();
149
+ continue;
150
+ }
151
+ let fd;
152
+ let rootReceipt;
153
+ let unpublishedTimer;
154
+ let lockFileCreateOpenFailure;
155
+ try {
156
+ const created = createFileLockSyncRootFile(lockRootPath, 0o600, {
157
+ assertBeforeOpen: () => {
158
+ assertAdmission();
159
+ if (ownedReclaimGuard)
160
+ assertOwnedReclaimGuardCurrent();
161
+ if (currentTargetHolder() !== undefined)
162
+ throw new FileLockSyncRootArbitrationCollision();
163
+ },
164
+ onOpenFailure: (error) => {
165
+ lockFileCreateOpenFailure = { error };
166
+ },
167
+ });
168
+ fd = created.fd;
169
+ rootReceipt = created.receipt;
170
+ fs.writeFileSync(fd, raw, "utf8");
171
+ fs.fsyncSync(fd);
172
+ const snapshot = {
173
+ raw,
174
+ payload,
175
+ ownershipToken,
176
+ };
177
+ if (ownedReclaimGuard)
178
+ releaseReclaimGuard();
179
+ rootReceipt = refreshFileLockSyncRootFileReceipt(lockRootPath, rootReceipt);
180
+ const createdHeld = {
181
+ fd,
182
+ lockPath,
183
+ normalizedTargetPath,
184
+ parsePayload: options.parsePayload,
185
+ refCount: 1,
186
+ reentrantOwner: options.reentrantOwner,
187
+ releaseState: "active",
188
+ revision: 0,
189
+ rootAuthority: authority,
190
+ rootPath: lockRootPath,
191
+ rootReceipt,
192
+ snapshot,
193
+ };
194
+ const returnedHandle = createRootSyncHeldLockHandle(createdHeld);
195
+ if (options.onCompromised && (options.compromiseCheckIntervalMs ?? 0) > 0) {
196
+ const timer = setInterval(() => {
197
+ let stillHeld;
198
+ try {
199
+ stillHeld = returnedHandle.verifyStillHeld();
200
+ }
201
+ catch {
202
+ stillHeld = false;
203
+ }
204
+ if (!stillHeld && createdHeld.timer) {
205
+ clearInterval(createdHeld.timer);
206
+ createdHeld.timer = undefined;
207
+ Reflect.apply(options.onCompromised, options.optionsReceiver, [{ lockPath, normalizedTargetPath }]);
208
+ }
209
+ }, options.compromiseCheckIntervalMs);
210
+ unpublishedTimer = timer;
211
+ createdHeld.timer = timer;
212
+ timer.unref();
213
+ }
214
+ if (currentTargetHolder() !== undefined) {
215
+ throw new FileLockSyncRootArbitrationCollision();
216
+ }
217
+ assertAdmission();
218
+ heldLocks.set(normalizedTargetPath, createdHeld);
219
+ fd = undefined;
220
+ unpublishedTimer = undefined;
221
+ return returnedHandle;
222
+ }
223
+ catch (error) {
224
+ if (fd !== undefined && rootReceipt) {
225
+ const cleanupFd = fd;
226
+ const cleanupReceipt = rootReceipt;
227
+ const cleanupTimer = unpublishedTimer;
228
+ fd = undefined;
229
+ rootReceipt = undefined;
230
+ unpublishedTimer = undefined;
231
+ try {
232
+ cleanupCreatedRootSyncLock(lockRootPath, cleanupFd, cleanupReceipt, cleanupTimer);
233
+ }
234
+ catch (cleanupError) {
235
+ throw createSuppressedError(error, cleanupError, "file lock acquisition and Root cleanup both failed");
236
+ }
237
+ }
238
+ if (error instanceof FileLockSyncRootArbitrationCollision) {
239
+ const reused = reuseCurrentHeld();
240
+ if (reused)
241
+ return reused;
242
+ waitForRetry();
243
+ continue;
244
+ }
245
+ const fromLockFileOpen = lockFileCreateOpenFailure !== undefined &&
246
+ lockFileCreateOpenFailure.error === error;
247
+ if (fromLockFileOpen && retryLockFileDenial(error))
248
+ continue;
249
+ if (!fromLockFileOpen || error.code !== "EEXIST")
250
+ throw error;
251
+ if (ownedReclaimGuard) {
252
+ releaseReclaimGuard();
253
+ const reused = reuseCurrentHeld();
254
+ if (reused)
255
+ return reused;
256
+ waitForRetry();
257
+ continue;
258
+ }
259
+ if (currentTargetHolder() !== undefined) {
260
+ const reused = reuseCurrentHeld();
261
+ if (reused)
262
+ return reused;
263
+ waitForRetry();
264
+ continue;
265
+ }
266
+ let lockFileOpenDenied = false;
267
+ let current;
268
+ try {
269
+ current = readRootSidecarSnapshotSync(lockRootPath, options.parsePayload, (openError) => {
270
+ lockFileOpenDenied = isTransientLockFileDenial(openError, lockPath);
271
+ });
272
+ }
273
+ catch (readError) {
274
+ if (lockFileOpenDenied && retryLockFileDenial(readError))
275
+ continue;
276
+ throw readError;
277
+ }
278
+ if (currentTargetHolder() !== undefined) {
279
+ const reused = reuseCurrentHeld();
280
+ if (reused)
281
+ return reused;
282
+ waitForRetry();
283
+ continue;
284
+ }
285
+ assertAdmission();
286
+ if (!current) {
287
+ waitForRetry();
288
+ continue;
289
+ }
290
+ const snapshot = current.snapshot;
291
+ const nowMs = Date.now();
292
+ let reclaim;
293
+ if (options.shouldReclaim) {
294
+ reclaim = Reflect.apply(options.shouldReclaim, options.optionsReceiver, [{
295
+ lockPath,
296
+ normalizedTargetPath,
297
+ payload: snapshot.payload,
298
+ staleMs: options.staleMs,
299
+ nowMs,
300
+ heldByThisProcess: false,
301
+ }]);
302
+ assertAdmission();
303
+ if (!fileLockSyncRootSnapshotStillCurrent(lockRootPath, current)) {
304
+ throw new FsSafeError("path-mismatch", "sidecar changed during reclaim policy callback");
305
+ }
306
+ }
307
+ else {
308
+ reclaim = defaultSyncShouldReclaim(snapshot, options.staleMs, nowMs);
309
+ }
310
+ if (reclaim) {
311
+ if (options.staleRecovery === "remove-if-unchanged" &&
312
+ snapshot.raw !== undefined &&
313
+ options.shouldRemoveStaleLock) {
314
+ const guard = createFileLockSyncRootDirectory(reclaimRootPath);
315
+ if (!guard) {
316
+ waitForRetry();
317
+ continue;
318
+ }
319
+ ownedReclaimGuard = guard;
320
+ reclaimCleanupAttempted = false;
321
+ const approved = Reflect.apply(options.shouldRemoveStaleLock, options.optionsReceiver, [{
322
+ lockPath,
323
+ normalizedTargetPath,
324
+ raw: snapshot.raw,
325
+ payload: snapshot.payload,
326
+ }]);
327
+ assertAdmission();
328
+ assertOwnedReclaimGuardCurrent();
329
+ if (approved) {
330
+ const removed = removeFileLockSyncRootFile(lockRootPath, current.receipt, snapshot, () => {
331
+ assertAdmission();
332
+ assertOwnedReclaimGuardCurrent();
333
+ if (currentTargetHolder() !== undefined)
334
+ throw new FileLockSyncRootArbitrationCollision();
335
+ });
336
+ if (!removed) {
337
+ throw new FsSafeError("path-mismatch", "stale sidecar changed before removal");
338
+ }
339
+ continue;
340
+ }
341
+ if (!fileLockSyncRootSnapshotStillCurrent(lockRootPath, current)) {
342
+ throw new FsSafeError("path-mismatch", "sidecar changed during stale-removal policy callback");
343
+ }
344
+ releaseReclaimGuard();
345
+ }
346
+ throw Object.assign(new Error(`file lock stale for ${normalizedTargetPath}`), {
347
+ code: "file_lock_stale",
348
+ lockPath,
349
+ normalizedTargetPath,
350
+ });
351
+ }
352
+ waitForRetry();
353
+ }
354
+ }
355
+ }
356
+ catch (error) {
357
+ if (ownedReclaimGuard && !reclaimCleanupAttempted) {
358
+ try {
359
+ releaseReclaimGuard();
360
+ }
361
+ catch (cleanupError) {
362
+ throw createSuppressedError(error, cleanupError, "file lock acquisition and reclaim cleanup both failed");
363
+ }
364
+ }
365
+ throw error;
366
+ }
367
+ finally {
368
+ releaseAdmission();
369
+ }
370
+ }
@@ -0,0 +1,18 @@
1
+ import { FsSafeError } from "./errors.js";
2
+ import type { FileLockSyncHandle } from "./file-lock-sync.js";
3
+ import { type FileLockSyncRootAuthority, type FileLockSyncRootPath } from "./file-lock-sync-root.js";
4
+ import type { FileLockSyncRootFileReceipt } from "./file-lock-sync-root-io.js";
5
+ import { type RootSyncHeldLock } from "./file-lock-sync-root-held.js";
6
+ export declare class FileLockSyncRootArbitrationCollision extends FsSafeError {
7
+ constructor();
8
+ }
9
+ export type FileLockSyncRootArbitration = Readonly<{
10
+ authority: FileLockSyncRootAuthority;
11
+ heldLocks: Map<string, RootSyncHeldLock>;
12
+ lockRootPath: FileLockSyncRootPath;
13
+ normalizedTargetPath: string;
14
+ reentrantOwner?: string;
15
+ }>;
16
+ export declare function tryReuseCurrentRootSyncHeldLock(arbitration: FileLockSyncRootArbitration): FileLockSyncHandle | undefined;
17
+ export declare function cleanupCreatedRootSyncLock(lockRootPath: FileLockSyncRootPath, fd: number, receipt: FileLockSyncRootFileReceipt, timer?: NodeJS.Timeout): void;
18
+ //# sourceMappingURL=file-lock-sync-root-arbitration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-lock-sync-root-arbitration.d.ts","sourceRoot":"","sources":["../src/file-lock-sync-root-arbitration.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAG/E,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AAEvC,qBAAa,oCAAqC,SAAQ,WAAW;IACnE,cAEC;CACF;AAED,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IACjD,SAAS,EAAE,yBAAyB,CAAC;IACrC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACzC,YAAY,EAAE,oBAAoB,CAAC;IACnC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC,CAAC;AAMH,wBAAgB,+BAA+B,CAC7C,WAAW,EAAE,2BAA2B,GACvC,kBAAkB,GAAG,SAAS,CAsBhC;AAED,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,oBAAoB,EAClC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,2BAA2B,EACpC,KAAK,CAAC,EAAE,MAAM,CAAC,OAAO,GACrB,IAAI,CAyBN"}
@@ -0,0 +1,66 @@
1
+ import fs from "node:fs";
2
+ import { foreignSyncHeldLock } from "./file-lock-sync-admission.js";
3
+ import path from "node:path";
4
+ import { FsSafeError } from "./errors.js";
5
+ import {} from "./file-lock-sync-root.js";
6
+ import { removeFileLockSyncRootFile } from "./file-lock-sync-root-mutation.js";
7
+ import { createSuppressedError } from "./suppressed-error.js";
8
+ import { createRootSyncHeldLockHandle, verifyRootSyncHeldLock, } from "./file-lock-sync-root-held.js";
9
+ export class FileLockSyncRootArbitrationCollision extends FsSafeError {
10
+ constructor() {
11
+ super("path-mismatch", "file lock arbitration changed during local creation");
12
+ }
13
+ }
14
+ function sameRootLockPath(left, right) {
15
+ return left.relativePath === right.relativePath && path.relative(left.path, right.path) === "";
16
+ }
17
+ export function tryReuseCurrentRootSyncHeldLock(arbitration) {
18
+ const held = arbitration.heldLocks.get(arbitration.normalizedTargetPath);
19
+ const reusable = held && !foreignSyncHeldLock("root", arbitration.normalizedTargetPath) &&
20
+ arbitration.reentrantOwner !== undefined &&
21
+ held.reentrantOwner !== undefined &&
22
+ arbitration.reentrantOwner === held.reentrantOwner &&
23
+ arbitration.authority.adapter === held.rootAuthority.adapter &&
24
+ sameRootLockPath(arbitration.lockRootPath, held.rootPath) &&
25
+ held.releaseState !== "released";
26
+ if (!reusable)
27
+ return undefined;
28
+ if (!verifyRootSyncHeldLock(held)) {
29
+ throw new FsSafeError("path-mismatch", "held sidecar lock changed before reentrant reuse");
30
+ }
31
+ // Verification can invoke a custom parser. Re-fetch the exact entry before
32
+ // granting a reference, while retaining supported releasing/exit states.
33
+ if (arbitration.heldLocks.get(arbitration.normalizedTargetPath) !== held ||
34
+ held.releaseState === "released" || foreignSyncHeldLock("root", arbitration.normalizedTargetPath)) {
35
+ throw new FsSafeError("path-mismatch", "held sidecar lock changed during reentrant reuse");
36
+ }
37
+ held.refCount += 1;
38
+ held.revision += 1;
39
+ return createRootSyncHeldLockHandle(held);
40
+ }
41
+ export function cleanupCreatedRootSyncLock(lockRootPath, fd, receipt, timer) {
42
+ let timerCleanupFailed = false;
43
+ let timerCleanupError;
44
+ try {
45
+ if (timer)
46
+ clearInterval(timer);
47
+ }
48
+ catch (error) {
49
+ timerCleanupFailed = true;
50
+ timerCleanupError = error;
51
+ }
52
+ try {
53
+ fs.closeSync(fd);
54
+ if (!removeFileLockSyncRootFile(lockRootPath, receipt)) {
55
+ throw new FsSafeError("path-mismatch", "created sidecar lock changed before cleanup");
56
+ }
57
+ }
58
+ catch (fileCleanupError) {
59
+ if (timerCleanupFailed) {
60
+ throw createSuppressedError(timerCleanupError, fileCleanupError, "unpublished lock timer and file cleanup both failed");
61
+ }
62
+ throw fileCleanupError;
63
+ }
64
+ if (timerCleanupFailed)
65
+ throw timerCleanupError;
66
+ }
@@ -0,0 +1,34 @@
1
+ import type { FileLockSyncHandle } from "./file-lock-sync.js";
2
+ import { type SidecarLockSnapshot } from "./sidecar-lock-reclaim.js";
3
+ import { type FileLockSyncRootAuthority, type FileLockSyncRootPath } from "./file-lock-sync-root.js";
4
+ import { type FileLockSyncRootFileReceipt, type FileLockSyncRootSnapshot } from "./file-lock-sync-root-io.js";
5
+ type RootSyncHeldLockReleaseState = "active" | "releasing" | "exit-cleaning" | "released";
6
+ type RootSyncHeldLockHandleDisposition = {
7
+ held: RootSyncHeldLock;
8
+ released: boolean;
9
+ };
10
+ export type RootSyncHeldLock = {
11
+ deferredExitReleases?: Set<RootSyncHeldLockHandleDisposition>;
12
+ fd: number | undefined;
13
+ lockPath: string;
14
+ normalizedTargetPath: string;
15
+ parsePayload?: (raw: string) => unknown;
16
+ refCount: number;
17
+ reentrantOwner?: string;
18
+ releaseState: RootSyncHeldLockReleaseState;
19
+ revision: number;
20
+ rootAuthority: FileLockSyncRootAuthority;
21
+ rootPath: FileLockSyncRootPath;
22
+ rootReceipt: FileLockSyncRootFileReceipt;
23
+ snapshot: SidecarLockSnapshot;
24
+ timer?: NodeJS.Timeout;
25
+ };
26
+ export declare function readRootSidecarSnapshotSync(rootPath: FileLockSyncRootPath, parsePayload?: (raw: string) => unknown, onOpenFailure?: (error: unknown) => void, expectedReceipt?: FileLockSyncRootFileReceipt): FileLockSyncRootSnapshot | null;
27
+ export declare function getRootSyncHeldLocks(): Map<string, RootSyncHeldLock>;
28
+ export declare function ensureRootSyncExitCleanupRegistered(): void;
29
+ export declare function verifyRootSyncHeldLock(held: RootSyncHeldLock): boolean;
30
+ export declare function createRootSyncHeldLockHandle(held: RootSyncHeldLock): FileLockSyncHandle;
31
+ export declare function isRootSyncHeldLockHandle(handle: FileLockSyncHandle): boolean;
32
+ export declare function withRootSyncHeldLockHandle<T>(lock: FileLockSyncHandle, fn: () => T): T;
33
+ export {};
34
+ //# sourceMappingURL=file-lock-sync-root-held.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-lock-sync-root-held.d.ts","sourceRoot":"","sources":["../src/file-lock-sync-root-held.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC9B,MAAM,6BAA6B,CAAC;AAQrC,KAAK,4BAA4B,GAAG,QAAQ,GAAG,WAAW,GAAG,eAAe,GAAG,UAAU,CAAC;AAE1F,KAAK,iCAAiC,GAAG;IACvC,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAOF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oBAAoB,CAAC,EAAE,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC9D,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,4BAA4B,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,yBAAyB,CAAC;IACzC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,WAAW,EAAE,2BAA2B,CAAC;IACzC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC;CACxB,CAAC;AAQF,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,oBAAoB,EAC9B,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,EACvC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,EACxC,eAAe,CAAC,EAAE,2BAA2B,GAC5C,wBAAwB,GAAG,IAAI,CAmCjC;AAED,wBAAgB,oBAAoB,IAAI,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAQpE;AA+KD,wBAAgB,mCAAmC,IAAI,IAAI,CAE1D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAWtE;AAsHD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,gBAAgB,GAAG,kBAAkB,CAqBvF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAE5E;AAED,wBAAgB,0BAA0B,CAAC,CAAC,EAC1C,IAAI,EAAE,kBAAkB,EACxB,EAAE,EAAE,MAAM,CAAC,GACV,CAAC,CAoBH"}