fix(tts): split shared tts config types

This commit is contained in:
Vincent Koc
2026-04-11 20:25:02 +01:00
parent 44f02dbbc6
commit 7d1bd0c98c
4 changed files with 30 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
// Shared speech-provider implementation helpers for bundled and third-party plugins.
export type { SpeechProviderPlugin } from "../plugins/types.js";
export type { ResolvedTtsConfig, ResolvedTtsModelOverrides } from "../tts/tts-types.js";
export type {
SpeechDirectiveTokenParseContext,
SpeechDirectiveTokenParseResult,

View File

@@ -14,7 +14,7 @@ import {
normalizeOptionalLowercaseString,
normalizeOptionalString,
} from "../shared/string-coerce.js";
import type { ResolvedTtsConfig } from "./tts.js";
import type { ResolvedTtsConfig } from "./tts-types.js";
const TEMP_FILE_CLEANUP_DELAY_MS = 5 * 60 * 1000; // 5 minutes

20
src/tts/tts-types.ts Normal file
View File

@@ -0,0 +1,20 @@
import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { TtsAutoMode, TtsConfig, TtsMode, TtsProvider } from "../config/types.tts.js";
import type { SpeechModelOverridePolicy, SpeechProviderConfig } from "./provider-types.js";
export type ResolvedTtsModelOverrides = SpeechModelOverridePolicy;
export type ResolvedTtsConfig = {
auto: TtsAutoMode;
mode: TtsMode;
provider: TtsProvider;
providerSource: "config" | "default";
summaryModel?: string;
modelOverrides: ResolvedTtsModelOverrides;
providerConfigs: Record<string, SpeechProviderConfig>;
prefsPath?: string;
maxTextLength: number;
timeoutMs: number;
rawConfig?: TtsConfig;
sourceConfig?: OpenClawConfig;
};