{"version":3,"file":"exceptions.cjs","names":[],"sources":["../../../../src/batteries/tts/native/exceptions.ts"],"sourcesContent":["/**\n * Battery-scoped exception constructors for the OS-native TTS adapter.\n *\n * @module @nhtio/adk/batteries/tts/native/exceptions\n *\n * @remarks\n * Battery-scoped exception classes for the model-less, shell-out OS-native text-to-speech adapter\n * (macOS `say` / Linux `espeak-ng` / Windows PowerShell `System.Speech`), minted via `createException`\n * from `@nhtio/adk/factories`. Two categories are fatal config/contract bugs (invalid options,\n * unsupported platform — both 529); two are non-fatal runtime failures (engine error 502, timeout\n * 504) so a caller may retry with a different voice/rate or fall back to another TTS engine.\n */\n\nimport { createException } from '@nhtio/adk/factories'\n\n/**\n * Thrown when the resolved adapter options fail validation against\n * {@link @nhtio/adk/batteries/tts/native!nativeTtsOptionsSchema} — e.g. an unknown option key, a\n * non-numeric `rate`, or a `platform` outside the supported set. Fatal: config bugs fail loud, not\n * at `synthesize` time. Printf arg: `[detail]`.\n */\nexport const E_INVALID_NATIVE_TTS_OPTIONS = createException<[string]>(\n  'E_INVALID_NATIVE_TTS_OPTIONS',\n  'Invalid native TTS adapter options: %s',\n  'E_INVALID_NATIVE_TTS_OPTIONS',\n  529,\n  true\n)\n\n/**\n * Thrown when the resolved `platform` is not one of {@link\n * @nhtio/adk/batteries/tts/native!NativeTtsPlatform} (`darwin`/`linux`/`win32`). Fatal: there is no\n * engine binary to shell out to on any other platform, so synthesis cannot proceed. Printf arg:\n * `[platform]`.\n */\nexport const E_NATIVE_TTS_UNSUPPORTED_PLATFORM = createException<[string]>(\n  'E_NATIVE_TTS_UNSUPPORTED_PLATFORM',\n  'Native TTS is not supported on platform %s (expected darwin, linux, or win32)',\n  'E_NATIVE_TTS_UNSUPPORTED_PLATFORM',\n  529,\n  true\n)\n\n/**\n * Thrown when the OS-native binary invocation fails (non-zero exit / spawn error / empty or missing\n * output file / a result that is not a RIFF/WAVE file). Non-fatal: the engine itself may be\n * transiently unavailable, or a particular voice/rate combination may be rejected by the binary;\n * retry or fall back to another TTS engine. Printf arg: `[detail]` (stderr on failure, otherwise a\n * structural message such as `expected a RIFF/WAVE file`).\n */\nexport const E_NATIVE_TTS_ENGINE_ERROR = createException<[string]>(\n  'E_NATIVE_TTS_ENGINE_ERROR',\n  'Native TTS engine error: %s',\n  'E_NATIVE_TTS_ENGINE_ERROR',\n  502,\n  false\n)\n\n/**\n * Thrown when the binary invocation is aborted for exceeding\n * {@link @nhtio/adk/batteries/tts/native!NativeTtsAdapterOptions.timeoutMs}. Non-fatal: a slow\n * engine on a long text may simply need more time; the caller may raise `timeoutMs` and retry.\n * Printf arg: `[timeoutMs]`.\n */\nexport const E_NATIVE_TTS_TIMEOUT = createException<[number]>(\n  'E_NATIVE_TTS_TIMEOUT',\n  'Native TTS synthesis timed out after %d ms',\n  'E_NATIVE_TTS_TIMEOUT',\n  504,\n  false\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAa,+BAA+B,mBAAA,gBAC1C,gCACA,0CACA,gCACA,KACA,IACF;;;;;;;AAQA,IAAa,oCAAoC,mBAAA,gBAC/C,qCACA,iFACA,qCACA,KACA,IACF;;;;;;;;AASA,IAAa,4BAA4B,mBAAA,gBACvC,6BACA,+BACA,6BACA,KACA,KACF;;;;;;;AAQA,IAAa,uBAAuB,mBAAA,gBAClC,wBACA,8CACA,wBACA,KACA,KACF"}