refactor: rename clawdbot to moltbot with legacy compat

This commit is contained in:
Peter Steinberger
2026-01-27 12:19:58 +00:00
parent 83460df96f
commit 6d16a658e5
1839 changed files with 11250 additions and 11199 deletions

View File

@@ -1,8 +1,8 @@
import fs from "node:fs/promises";
import path from "node:path";
import { type ClawdbotConfig, loadConfig } from "../config/config.js";
import { resolveClawdbotAgentDir } from "./agent-paths.js";
import { type MoltbotConfig, loadConfig } from "../config/config.js";
import { resolveMoltbotAgentDir } from "./agent-paths.js";
import {
normalizeProviders,
type ProviderConfig,
@@ -11,7 +11,7 @@ import {
resolveImplicitProviders,
} from "./models-config.providers.js";
type ModelsConfig = NonNullable<ClawdbotConfig["models"]>;
type ModelsConfig = NonNullable<MoltbotConfig["models"]>;
const DEFAULT_MODE: NonNullable<ModelsConfig["mode"]> = "merge";
@@ -72,12 +72,12 @@ async function readJson(pathname: string): Promise<unknown> {
}
}
export async function ensureClawdbotModelsJson(
config?: ClawdbotConfig,
export async function ensureMoltbotModelsJson(
config?: MoltbotConfig,
agentDirOverride?: string,
): Promise<{ agentDir: string; wrote: boolean }> {
const cfg = config ?? loadConfig();
const agentDir = agentDirOverride?.trim() ? agentDirOverride.trim() : resolveClawdbotAgentDir();
const agentDir = agentDirOverride?.trim() ? agentDirOverride.trim() : resolveMoltbotAgentDir();
const explicitProviders = (cfg.models?.providers ?? {}) as Record<string, ProviderConfig>;
const implicitProviders = await resolveImplicitProviders({ agentDir });