uhc-voice-core-ts
v0.1.3
Published
Reusable voice i18n core utilities for locale loading, template rendering, and language resolution.
Readme
uhc-voice-core-ts
Reusable voice i18n core utilities for UHC/UNID services.
Features
- Load locale JSON files from ESM modules.
- Resolve locale by language prefix with fallback.
- Render
{{variable}}templates. - Resolve localized language names with fallback to Intl APIs.
- Share provider-neutral batch/streaming transcription contracts.
- Share allowlisted intent proposal, resolution and provider-attempt contracts.
- Keep companion conversation and consent-gated social fact proposals separate from operational intents.
Install
npm install uhc-voice-core-tsAPI
loadJsonFile(relativePath, importMetaUrl)resolveLocaleByPrefix(value, supportedLocales, fallbackLocale)renderTemplate(template, vars)getLocalizedLanguageName(targetLocale, uiLocale, localeNames, supportedLocales, fallbackLocale?)AssistantAudioTranscriptionProviderfor short push-to-talk audio.AssistantStreamingTranscriptionProviderfor later partial transcripts.AssistantIntentProviderandAssistantIntentResolutionfor proposal-only deterministic/local/remote routing.AssistantCompanionProviderfor disclosed conversation whose extracted facts still require consent and confirmation.resolveAssistantCompanionActivationfor a controller-configurable wake phrase (defaultconversai) and speaker-scoped companion context.- Reviewable social, family, wellbeing and vital-sign proposals. Repeated measurements remain proposals until a clinical application groups and saves them through its canonical FHIR/Communication path.
Providers defined here have no SDK or GW dependency. Model output cannot invoke application functions; a channel validates, previews and confirms through its normal builders and authorization path.
Canonical Voice Flow
The current UHC/UNID phone-assistance flow is specified in:
Supporting demo-specific voice materials now live in:
- docs/101-VOICE_FLOW_V1_2_DEMO.md
- docs/101-VOICE_FLOW_V1_2_DEMO.runtime.yaml
- docs/101-VOICE_FLOW_V1_2_DEMO.panels.yaml
That file is consumed by uhc-unid-chat-node and is the canonical source for:
- onboarding gate fields
- individual data capture menus
- appointment and medication voice menus
- permission-management prompts
The docs/101-VOICE_FLOW_V1_2_DEMO* files are supplementary demo documents.
They belong with voice ownership, not with gdc-sdk-core-ts.
