Implementation:23blocks OS Ai maestro Voice Commands
| Knowledge Sources | |
|---|---|
| Domains | UI, Voice |
| Last Updated | 2026-10-26 18:00 GMT |
Overview
Concrete tool for client-side interception of natural-language voice meta-commands (repeat, stop, mute, volume, speed) before they reach the agent, with phrase and keyword matching at confidence levels, provided by AI Maestro's `lib/voice-commands.ts`.
Description
The voice-commands module intercepts natural language commands for the companion voice interface. Commands like "repeat", "stop", "mute", "unmute", "louder", "softer", "faster", "slower" are detected before sending to the agent, so meta-commands about the voice interface don't waste agent time. Each command has `keywords` (single words) and `phrases` (multi-word). `matchVoiceCommand` returns a `VoiceCommandMatch` with confidence 'exact' (phrase match) or 'high' (keyword match).
Usage
Call `matchVoiceCommand(text)` before sending to the agent. If a match is returned, execute the action and show `feedbackMessage` instead of forwarding to the agent.
Code Reference
Source Location
- Repository: ai-maestro
- File: lib/voice-commands.ts
- Lines: L1-L139
Signature
export const VOICE_COMMANDS: VoiceCommand[]
export function matchVoiceCommand(text: string): VoiceCommandMatch | null
Import
import { matchVoiceCommand, VOICE_COMMANDS } from '@/lib/voice-commands'
I/O Contract
| Name | Type | Description |
|---|---|---|
| matchVoiceCommand() returns | null | Match with command + confidence, or null |
Usage Examples
import { matchVoiceCommand } from '@/lib/voice-commands'
const match = matchVoiceCommand('stop talking')
if (match) {
executeVoiceAction(match.command.action)
showToast(match.command.feedbackMessage)
} else {
sendToAgent(text)
}