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

View File

@@ -2,13 +2,13 @@ import fs from "node:fs/promises";
import path from "node:path";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { withTempHome as withTempHomeBase } from "../../test/helpers/temp-home.js";
import type { MoltbotConfig } from "../config/config.js";
import type { OpenClawConfig } from "../config/config.js";
async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
return withTempHomeBase(fn, { prefix: "moltbot-models-" });
return withTempHomeBase(fn, { prefix: "openclaw-models-" });
}
const MODELS_CONFIG: MoltbotConfig = {
const MODELS_CONFIG: OpenClawConfig = {
models: {
providers: {
"custom-proxy": {
@@ -66,10 +66,10 @@ describe("models-config", () => {
try {
vi.resetModules();
const { ensureMoltbotModelsJson } = await import("./models-config.js");
const { ensureOpenClawModelsJson } = await import("./models-config.js");
const agentDir = path.join(home, "agent-empty");
const result = await ensureMoltbotModelsJson(
const result = await ensureOpenClawModelsJson(
{
models: { providers: {} },
},
@@ -103,12 +103,12 @@ describe("models-config", () => {
it("writes models.json for configured providers", async () => {
await withTempHome(async () => {
vi.resetModules();
const { ensureMoltbotModelsJson } = await import("./models-config.js");
const { resolveMoltbotAgentDir } = await import("./agent-paths.js");
const { ensureOpenClawModelsJson } = await import("./models-config.js");
const { resolveOpenClawAgentDir } = await import("./agent-paths.js");
await ensureMoltbotModelsJson(MODELS_CONFIG);
await ensureOpenClawModelsJson(MODELS_CONFIG);
const modelPath = path.join(resolveMoltbotAgentDir(), "models.json");
const modelPath = path.join(resolveOpenClawAgentDir(), "models.json");
const raw = await fs.readFile(modelPath, "utf8");
const parsed = JSON.parse(raw) as {
providers: Record<string, { baseUrl?: string }>;
@@ -123,12 +123,12 @@ describe("models-config", () => {
const prevKey = process.env.MINIMAX_API_KEY;
process.env.MINIMAX_API_KEY = "sk-minimax-test";
try {
const { ensureMoltbotModelsJson } = await import("./models-config.js");
const { resolveMoltbotAgentDir } = await import("./agent-paths.js");
const { ensureOpenClawModelsJson } = await import("./models-config.js");
const { resolveOpenClawAgentDir } = await import("./agent-paths.js");
await ensureMoltbotModelsJson({});
await ensureOpenClawModelsJson({});
const modelPath = path.join(resolveMoltbotAgentDir(), "models.json");
const modelPath = path.join(resolveOpenClawAgentDir(), "models.json");
const raw = await fs.readFile(modelPath, "utf8");
const parsed = JSON.parse(raw) as {
providers: Record<
@@ -157,12 +157,12 @@ describe("models-config", () => {
const prevKey = process.env.SYNTHETIC_API_KEY;
process.env.SYNTHETIC_API_KEY = "sk-synthetic-test";
try {
const { ensureMoltbotModelsJson } = await import("./models-config.js");
const { resolveMoltbotAgentDir } = await import("./agent-paths.js");
const { ensureOpenClawModelsJson } = await import("./models-config.js");
const { resolveOpenClawAgentDir } = await import("./agent-paths.js");
await ensureMoltbotModelsJson({});
await ensureOpenClawModelsJson({});
const modelPath = path.join(resolveMoltbotAgentDir(), "models.json");
const modelPath = path.join(resolveOpenClawAgentDir(), "models.json");
const raw = await fs.readFile(modelPath, "utf8");
const parsed = JSON.parse(raw) as {
providers: Record<