@openclaw/feishu 2026.10.1 → 2026.10.5-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.
Files changed (116) hide show
  1. package/dist/.setup/{app-registration-BB6TubaW.mjs → app-registration-DQOq5urV.mjs} +13 -32
  2. package/dist/.setup/{channel-DoRSlOQd.mjs → channel-CjGGyrdx.mjs} +87 -174
  3. package/dist/.setup/{channel.runtime-jLSFNkJh.mjs → channel.runtime-SaC_uTPM.mjs} +57 -74
  4. package/dist/.setup/{chat-mTBvMMvx.mjs → chat-fC3dvxFs.mjs} +16 -28
  5. package/dist/.setup/{client-CcxmEkoy.mjs → client-wwr8PGPH.mjs} +24 -30
  6. package/dist/.setup/{conversation-id-C1ofUfU8.mjs → conversation-id-D00i9uy5.mjs} +5 -10
  7. package/dist/.setup/{doctor-contract-DyOo8NvC.mjs → doctor-contract-oIpUWtNO.mjs} +8 -15
  8. package/dist/.setup/{monitor-DX3vAlY9.mjs → monitor-Yt__BUki.mjs} +33 -54
  9. package/dist/.setup/{monitor.account-C_uDFPtG.mjs → monitor.account-CVz16781.mjs} +377 -664
  10. package/dist/.setup/{probe-BjSykXB8.mjs → probe-DXnFxq5j.mjs} +14 -17
  11. package/dist/.setup/{reply-delivery-result-laBNOmBu.mjs → reply-delivery-result-iCCrdxE1.mjs} +153 -181
  12. package/dist/.setup/{session-conversation-C53IEUWt.mjs → session-conversation-BSBNK5Mq.mjs} +1 -1
  13. package/dist/.setup/{setup-api-DTTsvzfC.mjs → setup-api-B_LFQQ-Q.mjs} +1 -1
  14. package/dist/.setup/{subagent-hooks-C8Z_x3KJ.mjs → subagent-hooks-9Pc1-k37.mjs} +7 -17
  15. package/dist/.setup/{thread-bindings-jW2x5VuN.mjs → thread-bindings-DdNLxoL3.mjs} +21 -44
  16. package/dist/api.js +218 -326
  17. package/dist/channel-plugin-api.js +1 -1
  18. package/dist/contract-api.js +1 -1
  19. package/dist/doctor-contract-api.js +1 -1
  20. package/dist/session-binding-contract-api.js +1 -1
  21. package/dist/session-key-api.js +1 -1
  22. package/dist/setup-api.js +1 -1
  23. package/dist/setup-entry.js +1 -1
  24. package/dist/subagent-hooks-api.js +1 -1
  25. package/node_modules/@openclaw/fs-safe/CHANGELOG.md +35 -0
  26. package/node_modules/@openclaw/fs-safe/README.md +1 -1
  27. package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +1 -1
  28. package/node_modules/@openclaw/fs-safe/dist/advanced.js +1 -1
  29. package/node_modules/@openclaw/fs-safe/dist/archive-durability.js +1 -1
  30. package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +4 -4
  31. package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
  32. package/node_modules/@openclaw/fs-safe/dist/archive-read.js +5 -4
  33. package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +1 -1
  34. package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +22 -38
  35. package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.d.ts +17 -0
  36. package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.js +117 -0
  37. package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.d.ts +8 -5
  38. package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.js +27 -50
  39. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.d.ts +3 -0
  40. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +57 -11
  41. package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.js +5 -5
  42. package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +52 -5
  43. package/node_modules/@openclaw/fs-safe/dist/guest.js +1 -1
  44. package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +1 -0
  45. package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts +0 -1
  46. package/node_modules/@openclaw/fs-safe/dist/native-operations.js +22 -26
  47. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.js +5 -1
  48. package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +4 -1
  49. package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +2 -1
  50. package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.d.ts +6 -1
  51. package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +2 -2
  52. package/node_modules/@openclaw/fs-safe/dist/publish-file.js +34 -7
  53. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +1 -4
  54. package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +6 -0
  55. package/node_modules/@openclaw/fs-safe/dist/root-create-input.d.ts +15 -1
  56. package/node_modules/@openclaw/fs-safe/dist/root-create-input.js +4 -0
  57. package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.js +1 -1
  58. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +0 -1
  59. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +6 -12
  60. package/node_modules/@openclaw/fs-safe/dist/root-impl.js +15 -15
  61. package/node_modules/@openclaw/fs-safe/dist/root-paths.js +1 -1
  62. package/node_modules/@openclaw/fs-safe/dist/root-walk.js +4 -4
  63. package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts +10 -1
  64. package/node_modules/@openclaw/fs-safe/dist/root-write-verification.js +20 -0
  65. package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.js +19 -7
  66. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +25 -3
  67. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.d.ts +2 -0
  68. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.d.ts +14 -0
  69. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.js +187 -0
  70. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +15 -1
  71. package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.d.ts +10 -0
  72. package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.js +29 -0
  73. package/node_modules/@openclaw/fs-safe/dist/temp-target.js +1 -1
  74. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.js +6 -6
  75. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +4 -4
  76. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +17 -16
  77. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.js +20 -28
  78. package/node_modules/@openclaw/fs-safe/dist/walk.js +2 -13
  79. package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +2 -2
  80. package/node_modules/@openclaw/fs-safe/dist/watch-native.js +3 -1
  81. package/node_modules/@openclaw/fs-safe/dist/watch-rescan.js +3 -9
  82. package/node_modules/@openclaw/fs-safe/dist/watch.js +2 -3
  83. package/node_modules/@openclaw/fs-safe/docs/advanced.md +1 -1
  84. package/node_modules/@openclaw/fs-safe/docs/archive.md +3 -0
  85. package/node_modules/@openclaw/fs-safe/docs/atomic.md +11 -3
  86. package/node_modules/@openclaw/fs-safe/docs/contributing.md +1 -1
  87. package/node_modules/@openclaw/fs-safe/docs/copy.md +48 -0
  88. package/node_modules/@openclaw/fs-safe/docs/guest.md +21 -4
  89. package/node_modules/@openclaw/fs-safe/docs/path-scope.md +4 -0
  90. package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +46 -8
  91. package/node_modules/@openclaw/fs-safe/docs/temp.md +12 -0
  92. package/node_modules/@openclaw/fs-safe/docs/watch.md +3 -2
  93. package/node_modules/@openclaw/fs-safe/package.json +15 -15
  94. package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
  95. package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
  96. package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
  97. package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
  98. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
  99. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
  100. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
  101. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
  102. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
  103. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
  104. package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
  105. package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
  106. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
  107. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
  108. package/node_modules/follow-redirects/index.js +10 -1
  109. package/node_modules/follow-redirects/package.json +1 -1
  110. package/package.json +5 -5
  111. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.d.ts +0 -17
  112. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.js +0 -66
  113. package/node_modules/@openclaw/fs-safe/dist/publish-file-native.d.ts +0 -4
  114. package/node_modules/@openclaw/fs-safe/dist/publish-file-native.js +0 -35
  115. package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.d.ts +0 -7
  116. package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.js +0 -16
@@ -35,7 +35,7 @@ try {
35
35
 
36
36
  The lock file sits next to the protected resource. If a process crashes mid-lock, the next acquirer notices the held entry, inspects its payload (PID, host, acquired-at timestamp), and decides — via `shouldReclaim` (defaulting to "is the lock older than `staleMs`?") — whether it should keep waiting or fail.
37
37
 
38
- On natural event-loop shutdown, a globally deduplicated `process.on("beforeExit")` handler attempts asynchronous cleanup of held Root-backed locks through their retained Root capability and ownership receipt. The synchronous `process.on("exit")` handler provides last-chance cleanup for raw locks and raw-path reclaim guards. Changed sidecars and failed Root cleanup remain in place; cleanup does not keep retrying during shutdown unless another acquisition re-arms it. Locks acquired with `retainOnExit: true` are exempt from both handlers: their sidecar stays in place after exit and is governed only by the caller's own stale policy. Because exit handlers are globally deduplicated across package copies, `retainOnExit` fails closed with `helper-unavailable` if an older copy that cannot honor it registered the handlers first.
38
+ On natural event-loop shutdown, a globally deduplicated `process.on("beforeExit")` handler attempts asynchronous cleanup of held Root-backed locks through their creation receipt (or the Root capability when native retention is unavailable). The synchronous `process.on("exit")` handler also cleans retained native sidecars, raw locks, and raw-path reclaim guards. Changed sidecars and failed Root cleanup remain in place; cleanup does not keep retrying during shutdown unless another acquisition re-arms it. Locks acquired with `retainOnExit: true` are exempt from both handlers: their sidecar stays in place after exit and is governed only by the caller's own stale policy. Because exit handlers are globally deduplicated across package copies, `retainOnExit` fails closed with `helper-unavailable` if an older copy that cannot honor it registered the handlers first.
39
39
 
40
40
  Asynchronous Root-backed stale recovery uses a regular file at the
41
41
  `.reclaim` name, created, verified, and removed through that Root. Its ownership
@@ -57,17 +57,17 @@ even if guard ownership has also changed.
57
57
  Root guard; let its original attempt settle before retrying that guarded path.
58
58
  It stops compromise monitoring for forgotten holders, including callbacks from checks already in flight.
59
59
 
60
- Always release locks in a `finally` block. Application-managed graceful shutdown can await `release()` or `manager.drain()` before terminating. Explicit `process.exit()`, uncaught failures, crashes, default signal handling, and fatal termination (including `SIGKILL`) do not reliably run asynchronous Root cleanup and may leave sidecars. Recover only after an application-owned liveness policy proves the holder cannot still be writing.
60
+ Always release locks in a `finally` block. Application-managed graceful shutdown can await `release()` or `manager.drain()` before terminating. Explicit `process.exit()` runs synchronous cleanup for retained native sidecars, but cannot run asynchronous fallback Root cleanup. Uncaught failures, crashes, default signal handling, and fatal termination (including `SIGKILL`) may leave sidecars. Recover only after an application-owned liveness policy proves the holder cannot still be writing.
61
61
 
62
62
  Exit cleanup tolerates shared managers created by older package copies that lack reclaim-guard state, and continues through later manager domains. Handler ownership remains first-registration-wins: loading an updated copy does not replace an older copy's registered handler. First registration is committed only after Node accepts the listener; synchronous `newListener` reentry fails closed and a thrown registration rolls back so a later acquisition can retry. Restart with the updated copy registering first to obtain the fix. After building, `node scripts/legacy-lock-exit-proof.mjs` checks clean exit, removal of legacy and modern raw locks, and preservation of a retained lock using synthetic temporary files.
63
63
 
64
- Each new sidecar also carries an internal random ownership token encoded as JSON trailing whitespace. `JSON.parse()` and every payload callback still see exactly the caller-provided object. Only the process that successfully created the sidecar keeps that token as release authority; merely reading token-shaped bytes from disk does not enable this mode. Release compares the in-memory token and exact serialized bytes, and requires the pathname to remain a regular file, instead of requiring an opened descriptor and pathname lookup to report the same inode identity. This preserves ownership checks on filesystems such as Docker Desktop VirtioFS where those two views can legitimately differ. Sidecars created by older releases have no token and retain the legacy identity-plus-content check. Raw acquisition, snapshot, and exit cleanup capture bigint device/inode values; unsafe numeric identities from older in-process receipts cannot authorize cleanup. If Windows reports a zero device or inode for either identity observation, that check is inconclusive and removal is skipped.
64
+ Each new sidecar also carries an internal random ownership token encoded as JSON trailing whitespace. `JSON.parse()` and every payload callback still see exactly the caller-provided object. Only the process that successfully created the sidecar keeps that token as release authority; merely reading token-shaped bytes from disk does not enable this mode. Raw and JavaScript fallback release compare the in-memory token and exact serialized bytes, and require the pathname to remain a regular file, instead of requiring an opened descriptor and pathname lookup to report the same inode identity. Retained native Root locks additionally require the exact created inode and a single link, as described below. This preserves ownership checks on filesystems such as Docker Desktop VirtioFS where those two views can legitimately differ. Sidecars created by older releases have no token and retain the legacy identity-plus-content check. Raw acquisition, snapshot, and exit cleanup capture bigint device/inode values; unsafe numeric identities from older in-process receipts cannot authorize cleanup. If Windows reports a zero device or inode for either identity observation, that check is inconclusive and removal is skipped.
65
65
 
66
66
  Last-chance raw-lock exit cleanup requires known Windows device and inode values from both pathname observations and the opened descriptor. A zero value leaves the sidecar in place, including for token-owned locks. Known descriptor/path identity differences remain supported; a pathname identity change during the read still prevents cleanup.
67
67
 
68
68
  The raw sidecar bytes are not a canonical JSON representation: tools that trim or rewrite the trailing whitespace invalidate the ownership token, so release leaves the changed sidecar in place and fails closed. The token distinguishes cooperating acquisitions; it is not a secret and does not make pathname compare-and-remove atomic against a hostile process that can replace files outside the lock protocol.
69
69
 
70
- `release()` propagates an I/O failure that prevents deletion of an unchanged, owned sidecar; it never reports successful cleanup while leaving that lock behind. The handle and manager retain the exact cleanup receipt after a failure, so the same handle can retry `release()` and `manager.drain()` can retry retained cleanup. A changed sidecar remains an ownership mismatch rather than a deletion failure and is left untouched. If both a `withFileLock()` or `withFileLockSync()` callback and release fail, the release error is the primary `SuppressedError.error` and the callback failure remains available as `SuppressedError.suppressed`. Failed asynchronous acquisition cleanup uses the same shape, with the cleanup error primary and the acquisition failure suppressed. On Node runtimes without the global `SuppressedError` constructor, fs-safe returns the equivalent `Error` shape with the same name and properties.
70
+ `release()` propagates an I/O failure that prevents deletion of an unchanged, owned sidecar; it never reports successful cleanup while leaving that lock behind. Raw and JavaScript fallback handles and managers retain the cleanup receipt after an I/O failure, so the same handle can retry `release()` and `manager.drain()` can retry cleanup. Retained native Root locks settle once and close their retained handles on every outcome, including failure; a failed deletion requires application-owned recovery. A changed sidecar is left untouched. Retained native Root release reports `FsSafeError` code `path-mismatch`, distinguishing a changed identity from a changed owner record; this includes a replacement inode containing an exact copy of the original bytes. If both a `withFileLock()` or `withFileLockSync()` callback and release fail, the release error is the primary `SuppressedError.error` and the callback failure remains available as `SuppressedError.suppressed`. Failed asynchronous acquisition cleanup uses the same shape, with the cleanup error primary and the acquisition failure suppressed. On Node runtimes without the global `SuppressedError` constructor, fs-safe returns the equivalent `Error` shape with the same name and properties.
71
71
 
72
72
  ## API
73
73
 
@@ -265,10 +265,48 @@ its separate canonical-path mutation queue. The synchronous APIs implement the
265
265
  same owner/refcount rules; a mismatched synchronous acquisition blocks the
266
266
  calling thread according to its retry and timeout options.
267
267
 
268
- Pass `lockRoot` to place sidecar create, read, verification, and removal behind
269
- an existing `Root` capability. `lockPath` must resolve inside that root.
270
- Identity-conditioned removal remains the only release and reclaim deletion
271
- path.
268
+ Pass `lockRoot` to admit sidecar creation, reads, and verification through an
269
+ existing `Root` capability. `lockPath` must resolve inside that root.
270
+
271
+ With the maintained native helper, asynchronous acquisition retains cleanup
272
+ authority over only the sidecar it created: an identity-checked parent descriptor
273
+ and file descriptor on POSIX, or a shared-delete parent directory handle on Windows
274
+ (local NTFS). `release()` and process-exit cleanup verify the original named
275
+ entry's exact identity, regular-file type, single link, and complete owner record
276
+ through those retained handles. They then use guarded descriptor-relative removal
277
+ or Windows disposition-delete, without resolving the Root again. Cleanup therefore
278
+ works after the Root moves, is replaced, or its parent becomes a symlink. A foreign
279
+ entry at either the original Root path or the retained sidecar name is preserved.
280
+ The retained handles close on success, mismatch, failed acquisition, and exit
281
+ (including `retainOnExit`, which closes handles without deleting).
282
+ If retention itself fails after creation, rollback checks the original identity
283
+ and owner bytes through the creator's still-open descriptors before removing the
284
+ claim. A changed entry is preserved and both the retention and cleanup errors are
285
+ reported; cleanup never falls back to token-only deletion of a replacement.
286
+ Retention duplicates the already-admitted parent authority instead of walking
287
+ its pathname again or requiring extra access to its ancestors.
288
+ Windows opens the named file through the retained parent only for settlement,
289
+ with delete access and sharing; keeping a file handle open would prevent ordinary
290
+ directory relocation. Retained cleanup compares the owner bytes directly and does
291
+ not invoke `parsePayload`; verification and stale-policy reads still do.
292
+ Windows permits renaming that retained parent itself, but refuses renaming an
293
+ ancestor containing the open directory handle, even with delete sharing and no
294
+ data access. Such a refused move leaves the Root and lock in place; release or
295
+ exit cleanup closes the pin so the ancestor can then move. POSIX also supports
296
+ cleanup after a successful ancestor move or symlink swap.
297
+
298
+ `verifyStillHeld()` retains its Root-based semantics and can still reject a moved
299
+ Root even though `release()` can remove its own sidecar. This creation-specific
300
+ cleanup receipt does not authorize other Root operations or stale reclamation;
301
+ those continue to enforce current confinement and mutation policy. As with the
302
+ sidecar protocol generally, the POSIX final identity check and unlink are not an
303
+ atomic compare-and-delete against an uncooperative process racing the same name.
304
+
305
+ When native retention is unavailable or explicitly disabled, release keeps the
306
+ existing Root-based fail-closed behavior; a moved Root can leave a sidecar requiring
307
+ application-owned recovery. Use the matching maintained native package to obtain
308
+ relocation-safe cleanup. Synchronous Root locks keep their existing Root authority.
309
+ Identity-conditioned removal remains the only release and reclaim deletion path.
272
310
  Root mutation refusals during stale removal propagate unchanged, including
273
311
  `null`, `undefined`, and errors carrying `ENOENT`; they do not become missing-sidecar retries.
274
312
 
@@ -35,6 +35,18 @@ mode, correction uses a verified directory descriptor.
35
35
  An initial mode-descriptor admission error is preserved if closing that rejected
36
36
  descriptor also fails; close failures after successful admission remain reportable.
37
37
 
38
+ These rules apply equally to effective UID 0: root-owned `0700` or `0755` temp
39
+ roots beneath root-owned sticky `1777` `/tmp` are accepted. Passing `/tmp` itself
40
+ as `rootDir` is rejected because the workspace root must be private. Permission
41
+ and ownership errors name the rejected directory (including an unsafe ancestor),
42
+ the observed mode or owner UID, the expected property, and a recovery path.
43
+ Prefer `resolveSecureTempRoot()` or a dedicated directory owned by the effective
44
+ user with mode `0700`. For a non-sticky writable ancestor, have its administrator
45
+ restore appropriate permissions (`1777` for shared system temp) or move the root
46
+ under trusted ancestry. Do not make shared `/tmp` private or take ownership of
47
+ another user's directory. A caller's preferred root takes precedence over
48
+ `TMPDIR`; changing `TMPDIR` only changes the resolver's fallback location.
49
+
38
50
  On Linux, non-identity `/proc/self/uid_map` and `/proc/self/gid_map` evidence
39
51
  permits ancestors whose UID and GID equal unmapped kernel overflow IDs,
40
52
  provided the same ancestor mode checks pass.
@@ -152,8 +152,9 @@ FSEvents drops, including during recursive deletion. A shallow tree anchored abo
152
152
  a busy unselected subtree still receives recursive traffic; pending hints fold
153
153
  under pressure, while genuine FSEvents drops can still overflow.
154
154
  Absolute hints are reduced lexically against the admitted canonical Root;
155
- outside paths never become detail. Dropped/wrapped streams, RootChanged and
156
- Unmount trigger guarded reconciliation. Pathname hints can reflect activity
155
+ outside paths never become detail. Dropped/wrapped streams, RootChanged, Unmount
156
+ and notifications naming the Root itself trigger guarded reconciliation without detail.
157
+ Pathname hints can reflect activity
157
158
  after a swap, but the Root is never replaced and names require guarded admission.
158
159
  Removal synchronously stops, invalidates and releases the stream on its queue.
159
160
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/fs-safe",
3
- "version": "0.24.2",
3
+ "version": "0.25.0",
4
4
  "description": "Capability-style filesystem roots for Node.js apps that handle untrusted relative paths.",
5
5
  "keywords": [
6
6
  "filesystem",
@@ -173,32 +173,32 @@
173
173
  "archive:producer-smoke": "node scripts/archive-producer-smoke.mjs"
174
174
  },
175
175
  "optionalDependencies": {
176
- "@openclaw/fs-safe-darwin-arm64": "0.24.2",
177
- "@openclaw/fs-safe-darwin-x64": "0.24.2",
178
- "@openclaw/fs-safe-linux-arm64-gnu": "0.24.2",
179
- "@openclaw/fs-safe-linux-arm64-musl": "0.24.2",
180
- "@openclaw/fs-safe-linux-x64-gnu": "0.24.2",
181
- "@openclaw/fs-safe-linux-x64-musl": "0.24.2",
182
- "@openclaw/fs-safe-win32-x64-msvc": "0.24.2",
176
+ "@openclaw/fs-safe-darwin-arm64": "0.25.0",
177
+ "@openclaw/fs-safe-darwin-x64": "0.25.0",
178
+ "@openclaw/fs-safe-linux-arm64-gnu": "0.25.0",
179
+ "@openclaw/fs-safe-linux-arm64-musl": "0.25.0",
180
+ "@openclaw/fs-safe-linux-x64-gnu": "0.25.0",
181
+ "@openclaw/fs-safe-linux-x64-musl": "0.25.0",
182
+ "@openclaw/fs-safe-win32-x64-msvc": "0.25.0",
183
183
  "jszip": "^3.10.2"
184
184
  },
185
185
  "devDependencies": {
186
- "@emnapi/runtime": "2.0.0-alpha.5",
187
- "@napi-rs/cli": "3.10.6",
188
- "@types/node": "^26.6.1",
186
+ "@emnapi/runtime": "2.0.0-alpha.6",
187
+ "@napi-rs/cli": "3.10.8",
188
+ "@types/node": "^26.6.4",
189
189
  "@vitest/coverage-v8": "5.0.3",
190
- "fast-check": "^4.10.1",
190
+ "fast-check": "^4.10.2",
191
191
  "istanbul-lib-coverage": "3.2.2",
192
192
  "istanbul-lib-report": "3.0.1",
193
193
  "istanbul-reports": "3.2.0",
194
194
  "sigstore": "5.0.0",
195
195
  "tar": "7.5.22",
196
196
  "typescript": "^7.0.2",
197
- "vite": "8.3.2",
198
- "vitest": "^5.0.1"
197
+ "vite": "8.3.3",
198
+ "vitest": "^5.0.3"
199
199
  },
200
200
  "engines": {
201
201
  "node": ">=22"
202
202
  },
203
- "packageManager": "pnpm@12.4.2"
203
+ "packageManager": "pnpm@12.10.1"
204
204
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/fs-safe-darwin-arm64",
3
- "version": "0.24.2",
3
+ "version": "0.25.0",
4
4
  "description": "macOS arm64 native binding for @openclaw/fs-safe.",
5
5
  "license": "MIT",
6
6
  "author": "OpenClaw Team <dev@openclaw.ai>",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/fs-safe-darwin-x64",
3
- "version": "0.24.2",
3
+ "version": "0.25.0",
4
4
  "description": "macOS x64 native binding for @openclaw/fs-safe.",
5
5
  "license": "MIT",
6
6
  "author": "OpenClaw Team <dev@openclaw.ai>",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/fs-safe-linux-arm64-gnu",
3
- "version": "0.24.2",
3
+ "version": "0.25.0",
4
4
  "description": "Linux arm64 glibc native binding for @openclaw/fs-safe.",
5
5
  "license": "MIT",
6
6
  "author": "OpenClaw Team <dev@openclaw.ai>",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/fs-safe-linux-arm64-musl",
3
- "version": "0.24.2",
3
+ "version": "0.25.0",
4
4
  "description": "Linux arm64 musl native binding for @openclaw/fs-safe.",
5
5
  "license": "MIT",
6
6
  "author": "OpenClaw Team <dev@openclaw.ai>",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/fs-safe-linux-x64-gnu",
3
- "version": "0.24.2",
3
+ "version": "0.25.0",
4
4
  "description": "Linux x64 glibc native binding for @openclaw/fs-safe.",
5
5
  "license": "MIT",
6
6
  "author": "OpenClaw Team <dev@openclaw.ai>",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/fs-safe-linux-x64-musl",
3
- "version": "0.24.2",
3
+ "version": "0.25.0",
4
4
  "description": "Linux x64 musl native binding for @openclaw/fs-safe.",
5
5
  "license": "MIT",
6
6
  "author": "OpenClaw Team <dev@openclaw.ai>",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/fs-safe-win32-x64-msvc",
3
- "version": "0.24.2",
3
+ "version": "0.25.0",
4
4
  "description": "Windows x64 MSVC native binding for @openclaw/fs-safe.",
5
5
  "license": "MIT",
6
6
  "author": "OpenClaw Team <dev@openclaw.ai>",
@@ -302,6 +302,15 @@ RedirectableRequest.prototype._sanitizeOptions = function (options) {
302
302
  if (!options.headers) {
303
303
  options.headers = {};
304
304
  }
305
+ // Convert [header1, value1, header2, value2, …] to object
306
+ else if (Array.isArray(options.headers)) {
307
+ var headerList = options.headers;
308
+ options.headers = {};
309
+ for (var i = 0; i < headerList.length; i += 2) {
310
+ options.headers[headerList[i]] = headerList[i + 1];
311
+ }
312
+ }
313
+ // Ensure sensitive headers are always present
305
314
  if (!isArray(options.sensitiveHeaders)) {
306
315
  options.sensitiveHeaders = [];
307
316
  }
@@ -701,7 +710,7 @@ function isURL(value) {
701
710
  }
702
711
 
703
712
  function escapeRegex(regex) {
704
- return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
713
+ return regex.replace(/[[\]\\/()*+?.^$|]/g, "\\$&");
705
714
  }
706
715
 
707
716
  // Exports
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "follow-redirects",
3
- "version": "1.16.0",
3
+ "version": "1.16.1",
4
4
  "description": "HTTP and HTTPS modules that follow redirects.",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/feishu",
3
- "version": "2026.10.1",
3
+ "version": "2026.10.5-beta.1",
4
4
  "description": "OpenClaw Feishu/Lark channel plugin for chats and workplace tools (community maintained by @m1heng).",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  "type": "module",
10
10
  "dependencies": {
11
11
  "@larksuiteoapi/node-sdk": "1.74.0",
12
- "@openclaw/fs-safe": "0.24.2",
12
+ "@openclaw/fs-safe": "0.25.0",
13
13
  "mdast-util-from-markdown": "2.0.3",
14
14
  "mdast-util-gfm-table": "2.0.0",
15
15
  "micromark-extension-gfm-table": "2.1.2",
@@ -17,7 +17,7 @@
17
17
  "zod": "4.6.5"
18
18
  },
19
19
  "peerDependencies": {
20
- "openclaw": ">=2026.10.1"
20
+ "openclaw": ">=2026.10.5-beta.1"
21
21
  },
22
22
  "peerDependenciesMeta": {
23
23
  "openclaw": {
@@ -64,11 +64,11 @@
64
64
  "minHostVersion": ">=2026.5.29"
65
65
  },
66
66
  "compat": {
67
- "pluginApi": ">=2026.10.1"
67
+ "pluginApi": ">=2026.10.5-beta.1"
68
68
  },
69
69
  "build": {
70
70
  "bundledDist": false,
71
- "openclawVersion": "2026.10.1"
71
+ "openclawVersion": "2026.10.5-beta.1"
72
72
  },
73
73
  "release": {
74
74
  "publishToClawHub": true,
@@ -1,17 +0,0 @@
1
- import { FsSafeError } from "./errors.js";
2
- import type { FileLockSyncHandle } from "./file-lock-sync.js";
3
- import { type FileLockSyncRootAuthority, type FileLockSyncRootPath } from "./file-lock-sync-root.js";
4
- import type { FileLockSyncRootFileReceipt } from "./file-lock-sync-root-io.js";
5
- import { type RootSyncHeldLock } from "./file-lock-sync-root-held.js";
6
- export declare class FileLockSyncRootArbitrationCollision extends FsSafeError {
7
- constructor();
8
- }
9
- export type FileLockSyncRootArbitration = Readonly<{
10
- authority: FileLockSyncRootAuthority;
11
- heldLocks: Map<string, RootSyncHeldLock>;
12
- lockRootPath: FileLockSyncRootPath;
13
- normalizedTargetPath: string;
14
- reentrantOwner?: string;
15
- }>;
16
- export declare function tryReuseCurrentRootSyncHeldLock(arbitration: FileLockSyncRootArbitration): FileLockSyncHandle | undefined;
17
- export declare function cleanupCreatedRootSyncLock(lockRootPath: FileLockSyncRootPath, fd: number, receipt: FileLockSyncRootFileReceipt, timer?: NodeJS.Timeout): void;
@@ -1,66 +0,0 @@
1
- import fs from "node:fs";
2
- import { foreignSyncHeldLock } from "./file-lock-sync-admission.js";
3
- import path from "node:path";
4
- import { FsSafeError } from "./errors.js";
5
- import {} from "./file-lock-sync-root.js";
6
- import { removeFileLockSyncRootFile } from "./file-lock-sync-root-mutation.js";
7
- import { createSuppressedError } from "./suppressed-error.js";
8
- import { createRootSyncHeldLockHandle, verifyRootSyncHeldLock, } from "./file-lock-sync-root-held.js";
9
- export class FileLockSyncRootArbitrationCollision extends FsSafeError {
10
- constructor() {
11
- super("path-mismatch", "file lock arbitration changed during local creation");
12
- }
13
- }
14
- function sameRootLockPath(left, right) {
15
- return left.relativePath === right.relativePath && path.relative(left.path, right.path) === "";
16
- }
17
- export function tryReuseCurrentRootSyncHeldLock(arbitration) {
18
- const held = arbitration.heldLocks.get(arbitration.normalizedTargetPath);
19
- const reusable = held && !foreignSyncHeldLock("root", arbitration.normalizedTargetPath) &&
20
- arbitration.reentrantOwner !== undefined &&
21
- held.reentrantOwner !== undefined &&
22
- arbitration.reentrantOwner === held.reentrantOwner &&
23
- arbitration.authority.adapter === held.rootAuthority.adapter &&
24
- sameRootLockPath(arbitration.lockRootPath, held.rootPath) &&
25
- held.releaseState !== "released";
26
- if (!reusable)
27
- return undefined;
28
- if (!verifyRootSyncHeldLock(held)) {
29
- throw new FsSafeError("path-mismatch", "held sidecar lock changed before reentrant reuse");
30
- }
31
- // Verification can invoke a custom parser. Re-fetch the exact entry before
32
- // granting a reference, while retaining supported releasing/exit states.
33
- if (arbitration.heldLocks.get(arbitration.normalizedTargetPath) !== held ||
34
- held.releaseState === "released" || foreignSyncHeldLock("root", arbitration.normalizedTargetPath)) {
35
- throw new FsSafeError("path-mismatch", "held sidecar lock changed during reentrant reuse");
36
- }
37
- held.refCount += 1;
38
- held.revision += 1;
39
- return createRootSyncHeldLockHandle(held);
40
- }
41
- export function cleanupCreatedRootSyncLock(lockRootPath, fd, receipt, timer) {
42
- let timerCleanupFailed = false;
43
- let timerCleanupError;
44
- try {
45
- if (timer)
46
- clearInterval(timer);
47
- }
48
- catch (error) {
49
- timerCleanupFailed = true;
50
- timerCleanupError = error;
51
- }
52
- try {
53
- fs.closeSync(fd);
54
- if (!removeFileLockSyncRootFile(lockRootPath, receipt)) {
55
- throw new FsSafeError("path-mismatch", "created sidecar lock changed before cleanup");
56
- }
57
- }
58
- catch (fileCleanupError) {
59
- if (timerCleanupFailed) {
60
- throw createSuppressedError(timerCleanupError, fileCleanupError, "unpublished lock timer and file cleanup both failed");
61
- }
62
- throw fileCleanupError;
63
- }
64
- if (timerCleanupFailed)
65
- throw timerCleanupError;
66
- }
@@ -1,4 +0,0 @@
1
- import type { BigIntStats } from "node:fs";
2
- import type { NativeBinding } from "./native-binding.js";
3
- import { type PublishFailureState } from "./publish-file-failure.js";
4
- export declare function publishFileNoReplaceNative(binding: NativeBinding, paths: Parameters<NativeBinding["renameNoReplace"]>, expected: BigIntStats, failure: PublishFailureState): "link-unlink" | undefined;
@@ -1,35 +0,0 @@
1
- import { FsSafeError } from "./errors.js";
2
- import { getFsSafeNativeConfig } from "./native-config.js";
3
- import { nativeMoveNoReplace } from "./native-move-fallback.js";
4
- import { rememberCreatedTarget } from "./publish-file-failure.js";
5
- export function publishFileNoReplaceNative(binding, paths, expected, failure) {
6
- try {
7
- const fallback = nativeMoveNoReplace(binding, paths, expected, getFsSafeNativeConfig().mode === "auto", "file publication");
8
- if (fallback) {
9
- failure.fallback = fallback;
10
- failure.sourceRemoval = "removed";
11
- }
12
- return fallback;
13
- }
14
- catch (error) {
15
- if (error instanceof FsSafeError && error.details?.publication === "published") {
16
- failure.targetCreated = true;
17
- failure.preserveTarget = true;
18
- failure.phase = "rename-verify";
19
- failure.fallback = "link-unlink";
20
- failure.sourceRemoval = error.details.sourceRemoval;
21
- // Changed/unverified pairs cannot establish which inode was published.
22
- if (failure.sourceRemoval === "still-linked")
23
- rememberCreatedTarget(failure, expected, "rename-verify");
24
- }
25
- if (error instanceof FsSafeError)
26
- throw error;
27
- const code = error?.code;
28
- if (code === "path-mismatch" || code === "hardlink") {
29
- throw new FsSafeError(code, "publication source changed before fallback", { cause: error });
30
- }
31
- if (code === "ELOOP")
32
- throw new FsSafeError("symlink", "publication source became a symlink", { cause: error });
33
- throw error;
34
- }
35
- }
@@ -1,7 +0,0 @@
1
- import { type DenyMutationPolicy } from "./deny-mutations.js";
2
- import { type RootContext } from "./root-context.js";
3
- export declare function assertMoveMutationAllowed(root: RootContext, params: {
4
- fromRelative: string;
5
- toRelative: string;
6
- denyMutations?: DenyMutationPolicy;
7
- }): Promise<void>;
@@ -1,16 +0,0 @@
1
- import { assertMutationNotDenied, } from "./deny-mutations.js";
2
- import { resolvePathInRoot } from "./root-context.js";
3
- export async function assertMoveMutationAllowed(root, params) {
4
- // Keep this preflight separate from the pinned resolutions in movePathFallback:
5
- // mutation denials must take precedence over source alias or identity failures.
6
- const source = await resolvePathInRoot(root, params.fromRelative, {
7
- aliasErrorCode: "path-alias",
8
- allowFinalSymlink: true,
9
- });
10
- await assertMutationNotDenied(source.resolved, params.denyMutations, { protectAncestors: true });
11
- const target = await resolvePathInRoot(root, params.toRelative, {
12
- aliasErrorCode: "path-alias",
13
- allowFinalSymlink: true,
14
- });
15
- await assertMutationNotDenied(target.resolved, params.denyMutations, { protectAncestors: true });
16
- }