import type { Host } from "../host/host.js"; import { throwAbortReason } from "./abortReason.js"; import { type TranscodeFormat } from "./ffmpeg.js"; export { throwAbortReason }; /** Backs `std::speech.say` (local macOS text-to-speech playback). */ export declare function _say(text: string, voice: string, rate: number, outputFile: string, allowedPaths?: string[]): Promise; /** An output file an external program will write: a whole path the * interrupt named, checked against the program's own allow-list, whose * final name is never followed. */ export declare function outputPath(host: Host, outputFile: string, allowedPaths: string[] | undefined): Promise; /** Backs `std::speech.record`. */ export declare function _record(outputFile: string, silenceTimeout: number, allowedPaths?: string[]): Promise; /** Pre-interrupt validation hook for `std::speech.speak` — see speech.agency. */ export declare function _validateSpeakArgs(format: string, speed: number): void; /** Pre-interrupt validation hook for `std::speech.transcribe` — see speech.agency. */ export declare function _validateTranscribeArgs(timestampGranularity: string): void; /** * Backs `std::speech.transcribe` (speech-to-text). Resolves + authorizes the * audio path (Agency's allow-list) and verifies it is a readable regular file * BEFORE any paid dispatch — preserving today's local missing-file failure and * keeping it off the metered path. Then routes through `ctx.llmClient.transcribe` * with cost/guards/statelog. Throws on failure. */ export declare function _transcribe(filepath: string, language: string, allowedPaths: string[], model: string, provider: string, prompt: string, timestampGranularity: string, apiKey: string): Promise; /** * Publish synthesized audio to `finalPath` without overwriting an existing * file. `create-only` writes the whole file beside the target and links it * into place, so the target appears complete or not at all, and a file that * appeared after the preflight makes the publish fail rather than be * replaced. Cancellation is checked last, right before the write. */ export declare function publishSpeechOutput(host: Host, finalPath: string, audio: Uint8Array, signal: AbortSignal): Promise; /** * Backs `std::speech.speak` (cloud text-to-speech). Resolves + authorizes the * output path and refuses to overwrite an existing file BEFORE any paid * dispatch. Routes through `ctx.llmClient.speak` with cost/guards/statelog, then * publishes the audio atomically. Returns the output file path; throws on failure. */ export declare function _synthesizeSpeech(text: string, outputFile: string, voice: string, model: string, provider: string, format: string, speed: number, allowedPaths: string[], apiKey: string, instructions?: string): Promise; type LocalSpeechFormat = TranscodeFormat; /** The most text one request to the local server carries. A cancelled call * holds the server for at most one piece. */ export declare const LOCAL_PIECE_CHARS = 500; /** Pre-interrupt validation hook for `std::speech.speakLocal` — see * speech.agency. An unknown model, format, or speed never prompts. * Returns the format that will be written. */ export declare function _validateSpeakLocalArgs(text: string, model: string, format: string, outputFile: string, speed: number): LocalSpeechFormat; /** * Backs `std::speech.speakLocal`. Sends the text to the mlx provider in * pieces, asking for raw PCM for each, joins the samples, and writes the * file through the same accounting and publish path as `speak`. */ export declare function _speakLocal(text: string, outputFile: string, model: string, voice: string, instructions: string, format: string, allowedPaths: string[], speed: number): Promise; /** True when `p` exists. A symlink at `p`, dangling or not, throws from * `resolvePath`, so paid synthesis never proceeds toward a commit that * would be refused. */ export declare function pathExists(host: Host, p: string): Promise;