"use strict";
// Voice layer — interface only.
//
// Defines the SpeechToText, TextToSpeech, and WakeWord interfaces plus a
// null adapter so the rest of the harness can wire to "voice" without any
// native binary present. Real adapters ship as opt-in cookbook recipes:
//
//   * STT: whisper.cpp (https://github.com/ggerganov/whisper.cpp)
//   * TTS: piper       (https://github.com/rhasspy/piper)
//   * Wake: openWakeWord or porcupine
//
// To enable voice for real:
//   1. Install one of the binaries above.
//   2. `import { setSpeechToText, setTextToSpeech, setWakeWord } from 'src/jarvis/voice'`
//      in a startup hook and register an adapter that shells out to the binary.
//   3. Gate the adapter behind a Trust Ladder capability ('voice_listen',
//      'voice_speak') so the user controls when the mic is hot.
//
// All adapters return Promises so callers don't depend on the underlying
// streaming model. Streaming is layered on top via the EventEmitter on the
// SignalBus when the adapter publishes partial transcripts.
Object.defineProperty(exports, "__esModule", { value: true });
exports.setSpeechToText = setSpeechToText;
exports.setTextToSpeech = setTextToSpeech;
exports.setWakeWord = setWakeWord;
exports.getSpeechToText = getSpeechToText;
exports.getTextToSpeech = getTextToSpeech;
exports.getWakeWord = getWakeWord;
exports.getVoiceStatus = getVoiceStatus;
const nullSTT = {
    name: 'null-stt',
    async transcribe() {
        throw new Error('No speech-to-text adapter registered. Install whisper.cpp and call setSpeechToText().');
    },
};
const nullTTS = {
    name: 'null-tts',
    async speak() {
        throw new Error('No text-to-speech adapter registered. Install piper and call setTextToSpeech().');
    },
};
const nullWake = {
    name: 'null-wake',
    async detect() {
        return false;
    },
};
let stt = nullSTT;
let tts = nullTTS;
let wake = nullWake;
function setSpeechToText(adapter) { stt = adapter; }
function setTextToSpeech(adapter) { tts = adapter; }
function setWakeWord(adapter) { wake = adapter; }
function getSpeechToText() { return stt; }
function getTextToSpeech() { return tts; }
function getWakeWord() { return wake; }
function getVoiceStatus() {
    return {
        stt: { name: stt.name, ready: stt.name !== 'null-stt' },
        tts: { name: tts.name, ready: tts.name !== 'null-tts' },
        wake: { name: wake.name, ready: wake.name !== 'null-wake' },
    };
}
//# sourceMappingURL=voice.js.map