mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-29 01:02:03 +03:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -4,7 +4,7 @@ import path from "node:path";
|
||||
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { ClawdbotConfig } from "../src/config/config.js";
|
||||
import type { MoltbotConfig } from "../src/config/config.js";
|
||||
import type { MsgContext } from "../src/auto-reply/templating.js";
|
||||
|
||||
const makeTempDir = async (prefix: string) => await fs.mkdtemp(path.join(os.tmpdir(), prefix));
|
||||
@@ -16,7 +16,7 @@ const writeExecutable = async (dir: string, name: string, content: string) => {
|
||||
};
|
||||
|
||||
const makeTempMedia = async (ext: string) => {
|
||||
const dir = await makeTempDir("clawdbot-media-e2e-");
|
||||
const dir = await makeTempDir("moltbot-media-e2e-");
|
||||
const filePath = path.join(dir, `sample${ext}`);
|
||||
await fs.writeFile(filePath, "audio");
|
||||
return { dir, filePath };
|
||||
@@ -52,8 +52,8 @@ describe("media understanding auto-detect (e2e)", () => {
|
||||
it("uses sherpa-onnx-offline when available", async () => {
|
||||
const snapshot = envSnapshot();
|
||||
try {
|
||||
const binDir = await makeTempDir("clawdbot-bin-sherpa-");
|
||||
const modelDir = await makeTempDir("clawdbot-sherpa-model-");
|
||||
const binDir = await makeTempDir("moltbot-bin-sherpa-");
|
||||
const modelDir = await makeTempDir("moltbot-sherpa-model-");
|
||||
tempPaths.push(binDir, modelDir);
|
||||
|
||||
await fs.writeFile(path.join(modelDir, "tokens.txt"), "a");
|
||||
@@ -79,7 +79,7 @@ describe("media understanding auto-detect (e2e)", () => {
|
||||
MediaPath: filePath,
|
||||
MediaType: "audio/wav",
|
||||
};
|
||||
const cfg: ClawdbotConfig = { tools: { media: { audio: {} } } };
|
||||
const cfg: MoltbotConfig = { tools: { media: { audio: {} } } };
|
||||
|
||||
await applyMediaUnderstanding({ ctx, cfg });
|
||||
|
||||
@@ -92,8 +92,8 @@ describe("media understanding auto-detect (e2e)", () => {
|
||||
it("uses whisper-cli when sherpa is missing", async () => {
|
||||
const snapshot = envSnapshot();
|
||||
try {
|
||||
const binDir = await makeTempDir("clawdbot-bin-whispercpp-");
|
||||
const modelDir = await makeTempDir("clawdbot-whispercpp-model-");
|
||||
const binDir = await makeTempDir("moltbot-bin-whispercpp-");
|
||||
const modelDir = await makeTempDir("moltbot-whispercpp-model-");
|
||||
tempPaths.push(binDir, modelDir);
|
||||
|
||||
const modelPath = path.join(modelDir, "tiny.bin");
|
||||
@@ -124,7 +124,7 @@ describe("media understanding auto-detect (e2e)", () => {
|
||||
MediaPath: filePath,
|
||||
MediaType: "audio/wav",
|
||||
};
|
||||
const cfg: ClawdbotConfig = { tools: { media: { audio: {} } } };
|
||||
const cfg: MoltbotConfig = { tools: { media: { audio: {} } } };
|
||||
|
||||
await applyMediaUnderstanding({ ctx, cfg });
|
||||
|
||||
@@ -137,7 +137,7 @@ describe("media understanding auto-detect (e2e)", () => {
|
||||
it("uses gemini CLI for images when available", async () => {
|
||||
const snapshot = envSnapshot();
|
||||
try {
|
||||
const binDir = await makeTempDir("clawdbot-bin-gemini-");
|
||||
const binDir = await makeTempDir("moltbot-bin-gemini-");
|
||||
tempPaths.push(binDir);
|
||||
|
||||
await writeExecutable(
|
||||
@@ -157,7 +157,7 @@ describe("media understanding auto-detect (e2e)", () => {
|
||||
MediaPath: filePath,
|
||||
MediaType: "image/png",
|
||||
};
|
||||
const cfg: ClawdbotConfig = { tools: { media: { image: {} } } };
|
||||
const cfg: MoltbotConfig = { tools: { media: { image: {} } } };
|
||||
|
||||
await applyMediaUnderstanding({ ctx, cfg });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user