@openclaw/signal 2026.7.2-beta.5 → 2026.7.33

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 (763) hide show
  1. package/dist/.setup/accounts-Bz4HtP0g.mjs +59 -0
  2. package/dist/.setup/api-Q_S37MF_.mjs +16 -0
  3. package/dist/.setup/api-zi9Hs8Er.mjs +11 -0
  4. package/dist/{runtime-JPrGlV7h.js → .setup/approval-auth-CKMusyZI.mjs} +27 -36
  5. package/dist/{approval-handler.runtime-C-XYgcxE.js → .setup/approval-handler.runtime-eIT2knU-.mjs} +7 -7
  6. package/dist/{approval-reactions-DtL47gSK.js → .setup/approval-reactions-DoY1BVpl.mjs} +29 -38
  7. package/dist/{approval-resolver-B3m0D2R0.js → .setup/approval-resolver-BR0MioAA.mjs} +1 -2
  8. package/dist/{channel-CBIljGCH.js → .setup/channel-DKzsFvG5.mjs} +90 -527
  9. package/dist/.setup/channel.runtime-jVmVayf_.mjs +66 -0
  10. package/dist/{client-BazXTH7O.js → .setup/client-adapter-BiGMiCr4.mjs} +236 -184
  11. package/dist/.setup/config-api-KS-qhQvD.mjs +2 -0
  12. package/dist/.setup/config-schema-BQRy2Glu.mjs +27 -0
  13. package/dist/{identity-BQ4OzXXk.js → .setup/identity-C8-yk4J9.mjs} +9 -21
  14. package/dist/{install-signal-cli-qJF7iC4h.js → .setup/install-signal-cli-BoniH0EF.mjs} +50 -88
  15. package/dist/.setup/message-actions-Cplx3XNC.mjs +529 -0
  16. package/dist/{monitor-CHBkf7lk.js → .setup/monitor-CZUTeDiv.mjs} +310 -615
  17. package/dist/.setup/probe-BXmpsFzO.mjs +48 -0
  18. package/dist/{reaction-runtime-api-BjeDyKcz.js → .setup/reaction-runtime-api-CAxalUfb.mjs} +7 -5
  19. package/dist/{rpc-context-CZUoE0-A.js → .setup/rpc-context-B-l6wiZj.mjs} +1 -1
  20. package/dist/{send-B_Ks4MZr.js → .setup/send-CF_VPaZJ.mjs} +41 -56
  21. package/dist/{send.runtime-CbuXycZT.js → .setup/send.runtime-DqumNf6-.mjs} +1 -1
  22. package/dist/api.js +11 -16
  23. package/dist/channel-config-api.js +1 -1
  24. package/dist/channel-plugin-api.js +1 -1
  25. package/dist/contract-api.js +3 -3
  26. package/dist/reaction-runtime-api.js +1 -1
  27. package/dist/runtime-api.js +10 -11
  28. package/dist/setup-entry.js +2 -1
  29. package/node_modules/ws/lib/permessage-deflate.js +3 -1
  30. package/node_modules/ws/package.json +1 -1
  31. package/openclaw.plugin.json +408 -566
  32. package/package.json +20 -70
  33. package/dist/accounts-DrStJjiK.js +0 -147
  34. package/dist/channel.runtime-B8GXmuol.js +0 -92
  35. package/dist/client-adapter-mXGeEHQJ.js +0 -56
  36. package/dist/config-schema-DLvpQPN5.js +0 -221
  37. package/dist/doctor-contract-api-DbUCknbC.js +0 -492
  38. package/dist/doctor-contract-api.js +0 -2
  39. package/dist/probe-Br9abaGp.js +0 -65
  40. package/dist/question-reactions-Ds48FtEu.js +0 -109
  41. package/dist/transport-detection-Da06-LOL.js +0 -652
  42. package/dist/transport-detection.runtime-D_190UUL.js +0 -2
  43. package/dist/transport-policy-DxvSMHp9.js +0 -99
  44. package/dist/transport-probes.runtime-CV6Qs0Og.js +0 -2
  45. package/node_modules/zod/LICENSE +0 -21
  46. package/node_modules/zod/README.md +0 -191
  47. package/node_modules/zod/index.cjs +0 -33
  48. package/node_modules/zod/index.d.cts +0 -4
  49. package/node_modules/zod/index.d.ts +0 -4
  50. package/node_modules/zod/index.js +0 -4
  51. package/node_modules/zod/locales/index.cjs +0 -17
  52. package/node_modules/zod/locales/index.d.cts +0 -1
  53. package/node_modules/zod/locales/index.d.ts +0 -1
  54. package/node_modules/zod/locales/index.js +0 -1
  55. package/node_modules/zod/locales/package.json +0 -7
  56. package/node_modules/zod/mini/index.cjs +0 -32
  57. package/node_modules/zod/mini/index.d.cts +0 -3
  58. package/node_modules/zod/mini/index.d.ts +0 -3
  59. package/node_modules/zod/mini/index.js +0 -3
  60. package/node_modules/zod/mini/package.json +0 -7
  61. package/node_modules/zod/package.json +0 -135
  62. package/node_modules/zod/src/index.ts +0 -4
  63. package/node_modules/zod/src/locales/index.ts +0 -1
  64. package/node_modules/zod/src/mini/index.ts +0 -3
  65. package/node_modules/zod/src/v3/ZodError.ts +0 -330
  66. package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  67. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  68. package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  69. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  70. package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  71. package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  72. package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  73. package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  74. package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  75. package/node_modules/zod/src/v3/errors.ts +0 -13
  76. package/node_modules/zod/src/v3/external.ts +0 -6
  77. package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  78. package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  79. package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  80. package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  81. package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  82. package/node_modules/zod/src/v3/helpers/util.ts +0 -224
  83. package/node_modules/zod/src/v3/index.ts +0 -4
  84. package/node_modules/zod/src/v3/locales/en.ts +0 -124
  85. package/node_modules/zod/src/v3/standard-schema.ts +0 -113
  86. package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  87. package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  88. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  89. package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  90. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  91. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  92. package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  93. package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  94. package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  95. package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  96. package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  97. package/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
  98. package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  99. package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  100. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  101. package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  102. package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  103. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  104. package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  105. package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
  106. package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  107. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  108. package/node_modules/zod/src/v3/tests/function.test.ts +0 -261
  109. package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  110. package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  111. package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
  112. package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  113. package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
  114. package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  115. package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  116. package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  117. package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  118. package/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
  119. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  120. package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  121. package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  122. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  123. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  124. package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
  125. package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  126. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  127. package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  128. package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  129. package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  130. package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  131. package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  132. package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  133. package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  134. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
  135. package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  136. package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  137. package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  138. package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  139. package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  140. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  141. package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
  142. package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  143. package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  144. package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  145. package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  146. package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  147. package/node_modules/zod/src/v3/types.ts +0 -5138
  148. package/node_modules/zod/src/v4/classic/checks.ts +0 -32
  149. package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  150. package/node_modules/zod/src/v4/classic/compat.ts +0 -70
  151. package/node_modules/zod/src/v4/classic/errors.ts +0 -82
  152. package/node_modules/zod/src/v4/classic/external.ts +0 -52
  153. package/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -659
  154. package/node_modules/zod/src/v4/classic/index.ts +0 -5
  155. package/node_modules/zod/src/v4/classic/iso.ts +0 -90
  156. package/node_modules/zod/src/v4/classic/parse.ts +0 -82
  157. package/node_modules/zod/src/v4/classic/schemas.ts +0 -2672
  158. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  159. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -59
  160. package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  161. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -216
  162. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  163. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  164. package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  165. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
  166. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
  167. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -326
  168. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  169. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -573
  170. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -703
  171. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  172. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
  173. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  174. package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -62
  175. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -302
  176. package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -409
  177. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
  178. package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  179. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -197
  180. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -694
  181. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
  182. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -807
  183. package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
  184. package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  185. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  186. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
  187. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -895
  188. package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -360
  189. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  190. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -39
  191. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -68
  192. package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -939
  193. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -60
  194. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -198
  195. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -46
  196. package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
  197. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
  198. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -117
  199. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
  200. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
  201. package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -330
  202. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  203. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  204. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  205. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  206. package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -325
  207. package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -717
  208. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -333
  209. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -450
  210. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
  211. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  212. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
  213. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -26
  214. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
  215. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  216. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  217. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  218. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
  219. package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -717
  220. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -631
  221. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -633
  222. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
  223. package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -181
  224. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -134
  225. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  226. package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1224
  227. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -106
  228. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -771
  229. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
  230. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -3125
  231. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
  232. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -496
  233. package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -273
  234. package/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
  235. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  236. package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  237. package/node_modules/zod/src/v4/core/api.ts +0 -1823
  238. package/node_modules/zod/src/v4/core/checks.ts +0 -1293
  239. package/node_modules/zod/src/v4/core/config.ts +0 -15
  240. package/node_modules/zod/src/v4/core/core.ts +0 -153
  241. package/node_modules/zod/src/v4/core/doc.ts +0 -44
  242. package/node_modules/zod/src/v4/core/errors.ts +0 -455
  243. package/node_modules/zod/src/v4/core/index.ts +0 -16
  244. package/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -126
  245. package/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -666
  246. package/node_modules/zod/src/v4/core/json-schema.ts +0 -147
  247. package/node_modules/zod/src/v4/core/parse.ts +0 -195
  248. package/node_modules/zod/src/v4/core/regexes.ts +0 -190
  249. package/node_modules/zod/src/v4/core/registries.ts +0 -105
  250. package/node_modules/zod/src/v4/core/schemas.ts +0 -4730
  251. package/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
  252. package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
  253. package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  254. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  255. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -215
  256. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  257. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -181
  258. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
  259. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
  260. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
  261. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
  262. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  263. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  264. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
  265. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
  266. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
  267. package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -622
  268. package/node_modules/zod/src/v4/core/util.ts +0 -983
  269. package/node_modules/zod/src/v4/core/versions.ts +0 -5
  270. package/node_modules/zod/src/v4/core/zsf.ts +0 -323
  271. package/node_modules/zod/src/v4/index.ts +0 -4
  272. package/node_modules/zod/src/v4/locales/ar.ts +0 -115
  273. package/node_modules/zod/src/v4/locales/az.ts +0 -111
  274. package/node_modules/zod/src/v4/locales/be.ts +0 -176
  275. package/node_modules/zod/src/v4/locales/bg.ts +0 -128
  276. package/node_modules/zod/src/v4/locales/ca.ts +0 -116
  277. package/node_modules/zod/src/v4/locales/cs.ts +0 -118
  278. package/node_modules/zod/src/v4/locales/da.ts +0 -123
  279. package/node_modules/zod/src/v4/locales/de.ts +0 -116
  280. package/node_modules/zod/src/v4/locales/el.ts +0 -121
  281. package/node_modules/zod/src/v4/locales/en.ts +0 -123
  282. package/node_modules/zod/src/v4/locales/eo.ts +0 -118
  283. package/node_modules/zod/src/v4/locales/es.ts +0 -141
  284. package/node_modules/zod/src/v4/locales/fa.ts +0 -126
  285. package/node_modules/zod/src/v4/locales/fi.ts +0 -121
  286. package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -116
  287. package/node_modules/zod/src/v4/locales/fr.ts +0 -132
  288. package/node_modules/zod/src/v4/locales/he.ts +0 -246
  289. package/node_modules/zod/src/v4/locales/hr.ts +0 -131
  290. package/node_modules/zod/src/v4/locales/hu.ts +0 -117
  291. package/node_modules/zod/src/v4/locales/hy.ts +0 -164
  292. package/node_modules/zod/src/v4/locales/id.ts +0 -115
  293. package/node_modules/zod/src/v4/locales/index.ts +0 -52
  294. package/node_modules/zod/src/v4/locales/is.ts +0 -119
  295. package/node_modules/zod/src/v4/locales/it.ts +0 -116
  296. package/node_modules/zod/src/v4/locales/ja.ts +0 -114
  297. package/node_modules/zod/src/v4/locales/ka.ts +0 -123
  298. package/node_modules/zod/src/v4/locales/kh.ts +0 -7
  299. package/node_modules/zod/src/v4/locales/km.ts +0 -119
  300. package/node_modules/zod/src/v4/locales/ko.ts +0 -121
  301. package/node_modules/zod/src/v4/locales/lt.ts +0 -239
  302. package/node_modules/zod/src/v4/locales/mk.ts +0 -118
  303. package/node_modules/zod/src/v4/locales/ms.ts +0 -115
  304. package/node_modules/zod/src/v4/locales/nl.ts +0 -121
  305. package/node_modules/zod/src/v4/locales/no.ts +0 -116
  306. package/node_modules/zod/src/v4/locales/ota.ts +0 -117
  307. package/node_modules/zod/src/v4/locales/pl.ts +0 -118
  308. package/node_modules/zod/src/v4/locales/ps.ts +0 -126
  309. package/node_modules/zod/src/v4/locales/pt.ts +0 -116
  310. package/node_modules/zod/src/v4/locales/ro.ts +0 -129
  311. package/node_modules/zod/src/v4/locales/ru.ts +0 -176
  312. package/node_modules/zod/src/v4/locales/sl.ts +0 -118
  313. package/node_modules/zod/src/v4/locales/sv.ts +0 -119
  314. package/node_modules/zod/src/v4/locales/ta.ts +0 -118
  315. package/node_modules/zod/src/v4/locales/th.ts +0 -119
  316. package/node_modules/zod/src/v4/locales/tr.ts +0 -111
  317. package/node_modules/zod/src/v4/locales/ua.ts +0 -7
  318. package/node_modules/zod/src/v4/locales/uk.ts +0 -117
  319. package/node_modules/zod/src/v4/locales/ur.ts +0 -119
  320. package/node_modules/zod/src/v4/locales/uz.ts +0 -117
  321. package/node_modules/zod/src/v4/locales/vi.ts +0 -117
  322. package/node_modules/zod/src/v4/locales/yo.ts +0 -124
  323. package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -116
  324. package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -115
  325. package/node_modules/zod/src/v4/mini/checks.ts +0 -32
  326. package/node_modules/zod/src/v4/mini/coerce.ts +0 -27
  327. package/node_modules/zod/src/v4/mini/external.ts +0 -41
  328. package/node_modules/zod/src/v4/mini/index.ts +0 -3
  329. package/node_modules/zod/src/v4/mini/iso.ts +0 -66
  330. package/node_modules/zod/src/v4/mini/parse.ts +0 -14
  331. package/node_modules/zod/src/v4/mini/schemas.ts +0 -1947
  332. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -24
  333. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
  334. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
  335. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
  336. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -548
  337. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  338. package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
  339. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -5
  340. package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -993
  341. package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
  342. package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -227
  343. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  344. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -325
  345. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
  346. package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -352
  347. package/node_modules/zod/src/v4-mini/index.ts +0 -3
  348. package/node_modules/zod/v3/ZodError.cjs +0 -138
  349. package/node_modules/zod/v3/ZodError.d.cts +0 -164
  350. package/node_modules/zod/v3/ZodError.d.ts +0 -164
  351. package/node_modules/zod/v3/ZodError.js +0 -133
  352. package/node_modules/zod/v3/errors.cjs +0 -17
  353. package/node_modules/zod/v3/errors.d.cts +0 -5
  354. package/node_modules/zod/v3/errors.d.ts +0 -5
  355. package/node_modules/zod/v3/errors.js +0 -9
  356. package/node_modules/zod/v3/external.cjs +0 -22
  357. package/node_modules/zod/v3/external.d.cts +0 -6
  358. package/node_modules/zod/v3/external.d.ts +0 -6
  359. package/node_modules/zod/v3/external.js +0 -6
  360. package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  361. package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  362. package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  363. package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  364. package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  365. package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  366. package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  367. package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  368. package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  369. package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  370. package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  371. package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  372. package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  373. package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  374. package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  375. package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  376. package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  377. package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  378. package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  379. package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  380. package/node_modules/zod/v3/helpers/util.cjs +0 -137
  381. package/node_modules/zod/v3/helpers/util.d.cts +0 -85
  382. package/node_modules/zod/v3/helpers/util.d.ts +0 -85
  383. package/node_modules/zod/v3/helpers/util.js +0 -133
  384. package/node_modules/zod/v3/index.cjs +0 -33
  385. package/node_modules/zod/v3/index.d.cts +0 -4
  386. package/node_modules/zod/v3/index.d.ts +0 -4
  387. package/node_modules/zod/v3/index.js +0 -4
  388. package/node_modules/zod/v3/locales/en.cjs +0 -112
  389. package/node_modules/zod/v3/locales/en.d.cts +0 -3
  390. package/node_modules/zod/v3/locales/en.d.ts +0 -3
  391. package/node_modules/zod/v3/locales/en.js +0 -109
  392. package/node_modules/zod/v3/package.json +0 -7
  393. package/node_modules/zod/v3/standard-schema.cjs +0 -2
  394. package/node_modules/zod/v3/standard-schema.d.cts +0 -102
  395. package/node_modules/zod/v3/standard-schema.d.ts +0 -102
  396. package/node_modules/zod/v3/standard-schema.js +0 -1
  397. package/node_modules/zod/v3/types.cjs +0 -3777
  398. package/node_modules/zod/v3/types.d.cts +0 -1034
  399. package/node_modules/zod/v3/types.d.ts +0 -1034
  400. package/node_modules/zod/v3/types.js +0 -3695
  401. package/node_modules/zod/v4/classic/checks.cjs +0 -33
  402. package/node_modules/zod/v4/classic/checks.d.cts +0 -1
  403. package/node_modules/zod/v4/classic/checks.d.ts +0 -1
  404. package/node_modules/zod/v4/classic/checks.js +0 -1
  405. package/node_modules/zod/v4/classic/coerce.cjs +0 -47
  406. package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  407. package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  408. package/node_modules/zod/v4/classic/coerce.js +0 -17
  409. package/node_modules/zod/v4/classic/compat.cjs +0 -61
  410. package/node_modules/zod/v4/classic/compat.d.cts +0 -50
  411. package/node_modules/zod/v4/classic/compat.d.ts +0 -50
  412. package/node_modules/zod/v4/classic/compat.js +0 -31
  413. package/node_modules/zod/v4/classic/errors.cjs +0 -74
  414. package/node_modules/zod/v4/classic/errors.d.cts +0 -30
  415. package/node_modules/zod/v4/classic/errors.d.ts +0 -30
  416. package/node_modules/zod/v4/classic/errors.js +0 -48
  417. package/node_modules/zod/v4/classic/external.cjs +0 -73
  418. package/node_modules/zod/v4/classic/external.d.cts +0 -16
  419. package/node_modules/zod/v4/classic/external.d.ts +0 -16
  420. package/node_modules/zod/v4/classic/external.js +0 -20
  421. package/node_modules/zod/v4/classic/from-json-schema.cjs +0 -625
  422. package/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
  423. package/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
  424. package/node_modules/zod/v4/classic/from-json-schema.js +0 -599
  425. package/node_modules/zod/v4/classic/index.cjs +0 -33
  426. package/node_modules/zod/v4/classic/index.d.cts +0 -4
  427. package/node_modules/zod/v4/classic/index.d.ts +0 -4
  428. package/node_modules/zod/v4/classic/index.js +0 -4
  429. package/node_modules/zod/v4/classic/iso.cjs +0 -60
  430. package/node_modules/zod/v4/classic/iso.d.cts +0 -22
  431. package/node_modules/zod/v4/classic/iso.d.ts +0 -22
  432. package/node_modules/zod/v4/classic/iso.js +0 -30
  433. package/node_modules/zod/v4/classic/package.json +0 -7
  434. package/node_modules/zod/v4/classic/parse.cjs +0 -41
  435. package/node_modules/zod/v4/classic/parse.d.cts +0 -31
  436. package/node_modules/zod/v4/classic/parse.d.ts +0 -31
  437. package/node_modules/zod/v4/classic/parse.js +0 -15
  438. package/node_modules/zod/v4/classic/schemas.cjs +0 -1511
  439. package/node_modules/zod/v4/classic/schemas.d.cts +0 -767
  440. package/node_modules/zod/v4/classic/schemas.d.ts +0 -767
  441. package/node_modules/zod/v4/classic/schemas.js +0 -1395
  442. package/node_modules/zod/v4/core/api.cjs +0 -1227
  443. package/node_modules/zod/v4/core/api.d.cts +0 -325
  444. package/node_modules/zod/v4/core/api.d.ts +0 -325
  445. package/node_modules/zod/v4/core/api.js +0 -1087
  446. package/node_modules/zod/v4/core/checks.cjs +0 -601
  447. package/node_modules/zod/v4/core/checks.d.cts +0 -278
  448. package/node_modules/zod/v4/core/checks.d.ts +0 -278
  449. package/node_modules/zod/v4/core/checks.js +0 -575
  450. package/node_modules/zod/v4/core/core.cjs +0 -85
  451. package/node_modules/zod/v4/core/core.d.cts +0 -70
  452. package/node_modules/zod/v4/core/core.d.ts +0 -70
  453. package/node_modules/zod/v4/core/core.js +0 -78
  454. package/node_modules/zod/v4/core/doc.cjs +0 -39
  455. package/node_modules/zod/v4/core/doc.d.cts +0 -14
  456. package/node_modules/zod/v4/core/doc.d.ts +0 -14
  457. package/node_modules/zod/v4/core/doc.js +0 -35
  458. package/node_modules/zod/v4/core/errors.cjs +0 -216
  459. package/node_modules/zod/v4/core/errors.d.cts +0 -221
  460. package/node_modules/zod/v4/core/errors.d.ts +0 -221
  461. package/node_modules/zod/v4/core/errors.js +0 -185
  462. package/node_modules/zod/v4/core/index.cjs +0 -47
  463. package/node_modules/zod/v4/core/index.d.cts +0 -16
  464. package/node_modules/zod/v4/core/index.d.ts +0 -16
  465. package/node_modules/zod/v4/core/index.js +0 -16
  466. package/node_modules/zod/v4/core/json-schema-generator.cjs +0 -99
  467. package/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
  468. package/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
  469. package/node_modules/zod/v4/core/json-schema-generator.js +0 -95
  470. package/node_modules/zod/v4/core/json-schema-processors.cjs +0 -644
  471. package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -49
  472. package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -49
  473. package/node_modules/zod/v4/core/json-schema-processors.js +0 -601
  474. package/node_modules/zod/v4/core/json-schema.cjs +0 -2
  475. package/node_modules/zod/v4/core/json-schema.d.cts +0 -88
  476. package/node_modules/zod/v4/core/json-schema.d.ts +0 -88
  477. package/node_modules/zod/v4/core/json-schema.js +0 -1
  478. package/node_modules/zod/v4/core/package.json +0 -7
  479. package/node_modules/zod/v4/core/parse.cjs +0 -131
  480. package/node_modules/zod/v4/core/parse.d.cts +0 -49
  481. package/node_modules/zod/v4/core/parse.d.ts +0 -49
  482. package/node_modules/zod/v4/core/parse.js +0 -93
  483. package/node_modules/zod/v4/core/regexes.cjs +0 -172
  484. package/node_modules/zod/v4/core/regexes.d.cts +0 -85
  485. package/node_modules/zod/v4/core/regexes.d.ts +0 -85
  486. package/node_modules/zod/v4/core/regexes.js +0 -139
  487. package/node_modules/zod/v4/core/registries.cjs +0 -56
  488. package/node_modules/zod/v4/core/registries.d.cts +0 -35
  489. package/node_modules/zod/v4/core/registries.d.ts +0 -35
  490. package/node_modules/zod/v4/core/registries.js +0 -51
  491. package/node_modules/zod/v4/core/schemas.cjs +0 -2270
  492. package/node_modules/zod/v4/core/schemas.d.cts +0 -1184
  493. package/node_modules/zod/v4/core/schemas.d.ts +0 -1184
  494. package/node_modules/zod/v4/core/schemas.js +0 -2239
  495. package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
  496. package/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
  497. package/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
  498. package/node_modules/zod/v4/core/standard-schema.js +0 -1
  499. package/node_modules/zod/v4/core/to-json-schema.cjs +0 -457
  500. package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -114
  501. package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -114
  502. package/node_modules/zod/v4/core/to-json-schema.js +0 -448
  503. package/node_modules/zod/v4/core/util.cjs +0 -734
  504. package/node_modules/zod/v4/core/util.d.cts +0 -200
  505. package/node_modules/zod/v4/core/util.d.ts +0 -200
  506. package/node_modules/zod/v4/core/util.js +0 -674
  507. package/node_modules/zod/v4/core/versions.cjs +0 -8
  508. package/node_modules/zod/v4/core/versions.d.cts +0 -5
  509. package/node_modules/zod/v4/core/versions.d.ts +0 -5
  510. package/node_modules/zod/v4/core/versions.js +0 -5
  511. package/node_modules/zod/v4/index.cjs +0 -22
  512. package/node_modules/zod/v4/index.d.cts +0 -3
  513. package/node_modules/zod/v4/index.d.ts +0 -3
  514. package/node_modules/zod/v4/index.js +0 -3
  515. package/node_modules/zod/v4/locales/ar.cjs +0 -133
  516. package/node_modules/zod/v4/locales/ar.d.cts +0 -5
  517. package/node_modules/zod/v4/locales/ar.d.ts +0 -4
  518. package/node_modules/zod/v4/locales/ar.js +0 -106
  519. package/node_modules/zod/v4/locales/az.cjs +0 -132
  520. package/node_modules/zod/v4/locales/az.d.cts +0 -5
  521. package/node_modules/zod/v4/locales/az.d.ts +0 -4
  522. package/node_modules/zod/v4/locales/az.js +0 -105
  523. package/node_modules/zod/v4/locales/be.cjs +0 -183
  524. package/node_modules/zod/v4/locales/be.d.cts +0 -5
  525. package/node_modules/zod/v4/locales/be.d.ts +0 -4
  526. package/node_modules/zod/v4/locales/be.js +0 -156
  527. package/node_modules/zod/v4/locales/bg.cjs +0 -147
  528. package/node_modules/zod/v4/locales/bg.d.cts +0 -5
  529. package/node_modules/zod/v4/locales/bg.d.ts +0 -4
  530. package/node_modules/zod/v4/locales/bg.js +0 -120
  531. package/node_modules/zod/v4/locales/ca.cjs +0 -134
  532. package/node_modules/zod/v4/locales/ca.d.cts +0 -5
  533. package/node_modules/zod/v4/locales/ca.d.ts +0 -4
  534. package/node_modules/zod/v4/locales/ca.js +0 -107
  535. package/node_modules/zod/v4/locales/cs.cjs +0 -138
  536. package/node_modules/zod/v4/locales/cs.d.cts +0 -5
  537. package/node_modules/zod/v4/locales/cs.d.ts +0 -4
  538. package/node_modules/zod/v4/locales/cs.js +0 -111
  539. package/node_modules/zod/v4/locales/da.cjs +0 -142
  540. package/node_modules/zod/v4/locales/da.d.cts +0 -5
  541. package/node_modules/zod/v4/locales/da.d.ts +0 -4
  542. package/node_modules/zod/v4/locales/da.js +0 -115
  543. package/node_modules/zod/v4/locales/de.cjs +0 -135
  544. package/node_modules/zod/v4/locales/de.d.cts +0 -5
  545. package/node_modules/zod/v4/locales/de.d.ts +0 -4
  546. package/node_modules/zod/v4/locales/de.js +0 -108
  547. package/node_modules/zod/v4/locales/el.cjs +0 -136
  548. package/node_modules/zod/v4/locales/el.d.cts +0 -5
  549. package/node_modules/zod/v4/locales/el.d.ts +0 -4
  550. package/node_modules/zod/v4/locales/el.js +0 -109
  551. package/node_modules/zod/v4/locales/en.cjs +0 -140
  552. package/node_modules/zod/v4/locales/en.d.cts +0 -5
  553. package/node_modules/zod/v4/locales/en.d.ts +0 -4
  554. package/node_modules/zod/v4/locales/en.js +0 -113
  555. package/node_modules/zod/v4/locales/eo.cjs +0 -136
  556. package/node_modules/zod/v4/locales/eo.d.cts +0 -5
  557. package/node_modules/zod/v4/locales/eo.d.ts +0 -4
  558. package/node_modules/zod/v4/locales/eo.js +0 -109
  559. package/node_modules/zod/v4/locales/es.cjs +0 -159
  560. package/node_modules/zod/v4/locales/es.d.cts +0 -5
  561. package/node_modules/zod/v4/locales/es.d.ts +0 -4
  562. package/node_modules/zod/v4/locales/es.js +0 -132
  563. package/node_modules/zod/v4/locales/fa.cjs +0 -141
  564. package/node_modules/zod/v4/locales/fa.d.cts +0 -5
  565. package/node_modules/zod/v4/locales/fa.d.ts +0 -4
  566. package/node_modules/zod/v4/locales/fa.js +0 -114
  567. package/node_modules/zod/v4/locales/fi.cjs +0 -139
  568. package/node_modules/zod/v4/locales/fi.d.cts +0 -5
  569. package/node_modules/zod/v4/locales/fi.d.ts +0 -4
  570. package/node_modules/zod/v4/locales/fi.js +0 -112
  571. package/node_modules/zod/v4/locales/fr-CA.cjs +0 -134
  572. package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  573. package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  574. package/node_modules/zod/v4/locales/fr-CA.js +0 -107
  575. package/node_modules/zod/v4/locales/fr.cjs +0 -152
  576. package/node_modules/zod/v4/locales/fr.d.cts +0 -5
  577. package/node_modules/zod/v4/locales/fr.d.ts +0 -4
  578. package/node_modules/zod/v4/locales/fr.js +0 -125
  579. package/node_modules/zod/v4/locales/he.cjs +0 -241
  580. package/node_modules/zod/v4/locales/he.d.cts +0 -5
  581. package/node_modules/zod/v4/locales/he.d.ts +0 -4
  582. package/node_modules/zod/v4/locales/he.js +0 -214
  583. package/node_modules/zod/v4/locales/hr.cjs +0 -149
  584. package/node_modules/zod/v4/locales/hr.d.cts +0 -5
  585. package/node_modules/zod/v4/locales/hr.d.ts +0 -4
  586. package/node_modules/zod/v4/locales/hr.js +0 -122
  587. package/node_modules/zod/v4/locales/hu.cjs +0 -135
  588. package/node_modules/zod/v4/locales/hu.d.cts +0 -5
  589. package/node_modules/zod/v4/locales/hu.d.ts +0 -4
  590. package/node_modules/zod/v4/locales/hu.js +0 -108
  591. package/node_modules/zod/v4/locales/hy.cjs +0 -174
  592. package/node_modules/zod/v4/locales/hy.d.cts +0 -5
  593. package/node_modules/zod/v4/locales/hy.d.ts +0 -4
  594. package/node_modules/zod/v4/locales/hy.js +0 -147
  595. package/node_modules/zod/v4/locales/id.cjs +0 -133
  596. package/node_modules/zod/v4/locales/id.d.cts +0 -5
  597. package/node_modules/zod/v4/locales/id.d.ts +0 -4
  598. package/node_modules/zod/v4/locales/id.js +0 -106
  599. package/node_modules/zod/v4/locales/index.cjs +0 -111
  600. package/node_modules/zod/v4/locales/index.d.cts +0 -52
  601. package/node_modules/zod/v4/locales/index.d.ts +0 -52
  602. package/node_modules/zod/v4/locales/index.js +0 -52
  603. package/node_modules/zod/v4/locales/is.cjs +0 -136
  604. package/node_modules/zod/v4/locales/is.d.cts +0 -5
  605. package/node_modules/zod/v4/locales/is.d.ts +0 -4
  606. package/node_modules/zod/v4/locales/is.js +0 -109
  607. package/node_modules/zod/v4/locales/it.cjs +0 -135
  608. package/node_modules/zod/v4/locales/it.d.cts +0 -5
  609. package/node_modules/zod/v4/locales/it.d.ts +0 -4
  610. package/node_modules/zod/v4/locales/it.js +0 -108
  611. package/node_modules/zod/v4/locales/ja.cjs +0 -134
  612. package/node_modules/zod/v4/locales/ja.d.cts +0 -5
  613. package/node_modules/zod/v4/locales/ja.d.ts +0 -4
  614. package/node_modules/zod/v4/locales/ja.js +0 -107
  615. package/node_modules/zod/v4/locales/ka.cjs +0 -139
  616. package/node_modules/zod/v4/locales/ka.d.cts +0 -5
  617. package/node_modules/zod/v4/locales/ka.d.ts +0 -4
  618. package/node_modules/zod/v4/locales/ka.js +0 -112
  619. package/node_modules/zod/v4/locales/kh.cjs +0 -12
  620. package/node_modules/zod/v4/locales/kh.d.cts +0 -5
  621. package/node_modules/zod/v4/locales/kh.d.ts +0 -5
  622. package/node_modules/zod/v4/locales/kh.js +0 -5
  623. package/node_modules/zod/v4/locales/km.cjs +0 -137
  624. package/node_modules/zod/v4/locales/km.d.cts +0 -5
  625. package/node_modules/zod/v4/locales/km.d.ts +0 -4
  626. package/node_modules/zod/v4/locales/km.js +0 -110
  627. package/node_modules/zod/v4/locales/ko.cjs +0 -138
  628. package/node_modules/zod/v4/locales/ko.d.cts +0 -5
  629. package/node_modules/zod/v4/locales/ko.d.ts +0 -4
  630. package/node_modules/zod/v4/locales/ko.js +0 -111
  631. package/node_modules/zod/v4/locales/lt.cjs +0 -230
  632. package/node_modules/zod/v4/locales/lt.d.cts +0 -5
  633. package/node_modules/zod/v4/locales/lt.d.ts +0 -4
  634. package/node_modules/zod/v4/locales/lt.js +0 -203
  635. package/node_modules/zod/v4/locales/mk.cjs +0 -136
  636. package/node_modules/zod/v4/locales/mk.d.cts +0 -5
  637. package/node_modules/zod/v4/locales/mk.d.ts +0 -4
  638. package/node_modules/zod/v4/locales/mk.js +0 -109
  639. package/node_modules/zod/v4/locales/ms.cjs +0 -134
  640. package/node_modules/zod/v4/locales/ms.d.cts +0 -5
  641. package/node_modules/zod/v4/locales/ms.d.ts +0 -4
  642. package/node_modules/zod/v4/locales/ms.js +0 -107
  643. package/node_modules/zod/v4/locales/nl.cjs +0 -137
  644. package/node_modules/zod/v4/locales/nl.d.cts +0 -5
  645. package/node_modules/zod/v4/locales/nl.d.ts +0 -4
  646. package/node_modules/zod/v4/locales/nl.js +0 -110
  647. package/node_modules/zod/v4/locales/no.cjs +0 -135
  648. package/node_modules/zod/v4/locales/no.d.cts +0 -5
  649. package/node_modules/zod/v4/locales/no.d.ts +0 -4
  650. package/node_modules/zod/v4/locales/no.js +0 -108
  651. package/node_modules/zod/v4/locales/ota.cjs +0 -136
  652. package/node_modules/zod/v4/locales/ota.d.cts +0 -5
  653. package/node_modules/zod/v4/locales/ota.d.ts +0 -4
  654. package/node_modules/zod/v4/locales/ota.js +0 -109
  655. package/node_modules/zod/v4/locales/package.json +0 -7
  656. package/node_modules/zod/v4/locales/pl.cjs +0 -136
  657. package/node_modules/zod/v4/locales/pl.d.cts +0 -5
  658. package/node_modules/zod/v4/locales/pl.d.ts +0 -4
  659. package/node_modules/zod/v4/locales/pl.js +0 -109
  660. package/node_modules/zod/v4/locales/ps.cjs +0 -141
  661. package/node_modules/zod/v4/locales/ps.d.cts +0 -5
  662. package/node_modules/zod/v4/locales/ps.d.ts +0 -4
  663. package/node_modules/zod/v4/locales/ps.js +0 -114
  664. package/node_modules/zod/v4/locales/pt.cjs +0 -135
  665. package/node_modules/zod/v4/locales/pt.d.cts +0 -5
  666. package/node_modules/zod/v4/locales/pt.d.ts +0 -4
  667. package/node_modules/zod/v4/locales/pt.js +0 -108
  668. package/node_modules/zod/v4/locales/ro.cjs +0 -146
  669. package/node_modules/zod/v4/locales/ro.d.cts +0 -5
  670. package/node_modules/zod/v4/locales/ro.d.ts +0 -4
  671. package/node_modules/zod/v4/locales/ro.js +0 -119
  672. package/node_modules/zod/v4/locales/ru.cjs +0 -183
  673. package/node_modules/zod/v4/locales/ru.d.cts +0 -5
  674. package/node_modules/zod/v4/locales/ru.d.ts +0 -4
  675. package/node_modules/zod/v4/locales/ru.js +0 -156
  676. package/node_modules/zod/v4/locales/sl.cjs +0 -136
  677. package/node_modules/zod/v4/locales/sl.d.cts +0 -5
  678. package/node_modules/zod/v4/locales/sl.d.ts +0 -4
  679. package/node_modules/zod/v4/locales/sl.js +0 -109
  680. package/node_modules/zod/v4/locales/sv.cjs +0 -137
  681. package/node_modules/zod/v4/locales/sv.d.cts +0 -5
  682. package/node_modules/zod/v4/locales/sv.d.ts +0 -4
  683. package/node_modules/zod/v4/locales/sv.js +0 -110
  684. package/node_modules/zod/v4/locales/ta.cjs +0 -137
  685. package/node_modules/zod/v4/locales/ta.d.cts +0 -5
  686. package/node_modules/zod/v4/locales/ta.d.ts +0 -4
  687. package/node_modules/zod/v4/locales/ta.js +0 -110
  688. package/node_modules/zod/v4/locales/th.cjs +0 -137
  689. package/node_modules/zod/v4/locales/th.d.cts +0 -5
  690. package/node_modules/zod/v4/locales/th.d.ts +0 -4
  691. package/node_modules/zod/v4/locales/th.js +0 -110
  692. package/node_modules/zod/v4/locales/tr.cjs +0 -132
  693. package/node_modules/zod/v4/locales/tr.d.cts +0 -5
  694. package/node_modules/zod/v4/locales/tr.d.ts +0 -4
  695. package/node_modules/zod/v4/locales/tr.js +0 -105
  696. package/node_modules/zod/v4/locales/ua.cjs +0 -12
  697. package/node_modules/zod/v4/locales/ua.d.cts +0 -5
  698. package/node_modules/zod/v4/locales/ua.d.ts +0 -5
  699. package/node_modules/zod/v4/locales/ua.js +0 -5
  700. package/node_modules/zod/v4/locales/uk.cjs +0 -135
  701. package/node_modules/zod/v4/locales/uk.d.cts +0 -5
  702. package/node_modules/zod/v4/locales/uk.d.ts +0 -4
  703. package/node_modules/zod/v4/locales/uk.js +0 -108
  704. package/node_modules/zod/v4/locales/ur.cjs +0 -137
  705. package/node_modules/zod/v4/locales/ur.d.cts +0 -5
  706. package/node_modules/zod/v4/locales/ur.d.ts +0 -4
  707. package/node_modules/zod/v4/locales/ur.js +0 -110
  708. package/node_modules/zod/v4/locales/uz.cjs +0 -137
  709. package/node_modules/zod/v4/locales/uz.d.cts +0 -5
  710. package/node_modules/zod/v4/locales/uz.d.ts +0 -4
  711. package/node_modules/zod/v4/locales/uz.js +0 -110
  712. package/node_modules/zod/v4/locales/vi.cjs +0 -135
  713. package/node_modules/zod/v4/locales/vi.d.cts +0 -5
  714. package/node_modules/zod/v4/locales/vi.d.ts +0 -4
  715. package/node_modules/zod/v4/locales/vi.js +0 -108
  716. package/node_modules/zod/v4/locales/yo.cjs +0 -134
  717. package/node_modules/zod/v4/locales/yo.d.cts +0 -5
  718. package/node_modules/zod/v4/locales/yo.d.ts +0 -4
  719. package/node_modules/zod/v4/locales/yo.js +0 -107
  720. package/node_modules/zod/v4/locales/zh-CN.cjs +0 -136
  721. package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  722. package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  723. package/node_modules/zod/v4/locales/zh-CN.js +0 -109
  724. package/node_modules/zod/v4/locales/zh-TW.cjs +0 -134
  725. package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  726. package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  727. package/node_modules/zod/v4/locales/zh-TW.js +0 -107
  728. package/node_modules/zod/v4/mini/checks.cjs +0 -34
  729. package/node_modules/zod/v4/mini/checks.d.cts +0 -1
  730. package/node_modules/zod/v4/mini/checks.d.ts +0 -1
  731. package/node_modules/zod/v4/mini/checks.js +0 -1
  732. package/node_modules/zod/v4/mini/coerce.cjs +0 -52
  733. package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  734. package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  735. package/node_modules/zod/v4/mini/coerce.js +0 -22
  736. package/node_modules/zod/v4/mini/external.cjs +0 -63
  737. package/node_modules/zod/v4/mini/external.d.cts +0 -13
  738. package/node_modules/zod/v4/mini/external.d.ts +0 -13
  739. package/node_modules/zod/v4/mini/external.js +0 -14
  740. package/node_modules/zod/v4/mini/index.cjs +0 -32
  741. package/node_modules/zod/v4/mini/index.d.cts +0 -3
  742. package/node_modules/zod/v4/mini/index.d.ts +0 -3
  743. package/node_modules/zod/v4/mini/index.js +0 -3
  744. package/node_modules/zod/v4/mini/iso.cjs +0 -64
  745. package/node_modules/zod/v4/mini/iso.d.cts +0 -22
  746. package/node_modules/zod/v4/mini/iso.d.ts +0 -22
  747. package/node_modules/zod/v4/mini/iso.js +0 -34
  748. package/node_modules/zod/v4/mini/package.json +0 -7
  749. package/node_modules/zod/v4/mini/parse.cjs +0 -16
  750. package/node_modules/zod/v4/mini/parse.d.cts +0 -1
  751. package/node_modules/zod/v4/mini/parse.d.ts +0 -1
  752. package/node_modules/zod/v4/mini/parse.js +0 -1
  753. package/node_modules/zod/v4/mini/schemas.cjs +0 -1083
  754. package/node_modules/zod/v4/mini/schemas.d.cts +0 -445
  755. package/node_modules/zod/v4/mini/schemas.d.ts +0 -445
  756. package/node_modules/zod/v4/mini/schemas.js +0 -961
  757. package/node_modules/zod/v4/package.json +0 -7
  758. package/node_modules/zod/v4-mini/index.cjs +0 -32
  759. package/node_modules/zod/v4-mini/index.d.cts +0 -3
  760. package/node_modules/zod/v4-mini/index.d.ts +0 -3
  761. package/node_modules/zod/v4-mini/index.js +0 -3
  762. package/node_modules/zod/v4-mini/package.json +0 -7
  763. /package/dist/{rolldown-runtime-D7D4PA-g.js → .setup/rolldown-runtime-D7D4PA-g.mjs} +0 -0
@@ -1,51 +1,44 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { i as resolveSignalAccount, o as resolveSignalReplyToMode } from "./accounts-DrStJjiK.js";
3
- import { a as normalizeSignalAllowRecipient, c as resolveSignalSender, d as normalizeSignalMessagingTarget, i as isSignalSenderAllowed, l as looksLikeUuid, n as formatSignalSenderDisplay, o as resolveSignalPeerId, r as formatSignalSenderId, s as resolveSignalRecipient, t as formatSignalPairingIdLine } from "./identity-BQ4OzXXk.js";
4
- import { t as getOptionalSignalRuntime } from "./runtime-JPrGlV7h.js";
5
- import { i as materializeSignalPresentationFallback, n as registerSignalReplyContext, o as resolveSignalReactionLevel, s as formatSignalMediaText, u as isSignalNativeApprovalHandlerConfigured } from "./transport-detection-Da06-LOL.js";
6
- import { n as signalRpcRequest, r as streamSignalEvents, t as signalCheck } from "./client-adapter-mXGeEHQJ.js";
7
- import { n as sendReactionSignal } from "./reaction-runtime-api-BjeDyKcz.js";
8
- import { a as maybeResolveSignalApprovalReaction, l as resolveSignalApprovalConversationKey, s as registerSignalApprovalReactionTargetForDeliveredPayload, t as addSignalApprovalReactionHintToStructuredPayload } from "./approval-reactions-DtL47gSK.js";
9
- import { r as registerSignalQuestionReactionTargetForDeliveredPayload, t as maybeResolveSignalQuestionReaction } from "./question-reactions-Ds48FtEu.js";
10
- import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-B_Ks4MZr.js";
11
- import { bindIngressLifecycleToReplyOptions, createChannelIngressMonitor, createChannelMessageReplyPipeline, resolveChannelStreamingBlockEnabled } from "openclaw/plugin-sdk/channel-outbound";
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
+ import { a as resolveSignalReplyToMode, i as resolveSignalAccount } from "./accounts-Bz4HtP0g.mjs";
3
+ import { a as normalizeSignalAllowRecipient, c as resolveSignalSender, d as normalizeSignalMessagingTarget, i as isSignalSenderAllowed, l as looksLikeUuid, n as formatSignalSenderDisplay, o as resolveSignalPeerId, r as formatSignalSenderId, s as resolveSignalRecipient, t as formatSignalPairingIdLine } from "./identity-C8-yk4J9.mjs";
4
+ import { a as isSignalNativeApprovalHandlerConfigured, n as resolveSignalReactionLevel } from "./message-actions-Cplx3XNC.mjs";
5
+ import { n as signalRpcRequest, r as streamSignalEvents, t as signalCheck } from "./client-adapter-BiGMiCr4.mjs";
6
+ import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-CAxalUfb.mjs";
7
+ import { a as maybeResolveSignalApprovalReaction, l as resolveSignalApprovalConversationKey, s as registerSignalApprovalReactionTargetForDeliveredPayload, t as addSignalApprovalReactionHintToStructuredPayload } from "./approval-reactions-DoY1BVpl.mjs";
8
+ import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-CF_VPaZJ.mjs";
9
+ import { createChannelMessageReplyPipeline } from "openclaw/plugin-sdk/channel-outbound";
12
10
  import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
13
11
  import { detectMime, estimateBase64DecodedBytes, kindFromMime, saveMediaBuffer } from "openclaw/plugin-sdk/media-runtime";
14
12
  import { resolveAgentRoute, resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
15
13
  import { normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
16
14
  import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
17
15
  import { normalizeE164, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
18
- import { buildChannelInboundEventContext, buildMentionRegexes, createChannelInboundDebouncer, filterChannelInboundQuoteContext, formatInboundEnvelope, formatInboundFromLabel, formatInboundMediaUnavailableText, hasVisibleInboundReplyDispatch, logInboundDrop, matchesMentionPatterns, resolveEnvelopeFormatOptions, resolveInboundMentionDecision, resolveInboundSupplementalSenderAllowed, runChannelInboundEvent, shouldDebounceTextInbound, toHistoryMediaEntries, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
19
16
  import nodePath from "node:path";
20
- import { collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
21
17
  import { resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
22
18
  import { resolveChannelGroupPolicy, resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
23
19
  import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
24
20
  import { DEFAULT_GROUP_HISTORY_LIMIT, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
25
21
  import { deliverTextOrMediaReply, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
26
- import { chunkTextWithMode, createReplyReferencePlanner, resolveChunkMode, resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-runtime";
22
+ import { chunkTextWithMode, createReplyDispatcherWithTyping, createReplyReferencePlanner, dispatchInboundMessage, resolveChunkMode, resolveTextChunkLimit, settleReplyDispatcher } from "openclaw/plugin-sdk/reply-runtime";
27
23
  import { getRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
28
- import { computeBackoff, createNonExitingRuntime, danger, logVerbose, shouldLogVerbose, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
24
+ import { computeBackoff, createNonExitingRuntime, danger, logVerbose, shouldLogVerbose, sleep, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
29
25
  import { resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
30
26
  import { waitForTransportReady } from "openclaw/plugin-sdk/transport-ready-runtime";
31
27
  import { spawn } from "node:child_process";
32
28
  import os from "node:os";
33
29
  import { createInterface } from "node:readline";
34
- import { setTimeout as setTimeout$1 } from "node:timers/promises";
35
30
  import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
36
31
  import { DEFAULT_EMOJIS, DEFAULT_TIMING, createStatusReactionController, logAckFailure, logTypingFailure, resolveAckReaction, shouldAckReaction } from "openclaw/plugin-sdk/channel-feedback";
37
- import { createChannelIngressResolver, defineStableChannelIngressIdentity, fanInChannelIngressLifecycles } from "openclaw/plugin-sdk/channel-ingress-runtime";
38
- import { isControlCommandMessage } from "openclaw/plugin-sdk/command-detection";
32
+ import { buildChannelInboundEventContext, buildMentionRegexes, createChannelInboundDebouncer, filterChannelInboundQuoteContext, formatInboundEnvelope, formatInboundFromLabel, formatInboundMediaUnavailableText, hasVisibleInboundReplyDispatch, logInboundDrop, matchesMentionPatterns, resolveEnvelopeFormatOptions, resolveInboundMentionDecision, runChannelInboundEvent, shouldDebounceTextInbound } from "openclaw/plugin-sdk/channel-inbound";
33
+ import { hasControlCommand } from "openclaw/plugin-sdk/command-auth-native";
34
+ import { recordInboundSession, upsertChannelPairingRequest } from "openclaw/plugin-sdk/conversation-runtime";
39
35
  import { createInternalHookEvent, fireAndForgetHook, toInternalMessageReceivedContext, triggerInternalHook } from "openclaw/plugin-sdk/hook-runtime";
40
36
  import { resolveBatchedReplyThreadingPolicy } from "openclaw/plugin-sdk/reply-reference";
41
37
  import { readSessionUpdatedAt, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
42
38
  import { enqueueSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
43
- import { upsertChannelPairingRequest } from "openclaw/plugin-sdk/conversation-runtime";
44
- import { listChatCommands, maybeResolveTextAlias, normalizeCommandBody } from "openclaw/plugin-sdk/command-auth-native";
45
- import { isAbortRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
39
+ import { createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
46
40
  import { resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
47
41
  //#region extensions/signal/src/daemon.ts
48
- const SIGNAL_DAEMON_STOP_KILL_TIMEOUT_MS = 1500;
49
42
  function formatSignalDaemonExit(exit) {
50
43
  return `signal daemon exited (source=${exit.source} code=${exit.code ?? "null"} signal=${exit.signal ?? "null"})`;
51
44
  }
@@ -98,7 +91,6 @@ function spawnSignalDaemon(opts) {
98
91
  const error = opts.runtime?.error ?? (() => {});
99
92
  let exited = false;
100
93
  let settledExit = false;
101
- let stopPromise;
102
94
  let resolveExit;
103
95
  const exitedPromise = new Promise((resolve) => {
104
96
  resolveExit = resolve;
@@ -139,42 +131,19 @@ function spawnSignalDaemon(opts) {
139
131
  });
140
132
  });
141
133
  child.on("error", (err) => {
142
- if (child.pid === void 0) {
143
- error(`signal-cli spawn error: ${String(err)}`);
144
- settleExit({
145
- source: "spawn-error",
146
- code: null,
147
- signal: null
148
- });
149
- } else error(`signal-cli process error: ${String(err)}`);
134
+ error(`signal-cli spawn error: ${String(err)}`);
135
+ settleExit({
136
+ source: "spawn-error",
137
+ code: null,
138
+ signal: null
139
+ });
150
140
  });
151
141
  return {
152
142
  pid: child.pid ?? void 0,
153
143
  exited: exitedPromise,
154
144
  isExited: () => exited,
155
145
  stop: () => {
156
- if (exited) return Promise.resolve();
157
- if (stopPromise) return stopPromise;
158
- if (!child.killed) try {
159
- child.kill("SIGTERM");
160
- } catch (err) {
161
- error(`signal-cli stop error: ${String(err)}`);
162
- }
163
- stopPromise = new Promise((resolve) => {
164
- const timeout = setTimeout(() => {
165
- if (!exited) try {
166
- child.kill("SIGKILL");
167
- } catch (err) {
168
- error(`signal-cli force-stop error: ${String(err)}`);
169
- }
170
- }, SIGNAL_DAEMON_STOP_KILL_TIMEOUT_MS);
171
- timeout.unref?.();
172
- exitedPromise.then(() => {
173
- clearTimeout(timeout);
174
- resolve();
175
- });
176
- });
177
- return stopPromise;
146
+ if (!child.killed && !exited) child.kill("SIGTERM");
178
147
  }
179
148
  };
180
149
  }
@@ -245,8 +214,8 @@ function signalSubjectInput(params) {
245
214
  return {
246
215
  stableId: formatSignalSenderId(params.sender),
247
216
  aliases: {
248
- phone: params.sender.kind === "phone" ? params.sender.e164 : params.sender.aliases?.e164,
249
- uuid: params.sender.kind === "uuid" ? params.sender.raw : params.sender.aliases?.uuid,
217
+ phone: params.sender.kind === "phone" ? params.sender.e164 : void 0,
218
+ uuid: params.sender.kind === "uuid" ? params.sender.raw : void 0,
250
219
  group: params.groupId
251
220
  }
252
221
  };
@@ -312,96 +281,6 @@ async function handleSignalDirectMessageAccess(params) {
312
281
  return false;
313
282
  }
314
283
  //#endregion
315
- //#region extensions/signal/src/monitor/event-handler.control-lane.ts
316
- const SIGNAL_ACTIVE_RUN_CONTROL_COMMAND_KEYS = /* @__PURE__ */ new Set([
317
- "approve",
318
- "commands",
319
- "context",
320
- "help",
321
- "status",
322
- "steer",
323
- "tasks",
324
- "tools",
325
- "whoami"
326
- ]);
327
- function resolveSignalConversationId(entry) {
328
- return (entry.isGroup ? entry.groupId : entry.senderPeerId)?.trim() || null;
329
- }
330
- function resolveSignalInboundDebounceKey(accountId, entry) {
331
- const conversationId = resolveSignalConversationId(entry);
332
- if (!conversationId || !entry.senderPeerId) return null;
333
- return `signal:${accountId}:${conversationId}:${entry.senderPeerId}`;
334
- }
335
- function resolveSignalInboundConversationKey(accountId, entry) {
336
- const conversationId = resolveSignalConversationId(entry);
337
- return conversationId ? `signal:${accountId}:${conversationId}` : null;
338
- }
339
- function isSignalActiveRunControlText(text) {
340
- if (isAbortRequestText(text)) return true;
341
- const normalizedBody = normalizeCommandBody(text.trim());
342
- const alias = maybeResolveTextAlias(normalizedBody);
343
- if (!alias) return false;
344
- const command = listChatCommands().find((entry) => entry.textAliases.some((candidate) => candidate.trim().toLowerCase() === alias));
345
- if (command?.key === "queue") return normalizedBody.slice(alias.length).trim() === "";
346
- return command ? SIGNAL_ACTIVE_RUN_CONTROL_COMMAND_KEYS.has(command.key) : false;
347
- }
348
- function resolveSignalControlLaneKey(accountId, entry) {
349
- if (!entry.commandAuthorized || !isSignalActiveRunControlText(entry.commandBody)) return null;
350
- const conversationId = resolveSignalConversationId(entry);
351
- return conversationId ? `signal:${accountId}:${conversationId}:control` : null;
352
- }
353
- function createSignalPendingInboundRegistry(accountId) {
354
- const trackedEntries = /* @__PURE__ */ new WeakMap();
355
- const countsByConversation = /* @__PURE__ */ new Map();
356
- const track = (entry) => {
357
- if (trackedEntries.has(entry)) return;
358
- const conversationKey = resolveSignalInboundConversationKey(accountId, entry);
359
- const inboundKey = resolveSignalInboundDebounceKey(accountId, entry);
360
- if (!conversationKey || !inboundKey) return;
361
- const counts = countsByConversation.get(conversationKey) ?? /* @__PURE__ */ new Map();
362
- counts.set(inboundKey, (counts.get(inboundKey) ?? 0) + 1);
363
- countsByConversation.set(conversationKey, counts);
364
- trackedEntries.set(entry, {
365
- conversationKey,
366
- inboundKey
367
- });
368
- };
369
- const complete = (entries) => {
370
- for (const entry of entries) {
371
- const tracked = trackedEntries.get(entry);
372
- if (!tracked) continue;
373
- trackedEntries.delete(entry);
374
- const counts = countsByConversation.get(tracked.conversationKey);
375
- const nextCount = (counts?.get(tracked.inboundKey) ?? 0) - 1;
376
- if (nextCount > 0) {
377
- counts?.set(tracked.inboundKey, nextCount);
378
- continue;
379
- }
380
- counts?.delete(tracked.inboundKey);
381
- if (counts?.size === 0) countsByConversation.delete(tracked.conversationKey);
382
- }
383
- };
384
- const cancelPendingOnAbort = (entry, cancelKey) => {
385
- if (!entry.commandAuthorized || !isAbortRequestText(entry.commandBody)) return;
386
- const conversationKey = resolveSignalInboundConversationKey(accountId, entry);
387
- if (!conversationKey) return;
388
- for (const inboundKey of countsByConversation.get(conversationKey)?.keys() ?? []) cancelKey(inboundKey);
389
- };
390
- const completeAfter = (flush) => async (entries) => {
391
- try {
392
- await flush(entries);
393
- } finally {
394
- complete(entries);
395
- }
396
- };
397
- return {
398
- track,
399
- complete,
400
- completeAfter,
401
- cancelPendingOnAbort
402
- };
403
- }
404
- //#endregion
405
284
  //#region extensions/signal/src/monitor/inbound-context.ts
406
285
  function resolveSignalQuoteContext(params) {
407
286
  const contextVisibilityMode = resolveChannelContextVisibilityMode({
@@ -414,12 +293,7 @@ function resolveSignalQuoteContext(params) {
414
293
  sourceNumber: params.dataMessage?.quote?.author ?? null,
415
294
  sourceUuid: params.dataMessage?.quote?.authorUuid ?? null
416
295
  });
417
- const quoteSenderAllowed = resolveInboundSupplementalSenderAllowed({
418
- isGroup: params.isGroup,
419
- groupPolicy: params.effectiveGroupAllow.length === 0 ? "open" : "allowlist",
420
- allowFrom: params.effectiveGroupAllow,
421
- isSenderAllowed: (allowFrom) => quoteSender ? isSignalSenderAllowed(quoteSender, allowFrom) : false
422
- });
296
+ const quoteSenderAllowed = !params.isGroup || params.effectiveGroupAllow.length === 0 ? true : quoteSender ? isSignalSenderAllowed(quoteSender, params.effectiveGroupAllow) : false;
423
297
  const visibleQuote = filterChannelInboundQuoteContext(contextVisibilityMode, {
424
298
  body: quoteText,
425
299
  sender: quoteSender ? formatSignalSenderDisplay(quoteSender) : void 0,
@@ -454,41 +328,6 @@ function clampBounds(start, length, textLength) {
454
328
  end: Math.min(textLength, safeStart + Math.max(0, Math.trunc(length)))
455
329
  };
456
330
  }
457
- function isValidStructuredMention(message, mention) {
458
- if (!mention || !(mention.uuid || mention.number)) return false;
459
- const { start, length } = mention;
460
- if (typeof start !== "number" || typeof length !== "number") return false;
461
- return Number.isInteger(start) && Number.isInteger(length) && start >= 0 && length > 0 && start + length <= message.length;
462
- }
463
- function normalizeAccountPhone(account) {
464
- const trimmed = account?.trim();
465
- return trimmed ? normalizeE164(trimmed) : void 0;
466
- }
467
- function resolveSignalNativeMentionFacts(params) {
468
- const validMentions = (params.mentions ?? []).filter((mention) => isValidStructuredMention(params.message, mention));
469
- const botUuid = params.accountUuid?.trim();
470
- const botPhone = normalizeAccountPhone(params.account);
471
- const canDetectBotMention = Boolean(botUuid || botPhone);
472
- const mentionsBot = validMentions.some((mention) => {
473
- const mentionUuid = mention.uuid?.trim();
474
- if (botUuid && mentionUuid === botUuid) return true;
475
- const mentionNumber = mention.number?.trim();
476
- return Boolean(botPhone && mentionNumber && normalizeE164(mentionNumber) === botPhone);
477
- });
478
- return {
479
- canDetectBotMention,
480
- hasAnyMention: validMentions.length > 0,
481
- mentionsBot
482
- };
483
- }
484
- function resolveSignalMentionFacts(identity, message, mentions) {
485
- return resolveSignalNativeMentionFacts({
486
- message,
487
- mentions,
488
- account: identity.account,
489
- accountUuid: identity.accountUuid
490
- });
491
- }
492
331
  function renderSignalMentions(message, mentions) {
493
332
  if (!message || !mentions?.length) return message;
494
333
  let normalized = message;
@@ -505,14 +344,17 @@ function renderSignalMentions(message, mentions) {
505
344
  }
506
345
  //#endregion
507
346
  //#region extensions/signal/src/monitor/event-handler.ts
508
- const REPLY_SESSION_INIT_CONFLICT_MESSAGE_RE = /reply session initialization conflicted for \S+/u;
509
- const RETRYABLE_FLUSH_RETRY_DELAYS_MS = [
510
- 1e3,
511
- 2e3,
512
- 4e3
513
- ];
514
- function isSignalReplySessionInitConflictError(error) {
515
- return collectErrorGraphCandidates(error, (current) => [current.cause, current.error]).some((candidate) => REPLY_SESSION_INIT_CONFLICT_MESSAGE_RE.test(formatErrorMessage(candidate)));
347
+ function formatAttachmentKindCount(kind, count) {
348
+ if (kind === "attachment") return `${count} file${count > 1 ? "s" : ""}`;
349
+ return `${count} ${kind}${count > 1 ? "s" : ""}`;
350
+ }
351
+ function formatAttachmentSummaryPlaceholder(contentTypes) {
352
+ const kindCounts = /* @__PURE__ */ new Map();
353
+ for (const contentType of contentTypes) {
354
+ const kind = kindFromMime(contentType) ?? "attachment";
355
+ kindCounts.set(kind, (kindCounts.get(kind) ?? 0) + 1);
356
+ }
357
+ return `[${[...kindCounts.entries()].map(([kind, count]) => formatAttachmentKindCount(kind, count)).join(" + ")} attached]`;
516
358
  }
517
359
  function resolveSignalInboundRoute(params) {
518
360
  return resolveAgentRoute({
@@ -542,13 +384,26 @@ function resolveSignalStatusReactionEmojis(emojis) {
542
384
  };
543
385
  }
544
386
  async function finalizeSignalStatusReaction(params) {
545
- if (params.outcome === "done") await params.controller.setDone();
546
- else await params.controller.setError();
387
+ if (params.outcome === "done") {
388
+ await params.controller.setDone();
389
+ if (params.removeAckAfterReply) {
390
+ await sleep(params.timing.doneHoldMs);
391
+ await params.controller.clear();
392
+ } else await params.controller.restoreInitial();
393
+ return;
394
+ }
395
+ await params.controller.setError();
396
+ if (params.hasFinalResponse) {
397
+ if (params.removeAckAfterReply) {
398
+ await sleep(params.timing.errorHoldMs);
399
+ await params.controller.clear();
400
+ } else await params.controller.restoreInitial();
401
+ return;
402
+ }
403
+ if (params.removeAckAfterReply) await sleep(params.timing.errorHoldMs);
547
404
  await params.controller.restoreInitial();
548
405
  }
549
406
  function createSignalEventHandler(deps) {
550
- const statusReactionTiming = deps.statusReactionTiming ?? DEFAULT_TIMING;
551
- const activeEnqueueEntries = /* @__PURE__ */ new WeakSet();
552
407
  async function handleSignalInboundMessage(entry) {
553
408
  const fromLabel = formatInboundFromLabel({
554
409
  isGroup: entry.isGroup,
@@ -594,7 +449,7 @@ function createSignalEventHandler(deps) {
594
449
  channel: "Signal",
595
450
  from: fromLabel,
596
451
  timestamp: historyEntry.timestamp,
597
- body: `${[historyEntry.body, formatSignalMediaText(historyEntry.media ?? [])].filter(Boolean).join("\n")}${historyEntry.messageId ? ` [id:${historyEntry.messageId}]` : ""}`,
452
+ body: `${historyEntry.body}${historyEntry.messageId ? ` [id:${historyEntry.messageId}]` : ""}`,
598
453
  chatType: "group",
599
454
  senderLabel: historyEntry.sender,
600
455
  envelope: envelopeOptions
@@ -606,13 +461,20 @@ function createSignalEventHandler(deps) {
606
461
  historyKey,
607
462
  limit: deps.historyLimit
608
463
  }) : void 0;
609
- const replyToMode = resolveSignalReplyToMode({
464
+ const replyThreading = resolveBatchedReplyThreadingPolicy(resolveSignalReplyToMode({
610
465
  cfg: deps.cfg,
611
466
  accountId: deps.accountId,
612
467
  chatType: entry.isGroup ? "group" : "direct"
613
- });
614
- const replyThreading = resolveBatchedReplyThreadingPolicy(replyToMode, entry.isBatched === true);
615
- const media = toInboundMediaFacts(entry.media);
468
+ }), entry.isBatched === true);
469
+ const media = entry.mediaPaths && entry.mediaPaths.length > 0 ? entry.mediaPaths.map((path, index) => ({
470
+ path,
471
+ url: path,
472
+ contentType: entry.mediaTypes?.[index]
473
+ })) : entry.mediaPath ? [{
474
+ path: entry.mediaPath,
475
+ url: entry.mediaPath,
476
+ contentType: entry.mediaType
477
+ }] : void 0;
616
478
  const ctxPayload = buildChannelInboundEventContext({
617
479
  channel: "signal",
618
480
  supplemental: { quote: entry.replyToBody ? {
@@ -634,7 +496,6 @@ function createSignalEventHandler(deps) {
634
496
  },
635
497
  route: {
636
498
  agentId: route.agentId,
637
- dmScope: route.dmScope,
638
499
  accountId: route.accountId,
639
500
  routeSessionKey: route.sessionKey
640
501
  },
@@ -649,7 +510,6 @@ function createSignalEventHandler(deps) {
649
510
  rawBody: entry.commandBody,
650
511
  commandBody: entry.commandBody
651
512
  },
652
- sessionTranscript: { historyLimit: entry.isGroup ? deps.historyLimit : 0 },
653
513
  access: {
654
514
  ...entry.isGroup ? { mentions: {
655
515
  canDetectMention: true,
@@ -698,14 +558,23 @@ function createSignalEventHandler(deps) {
698
558
  } : {}
699
559
  };
700
560
  const statusReactionRecipient = entry.isGroup ? "" : entry.senderRecipient;
561
+ let currentStatusReactionEmoji = ackReaction;
701
562
  const statusReactionController = statusReactionsConfig?.enabled === true && signalReactionLevel.level !== "off" && shouldSendStatusReaction && statusReactionTimestamp ? createStatusReactionController({
702
563
  enabled: true,
703
- adapter: { setReaction: async (emoji) => {
704
- await sendReactionSignal(statusReactionRecipient, statusReactionTimestamp, emoji, signalReactionOpts);
705
- } },
564
+ adapter: {
565
+ setReaction: async (emoji) => {
566
+ await sendReactionSignal(statusReactionRecipient, statusReactionTimestamp, emoji, signalReactionOpts);
567
+ currentStatusReactionEmoji = emoji;
568
+ },
569
+ clearReaction: async () => {
570
+ if (!currentStatusReactionEmoji) return;
571
+ await removeReactionSignal(statusReactionRecipient, statusReactionTimestamp, currentStatusReactionEmoji, signalReactionOpts);
572
+ currentStatusReactionEmoji = "";
573
+ }
574
+ },
706
575
  initialEmoji: ackReaction,
707
- emojis: resolveSignalStatusReactionEmojis(void 0),
708
- timing: statusReactionTiming,
576
+ emojis: resolveSignalStatusReactionEmojis(statusReactionsConfig.emojis),
577
+ timing: statusReactionsConfig.timing,
709
578
  onError: (err) => {
710
579
  logAckFailure({
711
580
  log: logVerbose,
@@ -715,6 +584,10 @@ function createSignalEventHandler(deps) {
715
584
  });
716
585
  }
717
586
  }) : null;
587
+ const statusReactionTiming = {
588
+ ...DEFAULT_TIMING,
589
+ ...statusReactionsConfig?.timing
590
+ };
718
591
  if (statusReactionController) statusReactionController.setQueued();
719
592
  const { onModelSelected, typingCallbacks, ...replyPipeline } = createChannelMessageReplyPipeline({
720
593
  cfg: deps.cfg,
@@ -745,15 +618,12 @@ function createSignalEventHandler(deps) {
745
618
  replyToId: ctxPayload.ReplyToId,
746
619
  author: entry.senderRecipient,
747
620
  body: entry.nativeReplyBody ?? entry.bodyText,
748
- allowImplicitCurrentMessage: replyToMode !== "off" && replyThreading?.implicitCurrentMessage !== "deny",
749
621
  state: { hasReplied: false }
750
622
  };
751
- const dispatcherOptions = {
623
+ const { dispatcher, replyOptions, markDispatchIdle } = createReplyDispatcherWithTyping({
752
624
  ...replyPipeline,
753
625
  humanDelay: resolveHumanDelayConfig(deps.cfg, route.agentId),
754
- typingCallbacks
755
- };
756
- const delivery = {
626
+ typingCallbacks,
757
627
  deliver: async (payload, _info) => {
758
628
  await deps.deliverReplies({
759
629
  cfg: deps.cfg,
@@ -773,7 +643,7 @@ function createSignalEventHandler(deps) {
773
643
  onError: (err, info) => {
774
644
  deps.runtime.error?.(danger(`signal ${info.kind} reply failed: ${String(err)}`));
775
645
  }
776
- };
646
+ });
777
647
  const inboundLastRouteSessionKey = resolveInboundLastRouteSessionKey({
778
648
  route,
779
649
  sessionKey: route.sessionKey
@@ -790,14 +660,12 @@ function createSignalEventHandler(deps) {
790
660
  raw: entry
791
661
  }),
792
662
  resolveTurn: () => ({
793
- cfg: deps.cfg,
794
663
  channel: "signal",
795
664
  accountId: route.accountId,
796
- route: {
797
- agentId: route.agentId,
798
- sessionKey: route.sessionKey
799
- },
665
+ routeSessionKey: route.sessionKey,
666
+ storePath,
800
667
  ctxPayload,
668
+ recordInboundSession,
801
669
  record: {
802
670
  updateLastRoute: !entry.isGroup ? {
803
671
  sessionKey: inboundLastRouteSessionKey,
@@ -831,31 +699,41 @@ function createSignalEventHandler(deps) {
831
699
  historyMap: deps.groupHistories,
832
700
  limit: deps.historyLimit
833
701
  },
834
- afterRecord: () => {
835
- if (statusReactionController) statusReactionController.setThinking();
836
- },
837
- dispatcherOptions,
838
- delivery,
839
- sessionInitRetry: { delaysMs: [] },
840
- replyOptions: {
841
- ...entry.turnAdoptionLifecycle ? bindIngressLifecycleToReplyOptions(entry.turnAdoptionLifecycle) : {},
842
- disableBlockStreaming: typeof deps.blockStreaming === "boolean" ? !deps.blockStreaming : void 0,
843
- ...statusReactionController ? {
844
- allowProgressCallbacksWhenSourceDeliverySuppressed: true,
845
- allowToolLifecycleWhenProgressHidden: true,
846
- onToolStart: async (payload) => {
847
- const toolName = payload.name?.trim();
848
- if (toolName) await statusReactionController.setTool(toolName);
849
- },
850
- onCompactionStart: async () => {
851
- await statusReactionController.setCompacting();
852
- },
853
- onCompactionEnd: async () => {
854
- statusReactionController.cancelPending();
855
- await statusReactionController.setThinking();
856
- }
857
- } : {},
858
- onModelSelected
702
+ onPreDispatchFailure: () => settleReplyDispatcher({
703
+ dispatcher,
704
+ onSettled: () => markDispatchIdle()
705
+ }),
706
+ runDispatch: async () => {
707
+ try {
708
+ if (statusReactionController) statusReactionController.setThinking();
709
+ return await dispatchInboundMessage({
710
+ ctx: ctxPayload,
711
+ cfg: deps.cfg,
712
+ dispatcher,
713
+ replyOptions: {
714
+ ...replyOptions,
715
+ disableBlockStreaming: typeof deps.blockStreaming === "boolean" ? !deps.blockStreaming : void 0,
716
+ ...statusReactionController ? {
717
+ allowProgressCallbacksWhenSourceDeliverySuppressed: true,
718
+ allowToolLifecycleWhenProgressHidden: true,
719
+ onToolStart: async (payload) => {
720
+ const toolName = payload.name?.trim();
721
+ if (toolName) await statusReactionController.setTool(toolName);
722
+ },
723
+ onCompactionStart: async () => {
724
+ await statusReactionController.setCompacting();
725
+ },
726
+ onCompactionEnd: async () => {
727
+ statusReactionController.cancelPending();
728
+ await statusReactionController.setThinking();
729
+ }
730
+ } : {},
731
+ onModelSelected
732
+ }
733
+ });
734
+ } finally {
735
+ markDispatchIdle();
736
+ }
859
737
  }
860
738
  }),
861
739
  onFinalize: (result) => {
@@ -864,7 +742,10 @@ function createSignalEventHandler(deps) {
864
742
  const hasDeliveryFailure = result.dispatched && hasSignalStatusReplyDeliveryFailure(result.dispatchResult);
865
743
  finalizeSignalStatusReaction({
866
744
  controller: statusReactionController,
867
- outcome: hasFinalResponse && !hasDeliveryFailure ? "done" : "error"
745
+ outcome: hasFinalResponse && !hasDeliveryFailure ? "done" : "error",
746
+ hasFinalResponse,
747
+ removeAckAfterReply: deps.cfg.messages?.removeAckAfterReply ?? false,
748
+ timing: statusReactionTiming
868
749
  }).catch((err) => {
869
750
  logVerbose(`signal: status reaction finalize failed: ${String(err)}`);
870
751
  });
@@ -872,102 +753,46 @@ function createSignalEventHandler(deps) {
872
753
  }
873
754
  });
874
755
  }
875
- async function flushSignalInboundEntries(entries) {
876
- const last = entries.at(-1);
877
- if (!last) return;
878
- const { lifecycle, settle } = fanInChannelIngressLifecycles(entries.map((entry) => entry.turnAdoptionLifecycle));
879
- if (entries.length === 1) {
880
- await handleSignalInboundMessage(lifecycle ? {
881
- ...last,
882
- turnAdoptionLifecycle: lifecycle
883
- } : last);
884
- await settle();
885
- return;
886
- }
887
- const combinedText = entries.map((entry) => entry.bodyText).filter(Boolean).join("\n");
888
- const combinedCommandBody = entries.map((entry) => entry.commandBody).filter(Boolean).join("\n");
889
- if (!combinedText.trim()) {
890
- await settle();
891
- return;
892
- }
893
- await handleSignalInboundMessage({
894
- ...last,
895
- bodyText: combinedText,
896
- commandBody: combinedCommandBody,
897
- ...lifecycle ? { turnAdoptionLifecycle: lifecycle } : {},
898
- isBatched: true,
899
- nativeReplyBody: last.nativeReplyBody ?? last.bodyText,
900
- media: entries.flatMap((entry) => entry.media ?? [])
901
- });
902
- await settle();
903
- }
904
- async function retrySignalInboundFlush(entries, initialError) {
905
- let lastError = initialError;
906
- for (const [attemptIndex, delayMs] of RETRYABLE_FLUSH_RETRY_DELAYS_MS.entries()) {
907
- const attempt = attemptIndex + 1;
908
- logVerbose(`signal: reply session init conflict, retrying ${entries.length} inbound message(s) in ${delayMs}ms (attempt ${attempt}/${RETRYABLE_FLUSH_RETRY_DELAYS_MS.length})`);
909
- try {
910
- await setTimeout$1(delayMs, void 0, {
911
- ref: false,
912
- signal: deps.abortSignal
913
- });
914
- } catch (err) {
915
- if (deps.abortSignal?.aborted) return;
916
- throw err;
917
- }
918
- if (deps.abortSignal?.aborted) return;
919
- try {
920
- await flushSignalInboundEntries(entries);
756
+ const { debouncer: inboundDebouncer } = createChannelInboundDebouncer({
757
+ cfg: deps.cfg,
758
+ channel: "signal",
759
+ buildKey: (entry) => {
760
+ const conversationId = entry.isGroup ? entry.groupId ?? "unknown" : entry.senderPeerId;
761
+ if (!conversationId || !entry.senderPeerId) return null;
762
+ return `signal:${deps.accountId}:${conversationId}:${entry.senderPeerId}`;
763
+ },
764
+ shouldDebounce: (entry) => {
765
+ return shouldDebounceTextInbound({
766
+ text: entry.commandBody,
767
+ cfg: deps.cfg,
768
+ hasMedia: Boolean(entry.mediaPath || entry.mediaType || entry.mediaPaths?.length)
769
+ });
770
+ },
771
+ onFlush: async (entries) => {
772
+ const last = entries.at(-1);
773
+ if (!last) return;
774
+ if (entries.length === 1) {
775
+ await handleSignalInboundMessage(last);
921
776
  return;
922
- } catch (err) {
923
- if (deps.abortSignal?.aborted) return;
924
- lastError = err;
925
- if (!isSignalReplySessionInitConflictError(err)) throw err;
926
777
  }
927
- }
928
- throw lastError;
929
- }
930
- const flushDebouncedSignalInboundEntries = async (entries) => {
931
- if (!entries.some((entry) => activeEnqueueEntries.has(entry)) && deps.abortSignal?.aborted) return;
932
- try {
933
- await flushSignalInboundEntries(entries);
934
- } catch (err) {
935
- if (!isSignalReplySessionInitConflictError(err)) throw err;
936
- if (deps.abortSignal?.aborted) return;
937
- const retryTask = retrySignalInboundFlush(entries, err).catch(async (terminalError) => {
938
- await Promise.all(entries.map((entry) => Promise.resolve(entry.turnAdoptionLifecycle?.onAbandoned())));
939
- throw terminalError;
778
+ const combinedText = entries.map((entry) => entry.bodyText).filter(Boolean).join("\\n");
779
+ const combinedCommandBody = entries.map((entry) => entry.commandBody).filter(Boolean).join("\\n");
780
+ if (!combinedText.trim()) return;
781
+ await handleSignalInboundMessage({
782
+ ...last,
783
+ bodyText: combinedText,
784
+ commandBody: combinedCommandBody,
785
+ isBatched: true,
786
+ nativeReplyBody: last.nativeReplyBody ?? last.bodyText,
787
+ mediaPath: void 0,
788
+ mediaType: void 0,
789
+ mediaPaths: void 0,
790
+ mediaTypes: void 0
940
791
  });
941
- deps.runTrackedTask?.(() => retryTask.catch(() => void 0));
942
- await retryTask;
792
+ },
793
+ onError: (err) => {
794
+ deps.runtime.error?.(`signal debounce flush failed: ${String(err)}`);
943
795
  }
944
- };
945
- const reportSignalInboundFlushError = (err) => {
946
- deps.runtime.error?.(`signal debounce flush failed: ${String(err)}`);
947
- };
948
- const pendingInboundRegistry = createSignalPendingInboundRegistry(deps.accountId);
949
- const flushNormalSignalInboundEntries = pendingInboundRegistry.completeAfter(flushDebouncedSignalInboundEntries);
950
- const { debouncer } = createChannelInboundDebouncer({
951
- cfg: deps.cfg,
952
- channel: "signal",
953
- buildKey: (entry) => resolveSignalInboundDebounceKey(deps.accountId, entry),
954
- shouldDebounce: (entry) => shouldDebounceTextInbound({
955
- text: entry.commandBody,
956
- cfg: deps.cfg,
957
- hasMedia: entry.media?.some((media) => Boolean(media.path || media.url)) === true
958
- }),
959
- onFlush: flushNormalSignalInboundEntries,
960
- onError: reportSignalInboundFlushError,
961
- onCancel: pendingInboundRegistry.complete
962
- });
963
- const { debouncer: controlDebouncer } = createChannelInboundDebouncer({
964
- cfg: deps.cfg,
965
- channel: "signal",
966
- serializeImmediate: true,
967
- buildKey: (entry) => resolveSignalControlLaneKey(deps.accountId, entry),
968
- shouldDebounce: () => false,
969
- onFlush: flushDebouncedSignalInboundEntries,
970
- onError: reportSignalInboundFlushError
971
796
  });
972
797
  async function handleReactionOnlyInbound(params) {
973
798
  if (params.hasBodyContent) return false;
@@ -995,18 +820,6 @@ function createSignalEventHandler(deps) {
995
820
  logVerbose(`Blocked signal reaction sender ${params.senderDisplay} (${params.accessDecision.reasonCode})`);
996
821
  return true;
997
822
  }
998
- if (conversationKey && await maybeResolveSignalQuestionReaction({
999
- cfg: deps.cfg,
1000
- accountId: deps.accountId,
1001
- conversationKey,
1002
- messageId,
1003
- reactionKey: emojiLabel,
1004
- isRemove: Boolean(params.reaction.isRemove),
1005
- actorId: formatSignalSenderId(params.sender),
1006
- targetAuthor: params.reaction.targetAuthor,
1007
- targetAuthorUuid: params.reaction.targetAuthorUuid,
1008
- logDebug: logVerbose
1009
- })) return true;
1010
823
  const targets = deps.resolveSignalReactionTargets(params.reaction);
1011
824
  if (!deps.shouldEmitSignalReactionNotification({
1012
825
  mode: deps.reactionMode,
@@ -1046,7 +859,7 @@ function createSignalEventHandler(deps) {
1046
859
  });
1047
860
  return true;
1048
861
  }
1049
- return async (event, turnAdoptionLifecycle) => {
862
+ return async (event) => {
1050
863
  if (event.event !== "receive" || !event.data) return;
1051
864
  let payload;
1052
865
  try {
@@ -1065,11 +878,10 @@ function createSignalEventHandler(deps) {
1065
878
  if ("syncMessage" in envelope) return;
1066
879
  const dataMessage = envelope.dataMessage ?? envelope.editMessage?.dataMessage;
1067
880
  const reaction = deps.isSignalReactionMessage(envelope.reactionMessage) ? envelope.reactionMessage : deps.isSignalReactionMessage(dataMessage?.reaction) ? dataMessage?.reaction : null;
1068
- const rawMessage = dataMessage?.message ?? "";
1069
- const messageText = renderSignalMentions(rawMessage, dataMessage?.mentions).trim();
881
+ const messageText = renderSignalMentions(dataMessage?.message ?? "", dataMessage?.mentions).trim();
1070
882
  const groupId = dataMessage?.groupInfo?.groupId ?? reaction?.groupInfo?.groupId ?? void 0;
1071
883
  const isGroup = Boolean(groupId);
1072
- const hasControlCommandInMessage = isControlCommandMessage(messageText, deps.cfg);
884
+ const hasControlCommandInMessage = hasControlCommand(messageText, deps.cfg);
1073
885
  const senderDisplay = formatSignalSenderDisplay(sender);
1074
886
  const { senderAccess, commandAccess } = await resolveSignalAccessState({
1075
887
  accountId: deps.accountId,
@@ -1154,16 +966,8 @@ function createSignalEventHandler(deps) {
1154
966
  groupId,
1155
967
  senderPeerId
1156
968
  });
1157
- const inboundTimestamp = typeof envelope.timestamp === "number" ? envelope.timestamp : typeof dataMessage.timestamp === "number" ? dataMessage.timestamp : void 0;
1158
- const nativeReplyTargetTimestamp = typeof envelope.editMessage?.targetSentTimestamp === "number" ? envelope.editMessage.targetSentTimestamp : inboundTimestamp;
1159
- const messageId = typeof inboundTimestamp === "number" ? String(inboundTimestamp) : void 0;
1160
- const replyToId = typeof nativeReplyTargetTimestamp === "number" ? String(nativeReplyTargetTimestamp) : void 0;
1161
- const signalToRaw = isGroup ? `group:${groupId}` : `signal:${senderRecipient}`;
1162
- const signalTo = normalizeSignalMessagingTarget(signalToRaw) ?? signalToRaw;
1163
969
  const mentionRegexes = buildMentionRegexes(deps.cfg, route.agentId);
1164
- const textWasMentioned = isGroup && matchesMentionPatterns(messageText, mentionRegexes);
1165
- const nativeMentionFacts = resolveSignalMentionFacts(deps, rawMessage, dataMessage?.mentions);
1166
- const wasMentioned = isGroup && (textWasMentioned || nativeMentionFacts.mentionsBot);
970
+ const wasMentioned = isGroup && matchesMentionPatterns(messageText, mentionRegexes);
1167
971
  const requireMention = isGroup && resolveChannelGroupRequireMention({
1168
972
  cfg: deps.cfg,
1169
973
  channel: "signal",
@@ -1171,12 +975,12 @@ function createSignalEventHandler(deps) {
1171
975
  accountId: deps.accountId,
1172
976
  configuredGroupDefaultsToNoMention: true
1173
977
  });
1174
- const canDetectMention = mentionRegexes.length > 0 || nativeMentionFacts.canDetectBotMention;
978
+ const canDetectMention = mentionRegexes.length > 0;
1175
979
  const mentionDecision = resolveInboundMentionDecision({
1176
980
  facts: {
1177
981
  canDetectMention,
1178
982
  wasMentioned,
1179
- hasAnyMention: nativeMentionFacts.hasAnyMention,
983
+ hasAnyMention: false,
1180
984
  implicitMentionKinds: []
1181
985
  },
1182
986
  policy: {
@@ -1195,36 +999,27 @@ function createSignalEventHandler(deps) {
1195
999
  reason: "no mention",
1196
1000
  target: senderDisplay
1197
1001
  });
1198
- const pendingMedia = (dataMessage.attachments ?? []).map((attachment) => {
1199
- const contentType = attachment?.contentType ?? void 0;
1200
- return {
1201
- contentType,
1202
- kind: kindFromMime(contentType) ?? "unknown"
1203
- };
1204
- });
1205
- const pendingMediaText = formatSignalMediaText(pendingMedia);
1206
- const pendingBodyText = messageText || pendingMediaText || visibleQuoteText;
1002
+ const pendingPlaceholder = (() => {
1003
+ if (!dataMessage.attachments?.length) return "";
1004
+ if (deps.ignoreAttachments) return "<media:attachment>";
1005
+ const attachmentTypes = (dataMessage.attachments ?? []).map((attachment) => typeof attachment?.contentType === "string" ? attachment.contentType : void 0);
1006
+ if (attachmentTypes.length > 1) return formatAttachmentSummaryPlaceholder(attachmentTypes);
1007
+ const firstContentType = dataMessage.attachments?.[0]?.contentType;
1008
+ const pendingKind = kindFromMime(firstContentType ?? void 0);
1009
+ return pendingKind ? `<media:${pendingKind}>` : "<media:attachment>";
1010
+ })();
1011
+ const pendingBodyText = messageText || pendingPlaceholder || visibleQuoteText;
1207
1012
  const historyKey = groupId ?? "unknown";
1208
1013
  createChannelHistoryWindow({ historyMap: deps.groupHistories }).record({
1209
1014
  historyKey,
1210
1015
  limit: deps.historyLimit,
1211
1016
  entry: {
1212
1017
  sender: envelope.sourceName ?? senderDisplay,
1213
- body: messageText || visibleQuoteText,
1214
- media: toHistoryMediaEntries(pendingMedia),
1018
+ body: pendingBodyText,
1215
1019
  timestamp: envelope.timestamp ?? void 0,
1216
1020
  messageId: typeof envelope.timestamp === "number" ? String(envelope.timestamp) : void 0
1217
1021
  }
1218
1022
  });
1219
- await registerSignalReplyContext({
1220
- accountId: deps.accountId,
1221
- to: signalTo,
1222
- replyToId,
1223
- author: senderRecipient,
1224
- body: messageText || visibleQuoteText,
1225
- media: pendingMedia,
1226
- sourceTimestamp: inboundTimestamp
1227
- });
1228
1023
  const signalGroupPolicy = resolveChannelGroupPolicy({
1229
1024
  cfg: deps.cfg,
1230
1025
  channel: "signal",
@@ -1254,16 +1049,14 @@ function createSignalEventHandler(deps) {
1254
1049
  }
1255
1050
  return;
1256
1051
  }
1052
+ let mediaPath;
1053
+ let mediaType;
1054
+ const mediaPaths = [];
1055
+ const mediaTypes = [];
1056
+ let placeholder = "";
1257
1057
  const attachments = dataMessage.attachments ?? [];
1258
- const mediaFacts = attachments.map((attachment) => {
1259
- const contentType = attachment?.contentType ?? void 0;
1260
- return {
1261
- contentType,
1262
- kind: kindFromMime(contentType) ?? "unknown"
1263
- };
1264
- });
1265
1058
  let unavailableAttachmentCount = deps.ignoreAttachments ? attachments.length : 0;
1266
- if (!deps.ignoreAttachments) for (const [index, attachment] of attachments.entries()) {
1059
+ if (!deps.ignoreAttachments) for (const attachment of attachments) {
1267
1060
  if (!attachment?.id) {
1268
1061
  unavailableAttachmentCount += 1;
1269
1062
  continue;
@@ -1278,20 +1071,25 @@ function createSignalEventHandler(deps) {
1278
1071
  maxBytes: deps.mediaMaxBytes
1279
1072
  });
1280
1073
  if (fetched) {
1281
- const contentType = fetched.contentType ?? attachment.contentType ?? "application/octet-stream";
1282
- mediaFacts[index] = {
1283
- path: fetched.path,
1284
- url: fetched.path,
1285
- contentType,
1286
- kind: kindFromMime(contentType) ?? "unknown"
1287
- };
1074
+ mediaPaths.push(fetched.path);
1075
+ mediaTypes.push(fetched.contentType ?? attachment.contentType ?? "application/octet-stream");
1076
+ if (!mediaPath) {
1077
+ mediaPath = fetched.path;
1078
+ mediaType = fetched.contentType ?? attachment.contentType ?? void 0;
1079
+ }
1288
1080
  } else unavailableAttachmentCount += 1;
1289
1081
  } catch (err) {
1290
1082
  unavailableAttachmentCount += 1;
1291
1083
  deps.runtime.error?.(danger(`attachment fetch failed: ${String(err)}`));
1292
1084
  }
1293
1085
  }
1294
- let bodyText = messageText;
1086
+ if (mediaPaths.length > 1) placeholder = formatAttachmentSummaryPlaceholder(mediaTypes);
1087
+ else {
1088
+ const kind = kindFromMime(mediaType ?? void 0);
1089
+ if (kind) placeholder = `<media:${kind}>`;
1090
+ else if (mediaPaths.length > 0) placeholder = "<media:attachment>";
1091
+ }
1092
+ let bodyText = messageText || placeholder || visibleQuoteText || "";
1295
1093
  if (unavailableAttachmentCount > 0) {
1296
1094
  const attachmentLabel = unavailableAttachmentCount === 1 ? "attachment" : "attachments";
1297
1095
  bodyText = formatInboundMediaUnavailableText({
@@ -1299,7 +1097,9 @@ function createSignalEventHandler(deps) {
1299
1097
  notice: `[signal ${unavailableAttachmentCount > 1 ? `${unavailableAttachmentCount} ` : ""}${attachmentLabel} unavailable]`
1300
1098
  });
1301
1099
  }
1302
- if (!bodyText && mediaFacts.length === 0 && !visibleQuoteText) return;
1100
+ if (!bodyText) return;
1101
+ const inboundTimestamp = typeof envelope.timestamp === "number" ? envelope.timestamp : typeof dataMessage.timestamp === "number" ? dataMessage.timestamp : void 0;
1102
+ const nativeReplyTargetTimestamp = typeof envelope.editMessage?.targetSentTimestamp === "number" ? envelope.editMessage.targetSentTimestamp : inboundTimestamp;
1303
1103
  if (deps.sendReadReceipts && !deps.readReceiptsViaDaemon && !isGroup && inboundTimestamp) try {
1304
1104
  await sendReadReceiptSignal(`signal:${senderRecipient}`, inboundTimestamp, {
1305
1105
  cfg: deps.cfg,
@@ -1312,16 +1112,9 @@ function createSignalEventHandler(deps) {
1312
1112
  }
1313
1113
  else if (deps.sendReadReceipts && !deps.readReceiptsViaDaemon && !isGroup && !inboundTimestamp) logVerbose(`signal read receipt skipped (missing timestamp) for ${senderDisplay}`);
1314
1114
  const senderName = envelope.sourceName ?? senderDisplay;
1315
- await registerSignalReplyContext({
1316
- accountId: deps.accountId,
1317
- to: signalTo,
1318
- replyToId,
1319
- author: senderRecipient,
1320
- body: messageText,
1321
- media: mediaFacts,
1322
- sourceTimestamp: inboundTimestamp
1323
- });
1324
- const entry = {
1115
+ const messageId = typeof inboundTimestamp === "number" ? String(inboundTimestamp) : void 0;
1116
+ const replyToId = typeof nativeReplyTargetTimestamp === "number" ? String(nativeReplyTargetTimestamp) : void 0;
1117
+ await inboundDebouncer.enqueue({
1325
1118
  senderName,
1326
1119
  senderDisplay,
1327
1120
  senderRecipient,
@@ -1330,155 +1123,22 @@ function createSignalEventHandler(deps) {
1330
1123
  groupName,
1331
1124
  isGroup,
1332
1125
  bodyText,
1333
- nativeReplyBody: [messageText, formatSignalMediaText(mediaFacts)].filter(Boolean).join("\n"),
1334
1126
  commandBody: messageText,
1335
1127
  timestamp: inboundTimestamp,
1336
1128
  messageId,
1337
1129
  replyToId,
1338
- media: mediaFacts,
1130
+ mediaPath,
1131
+ mediaType,
1132
+ mediaPaths: mediaPaths.length > 0 ? mediaPaths : void 0,
1133
+ mediaTypes: mediaTypes.length > 0 ? mediaTypes : void 0,
1339
1134
  commandAuthorized,
1340
1135
  canDetectMention,
1341
1136
  requireMention,
1342
1137
  wasMentioned: effectiveWasMentioned,
1343
1138
  replyToBody: visibleQuoteText || void 0,
1344
1139
  replyToSender: visibleQuoteSender,
1345
- replyToIsQuote: visibleQuoteText ? true : void 0,
1346
- turnAdoptionLifecycle
1347
- };
1348
- pendingInboundRegistry.cancelPendingOnAbort(entry, debouncer.cancelKey);
1349
- const inboundLane = resolveSignalControlLaneKey(deps.accountId, entry) ? controlDebouncer : debouncer;
1350
- if (inboundLane === debouncer) pendingInboundRegistry.track(entry);
1351
- activeEnqueueEntries.add(entry);
1352
- try {
1353
- await inboundLane.enqueue(entry);
1354
- } finally {
1355
- activeEnqueueEntries.delete(entry);
1356
- }
1357
- if (turnAdoptionLifecycle) return { kind: "deferred" };
1358
- };
1359
- }
1360
- //#endregion
1361
- //#region extensions/signal/src/reaction-targets.ts
1362
- function registerSignalReactionTargetsForDeliveredPayload(params) {
1363
- registerSignalQuestionReactionTargetForDeliveredPayload(params);
1364
- registerSignalApprovalReactionTargetForDeliveredPayload(params);
1365
- }
1366
- //#endregion
1367
- //#region extensions/signal/src/signal-ingress.ts
1368
- const SIGNAL_INGRESS_COMPLETED_TTL_MS = 720 * 60 * 60 * 1e3;
1369
- const SIGNAL_INGRESS_COMPLETED_MAX_ENTRIES = 1e3;
1370
- const SIGNAL_INGRESS_FAILED_TTL_MS = 720 * 60 * 60 * 1e3;
1371
- const SIGNAL_INGRESS_FAILED_MAX_ENTRIES = 1e3;
1372
- const SIGNAL_INGRESS_DRAIN_INTERVAL_MS = 1e3;
1373
- var SignalIngressPermanentError = class extends Error {
1374
- constructor(reason, message, options) {
1375
- super(message, options);
1376
- this.reason = reason;
1377
- this.name = "SignalIngressPermanentError";
1378
- }
1379
- };
1380
- function isRecord$1(value) {
1381
- return typeof value === "object" && value !== null && !Array.isArray(value);
1382
- }
1383
- function normalizeRawString(value) {
1384
- return typeof value === "string" && value.trim() ? value.trim() : null;
1385
- }
1386
- function normalizeTimestamp(value) {
1387
- return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : null;
1388
- }
1389
- function parseReceiveEnvelope(event) {
1390
- if (event.event !== "receive" || !event.data) return null;
1391
- let parsed;
1392
- try {
1393
- parsed = JSON.parse(event.data);
1394
- } catch (error) {
1395
- throw new SignalIngressPermanentError("parse-error", "Signal receive event contains invalid JSON", { cause: error });
1396
- }
1397
- if (!isRecord$1(parsed)) throw new SignalIngressPermanentError("parse-error", "Signal receive event must contain a JSON object");
1398
- return isRecord$1(parsed.envelope) ? parsed.envelope : null;
1399
- }
1400
- function resolveDataMessage(envelope) {
1401
- if (isRecord$1(envelope.dataMessage)) return envelope.dataMessage;
1402
- return isRecord$1(envelope.editMessage?.dataMessage) ? envelope.editMessage.dataMessage : null;
1403
- }
1404
- function inspectSignalIngressEvent(event) {
1405
- const envelope = parseReceiveEnvelope(event);
1406
- if (!envelope || "syncMessage" in envelope) return null;
1407
- const dataMessage = resolveDataMessage(envelope);
1408
- const reactionMessage = isRecord$1(envelope.reactionMessage) ? envelope.reactionMessage : null;
1409
- if (!dataMessage && !reactionMessage) return null;
1410
- const senderUuid = normalizeRawString(envelope.sourceUuid);
1411
- const senderNumber = normalizeRawString(envelope.sourceNumber);
1412
- const senderKey = senderUuid ? `uuid:${senderUuid}` : senderNumber ? `number:${senderNumber}` : null;
1413
- if (!senderKey) throw new SignalIngressPermanentError("missing-sender", "Signal dispatchable envelope is missing sourceUuid/sourceNumber");
1414
- const timestamp = normalizeTimestamp(envelope.timestamp) ?? normalizeTimestamp(dataMessage?.timestamp);
1415
- if (timestamp === null) throw new SignalIngressPermanentError("missing-timestamp", "Signal dispatchable envelope is missing a stable timestamp");
1416
- const dataGroup = isRecord$1(dataMessage?.groupInfo) ? dataMessage.groupInfo : null;
1417
- const reactionGroup = isRecord$1(reactionMessage?.groupInfo) ? reactionMessage.groupInfo : null;
1418
- const groupId = normalizeRawString(dataGroup?.groupId) ?? normalizeRawString(reactionGroup?.groupId);
1419
- return {
1420
- eventId: JSON.stringify([senderKey, timestamp]),
1421
- laneKey: groupId ? `group:${groupId}` : `direct:${senderKey}`
1422
- };
1423
- }
1424
- function resolveSignalIngressNonRetryableFailure(error) {
1425
- return error instanceof SignalIngressPermanentError ? {
1426
- reason: error.reason,
1427
- message: error.message
1428
- } : null;
1429
- }
1430
- /** Open the account queue, recover it, and keep newly appended rows draining. */
1431
- async function startSignalIngressMonitor(params) {
1432
- let queue = params.queue;
1433
- if (!queue) {
1434
- const pluginRuntime = getOptionalSignalRuntime();
1435
- if (!pluginRuntime) throw new Error("Signal runtime not initialized for durable ingress");
1436
- queue = pluginRuntime.state.openChannelIngressQueue({ accountId: params.accountId });
1437
- }
1438
- const monitor = createChannelIngressMonitor({
1439
- queue,
1440
- inspect: (event) => inspectSignalIngressEvent(event),
1441
- payload: {
1442
- version: 1,
1443
- serialize: (event, { receivedAt }) => ({
1444
- receivedAt,
1445
- event
1446
- }),
1447
- deserialize: (body) => body.event,
1448
- encode: ({ body }) => ({
1449
- version: 1,
1450
- ...body
1451
- }),
1452
- decode: (payload) => ({
1453
- version: payload.version,
1454
- body: payload
1455
- }),
1456
- createClaimError: (_kind, claim) => new SignalIngressPermanentError("unsupported-event", `Signal ingress row ${claim.id} has an invalid payload`)
1457
- },
1458
- deliver: (event, lifecycle) => params.dispatch(event, lifecycle),
1459
- pollIntervalMs: SIGNAL_INGRESS_DRAIN_INTERVAL_MS,
1460
- retention: {
1461
- pruneIntervalMs: 0,
1462
- completedTtlMs: SIGNAL_INGRESS_COMPLETED_TTL_MS,
1463
- completedMaxEntries: SIGNAL_INGRESS_COMPLETED_MAX_ENTRIES,
1464
- failedTtlMs: SIGNAL_INGRESS_FAILED_TTL_MS,
1465
- failedMaxEntries: SIGNAL_INGRESS_FAILED_MAX_ENTRIES
1466
- },
1467
- appendRetryDelaysMs: [0],
1468
- drain: {
1469
- resolveNonRetryableFailure: resolveSignalIngressNonRetryableFailure,
1470
- onLog: (message) => params.runtime.log?.(`signal ${message}`)
1471
- },
1472
- onError: (error) => params.runtime.error?.(`signal ingress drain failed: ${String(error)}`)
1473
- });
1474
- monitor.start();
1475
- return {
1476
- receive: async (event) => {
1477
- await monitor.admit(event);
1478
- await monitor.waitForPumpIdle();
1479
- },
1480
- stop: monitor.stop,
1481
- waitForIdle: monitor.waitForIdle
1140
+ replyToIsQuote: visibleQuoteText ? true : void 0
1141
+ });
1482
1142
  };
1483
1143
  }
1484
1144
  //#endregion
@@ -1489,7 +1149,7 @@ const DEFAULT_RECONNECT_POLICY = {
1489
1149
  factor: 2,
1490
1150
  jitter: .2
1491
1151
  };
1492
- async function runSignalSseLoop({ baseUrl, account, abortSignal, runtime, onEvent, timeoutMs, transportKind, policy }) {
1152
+ async function runSignalSseLoop({ baseUrl, account, abortSignal, runtime, onEvent, timeoutMs, apiMode, policy }) {
1493
1153
  const reconnectPolicy = {
1494
1154
  ...DEFAULT_RECONNECT_POLICY,
1495
1155
  ...policy
@@ -1507,10 +1167,10 @@ async function runSignalSseLoop({ baseUrl, account, abortSignal, runtime, onEven
1507
1167
  account,
1508
1168
  abortSignal,
1509
1169
  timeoutMs,
1510
- transportKind,
1511
- onEvent: async (event) => {
1170
+ apiMode,
1171
+ onEvent: (event) => {
1512
1172
  reconnectAttempts = 0;
1513
- await onEvent(event);
1173
+ onEvent(event);
1514
1174
  },
1515
1175
  logger: {
1516
1176
  log: runtime.log,
@@ -1543,34 +1203,73 @@ var monitor_exports = /* @__PURE__ */ __exportAll({
1543
1203
  deliverReplies: () => deliverReplies,
1544
1204
  monitorSignalProvider: () => monitorSignalProvider
1545
1205
  });
1206
+ function resolveRuntime(opts) {
1207
+ return opts.runtime ?? createNonExitingRuntime();
1208
+ }
1546
1209
  function createSignalMonitorTaskRunner(runtime) {
1547
1210
  const inFlight = /* @__PURE__ */ new Set();
1548
1211
  return {
1549
- runTask(task) {
1550
- const trackedTask = Promise.resolve().then(task);
1212
+ runEventTask(task) {
1213
+ const trackedTask = Promise.resolve().then(task).catch((err) => runtime.error?.(`event handler failed: ${String(err)}`)).finally(() => inFlight.delete(trackedTask));
1551
1214
  inFlight.add(trackedTask);
1552
- trackedTask.catch((err) => runtime.error?.(`signal monitor task failed: ${String(err)}`));
1553
- trackedTask.finally(() => inFlight.delete(trackedTask)).catch(() => void 0);
1554
- return trackedTask;
1555
1215
  },
1556
1216
  async waitForIdle() {
1557
1217
  while (inFlight.size > 0) await Promise.allSettled(inFlight);
1558
1218
  }
1559
1219
  };
1560
1220
  }
1221
+ function mergeAbortSignals(a, b) {
1222
+ if (!a && !b) return {
1223
+ signal: void 0,
1224
+ dispose: () => {}
1225
+ };
1226
+ if (!a) return {
1227
+ signal: b,
1228
+ dispose: () => {}
1229
+ };
1230
+ if (!b) return {
1231
+ signal: a,
1232
+ dispose: () => {}
1233
+ };
1234
+ const controller = new AbortController();
1235
+ const abortFrom = (source) => {
1236
+ if (!controller.signal.aborted) controller.abort(source.reason);
1237
+ };
1238
+ if (a.aborted) {
1239
+ abortFrom(a);
1240
+ return {
1241
+ signal: controller.signal,
1242
+ dispose: () => {}
1243
+ };
1244
+ }
1245
+ if (b.aborted) {
1246
+ abortFrom(b);
1247
+ return {
1248
+ signal: controller.signal,
1249
+ dispose: () => {}
1250
+ };
1251
+ }
1252
+ const onAbortA = () => abortFrom(a);
1253
+ const onAbortB = () => abortFrom(b);
1254
+ a.addEventListener("abort", onAbortA, { once: true });
1255
+ b.addEventListener("abort", onAbortB, { once: true });
1256
+ return {
1257
+ signal: controller.signal,
1258
+ dispose: () => {
1259
+ a.removeEventListener("abort", onAbortA);
1260
+ b.removeEventListener("abort", onAbortB);
1261
+ }
1262
+ };
1263
+ }
1561
1264
  function createSignalDaemonLifecycle(params) {
1562
1265
  let daemonHandle = null;
1563
1266
  let daemonStopRequested = false;
1564
- let daemonStopPromise;
1565
1267
  let daemonExitError;
1566
1268
  const daemonAbortController = new AbortController();
1567
- const abortSignal = params.abortSignal ? AbortSignal.any([params.abortSignal, daemonAbortController.signal]) : daemonAbortController.signal;
1269
+ const mergedAbort = mergeAbortSignals(params.abortSignal, daemonAbortController.signal);
1568
1270
  const stop = () => {
1569
- if (daemonStopPromise) return daemonStopPromise;
1570
1271
  daemonStopRequested = true;
1571
- if (!daemonAbortController.signal.aborted) daemonAbortController.abort(params.abortSignal?.reason ?? /* @__PURE__ */ new Error("Signal monitor stopped"));
1572
- daemonStopPromise = daemonHandle?.stop() ?? Promise.resolve();
1573
- return daemonStopPromise;
1272
+ daemonHandle?.stop();
1574
1273
  };
1575
1274
  const attach = (handle) => {
1576
1275
  daemonHandle = handle;
@@ -1585,9 +1284,13 @@ function createSignalDaemonLifecycle(params) {
1585
1284
  attach,
1586
1285
  stop,
1587
1286
  getExitError,
1588
- abortSignal
1287
+ abortSignal: mergedAbort.signal,
1288
+ dispose: mergedAbort.dispose
1589
1289
  };
1590
1290
  }
1291
+ function normalizeAllowList(raw) {
1292
+ return normalizeStringEntries(raw);
1293
+ }
1591
1294
  function resolveSignalReactionTargets(reaction) {
1592
1295
  const targets = [];
1593
1296
  const uuid = reaction.targetAuthorUuid?.trim();
@@ -1657,7 +1360,7 @@ async function waitForSignalDaemonReady(params) {
1657
1360
  }
1658
1361
  });
1659
1362
  }
1660
- const SIGNAL_ATTACHMENT_RPC_RESPONSE_HEADROOM_BYTES = 64 * 1024;
1363
+ const SIGNAL_ATTACHMENT_RPC_RESPONSE_HEADROOM_BYTES = 65536;
1661
1364
  const SIGNAL_BASE64_OVERHEAD_NUMERATOR = 4;
1662
1365
  const SIGNAL_BASE64_OVERHEAD_DENOMINATOR = 3;
1663
1366
  function deriveSignalAttachmentRpcMaxResponseBytes(maxBytes) {
@@ -1667,7 +1370,7 @@ function deriveSignalAttachmentRpcMaxResponseBytes(maxBytes) {
1667
1370
  async function fetchAttachment(params) {
1668
1371
  const { attachment } = params;
1669
1372
  if (!attachment?.id) return null;
1670
- if (typeof attachment.size === "number" && attachment.size > params.maxBytes) throw new Error(`Signal attachment ${attachment.id} exceeds ${(params.maxBytes / (1024 * 1024)).toFixed(0)}MB limit`);
1373
+ if (typeof attachment.size === "number" && attachment.size > params.maxBytes) throw new Error(`Signal attachment ${attachment.id} exceeds ${(params.maxBytes / 1048576).toFixed(0)}MB limit`);
1671
1374
  const rpcParams = { id: attachment.id };
1672
1375
  if (params.account) rpcParams.account = params.account;
1673
1376
  if (params.groupId) rpcParams.groupId = params.groupId;
@@ -1676,16 +1379,17 @@ async function fetchAttachment(params) {
1676
1379
  const result = await signalRpcRequest("getAttachment", rpcParams, {
1677
1380
  baseUrl: params.baseUrl,
1678
1381
  maxResponseBytes: deriveSignalAttachmentRpcMaxResponseBytes(params.maxBytes),
1679
- transportKind: params.transportKind
1382
+ apiMode: params.apiMode
1680
1383
  });
1681
1384
  if (!result?.data) return null;
1682
- if (estimateBase64DecodedBytes(result.data) > params.maxBytes) throw new Error(`Signal attachment ${attachment.id} exceeds ${(params.maxBytes / (1024 * 1024)).toFixed(0)}MB limit`);
1385
+ if (estimateBase64DecodedBytes(result.data) > params.maxBytes) throw new Error(`Signal attachment ${attachment.id} exceeds ${(params.maxBytes / 1048576).toFixed(0)}MB limit`);
1683
1386
  const buffer = Buffer.from(result.data, "base64");
1684
1387
  const originalFilename = normalizeOptionalString(attachment.filename ?? void 0);
1685
- const saved = await saveMediaBuffer(buffer, normalizeOptionalString(attachment.contentType ?? void 0) ?? await detectMime({
1388
+ const contentType = normalizeOptionalString(attachment.contentType ?? void 0) ?? await detectMime({
1686
1389
  buffer,
1687
1390
  filePath: originalFilename
1688
- }), "inbound", params.maxBytes, originalFilename);
1391
+ });
1392
+ const saved = await saveMediaBuffer(buffer, contentType, "inbound", params.maxBytes, originalFilename);
1689
1393
  return {
1690
1394
  path: saved.path,
1691
1395
  contentType: saved.contentType
@@ -1700,15 +1404,14 @@ async function deliverReplies(params) {
1700
1404
  });
1701
1405
  for (const payload of replies) {
1702
1406
  const deliveryResults = [];
1703
- const presentationPayload = materializeSignalPresentationFallback(payload);
1704
1407
  const deliveredPayload = addSignalApprovalReactionHintToStructuredPayload({
1705
1408
  cfg: params.cfg,
1706
1409
  accountId,
1707
1410
  to: target,
1708
- payload: presentationPayload,
1411
+ payload,
1709
1412
  targetAuthor: account,
1710
1413
  targetAuthorUuid: accountUuid
1711
- }) ?? presentationPayload;
1414
+ }) ?? payload;
1712
1415
  const reply = resolveSendableOutboundReplyParts(deliveredPayload);
1713
1416
  const nextNativeReply = createSignalNativeReplyResolver({
1714
1417
  payload: deliveredPayload,
@@ -1750,7 +1453,7 @@ async function deliverReplies(params) {
1750
1453
  }), visibleText);
1751
1454
  }
1752
1455
  }) !== "empty") {
1753
- registerSignalReactionTargetsForDeliveredPayload({
1456
+ registerSignalApprovalReactionTargetForDeliveredPayload({
1754
1457
  cfg: params.cfg,
1755
1458
  target: {
1756
1459
  channel: "signal",
@@ -1769,15 +1472,12 @@ async function deliverReplies(params) {
1769
1472
  function resolveSignalNativeReplyOptions(params) {
1770
1473
  if (params.payload.replyToCurrent === false) return {};
1771
1474
  const payloadReplyToId = normalizeOptionalString(params.payload.replyToId);
1772
- const isExplicitCurrentReply = params.payload.replyToTag === true || params.payload.replyToCurrent === true;
1773
- if (!payloadReplyToId && !isExplicitCurrentReply && params.replyContext?.allowImplicitCurrentMessage === false) return {};
1774
1475
  const contextReplyToId = normalizeOptionalString(params.replyContext?.replyToId);
1775
- if (!contextReplyToId || payloadReplyToId && payloadReplyToId !== contextReplyToId) return {};
1776
- const replyToId = payloadReplyToId ?? contextReplyToId;
1476
+ if (!payloadReplyToId || !contextReplyToId || payloadReplyToId !== contextReplyToId) return {};
1777
1477
  const replyToAuthor = normalizeOptionalString(params.replyContext?.author);
1778
- if (!replyToAuthor) return { replyToId };
1478
+ if (!replyToAuthor) return { replyToId: payloadReplyToId };
1779
1479
  return {
1780
- replyToId,
1480
+ replyToId: payloadReplyToId,
1781
1481
  replyToAuthor,
1782
1482
  replyToBody: params.replyContext?.body ?? ""
1783
1483
  };
@@ -1808,7 +1508,7 @@ function createSignalNativeReplyResolver(params) {
1808
1508
  };
1809
1509
  }
1810
1510
  async function monitorSignalProvider(opts = {}) {
1811
- const runtime = opts.runtime ?? createNonExitingRuntime();
1511
+ const runtime = resolveRuntime(opts);
1812
1512
  const cfg = opts.config ?? getRuntimeConfig();
1813
1513
  const accountInfo = resolveSignalAccount({
1814
1514
  cfg,
@@ -1821,8 +1521,8 @@ async function monitorSignalProvider(opts = {}) {
1821
1521
  const baseUrl = normalizeOptionalString(opts.baseUrl) ?? accountInfo.baseUrl;
1822
1522
  const account = normalizeOptionalString(opts.account) ?? normalizeOptionalString(accountInfo.config.account);
1823
1523
  const dmPolicy = accountInfo.config.dmPolicy ?? "pairing";
1824
- const allowFrom = normalizeStringEntries(opts.allowFrom ?? accountInfo.config.allowFrom);
1825
- const groupAllowFrom = normalizeStringEntries(opts.groupAllowFrom ?? accountInfo.config.groupAllowFrom ?? (accountInfo.config.allowFrom && accountInfo.config.allowFrom.length > 0 ? accountInfo.config.allowFrom : []));
1524
+ const allowFrom = normalizeAllowList(opts.allowFrom ?? accountInfo.config.allowFrom);
1525
+ const groupAllowFrom = normalizeAllowList(opts.groupAllowFrom ?? accountInfo.config.groupAllowFrom ?? (accountInfo.config.allowFrom && accountInfo.config.allowFrom.length > 0 ? accountInfo.config.allowFrom : []));
1826
1526
  const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
1827
1527
  const { groupPolicy, providerMissingFallbackApplied } = resolveAllowlistProviderRuntimeGroupPolicy({
1828
1528
  providerConfigPresent: cfg.channels?.signal !== void 0,
@@ -1836,40 +1536,41 @@ async function monitorSignalProvider(opts = {}) {
1836
1536
  log: (message) => runtime.log?.(message)
1837
1537
  });
1838
1538
  const reactionMode = accountInfo.config.reactionNotifications ?? "own";
1839
- const reactionAllowlist = normalizeStringEntries(accountInfo.config.reactionAllowlist);
1539
+ const reactionAllowlist = normalizeAllowList(accountInfo.config.reactionAllowlist);
1840
1540
  const mediaMaxBytes = (opts.mediaMaxMb ?? accountInfo.config.mediaMaxMb ?? 8) * 1024 * 1024;
1841
- const transportKind = accountInfo.transport.kind;
1842
- const managedTransport = accountInfo.transport.kind === "managed-native" ? accountInfo.transport : void 0;
1843
1541
  const ignoreAttachments = opts.ignoreAttachments ?? accountInfo.config.ignoreAttachments ?? false;
1844
1542
  const sendReadReceipts = Boolean(opts.sendReadReceipts ?? accountInfo.config.sendReadReceipts);
1845
1543
  const waitForTransportReadyFn = opts.waitForTransportReady ?? waitForTransportReady;
1846
- const autoStart = Boolean(managedTransport) && (opts.autoStart ?? true);
1847
- const startupTimeoutMs = Math.min(12e4, Math.max(1e3, opts.startupTimeoutMs ?? managedTransport?.startupTimeoutMs ?? 3e4));
1544
+ const autoStart = opts.autoStart ?? accountInfo.config.autoStart ?? !accountInfo.config.httpUrl;
1545
+ const configuredApiMode = cfg.channels?.signal?.apiMode ?? "auto";
1546
+ const startupTimeoutMs = Math.min(12e4, Math.max(1e3, opts.startupTimeoutMs ?? accountInfo.config.startupTimeoutMs ?? 3e4));
1848
1547
  const readReceiptsViaDaemon = autoStart && sendReadReceipts;
1849
1548
  const daemonLifecycle = createSignalDaemonLifecycle({ abortSignal: opts.abortSignal });
1850
1549
  const monitorTaskRunner = createSignalMonitorTaskRunner(runtime);
1851
1550
  let daemonHandle = null;
1852
- let ingressMonitor;
1551
+ if (autoStart && configuredApiMode === "container") throw new Error("channels.signal.autoStart=true is incompatible with channels.signal.apiMode=container");
1853
1552
  if (autoStart) {
1854
- const cliPath = opts.cliPath ?? managedTransport?.cliPath ?? "signal-cli";
1855
- const configPath = normalizeOptionalString(opts.configPath) ?? normalizeOptionalString(managedTransport?.configPath);
1856
- const httpHost = opts.httpHost ?? managedTransport?.httpHost ?? "127.0.0.1";
1857
- const httpPort = opts.httpPort ?? managedTransport?.httpPort ?? 8080;
1553
+ const cliPath = opts.cliPath ?? accountInfo.config.cliPath ?? "signal-cli";
1554
+ const configPath = normalizeOptionalString(opts.configPath) ?? normalizeOptionalString(accountInfo.config.configPath);
1555
+ const httpHost = opts.httpHost ?? accountInfo.config.httpHost ?? "127.0.0.1";
1556
+ const httpPort = opts.httpPort ?? accountInfo.config.httpPort ?? 8080;
1858
1557
  daemonHandle = spawnSignalDaemon({
1859
1558
  cliPath,
1860
1559
  ...configPath ? { configPath } : {},
1861
1560
  account,
1862
1561
  httpHost,
1863
1562
  httpPort,
1864
- receiveMode: opts.receiveMode ?? managedTransport?.receiveMode,
1563
+ receiveMode: opts.receiveMode ?? accountInfo.config.receiveMode,
1865
1564
  ignoreAttachments: opts.ignoreAttachments ?? accountInfo.config.ignoreAttachments,
1866
- ignoreStories: opts.ignoreStories ?? managedTransport?.ignoreStories,
1565
+ ignoreStories: opts.ignoreStories ?? accountInfo.config.ignoreStories,
1867
1566
  sendReadReceipts,
1868
1567
  runtime
1869
1568
  });
1870
1569
  daemonLifecycle.attach(daemonHandle);
1871
1570
  }
1872
- const onAbort = () => void daemonLifecycle.stop();
1571
+ const onAbort = () => {
1572
+ daemonLifecycle.stop();
1573
+ };
1873
1574
  opts.abortSignal?.addEventListener("abort", onAbort, { once: true });
1874
1575
  try {
1875
1576
  if (daemonHandle) {
@@ -1903,16 +1604,12 @@ async function monitorSignalProvider(opts = {}) {
1903
1604
  });
1904
1605
  const handleEvent = createSignalEventHandler({
1905
1606
  runtime,
1906
- abortSignal: daemonLifecycle.abortSignal,
1907
- runTrackedTask: (task) => {
1908
- monitorTaskRunner.runTask(task);
1909
- },
1910
1607
  cfg,
1911
1608
  baseUrl,
1912
1609
  account,
1913
1610
  accountUuid: accountInfo.config.accountUuid,
1914
1611
  accountId: accountInfo.accountId,
1915
- blockStreaming: resolveChannelStreamingBlockEnabled(accountInfo.config),
1612
+ blockStreaming: accountInfo.config.blockStreaming,
1916
1613
  historyLimit,
1917
1614
  groupHistories,
1918
1615
  textLimit,
@@ -1928,7 +1625,7 @@ async function monitorSignalProvider(opts = {}) {
1928
1625
  readReceiptsViaDaemon,
1929
1626
  fetchAttachment: (params) => fetchAttachment({
1930
1627
  ...params,
1931
- transportKind
1628
+ apiMode: configuredApiMode
1932
1629
  }),
1933
1630
  deliverReplies: (params) => deliverReplies({
1934
1631
  ...params,
@@ -1940,20 +1637,17 @@ async function monitorSignalProvider(opts = {}) {
1940
1637
  shouldEmitSignalReactionNotification,
1941
1638
  buildSignalReactionSystemEventText
1942
1639
  });
1943
- ingressMonitor = await startSignalIngressMonitor({
1944
- accountId: accountInfo.accountId,
1945
- dispatch: handleEvent,
1946
- runtime
1947
- });
1948
1640
  await runSignalSseLoop({
1949
1641
  baseUrl,
1950
1642
  account,
1951
1643
  abortSignal: daemonLifecycle.abortSignal,
1952
1644
  runtime,
1953
1645
  timeoutMs: 0,
1954
- transportKind,
1646
+ apiMode: configuredApiMode,
1955
1647
  policy: opts.reconnectPolicy,
1956
- onEvent: (event) => monitorTaskRunner.runTask(async () => await ingressMonitor?.receive(event))
1648
+ onEvent: (event) => {
1649
+ monitorTaskRunner.runEventTask(() => handleEvent(event));
1650
+ }
1957
1651
  });
1958
1652
  const daemonExitError = daemonLifecycle.getExitError();
1959
1653
  if (daemonExitError) throw daemonExitError;
@@ -1962,9 +1656,10 @@ async function monitorSignalProvider(opts = {}) {
1962
1656
  if (opts.abortSignal?.aborted && !daemonExitError) return;
1963
1657
  throw err;
1964
1658
  } finally {
1965
- await ingressMonitor?.stop();
1966
- await Promise.all([daemonLifecycle.stop(), monitorTaskRunner.waitForIdle()]);
1659
+ await monitorTaskRunner.waitForIdle();
1660
+ daemonLifecycle.dispose();
1967
1661
  opts.abortSignal?.removeEventListener("abort", onAbort);
1662
+ daemonLifecycle.stop();
1968
1663
  }
1969
1664
  }
1970
1665
  //#endregion