@voctiv/agent-runtime 0.2.1 → 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 +8 -2
- 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,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NO_STANDARD_LEXICONS = exports.listenOnlyFormat = void 0;
|
|
4
|
+
const shared_1 = require("./shared");
|
|
5
|
+
function listenOnlyFormat(_code) {
|
|
6
|
+
return {
|
|
7
|
+
number: (n) => (0, shared_1.figureNumber)(n),
|
|
8
|
+
amount: (n, currency) => (0, shared_1.figureAmount)(n, currency),
|
|
9
|
+
date: (d) => (0, shared_1.figureDate)(d),
|
|
10
|
+
months: [],
|
|
11
|
+
weekdays: [],
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.listenOnlyFormat = listenOnlyFormat;
|
|
15
|
+
/** The standard lexicons, empty: a listen-only pack has none of them. */
|
|
16
|
+
exports.NO_STANDARD_LEXICONS = {
|
|
17
|
+
yes: [],
|
|
18
|
+
no: [],
|
|
19
|
+
backchannel: [],
|
|
20
|
+
interrupt: [],
|
|
21
|
+
greeting: [],
|
|
22
|
+
notHeard: [],
|
|
23
|
+
repeat: [],
|
|
24
|
+
wait: [],
|
|
25
|
+
voicemail: [],
|
|
26
|
+
goodbye: [],
|
|
27
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Word lists of the `ms` pack beyond the standard (empty) ones. */
|
|
2
|
+
export declare const MS_LEXICONS: {
|
|
3
|
+
/** Names of other languages a caller may ask for (English and Malay names). */
|
|
4
|
+
readonly languageName: readonly ["english", "inggeris", "mandarin", "chinese", "cina", "tamil", "hindi"];
|
|
5
|
+
/** Malay function words: a line with none of them was not said in Malay. */
|
|
6
|
+
readonly functionWords: readonly ["saya", "awak", "anda", "nak", "boleh", "tak", "tidak", "dengan", "sila", "cakap", "ada", "ini", "itu", "ya", "betul", "bayar", "orang", "ejen", "pegawai", "pasal", "bulanan"];
|
|
7
|
+
/** `functionWords` without the topic words «pegawai», «pasal», «bulanan». */
|
|
8
|
+
readonly functionWordsCore: readonly ["saya", "awak", "anda", "nak", "boleh", "tak", "tidak", "dengan", "sila", "cakap", "ada", "ini", "itu", "ya", "betul", "bayar", "orang", "ejen"];
|
|
9
|
+
/** The word joining the last two items of a list («A, B dan C»). */
|
|
10
|
+
readonly listAnd: readonly ["dan"];
|
|
11
|
+
};
|
|
12
|
+
/** Regular expressions of the `ms` pack by lexicon name. */
|
|
13
|
+
export declare const MS_PATTERNS: Readonly<Record<string, readonly RegExp[]>>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Malay word lists and patterns of the `ms` pack, copied word for word from the agents that first needed them (golden
|
|
3
|
+
// tests in `__golden__/` compare each with its original). Carrier prompts in Malaysia mix Malay and English.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.MS_PATTERNS = exports.MS_LEXICONS = void 0;
|
|
6
|
+
/** Word lists of the `ms` pack beyond the standard (empty) ones. */
|
|
7
|
+
exports.MS_LEXICONS = {
|
|
8
|
+
/** Names of other languages a caller may ask for (English and Malay names). */
|
|
9
|
+
languageName: ['english', 'inggeris', 'mandarin', 'chinese', 'cina', 'tamil', 'hindi'],
|
|
10
|
+
/** Malay function words: a line with none of them was not said in Malay. */
|
|
11
|
+
functionWords: [
|
|
12
|
+
'saya', 'awak', 'anda', 'nak', 'boleh', 'tak', 'tidak', 'dengan', 'sila', 'cakap', 'ada', 'ini', 'itu', 'ya', 'betul',
|
|
13
|
+
'bayar', 'orang', 'ejen', 'pegawai', 'pasal', 'bulanan',
|
|
14
|
+
],
|
|
15
|
+
/** `functionWords` without the topic words «pegawai», «pasal», «bulanan». */
|
|
16
|
+
functionWordsCore: [
|
|
17
|
+
'saya', 'awak', 'anda', 'nak', 'boleh', 'tak', 'tidak', 'dengan', 'sila', 'cakap', 'ada', 'ini', 'itu', 'ya', 'betul',
|
|
18
|
+
'bayar', 'orang', 'ejen',
|
|
19
|
+
],
|
|
20
|
+
/** The word joining the last two items of a list («A, B dan C»). */
|
|
21
|
+
listAnd: ['dan'],
|
|
22
|
+
};
|
|
23
|
+
/** Regular expressions of the `ms` pack by lexicon name. */
|
|
24
|
+
exports.MS_PATTERNS = {
|
|
25
|
+
/** Carrier voicemail and IVR prompts (Malay and English), safe for the whole call. */
|
|
26
|
+
voicemail: [
|
|
27
|
+
// --- "Unavailable / cannot be reached" prompts -----------------------------
|
|
28
|
+
/(?=.*((not\s|un)available))(?=.*(message|record|subscriber)).*/i,
|
|
29
|
+
/(?=.*((not\s|un)available))(?=.*number|subscriber)/i,
|
|
30
|
+
/(\s|^)(can\s?t|can\s?not)\sbe\sreached/i,
|
|
31
|
+
/(\s|^)no\slonger\sin\sservice($|\s)/i,
|
|
32
|
+
/(\s|^)not\sin\sservice($|\s)/i,
|
|
33
|
+
/(?=.*number)(?=.*trying\sto\sreach).*/i,
|
|
34
|
+
/(\s|^)number.{3,8}calling/i,
|
|
35
|
+
// --- Voice / mailbox keywords ----------------------------------------------
|
|
36
|
+
/(?=.*(mail|voice))(?=.*(service|assistant)).*/i,
|
|
37
|
+
/(\s|^)voice(\s|)(mail|maker|message|mesej)(\s|$)/i,
|
|
38
|
+
/mail(\s|ing\s)box($|\s)/i,
|
|
39
|
+
/(\s|^)(voice|leave\sa|audio)(\sshort)?\smessage/i,
|
|
40
|
+
/(\s|^)(peti|pesanan|nyala(kan)?)\ssuara(\s|$)/i,
|
|
41
|
+
/(^|\s)perkhidmatan\s(mel\ssuara|voicemail)(\s|$)/i,
|
|
42
|
+
/(^|\s)(perkhidmatan).{1,9}service(\s|$)/i,
|
|
43
|
+
// --- "Leave / record a message" prompts ------------------------------------
|
|
44
|
+
/(\s|^)(record|leave|rekod)\s(a|the|your)\s(message|mesej)/i,
|
|
45
|
+
/(\s|^)(record|leave)\s(the|your)\smessage/i,
|
|
46
|
+
/(r[ae]kam|tinggalkan|menyimpan)\s(message|mesej|pesan)\sanda($|\s)/i,
|
|
47
|
+
/(\s|^)(leave|fail).{1,7}(name|number)/i,
|
|
48
|
+
/(\s|^)send(\s|\sme\s)a?\s(message|text)/i,
|
|
49
|
+
/(\s|^)(tinggal(kan|lah)?|perkhidmatan)\s(pesan(an)?|pertama)(\s|$)/i,
|
|
50
|
+
/(^|\s)(menyelesaikan|mendengarkan)\srakaman(\s|$)/i,
|
|
51
|
+
/setelah\sbunyi\s(bip|b)($|\s)/i,
|
|
52
|
+
/lepas\sbunyi(\s|$)/i,
|
|
53
|
+
/(ikuti\sdengan|kunci\skhas)(\s|$)/i,
|
|
54
|
+
// --- Malay IVR / carrier boilerplate ----------------------------------------
|
|
55
|
+
/(\s|^)anda\sdisambungkan(\s|$)/i,
|
|
56
|
+
/(\s|^)sila\stunggu\ssebentar(\s|$)/i,
|
|
57
|
+
/(\s|^)yang\sanda\s(dail|hubungi)(\s|$)/i,
|
|
58
|
+
/(^)(welcome|apa\s?pun|mendengar|lagu|untuk)($)/i,
|
|
59
|
+
/(^|\s)(berikut)($)/i,
|
|
60
|
+
/(^|\s)ini\sadalah\spanggilan\sperkhidmatan(\s|$)/i,
|
|
61
|
+
/(^|\s)panggilan\s(perkhidmatan|ini)\s(voice|pesanan)(\s|$)/i,
|
|
62
|
+
/(^|\s)(mendengar|selepas|nada|servis).{1,7}(berikut)(\s|$)/i,
|
|
63
|
+
/(^|\s)(untuk|berikut)\s(menyelesaikan|apa\s?pun)(\s|$)/i,
|
|
64
|
+
/(^|\s)apa\s?pun\suntuk/i,
|
|
65
|
+
/(^|\s)berikut\ssekarang(\s|$)/i,
|
|
66
|
+
/(^|\s)datang.{1,4}(perkhidmatan?)(\s|$)/i,
|
|
67
|
+
/(^|\s)menerima\spanggilan(\s|$)/i,
|
|
68
|
+
/(^|\s)selamat\sdatang\ske(\s|$)/i,
|
|
69
|
+
/(^|\s)selamat\sdatang\sdi(\s|$)/i,
|
|
70
|
+
/(^|\s)selepas\s(mendengar(kan)?|apa)(\s|$)/i,
|
|
71
|
+
/(^|\s)sila.{1,23}selepas\smendengar(\s|$)/i,
|
|
72
|
+
/(^|\s)bunyi\s(selepas|dengar)(\s|$)/i,
|
|
73
|
+
/(^|\s)tambah\skredit(\s|$)/i,
|
|
74
|
+
// --- IVR menu / "press X" prompts ------------------------------------------
|
|
75
|
+
/(?=.*\bpress\b)(?=.*\bto\b).*/i,
|
|
76
|
+
/(press\s(0|zero|1|one|2|two|3|three|4|four|5|five|6|six|7|seven|8|eight|9|nine))/i,
|
|
77
|
+
/press\s(1|0|2|3|4|5|6|7|8|9)/i,
|
|
78
|
+
/([nt]ekan\s(0|nol|1|satu|2|dua|3|tiga|4|empat|5|lima|6|enam|7|tujuh|8|delapan|9|sembilan))/i,
|
|
79
|
+
/(^|\s)tekan\sbutang(\s|$)/i,
|
|
80
|
+
/(^|\s)mana[-\s]mana\sbutang(\s|$)/i,
|
|
81
|
+
// --- Generic English IVR boilerplate ---------------------------------------
|
|
82
|
+
/(\s|^)welcome\sto/i,
|
|
83
|
+
/(\s|^)not\sallowed\sto\suse(\s|$)/i,
|
|
84
|
+
],
|
|
85
|
+
/** Looser prompt fragments and caller-tune audio, for the opening only (too loose for answers in a conversation). */
|
|
86
|
+
voicemailOpening: [
|
|
87
|
+
// --- Fuller lookahead variants of the whole-call prompts -------------------
|
|
88
|
+
/(?=.*((not\s|un)available|please))(?=.*(message|record|subscriber|try\s(again\s)?later|stay)).*/i,
|
|
89
|
+
/(?=.*number)(?=.*(trying\sto\sreach|you\shave)).*/i,
|
|
90
|
+
/(\s|^)(ber)?(petik?|pesanan|nyala(kan)?|mesti)\s(suara|ujian|(se)?lepas|mesej|message)(\s|$)/i,
|
|
91
|
+
/(\s|^)not\s(in\sservice|allowed\sto\suse|answer)/i,
|
|
92
|
+
/(\s|^)(mail|maker|message|mesej)\s(follow|after)/i,
|
|
93
|
+
/(^|\s)(please\stry|try\sagain)(\s|$)/i,
|
|
94
|
+
/(^|\s)you\sare\strying(\s|$)/i,
|
|
95
|
+
// --- Standalone words / carrier-prompt fragments ---------------------------
|
|
96
|
+
/(^|\s)(mendengar|selepas|nada|servis)(\s|$)/i,
|
|
97
|
+
/(^|\s)(untuk|berikut|(for|fail)\sthe|fardu|firda|felda|faedah|(ber)?sabar|menyelesaikan|apa\s?pun|menambah|nombor|number)(\s|$)/i,
|
|
98
|
+
/((the|on|a)\s)?((un)?available|not\savailable|enable|bailable|valuable|[lt]?able)(\s|$)/i,
|
|
99
|
+
// --- Digit runs (IVR menus / carrier account prompts) ----------------------
|
|
100
|
+
/(^|\s)(z[ei]ro|0|xmao|xiao|one|wang?|1|nine|9|eight|age|8|seven|7|five|fai[lr]|5|fou?r|4)\s?(z[ei]ro|0|xmao|xiao|one|1|wang?|2|two|3|three|4|fou?r|5|five|fai[lr]|6|s[ei]x|7|seven|8|eight|age|9|nine|lain)(\s|$)/i,
|
|
101
|
+
/(^|\s)(number|nombor|bos|menambah)\s(kosong|zero|0|xmao|xiao)(\s|$)/i,
|
|
102
|
+
/(^|\s)\d\d\d\d\d/,
|
|
103
|
+
/(^|\s)zero(\s|$)/i,
|
|
104
|
+
// --- ASR garble of carrier prompts -----------------------------------------
|
|
105
|
+
/(^|\s)(mak\ssesyen|(sesyen|walau)\spun)(\s|$)/i,
|
|
106
|
+
/(^|\s)the\s(age|edge|beep?)(\s|$)/i,
|
|
107
|
+
/(^|\s)(chin\schai|shasha)(\s|$)/i,
|
|
108
|
+
/^(aira|b?latter|tetapi|lable|wan)$/i,
|
|
109
|
+
// --- Caller-tune / ad audio picked up before answer ------------------------
|
|
110
|
+
/(movie|full\s*(movie|music)?|filem\s*full|jilla\s*full|full\s*sexy|(?:woi\s*){2,}|wi[\s-]*fi(?:\s+wi[\s-]*fi)+|gila\s*woi|gila\s*seks|seks(?:i)?|sexy|mp3|juice|y2mate|vivo\s*v\d+|volvo\s*fm\d+|maybank2u|tata\s*sky|sh?e?ila|seven|husky|mesej|ada\s*hal\s*sikit)/i,
|
|
111
|
+
/(massage\s+after|massage|massach|gif\s+arm|event\s+massage|king\s+pembasaja|search\s+azkena|(?:sabtu\s+){2,}sabtu)/i,
|
|
112
|
+
],
|
|
113
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { DateInput, NameOptions } from '../locale';
|
|
2
|
+
import { type NumberWords } from './parse';
|
|
3
|
+
/**
|
|
4
|
+
* Non-negative integer in words: `123` → «seratus dua puluh tiga»; 1000 is «seribu». Up to the billions («bilion»);
|
|
5
|
+
* the fraction is dropped; `''` for non-finite or negative input.
|
|
6
|
+
*/
|
|
7
|
+
export declare function msNumberToWords(value: number): string;
|
|
8
|
+
/**
|
|
9
|
+
* `amount('1500.50')` → «seribu lima ratus ringgit lima puluh sen». Strings may carry thousands commas; a zero sen part is
|
|
10
|
+
* not read. Default currency MYR; `''` for an unparsable value.
|
|
11
|
+
*/
|
|
12
|
+
export declare function msAmount(value: number | string, currency?: string): string;
|
|
13
|
+
export declare const MS_MONTHS: readonly ["Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember"];
|
|
14
|
+
/** Weekday names, Sunday first (index = `Date#getUTCDay()`). */
|
|
15
|
+
export declare const MS_WEEKDAYS: readonly ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu"];
|
|
16
|
+
export interface MsDateOptions {
|
|
17
|
+
/** Day in words («lima Julai», default) or digits («5 Julai»). */
|
|
18
|
+
readonly day?: 'words' | 'digits';
|
|
19
|
+
/** «lima haribulan Julai». */
|
|
20
|
+
readonly haribulan?: boolean;
|
|
21
|
+
/** Append the year in words: «lapan Jun dua ribu dua puluh enam». */
|
|
22
|
+
readonly year?: boolean;
|
|
23
|
+
/** Prefix the weekday: «Isnin, 14 September». */
|
|
24
|
+
readonly weekday?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function msDate(d: DateInput, style?: 'short' | 'long' | 'dayMonth', opts?: MsDateOptions): string;
|
|
27
|
+
/** Part of the day: «pagi» before 12:00, «petang» before 19:00, then «malam». */
|
|
28
|
+
export declare function msTimeOfDay(hour: number): string;
|
|
29
|
+
export declare const msFormat: {
|
|
30
|
+
number: typeof msNumberToWords;
|
|
31
|
+
amount: typeof msAmount;
|
|
32
|
+
date: typeof msDate;
|
|
33
|
+
months: readonly ["Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember"];
|
|
34
|
+
weekdays: readonly ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu"];
|
|
35
|
+
name: (raw: string, _kase?: string, opts?: NameOptions) => string;
|
|
36
|
+
/** «pagi» / «petang» / «malam» (default: before 12, before 19, after); `opts.bands` moves the edges. */
|
|
37
|
+
timeOfDay: (hour: number, opts?: import("../locale").DayPartOptions | undefined) => string;
|
|
38
|
+
timeOfDayGreeting: (hour: number, opts?: import("../locale").DayPartOptions | undefined) => string;
|
|
39
|
+
};
|
|
40
|
+
/** Malay number words and «ke-» ordinals; `id` shares the shape with its own words. */
|
|
41
|
+
export declare function malayNumberWords(ones: readonly string[], big: Readonly<Record<string, number>>, group: ',' | '.', decimal: '.' | ','): NumberWords;
|
|
42
|
+
export declare const MS_NUMBER_WORDS: NumberWords;
|
|
43
|
+
export declare const msParse: import("../locale").LocaleParse;
|
|
44
|
+
export declare const ms: {
|
|
45
|
+
code: "ms";
|
|
46
|
+
script: "latin";
|
|
47
|
+
lexicons: {
|
|
48
|
+
languageName: readonly ["english", "inggeris", "mandarin", "chinese", "cina", "tamil", "hindi"];
|
|
49
|
+
functionWords: readonly ["saya", "awak", "anda", "nak", "boleh", "tak", "tidak", "dengan", "sila", "cakap", "ada", "ini", "itu", "ya", "betul", "bayar", "orang", "ejen", "pegawai", "pasal", "bulanan"];
|
|
50
|
+
functionWordsCore: readonly ["saya", "awak", "anda", "nak", "boleh", "tak", "tidak", "dengan", "sila", "cakap", "ada", "ini", "itu", "ya", "betul", "bayar", "orang", "ejen"];
|
|
51
|
+
listAnd: readonly ["dan"];
|
|
52
|
+
yes: never[];
|
|
53
|
+
no: never[];
|
|
54
|
+
backchannel: never[];
|
|
55
|
+
interrupt: never[];
|
|
56
|
+
greeting: never[];
|
|
57
|
+
notHeard: never[];
|
|
58
|
+
repeat: never[];
|
|
59
|
+
wait: never[];
|
|
60
|
+
voicemail: never[];
|
|
61
|
+
goodbye: never[];
|
|
62
|
+
};
|
|
63
|
+
patterns: Readonly<Record<string, readonly RegExp[]>>;
|
|
64
|
+
format: {
|
|
65
|
+
number: typeof msNumberToWords;
|
|
66
|
+
amount: typeof msAmount;
|
|
67
|
+
date: typeof msDate;
|
|
68
|
+
months: readonly ["Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember"];
|
|
69
|
+
weekdays: readonly ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu"];
|
|
70
|
+
name: (raw: string, _kase?: string, opts?: NameOptions) => string;
|
|
71
|
+
/** «pagi» / «petang» / «malam» (default: before 12, before 19, after); `opts.bands` moves the edges. */
|
|
72
|
+
timeOfDay: (hour: number, opts?: import("../locale").DayPartOptions | undefined) => string;
|
|
73
|
+
timeOfDayGreeting: (hour: number, opts?: import("../locale").DayPartOptions | undefined) => string;
|
|
74
|
+
};
|
|
75
|
+
parse: import("../locale").LocaleParse;
|
|
76
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ms = exports.msParse = exports.MS_NUMBER_WORDS = exports.malayNumberWords = exports.msFormat = exports.msTimeOfDay = exports.msDate = exports.MS_WEEKDAYS = exports.MS_MONTHS = exports.msAmount = exports.msNumberToWords = void 0;
|
|
4
|
+
const ms_lexicons_1 = require("./ms-lexicons");
|
|
5
|
+
const parse_1 = require("./parse");
|
|
6
|
+
const shared_1 = require("./shared");
|
|
7
|
+
const MS_ONES = ['', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'lapan', 'sembilan'];
|
|
8
|
+
const MS_TENS = [
|
|
9
|
+
'', 'sepuluh', 'dua puluh', 'tiga puluh', 'empat puluh', 'lima puluh', 'enam puluh', 'tujuh puluh', 'lapan puluh',
|
|
10
|
+
'sembilan puluh',
|
|
11
|
+
];
|
|
12
|
+
function msUpTo999(n) {
|
|
13
|
+
if (n === 0)
|
|
14
|
+
return '';
|
|
15
|
+
const parts = [];
|
|
16
|
+
const hundreds = Math.floor(n / 100);
|
|
17
|
+
if (hundreds === 1)
|
|
18
|
+
parts.push('seratus');
|
|
19
|
+
else if (hundreds > 1)
|
|
20
|
+
parts.push(`${MS_ONES[hundreds]} ratus`);
|
|
21
|
+
const rem = n % 100;
|
|
22
|
+
const tens = Math.floor(rem / 10);
|
|
23
|
+
const ones = rem % 10;
|
|
24
|
+
if (tens === 1) {
|
|
25
|
+
if (ones === 0)
|
|
26
|
+
parts.push('sepuluh');
|
|
27
|
+
else if (ones === 1)
|
|
28
|
+
parts.push('sebelas');
|
|
29
|
+
else
|
|
30
|
+
parts.push(`${MS_ONES[ones]} belas`);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
if (tens > 1)
|
|
34
|
+
parts.push(MS_TENS[tens]);
|
|
35
|
+
if (ones > 0)
|
|
36
|
+
parts.push(MS_ONES[ones]);
|
|
37
|
+
}
|
|
38
|
+
return parts.join(' ');
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Non-negative integer in words: `123` → «seratus dua puluh tiga»; 1000 is «seribu». Up to the billions («bilion»);
|
|
42
|
+
* the fraction is dropped; `''` for non-finite or negative input.
|
|
43
|
+
*/
|
|
44
|
+
function msNumberToWords(value) {
|
|
45
|
+
if (!Number.isFinite(value) || value < 0)
|
|
46
|
+
return '';
|
|
47
|
+
const n = Math.floor(value);
|
|
48
|
+
if (n === 0)
|
|
49
|
+
return 'sifar';
|
|
50
|
+
const parts = [];
|
|
51
|
+
const billions = Math.floor(n / 1_000_000_000);
|
|
52
|
+
const millions = Math.floor((n % 1_000_000_000) / 1_000_000);
|
|
53
|
+
const thousands = Math.floor((n % 1_000_000) / 1_000);
|
|
54
|
+
const remainder = n % 1000;
|
|
55
|
+
if (billions)
|
|
56
|
+
parts.push(`${msUpTo999(billions)} bilion`);
|
|
57
|
+
if (millions)
|
|
58
|
+
parts.push(`${msUpTo999(millions)} juta`);
|
|
59
|
+
if (thousands)
|
|
60
|
+
parts.push(thousands === 1 ? 'seribu' : `${msUpTo999(thousands)} ribu`);
|
|
61
|
+
if (remainder)
|
|
62
|
+
parts.push(msUpTo999(remainder));
|
|
63
|
+
return parts.join(' ').trim();
|
|
64
|
+
}
|
|
65
|
+
exports.msNumberToWords = msNumberToWords;
|
|
66
|
+
const MS_CURRENCY = { MYR: { unit: 'ringgit', minor: 'sen' } };
|
|
67
|
+
/**
|
|
68
|
+
* `amount('1500.50')` → «seribu lima ratus ringgit lima puluh sen». Strings may carry thousands commas; a zero sen part is
|
|
69
|
+
* not read. Default currency MYR; `''` for an unparsable value.
|
|
70
|
+
*/
|
|
71
|
+
function msAmount(value, currency = 'MYR') {
|
|
72
|
+
const parsed = (0, shared_1.parseAmount)(value);
|
|
73
|
+
if (!parsed)
|
|
74
|
+
return '';
|
|
75
|
+
const cur = MS_CURRENCY[currency] ?? { unit: currency, minor: '' };
|
|
76
|
+
const parts = [msNumberToWords(parsed.whole)];
|
|
77
|
+
if (cur.unit)
|
|
78
|
+
parts.push(cur.unit);
|
|
79
|
+
if (parsed.cents > 0)
|
|
80
|
+
parts.push(msNumberToWords(parsed.cents), ...(cur.minor ? [cur.minor] : []));
|
|
81
|
+
return parts.join(' ');
|
|
82
|
+
}
|
|
83
|
+
exports.msAmount = msAmount;
|
|
84
|
+
exports.MS_MONTHS = [
|
|
85
|
+
'Januari', 'Februari', 'Mac', 'April', 'Mei', 'Jun', 'Julai', 'Ogos', 'September', 'Oktober', 'November', 'Disember',
|
|
86
|
+
];
|
|
87
|
+
/** Weekday names, Sunday first (index = `Date#getUTCDay()`). */
|
|
88
|
+
exports.MS_WEEKDAYS = ['Ahad', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu'];
|
|
89
|
+
/** Style presets: `dayMonth` «lima Julai» (default), `short` «5 Julai», `long` «lima Julai dua ribu dua puluh enam». */
|
|
90
|
+
const MS_DATE_STYLES = {
|
|
91
|
+
dayMonth: {},
|
|
92
|
+
short: { day: 'digits' },
|
|
93
|
+
long: { year: true },
|
|
94
|
+
};
|
|
95
|
+
function msDate(d, style = 'dayMonth', opts = {}) {
|
|
96
|
+
const o = { ...MS_DATE_STYLES[style], ...opts };
|
|
97
|
+
const p = (0, shared_1.partsOf)(d);
|
|
98
|
+
const day = o.day === 'digits' ? String(p.day) : msNumberToWords(p.day);
|
|
99
|
+
let text = `${day}${o.haribulan ? ' haribulan' : ''} ${exports.MS_MONTHS[p.month - 1]}`;
|
|
100
|
+
if (o.year)
|
|
101
|
+
text = `${text} ${msNumberToWords(p.year)}`;
|
|
102
|
+
return o.weekday ? `${exports.MS_WEEKDAYS[p.weekday]}, ${text}` : text;
|
|
103
|
+
}
|
|
104
|
+
exports.msDate = msDate;
|
|
105
|
+
/** Part of the day: «pagi» before 12:00, «petang» before 19:00, then «malam». */
|
|
106
|
+
function msTimeOfDay(hour) {
|
|
107
|
+
if (hour < 12)
|
|
108
|
+
return 'pagi';
|
|
109
|
+
if (hour < 19)
|
|
110
|
+
return 'petang';
|
|
111
|
+
return 'malam';
|
|
112
|
+
}
|
|
113
|
+
exports.msTimeOfDay = msTimeOfDay;
|
|
114
|
+
const MS_DAY_WORDS = { morning: 'pagi', afternoon: 'petang', evening: 'malam', night: 'malam' };
|
|
115
|
+
const MS_DAY_BANDS = { morning: 0, afternoon: 12, evening: 19 };
|
|
116
|
+
exports.msFormat = {
|
|
117
|
+
number: msNumberToWords,
|
|
118
|
+
amount: msAmount,
|
|
119
|
+
date: msDate,
|
|
120
|
+
months: exports.MS_MONTHS,
|
|
121
|
+
weekdays: exports.MS_WEEKDAYS,
|
|
122
|
+
name: (raw, _kase, opts) => (0, shared_1.cleanName)(raw, opts),
|
|
123
|
+
/** «pagi» / «petang» / «malam» (default: before 12, before 19, after); `opts.bands` moves the edges. */
|
|
124
|
+
timeOfDay: (0, shared_1.dayPartWords)(MS_DAY_WORDS, MS_DAY_BANDS),
|
|
125
|
+
timeOfDayGreeting: (0, shared_1.dayPartWords)(Object.fromEntries(Object.entries(MS_DAY_WORDS).map(([k, w]) => [k, `Selamat ${w}`])), MS_DAY_BANDS),
|
|
126
|
+
};
|
|
127
|
+
// ── reading back ────────────────────────────────────────────────────────────────────────────────
|
|
128
|
+
/** Malay number words and «ke-» ordinals; `id` shares the shape with its own words. */
|
|
129
|
+
function malayNumberWords(ones, big, group, decimal) {
|
|
130
|
+
const values = new Map([
|
|
131
|
+
['kosong', 0], ['sifar', 0], ['nol', 0], ...ones.slice(1).map((w, i) => [w, i + 1]),
|
|
132
|
+
['sepuluh', 10], ['sebelas', 11], ['seratus', 100],
|
|
133
|
+
]);
|
|
134
|
+
return {
|
|
135
|
+
values,
|
|
136
|
+
multipliers: new Map([['puluh', 10], ['ratus', 100]]),
|
|
137
|
+
adders: new Map([['belas', 10]]),
|
|
138
|
+
scales: new Map([['ribu', 1000], ['seribu', 1000], ['juta', 1_000_000], ['sejuta', 1_000_000], ...Object.entries(big)]),
|
|
139
|
+
ordinal: (w) => (w === 'pertama' ? 1 : w.startsWith('ke') && w.length > 3 ? values.get(w.slice(2)) ?? null : null),
|
|
140
|
+
group,
|
|
141
|
+
decimal,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
exports.malayNumberWords = malayNumberWords;
|
|
145
|
+
exports.MS_NUMBER_WORDS = malayNumberWords(MS_ONES, { bilion: 1_000_000_000, billion: 1_000_000_000 }, ',', '.');
|
|
146
|
+
exports.msParse = (0, parse_1.makeParse)(exports.MS_NUMBER_WORDS, {
|
|
147
|
+
numbers: exports.MS_NUMBER_WORDS,
|
|
148
|
+
months: new Map(exports.MS_MONTHS.map((m, i) => [m.toLowerCase(), i + 1])),
|
|
149
|
+
relative: new Map([['hari ini', 0], ['harini', 0], ['esok', 1], ['besok', 1], ['lusa', 2]]),
|
|
150
|
+
weekdays: new Map(exports.MS_WEEKDAYS.map((d, i) => [d.toLowerCase(), i])),
|
|
151
|
+
nextAfter: new Set(['depan', 'hadapan', 'akan datang']),
|
|
152
|
+
dayLead: new Set(['pada', 'sebelum', 'hingga', 'sampai', 'tarikh', 'hb']),
|
|
153
|
+
dayMark: new Set(['haribulan', 'hb']),
|
|
154
|
+
notDayAfter: new Set([
|
|
155
|
+
'ringgit', 'rm', 'sen', 'hari', 'minggu', 'bulan', 'tahun', 'jam', 'minit', 'pagi', 'petang', 'malam', 'peratus',
|
|
156
|
+
]),
|
|
157
|
+
filler: new Set(['ya', 'ye', 'mungkin', 'lah', 'kot', 'dalam', 'tarikh', 'haribulan']),
|
|
158
|
+
vagueOrdinals: new Set(['pertama', 'kedua']),
|
|
159
|
+
});
|
|
160
|
+
exports.ms = {
|
|
161
|
+
code: 'ms',
|
|
162
|
+
script: 'latin',
|
|
163
|
+
lexicons: {
|
|
164
|
+
yes: [],
|
|
165
|
+
no: [],
|
|
166
|
+
backchannel: [],
|
|
167
|
+
interrupt: [],
|
|
168
|
+
greeting: [],
|
|
169
|
+
notHeard: [],
|
|
170
|
+
repeat: [],
|
|
171
|
+
wait: [],
|
|
172
|
+
voicemail: [],
|
|
173
|
+
goodbye: [],
|
|
174
|
+
...ms_lexicons_1.MS_LEXICONS,
|
|
175
|
+
},
|
|
176
|
+
patterns: ms_lexicons_1.MS_PATTERNS,
|
|
177
|
+
format: exports.msFormat,
|
|
178
|
+
parse: exports.msParse,
|
|
179
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { CalendarDate, DateInput, DateParseOptions, LocaleParse, NumberParseOptions, SpokenDate, SpokenNumber } from '../locale';
|
|
2
|
+
/** How a pack's number words combine. All words are lower case, after the pack's `normalize`. */
|
|
3
|
+
export interface NumberWords {
|
|
4
|
+
/** Words with a value below 1000: units, teens, tens, hundreds said as one word. */
|
|
5
|
+
readonly values: ReadonlyMap<string, number>;
|
|
6
|
+
/** Words that multiply the value before them («hundred», «puluh», «mươi», «жүз»); alone they count as 1 × it. */
|
|
7
|
+
readonly multipliers?: ReadonlyMap<string, number>;
|
|
8
|
+
/** Words added to the unit before them («belas»: «dua belas» = 12). */
|
|
9
|
+
readonly adders?: ReadonlyMap<string, number>;
|
|
10
|
+
/** Group words of 1000 and up («thousand», «тысяч», «juta»); alone they count as 1 × it. */
|
|
11
|
+
readonly scales: ReadonlyMap<string, number>;
|
|
12
|
+
/** Words that join parts of one number («and», «y», «linh») when another number word follows. */
|
|
13
|
+
readonly joiners?: ReadonlySet<string>;
|
|
14
|
+
/** The value of an ordinal word («fifth», «пятого», «бесінші»), `null` for any other word. */
|
|
15
|
+
readonly ordinal?: (word: string) => number | null;
|
|
16
|
+
/** A ten may take a unit after it («он бес» = 15, «mười lăm» = 15). */
|
|
17
|
+
readonly tenPlusUnit?: boolean;
|
|
18
|
+
/** Thousands separator in figures and the decimal mark. */
|
|
19
|
+
readonly group: ',' | '.' | ' ';
|
|
20
|
+
readonly decimal: '.' | ',';
|
|
21
|
+
/** Lower-cased text → the spelling the word lists use (e.g. «ё» → «е»). */
|
|
22
|
+
readonly normalize?: (text: string) => string;
|
|
23
|
+
/** Default of {@link NumberParseOptions.digitByDigit}. */
|
|
24
|
+
readonly digitByDigit?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Every number in a line, in order: figures («496», «4,496.64», «1 500»), digits one by one («7 5»), words. */
|
|
27
|
+
export declare function readNumbers(text: string, w: NumberWords, opts?: NumberParseOptions): SpokenNumber[];
|
|
28
|
+
/** A pack's words for the days a caller names. Phrases are lower-case words separated by single spaces. */
|
|
29
|
+
export interface DateWords {
|
|
30
|
+
readonly numbers: NumberWords;
|
|
31
|
+
/** Month phrases (every inflected form) → 1-12. */
|
|
32
|
+
readonly months: ReadonlyMap<string, number>;
|
|
33
|
+
/** Relative day phrases → days from today; `null` consumes the phrase with no day («la mañana» = the morning). */
|
|
34
|
+
readonly relative?: ReadonlyMap<string, number | null>;
|
|
35
|
+
/** Weekday phrases → 0 (Sunday) … 6. */
|
|
36
|
+
readonly weekdays?: ReadonlyMap<string, number>;
|
|
37
|
+
/** «Next» phrases before a weekday («next», «следующий») / after it («depan», «que viene»). */
|
|
38
|
+
readonly nextBefore?: ReadonlySet<string>;
|
|
39
|
+
readonly nextAfter?: ReadonlySet<string>;
|
|
40
|
+
/** Words that put a bare day number in a date: «by», «до», «tanggal», «ngày». */
|
|
41
|
+
readonly dayLead?: ReadonlySet<string>;
|
|
42
|
+
/** Words before a day that count as a date word only when the day is an ordinal («the»). */
|
|
43
|
+
readonly ordinalLead?: ReadonlySet<string>;
|
|
44
|
+
/** Words between a day and its month («of», «de»). */
|
|
45
|
+
readonly monthLink?: ReadonlySet<string>;
|
|
46
|
+
/** Words between a month and its day («the»). */
|
|
47
|
+
readonly dayLink?: ReadonlySet<string>;
|
|
48
|
+
/** Words after a figure that make it an ordinal day («го», «числа», «haribulan»). */
|
|
49
|
+
readonly dayMark?: ReadonlySet<string>;
|
|
50
|
+
/** Figures with an ordinal suffix as the speech engine writes them («23rd»): the day, or `null`. */
|
|
51
|
+
readonly figureOrdinal?: (token: string) => number | null;
|
|
52
|
+
/** After these a number is a time, an amount or a count, never a day («pm», «pesos», «дней»). Scales are added. */
|
|
53
|
+
readonly notDayAfter?: ReadonlySet<string>;
|
|
54
|
+
/** Words that may stand around a day number said on its own («po», «да»). */
|
|
55
|
+
readonly filler?: ReadonlySet<string>;
|
|
56
|
+
/** Ordinals too common to be a day on their own («first», «second»). */
|
|
57
|
+
readonly vagueOrdinals?: ReadonlySet<string>;
|
|
58
|
+
/** A day number may hold the number joiners («treinta y uno»). Default `true`. */
|
|
59
|
+
readonly dayJoiners?: boolean;
|
|
60
|
+
}
|
|
61
|
+
type Reading = {
|
|
62
|
+
readonly past: boolean;
|
|
63
|
+
readonly date: CalendarDate;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* A month and a day seen from `today`: the same month — that day (past when gone); up to six months ahead — that date,
|
|
67
|
+
* next year when needed; further — behind us (`pastMonth`).
|
|
68
|
+
*/
|
|
69
|
+
export declare function readMonthDay(month: number, day: number, today: CalendarDate, pastMonth?: 'past' | 'thisMonth'): Reading | null;
|
|
70
|
+
/** A bare day number: this month while ahead; next month only up to `until`; otherwise past. */
|
|
71
|
+
export declare function readBareDay(day: number, today: CalendarDate, until: CalendarDate | null): Reading | null;
|
|
72
|
+
/**
|
|
73
|
+
* A day and a month written as figures («10.11», «10/11», «10-11»), this year or next (the first not before `today`).
|
|
74
|
+
* `order`: `'dayFirst'` (default) reads «10.11» as 10 November, `'monthFirst'` as 11 October (the `MM.DD` form some
|
|
75
|
+
* extractors write). `null` for anything else or a day the calendar does not have.
|
|
76
|
+
*/
|
|
77
|
+
export declare function parseDayMonth(raw: unknown, today: DateInput, opts?: {
|
|
78
|
+
readonly order?: 'dayFirst' | 'monthFirst';
|
|
79
|
+
}): CalendarDate | null;
|
|
80
|
+
/** Every day a line names, in order. See {@link DateParseOptions}. */
|
|
81
|
+
export declare function readDates(text: string, todayIn: DateInput, w: DateWords, opts?: DateParseOptions): SpokenDate[];
|
|
82
|
+
/** The `parse` member of a pack from its number and day words. */
|
|
83
|
+
export declare function makeParse(numbers: NumberWords, dates: DateWords): LocaleParse;
|
|
84
|
+
/** Every `stem + ending` form, for word lists of inflected languages. */
|
|
85
|
+
export declare function forms(stems: readonly string[], endings: readonly string[]): string[];
|
|
86
|
+
export {};
|