@openclaw/fs-safe 0.17.0 → 0.18.1
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.
- package/CHANGELOG.md +53 -0
- package/dist/absolute-path.d.ts +0 -1
- package/dist/advanced.d.ts +2 -2
- package/dist/archive-crc32.d.ts +0 -1
- package/dist/archive-deadline.d.ts +0 -1
- package/dist/archive-durability.d.ts +1 -2
- package/dist/archive-entry.d.ts +0 -1
- package/dist/archive-errors.d.ts +0 -1
- package/dist/archive-gzip-tail.d.ts +0 -1
- package/dist/archive-input.d.ts +0 -1
- package/dist/archive-kind.d.ts +0 -1
- package/dist/archive-limits.d.ts +0 -1
- package/dist/archive-merge.d.ts +2 -4
- package/dist/archive-merge.js +14 -4
- package/dist/archive-parser-errors.d.ts +0 -1
- package/dist/archive-parser.wasm +0 -0
- package/dist/archive-plan.d.ts +72 -2
- package/dist/archive-plan.js +86 -22
- package/dist/archive-read.d.ts +0 -1
- package/dist/archive-staging.d.ts +0 -1
- package/dist/archive-tar-stream.d.ts +0 -1
- package/dist/archive-tar-wasm.d.ts +1 -2
- package/dist/archive-zip-admission.d.ts +0 -1
- package/dist/archive-zip-count.d.ts +0 -1
- package/dist/archive-zip-directory.d.ts +1 -2
- package/dist/archive-zip-entry.d.ts +1 -2
- package/dist/archive-zip-entry.js +1 -1
- package/dist/archive-zip-integrity.d.ts +0 -1
- package/dist/archive-zip-loader.d.ts +0 -1
- package/dist/archive-zip-manifest.d.ts +0 -1
- package/dist/archive-zip-names.d.ts +0 -1
- package/dist/archive-zip-preflight.d.ts +0 -1
- package/dist/archive.d.ts +8 -6
- package/dist/archive.js +204 -168
- package/dist/async-lock.d.ts +0 -1
- package/dist/atomic.d.ts +3 -2
- package/dist/bounded-read-stream.d.ts +0 -1
- package/dist/bounded-read.d.ts +0 -1
- package/dist/byte-budget.d.ts +0 -1
- package/dist/byte-view.d.ts +0 -1
- package/dist/clone-metadata.d.ts +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/containment.d.ts +0 -1
- package/dist/copy-file-input.d.ts +0 -1
- package/dist/copy-policy.d.ts +0 -1
- package/dist/copy-publication.d.ts +1 -2
- package/dist/copy-tree-portable.d.ts +0 -1
- package/dist/copy-tree-portable.js +9 -6
- package/dist/copy.d.ts +0 -1
- package/dist/copy.js +5 -5
- package/dist/create-owned-file.d.ts +0 -1
- package/dist/create.d.ts +16 -3
- package/dist/create.js +388 -2
- package/dist/creation-boundary.d.ts +60 -0
- package/dist/creation-boundary.js +371 -0
- package/dist/deny-mutations.d.ts +2 -3
- package/dist/deny-mutations.js +55 -35
- package/dist/device-path.d.ts +0 -1
- package/dist/directory-durability.d.ts +0 -1
- package/dist/directory-entry-path.d.ts +0 -1
- package/dist/directory-guard.d.ts +2 -7
- package/dist/directory-guard.js +25 -56
- package/dist/directory-mode-node.d.ts +0 -1
- package/dist/directory-mode-node.js +12 -2
- package/dist/directory-mode-owner.d.ts +0 -1
- package/dist/directory-receipt.d.ts +0 -1
- package/dist/durability.d.ts +2 -2
- package/dist/effective-uid.d.ts +0 -1
- package/dist/error-detail.d.ts +0 -1
- package/dist/errors.d.ts +0 -1
- package/dist/file-cleanup.d.ts +0 -1
- package/dist/file-contents.d.ts +0 -1
- package/dist/file-handle-transfer.d.ts +0 -1
- package/dist/file-hash.d.ts +0 -1
- package/dist/file-hash.js +170 -66
- package/dist/file-identity.d.ts +0 -1
- package/dist/file-lock-sync-acquisition.d.ts +22 -0
- package/dist/file-lock-sync-acquisition.js +98 -0
- package/dist/file-lock-sync-admission.d.ts +0 -2
- package/dist/file-lock-sync-admission.js +9 -48
- package/dist/file-lock-sync-root-acquire.d.ts +0 -1
- package/dist/file-lock-sync-root-acquire.js +33 -103
- package/dist/file-lock-sync-root-arbitration.d.ts +0 -1
- package/dist/file-lock-sync-root-held.d.ts +0 -1
- package/dist/file-lock-sync-root-io.d.ts +0 -1
- package/dist/file-lock-sync-root-mutation.d.ts +4 -5
- package/dist/file-lock-sync-root-mutation.js +7 -9
- package/dist/file-lock-sync-root-options.d.ts +0 -1
- package/dist/file-lock-sync-root-registration.d.ts +0 -1
- package/dist/file-lock-sync-root.d.ts +3 -3
- package/dist/file-lock-sync-root.js +14 -87
- package/dist/file-lock-sync-stale-admission.d.ts +2 -7
- package/dist/file-lock-sync-stale-admission.js +18 -27
- package/dist/file-lock-sync.d.ts +4 -22
- package/dist/file-lock-sync.js +38 -117
- package/dist/file-lock.d.ts +0 -1
- package/dist/file-observation.d.ts +0 -1
- package/dist/file-store-boundary.d.ts +7 -2
- package/dist/file-store-boundary.js +64 -27
- package/dist/file-store-prune.d.ts +0 -1
- package/dist/file-store-sync-directory.d.ts +0 -1
- package/dist/file-store-sync-directory.js +194 -231
- package/dist/file-store-sync-write.d.ts +0 -1
- package/dist/file-store-sync-write.js +18 -29
- package/dist/file-store.d.ts +0 -1
- package/dist/file-store.js +4 -10
- package/dist/file-sync.d.ts +0 -1
- package/dist/filename.d.ts +0 -1
- package/dist/filename.js +1 -7
- package/dist/fs.d.ts +0 -1
- package/dist/guarded-mkdir.d.ts +1 -2
- package/dist/guarded-mutation.d.ts +0 -7
- package/dist/guarded-mutation.js +6 -11
- package/dist/guest-dispatch-python.d.ts +0 -1
- package/dist/guest-dispatch-python.js +41 -90
- package/dist/guest-native-python.d.ts +0 -1
- package/dist/guest.d.ts +0 -1
- package/dist/home-dir.d.ts +0 -1
- package/dist/index.d.ts +9 -7
- package/dist/install-path.d.ts +0 -1
- package/dist/json-document-store.d.ts +0 -1
- package/dist/json-durable-queue-directory.d.ts +13 -1
- package/dist/json-durable-queue-directory.js +134 -0
- package/dist/json-durable-queue-ownership.d.ts +0 -1
- package/dist/json-durable-queue-ownership.js +42 -61
- package/dist/json-durable-queue-read.d.ts +0 -1
- package/dist/json-durable-queue-read.js +13 -9
- package/dist/json-durable-queue.d.ts +0 -1
- package/dist/json-durable-queue.js +8 -132
- package/dist/json-store.d.ts +0 -1
- package/dist/json-store.js +1 -2
- package/dist/json-stringify.d.ts +0 -1
- package/dist/json.d.ts +0 -1
- package/dist/json.js +7 -17
- package/dist/local-file-access.d.ts +0 -1
- package/dist/local-file-access.js +3 -10
- package/dist/local-file-descriptor.d.ts +0 -1
- package/dist/local-roots.d.ts +0 -1
- package/dist/lock-config.d.ts +0 -1
- package/dist/move-path-cleanup.d.ts +0 -1
- package/dist/move-path-stage.d.ts +0 -1
- package/dist/move-path.d.ts +0 -1
- package/dist/move-path.js +1 -2
- package/dist/mutation-authority.d.ts +0 -1
- package/dist/native-binding.d.ts +0 -1
- package/dist/native-config.d.ts +0 -1
- package/dist/native-directory-observation.d.ts +0 -1
- package/dist/native-fallback-warning.d.ts +0 -1
- package/dist/native-operations.d.ts +1 -5
- package/dist/native-operations.js +2 -7
- package/dist/native-parent-admission.d.ts +0 -1
- package/dist/native-pinned-write-windows.d.ts +1 -2
- package/dist/native-pinned-write-windows.js +1 -1
- package/dist/native-pinned-write.d.ts +1 -2
- package/dist/native-pinned-write.js +7 -16
- package/dist/native-policy-directory-observation.d.ts +0 -1
- package/dist/native-policy-parent-windows.d.ts +1 -2
- package/dist/native-rename-outcome.d.ts +0 -1
- package/dist/native-staged-file.d.ts +17 -5
- package/dist/native-staged-file.js +56 -65
- package/dist/native.d.ts +0 -1
- package/dist/opened-file-failure.d.ts +0 -1
- package/dist/opened-realpath.d.ts +0 -1
- package/dist/output.d.ts +0 -1
- package/dist/overwrite-file-handle.d.ts +0 -1
- package/dist/owner-dacl.d.ts +0 -1
- package/dist/path-case.d.ts +0 -1
- package/dist/path-policy.d.ts +0 -1
- package/dist/path-prefix.d.ts +0 -1
- package/dist/path-scope-lexical.d.ts +0 -1
- package/dist/path-segment-route.d.ts +0 -1
- package/dist/path-suffix-aliases.d.ts +0 -1
- package/dist/path.d.ts +0 -1
- package/dist/permission-exec.d.ts +0 -1
- package/dist/permission-exec.js +19 -25
- package/dist/permissions-public.d.ts +0 -1
- package/dist/permissions-windows.d.ts +2 -10
- package/dist/permissions-windows.js +10 -30
- package/dist/permissions.d.ts +0 -1
- package/dist/permissions.js +8 -16
- package/dist/pinned-mutation-admission.d.ts +1 -2
- package/dist/pinned-mutation-observation.d.ts +0 -1
- package/dist/pinned-mutation-shared-route.d.ts +0 -1
- package/dist/pinned-open.d.ts +1 -1
- package/dist/pinned-open.js +7 -2
- package/dist/pinned-operation.d.ts +1 -2
- package/dist/pinned-operation.js +3 -16
- package/dist/pinned-write-input.d.ts +0 -1
- package/dist/pinned-write-mode.d.ts +0 -1
- package/dist/pinned-write-mode.js +1 -1
- package/dist/pinned-write-staged.d.ts +0 -1
- package/dist/pinned-write-staged.js +1 -2
- package/dist/pinned-write-types.d.ts +9 -21
- package/dist/pinned-write.d.ts +0 -2
- package/dist/pinned-write.js +3 -5
- package/dist/positional-read.d.ts +0 -1
- package/dist/private-directory.d.ts +0 -1
- package/dist/private-producer-handoff-sync.d.ts +2 -13
- package/dist/private-producer-handoff-sync.js +10 -52
- package/dist/private-producer-handoff.d.ts +23 -4
- package/dist/private-producer-handoff.js +69 -46
- package/dist/private-temp-workspace.d.ts +0 -1
- package/dist/private-temp-workspace.js +11 -37
- package/dist/publish-copy-stage.d.ts +1 -2
- package/dist/publish-file-failure.d.ts +0 -1
- package/dist/publish-file.d.ts +0 -2
- package/dist/publish-file.js +1 -2
- package/dist/read-open-flags.d.ts +0 -1
- package/dist/read-opened-file.d.ts +0 -1
- package/dist/realpath.d.ts +0 -1
- package/dist/recursive-mkdir-path.d.ts +0 -1
- package/dist/regular-file.d.ts +0 -1
- package/dist/regular-file.js +77 -139
- package/dist/replace-directory.d.ts +0 -1
- package/dist/replace-directory.js +1 -2
- package/dist/replace-file-copy-fallback.d.ts +0 -1
- package/dist/replace-file-copy-fallback.js +14 -3
- package/dist/replace-file-copy-source.d.ts +0 -1
- package/dist/replace-file-copy-source.js +6 -1
- package/dist/replace-file-descriptor.d.ts +0 -1
- package/dist/replace-file-descriptor.js +6 -1
- package/dist/replace-file-mode.d.ts +0 -1
- package/dist/replace-file-rename-policy.d.ts +1 -3
- package/dist/replace-file-temp-owner.d.ts +12 -13
- package/dist/replace-file-temp-owner.js +66 -85
- package/dist/replace-file.d.ts +3 -4
- package/dist/replace-file.js +1 -1
- package/dist/retained-directory-replacement.d.ts +0 -1
- package/dist/root-boundary.d.ts +0 -1
- package/dist/root-context.d.ts +0 -1
- package/dist/root-context.js +3 -7
- package/dist/root-create-input.d.ts +1 -2
- package/dist/root-directory-creation.d.ts +1 -2
- package/dist/root-directory-creation.js +1 -1
- package/dist/root-directory-list.d.ts +0 -1
- package/dist/root-directory-list.js +3 -7
- package/dist/root-directory.d.ts +0 -1
- package/dist/root-entries.d.ts +0 -1
- package/dist/root-entries.js +2 -2
- package/dist/root-errors.d.ts +4 -1
- package/dist/root-errors.js +5 -3
- package/dist/root-file-final-admission.d.ts +0 -1
- package/dist/root-file.d.ts +0 -1
- package/dist/root-impl.d.ts +2 -15
- package/dist/root-impl.js +136 -112
- package/dist/root-move-noreplace.d.ts +0 -1
- package/dist/root-move-noreplace.js +4 -10
- package/dist/root-move-preflight.d.ts +0 -1
- package/dist/root-observed-path.d.ts +0 -1
- package/dist/root-observed-path.js +2 -4
- package/dist/root-options.d.ts +1 -2
- package/dist/root-path-errors.d.ts +0 -1
- package/dist/root-path-existing.d.ts +3 -1
- package/dist/root-path-existing.js +38 -18
- package/dist/root-path-observation.d.ts +0 -1
- package/dist/root-path-stat.d.ts +0 -1
- package/dist/root-path-stat.js +2 -4
- package/dist/root-path.d.ts +0 -1
- package/dist/root-path.js +60 -188
- package/dist/root-paths-lexical.d.ts +0 -1
- package/dist/root-paths.d.ts +0 -1
- package/dist/root-public-types.d.ts +11 -0
- package/dist/root-read-admission.d.ts +0 -1
- package/dist/root-read-admission.js +31 -44
- package/dist/root-remove-identity.d.ts +0 -1
- package/dist/root-remove-identity.js +2 -4
- package/dist/root-remove-receipt.d.ts +0 -1
- package/dist/root-remove.d.ts +0 -1
- package/dist/root-remove.js +2 -4
- package/dist/root-symlink-policy.d.ts +0 -1
- package/dist/root-walk.d.ts +0 -1
- package/dist/root-write-admission.d.ts +1 -2
- package/dist/root-write-admission.js +3 -7
- package/dist/root-write-compatibility.d.ts +0 -1
- package/dist/root-write-complete-parent.d.ts +0 -1
- package/dist/root-write-complete-parent.js +2 -3
- package/dist/root-write-lock-binding.d.ts +0 -1
- package/dist/root-write-mode.d.ts +0 -1
- package/dist/root-write-publication.d.ts +0 -1
- package/dist/root-write-verification.d.ts +1 -2
- package/dist/root.d.ts +2 -7
- package/dist/safe-path-segment.d.ts +1 -2
- package/dist/safe-path-segment.js +2 -5
- package/dist/secret-file.d.ts +0 -1
- package/dist/secret-file.js +7 -18
- package/dist/secret-read-async.d.ts +0 -1
- package/dist/secret-read-async.js +5 -5
- package/dist/secret-read-policy.d.ts +0 -1
- package/dist/secret.d.ts +0 -1
- package/dist/secure-file-windows.d.ts +0 -6
- package/dist/secure-file-windows.js +13 -28
- package/dist/secure-file.d.ts +0 -1
- package/dist/secure-file.js +9 -9
- package/dist/secure-temp-dir.d.ts +0 -1
- package/dist/secure-temp-repair.d.ts +0 -1
- package/dist/secure-temp-repair.js +5 -1
- package/dist/sibling-staged-file.d.ts +0 -1
- package/dist/sibling-staged-file.js +32 -39
- package/dist/sibling-temp.d.ts +0 -1
- package/dist/sidecar-lock-acquire.d.ts +1 -2
- package/dist/sidecar-lock-acquire.js +37 -61
- package/dist/sidecar-lock-admission-context.d.ts +0 -1
- package/dist/sidecar-lock-admission-parser.d.ts +0 -1
- package/dist/sidecar-lock-admission.d.ts +1 -5
- package/dist/sidecar-lock-admission.js +1 -7
- package/dist/sidecar-lock-handle.d.ts +0 -1
- package/dist/sidecar-lock-policy.d.ts +4 -1
- package/dist/sidecar-lock-policy.js +23 -0
- package/dist/sidecar-lock-reclaim.d.ts +0 -1
- package/dist/sidecar-lock-registration.d.ts +13 -0
- package/dist/sidecar-lock-registration.js +47 -0
- package/dist/sidecar-lock-root.d.ts +0 -1
- package/dist/sidecar-lock-stale-admission.d.ts +0 -1
- package/dist/sidecar-lock-stale-admission.js +2 -6
- package/dist/sidecar-lock-target.d.ts +0 -1
- package/dist/sidecar-lock-types.d.ts +22 -17
- package/dist/sidecar-lock.d.ts +0 -1
- package/dist/sidecar-lock.js +16 -83
- package/dist/staged-directory.d.ts +0 -1
- package/dist/staged-file-settlement.d.ts +0 -1
- package/dist/staged-file-types.d.ts +0 -1
- package/dist/stat-observation.d.ts +0 -1
- package/dist/store.d.ts +0 -1
- package/dist/strict-file-identity.d.ts +0 -1
- package/dist/string-coerce.d.ts +0 -1
- package/dist/suppressed-error.d.ts +0 -1
- package/dist/symlink-parents.d.ts +0 -1
- package/dist/temp-cleanup.d.ts +0 -1
- package/dist/temp-target.d.ts +0 -1
- package/dist/temp-target.js +7 -46
- package/dist/temp-workspace-admission.d.ts +0 -8
- package/dist/temp-workspace-admission.js +1 -7
- package/dist/temp-workspace-child-admission.d.ts +16 -6
- package/dist/temp-workspace-child-admission.js +71 -15
- package/dist/temp-workspace-descriptor.d.ts +1 -7
- package/dist/temp-workspace-descriptor.js +1 -4
- package/dist/temp-workspace-owner.d.ts +1 -1
- package/dist/temp-workspace-owner.js +45 -22
- package/dist/temp-workspace-types.d.ts +0 -1
- package/dist/temp.d.ts +0 -1
- package/dist/test-hooks.d.ts +0 -1
- package/dist/text-atomic.d.ts +0 -1
- package/dist/text-atomic.js +1 -1
- package/dist/timing.d.ts +0 -1
- package/dist/trash.d.ts +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/unicode-path.d.ts +0 -1
- package/dist/walk.d.ts +0 -1
- package/dist/windows-command.d.ts +0 -1
- package/dist/windows-owner.d.ts +0 -1
- package/dist/windows-owner.js +5 -2
- package/dist/windows-path-alias.d.ts +1 -1
- package/dist/windows-path-alias.js +12 -43
- package/dist/windows-path-syntax.d.ts +5 -0
- package/dist/windows-path-syntax.js +21 -0
- package/dist/windows-security-command.d.ts +0 -1
- package/dist/windows-security-facts.d.ts +0 -1
- package/dist/write-file-handle.d.ts +0 -1
- package/dist/write-open-flags.d.ts +0 -1
- package/dist/write-queue.d.ts +0 -1
- package/docs/advanced.md +3 -1
- package/docs/atomic.md +14 -0
- package/docs/copy.md +2 -0
- package/docs/mutation-policy-proof.md +6 -4
- package/docs/permissions.md +6 -0
- package/docs/root.md +10 -0
- package/docs/secret-file.md +8 -0
- package/docs/sidecar-lock.md +4 -0
- package/docs/store.md +6 -0
- package/docs/temp.md +8 -1
- package/docs/writing.md +14 -3
- package/package.json +8 -9
- package/dist/absolute-path.d.ts.map +0 -1
- package/dist/advanced.d.ts.map +0 -1
- package/dist/archive-crc32.d.ts.map +0 -1
- package/dist/archive-deadline.d.ts.map +0 -1
- package/dist/archive-durability.d.ts.map +0 -1
- package/dist/archive-entry.d.ts.map +0 -1
- package/dist/archive-errors.d.ts.map +0 -1
- package/dist/archive-gzip-tail.d.ts.map +0 -1
- package/dist/archive-input.d.ts.map +0 -1
- package/dist/archive-kind.d.ts.map +0 -1
- package/dist/archive-limits.d.ts.map +0 -1
- package/dist/archive-merge.d.ts.map +0 -1
- package/dist/archive-native.d.ts +0 -22
- package/dist/archive-native.d.ts.map +0 -1
- package/dist/archive-native.js +0 -98
- package/dist/archive-options.d.ts +0 -25
- package/dist/archive-options.d.ts.map +0 -1
- package/dist/archive-parser-errors.d.ts.map +0 -1
- package/dist/archive-plan.d.ts.map +0 -1
- package/dist/archive-policy.d.ts +0 -22
- package/dist/archive-policy.d.ts.map +0 -1
- package/dist/archive-policy.js +0 -38
- package/dist/archive-read.d.ts.map +0 -1
- package/dist/archive-staging.d.ts.map +0 -1
- package/dist/archive-tar-inspect.d.ts +0 -7
- package/dist/archive-tar-inspect.d.ts.map +0 -1
- package/dist/archive-tar-inspect.js +0 -62
- package/dist/archive-tar-stream.d.ts.map +0 -1
- package/dist/archive-tar-wasm.d.ts.map +0 -1
- package/dist/archive-tar.d.ts +0 -19
- package/dist/archive-tar.d.ts.map +0 -1
- package/dist/archive-tar.js +0 -21
- package/dist/archive-zip-admission.d.ts.map +0 -1
- package/dist/archive-zip-count.d.ts.map +0 -1
- package/dist/archive-zip-directory.d.ts.map +0 -1
- package/dist/archive-zip-entry.d.ts.map +0 -1
- package/dist/archive-zip-integrity.d.ts.map +0 -1
- package/dist/archive-zip-loader.d.ts.map +0 -1
- package/dist/archive-zip-manifest.d.ts.map +0 -1
- package/dist/archive-zip-names.d.ts.map +0 -1
- package/dist/archive-zip-preflight.d.ts.map +0 -1
- package/dist/archive.d.ts.map +0 -1
- package/dist/async-lock.d.ts.map +0 -1
- package/dist/atomic.d.ts.map +0 -1
- package/dist/bounded-read-stream.d.ts.map +0 -1
- package/dist/bounded-read.d.ts.map +0 -1
- package/dist/byte-budget.d.ts.map +0 -1
- package/dist/byte-view.d.ts.map +0 -1
- package/dist/clone-metadata.d.ts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/containment.d.ts.map +0 -1
- package/dist/copy-file-input.d.ts.map +0 -1
- package/dist/copy-policy.d.ts.map +0 -1
- package/dist/copy-publication.d.ts.map +0 -1
- package/dist/copy-tree-portable.d.ts.map +0 -1
- package/dist/copy.d.ts.map +0 -1
- package/dist/create-directory.d.ts +0 -20
- package/dist/create-directory.d.ts.map +0 -1
- package/dist/create-directory.js +0 -130
- package/dist/create-file-async.d.ts +0 -7
- package/dist/create-file-async.d.ts.map +0 -1
- package/dist/create-file-async.js +0 -121
- package/dist/create-file.d.ts +0 -8
- package/dist/create-file.d.ts.map +0 -1
- package/dist/create-file.js +0 -190
- package/dist/create-owned-file.d.ts.map +0 -1
- package/dist/create.d.ts.map +0 -1
- package/dist/creation-darwin.d.ts +0 -6
- package/dist/creation-darwin.d.ts.map +0 -1
- package/dist/creation-darwin.js +0 -70
- package/dist/creation-file-state.d.ts +0 -19
- package/dist/creation-file-state.d.ts.map +0 -1
- package/dist/creation-file-state.js +0 -118
- package/dist/creation-path.d.ts +0 -21
- package/dist/creation-path.d.ts.map +0 -1
- package/dist/creation-path.js +0 -71
- package/dist/creation-permissions.d.ts +0 -19
- package/dist/creation-permissions.d.ts.map +0 -1
- package/dist/creation-permissions.js +0 -125
- package/dist/deny-mutations.d.ts.map +0 -1
- package/dist/device-path.d.ts.map +0 -1
- package/dist/directory-durability.d.ts.map +0 -1
- package/dist/directory-entry-path.d.ts.map +0 -1
- package/dist/directory-guard.d.ts.map +0 -1
- package/dist/directory-mode-node.d.ts.map +0 -1
- package/dist/directory-mode-owner.d.ts.map +0 -1
- package/dist/directory-receipt.d.ts.map +0 -1
- package/dist/durability.d.ts.map +0 -1
- package/dist/effective-uid.d.ts.map +0 -1
- package/dist/error-detail.d.ts.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/file-cleanup.d.ts.map +0 -1
- package/dist/file-contents.d.ts.map +0 -1
- package/dist/file-handle-transfer.d.ts.map +0 -1
- package/dist/file-hash.d.ts.map +0 -1
- package/dist/file-identity.d.ts.map +0 -1
- package/dist/file-lock-sync-admission.d.ts.map +0 -1
- package/dist/file-lock-sync-root-acquire.d.ts.map +0 -1
- package/dist/file-lock-sync-root-arbitration.d.ts.map +0 -1
- package/dist/file-lock-sync-root-held.d.ts.map +0 -1
- package/dist/file-lock-sync-root-io.d.ts.map +0 -1
- package/dist/file-lock-sync-root-mutation.d.ts.map +0 -1
- package/dist/file-lock-sync-root-options.d.ts.map +0 -1
- package/dist/file-lock-sync-root-registration.d.ts.map +0 -1
- package/dist/file-lock-sync-root.d.ts.map +0 -1
- package/dist/file-lock-sync-stale-admission.d.ts.map +0 -1
- package/dist/file-lock-sync.d.ts.map +0 -1
- package/dist/file-lock.d.ts.map +0 -1
- package/dist/file-observation.d.ts.map +0 -1
- package/dist/file-store-boundary.d.ts.map +0 -1
- package/dist/file-store-copy-source.d.ts +0 -5
- package/dist/file-store-copy-source.d.ts.map +0 -1
- package/dist/file-store-copy-source.js +0 -31
- package/dist/file-store-limit.d.ts +0 -2
- package/dist/file-store-limit.d.ts.map +0 -1
- package/dist/file-store-limit.js +0 -8
- package/dist/file-store-path.d.ts +0 -3
- package/dist/file-store-path.d.ts.map +0 -1
- package/dist/file-store-path.js +0 -30
- package/dist/file-store-prune.d.ts.map +0 -1
- package/dist/file-store-sync-directory.d.ts.map +0 -1
- package/dist/file-store-sync-write.d.ts.map +0 -1
- package/dist/file-store.d.ts.map +0 -1
- package/dist/file-sync.d.ts.map +0 -1
- package/dist/filename.d.ts.map +0 -1
- package/dist/fs.d.ts.map +0 -1
- package/dist/guarded-mkdir.d.ts.map +0 -1
- package/dist/guarded-mutation.d.ts.map +0 -1
- package/dist/guest-dispatch-python.d.ts.map +0 -1
- package/dist/guest-native-python.d.ts.map +0 -1
- package/dist/guest.d.ts.map +0 -1
- package/dist/home-dir.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/install-path.d.ts.map +0 -1
- package/dist/json-document-store.d.ts.map +0 -1
- package/dist/json-durable-queue-directory.d.ts.map +0 -1
- package/dist/json-durable-queue-ownership.d.ts.map +0 -1
- package/dist/json-durable-queue-paths.d.ts +0 -11
- package/dist/json-durable-queue-paths.d.ts.map +0 -1
- package/dist/json-durable-queue-paths.js +0 -20
- package/dist/json-durable-queue-read.d.ts.map +0 -1
- package/dist/json-durable-queue.d.ts.map +0 -1
- package/dist/json-store.d.ts.map +0 -1
- package/dist/json-stringify.d.ts.map +0 -1
- package/dist/json.d.ts.map +0 -1
- package/dist/local-file-access.d.ts.map +0 -1
- package/dist/local-file-descriptor.d.ts.map +0 -1
- package/dist/local-roots.d.ts.map +0 -1
- package/dist/lock-config.d.ts.map +0 -1
- package/dist/move-path-cleanup.d.ts.map +0 -1
- package/dist/move-path-stage.d.ts.map +0 -1
- package/dist/move-path.d.ts.map +0 -1
- package/dist/mutation-authority.d.ts.map +0 -1
- package/dist/native-binding.d.ts.map +0 -1
- package/dist/native-config.d.ts.map +0 -1
- package/dist/native-directory-observation.d.ts.map +0 -1
- package/dist/native-fallback-warning.d.ts.map +0 -1
- package/dist/native-operations.d.ts.map +0 -1
- package/dist/native-parent-admission.d.ts.map +0 -1
- package/dist/native-pinned-write-windows.d.ts.map +0 -1
- package/dist/native-pinned-write.d.ts.map +0 -1
- package/dist/native-policy-directory-observation.d.ts.map +0 -1
- package/dist/native-policy-parent-windows.d.ts.map +0 -1
- package/dist/native-rename-outcome.d.ts.map +0 -1
- package/dist/native-staged-file.d.ts.map +0 -1
- package/dist/native.d.ts.map +0 -1
- package/dist/opened-file-failure.d.ts.map +0 -1
- package/dist/opened-realpath.d.ts.map +0 -1
- package/dist/output.d.ts.map +0 -1
- package/dist/overwrite-file-handle.d.ts.map +0 -1
- package/dist/owner-dacl.d.ts.map +0 -1
- package/dist/path-case.d.ts.map +0 -1
- package/dist/path-policy.d.ts.map +0 -1
- package/dist/path-prefix.d.ts.map +0 -1
- package/dist/path-scope-lexical.d.ts.map +0 -1
- package/dist/path-segment-route.d.ts.map +0 -1
- package/dist/path-suffix-aliases.d.ts.map +0 -1
- package/dist/path.d.ts.map +0 -1
- package/dist/permission-exec.d.ts.map +0 -1
- package/dist/permissions-public.d.ts.map +0 -1
- package/dist/permissions-windows.d.ts.map +0 -1
- package/dist/permissions.d.ts.map +0 -1
- package/dist/pinned-mutation-admission.d.ts.map +0 -1
- package/dist/pinned-mutation-observation.d.ts.map +0 -1
- package/dist/pinned-mutation-shared-route.d.ts.map +0 -1
- package/dist/pinned-open.d.ts.map +0 -1
- package/dist/pinned-operation.d.ts.map +0 -1
- package/dist/pinned-write-input.d.ts.map +0 -1
- package/dist/pinned-write-mode.d.ts.map +0 -1
- package/dist/pinned-write-staged.d.ts.map +0 -1
- package/dist/pinned-write-types.d.ts.map +0 -1
- package/dist/pinned-write.d.ts.map +0 -1
- package/dist/positional-read.d.ts.map +0 -1
- package/dist/private-directory.d.ts.map +0 -1
- package/dist/private-producer-handoff-sync.d.ts.map +0 -1
- package/dist/private-producer-handoff.d.ts.map +0 -1
- package/dist/private-temp-workspace.d.ts.map +0 -1
- package/dist/publish-copy-stage.d.ts.map +0 -1
- package/dist/publish-file-failure.d.ts.map +0 -1
- package/dist/publish-file.d.ts.map +0 -1
- package/dist/read-open-flags.d.ts.map +0 -1
- package/dist/read-opened-file.d.ts.map +0 -1
- package/dist/realpath.d.ts.map +0 -1
- package/dist/recursive-mkdir-path.d.ts.map +0 -1
- package/dist/regular-file.d.ts.map +0 -1
- package/dist/replace-directory.d.ts.map +0 -1
- package/dist/replace-file-copy-fallback.d.ts.map +0 -1
- package/dist/replace-file-copy-source.d.ts.map +0 -1
- package/dist/replace-file-descriptor.d.ts.map +0 -1
- package/dist/replace-file-mode.d.ts.map +0 -1
- package/dist/replace-file-rename-policy.d.ts.map +0 -1
- package/dist/replace-file-temp-owner.d.ts.map +0 -1
- package/dist/replace-file.d.ts.map +0 -1
- package/dist/retained-directory-replacement.d.ts.map +0 -1
- package/dist/root-boundary.d.ts.map +0 -1
- package/dist/root-context.d.ts.map +0 -1
- package/dist/root-create-input.d.ts.map +0 -1
- package/dist/root-directory-creation.d.ts.map +0 -1
- package/dist/root-directory-list.d.ts.map +0 -1
- package/dist/root-directory.d.ts.map +0 -1
- package/dist/root-entries.d.ts.map +0 -1
- package/dist/root-errors.d.ts.map +0 -1
- package/dist/root-file-final-admission.d.ts.map +0 -1
- package/dist/root-file.d.ts.map +0 -1
- package/dist/root-impl.d.ts.map +0 -1
- package/dist/root-move-noreplace.d.ts.map +0 -1
- package/dist/root-move-preflight.d.ts.map +0 -1
- package/dist/root-observed-path.d.ts.map +0 -1
- package/dist/root-options.d.ts.map +0 -1
- package/dist/root-path-errors.d.ts.map +0 -1
- package/dist/root-path-existing.d.ts.map +0 -1
- package/dist/root-path-observation.d.ts.map +0 -1
- package/dist/root-path-stat.d.ts.map +0 -1
- package/dist/root-path-symlink.d.ts +0 -7
- package/dist/root-path-symlink.d.ts.map +0 -1
- package/dist/root-path-symlink.js +0 -55
- package/dist/root-path.d.ts.map +0 -1
- package/dist/root-paths-lexical.d.ts.map +0 -1
- package/dist/root-paths.d.ts.map +0 -1
- package/dist/root-read-admission.d.ts.map +0 -1
- package/dist/root-remove-identity.d.ts.map +0 -1
- package/dist/root-remove-receipt.d.ts.map +0 -1
- package/dist/root-remove.d.ts.map +0 -1
- package/dist/root-symlink-policy.d.ts.map +0 -1
- package/dist/root-walk.d.ts.map +0 -1
- package/dist/root-write-admission.d.ts.map +0 -1
- package/dist/root-write-compatibility.d.ts.map +0 -1
- package/dist/root-write-complete-parent.d.ts.map +0 -1
- package/dist/root-write-lock-binding.d.ts.map +0 -1
- package/dist/root-write-mode.d.ts.map +0 -1
- package/dist/root-write-publication.d.ts.map +0 -1
- package/dist/root-write-verification.d.ts.map +0 -1
- package/dist/root.d.ts.map +0 -1
- package/dist/safe-path-segment.d.ts.map +0 -1
- package/dist/secret-file.d.ts.map +0 -1
- package/dist/secret-read-async.d.ts.map +0 -1
- package/dist/secret-read-policy.d.ts.map +0 -1
- package/dist/secret.d.ts.map +0 -1
- package/dist/secure-file-windows.d.ts.map +0 -1
- package/dist/secure-file.d.ts.map +0 -1
- package/dist/secure-temp-dir.d.ts.map +0 -1
- package/dist/secure-temp-repair.d.ts.map +0 -1
- package/dist/sibling-staged-file.d.ts.map +0 -1
- package/dist/sibling-temp.d.ts.map +0 -1
- package/dist/sidecar-lock-acquire.d.ts.map +0 -1
- package/dist/sidecar-lock-admission-context.d.ts.map +0 -1
- package/dist/sidecar-lock-admission-parser.d.ts.map +0 -1
- package/dist/sidecar-lock-admission.d.ts.map +0 -1
- package/dist/sidecar-lock-handle.d.ts.map +0 -1
- package/dist/sidecar-lock-policy.d.ts.map +0 -1
- package/dist/sidecar-lock-reclaim.d.ts.map +0 -1
- package/dist/sidecar-lock-root.d.ts.map +0 -1
- package/dist/sidecar-lock-stale-admission.d.ts.map +0 -1
- package/dist/sidecar-lock-target.d.ts.map +0 -1
- package/dist/sidecar-lock-types.d.ts.map +0 -1
- package/dist/sidecar-lock.d.ts.map +0 -1
- package/dist/staged-directory.d.ts.map +0 -1
- package/dist/staged-file-settlement.d.ts.map +0 -1
- package/dist/staged-file-types.d.ts.map +0 -1
- package/dist/standalone-publication-path.d.ts +0 -2
- package/dist/standalone-publication-path.d.ts.map +0 -1
- package/dist/standalone-publication-path.js +0 -6
- package/dist/stat-observation.d.ts.map +0 -1
- package/dist/store.d.ts.map +0 -1
- package/dist/strict-file-identity.d.ts.map +0 -1
- package/dist/string-coerce.d.ts.map +0 -1
- package/dist/suppressed-error.d.ts.map +0 -1
- package/dist/symlink-parents.d.ts.map +0 -1
- package/dist/temp-cleanup.d.ts.map +0 -1
- package/dist/temp-target.d.ts.map +0 -1
- package/dist/temp-workspace-admission.d.ts.map +0 -1
- package/dist/temp-workspace-child-admission.d.ts.map +0 -1
- package/dist/temp-workspace-descriptor.d.ts.map +0 -1
- package/dist/temp-workspace-identity.d.ts +0 -15
- package/dist/temp-workspace-identity.d.ts.map +0 -1
- package/dist/temp-workspace-identity.js +0 -41
- package/dist/temp-workspace-owner.d.ts.map +0 -1
- package/dist/temp-workspace-permissions.d.ts +0 -4
- package/dist/temp-workspace-permissions.d.ts.map +0 -1
- package/dist/temp-workspace-permissions.js +0 -32
- package/dist/temp-workspace-types.d.ts.map +0 -1
- package/dist/temp.d.ts.map +0 -1
- package/dist/test-hooks.d.ts.map +0 -1
- package/dist/text-atomic.d.ts.map +0 -1
- package/dist/timing.d.ts.map +0 -1
- package/dist/trash.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/unicode-path.d.ts.map +0 -1
- package/dist/walk.d.ts.map +0 -1
- package/dist/windows-command.d.ts.map +0 -1
- package/dist/windows-owner.d.ts.map +0 -1
- package/dist/windows-path-alias.d.ts.map +0 -1
- package/dist/windows-security-command.d.ts.map +0 -1
- package/dist/windows-security-facts.d.ts.map +0 -1
- package/dist/write-file-handle.d.ts.map +0 -1
- package/dist/write-open-flags.d.ts.map +0 -1
- package/dist/write-queue.d.ts.map +0 -1
- /package/dist/{archive-options.js → root-public-types.js} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type BigIntStats } from "node:fs";
|
|
2
2
|
import { type FileHandle } from "node:fs/promises";
|
|
3
|
+
import { FsSafeError } from "./errors.js";
|
|
3
4
|
import { type TempPathRegistration } from "./temp-cleanup.js";
|
|
4
5
|
export type PrivateProducerHandoff = {
|
|
5
6
|
handle: FileHandle;
|
|
@@ -17,18 +18,36 @@ type HandoffPaths = HandoffParents & {
|
|
|
17
18
|
type ProducerHandoffParams = HandoffPaths & {
|
|
18
19
|
readWrite: boolean;
|
|
19
20
|
};
|
|
20
|
-
type CreatedHandoffParams = HandoffPaths & {
|
|
21
|
-
source:
|
|
21
|
+
export type CreatedHandoffParams<TSource = FileHandle, TVerification = Promise<void>> = HandoffPaths & {
|
|
22
|
+
source: TSource;
|
|
22
23
|
identity: BigIntStats;
|
|
23
24
|
assertBeforeMutation?: () => void;
|
|
24
|
-
verifyDescriptor?: (fd: number, path: string, links: number) =>
|
|
25
|
+
verifyDescriptor?: (fd: number, path: string, links: number) => TVerification;
|
|
25
26
|
onPublished?: () => void;
|
|
26
27
|
};
|
|
27
28
|
export declare function assertInitialSource(stat: BigIntStats): void;
|
|
28
29
|
export declare function inspectLinkedFile(inspect: () => BigIntStats, expected: BigIntStats, links: bigint, label: string): BigIntStats;
|
|
29
30
|
export declare function assertParents(params: HandoffParents): void;
|
|
30
31
|
export declare function normalizeLinkError(error: unknown): unknown;
|
|
32
|
+
export declare class FileHandoff {
|
|
33
|
+
private readonly paths;
|
|
34
|
+
private readonly identity;
|
|
35
|
+
private readonly createdLabels;
|
|
36
|
+
siblingOwned: boolean;
|
|
37
|
+
publication: "not-published" | "published" | "indeterminate";
|
|
38
|
+
cleanup: "preserved" | "removed" | "failed";
|
|
39
|
+
closeFailed: boolean;
|
|
40
|
+
constructor(paths: HandoffPaths, identity: BigIntStats, createdLabels?: boolean);
|
|
41
|
+
inspect(owner: {
|
|
42
|
+
readonly fd: number;
|
|
43
|
+
}, links: bigint): {
|
|
44
|
+
opened: BigIntStats;
|
|
45
|
+
named?: BigIntStats;
|
|
46
|
+
};
|
|
47
|
+
publish(): void;
|
|
48
|
+
retireSource(): void;
|
|
49
|
+
failure(failures: readonly unknown[], aggregateMessage: string): FsSafeError;
|
|
50
|
+
}
|
|
31
51
|
export declare function handoffPrivateProducerFile(params: ProducerHandoffParams): Promise<PrivateProducerHandoff>;
|
|
32
52
|
export declare function handoffCreatedFile(params: CreatedHandoffParams): Promise<FileHandle>;
|
|
33
53
|
export {};
|
|
34
|
-
//# sourceMappingURL=private-producer-handoff.d.ts.map
|
|
@@ -165,14 +165,62 @@ async function openProducerSource(params, identity, links = 1n) {
|
|
|
165
165
|
}
|
|
166
166
|
return fallback;
|
|
167
167
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
168
|
+
export class FileHandoff {
|
|
169
|
+
paths;
|
|
170
|
+
identity;
|
|
171
|
+
createdLabels;
|
|
172
|
+
siblingOwned = false;
|
|
173
|
+
publication = "not-published";
|
|
174
|
+
cleanup = "preserved";
|
|
175
|
+
closeFailed = false;
|
|
176
|
+
constructor(paths, identity, createdLabels = false) {
|
|
177
|
+
this.paths = paths;
|
|
178
|
+
this.identity = identity;
|
|
179
|
+
this.createdLabels = createdLabels;
|
|
180
|
+
}
|
|
181
|
+
inspect(owner, links) {
|
|
182
|
+
assertParents(this.paths);
|
|
183
|
+
const opened = inspectLinkedFile(() => fsSync.fstatSync(owner.fd, { bigint: true }), this.identity, links, this.createdLabels ? "created file descriptor" : "isolated producer descriptor");
|
|
184
|
+
if (this.cleanup !== "removed") {
|
|
185
|
+
inspectLinkedFile(() => fsSync.lstatSync(this.paths.sourcePath, { bigint: true }), this.identity, links, this.createdLabels ? "created file stage" : "isolated producer path");
|
|
186
|
+
}
|
|
187
|
+
const named = this.publication === "published"
|
|
188
|
+
? inspectLinkedFile(() => fsSync.lstatSync(this.paths.targetPath, { bigint: true }), this.identity, links, this.createdLabels ? "created file destination" : "isolated producer sibling")
|
|
189
|
+
: undefined;
|
|
190
|
+
return { opened, named };
|
|
191
|
+
}
|
|
192
|
+
publish() {
|
|
193
|
+
this.publication = "indeterminate";
|
|
194
|
+
try {
|
|
195
|
+
fsSync.linkSync(this.paths.sourcePath, this.paths.targetPath);
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
const normalized = normalizeLinkError(error);
|
|
199
|
+
if (normalized instanceof FsSafeError &&
|
|
200
|
+
(normalized.code === "already-exists" || normalized.code === "helper-unavailable")) {
|
|
201
|
+
this.publication = "not-published";
|
|
202
|
+
}
|
|
203
|
+
throw normalized;
|
|
204
|
+
}
|
|
205
|
+
this.publication = "published";
|
|
206
|
+
}
|
|
207
|
+
retireSource() {
|
|
208
|
+
this.cleanup = "failed";
|
|
209
|
+
fsSync.unlinkSync(this.paths.sourcePath);
|
|
210
|
+
this.cleanup = "removed";
|
|
211
|
+
}
|
|
212
|
+
failure(failures, aggregateMessage) {
|
|
213
|
+
const primary = failures[0];
|
|
214
|
+
// Collision-as-no-op callers must still observe a failed settlement.
|
|
215
|
+
return new FsSafeError(this.closeFailed || failures.length > 1 ? "helper-failed" : primary instanceof FsSafeError ? primary.code : "helper-failed", "created file publication failed", {
|
|
216
|
+
cause: failures.length === 1 ? primary : new AggregateError(failures, aggregateMessage),
|
|
217
|
+
details: {
|
|
218
|
+
publication: { status: this.publication }, cleanup: this.cleanup,
|
|
219
|
+
resources: this.closeFailed ? "close-failed" : "closed",
|
|
220
|
+
path: this.paths.targetPath, dev: this.identity.dev, ino: this.identity.ino,
|
|
221
|
+
},
|
|
222
|
+
});
|
|
173
223
|
}
|
|
174
|
-
const named = state.publication === "published" ? inspectLinkedFile(() => fsSync.lstatSync(params.targetPath, { bigint: true }), identity, links, "isolated producer sibling") : undefined;
|
|
175
|
-
return { opened, named };
|
|
176
224
|
}
|
|
177
225
|
async function handoffFile(params) {
|
|
178
226
|
const created = "source" in params ? params : undefined;
|
|
@@ -186,9 +234,7 @@ async function handoffFile(params) {
|
|
|
186
234
|
const owners = new Set(handle ? [handle] : []);
|
|
187
235
|
const failures = [];
|
|
188
236
|
let unregister;
|
|
189
|
-
const state =
|
|
190
|
-
siblingOwned: false, publication: "not-published", cleanup: "preserved", closeFailed: false,
|
|
191
|
-
};
|
|
237
|
+
const state = new FileHandoff(params, identity);
|
|
192
238
|
async function close(owned) {
|
|
193
239
|
// Final creation consumes its pin before close can release and recycle it.
|
|
194
240
|
// Legacy temporary handoff retains its historical FileHandle close retry.
|
|
@@ -209,7 +255,7 @@ async function handoffFile(params) {
|
|
|
209
255
|
handle = await openProducerSource({ ...params, readWrite: "readWrite" in params && params.readWrite }, identity);
|
|
210
256
|
owners.add(handle);
|
|
211
257
|
}
|
|
212
|
-
|
|
258
|
+
state.inspect(handle, 1n);
|
|
213
259
|
if (created?.verifyDescriptor)
|
|
214
260
|
await created.verifyDescriptor(handle.fd, params.sourcePath, 1);
|
|
215
261
|
if (!created) {
|
|
@@ -220,20 +266,8 @@ async function handoffFile(params) {
|
|
|
220
266
|
});
|
|
221
267
|
}
|
|
222
268
|
assertSynchronousCallbackResult(created?.assertBeforeMutation?.(), "assertBeforeMutation");
|
|
223
|
-
|
|
224
|
-
state.
|
|
225
|
-
try {
|
|
226
|
-
fsSync.linkSync(params.sourcePath, params.targetPath);
|
|
227
|
-
}
|
|
228
|
-
catch (error) {
|
|
229
|
-
const normalized = normalizeLinkError(error);
|
|
230
|
-
if (normalized instanceof FsSafeError &&
|
|
231
|
-
(normalized.code === "already-exists" || normalized.code === "helper-unavailable")) {
|
|
232
|
-
state.publication = "not-published";
|
|
233
|
-
}
|
|
234
|
-
throw normalized;
|
|
235
|
-
}
|
|
236
|
-
state.publication = "published";
|
|
269
|
+
state.inspect(handle, 1n);
|
|
270
|
+
state.publish();
|
|
237
271
|
state.siblingOwned = !created;
|
|
238
272
|
try {
|
|
239
273
|
assertSynchronousCallbackResult(created?.onPublished?.(), "onPublished");
|
|
@@ -241,7 +275,7 @@ async function handoffFile(params) {
|
|
|
241
275
|
catch (error) {
|
|
242
276
|
failures.push(error);
|
|
243
277
|
}
|
|
244
|
-
|
|
278
|
+
state.inspect(handle, 2n);
|
|
245
279
|
if (process.platform === "win32") {
|
|
246
280
|
// Legacy Windows unlink retains a delete-pending name until handles
|
|
247
281
|
// opened through that name close. Transfer the pin before retiring it.
|
|
@@ -250,26 +284,24 @@ async function handoffFile(params) {
|
|
|
250
284
|
: await openProducerSource({ ...params, sourcePath: params.targetPath,
|
|
251
285
|
readWrite: "readWrite" in params && params.readWrite }, identity, 2n);
|
|
252
286
|
owners.add(sibling);
|
|
253
|
-
|
|
287
|
+
state.inspect(sibling, 2n);
|
|
254
288
|
if (created?.verifyDescriptor)
|
|
255
289
|
await created.verifyDescriptor(sibling.fd, params.targetPath, 2);
|
|
256
|
-
|
|
290
|
+
state.inspect(sibling, 2n);
|
|
257
291
|
inspectSourceDescriptor(handle, identity, 2n);
|
|
258
292
|
await close(handle);
|
|
259
293
|
handle = sibling;
|
|
260
294
|
// The old handle's close yielded; both names must still be ours.
|
|
261
|
-
|
|
295
|
+
state.inspect(handle, 2n);
|
|
262
296
|
}
|
|
263
297
|
if (created?.verifyDescriptor)
|
|
264
298
|
await created.verifyDescriptor(handle.fd, process.platform === "win32" ? params.targetPath : params.sourcePath, 2);
|
|
265
299
|
assertSynchronousCallbackResult(created?.assertBeforeMutation?.(), "assertBeforeMutation");
|
|
266
|
-
|
|
267
|
-
state.
|
|
268
|
-
fsSync.unlinkSync(params.sourcePath);
|
|
269
|
-
state.cleanup = "removed";
|
|
300
|
+
state.inspect(handle, 2n);
|
|
301
|
+
state.retireSource();
|
|
270
302
|
if (created?.verifyDescriptor)
|
|
271
303
|
await created.verifyDescriptor(handle.fd, params.targetPath, 1);
|
|
272
|
-
const { opened, named } =
|
|
304
|
+
const { opened, named } = state.inspect(handle, 1n);
|
|
273
305
|
const originalMode = identity.mode & 511n;
|
|
274
306
|
if (!created && process.platform === "win32" && (originalMode & 128n) === 0n &&
|
|
275
307
|
((opened.mode & 511n) !== originalMode || (named.mode & 511n) !== originalMode)) {
|
|
@@ -277,7 +309,7 @@ async function handoffFile(params) {
|
|
|
277
309
|
// admitted sibling inode, without reopening or chmodding its pathname.
|
|
278
310
|
assertParents(params);
|
|
279
311
|
fsSync.fchmodSync(handle.fd, Number(originalMode));
|
|
280
|
-
const restored =
|
|
312
|
+
const restored = state.inspect(handle, 1n);
|
|
281
313
|
if ((restored.opened.mode & 511n) !== originalMode || (restored.named.mode & 511n) !== originalMode) {
|
|
282
314
|
throw pathMismatch("isolated producer read-only mode could not be restored");
|
|
283
315
|
}
|
|
@@ -314,18 +346,9 @@ async function handoffFile(params) {
|
|
|
314
346
|
failures.push(error);
|
|
315
347
|
}
|
|
316
348
|
}
|
|
317
|
-
const primary = failures[0];
|
|
318
|
-
const cause = combinedFailure(primary, failures.slice(1));
|
|
319
349
|
if (!created)
|
|
320
|
-
throw
|
|
321
|
-
throw
|
|
322
|
-
cause,
|
|
323
|
-
details: {
|
|
324
|
-
publication: { status: state.publication }, cleanup: state.cleanup,
|
|
325
|
-
resources: state.closeFailed ? "close-failed" : "closed",
|
|
326
|
-
path: params.targetPath, dev: identity.dev, ino: identity.ino,
|
|
327
|
-
},
|
|
328
|
-
});
|
|
350
|
+
throw combinedFailure(failures[0], failures.slice(1));
|
|
351
|
+
throw state.failure(failures, "isolated producer handoff and settlement failed");
|
|
329
352
|
}
|
|
330
353
|
export function handoffPrivateProducerFile(params) {
|
|
331
354
|
return handoffFile(params);
|
|
@@ -5,4 +5,3 @@ export declare function tempWorkspace(options: TempWorkspaceOptions): Promise<Te
|
|
|
5
5
|
export declare function withTempWorkspace<T>(options: TempWorkspaceOptions, run: (workspace: TempWorkspace) => Promise<T>): Promise<T>;
|
|
6
6
|
export declare function tempWorkspaceSync(options: TempWorkspaceOptions): TempWorkspaceSync;
|
|
7
7
|
export declare function withTempWorkspaceSync<T>(options: TempWorkspaceOptions, run: (workspace: TempWorkspaceSync) => T): T;
|
|
8
|
-
//# sourceMappingURL=private-temp-workspace.d.ts.map
|
|
@@ -9,12 +9,11 @@ import { inspectDirectoryIdentitySync } from "./directory-guard.js";
|
|
|
9
9
|
import { throwFsSafeReadError } from "./root-errors.js";
|
|
10
10
|
import { matchRootFileOpenFailure, openRootFileSync, } from "./root-file.js";
|
|
11
11
|
import { registerTempPathForExit, } from "./temp-cleanup.js";
|
|
12
|
-
import { TempWorkspaceCleanupCapability, TempWorkspaceCleanupOwner, } from "./temp-workspace-owner.js";
|
|
12
|
+
import { TempWorkspaceCleanupCapability, TempWorkspaceCleanupOwner, throwTempWorkspaceCreationFailure, } from "./temp-workspace-owner.js";
|
|
13
13
|
import { assertNoWindowsPathAlias, hasWindowsPathAlias, } from "./windows-path-alias.js";
|
|
14
14
|
import { TempWorkspaceRetainedChild } from "./temp-workspace-descriptor.js";
|
|
15
|
-
import {
|
|
15
|
+
import { validateInitialTempWorkspaceChild, validateTempWorkspaceDirMode } from "./temp-workspace-child-admission.js";
|
|
16
16
|
import { admitTempWorkspaceRoot, admitTempWorkspaceRootSync, } from "./temp-workspace-admission.js";
|
|
17
|
-
import { validateTempWorkspaceDirMode } from "./temp-workspace-permissions.js";
|
|
18
17
|
function resolveTempWorkspaceCleanupSafety(value) {
|
|
19
18
|
if (value === undefined || value === "compatible")
|
|
20
19
|
return "compatible";
|
|
@@ -125,36 +124,6 @@ function tempWorkspaceChildPrefix(root, options, scopedPrefix) {
|
|
|
125
124
|
assertNoWindowsPathAlias(childPrefix, "filesystem", "temp workspace path uses a Windows filesystem namespace alias");
|
|
126
125
|
return childPrefix;
|
|
127
126
|
}
|
|
128
|
-
function throwTempWorkspaceCreationFailure(error, retainedChild, capability, owner) {
|
|
129
|
-
try {
|
|
130
|
-
if (owner)
|
|
131
|
-
owner.cleanupSync();
|
|
132
|
-
else {
|
|
133
|
-
const closeErrors = [];
|
|
134
|
-
try {
|
|
135
|
-
retainedChild?.close();
|
|
136
|
-
}
|
|
137
|
-
catch (closeError) {
|
|
138
|
-
closeErrors.push(closeError);
|
|
139
|
-
}
|
|
140
|
-
try {
|
|
141
|
-
capability.close();
|
|
142
|
-
}
|
|
143
|
-
catch (closeError) {
|
|
144
|
-
closeErrors.push(closeError);
|
|
145
|
-
}
|
|
146
|
-
if (closeErrors.length === 1)
|
|
147
|
-
throw closeErrors[0];
|
|
148
|
-
if (closeErrors.length > 1) {
|
|
149
|
-
throw new AggregateError(closeErrors, "temp workspace admission descriptor close failed");
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
catch (cleanupError) {
|
|
154
|
-
throw new AggregateError([error, cleanupError], "temp workspace creation and cleanup both failed");
|
|
155
|
-
}
|
|
156
|
-
throw error;
|
|
157
|
-
}
|
|
158
127
|
function registerTempWorkspace(dir, retainedChild, capability, admission, dirMode) {
|
|
159
128
|
let owner;
|
|
160
129
|
let stat;
|
|
@@ -201,9 +170,9 @@ async function createTempWorkspace(options, scopedPrefix = false) {
|
|
|
201
170
|
// Retain while the child still has its private creation mode so an
|
|
202
171
|
// explicit dirMode such as 0 cannot make identity descriptor acquisition fail.
|
|
203
172
|
retainedChild = TempWorkspaceRetainedChild.retain(dir, stat);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
173
|
+
if (needsModeInitialization) {
|
|
174
|
+
await retainedChild.initializeMode(dirMode, admission.ownerUid, admission.assertCurrent);
|
|
175
|
+
}
|
|
207
176
|
}
|
|
208
177
|
catch (error) {
|
|
209
178
|
throwTempWorkspaceCreationFailure(error, retainedChild, capability);
|
|
@@ -294,7 +263,12 @@ function createTempWorkspaceSync(options, scopedPrefix = false) {
|
|
|
294
263
|
}
|
|
295
264
|
const needsModeInitialization = validateInitialTempWorkspaceChild(stat, admission.ownerUid, dirMode);
|
|
296
265
|
retainedChild ??= TempWorkspaceRetainedChild.retain(dir, stat);
|
|
297
|
-
|
|
266
|
+
if (needsModeInitialization) {
|
|
267
|
+
retainedChild.initializeModeSync(dirMode, admission.ownerUid, admission.assertCurrent);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
retainedChild.discardInitialReceipt();
|
|
271
|
+
}
|
|
298
272
|
}
|
|
299
273
|
catch (error) {
|
|
300
274
|
throwTempWorkspaceCreationFailure(error, retainedChild, capability);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type BigIntStats } from "node:fs";
|
|
2
2
|
import { type AnyAsyncDirectoryGuard } from "./directory-guard.js";
|
|
3
|
-
import type { PublishedWriteIdentity } from "./pinned-write.js";
|
|
3
|
+
import type { PublishedWriteIdentity } from "./pinned-write-types.js";
|
|
4
4
|
export declare function publishCopyStage(params: {
|
|
5
5
|
temporaryPath: string;
|
|
6
6
|
targetPath: string;
|
|
@@ -11,4 +11,3 @@ export declare function publishCopyStage(params: {
|
|
|
11
11
|
onPublicationAttempt?: () => void;
|
|
12
12
|
onPublished?: (identity: PublishedWriteIdentity) => void;
|
|
13
13
|
}): void;
|
|
14
|
-
//# sourceMappingURL=publish-copy-stage.d.ts.map
|
|
@@ -25,4 +25,3 @@ export type PublishFailureState = {
|
|
|
25
25
|
export declare function rememberCreatedTarget(state: PublishFailureState, identity: FileIdentityStat, phase: PublishFileExclusiveFailurePhase): void;
|
|
26
26
|
export declare function publicationFailure(error: unknown, state: PublishFailureState, cleanup: PublishFileExclusiveCleanup): FsSafeError;
|
|
27
27
|
export declare function directorySyncFailure(error: unknown): PublishFileExclusiveDirectorySyncFailure;
|
|
28
|
-
//# sourceMappingURL=publish-file-failure.d.ts.map
|
package/dist/publish-file.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { type BigIntStats, type Stats } from "node:fs";
|
|
|
2
2
|
import { type DirectoryReceipt, type DirectorySyncOutcome } from "./directory-durability.js";
|
|
3
3
|
import { type FileIdentityStat } from "./file-identity.js";
|
|
4
4
|
import { type PublishFileExclusiveSyncFailurePolicy } from "./publish-file-failure.js";
|
|
5
|
-
export type { PublishFileExclusiveCleanup, PublishFileExclusiveDirectorySyncFailure, PublishFileExclusiveFailureDetails, PublishFileExclusiveFailurePhase, PublishFileExclusiveSyncFailurePolicy, } from "./publish-file-failure.js";
|
|
6
5
|
export type PublishFileExclusiveStrategy = "link-or-copy" | "link-required" | "rename-noreplace";
|
|
7
6
|
export type PublishFileExclusiveResult = {
|
|
8
7
|
method: "hardlink" | "exclusive-copy" | "rename-noreplace";
|
|
@@ -18,4 +17,3 @@ export declare function publishFileExclusive(params: {
|
|
|
18
17
|
onSyncFailure?: PublishFileExclusiveSyncFailurePolicy;
|
|
19
18
|
parentReceipt?: DirectoryReceipt<Stats | BigIntStats>;
|
|
20
19
|
}): Promise<PublishFileExclusiveResult>;
|
|
21
|
-
//# sourceMappingURL=publish-file.d.ts.map
|
package/dist/publish-file.js
CHANGED
|
@@ -12,9 +12,8 @@ import { getNativeBinding, requireNativeBinding } from "./native.js";
|
|
|
12
12
|
import { captureNativeFdClose } from "./native-binding.js";
|
|
13
13
|
import { resolveReadOpenFlags } from "./read-open-flags.js";
|
|
14
14
|
import { directorySyncFailure, publicationFailure, rememberCreatedTarget, } from "./publish-file-failure.js";
|
|
15
|
-
import { admitStandalonePublicationPath } from "./
|
|
15
|
+
import { admitStandalonePublicationPath, assertNoWindowsPathAlias } from "./windows-path-alias.js";
|
|
16
16
|
import { getFsSafeTestHooks } from "./test-hooks.js";
|
|
17
|
-
import { assertNoWindowsPathAlias } from "./windows-path-alias.js";
|
|
18
17
|
import { hasErrorCode } from "./file-cleanup.js";
|
|
19
18
|
import { writeAllToFile } from "./write-file-handle.js";
|
|
20
19
|
const HARDLINK_FALLBACK_CODES = new Set(["EPERM", "EXDEV", "ENOTSUP", "EOPNOTSUPP", "ENOSYS"]);
|
package/dist/realpath.d.ts
CHANGED
package/dist/regular-file.d.ts
CHANGED
|
@@ -35,4 +35,3 @@ export declare function readRegularFileSync(params: {
|
|
|
35
35
|
export declare function appendRegularFile(options: AppendRegularFileOptions): Promise<void>;
|
|
36
36
|
export declare function appendRegularFileSync(options: AppendRegularFileOptions): void;
|
|
37
37
|
export {};
|
|
38
|
-
//# sourceMappingURL=regular-file.d.ts.map
|