@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,12 +1,14 @@
1
+ import { a as migrateLegacySignalTransportConfig, i as clearLegacySignalTransportFieldsForAccount, n as normalizeCompatibilityConfig, r as repairSignalAccountKeys } from "./doctor-contract-api-Db9V9gsY.mjs";
1
2
  import { a as normalizeSignalTransportUrl, i as normalizeSignalTransportHost, o as resolveSignalAccountEntry, s as resolveSignalAccountKey, t as assertSignalSocketTransport } from "./transport-url-CAC0JcuI.mjs";
2
- import { a as isSignalManagedNativeConnectionUrlForBind, i as assignSignalManagedNativePort, o as isValidSignalManagedNativePort, r as allocateSignalManagedNativePort, s as resolveLocalSignalTransportPort } from "./transport-policy-5VSnj5ma.mjs";
3
- import { a as resolveSignalAccountConfig, i as resolveSignalAccount, n as listSignalAccountIds, o as resolveSignalReplyToMode, r as resolveDefaultSignalAccountId, s as resolveSignalTransport } from "./accounts-BV6tDOTc.mjs";
4
- import { n as normalizeSignalMessagingTarget, t as looksLikeSignalTargetId } from "./normalize-l_b99hap.mjs";
5
- import { a as resolveSignalTarget, r as listSignalAliasDirectoryEntries } from "./approval-auth-BBI9BTRm.mjs";
6
- import { c as resolveSignalSender, l as looksLikeUuid, o as resolveSignalPeerId, s as resolveSignalRecipient } from "./identity-YXPmgFMu.mjs";
7
- import { c as signalMessageActions, f as markdownToSignalTextChunks, h as signalApprovalCapability, l as resolveSignalReactionLevel, m as shouldSuppressLocalSignalExecApprovalPrompt, r as resolveSignalReplyContextWithPersistence, s as materializeSignalPresentationFallback, t as detectSignalTransport, u as formatSignalMediaText } from "./transport-detection-CoiRl7Gx.mjs";
8
- import { a as migrateLegacySignalTransportConfig, i as clearLegacySignalTransportFieldsForAccount, n as normalizeCompatibilityConfig, r as repairSignalAccountKeys } from "./doctor-contract-api-Rbq_sRTI.mjs";
9
- import { t as SignalChannelConfigSchema } from "./config-schema-aQwwMGUj.mjs";
3
+ import { a as isSignalManagedNativeConnectionUrlForBind, c as resolveLocalSignalTransportPort, i as assignSignalManagedNativePort, o as isValidSignalManagedNativePort, r as allocateSignalManagedNativePort, s as reserveSignalTransportPorts } from "./transport-policy-B6C_LogW.mjs";
4
+ import { a as resolveSignalAccountConfig, i as resolveSignalAccount, n as listSignalAccountIds, o as resolveSignalReplyToMode, r as resolveDefaultSignalAccountId, s as resolveSignalTransport, t as listEnabledSignalAccounts } from "./accounts-DMtj2E-4.mjs";
5
+ import { n as normalizeSignalMessagingTarget, r as normalizeSignalReactionRecipient, t as looksLikeSignalTargetId } from "./normalize-l_b99hap.mjs";
6
+ import { a as resolveSignalTarget, n as signalApprovalAuth, r as listSignalAliasDirectoryEntries, t as getSignalApprovalApprovers } from "./approval-auth-CszS7gwf.mjs";
7
+ import { c as resolveSignalSender, l as looksLikeUuid, o as resolveSignalPeerId, s as resolveSignalRecipient } from "./identity-B3JyPqGO.mjs";
8
+ import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-DDi5x2wC.mjs";
9
+ import { t as getOptionalSignalRuntime } from "./runtime-8sxUF217.mjs";
10
+ import { t as detectSignalTransport } from "./transport-detection-BVUDE42e.mjs";
11
+ import { t as SignalChannelConfigSchema } from "./config-schema-DvxZ18SD.mjs";
10
12
  import { describeAccountSnapshot, resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/account-helpers";
11
13
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
12
14
  import { buildDmGroupAccountAllowlistAdapter } from "openclaw/plugin-sdk/allowlist-config-edit";
@@ -19,14 +21,24 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
19
21
  import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
20
22
  import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
21
23
  import { chunkText, resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-chunking";
22
- import { buildOutboundBaseSessionKey } from "openclaw/plugin-sdk/routing";
23
- import { buildBaseChannelStatusSummary, collectStatusIssuesFromLastError, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
24
+ import { buildOutboundBaseSessionKey, parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
25
+ import { buildBaseChannelStatusSummary, collectStatusIssuesFromLastError, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState, resolveReactionLevel } from "openclaw/plugin-sdk/status-helpers";
24
26
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
25
- import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
27
+ import { FormatCapabilityProfile, markdownToIR, renderMarkdownIRChunksWithinLimit, renderMarkdownWithAttributedRanges, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
26
28
  import { normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/account-resolution";
29
+ import { createApproverRestrictedNativeApprovalCapabilityFromForwardingRoutes } from "openclaw/plugin-sdk/approval-delivery-runtime";
30
+ import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
31
+ import { shouldSuppressLocalNativeExecApprovalPrompt } from "openclaw/plugin-sdk/approval-native-runtime";
32
+ import { buildApprovalReactionPendingContentForRequest } from "openclaw/plugin-sdk/approval-reaction-runtime";
27
33
  import { normalizeE164 } from "openclaw/plugin-sdk/text-utility-runtime";
34
+ import { formatMediaPlaceholderText } from "openclaw/plugin-sdk/channel-inbound";
35
+ import { kindFromMime } from "openclaw/plugin-sdk/media-runtime";
36
+ import { createActionGate, jsonResult, readStringParam, resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
37
+ import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
28
38
  import { createChannelPluginBase, getChatChannelMeta } from "openclaw/plugin-sdk/core";
29
39
  import { parseAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
40
+ import { getExecApprovalReplyMetadata } from "openclaw/plugin-sdk/approval-reply-runtime";
41
+ import { isMessagePresentationInteractiveBlock, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
30
42
  import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
31
43
  import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
32
44
  import { patchTopLevelChannelConfigSection } from "openclaw/plugin-sdk/setup";
@@ -34,6 +46,282 @@ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, createCliPathTextInput, cre
34
46
  import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
35
47
  import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
36
48
  import { createRestrictSendersChannelSecurity } from "openclaw/plugin-sdk/channel-policy";
49
+ //#region extensions/signal/src/approval-native.ts
50
+ function isSignalApprovalTransportEnabled(params) {
51
+ return resolveSignalAccount({
52
+ cfg: params.cfg,
53
+ accountId: params.accountId
54
+ }).enabled;
55
+ }
56
+ const signalApproval = createApproverRestrictedNativeApprovalCapabilityFromForwardingRoutes({
57
+ channel: "signal",
58
+ channelLabel: "Signal",
59
+ authorizeActorAction: (params) => signalApprovalAuth.authorizeActorAction(params),
60
+ routing: {
61
+ defaultForwardingMode: "session",
62
+ isTransportEnabled: isSignalApprovalTransportEnabled,
63
+ listAccountIds: listSignalAccountIds,
64
+ resolveDefaultAccountId: resolveDefaultSignalAccountId,
65
+ normalizeTo: normalizeSignalMessagingTarget,
66
+ resolveApprovers: getSignalApprovalApprovers,
67
+ suppressExplicitTargetFallback: false,
68
+ isOriginTargetAllowed: ({ cfg, accountId, target }) => !isSignalGroupTarget(target.to) || getSignalApprovalApprovers({
69
+ cfg,
70
+ accountId
71
+ }).length > 0
72
+ },
73
+ describeExecApprovalSetup: ({ accountId }) => {
74
+ 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.`;
75
+ },
76
+ render: {
77
+ exec: { buildPendingPayload: ({ request, nowMs }) => buildApprovalReactionPendingContentForRequest({
78
+ request,
79
+ nowMs
80
+ }).manualFallbackPayload },
81
+ plugin: { buildPendingPayload: ({ request, nowMs }) => buildApprovalReactionPendingContentForRequest({
82
+ request,
83
+ nowMs
84
+ }).manualFallbackPayload }
85
+ },
86
+ createNativeRuntime: (routing) => createLazyChannelApprovalNativeRuntimeAdapter({
87
+ capabilityBoundary: true,
88
+ eventKinds: [
89
+ "exec",
90
+ "plugin",
91
+ "system-agent"
92
+ ],
93
+ isConfigured: ({ cfg, accountId, context }) => Boolean(context) && routing.isNativeApprovalHandlerConfigured({
94
+ cfg,
95
+ accountId
96
+ }),
97
+ shouldHandle: ({ cfg, accountId, context, approvalKind, request }) => Boolean(context) && routing.shouldHandleApprovalRequest({
98
+ cfg,
99
+ accountId,
100
+ approvalKind,
101
+ request
102
+ }),
103
+ load: async () => (await import("./approval-handler.runtime-D9ofZcZW.mjs")).signalApprovalNativeRuntime
104
+ })
105
+ });
106
+ const signalApprovalRouting = signalApproval.routing;
107
+ function isSignalNativeApprovalHandlerConfigured(params) {
108
+ return signalApprovalRouting.isNativeApprovalHandlerConfigured(params);
109
+ }
110
+ function resolveSignalSessionTargetFromSessionKey(sessionKey) {
111
+ const rest = parseAgentSessionKey(sessionKey)?.rest ?? normalizeOptionalString(sessionKey);
112
+ if (!rest || !normalizeLowercaseStringOrEmpty(rest).startsWith("signal:")) return null;
113
+ return normalizeSignalMessagingTarget(rest.slice(7)) ?? null;
114
+ }
115
+ function shouldSuppressLocalSignalExecApprovalPrompt(params) {
116
+ return shouldSuppressLocalNativeExecApprovalPrompt({
117
+ ...params,
118
+ isTransportEnabled: isSignalApprovalTransportEnabled,
119
+ isSessionRouteEligible: ({ cfg, accountId, metadata }) => {
120
+ if (getSignalApprovalApprovers({
121
+ cfg,
122
+ accountId
123
+ }).length > 0) return true;
124
+ const sessionTarget = resolveSignalSessionTargetFromSessionKey(metadata.sessionKey);
125
+ return Boolean(sessionTarget && !isSignalGroupTarget(sessionTarget));
126
+ }
127
+ });
128
+ }
129
+ function isSignalGroupTarget(to) {
130
+ return normalizeLowercaseStringOrEmpty(to).startsWith("group:");
131
+ }
132
+ const signalApprovalCapability = signalApproval.capability;
133
+ //#endregion
134
+ //#region extensions/signal/src/format.ts
135
+ const SIGNAL_STYLE_MAP = {
136
+ bold: "BOLD",
137
+ italic: "ITALIC",
138
+ strikethrough: "STRIKETHROUGH",
139
+ code: "MONOSPACE",
140
+ code_block: "MONOSPACE",
141
+ spoiler: "SPOILER"
142
+ };
143
+ const SIGNAL_FORMAT_PROFILE = FormatCapabilityProfile.define({
144
+ mechanism: "ranges",
145
+ constructs: {
146
+ underline: "strip",
147
+ codeLanguage: "fallback",
148
+ linkLabel: "fallback",
149
+ heading: "fallback",
150
+ bulletList: "fallback",
151
+ orderedList: "fallback",
152
+ taskList: "fallback",
153
+ table: "fallback",
154
+ blockquote: "fallback",
155
+ image: "fallback",
156
+ mention: "strip"
157
+ },
158
+ chunk: {
159
+ limit: 4e3,
160
+ unit: "chars"
161
+ }
162
+ });
163
+ function stripEquivalentSignalLinks(ir) {
164
+ const normalize = (value, preserveSuffixCase) => {
165
+ const normalized = value.trim().replace(/^(?:https?:\/\/)?(?:www\.)?/i, "").replace(/\/+$/, "");
166
+ return preserveSuffixCase ? normalized.replace(/^[^/?#]+/, (host) => host.toLowerCase()) : normalizeLowercaseStringOrEmpty(normalized);
167
+ };
168
+ return {
169
+ ...ir,
170
+ links: ir.links.filter((link) => {
171
+ const label = ir.text.slice(link.start, link.end);
172
+ const href = link.href.trim();
173
+ const preserveSuffixCase = /^https?:\/\//i.test(href);
174
+ return normalize(label, preserveSuffixCase) !== normalize(href.replace(/^mailto:/, ""), preserveSuffixCase);
175
+ })
176
+ };
177
+ }
178
+ function renderSignalText(ir) {
179
+ const rendered = renderMarkdownWithAttributedRanges(stripEquivalentSignalLinks(ir), {
180
+ styleMap: SIGNAL_STYLE_MAP,
181
+ annotationStyleMap: { assistant_transcript_role: "MONOSPACE" },
182
+ trimEnd: true
183
+ }, SIGNAL_FORMAT_PROFILE);
184
+ return {
185
+ text: rendered.text,
186
+ styles: rendered.ranges
187
+ };
188
+ }
189
+ function markdownToSignalIR(markdown, options) {
190
+ return markdownToIR(markdown ?? "", {
191
+ assistantTranscriptRoleHeaders: true,
192
+ linkify: true,
193
+ enableSpoilers: true,
194
+ headingStyle: "rich",
195
+ blockquotePrefix: "> ",
196
+ tableMode: options.tableMode
197
+ });
198
+ }
199
+ function markdownToSignalText(markdown, options = {}) {
200
+ return renderSignalText(markdownToSignalIR(markdown, options));
201
+ }
202
+ function markdownToSignalTextChunks(markdown, limit, options = {}) {
203
+ const ir = markdownToSignalIR(markdown, options);
204
+ if (ir.listItems && ir.text.length > limit) ir.listItems = ir.listItems.map((item) => ({ ...item }));
205
+ return renderMarkdownIRChunksWithinLimit({
206
+ ir,
207
+ limit,
208
+ assistantTranscriptRoleMessageBoundaries: true,
209
+ renderChunk: renderSignalText,
210
+ measureRendered: (rendered) => rendered.text.length
211
+ }).map(({ rendered }) => rendered);
212
+ }
213
+ //#endregion
214
+ //#region extensions/signal/src/media-text.ts
215
+ function formatAttachmentKindCount(kind, count) {
216
+ if (kind === "attachment") return `${count} file${count > 1 ? "s" : ""}`;
217
+ return `${count} ${kind}${count > 1 ? "s" : ""}`;
218
+ }
219
+ /** Keeps Signal's established multi-attachment text while sharing single-item rendering. */
220
+ function formatSignalMediaText(media) {
221
+ if (media.length <= 1) return formatMediaPlaceholderText(media);
222
+ const kindCounts = /* @__PURE__ */ new Map();
223
+ for (const entry of media) {
224
+ const kind = entry.kind && entry.kind !== "unknown" ? entry.kind : kindFromMime(entry.contentType) ?? "attachment";
225
+ kindCounts.set(kind, (kindCounts.get(kind) ?? 0) + 1);
226
+ }
227
+ return `[${[...kindCounts.entries()].map(([kind, count]) => formatAttachmentKindCount(kind, count)).join(" + ")} attached]`;
228
+ }
229
+ //#endregion
230
+ //#region extensions/signal/src/reaction-level.ts
231
+ function resolveSignalReactionLevel(params) {
232
+ const account = resolveSignalAccount({
233
+ cfg: params.cfg,
234
+ accountId: params.accountId
235
+ });
236
+ return resolveReactionLevel({
237
+ value: account.config.reactionLevel,
238
+ defaultLevel: "minimal",
239
+ invalidFallback: "minimal"
240
+ });
241
+ }
242
+ //#endregion
243
+ //#region extensions/signal/src/message-actions.ts
244
+ const providerId = "signal";
245
+ const GROUP_PREFIX = "group:";
246
+ function resolveSignalReactionTarget(raw) {
247
+ const withoutSignal = raw.trim().replace(/^signal:/i, "").trim();
248
+ if (!withoutSignal) return {};
249
+ if (normalizeLowercaseStringOrEmpty(withoutSignal).startsWith(GROUP_PREFIX)) {
250
+ const groupId = withoutSignal.slice(6).trim();
251
+ return groupId ? { groupId } : {};
252
+ }
253
+ return { recipient: normalizeSignalReactionRecipient(withoutSignal) };
254
+ }
255
+ const signalMessageActions = {
256
+ describeMessageTool: ({ cfg, accountId }) => {
257
+ const configuredAccounts = accountId ? [resolveSignalAccount({
258
+ cfg,
259
+ accountId
260
+ })].filter((account) => account.enabled && account.configured) : listEnabledSignalAccounts(cfg).filter((account) => account.configured);
261
+ if (configuredAccounts.length === 0) return null;
262
+ return { actions: configuredAccounts.some((account) => createActionGate(account.config.actions)("reactions")) ? ["send", "react"] : ["send"] };
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
+ await (remove ? removeReactionSignal : sendReactionSignal)(target.recipient ?? "", timestamp, emoji, {
309
+ cfg,
310
+ accountId: account.accountId,
311
+ groupId: target.groupId,
312
+ targetAuthor,
313
+ targetAuthorUuid,
314
+ ...assertDirectAdapterHandoff ? { assertDirectAdapterHandoff } : {}
315
+ });
316
+ return jsonResult({
317
+ ok: true,
318
+ [remove ? "removed" : "added"]: emoji
319
+ });
320
+ }
321
+ throw new Error(`Action ${action} not supported for ${providerId}.`);
322
+ }
323
+ };
324
+ //#endregion
37
325
  //#region extensions/signal/src/outbound-session.ts
38
326
  function resolveSignalOutboundTarget(target) {
39
327
  const normalized = normalizeSignalMessagingTarget(target);
@@ -79,6 +367,219 @@ function resolveSignalOutboundTarget(target) {
79
367
  };
80
368
  }
81
369
  //#endregion
370
+ //#region extensions/signal/src/presentation-fallback.ts
371
+ /** Materialize presentation content once before Signal's text-only delivery funnels. */
372
+ function materializeSignalPresentationFallback(payload, presentationOverride) {
373
+ const reactionPayload = questionGatewayRuntime.prepareReactionPayloadForDelivery({
374
+ payload,
375
+ presentation: presentationOverride ?? payload.presentation
376
+ });
377
+ if (reactionPayload) return reactionPayload;
378
+ const presentation = presentationOverride ?? normalizeMessagePresentation(payload.presentation);
379
+ if (!presentation) return payload;
380
+ const currentText = payload.text?.trim() ?? "";
381
+ const fallbackPresentation = Boolean(getExecApprovalReplyMetadata(payload) && currentText) ? {
382
+ ...presentation,
383
+ blocks: presentation.blocks.filter((block) => !isMessagePresentationInteractiveBlock(block))
384
+ } : presentation;
385
+ const presentationFallback = renderMessagePresentationFallbackText({ presentation: fallbackPresentation });
386
+ const text = currentText.includes(presentationFallback) ? currentText : [currentText, presentationFallback].filter(Boolean).join("\n\n");
387
+ const { presentation: _presentation, ...withoutPresentation } = payload;
388
+ return {
389
+ ...withoutPresentation,
390
+ text
391
+ };
392
+ }
393
+ //#endregion
394
+ //#region extensions/signal/src/reply-authors-state.ts
395
+ const signalReplyAuthorState = {
396
+ memoryReplyContexts: /* @__PURE__ */ new Map(),
397
+ persistentStoreDisabled: false
398
+ };
399
+ //#endregion
400
+ //#region extensions/signal/src/reply-authors.ts
401
+ const PERSISTENT_NAMESPACE = "signal.reply-authors.v1";
402
+ const PERSISTENT_MAX_ENTRIES = 5e3;
403
+ const DEFAULT_REPLY_AUTHOR_TTL_MS = 6048e5;
404
+ const { memoryReplyContexts } = signalReplyAuthorState;
405
+ function openSignalReplyAuthorStore() {
406
+ if (signalReplyAuthorState.persistentStoreDisabled) return;
407
+ const runtime = getOptionalSignalRuntime();
408
+ try {
409
+ return runtime?.state.openKeyedStore({
410
+ namespace: PERSISTENT_NAMESPACE,
411
+ maxEntries: PERSISTENT_MAX_ENTRIES,
412
+ defaultTtlMs: DEFAULT_REPLY_AUTHOR_TTL_MS
413
+ });
414
+ } catch (error) {
415
+ signalReplyAuthorState.persistentStoreDisabled = true;
416
+ runtime?.logging.getChildLogger({
417
+ plugin: "signal",
418
+ feature: "reply-author-state"
419
+ }).warn("Signal persistent reply author state unavailable", { error: String(error) });
420
+ return;
421
+ }
422
+ }
423
+ function buildSignalReplyAuthorStoreKey(params) {
424
+ const conversationKey = normalizeSignalMessagingTarget(params.to);
425
+ const replyToId = normalizeOptionalString(params.replyToId);
426
+ if (!conversationKey || !replyToId) return;
427
+ return `account=${normalizeLowercaseStringOrEmpty(normalizeOptionalString(params.accountId) ?? DEFAULT_ACCOUNT_ID)}|to=${conversationKey}|id=${replyToId}`;
428
+ }
429
+ function pruneMemoryReplyContexts(now = Date.now()) {
430
+ for (const [key, record] of memoryReplyContexts) if (record.expiresAt <= now) memoryReplyContexts.delete(key);
431
+ while (memoryReplyContexts.size > PERSISTENT_MAX_ENTRIES) {
432
+ const oldestKey = memoryReplyContexts.keys().next().value;
433
+ if (!oldestKey) break;
434
+ memoryReplyContexts.delete(oldestKey);
435
+ }
436
+ }
437
+ function resolveReplyContext(record) {
438
+ if (!record) return;
439
+ if (record.kind === "ambiguous") return { ambiguous: true };
440
+ const author = normalizeOptionalString(record.author);
441
+ if (!author) return;
442
+ const body = normalizeOptionalString(record.body);
443
+ const media = record.media;
444
+ return {
445
+ author,
446
+ ...body ? { body } : {},
447
+ ...media?.length ? { media } : {}
448
+ };
449
+ }
450
+ function resolveSourceTimestamp(value) {
451
+ return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : Date.now();
452
+ }
453
+ function mergeReplyContext(current, next) {
454
+ if (!current) return next;
455
+ if (current.kind === "ambiguous") return current;
456
+ if (next.kind === "ambiguous") return next;
457
+ if (current.author !== next.author) {
458
+ const { author: _author, body: _body, media: _media, ...identity } = next;
459
+ return {
460
+ ...identity,
461
+ kind: "ambiguous"
462
+ };
463
+ }
464
+ return next.sourceTimestamp >= current.sourceTimestamp ? next : current;
465
+ }
466
+ async function registerSignalReplyContext(params) {
467
+ const store = openSignalReplyAuthorStore();
468
+ const key = buildSignalReplyAuthorStoreKey(params);
469
+ const author = normalizeOptionalString(params.author);
470
+ const body = normalizeOptionalString(params.body);
471
+ const media = params.media?.map((entry) => ({
472
+ contentType: normalizeOptionalString(entry.contentType),
473
+ kind: entry.kind ?? void 0
474
+ }));
475
+ const conversationKey = normalizeSignalMessagingTarget(params.to);
476
+ const replyToId = normalizeOptionalString(params.replyToId);
477
+ const accountKey = normalizeLowercaseStringOrEmpty(normalizeOptionalString(params.accountId) ?? DEFAULT_ACCOUNT_ID);
478
+ const sourceTimestamp = resolveSourceTimestamp(params.sourceTimestamp);
479
+ if (!key || !author || !conversationKey || !replyToId) return;
480
+ const registeredAt = Date.now();
481
+ const record = {
482
+ kind: "resolved",
483
+ author,
484
+ ...body ? { body } : {},
485
+ ...media?.length ? { media } : {},
486
+ accountId: accountKey,
487
+ conversationKey,
488
+ replyToId,
489
+ sourceTimestamp,
490
+ registeredAt
491
+ };
492
+ const expiresAt = registeredAt + DEFAULT_REPLY_AUTHOR_TTL_MS;
493
+ const usesComparisons = Boolean(store?.observe && store.compareAndApply);
494
+ if (!store || !store.update && !usesComparisons) {
495
+ const next = mergeReplyContext(memoryReplyContexts.get(key), record);
496
+ memoryReplyContexts.set(key, {
497
+ ...next,
498
+ expiresAt
499
+ });
500
+ pruneMemoryReplyContexts(registeredAt);
501
+ if (store) {
502
+ signalReplyAuthorState.persistentStoreDisabled = true;
503
+ getOptionalSignalRuntime()?.logging.getChildLogger({
504
+ plugin: "signal",
505
+ feature: "reply-author-state"
506
+ }).warn("Signal persistent reply author state lacks atomic updates");
507
+ }
508
+ return;
509
+ }
510
+ const cachedBeforeUpdate = memoryReplyContexts.get(key);
511
+ const cacheReplyContext = (next) => {
512
+ const current = memoryReplyContexts.get(key);
513
+ const changedDuringUpdate = usesComparisons && current !== cachedBeforeUpdate;
514
+ if (!next) {
515
+ if (!changedDuringUpdate) memoryReplyContexts.delete(key);
516
+ return;
517
+ }
518
+ const concurrent = changedDuringUpdate && current && current.expiresAt > registeredAt ? current : void 0;
519
+ memoryReplyContexts.set(key, {
520
+ ...concurrent ? mergeReplyContext(concurrent, next) : next,
521
+ expiresAt: Math.max(expiresAt, concurrent?.expiresAt ?? expiresAt)
522
+ });
523
+ };
524
+ let updateEvaluated = false;
525
+ let nextRecord;
526
+ try {
527
+ let updated = false;
528
+ if (store.observe && store.compareAndApply) {
529
+ let observation = await store.observe(key);
530
+ for (;;) {
531
+ updateEvaluated = true;
532
+ nextRecord = mergeReplyContext(observation.value, record);
533
+ const result = await store.compareAndApply(key, observation.comparison, {
534
+ operation: "update",
535
+ action: "set",
536
+ value: nextRecord
537
+ });
538
+ if (result.status !== "conflict") {
539
+ updated = result.status === "applied";
540
+ break;
541
+ }
542
+ observation = result.current;
543
+ }
544
+ } else if (store.update) updated = await store.update(key, (current) => {
545
+ updateEvaluated = true;
546
+ nextRecord = mergeReplyContext(current, record);
547
+ return nextRecord;
548
+ });
549
+ cacheReplyContext(updated ? nextRecord : void 0);
550
+ pruneMemoryReplyContexts(registeredAt);
551
+ } catch (error) {
552
+ if (!updateEvaluated) try {
553
+ nextRecord = mergeReplyContext(await store.lookup(key), record);
554
+ } catch {
555
+ nextRecord = void 0;
556
+ }
557
+ if (nextRecord || updateEvaluated) cacheReplyContext(nextRecord);
558
+ pruneMemoryReplyContexts(registeredAt);
559
+ getOptionalSignalRuntime()?.logging.getChildLogger({
560
+ plugin: "signal",
561
+ feature: "reply-author-state"
562
+ }).warn("Signal persistent reply author state failed", { error: String(error) });
563
+ }
564
+ }
565
+ async function resolveSignalReplyContextWithPersistence(params) {
566
+ const store = openSignalReplyAuthorStore();
567
+ const key = buildSignalReplyAuthorStoreKey(params);
568
+ if (!key) return;
569
+ pruneMemoryReplyContexts();
570
+ const memoryContext = resolveReplyContext(memoryReplyContexts.get(key));
571
+ if (!store || memoryContext) return memoryContext;
572
+ try {
573
+ return resolveReplyContext(await store.lookup(key));
574
+ } catch (error) {
575
+ getOptionalSignalRuntime()?.logging.getChildLogger({
576
+ plugin: "signal",
577
+ feature: "reply-author-state"
578
+ }).warn("Signal persistent reply author lookup failed", { error: String(error) });
579
+ return;
580
+ }
581
+ }
582
+ //#endregion
82
583
  //#region extensions/signal/src/setup-transport.ts
83
584
  function managedTransportOptions(transport) {
84
585
  const { kind: _kind, ...options } = transport;
@@ -173,23 +674,7 @@ function prepareSignalManagedNativeTransport(params) {
173
674
  if (!normalizeOptionalString(accountConfig.account) && !accountConfig.transport) continue;
174
675
  const accountPorts = portsByAccountId.get(normalizedAccountId) ?? /* @__PURE__ */ new Set();
175
676
  portsByAccountId.set(normalizedAccountId, accountPorts);
176
- const transport = accountConfig.transport;
177
- if (transport?.kind === "managed-native") {
178
- if (transport.socketPath !== void 0) continue;
179
- if (transport.httpPort !== void 0) accountPorts.add(transport.httpPort);
180
- else implicitManagedAccountIds.push(normalizedAccountId);
181
- if (transport.url && !isSignalManagedNativeConnectionUrlForBind(transport)) {
182
- const localConnectionPort = resolveLocalSignalTransportPort(transport.url);
183
- if (localConnectionPort !== void 0) accountPorts.add(localConnectionPort);
184
- }
185
- continue;
186
- }
187
- if (transport?.kind === "external-native" || transport?.kind === "container") {
188
- const localPort = resolveLocalSignalTransportPort(transport.url);
189
- if (localPort !== void 0) accountPorts.add(localPort);
190
- continue;
191
- }
192
- implicitManagedAccountIds.push(normalizedAccountId);
677
+ if (reserveSignalTransportPorts(accountConfig.transport, accountPorts)) implicitManagedAccountIds.push(normalizedAccountId);
193
678
  }
194
679
  const currentReservedPorts = /* @__PURE__ */ new Set();
195
680
  for (const accountPorts of portsByAccountId.values()) for (const httpPort of accountPorts) currentReservedPorts.add(httpPort);
@@ -229,8 +714,8 @@ async function probeSignalTransport(params) {
229
714
  overrides: managedTransportOptions(params.transport)
230
715
  }) : params.transport;
231
716
  const resolved = resolveSignalTransport(transport);
232
- if (resolved.kind === "container") return (params.probeContainer ?? (await import("./transport-probes.runtime-WprAyBbL.mjs")).containerCheck)(resolved.baseUrl, timeoutMs, params.account);
233
- return (params.probeNative ?? (await import("./transport-probes.runtime-WprAyBbL.mjs")).nativeCheck)(resolved.baseUrl, timeoutMs);
717
+ if (resolved.kind === "container") return (params.probeContainer ?? (await import("./transport-probes.runtime-DwXEHnXr.mjs")).containerCheck)(resolved.baseUrl, timeoutMs, params.account);
718
+ return (params.probeNative ?? (await import("./transport-probes.runtime-DwXEHnXr.mjs")).nativeCheck)(resolved.baseUrl, timeoutMs);
234
719
  }
235
720
  function writeSignalAccountTransport(params) {
236
721
  const transport = normalizeTransport(params.transport);
@@ -347,9 +832,7 @@ function buildSignalSetupPatch(input) {
347
832
  url: normalizeSignalTransportUrl(input.httpUrl)
348
833
  } : input.cliPath || input.httpHost || input.httpPort ? {
349
834
  kind: "managed-native",
350
- ...input.cliPath ? { cliPath: input.cliPath } : {},
351
- ...input.httpHost ? { httpHost: input.httpHost } : {},
352
- ...input.httpPort ? { httpPort: Number(input.httpPort) } : {}
835
+ ...managedTransportOverridesFromSetupInput(input)
353
836
  } : void 0;
354
837
  return {
355
838
  ...account ? { account } : {},
@@ -442,11 +925,7 @@ function createSignalCliPathTextInput(shouldPrompt) {
442
925
  return createCliPathTextInput({
443
926
  inputKey: "cliPath",
444
927
  message: "signal-cli path",
445
- resolvePath: ({ cfg, accountId, credentialValues }) => resolveSignalCliPath({
446
- cfg,
447
- accountId,
448
- credentialValues
449
- }),
928
+ resolvePath: resolveSignalCliPath,
450
929
  shouldPrompt
451
930
  });
452
931
  }
@@ -489,7 +968,7 @@ const signalSetupAdapterBase = createPatchedAccountSetupAdapter({
489
968
  if (!input.signalNumber && !input.httpUrl && !input.httpHost && !input.httpPort && !input.cliPath) return "Signal requires --signal-number or --http-url/--http-host/--http-port/--cli-path.";
490
969
  return null;
491
970
  } }),
492
- buildPatch: (input) => buildSignalSetupPatch(input)
971
+ buildPatch: buildSignalSetupPatch
493
972
  });
494
973
  function restorePromotedSignalDefaultAccount(cfg) {
495
974
  const signal = cfg.channels?.signal;
@@ -512,11 +991,7 @@ function restorePromotedSignalDefaultAccount(cfg) {
512
991
  const signalSetupAdapter = {
513
992
  ...signalSetupAdapterBase,
514
993
  namedAccountPromotionKeys: [],
515
- prepareAccountConfigInput: ({ cfg, accountId, input }) => prepareSignalSetupInput({
516
- cfg,
517
- accountId,
518
- input
519
- }),
994
+ prepareAccountConfigInput: prepareSignalSetupInput,
520
995
  singleAccountKeysToMove: [
521
996
  "signalNumber",
522
997
  "account",
@@ -586,7 +1061,7 @@ function createSignalSetupWizardProxy(loadWizard) {
586
1061
  const signalDoctor = {
587
1062
  normalizeCompatibilityConfig,
588
1063
  cleanStaleConfig: async ({ cfg }) => {
589
- const { detectSignalTransport } = await import("./transport-detection.runtime-Tlhuv3T_.mjs");
1064
+ const { detectSignalTransport } = await import("./transport-detection-BVUDE42e.mjs").then((n) => n.n);
590
1065
  const transport = await migrateLegacySignalTransportConfig({
591
1066
  cfg,
592
1067
  detect: detectSignalTransport
@@ -600,16 +1075,13 @@ const signalDoctor = {
600
1075
  //#endregion
601
1076
  //#region extensions/signal/src/shared.ts
602
1077
  const SIGNAL_CHANNEL = "signal";
603
- async function loadSignalChannelRuntime() {
604
- return await import("./channel.runtime-CG79z_Vy.mjs");
605
- }
606
- const signalSetupWizard = createSignalSetupWizardProxy(async () => (await loadSignalChannelRuntime()).signalSetupWizard);
1078
+ const signalSetupWizard = createSignalSetupWizardProxy(async () => (await import("./setup-surface-Drt-4t3R.mjs")).signalSetupWizard);
607
1079
  const signalConfigAdapter = {
608
1080
  ...createScopedChannelConfigAdapter({
609
1081
  sectionKey: SIGNAL_CHANNEL,
610
- listAccountIds: (cfg) => listSignalAccountIds(cfg),
611
- resolveAccount: adaptScopedAccountAccessor((params) => resolveSignalAccount(params)),
612
- defaultAccountId: (cfg) => resolveDefaultSignalAccountId(cfg),
1082
+ listAccountIds: listSignalAccountIds,
1083
+ resolveAccount: adaptScopedAccountAccessor(resolveSignalAccount),
1084
+ defaultAccountId: resolveDefaultSignalAccountId,
613
1085
  clearBaseFields: [
614
1086
  "account",
615
1087
  "accountUuid",
@@ -617,8 +1089,7 @@ const signalConfigAdapter = {
617
1089
  "name"
618
1090
  ],
619
1091
  resolveAllowFrom: (account) => account.config.allowFrom,
620
- formatAllowFrom: (allowFrom) => normalizeStringifiedEntries(allowFrom).map((entry) => entry === "*" ? "*" : normalizeE164(entry.replace(/^signal:/i, ""))).filter(Boolean),
621
- resolveDefaultTo: (account) => account.config.defaultTo
1092
+ formatAllowFrom: (allowFrom) => normalizeStringifiedEntries(allowFrom).map((entry) => entry === "*" ? "*" : normalizeE164(entry.replace(/^signal:/i, ""))).filter(Boolean)
622
1093
  }),
623
1094
  resolveDefaultTo({ cfg, accountId }) {
624
1095
  const raw = resolveSignalAccount({
@@ -657,11 +1128,6 @@ function createSignalPluginBase(params) {
657
1128
  id: SIGNAL_CHANNEL,
658
1129
  meta: { ...getChatChannelMeta(SIGNAL_CHANNEL) },
659
1130
  setupWizard: params.setupWizard,
660
- capabilities: {
661
- chatTypes: ["direct", "group"],
662
- media: true,
663
- reactions: true
664
- },
665
1131
  streaming: { blockStreamingCoalesceDefaults: {
666
1132
  minChars: 1500,
667
1133
  idleMs: 1e3
@@ -672,27 +1138,32 @@ function createSignalPluginBase(params) {
672
1138
  },
673
1139
  configSchema: SignalChannelConfigSchema,
674
1140
  doctor: signalDoctor,
675
- config: {
676
- ...signalConfigAdapter,
677
- isConfigured: (account) => account.configured,
678
- describeAccount: (account) => describeAccountSnapshot({
679
- account,
680
- configured: account.configured,
681
- extra: { baseUrl: account.baseUrl }
682
- })
683
- },
684
1141
  security: signalSecurityAdapter,
685
1142
  setupContract: params.setupContract
686
1143
  }),
1144
+ capabilities: {
1145
+ chatTypes: ["direct", "group"],
1146
+ media: true,
1147
+ reactions: true
1148
+ },
1149
+ config: {
1150
+ ...signalConfigAdapter,
1151
+ isConfigured: (account) => account.configured,
1152
+ describeAccount: (account) => describeAccountSnapshot({
1153
+ account,
1154
+ configured: account.configured,
1155
+ extra: { baseUrl: account.baseUrl }
1156
+ })
1157
+ },
687
1158
  messaging: { defaultMarkdownTableMode: "bullets" }
688
1159
  };
689
1160
  }
690
1161
  //#endregion
691
1162
  //#region extensions/signal/src/channel.ts
692
- const loadSignalMonitorModule = createLazyRuntimeModule(() => import("./monitor-Dnz6Ygz5.mjs").then((n) => n.n));
693
- const loadSignalProbeModule = createLazyRuntimeModule(() => import("./probe-DXT2eLnw.mjs").then((n) => n.n));
694
- const loadSignalSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-CLnCWvrM.mjs"));
695
- const loadSignalApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-DDQvPP_z.mjs").then((n) => n.n));
1163
+ const loadSignalMonitorModule = createLazyRuntimeModule(() => import("./monitor-BfwQr78f.mjs").then((n) => n.n));
1164
+ const loadSignalProbeModule = createLazyRuntimeModule(() => import("./probe-BYLzra6D.mjs").then((n) => n.n));
1165
+ const loadSignalSendRuntime = createLazyRuntimeModule(() => import("./send-DEjrbpIC.mjs").then((n) => n.i));
1166
+ const loadSignalApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-BKkjIAoi.mjs").then((n) => n.n));
696
1167
  async function resolveSignalSendContext(params) {
697
1168
  return {
698
1169
  send: resolveOutboundSendDep(params.deps, "signal") ?? (await loadSignalSendRuntime()).sendMessageSignal,
@@ -711,14 +1182,8 @@ function resolveSignalSendTarget(params) {
711
1182
  }
712
1183
  async function sendSignalOutbound(params) {
713
1184
  const accountId = params.accountId ?? void 0;
714
- const { send, maxBytes } = await resolveSignalSendContext({
715
- ...params,
716
- accountId
717
- });
718
- const to = resolveSignalSendTarget({
719
- ...params,
720
- accountId
721
- });
1185
+ const { send, maxBytes } = await resolveSignalSendContext(params);
1186
+ const to = resolveSignalSendTarget(params);
722
1187
  const replyOptions = await resolveSignalReplyOptions({
723
1188
  cfg: params.cfg,
724
1189
  to,
@@ -737,26 +1202,25 @@ async function sendSignalOutbound(params) {
737
1202
  ...replyOptions
738
1203
  });
739
1204
  }
740
- function resolveSignalReplyOptions(params) {
1205
+ async function resolveSignalReplyOptions(params) {
741
1206
  const replyToId = normalizeOptionalString(params.replyToId);
742
- if (!replyToId) return Promise.resolve({});
1207
+ if (!replyToId) return {};
743
1208
  const accountId = resolveSignalAccount({
744
1209
  cfg: params.cfg,
745
1210
  accountId: params.accountId
746
1211
  }).accountId;
747
- return resolveSignalReplyContextWithPersistence({
1212
+ const persistedContext = await resolveSignalReplyContextWithPersistence({
748
1213
  accountId,
749
1214
  to: params.to,
750
1215
  replyToId
751
- }).then((persistedContext) => {
752
- const replyToAuthor = persistedContext?.ambiguous === true ? void 0 : persistedContext?.author;
753
- const replyToBody = persistedContext?.ambiguous === true ? "" : [persistedContext?.body, formatSignalMediaText(persistedContext?.media ?? [])].filter(Boolean).join("\n");
754
- return {
755
- replyToId,
756
- ...replyToAuthor ? { replyToAuthor } : {},
757
- ...replyToBody ? { replyToBody } : {}
758
- };
759
1216
  });
1217
+ const replyToAuthor = persistedContext?.ambiguous === true ? void 0 : persistedContext?.author;
1218
+ const replyToBody = persistedContext?.ambiguous === true ? "" : [persistedContext?.body, formatSignalMediaText(persistedContext?.media ?? [])].filter(Boolean).join("\n");
1219
+ return {
1220
+ replyToId,
1221
+ ...replyToAuthor ? { replyToAuthor } : {},
1222
+ ...replyToBody ? { replyToBody } : {}
1223
+ };
760
1224
  }
761
1225
  function inferSignalTargetChatType(rawTo) {
762
1226
  let to = rawTo.trim();
@@ -791,19 +1255,14 @@ const signalMessageAdapter = defineChannelMessageAdapter({
791
1255
  media: sendSignalOutbound
792
1256
  }
793
1257
  });
794
- function buildSignalBaseSessionKey(params) {
795
- return buildOutboundBaseSessionKey({
796
- ...params,
797
- channel: "signal"
798
- });
799
- }
800
1258
  function resolveSignalOutboundSessionRoute(params) {
801
1259
  const target = params.resolvedTarget?.to ?? params.target;
802
1260
  const resolved = resolveSignalOutboundTarget(target);
803
1261
  if (!resolved) return null;
804
1262
  const normalizedTarget = target.replace(/^signal:/i, "").trim();
805
1263
  const recipientSessionExact = resolved.chatType === "group" || /^\+?\d{3,15}$/.test(normalizedTarget) ? true : "direct-alias";
806
- const baseSessionKey = buildSignalBaseSessionKey({
1264
+ const baseSessionKey = buildOutboundBaseSessionKey({
1265
+ channel: "signal",
807
1266
  cfg: params.cfg,
808
1267
  agentId: params.agentId,
809
1268
  accountId: params.accountId,
@@ -817,23 +1276,15 @@ function resolveSignalOutboundSessionRoute(params) {
817
1276
  };
818
1277
  }
819
1278
  async function sendFormattedSignalText(ctx) {
820
- const { send, maxBytes } = await resolveSignalSendContext({
821
- cfg: ctx.cfg,
822
- accountId: ctx.accountId ?? void 0,
823
- deps: ctx.deps
824
- });
1279
+ const { send, maxBytes } = await resolveSignalSendContext(ctx);
825
1280
  const limit = resolveTextChunkLimit(ctx.cfg, "signal", ctx.accountId ?? void 0, { fallbackLimit: 4e3 });
826
- const to = resolveSignalSendTarget({
827
- cfg: ctx.cfg,
828
- accountId: ctx.accountId ?? void 0,
829
- to: ctx.to
830
- });
1281
+ const to = resolveSignalSendTarget(ctx);
831
1282
  const tableMode = resolveMarkdownTableMode({
832
1283
  cfg: ctx.cfg,
833
1284
  channel: "signal",
834
1285
  accountId: ctx.accountId ?? void 0
835
1286
  });
836
- let chunks = limit === void 0 ? markdownToSignalTextChunks(ctx.text, Number.POSITIVE_INFINITY, { tableMode }) : markdownToSignalTextChunks(ctx.text, limit, { tableMode });
1287
+ let chunks = markdownToSignalTextChunks(ctx.text, limit ?? Number.POSITIVE_INFINITY, { tableMode });
837
1288
  if (chunks.length === 0 && ctx.text) chunks = [{
838
1289
  text: ctx.text,
839
1290
  styles: []
@@ -875,16 +1326,8 @@ async function sendFormattedSignalText(ctx) {
875
1326
  }
876
1327
  async function sendFormattedSignalMedia(ctx) {
877
1328
  ctx.abortSignal?.throwIfAborted();
878
- const { send, maxBytes } = await resolveSignalSendContext({
879
- cfg: ctx.cfg,
880
- accountId: ctx.accountId ?? void 0,
881
- deps: ctx.deps
882
- });
883
- const to = resolveSignalSendTarget({
884
- cfg: ctx.cfg,
885
- accountId: ctx.accountId ?? void 0,
886
- to: ctx.to
887
- });
1329
+ const { send, maxBytes } = await resolveSignalSendContext(ctx);
1330
+ const to = resolveSignalSendTarget(ctx);
888
1331
  const tableMode = resolveMarkdownTableMode({
889
1332
  cfg: ctx.cfg,
890
1333
  channel: "signal",
@@ -923,20 +1366,8 @@ async function registerDeliveredSignalApprovalPayloadForReactions(params) {
923
1366
  const targetAuthor = normalizeOptionalString(account.config.account);
924
1367
  const targetAuthorUuid = normalizeOptionalString(account.config.accountUuid);
925
1368
  if (!targetAuthor && !targetAuthorUuid) return;
926
- const { registerSignalQuestionReactionTargetForDeliveredPayload } = await import("./question-reactions-C8cSEjVf.mjs").then((n) => n.n);
927
- registerSignalQuestionReactionTargetForDeliveredPayload({
928
- cfg: params.cfg,
929
- target: {
930
- ...params.target,
931
- accountId: account.accountId
932
- },
933
- payload: params.payload,
934
- results: params.results,
935
- targetAuthor,
936
- targetAuthorUuid
937
- });
938
- const { registerSignalApprovalReactionTargetForDeliveredPayload } = await loadSignalApprovalReactionsModule();
939
- await registerSignalApprovalReactionTargetForDeliveredPayload({
1369
+ const { registerSignalReactionTargetsForDeliveredPayload } = await import("./reaction-targets-CEdyjtrC.mjs").then((n) => n.t);
1370
+ await registerSignalReactionTargetsForDeliveredPayload({
940
1371
  cfg: params.cfg,
941
1372
  target: {
942
1373
  ...params.target,
@@ -1007,7 +1438,7 @@ const signalPlugin = createChatChannelPlugin({
1007
1438
  targetPrefixes: ["signal"],
1008
1439
  normalizeTarget: normalizeSignalMessagingTarget,
1009
1440
  inferTargetChatType: ({ to }) => inferSignalTargetChatType(to),
1010
- resolveOutboundSessionRoute: (params) => resolveSignalOutboundSessionRoute(params),
1441
+ resolveOutboundSessionRoute: resolveSignalOutboundSessionRoute,
1011
1442
  targetResolver: {
1012
1443
  looksLikeId: looksLikeSignalTargetId,
1013
1444
  hint: "<E.164|uuid:ID|group:ID|signal:group:ID|signal:+E.164>",
@@ -1123,7 +1554,7 @@ const signalPlugin = createChatChannelPlugin({
1123
1554
  } },
1124
1555
  security: signalSecurityAdapter,
1125
1556
  threading: {
1126
- resolveReplyToMode: (params) => resolveSignalReplyToMode(params),
1557
+ resolveReplyToMode: resolveSignalReplyToMode,
1127
1558
  matchesToolContextTarget: ({ target, toolContext }) => {
1128
1559
  const normalizedTarget = normalizeSignalMessagingTarget(target);
1129
1560
  if (!normalizedTarget) return false;
@@ -1200,4 +1631,4 @@ const signalPlugin = createChatChannelPlugin({
1200
1631
  }
1201
1632
  });
1202
1633
  //#endregion
1203
- export { normalizeSignalAccountInput as a, signalNumberTextInput as c, probeSignalTransport as d, writeSignalAccountTransport as f, createSignalCliPathTextInput as i, signalSetupContract as l, createSignalPluginBase as n, signalCompletionNote as o, resolveSignalOutboundTarget as p, signalSetupWizard as r, signalDmPolicy as s, signalPlugin as t, prepareSignalManagedNativeTransport as u };
1634
+ export { resolveSignalReactionLevel as _, normalizeSignalAccountInput as a, markdownToSignalTextChunks as b, signalNumberTextInput as c, probeSignalTransport as d, writeSignalAccountTransport as f, signalMessageActions as g, resolveSignalOutboundTarget as h, createSignalCliPathTextInput as i, signalSetupContract as l, materializeSignalPresentationFallback as m, createSignalPluginBase as n, signalCompletionNote as o, registerSignalReplyContext as p, signalSetupWizard as r, signalDmPolicy as s, signalPlugin as t, prepareSignalManagedNativeTransport as u, formatSignalMediaText as v, isSignalNativeApprovalHandlerConfigured as x, markdownToSignalText as y };