@openclaw/voice-call 2026.7.1-beta.2 → 2026.7.1-beta.4

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 (394) hide show
  1. package/README.md +1 -0
  2. package/dist/{config-DNtTB7Iw.js → config-CgigQDrF.js} +31 -13
  3. package/dist/{config-compat-CCEjHjAJ.js → config-compat-DAFd5tVH.js} +3 -2
  4. package/dist/doctor-contract-api.js +4 -22
  5. package/dist/{guarded-json-api-7ITxTL6G.js → guarded-json-api-BrBbW_RJ.js} +19 -57
  6. package/dist/index.js +46 -33
  7. package/dist/{mock-YAo3QDri.js → mock-YsvBTX-7.js} +18 -2
  8. package/dist/{plivo-wmeT9r_t.js → plivo-BnCuAGwj.js} +25 -6
  9. package/dist/{realtime-handler-DdViwdCW.js → realtime-handler-Bz-MNWtD.js} +103 -43
  10. package/dist/response-generator-PXuisI3L.js +272 -0
  11. package/dist/{runtime-entry-DN7HllXj.js → runtime-entry-kCq5Xjph.js} +234 -96
  12. package/dist/runtime-entry.js +1 -1
  13. package/dist/setup-api.js +1 -1
  14. package/dist/{store-8M2m4Isq.js → store-DtewuuOb.js} +23 -6
  15. package/dist/{telnyx-DuUBsPW2.js → telnyx-DTHQGeaW.js} +1 -1
  16. package/dist/{twilio-CsJBvC3a.js → twilio-xNIXGJ-M.js} +16 -8
  17. package/dist/webhook-replay-aaP79dI8.js +32 -0
  18. package/node_modules/commander/Readme.md +11 -15
  19. package/node_modules/commander/index.js +14 -17
  20. package/node_modules/commander/lib/argument.js +3 -6
  21. package/node_modules/commander/lib/command.js +46 -33
  22. package/node_modules/commander/lib/error.js +2 -5
  23. package/node_modules/commander/lib/help.js +4 -20
  24. package/node_modules/commander/lib/option.js +3 -6
  25. package/node_modules/commander/lib/suggestSimilar.js +2 -4
  26. package/node_modules/commander/package.json +10 -28
  27. package/node_modules/commander/typings/index.d.ts +3 -3
  28. package/node_modules/typebox/build/compile/validator.d.mts +2 -7
  29. package/node_modules/typebox/build/compile/validator.mjs +6 -36
  30. package/node_modules/typebox/build/error/errors.d.mts +1 -7
  31. package/node_modules/typebox/build/format/_idna.mjs +36 -6
  32. package/node_modules/typebox/build/format/_puny.mjs +4 -1
  33. package/node_modules/typebox/build/format/uuid.d.mts +2 -2
  34. package/node_modules/typebox/build/format/uuid.mjs +3 -3
  35. package/node_modules/typebox/build/guard/emit.d.mts +0 -4
  36. package/node_modules/typebox/build/guard/emit.mjs +0 -8
  37. package/node_modules/typebox/build/guard/guard.d.mts +4 -8
  38. package/node_modules/typebox/build/guard/guard.mjs +5 -13
  39. package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
  40. package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
  41. package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
  42. package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
  43. package/node_modules/typebox/build/schema/engine/schema.mjs +5 -10
  44. package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
  45. package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
  46. package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
  47. package/node_modules/typebox/build/schema/types/index.mjs +0 -1
  48. package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
  49. package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
  50. package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
  51. package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
  52. package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
  53. package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
  54. package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
  55. package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
  56. package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
  57. package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
  58. package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
  59. package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
  60. package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
  61. package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
  62. package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
  63. package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
  64. package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
  65. package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
  66. package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
  67. package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
  68. package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
  69. package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
  70. package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
  71. package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
  72. package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
  73. package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
  74. package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
  75. package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
  76. package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
  77. package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
  78. package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
  79. package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
  80. package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
  81. package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
  82. package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
  83. package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
  84. package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
  85. package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
  86. package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
  87. package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
  88. package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
  89. package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
  90. package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
  91. package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
  92. package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
  93. package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
  94. package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
  95. package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
  96. package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
  97. package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
  98. package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
  99. package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
  100. package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
  101. package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
  102. package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
  103. package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
  104. package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
  105. package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
  106. package/node_modules/typebox/build/type/action/index.d.mts +7 -4
  107. package/node_modules/typebox/build/type/action/index.mjs +7 -4
  108. package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
  109. package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
  110. package/node_modules/typebox/build/type/action/module.d.mts +8 -7
  111. package/node_modules/typebox/build/type/action/module.mjs +7 -6
  112. package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
  113. package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -5
  114. package/node_modules/typebox/build/type/action/with.d.mts +11 -0
  115. package/node_modules/typebox/build/type/action/with.mjs +11 -0
  116. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
  117. package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
  118. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
  119. package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
  120. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
  121. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
  122. package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
  123. package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
  124. package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
  125. package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
  126. package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
  127. package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
  128. package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
  129. package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
  130. package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
  131. package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
  132. package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
  133. package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
  134. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
  135. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
  136. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
  137. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
  138. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
  139. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
  140. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
  141. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
  142. package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
  143. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
  144. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
  145. package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
  146. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
  147. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
  148. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
  149. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
  150. package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
  151. package/node_modules/typebox/build/type/engine/index.mjs +2 -2
  152. package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
  153. package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
  154. package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
  155. package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
  156. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
  157. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
  158. package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
  159. package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
  160. package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
  161. package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
  162. package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
  163. package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
  164. package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
  165. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
  166. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
  167. package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
  168. package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
  169. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
  170. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
  171. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
  172. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
  173. package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
  174. package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
  175. package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
  176. package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
  177. package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
  178. package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
  179. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  180. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
  181. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
  182. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
  183. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
  184. package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
  185. package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
  186. package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
  187. package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
  188. package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
  189. package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
  190. package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
  191. package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
  192. package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
  193. package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
  194. package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
  195. package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
  196. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
  197. package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
  198. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
  199. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
  200. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
  201. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
  202. package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
  203. package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
  204. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
  205. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
  206. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
  207. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
  208. package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
  209. package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
  210. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
  211. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
  212. package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
  213. package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
  214. package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
  215. package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
  216. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
  217. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
  218. package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
  219. package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
  220. package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
  221. package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
  222. package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
  223. package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
  224. package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
  225. package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
  226. package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
  227. package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
  228. package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
  229. package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
  230. package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
  231. package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
  232. package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
  233. package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
  234. package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
  235. package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
  236. package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
  237. package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
  238. package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
  239. package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
  240. package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
  241. package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
  242. package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
  243. package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
  244. package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
  245. package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
  246. package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
  247. package/node_modules/typebox/build/type/extends/object.mjs +25 -3
  248. package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
  249. package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
  250. package/node_modules/typebox/build/type/extends/record.mjs +23 -0
  251. package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
  252. package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
  253. package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
  254. package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
  255. package/node_modules/typebox/build/type/extends/union.mjs +2 -2
  256. package/node_modules/typebox/build/type/script/mapping.d.mts +84 -99
  257. package/node_modules/typebox/build/type/script/mapping.mjs +81 -85
  258. package/node_modules/typebox/build/type/script/parser.d.mts +40 -40
  259. package/node_modules/typebox/build/type/script/parser.mjs +22 -22
  260. package/node_modules/typebox/build/type/script/script.d.mts +3 -4
  261. package/node_modules/typebox/build/type/script/script.mjs +3 -2
  262. package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
  263. package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
  264. package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
  265. package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
  266. package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
  267. package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
  268. package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
  269. package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
  270. package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
  271. package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
  272. package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
  273. package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
  274. package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
  275. package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
  276. package/node_modules/typebox/build/type/types/call.d.mts +3 -3
  277. package/node_modules/typebox/build/type/types/call.mjs +3 -2
  278. package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
  279. package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
  280. package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
  281. package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
  282. package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
  283. package/node_modules/typebox/build/type/types/enum.mjs +5 -0
  284. package/node_modules/typebox/build/type/types/index.d.mts +1 -4
  285. package/node_modules/typebox/build/type/types/index.mjs +1 -4
  286. package/node_modules/typebox/build/type/types/number.d.mts +1 -1
  287. package/node_modules/typebox/build/type/types/number.mjs +1 -1
  288. package/node_modules/typebox/build/type/types/record.d.mts +13 -7
  289. package/node_modules/typebox/build/type/types/record.mjs +15 -9
  290. package/node_modules/typebox/build/type/types/static.d.mts +2 -5
  291. package/node_modules/typebox/build/typebox.d.mts +4 -8
  292. package/node_modules/typebox/build/typebox.mjs +4 -8
  293. package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
  294. package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
  295. package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
  296. package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
  297. package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
  298. package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
  299. package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
  300. package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
  301. package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
  302. package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
  303. package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
  304. package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
  305. package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
  306. package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
  307. package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
  308. package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
  309. package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
  310. package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
  311. package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
  312. package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
  313. package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
  314. package/node_modules/typebox/build/value/index.d.mts +0 -1
  315. package/node_modules/typebox/build/value/index.mjs +0 -1
  316. package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
  317. package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
  318. package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
  319. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
  320. package/node_modules/typebox/build/value/value.d.mts +0 -1
  321. package/node_modules/typebox/build/value/value.mjs +0 -1
  322. package/node_modules/typebox/package.json +25 -25
  323. package/node_modules/typebox/readme.md +97 -80
  324. package/npm-shrinkwrap.json +12 -12
  325. package/openclaw.plugin.json +8 -0
  326. package/package.json +6 -6
  327. package/dist/response-generator-CXBGKbAp.js +0 -212
  328. package/node_modules/commander/esm.mjs +0 -16
  329. package/node_modules/commander/typings/esm.d.mts +0 -3
  330. package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
  331. package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
  332. package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
  333. package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
  334. package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
  335. package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
  336. package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
  337. package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
  338. package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
  339. package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
  340. package/node_modules/typebox/build/type/action/options.d.mts +0 -11
  341. package/node_modules/typebox/build/type/action/options.mjs +0 -11
  342. package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
  343. package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
  344. package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
  345. package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
  346. package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
  347. package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
  348. package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
  349. package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
  350. package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
  351. package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
  352. package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
  353. package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
  354. package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
  355. package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
  356. package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
  357. package/node_modules/typebox/build/type/types/base.d.mts +0 -50
  358. package/node_modules/typebox/build/type/types/base.mjs +0 -84
  359. package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
  360. package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
  361. package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
  362. package/node_modules/typebox/build/type/types/promise.mjs +0 -29
  363. package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
  364. package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
  365. package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
  366. package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
  367. package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
  368. package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
  369. package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
  370. package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
  371. package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
  372. package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
  373. package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
  374. package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
  375. package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
  376. package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
  377. package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
  378. package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
  379. package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
  380. package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
  381. package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
  382. package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
  383. package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
  384. package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
  385. package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
  386. package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
  387. package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
  388. package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
  389. package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
  390. package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
  391. package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
  392. package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
  393. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
  394. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
package/README.md CHANGED
@@ -98,6 +98,7 @@ Put under `plugins.entries.voice-call.config`:
98
98
  Notes:
99
99
 
100
100
  - Twilio/Telnyx/Plivo require a **publicly reachable** webhook URL.
101
+ - Twilio defaults to US1. For a non-US Region, set `twilio.region` to `ie1` or `au1` and use credentials created in that Region; see [Twilio's regional REST API guide](https://www.twilio.com/docs/global-infrastructure/using-the-twilio-rest-api-in-a-non-us-region).
101
102
  - `mock` is a local dev provider (no network calls).
102
103
  - Telnyx requires `telnyx.publicKey` (or `TELNYX_PUBLIC_KEY`) unless `skipSignatureVerification` is true.
103
104
  - If older configs still use `provider: "log"`, `twilio.from`, or legacy `streaming.*` OpenAI keys, run `openclaw doctor --fix` to rewrite them.
@@ -1,13 +1,14 @@
1
1
  import { TtsConfigSchema } from "./runtime-api.js";
2
2
  import "./api.js";
3
+ import { normalizeAgentId, parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
3
4
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
5
  import { REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME, REALTIME_VOICE_AGENT_CONSULT_TOOL_POLICIES } from "openclaw/plugin-sdk/realtime-voice";
5
- import { normalizeAgentId, parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
6
6
  import { buildSecretInputSchema, hasConfiguredSecretInput, normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
7
7
  import { canonicalizeMainSessionAlias } from "openclaw/plugin-sdk/session-store-runtime";
8
+ import { normalizeWebhookPath } from "openclaw/plugin-sdk/webhook-ingress";
8
9
  import { z } from "zod";
9
10
  //#region extensions/voice-call/src/deep-merge.ts
10
- const BLOCKED_MERGE_KEYS = new Set([
11
+ const BLOCKED_MERGE_KEYS = /* @__PURE__ */ new Set([
11
12
  "__proto__",
12
13
  "prototype",
13
14
  "constructor"
@@ -24,13 +25,28 @@ function deepMergeDefined(base, override) {
24
25
  return result;
25
26
  }
26
27
  //#endregion
27
- //#region extensions/voice-call/src/path-utils.ts
28
- function normalizePath(pathname) {
29
- const trimmed = pathname.trim();
30
- if (!trimmed) return "/";
31
- const prefixed = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
32
- if (prefixed === "/") return prefixed;
33
- return prefixed.endsWith("/") ? prefixed.slice(0, -1) : prefixed;
28
+ //#region extensions/voice-call/src/providers/twilio-region.ts
29
+ const TWILIO_REGIONS = [
30
+ "us1",
31
+ "ie1",
32
+ "au1"
33
+ ];
34
+ const TWILIO_API_HOSTNAME_BY_REGION = {
35
+ us1: "api.twilio.com",
36
+ ie1: "api.dublin.ie1.twilio.com",
37
+ au1: "api.sydney.au1.twilio.com"
38
+ };
39
+ const TWILIO_API_HOSTNAMES = new Set(Object.values(TWILIO_API_HOSTNAME_BY_REGION));
40
+ function resolveTwilioApiHostname(region) {
41
+ return TWILIO_API_HOSTNAME_BY_REGION[region ?? "us1"];
42
+ }
43
+ function resolveTwilioApiBaseUrl(params) {
44
+ return `https://${resolveTwilioApiHostname(params.region)}/2010-04-01/Accounts/${params.accountSid}`;
45
+ }
46
+ function requireSupportedTwilioApiHostname(baseUrl) {
47
+ const hostname = new URL(baseUrl).hostname;
48
+ if (!TWILIO_API_HOSTNAMES.has(hostname)) throw new Error(`Unsupported Twilio API hostname: ${hostname}`);
49
+ return hostname;
34
50
  }
35
51
  //#endregion
36
52
  //#region extensions/voice-call/src/realtime-defaults.ts
@@ -69,7 +85,9 @@ const TwilioConfigSchema = z.object({
69
85
  /** Twilio Account SID */
70
86
  accountSid: z.string().min(1).optional(),
71
87
  /** Twilio Auth Token */
72
- authToken: SecretInputSchema.optional()
88
+ authToken: SecretInputSchema.optional(),
89
+ /** Twilio processing Region (for example, ie1) */
90
+ region: z.enum(TWILIO_REGIONS).optional()
73
91
  }).strict();
74
92
  const PlivoConfigSchema = z.object({
75
93
  /** Plivo Auth ID (starts with MA/SA) */
@@ -424,7 +442,7 @@ function cloneDefaultVoiceCallConfig() {
424
442
  return structuredClone(DEFAULT_VOICE_CALL_CONFIG);
425
443
  }
426
444
  function defaultRealtimeStreamPathForServePath(servePath) {
427
- const normalized = normalizePath(servePath);
445
+ const normalized = normalizeWebhookPath(servePath);
428
446
  if (normalized.endsWith("/webhook")) return `${normalized.slice(0, -8)}/stream/realtime`;
429
447
  if (normalized === "/") return "/voice/stream/realtime";
430
448
  return `${normalized}/stream/realtime`;
@@ -645,11 +663,11 @@ function validateProviderConfig(config) {
645
663
  }
646
664
  if (config.realtime.enabled && config.inboundPolicy === "disabled") errors.push("plugins.entries.voice-call.config.inboundPolicy must not be \"disabled\" when realtime.enabled is true");
647
665
  if (config.realtime.enabled && config.streaming.enabled) errors.push("plugins.entries.voice-call.config.realtime.enabled and plugins.entries.voice-call.config.streaming.enabled cannot both be true");
648
- if (config.realtime.enabled && config.provider && config.provider !== "twilio" && config.provider !== "telnyx") errors.push("plugins.entries.voice-call.config.provider must be \"twilio\" or \"telnyx\" when realtime.enabled is true");
666
+ if (config.realtime.enabled && config.provider && config.provider !== "twilio" && config.provider !== "telnyx" && config.provider !== "mock") errors.push("plugins.entries.voice-call.config.provider must be \"twilio\", \"telnyx\", or \"mock\" when realtime.enabled is true");
649
667
  return {
650
668
  valid: errors.length === 0,
651
669
  errors
652
670
  };
653
671
  }
654
672
  //#endregion
655
- export { resolveVoiceCallEffectiveConfig as a, validateProviderConfig as c, resolveVoiceCallConfig as i, normalizePath as l, normalizeVoiceCallConfig as n, resolveVoiceCallNumberRouteKeyForCall as o, resolveTwilioAuthToken as r, resolveVoiceCallSessionKey as s, VoiceCallConfigSchema as t, deepMergeDefined as u };
673
+ export { resolveVoiceCallEffectiveConfig as a, validateProviderConfig as c, deepMergeDefined as d, resolveVoiceCallConfig as i, requireSupportedTwilioApiHostname as l, normalizeVoiceCallConfig as n, resolveVoiceCallNumberRouteKeyForCall as o, resolveTwilioAuthToken as r, resolveVoiceCallSessionKey as s, VoiceCallConfigSchema as t, resolveTwilioApiBaseUrl as u };
@@ -1,4 +1,4 @@
1
- import { t as VoiceCallConfigSchema } from "./config-DNtTB7Iw.js";
1
+ import { t as VoiceCallConfigSchema } from "./config-CgigQDrF.js";
2
2
  import { asOptionalRecord, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  //#region extensions/voice-call/src/config-compat.ts
4
4
  /** Version where legacy voice-call config shape support is removed. */
@@ -26,7 +26,8 @@ function mergeProviderConfig(providersValue, providerId, compatValues) {
26
26
  /** Collect legacy voice-call config keys that should be migrated. */
27
27
  function collectVoiceCallLegacyConfigIssues(value) {
28
28
  const raw = asObject(value) ?? {};
29
- const realtimeAgentContext = asObject(asObject(raw.realtime)?.agentContext);
29
+ const realtime = asObject(raw.realtime);
30
+ const realtimeAgentContext = asObject(realtime?.agentContext);
30
31
  const twilio = asObject(raw.twilio);
31
32
  const streaming = asObject(raw.streaming);
32
33
  const issues = [];
@@ -1,8 +1,9 @@
1
- import { a as MAX_CALL_RECORD_EVENTS, f as prepareVoiceCallRecordForStorage, i as CALL_RECORD_EVENT_META_MAX_ENTRIES, n as CALL_RECORD_EVENTS_NAMESPACE, o as RAW_CALL_RECORD_CHUNK_BYTES, p as resolveVoiceCallLegacyCallLogPath, r as CALL_RECORD_EVENT_CHUNKS_NAMESPACE, s as buildVoiceCallLegacyJsonlEventKey, t as CALL_RECORD_CHUNK_MAX_ENTRIES, u as parseVoiceCallRecordLine } from "./store-8M2m4Isq.js";
1
+ import { a as MAX_CALL_RECORD_EVENTS, d as parseVoiceCallRecordLine, i as CALL_RECORD_EVENT_META_MAX_ENTRIES, m as resolveVoiceCallLegacyCallLogPath, n as CALL_RECORD_EVENTS_NAMESPACE, o as RAW_CALL_RECORD_CHUNK_BYTES, p as prepareVoiceCallRecordForStorage, r as CALL_RECORD_EVENT_CHUNKS_NAMESPACE, s as buildVoiceCallLegacyJsonlEventKey, t as CALL_RECORD_CHUNK_MAX_ENTRIES } from "./store-DtewuuOb.js";
2
2
  import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs/promises";
6
+ import { archiveLegacyStateSource } from "openclaw/plugin-sdk/runtime-doctor";
6
7
  //#region extensions/voice-call/doctor-contract-api.ts
7
8
  /** Resolve home from doctor env with OS fallback. */
8
9
  function resolveHome(env) {
@@ -52,13 +53,6 @@ function resolveVoiceCallStorePath(params) {
52
53
  return path.join(resolveHome(params.env), ".openclaw", "voice-calls");
53
54
  }
54
55
  /** Return true when a path exists and is a file. */
55
- async function fileExists(filePath) {
56
- try {
57
- return (await fs.stat(filePath)).isFile();
58
- } catch {
59
- return false;
60
- }
61
- }
62
56
  /** Build the plugin state key for one migrated event chunk. */
63
57
  function buildChunkKey(eventKey, index) {
64
58
  return `${eventKey}:chunk:${String(index).padStart(4, "0")}`;
@@ -129,19 +123,6 @@ async function readLegacyCallRecords(filePath) {
129
123
  };
130
124
  }
131
125
  /** Archive the legacy JSONL source after a complete migration. */
132
- async function archiveLegacySource(params) {
133
- const archivedPath = `${params.filePath}.migrated`;
134
- if (await fileExists(archivedPath)) {
135
- params.warnings.push(`Left migrated Voice Call call-log source in place because ${archivedPath} already exists`);
136
- return;
137
- }
138
- try {
139
- await fs.rename(params.filePath, archivedPath);
140
- params.changes.push(`Archived Voice Call call-log legacy source -> ${archivedPath}`);
141
- } catch (err) {
142
- params.warnings.push(`Failed archiving Voice Call call-log legacy source: ${String(err)}`);
143
- }
144
- }
145
126
  /** Select newest missing records that fit remaining plugin state capacity. */
146
127
  async function selectEntriesForImport(params) {
147
128
  const existingEventKeys = new Set((await params.eventStore.entries()).map((entry) => entry.key));
@@ -229,8 +210,9 @@ const stateMigrations = [{
229
210
  warnings
230
211
  };
231
212
  }
232
- await archiveLegacySource({
213
+ await archiveLegacyStateSource({
233
214
  filePath,
215
+ label: "Voice Call call-log",
234
216
  changes,
235
217
  warnings
236
218
  });
@@ -1,53 +1,22 @@
1
1
  import { fetchWithSsrFGuard } from "./runtime-api.js";
2
2
  import "./api.js";
3
- import { a as getHeader } from "./runtime-entry-DN7HllXj.js";
3
+ import { n as normalizeProxyIp, o as getHeader } from "./runtime-entry-kCq5Xjph.js";
4
+ import { n as markWebhookReplay, t as createWebhookReplayCache } from "./webhook-replay-aaP79dI8.js";
4
5
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
5
6
  import { isLoopbackHost } from "openclaw/plugin-sdk/gateway-runtime";
6
- import { isFutureDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
7
7
  import { normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  import crypto from "node:crypto";
9
9
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
10
10
  //#region extensions/voice-call/src/webhook-security.ts
11
- const REPLAY_WINDOW_MS = 600 * 1e3;
12
- const REPLAY_CACHE_MAX_ENTRIES = 1e4;
13
- const REPLAY_CACHE_PRUNE_INTERVAL = 64;
14
- const twilioReplayCache = {
15
- seenUntil: /* @__PURE__ */ new Map(),
16
- calls: 0
17
- };
18
- const plivoReplayCache = {
19
- seenUntil: /* @__PURE__ */ new Map(),
20
- calls: 0
21
- };
22
- const telnyxReplayCache = {
23
- seenUntil: /* @__PURE__ */ new Map(),
24
- calls: 0
25
- };
11
+ const twilioReplayCache = createWebhookReplayCache();
12
+ const plivoReplayCache = createWebhookReplayCache();
13
+ const telnyxReplayCache = createWebhookReplayCache();
26
14
  function sha256Hex(input) {
27
15
  return crypto.createHash("sha256").update(input).digest("hex");
28
16
  }
29
17
  function createSkippedVerificationReplayKey(provider, ctx) {
30
18
  return `${provider}:skip:${sha256Hex(`${ctx.method}\n${ctx.url}\n${ctx.rawBody}`)}`;
31
19
  }
32
- function pruneReplayCache(cache, now) {
33
- for (const [key, expiresAt] of cache.seenUntil) if (!isFutureDateTimestampMs(expiresAt, { nowMs: now })) cache.seenUntil.delete(key);
34
- while (cache.seenUntil.size > REPLAY_CACHE_MAX_ENTRIES) {
35
- const oldest = cache.seenUntil.keys().next().value;
36
- if (!oldest) break;
37
- cache.seenUntil.delete(oldest);
38
- }
39
- }
40
- function markReplay(cache, replayKey) {
41
- const now = Date.now();
42
- cache.calls += 1;
43
- if (cache.calls % REPLAY_CACHE_PRUNE_INTERVAL === 0) pruneReplayCache(cache, now);
44
- const existing = cache.seenUntil.get(replayKey);
45
- if (existing !== void 0 && isFutureDateTimestampMs(existing, { nowMs: now })) return true;
46
- const expiresAt = resolveExpiresAtMsFromDurationMs(REPLAY_WINDOW_MS, { nowMs: now });
47
- if (expiresAt !== void 0) cache.seenUntil.set(replayKey, expiresAt);
48
- if (cache.seenUntil.size > REPLAY_CACHE_MAX_ENTRIES) pruneReplayCache(cache, now);
49
- return false;
50
- }
51
20
  /**
52
21
  * Validate Twilio webhook signature using HMAC-SHA1.
53
22
  *
@@ -59,7 +28,7 @@ function markReplay(cache, replayKey) {
59
28
  function validateTwilioSignature(authToken, signature, url, params) {
60
29
  if (!signature) return false;
61
30
  const dataToSign = buildTwilioDataToSign(url, params);
62
- return timingSafeEqual(signature, crypto.createHmac("sha1", authToken).update(dataToSign).digest("base64"));
31
+ return safeEqualSecret(signature, crypto.createHmac("sha1", authToken).update(dataToSign).digest("base64"));
63
32
  }
64
33
  function buildTwilioDataToSign(url, params) {
65
34
  let dataToSign = url;
@@ -71,12 +40,6 @@ function buildCanonicalTwilioParamString(params) {
71
40
  return Array.from(params.entries()).toSorted((a, b) => a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0).map(([key, value]) => `${key}=${value}`).join("&");
72
41
  }
73
42
  /**
74
- * Timing-safe string comparison to prevent timing attacks.
75
- */
76
- function timingSafeEqual(a, b) {
77
- return safeEqualSecret(a, b);
78
- }
79
- /**
80
43
  * Validate that a hostname matches RFC 1123 format.
81
44
  * Prevents injection of malformed hostnames.
82
45
  */
@@ -141,7 +104,9 @@ function reconstructWebhookUrl(ctx, options) {
141
104
  const trustedProxyIPs = options?.trustedProxyIPs?.filter(Boolean) ?? [];
142
105
  const hasTrustedProxyIPs = trustedProxyIPs.length > 0;
143
106
  const remoteIP = options?.remoteIP ?? ctx.remoteAddress;
144
- const fromTrustedProxy = !hasTrustedProxyIPs || (remoteIP ? trustedProxyIPs.includes(remoteIP) : false);
107
+ const normalizedTrustedProxyIps = new Set(trustedProxyIPs.map((ip) => normalizeProxyIp(ip)).filter((ip) => Boolean(ip)));
108
+ const normalizedRemoteIp = normalizeProxyIp(remoteIP);
109
+ const fromTrustedProxy = !hasTrustedProxyIPs || (normalizedRemoteIp ? normalizedTrustedProxyIps.has(normalizedRemoteIp) : false);
145
110
  const shouldTrustForwardingHeaders = (hasAllowedHosts || explicitlyTrusted) && fromTrustedProxy;
146
111
  const isAllowedForwardedHost = (host) => !allowedHosts || allowedHosts.has(host);
147
112
  let proto = "https";
@@ -268,7 +233,7 @@ function verifyTelnyxWebhook(ctx, publicKey, options) {
268
233
  return {
269
234
  ok: true,
270
235
  reason: "verification skipped (dev mode)",
271
- isReplay: markReplay(telnyxReplayCache, replayKey),
236
+ isReplay: markWebhookReplay(telnyxReplayCache, replayKey),
272
237
  verifiedRequestKey: replayKey
273
238
  };
274
239
  }
@@ -305,7 +270,7 @@ function verifyTelnyxWebhook(ctx, publicKey, options) {
305
270
  const replayKey = `telnyx:${sha256Hex(`${timestamp}\n${canonicalSignature}\n${ctx.rawBody}`)}`;
306
271
  return {
307
272
  ok: true,
308
- isReplay: markReplay(telnyxReplayCache, replayKey),
273
+ isReplay: markWebhookReplay(telnyxReplayCache, replayKey),
309
274
  verifiedRequestKey: replayKey
310
275
  };
311
276
  } catch (err) {
@@ -324,7 +289,7 @@ function verifyTwilioWebhook(ctx, authToken, options) {
324
289
  return {
325
290
  ok: true,
326
291
  reason: "verification skipped (dev mode)",
327
- isReplay: markReplay(twilioReplayCache, replayKey),
292
+ isReplay: markWebhookReplay(twilioReplayCache, replayKey),
328
293
  verifiedRequestKey: replayKey
329
294
  };
330
295
  }
@@ -351,7 +316,7 @@ function verifyTwilioWebhook(ctx, authToken, options) {
351
316
  return {
352
317
  ok: true,
353
318
  verificationUrl,
354
- isReplay: markReplay(twilioReplayCache, replayKey),
319
+ isReplay: markWebhookReplay(twilioReplayCache, replayKey),
355
320
  verifiedRequestKey: replayKey
356
321
  };
357
322
  }
@@ -375,7 +340,7 @@ function verifyTwilioWebhook(ctx, authToken, options) {
375
340
  return {
376
341
  ok: true,
377
342
  verificationUrl: candidateUrl,
378
- isReplay: markReplay(twilioReplayCache, replayKey),
343
+ isReplay: markWebhookReplay(twilioReplayCache, replayKey),
379
344
  verifiedRequestKey: replayKey
380
345
  };
381
346
  }
@@ -404,12 +369,9 @@ function createPlivoV3ReplayKey(params) {
404
369
  postParams: params.postParams
405
370
  })}\n${params.nonce}`)}`;
406
371
  }
407
- function timingSafeEqualString(a, b) {
408
- return safeEqualSecret(a, b);
409
- }
410
372
  function validatePlivoV2Signature(params) {
411
373
  const baseUrl = getBaseUrlNoQuery(params.url);
412
- return timingSafeEqualString(normalizeSignatureBase64(crypto.createHmac("sha256", params.authToken).update(baseUrl + params.nonce).digest("base64")), normalizeSignatureBase64(params.signature));
374
+ return safeEqualSecret(normalizeSignatureBase64(crypto.createHmac("sha256", params.authToken).update(baseUrl + params.nonce).digest("base64")), normalizeSignatureBase64(params.signature));
413
375
  }
414
376
  function toParamMapFromSearchParams(sp) {
415
377
  const map = {};
@@ -454,7 +416,7 @@ function validatePlivoV3Signature(params) {
454
416
  })}.${params.nonce}`;
455
417
  const expected = normalizeSignatureBase64(crypto.createHmac("sha256", params.authToken).update(hmacBase).digest("base64"));
456
418
  const provided = normalizeStringEntries(params.signatureHeader.split(",")).map((s) => normalizeSignatureBase64(s));
457
- for (const sig of provided) if (timingSafeEqualString(expected, sig)) return true;
419
+ for (const sig of provided) if (safeEqualSecret(expected, sig)) return true;
458
420
  return false;
459
421
  }
460
422
  /**
@@ -470,7 +432,7 @@ function verifyPlivoWebhook(ctx, authToken, options) {
470
432
  return {
471
433
  ok: true,
472
434
  reason: "verification skipped (dev mode)",
473
- isReplay: markReplay(plivoReplayCache, replayKey),
435
+ isReplay: markWebhookReplay(plivoReplayCache, replayKey),
474
436
  verifiedRequestKey: replayKey
475
437
  };
476
438
  }
@@ -522,7 +484,7 @@ function verifyPlivoWebhook(ctx, authToken, options) {
522
484
  postParams,
523
485
  nonce: nonceV3
524
486
  });
525
- const isReplay = markReplay(plivoReplayCache, replayKey);
487
+ const isReplay = markWebhookReplay(plivoReplayCache, replayKey);
526
488
  return {
527
489
  ok: true,
528
490
  version: "v3",
@@ -544,7 +506,7 @@ function verifyPlivoWebhook(ctx, authToken, options) {
544
506
  reason: "Invalid Plivo V2 signature"
545
507
  };
546
508
  const replayKey = createPlivoV2ReplayKey(verificationUrl, nonceV2);
547
- const isReplay = markReplay(plivoReplayCache, replayKey);
509
+ const isReplay = markWebhookReplay(plivoReplayCache, replayKey);
548
510
  return {
549
511
  ok: true,
550
512
  version: "v2",
package/dist/index.js CHANGED
@@ -1,13 +1,15 @@
1
1
  import { definePluginEntry, sleep } from "./runtime-api.js";
2
2
  import "./api.js";
3
- import { c as validateProviderConfig, i as resolveVoiceCallConfig } from "./config-DNtTB7Iw.js";
4
- import { c as getTailscaleSelfInfo, l as setupTailscaleExposureRoute, o as resolveWebhookExposureStatus, p as resolveUserPath, s as cleanupTailscaleExposureRoute, t as createVoiceCallRuntime } from "./runtime-entry-DN7HllXj.js";
5
- import { c as getCallHistoryFromStore, m as setVoiceCallStateRuntime } from "./store-8M2m4Isq.js";
6
- import { i as parseVoiceCallPluginConfig, r as normalizeVoiceCallLegacyConfigInput, t as formatVoiceCallLegacyConfigWarnings } from "./config-compat-CCEjHjAJ.js";
3
+ import { c as validateProviderConfig, i as resolveVoiceCallConfig } from "./config-CgigQDrF.js";
4
+ import { c as cleanupTailscaleExposureRoute, h as resolveUserPath, l as getTailscaleSelfInfo, s as resolveWebhookExposureStatus, t as createVoiceCallRuntime, u as setupTailscaleExposureRoute } from "./runtime-entry-kCq5Xjph.js";
5
+ import { h as setVoiceCallStateRuntime, l as getCallHistoryFromStore } from "./store-DtewuuOb.js";
6
+ import { i as parseVoiceCallPluginConfig, r as normalizeVoiceCallLegacyConfigInput, t as formatVoiceCallLegacyConfigWarnings } from "./config-compat-DAFd5tVH.js";
7
7
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
8
8
  import { ErrorCodes, callGatewayFromCli, errorShape } from "openclaw/plugin-sdk/gateway-runtime";
9
9
  import { MAX_TCP_PORT, MAX_TIMER_TIMEOUT_MS, addTimerTimeoutGraceMs, clampTimerTimeoutMs, parseStrictNonNegativeInteger, resolveTimerTimeoutMs, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
10
+ import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
10
11
  import { isRecord, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
12
+ import { jsonResult } from "openclaw/plugin-sdk/tool-results";
11
13
  import { Type } from "typebox";
12
14
  import fs from "node:fs";
13
15
  import os from "node:os";
@@ -403,7 +405,7 @@ function registerVoiceCallCli(params) {
403
405
  }
404
406
  const rt = await ensureRuntime();
405
407
  if (options.callId) {
406
- writeStdoutJson(rt.manager.getCall(options.callId) ?? { found: false });
408
+ writeStdoutJson(await rt.manager.getCallFromMemoryOrStore(options.callId) ?? { found: false });
407
409
  return;
408
410
  }
409
411
  writeStdoutJson({
@@ -702,6 +704,10 @@ const voiceCallConfigSchema = {
702
704
  label: "Twilio Auth Token",
703
705
  sensitive: true
704
706
  },
707
+ "twilio.region": {
708
+ label: "Twilio Region",
709
+ advanced: true
710
+ },
705
711
  "outbound.defaultMode": { label: "Default Call Mode" },
706
712
  "outbound.notifyHangupDelaySec": {
707
713
  label: "Notify Hangup Delay (sec)",
@@ -1001,7 +1007,7 @@ var voice_call_default = definePluginEntry({
1001
1007
  respondError(respond, formatErrorMessage(err));
1002
1008
  };
1003
1009
  const describeHistoricalCall = async (rt, callId) => {
1004
- const call = (await rt.manager.getCallHistory(100)).toReversed().find((candidate) => candidate.callId === callId || candidate.providerCallId === callId);
1010
+ const call = await rt.manager.getCallFromMemoryOrStore(callId);
1005
1011
  if (!call) return;
1006
1012
  const endedAt = timestampMsToIsoString(call.endedAt);
1007
1013
  return `call is not active (${[
@@ -1028,7 +1034,8 @@ var voice_call_default = definePluginEntry({
1028
1034
  message: params.message,
1029
1035
  mode: params.mode,
1030
1036
  dtmfSequence: params.dtmfSequence,
1031
- ...params.requesterSessionKey ? { requesterSessionKey: params.requesterSessionKey } : {}
1037
+ ...params.requesterSessionKey ? { requesterSessionKey: params.requesterSessionKey } : {},
1038
+ ...params.agentId ? { agentId: params.agentId } : {}
1032
1039
  });
1033
1040
  if (!result.success) {
1034
1041
  respondError(params.respond, result.error || "initiate failed");
@@ -1068,12 +1075,13 @@ var voice_call_default = definePluginEntry({
1068
1075
  respondError(respond, "to required", ErrorCodes.INVALID_REQUEST);
1069
1076
  return;
1070
1077
  }
1078
+ const mode = params?.mode === "notify" || params?.mode === "conversation" ? params.mode : void 0;
1071
1079
  await initiateCallAndRespond({
1072
1080
  rt,
1073
1081
  respond,
1074
1082
  to,
1075
1083
  message,
1076
- mode: params?.mode === "notify" || params?.mode === "conversation" ? params.mode : void 0,
1084
+ mode,
1077
1085
  sessionKey: normalizeOptionalString(params?.sessionKey),
1078
1086
  requesterSessionKey: normalizeOptionalString(params?.requesterSessionKey)
1079
1087
  });
@@ -1200,7 +1208,7 @@ var voice_call_default = definePluginEntry({
1200
1208
  });
1201
1209
  return;
1202
1210
  }
1203
- const call = rt.manager.getCall(raw) || rt.manager.getCallByProviderCallId(raw);
1211
+ const call = await rt.manager.getCallFromMemoryOrStore(raw);
1204
1212
  if (!call) {
1205
1213
  respond(true, { found: false });
1206
1214
  return;
@@ -1213,46 +1221,49 @@ var voice_call_default = definePluginEntry({
1213
1221
  sendError(respond, err);
1214
1222
  }
1215
1223
  }, VOICE_CALL_READ_METHOD_SCOPE);
1216
- api.registerGatewayMethod("voicecall.start", async ({ params, respond }) => {
1224
+ api.registerGatewayMethod("voicecall.start", async ({ params, client, respond }) => {
1217
1225
  try {
1218
1226
  const to = normalizeOptionalString(params?.to) ?? "";
1219
1227
  const message = normalizeOptionalString(params?.message) ?? "";
1220
1228
  const dtmfSequence = normalizeOptionalString(params?.dtmfSequence);
1221
1229
  const sessionKey = normalizeOptionalString(params?.sessionKey);
1222
1230
  const requesterSessionKey = normalizeOptionalString(params?.requesterSessionKey);
1231
+ const requestedAgentId = normalizeOptionalString(params?.agentId);
1232
+ const normalizedAgentId = requestedAgentId ? normalizeAgentId(requestedAgentId) : void 0;
1233
+ const pluginOwnerId = normalizeOptionalString(client?.internal?.pluginRuntimeOwnerId);
1234
+ if (requestedAgentId && (!pluginOwnerId || normalizedAgentId !== requestedAgentId.toLowerCase())) {
1235
+ respondError(respond, "agentId requires a trusted plugin caller and a valid agent id", ErrorCodes.INVALID_REQUEST);
1236
+ return;
1237
+ }
1223
1238
  if (!to) {
1224
1239
  respondError(respond, "to required", ErrorCodes.INVALID_REQUEST);
1225
1240
  return;
1226
1241
  }
1227
1242
  const mode = params?.mode === "notify" || params?.mode === "conversation" ? params.mode : void 0;
1243
+ const rt = await ensureRuntime();
1228
1244
  await initiateCallAndRespond({
1229
- rt: await ensureRuntime(),
1245
+ rt,
1230
1246
  respond,
1231
1247
  to,
1232
1248
  message: message || void 0,
1233
1249
  mode,
1234
1250
  dtmfSequence,
1235
1251
  sessionKey,
1236
- ...requesterSessionKey ? { requesterSessionKey } : {}
1252
+ ...requesterSessionKey ? { requesterSessionKey } : {},
1253
+ ...normalizedAgentId ? { agentId: normalizedAgentId } : {}
1237
1254
  });
1238
1255
  } catch (err) {
1239
1256
  sendError(respond, err);
1240
1257
  }
1241
1258
  }, VOICE_CALL_WRITE_METHOD_SCOPE);
1242
- api.registerTool({
1259
+ api.registerTool((toolContext) => ({
1243
1260
  name: "voice_call",
1244
1261
  label: "Voice Call",
1245
1262
  description: "Make phone calls and have voice conversations via the voice-call plugin.",
1246
1263
  parameters: VoiceCallToolSchema,
1247
1264
  async execute(_toolCallId, params) {
1248
1265
  const rawParams = asParamRecord(params);
1249
- const json = (payload) => ({
1250
- content: [{
1251
- type: "text",
1252
- text: JSON.stringify(payload, null, 2)
1253
- }],
1254
- details: payload
1255
- });
1266
+ const agentId = normalizeOptionalString(toolContext.agentId);
1256
1267
  try {
1257
1268
  const rt = await ensureRuntime();
1258
1269
  if (typeof rawParams.action === "string") switch (rawParams.action) {
@@ -1264,10 +1275,11 @@ var voice_call_default = definePluginEntry({
1264
1275
  const result = await rt.manager.initiateCall(to, void 0, {
1265
1276
  message,
1266
1277
  dtmfSequence: normalizeOptionalString(rawParams.dtmfSequence),
1267
- mode: rawParams.mode === "notify" || rawParams.mode === "conversation" ? rawParams.mode : void 0
1278
+ mode: rawParams.mode === "notify" || rawParams.mode === "conversation" ? rawParams.mode : void 0,
1279
+ ...agentId ? { agentId } : {}
1268
1280
  });
1269
1281
  if (!result.success) throw new Error(result.error || "initiate failed");
1270
- return json({
1282
+ return jsonResult({
1271
1283
  callId: result.callId,
1272
1284
  initiated: true
1273
1285
  });
@@ -1278,7 +1290,7 @@ var voice_call_default = definePluginEntry({
1278
1290
  if (!callId || !message) throw new Error("callId and message required");
1279
1291
  const result = await rt.manager.continueCall(callId, message);
1280
1292
  if (!result.success) throw new Error(result.error || "continue failed");
1281
- return json({
1293
+ return jsonResult({
1282
1294
  success: true,
1283
1295
  transcript: result.transcript
1284
1296
  });
@@ -1289,7 +1301,7 @@ var voice_call_default = definePluginEntry({
1289
1301
  if (!callId || !message) throw new Error("callId and message required");
1290
1302
  const result = await rt.manager.speak(callId, message);
1291
1303
  if (!result.success) throw new Error(result.error || "speak failed");
1292
- return json({ success: true });
1304
+ return jsonResult({ success: true });
1293
1305
  }
1294
1306
  case "send_dtmf": {
1295
1307
  const callId = normalizeOptionalString(rawParams.callId) ?? "";
@@ -1297,20 +1309,20 @@ var voice_call_default = definePluginEntry({
1297
1309
  if (!callId || !digits) throw new Error("callId and digits required");
1298
1310
  const result = await rt.manager.sendDtmf(callId, digits);
1299
1311
  if (!result.success) throw new Error(result.error || "dtmf failed");
1300
- return json({ success: true });
1312
+ return jsonResult({ success: true });
1301
1313
  }
1302
1314
  case "end_call": {
1303
1315
  const callId = normalizeOptionalString(rawParams.callId) ?? "";
1304
1316
  if (!callId) throw new Error("callId required");
1305
1317
  const result = await rt.manager.endCall(callId);
1306
1318
  if (!result.success) throw new Error(result.error || "end failed");
1307
- return json({ success: true });
1319
+ return jsonResult({ success: true });
1308
1320
  }
1309
1321
  case "get_status": {
1310
1322
  const callId = normalizeOptionalString(rawParams.callId) ?? "";
1311
1323
  if (!callId) throw new Error("callId required");
1312
- const call = rt.manager.getCall(callId) || rt.manager.getCallByProviderCallId(callId);
1313
- return json(call ? {
1324
+ const call = await rt.manager.getCallFromMemoryOrStore(callId);
1325
+ return jsonResult(call ? {
1314
1326
  found: true,
1315
1327
  call: toVoiceCallStatus(call)
1316
1328
  } : { found: false });
@@ -1319,8 +1331,8 @@ var voice_call_default = definePluginEntry({
1319
1331
  if ((rawParams.mode ?? "call") === "status") {
1320
1332
  const sid = normalizeOptionalString(rawParams.sid) ?? "";
1321
1333
  if (!sid) throw new Error("sid required for status");
1322
- const call = rt.manager.getCall(sid) || rt.manager.getCallByProviderCallId(sid);
1323
- return json(call ? {
1334
+ const call = await rt.manager.getCallFromMemoryOrStore(sid);
1335
+ return jsonResult(call ? {
1324
1336
  found: true,
1325
1337
  call: toVoiceCallStatus(call)
1326
1338
  } : { found: false });
@@ -1330,18 +1342,19 @@ var voice_call_default = definePluginEntry({
1330
1342
  const result = await rt.manager.initiateCall(to, normalizeOptionalString(rawParams.sessionKey), {
1331
1343
  dtmfSequence: normalizeOptionalString(rawParams.dtmfSequence),
1332
1344
  message: normalizeOptionalString(rawParams.message),
1345
+ ...agentId ? { agentId } : {},
1333
1346
  ...normalizeOptionalString(rawParams.requesterSessionKey) ? { requesterSessionKey: normalizeOptionalString(rawParams.requesterSessionKey) } : {}
1334
1347
  });
1335
1348
  if (!result.success) throw new Error(result.error || "initiate failed");
1336
- return json({
1349
+ return jsonResult({
1337
1350
  callId: result.callId,
1338
1351
  initiated: true
1339
1352
  });
1340
1353
  } catch (err) {
1341
- return json({ error: formatErrorMessage(err) });
1354
+ return jsonResult({ error: formatErrorMessage(err) });
1342
1355
  }
1343
1356
  }
1344
- });
1357
+ }));
1345
1358
  api.registerCli(({ program }) => registerVoiceCallCli({
1346
1359
  program,
1347
1360
  config,
@@ -1,3 +1,4 @@
1
+ import { n as markWebhookReplay, t as createWebhookReplayCache } from "./webhook-replay-aaP79dI8.js";
1
2
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
2
3
  import crypto from "node:crypto";
3
4
  //#region extensions/voice-call/src/providers/mock.ts
@@ -11,9 +12,16 @@ import crypto from "node:crypto";
11
12
  var MockProvider = class {
12
13
  constructor() {
13
14
  this.name = "mock";
15
+ this.replayCache = createWebhookReplayCache();
14
16
  }
15
- verifyWebhook(_ctx) {
16
- return { ok: true };
17
+ verifyWebhook(ctx) {
18
+ const requestMaterial = `${ctx.method}\n${ctx.url}\n${ctx.rawBody}`;
19
+ const key = `mock:${crypto.createHash("sha256").update(requestMaterial).digest("hex")}`;
20
+ return {
21
+ ok: true,
22
+ verifiedRequestKey: key,
23
+ isReplay: markWebhookReplay(this.replayCache, key)
24
+ };
17
25
  }
18
26
  parseWebhookEvent(ctx, _options) {
19
27
  try {
@@ -62,6 +70,14 @@ var MockProvider = class {
62
70
  text: payload.text ?? ""
63
71
  };
64
72
  }
73
+ case "call.assistant-speech": {
74
+ const payload = evt;
75
+ return {
76
+ ...base,
77
+ type: evt.type,
78
+ transcript: payload.transcript ?? ""
79
+ };
80
+ }
65
81
  case "call.speech": {
66
82
  const payload = evt;
67
83
  return {