refactor: rename to openclaw

This commit is contained in:
Peter Steinberger
2026-01-30 03:15:10 +01:00
parent 4583f88626
commit 9a7160786a
2357 changed files with 16688 additions and 16788 deletions
+12 -12
View File
@@ -449,8 +449,8 @@ describe("tts", () => {
};
it("skips auto-TTS when inbound audio gating is on and the message is not audio", async () => {
const prevPrefs = process.env.CLAWDBOT_TTS_PREFS;
process.env.CLAWDBOT_TTS_PREFS = `/tmp/tts-test-${Date.now()}.json`;
const prevPrefs = process.env.OPENCLAW_TTS_PREFS;
process.env.OPENCLAW_TTS_PREFS = `/tmp/tts-test-${Date.now()}.json`;
const originalFetch = globalThis.fetch;
const fetchMock = vi.fn(async () => ({
ok: true,
@@ -470,12 +470,12 @@ describe("tts", () => {
expect(fetchMock).not.toHaveBeenCalled();
globalThis.fetch = originalFetch;
process.env.CLAWDBOT_TTS_PREFS = prevPrefs;
process.env.OPENCLAW_TTS_PREFS = prevPrefs;
});
it("attempts auto-TTS when inbound audio gating is on and the message is audio", async () => {
const prevPrefs = process.env.CLAWDBOT_TTS_PREFS;
process.env.CLAWDBOT_TTS_PREFS = `/tmp/tts-test-${Date.now()}.json`;
const prevPrefs = process.env.OPENCLAW_TTS_PREFS;
process.env.OPENCLAW_TTS_PREFS = `/tmp/tts-test-${Date.now()}.json`;
const originalFetch = globalThis.fetch;
const fetchMock = vi.fn(async () => ({
ok: true,
@@ -494,12 +494,12 @@ describe("tts", () => {
expect(fetchMock).toHaveBeenCalledTimes(1);
globalThis.fetch = originalFetch;
process.env.CLAWDBOT_TTS_PREFS = prevPrefs;
process.env.OPENCLAW_TTS_PREFS = prevPrefs;
});
it("skips auto-TTS in tagged mode unless a tts tag is present", async () => {
const prevPrefs = process.env.CLAWDBOT_TTS_PREFS;
process.env.CLAWDBOT_TTS_PREFS = `/tmp/tts-test-${Date.now()}.json`;
const prevPrefs = process.env.OPENCLAW_TTS_PREFS;
process.env.OPENCLAW_TTS_PREFS = `/tmp/tts-test-${Date.now()}.json`;
const originalFetch = globalThis.fetch;
const fetchMock = vi.fn(async () => ({
ok: true,
@@ -526,12 +526,12 @@ describe("tts", () => {
expect(fetchMock).not.toHaveBeenCalled();
globalThis.fetch = originalFetch;
process.env.CLAWDBOT_TTS_PREFS = prevPrefs;
process.env.OPENCLAW_TTS_PREFS = prevPrefs;
});
it("runs auto-TTS in tagged mode when tags are present", async () => {
const prevPrefs = process.env.CLAWDBOT_TTS_PREFS;
process.env.CLAWDBOT_TTS_PREFS = `/tmp/tts-test-${Date.now()}.json`;
const prevPrefs = process.env.OPENCLAW_TTS_PREFS;
process.env.OPENCLAW_TTS_PREFS = `/tmp/tts-test-${Date.now()}.json`;
const originalFetch = globalThis.fetch;
const fetchMock = vi.fn(async () => ({
ok: true,
@@ -557,7 +557,7 @@ describe("tts", () => {
expect(fetchMock).toHaveBeenCalledTimes(1);
globalThis.fetch = originalFetch;
process.env.CLAWDBOT_TTS_PREFS = prevPrefs;
process.env.OPENCLAW_TTS_PREFS = prevPrefs;
});
});
});
+9 -9
View File
@@ -17,7 +17,7 @@ import { EdgeTTS } from "node-edge-tts";
import type { ReplyPayload } from "../auto-reply/types.js";
import { normalizeChannelId } from "../channels/plugins/index.js";
import type { ChannelId } from "../channels/plugins/types.js";
import type { MoltbotConfig } from "../config/config.js";
import type { OpenClawConfig } from "../config/config.js";
import type {
TtsConfig,
TtsAutoMode,
@@ -245,7 +245,7 @@ function resolveModelOverridePolicy(
};
}
export function resolveTtsConfig(cfg: MoltbotConfig): ResolvedTtsConfig {
export function resolveTtsConfig(cfg: OpenClawConfig): ResolvedTtsConfig {
const raw: TtsConfig = cfg.messages?.tts ?? {};
const providerSource = raw.provider ? "config" : "default";
const edgeOutputFormat = raw.edge?.outputFormat?.trim();
@@ -304,7 +304,7 @@ export function resolveTtsConfig(cfg: MoltbotConfig): ResolvedTtsConfig {
export function resolveTtsPrefsPath(config: ResolvedTtsConfig): string {
if (config.prefsPath?.trim()) return resolveUserPath(config.prefsPath.trim());
const envPath = process.env.CLAWDBOT_TTS_PREFS?.trim();
const envPath = process.env.OPENCLAW_TTS_PREFS?.trim();
if (envPath) return resolveUserPath(envPath);
return path.join(CONFIG_DIR, "settings", "tts.json");
}
@@ -330,7 +330,7 @@ export function resolveTtsAutoMode(params: {
return params.config.auto;
}
export function buildTtsSystemPromptHint(cfg: MoltbotConfig): string | undefined {
export function buildTtsSystemPromptHint(cfg: OpenClawConfig): string | undefined {
const config = resolveTtsConfig(cfg);
const prefsPath = resolveTtsPrefsPath(config);
const autoMode = resolveTtsAutoMode({ config, prefsPath });
@@ -809,7 +809,7 @@ type SummaryModelSelection = {
};
function resolveSummaryModelRef(
cfg: MoltbotConfig,
cfg: OpenClawConfig,
config: ResolvedTtsConfig,
): SummaryModelSelection {
const defaultRef = resolveDefaultModelForAgent({ cfg });
@@ -833,7 +833,7 @@ function isTextContentBlock(block: { type: string }): block is TextContent {
async function summarizeText(params: {
text: string;
targetLength: number;
cfg: MoltbotConfig;
cfg: OpenClawConfig;
config: ResolvedTtsConfig;
timeoutMs: number;
}): Promise<SummarizeResult> {
@@ -1078,7 +1078,7 @@ async function edgeTTS(params: {
export async function textToSpeech(params: {
text: string;
cfg: MoltbotConfig;
cfg: OpenClawConfig;
prefsPath?: string;
channel?: string;
overrides?: TtsDirectiveOverrides;
@@ -1249,7 +1249,7 @@ export async function textToSpeech(params: {
export async function textToSpeechTelephony(params: {
text: string;
cfg: MoltbotConfig;
cfg: OpenClawConfig;
prefsPath?: string;
}): Promise<TtsTelephonyResult> {
const config = resolveTtsConfig(params.cfg);
@@ -1343,7 +1343,7 @@ export async function textToSpeechTelephony(params: {
export async function maybeApplyTtsToPayload(params: {
payload: ReplyPayload;
cfg: MoltbotConfig;
cfg: OpenClawConfig;
channel?: string;
kind?: "tool" | "block" | "final";
inboundAudio?: boolean;