@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.
- package/assets/activity.svg +3 -0
- package/assets/icon.png +0 -0
- package/dist/{cli-BGdihqyA.js → .setup/cli-z1onSLj4.mjs} +7 -7
- package/dist/{config-DQwvsxeV.js → .setup/config-72FnMWHb.mjs} +3 -3
- package/dist/{guarded-json-api-3Jy2k-eX.js → .setup/guarded-json-api-CuLkeTrl.mjs} +17 -39
- package/dist/{mock-C57qj18W.js → .setup/mock-CcYEAUhV.mjs} +1 -1
- package/dist/{plivo-BsdFT1gS.js → .setup/plivo-DWYNkAQ3.mjs} +2 -2
- package/dist/{realtime-handler-C7N4qzvf.js → .setup/realtime-handler-CaoetLrM.mjs} +284 -135
- package/dist/{response-generator-DsdC88Xg.js → .setup/response-generator-DB1nElLO.mjs} +2 -2
- package/dist/{runtime-entry-Ln4SWaYK.js → .setup/runtime-entry-YWSSnAsH.mjs} +457 -291
- package/dist/{store-path-M0GXxUfv.js → .setup/store-path-B1j1up4_.mjs} +91 -55
- package/dist/{telnyx-eCxGOUfA.js → .setup/telnyx-BY3ef4Cc.mjs} +1 -1
- package/dist/{twilio-DQKhnXXE.js → .setup/twilio-DWZ4HVmF.mjs} +9 -23
- package/dist/doctor-contract-api.js +14 -33
- package/dist/index.js +3 -3
- package/dist/runtime-entry.js +1 -1
- package/node_modules/typebox/build/compile/validator.d.mts +1 -1
- package/node_modules/typebox/build/compile/validator.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
- package/node_modules/typebox/build/format/iri.mjs +5 -1
- package/node_modules/typebox/build/guard/emit.mjs +2 -4
- package/node_modules/typebox/build/guard/guard.mjs +6 -18
- package/node_modules/typebox/build/guard/string.mjs +16 -24
- package/node_modules/typebox/build/schema/build.mjs +2 -2
- package/node_modules/typebox/build/schema/check.mjs +1 -1
- package/node_modules/typebox/build/schema/compile.d.mts +3 -2
- package/node_modules/typebox/build/schema/compile.mjs +8 -8
- package/node_modules/typebox/build/schema/engine/_context.d.mts +6 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +23 -15
- package/node_modules/typebox/build/schema/engine/_functions.d.mts +2 -2
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/_reducer.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/_refine.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/_refine.mjs +4 -7
- package/node_modules/typebox/build/schema/engine/_stack.d.mts +34 -16
- package/node_modules/typebox/build/schema/engine/_stack.mjs +148 -104
- package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +8 -8
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +26 -18
- package/node_modules/typebox/build/schema/engine/allOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/allOf.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/anyOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/anyOf.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/boolean.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/const.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/const.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/contains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/contains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/dependencies.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +3 -6
- package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +11 -7
- package/node_modules/typebox/build/schema/engine/enum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/enum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/format.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/format.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/if.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/if.mjs +7 -15
- package/node_modules/typebox/build/schema/engine/items.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/items.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/maxContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxItems.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxLength.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxProperties.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maximum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minContains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minItems.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/minItems.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minLength.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minProperties.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minimum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/multipleOf.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/not.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -8
- package/node_modules/typebox/build/schema/engine/oneOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +6 -11
- package/node_modules/typebox/build/schema/engine/pattern.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -7
- package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/prefixItems.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/properties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/properties.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +4 -10
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +11 -7
- package/node_modules/typebox/build/schema/engine/ref.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/ref.mjs +19 -15
- package/node_modules/typebox/build/schema/engine/required.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/required.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/schema.d.mts +7 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +137 -133
- package/node_modules/typebox/build/schema/engine/type.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +5 -9
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +5 -9
- package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +2 -6
- package/node_modules/typebox/build/schema/errors.d.mts +2 -2
- package/node_modules/typebox/build/schema/errors.mjs +8 -14
- package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
- package/node_modules/typebox/build/schema/intern/intern.d.mts +11 -0
- package/node_modules/typebox/build/schema/intern/intern.mjs +293 -0
- package/node_modules/typebox/build/schema/meta/draft_2019_09.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_2019_09.mjs +288 -0
- package/node_modules/typebox/build/schema/meta/draft_2020_12.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_2020_12.mjs +300 -0
- package/node_modules/typebox/build/schema/meta/draft_3.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_3.mjs +143 -0
- package/node_modules/typebox/build/schema/meta/draft_4.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_4.mjs +149 -0
- package/node_modules/typebox/build/schema/meta/draft_6.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_6.mjs +155 -0
- package/node_modules/typebox/build/schema/meta/draft_7.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_7.mjs +172 -0
- package/node_modules/typebox/build/schema/meta/index.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/index.mjs +2 -0
- package/node_modules/typebox/build/schema/meta/meta.d.mts +9 -0
- package/node_modules/typebox/build/schema/meta/meta.mjs +15 -0
- package/node_modules/typebox/build/schema/meta/schema.d.mts +6 -0
- package/node_modules/typebox/build/schema/meta/schema.mjs +1 -0
- package/node_modules/typebox/build/schema/parse.d.mts +1 -0
- package/node_modules/typebox/build/schema/parse.mjs +10 -5
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +8 -3
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +268 -139
- package/node_modules/typebox/build/schema/schema.d.mts +2 -0
- package/node_modules/typebox/build/schema/schema.mjs +2 -0
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
- package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +59 -89
- package/node_modules/zod/README.md +27 -0
- package/node_modules/zod/compile.cjs +77 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +2 -2
- package/node_modules/zod/index.d.cts +1 -2
- package/node_modules/zod/index.d.ts +1 -2
- package/node_modules/zod/index.js +5 -2
- package/node_modules/zod/package.json +13 -2
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +5 -2
- package/node_modules/zod/src/v3/ZodError.ts +22 -12
- package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
- package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
- package/node_modules/zod/src/v3/types.ts +5 -5
- package/node_modules/zod/src/v4/classic/checks.ts +1 -0
- package/node_modules/zod/src/v4/classic/compat.ts +26 -18
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +59 -44
- package/node_modules/zod/src/v4/classic/external.ts +12 -9
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +140 -78
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +2 -2
- package/node_modules/zod/src/v4/classic/iso.ts +2 -72
- package/node_modules/zod/src/v4/classic/parse.ts +10 -4
- package/node_modules/zod/src/v4/classic/schemas.ts +452 -262
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +135 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +30 -1
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +720 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +155 -13
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +11 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +274 -6
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +425 -10
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +281 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +47 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +183 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +46 -9
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +245 -12
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +234 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +33 -2
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +127 -5
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +11 -2
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1585 -173
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
- package/node_modules/zod/src/v4/core/api.ts +48 -12
- package/node_modules/zod/src/v4/core/checks.ts +57 -44
- package/node_modules/zod/src/v4/core/compile.ts +2188 -0
- package/node_modules/zod/src/v4/core/core.ts +98 -19
- package/node_modules/zod/src/v4/core/doc.ts +11 -7
- package/node_modules/zod/src/v4/core/errors.ts +115 -24
- package/node_modules/zod/src/v4/core/index.ts +3 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +6 -1
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +257 -93
- package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
- package/node_modules/zod/src/v4/core/memoizer.ts +284 -0
- package/node_modules/zod/src/v4/core/parse.ts +131 -38
- package/node_modules/zod/src/v4/core/regexes.ts +30 -13
- package/node_modules/zod/src/v4/core/registries.ts +2 -2
- package/node_modules/zod/src/v4/core/schemas.ts +759 -461
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +1639 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +275 -42
- package/node_modules/zod/src/v4/core/util.ts +268 -42
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/index.ts +3 -3
- package/node_modules/zod/src/v4/locales/ar.ts +3 -0
- package/node_modules/zod/src/v4/locales/az.ts +3 -0
- package/node_modules/zod/src/v4/locales/be.ts +10 -0
- package/node_modules/zod/src/v4/locales/bg.ts +3 -0
- package/node_modules/zod/src/v4/locales/bn.ts +121 -0
- package/node_modules/zod/src/v4/locales/ca.ts +3 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +138 -0
- package/node_modules/zod/src/v4/locales/cs.ts +3 -0
- package/node_modules/zod/src/v4/locales/da.ts +5 -2
- package/node_modules/zod/src/v4/locales/de.ts +3 -0
- package/node_modules/zod/src/v4/locales/el.ts +1 -0
- package/node_modules/zod/src/v4/locales/en.ts +15 -4
- package/node_modules/zod/src/v4/locales/eo.ts +3 -0
- package/node_modules/zod/src/v4/locales/es.ts +2 -0
- package/node_modules/zod/src/v4/locales/fa.ts +3 -0
- package/node_modules/zod/src/v4/locales/fi.ts +3 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +3 -0
- package/node_modules/zod/src/v4/locales/fr.ts +19 -14
- package/node_modules/zod/src/v4/locales/gu.ts +121 -0
- package/node_modules/zod/src/v4/locales/he.ts +6 -1
- package/node_modules/zod/src/v4/locales/hi.ts +124 -0
- package/node_modules/zod/src/v4/locales/hr.ts +2 -0
- package/node_modules/zod/src/v4/locales/hu.ts +3 -0
- package/node_modules/zod/src/v4/locales/hy.ts +9 -0
- package/node_modules/zod/src/v4/locales/id.ts +3 -0
- package/node_modules/zod/src/v4/locales/index.ts +10 -0
- package/node_modules/zod/src/v4/locales/is.ts +3 -0
- package/node_modules/zod/src/v4/locales/it.ts +3 -0
- package/node_modules/zod/src/v4/locales/ja.ts +3 -0
- package/node_modules/zod/src/v4/locales/ka.ts +3 -0
- package/node_modules/zod/src/v4/locales/km.ts +3 -0
- package/node_modules/zod/src/v4/locales/kn.ts +124 -0
- package/node_modules/zod/src/v4/locales/ko.ts +3 -0
- package/node_modules/zod/src/v4/locales/lt.ts +2 -0
- package/node_modules/zod/src/v4/locales/mk.ts +3 -0
- package/node_modules/zod/src/v4/locales/ms.ts +3 -0
- package/node_modules/zod/src/v4/locales/ne.ts +126 -0
- package/node_modules/zod/src/v4/locales/nl.ts +3 -0
- package/node_modules/zod/src/v4/locales/nn.ts +119 -0
- package/node_modules/zod/src/v4/locales/no.ts +5 -2
- package/node_modules/zod/src/v4/locales/ota.ts +3 -0
- package/node_modules/zod/src/v4/locales/pl.ts +3 -0
- package/node_modules/zod/src/v4/locales/ps.ts +3 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +159 -0
- package/node_modules/zod/src/v4/locales/pt.ts +99 -58
- package/node_modules/zod/src/v4/locales/ro.ts +1 -0
- package/node_modules/zod/src/v4/locales/ru.ts +10 -0
- package/node_modules/zod/src/v4/locales/sk.ts +121 -0
- package/node_modules/zod/src/v4/locales/sl.ts +3 -0
- package/node_modules/zod/src/v4/locales/sv.ts +5 -2
- package/node_modules/zod/src/v4/locales/ta.ts +3 -0
- package/node_modules/zod/src/v4/locales/th.ts +3 -0
- package/node_modules/zod/src/v4/locales/tk.ts +111 -0
- package/node_modules/zod/src/v4/locales/tr.ts +3 -0
- package/node_modules/zod/src/v4/locales/uk.ts +3 -0
- package/node_modules/zod/src/v4/locales/ur.ts +3 -0
- package/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/zod/src/v4/locales/vi.ts +3 -0
- package/node_modules/zod/src/v4/locales/yo.ts +3 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +3 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +3 -0
- package/node_modules/zod/src/v4/mini/checks.ts +1 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +10 -1
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/parse.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +135 -56
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +72 -5
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +21 -0
- package/node_modules/zod/v3/ZodError.cjs +22 -12
- package/node_modules/zod/v3/ZodError.d.cts +1 -1
- package/node_modules/zod/v3/ZodError.d.ts +1 -1
- package/node_modules/zod/v3/ZodError.js +22 -12
- package/node_modules/zod/v3/types.cjs +7 -5
- package/node_modules/zod/v3/types.js +7 -5
- package/node_modules/zod/v4/classic/checks.cjs +2 -1
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- package/node_modules/zod/v4/classic/compat.d.cts +9 -11
- package/node_modules/zod/v4/classic/compat.d.ts +9 -11
- package/node_modules/zod/v4/classic/deep-partial.cjs +39 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +43 -34
- package/node_modules/zod/v4/classic/errors.d.cts +3 -4
- package/node_modules/zod/v4/classic/errors.d.ts +3 -4
- package/node_modules/zod/v4/classic/errors.js +43 -34
- package/node_modules/zod/v4/classic/external.cjs +30 -27
- package/node_modules/zod/v4/classic/external.d.cts +5 -2
- package/node_modules/zod/v4/classic/external.d.ts +5 -2
- package/node_modules/zod/v4/classic/external.js +5 -8
- package/node_modules/zod/v4/classic/from-json-schema.cjs +136 -75
- package/node_modules/zod/v4/classic/from-json-schema.js +136 -75
- package/node_modules/zod/v4/classic/in-out.cjs +63 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +2 -2
- package/node_modules/zod/v4/classic/index.d.cts +1 -2
- package/node_modules/zod/v4/classic/index.d.ts +1 -2
- package/node_modules/zod/v4/classic/index.js +2 -2
- package/node_modules/zod/v4/classic/iso.cjs +11 -22
- package/node_modules/zod/v4/classic/iso.d.cts +2 -17
- package/node_modules/zod/v4/classic/iso.d.ts +2 -17
- package/node_modules/zod/v4/classic/iso.js +2 -17
- package/node_modules/zod/v4/classic/parse.cjs +4 -1
- package/node_modules/zod/v4/classic/parse.d.cts +17 -4
- package/node_modules/zod/v4/classic/parse.d.ts +17 -4
- package/node_modules/zod/v4/classic/parse.js +1 -0
- package/node_modules/zod/v4/classic/schemas.cjs +498 -398
- package/node_modules/zod/v4/classic/schemas.d.cts +53 -18
- package/node_modules/zod/v4/classic/schemas.d.ts +53 -18
- package/node_modules/zod/v4/classic/schemas.js +492 -396
- package/node_modules/zod/v4/core/api.cjs +23 -4
- package/node_modules/zod/v4/core/api.d.cts +13 -9
- package/node_modules/zod/v4/core/api.d.ts +13 -9
- package/node_modules/zod/v4/core/api.js +21 -4
- package/node_modules/zod/v4/core/checks.cjs +37 -31
- package/node_modules/zod/v4/core/checks.d.cts +13 -13
- package/node_modules/zod/v4/core/checks.d.ts +13 -13
- package/node_modules/zod/v4/core/checks.js +37 -31
- package/node_modules/zod/v4/core/compile.cjs +1813 -0
- package/node_modules/zod/v4/core/compile.d.cts +51 -0
- package/node_modules/zod/v4/core/compile.d.ts +51 -0
- package/node_modules/zod/v4/core/compile.js +1783 -0
- package/node_modules/zod/v4/core/core.cjs +81 -18
- package/node_modules/zod/v4/core/core.d.cts +16 -4
- package/node_modules/zod/v4/core/core.d.ts +16 -4
- package/node_modules/zod/v4/core/core.js +82 -19
- package/node_modules/zod/v4/core/doc.cjs +5 -7
- package/node_modules/zod/v4/core/doc.d.cts +3 -1
- package/node_modules/zod/v4/core/doc.d.ts +3 -1
- package/node_modules/zod/v4/core/doc.js +5 -7
- package/node_modules/zod/v4/core/errors.cjs +110 -25
- package/node_modules/zod/v4/core/errors.d.cts +4 -0
- package/node_modules/zod/v4/core/errors.d.ts +4 -0
- package/node_modules/zod/v4/core/errors.js +110 -25
- package/node_modules/zod/v4/core/index.cjs +5 -1
- package/node_modules/zod/v4/core/index.d.cts +3 -0
- package/node_modules/zod/v4/core/index.d.ts +3 -0
- package/node_modules/zod/v4/core/index.js +3 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +4 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.js +4 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +264 -95
- package/node_modules/zod/v4/core/json-schema-processors.js +243 -97
- package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
- package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
- package/node_modules/zod/v4/core/memoizer.cjs +272 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +265 -0
- package/node_modules/zod/v4/core/parse.cjs +96 -34
- package/node_modules/zod/v4/core/parse.d.cts +14 -11
- package/node_modules/zod/v4/core/parse.d.ts +14 -11
- package/node_modules/zod/v4/core/parse.js +94 -33
- package/node_modules/zod/v4/core/regexes.cjs +27 -15
- package/node_modules/zod/v4/core/regexes.d.cts +2 -0
- package/node_modules/zod/v4/core/regexes.d.ts +2 -0
- package/node_modules/zod/v4/core/regexes.js +24 -13
- package/node_modules/zod/v4/core/registries.js +2 -2
- package/node_modules/zod/v4/core/schemas.cjs +537 -326
- package/node_modules/zod/v4/core/schemas.d.cts +100 -31
- package/node_modules/zod/v4/core/schemas.d.ts +100 -31
- package/node_modules/zod/v4/core/schemas.js +526 -325
- package/node_modules/zod/v4/core/to-json-schema.cjs +242 -39
- package/node_modules/zod/v4/core/to-json-schema.d.cts +42 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +42 -3
- package/node_modules/zod/v4/core/to-json-schema.js +241 -39
- package/node_modules/zod/v4/core/util.cjs +212 -31
- package/node_modules/zod/v4/core/util.d.cts +58 -1
- package/node_modules/zod/v4/core/util.d.ts +58 -1
- package/node_modules/zod/v4/core/util.js +202 -30
- package/node_modules/zod/v4/core/versions.cjs +2 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +195 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +15 -5
- package/node_modules/zod/v4/index.d.cts +2 -2
- package/node_modules/zod/v4/index.d.ts +2 -2
- package/node_modules/zod/v4/index.js +3 -2
- package/node_modules/zod/v4/locales/ar.cjs +3 -0
- package/node_modules/zod/v4/locales/ar.js +3 -0
- package/node_modules/zod/v4/locales/az.cjs +3 -0
- package/node_modules/zod/v4/locales/az.js +3 -0
- package/node_modules/zod/v4/locales/be.cjs +10 -0
- package/node_modules/zod/v4/locales/be.js +10 -0
- package/node_modules/zod/v4/locales/bg.cjs +3 -0
- package/node_modules/zod/v4/locales/bg.js +3 -0
- package/node_modules/zod/v4/locales/bn.cjs +138 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +111 -0
- package/node_modules/zod/v4/locales/ca.cjs +3 -0
- package/node_modules/zod/v4/locales/ca.js +3 -0
- package/node_modules/zod/v4/locales/ckb.cjs +158 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +131 -0
- package/node_modules/zod/v4/locales/cs.cjs +3 -0
- package/node_modules/zod/v4/locales/cs.js +3 -0
- package/node_modules/zod/v4/locales/da.cjs +5 -2
- package/node_modules/zod/v4/locales/da.js +5 -2
- package/node_modules/zod/v4/locales/de.cjs +3 -0
- package/node_modules/zod/v4/locales/de.js +3 -0
- package/node_modules/zod/v4/locales/el.cjs +1 -0
- package/node_modules/zod/v4/locales/el.js +1 -0
- package/node_modules/zod/v4/locales/en.cjs +14 -4
- package/node_modules/zod/v4/locales/en.js +14 -4
- package/node_modules/zod/v4/locales/eo.cjs +3 -0
- package/node_modules/zod/v4/locales/eo.js +3 -0
- package/node_modules/zod/v4/locales/es.cjs +2 -0
- package/node_modules/zod/v4/locales/es.js +2 -0
- package/node_modules/zod/v4/locales/fa.cjs +3 -0
- package/node_modules/zod/v4/locales/fa.js +3 -0
- package/node_modules/zod/v4/locales/fi.cjs +3 -0
- package/node_modules/zod/v4/locales/fi.js +3 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +3 -0
- package/node_modules/zod/v4/locales/fr-CA.js +3 -0
- package/node_modules/zod/v4/locales/fr.cjs +16 -14
- package/node_modules/zod/v4/locales/fr.js +16 -14
- package/node_modules/zod/v4/locales/gu.cjs +138 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +111 -0
- package/node_modules/zod/v4/locales/he.cjs +5 -0
- package/node_modules/zod/v4/locales/he.js +5 -0
- package/node_modules/zod/v4/locales/hi.cjs +136 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +109 -0
- package/node_modules/zod/v4/locales/hr.cjs +2 -0
- package/node_modules/zod/v4/locales/hr.js +2 -0
- package/node_modules/zod/v4/locales/hu.cjs +3 -0
- package/node_modules/zod/v4/locales/hu.js +3 -0
- package/node_modules/zod/v4/locales/hy.cjs +9 -0
- package/node_modules/zod/v4/locales/hy.js +9 -0
- package/node_modules/zod/v4/locales/id.cjs +3 -0
- package/node_modules/zod/v4/locales/id.js +3 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -2
- package/node_modules/zod/v4/locales/index.d.cts +10 -0
- package/node_modules/zod/v4/locales/index.d.ts +10 -0
- package/node_modules/zod/v4/locales/index.js +10 -0
- package/node_modules/zod/v4/locales/is.cjs +3 -0
- package/node_modules/zod/v4/locales/is.js +3 -0
- package/node_modules/zod/v4/locales/it.cjs +3 -0
- package/node_modules/zod/v4/locales/it.js +3 -0
- package/node_modules/zod/v4/locales/ja.cjs +3 -0
- package/node_modules/zod/v4/locales/ja.js +3 -0
- package/node_modules/zod/v4/locales/ka.cjs +3 -0
- package/node_modules/zod/v4/locales/ka.js +3 -0
- package/node_modules/zod/v4/locales/km.cjs +3 -0
- package/node_modules/zod/v4/locales/km.js +3 -0
- package/node_modules/zod/v4/locales/kn.cjs +141 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +114 -0
- package/node_modules/zod/v4/locales/ko.cjs +3 -0
- package/node_modules/zod/v4/locales/ko.js +3 -0
- package/node_modules/zod/v4/locales/lt.cjs +2 -0
- package/node_modules/zod/v4/locales/lt.js +2 -0
- package/node_modules/zod/v4/locales/mk.cjs +3 -0
- package/node_modules/zod/v4/locales/mk.js +3 -0
- package/node_modules/zod/v4/locales/ms.cjs +3 -0
- package/node_modules/zod/v4/locales/ms.js +3 -0
- package/node_modules/zod/v4/locales/ne.cjs +136 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +109 -0
- package/node_modules/zod/v4/locales/nl.cjs +3 -0
- package/node_modules/zod/v4/locales/nl.js +3 -0
- package/node_modules/zod/v4/locales/nn.cjs +138 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +111 -0
- package/node_modules/zod/v4/locales/no.cjs +5 -2
- package/node_modules/zod/v4/locales/no.js +5 -2
- package/node_modules/zod/v4/locales/ota.cjs +3 -0
- package/node_modules/zod/v4/locales/ota.js +3 -0
- package/node_modules/zod/v4/locales/pl.cjs +3 -0
- package/node_modules/zod/v4/locales/pl.js +3 -0
- package/node_modules/zod/v4/locales/ps.cjs +3 -0
- package/node_modules/zod/v4/locales/ps.js +3 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +168 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +141 -0
- package/node_modules/zod/v4/locales/pt.cjs +87 -55
- package/node_modules/zod/v4/locales/pt.js +87 -55
- package/node_modules/zod/v4/locales/ro.cjs +1 -0
- package/node_modules/zod/v4/locales/ro.js +1 -0
- package/node_modules/zod/v4/locales/ru.cjs +10 -0
- package/node_modules/zod/v4/locales/ru.js +10 -0
- package/node_modules/zod/v4/locales/sk.cjs +141 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +114 -0
- package/node_modules/zod/v4/locales/sl.cjs +3 -0
- package/node_modules/zod/v4/locales/sl.js +3 -0
- package/node_modules/zod/v4/locales/sv.cjs +5 -2
- package/node_modules/zod/v4/locales/sv.js +5 -2
- package/node_modules/zod/v4/locales/ta.cjs +3 -0
- package/node_modules/zod/v4/locales/ta.js +3 -0
- package/node_modules/zod/v4/locales/th.cjs +3 -0
- package/node_modules/zod/v4/locales/th.js +3 -0
- package/node_modules/zod/v4/locales/tk.cjs +132 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +105 -0
- package/node_modules/zod/v4/locales/tr.cjs +3 -0
- package/node_modules/zod/v4/locales/tr.js +3 -0
- package/node_modules/zod/v4/locales/uk.cjs +3 -0
- package/node_modules/zod/v4/locales/uk.js +3 -0
- package/node_modules/zod/v4/locales/ur.cjs +3 -0
- package/node_modules/zod/v4/locales/ur.js +3 -0
- package/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/zod/v4/locales/vi.cjs +3 -0
- package/node_modules/zod/v4/locales/vi.js +3 -0
- package/node_modules/zod/v4/locales/yo.cjs +3 -0
- package/node_modules/zod/v4/locales/yo.js +3 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +3 -0
- package/node_modules/zod/v4/locales/zh-CN.js +3 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +3 -0
- package/node_modules/zod/v4/locales/zh-TW.js +3 -0
- package/node_modules/zod/v4/mini/checks.cjs +2 -1
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/deep-partial.cjs +39 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +12 -1
- package/node_modules/zod/v4/mini/external.d.cts +5 -2
- package/node_modules/zod/v4/mini/external.d.ts +5 -2
- package/node_modules/zod/v4/mini/external.js +3 -1
- package/node_modules/zod/v4/mini/in-out.cjs +63 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/parse.cjs +3 -1
- package/node_modules/zod/v4/mini/parse.d.cts +1 -1
- package/node_modules/zod/v4/mini/parse.d.ts +1 -1
- package/node_modules/zod/v4/mini/parse.js +1 -1
- package/node_modules/zod/v4/mini/schemas.cjs +75 -47
- package/node_modules/zod/v4/mini/schemas.d.cts +43 -13
- package/node_modules/zod/v4/mini/schemas.d.ts +43 -13
- package/node_modules/zod/v4/mini/schemas.js +71 -45
- package/openclaw.plugin.json +70 -1
- package/package.json +9 -6
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- /package/dist/{realtime-transcription.runtime-CbJAs5t_.js → .setup/realtime-transcription.runtime-CbJAs5t_.mjs} +0 -0
- /package/dist/{realtime-voice.runtime-vtdCOWg-.js → .setup/realtime-voice.runtime-vtdCOWg-.mjs} +0 -0
- /package/dist/{twilio-region-4fkgz3UG.js → .setup/twilio-region-4fkgz3UG.mjs} +0 -0
- /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-
|
|
2
|
-
import { c as canonicalizeVoiceCallMediaBase64, o as WebSocket, s as WebSocketServer } from "./runtime-entry-
|
|
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(
|
|
529
|
-
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
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
|
-
|
|
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
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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 (!
|
|
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
|
|
833
|
-
|
|
834
|
-
this.manager.
|
|
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
|
-
|
|
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) =>
|
|
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
|
-
|
|
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}-${
|
|
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
|
-
|
|
1031
|
-
this.
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
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}-${
|
|
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
|
-
|
|
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
|
-
|
|
1150
|
-
|
|
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 (!
|
|
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
|
-
|
|
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 (
|
|
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
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1230
|
-
|
|
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")
|
|
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
|
-
|
|
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
|
-
|
|
1286
|
-
} catch
|
|
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.
|
|
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
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
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
|
|
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
|