Files
openclaw/src/tts/tts-auto-mode.ts
Vincent Koc 26db578edc perf(inbound): trim reply startup imports (#52470)
* perf(inbound): trim dispatch and command startup imports

* fix(reply): restore command alias canonicalization

* style(reply): format command context

* fix(reply): restore runtime shim exports

* test(reply): mock ACP route seam

* fix(reply): repair dispatch type seams

* perf(inbound): defer followup reply helpers

* refactor(tts): share auto mode normalization

* fix(reply): catch followup compaction notice failures
2026-03-22 14:04:00 -07:00

15 lines
462 B
TypeScript

import type { TtsAutoMode } from "../config/types.tts.js";
export const TTS_AUTO_MODES = new Set<TtsAutoMode>(["off", "always", "inbound", "tagged"]);
export function normalizeTtsAutoMode(value: unknown): TtsAutoMode | undefined {
if (typeof value !== "string") {
return undefined;
}
const normalized = value.trim().toLowerCase();
if (TTS_AUTO_MODES.has(normalized as TtsAutoMode)) {
return normalized as TtsAutoMode;
}
return undefined;
}