@nura-js/plugin-voice
v1.0.0
Published
Voice plugin for Nura.js command registry
Readme
@nura-js/plugin-voice
Voice agent for Nura.js with wake-word comparison, locale detection, and intent scoring.
Installation
pnpm add @nura-js/plugin-voiceUsage Example
import { createRegistry, defineActionSpec } from '@nura-js/core';
import { voiceAgent } from '@nura-js/plugin-voice';
const registry = createRegistry({
actions: [
defineActionSpec({
name: 'open_orders',
type: 'open',
target: 'orders',
phrases: {
'es-CR': { canonical: ['abre órdenes'], wake: ['hey nura'] },
},
}),
],
agents: [voiceAgent({ wakeWords: ['hey nura'] })],
});
registry.agents.start('voice', {
locale: 'es-CR',
intents: registry.actions.intents(),
});Key APIs
voiceAgentwires recognition, wake configuration, and event emission into a registry.matchUtterancescores intents based on phonetic and edit-distance comparisons.compareWakeWordcompares phrases for wake-word confidence.stripWakeanddetectLocaleare re-exported from@nura-js/corefor convenience.
Type References
NVoiceOptions— configuration for the agent (wake words, thresholds, debug mode).WakeWordInput— normalized structure for wake-word checks.NIntent— registry intent ready for recognition.IntentMatchResult— detailed result frommatchUtteranceincluding scores and tokens.
Additional Resources
- Repository: https://github.com/nura-ia/nurajs
- Issues: https://github.com/nura-ia/nurajs/issues
