@openclaw/matrix 2026.11.5 → 2026.11.10-beta.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/dist/.setup/{account-config-CRsKoMqJ.mjs → account-config-CVM2a28p.mjs} +1 -2
- package/dist/.setup/{account-selection-UUPhMBmu.mjs → account-selection-Cow3TMFO.mjs} +5 -8
- package/dist/.setup/{approval-handler.runtime-Ca12_7Qa.mjs → approval-handler.runtime-D7KO6ds_.mjs} +8 -9
- package/dist/.setup/{approval-reactions-BazmsDbe.mjs → approval-reactions-Bz_8XB01.mjs} +2 -3
- package/dist/.setup/{backup-health-Dm_YMVFT.mjs → backup-health-BxH69np2.mjs} +1 -2
- package/dist/.setup/{channel-FfaEmyIU.mjs → channel-BJGiol_v.mjs} +30 -40
- package/dist/.setup/{channel.runtime-CkkHG8zy.mjs → channel.runtime-BrSYy4Qm.mjs} +10 -12
- package/dist/.setup/{channel.setup-B00zzOOL.mjs → channel.setup-DJdvsvAL.mjs} +9 -7
- package/dist/.setup/{cli-dz9hd2dR.mjs → cli-CjjggD1Y.mjs} +25 -34
- package/dist/.setup/{cli-metadata-CwUhA9CY.mjs → cli-metadata-nnz3uf_k.mjs} +3 -5
- package/dist/.setup/{client-D1bsidwU.mjs → client-DIeTvz6C.mjs} +21 -26
- package/dist/.setup/{client-bootstrap-CTT0VF6v.mjs → client-bootstrap-CvbnV_7R.mjs} +2 -3
- package/dist/.setup/{client-support-B_Mp4Qk9.mjs → client-support-CqXAOZp3.mjs} +2 -3
- package/dist/.setup/{client-CFPYqaYK.mjs → client-uAX074II.mjs} +4 -5
- package/dist/.setup/{config-paths-CnREYb1Y.mjs → config-paths-DBpHxDyc.mjs} +1 -2
- package/dist/.setup/{create-client-Ccf5wyS3.mjs → create-client-XL9SKJ2s.mjs} +8 -9
- package/dist/.setup/{credentials-kT20jk_u.mjs → credentials-CGgWuhFV.mjs} +5 -6
- package/dist/.setup/{credentials-read-CM6wXUjL.mjs → credentials-read-rPqEpuxv.mjs} +5 -6
- package/dist/.setup/{credentials-state-B3cuUFwZ.mjs → credentials-state-jxq29yQw.mjs} +1 -2
- package/dist/.setup/{crypto-node.runtime-6Aj_ltHQ.mjs → crypto-node.runtime-E_hqXGxm.mjs} +1 -2
- package/dist/.setup/{crypto-runtime-DZNytKX5.mjs → crypto-runtime-D96thr_g.mjs} +10 -15
- package/dist/.setup/{crypto-state-store-BZLlwkv_.mjs → crypto-state-store-CzAmeC_Z.mjs} +4 -4
- package/dist/.setup/{crypto-store-ownership-CiQ1l_O7.mjs → crypto-store-ownership-DPO9WcVz.mjs} +3 -4
- package/dist/.setup/{crypto-unsafe-state-doctor-Dh1dtuSz.mjs → crypto-unsafe-state-doctor-CkhtP1mQ.mjs} +7 -8
- package/dist/.setup/{deps-D-W_QQjz.mjs → deps-CVPT2Ros.mjs} +1 -2
- package/dist/.setup/{device-health-Ck2YpEVN.mjs → device-health-D7n-lPeb.mjs} +2 -3
- package/dist/.setup/{direct-management-Dp1giZ34.mjs → direct-management-D59C1WO-.mjs} +7 -11
- package/dist/.setup/{directory-live-ufzRheWx.mjs → directory-live-5RgaKKuc.mjs} +5 -6
- package/dist/.setup/{doctor-contract-BANpMUbP.mjs → doctor-contract-GiXgCj7k.mjs} +2 -3
- package/dist/.setup/{draft-stream-BPjjKSoI.mjs → draft-stream-CjEpElZ-.mjs} +3 -4
- package/dist/.setup/{encryption-guidance-Br3Lv9Hm.mjs → encryption-guidance-DfbEaKct.mjs} +3 -4
- package/dist/.setup/{env-vars-aEBngJPa.mjs → env-vars-Bh1iOXJ1.mjs} +1 -2
- package/dist/.setup/{errors-Bw4EHwKX.mjs → errors-CL3YJV8U.mjs} +1 -2
- package/dist/.setup/{event-helpers-CxNgMQqH.mjs → event-helpers-DDUjVVf7.mjs} +1 -2
- package/dist/.setup/{exec-approvals-BwEOyI1-.mjs → exec-approvals-DcQS_LNp.mjs} +6 -9
- package/dist/.setup/{file-sync-store-BpS12yaK.mjs → file-sync-store-CAhnwOPA.mjs} +6 -36
- package/dist/.setup/{http-client-B_ohXrBm.mjs → http-client-CqnKFKUH.mjs} +5 -8
- package/dist/.setup/{idb-persistence-BTOsltD9.mjs → idb-persistence-DeGUs--C.mjs} +6 -7
- package/dist/.setup/{idb-persistence-lock-Bh3ZLIsE.mjs → idb-persistence-lock-CH2K6d_3.mjs} +1 -2
- package/dist/.setup/{joined-room-encryption-C0gHa2DG.mjs → joined-room-encryption-9sJK1kM-.mjs} +2 -3
- package/dist/.setup/{logger-CuAzdD8Q.mjs → logger-B9TwnY6C.mjs} +2 -3
- package/dist/.setup/{logging-CoaEyRtA.mjs → logging-Bnsn7s4r.mjs} +3 -4
- package/dist/.setup/{messages-DpJ9naJa.mjs → messages-CmlRhlPp.mjs} +9 -14
- package/dist/.setup/{monitor-vpzawYrB.mjs → monitor-DG8yTCh9.mjs} +98 -137
- package/dist/.setup/{onboarding-BK-V2ZLT.mjs → onboarding-CY_oesMI.mjs} +10 -11
- package/dist/.setup/{outbound-DydCDuvM.mjs → outbound-BY9kS8Kt.mjs} +5 -6
- package/dist/.setup/{profile-update-RLsY-gu6.mjs → profile-update-BRugBHSm.mjs} +13 -10
- package/dist/.setup/{reaction-events-lcgVF3M5.mjs → reaction-events-B1DQTt9d.mjs} +8 -9
- package/dist/.setup/{resolve-targets-DYW8ULZS.mjs → resolve-targets-CUBvJ37V.mjs} +4 -5
- package/dist/.setup/{retired-state-JGUEBE72.mjs → retired-state-BsxdpJNk.mjs} +3 -41
- package/dist/.setup/{room-info-Dhc4efkA.mjs → room-info-CJVhaCvB.mjs} +6 -8
- package/dist/.setup/{runtime-1kn1P6io.mjs → runtime-Ck8TjD7L.mjs} +1 -2
- package/dist/.setup/{runtime-doctor-migrations-hxP-CXX7.mjs → runtime-doctor-migrations-CSvRANPN.mjs} +5 -10
- package/dist/.setup/{runtime-setter-api-i2MOXoT3.mjs → runtime-setter-api-CpwhcBQK.mjs} +1 -1
- package/dist/.setup/{sdk-DPXiQ3jr.mjs → sdk-CRJQM2N0.mjs} +33 -47
- package/dist/.setup/{secret-contract-DxyzKSzf.mjs → secret-contract-AKnr45nw.mjs} +2 -3
- package/dist/.setup/{secret-contract-api-Dukgvike.mjs → secret-contract-api-DMSwMIxd.mjs} +1 -1
- package/dist/.setup/{send-HHAbKARg.mjs → send-QWCT3NT9.mjs} +58 -44
- package/dist/.setup/{send-currentness-DGxiiBn9.mjs → send-currentness-D1x6YP9O.mjs} +2 -4
- package/dist/.setup/{setup-bootstrap-DaT2j28V.mjs → setup-bootstrap-DrBapwjQ.mjs} +4 -5
- package/dist/.setup/{setup-core-DcqQbLZv.mjs → setup-core-B4sVj_9e.mjs} +13 -20
- package/dist/.setup/setup-plugin-api-t9yhI-Tq.mjs +2 -0
- package/dist/.setup/sqlite-state-D6Zpz1q1.mjs +36 -0
- package/dist/.setup/{startup-verification-UkaoSldm.mjs → startup-verification-DfOuAruK.mjs} +5 -5
- package/dist/.setup/{state-layout-walk-BQMgMykU.mjs → state-layout-walk-BqCZTHpp.mjs} +2 -3
- package/dist/.setup/{storage-C3N6YZIn.mjs → storage-CCarF_gm.mjs} +9 -10
- package/dist/.setup/{storage-paths-B51JM-pC.mjs → storage-paths-e_Vq6cvw.mjs} +1 -2
- package/dist/.setup/{subagent-hooks-CfGAysJi.mjs → subagent-hooks-BdbuojSv.mjs} +2 -3
- package/dist/.setup/{sync-cache-state-BKVaKRzQ.mjs → sync-cache-state-BMvqW4Ii.mjs} +5 -5
- package/dist/.setup/{sync-state-CWbp0QSY.mjs → sync-state-Cu1nagBV.mjs} +1 -2
- package/dist/.setup/{target-ids-HhcaKX1n.mjs → target-ids-DltG_ZHJ.mjs} +1 -2
- package/dist/.setup/{task-runner-DY3aKiQa.mjs → task-runner-CYyGHdNW.mjs} +1 -2
- package/dist/.setup/{thread-binding-api-BvuaKpd0.mjs → thread-binding-api-OtSciHmZ.mjs} +2 -3
- package/dist/.setup/{thread-bindings-891JsKXF.mjs → thread-bindings-jNXWItIL.mjs} +54 -23
- package/dist/.setup/{thread-bindings-shared-QmZOfX9Q.mjs → thread-bindings-shared-DEAGGuDA.mjs} +6 -3
- package/dist/.setup/{tool-actions-8mXdq9OV.mjs → tool-actions-4sdtsvN2.mjs} +25 -25
- package/dist/.setup/{url-validation-By_2hsXr.mjs → url-validation-DesoKUns.mjs} +1 -2
- package/dist/.setup/{verification-CcZIVL8P.mjs → verification-DQu-OS0V.mjs} +4 -5
- package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +1 -1
- package/dist/api.js +8 -8
- package/dist/auth-presence.js +2 -3
- package/dist/channel-plugin-api.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-api.js +14 -16
- package/dist/helper-api.js +3 -3
- package/dist/index.js +3 -4
- package/dist/plugin-entry.handlers.runtime.js +3 -4
- package/dist/runtime-api.js +7 -8
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/setup-entry.js +4 -5
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +2 -3
- package/dist/thread-binding-api.js +1 -1
- package/dist/thread-bindings-runtime.js +1 -1
- package/node_modules/@openclaw/fs-safe/CHANGELOG.md +45 -1
- package/node_modules/@openclaw/fs-safe/README.md +4 -0
- package/node_modules/@openclaw/fs-safe/dist/absolute-path.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +2 -2
- package/node_modules/@openclaw/fs-safe/dist/advanced.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic-io.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic-io.js +6 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.js +13 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-options.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-options.js +6 -0
- package/node_modules/@openclaw/fs-safe/dist/errors.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/errors.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.js +1 -11
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +3 -3
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.js +2 -3
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.d.ts +3 -3
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.js +30 -4
- package/node_modules/@openclaw/fs-safe/dist/file-store-prune.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/file-store-prune.js +7 -1
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.js +30 -4
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/file-store.js +5 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.js +9 -0
- package/node_modules/@openclaw/fs-safe/dist/json-store.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +4 -1
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +19 -13
- package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.js +27 -5
- package/node_modules/@openclaw/fs-safe/dist/path-prefix.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/path-prefix.js +84 -7
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-input.js +0 -11
- package/node_modules/@openclaw/fs-safe/dist/prepare-directory-mode.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/prepare-directory-mode.js +61 -0
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +2 -1
- package/node_modules/@openclaw/fs-safe/dist/realpath.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/realpath.js +16 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +8 -6
- package/node_modules/@openclaw/fs-safe/dist/replace-file-types.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/replace-file.js +20 -13
- package/node_modules/@openclaw/fs-safe/dist/root-context.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/root-create-native.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-create-native.js +18 -9
- package/node_modules/@openclaw/fs-safe/dist/root-errors.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/root-errors.js +9 -0
- package/node_modules/@openclaw/fs-safe/dist/root-impl.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/root-mkdir-native.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-mkdir-native.js +35 -16
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts +6 -2
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +32 -20
- package/node_modules/@openclaw/fs-safe/dist/root-path.js +32 -26
- package/node_modules/@openclaw/fs-safe/dist/root-write-admission.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/secret-file.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/secret-file.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.js +5 -4
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.d.ts +3 -2
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.js +8 -9
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-stale-admission.js +3 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-types.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/types.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-hints.js +12 -3
- package/node_modules/@openclaw/fs-safe/dist/windows-security-helper.exe +0 -0
- package/node_modules/@openclaw/fs-safe/dist/write-file-handle.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/write-file-handle.js +10 -12
- package/node_modules/@openclaw/fs-safe/docs/advanced.md +3 -3
- package/node_modules/@openclaw/fs-safe/docs/atomic.md +16 -3
- package/node_modules/@openclaw/fs-safe/docs/compiler-qualification.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/contributing.md +27 -18
- package/node_modules/@openclaw/fs-safe/docs/errors.md +3 -1
- package/node_modules/@openclaw/fs-safe/docs/file-store.md +14 -2
- package/node_modules/@openclaw/fs-safe/docs/in-place-write.md +31 -0
- package/node_modules/@openclaw/fs-safe/docs/install.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/json-store.md +6 -1
- package/node_modules/@openclaw/fs-safe/docs/json.md +5 -1
- package/node_modules/@openclaw/fs-safe/docs/path-prefix.md +14 -4
- package/node_modules/@openclaw/fs-safe/docs/public-api.md +4 -2
- package/node_modules/@openclaw/fs-safe/docs/secret-file.md +5 -1
- package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +4 -0
- package/node_modules/@openclaw/fs-safe/docs/temp.md +9 -1
- package/node_modules/@openclaw/fs-safe/docs/types.md +5 -1
- package/node_modules/@openclaw/fs-safe/package.json +12 -12
- package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-freebsd-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-freebsd-arm64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-freebsd-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-freebsd-x64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-win32-arm64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-arm64-msvc/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
- package/node_modules/@tokenizer/inflate/README.md +57 -17
- package/node_modules/@tokenizer/inflate/lib/ZipHandler.d.ts +12 -1
- package/node_modules/@tokenizer/inflate/lib/ZipHandler.js +127 -57
- package/node_modules/@tokenizer/inflate/lib/ZipLimitError.d.ts +18 -4
- package/node_modules/@tokenizer/inflate/lib/ZipLimitError.js +1 -1
- package/node_modules/@tokenizer/inflate/lib/index.d.ts +1 -1
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/LICENSE.txt +21 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/README.md +736 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbortSignal.d.ts +2 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbortSignal.js +7 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbstractTokenizer.d.ts +117 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbstractTokenizer.js +204 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BlobTokenizer.d.ts +29 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BlobTokenizer.js +57 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferSizeError.d.ts +19 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferSizeError.js +27 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferTokenizer.d.ts +29 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferTokenizer.js +51 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/FileTokenizer.d.ts +47 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/FileTokenizer.js +83 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/NotRegularFileError.d.ts +5 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/NotRegularFileError.js +8 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +34 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/ReadStreamTokenizer.js +140 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerBoundaryError.d.ts +7 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerBoundaryError.js +10 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerView.d.ts +9 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerView.js +184 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/core.d.ts +44 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/core.js +56 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/index.d.ts +17 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/index.js +46 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/isRandomAccessTokenizer.d.ts +6 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/isRandomAccessTokenizer.js +10 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +54 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/AbstractStreamReader.js +73 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Deferred.d.ts +6 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Deferred.js +10 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Errors.d.ts +10 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Errors.js +16 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/StreamReader.d.ts +34 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/StreamReader.js +125 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +14 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamByobReader.js +29 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +19 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +67 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +24 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReader.js +13 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +5 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +19 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/index.d.ts +6 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/index.js +5 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/types.d.ts +163 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/types.js +1 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/package.json +97 -0
- package/node_modules/@tokenizer/inflate/package.json +5 -5
- package/node_modules/fake-indexeddb/README.md +7 -7
- package/node_modules/fake-indexeddb/build/cjs/lib/Index.js +47 -22
- package/node_modules/fake-indexeddb/build/cjs/lib/ObjectStore.js +4 -2
- package/node_modules/fake-indexeddb/build/cjs/lib/RecordStore.js +14 -9
- package/node_modules/fake-indexeddb/build/esm/lib/Index.js +47 -22
- package/node_modules/fake-indexeddb/build/esm/lib/ObjectStore.js +4 -2
- package/node_modules/fake-indexeddb/build/esm/lib/RecordStore.js +14 -9
- package/node_modules/fake-indexeddb/package.json +1 -1
- package/node_modules/file-type/node_modules/strtok3/README.md +154 -9
- package/node_modules/file-type/node_modules/strtok3/lib/AbstractTokenizer.d.ts +3 -0
- package/node_modules/file-type/node_modules/strtok3/lib/AbstractTokenizer.js +12 -4
- package/node_modules/file-type/node_modules/strtok3/lib/BlobTokenizer.js +1 -0
- package/node_modules/file-type/node_modules/strtok3/lib/BufferTokenizer.js +2 -1
- package/node_modules/file-type/node_modules/strtok3/lib/FileTokenizer.d.ts +1 -1
- package/node_modules/file-type/node_modules/strtok3/lib/FileTokenizer.js +3 -3
- package/node_modules/file-type/node_modules/strtok3/lib/ReadStreamTokenizer.js +17 -2
- package/node_modules/file-type/node_modules/strtok3/lib/TokenizerBoundaryError.d.ts +7 -0
- package/node_modules/file-type/node_modules/strtok3/lib/TokenizerBoundaryError.js +10 -0
- package/node_modules/file-type/node_modules/strtok3/lib/TokenizerView.d.ts +9 -0
- package/node_modules/file-type/node_modules/strtok3/lib/TokenizerView.js +184 -0
- package/node_modules/file-type/node_modules/strtok3/lib/core.d.ts +4 -1
- package/node_modules/file-type/node_modules/strtok3/lib/core.js +5 -18
- package/node_modules/file-type/node_modules/strtok3/lib/index.js +28 -5
- package/node_modules/file-type/node_modules/strtok3/lib/isRandomAccessTokenizer.d.ts +6 -0
- package/node_modules/file-type/node_modules/strtok3/lib/isRandomAccessTokenizer.js +10 -0
- package/node_modules/file-type/node_modules/strtok3/lib/stream/StreamReader.d.ts +4 -0
- package/node_modules/file-type/node_modules/strtok3/lib/stream/StreamReader.js +29 -8
- package/node_modules/file-type/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +12 -2
- package/node_modules/file-type/node_modules/strtok3/lib/types.d.ts +19 -2
- package/node_modules/file-type/node_modules/strtok3/package.json +10 -8
- package/node_modules/file-type/package.json +3 -3
- package/node_modules/file-type/source/detectors/ebml.js +31 -16
- package/node_modules/file-type/source/detectors/zip.js +21 -203
- package/node_modules/matrix-js-sdk/CHANGELOG.md +28 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.d.ts +30 -25
- package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.js +91 -100
- package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.d.ts +6 -4
- package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.d.ts +2 -15
- package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.d.ts +36 -7
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js +29 -2
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.d.ts +12 -51
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js +10 -66
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.d.ts +5 -10
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js +25 -44
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.d.ts +8 -8
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js +30 -22
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/ToDeviceKeyTransport.js +7 -8
- package/node_modules/matrix-js-sdk/lib/matrixrtc/ToDeviceKeyTransport.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.d.ts +8 -13
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.js +2 -11
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.d.ts +6 -2
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.js +3 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/types.d.ts +5 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/types.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/types.js +5 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/types.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.d.ts +9 -2
- package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.js +8 -5
- package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.d.ts +17 -2
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.js +88 -47
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room.d.ts +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room.js +8 -2
- package/node_modules/matrix-js-sdk/lib/models/room.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/thread.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/thread.js +23 -2
- package/node_modules/matrix-js-sdk/lib/models/thread.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.d.ts +3 -3
- package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.d.ts +95 -0
- package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.d.ts.map +1 -0
- package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.js +3 -0
- package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.js.map +1 -0
- package/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts +1 -0
- package/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js +5 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/package.json +3 -3
- package/node_modules/matrix-js-sdk/src/matrixrtc/CallMembership.ts +85 -95
- package/node_modules/matrix-js-sdk/src/matrixrtc/EncryptionManager.ts +6 -4
- package/node_modules/matrix-js-sdk/src/matrixrtc/IMembershipManager.ts +2 -15
- package/node_modules/matrix-js-sdk/src/matrixrtc/LivekitTransport.ts +58 -9
- package/node_modules/matrix-js-sdk/src/matrixrtc/MatrixRTCSession.ts +21 -80
- package/node_modules/matrix-js-sdk/src/matrixrtc/MembershipManager.ts +23 -40
- package/node_modules/matrix-js-sdk/src/matrixrtc/RTCEncryptionManager.ts +51 -39
- package/node_modules/matrix-js-sdk/src/matrixrtc/ToDeviceKeyTransport.ts +7 -7
- package/node_modules/matrix-js-sdk/src/matrixrtc/membershipData/rtc.ts +9 -23
- package/node_modules/matrix-js-sdk/src/matrixrtc/membershipData/session.ts +14 -2
- package/node_modules/matrix-js-sdk/src/matrixrtc/types.ts +6 -0
- package/node_modules/matrix-js-sdk/src/models/event-timeline-set.ts +19 -4
- package/node_modules/matrix-js-sdk/src/models/room-sticky-events.ts +92 -58
- package/node_modules/matrix-js-sdk/src/models/room.ts +8 -2
- package/node_modules/matrix-js-sdk/src/models/thread.ts +25 -3
- package/node_modules/matrix-js-sdk/src/rendezvous/MSC4108SignInWithQR.ts +3 -3
- package/node_modules/matrix-js-sdk/src/rendezvous/SignInWithQRFlow.ts +117 -0
- package/node_modules/matrix-js-sdk/src/rendezvous/index.ts +1 -0
- package/node_modules/matrix-js-sdk/src/rust-crypto/index.ts +5 -1
- package/node_modules/music-metadata/README.md +62 -67
- package/node_modules/music-metadata/lib/ParserFactory.js +3 -1
- package/node_modules/music-metadata/lib/aiff/AiffParser.d.ts +2 -0
- package/node_modules/music-metadata/lib/aiff/AiffParser.js +42 -3
- package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +1 -0
- package/node_modules/music-metadata/lib/aiff/AiffToken.js +1 -0
- package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +11 -1
- package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +2 -2
- package/node_modules/music-metadata/lib/asf/AsfObject.js +81 -111
- package/node_modules/music-metadata/lib/asf/AsfParser.js +5 -3
- package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +27 -3
- package/node_modules/music-metadata/lib/asf/AsfUtil.d.ts +1 -1
- package/node_modules/music-metadata/lib/caf/CafParser.js +13 -2
- package/node_modules/music-metadata/lib/caf/CafToken.d.ts +2 -2
- package/node_modules/music-metadata/lib/caf/CafToken.js +9 -2
- package/node_modules/music-metadata/lib/common/Allocation.d.ts +6 -0
- package/node_modules/music-metadata/lib/common/Allocation.js +18 -0
- package/node_modules/music-metadata/lib/common/GenericTagMapper.js +1 -1
- package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +2 -0
- package/node_modules/music-metadata/lib/common/MetadataCollector.js +21 -4
- package/node_modules/music-metadata/lib/common/Util.d.ts +4 -0
- package/node_modules/music-metadata/lib/common/Util.js +34 -1
- package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.d.ts +4 -1
- package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +32 -36
- package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +6 -2
- package/node_modules/music-metadata/lib/flac/FlacParser.js +2 -1
- package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +7 -3
- package/node_modules/music-metadata/lib/id3v2/FrameParser.js +91 -46
- package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +6 -0
- package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.d.ts +5 -0
- package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +6 -4
- package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +2 -1
- package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +57 -15
- package/node_modules/music-metadata/lib/lrc/LyricsParser.d.ts +18 -2
- package/node_modules/music-metadata/lib/lrc/LyricsParser.js +14 -3
- package/node_modules/music-metadata/lib/mp4/Atom.d.ts +3 -3
- package/node_modules/music-metadata/lib/mp4/Atom.js +14 -7
- package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +25 -25
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +136 -119
- package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +16 -2
- package/node_modules/music-metadata/lib/mp4/MP4Parser.js +370 -132
- package/node_modules/music-metadata/lib/mp4/MP4TagMapper.js +30 -0
- package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +19 -8
- package/node_modules/music-metadata/lib/ogg/OggParser.js +6 -2
- package/node_modules/music-metadata/lib/ogg/OggToken.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/OggToken.js +3 -9
- package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +9 -11
- package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +111 -27
- package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.js +6 -0
- package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.js +6 -0
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +8 -4
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +1 -0
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +23 -3
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.d.ts +4 -0
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +15 -2
- package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.js +1 -0
- package/node_modules/music-metadata/lib/type.d.ts +23 -6
- package/node_modules/music-metadata/lib/wav/BwfChunk.d.ts +12 -2
- package/node_modules/music-metadata/lib/wav/BwfChunk.js +39 -11
- package/node_modules/music-metadata/lib/wav/WaveParser.js +13 -2
- package/node_modules/music-metadata/package.json +2 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -1
- package/node_modules/typebox/build/format/date_time.mjs +12 -3
- package/node_modules/typebox/package.json +1 -1
- package/package.json +9 -9
- package/dist/.setup/setup-plugin-api-Cg4TelGZ.mjs +0 -2
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/auto.js +0 -54
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/binarySearchTree.js +0 -413
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/fakeIndexedDB.js +0 -1018
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/forceCloseDatabase.js +0 -99
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/getAll.js +0 -707
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/memoryLeaks.js +0 -42
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/auto.js +0 -52
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/binarySearchTree.js +0 -409
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/fakeIndexedDB.js +0 -1014
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/forceCloseDatabase.js +0 -95
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/getAll.js +0 -703
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/memoryLeaks.js +0 -38
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
+
import asyncFs from "node:fs/promises";
|
|
2
3
|
import { platform } from "node:os";
|
|
3
4
|
import { getSystemErrorName } from "node:util";
|
|
4
5
|
import { FsSafeError } from "./errors.js";
|
|
@@ -73,3 +74,18 @@ function resolve(input, native) {
|
|
|
73
74
|
export const realpathSync = Object.assign((input) => resolve(input, false), {
|
|
74
75
|
native: (input) => resolve(input, true),
|
|
75
76
|
});
|
|
77
|
+
/** Async on Node; retain runtime-specific native canonicalization guarantees. */
|
|
78
|
+
export async function realpathNative(input) {
|
|
79
|
+
if (bunPosix)
|
|
80
|
+
return realpathSync.native(input);
|
|
81
|
+
try {
|
|
82
|
+
return await asyncFs.realpath(input);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
if (process.platform !== "win32" || error.code !== "EPERM" ||
|
|
86
|
+
error.syscall !== "realpath")
|
|
87
|
+
throw error;
|
|
88
|
+
// AppContainer DOS-name translation still belongs to the native sync owner.
|
|
89
|
+
return realpathSync.native(input);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -4,7 +4,8 @@ import { type AtomicFile, type AtomicIo, type Procedure } from "./atomic-io.js";
|
|
|
4
4
|
export declare function syncDirectoryBestEffort(io: AtomicIo, dirPath: string): Procedure<void>;
|
|
5
5
|
export declare function applyDirectoryMode(io: AtomicIo, params: {
|
|
6
6
|
dirPath: string;
|
|
7
|
-
mode: number;
|
|
7
|
+
mode: number | "preserve";
|
|
8
|
+
expectedIdentity?: BigIntStats;
|
|
8
9
|
ignoreChmodError?: boolean;
|
|
9
10
|
mutation?: AtomicMutation;
|
|
10
11
|
}): Procedure<void>;
|
|
@@ -46,9 +46,9 @@ async function pinDirectoryForMode(params) {
|
|
|
46
46
|
if (process.platform === "win32") {
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
const expected = params.fsModule === fs
|
|
49
|
+
const expected = params.expectedIdentity ?? (params.fsModule === fs
|
|
50
50
|
? inspectFileIdentitySync(() => assertDirectory(syncFs.lstatSync(params.dirPath, { bigint: true }), params.dirPath))
|
|
51
|
-
: await inspectFileIdentity(async () => assertDirectory(await params.fsModule.lstat(params.dirPath, { bigint: true }), params.dirPath));
|
|
51
|
+
: await inspectFileIdentity(async () => assertDirectory(await params.fsModule.lstat(params.dirPath, { bigint: true }), params.dirPath)));
|
|
52
52
|
const handle = await params.fsModule.open(params.dirPath, directoryOpenFlags());
|
|
53
53
|
try {
|
|
54
54
|
const owner = ownDirectoryMode({
|
|
@@ -86,7 +86,7 @@ export function* applyDirectoryMode(io, params) {
|
|
|
86
86
|
}));
|
|
87
87
|
let primary;
|
|
88
88
|
try {
|
|
89
|
-
if (owner)
|
|
89
|
+
if (owner && params.mode !== "preserve")
|
|
90
90
|
yield* wait(owner.apply(params.mode));
|
|
91
91
|
}
|
|
92
92
|
catch (error) {
|
|
@@ -107,13 +107,15 @@ export function* applyDirectoryMode(io, params) {
|
|
|
107
107
|
if (process.platform === "win32")
|
|
108
108
|
return;
|
|
109
109
|
const admit = (stat) => assertDirectory(stat, params.dirPath);
|
|
110
|
-
const expected = inspectAtomicIdentity(io, () => io.lstatExact(params.dirPath), undefined, false, admit);
|
|
110
|
+
const expected = params.expectedIdentity ?? inspectAtomicIdentity(io, () => io.lstatExact(params.dirPath), undefined, false, admit);
|
|
111
111
|
const file = yield* io.open(params.dirPath, directoryOpenFlags());
|
|
112
112
|
let primary;
|
|
113
113
|
try {
|
|
114
114
|
inspectAtomicIdentity(io, () => file.statExact(), expected, false, admit);
|
|
115
|
-
params.
|
|
116
|
-
|
|
115
|
+
if (params.mode !== "preserve") {
|
|
116
|
+
params.mutation?.assert();
|
|
117
|
+
file.chmod(params.mode & 0o7777);
|
|
118
|
+
}
|
|
117
119
|
}
|
|
118
120
|
catch (error) {
|
|
119
121
|
primary = { error };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type syncFs from "node:fs";
|
|
2
|
+
import type { DirectoryMode } from "./directory-mode-options.js";
|
|
2
3
|
import type fs from "node:fs/promises";
|
|
3
4
|
import type { RenameIdentityPolicy } from "./pinned-write-types.js";
|
|
4
5
|
import type { AtomicMutationOptions } from "./replace-file-mutation.js";
|
|
@@ -12,7 +13,7 @@ export type ReplaceFileAtomicSyncFileSystem = Pick<typeof syncFs, "mkdirSync" |
|
|
|
12
13
|
export type ReplaceFileAtomicBaseOptions = AtomicMutationOptions & {
|
|
13
14
|
filePath: string;
|
|
14
15
|
content: string | Uint8Array;
|
|
15
|
-
dirMode?:
|
|
16
|
+
dirMode?: DirectoryMode;
|
|
16
17
|
mode?: number;
|
|
17
18
|
/** Inherit only rwx bits from an existing non-symlink regular file. */
|
|
18
19
|
preserveExistingMode?: boolean;
|
|
@@ -4,7 +4,8 @@ import fs from "node:fs/promises";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { recursiveMkdirPath } from "./recursive-mkdir-path.js";
|
|
6
6
|
import { assertDestinationHardlinkPolicy, copyFallbackReplace } from "./replace-file-copy-fallback.js";
|
|
7
|
-
import {
|
|
7
|
+
import { syncDirectoryBestEffort, writeTempFile } from "./replace-file-descriptor.js";
|
|
8
|
+
import { prepareDirectoryMode } from "./prepare-directory-mode.js";
|
|
8
9
|
import { inheritedRegularFileMode } from "./replace-file-mode.js";
|
|
9
10
|
import { atomicExpectedContentHash, validateRenameIdentity, withAtomicRenameIdentityLock, withAtomicRenameIdentityLockSync, } from "./replace-file-rename-policy.js";
|
|
10
11
|
import { AtomicTempOwner } from "./replace-file-temp-owner.js";
|
|
@@ -109,10 +110,14 @@ export async function replaceFileAtomicWithDirectorySync(options, syncParent) {
|
|
|
109
110
|
const fsModule = options.fileSystem?.promises ?? fs;
|
|
110
111
|
const dir = path.dirname(filePath);
|
|
111
112
|
mutation.assert();
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
mode:
|
|
115
|
-
}
|
|
113
|
+
const dirMode = options.dirMode ?? 0o700;
|
|
114
|
+
if (dirMode === "preserve") {
|
|
115
|
+
await runAsync(prepareDirectoryMode(AtomicIo.async(fsModule), { dirPath: dir, mode: "preserve", mutation }));
|
|
116
|
+
}
|
|
117
|
+
else
|
|
118
|
+
await fsModule.mkdir(fsModule === fs ? recursiveMkdirPath(dir) : dir, {
|
|
119
|
+
recursive: true, mode: dirMode,
|
|
120
|
+
});
|
|
116
121
|
mutation.assert();
|
|
117
122
|
return await withAtomicRenameIdentityLock(filePath, () => replaceAsync(options, filePath, renameIdentity, mutation, syncParent));
|
|
118
123
|
});
|
|
@@ -132,10 +137,14 @@ export function replaceFileAtomicSync(options) {
|
|
|
132
137
|
const fsModule = options.fileSystem ?? syncFs;
|
|
133
138
|
const dir = path.dirname(filePath);
|
|
134
139
|
mutation.assert();
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
mode:
|
|
138
|
-
}
|
|
140
|
+
const dirMode = options.dirMode ?? 0o700;
|
|
141
|
+
if (dirMode === "preserve") {
|
|
142
|
+
runSync(prepareDirectoryMode(AtomicIo.sync(fsModule, fsModule.fchmodSync), { dirPath: dir, mode: "preserve", mutation }));
|
|
143
|
+
}
|
|
144
|
+
else
|
|
145
|
+
fsModule.mkdirSync(fsModule === syncFs ? recursiveMkdirPath(dir) : dir, {
|
|
146
|
+
recursive: true, mode: dirMode,
|
|
147
|
+
});
|
|
139
148
|
mutation.assert();
|
|
140
149
|
return withAtomicRenameIdentityLockSync(filePath, () => replaceSync(options, filePath, renameIdentity, mutation));
|
|
141
150
|
}
|
|
@@ -151,7 +160,7 @@ function* replace(io, options, filePath, renameIdentity, mutation, syncParent) {
|
|
|
151
160
|
const syncOptions = options;
|
|
152
161
|
io.fchmodSync = syncOptions.fileSystem?.fchmodSync ?? (syncOptions.fileSystem === undefined ? syncFs.fchmodSync : undefined);
|
|
153
162
|
if (!io.fchmodSync && (options.mode !== undefined || options.preserveExistingMode === true ||
|
|
154
|
-
(process.platform !== "win32" && options.dirMode
|
|
163
|
+
(process.platform !== "win32" && typeof options.dirMode === "number"))) {
|
|
155
164
|
throw new TypeError("fileSystem.fchmodSync is required when mode, dirMode, or preserveExistingMode is specified");
|
|
156
165
|
}
|
|
157
166
|
}
|
|
@@ -159,9 +168,7 @@ function* replace(io, options, filePath, renameIdentity, mutation, syncParent) {
|
|
|
159
168
|
const tempOwner = new AtomicTempOwner(tempPath, io);
|
|
160
169
|
let originalFailure;
|
|
161
170
|
try {
|
|
162
|
-
mutation
|
|
163
|
-
yield* io.mkdir(dir, dirMode);
|
|
164
|
-
yield* applyDirectoryMode(io, { dirPath: dir, mode: dirMode, mutation });
|
|
171
|
+
yield* prepareDirectoryMode(io, { dirPath: dir, mode: dirMode, mutation });
|
|
165
172
|
tempOwner.start();
|
|
166
173
|
tempOwner.adopt(yield* writeTempFile(io, {
|
|
167
174
|
tempPath,
|
|
@@ -6,7 +6,7 @@ import { FsSafeError } from "./errors.js";
|
|
|
6
6
|
import { assertNoNulPathInput, assertNoUnsafeDeviceReadPath, hasNodeErrorCode, isNotFoundPathError, isPathInside, } from "./path.js";
|
|
7
7
|
import { ROOT_PATH_ALIAS_POLICIES, resolveRootPath } from "./root-path.js";
|
|
8
8
|
import { admitPathInsideRoot } from "./root-boundary.js";
|
|
9
|
-
import { errorCauseOptions, outsideWorkspaceError, rootPathChangedError } from "./root-errors.js";
|
|
9
|
+
import { errorCauseOptions, outsideWorkspaceError, pathTraversalPermissionError, rootPathChangedError } from "./root-errors.js";
|
|
10
10
|
import { isDriveRelativePath } from "./safe-path-segment.js";
|
|
11
11
|
import { realpathSync } from "./realpath.js";
|
|
12
12
|
import { inspectFileIdentity } from "./strict-file-identity.js";
|
|
@@ -205,6 +205,9 @@ export async function resolvePathInRoot(root, relativePath, options) {
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
catch (error) {
|
|
208
|
+
const permissionError = pathTraversalPermissionError(error, rawAbsolutePath);
|
|
209
|
+
if (permissionError)
|
|
210
|
+
throw permissionError;
|
|
208
211
|
if (error instanceof FsSafeError && error.code === "symlink") {
|
|
209
212
|
throw error;
|
|
210
213
|
}
|
|
@@ -32,7 +32,7 @@ export type MissingWritableFileInRoot = {
|
|
|
32
32
|
};
|
|
33
33
|
export declare function isNativeCreateCollision(error: unknown): boolean;
|
|
34
34
|
/** Admit only an ordinary direct child; aliases keep the full resolver. */
|
|
35
|
-
export declare function tryMkdirNativeDirectChild(root: RootContext, relativePath: string): boolean;
|
|
35
|
+
export declare function tryMkdirNativeDirectChild(root: RootContext, relativePath: string, mode?: number): boolean;
|
|
36
36
|
export declare function tryMkdirRootNative(params: Creation): Promise<boolean>;
|
|
37
37
|
export declare function verifyMkdirDirectory(binding: NativeBinding, fd: number, pathname: string): void;
|
|
38
38
|
export declare function ensureNativeRootCurrent(root: RootContext): void;
|
|
@@ -56,7 +56,7 @@ import { randomUUID } from "node:crypto";
|
|
|
56
56
|
import fsAsync from "node:fs/promises";
|
|
57
57
|
import path from "node:path";
|
|
58
58
|
import { assertSyncDirectoryGuard, inspectDirectoryIdentitySync } from "./directory-guard.js";
|
|
59
|
-
import { nodeDirectorySearchOnlyFlags } from "./directory-mode-node.js";
|
|
59
|
+
import { finalizeCreatedDirectoryModeSync, nodeDirectorySearchOnlyFlags } from "./directory-mode-node.js";
|
|
60
60
|
import { assertDarwinCreationAcl, assertPrivateDirectory } from "./creation-boundary.js";
|
|
61
61
|
import { assertMutationNotDenied } from "./deny-mutations.js";
|
|
62
62
|
import { FsSafeError } from "./errors.js";
|
|
@@ -295,7 +295,7 @@ async function withNativeDirectory(params, operation, discard) {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
/** Admit only an ordinary direct child; aliases keep the full resolver. */
|
|
298
|
-
export function tryMkdirNativeDirectChild(root, relativePath) {
|
|
298
|
+
export function tryMkdirNativeDirectChild(root, relativePath, mode) {
|
|
299
299
|
if (!isSafePathSegment(relativePath, { allowDotPrefix: true }) || relativePath.endsWith(".") ||
|
|
300
300
|
getFsSafeTestHooks()?.beforeRootFallbackMutation)
|
|
301
301
|
return false;
|
|
@@ -311,7 +311,7 @@ export function tryMkdirNativeDirectChild(root, relativePath) {
|
|
|
311
311
|
return false;
|
|
312
312
|
}
|
|
313
313
|
try {
|
|
314
|
-
mkdirNativeRootChild({ root, target });
|
|
314
|
+
mkdirNativeRootChild({ root, target }, mode);
|
|
315
315
|
return true;
|
|
316
316
|
}
|
|
317
317
|
catch (error) {
|
|
@@ -420,7 +420,7 @@ function ensureNativeRootCurrentLegacy(root, binding) {
|
|
|
420
420
|
__disposeResources(env_4);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
function mkdirNativeRootChild(params) {
|
|
423
|
+
function mkdirNativeRootChild(params, mode) {
|
|
424
424
|
const env_5 = { stack: [], error: void 0, hasError: false };
|
|
425
425
|
try {
|
|
426
426
|
const binding = getNativeBinding("openBeneath", "mkdirChildBeneath");
|
|
@@ -430,19 +430,28 @@ function mkdirNativeRootChild(params) {
|
|
|
430
430
|
rootPath: params.root.rootReal, rootIdentity: params.root.rootIdentity,
|
|
431
431
|
}), false);
|
|
432
432
|
verifyMkdirDirectory(binding, rootOwner.fd, params.root.rootReal);
|
|
433
|
-
const flags = (nodeDirectorySearchOnlyFlags()?.flags ?? fs.constants.O_RDONLY) |
|
|
433
|
+
const flags = (mode === undefined ? nodeDirectorySearchOnlyFlags()?.flags ?? fs.constants.O_RDONLY : fs.constants.O_RDONLY) |
|
|
434
434
|
(fs.constants.O_DIRECTORY ?? 0) | (fs.constants.O_NOFOLLOW ?? 0);
|
|
435
435
|
const name = path.basename(params.target);
|
|
436
436
|
// The admitted Root is already this operation's immediate parent. Retain
|
|
437
437
|
// both handles through the same fresh pathname and canonical identity fences.
|
|
438
438
|
const child = binding.mkdirOpenChildBeneath
|
|
439
|
-
? binding.mkdirOpenChildBeneath(rootOwner.fd, name, 0o777, flags)
|
|
440
|
-
:
|
|
439
|
+
? binding.mkdirOpenChildBeneath(rootOwner.fd, name, mode ?? 0o777, flags)
|
|
440
|
+
: {
|
|
441
|
+
created: binding.mkdirChildBeneath(rootOwner.fd, name, mode ?? 0o777),
|
|
442
|
+
fd: binding.openBeneath(rootOwner.fd, name, flags).fd,
|
|
443
|
+
};
|
|
441
444
|
const close = captureNativeFdClose(binding);
|
|
442
|
-
const childOwner = __addDisposableResource(env_5, { [Symbol.dispose]() { close(child); } }, false);
|
|
445
|
+
const childOwner = __addDisposableResource(env_5, { [Symbol.dispose]() { close(child.fd); } }, false);
|
|
443
446
|
assertRootIdentityCurrentSync(params.root);
|
|
444
|
-
verifyMkdirDirectory(binding, child, params.target);
|
|
447
|
+
verifyMkdirDirectory(binding, child.fd, params.target);
|
|
445
448
|
verifyMkdirDirectory(binding, rootOwner.fd, params.root.rootReal);
|
|
449
|
+
if (mode !== undefined && child.created) {
|
|
450
|
+
finalizeCreatedDirectoryModeSync(child, mode);
|
|
451
|
+
verifyMkdirDirectory(binding, child.fd, params.target);
|
|
452
|
+
verifyMkdirDirectory(binding, rootOwner.fd, params.root.rootReal);
|
|
453
|
+
assertRootIdentityCurrentSync(params.root);
|
|
454
|
+
}
|
|
446
455
|
}
|
|
447
456
|
catch (e_5) {
|
|
448
457
|
env_5.error = e_5;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FsSafeError, type FsSafeErrorDetails } from "./errors.js";
|
|
2
2
|
export declare function fileNotFoundError(cause?: unknown, details?: FsSafeErrorDetails): FsSafeError;
|
|
3
3
|
export declare function outsideWorkspaceError(): FsSafeError;
|
|
4
|
+
/** Classify raw traversal denials without disguising an established policy failure. */
|
|
5
|
+
export declare function pathTraversalPermissionError(error: unknown, targetPath: string): FsSafeError | undefined;
|
|
4
6
|
export declare function rootPathChangedError(cause?: Error): FsSafeError;
|
|
5
7
|
export declare function directoryComponentNotDirectoryError(cause?: unknown): FsSafeError;
|
|
6
8
|
export declare function hardlinkedPathNotAllowedError(): FsSafeError;
|
|
@@ -15,6 +15,15 @@ export function fileNotFoundError(cause, details) {
|
|
|
15
15
|
export function outsideWorkspaceError() {
|
|
16
16
|
return new FsSafeError("outside-workspace", "file is outside workspace root");
|
|
17
17
|
}
|
|
18
|
+
/** Classify raw traversal denials without disguising an established policy failure. */
|
|
19
|
+
export function pathTraversalPermissionError(error, targetPath) {
|
|
20
|
+
if (error instanceof FsSafeError)
|
|
21
|
+
return error.code === "permission-denied" ? error : undefined;
|
|
22
|
+
if (!hasNodeErrorCode(error, "EACCES") && !hasNodeErrorCode(error, "EPERM"))
|
|
23
|
+
return;
|
|
24
|
+
const deniedPath = isNodeError(error) && typeof error.path === "string" ? error.path : targetPath;
|
|
25
|
+
return new FsSafeError("permission-denied", `permission denied while resolving ${deniedPath}`, errorCauseOptions(error));
|
|
26
|
+
}
|
|
18
27
|
export function rootPathChangedError(cause) {
|
|
19
28
|
return new FsSafeError("path-mismatch", "root path changed during operation", { cause });
|
|
20
29
|
}
|
|
@@ -90,7 +90,7 @@ import { listDirectoryPath, openRootDirectoryListing } from "./root-directory-li
|
|
|
90
90
|
import { statResolvedPathInRoot } from "./root-path-stat.js";
|
|
91
91
|
import { entriesInRoot } from "./root-entries.js";
|
|
92
92
|
import { assertRootIdentityCurrent, assertRootIdentityCurrentSync, assertValidRootDestinationPath, assertValidRootRelativePath, createRootObservationGuard, ensureTrailingSep, expandRelativePathWithHome, resolvePathInRoot, resolveRootContext, rootRelativeReadPath, } from "./root-context.js";
|
|
93
|
-
import { errorCauseOptions, fileNotFoundError, hardlinkedPathNotAllowedError, isAlreadyExistsError, normalizePinnedPathError, normalizePinnedWriteError, outsideWorkspaceError, } from "./root-errors.js";
|
|
93
|
+
import { errorCauseOptions, fileNotFoundError, hardlinkedPathNotAllowedError, isAlreadyExistsError, normalizePinnedPathError, normalizePinnedWriteError, outsideWorkspaceError, pathTraversalPermissionError, } from "./root-errors.js";
|
|
94
94
|
import { getFsSafeTestHooks } from "./test-hooks.js";
|
|
95
95
|
import { stringifyJsonDocument } from "./json-stringify.js";
|
|
96
96
|
import { walkRoot } from "./root-walk.js";
|
|
@@ -1078,6 +1078,9 @@ async function resolvePinnedRootPathInRoot(root, params) {
|
|
|
1078
1078
|
resolved = await (params.removalReceipts ? resolveRootPathForRemoval(resolution, params.removalReceipts) : resolveRootPath(resolution));
|
|
1079
1079
|
}
|
|
1080
1080
|
catch (err) {
|
|
1081
|
+
const permissionError = pathTraversalPermissionError(err, params.relativePath);
|
|
1082
|
+
if (permissionError)
|
|
1083
|
+
throw permissionError;
|
|
1081
1084
|
if (err instanceof FsSafeError && err.code === "symlink")
|
|
1082
1085
|
throw err;
|
|
1083
1086
|
throw new FsSafeError("path-alias", "path alias escape blocked", { cause: err });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RootContext } from "./root-context.js";
|
|
2
|
-
export declare function tryMkdirNativeParents(root: RootContext, relativePath: string): boolean;
|
|
2
|
+
export declare function tryMkdirNativeParents(root: RootContext, relativePath: string, mode?: number): boolean;
|
|
@@ -53,7 +53,7 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
53
53
|
import fs from "node:fs";
|
|
54
54
|
import path from "node:path";
|
|
55
55
|
import { inspectDirectoryIdentitySync } from "./directory-guard.js";
|
|
56
|
-
import { nodeDirectorySearchOnlyFlags } from "./directory-mode-node.js";
|
|
56
|
+
import { finalizeCreatedDirectoryModeSync, nodeDirectorySearchOnlyFlags } from "./directory-mode-node.js";
|
|
57
57
|
import { FsSafeError } from "./errors.js";
|
|
58
58
|
import { getNativeBinding } from "./native.js";
|
|
59
59
|
import { captureNativeFdClose } from "./native-binding.js";
|
|
@@ -67,9 +67,9 @@ import { isSafePathSegment } from "./safe-path-segment.js";
|
|
|
67
67
|
import { inspectFileIdentitySync } from "./strict-file-identity.js";
|
|
68
68
|
import { getFsSafeTestHooks } from "./test-hooks.js";
|
|
69
69
|
import { pathForWindowsFilesystem } from "./windows-path-alias.js";
|
|
70
|
-
export function tryMkdirNativeParents(root, relativePath) {
|
|
70
|
+
export function tryMkdirNativeParents(root, relativePath, mode) {
|
|
71
71
|
try {
|
|
72
|
-
return mkdirOrdinaryNativeParents(root, relativePath);
|
|
72
|
+
return mkdirOrdinaryNativeParents(root, relativePath, mode);
|
|
73
73
|
}
|
|
74
74
|
catch (error) {
|
|
75
75
|
if (hasNodeErrorCode(error, "ENOTDIR"))
|
|
@@ -77,7 +77,7 @@ export function tryMkdirNativeParents(root, relativePath) {
|
|
|
77
77
|
throw error;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
function mkdirOrdinaryNativeParents(root, relativePath) {
|
|
80
|
+
function mkdirOrdinaryNativeParents(root, relativePath, mode) {
|
|
81
81
|
if (getFsSafeTestHooks()?.beforeRootFallbackMutation)
|
|
82
82
|
return false;
|
|
83
83
|
const segments = relativePath.split(path.sep === "\\" ? /[\\/]/ : "/");
|
|
@@ -102,7 +102,7 @@ function mkdirOrdinaryNativeParents(root, relativePath) {
|
|
|
102
102
|
catch (error) {
|
|
103
103
|
// Reuse this exact Root snapshot and failed parent observation without an
|
|
104
104
|
// intervening await. All opened ancestors still receive fresh native fences.
|
|
105
|
-
return hasNodeErrorCode(error, "ENOENT") ? mkdirMissingParents(root, segments, rootStat) : false;
|
|
105
|
+
return hasNodeErrorCode(error, "ENOENT") ? mkdirMissingParents(root, segments, rootStat, mode) : false;
|
|
106
106
|
}
|
|
107
107
|
try {
|
|
108
108
|
if (realpathSync.native(pathForWindowsFilesystem(parentPath)) !== parentPath)
|
|
@@ -111,12 +111,12 @@ function mkdirOrdinaryNativeParents(root, relativePath) {
|
|
|
111
111
|
catch {
|
|
112
112
|
return false;
|
|
113
113
|
}
|
|
114
|
-
return mkdirExistingParent(root, segments, parentIdentity);
|
|
114
|
+
return mkdirExistingParent(root, segments, parentIdentity, mode);
|
|
115
115
|
}
|
|
116
116
|
/** Ordinary missing suffixes need no policy callbacks or repeated path resolution. */
|
|
117
|
-
function mkdirMissingParents(root, segments, rootStat) {
|
|
117
|
+
function mkdirMissingParents(root, segments, rootStat, mode) {
|
|
118
118
|
const binding = getNativeBinding("openBeneath", "mkdirChildBeneath");
|
|
119
|
-
if (!binding?.openBeneath || !binding.mkdirOpenChildBeneath)
|
|
119
|
+
if (!binding?.openBeneath || !binding.mkdirChildBeneath || (!binding.mkdirOpenChildBeneath && mode === undefined))
|
|
120
120
|
return false;
|
|
121
121
|
let parentDepth = segments.length - 2;
|
|
122
122
|
let parentPath;
|
|
@@ -156,7 +156,7 @@ function mkdirMissingParents(root, segments, rootStat) {
|
|
|
156
156
|
if (errors.length)
|
|
157
157
|
throw new AggregateError(errors, "mkdir directory close failed");
|
|
158
158
|
} }, false);
|
|
159
|
-
const flags = (nodeDirectorySearchOnlyFlags()?.flags ?? fs.constants.O_RDONLY) |
|
|
159
|
+
const flags = (mode === undefined ? nodeDirectorySearchOnlyFlags()?.flags ?? fs.constants.O_RDONLY : fs.constants.O_RDONLY) |
|
|
160
160
|
(fs.constants.O_DIRECTORY ?? 0) | (fs.constants.O_NOFOLLOW ?? 0);
|
|
161
161
|
let current = rootOwner.fd;
|
|
162
162
|
if (parentDepth > 0) {
|
|
@@ -172,12 +172,21 @@ function mkdirMissingParents(root, segments, rootStat) {
|
|
|
172
172
|
};
|
|
173
173
|
assertCurrent();
|
|
174
174
|
for (const segment of segments.slice(parentDepth)) {
|
|
175
|
-
const child = binding.mkdirOpenChildBeneath
|
|
175
|
+
const child = binding.mkdirOpenChildBeneath
|
|
176
|
+
? binding.mkdirOpenChildBeneath(current, segment, mode ?? 0o777, flags)
|
|
177
|
+
: {
|
|
178
|
+
created: binding.mkdirChildBeneath(current, segment, mode ?? 0o777),
|
|
179
|
+
fd: binding.openBeneath(current, segment, flags).fd,
|
|
180
|
+
};
|
|
176
181
|
parentPath = path.join(parentPath, segment);
|
|
177
182
|
directories.push({ fd: child.fd, pathname: parentPath });
|
|
178
183
|
// Retain every ancestor until the complete suffix is admitted. The
|
|
179
184
|
// post-create fence also precedes the next synchronous child mutation.
|
|
180
185
|
assertCurrent();
|
|
186
|
+
if (mode !== undefined && child.created) {
|
|
187
|
+
finalizeCreatedDirectoryModeSync(child, mode);
|
|
188
|
+
assertCurrent();
|
|
189
|
+
}
|
|
181
190
|
current = child.fd;
|
|
182
191
|
}
|
|
183
192
|
return true;
|
|
@@ -196,7 +205,7 @@ function mkdirMissingParents(root, segments, rootStat) {
|
|
|
196
205
|
throw error;
|
|
197
206
|
}
|
|
198
207
|
}
|
|
199
|
-
function mkdirExistingParent(root, segments, parentIdentity) {
|
|
208
|
+
function mkdirExistingParent(root, segments, parentIdentity, mode) {
|
|
200
209
|
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
201
210
|
try {
|
|
202
211
|
const target = path.join(root.rootReal, ...segments);
|
|
@@ -209,7 +218,7 @@ function mkdirExistingParent(root, segments, parentIdentity) {
|
|
|
209
218
|
rootPath: root.rootReal, rootIdentity: root.rootIdentity,
|
|
210
219
|
}), false);
|
|
211
220
|
verifyMkdirDirectory(binding, rootOwner.fd, root.rootReal);
|
|
212
|
-
const flags = (nodeDirectorySearchOnlyFlags()?.flags ?? fs.constants.O_RDONLY) |
|
|
221
|
+
const flags = (mode === undefined ? nodeDirectorySearchOnlyFlags()?.flags ?? fs.constants.O_RDONLY : fs.constants.O_RDONLY) |
|
|
213
222
|
(fs.constants.O_DIRECTORY ?? 0) | (fs.constants.O_NOFOLLOW ?? 0);
|
|
214
223
|
const close = captureNativeFdClose(binding);
|
|
215
224
|
const parent = binding.openBeneath(rootOwner.fd, segments.slice(0, -1).join("/"), flags).fd;
|
|
@@ -219,14 +228,24 @@ function mkdirExistingParent(root, segments, parentIdentity) {
|
|
|
219
228
|
assertRootIdentityCurrentSync(root);
|
|
220
229
|
const name = segments.at(-1);
|
|
221
230
|
const child = binding.mkdirOpenChildBeneath
|
|
222
|
-
? binding.mkdirOpenChildBeneath(parent, name, 0o777, flags)
|
|
223
|
-
:
|
|
224
|
-
|
|
231
|
+
? binding.mkdirOpenChildBeneath(parent, name, mode ?? 0o777, flags)
|
|
232
|
+
: {
|
|
233
|
+
created: binding.mkdirChildBeneath(parent, name, mode ?? 0o777),
|
|
234
|
+
fd: binding.openBeneath(parent, name, flags).fd,
|
|
235
|
+
};
|
|
236
|
+
const childOwner = __addDisposableResource(env_2, { [Symbol.dispose]() { close(child.fd); } }, false);
|
|
225
237
|
assertRootIdentityCurrentSync(root);
|
|
226
|
-
verifyMkdirDirectory(binding, child, target);
|
|
238
|
+
verifyMkdirDirectory(binding, child.fd, target);
|
|
227
239
|
inspectDirectoryIdentitySync(parentPath, parentIdentity);
|
|
228
240
|
verifyMkdirDirectory(binding, parent, parentPath);
|
|
229
241
|
verifyMkdirDirectory(binding, rootOwner.fd, root.rootReal);
|
|
242
|
+
if (mode !== undefined && child.created) {
|
|
243
|
+
finalizeCreatedDirectoryModeSync(child, mode);
|
|
244
|
+
verifyMkdirDirectory(binding, child.fd, target);
|
|
245
|
+
verifyMkdirDirectory(binding, parent, parentPath);
|
|
246
|
+
verifyMkdirDirectory(binding, rootOwner.fd, root.rootReal);
|
|
247
|
+
assertRootIdentityCurrentSync(root);
|
|
248
|
+
}
|
|
230
249
|
return true;
|
|
231
250
|
}
|
|
232
251
|
catch (e_2) {
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import { runAsync, runSync, type Procedure } from "./atomic-io.js";
|
|
1
2
|
import { type RootBoundaryIdentity } from "./root-boundary.js";
|
|
3
|
+
export declare const synchronousRootTraversal: boolean;
|
|
4
|
+
export declare const runRootTraversal: typeof runAsync | typeof runSync;
|
|
2
5
|
export declare function absolutePathWithRawSegments(candidate: string): string;
|
|
3
6
|
export declare function rawPathRelativeToCanonicalRoot(candidate: string, rootCanonicalPath: string, options?: {
|
|
4
7
|
rejectSymlinks?: boolean;
|
|
5
8
|
rejectFinalSymlink?: boolean;
|
|
6
9
|
rootIdentity?: RootBoundaryIdentity;
|
|
7
|
-
}): string | undefined
|
|
10
|
+
}, synchronous?: boolean): Procedure<string | undefined>;
|
|
8
11
|
export declare function resolvePathViaExistingAncestor(targetPath: string): Promise<string>;
|
|
9
12
|
export declare function resolvePathViaExistingAncestorSync(targetPath: string): string;
|
|
10
13
|
export type RootPathMetadataMode = "native" | "ordinary";
|
|
11
14
|
export declare function resolveExistingAncestor(targetPath: string, mode: RootPathMetadataMode, preserveRawSegments?: boolean, remainingHops?: number): string;
|
|
12
|
-
export declare function
|
|
15
|
+
export declare function resolveExistingAncestorProcedure(targetPath: string, mode: RootPathMetadataMode, synchronous: boolean, preserveRawSegments?: boolean, remainingHops?: number): Procedure<string>;
|
|
16
|
+
export declare function resolveSymlinkHopPath(symlinkPath: string, mode: RootPathMetadataMode, rejectUnresolved?: boolean, remainingHops?: number, synchronous?: boolean): Procedure<string>;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
+
import asyncFs from "node:fs/promises";
|
|
2
3
|
import path from "node:path";
|
|
4
|
+
import { runAsync, runSync, wait } from "./atomic-io.js";
|
|
3
5
|
import { FsSafeError } from "./errors.js";
|
|
4
6
|
import { formatErrorDetail } from "./error-detail.js";
|
|
5
7
|
import { isNotFoundPathError, isPathInside, isSymlinkOpenError } from "./path.js";
|
|
6
|
-
import { realpathSync } from "./realpath.js";
|
|
8
|
+
import { realpathNative, realpathSync } from "./realpath.js";
|
|
7
9
|
import { assertNoWindowsPathAlias, isForeignWindowsShareOrDevicePath, pathForWindowsFilesystem, resolvePathFromBasePreservingWindowsRoot, resolvePathPreservingWindowsRoot, } from "./windows-path-alias.js";
|
|
8
10
|
import { admitPathInsideRoot } from "./root-boundary.js";
|
|
9
11
|
import { errorCauseOptions } from "./root-errors.js";
|
|
12
|
+
// Windows native realpath denies delete sharing. Preserve read/publication
|
|
13
|
+
// scheduling until canonicalization can safely overlap replacement.
|
|
14
|
+
export const synchronousRootTraversal = process.platform === "win32";
|
|
15
|
+
export const runRootTraversal = synchronousRootTraversal ? runSync : runAsync;
|
|
10
16
|
export function absolutePathWithRawSegments(candidate) {
|
|
11
17
|
if (path.sep !== "\\") {
|
|
12
18
|
if (path.isAbsolute(candidate))
|
|
@@ -24,7 +30,7 @@ export function absolutePathWithRawSegments(candidate) {
|
|
|
24
30
|
const base = drive ? path.resolve(drive) : process.cwd();
|
|
25
31
|
return `${base}${base.endsWith(path.sep) ? "" : path.sep}${raw.slice(drive.length)}`;
|
|
26
32
|
}
|
|
27
|
-
export function rawPathRelativeToCanonicalRoot(candidate, rootCanonicalPath, options = {}) {
|
|
33
|
+
export function* rawPathRelativeToCanonicalRoot(candidate, rootCanonicalPath, options = {}, synchronous = true) {
|
|
28
34
|
assertNoWindowsPathAlias(candidate);
|
|
29
35
|
assertNoWindowsPathAlias(rootCanonicalPath);
|
|
30
36
|
const absolute = absolutePathWithRawSegments(candidate);
|
|
@@ -43,7 +49,7 @@ export function rawPathRelativeToCanonicalRoot(candidate, rootCanonicalPath, opt
|
|
|
43
49
|
let isSymlink = false;
|
|
44
50
|
try {
|
|
45
51
|
const operationPath = pathForWindowsFilesystem(prefix);
|
|
46
|
-
const stat = fs.lstatSync(operationPath);
|
|
52
|
+
const stat = synchronous ? fs.lstatSync(operationPath) : yield* wait(asyncFs.lstat(operationPath));
|
|
47
53
|
isSymlink = stat.isSymbolicLink();
|
|
48
54
|
// Check the original leaf before canonicalization can erase an entry alias.
|
|
49
55
|
if (isSymlink && options.rejectFinalSymlink && index === finalComponentIndex) {
|
|
@@ -52,10 +58,11 @@ export function rawPathRelativeToCanonicalRoot(candidate, rootCanonicalPath, opt
|
|
|
52
58
|
if (!isSymlink && !stat.isDirectory() && index < segments.length - 1)
|
|
53
59
|
return undefined;
|
|
54
60
|
traversedSymlink ||= isSymlink;
|
|
55
|
-
canonical = realpathSync.native(operationPath);
|
|
61
|
+
canonical = synchronous ? realpathSync.native(operationPath) : yield* wait(realpathNative(operationPath));
|
|
56
62
|
assertNoWindowsPathAlias(canonical);
|
|
57
63
|
if (isSymlink && index < segments.length - 1 &&
|
|
58
|
-
!fs.statSync(pathForWindowsFilesystem(canonical))
|
|
64
|
+
!(synchronous ? fs.statSync(pathForWindowsFilesystem(canonical))
|
|
65
|
+
: yield* wait(asyncFs.stat(pathForWindowsFilesystem(canonical)))).isDirectory())
|
|
59
66
|
return undefined;
|
|
60
67
|
if (isSymlink && !isPathInside(rootCanonicalPath, canonical) && !isPathInside(canonical, rootCanonicalPath)) {
|
|
61
68
|
throw new FsSafeError("outside-workspace", `symlink prefix resolves outside the root ancestry: ${formatErrorDetail(candidate)}`);
|
|
@@ -84,9 +91,10 @@ export function rawPathRelativeToCanonicalRoot(candidate, rootCanonicalPath, opt
|
|
|
84
91
|
}
|
|
85
92
|
return undefined;
|
|
86
93
|
}
|
|
87
|
-
function pathExists(targetPath) {
|
|
94
|
+
function* pathExists(targetPath, synchronous) {
|
|
88
95
|
try {
|
|
89
|
-
return fs.lstatSync(pathForWindowsFilesystem(targetPath), { throwIfNoEntry: false })
|
|
96
|
+
return (synchronous ? fs.lstatSync(pathForWindowsFilesystem(targetPath), { throwIfNoEntry: false })
|
|
97
|
+
: yield* wait(asyncFs.lstat(pathForWindowsFilesystem(targetPath)))) !== undefined;
|
|
90
98
|
}
|
|
91
99
|
catch (error) {
|
|
92
100
|
if (isNotFoundPathError(error)) {
|
|
@@ -96,17 +104,20 @@ function pathExists(targetPath) {
|
|
|
96
104
|
}
|
|
97
105
|
}
|
|
98
106
|
export async function resolvePathViaExistingAncestor(targetPath) {
|
|
99
|
-
return
|
|
107
|
+
return runRootTraversal(resolveExistingAncestorProcedure(targetPath, "native", synchronousRootTraversal));
|
|
100
108
|
}
|
|
101
|
-
function
|
|
109
|
+
function* ordinaryExists(targetPath) {
|
|
102
110
|
return fs.existsSync(pathForWindowsFilesystem(targetPath));
|
|
103
111
|
}
|
|
104
112
|
export function resolvePathViaExistingAncestorSync(targetPath) {
|
|
105
113
|
return resolveExistingAncestor(targetPath, "ordinary");
|
|
106
114
|
}
|
|
107
115
|
export function resolveExistingAncestor(targetPath, mode, preserveRawSegments = false, remainingHops = 64) {
|
|
108
|
-
|
|
109
|
-
|
|
116
|
+
return runSync(resolveExistingAncestorProcedure(targetPath, mode, true, preserveRawSegments, remainingHops));
|
|
117
|
+
}
|
|
118
|
+
export function* resolveExistingAncestorProcedure(targetPath, mode, synchronous, preserveRawSegments = false, remainingHops = 64) {
|
|
119
|
+
const exists = (pathname) => mode === "native" || preserveRawSegments
|
|
120
|
+
? pathExists(pathname, synchronous) : ordinaryExists(pathname);
|
|
110
121
|
assertNoWindowsPathAlias(targetPath);
|
|
111
122
|
const normalized = resolvePathPreservingWindowsRoot(targetPath);
|
|
112
123
|
assertNoWindowsPathAlias(normalized);
|
|
@@ -114,22 +125,23 @@ export function resolveExistingAncestor(targetPath, mode, preserveRawSegments =
|
|
|
114
125
|
let cursor = candidate;
|
|
115
126
|
const filesystemRoot = path.parse(candidate).root;
|
|
116
127
|
while (cursor !== filesystemRoot &&
|
|
117
|
-
!exists(cursor)) {
|
|
128
|
+
!(yield* exists(cursor))) {
|
|
118
129
|
cursor = path.dirname(cursor);
|
|
119
130
|
}
|
|
120
|
-
if (!exists(cursor)) {
|
|
131
|
+
if (!(yield* exists(cursor))) {
|
|
121
132
|
return normalized;
|
|
122
133
|
}
|
|
123
134
|
let rawResolvedAncestor;
|
|
124
135
|
try {
|
|
125
|
-
rawResolvedAncestor =
|
|
136
|
+
rawResolvedAncestor = synchronous ? realpathSync.native(pathForWindowsFilesystem(cursor))
|
|
137
|
+
: yield* wait(realpathNative(pathForWindowsFilesystem(cursor)));
|
|
126
138
|
}
|
|
127
139
|
catch (error) {
|
|
128
140
|
if (!preserveRawSegments)
|
|
129
141
|
return normalized;
|
|
130
142
|
if (!isNotFoundPathError(error))
|
|
131
143
|
throw error;
|
|
132
|
-
rawResolvedAncestor = resolveSymlinkHopPath(cursor, mode, false, remainingHops);
|
|
144
|
+
rawResolvedAncestor = yield* resolveSymlinkHopPath(cursor, mode, false, remainingHops, synchronous);
|
|
133
145
|
}
|
|
134
146
|
assertNoWindowsPathAlias(rawResolvedAncestor);
|
|
135
147
|
const resolvedAncestor = resolvePathPreservingWindowsRoot(rawResolvedAncestor);
|
|
@@ -145,10 +157,10 @@ export function resolveExistingAncestor(targetPath, mode, preserveRawSegments =
|
|
|
145
157
|
assertNoWindowsPathAlias(resolved);
|
|
146
158
|
return resolved;
|
|
147
159
|
}
|
|
148
|
-
export function resolveSymlinkHopPath(symlinkPath, mode, rejectUnresolved, remainingHops = 64) {
|
|
160
|
+
export function* resolveSymlinkHopPath(symlinkPath, mode, rejectUnresolved, remainingHops = 64, synchronous = true) {
|
|
149
161
|
try {
|
|
150
|
-
const
|
|
151
|
-
|
|
162
|
+
const rawRealPath = synchronous ? realpathSync.native(symlinkPath)
|
|
163
|
+
: yield* wait(realpathNative(symlinkPath));
|
|
152
164
|
assertNoWindowsPathAlias(rawRealPath, "filesystem", "resolved symlink path uses a Windows filesystem namespace alias");
|
|
153
165
|
const realPath = resolvePathPreservingWindowsRoot(rawRealPath);
|
|
154
166
|
assertNoWindowsPathAlias(realPath, "filesystem", "resolved symlink path uses a Windows filesystem namespace alias");
|
|
@@ -162,14 +174,14 @@ export function resolveSymlinkHopPath(symlinkPath, mode, rejectUnresolved, remai
|
|
|
162
174
|
throw error;
|
|
163
175
|
if (remainingHops <= 0)
|
|
164
176
|
throw new FsSafeError("symlink", "too many unresolved symlink hops");
|
|
165
|
-
const linkTarget = fs.readlinkSync(symlinkPath);
|
|
177
|
+
const linkTarget = synchronous ? fs.readlinkSync(symlinkPath) : yield* wait(asyncFs.readlink(symlinkPath));
|
|
166
178
|
assertNoWindowsPathAlias(linkTarget, "filesystem", "symlink target uses a Windows filesystem namespace alias");
|
|
167
179
|
const linkDir = resolvePathPreservingWindowsRoot(path.dirname(symlinkPath));
|
|
168
180
|
// Keep parent segments until the kernel has resolved the existing prefix.
|
|
169
181
|
const targetPath = path.isAbsolute(linkTarget) ? linkTarget
|
|
170
182
|
: path.parse(linkTarget).root ? resolvePathFromBasePreservingWindowsRoot(linkDir, linkTarget)
|
|
171
183
|
: `${linkDir}${path.sep}${linkTarget}`;
|
|
172
|
-
const resolved =
|
|
184
|
+
const resolved = yield* resolveExistingAncestorProcedure(targetPath, mode, synchronous, true, remainingHops - 1);
|
|
173
185
|
assertNoWindowsPathAlias(resolved, "filesystem", "resolved symlink path uses a Windows filesystem namespace alias");
|
|
174
186
|
return resolved;
|
|
175
187
|
}
|