@voctiv/agent-runtime 0.2.2 → 0.4.0
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 +45 -20
- 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 +16 -23
- package/docs/framework/testing.md +8 -6
- package/package.json +10 -54
- package/skill/SKILL.md +213 -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/locales.md +149 -0
- package/skill/references/migration.md +133 -0
- package/skill/references/new-agent.md +81 -0
- package/skill/references/porting.md +109 -0
- package/templates/agent/README.md +50 -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
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.annotate = exports.detect = exports.dayHints = exports.dayHintTable = void 0;
|
|
4
|
+
// `annotateCaller.notes`: notes in front of (or after) the caller's words for the LLM, made in order as data. Each note
|
|
5
|
+
// reads the line (and the notes made before it) with a condition, may detect items in the words (spoken day words, the
|
|
6
|
+
// next rung of a note ladder, the option a choice set picks) and is rendered per item. Pure: the only state it changes
|
|
7
|
+
// is the note ladders' (returned with the text; the reducer keeps it).
|
|
8
|
+
const locales_1 = require("../../locales");
|
|
9
|
+
const word_regex_1 = require("../../locales/word-regex");
|
|
10
|
+
const context_1 = require("../../expr/context");
|
|
11
|
+
const evaluate_1 = require("../../expr/evaluate");
|
|
12
|
+
const transcript_1 = require("../../expr/transcript");
|
|
13
|
+
const values_1 = require("../../expr/values");
|
|
14
|
+
const choices_1 = require("./choices");
|
|
15
|
+
const ladders_1 = require("./ladders");
|
|
16
|
+
const notes_dates_1 = require("./notes-dates");
|
|
17
|
+
function render(n) {
|
|
18
|
+
return `${n.front.length ? `${n.front.join(' ')} ${n.words}` : n.words}${n.after}`;
|
|
19
|
+
}
|
|
20
|
+
/** The notes in front as text, with the space after them (`''` without). */
|
|
21
|
+
function frontText(n) {
|
|
22
|
+
return n.front.length ? `${n.front.join(' ')} ` : '';
|
|
23
|
+
}
|
|
24
|
+
const lastOfMonth = (year, month) => {
|
|
25
|
+
const d = new Date(Date.UTC(year, month, 0));
|
|
26
|
+
return { year: d.getUTCFullYear(), month: d.getUTCMonth() + 1, day: d.getUTCDate() };
|
|
27
|
+
};
|
|
28
|
+
function addDays(d, n) {
|
|
29
|
+
const t = new Date(Date.UTC(d.year, d.month - 1, d.day + n));
|
|
30
|
+
return { year: t.getUTCFullYear(), month: t.getUTCMonth() + 1, day: t.getUTCDate() };
|
|
31
|
+
}
|
|
32
|
+
/** The hint table of today: each group's words and the day they mean, in order. */
|
|
33
|
+
function dayHintTable(spec, ctx) {
|
|
34
|
+
const c = (0, context_1.clockOf)(ctx);
|
|
35
|
+
const today = { year: c.year, month: c.month, day: c.day };
|
|
36
|
+
const wd = (0, values_1.weekdayOf)(today);
|
|
37
|
+
const pack = (0, locales_1.getLocale)(spec.pack ?? ctx.locale);
|
|
38
|
+
const out = [];
|
|
39
|
+
for (const g of spec.groups) {
|
|
40
|
+
if ('days' in g)
|
|
41
|
+
out.push({ words: [...g.words], date: addDays(today, g.days) });
|
|
42
|
+
else if ('monthEnd' in g)
|
|
43
|
+
out.push({ words: [...g.words], date: lastOfMonth(today.year, today.month) });
|
|
44
|
+
else if ('nextToday' in g) {
|
|
45
|
+
const name = String(pack?.format?.weekdays?.[wd] ?? '').toLowerCase();
|
|
46
|
+
out.push({ words: [g.nextToday.replace(/\{weekday\}/g, name)], date: addDays(today, 7) });
|
|
47
|
+
}
|
|
48
|
+
else if ('weekdays' in g) {
|
|
49
|
+
for (const target of [1, 2, 3, 4, 5, 6, 0]) {
|
|
50
|
+
const words = g.weekdays[target] ?? [];
|
|
51
|
+
if (words.length)
|
|
52
|
+
out.push({ words: [...words], date: addDays(today, (target - wd + 7) % 7) });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else if ('ordinalDays' in g) {
|
|
56
|
+
const o = g.ordinalDays;
|
|
57
|
+
const monthEnd = lastOfMonth(today.year, today.month);
|
|
58
|
+
const nextEnd = lastOfMonth(monthEnd.year, monthEnd.month + 1);
|
|
59
|
+
const fmt = pack?.format;
|
|
60
|
+
for (let day = 1; day <= 31; day++) {
|
|
61
|
+
const m = day >= today.day && day <= monthEnd.day ? monthEnd : day <= nextEnd.day ? nextEnd : null;
|
|
62
|
+
if (!m)
|
|
63
|
+
continue;
|
|
64
|
+
const words = [fmt?.ordinalFigure?.(day) ?? String(day)];
|
|
65
|
+
if (day >= (o.wordsFrom ?? 1) && fmt?.ordinal) {
|
|
66
|
+
const word = fmt.ordinal(day);
|
|
67
|
+
const lead = o.lead != null ? `${o.lead} ` : '';
|
|
68
|
+
words.push(`${lead}${word}`);
|
|
69
|
+
if (word.includes('-'))
|
|
70
|
+
words.push(`${lead}${word.replace('-', ' ')}`);
|
|
71
|
+
}
|
|
72
|
+
out.push({ words, date: { year: m.year, month: m.month, day } });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return out;
|
|
77
|
+
}
|
|
78
|
+
exports.dayHintTable = dayHintTable;
|
|
79
|
+
/** The day words a text names: per group, the first of its words found (that match blanked for the next groups). */
|
|
80
|
+
function dayHints(spec, text, ctx) {
|
|
81
|
+
const pack = (0, locales_1.getLocale)(spec.pack ?? ctx.locale)?.format;
|
|
82
|
+
const tail = spec.notFollowedBy ? (0, word_regex_1.stickyOf)(spec.notFollowedBy) : null;
|
|
83
|
+
let rest = text.toLowerCase();
|
|
84
|
+
const items = [];
|
|
85
|
+
for (const hint of dayHintTable(spec, ctx)) {
|
|
86
|
+
for (const word of hint.words) {
|
|
87
|
+
const m = (0, word_regex_1.findWholeWord)(word, rest, tail);
|
|
88
|
+
if (m == null)
|
|
89
|
+
continue;
|
|
90
|
+
const date = (0, values_1.dayText)(hint.date);
|
|
91
|
+
const weekday = (0, values_1.weekdayOf)(hint.date);
|
|
92
|
+
const locals = {
|
|
93
|
+
word, date, year: hint.date.year, month: hint.date.month, day: hint.date.day, weekday,
|
|
94
|
+
weekdayName: pack?.weekdays?.[weekday] ?? '', monthName: pack?.months?.[hint.date.month - 1] ?? '',
|
|
95
|
+
dayOrdinal: pack?.ordinal?.(hint.date.day) ?? String(hint.date.day),
|
|
96
|
+
};
|
|
97
|
+
items.push({ ...locals, resolved: (0, values_1.toText)((0, evaluate_1.evalExpr)(spec.resolved, (0, context_1.withLocals)(ctx, locals))) });
|
|
98
|
+
rest = rest.slice(0, m.index) + ' '.repeat(m[0].length) + rest.slice(m.index + m[0].length);
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return items;
|
|
103
|
+
}
|
|
104
|
+
exports.dayHints = dayHints;
|
|
105
|
+
// ── the notes ─────────────────────────────────────────────────────────────────────────────────
|
|
106
|
+
/** What one note found: its items (an empty list: nothing), and the note ladders after it. */
|
|
107
|
+
function detect(d, words, ctx, ladders) {
|
|
108
|
+
if (!d)
|
|
109
|
+
return { items: [{}], ladders };
|
|
110
|
+
if ('dayHints' in d)
|
|
111
|
+
return { items: dayHints(d.dayHints, words, ctx), ladders };
|
|
112
|
+
if ('dates' in d)
|
|
113
|
+
return { items: (0, notes_dates_1.datesIn)(d.dates, words, ctx), ladders };
|
|
114
|
+
if ('ladder' in d) {
|
|
115
|
+
const r = (0, ladders_1.ladderNote)(ctx, d.ladder, ladders[d.ladder]);
|
|
116
|
+
return { items: r.note == null ? [] : [{ note: r.note, count: r.count, stage: r.stage }], ladders: { ...ladders, [d.ladder]: r.state } };
|
|
117
|
+
}
|
|
118
|
+
if ('choice' in d) {
|
|
119
|
+
const c = d.choice;
|
|
120
|
+
if (c.mode === 'chosen') {
|
|
121
|
+
const p = (0, choices_1.chosen)(ctx, c.set, words);
|
|
122
|
+
return { items: p ? [(0, choices_1.optionItem)(ctx, c.set, p.key, p.said)] : [], ladders };
|
|
123
|
+
}
|
|
124
|
+
const last = lastAgentLine(ctx);
|
|
125
|
+
const n = last ? (0, choices_1.named)(ctx, c.set, last) : [];
|
|
126
|
+
if (n.length !== 1 || (c.yes != null && !(0, transcript_1.matches)(c.yes, words, ctx)))
|
|
127
|
+
return { items: [], ladders };
|
|
128
|
+
return { items: [(0, choices_1.optionItem)(ctx, c.set, n[0], words.trim())], ladders };
|
|
129
|
+
}
|
|
130
|
+
throw new Error(`[templates/notes] unknown detector ${JSON.stringify(Object.keys(d))}`);
|
|
131
|
+
}
|
|
132
|
+
exports.detect = detect;
|
|
133
|
+
function lastAgentLine(ctx) {
|
|
134
|
+
const lines = ctx.call?.agentLines ?? [];
|
|
135
|
+
return lines[lines.length - 1] ?? '';
|
|
136
|
+
}
|
|
137
|
+
/** One note on the line; `false` when it noted nothing. */
|
|
138
|
+
function noteOne(r, n, ctx0, ladders) {
|
|
139
|
+
if (r.unlessNotes?.some((x) => n.made.includes(x)))
|
|
140
|
+
return false;
|
|
141
|
+
const ctx = (0, context_1.withLocals)({ ...ctx0, line: n.words }, { notes: frontText(n), noted: render(n), words: n.words });
|
|
142
|
+
if (r.when != null && !(0, evaluate_1.evalCondition)(r.when, ctx))
|
|
143
|
+
return false;
|
|
144
|
+
const found = detect(r.detect, n.words, ctx, ladders.v);
|
|
145
|
+
let texts = found.items.map((it) => (0, values_1.toText)((0, evaluate_1.evalExpr)(r.note, (0, context_1.withLocals)(ctx, it)))).filter((t) => t !== '');
|
|
146
|
+
if (r.dedupe)
|
|
147
|
+
texts = [...new Set(texts)];
|
|
148
|
+
if (!texts.length)
|
|
149
|
+
return false;
|
|
150
|
+
ladders.v = found.ladders;
|
|
151
|
+
if (r.place === 'front')
|
|
152
|
+
n.front = [...texts, ...n.front];
|
|
153
|
+
else if (r.place === 'beforeWords')
|
|
154
|
+
n.front = [...n.front, ...texts];
|
|
155
|
+
else
|
|
156
|
+
n.after = `${n.after}${texts.join('')}`;
|
|
157
|
+
n.made.push(r.id);
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
/** The caller's words with the notes, and the note ladders after them. */
|
|
161
|
+
function annotate(entries, words, ctx, ladders = {}) {
|
|
162
|
+
const n = { front: [], words, after: '', made: [] };
|
|
163
|
+
const box = { v: ladders };
|
|
164
|
+
for (const e of entries) {
|
|
165
|
+
if ('oneOf' in e) {
|
|
166
|
+
for (const r of e.oneOf)
|
|
167
|
+
if (noteOne(r, n, ctx, box))
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
noteOne(e, n, ctx, box);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return { text: render(n), ladders: box.v, made: n.made };
|
|
175
|
+
}
|
|
176
|
+
exports.annotate = annotate;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { VoiceStep } from '../config';
|
|
2
|
+
import type { Turn } from './context';
|
|
3
|
+
/**
|
|
4
|
+
* Run step `i` and the cx.steps after it that do not wait. A line, clip or greeting is waited for (the step after it
|
|
5
|
+
* starts when it played out) unless it is the last step; a listen step waits for the caller.
|
|
6
|
+
*/
|
|
7
|
+
export declare function enter(cx: Turn, i: number): void;
|
|
8
|
+
/** The step runs on this call (`when`). */
|
|
9
|
+
export declare function stepOn(cx: Turn, st: VoiceStep): boolean;
|
|
10
|
+
export declare function question(cx: Turn, gateId: string): string;
|
|
11
|
+
/** The `language` step: the pick from the opening answer (or nothing). */
|
|
12
|
+
export declare function pickLanguage(cx: Turn): void;
|
|
13
|
+
export declare function endOpening(cx: Turn): void;
|
|
14
|
+
/** The opening's listen step got its line (or `null`: its silence rung said go on). */
|
|
15
|
+
export declare function takeAnswer(cx: Turn, answer: string | null): void;
|
|
16
|
+
/** A caller line during the opening: the listen step's answer (or kept for it while a line plays). */
|
|
17
|
+
export declare function openingLine(cx: Turn, text: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* An opening answer that carries the caller's intent (`toLlmWhen`): it is the first LLM turn, the rest of the
|
|
20
|
+
* opening is skipped; an eager greeting not played is waited for first (the turn follows it in the LLM's history).
|
|
21
|
+
*/
|
|
22
|
+
export declare function openingAnswerToLlm(cx: Turn, text: string): void;
|
|
23
|
+
/** Request the eager LLM lines of the opening from step `from` on (their `when` read now). */
|
|
24
|
+
export declare function prefetchEager(cx: Turn, from: number): void;
|
|
25
|
+
/** `input.lookup` is in: the variables it brought; eager lines not reached yet are requested now. */
|
|
26
|
+
export declare function inputUpdated(cx: Turn, vars: Readonly<Record<string, unknown>>, result: string | null): void;
|
|
27
|
+
/** The listen step after a line played: speech heard over it is its answer (as `speechOverPrevious` says). */
|
|
28
|
+
export declare function listenAfter(cx: Turn, listen: Extract<VoiceStep, {
|
|
29
|
+
kind: 'listen';
|
|
30
|
+
}>): void;
|
|
31
|
+
/** Voice without text during the opening: the listen step's answer (nothing), once no clip plays. */
|
|
32
|
+
export declare function voiceAnswer(cx: Turn): void;
|
|
33
|
+
/** The line, clip or greeting the opening waited for played out: the listen step after it, or the next step. */
|
|
34
|
+
export declare function openingDrained(cx: Turn): void;
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.openingDrained = exports.voiceAnswer = exports.listenAfter = exports.inputUpdated = exports.prefetchEager = exports.openingAnswerToLlm = exports.openingLine = exports.takeAnswer = exports.endOpening = exports.pickLanguage = exports.question = exports.stepOn = exports.enter = void 0;
|
|
4
|
+
// The opening: its steps one after another (clips, fixed lines, the LLM greeting, listening, the language pick, a gate
|
|
5
|
+
// question, a hook, a close), the answer of a listen step, the eager greeting and the end of the opening.
|
|
6
|
+
const core_1 = require("../../../call/extraction/core");
|
|
7
|
+
const language_1 = require("./language");
|
|
8
|
+
const turn_1 = require("./turn");
|
|
9
|
+
/** How a greeting's stream ends: empty after `firstTokenMs` without a chunk, and empty on an error when it has a fallback. */
|
|
10
|
+
function greetingStream(st) {
|
|
11
|
+
return { ...(st.firstTokenMs != null ? { firstTokenMs: st.firstTokenMs } : {}), ...(st.fallback ? { emptyOnError: true } : {}) };
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Run step `i` and the cx.steps after it that do not wait. A line, clip or greeting is waited for (the step after it
|
|
15
|
+
* starts when it played out) unless it is the last step; a listen step waits for the caller.
|
|
16
|
+
*/
|
|
17
|
+
function enter(cx, i) {
|
|
18
|
+
for (let k = i;; k++) {
|
|
19
|
+
const st = cx.steps[k];
|
|
20
|
+
cx.d.step = k;
|
|
21
|
+
cx.d.rung = 0;
|
|
22
|
+
if (!st) {
|
|
23
|
+
endOpening(cx);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (!stepOn(cx, st)) {
|
|
27
|
+
cx.log('opening_step_skipped', { step: k, kind: st.kind });
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (st.kind === 'listen')
|
|
31
|
+
return;
|
|
32
|
+
if (st.kind === 'language') {
|
|
33
|
+
pickLanguage(cx);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (st.kind === 'hook') {
|
|
37
|
+
// Agent code decides; the opening waits for its actions.
|
|
38
|
+
cx.d.playing = st.key;
|
|
39
|
+
cx.fx.push({ type: 'runHook', key: st.key, name: st.name, line: '' });
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (st.kind === 'close') {
|
|
43
|
+
// The opening ends the call: its line (if any), then the hangup.
|
|
44
|
+
cx.log('opening_close', { step: k, result: typeof st.result === 'function' ? st.result(cx.core.view(cx.d)) : st.result });
|
|
45
|
+
const action = st.text != null
|
|
46
|
+
? { close: st.text, result: st.result, reason: st.reason, ...(st.alias != null ? { alias: st.alias } : {}) }
|
|
47
|
+
: { hangup: st.reason, result: typeof st.result === 'function' ? st.result(cx.core.view(cx.d)) : st.result, ...(st.graceMs != null ? { graceMs: st.graceMs } : {}) };
|
|
48
|
+
const r = cx.run(cx.d, [action], { id: st.key });
|
|
49
|
+
cx.set(r.state);
|
|
50
|
+
cx.fx.push(...r.effects);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const last = !cx.steps.slice(k + 1).some((x) => stepOn(cx, x));
|
|
54
|
+
if (st.kind === 'llmGreeting') {
|
|
55
|
+
if (cx.env.voiceAnswerSteps)
|
|
56
|
+
cx.fx.push({ type: 'voiceAnswer', op: 'off' });
|
|
57
|
+
cx.log('opening_line', { step: k, alias: st.alias, llm: st.signal });
|
|
58
|
+
cx.fx.push({
|
|
59
|
+
type: 'playLlm', key: st.key, alias: st.alias, text: st.signal, ...cx.request(), ...greetingStream(st),
|
|
60
|
+
...(st.fallback ? { fallback: { play: st.fallback, text: cx.core.text(st.fallback.text, cx.d) ?? '' } } : {}),
|
|
61
|
+
...(st.bargeInAfterMs != null ? { bargeInAfterMs: st.bargeInAfterMs } : {}),
|
|
62
|
+
});
|
|
63
|
+
cx.d.playing = st.key;
|
|
64
|
+
cx.d.stepSpoke = false;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (st.kind === 'play') {
|
|
68
|
+
// A sequence read from the call: each record with its own text.
|
|
69
|
+
const items = st.play.records
|
|
70
|
+
? st.play.records(cx.core.view(cx.d)).map((record) => ({ record, text: cx.core.text(st.play.text, cx.d, record) ?? '' }))
|
|
71
|
+
: undefined;
|
|
72
|
+
const line = items ? items.map((x) => x.text).filter(Boolean).join(' ') : cx.core.text(st.play.text, cx.d) ?? '';
|
|
73
|
+
// A sequence is the call's data (a code): only its length is logged.
|
|
74
|
+
cx.log('opening_line', { step: k, alias: st.play.alias, ...(items ? { clips: items.length } : { text: line }) });
|
|
75
|
+
cx.fx.push({ type: 'playClip', key: st.key, play: st.play, text: line, ...(items ? { items } : {}), queued: true });
|
|
76
|
+
cx.d.openingSaid = [...cx.d.openingSaid, line];
|
|
77
|
+
if (!last) {
|
|
78
|
+
cx.d.playing = st.key;
|
|
79
|
+
cx.d.stepSpoke = false;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const said = st.kind === 'say' ? cx.sayText(st.text) : null;
|
|
85
|
+
const line = st.kind === 'say' ? said?.line ?? '' : question(cx, st.gate);
|
|
86
|
+
cx.log('opening_line', { step: k, alias: st.alias, text: line });
|
|
87
|
+
const sayOpts = { ...(st.bargeIn ? {} : { blocksBargeIn: true }), ...(said?.parts ? { parts: said.parts } : {}) };
|
|
88
|
+
cx.staticTurn(line, st.alias, Object.keys(sayOpts).length ? sayOpts : undefined);
|
|
89
|
+
cx.d.openingSaid = [...cx.d.openingSaid, line];
|
|
90
|
+
if (!last) {
|
|
91
|
+
cx.d.playing = st.key;
|
|
92
|
+
cx.d.stepSpoke = false;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.enter = enter;
|
|
98
|
+
/** The step runs on this call (`when`). */
|
|
99
|
+
function stepOn(cx, st) {
|
|
100
|
+
return !st.when || st.when(cx.core.view(cx.d));
|
|
101
|
+
}
|
|
102
|
+
exports.stepOn = stepOn;
|
|
103
|
+
function question(cx, gateId) {
|
|
104
|
+
const g = cx.v.gates.find((x) => x.id === gateId);
|
|
105
|
+
return cx.core.text(g.question, cx.d) ?? '';
|
|
106
|
+
}
|
|
107
|
+
exports.question = question;
|
|
108
|
+
/** The `language` step: the pick from the opening answer (or nothing). */
|
|
109
|
+
function pickLanguage(cx) {
|
|
110
|
+
const before = cx.d.beforeQuestion;
|
|
111
|
+
const answer = cx.d.openingAnswer;
|
|
112
|
+
const text = answer ?? before;
|
|
113
|
+
const named = text == null ? undefined : cx.v.language?.answers?.find((a) => a.test(text, cx.core.view(cx.d)));
|
|
114
|
+
const pick = named ? { language: named.language, reason: `opening_answer:${cx.langName(named.language)}`, provisional: false } : cx.v.ladder.decide(text);
|
|
115
|
+
cx.d.lang = pick.language;
|
|
116
|
+
cx.d.provisional = pick.provisional;
|
|
117
|
+
cx.d.askedLanguage = pick.language;
|
|
118
|
+
if (pick.reason.startsWith('explicit_language_request'))
|
|
119
|
+
cx.d.langRequested = true;
|
|
120
|
+
cx.log('opening_language', { language: pick.language, reason: pick.reason, provisional: pick.provisional });
|
|
121
|
+
}
|
|
122
|
+
exports.pickLanguage = pickLanguage;
|
|
123
|
+
function endOpening(cx) {
|
|
124
|
+
if (cx.env.voiceAnswerSteps)
|
|
125
|
+
cx.fx.push({ type: 'voiceAnswer', op: 'off' });
|
|
126
|
+
const before = cx.d.beforeQuestion;
|
|
127
|
+
const answer = cx.d.openingAnswer;
|
|
128
|
+
cx.d.firstReply = [before, answer].filter((t) => t != null).join('\n') || null;
|
|
129
|
+
cx.d.beforeQuestion = null;
|
|
130
|
+
cx.d.openingAnswer = null;
|
|
131
|
+
cx.d.phase = 'conversation';
|
|
132
|
+
cx.d.playing = null;
|
|
133
|
+
cx.d.rung = 0;
|
|
134
|
+
cx.d.handoffPending = cx.v.handoff != null;
|
|
135
|
+
if (cx.v.afterOpeningWindow)
|
|
136
|
+
cx.timing('openingEnd');
|
|
137
|
+
if (cx.d.result === core_1.BaseResult.GREETING_DROP && cx.cfg.greetingDropUntil === 'openingEnd')
|
|
138
|
+
cx.d.result = core_1.BaseResult.DEFAULT;
|
|
139
|
+
// The recognizer follows the pick now (`asrSwitch: 'openingEnd'`), not at the caller's next turn.
|
|
140
|
+
if (cx.v.language?.asrAtOpeningEnd)
|
|
141
|
+
(0, language_1.syncAsr)(cx);
|
|
142
|
+
// The answer kept for the LLM (no handoff text to carry it): the first turn now.
|
|
143
|
+
const toLlm = cx.d.toLlm;
|
|
144
|
+
cx.d.toLlm = null;
|
|
145
|
+
if (toLlm != null) {
|
|
146
|
+
(0, language_1.syncAsr)(cx);
|
|
147
|
+
cx.llmTurn((0, language_1.nextTurnText)(cx, toLlm));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
exports.endOpening = endOpening;
|
|
151
|
+
/** The opening's listen step got its line (or `null`: its silence rung said go on). */
|
|
152
|
+
function takeAnswer(cx, answer) {
|
|
153
|
+
cx.d.openingAnswer = answer;
|
|
154
|
+
enter(cx, cx.d.step + 1);
|
|
155
|
+
}
|
|
156
|
+
exports.takeAnswer = takeAnswer;
|
|
157
|
+
/** A caller line during the opening: the listen step's answer (or kept for it while a line plays). */
|
|
158
|
+
function openingLine(cx, text) {
|
|
159
|
+
const d = cx.d;
|
|
160
|
+
const st = cx.steps[d.step];
|
|
161
|
+
if (st?.kind === 'listen' && st.answer !== 'toLlm' && st.toLlmWhen?.(text, cx.core.view(d))) {
|
|
162
|
+
openingAnswerToLlm(cx, text);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const mode = st?.kind === 'listen' ? st.answer : 'toLlm';
|
|
166
|
+
d.callerFinals += 1;
|
|
167
|
+
cx.timing('realResult');
|
|
168
|
+
if (mode !== 'discard')
|
|
169
|
+
cx.addLine('caller', text);
|
|
170
|
+
if (mode === 'toLlm') {
|
|
171
|
+
d.callerTurns += 1;
|
|
172
|
+
d.heldTurns = 0;
|
|
173
|
+
if (d.result === core_1.BaseResult.GREETING_DROP)
|
|
174
|
+
d.result = core_1.BaseResult.DEFAULT;
|
|
175
|
+
}
|
|
176
|
+
// Rules of the opening phase read the answer.
|
|
177
|
+
const r = cx.core.rules(d, 'callerLine', text, 'turn', cx.run);
|
|
178
|
+
cx.set(r.state);
|
|
179
|
+
cx.fx.push(...r.effects);
|
|
180
|
+
if (cx.d.phase === 'closing')
|
|
181
|
+
return;
|
|
182
|
+
if (mode === 'toLlm' && cx.v.handoff == null)
|
|
183
|
+
cx.d.toLlm = text;
|
|
184
|
+
if (mode === 'toLlm')
|
|
185
|
+
takeAnswer(cx, text);
|
|
186
|
+
else {
|
|
187
|
+
cx.d.openingAnswer = null;
|
|
188
|
+
enter(cx, cx.d.step + 1);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
exports.openingLine = openingLine;
|
|
192
|
+
/**
|
|
193
|
+
* An opening answer that carries the caller's intent (`toLlmWhen`): it is the first LLM turn, the rest of the
|
|
194
|
+
* opening is skipped; an eager greeting not played is waited for first (the turn follows it in the LLM's history).
|
|
195
|
+
*/
|
|
196
|
+
function openingAnswerToLlm(cx, text) {
|
|
197
|
+
const d = cx.d;
|
|
198
|
+
d.callerFinals += 1;
|
|
199
|
+
d.callerTurns += 1;
|
|
200
|
+
d.heldTurns = 0;
|
|
201
|
+
cx.timing('realResult');
|
|
202
|
+
cx.addLine('caller', text);
|
|
203
|
+
if (d.result === core_1.BaseResult.GREETING_DROP)
|
|
204
|
+
d.result = core_1.BaseResult.DEFAULT;
|
|
205
|
+
const r = cx.core.rules(d, 'callerLine', text, 'turn', cx.run);
|
|
206
|
+
cx.set(r.state);
|
|
207
|
+
cx.fx.push(...r.effects);
|
|
208
|
+
if (cx.d.phase === 'closing')
|
|
209
|
+
return;
|
|
210
|
+
const greeting = cx.steps.slice(cx.d.step + 1).find((s) => s.kind === 'llmGreeting' && s.eager);
|
|
211
|
+
cx.log('opening_answer_to_llm', { userText: text, skipped: cx.steps.slice(cx.d.step + 1).map((s) => s.kind) });
|
|
212
|
+
cx.d.step = cx.steps.length;
|
|
213
|
+
cx.d.openingAnswer = text;
|
|
214
|
+
endOpening(cx);
|
|
215
|
+
(0, language_1.syncAsr)(cx);
|
|
216
|
+
cx.llmTurn((0, language_1.nextTurnText)(cx, text), greeting ? { after: { key: greeting.key, maxMs: greeting.waitMs } } : undefined);
|
|
217
|
+
}
|
|
218
|
+
exports.openingAnswerToLlm = openingAnswerToLlm;
|
|
219
|
+
/** Request the eager LLM lines of the opening from step `from` on (their `when` read now). */
|
|
220
|
+
function prefetchEager(cx, from) {
|
|
221
|
+
for (const [i, st] of cx.steps.entries()) {
|
|
222
|
+
if (i < from)
|
|
223
|
+
continue;
|
|
224
|
+
if (st.kind === 'llmGreeting' && st.eager && stepOn(cx, st))
|
|
225
|
+
cx.fx.push({ type: 'prefetchLlm', key: st.key, text: st.signal, ...cx.request(), ...greetingStream(st) });
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
exports.prefetchEager = prefetchEager;
|
|
229
|
+
/** `input.lookup` is in: the variables it brought; eager lines not reached yet are requested now. */
|
|
230
|
+
function inputUpdated(cx, vars, result) {
|
|
231
|
+
const d = cx.d;
|
|
232
|
+
d.inputVars = vars;
|
|
233
|
+
if (result && d.phase !== 'closing')
|
|
234
|
+
d.result = result;
|
|
235
|
+
if (!d.lookupPending)
|
|
236
|
+
return;
|
|
237
|
+
d.lookupPending = false;
|
|
238
|
+
cx.log('input_lookup_in', { result });
|
|
239
|
+
prefetchEager(cx, d.phase === 'opening' ? d.step + (d.playing != null ? 1 : 0) : cx.steps.length);
|
|
240
|
+
}
|
|
241
|
+
exports.inputUpdated = inputUpdated;
|
|
242
|
+
/** The listen step after a line played: speech heard over it is its answer (as `speechOverPrevious` says). */
|
|
243
|
+
function listenAfter(cx, listen) {
|
|
244
|
+
const d = cx.d;
|
|
245
|
+
const heard = d.overPrevious;
|
|
246
|
+
d.overPrevious = null;
|
|
247
|
+
const ageMs = cx.now() - d.overPreviousAt;
|
|
248
|
+
const answers = heard != null && listen.over !== 'drop' && (listen.keepWithinMs == null || ageMs <= listen.keepWithinMs);
|
|
249
|
+
d.beforeQuestion = answers || listen.over === 'drop' ? d.beforeQuestion : heard;
|
|
250
|
+
cx.log('opening_listening', { firstUserText: answers ? heard : null });
|
|
251
|
+
if (answers && heard != null)
|
|
252
|
+
(0, turn_1.callerLine)(cx, heard);
|
|
253
|
+
else
|
|
254
|
+
cx.timing('playbackEnd');
|
|
255
|
+
}
|
|
256
|
+
exports.listenAfter = listenAfter;
|
|
257
|
+
/** Voice without text during the opening: the listen step's answer (nothing), once no clip plays. */
|
|
258
|
+
function voiceAnswer(cx) {
|
|
259
|
+
const d = cx.d;
|
|
260
|
+
const m = cx.m;
|
|
261
|
+
if (d.phase !== 'opening' || m.callEnding || m.terminated)
|
|
262
|
+
return;
|
|
263
|
+
if (d.playing != null) {
|
|
264
|
+
cx.fx.push({ type: 'voiceAnswer', op: 'retry' });
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
const st = cx.steps[d.step];
|
|
268
|
+
if (st?.kind !== 'listen' || !st.voiceAnswer)
|
|
269
|
+
return;
|
|
270
|
+
cx.log('opening_voice_answer_taken', { step: d.step });
|
|
271
|
+
takeAnswer(cx, null);
|
|
272
|
+
}
|
|
273
|
+
exports.voiceAnswer = voiceAnswer;
|
|
274
|
+
/** The line, clip or greeting the opening waited for played out: the listen step after it, or the next step. */
|
|
275
|
+
function openingDrained(cx) {
|
|
276
|
+
const d = cx.d;
|
|
277
|
+
const st = cx.steps[d.step];
|
|
278
|
+
d.playing = null;
|
|
279
|
+
const mark = cx.fx.length;
|
|
280
|
+
if (st?.kind === 'listen') {
|
|
281
|
+
// A re-prompt of the listen step played out.
|
|
282
|
+
listenAfter(cx, st);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
if (st?.kind === 'llmGreeting') {
|
|
286
|
+
// Speech over the greeting is not an answer to anything.
|
|
287
|
+
d.overPrevious = null;
|
|
288
|
+
enter(cx, d.step + 1);
|
|
289
|
+
if (!cx.startedTurn(mark))
|
|
290
|
+
cx.timing('playbackEnd');
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const listen = cx.steps[d.step + 1];
|
|
294
|
+
if (st && listen?.kind === 'listen' && stepOn(cx, listen)) {
|
|
295
|
+
d.step += 1;
|
|
296
|
+
d.rung = 0;
|
|
297
|
+
listenAfter(cx, listen);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
d.overPrevious = null;
|
|
301
|
+
enter(cx, d.step + 1);
|
|
302
|
+
if (!cx.startedTurn(mark))
|
|
303
|
+
cx.timing('playbackEnd');
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
exports.openingDrained = openingDrained;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Turn } from './context';
|
|
2
|
+
/** `overtalk.overSilenceTurn: 'answer'`: words over the reply to a silence turn are answered at once, not buffered. */
|
|
3
|
+
export declare function overSilenceTurn(cx: Turn, text: string): boolean;
|
|
4
|
+
/** The caller's line the reply in flight answers (with what `startedBeforeReply` added to it). */
|
|
5
|
+
export declare function triggerText(cx: Turn): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* `overtalk.startedBeforeReply`: speech the caller began before the reply played is the rest of the line the reply
|
|
8
|
+
* answers — added to that caller line in the transcript and to the trigger line, not buffered.
|
|
9
|
+
*/
|
|
10
|
+
export declare function continuesTrigger(cx: Turn, text: string): boolean;
|
|
11
|
+
/** Buffer speech heard over the agent (`elapsedMs` into the reply's playback); false: the buffer kept its line. */
|
|
12
|
+
export declare function buffer(cx: Turn, text: string, elapsedMs?: number): boolean;
|
|
13
|
+
export declare function scheduleReplay(cx: Turn): void;
|
|
14
|
+
export declare function replayDue(cx: Turn): void;
|
|
15
|
+
/** A held backchannel goes to the LLM now: its marker goes with it. */
|
|
16
|
+
export declare function takeBackchannel(cx: Turn): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The agent's line played out with speech buffered over it: the answer now, dropped (reverse, before the reply or its
|
|
19
|
+
* question), held as a backchannel, or replayed after the gap. `silenceTurn`: the line was the reply to a silence turn.
|
|
20
|
+
*/
|
|
21
|
+
export declare function bufferDrained(cx: Turn, silenceTurn: boolean): void;
|