mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-28 21:51:13 +00:00
refactor(speech-core): remove redundant API back-edge
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
// Public speech-core plugin SDK facade. Re-export stable provider/config helpers
|
||||
// from the plugin-sdk alias so speech plugins do not import core internals.
|
||||
export {
|
||||
asBoolean,
|
||||
asFiniteNumber,
|
||||
asObject,
|
||||
assertOkOrThrowProviderError,
|
||||
canonicalizeSpeechProviderId,
|
||||
createProviderHttpError,
|
||||
extractProviderErrorDetail,
|
||||
extractProviderRequestId,
|
||||
formatProviderErrorPayload,
|
||||
formatProviderHttpErrorMessage,
|
||||
getSpeechProvider,
|
||||
listSpeechProviders,
|
||||
normalizeApplyTextNormalization,
|
||||
normalizeLanguageCode,
|
||||
normalizeSeed,
|
||||
normalizeSpeechProviderId,
|
||||
normalizeTtsAutoMode,
|
||||
parseTtsDirectives,
|
||||
readResponseTextLimited,
|
||||
requireInRange,
|
||||
resolveEffectiveTtsConfig,
|
||||
scheduleCleanup,
|
||||
summarizeText,
|
||||
trimToUndefined,
|
||||
truncateErrorDetail,
|
||||
TTS_AUTO_MODES,
|
||||
} from "openclaw/plugin-sdk/speech-core";
|
||||
export type {
|
||||
ResolvedTtsConfig,
|
||||
ResolvedTtsModelOverrides,
|
||||
SpeechDirectiveTokenParseContext,
|
||||
SpeechDirectiveTokenParseResult,
|
||||
SpeechListVoicesRequest,
|
||||
SpeechModelOverridePolicy,
|
||||
SpeechProviderConfig,
|
||||
SpeechProviderConfiguredContext,
|
||||
SpeechProviderOverrides,
|
||||
SpeechProviderPlugin,
|
||||
SpeechProviderPreparedSynthesis,
|
||||
SpeechProviderPrepareSynthesisContext,
|
||||
SpeechProviderResolveConfigContext,
|
||||
SpeechProviderResolveTalkConfigContext,
|
||||
SpeechProviderResolveTalkOverridesContext,
|
||||
SpeechSynthesisRequest,
|
||||
SpeechSynthesisStreamRequest,
|
||||
SpeechSynthesisStreamResult,
|
||||
SpeechSynthesisTarget,
|
||||
SpeechTelephonySynthesisRequest,
|
||||
SpeechVoiceOption,
|
||||
TtsConfigResolutionContext,
|
||||
TtsDirectiveOverrides,
|
||||
TtsDirectiveParseResult,
|
||||
} from "openclaw/plugin-sdk/speech-core";
|
||||
@@ -12,11 +12,6 @@
|
||||
"import": "./dist/runtime-api.mjs",
|
||||
"default": "./dist/runtime-api.mjs"
|
||||
},
|
||||
"./api": {
|
||||
"types": "./dist/api.d.mts",
|
||||
"import": "./dist/api.mjs",
|
||||
"default": "./dist/api.mjs"
|
||||
},
|
||||
"./runtime-api": {
|
||||
"types": "./dist/runtime-api.d.mts",
|
||||
"import": "./dist/runtime-api.mjs",
|
||||
|
||||
@@ -83,8 +83,8 @@ vi.mock("openclaw/plugin-sdk/channel-targets", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock("../api.js", async () => {
|
||||
const actual = await vi.importActual<typeof import("../api.js")>("../api.js");
|
||||
vi.mock("openclaw/plugin-sdk/speech-core", async () => {
|
||||
const actual = await vi.importActual("openclaw/plugin-sdk/speech-core");
|
||||
const mockProvider: SpeechProviderPlugin = {
|
||||
id: "mock",
|
||||
label: "Mock",
|
||||
|
||||
@@ -27,17 +27,6 @@ import {
|
||||
import { isVerbose, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
||||
import { tempWorkspaceSync, resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/sandbox";
|
||||
import { privateFileStoreSync } from "openclaw/plugin-sdk/security-runtime";
|
||||
import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalLowercaseString,
|
||||
normalizeOptionalString,
|
||||
} from "openclaw/plugin-sdk/string-coerce-runtime";
|
||||
import { stripMarkdown } from "openclaw/plugin-sdk/text-chunking";
|
||||
import {
|
||||
resolveConfigDir,
|
||||
resolveUserPath,
|
||||
truncateUtf16Safe,
|
||||
} from "openclaw/plugin-sdk/text-utility-runtime";
|
||||
import {
|
||||
canonicalizeSpeechProviderId,
|
||||
getSpeechProvider,
|
||||
@@ -57,7 +46,18 @@ import {
|
||||
type TtsDirectiveOverrides,
|
||||
type TtsDirectiveParseResult,
|
||||
type TtsConfigResolutionContext,
|
||||
} from "../api.js";
|
||||
} from "openclaw/plugin-sdk/speech-core";
|
||||
import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalLowercaseString,
|
||||
normalizeOptionalString,
|
||||
} from "openclaw/plugin-sdk/string-coerce-runtime";
|
||||
import { stripMarkdown } from "openclaw/plugin-sdk/text-chunking";
|
||||
import {
|
||||
resolveConfigDir,
|
||||
resolveUserPath,
|
||||
truncateUtf16Safe,
|
||||
} from "openclaw/plugin-sdk/text-utility-runtime";
|
||||
import { withSpeakerSelectionCompat } from "../speaker.js";
|
||||
import {
|
||||
resolvePrimaryVoiceProviderCandidate,
|
||||
|
||||
Reference in New Issue
Block a user