@openclaw/voice-call 2026.9.4 → 2026.9.5

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 (644) hide show
  1. package/assets/activity.svg +3 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/{cli-BGdihqyA.js → .setup/cli-z1onSLj4.mjs} +7 -7
  4. package/dist/{config-DQwvsxeV.js → .setup/config-72FnMWHb.mjs} +3 -3
  5. package/dist/{guarded-json-api-3Jy2k-eX.js → .setup/guarded-json-api-CuLkeTrl.mjs} +17 -39
  6. package/dist/{mock-C57qj18W.js → .setup/mock-CcYEAUhV.mjs} +1 -1
  7. package/dist/{plivo-BsdFT1gS.js → .setup/plivo-DWYNkAQ3.mjs} +2 -2
  8. package/dist/{realtime-handler-C7N4qzvf.js → .setup/realtime-handler-CaoetLrM.mjs} +284 -135
  9. package/dist/{response-generator-DsdC88Xg.js → .setup/response-generator-DB1nElLO.mjs} +2 -2
  10. package/dist/{runtime-entry-Ln4SWaYK.js → .setup/runtime-entry-YWSSnAsH.mjs} +457 -291
  11. package/dist/{store-path-M0GXxUfv.js → .setup/store-path-B1j1up4_.mjs} +91 -55
  12. package/dist/{telnyx-eCxGOUfA.js → .setup/telnyx-BY3ef4Cc.mjs} +1 -1
  13. package/dist/{twilio-DQKhnXXE.js → .setup/twilio-DWZ4HVmF.mjs} +9 -23
  14. package/dist/doctor-contract-api.js +14 -33
  15. package/dist/index.js +3 -3
  16. package/dist/runtime-entry.js +1 -1
  17. package/node_modules/typebox/build/compile/validator.d.mts +1 -1
  18. package/node_modules/typebox/build/compile/validator.mjs +1 -1
  19. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
  20. package/node_modules/typebox/build/format/iri.mjs +5 -1
  21. package/node_modules/typebox/build/guard/emit.mjs +2 -4
  22. package/node_modules/typebox/build/guard/guard.mjs +6 -18
  23. package/node_modules/typebox/build/guard/string.mjs +16 -24
  24. package/node_modules/typebox/build/schema/build.mjs +2 -2
  25. package/node_modules/typebox/build/schema/check.mjs +1 -1
  26. package/node_modules/typebox/build/schema/compile.d.mts +3 -2
  27. package/node_modules/typebox/build/schema/compile.mjs +8 -8
  28. package/node_modules/typebox/build/schema/engine/_context.d.mts +6 -7
  29. package/node_modules/typebox/build/schema/engine/_context.mjs +23 -15
  30. package/node_modules/typebox/build/schema/engine/_functions.d.mts +2 -2
  31. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
  32. package/node_modules/typebox/build/schema/engine/_reducer.d.mts +3 -3
  33. package/node_modules/typebox/build/schema/engine/_refine.d.mts +5 -5
  34. package/node_modules/typebox/build/schema/engine/_refine.mjs +4 -7
  35. package/node_modules/typebox/build/schema/engine/_stack.d.mts +34 -16
  36. package/node_modules/typebox/build/schema/engine/_stack.mjs +148 -104
  37. package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +4 -4
  38. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +8 -8
  39. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +26 -18
  40. package/node_modules/typebox/build/schema/engine/allOf.d.mts +4 -4
  41. package/node_modules/typebox/build/schema/engine/allOf.mjs +3 -3
  42. package/node_modules/typebox/build/schema/engine/anyOf.d.mts +4 -4
  43. package/node_modules/typebox/build/schema/engine/anyOf.mjs +5 -10
  44. package/node_modules/typebox/build/schema/engine/boolean.d.mts +4 -4
  45. package/node_modules/typebox/build/schema/engine/boolean.mjs +2 -6
  46. package/node_modules/typebox/build/schema/engine/const.d.mts +4 -4
  47. package/node_modules/typebox/build/schema/engine/const.mjs +2 -6
  48. package/node_modules/typebox/build/schema/engine/contains.d.mts +4 -4
  49. package/node_modules/typebox/build/schema/engine/contains.mjs +2 -6
  50. package/node_modules/typebox/build/schema/engine/dependencies.d.mts +4 -4
  51. package/node_modules/typebox/build/schema/engine/dependencies.mjs +3 -6
  52. package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +4 -4
  53. package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +2 -6
  54. package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +4 -4
  55. package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +4 -4
  56. package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +11 -7
  57. package/node_modules/typebox/build/schema/engine/enum.d.mts +4 -4
  58. package/node_modules/typebox/build/schema/engine/enum.mjs +2 -6
  59. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +4 -4
  60. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +2 -6
  61. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +4 -4
  62. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +2 -6
  63. package/node_modules/typebox/build/schema/engine/format.d.mts +4 -4
  64. package/node_modules/typebox/build/schema/engine/format.mjs +2 -6
  65. package/node_modules/typebox/build/schema/engine/if.d.mts +4 -4
  66. package/node_modules/typebox/build/schema/engine/if.mjs +7 -15
  67. package/node_modules/typebox/build/schema/engine/items.d.mts +4 -4
  68. package/node_modules/typebox/build/schema/engine/items.mjs +1 -1
  69. package/node_modules/typebox/build/schema/engine/maxContains.d.mts +4 -4
  70. package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -6
  71. package/node_modules/typebox/build/schema/engine/maxItems.d.mts +4 -4
  72. package/node_modules/typebox/build/schema/engine/maxItems.mjs +2 -6
  73. package/node_modules/typebox/build/schema/engine/maxLength.d.mts +4 -4
  74. package/node_modules/typebox/build/schema/engine/maxLength.mjs +2 -6
  75. package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +4 -4
  76. package/node_modules/typebox/build/schema/engine/maxProperties.mjs +2 -6
  77. package/node_modules/typebox/build/schema/engine/maximum.d.mts +4 -4
  78. package/node_modules/typebox/build/schema/engine/maximum.mjs +2 -6
  79. package/node_modules/typebox/build/schema/engine/minContains.d.mts +4 -4
  80. package/node_modules/typebox/build/schema/engine/minContains.mjs +2 -6
  81. package/node_modules/typebox/build/schema/engine/minItems.d.mts +5 -5
  82. package/node_modules/typebox/build/schema/engine/minItems.mjs +2 -6
  83. package/node_modules/typebox/build/schema/engine/minLength.d.mts +4 -4
  84. package/node_modules/typebox/build/schema/engine/minLength.mjs +2 -6
  85. package/node_modules/typebox/build/schema/engine/minProperties.d.mts +4 -4
  86. package/node_modules/typebox/build/schema/engine/minProperties.mjs +2 -6
  87. package/node_modules/typebox/build/schema/engine/minimum.d.mts +4 -4
  88. package/node_modules/typebox/build/schema/engine/minimum.mjs +2 -6
  89. package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +4 -4
  90. package/node_modules/typebox/build/schema/engine/multipleOf.mjs +2 -6
  91. package/node_modules/typebox/build/schema/engine/not.d.mts +4 -4
  92. package/node_modules/typebox/build/schema/engine/not.mjs +4 -8
  93. package/node_modules/typebox/build/schema/engine/oneOf.d.mts +4 -4
  94. package/node_modules/typebox/build/schema/engine/oneOf.mjs +6 -11
  95. package/node_modules/typebox/build/schema/engine/pattern.d.mts +4 -4
  96. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -7
  97. package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +4 -4
  98. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +1 -1
  99. package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +4 -4
  100. package/node_modules/typebox/build/schema/engine/prefixItems.mjs +1 -1
  101. package/node_modules/typebox/build/schema/engine/properties.d.mts +4 -4
  102. package/node_modules/typebox/build/schema/engine/properties.mjs +1 -1
  103. package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +4 -4
  104. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +4 -10
  105. package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +4 -4
  106. package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +11 -7
  107. package/node_modules/typebox/build/schema/engine/ref.d.mts +4 -4
  108. package/node_modules/typebox/build/schema/engine/ref.mjs +19 -15
  109. package/node_modules/typebox/build/schema/engine/required.d.mts +4 -4
  110. package/node_modules/typebox/build/schema/engine/required.mjs +2 -6
  111. package/node_modules/typebox/build/schema/engine/schema.d.mts +7 -7
  112. package/node_modules/typebox/build/schema/engine/schema.mjs +137 -133
  113. package/node_modules/typebox/build/schema/engine/type.d.mts +4 -4
  114. package/node_modules/typebox/build/schema/engine/type.mjs +2 -6
  115. package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +4 -4
  116. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +5 -9
  117. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +4 -4
  118. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +5 -9
  119. package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +4 -4
  120. package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +2 -6
  121. package/node_modules/typebox/build/schema/errors.d.mts +2 -2
  122. package/node_modules/typebox/build/schema/errors.mjs +8 -14
  123. package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
  124. package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
  125. package/node_modules/typebox/build/schema/intern/intern.d.mts +11 -0
  126. package/node_modules/typebox/build/schema/intern/intern.mjs +293 -0
  127. package/node_modules/typebox/build/schema/meta/draft_2019_09.d.mts +2 -0
  128. package/node_modules/typebox/build/schema/meta/draft_2019_09.mjs +288 -0
  129. package/node_modules/typebox/build/schema/meta/draft_2020_12.d.mts +2 -0
  130. package/node_modules/typebox/build/schema/meta/draft_2020_12.mjs +300 -0
  131. package/node_modules/typebox/build/schema/meta/draft_3.d.mts +2 -0
  132. package/node_modules/typebox/build/schema/meta/draft_3.mjs +143 -0
  133. package/node_modules/typebox/build/schema/meta/draft_4.d.mts +2 -0
  134. package/node_modules/typebox/build/schema/meta/draft_4.mjs +149 -0
  135. package/node_modules/typebox/build/schema/meta/draft_6.d.mts +2 -0
  136. package/node_modules/typebox/build/schema/meta/draft_6.mjs +155 -0
  137. package/node_modules/typebox/build/schema/meta/draft_7.d.mts +2 -0
  138. package/node_modules/typebox/build/schema/meta/draft_7.mjs +172 -0
  139. package/node_modules/typebox/build/schema/meta/index.d.mts +2 -0
  140. package/node_modules/typebox/build/schema/meta/index.mjs +2 -0
  141. package/node_modules/typebox/build/schema/meta/meta.d.mts +9 -0
  142. package/node_modules/typebox/build/schema/meta/meta.mjs +15 -0
  143. package/node_modules/typebox/build/schema/meta/schema.d.mts +6 -0
  144. package/node_modules/typebox/build/schema/meta/schema.mjs +1 -0
  145. package/node_modules/typebox/build/schema/parse.d.mts +1 -0
  146. package/node_modules/typebox/build/schema/parse.mjs +10 -5
  147. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +8 -3
  148. package/node_modules/typebox/build/schema/resolve/resolve.mjs +268 -139
  149. package/node_modules/typebox/build/schema/schema.d.mts +2 -0
  150. package/node_modules/typebox/build/schema/schema.mjs +2 -0
  151. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
  152. package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
  153. package/node_modules/typebox/package.json +1 -1
  154. package/node_modules/typebox/readme.md +59 -89
  155. package/node_modules/zod/README.md +27 -0
  156. package/node_modules/zod/compile.cjs +77 -0
  157. package/node_modules/zod/compile.d.cts +1 -0
  158. package/node_modules/zod/compile.d.ts +1 -0
  159. package/node_modules/zod/compile.js +52 -0
  160. package/node_modules/zod/index.cjs +2 -2
  161. package/node_modules/zod/index.d.cts +1 -2
  162. package/node_modules/zod/index.d.ts +1 -2
  163. package/node_modules/zod/index.js +5 -2
  164. package/node_modules/zod/package.json +13 -2
  165. package/node_modules/zod/src/compile.ts +56 -0
  166. package/node_modules/zod/src/index.ts +5 -2
  167. package/node_modules/zod/src/v3/ZodError.ts +22 -12
  168. package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
  169. package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
  170. package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
  171. package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
  172. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
  173. package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
  174. package/node_modules/zod/src/v3/types.ts +5 -5
  175. package/node_modules/zod/src/v4/classic/checks.ts +1 -0
  176. package/node_modules/zod/src/v4/classic/compat.ts +26 -18
  177. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  178. package/node_modules/zod/src/v4/classic/errors.ts +59 -44
  179. package/node_modules/zod/src/v4/classic/external.ts +12 -9
  180. package/node_modules/zod/src/v4/classic/from-json-schema.ts +140 -78
  181. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  182. package/node_modules/zod/src/v4/classic/index.ts +2 -2
  183. package/node_modules/zod/src/v4/classic/iso.ts +2 -72
  184. package/node_modules/zod/src/v4/classic/parse.ts +10 -4
  185. package/node_modules/zod/src/v4/classic/schemas.ts +452 -262
  186. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
  187. package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
  188. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +135 -0
  189. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +30 -1
  190. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
  191. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
  192. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
  193. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
  194. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  195. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +720 -0
  196. package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
  197. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
  198. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  199. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  200. package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
  201. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
  202. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +155 -13
  203. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +11 -0
  204. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
  205. package/node_modules/zod/src/v4/classic/tests/error.test.ts +274 -6
  206. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +425 -10
  207. package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
  208. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
  209. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
  210. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  211. package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
  212. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +281 -0
  213. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +47 -0
  214. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
  215. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +183 -0
  216. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
  217. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
  218. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
  219. package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
  220. package/node_modules/zod/src/v4/classic/tests/number.test.ts +46 -9
  221. package/node_modules/zod/src/v4/classic/tests/object.test.ts +245 -12
  222. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +234 -0
  223. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
  224. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
  225. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
  226. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
  227. package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
  228. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +33 -2
  229. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  230. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
  231. package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
  232. package/node_modules/zod/src/v4/classic/tests/string.test.ts +127 -5
  233. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
  234. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +11 -2
  235. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1585 -173
  236. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
  237. package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
  238. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +76 -0
  239. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
  240. package/node_modules/zod/src/v4/core/api.ts +48 -12
  241. package/node_modules/zod/src/v4/core/checks.ts +57 -44
  242. package/node_modules/zod/src/v4/core/compile.ts +2188 -0
  243. package/node_modules/zod/src/v4/core/core.ts +98 -19
  244. package/node_modules/zod/src/v4/core/doc.ts +11 -7
  245. package/node_modules/zod/src/v4/core/errors.ts +115 -24
  246. package/node_modules/zod/src/v4/core/index.ts +3 -0
  247. package/node_modules/zod/src/v4/core/json-schema-generator.ts +6 -1
  248. package/node_modules/zod/src/v4/core/json-schema-processors.ts +257 -93
  249. package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
  250. package/node_modules/zod/src/v4/core/memoizer.ts +284 -0
  251. package/node_modules/zod/src/v4/core/parse.ts +131 -38
  252. package/node_modules/zod/src/v4/core/regexes.ts +30 -13
  253. package/node_modules/zod/src/v4/core/registries.ts +2 -2
  254. package/node_modules/zod/src/v4/core/schemas.ts +759 -461
  255. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
  256. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  257. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  258. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  259. package/node_modules/zod/src/v4/core/tests/compile.test.ts +1639 -0
  260. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
  261. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
  262. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
  263. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  264. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  265. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  266. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
  267. package/node_modules/zod/src/v4/core/to-json-schema.ts +275 -42
  268. package/node_modules/zod/src/v4/core/util.ts +268 -42
  269. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  270. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  271. package/node_modules/zod/src/v4/index.ts +3 -3
  272. package/node_modules/zod/src/v4/locales/ar.ts +3 -0
  273. package/node_modules/zod/src/v4/locales/az.ts +3 -0
  274. package/node_modules/zod/src/v4/locales/be.ts +10 -0
  275. package/node_modules/zod/src/v4/locales/bg.ts +3 -0
  276. package/node_modules/zod/src/v4/locales/bn.ts +121 -0
  277. package/node_modules/zod/src/v4/locales/ca.ts +3 -0
  278. package/node_modules/zod/src/v4/locales/ckb.ts +138 -0
  279. package/node_modules/zod/src/v4/locales/cs.ts +3 -0
  280. package/node_modules/zod/src/v4/locales/da.ts +5 -2
  281. package/node_modules/zod/src/v4/locales/de.ts +3 -0
  282. package/node_modules/zod/src/v4/locales/el.ts +1 -0
  283. package/node_modules/zod/src/v4/locales/en.ts +15 -4
  284. package/node_modules/zod/src/v4/locales/eo.ts +3 -0
  285. package/node_modules/zod/src/v4/locales/es.ts +2 -0
  286. package/node_modules/zod/src/v4/locales/fa.ts +3 -0
  287. package/node_modules/zod/src/v4/locales/fi.ts +3 -0
  288. package/node_modules/zod/src/v4/locales/fr-CA.ts +3 -0
  289. package/node_modules/zod/src/v4/locales/fr.ts +19 -14
  290. package/node_modules/zod/src/v4/locales/gu.ts +121 -0
  291. package/node_modules/zod/src/v4/locales/he.ts +6 -1
  292. package/node_modules/zod/src/v4/locales/hi.ts +124 -0
  293. package/node_modules/zod/src/v4/locales/hr.ts +2 -0
  294. package/node_modules/zod/src/v4/locales/hu.ts +3 -0
  295. package/node_modules/zod/src/v4/locales/hy.ts +9 -0
  296. package/node_modules/zod/src/v4/locales/id.ts +3 -0
  297. package/node_modules/zod/src/v4/locales/index.ts +10 -0
  298. package/node_modules/zod/src/v4/locales/is.ts +3 -0
  299. package/node_modules/zod/src/v4/locales/it.ts +3 -0
  300. package/node_modules/zod/src/v4/locales/ja.ts +3 -0
  301. package/node_modules/zod/src/v4/locales/ka.ts +3 -0
  302. package/node_modules/zod/src/v4/locales/km.ts +3 -0
  303. package/node_modules/zod/src/v4/locales/kn.ts +124 -0
  304. package/node_modules/zod/src/v4/locales/ko.ts +3 -0
  305. package/node_modules/zod/src/v4/locales/lt.ts +2 -0
  306. package/node_modules/zod/src/v4/locales/mk.ts +3 -0
  307. package/node_modules/zod/src/v4/locales/ms.ts +3 -0
  308. package/node_modules/zod/src/v4/locales/ne.ts +126 -0
  309. package/node_modules/zod/src/v4/locales/nl.ts +3 -0
  310. package/node_modules/zod/src/v4/locales/nn.ts +119 -0
  311. package/node_modules/zod/src/v4/locales/no.ts +5 -2
  312. package/node_modules/zod/src/v4/locales/ota.ts +3 -0
  313. package/node_modules/zod/src/v4/locales/pl.ts +3 -0
  314. package/node_modules/zod/src/v4/locales/ps.ts +3 -0
  315. package/node_modules/zod/src/v4/locales/pt-BR.ts +159 -0
  316. package/node_modules/zod/src/v4/locales/pt.ts +99 -58
  317. package/node_modules/zod/src/v4/locales/ro.ts +1 -0
  318. package/node_modules/zod/src/v4/locales/ru.ts +10 -0
  319. package/node_modules/zod/src/v4/locales/sk.ts +121 -0
  320. package/node_modules/zod/src/v4/locales/sl.ts +3 -0
  321. package/node_modules/zod/src/v4/locales/sv.ts +5 -2
  322. package/node_modules/zod/src/v4/locales/ta.ts +3 -0
  323. package/node_modules/zod/src/v4/locales/th.ts +3 -0
  324. package/node_modules/zod/src/v4/locales/tk.ts +111 -0
  325. package/node_modules/zod/src/v4/locales/tr.ts +3 -0
  326. package/node_modules/zod/src/v4/locales/uk.ts +3 -0
  327. package/node_modules/zod/src/v4/locales/ur.ts +3 -0
  328. package/node_modules/zod/src/v4/locales/uz.ts +1 -0
  329. package/node_modules/zod/src/v4/locales/vi.ts +3 -0
  330. package/node_modules/zod/src/v4/locales/yo.ts +3 -0
  331. package/node_modules/zod/src/v4/locales/zh-CN.ts +3 -0
  332. package/node_modules/zod/src/v4/locales/zh-TW.ts +3 -0
  333. package/node_modules/zod/src/v4/mini/checks.ts +1 -0
  334. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  335. package/node_modules/zod/src/v4/mini/external.ts +10 -1
  336. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  337. package/node_modules/zod/src/v4/mini/parse.ts +2 -0
  338. package/node_modules/zod/src/v4/mini/schemas.ts +135 -56
  339. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
  340. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
  341. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
  342. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
  343. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  344. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  345. package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
  346. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
  347. package/node_modules/zod/src/v4/mini/tests/index.test.ts +72 -5
  348. package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
  349. package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
  350. package/node_modules/zod/src/v4/mini/tests/string.test.ts +21 -0
  351. package/node_modules/zod/v3/ZodError.cjs +22 -12
  352. package/node_modules/zod/v3/ZodError.d.cts +1 -1
  353. package/node_modules/zod/v3/ZodError.d.ts +1 -1
  354. package/node_modules/zod/v3/ZodError.js +22 -12
  355. package/node_modules/zod/v3/types.cjs +7 -5
  356. package/node_modules/zod/v3/types.js +7 -5
  357. package/node_modules/zod/v4/classic/checks.cjs +2 -1
  358. package/node_modules/zod/v4/classic/checks.d.cts +1 -1
  359. package/node_modules/zod/v4/classic/checks.d.ts +1 -1
  360. package/node_modules/zod/v4/classic/checks.js +1 -1
  361. package/node_modules/zod/v4/classic/compat.d.cts +9 -11
  362. package/node_modules/zod/v4/classic/compat.d.ts +9 -11
  363. package/node_modules/zod/v4/classic/deep-partial.cjs +39 -0
  364. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  365. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  366. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  367. package/node_modules/zod/v4/classic/errors.cjs +43 -34
  368. package/node_modules/zod/v4/classic/errors.d.cts +3 -4
  369. package/node_modules/zod/v4/classic/errors.d.ts +3 -4
  370. package/node_modules/zod/v4/classic/errors.js +43 -34
  371. package/node_modules/zod/v4/classic/external.cjs +30 -27
  372. package/node_modules/zod/v4/classic/external.d.cts +5 -2
  373. package/node_modules/zod/v4/classic/external.d.ts +5 -2
  374. package/node_modules/zod/v4/classic/external.js +5 -8
  375. package/node_modules/zod/v4/classic/from-json-schema.cjs +136 -75
  376. package/node_modules/zod/v4/classic/from-json-schema.js +136 -75
  377. package/node_modules/zod/v4/classic/in-out.cjs +63 -0
  378. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  379. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  380. package/node_modules/zod/v4/classic/in-out.js +36 -0
  381. package/node_modules/zod/v4/classic/index.cjs +2 -2
  382. package/node_modules/zod/v4/classic/index.d.cts +1 -2
  383. package/node_modules/zod/v4/classic/index.d.ts +1 -2
  384. package/node_modules/zod/v4/classic/index.js +2 -2
  385. package/node_modules/zod/v4/classic/iso.cjs +11 -22
  386. package/node_modules/zod/v4/classic/iso.d.cts +2 -17
  387. package/node_modules/zod/v4/classic/iso.d.ts +2 -17
  388. package/node_modules/zod/v4/classic/iso.js +2 -17
  389. package/node_modules/zod/v4/classic/parse.cjs +4 -1
  390. package/node_modules/zod/v4/classic/parse.d.cts +17 -4
  391. package/node_modules/zod/v4/classic/parse.d.ts +17 -4
  392. package/node_modules/zod/v4/classic/parse.js +1 -0
  393. package/node_modules/zod/v4/classic/schemas.cjs +498 -398
  394. package/node_modules/zod/v4/classic/schemas.d.cts +53 -18
  395. package/node_modules/zod/v4/classic/schemas.d.ts +53 -18
  396. package/node_modules/zod/v4/classic/schemas.js +492 -396
  397. package/node_modules/zod/v4/core/api.cjs +23 -4
  398. package/node_modules/zod/v4/core/api.d.cts +13 -9
  399. package/node_modules/zod/v4/core/api.d.ts +13 -9
  400. package/node_modules/zod/v4/core/api.js +21 -4
  401. package/node_modules/zod/v4/core/checks.cjs +37 -31
  402. package/node_modules/zod/v4/core/checks.d.cts +13 -13
  403. package/node_modules/zod/v4/core/checks.d.ts +13 -13
  404. package/node_modules/zod/v4/core/checks.js +37 -31
  405. package/node_modules/zod/v4/core/compile.cjs +1813 -0
  406. package/node_modules/zod/v4/core/compile.d.cts +51 -0
  407. package/node_modules/zod/v4/core/compile.d.ts +51 -0
  408. package/node_modules/zod/v4/core/compile.js +1783 -0
  409. package/node_modules/zod/v4/core/core.cjs +81 -18
  410. package/node_modules/zod/v4/core/core.d.cts +16 -4
  411. package/node_modules/zod/v4/core/core.d.ts +16 -4
  412. package/node_modules/zod/v4/core/core.js +82 -19
  413. package/node_modules/zod/v4/core/doc.cjs +5 -7
  414. package/node_modules/zod/v4/core/doc.d.cts +3 -1
  415. package/node_modules/zod/v4/core/doc.d.ts +3 -1
  416. package/node_modules/zod/v4/core/doc.js +5 -7
  417. package/node_modules/zod/v4/core/errors.cjs +110 -25
  418. package/node_modules/zod/v4/core/errors.d.cts +4 -0
  419. package/node_modules/zod/v4/core/errors.d.ts +4 -0
  420. package/node_modules/zod/v4/core/errors.js +110 -25
  421. package/node_modules/zod/v4/core/index.cjs +5 -1
  422. package/node_modules/zod/v4/core/index.d.cts +3 -0
  423. package/node_modules/zod/v4/core/index.d.ts +3 -0
  424. package/node_modules/zod/v4/core/index.js +3 -0
  425. package/node_modules/zod/v4/core/json-schema-generator.cjs +4 -0
  426. package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
  427. package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
  428. package/node_modules/zod/v4/core/json-schema-generator.js +4 -0
  429. package/node_modules/zod/v4/core/json-schema-processors.cjs +264 -95
  430. package/node_modules/zod/v4/core/json-schema-processors.js +243 -97
  431. package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
  432. package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
  433. package/node_modules/zod/v4/core/memoizer.cjs +272 -0
  434. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  435. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  436. package/node_modules/zod/v4/core/memoizer.js +265 -0
  437. package/node_modules/zod/v4/core/parse.cjs +96 -34
  438. package/node_modules/zod/v4/core/parse.d.cts +14 -11
  439. package/node_modules/zod/v4/core/parse.d.ts +14 -11
  440. package/node_modules/zod/v4/core/parse.js +94 -33
  441. package/node_modules/zod/v4/core/regexes.cjs +27 -15
  442. package/node_modules/zod/v4/core/regexes.d.cts +2 -0
  443. package/node_modules/zod/v4/core/regexes.d.ts +2 -0
  444. package/node_modules/zod/v4/core/regexes.js +24 -13
  445. package/node_modules/zod/v4/core/registries.js +2 -2
  446. package/node_modules/zod/v4/core/schemas.cjs +537 -326
  447. package/node_modules/zod/v4/core/schemas.d.cts +100 -31
  448. package/node_modules/zod/v4/core/schemas.d.ts +100 -31
  449. package/node_modules/zod/v4/core/schemas.js +526 -325
  450. package/node_modules/zod/v4/core/to-json-schema.cjs +242 -39
  451. package/node_modules/zod/v4/core/to-json-schema.d.cts +42 -3
  452. package/node_modules/zod/v4/core/to-json-schema.d.ts +42 -3
  453. package/node_modules/zod/v4/core/to-json-schema.js +241 -39
  454. package/node_modules/zod/v4/core/util.cjs +212 -31
  455. package/node_modules/zod/v4/core/util.d.cts +58 -1
  456. package/node_modules/zod/v4/core/util.d.ts +58 -1
  457. package/node_modules/zod/v4/core/util.js +202 -30
  458. package/node_modules/zod/v4/core/versions.cjs +2 -2
  459. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  460. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  461. package/node_modules/zod/v4/core/versions.js +2 -2
  462. package/node_modules/zod/v4/core/visit.cjs +195 -0
  463. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  464. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  465. package/node_modules/zod/v4/core/visit.js +169 -0
  466. package/node_modules/zod/v4/index.cjs +15 -5
  467. package/node_modules/zod/v4/index.d.cts +2 -2
  468. package/node_modules/zod/v4/index.d.ts +2 -2
  469. package/node_modules/zod/v4/index.js +3 -2
  470. package/node_modules/zod/v4/locales/ar.cjs +3 -0
  471. package/node_modules/zod/v4/locales/ar.js +3 -0
  472. package/node_modules/zod/v4/locales/az.cjs +3 -0
  473. package/node_modules/zod/v4/locales/az.js +3 -0
  474. package/node_modules/zod/v4/locales/be.cjs +10 -0
  475. package/node_modules/zod/v4/locales/be.js +10 -0
  476. package/node_modules/zod/v4/locales/bg.cjs +3 -0
  477. package/node_modules/zod/v4/locales/bg.js +3 -0
  478. package/node_modules/zod/v4/locales/bn.cjs +138 -0
  479. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  480. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  481. package/node_modules/zod/v4/locales/bn.js +111 -0
  482. package/node_modules/zod/v4/locales/ca.cjs +3 -0
  483. package/node_modules/zod/v4/locales/ca.js +3 -0
  484. package/node_modules/zod/v4/locales/ckb.cjs +158 -0
  485. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  486. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  487. package/node_modules/zod/v4/locales/ckb.js +131 -0
  488. package/node_modules/zod/v4/locales/cs.cjs +3 -0
  489. package/node_modules/zod/v4/locales/cs.js +3 -0
  490. package/node_modules/zod/v4/locales/da.cjs +5 -2
  491. package/node_modules/zod/v4/locales/da.js +5 -2
  492. package/node_modules/zod/v4/locales/de.cjs +3 -0
  493. package/node_modules/zod/v4/locales/de.js +3 -0
  494. package/node_modules/zod/v4/locales/el.cjs +1 -0
  495. package/node_modules/zod/v4/locales/el.js +1 -0
  496. package/node_modules/zod/v4/locales/en.cjs +14 -4
  497. package/node_modules/zod/v4/locales/en.js +14 -4
  498. package/node_modules/zod/v4/locales/eo.cjs +3 -0
  499. package/node_modules/zod/v4/locales/eo.js +3 -0
  500. package/node_modules/zod/v4/locales/es.cjs +2 -0
  501. package/node_modules/zod/v4/locales/es.js +2 -0
  502. package/node_modules/zod/v4/locales/fa.cjs +3 -0
  503. package/node_modules/zod/v4/locales/fa.js +3 -0
  504. package/node_modules/zod/v4/locales/fi.cjs +3 -0
  505. package/node_modules/zod/v4/locales/fi.js +3 -0
  506. package/node_modules/zod/v4/locales/fr-CA.cjs +3 -0
  507. package/node_modules/zod/v4/locales/fr-CA.js +3 -0
  508. package/node_modules/zod/v4/locales/fr.cjs +16 -14
  509. package/node_modules/zod/v4/locales/fr.js +16 -14
  510. package/node_modules/zod/v4/locales/gu.cjs +138 -0
  511. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  512. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  513. package/node_modules/zod/v4/locales/gu.js +111 -0
  514. package/node_modules/zod/v4/locales/he.cjs +5 -0
  515. package/node_modules/zod/v4/locales/he.js +5 -0
  516. package/node_modules/zod/v4/locales/hi.cjs +136 -0
  517. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  518. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  519. package/node_modules/zod/v4/locales/hi.js +109 -0
  520. package/node_modules/zod/v4/locales/hr.cjs +2 -0
  521. package/node_modules/zod/v4/locales/hr.js +2 -0
  522. package/node_modules/zod/v4/locales/hu.cjs +3 -0
  523. package/node_modules/zod/v4/locales/hu.js +3 -0
  524. package/node_modules/zod/v4/locales/hy.cjs +9 -0
  525. package/node_modules/zod/v4/locales/hy.js +9 -0
  526. package/node_modules/zod/v4/locales/id.cjs +3 -0
  527. package/node_modules/zod/v4/locales/id.js +3 -0
  528. package/node_modules/zod/v4/locales/index.cjs +22 -2
  529. package/node_modules/zod/v4/locales/index.d.cts +10 -0
  530. package/node_modules/zod/v4/locales/index.d.ts +10 -0
  531. package/node_modules/zod/v4/locales/index.js +10 -0
  532. package/node_modules/zod/v4/locales/is.cjs +3 -0
  533. package/node_modules/zod/v4/locales/is.js +3 -0
  534. package/node_modules/zod/v4/locales/it.cjs +3 -0
  535. package/node_modules/zod/v4/locales/it.js +3 -0
  536. package/node_modules/zod/v4/locales/ja.cjs +3 -0
  537. package/node_modules/zod/v4/locales/ja.js +3 -0
  538. package/node_modules/zod/v4/locales/ka.cjs +3 -0
  539. package/node_modules/zod/v4/locales/ka.js +3 -0
  540. package/node_modules/zod/v4/locales/km.cjs +3 -0
  541. package/node_modules/zod/v4/locales/km.js +3 -0
  542. package/node_modules/zod/v4/locales/kn.cjs +141 -0
  543. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  544. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  545. package/node_modules/zod/v4/locales/kn.js +114 -0
  546. package/node_modules/zod/v4/locales/ko.cjs +3 -0
  547. package/node_modules/zod/v4/locales/ko.js +3 -0
  548. package/node_modules/zod/v4/locales/lt.cjs +2 -0
  549. package/node_modules/zod/v4/locales/lt.js +2 -0
  550. package/node_modules/zod/v4/locales/mk.cjs +3 -0
  551. package/node_modules/zod/v4/locales/mk.js +3 -0
  552. package/node_modules/zod/v4/locales/ms.cjs +3 -0
  553. package/node_modules/zod/v4/locales/ms.js +3 -0
  554. package/node_modules/zod/v4/locales/ne.cjs +136 -0
  555. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  556. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  557. package/node_modules/zod/v4/locales/ne.js +109 -0
  558. package/node_modules/zod/v4/locales/nl.cjs +3 -0
  559. package/node_modules/zod/v4/locales/nl.js +3 -0
  560. package/node_modules/zod/v4/locales/nn.cjs +138 -0
  561. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  562. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  563. package/node_modules/zod/v4/locales/nn.js +111 -0
  564. package/node_modules/zod/v4/locales/no.cjs +5 -2
  565. package/node_modules/zod/v4/locales/no.js +5 -2
  566. package/node_modules/zod/v4/locales/ota.cjs +3 -0
  567. package/node_modules/zod/v4/locales/ota.js +3 -0
  568. package/node_modules/zod/v4/locales/pl.cjs +3 -0
  569. package/node_modules/zod/v4/locales/pl.js +3 -0
  570. package/node_modules/zod/v4/locales/ps.cjs +3 -0
  571. package/node_modules/zod/v4/locales/ps.js +3 -0
  572. package/node_modules/zod/v4/locales/pt-BR.cjs +168 -0
  573. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  574. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  575. package/node_modules/zod/v4/locales/pt-BR.js +141 -0
  576. package/node_modules/zod/v4/locales/pt.cjs +87 -55
  577. package/node_modules/zod/v4/locales/pt.js +87 -55
  578. package/node_modules/zod/v4/locales/ro.cjs +1 -0
  579. package/node_modules/zod/v4/locales/ro.js +1 -0
  580. package/node_modules/zod/v4/locales/ru.cjs +10 -0
  581. package/node_modules/zod/v4/locales/ru.js +10 -0
  582. package/node_modules/zod/v4/locales/sk.cjs +141 -0
  583. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  584. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  585. package/node_modules/zod/v4/locales/sk.js +114 -0
  586. package/node_modules/zod/v4/locales/sl.cjs +3 -0
  587. package/node_modules/zod/v4/locales/sl.js +3 -0
  588. package/node_modules/zod/v4/locales/sv.cjs +5 -2
  589. package/node_modules/zod/v4/locales/sv.js +5 -2
  590. package/node_modules/zod/v4/locales/ta.cjs +3 -0
  591. package/node_modules/zod/v4/locales/ta.js +3 -0
  592. package/node_modules/zod/v4/locales/th.cjs +3 -0
  593. package/node_modules/zod/v4/locales/th.js +3 -0
  594. package/node_modules/zod/v4/locales/tk.cjs +132 -0
  595. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  596. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  597. package/node_modules/zod/v4/locales/tk.js +105 -0
  598. package/node_modules/zod/v4/locales/tr.cjs +3 -0
  599. package/node_modules/zod/v4/locales/tr.js +3 -0
  600. package/node_modules/zod/v4/locales/uk.cjs +3 -0
  601. package/node_modules/zod/v4/locales/uk.js +3 -0
  602. package/node_modules/zod/v4/locales/ur.cjs +3 -0
  603. package/node_modules/zod/v4/locales/ur.js +3 -0
  604. package/node_modules/zod/v4/locales/uz.cjs +1 -0
  605. package/node_modules/zod/v4/locales/uz.js +1 -0
  606. package/node_modules/zod/v4/locales/vi.cjs +3 -0
  607. package/node_modules/zod/v4/locales/vi.js +3 -0
  608. package/node_modules/zod/v4/locales/yo.cjs +3 -0
  609. package/node_modules/zod/v4/locales/yo.js +3 -0
  610. package/node_modules/zod/v4/locales/zh-CN.cjs +3 -0
  611. package/node_modules/zod/v4/locales/zh-CN.js +3 -0
  612. package/node_modules/zod/v4/locales/zh-TW.cjs +3 -0
  613. package/node_modules/zod/v4/locales/zh-TW.js +3 -0
  614. package/node_modules/zod/v4/mini/checks.cjs +2 -1
  615. package/node_modules/zod/v4/mini/checks.d.cts +1 -1
  616. package/node_modules/zod/v4/mini/checks.d.ts +1 -1
  617. package/node_modules/zod/v4/mini/checks.js +1 -1
  618. package/node_modules/zod/v4/mini/deep-partial.cjs +39 -0
  619. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  620. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  621. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  622. package/node_modules/zod/v4/mini/external.cjs +12 -1
  623. package/node_modules/zod/v4/mini/external.d.cts +5 -2
  624. package/node_modules/zod/v4/mini/external.d.ts +5 -2
  625. package/node_modules/zod/v4/mini/external.js +3 -1
  626. package/node_modules/zod/v4/mini/in-out.cjs +63 -0
  627. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  628. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  629. package/node_modules/zod/v4/mini/in-out.js +36 -0
  630. package/node_modules/zod/v4/mini/parse.cjs +3 -1
  631. package/node_modules/zod/v4/mini/parse.d.cts +1 -1
  632. package/node_modules/zod/v4/mini/parse.d.ts +1 -1
  633. package/node_modules/zod/v4/mini/parse.js +1 -1
  634. package/node_modules/zod/v4/mini/schemas.cjs +75 -47
  635. package/node_modules/zod/v4/mini/schemas.d.cts +43 -13
  636. package/node_modules/zod/v4/mini/schemas.d.ts +43 -13
  637. package/node_modules/zod/v4/mini/schemas.js +71 -45
  638. package/openclaw.plugin.json +70 -1
  639. package/package.json +9 -6
  640. package/node_modules/zod/src/v4/core/config.ts +0 -15
  641. /package/dist/{realtime-transcription.runtime-CbJAs5t_.js → .setup/realtime-transcription.runtime-CbJAs5t_.mjs} +0 -0
  642. /package/dist/{realtime-voice.runtime-vtdCOWg-.js → .setup/realtime-voice.runtime-vtdCOWg-.mjs} +0 -0
  643. /package/dist/{twilio-region-4fkgz3UG.js → .setup/twilio-region-4fkgz3UG.mjs} +0 -0
  644. /package/dist/{webhook-replay-CCQSoBNF.js → .setup/webhook-replay-CCQSoBNF.mjs} +0 -0
@@ -1,9 +1,9 @@
1
- import { d as REALTIME_VOICE_END_CALL_TOOL_NAME, s as resolveVoiceCallPublicPathPrefix } from "./config-DQwvsxeV.js";
2
- import { c as canonicalizeVoiceCallMediaBase64, o as WebSocket, s as WebSocketServer } from "./runtime-entry-Ln4SWaYK.js";
1
+ import { d as REALTIME_VOICE_END_CALL_TOOL_NAME, s as resolveVoiceCallPublicPathPrefix } from "./config-72FnMWHb.mjs";
2
+ import { c as canonicalizeVoiceCallMediaBase64, o as WebSocket, s as WebSocketServer } from "./runtime-entry-YWSSnAsH.mjs";
3
3
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
4
4
  import { asNullableRecord, asOptionalObjectRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
6
- import { REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME, REALTIME_VOICE_AUDIO_FORMAT_G711_ULAW_8KHZ, buildRealtimeVoiceAgentConsultWorkingResponse, buildRealtimeVoiceAgentErrorProviderResult, calculateMulawRms, createRealtimeVoiceSessionHarness, createSpeechThresholdGate, readRealtimeVoiceConsultQuestion, readSpeakableRealtimeVoiceToolResult } from "openclaw/plugin-sdk/realtime-voice";
6
+ import { REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME, REALTIME_VOICE_AUDIO_FORMAT_G711_ULAW_8KHZ, buildRealtimeVoiceAgentConsultWorkingResponse, buildRealtimeVoiceAgentErrorProviderResult, calculateMulawRms, createRealtimeVoiceSessionHarness, createSpeechThresholdGate, readRealtimeVoiceConsultQuestion, readSpeakableRealtimeVoiceToolResult, resolveRealtimeVoiceBargeIn, resolveRealtimeVoiceSessionPolicy } from "openclaw/plugin-sdk/realtime-voice";
7
7
  import { normalizeWebhookPath } from "openclaw/plugin-sdk/webhook-ingress";
8
8
  import { isFutureDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
9
9
  import { randomUUID } from "node:crypto";
@@ -525,26 +525,27 @@ async function waitForNativeConsult(state) {
525
525
  result
526
526
  })), state.cancellation.then(() => ({ kind: "cancelled" }))]);
527
527
  }
528
- function appendRecentTalkEventMetadata(call, event) {
529
- if (!call) return;
530
- const metadata = call.metadata ?? {};
531
- const previous = Array.isArray(metadata.recentTalkEvents) ? metadata.recentTalkEvents : [];
532
- metadata.lastTalkEventAt = event.timestamp;
533
- metadata.lastTalkEventType = event.type;
534
- metadata.recentTalkEvents = [...previous, {
535
- id: event.id,
536
- brain: event.brain,
537
- mode: event.mode,
538
- provider: event.provider,
539
- seq: event.seq,
540
- sessionId: event.sessionId,
541
- timestamp: event.timestamp,
542
- transport: event.transport,
543
- type: event.type,
544
- ...event.turnId ? { turnId: event.turnId } : {},
545
- ...event.final !== void 0 ? { final: event.final } : {}
546
- }].slice(-12);
547
- call.metadata = metadata;
528
+ function appendRecentTalkEventMetadata(metadata, event) {
529
+ const previous = metadata ?? {};
530
+ const recent = Array.isArray(previous.recentTalkEvents) ? previous.recentTalkEvents : [];
531
+ return {
532
+ ...previous,
533
+ lastTalkEventAt: event.timestamp,
534
+ lastTalkEventType: event.type,
535
+ recentTalkEvents: [...recent, {
536
+ id: event.id,
537
+ brain: event.brain,
538
+ mode: event.mode,
539
+ provider: event.provider,
540
+ seq: event.seq,
541
+ sessionId: event.sessionId,
542
+ timestamp: event.timestamp,
543
+ transport: event.transport,
544
+ type: event.type,
545
+ ...event.turnId ? { turnId: event.turnId } : {},
546
+ ...event.final !== void 0 ? { final: event.final } : {}
547
+ }].slice(-12)
548
+ };
548
549
  }
549
550
  function rejectRealtimeUpgrade(socket, status) {
550
551
  const reason = status === 401 ? "Unauthorized" : "Service Unavailable";
@@ -574,6 +575,7 @@ var RealtimeCallHandler = class {
574
575
  this.consultSessionsByCallId = /* @__PURE__ */ new Map();
575
576
  this.nativeConsultsInFlightByCallId = /* @__PURE__ */ new Map();
576
577
  this.terminationAttempts = /* @__PURE__ */ new Set();
578
+ this.admissions = /* @__PURE__ */ new Set();
577
579
  this.closePromise = null;
578
580
  this.closing = false;
579
581
  this.publicOrigin = null;
@@ -641,7 +643,19 @@ var RealtimeCallHandler = class {
641
643
  let activeStreamSid = "unknown";
642
644
  let lastMediaTimestamp;
643
645
  let lastMediaGapWarnAt = 0;
644
- ws.on("message", (data) => {
646
+ let admitting = false;
647
+ const pendingFrames = [];
648
+ let pendingBytes = 0;
649
+ const handleMessage = (data) => {
650
+ if (admitting) {
651
+ pendingBytes += Math.max(1, data.byteLength);
652
+ if (pendingBytes > MAX_REALTIME_WS_BUFFERED_BYTES) {
653
+ ws.terminate();
654
+ return;
655
+ }
656
+ pendingFrames.push(data);
657
+ return;
658
+ }
645
659
  try {
646
660
  const frame = adapter.parseInbound(data.toString());
647
661
  if (frame.kind === "ignored") return;
@@ -650,10 +664,27 @@ var RealtimeCallHandler = class {
650
664
  initialized = true;
651
665
  activeCallSid = frame.providerCallId;
652
666
  activeStreamSid = frame.streamId;
653
- const nextBinding = this.handleCall(frame.streamId, frame.providerCallId, ws, callerMeta, adapter);
654
- if (!nextBinding) return;
655
- telephonyBinding = nextBinding;
656
- this.streamDisconnectLifecycle.connect(activeCallSid, activeStreamSid);
667
+ admitting = true;
668
+ ws.pause();
669
+ const admission = this.handleCall(frame.streamId, frame.providerCallId, ws, callerMeta, adapter).then(async (nextBinding) => {
670
+ telephonyBinding = nextBinding;
671
+ if (!nextBinding) return;
672
+ if (this.closing || ws.readyState !== WebSocket.OPEN) {
673
+ await nextBinding.close(this.serverClosingSockets.has(ws) ? "shutdown" : "disconnect");
674
+ return;
675
+ }
676
+ this.streamDisconnectLifecycle.connect(activeCallSid, activeStreamSid);
677
+ }).catch((error) => {
678
+ console.error("[voice-call] realtime admission failed:", error);
679
+ ws.close(1011, "Failed to persist call");
680
+ }).finally(() => {
681
+ admitting = false;
682
+ if (ws.readyState === WebSocket.OPEN && !this.closing) for (const pending of pendingFrames) handleMessage(pending);
683
+ ws.resume();
684
+ pendingFrames.length = 0;
685
+ pendingBytes = 0;
686
+ });
687
+ this.trackShutdownWork(admission, this.admissions);
657
688
  return;
658
689
  }
659
690
  if (!telephonyBinding) return;
@@ -688,7 +719,8 @@ var RealtimeCallHandler = class {
688
719
  } catch (error) {
689
720
  console.error("[voice-call] realtime WS parse failed:", error);
690
721
  }
691
- });
722
+ };
723
+ ws.on("message", handleMessage);
692
724
  ws.on("close", () => {
693
725
  this.activeSockets.delete(ws);
694
726
  const reason = this.serverClosingSockets.has(ws) ? "shutdown" : "disconnect";
@@ -709,7 +741,7 @@ var RealtimeCallHandler = class {
709
741
  this.closing = true;
710
742
  this.pendingStreamTokens.clear();
711
743
  const sockets = [...this.activeSockets];
712
- this.closePromise = Promise.all([shutdownBarrier, ...sockets.map((ws) => new Promise((resolve) => {
744
+ this.closePromise = Promise.allSettled([shutdownBarrier, ...sockets.map((ws) => new Promise((resolve) => {
713
745
  if (ws.readyState === WebSocket.CLOSED) {
714
746
  resolve();
715
747
  return;
@@ -717,15 +749,29 @@ var RealtimeCallHandler = class {
717
749
  this.serverClosingSockets.add(ws);
718
750
  ws.once("close", () => resolve());
719
751
  ws.terminate();
720
- }))]).then(async () => {
721
- await Promise.all(this.terminationAttempts);
752
+ }))]).then(async (results) => {
753
+ results.push(...await Promise.allSettled(this.admissions));
754
+ results.push(...await Promise.allSettled(this.terminationAttempts));
722
755
  this.pendingStreamTokens.clear();
756
+ const failure = results.find((result) => result.status === "rejected");
757
+ if (failure?.status === "rejected") throw failure.reason;
758
+ if (this.shutdownFailure) throw this.shutdownFailure.error;
723
759
  }).finally(() => {
724
760
  this.closing = false;
725
761
  this.closePromise = null;
762
+ this.shutdownFailure = void 0;
726
763
  });
727
764
  return this.closePromise;
728
765
  }
766
+ trackShutdownWork(work, pending) {
767
+ pending.add(work);
768
+ work.then(() => {
769
+ pending.delete(work);
770
+ }, (error) => {
771
+ pending.delete(work);
772
+ if (this.closing) this.shutdownFailure ??= { error };
773
+ });
774
+ }
729
775
  registerToolHandler(name, fn) {
730
776
  this.toolHandlers.set(name, fn);
731
777
  }
@@ -793,16 +839,14 @@ var RealtimeCallHandler = class {
793
839
  callId: entry.callId
794
840
  };
795
841
  }
796
- handleCall(streamSid, callSid, ws, callerMeta, adapter) {
797
- const preparedCall = this.prepareCallInManager(callSid, callerMeta);
842
+ async handleCall(streamSid, callSid, ws, callerMeta, adapter) {
843
+ const preparedCall = await this.prepareCallInManager(callSid, callerMeta);
798
844
  if (!preparedCall) {
799
845
  ws.close(1008, "Caller rejected by policy");
800
846
  return null;
801
847
  }
802
848
  const { callRecord } = preparedCall;
803
849
  const callId = callRecord.callId;
804
- const hadPredecessorOnAdmission = this.activeBridgesByCallId.has(callId);
805
- const previousTelephonyBinding = this.activeTelephonyBindingsByCallId.get(callId);
806
850
  let callEndPromise;
807
851
  const emitCallEnd = (cause) => {
808
852
  if (callEndPromise) return callEndPromise;
@@ -815,29 +859,70 @@ var RealtimeCallHandler = class {
815
859
  console.log(`[voice-call] Realtime call ended callId=${callId} providerCallId=${callSid} reason=${cause}`);
816
860
  });
817
861
  callEndPromise = attempt;
818
- this.terminationAttempts.add(attempt);
819
- const release = () => this.terminationAttempts.delete(attempt);
820
- attempt.then(release, release);
862
+ this.trackShutdownWork(attempt, this.terminationAttempts);
821
863
  return attempt;
822
864
  };
865
+ const admissionAbandoned = () => this.closing || ws.readyState !== WebSocket.OPEN;
866
+ const abandonAdmission = async () => {
867
+ if (!this.activeBridgesByCallId.has(callId)) {
868
+ if (this.closing || this.serverClosingSockets.has(ws)) await emitCallEnd("shutdown");
869
+ else {
870
+ this.streamDisconnectLifecycle.connect(callSid, streamSid);
871
+ this.streamDisconnectLifecycle.disconnect(callSid, streamSid);
872
+ }
873
+ }
874
+ };
875
+ if (admissionAbandoned()) {
876
+ await abandonAdmission();
877
+ return null;
878
+ }
823
879
  let registration;
880
+ let sessionPolicy;
824
881
  try {
825
882
  registration = this.resolveCallRegistration(callRecord);
883
+ sessionPolicy = resolveRealtimeVoiceSessionPolicy({
884
+ isAgentProxy: false,
885
+ capabilities: registration.capabilities,
886
+ configuredToolPolicy: this.config.toolPolicy,
887
+ configuredConsultPolicy: this.config.consultPolicy === "always" ? "always" : "auto",
888
+ requireWakeName: void 0,
889
+ configuredWakeNames: void 0,
890
+ cfg: this.coreConfig ?? {},
891
+ agentId: registration.agentId
892
+ });
826
893
  } catch (error) {
827
894
  console.error(`[voice-call] Failed to resolve realtime call registration callId=${callId} providerCallId=${callSid}: ${formatErrorMessage(error)}`);
828
- if (!hadPredecessorOnAdmission) emitCallEnd("error");
895
+ if (!this.activeBridgesByCallId.has(callId)) emitCallEnd("error");
829
896
  ws.close(1011, "Check realtime configuration for routed agent");
830
897
  return null;
831
898
  }
832
- const { baseFields, initialGreeting } = preparedCall;
833
- if (callRecord.metadata) delete callRecord.metadata.initialMessage;
834
- this.manager.processEvent({
899
+ const { baseFields } = preparedCall;
900
+ let initialGreeting;
901
+ await this.manager.updateCallMetadata(callRecord, (metadata) => {
902
+ if (metadata) {
903
+ initialGreeting = typeof metadata.initialMessage === "string" ? metadata.initialMessage : void 0;
904
+ delete metadata.initialMessage;
905
+ }
906
+ return metadata;
907
+ });
908
+ await this.manager.processEvent({
835
909
  id: `realtime-answered-${callSid}`,
836
910
  callId,
837
911
  type: "call.answered",
838
912
  ...baseFields
839
913
  });
840
- const { agentId, instructions, provider: realtimeProvider, providerConfig } = registration;
914
+ if (admissionAbandoned()) {
915
+ await abandonAdmission();
916
+ return null;
917
+ }
918
+ if (this.manager.getCallByProviderCallId(callSid) !== callRecord) {
919
+ ws.close(1008, "Call is no longer active");
920
+ return null;
921
+ }
922
+ const previousTelephonyBinding = this.activeTelephonyBindingsByCallId.get(callId);
923
+ const { agentId, instructions, provider: realtimeProvider, providerConfig, capabilities } = registration;
924
+ const { handlesAgentConsult, toolPolicy } = sessionPolicy;
925
+ if (handlesAgentConsult) console.warn("[voice-call] This realtime model uses native agent delegation; the end-call and custom realtime function tools are unavailable.");
841
926
  const initialGreetingInstructions = buildGreetingInstructions(instructions, initialGreeting);
842
927
  const harness = createRealtimeVoiceSessionHarness({
843
928
  talk: {
@@ -869,9 +954,13 @@ var RealtimeCallHandler = class {
869
954
  reason
870
955
  })
871
956
  },
872
- onTalkEvent: (event) => appendRecentTalkEventMetadata(callRecord, event)
957
+ onTalkEvent: (event) => {
958
+ this.manager.updateCallMetadata(callRecord, (metadata) => appendRecentTalkEventMetadata(metadata, event)).catch((error) => {
959
+ console.warn("[voice-call] Failed to update realtime call metadata:", error);
960
+ });
961
+ }
873
962
  });
874
- let providerHandlesInputAudioBargeIn = realtimeProvider.capabilities?.handlesInputAudioBargeIn === true;
963
+ const providerHandlesInputAudioBargeIn = (capabilities ?? realtimeProvider.capabilities)?.handlesInputAudioBargeIn === true;
875
964
  const cancelOutputAudioForBargeIn = (source, interruptProvider, clearedAudioBytes = 0) => {
876
965
  const outputAudioActive = harness.talk.outputAudioActive;
877
966
  const pendingTelephonyAudio = audioPacer.hasPendingAudio();
@@ -941,19 +1030,58 @@ var RealtimeCallHandler = class {
941
1030
  let sessionClosed = false;
942
1031
  const userTranscriptAdoption = this.beginUserTranscriptOwnerAdoption(callId);
943
1032
  const userTranscriptOwner = userTranscriptAdoption.owner;
1033
+ let transcriptPersistence = Promise.resolve();
1034
+ let transcriptFailure;
1035
+ const reportTranscriptFailure = (error) => {
1036
+ transcriptFailure ??= { error };
1037
+ console.error("[voice-call] Failed to persist realtime transcript:", error);
1038
+ };
1039
+ const drainProviderClose = async (closeProvider) => {
1040
+ const failures = [];
1041
+ try {
1042
+ await closeProvider();
1043
+ } catch (error) {
1044
+ failures.push(error);
1045
+ }
1046
+ await transcriptPersistence.catch((error) => {
1047
+ transcriptFailure ??= { error };
1048
+ });
1049
+ if (transcriptFailure) failures.push(transcriptFailure.error);
1050
+ if (failures.length === 1) throw failures[0];
1051
+ if (failures.length > 1) throw new AggregateError(failures, "Realtime provider and transcript cleanup failed");
1052
+ };
1053
+ let continuityGeneration = 0;
944
1054
  const bridgeParams = {
945
1055
  provider: realtimeProvider,
946
1056
  cfg: this.coreConfig,
947
1057
  agentId,
948
1058
  providerConfig,
1059
+ capabilities,
949
1060
  audioFormat: REALTIME_VOICE_AUDIO_FORMAT_G711_ULAW_8KHZ,
950
1061
  interruptResponseOnInputAudio,
951
- instructions,
952
- tools: this.config.tools,
1062
+ instructions: handlesAgentConsult ? `${instructions}\n\nUse native agent delegation for OpenClaw work. End-call and custom realtime function tools are unavailable in this session; the caller can hang up to end the call.` : instructions,
1063
+ tools: handlesAgentConsult ? [] : this.config.tools,
1064
+ ...handlesAgentConsult ? { runAgentConsult: async (request) => {
1065
+ const owner = nativeConsultOwner.current;
1066
+ const generation = continuityGeneration;
1067
+ request.signal?.throwIfAborted();
1068
+ await transcriptPersistence;
1069
+ if (!owner || sessionClosed || generation !== continuityGeneration || !this.isActiveBridgeOwner(callId, owner)) throw new Error("Realtime call delegation owner is no longer active");
1070
+ if (toolPolicy === "none") throw new Error("Agent consultation is disabled for this call");
1071
+ const result = await this.executeToolCall(owner, callId, randomUUID(), REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME, { question: request.prompt }, harness.ensureTurn(), harness, userTranscriptOwner, { signal: request.signal });
1072
+ request.signal?.throwIfAborted();
1073
+ if (sessionClosed || generation !== continuityGeneration || !this.isActiveBridgeOwner(callId, owner)) throw new Error("Realtime call delegation owner is no longer active");
1074
+ const text = readSpeakableRealtimeVoiceToolResult(result, {
1075
+ keys: ["text", "output"],
1076
+ maxChars: FORCED_CONSULT_RESULT_MAX_CHARS
1077
+ });
1078
+ if (!text) throw new Error("Agent consultation returned no spoken answer");
1079
+ return { text };
1080
+ } } : {},
953
1081
  initialGreetingInstructions,
954
1082
  triggerGreetingOnReady: Boolean(initialGreetingInstructions),
955
1083
  audioSink: {
956
- isOpen: () => ws.readyState === WebSocket.OPEN,
1084
+ isOpen: () => !sessionClosed && ws.readyState === WebSocket.OPEN,
957
1085
  sendAudio: (muLaw, metadata) => {
958
1086
  harness.recordOutputAudio(muLaw);
959
1087
  audioPacer.sendAudio(muLaw, metadata);
@@ -977,7 +1105,7 @@ var RealtimeCallHandler = class {
977
1105
  },
978
1106
  onTranscript: (role, text, isFinal) => {
979
1107
  const owner = nativeConsultOwner.current;
980
- if (provisionalCloseReason || !this.getUserTranscriptState(callId, userTranscriptOwner) || owner && !this.isActiveBridgeOwner(callId, owner)) return;
1108
+ if (provisionalCloseReason || sessionClosed && !isFinal || !this.getUserTranscriptState(callId, userTranscriptOwner) || owner && !this.isActiveBridgeOwner(callId, owner)) return;
981
1109
  const turnId = harness.ensureTurn();
982
1110
  const eventType = role === "assistant" ? isFinal ? "output.text.done" : "output.text.delta" : isFinal ? "transcript.done" : "transcript.delta";
983
1111
  const payload = role === "assistant" ? { text } : {
@@ -1019,7 +1147,7 @@ var RealtimeCallHandler = class {
1019
1147
  this.setRecentFinalUserTranscript(callId, userTranscriptOwner, transcript);
1020
1148
  console.log(`[voice-call] realtime input transcript callId=${callId} providerCallId=${callSid} final=true chars=${text.trim().length} aggregateChars=${transcript.length}`);
1021
1149
  const event = {
1022
- id: `realtime-speech-${callSid}-${Date.now()}`,
1150
+ id: `realtime-speech-${callSid}-${randomUUID()}`,
1023
1151
  type: "call.speech",
1024
1152
  callId,
1025
1153
  providerCallId: callSid,
@@ -1027,31 +1155,39 @@ var RealtimeCallHandler = class {
1027
1155
  transcript,
1028
1156
  isFinal: true
1029
1157
  };
1030
- this.manager.processEvent(event);
1031
- this.scheduleForcedAgentConsult({
1032
- harness,
1033
- session,
1034
- callId,
1035
- callSid,
1036
- transcript,
1037
- userTranscriptOwner,
1038
- clearAudio: () => {
1039
- const clearedBytes = audioPacer.clearAudio();
1040
- console.log(`[voice-call] realtime forced consult cleared outbound audio callId=${callId} providerCallId=${callSid} queuedBytes=${clearedBytes}`);
1041
- }
1158
+ const generation = continuityGeneration;
1159
+ transcriptPersistence = this.manager.processEvent(event).then(() => {
1160
+ if (handlesAgentConsult || sessionClosed || generation !== continuityGeneration || !this.getUserTranscriptState(callId, userTranscriptOwner) || !this.isActiveBridgeOwner(callId, session)) return;
1161
+ this.scheduleForcedAgentConsult({
1162
+ harness,
1163
+ session,
1164
+ callId,
1165
+ callSid,
1166
+ transcript,
1167
+ userTranscriptOwner,
1168
+ clearAudio: () => {
1169
+ const clearedBytes = audioPacer.clearAudio();
1170
+ console.log(`[voice-call] realtime forced consult cleared outbound audio callId=${callId} providerCallId=${callSid} queuedBytes=${clearedBytes}`);
1171
+ }
1172
+ });
1042
1173
  });
1174
+ transcriptPersistence.catch(reportTranscriptFailure);
1043
1175
  return;
1044
1176
  }
1045
- this.manager.processEvent({
1046
- id: `realtime-bot-${callSid}-${Date.now()}`,
1177
+ transcriptPersistence = this.manager.processEvent({
1178
+ id: `realtime-bot-${callSid}-${randomUUID()}`,
1047
1179
  type: "call.assistant-speech",
1048
1180
  callId,
1049
1181
  providerCallId: callSid,
1050
1182
  timestamp: Date.now(),
1051
1183
  transcript: text
1052
- });
1184
+ }).then(() => {});
1185
+ transcriptPersistence.catch(reportTranscriptFailure);
1053
1186
  },
1054
- onToolCall: (toolEvent, sessionLocal) => {
1187
+ onToolCall: async (toolEvent, sessionLocal) => {
1188
+ const generation = continuityGeneration;
1189
+ await transcriptPersistence;
1190
+ if (sessionClosed || generation !== continuityGeneration || !this.isActiveBridgeOwner(callId, sessionLocal)) return;
1055
1191
  const turnId = harness.ensureTurn();
1056
1192
  harness.emit({
1057
1193
  type: "tool.call",
@@ -1064,10 +1200,11 @@ var RealtimeCallHandler = class {
1064
1200
  }
1065
1201
  });
1066
1202
  console.log(`[voice-call] realtime tool call received callId=${callId} providerCallId=${callSid} tool=${toolEvent.name}`);
1067
- return this.executeToolCall(sessionLocal, callId, toolEvent.callId || toolEvent.itemId, toolEvent.name, toolEvent.args, turnId, harness, userTranscriptOwner);
1203
+ await this.executeToolCall(sessionLocal, callId, toolEvent.callId || toolEvent.itemId, toolEvent.name, toolEvent.args, turnId, harness, userTranscriptOwner);
1068
1204
  },
1069
1205
  onEvent: (event) => {
1070
1206
  if (event.direction === "client" && event.type === "session.continuity.reset") {
1207
+ continuityGeneration += 1;
1071
1208
  const turnId = harness.talk.activeTurnId;
1072
1209
  const owner = nativeConsultOwner.current;
1073
1210
  if (owner && this.isActiveBridgeOwner(callId, owner)) {
@@ -1145,14 +1282,18 @@ var RealtimeCallHandler = class {
1145
1282
  provisionalCloseReason ??= reason;
1146
1283
  return;
1147
1284
  }
1285
+ if (sessionClosed) {
1286
+ if (reason === "error") {
1287
+ this.streamDisconnectLifecycle.retire(callSid, streamSid);
1288
+ if (ws.readyState === WebSocket.OPEN) ws.close(1011, "Bridge disconnected");
1289
+ }
1290
+ return;
1291
+ }
1148
1292
  const ownsCallState = this.isActiveBridgeOwner(callId, owner);
1149
- this.clearActiveBridgeMappings(callId, callSid, owner);
1150
- this.cancelConsultSession(callId, owner);
1151
- if (ownsCallState) this.clearUserTranscriptState(callId, userTranscriptOwner);
1152
- if (reason === "completed" && (!ownsCallState || sessionClosed)) return;
1293
+ if (reason === "completed" && !ownsCallState) return;
1294
+ if (ownsCallState) closeBinding(telephonyBinding, reason);
1153
1295
  this.streamDisconnectLifecycle.retire(callSid, streamSid);
1154
1296
  if (ws.readyState === WebSocket.OPEN) ws.close(reason === "error" ? 1011 : 1e3, "Bridge disconnected");
1155
- if (ownsCallState) emitCallEnd(reason);
1156
1297
  }
1157
1298
  };
1158
1299
  let candidate;
@@ -1164,21 +1305,26 @@ var RealtimeCallHandler = class {
1164
1305
  if (!candidate || provisionalCloseReason) {
1165
1306
  this.rollbackUserTranscriptOwnerAdoption(callId, userTranscriptAdoption);
1166
1307
  try {
1167
- candidate?.close();
1308
+ await drainProviderClose(() => candidate?.close());
1168
1309
  } catch (error) {
1169
1310
  console.warn(`[voice-call] Failed to close realtime bridge ${callSid}: ${formatErrorMessage(error)}`);
1170
1311
  }
1171
1312
  harness.close();
1172
1313
  audioPacer.close();
1173
1314
  const reason = provisionalCloseReason ?? "error";
1174
- if (!hadPredecessorOnAdmission || !this.activeBridgesByCallId.has(callId)) emitCallEnd(reason);
1315
+ if (!this.activeBridgesByCallId.has(callId)) emitCallEnd(reason);
1175
1316
  if (ws.readyState === WebSocket.OPEN) ws.close(reason === "error" ? 1011 : 1e3, "Failed to create realtime bridge");
1176
1317
  return null;
1177
1318
  }
1178
1319
  const session = candidate;
1179
1320
  this.commitUserTranscriptOwnerAdoption(callId, userTranscriptAdoption);
1180
1321
  nativeConsultOwner.current = session;
1181
- providerHandlesInputAudioBargeIn = session.bridge.handlesInputAudioBargeIn ?? providerHandlesInputAudioBargeIn;
1322
+ const localBargeIn = !(session.bridge.handlesInputAudioBargeIn ?? providerHandlesInputAudioBargeIn) && resolveRealtimeVoiceBargeIn({
1323
+ configuredBargeIn: void 0,
1324
+ interruptResponseOnInputAudio,
1325
+ capabilities,
1326
+ outputAudioMode: session.bridge.outputAudioMode
1327
+ });
1182
1328
  const previousConsultSession = this.consultSessionsByCallId.get(callId);
1183
1329
  if (previousConsultSession && previousConsultSession.owner !== session) this.cancelConsultSession(callId, previousConsultSession.owner);
1184
1330
  this.consultSessionsByCallId.set(callId, {
@@ -1187,12 +1333,13 @@ var RealtimeCallHandler = class {
1187
1333
  });
1188
1334
  const sendAudioToSession = session.sendAudio.bind(session);
1189
1335
  session.sendAudio = (audio) => {
1336
+ if (sessionClosed) return;
1190
1337
  if (speechDetector.accept({
1191
1338
  rms: calculateMulawRms(audio),
1192
1339
  peak: 0
1193
1340
  })) {
1194
1341
  console.log(`[voice-call] realtime local speech detected callId=${callId} providerCallId=${callSid}`);
1195
- if (!providerHandlesInputAudioBargeIn) cancelOutputAudioForBargeIn("local", (audioPlaybackActive) => {
1342
+ if (localBargeIn) cancelOutputAudioForBargeIn("local", (audioPlaybackActive) => {
1196
1343
  session.handleBargeIn({ audioPlaybackActive });
1197
1344
  });
1198
1345
  }
@@ -1200,18 +1347,18 @@ var RealtimeCallHandler = class {
1200
1347
  sendAudioToSession(audio);
1201
1348
  };
1202
1349
  const closeSession = session.close.bind(session);
1350
+ let sessionClosePromise;
1203
1351
  session.close = () => {
1204
- if (sessionClosed) return;
1352
+ if (sessionClosed) return sessionClosePromise ?? Promise.resolve();
1205
1353
  sessionClosed = true;
1206
- try {
1207
- closeSession();
1208
- } finally {
1354
+ this.cancelConsultSession(callId, session);
1355
+ audioPacer.close();
1356
+ sessionClosePromise = drainProviderClose(closeSession).finally(() => {
1209
1357
  this.clearActiveBridgeMappings(callId, callSid, session);
1210
- this.cancelConsultSession(callId, session);
1211
1358
  this.clearUserTranscriptState(callId, userTranscriptOwner);
1212
1359
  harness.close();
1213
- audioPacer.close();
1214
- }
1360
+ });
1361
+ return sessionClosePromise;
1215
1362
  };
1216
1363
  let livenessTimer;
1217
1364
  const clearLivenessTimer = () => {
@@ -1221,23 +1368,37 @@ var RealtimeCallHandler = class {
1221
1368
  }
1222
1369
  };
1223
1370
  let bindingClosed = false;
1371
+ let bindingClosePromise;
1224
1372
  const closeBinding = (binding, cause) => {
1225
- if (bindingClosed) return callEndPromise ?? Promise.resolve();
1373
+ if (bindingClosed) return bindingClosePromise ?? callEndPromise ?? Promise.resolve();
1226
1374
  bindingClosed = true;
1227
1375
  clearLivenessTimer();
1228
1376
  const ownsCall = this.activeTelephonyBindingsByCallId.get(callId) === binding;
1229
- let termination = Promise.resolve();
1230
- try {
1231
- session.close();
1232
- } catch (error) {
1233
- console.warn(`[voice-call] Failed to close realtime bridge ${callSid}: ${formatErrorMessage(error)}`);
1234
- } finally {
1377
+ const finishClose = () => {
1378
+ const stillOwnsCall = this.activeTelephonyBindingsByCallId.get(callId) === binding;
1235
1379
  this.clearActiveTelephonyBinding(callId, binding);
1236
1380
  if (cause === "disconnect") this.streamDisconnectLifecycle.disconnect(callSid, streamSid);
1237
1381
  else this.streamDisconnectLifecycle.retire(callSid, streamSid);
1238
- if (ownsCall && cause && cause !== "disconnect") termination = emitCallEnd(cause);
1382
+ if (ownsCall && stillOwnsCall && cause && cause !== "disconnect") return emitCallEnd(cause);
1383
+ return Promise.resolve();
1384
+ };
1385
+ let pending;
1386
+ try {
1387
+ pending = Promise.resolve(session.close());
1388
+ } catch (error) {
1389
+ pending = Promise.reject(error instanceof Error ? error : new Error("Realtime provider close failed", { cause: error }));
1239
1390
  }
1240
- return termination;
1391
+ bindingClosePromise = pending.then(finishClose, async (error) => {
1392
+ console.warn(`[voice-call] Failed to close realtime bridge ${callSid}: ${formatErrorMessage(error)}`);
1393
+ try {
1394
+ await finishClose();
1395
+ } catch (terminationError) {
1396
+ throw new AggregateError([error, terminationError], "Realtime call cleanup failed", { cause: terminationError });
1397
+ }
1398
+ throw error;
1399
+ });
1400
+ this.trackShutdownWork(bindingClosePromise, this.terminationAttempts);
1401
+ return bindingClosePromise;
1241
1402
  };
1242
1403
  const telephonyBinding = {
1243
1404
  bridge: session,
@@ -1277,16 +1438,11 @@ var RealtimeCallHandler = class {
1277
1438
  this.activeTelephonyBindingsByCallId.set(callId, telephonyBinding);
1278
1439
  telephonyBinding.noteMediaActivity();
1279
1440
  if (previousTelephonyBinding && previousTelephonyBinding !== telephonyBinding) previousTelephonyBinding.retire();
1280
- session.connect().catch((error) => {
1441
+ session.connect().catch(async (error) => {
1281
1442
  console.error("[voice-call] Failed to connect realtime bridge:", error);
1282
- const ownsCallState = this.isActiveBridgeOwner(callId, session);
1283
- this.streamDisconnectLifecycle.retire(callSid, streamSid);
1284
1443
  try {
1285
- session.close();
1286
- } catch (closeError) {
1287
- console.warn(`[voice-call] Failed to close realtime bridge ${callSid}: ${formatErrorMessage(closeError)}`);
1288
- } finally {
1289
- if (ownsCallState) emitCallEnd("error");
1444
+ await closeBinding(telephonyBinding, "error");
1445
+ } catch {} finally {
1290
1446
  ws.close(1011, "Failed to connect");
1291
1447
  }
1292
1448
  });
@@ -1375,7 +1531,6 @@ var RealtimeCallHandler = class {
1375
1531
  cancelNativeConsult(callId, owner) {
1376
1532
  const state = this.nativeConsultsInFlightByCallId.get(callId);
1377
1533
  if (!state || state.owner !== owner) return;
1378
- state.cancelled = true;
1379
1534
  this.nativeConsultsInFlightByCallId.delete(callId);
1380
1535
  state.cancel();
1381
1536
  }
@@ -1539,7 +1694,7 @@ var RealtimeCallHandler = class {
1539
1694
  }
1540
1695
  }
1541
1696
  }
1542
- prepareCallInManager(callSid, callerMeta = {}) {
1697
+ async prepareCallInManager(callSid, callerMeta = {}) {
1543
1698
  const baseFields = {
1544
1699
  providerCallId: callSid,
1545
1700
  timestamp: Date.now(),
@@ -1547,22 +1702,19 @@ var RealtimeCallHandler = class {
1547
1702
  ...callerMeta.from ? { from: callerMeta.from } : {},
1548
1703
  ...callerMeta.to ? { to: callerMeta.to } : {}
1549
1704
  };
1550
- const callRecord = this.resolveRealtimeCall(callSid, callerMeta, baseFields);
1705
+ const callRecord = await this.resolveRealtimeCall(callSid, callerMeta, baseFields);
1551
1706
  if (!callRecord) return null;
1552
- const initialGreeting = this.extractInitialGreeting(callRecord);
1553
- console.log(`[voice-call] Realtime call ${callRecord.callId} initial greeting ${initialGreeting ? "queued" : "absent"}`);
1554
1707
  return {
1555
1708
  callRecord,
1556
- baseFields,
1557
- initialGreeting
1709
+ baseFields
1558
1710
  };
1559
1711
  }
1560
- resolveRealtimeCall(callSid, callerMeta, baseFields) {
1712
+ async resolveRealtimeCall(callSid, callerMeta, baseFields) {
1561
1713
  if (callerMeta.callId) {
1562
- const call = this.manager.getCall(callerMeta.callId);
1714
+ const call = await this.manager.getCallForStream(callerMeta.callId);
1563
1715
  return call?.providerCallId === callSid ? call : null;
1564
1716
  }
1565
- this.manager.processEvent({
1717
+ await this.manager.processEvent({
1566
1718
  id: `realtime-initiated-${callSid}`,
1567
1719
  callId: callSid,
1568
1720
  type: "call.initiated",
@@ -1570,9 +1722,6 @@ var RealtimeCallHandler = class {
1570
1722
  });
1571
1723
  return this.manager.getCallByProviderCallId(callSid) ?? null;
1572
1724
  }
1573
- extractInitialGreeting(call) {
1574
- return typeof call.metadata?.initialMessage === "string" ? call.metadata.initialMessage : void 0;
1575
- }
1576
1725
  async executeEndCallTool(params) {
1577
1726
  const binding = this.activeTelephonyBindingsByCallId.get(params.callId);
1578
1727
  if (!binding || binding.bridge !== params.bridge || !this.isActiveBridgeOwner(params.callId, params.bridge)) return;
@@ -1613,7 +1762,7 @@ var RealtimeCallHandler = class {
1613
1762
  });
1614
1763
  binding.endCall();
1615
1764
  }
1616
- async executeToolCall(bridge, callId, bridgeCallId, name, args, turnId, harness, userTranscriptOwner) {
1765
+ async executeToolCall(bridge, callId, bridgeCallId, name, args, turnId, harness, userTranscriptOwner, delegation) {
1617
1766
  if (name === "openclaw_end_call") {
1618
1767
  await this.executeEndCallTool({
1619
1768
  bridge,
@@ -1642,11 +1791,12 @@ var RealtimeCallHandler = class {
1642
1791
  });
1643
1792
  };
1644
1793
  const submitFinalToolResult = async (result) => {
1645
- await bridge.submitToolResult(bridgeCallId, result);
1794
+ if (!delegation) await bridge.submitToolResult(bridgeCallId, result);
1646
1795
  emitFinalToolEvent(result);
1796
+ return result;
1647
1797
  };
1648
1798
  const submitWorkingResponse = async () => {
1649
- if (handler && name === REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME && bridge.bridge.supportsToolResultContinuation && !this.config.fastContext.enabled) {
1799
+ if (!delegation && handler && name === REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME && bridge.bridge.supportsToolResultContinuation && !this.config.fastContext.enabled) {
1650
1800
  await bridge.submitToolResult(bridgeCallId, buildRealtimeVoiceAgentConsultWorkingResponse("caller"), { willContinue: true });
1651
1801
  harness.emit({
1652
1802
  type: "tool.progress",
@@ -1671,25 +1821,20 @@ var RealtimeCallHandler = class {
1671
1821
  const forcedConsult = forcedConsultState?.owner === bridge && !forcedConsultState.cancelled ? forcedConsultState : void 0;
1672
1822
  if (forcedMatch.kind === "already_delivered" && coordinator.isCancelled(forcedMatch.handle)) {
1673
1823
  if (forcedConsult) forcedConsult.sendSpeechPrompt = false;
1674
- await submitFinalToolResult({
1824
+ return await submitFinalToolResult({
1675
1825
  status: "cancelled",
1676
1826
  message: "OpenClaw cancelled this consult before completion. Do not restart it."
1677
1827
  });
1678
- return;
1679
1828
  }
1680
1829
  if (forcedConsult) {
1681
- if (forcedConsult.completedAt || forcedMatch.kind === "already_delivered") {
1682
- await submitFinalToolResult({
1683
- status: "already_delivered",
1684
- message: "OpenClaw already delivered this consult result internally. Do not repeat it."
1685
- });
1686
- return;
1687
- }
1830
+ if (forcedConsult.completedAt || forcedMatch.kind === "already_delivered") return await submitFinalToolResult({
1831
+ status: "already_delivered",
1832
+ message: "OpenClaw already delivered this consult result internally. Do not repeat it."
1833
+ });
1688
1834
  forcedConsult.sendSpeechPrompt = false;
1689
1835
  const result = await forcedConsult.promise.catch(buildRealtimeVoiceAgentErrorProviderResult);
1690
1836
  if (forcedConsult.cancelled || forcedConsult.owner !== bridge || this.forcedConsultsByCallId.get(callId) !== forcedConsult) return;
1691
- await submitFinalToolResult(result);
1692
- return;
1837
+ return await submitFinalToolResult(result);
1693
1838
  }
1694
1839
  const existingNativeConsult = this.nativeConsultsInFlightByCallId.get(callId);
1695
1840
  if (existingNativeConsult) {
@@ -1697,8 +1842,7 @@ var RealtimeCallHandler = class {
1697
1842
  await submitWorkingResponse();
1698
1843
  const outcome = await waitForNativeConsult(existingNativeConsult);
1699
1844
  if (outcome.kind === "cancelled") return;
1700
- await submitFinalToolResult(outcome.result);
1701
- return;
1845
+ return await submitFinalToolResult(outcome.result);
1702
1846
  }
1703
1847
  const abortController = new AbortController();
1704
1848
  let releaseCancellation = () => {};
@@ -1713,19 +1857,23 @@ var RealtimeCallHandler = class {
1713
1857
  completeConsult = resolve;
1714
1858
  }),
1715
1859
  cancellation,
1716
- cancelled: false,
1860
+ get cancelled() {
1861
+ return abortController.signal.aborted;
1862
+ },
1717
1863
  cancel: () => {
1718
1864
  abortController.abort(/* @__PURE__ */ new Error("Realtime native consult owner was cancelled."));
1719
1865
  releaseCancellation();
1720
1866
  }
1721
1867
  };
1868
+ if (delegation?.signal?.aborted) state.cancel();
1869
+ else delegation?.signal?.addEventListener("abort", state.cancel, { once: true });
1722
1870
  this.nativeConsultsInFlightByCallId.set(callId, state);
1723
1871
  (async () => {
1724
1872
  try {
1725
1873
  await submitWorkingResponse();
1726
- if (state.cancelled) return;
1874
+ if (state.cancelled || !this.isActiveBridgeOwner(callId, bridge)) return;
1727
1875
  await Promise.race([this.waitForConsultTranscriptSettle(callId, userTranscriptOwner, startedAt), state.cancellation]);
1728
- if (state.cancelled) return;
1876
+ if (state.cancelled || !this.isActiveBridgeOwner(callId, bridge)) return;
1729
1877
  const context = {
1730
1878
  partialUserTranscript: this.resolveUserTranscriptContext(callId, userTranscriptOwner),
1731
1879
  abortSignal: abortController.signal
@@ -1747,10 +1895,11 @@ var RealtimeCallHandler = class {
1747
1895
  console.log(`[voice-call] realtime tool call completed callId=${callId} tool=${name} status=${failed ? "error" : "ok"} elapsedMs=${Date.now() - startedAt}${error ? ` error=${error}` : ""}`);
1748
1896
  await submitFinalToolResult(result);
1749
1897
  if (!failed) this.consumePartialUserTranscript(callId, userTranscriptOwner, state.partialUserTranscript);
1898
+ return result;
1750
1899
  } finally {
1900
+ delegation?.signal?.removeEventListener("abort", state.cancel);
1751
1901
  if (this.nativeConsultsInFlightByCallId.get(callId) === state) this.nativeConsultsInFlightByCallId.delete(callId);
1752
1902
  }
1753
- return;
1754
1903
  }
1755
1904
  console.log(`[voice-call] realtime tool call executing callId=${callId} tool=${name} hasHandler=${Boolean(handler)}`);
1756
1905
  const context = { partialUserTranscript: this.resolveUserTranscriptContext(callId, userTranscriptOwner) };
@@ -1762,7 +1911,7 @@ var RealtimeCallHandler = class {
1762
1911
  }
1763
1912
  const error = hasResultError(result) ? formatErrorMessage(result.error ?? "unknown") : void 0;
1764
1913
  console.log(`[voice-call] realtime tool call completed callId=${callId} tool=${name} status=${error === void 0 ? "ok" : "error"} elapsedMs=${Date.now() - startedAt}${error ? ` error=${error}` : ""}`);
1765
- await submitFinalToolResult(result);
1914
+ return await submitFinalToolResult(result);
1766
1915
  }
1767
1916
  };
1768
1917
  //#endregion