@openclaw/openshell-sandbox 2026.9.2 → 2026.9.3
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/index.js +87 -47
- package/node_modules/@openclaw/fs-safe/CHANGELOG.md +700 -0
- package/node_modules/@openclaw/fs-safe/LICENSE +21 -0
- package/node_modules/@openclaw/fs-safe/README.md +564 -0
- package/node_modules/@openclaw/fs-safe/SECURITY.md +45 -0
- package/node_modules/@openclaw/fs-safe/dist/absolute-path.d.ts +33 -0
- package/node_modules/@openclaw/fs-safe/dist/absolute-path.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/absolute-path.js +307 -0
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +26 -0
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/advanced.js +28 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-crc32.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-crc32.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-crc32.js +14 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-deadline.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-deadline.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-deadline.js +103 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-entry.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-entry.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-entry.js +85 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-errors.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-errors.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-errors.js +23 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-gzip-tail.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-gzip-tail.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-gzip-tail.js +74 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-input.d.ts +19 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-input.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-input.js +92 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-kind.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-kind.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-kind.js +82 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-limits.d.ts +57 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-limits.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-limits.js +131 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-merge.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-merge.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +157 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-native.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-native.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-native.js +107 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-options.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-options.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-options.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser-errors.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser-errors.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser-errors.js +12 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-plan.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-plan.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-plan.js +55 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-policy.d.ts +22 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-policy.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-policy.js +38 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-read.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-read.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-read.js +225 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +31 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +250 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-inspect.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-inspect.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-inspect.js +59 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.js +95 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.js +99 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar.d.ts +19 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar.js +21 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-admission.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-admission.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-admission.js +60 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.js +140 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.js +228 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.js +27 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.js +41 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.js +100 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.js +44 -0
- package/node_modules/@openclaw/fs-safe/dist/archive.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/archive.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive.js +275 -0
- package/node_modules/@openclaw/fs-safe/dist/async-lock.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/async-lock.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/async-lock.js +17 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic.js +4 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.js +21 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read.js +106 -0
- package/node_modules/@openclaw/fs-safe/dist/byte-budget.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/byte-budget.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/byte-budget.js +9 -0
- package/node_modules/@openclaw/fs-safe/dist/config.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/config.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/config.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/containment.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/containment.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/containment.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/deny-mutations.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/deny-mutations.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/deny-mutations.js +69 -0
- package/node_modules/@openclaw/fs-safe/dist/device-path.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/device-path.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/device-path.js +137 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-durability.d.ts +44 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-durability.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-durability.js +299 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-guard.d.ts +31 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-guard.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-guard.js +82 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.js +93 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-owner.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-owner.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-owner.js +78 -0
- package/node_modules/@openclaw/fs-safe/dist/durability.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/durability.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/durability.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/error-detail.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/error-detail.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/error-detail.js +10 -0
- package/node_modules/@openclaw/fs-safe/dist/errors.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/errors.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/errors.js +26 -0
- package/node_modules/@openclaw/fs-safe/dist/file-hash.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/file-hash.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-hash.js +73 -0
- package/node_modules/@openclaw/fs-safe/dist/file-identity.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/file-identity.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-identity.js +34 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.d.ts +35 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.js +349 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock.d.ts +24 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock.js +46 -0
- package/node_modules/@openclaw/fs-safe/dist/file-observation.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/file-observation.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-observation.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.d.ts +33 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.js +189 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-limit.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-limit.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-limit.js +8 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-prune.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-prune.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-prune.js +95 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.js +127 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store.d.ts +62 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store.js +357 -0
- package/node_modules/@openclaw/fs-safe/dist/file-sync.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/file-sync.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-sync.js +19 -0
- package/node_modules/@openclaw/fs-safe/dist/filename.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/filename.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/filename.js +91 -0
- package/node_modules/@openclaw/fs-safe/dist/fs.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/fs.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/fs.js +30 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.js +87 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.d.ts +37 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.js +82 -0
- package/node_modules/@openclaw/fs-safe/dist/home-dir.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/home-dir.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/home-dir.js +84 -0
- package/node_modules/@openclaw/fs-safe/dist/index.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/index.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/index.js +5 -0
- package/node_modules/@openclaw/fs-safe/dist/install-path.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/install-path.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/install-path.js +94 -0
- package/node_modules/@openclaw/fs-safe/dist/json-document-store.d.ts +35 -0
- package/node_modules/@openclaw/fs-safe/dist/json-document-store.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/json-document-store.js +97 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.js +20 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.js +292 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.d.ts +46 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.js +383 -0
- package/node_modules/@openclaw/fs-safe/dist/json-store.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/json-store.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/json-store.js +12 -0
- package/node_modules/@openclaw/fs-safe/dist/json-stringify.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/json-stringify.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/json-stringify.js +7 -0
- package/node_modules/@openclaw/fs-safe/dist/json.d.ts +50 -0
- package/node_modules/@openclaw/fs-safe/dist/json.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/json.js +343 -0
- package/node_modules/@openclaw/fs-safe/dist/local-file-access.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/local-file-access.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/local-file-access.js +87 -0
- package/node_modules/@openclaw/fs-safe/dist/local-roots.d.ts +26 -0
- package/node_modules/@openclaw/fs-safe/dist/local-roots.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/local-roots.js +135 -0
- package/node_modules/@openclaw/fs-safe/dist/lock-config.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/lock-config.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/lock-config.js +12 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.d.ts +43 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.js +161 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path.js +334 -0
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +93 -0
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native-binding.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native-config.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/native-config.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native-config.js +71 -0
- package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native-operations.js +132 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.js +96 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.js +161 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.d.ts +31 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +362 -0
- package/node_modules/@openclaw/fs-safe/dist/native.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/native.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native.js +204 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-file-failure.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-file-failure.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-file-failure.js +45 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-realpath.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-realpath.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-realpath.js +92 -0
- package/node_modules/@openclaw/fs-safe/dist/output.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/output.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/output.js +123 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl.d.ts +31 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl.js +28 -0
- package/node_modules/@openclaw/fs-safe/dist/path-policy.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/path-policy.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/path-policy.js +44 -0
- package/node_modules/@openclaw/fs-safe/dist/path.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/path.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/path.js +136 -0
- package/node_modules/@openclaw/fs-safe/dist/permission-exec.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/permission-exec.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +74 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-public.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-public.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-public.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-windows.d.ts +59 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-windows.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-windows.js +296 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions.d.ts +60 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions.js +125 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-open.d.ts +24 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-open.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-open.js +74 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-operation.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-operation.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-operation.js +35 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write.d.ts +36 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write.js +252 -0
- package/node_modules/@openclaw/fs-safe/dist/private-directory.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/private-directory.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/private-directory.js +14 -0
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.d.ts +45 -0
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +299 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file-failure.d.ts +28 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file-failure.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file-failure.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file.js +366 -0
- package/node_modules/@openclaw/fs-safe/dist/read-open-flags.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/read-open-flags.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/read-open-flags.js +13 -0
- package/node_modules/@openclaw/fs-safe/dist/read-opened-file.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/read-opened-file.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/read-opened-file.js +18 -0
- package/node_modules/@openclaw/fs-safe/dist/regular-file.d.ts +38 -0
- package/node_modules/@openclaw/fs-safe/dist/regular-file.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/regular-file.js +391 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-directory.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-directory.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-directory.js +42 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.d.ts +39 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +331 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.js +107 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts +51 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +161 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-rename-policy.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-rename-policy.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-rename-policy.js +30 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.d.ts +53 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.js +376 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file.d.ts +58 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file.js +329 -0
- package/node_modules/@openclaw/fs-safe/dist/root-context.d.ts +38 -0
- package/node_modules/@openclaw/fs-safe/dist/root-context.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-context.js +141 -0
- package/node_modules/@openclaw/fs-safe/dist/root-errors.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-errors.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-errors.js +75 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file.d.ts +45 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file.js +120 -0
- package/node_modules/@openclaw/fs-safe/dist/root-impl.d.ts +163 -0
- package/node_modules/@openclaw/fs-safe/dist/root-impl.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-impl.js +1230 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +68 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-symlink.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-symlink.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-symlink.js +35 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path.d.ts +40 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path.js +481 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths.d.ts +89 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths.js +381 -0
- package/node_modules/@openclaw/fs-safe/dist/root-walk.d.ts +41 -0
- package/node_modules/@openclaw/fs-safe/dist/root-walk.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-walk.js +133 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-mode.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-mode.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-mode.js +61 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.js +97 -0
- package/node_modules/@openclaw/fs-safe/dist/root.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.js +75 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-file.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-file.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-file.js +329 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-async.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-async.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-async.js +73 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.js +40 -0
- package/node_modules/@openclaw/fs-safe/dist/secret.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/secret.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/secret.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-file.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-file.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-file.js +182 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.d.ts +27 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.js +160 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.js +143 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.d.ts +27 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.js +95 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.d.ts +31 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +336 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.d.ts +24 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.js +42 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.js +71 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.d.ts +63 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.js +305 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.js +76 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-types.d.ts +63 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-types.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +265 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-directory.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-directory.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-directory.js +60 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-file-types.d.ts +56 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-file-types.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-file-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/store.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/store.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/store.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.js +51 -0
- package/node_modules/@openclaw/fs-safe/dist/string-coerce.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/string-coerce.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/string-coerce.js +16 -0
- package/node_modules/@openclaw/fs-safe/dist/suppressed-error.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/suppressed-error.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/suppressed-error.js +15 -0
- package/node_modules/@openclaw/fs-safe/dist/symlink-parents.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/symlink-parents.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/symlink-parents.js +78 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.js +87 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-target.d.ts +28 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-target.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-target.js +137 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.js +320 -0
- package/node_modules/@openclaw/fs-safe/dist/temp.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/temp.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/temp.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/test-hooks.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/test-hooks.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/test-hooks.js +13 -0
- package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/text-atomic.js +14 -0
- package/node_modules/@openclaw/fs-safe/dist/timing.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/timing.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/timing.js +40 -0
- package/node_modules/@openclaw/fs-safe/dist/trash.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/trash.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/trash.js +171 -0
- package/node_modules/@openclaw/fs-safe/dist/types.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/types.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/walk.d.ts +37 -0
- package/node_modules/@openclaw/fs-safe/dist/walk.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/walk.js +207 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-command.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-command.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-command.js +34 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-owner.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-owner.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-owner.js +126 -0
- package/node_modules/@openclaw/fs-safe/dist/write-open-flags.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/write-open-flags.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/write-open-flags.js +35 -0
- package/node_modules/@openclaw/fs-safe/dist/write-queue.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/write-queue.d.ts.map +1 -0
- package/node_modules/@openclaw/fs-safe/dist/write-queue.js +18 -0
- package/node_modules/@openclaw/fs-safe/docs/advanced.md +153 -0
- package/node_modules/@openclaw/fs-safe/docs/archive.md +658 -0
- package/node_modules/@openclaw/fs-safe/docs/assets/readme-banner.jpg +0 -0
- package/node_modules/@openclaw/fs-safe/docs/atomic.md +334 -0
- package/node_modules/@openclaw/fs-safe/docs/config.md +131 -0
- package/node_modules/@openclaw/fs-safe/docs/contributing.md +180 -0
- package/node_modules/@openclaw/fs-safe/docs/durability.md +313 -0
- package/node_modules/@openclaw/fs-safe/docs/errors.md +232 -0
- package/node_modules/@openclaw/fs-safe/docs/file-store.md +258 -0
- package/node_modules/@openclaw/fs-safe/docs/filename.md +96 -0
- package/node_modules/@openclaw/fs-safe/docs/index.md +84 -0
- package/node_modules/@openclaw/fs-safe/docs/install-path.md +170 -0
- package/node_modules/@openclaw/fs-safe/docs/install.md +163 -0
- package/node_modules/@openclaw/fs-safe/docs/json-store.md +221 -0
- package/node_modules/@openclaw/fs-safe/docs/json.md +213 -0
- package/node_modules/@openclaw/fs-safe/docs/local-roots.md +141 -0
- package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.5.md +196 -0
- package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.6.md +43 -0
- package/node_modules/@openclaw/fs-safe/docs/native-helper.md +118 -0
- package/node_modules/@openclaw/fs-safe/docs/native.md +196 -0
- package/node_modules/@openclaw/fs-safe/docs/output.md +139 -0
- package/node_modules/@openclaw/fs-safe/docs/path-scope.md +159 -0
- package/node_modules/@openclaw/fs-safe/docs/path.md +208 -0
- package/node_modules/@openclaw/fs-safe/docs/permissions.md +200 -0
- package/node_modules/@openclaw/fs-safe/docs/private-file-store.md +54 -0
- package/node_modules/@openclaw/fs-safe/docs/public-api.md +112 -0
- package/node_modules/@openclaw/fs-safe/docs/quickstart.md +154 -0
- package/node_modules/@openclaw/fs-safe/docs/reading.md +183 -0
- package/node_modules/@openclaw/fs-safe/docs/regular-file.md +190 -0
- package/node_modules/@openclaw/fs-safe/docs/root.md +266 -0
- package/node_modules/@openclaw/fs-safe/docs/secret-file.md +273 -0
- package/node_modules/@openclaw/fs-safe/docs/secure-file.md +100 -0
- package/node_modules/@openclaw/fs-safe/docs/security-model.md +188 -0
- package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +439 -0
- package/node_modules/@openclaw/fs-safe/docs/staged-file.md +182 -0
- package/node_modules/@openclaw/fs-safe/docs/store.md +94 -0
- package/node_modules/@openclaw/fs-safe/docs/temp.md +476 -0
- package/node_modules/@openclaw/fs-safe/docs/test-hooks.md +96 -0
- package/node_modules/@openclaw/fs-safe/docs/testing.md +189 -0
- package/node_modules/@openclaw/fs-safe/docs/timing.md +121 -0
- package/node_modules/@openclaw/fs-safe/docs/types.md +188 -0
- package/node_modules/@openclaw/fs-safe/docs/walk.md +128 -0
- package/node_modules/@openclaw/fs-safe/docs/writing.md +347 -0
- package/node_modules/@openclaw/fs-safe/package.json +187 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +29 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +29 -0
- 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 +32 -0
- 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 +32 -0
- 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 +32 -0
- 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 +32 -0
- 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 +29 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/immediate/LICENSE.txt +20 -0
- package/node_modules/immediate/README.md +93 -0
- package/node_modules/immediate/dist/immediate.js +75 -0
- package/node_modules/immediate/dist/immediate.min.js +1 -0
- package/node_modules/immediate/lib/browser.js +69 -0
- package/node_modules/immediate/lib/index.js +73 -0
- package/node_modules/immediate/package.json +42 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +60 -0
- package/node_modules/isarray/component.json +19 -0
- package/node_modules/isarray/index.js +5 -0
- package/node_modules/isarray/package.json +45 -0
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/jszip/.codeclimate.yml +16 -0
- package/node_modules/jszip/.editorconfig +8 -0
- package/node_modules/jszip/.eslintrc.js +43 -0
- package/node_modules/jszip/.github/workflows/pr.yaml +58 -0
- package/node_modules/jszip/.jekyll-metadata +0 -0
- package/node_modules/jszip/.travis.yml +17 -0
- package/node_modules/jszip/CHANGES.md +204 -0
- package/node_modules/jszip/LICENSE.markdown +651 -0
- package/node_modules/jszip/README.markdown +33 -0
- package/node_modules/jszip/deps.js +37 -0
- package/node_modules/jszip/dist/jszip.js +11577 -0
- package/node_modules/jszip/dist/jszip.min.js +13 -0
- package/node_modules/jszip/graph.svg +601 -0
- package/node_modules/jszip/index.d.ts +330 -0
- package/node_modules/jszip/lib/base64.js +106 -0
- package/node_modules/jszip/lib/compressedObject.js +74 -0
- package/node_modules/jszip/lib/compressions.js +14 -0
- package/node_modules/jszip/lib/crc32.js +77 -0
- package/node_modules/jszip/lib/defaults.js +11 -0
- package/node_modules/jszip/lib/external.js +18 -0
- package/node_modules/jszip/lib/flate.js +85 -0
- package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
- package/node_modules/jszip/lib/generate/index.js +57 -0
- package/node_modules/jszip/lib/index.js +55 -0
- package/node_modules/jszip/lib/license_header.js +11 -0
- package/node_modules/jszip/lib/load.js +88 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
- package/node_modules/jszip/lib/nodejsUtils.js +57 -0
- package/node_modules/jszip/lib/object.js +384 -0
- package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
- package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
- package/node_modules/jszip/lib/reader/DataReader.js +116 -0
- package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
- package/node_modules/jszip/lib/reader/StringReader.js +38 -0
- package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
- package/node_modules/jszip/lib/reader/readerFor.js +28 -0
- package/node_modules/jszip/lib/signature.js +7 -0
- package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
- package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
- package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
- package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
- package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
- package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
- package/node_modules/jszip/lib/support.js +38 -0
- package/node_modules/jszip/lib/utf8.js +275 -0
- package/node_modules/jszip/lib/utils.js +501 -0
- package/node_modules/jszip/lib/zipEntries.js +261 -0
- package/node_modules/jszip/lib/zipEntry.js +293 -0
- package/node_modules/jszip/lib/zipObject.js +133 -0
- package/node_modules/jszip/package.json +67 -0
- package/node_modules/jszip/sponsors.md +21 -0
- package/node_modules/jszip/tsconfig.json +101 -0
- package/node_modules/jszip/vendor/FileSaver.js +247 -0
- package/node_modules/lie/README.md +62 -0
- package/node_modules/lie/dist/lie.js +350 -0
- package/node_modules/lie/dist/lie.min.js +1 -0
- package/node_modules/lie/dist/lie.polyfill.js +358 -0
- package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
- package/node_modules/lie/lib/browser.js +273 -0
- package/node_modules/lie/lib/index.js +298 -0
- package/node_modules/lie/license.md +7 -0
- package/node_modules/lie/lie.d.ts +244 -0
- package/node_modules/lie/package.json +69 -0
- package/node_modules/lie/polyfill.js +4 -0
- package/node_modules/pako/CHANGELOG.md +164 -0
- package/node_modules/pako/LICENSE +21 -0
- package/node_modules/pako/README.md +191 -0
- package/node_modules/pako/dist/pako.js +6818 -0
- package/node_modules/pako/dist/pako.min.js +1 -0
- package/node_modules/pako/dist/pako_deflate.js +3997 -0
- package/node_modules/pako/dist/pako_deflate.min.js +1 -0
- package/node_modules/pako/dist/pako_inflate.js +3300 -0
- package/node_modules/pako/dist/pako_inflate.min.js +1 -0
- package/node_modules/pako/index.js +14 -0
- package/node_modules/pako/lib/deflate.js +400 -0
- package/node_modules/pako/lib/inflate.js +423 -0
- package/node_modules/pako/lib/utils/common.js +105 -0
- package/node_modules/pako/lib/utils/strings.js +187 -0
- package/node_modules/pako/lib/zlib/README +59 -0
- package/node_modules/pako/lib/zlib/adler32.js +51 -0
- package/node_modules/pako/lib/zlib/constants.js +68 -0
- package/node_modules/pako/lib/zlib/crc32.js +59 -0
- package/node_modules/pako/lib/zlib/deflate.js +1874 -0
- package/node_modules/pako/lib/zlib/gzheader.js +58 -0
- package/node_modules/pako/lib/zlib/inffast.js +345 -0
- package/node_modules/pako/lib/zlib/inflate.js +1556 -0
- package/node_modules/pako/lib/zlib/inftrees.js +343 -0
- package/node_modules/pako/lib/zlib/messages.js +32 -0
- package/node_modules/pako/lib/zlib/trees.js +1222 -0
- package/node_modules/pako/lib/zlib/zstream.js +47 -0
- package/node_modules/pako/package.json +44 -0
- package/node_modules/process-nextick-args/index.js +45 -0
- package/node_modules/process-nextick-args/license.md +19 -0
- package/node_modules/process-nextick-args/package.json +25 -0
- package/node_modules/process-nextick-args/readme.md +18 -0
- package/node_modules/readable-stream/.travis.yml +34 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +58 -0
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/node_modules/readable-stream/duplex-browser.js +1 -0
- package/node_modules/readable-stream/duplex.js +1 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +52 -0
- package/node_modules/readable-stream/passthrough.js +1 -0
- package/node_modules/readable-stream/readable-browser.js +7 -0
- package/node_modules/readable-stream/readable.js +19 -0
- package/node_modules/readable-stream/transform.js +1 -0
- package/node_modules/readable-stream/writable-browser.js +1 -0
- package/node_modules/readable-stream/writable.js +8 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/safe-buffer/package.json +37 -0
- package/node_modules/setimmediate/LICENSE.txt +20 -0
- package/node_modules/setimmediate/package.json +30 -0
- package/node_modules/setimmediate/setImmediate.js +186 -0
- package/node_modules/string_decoder/.travis.yml +50 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +31 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/package.json +6 -4
- /package/node_modules/{p-limit/node_modules/yocto-queue → yocto-queue}/index.d.ts +0 -0
- /package/node_modules/{p-limit/node_modules/yocto-queue → yocto-queue}/index.js +0 -0
- /package/node_modules/{p-limit/node_modules/yocto-queue → yocto-queue}/license +0 -0
- /package/node_modules/{p-limit/node_modules/yocto-queue → yocto-queue}/package.json +0 -0
- /package/node_modules/{p-limit/node_modules/yocto-queue → yocto-queue}/readme.md +0 -0
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
# Temp workspaces
|
|
2
|
+
|
|
3
|
+
`@openclaw/fs-safe/temp` is the stable temp surface: private temp **workspaces** with auto-cleanup plus the secure per-user temp root the helpers default to.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import {
|
|
7
|
+
tempWorkspace,
|
|
8
|
+
withTempWorkspace,
|
|
9
|
+
tempWorkspaceSync,
|
|
10
|
+
withTempWorkspaceSync,
|
|
11
|
+
resolveSecureTempRoot,
|
|
12
|
+
} from "@openclaw/fs-safe/temp";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Private temp workspaces
|
|
16
|
+
|
|
17
|
+
A private workspace is a directory created at mode `0o700` under a caller-provided temp root. It is unique per call (random suffix). Calling `cleanup()` or leaving an `await using` scope moves an unchanged workspace through a private quarantine before removal. Descriptor-bounded cleanup prevents recursive traversal of substitutions; the compatible JavaScript fallback has the narrower race contract documented below.
|
|
18
|
+
|
|
19
|
+
### `tempWorkspace`
|
|
20
|
+
|
|
21
|
+
The compact factory. Returns:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
type TempWorkspace = {
|
|
25
|
+
dir: string;
|
|
26
|
+
identity: { dev: number | bigint; ino: number | bigint };
|
|
27
|
+
store: FileStore;
|
|
28
|
+
path(fileName: string): string;
|
|
29
|
+
write(fileName: string, data: string | Uint8Array): Promise<string>;
|
|
30
|
+
writeText(fileName: string, data: string): Promise<string>;
|
|
31
|
+
writeJson(fileName: string, data: unknown, options?: { trailingNewline?: boolean }): Promise<string>;
|
|
32
|
+
copyIn(fileName: string, sourcePath: string): Promise<string>;
|
|
33
|
+
read(fileName: string): Promise<Buffer>;
|
|
34
|
+
cleanup(): Promise<"removed" | "missing" | "identity-mismatch" | "indeterminate">;
|
|
35
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
36
|
+
};
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { tempWorkspace } from "@openclaw/fs-safe/temp";
|
|
41
|
+
|
|
42
|
+
await using workspace = await tempWorkspace({ rootDir: "/tmp/my-app", prefix: "build-" });
|
|
43
|
+
const inputPath = await workspace.write("input.txt", "data");
|
|
44
|
+
await runBuild(workspace.dir, inputPath);
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`write` writes at `mode` (default `0o600`); `writeText` and `writeJson` are convenience wrappers for the common scratch-file shapes; `copyIn` ingests an absolute source path through the same atomic-rename machinery as `Root.copyIn`. `read` is a small accessor that reads back any file you wrote into the workspace.
|
|
48
|
+
Both the async and sync `read` methods throw `FsSafeError("not-file")` when the
|
|
49
|
+
named leaf is a directory or another non-regular target, and preserve the
|
|
50
|
+
`not-found`, `hardlink`, or `symlink` code for those stable target states.
|
|
51
|
+
Operational filesystem read failures use `read-failed` with the Node error in
|
|
52
|
+
`cause`.
|
|
53
|
+
|
|
54
|
+
`store` is a `fileStore({ rootDir: workspace.dir, private: true })` handle. Use
|
|
55
|
+
it when you want the richer store surface, including `writeStream`, `exists`,
|
|
56
|
+
`remove`, `readJsonIfExists`, or `store.json<T>(rel)`:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
await using workspace = await tempWorkspace({ rootDir: "/tmp/my-app", prefix: "build-" });
|
|
60
|
+
const state = workspace.store.json<State>("state.json");
|
|
61
|
+
await state.write({ ready: true });
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The workspace owns cleanup; the store is only a view over the workspace
|
|
65
|
+
directory.
|
|
66
|
+
|
|
67
|
+
**Compatibility and security:** workspace creation remains available in native
|
|
68
|
+
`auto`, `off`, and unavailable-native environments. The default
|
|
69
|
+
`cleanupSafety: "compatible"` preserves the JavaScript cleanup behavior from
|
|
70
|
+
0.6: it verifies the workspace identity, moves the public name to a fresh
|
|
71
|
+
`.fs-safe-workspace-cleanup-<uuid>` sibling, verifies that quarantine, and then
|
|
72
|
+
uses guarded pathname-recursive removal. This fallback never recursively
|
|
73
|
+
removes the public workspace name, but it is not atomic conditional deletion: a
|
|
74
|
+
same-privilege peer that discovers and replaces the private quarantine after
|
|
75
|
+
verification can still redirect the final pathname removal.
|
|
76
|
+
|
|
77
|
+
Set `cleanupSafety: "require-bounded"` when that concurrent attacker is in scope.
|
|
78
|
+
Creation then requires native no-replace directory rename, native owned-tree
|
|
79
|
+
removal, and a retained parent descriptor **before** `mkdtemp` creates
|
|
80
|
+
a child. If any capability is unavailable, creation throws
|
|
81
|
+
`FsSafeError("helper-unavailable")`; no child is created and a scoped callback is
|
|
82
|
+
not called. The compatible default retains its fallback even if process-global
|
|
83
|
+
native mode is `require`; select `require-bounded` to make cleanup capability
|
|
84
|
+
mandatory for this API.
|
|
85
|
+
|
|
86
|
+
On Linux, bounded cleanup requires a successful runtime probe of the exact
|
|
87
|
+
`openat2` child-directory flags, including `RESOLVE_NO_XDEV`, against the retained
|
|
88
|
+
parent descriptor. If the kernel or seccomp policy denies that capability,
|
|
89
|
+
compatible mode uses the guarded JavaScript fallback; `require-bounded` rejects
|
|
90
|
+
before child creation. The probe runs once at creation, without filesystem mutation.
|
|
91
|
+
|
|
92
|
+
Bounded cleanup checks the parent and public workspace identity, quarantines
|
|
93
|
+
the direct child without replacement, and verifies the quarantine against the
|
|
94
|
+
retained workspace descriptor. It binds every enumerated child to its native
|
|
95
|
+
identity before opening it, rejects mount crossings, and traverses descendants
|
|
96
|
+
only through opened directory handles; symlinks/reparse entries are removed as
|
|
97
|
+
leaves and never traversed. Windows marks the exact opened objects for deletion by handle.
|
|
98
|
+
|
|
99
|
+
POSIX has no unlink-by-fd or expected-inode unlink for directory entries. After
|
|
100
|
+
the final identity check, each `unlinkat` can still be raced; the possible side
|
|
101
|
+
effect is bounded to one substituted non-directory leaf or one empty directory
|
|
102
|
+
entry per raced syscall. A substituted nonempty directory is never recursively
|
|
103
|
+
traversed and is preserved as `"indeterminate"`, but a leaf replacement removed
|
|
104
|
+
in that irreducible final gap cannot be distinguished after the syscall.
|
|
105
|
+
|
|
106
|
+
The workspace captures its identity, binding, and descriptors until cleanup.
|
|
107
|
+
Later process-global mode changes or loader resets do not revoke that authority.
|
|
108
|
+
Manual, disposal, and process-exit cleanup share one serialized owner,
|
|
109
|
+
registered before store construction; a construction failure after registration
|
|
110
|
+
remains exit-cleanable. Earlier creation failures close retained descriptors
|
|
111
|
+
without deleting an unverified child.
|
|
112
|
+
|
|
113
|
+
If the quarantine does not match the creation descriptor, cleanup leaves it in
|
|
114
|
+
place without restoring the public name or recursively deleting it and returns
|
|
115
|
+
`"indeterminate"`. A collision, uncertain rename outcome, changed parent,
|
|
116
|
+
mount/device crossing, changed reparse state, or detected concurrent mutation also
|
|
117
|
+
preserves the remaining artifact. Recover `.fs-safe-workspace-cleanup-<uuid>` entries only
|
|
118
|
+
after excluding competing mutators and re-establishing ownership.
|
|
119
|
+
|
|
120
|
+
A missing workspace returns `"missing"`. A replacement observed at the public
|
|
121
|
+
name before quarantine returns `"identity-mismatch"` when the parent is stable;
|
|
122
|
+
an ambiguous parent returns `"indeterminate"`. After successful removal,
|
|
123
|
+
repeated cleanup returns `"missing"` without touching a recreated public name.
|
|
124
|
+
Other statuses remain stable. Operational removal errors propagate and later
|
|
125
|
+
cleanup returns `"indeterminate"` without retrying. Disposal and scoped helpers
|
|
126
|
+
ignore returned statuses, while manual cleanup exposes the result.
|
|
127
|
+
|
|
128
|
+
When cleanup is part of a retention or audit decision, inspect the receipt
|
|
129
|
+
instead of treating cleanup as fire-and-forget:
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
const workspace = await tempWorkspace({ rootDir: "/var/lib/app/tmp", prefix: "restore-" });
|
|
133
|
+
try {
|
|
134
|
+
await restoreInto(workspace.dir);
|
|
135
|
+
} finally {
|
|
136
|
+
const cleanup = await workspace.cleanup();
|
|
137
|
+
if (cleanup === "identity-mismatch") {
|
|
138
|
+
alertOperator("restore workspace path was replaced; replacement preserved");
|
|
139
|
+
} else if (cleanup === "indeterminate") {
|
|
140
|
+
alertOperator("restore workspace cleanup could not establish safe completion; inspect retained entries");
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The sync variant `tempWorkspaceSync` exposes the same surface with sync return
|
|
146
|
+
types and a `FileStoreSync` at `workspace.store`.
|
|
147
|
+
|
|
148
|
+
### `withTempWorkspace`
|
|
149
|
+
|
|
150
|
+
The recommended shape. Attempts cleanup on every exit path:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
import { withTempWorkspace } from "@openclaw/fs-safe/temp";
|
|
154
|
+
|
|
155
|
+
const result = await withTempWorkspace({ rootDir: "/tmp/my-app", prefix: "build-" }, async (workspace) => {
|
|
156
|
+
await workspace.write("input.txt", "data");
|
|
157
|
+
return await runBuild(workspace.dir);
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The callback receives the same workspace shape as `tempWorkspace()`. Cleanup is wired to run after the callback resolves or rejects.
|
|
162
|
+
|
|
163
|
+
### Manual lifetime
|
|
164
|
+
|
|
165
|
+
Lower-level. You manage the lifetime:
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
const workspace = await tempWorkspace({ rootDir: "/tmp/my-app", prefix: "scan-" });
|
|
169
|
+
try {
|
|
170
|
+
// …work in workspace.dir…
|
|
171
|
+
} finally {
|
|
172
|
+
await workspace.cleanup();
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Sync variants
|
|
177
|
+
|
|
178
|
+
`tempWorkspaceSync` and `withTempWorkspaceSync` are the synchronous siblings. Useful for setup code in tests or boot paths that have not entered async land yet.
|
|
179
|
+
|
|
180
|
+
### Options
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
type TempWorkspaceOptions = {
|
|
184
|
+
rootDir: string; // parent directory for workspaces
|
|
185
|
+
prefix: string; // dir prefix (sanitized)
|
|
186
|
+
dirMode?: number; // dir mode; default 0o700
|
|
187
|
+
mode?: number; // file write mode; default 0o600
|
|
188
|
+
cleanupSafety?: "compatible" | "require-bounded"; // default compatible
|
|
189
|
+
};
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Advanced temp primitives
|
|
193
|
+
|
|
194
|
+
When you don't need the stable workspace abstraction, the lower-level temp-file
|
|
195
|
+
and sibling-temp helpers live behind `@openclaw/fs-safe/advanced`. They are
|
|
196
|
+
composition primitives for stores and atomic writers, not the primary API.
|
|
197
|
+
`tempWorkspace()` carries the stable lifetime contract for application code;
|
|
198
|
+
`tempFile()` is a one-shot building block whose options may move as store and
|
|
199
|
+
archive internals evolve.
|
|
200
|
+
|
|
201
|
+
### `tempFile`
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
import { tempFile } from "@openclaw/fs-safe/advanced";
|
|
205
|
+
|
|
206
|
+
const target = await tempFile({ fileName: "report.pdf", prefix: "render-" });
|
|
207
|
+
try {
|
|
208
|
+
await render(target.path);
|
|
209
|
+
await fs.copyFile(target.path, "/srv/workspace/reports/today.pdf");
|
|
210
|
+
} finally {
|
|
211
|
+
await target.cleanup();
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Returns:
|
|
216
|
+
|
|
217
|
+
```ts
|
|
218
|
+
type TempFile = {
|
|
219
|
+
path: string; // absolute path; safe to write to
|
|
220
|
+
dir: string; // the enclosing private workspace dir
|
|
221
|
+
file(fileName?: string): string; // resolve another file in the same dir
|
|
222
|
+
cleanup(): Promise<void>; // removes the original private workspace dir
|
|
223
|
+
[Symbol.asyncDispose](): Promise<void>; // alias of cleanup()
|
|
224
|
+
};
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Cleanup captures the directory identity at creation time. If that path is
|
|
228
|
+
renamed away and replaced, cleanup preserves the replacement rather than
|
|
229
|
+
recursively deleting a directory it did not create.
|
|
230
|
+
|
|
231
|
+
### `withTempFile`
|
|
232
|
+
|
|
233
|
+
Same shape with auto-cleanup:
|
|
234
|
+
|
|
235
|
+
```ts
|
|
236
|
+
import { withTempFile } from "@openclaw/fs-safe/advanced";
|
|
237
|
+
|
|
238
|
+
await withTempFile({ fileName: "out.zip", prefix: "pack-" }, async (filePath) => {
|
|
239
|
+
await pack(filePath);
|
|
240
|
+
await uploadAndForget(filePath);
|
|
241
|
+
});
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Sibling temp writes
|
|
245
|
+
|
|
246
|
+
When you want to write to a temp file in **the same directory** as a future destination — useful when you need atomic placement but don't want to use `replaceFileAtomic`'s full machinery.
|
|
247
|
+
|
|
248
|
+
### `writeSiblingTempFile`
|
|
249
|
+
|
|
250
|
+
```ts
|
|
251
|
+
import { writeSiblingTempFile } from "@openclaw/fs-safe/advanced";
|
|
252
|
+
|
|
253
|
+
const result = await writeSiblingTempFile<string>({
|
|
254
|
+
dir: "/srv/workspace",
|
|
255
|
+
mode: 0o600,
|
|
256
|
+
writeTemp: async (tempPath) => {
|
|
257
|
+
await fs.writeFile(tempPath, JSON.stringify(state));
|
|
258
|
+
return "state.json";
|
|
259
|
+
},
|
|
260
|
+
resolveFinalPath: (fileName) => path.join("/srv/workspace", fileName),
|
|
261
|
+
});
|
|
262
|
+
// result.filePath, result.result (returned by writeTemp)
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
`writeSiblingTempFile` chooses a random, initially absent sibling name in `dir`
|
|
266
|
+
and calls `writeTemp()`. After the callback succeeds, it validates the produced
|
|
267
|
+
regular file before taking ownership: symlinks, directories, other non-regular
|
|
268
|
+
files, hardlinks, and changes between the pre-open pathname, opened descriptor,
|
|
269
|
+
and current pathname are rejected. The callback must finish and close its
|
|
270
|
+
writer before returning. Its return value is preserved as `result`.
|
|
271
|
+
|
|
272
|
+
The helper retains one descriptor through requested mode application, opt-in
|
|
273
|
+
file synchronization, rename, and publication verification. It opens read-only
|
|
274
|
+
unless file synchronization is requested, so closed read-only producer output
|
|
275
|
+
remains publishable under the historical default. Omitting
|
|
276
|
+
`mode` preserves the callback-produced mode without chmod; explicit modes,
|
|
277
|
+
including `0`, are applied through that descriptor. File-mode errors are
|
|
278
|
+
tolerated for compatibility with the helper's historical best-effort behavior.
|
|
279
|
+
No chmod, content read, or reopen follows
|
|
280
|
+
the staged or published pathname. `resolveFinalPath(result)` must resolve to a
|
|
281
|
+
distinct direct child of the same directory. Final-path writes are serialized
|
|
282
|
+
within the process, and the retained descriptor and current name must still
|
|
283
|
+
have the admitted exact bigint identity and exactly one link before rename and
|
|
284
|
+
after publication. A verification failure after rename does not roll back or
|
|
285
|
+
delete the final name.
|
|
286
|
+
|
|
287
|
+
`syncTempFile` and `syncParentDir` retain their historical `false` defaults.
|
|
288
|
+
Explicit `syncTempFile: true` synchronizes the descriptor before rename;
|
|
289
|
+
file-sync errors propagate except for the existing `EPERM` compatibility case.
|
|
290
|
+
Explicit `syncParentDir: true` requests best-effort parent sync after rename.
|
|
291
|
+
Omitting either option or passing `false` skips that sync, never the identity
|
|
292
|
+
checks. Parent synchronization can be unsupported or fail without rejecting
|
|
293
|
+
the write, so success is not a strict crash-durability receipt.
|
|
294
|
+
|
|
295
|
+
Cleanup only unlinks an admitted file while the parent, pathname identity, and
|
|
296
|
+
single-link regular-file checks still agree. Observed substitutes are preserved,
|
|
297
|
+
including during process-exit cleanup. Operational cleanup failures retain an
|
|
298
|
+
identity-bound exit retry. If the callback throws or admission fails, no file
|
|
299
|
+
has been adopted: even a regular partial file is left for caller-directed
|
|
300
|
+
recovery. The helper never recursively removes a sibling temp.
|
|
301
|
+
|
|
302
|
+
On POSIX, admission uses no-follow and nonblocking open flags, so a FIFO swap
|
|
303
|
+
does not block the helper. Windows retains Node's guarded pathname-open behavior
|
|
304
|
+
because Node has no portable no-follow flag there; metadata is checked before
|
|
305
|
+
and after opening, and unknown Windows identities fail closed after one bounded
|
|
306
|
+
re-inspection without reopening. These helpers remain available with native
|
|
307
|
+
mode `off`; they do not acquire the native-required retained-directory contract
|
|
308
|
+
of [`stageFileInDirectory`](staged-file.md).
|
|
309
|
+
|
|
310
|
+
Identity checks and pathname rename/unlink are separate syscalls, not atomic
|
|
311
|
+
conditional mutations. A hostile process can still replace a leaf or parent in
|
|
312
|
+
the final syscall gap or mutate an open file's contents. Use an approved writable
|
|
313
|
+
directory and cooperative locking or OS isolation; a moved parent can leave an
|
|
314
|
+
unpublished original temp behind. Observed replacements are preserved, but
|
|
315
|
+
arbitrary concurrent namespace changes cannot be prevented by these helpers.
|
|
316
|
+
|
|
317
|
+
By default the helper attempts to set `dir` to `dirMode` (default `0o700`)
|
|
318
|
+
through the shared verified POSIX directory-descriptor helper. Only the actual
|
|
319
|
+
descriptor chmod error is tolerated, preserving the historical best-effort
|
|
320
|
+
directory-mode behavior. Directory lstat, open, type, identity, and close errors
|
|
321
|
+
still propagate; there is no pathname chmod fallback. Windows only passes the
|
|
322
|
+
directory mode to `mkdir`. Pass
|
|
323
|
+
`chmodDir: false` when an existing staging/output directory mode must be preserved.
|
|
324
|
+
|
|
325
|
+
### `writeViaSiblingTempPath`
|
|
326
|
+
|
|
327
|
+
A higher-level convenience for callback-based producers. The callback writes to
|
|
328
|
+
a private temp path, then the helper copies the result into `targetPath` through
|
|
329
|
+
the root boundary:
|
|
330
|
+
|
|
331
|
+
```ts
|
|
332
|
+
import { writeViaSiblingTempPath } from "@openclaw/fs-safe/advanced";
|
|
333
|
+
|
|
334
|
+
await writeViaSiblingTempPath({
|
|
335
|
+
rootDir: "/srv/workspace",
|
|
336
|
+
targetPath: "/srv/workspace/state.json",
|
|
337
|
+
writeTemp: async (tempPath) => {
|
|
338
|
+
await fs.writeFile(tempPath, JSON.stringify(state));
|
|
339
|
+
},
|
|
340
|
+
});
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
If `replaceFileAtomic` does what you need, prefer that. Use
|
|
344
|
+
`writeViaSiblingTempPath` when the producer needs a concrete temp pathname but
|
|
345
|
+
the final destination still needs root-boundary checks.
|
|
346
|
+
Its private workspace uses the same identity-aware directory cleanup as
|
|
347
|
+
`tempFile()`: moving and replacing the workspace preserves the replacement.
|
|
348
|
+
The callback staging component is capped at 255 bytes under NFC and NFD by
|
|
349
|
+
shortening only an overlong embedded destination tail, while preserving an
|
|
350
|
+
extension when possible. Short callback paths and the final target stay
|
|
351
|
+
unchanged. This workspace owns its contents, unlike the unadmitted sibling
|
|
352
|
+
pathname above.
|
|
353
|
+
|
|
354
|
+
## Secure temp root
|
|
355
|
+
|
|
356
|
+
The `resolveSecureTempRoot()` helper picks a per-user directory under the system temp dir, creates it at mode `0o700` if missing, and returns the absolute path. The other helpers in this module call it by default; you can call it directly if you need to materialize the root yourself.
|
|
357
|
+
|
|
358
|
+
```ts
|
|
359
|
+
import { resolveSecureTempRoot } from "@openclaw/fs-safe/temp";
|
|
360
|
+
|
|
361
|
+
const tempRoot = resolveSecureTempRoot({ fallbackPrefix: "my-app" });
|
|
362
|
+
// e.g. /tmp/my-app-501
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
Consumers that only need this resolver can use the narrow package subpath:
|
|
366
|
+
|
|
367
|
+
```ts
|
|
368
|
+
import {
|
|
369
|
+
resolveSecureTempRoot,
|
|
370
|
+
type ResolveSecureTempRootOptions,
|
|
371
|
+
} from "@openclaw/fs-safe/secure-temp-root";
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
This entry excludes the temp workspace and store implementations from the
|
|
375
|
+
module graph, keeping the import closure small for browser-aware builds that
|
|
376
|
+
shim or exclude Node built-ins. The resolver remains a Node filesystem API; the
|
|
377
|
+
narrow entry does not make it runnable in a browser.
|
|
378
|
+
|
|
379
|
+
### Options
|
|
380
|
+
|
|
381
|
+
```ts
|
|
382
|
+
type ResolveSecureTempRootOptions = {
|
|
383
|
+
fallbackPrefix: string; // one portable path segment; invalid values throw
|
|
384
|
+
preferredDir?: string; // preferred secure temp root
|
|
385
|
+
skipPreferredOnWindows?: boolean;
|
|
386
|
+
unsafeFallbackLabel?: string; // text used in thrown errors
|
|
387
|
+
warningPrefix?: string; // default "[fs-safe]"
|
|
388
|
+
warn?: (message: string) => void; // default console.warn
|
|
389
|
+
|
|
390
|
+
// Platform/test adapters; production callers normally omit these.
|
|
391
|
+
platform?: NodeJS.Platform;
|
|
392
|
+
getuid?: () => number | undefined;
|
|
393
|
+
tmpdir?: () => string;
|
|
394
|
+
accessSync?: typeof import("node:fs").accessSync;
|
|
395
|
+
chmodSync?: typeof import("node:fs").chmodSync;
|
|
396
|
+
lstatSync?: (path: string) => {
|
|
397
|
+
isDirectory(): boolean;
|
|
398
|
+
isSymbolicLink(): boolean;
|
|
399
|
+
mode?: number;
|
|
400
|
+
uid?: number;
|
|
401
|
+
};
|
|
402
|
+
mkdirSync?: (
|
|
403
|
+
path: string,
|
|
404
|
+
options: { recursive: boolean; mode?: number },
|
|
405
|
+
) => void;
|
|
406
|
+
};
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
When `process.getuid()` is available, the fallback is
|
|
410
|
+
`<tmpdir>/<fallbackPrefix>-<uid>`. Without a UID (including Windows), it is
|
|
411
|
+
`<tmpdir>/<fallbackPrefix>`; no username is appended. The helper never returns
|
|
412
|
+
the shared `os.tmpdir()` directory itself. It requires the selected path to be
|
|
413
|
+
a writable, non-symlink directory and, when UID/mode facts are available,
|
|
414
|
+
owned by the current user without group/world write bits. It creates or repairs
|
|
415
|
+
the fallback to mode `0o700` where mode bits apply. If it cannot establish that
|
|
416
|
+
state, it throws an ordinary `Error`; there is no native mode or
|
|
417
|
+
`helper-unavailable` branch on this API.
|
|
418
|
+
|
|
419
|
+
## Common patterns
|
|
420
|
+
|
|
421
|
+
### Build something, atomically place it
|
|
422
|
+
|
|
423
|
+
```ts
|
|
424
|
+
import { replaceDirectoryAtomic } from "@openclaw/fs-safe/atomic";
|
|
425
|
+
|
|
426
|
+
await withTempWorkspace({ rootDir: "/srv/site/tmp", prefix: "build-" }, async (ws) => {
|
|
427
|
+
await runCompiler({ outDir: ws.dir });
|
|
428
|
+
await replaceDirectoryAtomic({
|
|
429
|
+
stagedDir: ws.dir,
|
|
430
|
+
targetDir: "/srv/site/public",
|
|
431
|
+
});
|
|
432
|
+
});
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Stream a download to a sibling temp, then commit
|
|
436
|
+
|
|
437
|
+
```ts
|
|
438
|
+
import { writeSiblingTempFile } from "@openclaw/fs-safe/advanced";
|
|
439
|
+
import fs from "node:fs/promises";
|
|
440
|
+
|
|
441
|
+
const r = await writeSiblingTempFile({
|
|
442
|
+
dir: "/srv/cache",
|
|
443
|
+
writeTemp: async (tempPath) => {
|
|
444
|
+
const handle = await fs.open(tempPath, "w");
|
|
445
|
+
try {
|
|
446
|
+
await pipeline(downloadStream, handle.createWriteStream());
|
|
447
|
+
} finally {
|
|
448
|
+
await handle.close();
|
|
449
|
+
}
|
|
450
|
+
return "blob.bin";
|
|
451
|
+
},
|
|
452
|
+
resolveFinalPath: (fileName) => path.join("/srv/cache", fileName),
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
console.log(`downloaded ${r.filePath}`);
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Per-call private scratch in a test
|
|
459
|
+
|
|
460
|
+
```ts
|
|
461
|
+
import { withTempWorkspace } from "@openclaw/fs-safe/temp";
|
|
462
|
+
|
|
463
|
+
it("processes a fixture", async () => {
|
|
464
|
+
await withTempWorkspace({ rootDir: "/tmp/my-tests", prefix: "test-" }, async (ws) => {
|
|
465
|
+
await fs.writeFile(path.join(ws.dir, "input.txt"), fixture);
|
|
466
|
+
const out = await processFile(path.join(ws.dir, "input.txt"));
|
|
467
|
+
expect(out).toEqual(expected);
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
## See also
|
|
473
|
+
|
|
474
|
+
- [Atomic writes](atomic.md) — `replaceDirectoryAtomic` for whole-directory swaps.
|
|
475
|
+
- [`root()`](root.md) — `fs.copyIn(rel, sourceAbs)` for moving files from a temp into a `Root`.
|
|
476
|
+
- [File lock](sidecar-lock.md) — when many processes share a temp tree.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Test hooks
|
|
3
|
+
description: "Internal-only injection hooks used by the fs-safe test suite. Active only when NODE_ENV=test or VITEST=true."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `@openclaw/fs-safe/test-hooks`
|
|
7
|
+
|
|
8
|
+
Internal injection points the `fs-safe` test suite uses to deterministically reproduce open/lstat races. They are exposed as a public subpath so downstream test suites can reuse the same harness, but they are **not** part of the supported runtime API.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import {
|
|
12
|
+
getFsSafeTestHooks,
|
|
13
|
+
__setFsSafeTestHooksForTest,
|
|
14
|
+
type FsSafeTestHooks,
|
|
15
|
+
} from "@openclaw/fs-safe/test-hooks";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## When the hooks are active
|
|
19
|
+
|
|
20
|
+
Hooks are only honored when one of the following is true:
|
|
21
|
+
|
|
22
|
+
- `process.env.NODE_ENV === "test"`
|
|
23
|
+
- `process.env.VITEST === "true"`
|
|
24
|
+
|
|
25
|
+
Calling `__setFsSafeTestHooksForTest(hooks)` outside of those environments throws. `getFsSafeTestHooks()` returns `undefined` when no hooks are registered, regardless of the environment.
|
|
26
|
+
|
|
27
|
+
## Shape
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
type FsSafeTestHooks = {
|
|
31
|
+
afterPreOpenLstat?: (filePath: string) => Promise<void> | void;
|
|
32
|
+
beforeOpen?: (filePath: string, flags: number) => Promise<void> | void;
|
|
33
|
+
afterOpen?: (filePath: string, handle: FileHandle) => Promise<void> | void;
|
|
34
|
+
beforeArchiveOutputMutation?: (operation: "mkdir" | "chmod", targetPath: string) => Promise<void> | void;
|
|
35
|
+
beforeFileStorePruneDescend?: (dirPath: string) => Promise<void> | void;
|
|
36
|
+
beforeFileStoreSyncPrivateWrite?: (filePath: string) => void;
|
|
37
|
+
beforeRootFallbackMutation?: (operation: "mkdir" | "move" | "remove", targetPath: string) => Promise<void> | void;
|
|
38
|
+
afterPinnedWriteFallbackRename?: (targetPath: string) => Promise<void> | void;
|
|
39
|
+
beforeSiblingTempWrite?: (tempPath: string) => Promise<void> | void;
|
|
40
|
+
beforeSidecarLockSnapshotOpen?: (lockPath: string) => Promise<void> | void;
|
|
41
|
+
beforeTrashMove?: (targetPath: string, destPath: string) => void;
|
|
42
|
+
afterPublishTargetCreated?: (method, targetPath, identity) => Promise<void> | void;
|
|
43
|
+
beforePublishDirectorySync?: (method, targetPath, identity) => Promise<void> | void;
|
|
44
|
+
};
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
| Hook | Fires when |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `afterPreOpenLstat` | A pre-open `lstat` has just resolved. Use this to swap a path between validation and open. |
|
|
50
|
+
| `beforeOpen` | The library is about to call `open(path, flags)`. Use this to inject a TOCTOU window. |
|
|
51
|
+
| `afterOpen` | An open just succeeded. Use this to mutate state before the post-open identity check runs. |
|
|
52
|
+
| `beforeArchiveOutputMutation` | Archive staging is about to create a directory or apply a mode. |
|
|
53
|
+
| `beforeFileStorePruneDescend` | File-store pruning is about to descend into a directory. |
|
|
54
|
+
| `beforeFileStoreSyncPrivateWrite` | A synchronous private-store write is about to mutate its target. |
|
|
55
|
+
| `beforeRootFallbackMutation` | A guarded JS root fallback is about to mkdir, move, or remove. |
|
|
56
|
+
| `afterPinnedWriteFallbackRename` | A fallback rename committed and post-commit identity checks have not run yet. |
|
|
57
|
+
| `beforeSiblingTempWrite` | A sibling temp file exists and its writer is about to run. |
|
|
58
|
+
| `beforeSidecarLockSnapshotOpen` | A sidecar lock was inspected and is about to be opened for a bounded snapshot read. |
|
|
59
|
+
| `beforeTrashMove` | Trash handling is about to move the target. |
|
|
60
|
+
| `afterPublishTargetCreated` | Exclusive publication created its target and final fences have not run yet. |
|
|
61
|
+
| `beforePublishDirectorySync` | Publication verified the target and is about to sync its parent directory. |
|
|
62
|
+
|
|
63
|
+
Hooks typed `Promise<void> | void` may be sync or async and are awaited.
|
|
64
|
+
Hooks used by synchronous code paths are typed `void` and must not return a
|
|
65
|
+
promise.
|
|
66
|
+
|
|
67
|
+
## Usage
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import { afterEach, beforeEach } from "vitest";
|
|
71
|
+
import { __setFsSafeTestHooksForTest } from "@openclaw/fs-safe/test-hooks";
|
|
72
|
+
|
|
73
|
+
beforeEach(() => {
|
|
74
|
+
__setFsSafeTestHooksForTest({
|
|
75
|
+
beforeOpen: async (filePath) => {
|
|
76
|
+
// swap a victim file with a symlink right before fs-safe opens it
|
|
77
|
+
await replaceWithSymlink(filePath);
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
afterEach(() => {
|
|
83
|
+
__setFsSafeTestHooksForTest(undefined);
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Always clear the hooks in `afterEach` so a stuck hook does not leak across tests.
|
|
88
|
+
|
|
89
|
+
## Stability
|
|
90
|
+
|
|
91
|
+
The shape can grow new optional fields between minor versions. Treat the surface as test-only and do not rely on it from production code.
|
|
92
|
+
|
|
93
|
+
## Related pages
|
|
94
|
+
|
|
95
|
+
- [Testing](testing.md) — broader notes on testing against `fs-safe`.
|
|
96
|
+
- [Security model](security-model.md) — the races these hooks help reproduce.
|