@evious/voice-agent 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +210 -2
  3. package/dist/cli/args.d.ts +16 -0
  4. package/dist/cli/args.d.ts.map +1 -0
  5. package/dist/cli/args.js +63 -0
  6. package/dist/cli/args.js.map +1 -0
  7. package/dist/cli/config.d.ts +4 -0
  8. package/dist/cli/config.d.ts.map +1 -0
  9. package/dist/cli/config.js +80 -0
  10. package/dist/cli/config.js.map +1 -0
  11. package/dist/cli/dictate.d.ts +4 -0
  12. package/dist/cli/dictate.d.ts.map +1 -0
  13. package/dist/cli/dictate.js +68 -0
  14. package/dist/cli/dictate.js.map +1 -0
  15. package/dist/cli/doctor.d.ts +8 -0
  16. package/dist/cli/doctor.d.ts.map +1 -0
  17. package/dist/cli/doctor.js +106 -0
  18. package/dist/cli/doctor.js.map +1 -0
  19. package/dist/cli/io.d.ts +15 -0
  20. package/dist/cli/io.d.ts.map +1 -0
  21. package/dist/cli/io.js +74 -0
  22. package/dist/cli/io.js.map +1 -0
  23. package/dist/cli/menu.d.ts +8 -0
  24. package/dist/cli/menu.d.ts.map +1 -0
  25. package/dist/cli/menu.js +177 -0
  26. package/dist/cli/menu.js.map +1 -0
  27. package/dist/cli/models.d.ts +4 -0
  28. package/dist/cli/models.d.ts.map +1 -0
  29. package/dist/cli/models.js +54 -0
  30. package/dist/cli/models.js.map +1 -0
  31. package/dist/cli/speech.d.ts +8 -0
  32. package/dist/cli/speech.d.ts.map +1 -0
  33. package/dist/cli/speech.js +219 -0
  34. package/dist/cli/speech.js.map +1 -0
  35. package/dist/cli.d.ts +3 -0
  36. package/dist/cli.d.ts.map +1 -0
  37. package/dist/cli.js +115 -0
  38. package/dist/cli.js.map +1 -0
  39. package/dist/core/audio.d.ts +8 -0
  40. package/dist/core/audio.d.ts.map +1 -0
  41. package/dist/core/audio.js +43 -0
  42. package/dist/core/audio.js.map +1 -0
  43. package/dist/core/clipboard.d.ts +15 -0
  44. package/dist/core/clipboard.d.ts.map +1 -0
  45. package/dist/core/clipboard.js +72 -0
  46. package/dist/core/clipboard.js.map +1 -0
  47. package/dist/core/config.d.ts +39 -0
  48. package/dist/core/config.d.ts.map +1 -0
  49. package/dist/core/config.js +116 -0
  50. package/dist/core/config.js.map +1 -0
  51. package/dist/core/deps.d.ts +27 -0
  52. package/dist/core/deps.d.ts.map +1 -0
  53. package/dist/core/deps.js +90 -0
  54. package/dist/core/deps.js.map +1 -0
  55. package/dist/core/dictate.d.ts +36 -0
  56. package/dist/core/dictate.d.ts.map +1 -0
  57. package/dist/core/dictate.js +124 -0
  58. package/dist/core/dictate.js.map +1 -0
  59. package/dist/core/doctor.d.ts +29 -0
  60. package/dist/core/doctor.d.ts.map +1 -0
  61. package/dist/core/doctor.js +52 -0
  62. package/dist/core/doctor.js.map +1 -0
  63. package/dist/core/errors.d.ts +35 -0
  64. package/dist/core/errors.d.ts.map +1 -0
  65. package/dist/core/errors.js +62 -0
  66. package/dist/core/errors.js.map +1 -0
  67. package/dist/core/exec.d.ts +66 -0
  68. package/dist/core/exec.d.ts.map +1 -0
  69. package/dist/core/exec.js +276 -0
  70. package/dist/core/exec.js.map +1 -0
  71. package/dist/core/index.d.ts +19 -0
  72. package/dist/core/index.d.ts.map +1 -0
  73. package/dist/core/index.js +18 -0
  74. package/dist/core/index.js.map +1 -0
  75. package/dist/core/models.d.ts +72 -0
  76. package/dist/core/models.d.ts.map +1 -0
  77. package/dist/core/models.js +311 -0
  78. package/dist/core/models.js.map +1 -0
  79. package/dist/core/paths.d.ts +23 -0
  80. package/dist/core/paths.d.ts.map +1 -0
  81. package/dist/core/paths.js +76 -0
  82. package/dist/core/paths.js.map +1 -0
  83. package/dist/core/piper.d.ts +79 -0
  84. package/dist/core/piper.d.ts.map +1 -0
  85. package/dist/core/piper.js +356 -0
  86. package/dist/core/piper.js.map +1 -0
  87. package/dist/core/playback.d.ts +66 -0
  88. package/dist/core/playback.d.ts.map +1 -0
  89. package/dist/core/playback.js +177 -0
  90. package/dist/core/playback.js.map +1 -0
  91. package/dist/core/record.d.ts +77 -0
  92. package/dist/core/record.d.ts.map +1 -0
  93. package/dist/core/record.js +271 -0
  94. package/dist/core/record.js.map +1 -0
  95. package/dist/core/speech.d.ts +24 -0
  96. package/dist/core/speech.d.ts.map +1 -0
  97. package/dist/core/speech.js +36 -0
  98. package/dist/core/speech.js.map +1 -0
  99. package/dist/core/text.d.ts +17 -0
  100. package/dist/core/text.d.ts.map +1 -0
  101. package/dist/core/text.js +88 -0
  102. package/dist/core/text.js.map +1 -0
  103. package/dist/core/transcribe.d.ts +22 -0
  104. package/dist/core/transcribe.d.ts.map +1 -0
  105. package/dist/core/transcribe.js +79 -0
  106. package/dist/core/transcribe.js.map +1 -0
  107. package/dist/core/transcript.d.ts +5 -0
  108. package/dist/core/transcript.d.ts.map +1 -0
  109. package/dist/core/transcript.js +71 -0
  110. package/dist/core/transcript.js.map +1 -0
  111. package/dist/core/tts.d.ts +37 -0
  112. package/dist/core/tts.d.ts.map +1 -0
  113. package/dist/core/tts.js +110 -0
  114. package/dist/core/tts.js.map +1 -0
  115. package/dist/core/types.d.ts +49 -0
  116. package/dist/core/types.d.ts.map +1 -0
  117. package/dist/core/types.js +3 -0
  118. package/dist/core/types.js.map +1 -0
  119. package/dist/core/voices.d.ts +26 -0
  120. package/dist/core/voices.d.ts.map +1 -0
  121. package/dist/core/voices.js +107 -0
  122. package/dist/core/voices.js.map +1 -0
  123. package/dist/mcp.d.ts +3 -0
  124. package/dist/mcp.d.ts.map +1 -0
  125. package/dist/mcp.js +281 -0
  126. package/dist/mcp.js.map +1 -0
  127. package/dist/platforms/linux.d.ts +14 -0
  128. package/dist/platforms/linux.d.ts.map +1 -0
  129. package/dist/platforms/linux.js +129 -0
  130. package/dist/platforms/linux.js.map +1 -0
  131. package/dist/platforms/windows.d.ts +16 -0
  132. package/dist/platforms/windows.d.ts.map +1 -0
  133. package/dist/platforms/windows.js +199 -0
  134. package/dist/platforms/windows.js.map +1 -0
  135. package/package.json +76 -4
@@ -0,0 +1,124 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { rm, stat } from "node:fs/promises";
3
+ import path from "node:path";
4
+ import { copyToClipboard } from "./clipboard.js";
5
+ import { loadConfig } from "./config.js";
6
+ import { VoiceError } from "./errors.js";
7
+ import { DEFAULT_MODEL_ID, binaryPath, ensureBinary, ensureModel, isFileOfSize, modelById, modelPath, } from "./models.js";
8
+ import { ensureAppDirs } from "./paths.js";
9
+ import { cleanupTempFiles } from "./playback.js";
10
+ import { detectCaptureSource, startRecording } from "./record.js";
11
+ import { transcribeAudio } from "./transcribe.js";
12
+ /**
13
+ * Record → transcribe → (optionally) copy.
14
+ *
15
+ * Shared by the CLI and the MCP server so both behave identically. Returns
16
+ * `empty: true` instead of throwing when no speech was recognised: the caller
17
+ * decides whether that is a failure (CLI exit code) or a normal answer (agent).
18
+ */
19
+ export async function dictate(options, paths) {
20
+ await ensureAppDirs(paths);
21
+ const config = await loadConfig(paths);
22
+ await cleanupTempFiles(paths, { maxAgeMs: 60_000 });
23
+ const modelId = options.modelId ?? config.model ?? DEFAULT_MODEL_ID;
24
+ const spec = modelById(modelId);
25
+ const noDownload = options.noDownload === true || process.env.VOICE_AGENT_NO_DOWNLOAD === "1";
26
+ const progress = options.onProgress;
27
+ await ensureBinaryOrExplain(paths, noDownload, progress);
28
+ await ensureModelOrExplain(paths, modelId, noDownload, progress);
29
+ const binary = binaryPath(paths);
30
+ const model = modelPath(paths, modelId);
31
+ const language = options.language ?? config.language ?? "auto";
32
+ const maxSeconds = options.maxSeconds ?? config.maxSeconds;
33
+ const source = await detectCaptureSource();
34
+ const outFile = path.join(paths.tempDir, `dictation-${randomUUID()}.wav`);
35
+ const recorder = startRecording({
36
+ outFile,
37
+ maxSeconds,
38
+ backend: source.backend,
39
+ device: source.device,
40
+ silenceMs: config.silenceMs,
41
+ });
42
+ options.onRecordingStart?.();
43
+ if (options.stopSignal) {
44
+ void options.stopSignal.then(() => recorder.stop()).catch(() => { });
45
+ }
46
+ let recordingMs = 0;
47
+ let text = "";
48
+ let detectedLanguage = language;
49
+ let transcribeMs = 0;
50
+ let audioDurationMs = null;
51
+ try {
52
+ const recording = await recorder.done;
53
+ recordingMs = recording.durationMs;
54
+ const result = await transcribeAudio({ audio: outFile, model, binary, language });
55
+ text = result.text;
56
+ detectedLanguage = result.language;
57
+ transcribeMs = result.durationMs;
58
+ audioDurationMs = result.audioDurationMs;
59
+ }
60
+ finally {
61
+ // The audio never outlives the transcription.
62
+ await rm(outFile, { force: true }).catch(() => { });
63
+ }
64
+ const empty = text.length === 0;
65
+ const wantCopy = !empty && (options.copy ?? (config.insert === "copy"));
66
+ let copied = false;
67
+ let copyMethod;
68
+ if (wantCopy) {
69
+ try {
70
+ const result = await copyToClipboard(paths, text);
71
+ copied = true;
72
+ copyMethod = result.method;
73
+ }
74
+ catch (error) {
75
+ // Dictation succeeded; a missing clipboard tool must not lose the text.
76
+ options.onWarning?.(`could not copy to the clipboard: ${error instanceof Error ? error.message : String(error)}`);
77
+ }
78
+ }
79
+ return {
80
+ text,
81
+ language: detectedLanguage,
82
+ model: spec.id,
83
+ recordingMs,
84
+ audioDurationMs,
85
+ transcribeMs,
86
+ copied,
87
+ ...(copyMethod === undefined ? {} : { copyMethod }),
88
+ empty,
89
+ };
90
+ }
91
+ async function ensureBinaryOrExplain(paths, noDownload, onProgress) {
92
+ if (await nonEmptyFile(binaryPath(paths)))
93
+ return;
94
+ if (noDownload) {
95
+ throw new VoiceError({
96
+ code: "NO_ENGINE",
97
+ message: "whisper.cpp is not installed and downloads are disabled.",
98
+ nextStep: "Run `voice-agent models download` once.",
99
+ });
100
+ }
101
+ await ensureBinary(paths, onProgress === undefined ? {} : { onProgress });
102
+ }
103
+ async function ensureModelOrExplain(paths, modelId, noDownload, onProgress) {
104
+ const spec = modelById(modelId);
105
+ if (await isFileOfSize(modelPath(paths, modelId), spec.bytes))
106
+ return;
107
+ if (noDownload) {
108
+ throw new VoiceError({
109
+ code: "NO_MODEL",
110
+ message: `Model "${modelId}" is not installed and downloads are disabled.`,
111
+ nextStep: `Run \`voice-agent models download ${modelId}\` once.`,
112
+ });
113
+ }
114
+ await ensureModel(paths, modelId, onProgress === undefined ? {} : { onProgress });
115
+ }
116
+ async function nonEmptyFile(file) {
117
+ try {
118
+ return (await stat(file)).size > 0;
119
+ }
120
+ catch {
121
+ return false;
122
+ }
123
+ }
124
+ //# sourceMappingURL=dictate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dictate.js","sourceRoot":"","sources":["../../src/core/dictate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,SAAS,EACT,SAAS,GACV,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,aAAa,EAAiB,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AA8BjD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,OAAuB,EAAE,KAAe;IACpE,MAAM,aAAa,CAAC,KAAK,CAAC,CAAA;IAC1B,MAAM,MAAM,GAAG,MAAM,UAA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I,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;IAC/B,IAAI,MAAM,YAAY,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC;QAAE,OAAM;IAErE,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,IAAI,UAAU,CAAC;YACnB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,UAAU,OAAO,gDAAgD;YAC1E,QAAQ,EAAE,qCAAqC,OAAO,UAAU;SACjE,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAA;AACnF,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,IAAY;IACtC,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAA;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { type ToolReport } from "./deps.js";
2
+ import type { AppPaths } from "./paths.js";
3
+ export interface DictationStatus {
4
+ binary: string;
5
+ binaryInstalled: boolean;
6
+ model: string;
7
+ modelInstalled: boolean;
8
+ modelPath: string;
9
+ }
10
+ export interface PiperStatus {
11
+ binary: string;
12
+ binaryInstalled: boolean;
13
+ voices: string[];
14
+ }
15
+ export interface DoctorReport {
16
+ ok: boolean;
17
+ version: string;
18
+ node: string;
19
+ platform: NodeJS.Platform;
20
+ arch: string;
21
+ paths: AppPaths;
22
+ configExists: boolean;
23
+ tools: ToolReport[];
24
+ dictation: DictationStatus;
25
+ piper: PiperStatus;
26
+ }
27
+ /** Everything `voice-agent doctor` and the `voice_doctor` tool report. */
28
+ export declare function buildDoctorReport(paths: AppPaths, version: string): Promise<DoctorReport>;
29
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/core/doctor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAA;AAIzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,eAAe,EAAE,OAAO,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,OAAO,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,eAAe,EAAE,OAAO,CAAA;IACxB,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,QAAQ,CAAA;IACf,YAAY,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,SAAS,EAAE,eAAe,CAAA;IAC1B,KAAK,EAAE,WAAW,CAAA;CACnB;AAED,0EAA0E;AAC1E,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAsC/F"}
@@ -0,0 +1,52 @@
1
+ import { stat } from "node:fs/promises";
2
+ import { collectTools } from "./deps.js";
3
+ import { loadConfig } from "./config.js";
4
+ import { binaryPath, isFileOfSize, modelById, modelPath, DEFAULT_MODEL_ID } from "./models.js";
5
+ import { installedPiperVoices, isPiperInstalled, piperBinaryPath } from "./piper.js";
6
+ /** Everything `voice-agent doctor` and the `voice_doctor` tool report. */
7
+ export async function buildDoctorReport(paths, version) {
8
+ const tools = await collectTools();
9
+ let configuredModel = DEFAULT_MODEL_ID;
10
+ try {
11
+ configuredModel = (await loadConfig(paths)).model;
12
+ }
13
+ catch {
14
+ // An invalid config must not break the doctor: report the default.
15
+ }
16
+ const modelSpec = modelById(configuredModel);
17
+ const binary = binaryPath(paths);
18
+ const model = modelPath(paths, modelSpec.id);
19
+ const report = {
20
+ ok: tools.every((tool) => !tool.required || tool.found),
21
+ version,
22
+ node: process.version,
23
+ platform: process.platform,
24
+ arch: process.arch,
25
+ paths,
26
+ configExists: await exists(paths.configFile),
27
+ tools,
28
+ dictation: {
29
+ binary,
30
+ binaryInstalled: await exists(binary),
31
+ model: modelSpec.id,
32
+ modelInstalled: await isFileOfSize(model, modelSpec.bytes),
33
+ modelPath: model,
34
+ },
35
+ piper: {
36
+ binary: piperBinaryPath(paths),
37
+ binaryInstalled: await isPiperInstalled(paths),
38
+ voices: (await installedPiperVoices(paths)).map((voice) => voice.id),
39
+ },
40
+ };
41
+ return report;
42
+ }
43
+ async function exists(file) {
44
+ try {
45
+ await stat(file);
46
+ return true;
47
+ }
48
+ catch {
49
+ return false;
50
+ }
51
+ }
52
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/core/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAEvC,OAAO,EAAE,YAAY,EAAmB,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9F,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA8BpF,0EAA0E;AAC1E,MAAM,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AG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;SACrE;KACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,IAAY;IAChC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,CAAA;QAChB,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Every failure the CLI/MCP can report carries a stable code, a message and,
3
+ * when possible, a concrete next step. The MCP layer turns this into an
4
+ * actionable tool error instead of a generic stack trace.
5
+ */
6
+ export declare const VOICE_ERROR_CODES: readonly ["NO_MIC", "NO_MODEL", "NO_ENGINE", "NO_VOICES", "BUSY", "TIMEOUT", "ABORTED", "EMPTY_AUDIO", "EMPTY_TEXT", "UNSUPPORTED", "CONFIG", "SPAWN_FAILED", "IO"];
7
+ export type VoiceErrorCode = (typeof VOICE_ERROR_CODES)[number];
8
+ export interface VoiceErrorInit {
9
+ code: VoiceErrorCode;
10
+ message: string;
11
+ /** What the user or agent should do next. Shown after the message. */
12
+ nextStep?: string;
13
+ /** Machine-readable context (paths, exit codes, stderr tails...). */
14
+ details?: Record<string, unknown>;
15
+ cause?: unknown;
16
+ }
17
+ export declare class VoiceError extends Error {
18
+ readonly code: VoiceErrorCode;
19
+ readonly nextStep: string | undefined;
20
+ readonly details: Record<string, unknown> | undefined;
21
+ constructor(init: VoiceErrorInit);
22
+ toJSON(): {
23
+ name: "VoiceError";
24
+ code: VoiceErrorCode;
25
+ message: string;
26
+ nextStep?: string;
27
+ details?: Record<string, unknown>;
28
+ };
29
+ }
30
+ export declare function isVoiceError(error: unknown): error is VoiceError;
31
+ /** Wrap anything thrown into a VoiceError, keeping the original message. */
32
+ export declare function toVoiceError(error: unknown, fallbackCode?: VoiceErrorCode): VoiceError;
33
+ /** One-line-per-field rendering for terminals. */
34
+ export declare function formatVoiceError(error: unknown): string;
35
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,YAC5B,QAAQ,EACR,UAAU,EACV,WAAW,EACX,WAAW,EACX,MAAM,EACN,SAAS,EACT,SAAS,EACT,aAAa,EACb,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACd,IAAI,CACI,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE/D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,cAAc,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;IAErD,YAAY,IAAI,EAAE,cAAc,EAM/B;IAED,MAAM,IAAI;QACR,IAAI,EAAE,YAAY,CAAA;QAClB,IAAI,EAAE,cAAc,CAAA;QACpB,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAClC,CAQA;CACF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,GAAE,cAAqB,GAAG,UAAU,CAM5F;AAED,kDAAkD;AAClD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAKvD"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Every failure the CLI/MCP can report carries a stable code, a message and,
3
+ * when possible, a concrete next step. The MCP layer turns this into an
4
+ * actionable tool error instead of a generic stack trace.
5
+ */
6
+ export const VOICE_ERROR_CODES = [
7
+ "NO_MIC",
8
+ "NO_MODEL",
9
+ "NO_ENGINE",
10
+ "NO_VOICES",
11
+ "BUSY",
12
+ "TIMEOUT",
13
+ "ABORTED",
14
+ "EMPTY_AUDIO",
15
+ "EMPTY_TEXT",
16
+ "UNSUPPORTED",
17
+ "CONFIG",
18
+ "SPAWN_FAILED",
19
+ "IO",
20
+ ];
21
+ export class VoiceError extends Error {
22
+ code;
23
+ nextStep;
24
+ details;
25
+ constructor(init) {
26
+ super(init.message, init.cause === undefined ? undefined : { cause: init.cause });
27
+ this.name = "VoiceError";
28
+ this.code = init.code;
29
+ this.nextStep = init.nextStep;
30
+ this.details = init.details;
31
+ }
32
+ toJSON() {
33
+ return {
34
+ name: "VoiceError",
35
+ code: this.code,
36
+ message: this.message,
37
+ ...(this.nextStep === undefined ? {} : { nextStep: this.nextStep }),
38
+ ...(this.details === undefined ? {} : { details: this.details }),
39
+ };
40
+ }
41
+ }
42
+ export function isVoiceError(error) {
43
+ return error instanceof VoiceError;
44
+ }
45
+ /** Wrap anything thrown into a VoiceError, keeping the original message. */
46
+ export function toVoiceError(error, fallbackCode = "IO") {
47
+ if (isVoiceError(error))
48
+ return error;
49
+ if (error instanceof Error) {
50
+ return new VoiceError({ code: fallbackCode, message: error.message, cause: error });
51
+ }
52
+ return new VoiceError({ code: fallbackCode, message: String(error), cause: error });
53
+ }
54
+ /** One-line-per-field rendering for terminals. */
55
+ export function formatVoiceError(error) {
56
+ const voiceError = toVoiceError(error);
57
+ const lines = [`${voiceError.code}: ${voiceError.message}`];
58
+ if (voiceError.nextStep)
59
+ lines.push(` -> ${voiceError.nextStep}`);
60
+ return lines.join("\n");
61
+ }
62
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,QAAQ;IACR,UAAU;IACV,WAAW;IACX,WAAW;IACX,MAAM;IACN,SAAS;IACT,SAAS;IACT,aAAa;IACb,YAAY;IACZ,aAAa;IACb,QAAQ;IACR,cAAc;IACd,IAAI;CACI,CAAA;AAcV,MAAM,OAAO,UAAW,SAAQ,KAAK;IAC1B,IAAI,CAAgB;IACpB,QAAQ,CAAoB;IAC5B,OAAO,CAAqC;IAErD,YAAY,IAAoB;QAC9B,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;QACjF,IAAI,CAAC,IAAI,GAAG,YAAY,CAAA;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;QACrB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;IAC7B,CAAC;IAED,MAAM;QAOJ,OAAO;YACL,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QA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{
4
+ cwd?: string;
5
+ env?: NodeJS.ProcessEnv;
6
+ /** Kill the process tree after this long. Defaults to 30 s. */
7
+ timeoutMs?: number;
8
+ signal?: AbortSignal;
9
+ /** Written to stdin, which is then closed. */
10
+ input?: string | Uint8Array;
11
+ maxOutputBytes?: number;
12
+ }
13
+ export interface ExecResult {
14
+ command: string;
15
+ args: string[];
16
+ code: number | null;
17
+ signal: NodeJS.Signals | null;
18
+ stdout: string;
19
+ stderr: string;
20
+ durationMs: number;
21
+ timedOut: boolean;
22
+ }
23
+ export interface BackgroundHandle {
24
+ pid: number;
25
+ /** Resolves when the process exits (or fails to start). */
26
+ exit: Promise<{
27
+ code: number | null;
28
+ signal: NodeJS.Signals | null;
29
+ }>;
30
+ stop: (signal?: NodeJS.Signals) => Promise<boolean>;
31
+ }
32
+ /**
33
+ * Run a command without a shell.
34
+ *
35
+ * `shell: false` is non-negotiable: Windows user profiles contain spaces
36
+ * ("Fran Carlos"), paths contain backslashes and Spanish text contains
37
+ * non-ASCII characters. Argument arrays avoid every quoting bug at once.
38
+ *
39
+ * Non-zero exit codes resolve (the caller decides what is fatal); spawn
40
+ * failures, aborts and output overflows reject with a VoiceError.
41
+ */
42
+ export declare function exec(command: string, args?: readonly string[], options?: ExecOptions): Promise<ExecResult>;
43
+ /** Run a command and throw a VoiceError unless it exits 0 in time. */
44
+ export declare function execOrThrow(command: string, args?: readonly string[], options?: ExecOptions): Promise<ExecResult>;
45
+ /**
46
+ * Run a command sharing the terminal (sudo prompts, package installers).
47
+ * Resolves with the exit code.
48
+ */
49
+ export declare function execInteractive(command: string, args?: readonly string[], options?: {
50
+ cwd?: string;
51
+ env?: NodeJS.ProcessEnv;
52
+ }): Promise<number>;
53
+ /** Fire-and-forget process that survives the parent (audio players). */
54
+ export declare function spawnBackground(command: string, args?: readonly string[], options?: {
55
+ cwd?: string;
56
+ env?: NodeJS.ProcessEnv;
57
+ }): BackgroundHandle;
58
+ /** Kill a whole process tree by pid. Returns true when a signal was delivered. */
59
+ export declare function killPid(pid: number, signal?: NodeJS.Signals): Promise<boolean>;
60
+ export declare function isPidAlive(pid: number): Promise<boolean>;
61
+ /** Cross-platform `which`/`where`. Never throws. */
62
+ export declare function commandExists(command: string, options?: {
63
+ env?: NodeJS.ProcessEnv;
64
+ timeoutMs?: number;
65
+ }): Promise<boolean>;
66
+ //# sourceMappingURL=exec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/core/exec.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,QAAS,CAAA;AACxC,eAAO,MAAM,wBAAwB,QAAkB,CAAA;AAIvD,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IACvB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,2DAA2D;IAC3D,IAAI,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;KAAE,CAAC,C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