Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:23blocks OS Ai maestro Voice Commands

From Leeroopedia
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)
}

Related Pages

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment