@openclaw/matrix 2026.11.5-beta.4 → 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
|
@@ -102,7 +102,7 @@ filesystem boundary violation. Branch on the specific code when the distinction
|
|
|
102
102
|
between those operational outcomes matters.
|
|
103
103
|
|
|
104
104
|
The operational set is exactly `helper-failed`, `helper-unavailable`,
|
|
105
|
-
`not-empty`, `not-found`, `not-removable`, `permission-unverified`, `read-failed`,
|
|
105
|
+
`not-empty`, `not-found`, `not-removable`, `permission-denied`, `permission-unverified`, `read-failed`,
|
|
106
106
|
`timeout`, and `unsupported-platform`. Every other current `FsSafeErrorCode`, including
|
|
107
107
|
`store-reentrant-update`, is categorized as `policy`.
|
|
108
108
|
|
|
@@ -126,6 +126,7 @@ type FsSafeErrorCode =
|
|
|
126
126
|
| "outside-workspace"
|
|
127
127
|
| "path-alias"
|
|
128
128
|
| "path-mismatch"
|
|
129
|
+
| "permission-denied"
|
|
129
130
|
| "permission-unverified"
|
|
130
131
|
| "read-failed"
|
|
131
132
|
| "secret-exists"
|
|
@@ -162,6 +163,7 @@ it is not an existing destination.
|
|
|
162
163
|
| `outside-workspace` | Path resolves outside the configured root. | `..` traversal; absolute path outside the root; symlink resolved out. |
|
|
163
164
|
| `path-alias` | A path alias check failed (e.g. canonical-real-path moved out of the root). | Symlink resolution lands outside the root. |
|
|
164
165
|
| `path-mismatch` | Post-open identity check failed: the opened fd does not match the resolved path. | TOCTOU — something else swapped the path between resolve and open. |
|
|
166
|
+
| `permission-denied` | Root path resolution could not traverse or inspect a path because the OS returned `EACCES` or `EPERM`. | Check the named path and grant the process directory search/traversal access through ownership, group permissions, or ACLs; the original errno is retained as `cause`. No operation is permitted by this classification. |
|
|
165
167
|
| `permission-unverified` | A secure file check could not verify required permissions. | Windows ACL inspection failed; POSIX ownership/mode was unavailable. |
|
|
166
168
|
| `read-failed` | A validated file could not be read because of an operational filesystem or device failure. | I/O error, media failure, or another runtime read failure; inspect `cause`. |
|
|
167
169
|
| `secret-exists` | `createSecretFileAtomic()` found an existing final path. | First-writer-wins secret creation lost a race or the credential was already initialized. |
|
|
@@ -36,7 +36,7 @@ const cache = fileStore({
|
|
|
36
36
|
|---|---|---|
|
|
37
37
|
| `rootDir` | Required | Store directory. |
|
|
38
38
|
| `private` | `false` | Use the secret-file atomic path. |
|
|
39
|
-
| `mode` / `dirMode` | `0o600` / `0o700` | File and parent-directory modes
|
|
39
|
+
| `mode` / `dirMode` | `0o600` / `0o700` | File and parent-directory modes; non-private stores also accept `dirMode: "preserve"`. |
|
|
40
40
|
| `maxBytes` | Unset | Store read/write byte limit. |
|
|
41
41
|
| `durable` | `true` | Sync the written file and its parent directory; see method support below. |
|
|
42
42
|
|
|
@@ -145,6 +145,18 @@ Writes use guarded sibling-temp publication: apply file and directory modes,
|
|
|
145
145
|
then rename into place. By default, the file and parent directory are synced
|
|
146
146
|
where supported by the platform and writer.
|
|
147
147
|
|
|
148
|
+
Non-private stores accept `dirMode: "preserve"` at construction or per write,
|
|
149
|
+
including streams, copies, and JSON writes. Verified existing root and parent
|
|
150
|
+
directories are never chmoded; each exclusively created directory finishes at
|
|
151
|
+
`0o700` on POSIX, including intermediate directories. Concurrent mkdir winners
|
|
152
|
+
are verified and preserved. The same policy applies when pruning creates a
|
|
153
|
+
missing store root. On Windows this uses mkdir's default handling.
|
|
154
|
+
Required-native stores retain handle-relative parent creation and finalize only
|
|
155
|
+
directories reported as exclusively created through their retained descriptors.
|
|
156
|
+
The TypeScript backend uses the guarded root walk with the same mode policy.
|
|
157
|
+
Private stores reject `"preserve"` with `FsSafeError("invalid-path")`, including
|
|
158
|
+
per-write overrides: their explicit permission policy must remain numeric.
|
|
159
|
+
|
|
148
160
|
`durable: false` keeps the sibling-temp replace/rename behavior but skips the
|
|
149
161
|
temp-file and parent-directory `fsync` calls. Use it only for reconstructible
|
|
150
162
|
metadata where lower latency matters more than crash-durability. Per-call
|
|
@@ -265,7 +277,7 @@ it does not control the publication policy.
|
|
|
265
277
|
```ts
|
|
266
278
|
type FileStoreWriteOptions = {
|
|
267
279
|
durable?: boolean; // store default, otherwise true
|
|
268
|
-
dirMode?: number;
|
|
280
|
+
dirMode?: number | "preserve";
|
|
269
281
|
mode?: number;
|
|
270
282
|
maxBytes?: number;
|
|
271
283
|
tempPrefix?: string; // override the default "." + basename
|
|
@@ -63,6 +63,37 @@ calling `beforeWrite` again. This callback is a whole-operation admission point,
|
|
|
63
63
|
not the per-mutation `assertBeforeMutation` callback used by Root operations.
|
|
64
64
|
It must not change the file, handle, or payload. There is no cancellation option.
|
|
65
65
|
|
|
66
|
+
## Awaited authority preparation
|
|
67
|
+
|
|
68
|
+
Use `overwriteFileHandleWithAuthority()` from `@openclaw/fs-safe/advanced` when
|
|
69
|
+
source validation requires awaited work immediately before admission:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
overwriteFileHandleWithAuthority(
|
|
73
|
+
handle: FileHandle,
|
|
74
|
+
data: Uint8Array,
|
|
75
|
+
prepareAuthority: () => Promise<() => void>,
|
|
76
|
+
): Promise<void>;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
It reads handle metadata asynchronously, performs rollback-prefix preparation, then awaits
|
|
80
|
+
`prepareAuthority()` once. The preparer must return a synchronous assertion of
|
|
81
|
+
current authority. That assertion runs immediately before the first mutation,
|
|
82
|
+
with no intervening await. Missing assertions and Promise, thenable, or generator
|
|
83
|
+
assertion results reject before any write. Preparation or assertion failures
|
|
84
|
+
propagate unchanged. Once admitted, writing and recovery finish without another
|
|
85
|
+
authority check, exactly as for `overwriteFileHandle()`.
|
|
86
|
+
|
|
87
|
+
The caller owns off-thread validation: this helper does **not** move the preparer
|
|
88
|
+
or assertion to another worker. Use the preparer for worker-backed storage or
|
|
89
|
+
identity validation and the final assertion for current in-memory revocation or
|
|
90
|
+
revision checks. Do not call blocking storage work inside either callback and
|
|
91
|
+
assume that `await` offloads it. The handle, file, and payload ownership restrictions
|
|
92
|
+
above also apply while preparation is pending. This API does not alter Root's
|
|
93
|
+
per-mutation hooks or make the existing `beforeWrite` callback asynchronous.
|
|
94
|
+
|
|
95
|
+
## Writing and recovery
|
|
96
|
+
|
|
66
97
|
For growth, additional tail bytes are written before the existing prefix is
|
|
67
98
|
touched. The prefix is then overwritten, completing partial writes. For shrinkage,
|
|
68
99
|
truncation is last. If a write or truncation fails, the helper attempts to restore
|
|
@@ -33,7 +33,7 @@ node --version
|
|
|
33
33
|
|
|
34
34
|
## Bun runtime
|
|
35
35
|
|
|
36
|
-
Bun 1.4.
|
|
36
|
+
Bun 1.4.4 can run the same public APIs and load the matching native package.
|
|
37
37
|
On macOS and Linux, fs-safe uses its Rust N-API addon to call the system
|
|
38
38
|
`realpath` implementation for native resolution. Ordinary resolution follows
|
|
39
39
|
Node's component walk, including lexical normalization of expanded symlink
|
|
@@ -43,7 +43,7 @@ For ad-hoc read/write of multiple JSON files, use the standalone helpers in
|
|
|
43
43
|
```ts
|
|
44
44
|
type JsonStoreOptions<T> = {
|
|
45
45
|
filePath: string;
|
|
46
|
-
dirMode?: number;
|
|
46
|
+
dirMode?: number | "preserve"; // default 0o700; preserve is rejected for private stores
|
|
47
47
|
mode?: number; // default 0o600
|
|
48
48
|
durable?: boolean; // default true
|
|
49
49
|
trailingNewline?: boolean; // default true
|
|
@@ -120,6 +120,11 @@ const state = await store.readRequired();
|
|
|
120
120
|
|
|
121
121
|
Atomic JSON write at `mode` (default `0o600`), creating parent dirs at `dirMode` (default `0o700`) if needed. When `lock: true` is set, takes the sidecar lock for the duration of the write.
|
|
122
122
|
|
|
123
|
+
`jsonStore` uses a private store and rejects `dirMode: "preserve"` with
|
|
124
|
+
`FsSafeError("invalid-path")`. Existing directories must match its numeric
|
|
125
|
+
permission policy. For shared directories, use `fileStore({ private: false,
|
|
126
|
+
dirMode: "preserve", ... }).json(...)` or standalone `writeJson`.
|
|
127
|
+
|
|
123
128
|
```ts
|
|
124
129
|
await store.write({ ...state, lastSeen: Date.now() });
|
|
125
130
|
```
|
|
@@ -132,7 +132,7 @@ Options:
|
|
|
132
132
|
```ts
|
|
133
133
|
type WriteJsonOptions = {
|
|
134
134
|
mode?: number; // file mode (default 0o600)
|
|
135
|
-
dirMode?: number;
|
|
135
|
+
dirMode?: number | "preserve"; // parent policy; see atomic writes
|
|
136
136
|
trailingNewline?: boolean; // append "\n" if missing (default false)
|
|
137
137
|
durable?: boolean; // default true; false skips temp/parent fsync
|
|
138
138
|
};
|
|
@@ -142,6 +142,10 @@ type WriteJsonOptions = {
|
|
|
142
142
|
and parent-directory `fsync` calls. Use it only for reconstructible JSON state
|
|
143
143
|
where lower latency matters more than crash-durability.
|
|
144
144
|
|
|
145
|
+
`dirMode: "preserve"` follows the [atomic parent policy](atomic.md): existing
|
|
146
|
+
parents are verified without chmod; new directories finish at `0o700` on POSIX.
|
|
147
|
+
`writeJsonSync` has no `dirMode` option and is unaffected.
|
|
148
|
+
|
|
145
149
|
### `writeJsonSync(pathname, data)`
|
|
146
150
|
|
|
147
151
|
Synchronous variant. It pretty-prints with two spaces, appends a newline,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Resolving an existing path prefix
|
|
2
2
|
|
|
3
|
-
`resolvePathPrefixSync()`
|
|
3
|
+
`resolvePathPrefix()` and `resolvePathPrefixSync()` follow filesystem path components until the first
|
|
4
4
|
missing entry. It returns a canonical existing prefix and the unprocessed
|
|
5
5
|
suffix separately, including dangling symlink targets.
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
|
-
import {
|
|
8
|
+
import { resolvePathPrefix, type ResolvedPathPrefix } from "@openclaw/fs-safe/advanced";
|
|
9
9
|
|
|
10
|
-
const observed: ResolvedPathPrefix =
|
|
10
|
+
const observed: ResolvedPathPrefix = await resolvePathPrefix("/srv/data/future/file.json");
|
|
11
11
|
// When /srv/data exists but future does not:
|
|
12
12
|
// observed.existingPath is the canonical spelling of /srv/data.
|
|
13
13
|
// observed.unresolvedSegments is ["future", "file.json"].
|
|
@@ -63,9 +63,19 @@ suffix for every component. The fixed small-queue bound limits repeated front
|
|
|
63
63
|
removal while retaining legacy shift-based consumption for shallow paths. This
|
|
64
64
|
asymptotic bound is not a platform performance result; performance acceptance
|
|
65
65
|
requires separate benchmark evidence. Callers should still apply their own
|
|
66
|
-
input-size limits:
|
|
66
|
+
input-size limits: both helpers retain the raw suffix and
|
|
67
67
|
performs filesystem work for each non-empty existing component.
|
|
68
68
|
|
|
69
|
+
The async form uses asynchronous component `lstat` and `readlink`, and native
|
|
70
|
+
Node `realpath`. On Node POSIX, fully existing paths use a kernel `lstat` traversal
|
|
71
|
+
and canonicalization without separately inspecting each ancestor. A final symlink
|
|
72
|
+
also checks target search permissions before canonicalization. For a clean missing path, it probes parents only until the nearest existing directory.
|
|
73
|
+
Raw dot/separator forms, dangling links, and uncertain failures fall through to the
|
|
74
|
+
component walker, retaining its missing-suffix and error contract. The synchronous form retains its existing contract. Bun POSIX
|
|
75
|
+
canonicalization and Windows AppContainer fallback still use fs-safe's
|
|
76
|
+
synchronous native-realpath owner to preserve its platform guarantees; these
|
|
77
|
+
fallbacks are not a promise of nonblocking filesystem work on those runtimes.
|
|
78
|
+
|
|
69
79
|
This is a read-only path observation. It neither pins files nor creates a root
|
|
70
80
|
boundary, authorizes access, or guarantees a consistent snapshot during
|
|
71
81
|
concurrent changes. Results can become stale immediately. Use a guarded Root
|
|
@@ -65,13 +65,15 @@ see [directory identity](directory-identity.md).
|
|
|
65
65
|
`overwriteFileHandle` and `OverwriteFileHandleOptions` provide in-place byte
|
|
66
66
|
replacement through a borrowed regular-file handle. Its once-only `beforeWrite`
|
|
67
67
|
callback admits the complete write and any required best-effort rollback after
|
|
68
|
-
prefix preparation.
|
|
68
|
+
prefix preparation. `overwriteFileHandleWithAuthority` instead awaits a required
|
|
69
|
+
authority preparer and runs its synchronous final assertion immediately before
|
|
70
|
+
mutation. See [in-place writes](in-place-write.md).
|
|
69
71
|
|
|
70
72
|
`probePathCaseInsensitiveSync` and `ProbePathCaseOptions` are advanced exports
|
|
71
73
|
for local ASCII-case observations. An unavailable answer remains `undefined`;
|
|
72
74
|
the caller selects any fallback. See [path case probing](path-case.md).
|
|
73
75
|
|
|
74
|
-
`resolvePathPrefixSync
|
|
76
|
+
`resolvePathPrefix`, `resolvePathPrefixSync`, and `ResolvedPathPrefix` separate a canonical existing
|
|
75
77
|
path prefix from its raw unresolved suffix after physical symlink traversal.
|
|
76
78
|
See [resolving path prefixes](path-prefix.md).
|
|
77
79
|
|
|
@@ -196,7 +196,7 @@ type WriteSecretFileParams = {
|
|
|
196
196
|
filePath: string; // absolute path; must be inside rootDir
|
|
197
197
|
content: string | Uint8Array;
|
|
198
198
|
mode?: number; // file mode for the new file (default PRIVATE_SECRET_FILE_MODE = 0o600)
|
|
199
|
-
dirMode?: number;
|
|
199
|
+
dirMode?: number | "preserve"; // numeric mode required; preserve is rejected (default 0o700)
|
|
200
200
|
durable?: boolean; // default true; false skips file and parent fsync
|
|
201
201
|
};
|
|
202
202
|
```
|
|
@@ -208,6 +208,10 @@ stores forward their durability policy here.
|
|
|
208
208
|
|
|
209
209
|
The full POSIX directory mode is asserted on each component along the path: `rootDir`, then any intermediate dirs, then the parent. Existing directories, including another creator's `EEXIST` winner, must already match `dirMode` exactly or the write fails with `insecure-permissions`; they are never chmod-repaired. An explicitly requested directory mode such as `0o2750` preserves its setgid bit. Audit and adjust existing secret directories yourself. The admitted directory guards are retained through traversal and the final writer/lock handoff; a fresh pathname lookup cannot silently authorize a replacement. The caller must still trust the selected root and its owners; matching permission bits alone do not establish that trust.
|
|
210
210
|
|
|
211
|
+
Both `writeSecretFileAtomic` and `createSecretFileAtomic` reject
|
|
212
|
+
`dirMode: "preserve"` with `FsSafeError("invalid-path")`. This keeps the explicit
|
|
213
|
+
private-directory mode assertion intact rather than accepting shared parents.
|
|
214
|
+
|
|
211
215
|
Directory admission and its retained guards use lossless bigint identities, including through private locks and native writes. On Windows, an unknown zero device or inode gets one reinspection that retains known components; a definite mismatch or persistent ambiguity fails with `path-mismatch` rather than authorizing a replacement.
|
|
212
216
|
|
|
213
217
|
Both mode options must resolve to integers between `0o0000` and `0o7777`; invalid values fail with `invalid-path` before directory creation or file publication. Windows validates the options but does not enforce POSIX permission bits.
|
|
@@ -330,6 +330,10 @@ target-leaf symlink. Non-Root acquisition retains its existing parent-creation
|
|
|
330
330
|
behavior.
|
|
331
331
|
|
|
332
332
|
An owner can finish releasing while another async acquirer inspects its record.
|
|
333
|
+
Default stale detection uses the admitted record's `createdAt` or captured
|
|
334
|
+
modification time, without looking up its pathname again after reading it.
|
|
335
|
+
Retiring that record therefore does not turn a fresh lock into a stale one or
|
|
336
|
+
authorize recovery of its successor.
|
|
333
337
|
Create-only Root writes do not open an existing record merely to inherit its
|
|
334
338
|
mode. Once a pathname sample and opened descriptor agree, a failed acquisition
|
|
335
339
|
snapshot can be discarded only when the original descriptor has exact identity,
|
|
@@ -323,7 +323,7 @@ Manage the lifetime with `try/finally` and inspect the cleanup result, as in the
|
|
|
323
323
|
type TempWorkspaceOptions = {
|
|
324
324
|
rootDir: string; // parent directory for workspaces
|
|
325
325
|
prefix: string; // dir prefix (sanitized)
|
|
326
|
-
dirMode?: number;
|
|
326
|
+
dirMode?: number | "preserve"; // new workspace mode; preserve means default 0o700
|
|
327
327
|
mode?: number; // file write mode; default 0o600
|
|
328
328
|
cleanupSafety?: "compatible" | "require-bounded"; // default compatible
|
|
329
329
|
};
|
|
@@ -561,6 +561,14 @@ still propagate; there is no pathname chmod fallback. Windows only passes the
|
|
|
561
561
|
directory mode to `mkdir`. Pass
|
|
562
562
|
`chmodDir: false` when an existing staging/output directory mode must be preserved.
|
|
563
563
|
|
|
564
|
+
Prefer `dirMode: "preserve"` to keep the existing parent verified without any
|
|
565
|
+
chmod and finalize every directory created by the operation at `0o700` on POSIX.
|
|
566
|
+
This explicit policy also applies with `chmodDir: false`. Concurrent mkdir
|
|
567
|
+
winners are verified as existing directories. Windows uses mkdir's default
|
|
568
|
+
handling. For `tempWorkspace`, `tempWorkspaceSync`, and their scoped wrappers,
|
|
569
|
+
`"preserve"` means the new workspace's default `0o700` mode; existing supplied
|
|
570
|
+
roots are already left untouched by these factories.
|
|
571
|
+
|
|
564
572
|
### `writeViaSiblingTempPath`
|
|
565
573
|
|
|
566
574
|
A higher-level convenience for callback-based producers. The callback writes to
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
The types most callers reach for. Shared data shapes are exported from `@openclaw/fs-safe/types`; method-specific option/result types live next to their subpath.
|
|
4
4
|
|
|
5
|
-
For atomic replacement, `ReplaceFileAtomicFileSystem` and `ReplaceFileAtomicSyncFileSystem` are exported from `@openclaw/fs-safe/atomic`. Async adapters use `chmod()` on the `FileHandle` returned by their required `open()` operation. The synchronous type adds optional `fchmodSync(fd, mode)`; custom sync adapters that explicitly request `mode` or `preserveExistingMode` must implement it. See [Atomic writes](atomic.md#test-injection).
|
|
5
|
+
For atomic replacement, `ReplaceFileAtomicFileSystem` and `ReplaceFileAtomicSyncFileSystem` are exported from `@openclaw/fs-safe/atomic`. Async adapters use `chmod()` on the `FileHandle` returned by their required `open()` operation. The synchronous type adds optional `fchmodSync(fd, mode)`; custom sync adapters that explicitly request `mode`, numeric `dirMode`, or `preserveExistingMode` must implement it. `dirMode: "preserve"` requires it when creating directories. See [Atomic writes](atomic.md#test-injection).
|
|
6
|
+
|
|
7
|
+
`DirectoryMode = number | "preserve"` is exported from `/types` and `/atomic`.
|
|
8
|
+
Each accepting API documents whether preservation applies to existing parents
|
|
9
|
+
or is a creation-default alias. Private secret/store APIs reject `"preserve"`.
|
|
6
10
|
|
|
7
11
|
`ReplaceFileAtomicDestinationState` is also exported from that subpath. It is a
|
|
8
12
|
readonly union of `{ state: "removed", path }` and
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/fs-safe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.1",
|
|
4
4
|
"description": "Capability-style filesystem roots for Node.js apps that handle untrusted relative paths.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"filesystem",
|
|
@@ -180,16 +180,16 @@
|
|
|
180
180
|
"archive:producer-smoke": "node scripts/archive-producer-smoke.mjs"
|
|
181
181
|
},
|
|
182
182
|
"optionalDependencies": {
|
|
183
|
-
"@openclaw/fs-safe-darwin-arm64": "0.
|
|
184
|
-
"@openclaw/fs-safe-darwin-x64": "0.
|
|
185
|
-
"@openclaw/fs-safe-freebsd-arm64": "0.
|
|
186
|
-
"@openclaw/fs-safe-freebsd-x64": "0.
|
|
187
|
-
"@openclaw/fs-safe-linux-arm64-gnu": "0.
|
|
188
|
-
"@openclaw/fs-safe-linux-arm64-musl": "0.
|
|
189
|
-
"@openclaw/fs-safe-linux-x64-gnu": "0.
|
|
190
|
-
"@openclaw/fs-safe-linux-x64-musl": "0.
|
|
191
|
-
"@openclaw/fs-safe-win32-arm64-msvc": "0.
|
|
192
|
-
"@openclaw/fs-safe-win32-x64-msvc": "0.
|
|
183
|
+
"@openclaw/fs-safe-darwin-arm64": "0.27.1",
|
|
184
|
+
"@openclaw/fs-safe-darwin-x64": "0.27.1",
|
|
185
|
+
"@openclaw/fs-safe-freebsd-arm64": "0.27.1",
|
|
186
|
+
"@openclaw/fs-safe-freebsd-x64": "0.27.1",
|
|
187
|
+
"@openclaw/fs-safe-linux-arm64-gnu": "0.27.1",
|
|
188
|
+
"@openclaw/fs-safe-linux-arm64-musl": "0.27.1",
|
|
189
|
+
"@openclaw/fs-safe-linux-x64-gnu": "0.27.1",
|
|
190
|
+
"@openclaw/fs-safe-linux-x64-musl": "0.27.1",
|
|
191
|
+
"@openclaw/fs-safe-win32-arm64-msvc": "0.27.1",
|
|
192
|
+
"@openclaw/fs-safe-win32-x64-msvc": "0.27.1",
|
|
193
193
|
"jszip": "^3.10.2"
|
|
194
194
|
},
|
|
195
195
|
"devDependencies": {
|
|
@@ -211,5 +211,5 @@
|
|
|
211
211
|
"engines": {
|
|
212
212
|
"node": ">=22"
|
|
213
213
|
},
|
|
214
|
-
"packageManager": "pnpm@12.
|
|
214
|
+
"packageManager": "pnpm@12.15.0"
|
|
215
215
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -52,8 +52,12 @@ const fileFilter = (file) => {
|
|
|
52
52
|
|
|
53
53
|
async function extractFiles(zipFilePath) {
|
|
54
54
|
const tokenizer = await fromFile(zipFilePath);
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
try {
|
|
56
|
+
const zipHandler = new ZipHandler(tokenizer);
|
|
57
|
+
await zipHandler.unzip(fileFilter);
|
|
58
|
+
} finally {
|
|
59
|
+
await tokenizer.close();
|
|
60
|
+
}
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
extractFiles('example.zip').catch(console.error);
|
|
@@ -68,11 +72,15 @@ A class for handling ZIP file parsing and extraction.
|
|
|
68
72
|
new ZipHandler(tokenizer: ITokenizer, options?: ZipHandlerOptions)
|
|
69
73
|
```
|
|
70
74
|
- **tokenizer**: An instance of ITokenizer to read the ZIP archive.
|
|
71
|
-
- **options**: Optional
|
|
75
|
+
- **options**: Optional processing limits and traversal settings. Each numeric limit accepts a positive safe integer or `Infinity`.
|
|
72
76
|
Omitted limits default to `Infinity`, preserving unlimited processing.
|
|
73
77
|
|
|
74
78
|
```ts
|
|
75
79
|
const zipHandler = new ZipHandler(tokenizer, {
|
|
80
|
+
maxEntryCount: 1024,
|
|
81
|
+
maxTotalScanBytes: 16 * 1024 * 1024,
|
|
82
|
+
maxTotalDataDescriptorScanBytes: 1024 * 1024,
|
|
83
|
+
maxSkippedEntrySize: 1024 * 1024,
|
|
76
84
|
maxDataDescriptorScanBytes: 1024 * 1024,
|
|
77
85
|
maxCompressedSize: 1024 * 1024,
|
|
78
86
|
maxUncompressedSize: 4 * 1024 * 1024
|
|
@@ -80,18 +88,47 @@ const zipHandler = new ZipHandler(tokenizer, {
|
|
|
80
88
|
```
|
|
81
89
|
|
|
82
90
|
`maxDataDescriptorScanBytes` bounds bytes before the descriptor signature when the compressed
|
|
83
|
-
size is unknown, even for ignored entries.
|
|
91
|
+
size is unknown, even for ignored entries. Descriptor candidates are checked against their
|
|
92
|
+
compressed-size field so an embedded signature with a different size does not end the scan.
|
|
93
|
+
Lookahead uses up to 16 additional bytes to validate a candidate descriptor.
|
|
84
94
|
`maxCompressedSize` bounds compressed data buffered for selected entries, and
|
|
85
95
|
`maxUncompressedSize` bounds their decompressed output, including stored entries.
|
|
86
96
|
Limits apply to local-header and central-directory sizes before allocation, and to actual
|
|
87
97
|
output before retaining chunks or combining buffers. Decompression is canceled on overflow.
|
|
88
|
-
|
|
98
|
+
`maxEntryCount` bounds entries visited, including ignored entries. `maxTotalScanBytes` bounds
|
|
99
|
+
metadata and compressed data consumed across one traversal, including ignored local-header
|
|
100
|
+
payloads. Random-access seek distances are excluded; the end-of-directory search and record
|
|
101
|
+
are included, and bytes read again during extraction count again. Ignored central-directory
|
|
102
|
+
payloads are not read or counted. `maxTotalDataDescriptorScanBytes` bounds cumulative payload
|
|
103
|
+
bytes scanned for unknown-size entries, excluding their descriptors. `maxSkippedEntrySize`
|
|
104
|
+
bounds a single ignored payload when local-header traversal must pass over it.
|
|
105
|
+
Counters reset for each `unzip()` or `readCentralDirectory()` call.
|
|
106
|
+
|
|
107
|
+
These limits are not a total process memory budget; tokenizer lookahead and native
|
|
89
108
|
decompression have their own buffers. Configure tokenizer limits separately where available.
|
|
90
109
|
|
|
91
110
|
A limit violation throws the exported `ZipLimitError` (a `RangeError`), with `limit`,
|
|
92
|
-
`requestedSize`, and `maxSize` properties.
|
|
93
|
-
|
|
94
|
-
|
|
111
|
+
`requestedSize`, and `maxSize` properties. Sizes are byte counts except for `maxEntryCount`.
|
|
112
|
+
No data handler is called for an entry rejected by a limit; earlier handlers may already have run.
|
|
113
|
+
Invalid numeric limit options throw `RangeError` when constructing the handler. Invalid
|
|
114
|
+
non-boolean values for `useCentralDirectory` or `allowTruncatedDataDescriptor` throw `TypeError`
|
|
115
|
+
during construction. After a processing failure, close the tokenizer; extraction is not resumable.
|
|
116
|
+
|
|
117
|
+
For random-access sources, central-directory entries are parsed within the directory's declared
|
|
118
|
+
byte range using a borrowed tokenizer view. An entry crossing that range throws
|
|
119
|
+
`strtok3.TokenizerBoundaryError`. Reading the directory restores the source position on both
|
|
120
|
+
success and failure, and leaves the source open. `unzip()` processes directory entries one at a
|
|
121
|
+
time and stops parsing when the callback returns `stop: true`, restoring the original source
|
|
122
|
+
position on completion or failure. `readCentralDirectory()` still explicitly collects an array.
|
|
123
|
+
|
|
124
|
+
Set `useCentralDirectory: false` to scan local headers even on random-access sources. This is
|
|
125
|
+
useful for detectors that need consistent local-header ordering and support partial archives.
|
|
126
|
+
It does not disable entry or byte limits.
|
|
127
|
+
|
|
128
|
+
`allowTruncatedDataDescriptor: true` lets a detector receive the available entry data when a
|
|
129
|
+
descriptor is missing or truncated at EOF. Extraction still rejects the incomplete descriptor
|
|
130
|
+
after the handler returns; the caller can retain a detection result. All configured limits
|
|
131
|
+
still apply. The default is `false`, which rejects incomplete descriptors before delivering data.
|
|
95
132
|
|
|
96
133
|
#### Methods
|
|
97
134
|
|
|
@@ -101,17 +138,17 @@ close the tokenizer; extraction is not resumable.
|
|
|
101
138
|
|
|
102
139
|
- `unzip(fileCb: InflateFileFilter): Promise<void>`
|
|
103
140
|
|
|
104
|
-
Extracts files from the ZIP archive, applying the provided
|
|
105
|
-
|
|
106
|
-
|
|
141
|
+
Extracts files from the ZIP archive, applying the provided [InflateFileFilter](#inflatefilefilter) callback to each file.
|
|
142
|
+
To extract a file, return an object whose `handler` is an [InflatedDataHandler](#inflateddatahandler).
|
|
143
|
+
Return `{ handler: false }` to skip the file.
|
|
107
144
|
|
|
108
145
|
## Types
|
|
109
146
|
|
|
110
147
|
### `InflateFileFilter`
|
|
111
148
|
```ts
|
|
112
|
-
type InflateFileFilter = (file:
|
|
149
|
+
type InflateFileFilter = (file: ILocalFileHeader) => InflateFileFilterResult;
|
|
113
150
|
```
|
|
114
|
-
Callback function
|
|
151
|
+
Callback function that receives the ZIP entry header and returns an [InflateFileFilterResult](#inflatefilefilterresult) to select or skip the entry.
|
|
115
152
|
|
|
116
153
|
### `InflateFileFilterResult`
|
|
117
154
|
```ts
|
|
@@ -119,15 +156,18 @@ type InflateFileFilterResult = {
|
|
|
119
156
|
handler: InflatedDataHandler | false; // Handle file data or ignore
|
|
120
157
|
stop?: boolean; // Stop processing further files
|
|
121
158
|
};
|
|
122
|
-
|
|
123
159
|
```
|
|
124
|
-
Returned from
|
|
160
|
+
Returned from [InflateFileFilter](#inflatefilefilter) to control file handling and extraction flow.
|
|
161
|
+
Set `handler` to an [InflatedDataHandler](#inflateddatahandler) to receive the entry data, or `false` to skip it.
|
|
162
|
+
Set `stop: true` to stop after the current entry has been handled or skipped.
|
|
125
163
|
|
|
126
164
|
### `InflatedDataHandler`
|
|
127
165
|
```ts
|
|
128
166
|
type InflatedDataHandler = (fileData: Uint8Array) => Promise<void>;
|
|
129
167
|
```
|
|
130
|
-
|
|
168
|
+
Asynchronous callback assigned to `InflateFileFilterResult.handler` for a selected entry.
|
|
169
|
+
It receives the complete uncompressed entry data as a `Uint8Array`, including for stored (uncompressed) entries.
|
|
170
|
+
Extraction awaits the returned promise before processing the next entry.
|
|
131
171
|
|
|
132
172
|
## Compatibility
|
|
133
173
|
|
|
@@ -140,4 +180,4 @@ If used with Node.js, it requires version ≥ 18.
|
|
|
140
180
|
See the [contribution guide](CONTRIBUTING.md) for code style and development checks.
|
|
141
181
|
|
|
142
182
|
## License
|
|
143
|
-
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
183
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ITokenizer } from 'strtok3/core';
|
|
2
2
|
import { type ZipHandlerOptions } from './ZipLimitError.js';
|
|
3
3
|
import { type IFileHeader, type ILocalFileHeader } from './ZipToken.js';
|
|
4
4
|
export type InflateFileFilterResult = {
|
|
@@ -15,14 +15,25 @@ export declare class ZipHandler {
|
|
|
15
15
|
private tokenizer;
|
|
16
16
|
private syncBuffer;
|
|
17
17
|
private readonly limits;
|
|
18
|
+
private readonly useCentralDirectory;
|
|
19
|
+
private readonly allowTruncatedDataDescriptor;
|
|
20
|
+
private scannedBytes;
|
|
21
|
+
private descriptorScannedBytes;
|
|
18
22
|
constructor(tokenizer: ITokenizer, options?: ZipHandlerOptions);
|
|
19
23
|
/** Reject oversized entries before retaining data or allocating a combined buffer. */
|
|
20
24
|
private checkLimit;
|
|
25
|
+
private resetTraversal;
|
|
26
|
+
private consumeBytes;
|
|
27
|
+
private readToken;
|
|
28
|
+
private ignore;
|
|
29
|
+
private readData;
|
|
21
30
|
private checkEntrySize;
|
|
22
31
|
isZip(): Promise<boolean>;
|
|
23
32
|
private peekSignature;
|
|
24
33
|
findEndOfCentralDirectoryLocator(): Promise<number>;
|
|
25
34
|
readCentralDirectory(): Promise<IFileHeader[] | undefined>;
|
|
35
|
+
private centralDirectoryEntries;
|
|
36
|
+
private iterateDirectory;
|
|
26
37
|
unzip(fileCb: InflateFileFilter): Promise<void>;
|
|
27
38
|
private iterateOverCentralDirectory;
|
|
28
39
|
private inflate;
|