mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-26 01:11:37 +00:00
perf(inbound): trim dispatch and command startup imports (#52374)
* 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
This commit is contained in:
19
src/tts/tts-config.ts
Normal file
19
src/tts/tts-config.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type { TtsAutoMode, TtsMode } from "../config/types.tts.js";
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
export function resolveConfiguredTtsMode(cfg: OpenClawConfig): TtsMode {
|
||||
return cfg.messages?.tts?.mode ?? "final";
|
||||
}
|
||||
1
src/tts/tts.runtime.ts
Normal file
1
src/tts/tts.runtime.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { maybeApplyTtsToPayload } from "./tts.js";
|
||||
Reference in New Issue
Block a user