@openclaw/fs-safe 0.17.0 → 0.18.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.
- package/CHANGELOG.md +43 -0
- package/dist/absolute-path.d.ts +0 -1
- package/dist/advanced.d.ts +0 -1
- package/dist/archive-crc32.d.ts +0 -1
- package/dist/archive-deadline.d.ts +0 -1
- package/dist/archive-durability.d.ts +0 -1
- 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-native.d.ts +3 -15
- package/dist/archive-native.js +46 -71
- package/dist/archive-options.d.ts +7 -2
- package/dist/archive-parser-errors.d.ts +0 -1
- package/dist/archive-plan.d.ts +10 -1
- package/dist/archive-plan.js +31 -21
- package/dist/archive-policy.d.ts +0 -1
- package/dist/archive-read.d.ts +0 -1
- package/dist/archive-staging.d.ts +0 -1
- package/dist/archive-tar-inspect.d.ts +0 -1
- package/dist/archive-tar-stream.d.ts +0 -1
- package/dist/archive-tar-wasm.d.ts +0 -1
- package/dist/archive-tar.d.ts +0 -1
- 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 +0 -1
- package/dist/archive-zip-entry.d.ts +0 -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 +0 -1
- package/dist/archive.js +87 -164
- package/dist/async-lock.d.ts +0 -1
- package/dist/atomic.d.ts +0 -1
- 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 +0 -1
- 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-directory.d.ts +0 -2
- package/dist/create-directory.js +3 -22
- package/dist/create-file-async.d.ts +0 -1
- package/dist/create-file.d.ts +0 -1
- package/dist/create-file.js +3 -14
- package/dist/create-owned-file.d.ts +0 -1
- package/dist/create.d.ts +1 -2
- package/dist/create.js +1 -1
- package/dist/creation-darwin.d.ts +0 -1
- package/dist/creation-file-state.d.ts +0 -1
- package/dist/creation-path.d.ts +2 -1
- package/dist/creation-path.js +12 -0
- package/dist/creation-permissions.d.ts +0 -1
- package/dist/creation-permissions.js +28 -38
- 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-owner.d.ts +0 -1
- package/dist/directory-receipt.d.ts +0 -1
- package/dist/durability.d.ts +0 -1
- 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 +32 -98
- 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 +1 -2
- 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 +21 -23
- package/dist/file-lock-sync.d.ts +0 -1
- 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 +0 -2
- package/dist/file-store-boundary.js +6 -26
- package/dist/file-store-copy-source.d.ts +1 -2
- package/dist/file-store-copy-source.js +1 -1
- package/dist/file-store-limit.d.ts +1 -2
- package/dist/file-store-limit.js +2 -3
- package/dist/file-store-path.d.ts +0 -1
- 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 +16 -26
- package/dist/file-store.d.ts +0 -1
- package/dist/file-store.js +3 -4
- 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 +0 -1
- 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 +0 -1
- 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 +6 -6
- package/dist/json-durable-queue.d.ts +0 -1
- package/dist/json-durable-queue.js +7 -130
- package/dist/json-store.d.ts +0 -1
- package/dist/json-stringify.d.ts +0 -1
- package/dist/json.d.ts +0 -1
- package/dist/json.js +6 -15
- 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/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 -6
- package/dist/native-parent-admission.d.ts +0 -1
- package/dist/native-pinned-write-windows.d.ts +0 -1
- package/dist/native-pinned-write.d.ts +0 -1
- package/dist/native-pinned-write.js +4 -10
- package/dist/native-policy-directory-observation.d.ts +0 -1
- package/dist/native-policy-parent-windows.d.ts +0 -1
- package/dist/native-rename-outcome.d.ts +0 -1
- package/dist/native-staged-file.d.ts +15 -3
- package/dist/native-staged-file.js +55 -63
- 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 +0 -1
- 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 +1 -1
- package/dist/pinned-operation.d.ts +0 -1
- package/dist/pinned-write-input.d.ts +0 -1
- package/dist/pinned-write-mode.d.ts +0 -1
- package/dist/pinned-write-staged.d.ts +0 -1
- package/dist/pinned-write-types.d.ts +9 -21
- package/dist/pinned-write.d.ts +0 -1
- package/dist/positional-read.d.ts +0 -1
- package/dist/private-directory.d.ts +0 -1
- package/dist/private-producer-handoff-sync.d.ts +0 -1
- package/dist/private-producer-handoff-sync.js +9 -51
- package/dist/private-producer-handoff.d.ts +20 -1
- package/dist/private-producer-handoff.js +69 -46
- package/dist/private-temp-workspace.d.ts +0 -1
- package/dist/private-temp-workspace.js +11 -36
- package/dist/publish-copy-stage.d.ts +0 -1
- package/dist/publish-file-failure.d.ts +0 -1
- package/dist/publish-file.d.ts +0 -1
- 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-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 +0 -1
- 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 +0 -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-create-input.d.ts +0 -1
- package/dist/root-directory-creation.d.ts +0 -1
- package/dist/root-directory-list.d.ts +0 -1
- package/dist/root-directory.d.ts +0 -1
- package/dist/root-entries.d.ts +0 -1
- package/dist/root-errors.d.ts +0 -1
- 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 -10
- package/dist/root-impl.js +114 -91
- package/dist/root-move-noreplace.d.ts +0 -1
- package/dist/root-move-preflight.d.ts +0 -1
- package/dist/root-observed-path.d.ts +0 -1
- package/dist/root-options.d.ts +0 -1
- package/dist/root-path-errors.d.ts +0 -1
- package/dist/root-path-existing.d.ts +3 -1
- package/dist/root-path-existing.js +39 -18
- package/dist/root-path-observation.d.ts +0 -1
- package/dist/root-path-stat.d.ts +0 -1
- 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-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-receipt.d.ts +0 -1
- package/dist/root-remove.d.ts +0 -1
- package/dist/root-symlink-policy.d.ts +0 -1
- package/dist/root-walk.d.ts +0 -1
- package/dist/root-write-admission.d.ts +0 -1
- package/dist/root-write-compatibility.d.ts +0 -1
- package/dist/root-write-complete-parent.d.ts +0 -1
- 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 +0 -1
- package/dist/root.d.ts +0 -1
- 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 -17
- 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/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 +31 -52
- 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 +3 -1
- package/dist/sidecar-lock-policy.js +16 -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-target.d.ts +0 -1
- package/dist/sidecar-lock-types.d.ts +0 -1
- 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/standalone-publication-path.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 +0 -4
- package/dist/temp-workspace-child-admission.d.ts +0 -4
- package/dist/temp-workspace-child-admission.js +0 -12
- package/dist/temp-workspace-descriptor.d.ts +0 -6
- package/dist/temp-workspace-descriptor.js +0 -2
- package/dist/temp-workspace-identity.d.ts +0 -1
- package/dist/temp-workspace-owner.d.ts +1 -1
- package/dist/temp-workspace-owner.js +45 -22
- package/dist/temp-workspace-permissions.d.ts +0 -1
- 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/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 +4 -1
- package/dist/windows-path-alias.d.ts +0 -1
- package/dist/windows-path-alias.js +7 -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/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 +4 -0
- package/docs/writing.md +9 -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.map +0 -1
- 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.map +0 -1
- 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.map +0 -1
- 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.map +0 -1
- 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.map +0 -1
- package/dist/create-file-async.d.ts.map +0 -1
- package/dist/create-file.d.ts.map +0 -1
- package/dist/create-owned-file.d.ts.map +0 -1
- package/dist/create.d.ts.map +0 -1
- package/dist/creation-darwin.d.ts.map +0 -1
- package/dist/creation-file-state.d.ts.map +0 -1
- package/dist/creation-path.d.ts.map +0 -1
- package/dist/creation-permissions.d.ts.map +0 -1
- 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.map +0 -1
- package/dist/file-store-limit.d.ts.map +0 -1
- package/dist/file-store-path.d.ts.map +0 -1
- 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.map +0 -1
- 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.map +0 -1
- package/dist/temp-workspace-owner.d.ts.map +0 -1
- package/dist/temp-workspace-permissions.d.ts.map +0 -1
- 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.js
CHANGED
|
@@ -6,25 +6,23 @@ import fs from "node:fs/promises";
|
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { Readable } from "node:stream";
|
|
8
8
|
import { pipeline } from "node:stream/promises";
|
|
9
|
-
import {
|
|
9
|
+
import { createArchiveEntrySelector } from "./archive-plan.js";
|
|
10
10
|
import { createPipelineTimeoutError, waitForDeadline, withExtractionDeadline, } from "./archive-deadline.js";
|
|
11
|
-
import { assertArchiveEntryCountWithinLimit,
|
|
11
|
+
import { assertArchiveEntryCountWithinLimit, createByteBudgetTracker, createExtractBudgetTransform, resolveExtractLimits, resolveTarMeterLimits, } from "./archive-limits.js";
|
|
12
12
|
import { resolveArchiveKind } from "./archive-kind.js";
|
|
13
|
-
import { prepareArchiveDestinationGuard, preparePrivateArchiveOutputPath,
|
|
14
|
-
import {
|
|
13
|
+
import { prepareArchiveDestinationGuard, preparePrivateArchiveOutputPath, } from "./archive-staging.js";
|
|
14
|
+
import { withStagedArchivePublication } from "./archive-merge.js";
|
|
15
15
|
import { loadZipArchiveWithPreflight } from "./archive-zip-preflight.js";
|
|
16
16
|
import { admittedZipEntries } from "./archive-zip-loader.js";
|
|
17
17
|
import { zipEntryKind, zipEntryDeclaredSize, zipEntryMode, } from "./archive-zip-entry.js";
|
|
18
18
|
import { createZipIntegrityTransform, normalizeZipIntegrityError, } from "./archive-zip-integrity.js";
|
|
19
|
-
import { FsSafeError } from "./errors.js";
|
|
20
19
|
import { ArchiveSecurityError } from "./archive-errors.js";
|
|
21
20
|
import { extractNativeArchive } from "./archive-native.js";
|
|
22
21
|
import { stageArchiveFileForExtraction } from "./archive-input.js";
|
|
23
22
|
import { getNativeBinding } from "./native.js";
|
|
24
|
-
import { resolveArchiveFilteredEntryPolicy
|
|
23
|
+
import { resolveArchiveFilteredEntryPolicy } from "./archive-policy.js";
|
|
25
24
|
import { writeSiblingTempFile } from "./sibling-temp.js";
|
|
26
25
|
import { assertNoWindowsPathAlias } from "./windows-path-alias.js";
|
|
27
|
-
import { realpathSync } from "./realpath.js";
|
|
28
26
|
export { isWindowsDrivePath, normalizeArchiveEntryPath, resolveArchiveOutputPath, stripArchivePath, validateArchiveEntryPath, } from "./archive-entry.js";
|
|
29
27
|
export { resolveArchiveKind, resolvePackedRootDir } from "./archive-kind.js";
|
|
30
28
|
export { readArchiveEntry } from "./archive-read.js";
|
|
@@ -48,26 +46,6 @@ async function readZipEntryStream(entry) {
|
|
|
48
46
|
const buf = await entry.async("nodebuffer");
|
|
49
47
|
return Readable.from(buf);
|
|
50
48
|
}
|
|
51
|
-
function resolveZipOutputPath(params) {
|
|
52
|
-
validateArchiveEntryPath(params.entryPath);
|
|
53
|
-
const canonicalPath = stripArchivePath(params.entryPath, 0);
|
|
54
|
-
if (!canonicalPath)
|
|
55
|
-
return null;
|
|
56
|
-
const relPath = params.strip === 0 ? canonicalPath : stripArchivePath(canonicalPath, params.strip);
|
|
57
|
-
if (!relPath) {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
validateArchiveEntryPath(relPath);
|
|
61
|
-
return {
|
|
62
|
-
canonicalPath,
|
|
63
|
-
relPath,
|
|
64
|
-
outPath: resolveArchiveOutputPath({
|
|
65
|
-
rootDir: params.destinationDir,
|
|
66
|
-
relPath,
|
|
67
|
-
originalPath: params.entryPath,
|
|
68
|
-
}),
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
49
|
async function writeZipFileEntry(params) {
|
|
72
50
|
params.deadline.check();
|
|
73
51
|
params.budget.startEntry();
|
|
@@ -118,93 +96,48 @@ async function writeZipFileEntry(params) {
|
|
|
118
96
|
}
|
|
119
97
|
}
|
|
120
98
|
async function extractZip(params) {
|
|
121
|
-
const limits =
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
99
|
+
const { limits, deadline } = params;
|
|
100
|
+
const destinationGuard = await prepareArchiveDestinationGuard(params.destDir);
|
|
101
|
+
deadline.check();
|
|
102
|
+
const buffer = await fs.readFile(params.archivePath, { signal: deadline.signal });
|
|
103
|
+
deadline.check();
|
|
104
|
+
const zip = await waitForDeadline(loadZipArchiveWithPreflight(buffer, limits), deadline);
|
|
105
|
+
deadline.check();
|
|
106
|
+
const entries = admittedZipEntries(zip);
|
|
107
|
+
assertArchiveEntryCountWithinLimit(entries.length, limits);
|
|
108
|
+
const budget = createByteBudgetTracker(limits);
|
|
109
|
+
await withStagedArchivePublication({ ...params, destinationGuard }, async (stagingDir) => {
|
|
110
|
+
const { select } = createArchiveEntrySelector({ ...params, rootDir: stagingDir });
|
|
111
|
+
const acceptedEntries = [];
|
|
112
|
+
for (const entry of entries) {
|
|
113
|
+
deadline.check();
|
|
114
|
+
const entryKind = zipEntryKind(entry);
|
|
115
|
+
const relPath = select({ path: entry.name, kind: entryKind, size: zipEntryDeclaredSize(entry) });
|
|
116
|
+
if (relPath === null)
|
|
117
|
+
continue;
|
|
118
|
+
if (entryKind === "symlink") {
|
|
119
|
+
throw new ArchiveSecurityError("entry-link", `zip entry is a link: ${entry.name}`);
|
|
120
|
+
}
|
|
121
|
+
if (entryKind === "other")
|
|
122
|
+
continue;
|
|
123
|
+
const mode = zipEntryMode(entry, params.entryModes);
|
|
124
|
+
acceptedEntries.push({ path: relPath, kind: entry.dir ? "directory" : "file", mode });
|
|
125
|
+
const outPath = path.join(stagingDir, relPath);
|
|
126
|
+
await preparePrivateArchiveOutputPath({
|
|
127
|
+
destinationDir: stagingDir,
|
|
128
|
+
destinationRealDir: stagingDir,
|
|
129
|
+
relPath,
|
|
130
|
+
outPath,
|
|
131
|
+
originalPath: entry.name,
|
|
132
|
+
isDirectory: entry.dir,
|
|
133
|
+
deadline,
|
|
134
|
+
});
|
|
135
|
+
if (!entry.dir) {
|
|
136
|
+
await writeZipFileEntry({ entry, outPath, budget, deadline });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return acceptedEntries;
|
|
126
140
|
});
|
|
127
|
-
try {
|
|
128
|
-
const destinationGuard = await prepareArchiveDestinationGuard(params.destDir);
|
|
129
|
-
const destinationRealDir = destinationGuard.realPath;
|
|
130
|
-
params.deadline.check();
|
|
131
|
-
const buffer = await fs.readFile(stagedArchive.path, { signal: params.deadline.signal });
|
|
132
|
-
params.deadline.check();
|
|
133
|
-
const zip = await waitForDeadline(loadZipArchiveWithPreflight(buffer, limits), params.deadline);
|
|
134
|
-
params.deadline.check();
|
|
135
|
-
const entries = admittedZipEntries(zip);
|
|
136
|
-
const strip = Math.max(0, Math.floor(params.stripComponents ?? 0));
|
|
137
|
-
assertArchiveEntryCountWithinLimit(entries.length, limits);
|
|
138
|
-
const budget = createByteBudgetTracker(limits);
|
|
139
|
-
const trackOutputPath = createArchiveOutputPathTracker();
|
|
140
|
-
await withStagedArchiveDestination({
|
|
141
|
-
destinationRealDir,
|
|
142
|
-
run: async (stagingDir) => {
|
|
143
|
-
const stagingRealDir = realpathSync.native(stagingDir);
|
|
144
|
-
const acceptedEntries = [];
|
|
145
|
-
for (const entry of entries) {
|
|
146
|
-
params.deadline.check();
|
|
147
|
-
const output = resolveZipOutputPath({
|
|
148
|
-
entryPath: entry.name,
|
|
149
|
-
strip,
|
|
150
|
-
destinationDir: stagingRealDir,
|
|
151
|
-
});
|
|
152
|
-
if (!output) {
|
|
153
|
-
continue;
|
|
154
|
-
}
|
|
155
|
-
assertArchiveEntryPathComponentsWithinLimit(output.relPath, limits);
|
|
156
|
-
trackOutputPath(output.relPath, entry.name);
|
|
157
|
-
const entryKind = zipEntryKind(entry);
|
|
158
|
-
const entrySize = zipEntryDeclaredSize(entry);
|
|
159
|
-
if (!shouldExtractArchiveEntry({
|
|
160
|
-
filter: params.entryFilter,
|
|
161
|
-
onFiltered: params.onFiltered,
|
|
162
|
-
entry: { path: output.canonicalPath, kind: entryKind, size: entrySize },
|
|
163
|
-
})) {
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
if (entryKind === "symlink") {
|
|
167
|
-
throw new ArchiveSecurityError("entry-link", `zip entry is a link: ${entry.name}`);
|
|
168
|
-
}
|
|
169
|
-
if (entryKind === "other")
|
|
170
|
-
continue;
|
|
171
|
-
const mode = zipEntryMode(entry, params.entryModes);
|
|
172
|
-
acceptedEntries.push({ path: output.relPath, kind: entry.dir ? "directory" : "file", mode });
|
|
173
|
-
await preparePrivateArchiveOutputPath({
|
|
174
|
-
destinationDir: stagingRealDir,
|
|
175
|
-
destinationRealDir: stagingRealDir,
|
|
176
|
-
relPath: output.relPath,
|
|
177
|
-
outPath: output.outPath,
|
|
178
|
-
originalPath: entry.name,
|
|
179
|
-
isDirectory: entry.dir,
|
|
180
|
-
deadline: params.deadline,
|
|
181
|
-
});
|
|
182
|
-
if (entry.dir) {
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
await writeZipFileEntry({
|
|
186
|
-
entry,
|
|
187
|
-
outPath: output.outPath,
|
|
188
|
-
budget,
|
|
189
|
-
deadline: params.deadline,
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
params.deadline.check();
|
|
193
|
-
await mergePlannedArchiveIntoDestination({
|
|
194
|
-
entries: acceptedEntries,
|
|
195
|
-
durable: params.durable,
|
|
196
|
-
entryUmask: params.entryUmask,
|
|
197
|
-
sourceDir: stagingRealDir,
|
|
198
|
-
destinationGuard,
|
|
199
|
-
deadline: params.deadline,
|
|
200
|
-
});
|
|
201
|
-
params.deadline.check();
|
|
202
|
-
},
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
finally {
|
|
206
|
-
await stagedArchive.cleanup();
|
|
207
|
-
}
|
|
208
141
|
}
|
|
209
142
|
export async function extractArchive(params) {
|
|
210
143
|
const archivePath = params.archivePath;
|
|
@@ -232,62 +165,52 @@ export async function extractArchive(params) {
|
|
|
232
165
|
stripComponents: params.stripComponents, limits,
|
|
233
166
|
entryModes: params.entryModes, entryUmask, entryFilter: params.entryFilter, onFiltered,
|
|
234
167
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
await withExtractionDeadline(params.timeoutMs, label, async (deadline) => extractZip({ ...options, deadline }));
|
|
168
|
+
await withExtractionDeadline(params.timeoutMs, label, async (deadline) => {
|
|
169
|
+
const stagedArchive = await stageArchiveFileForExtraction({ archivePath, limits, deadline });
|
|
170
|
+
try {
|
|
171
|
+
deadline.check();
|
|
172
|
+
const stagedOptions = { ...options, archivePath: stagedArchive.path, deadline };
|
|
173
|
+
if (native)
|
|
174
|
+
await extractNativeArchive({ ...stagedOptions, binding: native, kind, tarLimits });
|
|
175
|
+
else if (kind === "zip")
|
|
176
|
+
await extractZip(stagedOptions);
|
|
177
|
+
else
|
|
178
|
+
await extractWasmTar({ ...stagedOptions, kind, tarLimits });
|
|
179
|
+
}
|
|
180
|
+
finally {
|
|
181
|
+
await stagedArchive.cleanup();
|
|
182
|
+
}
|
|
183
|
+
});
|
|
256
184
|
}
|
|
257
185
|
async function extractWasmTar(params) {
|
|
258
|
-
const {
|
|
186
|
+
const { deadline, tarLimits } = params;
|
|
259
187
|
const manifest = [];
|
|
260
188
|
await inspectTar({ archivePath: params.archivePath, kind: params.kind, limits: tarLimits, signal: deadline.signal,
|
|
261
189
|
onMember: (entry) => { manifest.push(entry); } });
|
|
262
190
|
deadline.check();
|
|
263
|
-
const destinationGuard = await prepareArchiveDestinationGuard(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
const planEntry = createTarEntryPlanner({ ...options, rootDir: destinationRealDir, limits: params.limits });
|
|
268
|
-
const accepted = manifest.flatMap((entry) => {
|
|
269
|
-
deadline.check();
|
|
270
|
-
const planned = planEntry(entry);
|
|
271
|
-
return planned ? [{ ...entry, ...planned }] : [];
|
|
272
|
-
});
|
|
273
|
-
await replayTar({ archivePath: params.archivePath, kind: params.kind, limits: tarLimits, signal: deadline.signal, members: accepted,
|
|
274
|
-
async consume(member, payload) {
|
|
275
|
-
deadline.check();
|
|
276
|
-
await preparePrivateArchiveOutputPath({ destinationDir: stagingDir, destinationRealDir: stagingDir,
|
|
277
|
-
relPath: member.path, outPath: path.join(stagingDir, member.path), originalPath: member.path,
|
|
278
|
-
isDirectory: member.kind === "directory", deadline });
|
|
279
|
-
if (member.kind === "file") {
|
|
280
|
-
await runPinnedWriteHelper({ rootPath: stagingDir, relativeParentPath: path.posix.dirname(member.path),
|
|
281
|
-
basename: path.posix.basename(member.path), mkdir: false, mode: 0o600, overwrite: false,
|
|
282
|
-
sync: false,
|
|
283
|
-
maxBytes: member.size, input: { kind: "stream", stream: Readable.from(payload) } });
|
|
284
|
-
}
|
|
285
|
-
deadline.check();
|
|
286
|
-
},
|
|
287
|
-
});
|
|
191
|
+
const destinationGuard = await prepareArchiveDestinationGuard(params.destDir);
|
|
192
|
+
await withStagedArchivePublication({ ...params, destinationGuard }, async (stagingDir) => {
|
|
193
|
+
const planEntry = createTarEntryPlanner({ ...params, rootDir: destinationGuard.realPath });
|
|
194
|
+
const accepted = manifest.flatMap((entry) => {
|
|
288
195
|
deadline.check();
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
196
|
+
const planned = planEntry(entry);
|
|
197
|
+
return planned ? [{ ...entry, ...planned }] : [];
|
|
198
|
+
});
|
|
199
|
+
await replayTar({ archivePath: params.archivePath, kind: params.kind, limits: tarLimits, signal: deadline.signal, members: accepted,
|
|
200
|
+
async consume(member, payload) {
|
|
201
|
+
deadline.check();
|
|
202
|
+
await preparePrivateArchiveOutputPath({ destinationDir: stagingDir, destinationRealDir: stagingDir,
|
|
203
|
+
relPath: member.path, outPath: path.join(stagingDir, member.path), originalPath: member.path,
|
|
204
|
+
isDirectory: member.kind === "directory", deadline });
|
|
205
|
+
if (member.kind === "file") {
|
|
206
|
+
await runPinnedWriteHelper({ rootPath: stagingDir, relativeParentPath: path.posix.dirname(member.path),
|
|
207
|
+
basename: path.posix.basename(member.path), mkdir: false, mode: 0o600, overwrite: false,
|
|
208
|
+
sync: false,
|
|
209
|
+
maxBytes: member.size, input: { kind: "stream", stream: Readable.from(payload) } });
|
|
210
|
+
}
|
|
211
|
+
deadline.check();
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
return accepted;
|
|
215
|
+
});
|
|
293
216
|
}
|
package/dist/async-lock.d.ts
CHANGED
package/dist/atomic.d.ts
CHANGED
|
@@ -2,4 +2,3 @@ export { replaceFileAtomic, replaceFileAtomicSync, type RenameIdentityPolicy, ty
|
|
|
2
2
|
export { writeTextAtomic, type WriteTextAtomicOptions } from "./text-atomic.js";
|
|
3
3
|
export { replaceDirectoryAtomic, type ReplaceDirectoryAtomicOptions } from "./replace-directory.js";
|
|
4
4
|
export { movePathWithCopyFallback, type MovePathPublicationReceipt, type MovePathWithCopyFallbackOptions, } from "./move-path.js";
|
|
5
|
-
//# sourceMappingURL=atomic.d.ts.map
|
package/dist/bounded-read.d.ts
CHANGED
|
@@ -23,4 +23,3 @@ export declare function readBoundedSync(maxBytes: number, readChunk: (scratch: B
|
|
|
23
23
|
/** Sync bounded read from a numeric descriptor. The caller owns the descriptor. */
|
|
24
24
|
export declare function readFileDescriptorBoundedSync(fd: number, maxBytes: number): Buffer;
|
|
25
25
|
export {};
|
|
26
|
-
//# sourceMappingURL=bounded-read.d.ts.map
|
package/dist/byte-budget.d.ts
CHANGED
package/dist/byte-view.d.ts
CHANGED
package/dist/clone-metadata.d.ts
CHANGED
|
@@ -17,4 +17,3 @@ export type CloneFileMetadata = {
|
|
|
17
17
|
* These are point-in-time facts, not authorization or a guarantee against later edits.
|
|
18
18
|
*/
|
|
19
19
|
export declare function readCloneFileMetadata(files: readonly string[]): Promise<(CloneFileMetadata | undefined)[]>;
|
|
20
|
-
//# sourceMappingURL=clone-metadata.d.ts.map
|
package/dist/config.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { configureFsSafePython, configureFsSafeNative, getFsSafeNativeConfig, type FsSafePythonConfig, type FsSafeNativeConfig, type FsSafeNativeMode, } from "./native-config.js";
|
|
2
2
|
export { configureFsSafeLocks, getFsSafeLockConfig, type FsSafeLockConfig, } from "./lock-config.js";
|
|
3
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/containment.d.ts
CHANGED
|
@@ -19,4 +19,3 @@ export declare function assertCopySourceCurrent(source: {
|
|
|
19
19
|
export declare function writeCopyFileToFd(fd: number, input: CopyFileInput, maxBytes?: number, assertBeforeMutation?: () => void): Promise<void>;
|
|
20
20
|
export declare function createNativeCopyFile(native: NativeBinding, input: CopyFileInput, parentFd: number, basename: string, maxBytes: number | undefined, sync: boolean): Promise<NativeFileCopyResult | undefined>;
|
|
21
21
|
export declare function assertNativeCopyCompleted(input: CopyFileInput, copied?: NativeFileCopyResult): void;
|
|
22
|
-
//# sourceMappingURL=copy-file-input.d.ts.map
|
package/dist/copy-policy.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ function timestampSeconds(nanoseconds) {
|
|
|
11
11
|
}
|
|
12
12
|
/** Byte-copy adapter for the shared immutable-source, caller-owned namespace contract. */
|
|
13
13
|
export async function copyOwnedTree(source, destination, options) {
|
|
14
|
-
options.signal
|
|
14
|
+
const callerSignal = options.signal ? AbortSignal.any([options.signal]) : undefined;
|
|
15
15
|
const cancellation = new AbortController();
|
|
16
16
|
const signal = cancellation.signal;
|
|
17
17
|
setMaxListeners(options.concurrency, signal);
|
|
@@ -23,8 +23,8 @@ export async function copyOwnedTree(source, destination, options) {
|
|
|
23
23
|
failure ??= { value };
|
|
24
24
|
cancellation.abort(failure);
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
if (callerSignal)
|
|
27
|
+
callerSignal.onabort = () => recordFailure(callerSignal.reason);
|
|
28
28
|
async function schedule(operation, children) {
|
|
29
29
|
signal.throwIfAborted();
|
|
30
30
|
const task = operation()
|
|
@@ -51,8 +51,8 @@ export async function copyOwnedTree(source, destination, options) {
|
|
|
51
51
|
}
|
|
52
52
|
output = await fsp.open(to, "wx", 0o600);
|
|
53
53
|
if (options.copyFileContents) {
|
|
54
|
-
// napi-rs owns onabort. Each admitted file gets a separate signal
|
|
55
|
-
//
|
|
54
|
+
// napi-rs owns onabort. Each admitted file gets a separate signal; the
|
|
55
|
+
// shared failure signal is private, so callers cannot intercept its relay.
|
|
56
56
|
const fileCancellation = new AbortController();
|
|
57
57
|
const abortFile = () => fileCancellation.abort();
|
|
58
58
|
signal.addEventListener("abort", abortFile, { once: true });
|
|
@@ -62,6 +62,7 @@ export async function copyOwnedTree(source, destination, options) {
|
|
|
62
62
|
}
|
|
63
63
|
finally {
|
|
64
64
|
signal.removeEventListener("abort", abortFile);
|
|
65
|
+
fileCancellation.signal.onabort = null;
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
else {
|
|
@@ -224,6 +225,7 @@ export async function copyOwnedTree(source, destination, options) {
|
|
|
224
225
|
signal.throwIfAborted();
|
|
225
226
|
}
|
|
226
227
|
try {
|
|
228
|
+
callerSignal?.throwIfAborted();
|
|
227
229
|
await copyDirectory(source.receipt.realPath, destination);
|
|
228
230
|
await Promise.all(finishing);
|
|
229
231
|
signal.throwIfAborted();
|
|
@@ -233,7 +235,8 @@ export async function copyOwnedTree(source, destination, options) {
|
|
|
233
235
|
}
|
|
234
236
|
finally {
|
|
235
237
|
await Promise.all(finishing);
|
|
236
|
-
|
|
238
|
+
if (callerSignal)
|
|
239
|
+
callerSignal.onabort = null;
|
|
237
240
|
}
|
|
238
241
|
if (failure)
|
|
239
242
|
throw failure.value;
|
package/dist/copy.d.ts
CHANGED
|
@@ -13,4 +13,3 @@ export declare function probeTreeClone(parentPath: string): TreeCloneBackend | u
|
|
|
13
13
|
export declare function createCloneSource(destination: string, options?: Pick<CopyTreeOptions, "signal">): Promise<void>;
|
|
14
14
|
/** Copy an immutable, caller-owned tree, preferring native cloning unless configured otherwise. */
|
|
15
15
|
export declare function copyTree(source: string, destination: string, options?: CopyTreeOptions): Promise<void>;
|
|
16
|
-
//# sourceMappingURL=copy.d.ts.map
|
package/dist/copy.js
CHANGED
|
@@ -94,12 +94,11 @@ async function materializeTree(source, destination, options, policy) {
|
|
|
94
94
|
let cloned = false;
|
|
95
95
|
// napi-rs uses the supplied signal's onabort property. Give it a private
|
|
96
96
|
// signal so caller handlers and other admitted native operations stay intact.
|
|
97
|
-
const
|
|
98
|
-
const abort = () => cancellation?.abort();
|
|
99
|
-
options.signal?.addEventListener("abort", abort, { once: true });
|
|
97
|
+
const nativeSignal = options.signal && supported ? AbortSignal.any([options.signal]) : undefined;
|
|
100
98
|
try {
|
|
101
99
|
if (native && supported) {
|
|
102
|
-
|
|
100
|
+
nativeSignal?.throwIfAborted();
|
|
101
|
+
await native.cloneTree(original?.fd ?? null, parent.fd, name, concurrency, nativeSignal);
|
|
103
102
|
cloned = true;
|
|
104
103
|
}
|
|
105
104
|
}
|
|
@@ -113,7 +112,8 @@ async function materializeTree(source, destination, options, policy) {
|
|
|
113
112
|
}
|
|
114
113
|
}
|
|
115
114
|
finally {
|
|
116
|
-
|
|
115
|
+
if (nativeSignal)
|
|
116
|
+
nativeSignal.onabort = null;
|
|
117
117
|
}
|
|
118
118
|
options.signal?.throwIfAborted();
|
|
119
119
|
assertStagedDirectoryCurrent(parent.receipt);
|
|
@@ -15,6 +15,4 @@ export declare function createDirectory(targetPath: string, options?: CreateDire
|
|
|
15
15
|
export declare function createDirectoryWithAdmission(targetPath: string, options?: CreateDirectoryOptions, admission?: CreationAdmission): Promise<void>;
|
|
16
16
|
export declare function createDirectoryWithReceipt(targetPath: string, options?: CreateDirectoryOptions, admission?: CreationAdmission): Promise<CreationDirectoryReceipt>;
|
|
17
17
|
export declare function createDirectorySync(targetPath: string, options?: CreateDirectoryOptions): void;
|
|
18
|
-
export declare function createDirectorySyncWithAdmission(targetPath: string, options?: CreateDirectoryOptions, admission?: CreationAdmission): void;
|
|
19
18
|
export declare function createDirectoryWithReceiptSync(targetPath: string, options?: CreateDirectoryOptions, admission?: CreationAdmission): CreationDirectoryReceipt;
|
|
20
|
-
//# sourceMappingURL=create-directory.d.ts.map
|
package/dist/create-directory.js
CHANGED
|
@@ -3,13 +3,11 @@ import fs from "node:fs/promises";
|
|
|
3
3
|
import { FsSafeError } from "./errors.js";
|
|
4
4
|
import { getNativeBinding } from "./native.js";
|
|
5
5
|
import { getFsSafeNativeConfig } from "./native-config.js";
|
|
6
|
-
import { assertSynchronousCallbackResult } from "./mutation-authority.js";
|
|
7
6
|
import { assertPrivateDirectory, assertPrivateDirectorySync, inspectCreationDirectory, inspectCreationDirectorySync, resolveCreationPermissions, } from "./creation-permissions.js";
|
|
8
|
-
import { creationCollision, prepareCreationPath } from "./creation-path.js";
|
|
7
|
+
import { assertBeforeCreation, creationCollision, prepareCreationPath } from "./creation-path.js";
|
|
9
8
|
import { createPrivateWindowsDirectoryCommand, createPrivateWindowsDirectoryCommandSync, } from "./windows-security-command.js";
|
|
10
9
|
import { warnNativeFallback } from "./native-fallback-warning.js";
|
|
11
10
|
import { inspectDirectoryIdentitySync } from "./directory-guard.js";
|
|
12
|
-
import { assertDarwinCreationDirectoryAcl, assertDarwinPrivateDirectoryMode } from "./creation-darwin.js";
|
|
13
11
|
function directoryAdoptionFailure(error, target, windowsIdentity) {
|
|
14
12
|
return new FsSafeError("helper-failed", "created directory admission failed", {
|
|
15
13
|
cause: error,
|
|
@@ -43,14 +41,7 @@ export async function createDirectoryWithReceipt(targetPath, options = {}, admis
|
|
|
43
41
|
const backend = permissions.private && process.platform === "win32" ? privateDirectoryBackend() : undefined;
|
|
44
42
|
const parentIdentity = permissions.private && process.platform === "win32"
|
|
45
43
|
? await inspectCreationDirectory(selected.parent.dir, false) : undefined;
|
|
46
|
-
|
|
47
|
-
assertDarwinCreationDirectoryAcl(selected.parent.dir, selected.parent.stat, "directory");
|
|
48
|
-
assertSynchronousCallbackResult(assertion?.(), "assertBeforeMutation");
|
|
49
|
-
selected.assertParent();
|
|
50
|
-
if (permissions.private)
|
|
51
|
-
assertDarwinPrivateDirectoryMode(permissions.mode);
|
|
52
|
-
if (permissions.private)
|
|
53
|
-
assertDarwinCreationDirectoryAcl(selected.parent.dir, selected.parent.stat, "directory");
|
|
44
|
+
assertBeforeCreation(selected, permissions, assertion, "directory");
|
|
54
45
|
let created = false;
|
|
55
46
|
let windowsIdentity;
|
|
56
47
|
try {
|
|
@@ -82,9 +73,6 @@ export async function createDirectoryWithReceipt(targetPath, options = {}, admis
|
|
|
82
73
|
export function createDirectorySync(targetPath, options = {}) {
|
|
83
74
|
createDirectoryWithReceiptSync(targetPath, options, {});
|
|
84
75
|
}
|
|
85
|
-
export function createDirectorySyncWithAdmission(targetPath, options = {}, admission = {}) {
|
|
86
|
-
createDirectoryWithReceiptSync(targetPath, options, admission);
|
|
87
|
-
}
|
|
88
76
|
export function createDirectoryWithReceiptSync(targetPath, options = {}, admission = {}) {
|
|
89
77
|
const permissions = resolveCreationPermissions(options, true);
|
|
90
78
|
const assertion = options.assertBeforeMutation;
|
|
@@ -92,14 +80,7 @@ export function createDirectoryWithReceiptSync(targetPath, options = {}, admissi
|
|
|
92
80
|
const backend = permissions.private && process.platform === "win32" ? privateDirectoryBackend() : undefined;
|
|
93
81
|
const parentIdentity = permissions.private && process.platform === "win32"
|
|
94
82
|
? inspectCreationDirectorySync(selected.parent.dir, false) : undefined;
|
|
95
|
-
|
|
96
|
-
assertDarwinCreationDirectoryAcl(selected.parent.dir, selected.parent.stat, "directory");
|
|
97
|
-
assertSynchronousCallbackResult(assertion?.(), "assertBeforeMutation");
|
|
98
|
-
selected.assertParent();
|
|
99
|
-
if (permissions.private)
|
|
100
|
-
assertDarwinPrivateDirectoryMode(permissions.mode);
|
|
101
|
-
if (permissions.private)
|
|
102
|
-
assertDarwinCreationDirectoryAcl(selected.parent.dir, selected.parent.stat, "directory");
|
|
83
|
+
assertBeforeCreation(selected, permissions, assertion, "directory");
|
|
103
84
|
let created = false;
|
|
104
85
|
let windowsIdentity;
|
|
105
86
|
try {
|
package/dist/create-file.d.ts
CHANGED
|
@@ -5,4 +5,3 @@ export type CreateFileOptions = CreateDirectoryOptions;
|
|
|
5
5
|
export declare function createFileSync(targetPath: string, options?: CreateFileOptions): OwnedFileDescriptorSync;
|
|
6
6
|
/** Internal async writer; Windows preparation uses the nonblocking stage owner. */
|
|
7
7
|
export declare function createFileHandle(targetPath: string, options?: CreateFileOptions, admission?: CreationAdmission): Promise<FileHandle>;
|
|
8
|
-
//# sourceMappingURL=create-file.d.ts.map
|
package/dist/create-file.js
CHANGED
|
@@ -8,12 +8,11 @@ import { assertDirectoryIdentitySync } from "./directory-guard.js";
|
|
|
8
8
|
import { FsSafeError } from "./errors.js";
|
|
9
9
|
import { assertSynchronousCallbackResult } from "./mutation-authority.js";
|
|
10
10
|
import { assertPrivateFileCreationAvailable, inspectCreationDirectorySync, protectCreatedFileSync, resolveCreationPermissions, verifyCreatedFileSync, } from "./creation-permissions.js";
|
|
11
|
-
import { creationCollision, prepareCreationPath, removeCreationDirectory } from "./creation-path.js";
|
|
11
|
+
import { assertBeforeCreation, creationCollision, prepareCreationPath, removeCreationDirectory } from "./creation-path.js";
|
|
12
12
|
import { handoffCreatedFileSync } from "./private-producer-handoff-sync.js";
|
|
13
13
|
import { resolveReadOpenFlags } from "./read-open-flags.js";
|
|
14
14
|
import { assertCreationFile, assertPrivateCreationFile, creationPublicationAfterFailure, privateFileSettlementFailure, rethrowPrivateStageCreationFailure, removeRecordedCreationFileSync, } from "./creation-file-state.js";
|
|
15
15
|
import { createPrivateWindowsFileHandle } from "./create-file-async.js";
|
|
16
|
-
import { assertDarwinCreationDirectoryAcl } from "./creation-darwin.js";
|
|
17
16
|
function createPrivateWindowsFile(selected, options, mode) {
|
|
18
17
|
const assertion = options.assertBeforeMutation;
|
|
19
18
|
if (fs.lstatSync(selected.target, { throwIfNoEntry: false })) {
|
|
@@ -113,12 +112,7 @@ function createFileCore(targetPath, options, admission) {
|
|
|
113
112
|
assertPrivateFileCreationAvailable();
|
|
114
113
|
return createPrivateWindowsFile(selected, { ...permissions, assertBeforeMutation: assertion }, permissions.mode);
|
|
115
114
|
}
|
|
116
|
-
|
|
117
|
-
assertDarwinCreationDirectoryAcl(selected.parent.dir, selected.parent.stat, "file");
|
|
118
|
-
assertSynchronousCallbackResult(assertion?.(), "assertBeforeMutation");
|
|
119
|
-
selected.assertParent();
|
|
120
|
-
if (permissions.private)
|
|
121
|
-
assertDarwinCreationDirectoryAcl(selected.parent.dir, selected.parent.stat, "file");
|
|
115
|
+
assertBeforeCreation(selected, permissions, assertion, "file");
|
|
122
116
|
let file;
|
|
123
117
|
try {
|
|
124
118
|
file = ownFileDescriptorSync(fs.openSync(selected.target, fs.constants.O_RDWR | fs.constants.O_CREAT |
|
|
@@ -156,12 +150,7 @@ export async function createFileHandle(targetPath, options = {}, admission = {})
|
|
|
156
150
|
const assertion = options.assertBeforeMutation;
|
|
157
151
|
if (process.platform !== "win32" || !permissions.private) {
|
|
158
152
|
const selected = prepareCreationPath(targetPath, admission.expectedParentIdentity);
|
|
159
|
-
|
|
160
|
-
assertDarwinCreationDirectoryAcl(selected.parent.dir, selected.parent.stat, "file");
|
|
161
|
-
assertSynchronousCallbackResult(assertion?.(), "assertBeforeMutation");
|
|
162
|
-
selected.assertParent();
|
|
163
|
-
if (permissions.private)
|
|
164
|
-
assertDarwinCreationDirectoryAcl(selected.parent.dir, selected.parent.stat, "file");
|
|
153
|
+
assertBeforeCreation(selected, permissions, assertion, "file");
|
|
165
154
|
const handle = await fsAsync.open(selected.target, fs.constants.O_RDWR | fs.constants.O_CREAT |
|
|
166
155
|
fs.constants.O_EXCL | resolveReadOpenFlags(), permissions.mode ?? 0o666)
|
|
167
156
|
.catch(error => { throw creationCollision(error); });
|
|
@@ -5,4 +5,3 @@ export type OwnedFileDescriptorSync = {
|
|
|
5
5
|
};
|
|
6
6
|
/** Capture the descriptor's creator-owned closer before it can be reused. */
|
|
7
7
|
export declare function ownFileDescriptorSync(fd: number, closeFd?: (fd: number) => void): OwnedFileDescriptorSync;
|
|
8
|
-
//# sourceMappingURL=create-owned-file.d.ts.map
|
package/dist/create.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { createDirectory, createDirectorySync, createDirectoryWithAdmission,
|
|
1
|
+
export { createDirectory, createDirectorySync, createDirectoryWithAdmission, type CreateDirectoryOptions, type CreationAdmission, } from "./create-directory.js";
|
|
2
2
|
export { createFileSync, createFileHandle, type CreateFileOptions } from "./create-file.js";
|
|
3
3
|
export type { OwnedFileDescriptorSync } from "./create-owned-file.js";
|
|
4
|
-
//# sourceMappingURL=create.d.ts.map
|
package/dist/create.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createDirectory, createDirectorySync, createDirectoryWithAdmission,
|
|
1
|
+
export { createDirectory, createDirectorySync, createDirectoryWithAdmission, } from "./create-directory.js";
|
|
2
2
|
export { createFileSync, createFileHandle } from "./create-file.js";
|
|
@@ -3,4 +3,3 @@ export declare function assertDarwinPrivateCreationAvailable(): void;
|
|
|
3
3
|
export declare function assertDarwinPrivateDirectoryMode(mode: number): void;
|
|
4
4
|
export declare function assertDarwinCreationAcl(fd: number, inheritanceTarget?: "file" | "directory"): void;
|
|
5
5
|
export declare function assertDarwinCreationDirectoryAcl(pathname: string, expected: BigIntStats, inheritanceTarget?: "file" | "directory"): void;
|
|
6
|
-
//# sourceMappingURL=creation-darwin.d.ts.map
|
package/dist/creation-path.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type BigIntStats } from "node:fs";
|
|
2
2
|
import { type AsyncDirectoryGuard, type AnyAsyncDirectoryGuard } from "./directory-guard.js";
|
|
3
|
+
import type { CreationPermissions } from "./creation-permissions.js";
|
|
3
4
|
export type CreationParentIdentity = Readonly<{
|
|
4
5
|
dev: bigint;
|
|
5
6
|
ino: bigint;
|
|
@@ -10,6 +11,7 @@ export type CreationPath = {
|
|
|
10
11
|
parent: AsyncDirectoryGuard<BigIntStats>;
|
|
11
12
|
assertParent(): void;
|
|
12
13
|
};
|
|
14
|
+
export declare function assertBeforeCreation(selected: CreationPath, permissions: CreationPermissions, assertion: (() => void) | undefined, kind: "file" | "directory"): void;
|
|
13
15
|
export declare function creationAdmissionFromParent(parent: AnyAsyncDirectoryGuard): {
|
|
14
16
|
expectedParentIdentity: CreationParentIdentity;
|
|
15
17
|
};
|
|
@@ -18,4 +20,3 @@ export declare function creationCollision(error: unknown): unknown;
|
|
|
18
20
|
/** Remove only the recorded empty stage; never traverse a replaced directory. */
|
|
19
21
|
export declare function removeCreationDirectory(directory: string, identity: BigIntStats, assertParent: () => void): void;
|
|
20
22
|
export declare function removeCreationDirectoryAsync(directory: string, identity: BigIntStats, assertParent: () => void): Promise<void>;
|
|
21
|
-
//# sourceMappingURL=creation-path.d.ts.map
|