@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
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Turn = exports.turnEnv = void 0;
|
|
4
|
+
const actions_1 = require("./actions");
|
|
5
|
+
function turnEnv(core) {
|
|
6
|
+
const { cfg, v } = core;
|
|
7
|
+
const partialRuleIds = cfg.rules.filter((r) => r.on === 'callerPartial').map((r) => r.id);
|
|
8
|
+
return {
|
|
9
|
+
core, cfg, v, steps: v.steps,
|
|
10
|
+
voiceAnswerSteps: v.steps.some((s) => s.kind === 'listen' && s.voiceAnswer != null),
|
|
11
|
+
partialRuleIds, hasPartialRules: partialRuleIds.length > 0,
|
|
12
|
+
langName: (code) => v.ladder.name(code),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.turnEnv = turnEnv;
|
|
16
|
+
/** One step of the reducer: one event (or the call start, or a failure) on a copy of the state. */
|
|
17
|
+
class Turn {
|
|
18
|
+
constructor(env, d, m,
|
|
19
|
+
/** Words that say «yes» by language (a plain yes to the language question). */
|
|
20
|
+
yes = new Map()) {
|
|
21
|
+
this.env = env;
|
|
22
|
+
this.d = d;
|
|
23
|
+
this.m = m;
|
|
24
|
+
this.yes = yes;
|
|
25
|
+
this.fx = [];
|
|
26
|
+
/** Media turns this step started or superseded (the media's turn sequence after its effects). */
|
|
27
|
+
this.bumps = 0;
|
|
28
|
+
/** `turn.carryOn`: the line of the reply taken back, for this caller line's request. */
|
|
29
|
+
this.carriedLine = null;
|
|
30
|
+
/** Runs actions on a state (the rules pass and every block hand their actions to it). */
|
|
31
|
+
this.run = (s0, actions, ctx) => (0, actions_1.runActions)(this, s0, actions, ctx);
|
|
32
|
+
this.core = env.core;
|
|
33
|
+
this.cfg = env.cfg;
|
|
34
|
+
this.v = env.v;
|
|
35
|
+
this.steps = env.steps;
|
|
36
|
+
this.langName = env.langName;
|
|
37
|
+
}
|
|
38
|
+
log(message, data) {
|
|
39
|
+
this.fx.push({ type: 'log', message, data });
|
|
40
|
+
}
|
|
41
|
+
now() {
|
|
42
|
+
return this.m?.now ?? 0;
|
|
43
|
+
}
|
|
44
|
+
set(s) {
|
|
45
|
+
this.d = { ...s };
|
|
46
|
+
}
|
|
47
|
+
timing(op, value) {
|
|
48
|
+
this.fx.push({ type: 'timing', op, ...(value != null ? { value } : {}) });
|
|
49
|
+
}
|
|
50
|
+
clearReplay() {
|
|
51
|
+
this.d.replayHoldAt = 0;
|
|
52
|
+
this.fx.push({ type: 'clearReplay' });
|
|
53
|
+
}
|
|
54
|
+
addLine(who, text, unit) {
|
|
55
|
+
const t = text.trim();
|
|
56
|
+
if (t)
|
|
57
|
+
this.d.lines = [...this.d.lines, { who, text: t, ...(unit != null ? { unit } : {}) }];
|
|
58
|
+
}
|
|
59
|
+
agentLines() {
|
|
60
|
+
return this.d.lines.filter((l) => l.who === 'agent').map((l) => l.text);
|
|
61
|
+
}
|
|
62
|
+
/** Caller lines since the agent's last line. */
|
|
63
|
+
callerSinceAgent() {
|
|
64
|
+
const out = [];
|
|
65
|
+
for (let i = this.d.lines.length - 1; i >= 0 && this.d.lines[i].who === 'caller'; i--)
|
|
66
|
+
out.unshift(this.d.lines[i].text);
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
staticTurn(text, alias, opts) {
|
|
70
|
+
this.d.answerOver = false;
|
|
71
|
+
this.fx.push({ type: 'staticTurn', text, alias, ...(opts ? { opts } : {}) });
|
|
72
|
+
}
|
|
73
|
+
/** A fixed text, or a list of parts said one after another (empty parts left out); `null`: nothing to say. */
|
|
74
|
+
sayText(t, line, ruleCount) {
|
|
75
|
+
if (!Array.isArray(t)) {
|
|
76
|
+
const one = this.core.text(t, this.d, line, undefined, ruleCount);
|
|
77
|
+
return one ? { line: one } : null;
|
|
78
|
+
}
|
|
79
|
+
const parts = t.map((x) => this.core.text(x, this.d, line, undefined, ruleCount)).filter((x) => !!x && x.trim().length > 0);
|
|
80
|
+
if (!parts.length)
|
|
81
|
+
return null;
|
|
82
|
+
return { line: parts.join(' '), ...(parts.length > 1 ? { parts } : {}) };
|
|
83
|
+
}
|
|
84
|
+
/** Reply language and the agent file's prompt variables of an LLM request now. */
|
|
85
|
+
request() {
|
|
86
|
+
const view = this.core.view(this.d);
|
|
87
|
+
const payload = this.v.promptVars ? this.v.promptVars(view) : null;
|
|
88
|
+
return { replyLanguage: this.langName(this.d.lang), provisional: this.d.provisional, ...(payload ? { payload } : {}) };
|
|
89
|
+
}
|
|
90
|
+
llmTurn(text, extra) {
|
|
91
|
+
this.d.answerOver = false;
|
|
92
|
+
if (this.cfg.noLlm) {
|
|
93
|
+
// No LLM: the line nothing answered stays in the transcript; the silence windows go on.
|
|
94
|
+
this.log('turn_not_answered', { text });
|
|
95
|
+
this.timing('playbackEnd');
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.bumps += 1;
|
|
99
|
+
this.d.replying = true;
|
|
100
|
+
this.d.replyFor = null;
|
|
101
|
+
this.d.lastRequest = text;
|
|
102
|
+
this.fx.push({ type: 'llmTurn', text, ...this.request(), ...(extra ?? {}) });
|
|
103
|
+
}
|
|
104
|
+
/** A fixed line (not a closing line) the LLM did not say: noted for the caller's next turn (`systemNotes`). */
|
|
105
|
+
note(line) {
|
|
106
|
+
if (this.v.systemNotes == null || this.d.phase === 'opening')
|
|
107
|
+
return;
|
|
108
|
+
this.d.notes = [...this.d.notes, line];
|
|
109
|
+
}
|
|
110
|
+
/** The notes in front of the caller's text, taken once. */
|
|
111
|
+
takeNotes(text) {
|
|
112
|
+
const notes = this.d.notes;
|
|
113
|
+
if (!notes.length || this.v.systemNotes == null)
|
|
114
|
+
return text;
|
|
115
|
+
this.d.notes = [];
|
|
116
|
+
const mark = this.v.systemNotes;
|
|
117
|
+
return `${notes.map((l) => mark.replace(/\{line\}/g, l)).join(' ')} ${text}`;
|
|
118
|
+
}
|
|
119
|
+
/** An LLM turn whose text comes later (`heldText`): it starts now, with a filler after `afterMs`. */
|
|
120
|
+
heldTurn(key, heard, filler) {
|
|
121
|
+
this.d.replying = true;
|
|
122
|
+
this.fx.push({ type: 'llmTurn', text: heard, ...this.request(), held: { key, filler } });
|
|
123
|
+
}
|
|
124
|
+
/** A clip of an action (re-prompt); during a listen step the step waits for it and takes speech over it. */
|
|
125
|
+
playClip(p, text, items) {
|
|
126
|
+
const key = `play-${this.d.lines.length}`;
|
|
127
|
+
this.fx.push({ type: 'playClip', key, play: p, text, ...(items ? { items } : {}) });
|
|
128
|
+
if (this.d.phase === 'opening' && this.steps[this.d.step]?.kind === 'listen') {
|
|
129
|
+
this.d.playing = key;
|
|
130
|
+
this.d.stepSpoke = false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
setHold(on) {
|
|
134
|
+
if (this.d.held === on)
|
|
135
|
+
return;
|
|
136
|
+
this.d.held = on;
|
|
137
|
+
this.d.heldTurns = 0;
|
|
138
|
+
this.log(on ? 'hold_started' : 'hold_released');
|
|
139
|
+
this.timing('handover', on);
|
|
140
|
+
}
|
|
141
|
+
setLanguage(code, reason) {
|
|
142
|
+
this.d.provisional = false;
|
|
143
|
+
this.d.langRequested = true;
|
|
144
|
+
if (code === this.d.lang)
|
|
145
|
+
return;
|
|
146
|
+
this.d.lang = code;
|
|
147
|
+
this.d.langReason = this.d.handoffPending ? null : reason;
|
|
148
|
+
}
|
|
149
|
+
/** A turn effect (a line, a clip, an LLM turn) went out since effect `mark`. */
|
|
150
|
+
startedTurn(mark) {
|
|
151
|
+
return this.fx.slice(mark).some((e) => e.type === 'staticTurn' || e.type === 'llmTurn' || e.type === 'playClip' || e.type === 'playLlm' || e.type === 'hangupNow');
|
|
152
|
+
}
|
|
153
|
+
/** The media's turn sequence once this step's effects ran. */
|
|
154
|
+
turnSeqNow() {
|
|
155
|
+
return (this.m?.turnSeq ?? 0) + this.bumps;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.Turn = Turn;
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import type { Action, CallView, Text } from '../../spec';
|
|
2
|
+
import type { EngineDialogConfig, EnginePlay, EngineRule, EngineTransfer, VoiceDialogConfig } from '../config';
|
|
3
|
+
import type { EngineEffect, EngineState } from '../dialog';
|
|
4
|
+
/** What the media side knows at the moment of an event. */
|
|
5
|
+
export interface VoiceSnapshot {
|
|
6
|
+
readonly now: number;
|
|
7
|
+
readonly agentSpeaking: boolean;
|
|
8
|
+
readonly agentTurnInterrupted: boolean;
|
|
9
|
+
/** When the caller started hearing the current line (`now` while nothing has played yet). */
|
|
10
|
+
readonly playbackStartedAt: number;
|
|
11
|
+
/** Text of the request behind the current reply (echo check). */
|
|
12
|
+
readonly lastTurnTriggerText: string | null;
|
|
13
|
+
readonly closingPhraseActive: boolean;
|
|
14
|
+
readonly callEnding: boolean;
|
|
15
|
+
readonly terminated: boolean;
|
|
16
|
+
readonly userSpeaking: boolean;
|
|
17
|
+
/** When the LLM turn in flight was requested, while it has not streamed a chunk yet (0: none waiting). */
|
|
18
|
+
readonly llmWaitingSince?: number;
|
|
19
|
+
/** When the current agent turn started; when the last line's first audio started (kept after its drain). */
|
|
20
|
+
readonly turnStartedAt?: number;
|
|
21
|
+
readonly lastPlaybackStartedAt?: number;
|
|
22
|
+
/** When the current turn's latest agent-queue item (its latest sentence) started (0: none yet). */
|
|
23
|
+
readonly lastItemStartedAt?: number;
|
|
24
|
+
/** When the caller's current run of speech began (0: never spoke); the hangup was sent (nothing can reopen). */
|
|
25
|
+
readonly speechRunStartedAt?: number;
|
|
26
|
+
readonly hangupSent?: boolean;
|
|
27
|
+
/** When the utterance behind a caller final began (VAD start; 0: unknown); sequence number of the agent turn. */
|
|
28
|
+
readonly userSpeechStartedAt?: number;
|
|
29
|
+
readonly turnSeq?: number;
|
|
30
|
+
/** The caller cut the current turn: how long it had played then (`null`: nothing had played). */
|
|
31
|
+
readonly cutHeardMs?: number | null;
|
|
32
|
+
/** When the caller's last partial with words came (0 / absent: none yet). */
|
|
33
|
+
readonly lastPartialAt?: number;
|
|
34
|
+
/** When the last part of the fixed line now playing started (0 / absent: not yet). */
|
|
35
|
+
readonly lastPartStartedAt?: number;
|
|
36
|
+
}
|
|
37
|
+
/** A silence window that ran out: which count it walked and what was heard in it. */
|
|
38
|
+
export interface SilenceFacts {
|
|
39
|
+
/** Silence turns in a row of any kind (the `{attempt}` of the marker). */
|
|
40
|
+
readonly attempt: number;
|
|
41
|
+
/** True silences in a row (how far the ladder walked). */
|
|
42
|
+
readonly silentTurns: number;
|
|
43
|
+
/** Voice was heard in the window and no text came of it. */
|
|
44
|
+
readonly heardSpeech: boolean;
|
|
45
|
+
/** The line is held and the held ladder still runs. */
|
|
46
|
+
readonly awaitingHandover: boolean;
|
|
47
|
+
/** The ladder ran out (more true silences than rungs before the last). */
|
|
48
|
+
readonly exhausted: boolean;
|
|
49
|
+
}
|
|
50
|
+
export type VoiceEvent = {
|
|
51
|
+
type: 'CALLER_FINAL';
|
|
52
|
+
text: string;
|
|
53
|
+
m: VoiceSnapshot;
|
|
54
|
+
}
|
|
55
|
+
/** The vendor's wording of the last final (`virtual`), which an early final already answered. */
|
|
56
|
+
| {
|
|
57
|
+
type: 'CALLER_FINAL_REWORDED';
|
|
58
|
+
text: string;
|
|
59
|
+
virtual: string;
|
|
60
|
+
} | {
|
|
61
|
+
type: 'CALLER_DROPPED';
|
|
62
|
+
text: string;
|
|
63
|
+
reason: string;
|
|
64
|
+
m: VoiceSnapshot;
|
|
65
|
+
}
|
|
66
|
+
/** The caller began speaking / has words so far (only with `turn.carryOn`). */
|
|
67
|
+
| {
|
|
68
|
+
type: 'CALLER_SPEECH_START';
|
|
69
|
+
m: VoiceSnapshot;
|
|
70
|
+
} | {
|
|
71
|
+
type: 'CALLER_PARTIAL';
|
|
72
|
+
text: string;
|
|
73
|
+
m: VoiceSnapshot;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'AGENT_DRAINED';
|
|
76
|
+
m: VoiceSnapshot;
|
|
77
|
+
}
|
|
78
|
+
/** An LLM goodbye was said in full and its hangup waits for the playback (`closing.reopenOnSpeech`). */
|
|
79
|
+
| {
|
|
80
|
+
type: 'GOODBYE_STARTED';
|
|
81
|
+
m: VoiceSnapshot;
|
|
82
|
+
} | {
|
|
83
|
+
type: 'AGENT_SPOKEN';
|
|
84
|
+
text: string;
|
|
85
|
+
unit?: string | null;
|
|
86
|
+
} | {
|
|
87
|
+
type: 'CALL_RESULT';
|
|
88
|
+
result: string;
|
|
89
|
+
} | {
|
|
90
|
+
type: 'SILENCE_TIMEOUT';
|
|
91
|
+
timeout: SilenceFacts;
|
|
92
|
+
m: VoiceSnapshot;
|
|
93
|
+
} | {
|
|
94
|
+
type: 'AUDIO_DEAD';
|
|
95
|
+
m: VoiceSnapshot;
|
|
96
|
+
} | {
|
|
97
|
+
type: 'NO_PROGRESS';
|
|
98
|
+
m: VoiceSnapshot;
|
|
99
|
+
}
|
|
100
|
+
/** The opening's listen step heard voice without text (`voiceWithoutTextMs`). */
|
|
101
|
+
| {
|
|
102
|
+
type: 'VOICE_ANSWER';
|
|
103
|
+
m: VoiceSnapshot;
|
|
104
|
+
} | {
|
|
105
|
+
type: 'REPLAY_DUE';
|
|
106
|
+
m: VoiceSnapshot;
|
|
107
|
+
}
|
|
108
|
+
/** `input.lookup` is in: the call's variables built again (and the call's result from now on, if it says one). */
|
|
109
|
+
| {
|
|
110
|
+
type: 'INPUT_UPDATED';
|
|
111
|
+
vars: Readonly<Record<string, unknown>>;
|
|
112
|
+
result: string | null;
|
|
113
|
+
}
|
|
114
|
+
/** NLU answered for an asynchronous rule (`intents`: those found; `null`: no answer). */
|
|
115
|
+
| {
|
|
116
|
+
type: 'CLASSIFIED';
|
|
117
|
+
key: string;
|
|
118
|
+
intents: readonly string[] | null;
|
|
119
|
+
m: VoiceSnapshot;
|
|
120
|
+
}
|
|
121
|
+
/** An asynchronous rule is still waiting after `whileWaiting.afterMs`. */
|
|
122
|
+
| {
|
|
123
|
+
type: 'WAITING_FILLER';
|
|
124
|
+
key: string;
|
|
125
|
+
m: VoiceSnapshot;
|
|
126
|
+
}
|
|
127
|
+
/** The hook of a rule answers later: the LLM turn starts now and waits for its text. */
|
|
128
|
+
| {
|
|
129
|
+
type: 'HOOK_WAITING';
|
|
130
|
+
key: string;
|
|
131
|
+
m: VoiceSnapshot;
|
|
132
|
+
}
|
|
133
|
+
/** The hook of a rule answered (its actions; empty: the rule does not act). */
|
|
134
|
+
| {
|
|
135
|
+
type: 'HOOK_RESULT';
|
|
136
|
+
key: string;
|
|
137
|
+
actions: readonly Action[];
|
|
138
|
+
m: VoiceSnapshot;
|
|
139
|
+
}
|
|
140
|
+
/** The reply that played is the transfer (the transfer's tool latched on it, or it is the spoken transfer line). */
|
|
141
|
+
| {
|
|
142
|
+
type: 'TRANSFER_REPLY';
|
|
143
|
+
via: 'tool' | 'spoken';
|
|
144
|
+
spokeWords: boolean;
|
|
145
|
+
blank?: boolean;
|
|
146
|
+
trigger?: string;
|
|
147
|
+
m: VoiceSnapshot;
|
|
148
|
+
}
|
|
149
|
+
/** Empty LLM replies in a row reached the limit (`errored`: the last one carried the LLM's error event); `probe`: say it. */
|
|
150
|
+
| {
|
|
151
|
+
type: 'EMPTY_EXHAUSTED';
|
|
152
|
+
errored: boolean;
|
|
153
|
+
probe?: number;
|
|
154
|
+
m: VoiceSnapshot;
|
|
155
|
+
}
|
|
156
|
+
/** The reply guard held back a reply and replaced it with this line (`closing.guard`). */
|
|
157
|
+
| {
|
|
158
|
+
type: 'GUARD_REPLACED';
|
|
159
|
+
text: string;
|
|
160
|
+
alias?: string;
|
|
161
|
+
close?: {
|
|
162
|
+
result: string;
|
|
163
|
+
reason?: string;
|
|
164
|
+
};
|
|
165
|
+
m: VoiceSnapshot;
|
|
166
|
+
}
|
|
167
|
+
/** A `stream` reply filter's call variables of a reply that ended having said something. */
|
|
168
|
+
| {
|
|
169
|
+
type: 'REPLY_VARS';
|
|
170
|
+
vars: Readonly<Record<string, unknown>>;
|
|
171
|
+
}
|
|
172
|
+
/** A detector set a flag of the call. */
|
|
173
|
+
| {
|
|
174
|
+
type: 'FLAG';
|
|
175
|
+
flag: string;
|
|
176
|
+
m: VoiceSnapshot;
|
|
177
|
+
}
|
|
178
|
+
/** The reply in flight called a tool (rules `on: 'toolCall'` read its name). */
|
|
179
|
+
| {
|
|
180
|
+
type: 'TOOL_CALL';
|
|
181
|
+
name: string;
|
|
182
|
+
m: VoiceSnapshot;
|
|
183
|
+
}
|
|
184
|
+
/** The agent's reply reads as this recognizer key (`voice.asrByReply`). */
|
|
185
|
+
| {
|
|
186
|
+
type: 'REPLY_ASR';
|
|
187
|
+
key: string;
|
|
188
|
+
}
|
|
189
|
+
/** The operator leg is bridged to the caller. */
|
|
190
|
+
| {
|
|
191
|
+
type: 'TRANSFER_BRIDGED';
|
|
192
|
+
}
|
|
193
|
+
/** The transfer failed with the caller still on the line. */
|
|
194
|
+
| {
|
|
195
|
+
type: 'TRANSFER_FAILED';
|
|
196
|
+
failure: string;
|
|
197
|
+
m: VoiceSnapshot;
|
|
198
|
+
}
|
|
199
|
+
/** `turn.review` dropped the reply unspoken: its actions. */
|
|
200
|
+
| {
|
|
201
|
+
type: 'REVIEW_ACTIONS';
|
|
202
|
+
actions: readonly Action[];
|
|
203
|
+
m: VoiceSnapshot;
|
|
204
|
+
}
|
|
205
|
+
/** What the caller heard of a conversation reply: all of it as the current turn (`heard`), or not (state blocks). */
|
|
206
|
+
| {
|
|
207
|
+
type: 'REPLY_PLAYED';
|
|
208
|
+
text: string;
|
|
209
|
+
heard: boolean;
|
|
210
|
+
};
|
|
211
|
+
export type VoiceEffect = {
|
|
212
|
+
type: 'log';
|
|
213
|
+
message: string;
|
|
214
|
+
data?: Record<string, unknown>;
|
|
215
|
+
}
|
|
216
|
+
/** Fixed text; `hangupReason`: a closing line (uninterruptible, the call hangs up after it). */
|
|
217
|
+
| {
|
|
218
|
+
type: 'staticTurn';
|
|
219
|
+
text: string;
|
|
220
|
+
alias: string;
|
|
221
|
+
opts?: {
|
|
222
|
+
hangupReason?: string;
|
|
223
|
+
blocksBargeIn?: boolean;
|
|
224
|
+
parts?: readonly string[];
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/** A turn whose line comes later (an agent without an LLM waits for a hook): the agent stops, silence waits. */
|
|
228
|
+
| {
|
|
229
|
+
type: 'pendingTurn';
|
|
230
|
+
}
|
|
231
|
+
/** Fixed lines into the TTS cache (`voice.tts.presay`). */
|
|
232
|
+
| {
|
|
233
|
+
type: 'presay';
|
|
234
|
+
texts: readonly string[];
|
|
235
|
+
}
|
|
236
|
+
/** An LLM turn; `held`: its text comes later (`heldText`), a filler is said after `afterMs` meanwhile. */
|
|
237
|
+
| {
|
|
238
|
+
type: 'llmTurn';
|
|
239
|
+
text: string;
|
|
240
|
+
replyLanguage: string;
|
|
241
|
+
provisional: boolean;
|
|
242
|
+
payload?: Record<string, unknown>;
|
|
243
|
+
held?: {
|
|
244
|
+
key: string;
|
|
245
|
+
filler: {
|
|
246
|
+
text: string;
|
|
247
|
+
afterMs: number;
|
|
248
|
+
} | null;
|
|
249
|
+
};
|
|
250
|
+
/** The caller's words the turn answers (echo check), and the text an empty reply is asked again with. */
|
|
251
|
+
trigger?: string;
|
|
252
|
+
retry?: string;
|
|
253
|
+
/** Request it once the eager LLM line `key` has streamed (at most `maxMs`): it was not played, the turn follows it. */
|
|
254
|
+
after?: {
|
|
255
|
+
key: string;
|
|
256
|
+
maxMs: number;
|
|
257
|
+
};
|
|
258
|
+
} | {
|
|
259
|
+
type: 'heldText';
|
|
260
|
+
key: string;
|
|
261
|
+
text: string;
|
|
262
|
+
}
|
|
263
|
+
/** Run an agent hook of a rule on the caller's line; its answer comes back as `HOOK_WAITING` / `HOOK_RESULT`. */
|
|
264
|
+
| {
|
|
265
|
+
type: 'runHook';
|
|
266
|
+
key: string;
|
|
267
|
+
name: string;
|
|
268
|
+
line: string;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* The transfer starts: `say` before it (when the agent file has a transfer text for this reply), the operator leg's
|
|
272
|
+
* headers and whisper, the target as the agent file gives it (the ports resolve its sources).
|
|
273
|
+
*/
|
|
274
|
+
| {
|
|
275
|
+
type: 'transfer';
|
|
276
|
+
mode: EngineTransfer['mode'];
|
|
277
|
+
say: string | null;
|
|
278
|
+
alias: string;
|
|
279
|
+
whisper: string | null;
|
|
280
|
+
headers: Readonly<Record<string, string>>;
|
|
281
|
+
target: EngineTransfer['target'];
|
|
282
|
+
/** Played instead of `say` when it gave nothing (`transfer.text.clip`). */
|
|
283
|
+
clip?: {
|
|
284
|
+
readonly url?: string;
|
|
285
|
+
readonly record?: string;
|
|
286
|
+
readonly text: string;
|
|
287
|
+
readonly playMs: number;
|
|
288
|
+
} | null;
|
|
289
|
+
}
|
|
290
|
+
/** Hang up after `tailMs` (default `closing.hangupGraceMs`). */
|
|
291
|
+
| {
|
|
292
|
+
type: 'hangupNow';
|
|
293
|
+
reason: string;
|
|
294
|
+
tailMs?: number;
|
|
295
|
+
}
|
|
296
|
+
/** Cancel the pending hangup of a goodbye: the call goes on (`closing.reopenOnSpeech`). */
|
|
297
|
+
| {
|
|
298
|
+
type: 'reopen';
|
|
299
|
+
reason: string;
|
|
300
|
+
}
|
|
301
|
+
/** Start the LLM request of an opening line now and keep its stream (the eager greeting). */
|
|
302
|
+
| {
|
|
303
|
+
type: 'prefetchLlm';
|
|
304
|
+
key: string;
|
|
305
|
+
text: string;
|
|
306
|
+
replyLanguage: string;
|
|
307
|
+
provisional: boolean;
|
|
308
|
+
payload?: Record<string, unknown>;
|
|
309
|
+
/** The stream ends empty after this long without a chunk; `emptyOnError`: a failed stream ends empty too. */
|
|
310
|
+
firstTokenMs?: number;
|
|
311
|
+
emptyOnError?: boolean;
|
|
312
|
+
}
|
|
313
|
+
/** Play the LLM line of `key` (requested now when it was not prefetched); it plays out whole. */
|
|
314
|
+
| {
|
|
315
|
+
type: 'playLlm';
|
|
316
|
+
key: string;
|
|
317
|
+
alias: string;
|
|
318
|
+
text: string;
|
|
319
|
+
replyLanguage: string;
|
|
320
|
+
provisional: boolean;
|
|
321
|
+
payload?: Record<string, unknown>;
|
|
322
|
+
firstTokenMs?: number;
|
|
323
|
+
emptyOnError?: boolean;
|
|
324
|
+
/** Said when the line streamed nothing (its text resolved); the caller can cut the line after `bargeInAfterMs`. */
|
|
325
|
+
fallback?: {
|
|
326
|
+
play: EnginePlay;
|
|
327
|
+
text: string;
|
|
328
|
+
};
|
|
329
|
+
bargeInAfterMs?: number;
|
|
330
|
+
}
|
|
331
|
+
/** A clip (CMS record, URL, or TTS of its text) and its tail. */
|
|
332
|
+
| {
|
|
333
|
+
type: 'playClip';
|
|
334
|
+
key: string;
|
|
335
|
+
play: EnginePlay;
|
|
336
|
+
text: string;
|
|
337
|
+
items?: readonly ClipItem[];
|
|
338
|
+
queued?: boolean;
|
|
339
|
+
} | {
|
|
340
|
+
type: 'timing';
|
|
341
|
+
op: 'playbackEnd' | 'realResult' | 'refund' | 'handover' | 'openingEnd';
|
|
342
|
+
value?: boolean;
|
|
343
|
+
} | {
|
|
344
|
+
type: 'armReplay';
|
|
345
|
+
ms: number;
|
|
346
|
+
}
|
|
347
|
+
/** The opening's voice-without-text answer: on (from the call start), off (the greeting starts), or asked again shortly. */
|
|
348
|
+
| {
|
|
349
|
+
type: 'voiceAnswer';
|
|
350
|
+
op: 'on' | 'off' | 'retry';
|
|
351
|
+
} | {
|
|
352
|
+
type: 'clearReplay';
|
|
353
|
+
}
|
|
354
|
+
/** The reply in flight is taken back (superseded and stopped); no turn starts (`turn.carryOn`). */
|
|
355
|
+
| {
|
|
356
|
+
type: 'cutReply';
|
|
357
|
+
} | {
|
|
358
|
+
type: 'switchAsr';
|
|
359
|
+
language: string;
|
|
360
|
+
} | {
|
|
361
|
+
type: 'classify';
|
|
362
|
+
key: string;
|
|
363
|
+
text: string;
|
|
364
|
+
intents: readonly string[];
|
|
365
|
+
fillerAfterMs?: number;
|
|
366
|
+
nlu?: {
|
|
367
|
+
language?: string;
|
|
368
|
+
timeoutMs?: number;
|
|
369
|
+
normalized?: boolean;
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
/** An NLU request at answer whose answer is ignored (the first request of a call is slow). */
|
|
373
|
+
| {
|
|
374
|
+
type: 'warmUpNlu';
|
|
375
|
+
text: string;
|
|
376
|
+
intents: readonly string[];
|
|
377
|
+
language?: string;
|
|
378
|
+
};
|
|
379
|
+
/** One clip of a sequence (`PlaySpec.records`): its record and its text. */
|
|
380
|
+
export interface ClipItem {
|
|
381
|
+
readonly record: string;
|
|
382
|
+
readonly text: string;
|
|
383
|
+
}
|
|
384
|
+
/** What the voice part reads of the rest of the reducer. */
|
|
385
|
+
export interface VoiceCore {
|
|
386
|
+
readonly cfg: EngineDialogConfig;
|
|
387
|
+
readonly v: VoiceDialogConfig;
|
|
388
|
+
view(s: EngineState): CallView;
|
|
389
|
+
/** `ruleCount`: the acting rule's count (`{ nth }`). */
|
|
390
|
+
text(t: Text, s: EngineState, line?: string, vars?: Readonly<Record<string, unknown>>, ruleCount?: number): string | null;
|
|
391
|
+
decide(at: 'goodbye' | 'silenceLimit' | 'callEnd' | undefined, s: EngineState, result: string): string;
|
|
392
|
+
/** The rules pass on one event (the runner is the voice part's). */
|
|
393
|
+
rules(s: EngineState, on: EngineRule['on'], line: string, id: string, runner: Runner, asyncHits?: ReadonlySet<string>, hookActions?: ReadonlyMap<string, readonly Action[]>): Done;
|
|
394
|
+
}
|
|
395
|
+
export interface Done {
|
|
396
|
+
readonly state: EngineState;
|
|
397
|
+
readonly effects: EngineEffect[];
|
|
398
|
+
readonly answered: boolean;
|
|
399
|
+
readonly next: boolean;
|
|
400
|
+
}
|
|
401
|
+
export type Runner = (s: EngineState, actions: readonly Action[], ctx: RunContext) => Done;
|
|
402
|
+
/** Where actions run: the line they answer, the result point, the id they log and alias by. */
|
|
403
|
+
export interface RunContext {
|
|
404
|
+
readonly line?: string;
|
|
405
|
+
readonly at?: 'goodbye' | 'silenceLimit' | 'callEnd';
|
|
406
|
+
readonly id: string;
|
|
407
|
+
}
|
|
408
|
+
/** Flag of a call whose goodbye answered a silence turn (the LLM closed the call on the silence ladder). */
|
|
409
|
+
export declare const GOODBYE_AFTER_SILENCE = "closing.afterSilence";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GOODBYE_AFTER_SILENCE = void 0;
|
|
4
|
+
/** Flag of a call whose goodbye answered a silence turn (the LLM closed the call on the silence ladder). */
|
|
5
|
+
exports.GOODBYE_AFTER_SILENCE = 'closing.afterSilence';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Action, AnyHook, CallView } from '../../spec';
|
|
2
|
+
import type { Condition, Expr, ExprContext } from '../../expr/types';
|
|
3
|
+
/**
|
|
4
|
+
* `turn.review` as rules (first whose `when` holds; no `when`: always). Conditions and values read the review's input
|
|
5
|
+
* as `{ input: 'request' | 'trigger' | 'regenerated' | 'silence' | 'held' | 'final' }` and the caller's words as `line`.
|
|
6
|
+
* - `start` (asked at the start of every LLM turn but the greeting): `{ holdChars }` holds the reply until its first
|
|
7
|
+
* sentence ended and that many more characters came; `null` (or no rule) speaks it as it comes;
|
|
8
|
+
* - `held` (asked each time the held text grows): `'wait'` (or no rule) keeps holding (spoken when the hold is over),
|
|
9
|
+
* `'release'` speaks it now, `{ regenerate }` asks the LLM again with that text (nothing of the reply is spoken),
|
|
10
|
+
* `{ then }` runs the actions when the stream ended (nothing is spoken).
|
|
11
|
+
*/
|
|
12
|
+
export interface ReviewRules {
|
|
13
|
+
readonly start: readonly {
|
|
14
|
+
readonly when?: Condition;
|
|
15
|
+
readonly then: {
|
|
16
|
+
readonly holdChars: Expr;
|
|
17
|
+
} | null;
|
|
18
|
+
}[];
|
|
19
|
+
readonly held: readonly {
|
|
20
|
+
readonly when?: Condition;
|
|
21
|
+
readonly then: 'release' | 'wait' | {
|
|
22
|
+
readonly regenerate: Expr;
|
|
23
|
+
} | {
|
|
24
|
+
readonly then: Action | readonly Action[];
|
|
25
|
+
};
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
28
|
+
/** The review hook of rules. */
|
|
29
|
+
export declare function reviewRulesHook(spec: ReviewRules, path: string, ctxOf: (call: CallView, extra: Partial<ExprContext>) => ExprContext, actions: <T extends Action | readonly Action[]>(x: T, path: string) => T): AnyHook;
|
|
30
|
+
/**
|
|
31
|
+
* `transfer.toolReply` as data: the reply on which the LLM called the transfer's tool.
|
|
32
|
+
* - `overOnQuestion`: the reply so far ends with `?` → it is over there;
|
|
33
|
+
* - `overAfter`: from the first of `phrases` (contained, any case) to its sentence end (`.`, `!`, `?`) the transfer
|
|
34
|
+
* line is said; another sentence end after it → over; otherwise the text after it (and the chunk coming) must
|
|
35
|
+
* still be a beginning of `oneMoreStartingWith` (any case; absent: nothing may follow) or the reply is over;
|
|
36
|
+
* - `dropOn` (when the reply ended): `question` — it ends with `?`; `goodbye` — it ends on the goodbye marker, is not
|
|
37
|
+
* only `emptyGoodbye` and does not hold `unless` (its `line` is the reply): the tool call is dropped.
|
|
38
|
+
*/
|
|
39
|
+
export interface ToolReplySpec {
|
|
40
|
+
readonly overOnQuestion?: boolean;
|
|
41
|
+
readonly overAfter?: {
|
|
42
|
+
readonly phrases: readonly string[];
|
|
43
|
+
readonly oneMoreStartingWith?: string;
|
|
44
|
+
};
|
|
45
|
+
readonly dropOn?: {
|
|
46
|
+
readonly question?: boolean;
|
|
47
|
+
readonly goodbye?: {
|
|
48
|
+
readonly unless?: Condition;
|
|
49
|
+
readonly emptyGoodbye?: RegExp;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** Whether the transfer line is over (`overAfter`). */
|
|
54
|
+
export declare function transferLineOver(o: NonNullable<ToolReplySpec['overAfter']>, soFar: string, next: string): boolean;
|
|
55
|
+
/** The tool-reply hook of the data form. */
|
|
56
|
+
export declare function toolReplyHook(spec: ToolReplySpec, ctxOf: (call: CallView, extra: Partial<ExprContext>) => ExprContext): AnyHook;
|
|
57
|
+
/** `holdWhileSpeaking.extend` as data: keep waiting while a partial with text came within `whilePartialWithinMs` and the line was held less than `maxHeldMs`. */
|
|
58
|
+
export interface HoldExtendSpec {
|
|
59
|
+
readonly whilePartialWithinMs: number;
|
|
60
|
+
readonly maxHeldMs: number;
|
|
61
|
+
}
|
|
62
|
+
export declare function holdExtendHook(spec: HoldExtendSpec): AnyHook;
|