@voctiv/agent-runtime 0.2.2 → 0.4.1
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/README.md +53 -20
- package/bin/voctiv-agent-check.js +98 -0
- package/dist/barge-in/barge-in-module.d.ts +0 -1
- package/dist/barge-in/barge-in-module.js +0 -1
- package/dist/barge-in/barge-in-service.d.ts +1 -1
- package/dist/barge-in/barge-in-service.js +33 -2
- package/dist/barge-in/barge-in-strategy.d.ts +11 -9
- package/dist/barge-in/barge-in-strategy.js +39 -23
- package/dist/barge-in/echo-cancellation.d.ts +0 -1
- package/dist/barge-in/echo-cancellation.js +0 -1
- package/dist/barge-in/echo.d.ts +0 -1
- package/dist/barge-in/echo.js +0 -1
- package/dist/barge-in/lexicon.d.ts +0 -1
- package/dist/barge-in/lexicon.js +0 -1
- package/dist/barge-in/speech-ledger.d.ts +0 -2
- package/dist/barge-in/speech-ledger.js +3 -4
- package/dist/barge-in/word-classifier.d.ts +0 -1
- package/dist/barge-in/word-classifier.js +0 -1
- package/dist/call/asr-usage.d.ts +53 -0
- package/dist/call/asr-usage.js +42 -0
- package/dist/call/async.d.ts +2 -0
- package/dist/call/async.js +14 -0
- package/dist/call/env.d.ts +88 -0
- package/dist/call/env.js +294 -0
- package/dist/call/extraction/core.d.ts +99 -0
- package/dist/call/extraction/core.js +259 -0
- package/dist/call/extraction/defaults.d.ts +10 -0
- package/dist/call/extraction/defaults.js +25 -0
- package/dist/call/extraction/index.d.ts +7 -0
- package/dist/call/extraction/index.js +24 -0
- package/dist/call/extraction/orchestrator.d.ts +144 -0
- package/dist/call/extraction/orchestrator.js +309 -0
- package/dist/call/failed-leg.d.ts +43 -0
- package/dist/call/failed-leg.js +77 -0
- package/dist/call/http.d.ts +94 -0
- package/dist/call/http.js +145 -0
- package/dist/call/ledger.d.ts +18 -0
- package/dist/call/ledger.js +80 -0
- package/dist/call/llm-tap.d.ts +7 -0
- package/dist/call/llm-tap.js +41 -0
- package/dist/call/logging.d.ts +16 -0
- package/dist/call/logging.js +92 -0
- package/dist/call/outbound.d.ts +144 -0
- package/dist/call/outbound.js +404 -0
- package/dist/call/output.d.ts +108 -0
- package/dist/call/output.js +77 -0
- package/dist/call/plan.d.ts +119 -0
- package/dist/call/plan.js +2 -0
- package/dist/call/recall.d.ts +115 -0
- package/dist/call/recall.js +312 -0
- package/dist/call/records.d.ts +9 -0
- package/dist/call/records.js +71 -0
- package/dist/call/report.d.ts +65 -0
- package/dist/call/report.js +263 -0
- package/dist/call/sanitize.d.ts +16 -0
- package/dist/call/sanitize.js +72 -0
- package/dist/call/sip.d.ts +111 -0
- package/dist/call/sip.js +212 -0
- package/dist/call/voicemail.d.ts +159 -0
- package/dist/call/voicemail.js +246 -0
- package/dist/core/call-disposables.d.ts +2 -2
- package/dist/core/call-disposables.js +8 -3
- package/dist/core/call-ended-budget.d.ts +11 -0
- package/dist/core/call-ended-budget.js +31 -0
- package/dist/core/container.d.ts +1 -3
- package/dist/core/container.js +9 -49
- package/dist/core/create-agent-script.d.ts +6 -1
- package/dist/core/create-agent-script.js +161 -28
- package/dist/core/decorators.d.ts +0 -1
- package/dist/core/decorators.js +0 -1
- package/dist/core/define-module.d.ts +0 -1
- package/dist/core/define-module.js +0 -1
- package/dist/core/dump-policy.d.ts +0 -1
- package/dist/core/dump-policy.js +0 -1
- package/dist/core/hooks.d.ts +15 -4
- package/dist/core/hooks.js +0 -1
- package/dist/core/media-bootstrap.d.ts +19 -4
- package/dist/core/media-bootstrap.js +53 -13
- package/dist/core/open-timeout.d.ts +12 -0
- package/dist/core/open-timeout.js +48 -0
- package/dist/core/provide-media.d.ts +0 -8
- package/dist/core/provide-media.js +1 -22
- package/dist/core/runtime-events.d.ts +28 -0
- package/dist/{llm/llm-module.js → core/runtime-events.js} +19 -16
- package/dist/core/tokens.d.ts +0 -10
- package/dist/core/tokens.js +0 -1
- package/dist/core/types.d.ts +0 -1
- package/dist/core/types.js +0 -1
- package/dist/core/version.d.ts +2 -3
- package/dist/core/version.js +2 -3
- package/dist/dialog/dialog-definition.d.ts +0 -5
- package/dist/dialog/dialog-definition.js +1 -6
- package/dist/dialog/dialog-ports.d.ts +3 -1
- package/dist/dialog/dialog-ports.js +10 -2
- package/dist/dialog/online-call-host.d.ts +26 -4
- package/dist/dialog/online-call-host.js +94 -12
- package/dist/dialog/online-call-module.d.ts +5 -11
- package/dist/dialog/online-call-module.js +4 -36
- package/dist/dialog/turn-metrics.d.ts +46 -0
- package/dist/dialog/turn-metrics.js +141 -0
- package/dist/dialog-events/active-media.d.ts +50 -2
- package/dist/dialog-events/active-media.js +146 -34
- package/dist/dialog-events/event-source.d.ts +0 -1
- package/dist/dialog-events/event-source.js +0 -1
- package/dist/dialog-events/virtual-finals-module.d.ts +0 -1
- package/dist/dialog-events/virtual-finals-module.js +0 -1
- package/dist/dialog-events/virtual-finals.d.ts +2 -1
- package/dist/dialog-events/virtual-finals.js +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.js +8 -26
- package/dist/lifecycle/lifecycle.d.ts +25 -3
- package/dist/lifecycle/lifecycle.js +92 -14
- package/dist/result/result-store.d.ts +0 -1
- package/dist/result/result-store.js +0 -1
- package/dist/templates/authoring.d.ts +222 -0
- package/dist/templates/authoring.js +2 -0
- package/dist/templates/builder/agent.d.ts +34 -0
- package/dist/templates/builder/agent.js +87 -0
- package/dist/templates/builder/blocks.d.ts +54 -0
- package/dist/templates/builder/blocks.js +92 -0
- package/dist/templates/builder/data-check.d.ts +2 -0
- package/dist/templates/builder/data-check.js +61 -0
- package/dist/templates/builder/draft.d.ts +73 -0
- package/dist/templates/builder/draft.js +142 -0
- package/dist/templates/builder/index.d.ts +8 -0
- package/dist/templates/builder/index.js +55 -0
- package/dist/templates/builder/presets.d.ts +34 -0
- package/dist/templates/builder/presets.js +45 -0
- package/dist/templates/builder/spec-of.d.ts +13 -0
- package/dist/templates/builder/spec-of.js +18 -0
- package/dist/templates/builder/steps.d.ts +25 -0
- package/dist/templates/builder/steps.js +27 -0
- package/dist/templates/business/adapter.d.ts +12 -0
- package/dist/templates/business/adapter.js +980 -0
- package/dist/templates/business/agent-integrations.d.ts +24 -0
- package/dist/templates/business/agent-integrations.js +233 -0
- package/dist/templates/business/extraction-rules-transcript.d.ts +158 -0
- package/dist/templates/business/extraction-rules-transcript.js +405 -0
- package/dist/templates/business/extraction-rules.d.ts +107 -0
- package/dist/templates/business/extraction-rules.js +267 -0
- package/dist/templates/business/index.d.ts +6 -0
- package/dist/{result → templates/business}/index.js +8 -2
- package/dist/templates/business/input.d.ts +56 -0
- package/dist/templates/business/input.js +299 -0
- package/dist/templates/business/integration-data.d.ts +87 -0
- package/dist/templates/business/integration-data.js +312 -0
- package/dist/templates/business/integrations.d.ts +76 -0
- package/dist/templates/business/integrations.js +535 -0
- package/dist/templates/business/legs-policy.d.ts +43 -0
- package/dist/templates/business/legs-policy.js +268 -0
- package/dist/templates/business/report-label.d.ts +7 -0
- package/dist/templates/business/report-label.js +29 -0
- package/dist/templates/business/report.d.ts +67 -0
- package/dist/templates/business/report.js +284 -0
- package/dist/templates/business/result-catalog.d.ts +142 -0
- package/dist/templates/business/result-catalog.js +208 -0
- package/dist/templates/business/result-rules.d.ts +105 -0
- package/dist/templates/business/result-rules.js +167 -0
- package/dist/templates/business/results.d.ts +73 -0
- package/dist/templates/business/results.js +183 -0
- package/dist/templates/business/rule-env.d.ts +18 -0
- package/dist/templates/business/rule-env.js +38 -0
- package/dist/templates/business/sources.d.ts +76 -0
- package/dist/templates/business/sources.js +239 -0
- package/dist/templates/business/test-presets.d.ts +10 -0
- package/dist/templates/business/test-presets.js +68 -0
- package/dist/templates/catalog-match/block.d.ts +32 -0
- package/dist/templates/catalog-match/block.js +95 -0
- package/dist/templates/catalog-match/catalog.d.ts +77 -0
- package/dist/templates/catalog-match/catalog.js +222 -0
- package/dist/templates/catalog-match/recognizer.d.ts +44 -0
- package/dist/templates/catalog-match/recognizer.js +206 -0
- package/dist/templates/catalog-match/reconcile.d.ts +4 -0
- package/dist/templates/catalog-match/reconcile.js +39 -0
- package/dist/templates/catalog-match/request.d.ts +57 -0
- package/dist/templates/catalog-match/request.js +139 -0
- package/dist/templates/catalog-match/types.d.ts +197 -0
- package/dist/templates/catalog-match/types.js +2 -0
- package/dist/templates/catalog-match/verify.d.ts +76 -0
- package/dist/templates/catalog-match/verify.js +220 -0
- package/dist/templates/decision-model/index.d.ts +52 -0
- package/dist/templates/decision-model/index.js +68 -0
- package/dist/templates/engine/asr-picks.d.ts +11 -0
- package/dist/templates/engine/asr-picks.js +44 -0
- package/dist/templates/engine/call.d.ts +104 -0
- package/dist/templates/engine/call.js +322 -0
- package/dist/templates/engine/config.d.ts +447 -0
- package/dist/templates/engine/config.js +493 -0
- package/dist/templates/engine/define.d.ts +1 -0
- package/dist/templates/engine/define.js +9 -0
- package/dist/templates/engine/dialog.d.ts +253 -0
- package/dist/templates/engine/dialog.js +167 -0
- package/dist/templates/engine/echo-numbers.d.ts +7 -0
- package/dist/templates/engine/echo-numbers.js +19 -0
- package/dist/templates/engine/expand.d.ts +6 -0
- package/dist/templates/engine/expand.js +125 -0
- package/dist/templates/engine/filters.d.ts +81 -0
- package/dist/templates/engine/filters.js +654 -0
- package/dist/templates/engine/hook-state.d.ts +18 -0
- package/dist/templates/engine/hook-state.js +100 -0
- package/dist/templates/engine/hooks.d.ts +51 -0
- package/dist/templates/engine/hooks.js +310 -0
- package/dist/templates/engine/index.d.ts +13 -0
- package/dist/templates/engine/index.js +30 -0
- package/dist/templates/engine/language-vars.d.ts +6 -0
- package/dist/templates/engine/language-vars.js +40 -0
- package/dist/templates/engine/language.d.ts +32 -0
- package/dist/templates/engine/language.js +155 -0
- package/dist/templates/engine/lookup.d.ts +20 -0
- package/dist/templates/engine/lookup.js +52 -0
- package/dist/templates/engine/match.d.ts +48 -0
- package/dist/templates/engine/match.js +253 -0
- package/dist/templates/engine/media.d.ts +428 -0
- package/dist/templates/engine/media.js +1240 -0
- package/dist/templates/engine/script.d.ts +11 -0
- package/dist/templates/engine/script.js +69 -0
- package/dist/templates/engine/turns/actions.d.ts +5 -0
- package/dist/templates/engine/turns/actions.js +128 -0
- package/dist/templates/engine/turns/carry.d.ts +15 -0
- package/dist/templates/engine/turns/carry.js +74 -0
- package/dist/templates/engine/turns/choices-offers.d.ts +21 -0
- package/dist/templates/engine/turns/choices-offers.js +143 -0
- package/dist/templates/engine/turns/choices.d.ts +22 -0
- package/dist/templates/engine/turns/choices.js +141 -0
- package/dist/templates/engine/turns/closing-guard.d.ts +73 -0
- package/dist/templates/engine/turns/closing-guard.js +162 -0
- package/dist/templates/engine/turns/closing.d.ts +10 -0
- package/dist/templates/engine/turns/closing.js +82 -0
- package/dist/templates/engine/turns/compile-forms.d.ts +24 -0
- package/dist/templates/engine/turns/compile-forms.js +68 -0
- package/dist/templates/engine/turns/context.d.ts +96 -0
- package/dist/templates/engine/turns/context.js +158 -0
- package/dist/templates/engine/turns/events.d.ts +409 -0
- package/dist/templates/engine/turns/events.js +5 -0
- package/dist/templates/engine/turns/hook-forms.d.ts +62 -0
- package/dist/templates/engine/turns/hook-forms.js +79 -0
- package/dist/templates/engine/turns/ladders.d.ts +42 -0
- package/dist/templates/engine/turns/ladders.js +119 -0
- package/dist/templates/engine/turns/language.d.ts +8 -0
- package/dist/templates/engine/turns/language.js +121 -0
- package/dist/templates/engine/turns/notes-dates.d.ts +9 -0
- package/dist/templates/engine/turns/notes-dates.js +42 -0
- package/dist/templates/engine/turns/notes-detect.d.ts +13 -0
- package/dist/templates/engine/turns/notes-detect.js +36 -0
- package/dist/templates/engine/turns/notes.d.ts +27 -0
- package/dist/templates/engine/turns/notes.js +176 -0
- package/dist/templates/engine/turns/opening.d.ts +34 -0
- package/dist/templates/engine/turns/opening.js +306 -0
- package/dist/templates/engine/turns/overtalk.d.ts +21 -0
- package/dist/templates/engine/turns/overtalk.js +247 -0
- package/dist/templates/engine/turns/pending.d.ts +9 -0
- package/dist/templates/engine/turns/pending.js +88 -0
- package/dist/templates/engine/turns/reply-rules.d.ts +184 -0
- package/dist/templates/engine/turns/reply-rules.js +335 -0
- package/dist/templates/engine/turns/rules.d.ts +20 -0
- package/dist/templates/engine/turns/rules.js +144 -0
- package/dist/templates/engine/turns/silence.d.ts +7 -0
- package/dist/templates/engine/turns/silence.js +127 -0
- package/dist/templates/engine/turns/state-spec.d.ts +305 -0
- package/dist/templates/engine/turns/state-spec.js +2 -0
- package/dist/templates/engine/turns/state.d.ts +38 -0
- package/dist/templates/engine/turns/state.js +101 -0
- package/dist/templates/engine/turns/tracking.d.ts +50 -0
- package/dist/templates/engine/turns/tracking.js +184 -0
- package/dist/templates/engine/turns/transfer.d.ts +19 -0
- package/dist/templates/engine/turns/transfer.js +93 -0
- package/dist/templates/engine/turns/turn.d.ts +17 -0
- package/dist/templates/engine/turns/turn.js +363 -0
- package/dist/templates/engine/turns/voicemail.d.ts +8 -0
- package/dist/templates/engine/turns/voicemail.js +101 -0
- package/dist/templates/engine/variants.d.ts +36 -0
- package/dist/templates/engine/variants.js +159 -0
- package/dist/templates/engine/voice-dialog.d.ts +24 -0
- package/dist/templates/engine/voice-dialog.js +157 -0
- package/dist/templates/engine/voice.d.ts +174 -0
- package/dist/templates/engine/voice.js +1337 -0
- package/dist/templates/expr/caller-after.d.ts +20 -0
- package/dist/templates/expr/caller-after.js +53 -0
- package/dist/templates/expr/check.d.ts +19 -0
- package/dist/templates/expr/check.js +314 -0
- package/dist/templates/expr/compiled.d.ts +8 -0
- package/dist/templates/expr/compiled.js +8 -0
- package/dist/templates/expr/context.d.ts +28 -0
- package/dist/templates/expr/context.js +55 -0
- package/dist/templates/expr/day-table.d.ts +4 -0
- package/dist/templates/expr/day-table.js +80 -0
- package/dist/templates/expr/evaluate.d.ts +26 -0
- package/dist/templates/expr/evaluate.js +885 -0
- package/dist/templates/expr/facts.d.ts +7 -0
- package/dist/templates/expr/facts.js +81 -0
- package/dist/templates/expr/index.d.ts +4 -0
- package/dist/templates/expr/index.js +11 -0
- package/dist/templates/expr/line-tally.d.ts +64 -0
- package/dist/templates/expr/line-tally.js +88 -0
- package/dist/templates/expr/matchers-state.d.ts +23 -0
- package/dist/templates/expr/matchers-state.js +37 -0
- package/dist/templates/expr/matchers.d.ts +12 -0
- package/dist/templates/expr/matchers.js +99 -0
- package/dist/templates/expr/readers.d.ts +14 -0
- package/dist/templates/expr/readers.js +351 -0
- package/dist/templates/expr/slots.d.ts +14 -0
- package/dist/templates/expr/slots.js +678 -0
- package/dist/templates/expr/template.d.ts +12 -0
- package/dist/templates/expr/template.js +76 -0
- package/dist/templates/expr/test-call.d.ts +8 -0
- package/dist/templates/expr/test-call.js +32 -0
- package/dist/templates/expr/transcript.d.ts +36 -0
- package/dist/templates/expr/transcript.js +394 -0
- package/dist/templates/expr/types.d.ts +1011 -0
- package/dist/templates/expr/types.js +2 -0
- package/dist/templates/expr/values.d.ts +42 -0
- package/dist/templates/expr/values.js +166 -0
- package/dist/templates/expr/voice-ops.d.ts +26 -0
- package/dist/templates/expr/voice-ops.js +85 -0
- package/dist/templates/helpers/decision.d.ts +55 -0
- package/dist/templates/helpers/decision.js +83 -0
- package/dist/templates/helpers/fuzzy.d.ts +9 -0
- package/dist/templates/helpers/fuzzy.js +44 -0
- package/dist/templates/helpers/index.d.ts +6 -0
- package/dist/templates/helpers/index.js +35 -0
- package/dist/templates/index.d.ts +9 -0
- package/dist/templates/index.js +68 -0
- package/dist/templates/integration-forms.d.ts +252 -0
- package/dist/templates/integration-forms.js +2 -0
- package/dist/templates/knowledge/block.d.ts +44 -0
- package/dist/templates/knowledge/block.js +199 -0
- package/dist/templates/knowledge/dense.d.ts +87 -0
- package/dist/templates/knowledge/dense.js +158 -0
- package/dist/templates/knowledge/flow.d.ts +328 -0
- package/dist/templates/knowledge/flow.js +509 -0
- package/dist/templates/knowledge/retriever.d.ts +75 -0
- package/dist/templates/knowledge/retriever.js +204 -0
- package/dist/templates/knowledge/service.d.ts +77 -0
- package/dist/templates/knowledge/service.js +316 -0
- package/dist/templates/knowledge/text.d.ts +31 -0
- package/dist/templates/knowledge/text.js +66 -0
- package/dist/templates/knowledge/types.d.ts +120 -0
- package/dist/templates/knowledge/types.js +2 -0
- package/dist/templates/locale.d.ts +259 -0
- package/dist/templates/locale.js +4 -0
- package/dist/templates/locales/en-lexicons.d.ts +9 -0
- package/dist/templates/locales/en-lexicons.js +101 -0
- package/dist/templates/locales/en.d.ts +132 -0
- package/dist/templates/locales/en.js +261 -0
- package/dist/templates/locales/es.d.ts +65 -0
- package/dist/templates/locales/es.js +208 -0
- package/dist/templates/locales/hi.d.ts +47 -0
- package/dist/templates/locales/hi.js +235 -0
- package/dist/templates/locales/id.d.ts +43 -0
- package/dist/templates/locales/id.js +127 -0
- package/dist/templates/locales/index.d.ts +34 -0
- package/dist/templates/locales/index.js +112 -0
- package/dist/templates/locales/kk-lexicons.d.ts +22 -0
- package/dist/templates/locales/kk-lexicons.js +89 -0
- package/dist/templates/locales/kk.d.ts +140 -0
- package/dist/templates/locales/kk.js +306 -0
- package/dist/templates/locales/kn.d.ts +29 -0
- package/dist/templates/locales/kn.js +22 -0
- package/dist/templates/locales/listen-only.d.ts +15 -0
- package/dist/templates/locales/listen-only.js +27 -0
- package/dist/templates/locales/ms-lexicons.d.ts +13 -0
- package/dist/templates/locales/ms-lexicons.js +113 -0
- package/dist/templates/locales/ms.d.ts +76 -0
- package/dist/templates/locales/ms.js +179 -0
- package/dist/templates/locales/parse.d.ts +86 -0
- package/dist/templates/locales/parse.js +461 -0
- package/dist/templates/locales/ru-lexicons.d.ts +27 -0
- package/dist/templates/locales/ru-lexicons.js +127 -0
- package/dist/templates/locales/ru-stem.d.ts +2 -0
- package/dist/templates/locales/ru-stem.js +53 -0
- package/dist/templates/locales/ru.d.ts +143 -0
- package/dist/templates/locales/ru.js +387 -0
- package/dist/templates/locales/shared.d.ts +122 -0
- package/dist/templates/locales/shared.js +318 -0
- package/dist/templates/locales/ta.d.ts +29 -0
- package/dist/templates/locales/ta.js +22 -0
- package/dist/templates/locales/te.d.ts +29 -0
- package/dist/templates/locales/te.js +22 -0
- package/dist/templates/locales/tl-lexicons.d.ts +2 -0
- package/dist/templates/locales/tl-lexicons.js +230 -0
- package/dist/templates/locales/tl.d.ts +59 -0
- package/dist/templates/locales/tl.js +82 -0
- package/dist/templates/locales/vi.d.ts +59 -0
- package/dist/templates/locales/vi.js +160 -0
- package/dist/templates/locales/word-regex.d.ts +13 -0
- package/dist/templates/locales/word-regex.js +43 -0
- package/dist/templates/locales/words-kk.d.ts +2 -0
- package/dist/templates/locales/words-kk.js +23 -0
- package/dist/templates/locales/words-ru.d.ts +4 -0
- package/dist/templates/locales/words-ru.js +92 -0
- package/dist/templates/spec.d.ts +2856 -0
- package/dist/templates/spec.js +2 -0
- package/dist/testing/fake-channel.d.ts +0 -1
- package/dist/testing/fake-channel.js +0 -1
- package/dist/testing/index.d.ts +24 -1
- package/dist/testing/index.js +117 -2
- package/dist/voice/call-voice.d.ts +581 -0
- package/dist/voice/call-voice.js +1399 -0
- package/dist/voice/intent-interrupt.d.ts +32 -0
- package/dist/voice/intent-interrupt.js +91 -0
- package/dist/voice/self-echo.d.ts +28 -0
- package/dist/voice/self-echo.js +135 -0
- package/dist/voice/sentence-tag.d.ts +5 -0
- package/dist/voice/sentence-tag.js +42 -0
- package/dist/voice/speech-leak.d.ts +74 -0
- package/dist/voice/speech-leak.js +216 -0
- package/dist/voice/transfer.d.ts +90 -0
- package/dist/voice/transfer.js +331 -0
- package/dist/voice/turn-timing.d.ts +293 -0
- package/dist/voice/turn-timing.js +567 -0
- package/docs/README.md +3 -6
- package/docs/framework/README.md +6 -10
- package/docs/framework/architecture.md +2 -2
- package/docs/framework/container-and-di.md +1 -2
- package/docs/framework/invariants.md +6 -6
- package/docs/framework/package-layout.md +17 -23
- package/docs/framework/testing.md +8 -6
- package/package.json +22 -55
- package/skill/AGENTS.md +43 -0
- package/skill/AGENTS.recommend.md +27 -0
- package/skill/SKILL.md +100 -0
- package/skill/references/agent-file.md +230 -0
- package/skill/references/blocks.md +246 -0
- package/skill/references/builder.md +163 -0
- package/skill/references/business.md +659 -0
- package/skill/references/conversation.md +586 -0
- package/skill/references/core.md +89 -0
- package/skill/references/examples.md +73 -0
- package/skill/references/expressions.md +342 -0
- package/skill/references/format.md +114 -0
- package/skill/references/library-dev.md +84 -0
- package/skill/references/locales.md +149 -0
- package/skill/references/migration.md +133 -0
- package/skill/references/new-agent.md +170 -0
- package/skill/references/porting.md +165 -0
- package/templates/agent/README.md +55 -0
- package/templates/agent/package.json +24 -0
- package/templates/agent/src/agent.spec.ts +51 -0
- package/templates/agent/src/agent.ts +268 -0
- package/templates/agent/src/entities.ts +44 -0
- package/templates/agent/src/prompt.sqrl +21 -0
- package/templates/agent/src/variants/fixed-opening.ts +144 -0
- package/templates/agent/tsconfig.build.json +4 -0
- package/templates/agent/tsconfig.json +18 -0
- package/dist/asr/index.d.ts +0 -3
- package/dist/asr/index.d.ts.map +0 -1
- package/dist/asr/index.js +0 -6
- package/dist/asr/index.js.map +0 -1
- package/dist/barge-in/barge-in-module.d.ts.map +0 -1
- package/dist/barge-in/barge-in-module.js.map +0 -1
- package/dist/barge-in/barge-in-service.d.ts.map +0 -1
- package/dist/barge-in/barge-in-service.js.map +0 -1
- package/dist/barge-in/barge-in-strategy.d.ts.map +0 -1
- package/dist/barge-in/barge-in-strategy.js.map +0 -1
- package/dist/barge-in/echo-cancellation.d.ts.map +0 -1
- package/dist/barge-in/echo-cancellation.js.map +0 -1
- package/dist/barge-in/echo.d.ts.map +0 -1
- package/dist/barge-in/echo.js.map +0 -1
- package/dist/barge-in/index.d.ts +0 -13
- package/dist/barge-in/index.d.ts.map +0 -1
- package/dist/barge-in/index.js +0 -28
- package/dist/barge-in/index.js.map +0 -1
- package/dist/barge-in/lexicon.d.ts.map +0 -1
- package/dist/barge-in/lexicon.js.map +0 -1
- package/dist/barge-in/lexicons/en.d.ts +0 -2
- package/dist/barge-in/lexicons/en.d.ts.map +0 -1
- package/dist/barge-in/lexicons/en.js +0 -36
- package/dist/barge-in/lexicons/en.js.map +0 -1
- package/dist/barge-in/lexicons/id.d.ts +0 -2
- package/dist/barge-in/lexicons/id.d.ts.map +0 -1
- package/dist/barge-in/lexicons/id.js +0 -39
- package/dist/barge-in/lexicons/id.js.map +0 -1
- package/dist/barge-in/lexicons/index.d.ts +0 -10
- package/dist/barge-in/lexicons/index.d.ts.map +0 -1
- package/dist/barge-in/lexicons/index.js +0 -11
- package/dist/barge-in/lexicons/index.js.map +0 -1
- package/dist/barge-in/lexicons/ru.d.ts +0 -2
- package/dist/barge-in/lexicons/ru.d.ts.map +0 -1
- package/dist/barge-in/lexicons/ru.js +0 -39
- package/dist/barge-in/lexicons/ru.js.map +0 -1
- package/dist/barge-in/speech-ledger.d.ts.map +0 -1
- package/dist/barge-in/speech-ledger.js.map +0 -1
- package/dist/barge-in/word-classifier.d.ts.map +0 -1
- package/dist/barge-in/word-classifier.js.map +0 -1
- package/dist/bridge/bridge.d.ts +0 -28
- package/dist/bridge/bridge.d.ts.map +0 -1
- package/dist/bridge/bridge.js +0 -117
- package/dist/bridge/bridge.js.map +0 -1
- package/dist/bridge/index.d.ts +0 -3
- package/dist/bridge/index.d.ts.map +0 -1
- package/dist/bridge/index.js +0 -8
- package/dist/bridge/index.js.map +0 -1
- package/dist/core/call-disposables.d.ts.map +0 -1
- package/dist/core/call-disposables.js.map +0 -1
- package/dist/core/container.d.ts.map +0 -1
- package/dist/core/container.js.map +0 -1
- package/dist/core/create-agent-script.d.ts.map +0 -1
- package/dist/core/create-agent-script.js.map +0 -1
- package/dist/core/decorators.d.ts.map +0 -1
- package/dist/core/decorators.js.map +0 -1
- package/dist/core/define-module.d.ts.map +0 -1
- package/dist/core/define-module.js.map +0 -1
- package/dist/core/dump-policy.d.ts.map +0 -1
- package/dist/core/dump-policy.js.map +0 -1
- package/dist/core/hooks.d.ts.map +0 -1
- package/dist/core/hooks.js.map +0 -1
- package/dist/core/index.d.ts +0 -16
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -36
- package/dist/core/index.js.map +0 -1
- package/dist/core/media-bootstrap.d.ts.map +0 -1
- package/dist/core/media-bootstrap.js.map +0 -1
- package/dist/core/provide-media.d.ts.map +0 -1
- package/dist/core/provide-media.js.map +0 -1
- package/dist/core/tokens.d.ts.map +0 -1
- package/dist/core/tokens.js.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js.map +0 -1
- package/dist/core/version.d.ts.map +0 -1
- package/dist/core/version.js.map +0 -1
- package/dist/dialog/basic-ports.d.ts +0 -54
- package/dist/dialog/basic-ports.d.ts.map +0 -1
- package/dist/dialog/basic-ports.js +0 -206
- package/dist/dialog/basic-ports.js.map +0 -1
- package/dist/dialog/define-dialog.d.ts +0 -21
- package/dist/dialog/define-dialog.d.ts.map +0 -1
- package/dist/dialog/define-dialog.js +0 -21
- package/dist/dialog/define-dialog.js.map +0 -1
- package/dist/dialog/dialog-definition.d.ts.map +0 -1
- package/dist/dialog/dialog-definition.js.map +0 -1
- package/dist/dialog/dialog-ports.d.ts.map +0 -1
- package/dist/dialog/dialog-ports.js.map +0 -1
- package/dist/dialog/index.d.ts +0 -7
- package/dist/dialog/index.d.ts.map +0 -1
- package/dist/dialog/index.js +0 -23
- package/dist/dialog/index.js.map +0 -1
- package/dist/dialog/online-call-host.d.ts.map +0 -1
- package/dist/dialog/online-call-host.js.map +0 -1
- package/dist/dialog/online-call-module.d.ts.map +0 -1
- package/dist/dialog/online-call-module.js.map +0 -1
- package/dist/dialog-events/active-media.d.ts.map +0 -1
- package/dist/dialog-events/active-media.js.map +0 -1
- package/dist/dialog-events/event-source.d.ts.map +0 -1
- package/dist/dialog-events/event-source.js.map +0 -1
- package/dist/dialog-events/index.d.ts +0 -8
- package/dist/dialog-events/index.d.ts.map +0 -1
- package/dist/dialog-events/index.js +0 -24
- package/dist/dialog-events/index.js.map +0 -1
- package/dist/dialog-events/max-listen-source.d.ts +0 -27
- package/dist/dialog-events/max-listen-source.d.ts.map +0 -1
- package/dist/dialog-events/max-listen-source.js +0 -98
- package/dist/dialog-events/max-listen-source.js.map +0 -1
- package/dist/dialog-events/overtalk-source.d.ts +0 -61
- package/dist/dialog-events/overtalk-source.d.ts.map +0 -1
- package/dist/dialog-events/overtalk-source.js +0 -232
- package/dist/dialog-events/overtalk-source.js.map +0 -1
- package/dist/dialog-events/silence-source.d.ts +0 -32
- package/dist/dialog-events/silence-source.d.ts.map +0 -1
- package/dist/dialog-events/silence-source.js +0 -128
- package/dist/dialog-events/silence-source.js.map +0 -1
- package/dist/dialog-events/virtual-finals-module.d.ts.map +0 -1
- package/dist/dialog-events/virtual-finals-module.js.map +0 -1
- package/dist/dialog-events/virtual-finals.d.ts.map +0 -1
- package/dist/dialog-events/virtual-finals.js.map +0 -1
- package/dist/dtmf/dtmf.d.ts +0 -27
- package/dist/dtmf/dtmf.d.ts.map +0 -1
- package/dist/dtmf/dtmf.js +0 -87
- package/dist/dtmf/dtmf.js.map +0 -1
- package/dist/dtmf/index.d.ts +0 -3
- package/dist/dtmf/index.d.ts.map +0 -1
- package/dist/dtmf/index.js +0 -8
- package/dist/dtmf/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lifecycle/index.d.ts +0 -3
- package/dist/lifecycle/index.d.ts.map +0 -1
- package/dist/lifecycle/index.js +0 -9
- package/dist/lifecycle/index.js.map +0 -1
- package/dist/lifecycle/lifecycle.d.ts.map +0 -1
- package/dist/lifecycle/lifecycle.js.map +0 -1
- package/dist/llm/index.d.ts +0 -7
- package/dist/llm/index.d.ts.map +0 -1
- package/dist/llm/index.js +0 -18
- package/dist/llm/index.js.map +0 -1
- package/dist/llm/llm-markers-module.d.ts +0 -15
- package/dist/llm/llm-markers-module.d.ts.map +0 -1
- package/dist/llm/llm-markers-module.js +0 -48
- package/dist/llm/llm-markers-module.js.map +0 -1
- package/dist/llm/llm-markers.d.ts +0 -36
- package/dist/llm/llm-markers.d.ts.map +0 -1
- package/dist/llm/llm-markers.js +0 -210
- package/dist/llm/llm-markers.js.map +0 -1
- package/dist/llm/llm-module.d.ts +0 -20
- package/dist/llm/llm-module.d.ts.map +0 -1
- package/dist/llm/llm-module.js.map +0 -1
- package/dist/match/index.d.ts +0 -3
- package/dist/match/index.d.ts.map +0 -1
- package/dist/match/index.js +0 -10
- package/dist/match/index.js.map +0 -1
- package/dist/match/match.d.ts +0 -33
- package/dist/match/match.d.ts.map +0 -1
- package/dist/match/match.js +0 -85
- package/dist/match/match.js.map +0 -1
- package/dist/outbound/index.d.ts +0 -3
- package/dist/outbound/index.d.ts.map +0 -1
- package/dist/outbound/index.js +0 -8
- package/dist/outbound/index.js.map +0 -1
- package/dist/outbound/outbound.d.ts +0 -40
- package/dist/outbound/outbound.d.ts.map +0 -1
- package/dist/outbound/outbound.js +0 -84
- package/dist/outbound/outbound.js.map +0 -1
- package/dist/result/index.d.ts +0 -2
- package/dist/result/index.d.ts.map +0 -1
- package/dist/result/index.js.map +0 -1
- package/dist/result/result-store.d.ts.map +0 -1
- package/dist/result/result-store.js.map +0 -1
- package/dist/testing/fake-channel.d.ts.map +0 -1
- package/dist/testing/fake-channel.js.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js.map +0 -1
- package/docs/agents/README.md +0 -41
- package/docs/agents/barge-in.md +0 -67
- package/docs/agents/dialog.md +0 -98
- package/docs/agents/getting-started.md +0 -142
- package/docs/agents/imports.md +0 -40
- package/docs/agents/media-and-ports.md +0 -82
- package/docs/agents/modules.md +0 -83
- package/docs/agents/phases.md +0 -83
- package/docs/framework/extending.md +0 -59
- package/docs/framework/idn-parity.md +0 -18
- package/examples/minimal-agent/README.md +0 -7
- package/examples/minimal-agent/agent.ts +0 -94
|
@@ -16,12 +16,25 @@ const rxjs_1 = require("rxjs");
|
|
|
16
16
|
exports.ACTIVE_ASR$ = 'ACTIVE_ASR$';
|
|
17
17
|
exports.ACTIVE_TTS$ = 'ACTIVE_TTS$';
|
|
18
18
|
exports.ACTIVE_FINALS$ = 'ACTIVE_FINALS$';
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Optional `{ fillerPattern?: RegExp; minPeakVad?: number; minPeakVadExcept?: RegExp[]; minPeakVadOver?: 'line' }`
|
|
21
|
+
* registered by the agent (`minPeakVadOver: 'line'`: the peak of everything heard since the previous final counts too).
|
|
22
|
+
*/
|
|
20
23
|
exports.ASR_RESULT_FILTERS = 'ASR_RESULT_FILTERS';
|
|
21
24
|
/**
|
|
22
25
|
* Current ASR/TTS for the call. setAsr attaches barge when BargeInService is present.
|
|
23
26
|
*/
|
|
24
27
|
let ActiveMedia = class ActiveMedia {
|
|
28
|
+
/**
|
|
29
|
+
* The agent finished a turn that put nothing on the queue (empty or failed LLM reply): no `queueEmpty$`
|
|
30
|
+
* will come, so listeners that wait for the agent to go quiet (silence) take this instead.
|
|
31
|
+
*/
|
|
32
|
+
markAgentIdle() {
|
|
33
|
+
this.agentIdleSubject.next();
|
|
34
|
+
}
|
|
35
|
+
get agentIdle$() {
|
|
36
|
+
return this.agentIdleSubject.asObservable();
|
|
37
|
+
}
|
|
25
38
|
/**
|
|
26
39
|
* Constructed by createCallContainer (not resolved), so collaborators are passed in.
|
|
27
40
|
* BargeInService is present only when BargeInModule is imported.
|
|
@@ -39,7 +52,19 @@ let ActiveMedia = class ActiveMedia {
|
|
|
39
52
|
this.vfStrategy = virtual_finals_1.VirtualFinalsStrategy.off();
|
|
40
53
|
this.finalsShared = null;
|
|
41
54
|
this.minPeakVad = 0;
|
|
55
|
+
/** Finals kept below {@link minPeakVad} (short quiet answers). */
|
|
56
|
+
this.minPeakVadExcept = [];
|
|
42
57
|
this.segmentPeak = 0;
|
|
58
|
+
/** Peak since the previous final, when the peak counts over the whole line. */
|
|
59
|
+
this.peakOverLine = false;
|
|
60
|
+
this.linePeak = 0;
|
|
61
|
+
this.userSpeakingSubject = new rxjs_1.BehaviorSubject(false);
|
|
62
|
+
this.lastPartialText = '';
|
|
63
|
+
this.lastSpeechEndAt = null;
|
|
64
|
+
this.agentIdleSubject = new rxjs_1.Subject();
|
|
65
|
+
this.droppedSubject = new rxjs_1.Subject();
|
|
66
|
+
this.suppressedSubject = new rxjs_1.Subject();
|
|
67
|
+
this.bargeInBlocked = null;
|
|
43
68
|
this.agentQueue = 1;
|
|
44
69
|
}
|
|
45
70
|
/** Called from createCallContainer when VirtualFinalsModule is loaded. */
|
|
@@ -51,8 +76,49 @@ let ActiveMedia = class ActiveMedia {
|
|
|
51
76
|
setResultFilters(opts) {
|
|
52
77
|
this.fillerPattern = opts.fillerPattern;
|
|
53
78
|
this.minPeakVad = opts.minPeakVad ?? 0;
|
|
79
|
+
this.minPeakVadExcept = opts.minPeakVadExcept ?? [];
|
|
80
|
+
this.peakOverLine = opts.minPeakVadOver === 'line';
|
|
54
81
|
this.finalsShared = null;
|
|
55
82
|
}
|
|
83
|
+
/** True between VAD speechStart and speechEnd of the active ASR. */
|
|
84
|
+
get userSpeaking() {
|
|
85
|
+
return this.userSpeakingSubject.value;
|
|
86
|
+
}
|
|
87
|
+
get userSpeaking$() {
|
|
88
|
+
return this.userSpeakingSubject.asObservable();
|
|
89
|
+
}
|
|
90
|
+
/** Last ASR partial of the current / previous utterance. */
|
|
91
|
+
get lastPartial() {
|
|
92
|
+
return this.lastPartialText;
|
|
93
|
+
}
|
|
94
|
+
/** Epoch ms of the last VAD speech end, for turn metrics. */
|
|
95
|
+
get speechEndAt() {
|
|
96
|
+
return this.lastSpeechEndAt;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Resolve when the caller is not speaking, or after `maxMs`.
|
|
100
|
+
* Used before queueing a reply so the agent never starts over the caller.
|
|
101
|
+
*/
|
|
102
|
+
waitUserQuiet(maxMs) {
|
|
103
|
+
if (!this.userSpeaking || maxMs <= 0)
|
|
104
|
+
return Promise.resolve();
|
|
105
|
+
return new Promise((resolve) => {
|
|
106
|
+
let done = false;
|
|
107
|
+
const finish = () => {
|
|
108
|
+
if (done)
|
|
109
|
+
return;
|
|
110
|
+
done = true;
|
|
111
|
+
clearTimeout(timer);
|
|
112
|
+
sub.unsubscribe();
|
|
113
|
+
resolve();
|
|
114
|
+
};
|
|
115
|
+
const timer = setTimeout(finish, maxMs);
|
|
116
|
+
const sub = this.userSpeakingSubject.subscribe((speaking) => {
|
|
117
|
+
if (!speaking)
|
|
118
|
+
finish();
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
56
122
|
get asr$() {
|
|
57
123
|
return this.asrSubject.asObservable();
|
|
58
124
|
}
|
|
@@ -78,11 +144,24 @@ let ActiveMedia = class ActiveMedia {
|
|
|
78
144
|
this.watchPeak(asr);
|
|
79
145
|
return (0, virtual_finals_1.applyVirtualFinals)(asr, this.vfStrategy, {
|
|
80
146
|
finalizeOnSpeechEnd: false,
|
|
147
|
+
onSuppressed: (t) => this.suppressedSubject.next(t),
|
|
81
148
|
}).pipe((0, rxjs_1.filter)((text) => this.acceptFinal(text)));
|
|
82
149
|
}), (0, rxjs_1.share)());
|
|
83
150
|
}
|
|
84
151
|
return this.finalsShared;
|
|
85
152
|
}
|
|
153
|
+
/** Vendor finals swallowed after a virtual final of the same utterance (its better wording; no turn). */
|
|
154
|
+
get suppressedFinals$() {
|
|
155
|
+
return this.suppressedSubject.asObservable();
|
|
156
|
+
}
|
|
157
|
+
/** Finals the result filters threw away (filler, low VAD). No turn starts, but the utterance is over. */
|
|
158
|
+
get dropped$() {
|
|
159
|
+
return this.droppedSubject.asObservable();
|
|
160
|
+
}
|
|
161
|
+
/** Extra condition that keeps barge-in from stopping the agent (e.g. a phrase that must play out whole). */
|
|
162
|
+
setBargeInBlocker(blocked) {
|
|
163
|
+
this.bargeInBlocked = blocked;
|
|
164
|
+
}
|
|
86
165
|
setCallEnding(ending) {
|
|
87
166
|
this.isEnding = ending;
|
|
88
167
|
}
|
|
@@ -90,11 +169,11 @@ let ActiveMedia = class ActiveMedia {
|
|
|
90
169
|
this.activeBarge?.dispose();
|
|
91
170
|
this.activeBarge = null;
|
|
92
171
|
this.sessionSub?.unsubscribe();
|
|
93
|
-
this.sessionSub = attachAsrSession(asr
|
|
172
|
+
this.sessionSub = this.attachAsrSession(asr);
|
|
94
173
|
this.asrTokenSubject.next(asrToken);
|
|
95
174
|
this.asrSubject.next(asr);
|
|
96
175
|
if (this.bargeIn) {
|
|
97
|
-
this.activeBarge = this.bargeIn.attach(asr, asrToken, () => this.isEnding);
|
|
176
|
+
this.activeBarge = this.bargeIn.attach(asr, asrToken, () => this.isEnding || this.bargeInBlocked?.() === true);
|
|
98
177
|
this.bargeSubject.next(this.activeBarge);
|
|
99
178
|
}
|
|
100
179
|
else {
|
|
@@ -118,6 +197,8 @@ let ActiveMedia = class ActiveMedia {
|
|
|
118
197
|
this.sessionSub?.add(asr.vadProbability$.subscribe((p) => {
|
|
119
198
|
if (p > this.segmentPeak)
|
|
120
199
|
this.segmentPeak = p;
|
|
200
|
+
if (p > this.linePeak)
|
|
201
|
+
this.linePeak = p;
|
|
121
202
|
}));
|
|
122
203
|
if (asr.speechStart$) {
|
|
123
204
|
this.sessionSub?.add(asr.speechStart$.subscribe(() => {
|
|
@@ -129,16 +210,26 @@ let ActiveMedia = class ActiveMedia {
|
|
|
129
210
|
const trimmed = text.trim();
|
|
130
211
|
if (!trimmed)
|
|
131
212
|
return false;
|
|
213
|
+
// Each final closes the line the peak counts over (dropped or not).
|
|
214
|
+
const linePeak = this.linePeak;
|
|
215
|
+
this.linePeak = 0;
|
|
132
216
|
if (this.fillerPattern?.test(trimmed)) {
|
|
133
217
|
this.log('runtime: asr final dropped (filler)', { text: trimmed });
|
|
218
|
+
this.droppedSubject.next({ text: trimmed, reason: 'filler' });
|
|
134
219
|
return false;
|
|
135
220
|
}
|
|
136
|
-
|
|
221
|
+
const peak = this.peakOverLine ? Math.max(this.segmentPeak, linePeak) : this.segmentPeak;
|
|
222
|
+
if (this.minPeakVad > 0 && peak < this.minPeakVad) {
|
|
223
|
+
if (this.minPeakVadExcept.some((re) => re.test(trimmed))) {
|
|
224
|
+
this.log('runtime: asr final kept below min vad', { text: trimmed, peak, min: this.minPeakVad });
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
137
227
|
this.log('runtime: asr final dropped (low vad)', {
|
|
138
228
|
text: trimmed,
|
|
139
|
-
peak
|
|
229
|
+
peak,
|
|
140
230
|
min: this.minPeakVad,
|
|
141
231
|
});
|
|
232
|
+
this.droppedSubject.next({ text: trimmed, reason: 'low_vad' });
|
|
142
233
|
return false;
|
|
143
234
|
}
|
|
144
235
|
return true;
|
|
@@ -155,41 +246,63 @@ let ActiveMedia = class ActiveMedia {
|
|
|
155
246
|
this.activeBarge = null;
|
|
156
247
|
this.bargeSubject.next(null);
|
|
157
248
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
* Finals consumers must not call finalize() themselves.
|
|
167
|
-
*/
|
|
168
|
-
function attachAsrSession(asr, logger) {
|
|
169
|
-
const sub = new rxjs_1.Subscription();
|
|
170
|
-
if (asr.speechEnd$) {
|
|
171
|
-
sub.add(asr.speechEnd$.subscribe(() => {
|
|
249
|
+
/**
|
|
250
|
+
* One subscription per ASR handle: vendor finalize on speech end, user-speaking state, error log.
|
|
251
|
+
* Finals consumers must not call finalize() themselves.
|
|
252
|
+
*/
|
|
253
|
+
attachAsrSession(asr) {
|
|
254
|
+
const sub = new rxjs_1.Subscription();
|
|
255
|
+
const logger = this.logger;
|
|
256
|
+
const finalize = () => {
|
|
172
257
|
try {
|
|
173
258
|
asr.finalize();
|
|
174
259
|
}
|
|
175
260
|
catch {
|
|
176
261
|
/* double finalize is harmless */
|
|
177
262
|
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
263
|
+
};
|
|
264
|
+
if (asr.partial$) {
|
|
265
|
+
sub.add(asr.partial$.subscribe((p) => {
|
|
266
|
+
const t = p?.text?.trim();
|
|
267
|
+
if (t)
|
|
268
|
+
this.lastPartialText = t;
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
if (asr.speechStart$) {
|
|
272
|
+
sub.add(asr.speechStart$.subscribe(() => {
|
|
273
|
+
this.lastPartialText = '';
|
|
274
|
+
this.userSpeakingSubject.next(true);
|
|
275
|
+
}));
|
|
276
|
+
}
|
|
277
|
+
if (asr.speechEnd$) {
|
|
278
|
+
sub.add(asr.speechEnd$.subscribe(() => {
|
|
279
|
+
this.lastSpeechEndAt = Date.now();
|
|
280
|
+
this.userSpeakingSubject.next(false);
|
|
281
|
+
finalize();
|
|
282
|
+
}));
|
|
283
|
+
}
|
|
284
|
+
if (asr.error$) {
|
|
285
|
+
sub.add(asr.error$.subscribe((err) => {
|
|
286
|
+
const error = logger?.error;
|
|
287
|
+
if (typeof error === 'function') {
|
|
288
|
+
error.call(logger, 'runtime: asr error', {
|
|
289
|
+
message: err?.message,
|
|
290
|
+
code: err?.code,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}));
|
|
294
|
+
}
|
|
295
|
+
sub.add(() => {
|
|
296
|
+
this.userSpeakingSubject.next(false);
|
|
297
|
+
});
|
|
298
|
+
return sub;
|
|
190
299
|
}
|
|
191
|
-
|
|
192
|
-
|
|
300
|
+
};
|
|
301
|
+
exports.ActiveMedia = ActiveMedia;
|
|
302
|
+
exports.ActiveMedia = ActiveMedia = __decorate([
|
|
303
|
+
(0, decorators_1.Injectable)(),
|
|
304
|
+
__metadata("design:paramtypes", [Function, Object])
|
|
305
|
+
], ActiveMedia);
|
|
193
306
|
/** Register ACTIVE_ASR$ / ACTIVE_TTS$ / default ACTIVE_FINALS$ from ActiveMedia. */
|
|
194
307
|
function activeMediaStreamProviders() {
|
|
195
308
|
return [
|
|
@@ -211,4 +324,3 @@ function activeMediaStreamProviders() {
|
|
|
211
324
|
];
|
|
212
325
|
}
|
|
213
326
|
exports.activeMediaStreamProviders = activeMediaStreamProviders;
|
|
214
|
-
//# sourceMappingURL=active-media.js.map
|
|
@@ -27,6 +27,7 @@ export interface ApplyVirtualFinalsOptions {
|
|
|
27
27
|
* Default true (standalone / tests).
|
|
28
28
|
*/
|
|
29
29
|
finalizeOnSpeechEnd?: boolean;
|
|
30
|
+
/** The vendor's final of an utterance a virtual final already answered (swallowed within the quiet window). */
|
|
31
|
+
onSuppressed?: (vendorText: string) => void;
|
|
30
32
|
}
|
|
31
33
|
export declare function applyVirtualFinals(asr: AsrHandle, strategy?: VirtualFinalsStrategy, opts?: ApplyVirtualFinalsOptions): Observable<string>;
|
|
32
|
-
//# sourceMappingURL=virtual-finals.d.ts.map
|
|
@@ -85,6 +85,7 @@ function applyVirtualFinals(asr, strategy = exports.VirtualFinalsStrategy.off(),
|
|
|
85
85
|
const vendor$ = asr.result$.pipe((0, rxjs_1.map)((t) => t.trim()), (0, rxjs_1.filter)((t) => t.length > 0), (0, rxjs_1.filter)((t) => {
|
|
86
86
|
if (Date.now() < suppressUntil) {
|
|
87
87
|
suppressUntil = 0;
|
|
88
|
+
opts.onSuppressed?.(t);
|
|
88
89
|
return false;
|
|
89
90
|
}
|
|
90
91
|
if (vadFinalizeTimer != null) {
|
|
@@ -108,4 +109,3 @@ function applyVirtualFinals(asr, strategy = exports.VirtualFinalsStrategy.off(),
|
|
|
108
109
|
});
|
|
109
110
|
}
|
|
110
111
|
exports.applyVirtualFinals = applyVirtualFinals;
|
|
111
|
-
//# sourceMappingURL=virtual-finals.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
|
-
export { AGENT_RUNTIME_PACKAGE, AGENT_RUNTIME_VERSION
|
|
3
|
-
export type { Type, Provider, InjectionToken, ModuleMetadata, DynamicModule, AgentModuleMetadata, DumpPolicy, ScriptResult, OnBeforeCall, OnOnlineEarly, OnOnlineCall, OnAfterCallSuccess, OnAfterCallFailed, OnCallDestroy, CreateAgentScriptOptions, MediaRegistration, OnlineCallMediaOpts, } from './core';
|
|
4
|
-
export { ResultStore } from './result';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
2
|
+
export { AGENT_RUNTIME_PACKAGE, AGENT_RUNTIME_VERSION } from './core/version';
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AGENT_RUNTIME_VERSION = exports.AGENT_RUNTIME_PACKAGE = void 0;
|
|
4
4
|
require("reflect-metadata");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, "
|
|
11
|
-
Object.defineProperty(exports, "
|
|
12
|
-
Object.defineProperty(exports, "PhaseOrder", { enumerable: true, get: function () { return core_1.PhaseOrder; } });
|
|
13
|
-
Object.defineProperty(exports, "createAgentScript", { enumerable: true, get: function () { return core_1.createAgentScript; } });
|
|
14
|
-
Object.defineProperty(exports, "defineEventModule", { enumerable: true, get: function () { return core_1.defineEventModule; } });
|
|
15
|
-
Object.defineProperty(exports, "CHANNEL", { enumerable: true, get: function () { return core_1.CHANNEL; } });
|
|
16
|
-
Object.defineProperty(exports, "PLATFORM", { enumerable: true, get: function () { return core_1.PLATFORM; } });
|
|
17
|
-
Object.defineProperty(exports, "CONTEXT", { enumerable: true, get: function () { return core_1.CONTEXT; } });
|
|
18
|
-
Object.defineProperty(exports, "LOGGER", { enumerable: true, get: function () { return core_1.LOGGER; } });
|
|
19
|
-
Object.defineProperty(exports, "DUMP_POLICY", { enumerable: true, get: function () { return core_1.DUMP_POLICY; } });
|
|
20
|
-
Object.defineProperty(exports, "CallDisposables", { enumerable: true, get: function () { return core_1.CallDisposables; } });
|
|
21
|
-
Object.defineProperty(exports, "createCallContainer", { enumerable: true, get: function () { return core_1.createCallContainer; } });
|
|
22
|
-
Object.defineProperty(exports, "provideAsr", { enumerable: true, get: function () { return core_1.provideAsr; } });
|
|
23
|
-
Object.defineProperty(exports, "provideTts", { enumerable: true, get: function () { return core_1.provideTts; } });
|
|
24
|
-
Object.defineProperty(exports, "MEDIA_REGISTRATIONS", { enumerable: true, get: function () { return core_1.MEDIA_REGISTRATIONS; } });
|
|
25
|
-
Object.defineProperty(exports, "MediaBootstrap", { enumerable: true, get: function () { return core_1.MediaBootstrap; } });
|
|
26
|
-
Object.defineProperty(exports, "ONLINE_CALL_MEDIA_OPTS", { enumerable: true, get: function () { return core_1.ONLINE_CALL_MEDIA_OPTS; } });
|
|
27
|
-
var result_1 = require("./result");
|
|
28
|
-
Object.defineProperty(exports, "ResultStore", { enumerable: true, get: function () { return result_1.ResultStore; } });
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
5
|
+
// The package runs agents written as data: an agent is `voiceAgent(id).pipe(...blocks).build()` of
|
|
6
|
+
// `@voctiv/agent-runtime/templates` (the builder, its blocks, the data-only agent file types, the data language
|
|
7
|
+
// evaluators); `@voctiv/agent-runtime/testing` is for tests only. This root exports the package's name and version;
|
|
8
|
+
// the engine and the DI core under it are internal.
|
|
9
|
+
var version_1 = require("./core/version");
|
|
10
|
+
Object.defineProperty(exports, "AGENT_RUNTIME_PACKAGE", { enumerable: true, get: function () { return version_1.AGENT_RUNTIME_PACKAGE; } });
|
|
11
|
+
Object.defineProperty(exports, "AGENT_RUNTIME_VERSION", { enumerable: true, get: function () { return version_1.AGENT_RUNTIME_VERSION; } });
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { MediaChannel } from '@voctiv/agent-sdk';
|
|
1
|
+
import type { MediaChannel, ScriptLogger } from '@voctiv/agent-sdk';
|
|
2
2
|
import { type DynamicModule } from '../core/decorators';
|
|
3
3
|
import { ActiveMedia } from '../dialog-events/active-media';
|
|
4
4
|
import type { OnOnlineCall, OnCallDestroy } from '../core/hooks';
|
|
5
|
+
import { RuntimeEvents } from '../core/runtime-events';
|
|
5
6
|
export type HangupStrategyKind = 'drainPlayback' | 'immediate';
|
|
6
7
|
export interface HangupStrategy {
|
|
7
8
|
readonly kind: HangupStrategyKind;
|
|
@@ -23,20 +24,36 @@ export declare const LIFECYCLE_OPTIONS: "LIFECYCLE_OPTIONS";
|
|
|
23
24
|
export interface LifecycleOptions {
|
|
24
25
|
ringingTimeoutMs?: number;
|
|
25
26
|
maxDurationMs?: number;
|
|
27
|
+
/**
|
|
28
|
+
* What the cap does. Both raise `MAX_DURATION` for the dialog first.
|
|
29
|
+
* `hangup` (default): hang up at once. `event`: the dialog hangs up itself (say goodbye, record the reason).
|
|
30
|
+
*/
|
|
31
|
+
maxDurationAction?: 'hangup' | 'event';
|
|
32
|
+
/** `hangup` action: the agent queue stops at the cap and the hangup follows this long after (default 0: at once). */
|
|
33
|
+
maxDurationTailMs?: number;
|
|
26
34
|
hangup: HangupStrategy;
|
|
27
35
|
}
|
|
28
36
|
export declare class LifecycleService implements OnOnlineCall, OnCallDestroy {
|
|
29
37
|
private readonly channel;
|
|
30
38
|
private readonly media;
|
|
31
39
|
private readonly opts;
|
|
40
|
+
private readonly runtimeEvents?;
|
|
41
|
+
private readonly logger?;
|
|
32
42
|
callEnding: boolean;
|
|
33
43
|
terminated: boolean;
|
|
44
|
+
/** The script hung the call up (not the caller); `maxDurationHit`: because the call ran out of time. */
|
|
45
|
+
agentHangup: boolean;
|
|
46
|
+
maxDurationHit: boolean;
|
|
34
47
|
private maxTimer;
|
|
35
48
|
private ringTimer;
|
|
36
49
|
private termSub?;
|
|
37
|
-
|
|
50
|
+
private readonly queueSubs;
|
|
51
|
+
/** The agent queue is playing (itemStarted without a queueEmpty since). */
|
|
52
|
+
private agentPlaying;
|
|
53
|
+
constructor(channel: MediaChannel, media: ActiveMedia, opts: LifecycleOptions, runtimeEvents?: RuntimeEvents | undefined, logger?: ScriptLogger | undefined);
|
|
38
54
|
onOnlineCall(): Promise<void>;
|
|
39
55
|
onCallDestroy(): void;
|
|
56
|
+
private watchAgentQueue;
|
|
40
57
|
startMaxDuration(): void;
|
|
41
58
|
cancelMaxDuration(): void;
|
|
42
59
|
armRingingWatchdog(): void;
|
|
@@ -44,6 +61,12 @@ export declare class LifecycleService implements OnOnlineCall, OnCallDestroy {
|
|
|
44
61
|
waitFor?: Promise<void>;
|
|
45
62
|
strategy?: HangupStrategy;
|
|
46
63
|
}): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* SIP hangup, tried twice; then the channel is closed (its session ends, `terminated$` follows). When even that
|
|
66
|
+
* fails the line is still up: the hangup guard is released so a later hangup can try again.
|
|
67
|
+
*/
|
|
68
|
+
private sendHangup;
|
|
69
|
+
private warn;
|
|
47
70
|
markTerminated(): void;
|
|
48
71
|
private clearMax;
|
|
49
72
|
private clearRing;
|
|
@@ -51,4 +74,3 @@ export declare class LifecycleService implements OnOnlineCall, OnCallDestroy {
|
|
|
51
74
|
export declare class LifecycleModule {
|
|
52
75
|
static forRoot(opts: LifecycleOptions): DynamicModule;
|
|
53
76
|
}
|
|
54
|
-
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -20,6 +20,7 @@ const decorators_1 = require("../core/decorators");
|
|
|
20
20
|
const tokens_1 = require("../core/tokens");
|
|
21
21
|
const active_media_1 = require("../dialog-events/active-media");
|
|
22
22
|
const hooks_1 = require("../core/hooks");
|
|
23
|
+
const runtime_events_1 = require("../core/runtime-events");
|
|
23
24
|
exports.HangupStrategy = {
|
|
24
25
|
drainPlayback: (opts = {}) => ({
|
|
25
26
|
kind: 'drainPlayback',
|
|
@@ -34,18 +35,27 @@ exports.HangupStrategy = {
|
|
|
34
35
|
};
|
|
35
36
|
exports.LIFECYCLE_OPTIONS = 'LIFECYCLE_OPTIONS';
|
|
36
37
|
let LifecycleService = class LifecycleService {
|
|
37
|
-
constructor(channel, media, opts) {
|
|
38
|
+
constructor(channel, media, opts, runtimeEvents, logger) {
|
|
38
39
|
this.channel = channel;
|
|
39
40
|
this.media = media;
|
|
40
41
|
this.opts = opts;
|
|
42
|
+
this.runtimeEvents = runtimeEvents;
|
|
43
|
+
this.logger = logger;
|
|
41
44
|
this.callEnding = false;
|
|
42
45
|
this.terminated = false;
|
|
46
|
+
/** The script hung the call up (not the caller); `maxDurationHit`: because the call ran out of time. */
|
|
47
|
+
this.agentHangup = false;
|
|
48
|
+
this.maxDurationHit = false;
|
|
43
49
|
this.maxTimer = null;
|
|
44
50
|
this.ringTimer = null;
|
|
51
|
+
this.queueSubs = [];
|
|
52
|
+
/** The agent queue is playing (itemStarted without a queueEmpty since). */
|
|
53
|
+
this.agentPlaying = false;
|
|
45
54
|
}
|
|
46
55
|
async onOnlineCall() {
|
|
47
56
|
this.armRingingWatchdog();
|
|
48
57
|
this.startMaxDuration();
|
|
58
|
+
this.watchAgentQueue();
|
|
49
59
|
if (this.channel.type === 'sip') {
|
|
50
60
|
this.termSub = this.channel.events.terminated$.subscribe(() => {
|
|
51
61
|
this.markTerminated();
|
|
@@ -56,6 +66,21 @@ let LifecycleService = class LifecycleService {
|
|
|
56
66
|
this.clearMax();
|
|
57
67
|
this.clearRing();
|
|
58
68
|
this.termSub?.unsubscribe();
|
|
69
|
+
for (const s of this.queueSubs)
|
|
70
|
+
s.unsubscribe();
|
|
71
|
+
}
|
|
72
|
+
watchAgentQueue() {
|
|
73
|
+
try {
|
|
74
|
+
const q = this.channel.audio.queue(this.media.agentQueue);
|
|
75
|
+
if (!q?.itemStarted$ || !q?.queueEmpty$) {
|
|
76
|
+
this.agentPlaying = true; // no queue events: always wait for the drain, as before
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
this.queueSubs.push(q.itemStarted$.subscribe(() => { this.agentPlaying = true; }), q.queueEmpty$.subscribe(() => { this.agentPlaying = false; }));
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
this.agentPlaying = true;
|
|
83
|
+
}
|
|
59
84
|
}
|
|
60
85
|
startMaxDuration() {
|
|
61
86
|
const ms = this.opts.maxDurationMs;
|
|
@@ -64,7 +89,19 @@ let LifecycleService = class LifecycleService {
|
|
|
64
89
|
this.clearMax();
|
|
65
90
|
this.maxTimer = setTimeout(() => {
|
|
66
91
|
this.maxTimer = null;
|
|
67
|
-
|
|
92
|
+
if (!this.callEnding)
|
|
93
|
+
this.maxDurationHit = true;
|
|
94
|
+
this.runtimeEvents?.emit({ type: 'MAX_DURATION' });
|
|
95
|
+
if (this.opts.maxDurationAction === 'event' && this.runtimeEvents)
|
|
96
|
+
return;
|
|
97
|
+
const tail = this.opts.maxDurationTailMs ?? 0;
|
|
98
|
+
if (tail > 0) {
|
|
99
|
+
try {
|
|
100
|
+
this.channel.audio.stop(this.media.agentQueue);
|
|
101
|
+
}
|
|
102
|
+
catch { /* ignore */ }
|
|
103
|
+
}
|
|
104
|
+
void this.hangup('max_duration', { strategy: exports.HangupStrategy.immediate(tail > 0 ? { rtpTailMs: tail } : {}) });
|
|
68
105
|
}, ms);
|
|
69
106
|
}
|
|
70
107
|
cancelMaxDuration() {
|
|
@@ -81,17 +118,25 @@ let LifecycleService = class LifecycleService {
|
|
|
81
118
|
this.ringTimer = null;
|
|
82
119
|
void this.hangup('ringing_timeout', { strategy: exports.HangupStrategy.immediate() });
|
|
83
120
|
}, ms);
|
|
84
|
-
|
|
121
|
+
// state$ may emit the current state synchronously on subscribe (BehaviorSubject-like hosts): the
|
|
122
|
+
// subscription does not exist yet inside that first callback, so unsubscribe after it returns.
|
|
123
|
+
let done = false;
|
|
124
|
+
let sub;
|
|
125
|
+
sub = this.channel.sip.state$.subscribe((state) => {
|
|
85
126
|
if (state !== 'ringing') {
|
|
86
127
|
this.clearRing();
|
|
87
|
-
|
|
128
|
+
done = true;
|
|
129
|
+
sub?.unsubscribe();
|
|
88
130
|
}
|
|
89
131
|
});
|
|
132
|
+
if (done)
|
|
133
|
+
sub.unsubscribe();
|
|
90
134
|
}
|
|
91
135
|
async hangup(_reason, opts) {
|
|
92
136
|
if (this.callEnding)
|
|
93
137
|
return;
|
|
94
138
|
this.callEnding = true;
|
|
139
|
+
this.agentHangup = true;
|
|
95
140
|
this.media.setCallEnding(true);
|
|
96
141
|
this.clearMax();
|
|
97
142
|
this.clearRing();
|
|
@@ -102,27 +147,57 @@ let LifecycleService = class LifecycleService {
|
|
|
102
147
|
if (strategy.kind === 'drainPlayback') {
|
|
103
148
|
const queues = strategy.queues ?? [this.media.agentQueue];
|
|
104
149
|
const drainMs = strategy.drainTimeoutMs ?? 15_000;
|
|
150
|
+
// queueEmpty$ is an event, not a state: on a queue that is already quiet it never comes, and the
|
|
151
|
+
// hangup used to wait the whole drain timeout. The agent queue's state is tracked; others still wait.
|
|
152
|
+
const pending = queues.filter((q) => q !== this.media.agentQueue || this.agentPlaying);
|
|
105
153
|
await Promise.race([
|
|
106
|
-
Promise.all(
|
|
154
|
+
Promise.all(pending.map((q) => (0, rxjs_1.firstValueFrom)(this.channel.audio.queue(q).queueEmpty$))),
|
|
107
155
|
(0, rxjs_1.firstValueFrom)((0, rxjs_1.timer)(drainMs)),
|
|
108
156
|
]);
|
|
109
157
|
}
|
|
110
158
|
const tail = strategy.rtpTailMs ?? 0;
|
|
111
159
|
if (tail > 0)
|
|
112
160
|
await new Promise((r) => setTimeout(r, tail));
|
|
113
|
-
if (this.channel.type === 'sip') {
|
|
114
|
-
this.channel.sip.hangup();
|
|
115
|
-
}
|
|
116
161
|
}
|
|
117
162
|
catch {
|
|
163
|
+
/* the hangup still goes out */
|
|
164
|
+
}
|
|
165
|
+
this.sendHangup(_reason);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* SIP hangup, tried twice; then the channel is closed (its session ends, `terminated$` follows). When even that
|
|
169
|
+
* fails the line is still up: the hangup guard is released so a later hangup can try again.
|
|
170
|
+
*/
|
|
171
|
+
sendHangup(reason) {
|
|
172
|
+
if (this.channel.type !== 'sip')
|
|
173
|
+
return;
|
|
174
|
+
let lastError;
|
|
175
|
+
for (let attempt = 1; attempt <= 2; attempt += 1) {
|
|
118
176
|
try {
|
|
119
|
-
|
|
120
|
-
|
|
177
|
+
this.channel.sip.hangup();
|
|
178
|
+
return;
|
|
121
179
|
}
|
|
122
|
-
catch {
|
|
123
|
-
|
|
180
|
+
catch (err) {
|
|
181
|
+
lastError = err;
|
|
182
|
+
this.warn('runtime: sip hangup failed', { reason, attempt, error: String(err) });
|
|
124
183
|
}
|
|
125
184
|
}
|
|
185
|
+
try {
|
|
186
|
+
this.channel.destroy();
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
catch (err) {
|
|
190
|
+
lastError = err;
|
|
191
|
+
}
|
|
192
|
+
this.warn('runtime: hangup failed, line still up', { reason, error: String(lastError) });
|
|
193
|
+
this.callEnding = false;
|
|
194
|
+
this.agentHangup = false;
|
|
195
|
+
this.media.setCallEnding(false);
|
|
196
|
+
}
|
|
197
|
+
warn(message, data) {
|
|
198
|
+
const fn = this.logger?.error;
|
|
199
|
+
if (typeof fn === 'function')
|
|
200
|
+
fn.call(this.logger, message, data);
|
|
126
201
|
}
|
|
127
202
|
markTerminated() {
|
|
128
203
|
this.terminated = true;
|
|
@@ -151,7 +226,9 @@ exports.LifecycleService = LifecycleService = __decorate([
|
|
|
151
226
|
__param(0, (0, tsyringe_1.inject)(tokens_1.CHANNEL)),
|
|
152
227
|
__param(1, (0, tsyringe_1.inject)(active_media_1.ActiveMedia)),
|
|
153
228
|
__param(2, (0, tsyringe_1.inject)(exports.LIFECYCLE_OPTIONS)),
|
|
154
|
-
|
|
229
|
+
__param(3, (0, tsyringe_1.inject)(runtime_events_1.RuntimeEvents, { isOptional: true })),
|
|
230
|
+
__param(4, (0, tsyringe_1.inject)(tokens_1.LOGGER, { isOptional: true })),
|
|
231
|
+
__metadata("design:paramtypes", [Object, active_media_1.ActiveMedia, Object, runtime_events_1.RuntimeEvents, Object])
|
|
155
232
|
], LifecycleService);
|
|
156
233
|
let LifecycleModule = LifecycleModule_1 = class LifecycleModule {
|
|
157
234
|
static forRoot(opts) {
|
|
@@ -164,6 +241,8 @@ let LifecycleModule = LifecycleModule_1 = class LifecycleModule {
|
|
|
164
241
|
hangup: opts.hangup ?? exports.HangupStrategy.drainPlayback(),
|
|
165
242
|
ringingTimeoutMs: opts.ringingTimeoutMs,
|
|
166
243
|
maxDurationMs: opts.maxDurationMs,
|
|
244
|
+
maxDurationAction: opts.maxDurationAction,
|
|
245
|
+
...(opts.maxDurationTailMs ? { maxDurationTailMs: opts.maxDurationTailMs } : {}),
|
|
167
246
|
},
|
|
168
247
|
},
|
|
169
248
|
LifecycleService,
|
|
@@ -176,4 +255,3 @@ exports.LifecycleModule = LifecycleModule;
|
|
|
176
255
|
exports.LifecycleModule = LifecycleModule = LifecycleModule_1 = __decorate([
|
|
177
256
|
(0, decorators_1.Module)({})
|
|
178
257
|
], LifecycleModule);
|
|
179
|
-
//# sourceMappingURL=lifecycle.js.map
|