@openclaw/signal 2026.9.6 → 2026.9.8

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 (279) hide show
  1. package/assets/icon.png +0 -0
  2. package/dist/.setup/{accounts-BV6tDOTc.mjs → accounts-DMtj2E-4.mjs} +6 -35
  3. package/dist/.setup/api-DEB0Obj8.mjs +16 -0
  4. package/dist/.setup/{api-CGh4eWR8.mjs → api-DmCb6e7E.mjs} +10 -10
  5. package/dist/.setup/{approval-auth-BBI9BTRm.mjs → approval-auth-CszS7gwf.mjs} +7 -13
  6. package/dist/.setup/{approval-handler.runtime-C3vN5OWd.mjs → approval-handler.runtime-D9ofZcZW.mjs} +10 -29
  7. package/dist/.setup/{approval-reactions-DDQvPP_z.mjs → approval-reactions-BKkjIAoi.mjs} +25 -36
  8. package/dist/.setup/{channel-DhzTcFsK.mjs → channel-DrUxv5cf.mjs} +567 -136
  9. package/dist/.setup/{client-BseAt7F7.mjs → client-AXcDteBZ.mjs} +63 -152
  10. package/dist/.setup/client-adapter-c_O1ouxZ.mjs +30 -0
  11. package/dist/.setup/{config-schema-aQwwMGUj.mjs → config-schema-DvxZ18SD.mjs} +3 -13
  12. package/dist/.setup/{doctor-contract-api-Rbq_sRTI.mjs → doctor-contract-api-Db9V9gsY.mjs} +212 -91
  13. package/dist/.setup/{identity-YXPmgFMu.mjs → identity-B3JyPqGO.mjs} +2 -6
  14. package/dist/.setup/{install-signal-cli-BDbzFcU2.mjs → install-signal-cli-ChvjzM6X.mjs} +0 -4
  15. package/dist/.setup/legacy-transport-QIpaMNST.mjs +18 -0
  16. package/dist/.setup/{monitor-Dnz6Ygz5.mjs → monitor-BfwQr78f.mjs} +95 -124
  17. package/dist/.setup/{probe-DXT2eLnw.mjs → probe-BYLzra6D.mjs} +9 -9
  18. package/dist/.setup/{reaction-runtime-api-BnQGHcrB.mjs → reaction-runtime-api-DDi5x2wC.mjs} +3 -17
  19. package/dist/.setup/{question-reactions-C8cSEjVf.mjs → reaction-targets-CEdyjtrC.mjs} +11 -8
  20. package/dist/.setup/{rpc-context-CwwADZ1b.mjs → rpc-context-D26RxFIm.mjs} +1 -1
  21. package/dist/.setup/runtime-8sxUF217.mjs +8 -0
  22. package/dist/.setup/{send-B78M_eFp.mjs → send-DEjrbpIC.mjs} +25 -55
  23. package/dist/.setup/{channel.runtime-CG79z_Vy.mjs → setup-surface-Drt-4t3R.mjs} +4 -6
  24. package/dist/.setup/transport-detection-BVUDE42e.mjs +25 -0
  25. package/dist/.setup/{transport-policy-5VSnj5ma.mjs → transport-policy-B6C_LogW.mjs} +19 -1
  26. package/dist/.setup/transport-probes.runtime-DwXEHnXr.mjs +2 -0
  27. package/dist/api.js +10 -10
  28. package/dist/channel-config-api.js +1 -1
  29. package/dist/channel-plugin-api.js +1 -1
  30. package/dist/contract-api.js +2 -2
  31. package/dist/doctor-contract-api.js +1 -1
  32. package/dist/reaction-runtime-api.js +1 -1
  33. package/dist/runtime-api.js +2 -19
  34. package/dist/setup-entry.js +1 -1
  35. package/node_modules/@openclaw/fs-safe/CHANGELOG.md +102 -0
  36. package/node_modules/@openclaw/fs-safe/README.md +24 -6
  37. package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +6 -1
  38. package/node_modules/@openclaw/fs-safe/dist/advanced.js +3 -1
  39. package/node_modules/@openclaw/fs-safe/dist/archive-durability.js +1 -1
  40. package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +1 -2
  41. package/node_modules/@openclaw/fs-safe/dist/archive-plan.d.ts +2 -7
  42. package/node_modules/@openclaw/fs-safe/dist/archive-read.js +9 -18
  43. package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +1 -2
  44. package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +3 -3
  45. package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.js +4 -0
  46. package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.d.ts +11 -11
  47. package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.js +3 -35
  48. package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.d.ts +2 -2
  49. package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.js +2 -12
  50. package/node_modules/@openclaw/fs-safe/dist/archive-zip-loader.d.ts +7 -3
  51. package/node_modules/@openclaw/fs-safe/dist/archive-zip-loader.js +13 -10
  52. package/node_modules/@openclaw/fs-safe/dist/archive-zip-manifest.js +3 -1
  53. package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.d.ts +2 -3
  54. package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.js +16 -8
  55. package/node_modules/@openclaw/fs-safe/dist/archive.d.ts +6 -3
  56. package/node_modules/@openclaw/fs-safe/dist/archive.js +22 -19
  57. package/node_modules/@openclaw/fs-safe/dist/atomic.d.ts +1 -1
  58. package/node_modules/@openclaw/fs-safe/dist/copy-publication.d.ts +1 -3
  59. package/node_modules/@openclaw/fs-safe/dist/copy-publication.js +2 -6
  60. package/node_modules/@openclaw/fs-safe/dist/deny-mutation-match.d.ts +2 -0
  61. package/node_modules/@openclaw/fs-safe/dist/deny-mutation-match.js +71 -0
  62. package/node_modules/@openclaw/fs-safe/dist/deny-mutations.js +4 -3
  63. package/node_modules/@openclaw/fs-safe/dist/directory-guard.d.ts +0 -1
  64. package/node_modules/@openclaw/fs-safe/dist/directory-guard.js +0 -3
  65. package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.d.ts +20 -2
  66. package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.js +77 -1
  67. package/node_modules/@openclaw/fs-safe/dist/directory-receipt.js +5 -7
  68. package/node_modules/@openclaw/fs-safe/dist/effective-uid.js +1 -4
  69. package/node_modules/@openclaw/fs-safe/dist/errors.d.ts +3 -1
  70. package/node_modules/@openclaw/fs-safe/dist/errors.js +3 -2
  71. package/node_modules/@openclaw/fs-safe/dist/file-identity.js +10 -2
  72. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-acquisition.js +1 -1
  73. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.js +5 -1
  74. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-held.d.ts +4 -11
  75. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-held.js +1 -4
  76. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.d.ts +3 -6
  77. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.js +1 -1
  78. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-options.d.ts +2 -10
  79. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root.d.ts +2 -4
  80. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.js +2 -2
  81. package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.d.ts +3 -7
  82. package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.js +7 -10
  83. package/node_modules/@openclaw/fs-safe/dist/file-store-prune.js +7 -6
  84. package/node_modules/@openclaw/fs-safe/dist/file-store.d.ts +4 -7
  85. package/node_modules/@openclaw/fs-safe/dist/file-store.js +19 -21
  86. package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +23 -31
  87. package/node_modules/@openclaw/fs-safe/dist/guest.js +21 -12
  88. package/node_modules/@openclaw/fs-safe/dist/json-document-store.d.ts +4 -9
  89. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.d.ts +1 -5
  90. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.d.ts +0 -1
  91. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.js +2 -7
  92. package/node_modules/@openclaw/fs-safe/dist/local-file-access.js +2 -5
  93. package/node_modules/@openclaw/fs-safe/dist/local-file-descriptor.d.ts +2 -5
  94. package/node_modules/@openclaw/fs-safe/dist/local-roots.d.ts +2 -7
  95. package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.js +4 -4
  96. package/node_modules/@openclaw/fs-safe/dist/mutation-authority.js +5 -0
  97. package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +51 -14
  98. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.js +8 -2
  99. package/node_modules/@openclaw/fs-safe/dist/native-staged-symlink.d.ts +13 -0
  100. package/node_modules/@openclaw/fs-safe/dist/native-staged-symlink.js +303 -0
  101. package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch-worker.d.ts +1 -0
  102. package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch-worker.js +54 -0
  103. package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch.d.ts +5 -0
  104. package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch.js +64 -0
  105. package/node_modules/@openclaw/fs-safe/dist/owner-dacl.d.ts +2 -0
  106. package/node_modules/@openclaw/fs-safe/dist/owner-dacl.js +3 -0
  107. package/node_modules/@openclaw/fs-safe/dist/path.js +17 -1
  108. package/node_modules/@openclaw/fs-safe/dist/permission-exec.d.ts +6 -0
  109. package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +3 -6
  110. package/node_modules/@openclaw/fs-safe/dist/permissions-public.d.ts +3 -1
  111. package/node_modules/@openclaw/fs-safe/dist/permissions-public.js +1 -0
  112. package/node_modules/@openclaw/fs-safe/dist/permissions-windows.d.ts +3 -6
  113. package/node_modules/@openclaw/fs-safe/dist/permissions.d.ts +3 -10
  114. package/node_modules/@openclaw/fs-safe/dist/permissions.js +0 -1
  115. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.d.ts +0 -1
  116. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.js +4 -2
  117. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-shared-route.d.ts +2 -8
  118. package/node_modules/@openclaw/fs-safe/dist/pinned-open.d.ts +1 -1
  119. package/node_modules/@openclaw/fs-safe/dist/pinned-open.js +2 -3
  120. package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.js +4 -0
  121. package/node_modules/@openclaw/fs-safe/dist/read-opened-file.d.ts +2 -5
  122. package/node_modules/@openclaw/fs-safe/dist/regular-file.js +3 -3
  123. package/node_modules/@openclaw/fs-safe/dist/replace-directory.js +5 -17
  124. package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.d.ts +4 -0
  125. package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.js +36 -0
  126. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.d.ts +4 -10
  127. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +66 -38
  128. package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts +7 -11
  129. package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +10 -2
  130. package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.d.ts +21 -0
  131. package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.js +123 -0
  132. package/node_modules/@openclaw/fs-safe/dist/replace-file-mutation.d.ts +26 -0
  133. package/node_modules/@openclaw/fs-safe/dist/replace-file-mutation.js +47 -0
  134. package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.d.ts +2 -2
  135. package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.js +16 -4
  136. package/node_modules/@openclaw/fs-safe/dist/replace-file-types.d.ts +55 -0
  137. package/node_modules/@openclaw/fs-safe/dist/replace-file-types.js +1 -0
  138. package/node_modules/@openclaw/fs-safe/dist/replace-file.d.ts +3 -55
  139. package/node_modules/@openclaw/fs-safe/dist/replace-file.js +31 -11
  140. package/node_modules/@openclaw/fs-safe/dist/retained-directory-replacement.d.ts +1 -0
  141. package/node_modules/@openclaw/fs-safe/dist/retained-directory-replacement.js +1 -1
  142. package/node_modules/@openclaw/fs-safe/dist/retained-file-types.d.ts +50 -0
  143. package/node_modules/@openclaw/fs-safe/dist/retained-file-types.js +1 -0
  144. package/node_modules/@openclaw/fs-safe/dist/retained-file.d.ts +3 -0
  145. package/node_modules/@openclaw/fs-safe/dist/retained-file.js +121 -0
  146. package/node_modules/@openclaw/fs-safe/dist/root-context.js +3 -2
  147. package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.d.ts +9 -0
  148. package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.js +28 -0
  149. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +9 -1
  150. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +88 -37
  151. package/node_modules/@openclaw/fs-safe/dist/root-file-final-admission.d.ts +1 -1
  152. package/node_modules/@openclaw/fs-safe/dist/root-file-final-admission.js +1 -6
  153. package/node_modules/@openclaw/fs-safe/dist/root-file.js +2 -5
  154. package/node_modules/@openclaw/fs-safe/dist/root-handle-context.d.ts +4 -0
  155. package/node_modules/@openclaw/fs-safe/dist/root-handle-context.js +12 -0
  156. package/node_modules/@openclaw/fs-safe/dist/root-impl.d.ts +3 -3
  157. package/node_modules/@openclaw/fs-safe/dist/root-impl.js +8 -5
  158. package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.d.ts +2 -7
  159. package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.js +3 -3
  160. package/node_modules/@openclaw/fs-safe/dist/root-observed-path.d.ts +0 -1
  161. package/node_modules/@openclaw/fs-safe/dist/root-observed-path.js +0 -3
  162. package/node_modules/@openclaw/fs-safe/dist/root-path-observation.d.ts +4 -11
  163. package/node_modules/@openclaw/fs-safe/dist/root-path.js +7 -10
  164. package/node_modules/@openclaw/fs-safe/dist/root-paths.d.ts +2 -6
  165. package/node_modules/@openclaw/fs-safe/dist/root-remove-identity.d.ts +1 -3
  166. package/node_modules/@openclaw/fs-safe/dist/root-walk.d.ts +19 -12
  167. package/node_modules/@openclaw/fs-safe/dist/root-walk.js +56 -20
  168. package/node_modules/@openclaw/fs-safe/dist/root-write-admission.js +1 -6
  169. package/node_modules/@openclaw/fs-safe/dist/root-write-complete-parent.d.ts +2 -0
  170. package/node_modules/@openclaw/fs-safe/dist/root-write-complete-parent.js +1 -1
  171. package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.d.ts +1 -0
  172. package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.js +8 -2
  173. package/node_modules/@openclaw/fs-safe/dist/secret-file.d.ts +6 -2
  174. package/node_modules/@openclaw/fs-safe/dist/secret-file.js +12 -16
  175. package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.js +1 -1
  176. package/node_modules/@openclaw/fs-safe/dist/secure-file-windows.js +5 -14
  177. package/node_modules/@openclaw/fs-safe/dist/secure-file.js +3 -2
  178. package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.js +2 -7
  179. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +4 -4
  180. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-parser.d.ts +1 -2
  181. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.d.ts +2 -8
  182. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.d.ts +2 -7
  183. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.d.ts +2 -2
  184. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.js +11 -12
  185. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-stale-admission.d.ts +1 -5
  186. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +9 -7
  187. package/node_modules/@openclaw/fs-safe/dist/staged-symlink-types.d.ts +39 -0
  188. package/node_modules/@openclaw/fs-safe/dist/staged-symlink-types.js +1 -0
  189. package/node_modules/@openclaw/fs-safe/dist/stat-observation.js +3 -10
  190. package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.d.ts +2 -0
  191. package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.js +6 -6
  192. package/node_modules/@openclaw/fs-safe/dist/symlink-parents.js +58 -7
  193. package/node_modules/@openclaw/fs-safe/dist/temp-target.js +8 -10
  194. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.js +28 -33
  195. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +1 -1
  196. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +16 -17
  197. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.js +1 -2
  198. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.js +4 -9
  199. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-ownership.d.ts +8 -0
  200. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-ownership.js +52 -0
  201. package/node_modules/@openclaw/fs-safe/dist/test-hooks.d.ts +5 -1
  202. package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts +2 -1
  203. package/node_modules/@openclaw/fs-safe/dist/text-atomic.js +2 -0
  204. package/node_modules/@openclaw/fs-safe/dist/trash.js +27 -1
  205. package/node_modules/@openclaw/fs-safe/dist/walk.d.ts +2 -5
  206. package/node_modules/@openclaw/fs-safe/dist/watch-alias.d.ts +6 -0
  207. package/node_modules/@openclaw/fs-safe/dist/watch-alias.js +88 -0
  208. package/node_modules/@openclaw/fs-safe/dist/watch-hints.d.ts +9 -0
  209. package/node_modules/@openclaw/fs-safe/dist/watch-hints.js +93 -0
  210. package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +36 -0
  211. package/node_modules/@openclaw/fs-safe/dist/watch-native.js +73 -0
  212. package/node_modules/@openclaw/fs-safe/dist/watch-scan.d.ts +28 -0
  213. package/node_modules/@openclaw/fs-safe/dist/watch-scan.js +300 -0
  214. package/node_modules/@openclaw/fs-safe/dist/watch-stream.d.ts +8 -0
  215. package/node_modules/@openclaw/fs-safe/dist/watch-stream.js +32 -0
  216. package/node_modules/@openclaw/fs-safe/dist/watch-types.d.ts +60 -0
  217. package/node_modules/@openclaw/fs-safe/dist/watch-types.js +1 -0
  218. package/node_modules/@openclaw/fs-safe/dist/watch.d.ts +5 -0
  219. package/node_modules/@openclaw/fs-safe/dist/watch.js +530 -0
  220. package/node_modules/@openclaw/fs-safe/dist/windows-owner.d.ts +3 -7
  221. package/node_modules/@openclaw/fs-safe/dist/windows-owner.js +0 -1
  222. package/node_modules/@openclaw/fs-safe/dist/windows-security-bridge.cs +6 -6
  223. package/node_modules/@openclaw/fs-safe/dist/windows-security-bridge.ps1 +78 -3
  224. package/node_modules/@openclaw/fs-safe/dist/windows-security-command.d.ts +8 -0
  225. package/node_modules/@openclaw/fs-safe/dist/windows-security-command.js +66 -15
  226. package/node_modules/@openclaw/fs-safe/dist/windows-security-facts.d.ts +4 -0
  227. package/node_modules/@openclaw/fs-safe/dist/windows-security-facts.js +6 -2
  228. package/node_modules/@openclaw/fs-safe/docs/advanced.md +4 -2
  229. package/node_modules/@openclaw/fs-safe/docs/archive.md +16 -0
  230. package/node_modules/@openclaw/fs-safe/docs/atomic.md +93 -3
  231. package/node_modules/@openclaw/fs-safe/docs/contributing.md +102 -4
  232. package/node_modules/@openclaw/fs-safe/docs/copy.md +2 -0
  233. package/node_modules/@openclaw/fs-safe/docs/durability.md +7 -0
  234. package/node_modules/@openclaw/fs-safe/docs/file-store.md +5 -0
  235. package/node_modules/@openclaw/fs-safe/docs/guest.md +7 -1
  236. package/node_modules/@openclaw/fs-safe/docs/index.md +1 -0
  237. package/node_modules/@openclaw/fs-safe/docs/install.md +30 -0
  238. package/node_modules/@openclaw/fs-safe/docs/native-helper.md +20 -4
  239. package/node_modules/@openclaw/fs-safe/docs/native.md +63 -1
  240. package/node_modules/@openclaw/fs-safe/docs/permissions.md +66 -0
  241. package/node_modules/@openclaw/fs-safe/docs/public-api.md +30 -3
  242. package/node_modules/@openclaw/fs-safe/docs/retained-file.md +115 -0
  243. package/node_modules/@openclaw/fs-safe/docs/root.md +35 -9
  244. package/node_modules/@openclaw/fs-safe/docs/secret-file.md +19 -0
  245. package/node_modules/@openclaw/fs-safe/docs/security-model.md +4 -1
  246. package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +5 -1
  247. package/node_modules/@openclaw/fs-safe/docs/staged-symlink.md +124 -0
  248. package/node_modules/@openclaw/fs-safe/docs/store.md +3 -1
  249. package/node_modules/@openclaw/fs-safe/docs/temp.md +24 -4
  250. package/node_modules/@openclaw/fs-safe/docs/testing.md +210 -0
  251. package/node_modules/@openclaw/fs-safe/docs/types.md +6 -0
  252. package/node_modules/@openclaw/fs-safe/docs/walk.md +34 -1
  253. package/node_modules/@openclaw/fs-safe/docs/watch.md +251 -0
  254. package/node_modules/@openclaw/fs-safe/docs/writing.md +21 -0
  255. package/node_modules/@openclaw/fs-safe/package.json +13 -9
  256. package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
  257. package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
  258. package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
  259. package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
  260. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
  261. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
  262. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
  263. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
  264. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
  265. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
  266. package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
  267. package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
  268. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
  269. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
  270. package/package.json +5 -5
  271. package/dist/.setup/api-B9-B1L7Q.mjs +0 -17
  272. package/dist/.setup/client-adapter-dvFa47YL.mjs +0 -63
  273. package/dist/.setup/rolldown-runtime-8H4AJuhK.mjs +0 -14
  274. package/dist/.setup/send.runtime-CLnCWvrM.mjs +0 -2
  275. package/dist/.setup/transport-detection-CoiRl7Gx.mjs +0 -576
  276. package/dist/.setup/transport-detection.runtime-Tlhuv3T_.mjs +0 -2
  277. package/dist/.setup/transport-probes.runtime-WprAyBbL.mjs +0 -2
  278. package/node_modules/@openclaw/fs-safe/dist/directory-mode-owner.d.ts +0 -20
  279. package/node_modules/@openclaw/fs-safe/dist/directory-mode-owner.js +0 -78
@@ -1,576 +0,0 @@
1
- import { a as normalizeSignalTransportUrl } from "./transport-url-CAC0JcuI.mjs";
2
- import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId, t as listEnabledSignalAccounts } from "./accounts-BV6tDOTc.mjs";
3
- import { n as normalizeSignalMessagingTarget, r as normalizeSignalReactionRecipient } from "./normalize-l_b99hap.mjs";
4
- import { n as signalApprovalAuth, t as getSignalApprovalApprovers } from "./approval-auth-BBI9BTRm.mjs";
5
- import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-BnQGHcrB.mjs";
6
- import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
7
- import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
8
- import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
9
- import { resolveReactionLevel } from "openclaw/plugin-sdk/status-helpers";
10
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
11
- import { FormatCapabilityProfile, markdownToIR, renderMarkdownIRChunksWithinLimit, renderMarkdownWithAttributedRanges } from "openclaw/plugin-sdk/text-chunking";
12
- import { createApproverRestrictedNativeApprovalCapabilityFromForwardingRoutes } from "openclaw/plugin-sdk/approval-delivery-runtime";
13
- import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
14
- import { shouldSuppressLocalNativeExecApprovalPrompt } from "openclaw/plugin-sdk/approval-native-runtime";
15
- import { buildApprovalReactionPendingContentForRequest } from "openclaw/plugin-sdk/approval-reaction-runtime";
16
- import { formatMediaPlaceholderText } from "openclaw/plugin-sdk/channel-inbound";
17
- import { kindFromMime } from "openclaw/plugin-sdk/media-runtime";
18
- import { createActionGate, jsonResult, readStringParam, resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
19
- import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
20
- import { getExecApprovalReplyMetadata } from "openclaw/plugin-sdk/approval-reply-runtime";
21
- import { isMessagePresentationInteractiveBlock, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
22
- import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
23
- //#region extensions/signal/src/approval-native.ts
24
- function isSignalApprovalTransportEnabled(params) {
25
- return resolveSignalAccount({
26
- cfg: params.cfg,
27
- accountId: params.accountId
28
- }).enabled;
29
- }
30
- const signalApproval = createApproverRestrictedNativeApprovalCapabilityFromForwardingRoutes({
31
- channel: "signal",
32
- channelLabel: "Signal",
33
- authorizeActorAction: (params) => signalApprovalAuth.authorizeActorAction(params),
34
- routing: {
35
- defaultForwardingMode: "session",
36
- isTransportEnabled: isSignalApprovalTransportEnabled,
37
- listAccountIds: listSignalAccountIds,
38
- resolveDefaultAccountId: resolveDefaultSignalAccountId,
39
- normalizeTo: normalizeSignalMessagingTarget,
40
- resolveApprovers: getSignalApprovalApprovers,
41
- suppressExplicitTargetFallback: false,
42
- isOriginTargetAllowed: ({ cfg, accountId, target }) => !isSignalGroupTarget(target.to) || getSignalApprovalApprovers({
43
- cfg,
44
- accountId
45
- }).length > 0
46
- },
47
- describeExecApprovalSetup: ({ accountId }) => {
48
- return `Signal supports native exec approvals for this account when \`approvals.exec.enabled\` is true and the route allows Signal. Link Signal and keep the gateway running; configure \`${accountId && accountId !== "default" ? `channels.signal.accounts.${accountId}` : "channels.signal"}.allowFrom\` to restrict approvers.`;
49
- },
50
- render: {
51
- exec: { buildPendingPayload: ({ request, nowMs }) => buildApprovalReactionPendingContentForRequest({
52
- request,
53
- nowMs
54
- }).manualFallbackPayload },
55
- plugin: { buildPendingPayload: ({ request, nowMs }) => buildApprovalReactionPendingContentForRequest({
56
- request,
57
- nowMs
58
- }).manualFallbackPayload }
59
- },
60
- createNativeRuntime: (routing) => createLazyChannelApprovalNativeRuntimeAdapter({
61
- capabilityBoundary: true,
62
- eventKinds: [
63
- "exec",
64
- "plugin",
65
- "system-agent"
66
- ],
67
- isConfigured: ({ cfg, accountId, context }) => Boolean(context) && routing.isNativeApprovalHandlerConfigured({
68
- cfg,
69
- accountId
70
- }),
71
- shouldHandle: ({ cfg, accountId, context, approvalKind, request }) => Boolean(context) && routing.shouldHandleApprovalRequest({
72
- cfg,
73
- accountId,
74
- approvalKind,
75
- request
76
- }),
77
- load: async () => (await import("./approval-handler.runtime-C3vN5OWd.mjs")).signalApprovalNativeRuntime
78
- })
79
- });
80
- const signalApprovalRouting = signalApproval.routing;
81
- function isSignalNativeApprovalHandlerConfigured(params) {
82
- return signalApprovalRouting.isNativeApprovalHandlerConfigured(params);
83
- }
84
- function resolveSignalSessionTargetFromSessionKey(sessionKey) {
85
- const rest = parseAgentSessionKey(sessionKey)?.rest ?? normalizeOptionalString(sessionKey);
86
- if (!rest || !normalizeLowercaseStringOrEmpty(rest).startsWith("signal:")) return null;
87
- return normalizeSignalMessagingTarget(rest.slice(7)) ?? null;
88
- }
89
- function shouldSuppressLocalSignalExecApprovalPrompt(params) {
90
- return shouldSuppressLocalNativeExecApprovalPrompt({
91
- ...params,
92
- isTransportEnabled: isSignalApprovalTransportEnabled,
93
- isSessionRouteEligible: ({ cfg, accountId, metadata }) => {
94
- if (getSignalApprovalApprovers({
95
- cfg,
96
- accountId
97
- }).length > 0) return true;
98
- const sessionTarget = resolveSignalSessionTargetFromSessionKey(metadata.sessionKey);
99
- return Boolean(sessionTarget && !isSignalGroupTarget(sessionTarget));
100
- }
101
- });
102
- }
103
- function isSignalGroupTarget(to) {
104
- return normalizeLowercaseStringOrEmpty(to).startsWith("group:");
105
- }
106
- const signalApprovalCapability = signalApproval.capability;
107
- //#endregion
108
- //#region extensions/signal/src/format.ts
109
- const SIGNAL_STYLE_MAP = {
110
- bold: "BOLD",
111
- italic: "ITALIC",
112
- strikethrough: "STRIKETHROUGH",
113
- code: "MONOSPACE",
114
- code_block: "MONOSPACE",
115
- spoiler: "SPOILER"
116
- };
117
- const SIGNAL_FORMAT_PROFILE = FormatCapabilityProfile.define({
118
- mechanism: "ranges",
119
- constructs: {
120
- underline: "strip",
121
- codeLanguage: "fallback",
122
- linkLabel: "fallback",
123
- heading: "fallback",
124
- bulletList: "fallback",
125
- orderedList: "fallback",
126
- taskList: "fallback",
127
- table: "fallback",
128
- blockquote: "fallback",
129
- image: "fallback",
130
- mention: "strip"
131
- },
132
- chunk: {
133
- limit: 4e3,
134
- unit: "chars"
135
- }
136
- });
137
- function stripEquivalentSignalLinks(ir) {
138
- const normalize = (value, preserveSuffixCase) => {
139
- const normalized = value.trim().replace(/^(?:https?:\/\/)?(?:www\.)?/i, "").replace(/\/+$/, "");
140
- return preserveSuffixCase ? normalized.replace(/^[^/?#]+/, (host) => host.toLowerCase()) : normalizeLowercaseStringOrEmpty(normalized);
141
- };
142
- return {
143
- ...ir,
144
- links: ir.links.filter((link) => {
145
- const label = ir.text.slice(link.start, link.end);
146
- const href = link.href.trim();
147
- const preserveSuffixCase = /^https?:\/\//i.test(href);
148
- return normalize(label, preserveSuffixCase) !== normalize(href.replace(/^mailto:/, ""), preserveSuffixCase);
149
- })
150
- };
151
- }
152
- function renderSignalText(ir) {
153
- const rendered = renderMarkdownWithAttributedRanges(stripEquivalentSignalLinks(ir), {
154
- styleMap: SIGNAL_STYLE_MAP,
155
- annotationStyleMap: { assistant_transcript_role: "MONOSPACE" },
156
- trimEnd: true
157
- }, SIGNAL_FORMAT_PROFILE);
158
- return {
159
- text: rendered.text,
160
- styles: rendered.ranges
161
- };
162
- }
163
- function markdownToSignalIR(markdown, options) {
164
- return markdownToIR(markdown ?? "", {
165
- assistantTranscriptRoleHeaders: true,
166
- linkify: true,
167
- enableSpoilers: true,
168
- headingStyle: "rich",
169
- blockquotePrefix: "> ",
170
- tableMode: options.tableMode
171
- });
172
- }
173
- function markdownToSignalText(markdown, options = {}) {
174
- return renderSignalText(markdownToSignalIR(markdown, options));
175
- }
176
- function markdownToSignalTextChunks(markdown, limit, options = {}) {
177
- const ir = markdownToSignalIR(markdown, options);
178
- if (ir.listItems && ir.text.length > limit) ir.listItems = ir.listItems.map((item) => ({ ...item }));
179
- return renderMarkdownIRChunksWithinLimit({
180
- ir,
181
- limit,
182
- assistantTranscriptRoleMessageBoundaries: true,
183
- renderChunk: renderSignalText,
184
- measureRendered: (rendered) => rendered.text.length
185
- }).map(({ rendered }) => rendered);
186
- }
187
- //#endregion
188
- //#region extensions/signal/src/media-text.ts
189
- function formatAttachmentKindCount(kind, count) {
190
- if (kind === "attachment") return `${count} file${count > 1 ? "s" : ""}`;
191
- return `${count} ${kind}${count > 1 ? "s" : ""}`;
192
- }
193
- /** Keeps Signal's established multi-attachment text while sharing single-item rendering. */
194
- function formatSignalMediaText(media) {
195
- if (media.length <= 1) return formatMediaPlaceholderText(media);
196
- const kindCounts = /* @__PURE__ */ new Map();
197
- for (const entry of media) {
198
- const kind = entry.kind && entry.kind !== "unknown" ? entry.kind : kindFromMime(entry.contentType) ?? "attachment";
199
- kindCounts.set(kind, (kindCounts.get(kind) ?? 0) + 1);
200
- }
201
- return `[${[...kindCounts.entries()].map(([kind, count]) => formatAttachmentKindCount(kind, count)).join(" + ")} attached]`;
202
- }
203
- //#endregion
204
- //#region extensions/signal/src/reaction-level.ts
205
- /**
206
- * Resolve the effective reaction level and its implications for Signal.
207
- *
208
- * Levels:
209
- * - "off": No reactions at all
210
- * - "ack": Only automatic ack reactions (👀 when processing), no agent reactions
211
- * - "minimal": Agent can react, but sparingly (default)
212
- * - "extensive": Agent can react liberally
213
- */
214
- function resolveSignalReactionLevel(params) {
215
- const account = resolveSignalAccount({
216
- cfg: params.cfg,
217
- accountId: params.accountId
218
- });
219
- return resolveReactionLevel({
220
- value: account.config.reactionLevel,
221
- defaultLevel: "minimal",
222
- invalidFallback: "minimal"
223
- });
224
- }
225
- //#endregion
226
- //#region extensions/signal/src/message-actions.ts
227
- const providerId = "signal";
228
- const GROUP_PREFIX = "group:";
229
- function resolveSignalReactionTarget(raw) {
230
- const withoutSignal = raw.trim().replace(/^signal:/i, "").trim();
231
- if (!withoutSignal) return {};
232
- if (normalizeLowercaseStringOrEmpty(withoutSignal).startsWith(GROUP_PREFIX)) {
233
- const groupId = withoutSignal.slice(6).trim();
234
- return groupId ? { groupId } : {};
235
- }
236
- return { recipient: normalizeSignalReactionRecipient(withoutSignal) };
237
- }
238
- async function mutateSignalReaction(params) {
239
- const options = {
240
- cfg: params.cfg,
241
- accountId: params.accountId,
242
- groupId: params.target.groupId,
243
- targetAuthor: params.targetAuthor,
244
- targetAuthorUuid: params.targetAuthorUuid,
245
- ...params.assertDirectAdapterHandoff ? { assertDirectAdapterHandoff: params.assertDirectAdapterHandoff } : {}
246
- };
247
- await (params.remove ? removeReactionSignal : sendReactionSignal)(params.target.recipient ?? "", params.timestamp, params.emoji, options);
248
- return jsonResult({
249
- ok: true,
250
- [params.remove ? "removed" : "added"]: params.emoji
251
- });
252
- }
253
- const signalMessageActions = {
254
- describeMessageTool: ({ cfg, accountId }) => {
255
- const configuredAccounts = accountId ? [resolveSignalAccount({
256
- cfg,
257
- accountId
258
- })].filter((account) => account.enabled && account.configured) : listEnabledSignalAccounts(cfg).filter((account) => account.configured);
259
- if (configuredAccounts.length === 0) return null;
260
- const actions = /* @__PURE__ */ new Set(["send"]);
261
- if (configuredAccounts.some((account) => createActionGate(account.config.actions)("reactions"))) actions.add("react");
262
- return { actions: Array.from(actions) };
263
- },
264
- supportsAction: ({ action }) => action === "react",
265
- prepareSendPayload: ({ ctx, payload, replyToId, replyToIdSource }) => {
266
- if (ctx.action !== "send") return null;
267
- const normalizedReplyToId = replyToId?.trim();
268
- if (!normalizedReplyToId) return payload;
269
- return replyToIdSource === "implicit" ? payload : {
270
- ...payload,
271
- replyToId: normalizedReplyToId
272
- };
273
- },
274
- handleAction: async ({ action, params, cfg, accountId, toolContext, assertDirectAdapterHandoff }) => {
275
- if (action === "send") throw new Error("Send should be handled by outbound, not actions handler.");
276
- if (action === "react") {
277
- const account = resolveSignalAccount({
278
- cfg,
279
- accountId
280
- });
281
- if (!account.enabled) throw new Error(`Signal account "${account.accountId}" is disabled.`);
282
- if (!account.configured) throw new Error(`Signal account "${account.accountId}" is not configured.`);
283
- const reactionLevelInfo = resolveSignalReactionLevel({
284
- cfg,
285
- accountId: account.accountId
286
- });
287
- if (!reactionLevelInfo.agentReactionsEnabled) throw new Error(`Signal agent reactions disabled (reactionLevel="${reactionLevelInfo.level}"). Set channels.signal.reactionLevel to "minimal" or "extensive" to enable.`);
288
- if (!createActionGate(account.config.actions)("reactions")) throw new Error("Signal reactions are disabled via actions.reactions.");
289
- const target = resolveSignalReactionTarget(readStringParam(params, "to", {
290
- required: true,
291
- label: "recipient (UUID, phone number, or group)"
292
- }));
293
- if (!target.recipient && !target.groupId) throw new Error("recipient or group required");
294
- const messageIdRaw = resolveReactionMessageId({
295
- args: params,
296
- toolContext
297
- });
298
- const messageId = messageIdRaw != null ? String(messageIdRaw) : void 0;
299
- if (!messageId) throw new Error("messageId (timestamp) required. Provide messageId explicitly or react to the current inbound message.");
300
- const targetAuthor = readStringParam(params, "targetAuthor");
301
- const targetAuthorUuid = readStringParam(params, "targetAuthorUuid");
302
- if (target.groupId && !targetAuthor && !targetAuthorUuid) throw new Error("targetAuthor or targetAuthorUuid required for group reactions.");
303
- const emoji = readStringParam(params, "emoji", { allowEmpty: true });
304
- const remove = typeof params.remove === "boolean" ? params.remove : void 0;
305
- const timestamp = parseStrictNonNegativeInteger(messageId);
306
- if (timestamp === void 0) throw new Error(`Invalid messageId: ${messageId}. Expected numeric timestamp.`);
307
- if (!emoji) throw new Error(`Emoji required to ${remove ? "remove" : "add"} reaction.`);
308
- return await mutateSignalReaction({
309
- cfg,
310
- accountId: account.accountId,
311
- target,
312
- timestamp,
313
- emoji,
314
- remove: Boolean(remove),
315
- targetAuthor,
316
- targetAuthorUuid,
317
- assertDirectAdapterHandoff
318
- });
319
- }
320
- throw new Error(`Action ${action} not supported for ${providerId}.`);
321
- }
322
- };
323
- //#endregion
324
- //#region extensions/signal/src/presentation-fallback.ts
325
- /** Materialize presentation content once before Signal's text-only delivery funnels. */
326
- function materializeSignalPresentationFallback(payload, presentationOverride) {
327
- const reactionPayload = questionGatewayRuntime.prepareReactionPayloadForDelivery({
328
- payload,
329
- presentation: presentationOverride ?? payload.presentation
330
- });
331
- if (reactionPayload) return reactionPayload;
332
- const presentation = presentationOverride ?? normalizeMessagePresentation(payload.presentation);
333
- if (!presentation) return payload;
334
- const currentText = payload.text?.trim() ?? "";
335
- const fallbackPresentation = Boolean(getExecApprovalReplyMetadata(payload) && currentText) ? {
336
- ...presentation,
337
- blocks: presentation.blocks.filter((block) => !isMessagePresentationInteractiveBlock(block))
338
- } : presentation;
339
- const presentationFallback = renderMessagePresentationFallbackText({ presentation: fallbackPresentation });
340
- const text = currentText.includes(presentationFallback) ? currentText : [currentText, presentationFallback].filter(Boolean).join("\n\n");
341
- const { presentation: _presentation, ...withoutPresentation } = payload;
342
- return {
343
- ...withoutPresentation,
344
- text
345
- };
346
- }
347
- //#endregion
348
- //#region extensions/signal/src/reply-authors-state.ts
349
- const signalReplyAuthorState = {
350
- memoryReplyContexts: /* @__PURE__ */ new Map(),
351
- persistentStoreDisabled: false
352
- };
353
- //#endregion
354
- //#region extensions/signal/src/runtime.ts
355
- const { setRuntime: setSignalRuntime, getRuntime: getSignalRuntime, tryGetRuntime: getOptionalSignalRuntime } = createPluginRuntimeStore({
356
- pluginId: "signal",
357
- errorMessage: "Signal runtime not initialized"
358
- });
359
- //#endregion
360
- //#region extensions/signal/src/reply-authors.ts
361
- const PERSISTENT_NAMESPACE = "signal.reply-authors.v1";
362
- const PERSISTENT_MAX_ENTRIES = 5e3;
363
- const DEFAULT_REPLY_AUTHOR_TTL_MS = 6048e5;
364
- const { memoryReplyContexts } = signalReplyAuthorState;
365
- function openSignalReplyAuthorStore() {
366
- if (signalReplyAuthorState.persistentStoreDisabled) return;
367
- const runtime = getOptionalSignalRuntime();
368
- try {
369
- return runtime?.state.openKeyedStore({
370
- namespace: PERSISTENT_NAMESPACE,
371
- maxEntries: PERSISTENT_MAX_ENTRIES,
372
- defaultTtlMs: DEFAULT_REPLY_AUTHOR_TTL_MS
373
- });
374
- } catch (error) {
375
- signalReplyAuthorState.persistentStoreDisabled = true;
376
- runtime?.logging.getChildLogger({
377
- plugin: "signal",
378
- feature: "reply-author-state"
379
- }).warn("Signal persistent reply author state unavailable", { error: String(error) });
380
- return;
381
- }
382
- }
383
- function buildSignalReplyAuthorStoreKey(params) {
384
- const conversationKey = normalizeSignalMessagingTarget(params.to);
385
- const replyToId = normalizeOptionalString(params.replyToId);
386
- if (!conversationKey || !replyToId) return;
387
- return `account=${normalizeLowercaseStringOrEmpty(normalizeOptionalString(params.accountId) ?? DEFAULT_ACCOUNT_ID)}|to=${conversationKey}|id=${replyToId}`;
388
- }
389
- function pruneMemoryReplyContexts(now = Date.now()) {
390
- for (const [key, record] of memoryReplyContexts) if (record.expiresAt <= now) memoryReplyContexts.delete(key);
391
- while (memoryReplyContexts.size > PERSISTENT_MAX_ENTRIES) {
392
- const oldestKey = memoryReplyContexts.keys().next().value;
393
- if (!oldestKey) break;
394
- memoryReplyContexts.delete(oldestKey);
395
- }
396
- }
397
- function resolveReplyContext(record) {
398
- if (!record) return;
399
- if (record.kind === "ambiguous") return { ambiguous: true };
400
- const author = normalizeOptionalString(record.author);
401
- if (!author) return;
402
- const body = normalizeOptionalString(record.body);
403
- const media = record.media;
404
- return {
405
- author,
406
- ...body ? { body } : {},
407
- ...media?.length ? { media } : {}
408
- };
409
- }
410
- function resolveSourceTimestamp(value) {
411
- return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : Date.now();
412
- }
413
- function mergeReplyContext(current, next) {
414
- if (!current) return next;
415
- if (current.kind === "ambiguous") return current;
416
- if (next.kind === "ambiguous") return next;
417
- if (current.author !== next.author) {
418
- const { author: _author, body: _body, media: _media, ...identity } = next;
419
- return {
420
- ...identity,
421
- kind: "ambiguous"
422
- };
423
- }
424
- return next.sourceTimestamp >= current.sourceTimestamp ? next : current;
425
- }
426
- async function registerSignalReplyContext(params) {
427
- const store = openSignalReplyAuthorStore();
428
- const key = buildSignalReplyAuthorStoreKey(params);
429
- const author = normalizeOptionalString(params.author);
430
- const body = normalizeOptionalString(params.body);
431
- const media = params.media?.map((entry) => ({
432
- contentType: normalizeOptionalString(entry.contentType),
433
- kind: entry.kind ?? void 0
434
- }));
435
- const conversationKey = normalizeSignalMessagingTarget(params.to);
436
- const replyToId = normalizeOptionalString(params.replyToId);
437
- const accountKey = normalizeLowercaseStringOrEmpty(normalizeOptionalString(params.accountId) ?? DEFAULT_ACCOUNT_ID);
438
- const sourceTimestamp = resolveSourceTimestamp(params.sourceTimestamp);
439
- if (!key || !author || !conversationKey || !replyToId) return;
440
- const registeredAt = Date.now();
441
- const record = {
442
- kind: "resolved",
443
- author,
444
- ...body ? { body } : {},
445
- ...media?.length ? { media } : {},
446
- accountId: accountKey,
447
- conversationKey,
448
- replyToId,
449
- sourceTimestamp,
450
- registeredAt
451
- };
452
- const expiresAt = registeredAt + DEFAULT_REPLY_AUTHOR_TTL_MS;
453
- if (!store) {
454
- const next = mergeReplyContext(memoryReplyContexts.get(key), record);
455
- memoryReplyContexts.set(key, {
456
- ...next,
457
- expiresAt
458
- });
459
- pruneMemoryReplyContexts(registeredAt);
460
- return;
461
- }
462
- const usesComparisons = Boolean(store.observe && store.compareAndApply);
463
- if (!store.update && !usesComparisons) {
464
- const next = mergeReplyContext(memoryReplyContexts.get(key), record);
465
- memoryReplyContexts.set(key, {
466
- ...next,
467
- expiresAt
468
- });
469
- pruneMemoryReplyContexts(registeredAt);
470
- signalReplyAuthorState.persistentStoreDisabled = true;
471
- getOptionalSignalRuntime()?.logging.getChildLogger({
472
- plugin: "signal",
473
- feature: "reply-author-state"
474
- }).warn("Signal persistent reply author state lacks atomic updates");
475
- return;
476
- }
477
- const cachedBeforeUpdate = memoryReplyContexts.get(key);
478
- const cacheReplyContext = (next) => {
479
- const current = memoryReplyContexts.get(key);
480
- const changedDuringUpdate = usesComparisons && current !== cachedBeforeUpdate;
481
- if (!next) {
482
- if (!changedDuringUpdate) memoryReplyContexts.delete(key);
483
- return;
484
- }
485
- const concurrent = changedDuringUpdate && current && current.expiresAt > registeredAt ? current : void 0;
486
- memoryReplyContexts.set(key, {
487
- ...concurrent ? mergeReplyContext(concurrent, next) : next,
488
- expiresAt: Math.max(expiresAt, concurrent?.expiresAt ?? expiresAt)
489
- });
490
- };
491
- let updateEvaluated = false;
492
- let nextRecord;
493
- try {
494
- let updated = false;
495
- if (store.observe && store.compareAndApply) {
496
- let observation = await store.observe(key);
497
- for (;;) {
498
- updateEvaluated = true;
499
- nextRecord = mergeReplyContext(observation.value, record);
500
- const result = await store.compareAndApply(key, observation.comparison, {
501
- operation: "update",
502
- action: "set",
503
- value: nextRecord
504
- });
505
- if (result.status !== "conflict") {
506
- updated = result.status === "applied";
507
- break;
508
- }
509
- observation = result.current;
510
- }
511
- } else if (store.update) updated = await store.update(key, (current) => {
512
- updateEvaluated = true;
513
- nextRecord = mergeReplyContext(current, record);
514
- return nextRecord;
515
- });
516
- cacheReplyContext(updated ? nextRecord : void 0);
517
- pruneMemoryReplyContexts(registeredAt);
518
- } catch (error) {
519
- if (!updateEvaluated) try {
520
- nextRecord = mergeReplyContext(await store.lookup(key), record);
521
- } catch {
522
- nextRecord = void 0;
523
- }
524
- const next = nextRecord;
525
- if (next || updateEvaluated) cacheReplyContext(next);
526
- pruneMemoryReplyContexts(registeredAt);
527
- getOptionalSignalRuntime()?.logging.getChildLogger({
528
- plugin: "signal",
529
- feature: "reply-author-state"
530
- }).warn("Signal persistent reply author state failed", { error: String(error) });
531
- }
532
- }
533
- async function resolveSignalReplyContextWithPersistence(params) {
534
- const store = openSignalReplyAuthorStore();
535
- const key = buildSignalReplyAuthorStoreKey(params);
536
- if (!key) return;
537
- if (!store) {
538
- pruneMemoryReplyContexts();
539
- return resolveReplyContext(memoryReplyContexts.get(key));
540
- }
541
- pruneMemoryReplyContexts();
542
- const memoryContext = resolveReplyContext(memoryReplyContexts.get(key));
543
- if (memoryContext) return memoryContext;
544
- try {
545
- return resolveReplyContext(await store.lookup(key));
546
- } catch (error) {
547
- getOptionalSignalRuntime()?.logging.getChildLogger({
548
- plugin: "signal",
549
- feature: "reply-author-state"
550
- }).warn("Signal persistent reply author lookup failed", { error: String(error) });
551
- return;
552
- }
553
- }
554
- //#endregion
555
- //#region extensions/signal/src/transport-detection.ts
556
- const DEFAULT_PROBE_TIMEOUT_MS = 1e4;
557
- async function detectSignalTransport(params) {
558
- const url = normalizeSignalTransportUrl(params.url);
559
- const timeoutMs = params.timeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS;
560
- const probes = params.probeNative && params.probeContainer ? void 0 : await import("./transport-probes.runtime-WprAyBbL.mjs");
561
- const probeNative = params.probeNative ?? probes?.nativeCheck;
562
- const probeContainer = params.probeContainer ?? probes?.containerCheck;
563
- if (!probeNative || !probeContainer) throw new Error("Signal transport probes are unavailable");
564
- const [native, container] = await Promise.all([probeNative(url, timeoutMs).catch(() => ({ ok: false })), probeContainer(url, timeoutMs, params.account).catch(() => ({ ok: false }))]);
565
- if (native.ok) return {
566
- kind: "external-native",
567
- url
568
- };
569
- if (container.ok) return {
570
- kind: "container",
571
- url
572
- };
573
- throw new Error(`Signal transport not reachable at ${url}`);
574
- }
575
- //#endregion
576
- export { getSignalRuntime as a, signalMessageActions as c, markdownToSignalText as d, markdownToSignalTextChunks as f, signalApprovalCapability as h, getOptionalSignalRuntime as i, resolveSignalReactionLevel as l, shouldSuppressLocalSignalExecApprovalPrompt as m, registerSignalReplyContext as n, setSignalRuntime as o, isSignalNativeApprovalHandlerConfigured as p, resolveSignalReplyContextWithPersistence as r, materializeSignalPresentationFallback as s, detectSignalTransport as t, formatSignalMediaText as u };
@@ -1,2 +0,0 @@
1
- import { t as detectSignalTransport } from "./transport-detection-CoiRl7Gx.mjs";
2
- export { detectSignalTransport };
@@ -1,2 +0,0 @@
1
- import { n as signalCheck, o as containerCheck } from "./client-BseAt7F7.mjs";
2
- export { containerCheck, signalCheck as nativeCheck };
@@ -1,20 +0,0 @@
1
- import type { BigIntStats, Stats } from "node:fs";
2
- export type DirectoryModeChecks = {
3
- check?: () => void;
4
- beforeChmod?: () => Promise<void>;
5
- };
6
- export type DirectoryModeOwner = {
7
- verify(check?: () => void): Promise<void>;
8
- apply(mode: number, checks?: DirectoryModeChecks): Promise<void>;
9
- close(): Promise<void>;
10
- };
11
- export declare function assertOwnedDirectory(expected: Stats | BigIntStats, actual: Stats | BigIntStats): void;
12
- /** Serializes use and close: even a queued path-based fd operation retains its descriptor. */
13
- export declare function ownDirectoryMode(params: {
14
- inspect: () => Promise<number>;
15
- chmod: (mode: number) => Promise<void>;
16
- prepareChmod?: () => Promise<void>;
17
- verifyChmod?: () => Promise<void>;
18
- close: () => Promise<void>;
19
- ignoreChmodError?: boolean;
20
- }): DirectoryModeOwner;
@@ -1,78 +0,0 @@
1
- import { FsSafeError } from "./errors.js";
2
- import { sameFileIdentityForCleanup } from "./file-identity.js";
3
- export function assertOwnedDirectory(expected, actual) {
4
- if (actual.isSymbolicLink() || !actual.isDirectory()) {
5
- throw new FsSafeError("not-file", "directory mode target must be a real directory");
6
- }
7
- if (!sameFileIdentityForCleanup(expected, actual)) {
8
- throw new FsSafeError("path-mismatch", "directory changed before its mode could be applied");
9
- }
10
- }
11
- /** Serializes use and close: even a queued path-based fd operation retains its descriptor. */
12
- export function ownDirectoryMode(params) {
13
- let pending = Promise.resolve();
14
- let closing;
15
- const enqueue = (run) => {
16
- if (closing)
17
- return Promise.reject(new FsSafeError("path-mismatch", "directory mode owner is closed"));
18
- const operation = pending.then(run);
19
- pending = operation.catch(() => undefined);
20
- return operation;
21
- };
22
- return {
23
- verify: (check) => enqueue(async () => {
24
- check?.();
25
- await params.inspect();
26
- check?.();
27
- }),
28
- apply: (mode, checks = {}) => enqueue(async () => {
29
- // inspect() reports permission bits only; chmod ignores file-type bits,
30
- // so tolerate raw stat modes (e.g. S_IFDIR | 0o755) by masking up front.
31
- mode &= 0o7777;
32
- checks.check?.();
33
- const currentMode = await params.inspect();
34
- checks.check?.();
35
- if (currentMode === mode && !checks.beforeChmod && !checks.check)
36
- return;
37
- if (currentMode !== mode) {
38
- await params.prepareChmod?.();
39
- checks.check?.();
40
- }
41
- await checks.beforeChmod?.();
42
- checks.check?.();
43
- // Hooks/ancestor checks can yield; recheck the original named association.
44
- await params.inspect();
45
- checks.check?.();
46
- let dispatchDeadlineFailure;
47
- if (currentMode !== mode) {
48
- checks.check?.();
49
- try {
50
- await params.chmod(mode);
51
- }
52
- catch (error) {
53
- if (!params.ignoreChmodError)
54
- throw error;
55
- }
56
- // Expiry cannot release the fd while post-dispatch verification is pending.
57
- try {
58
- checks.check?.();
59
- }
60
- catch (error) {
61
- dispatchDeadlineFailure = { error };
62
- }
63
- await params.verifyChmod?.();
64
- }
65
- const finalMode = await params.inspect();
66
- if (dispatchDeadlineFailure)
67
- throw dispatchDeadlineFailure.error;
68
- checks.check?.();
69
- if (!params.ignoreChmodError && finalMode !== mode) {
70
- throw new FsSafeError("path-mismatch", "directory final mode could not be verified");
71
- }
72
- }),
73
- close() {
74
- closing ??= pending.then(params.close);
75
- return closing;
76
- },
77
- };
78
- }