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:
Vincent Koc
2026-03-22 13:19:57 -07:00
committed by GitHub
parent 3025760867
commit 5369ea53be
12 changed files with 234 additions and 131 deletions

19
src/tts/tts-config.ts Normal file
View 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
View File

@@ -0,0 +1 @@
export { maybeApplyTtsToPayload } from "./tts.js";