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

@@ -3,9 +3,9 @@ import fs from "node:fs";
import json5 from "json5";
import { resolveConfigPath } from "../config/paths.js";
import type { ClawdbotConfig } from "../config/types.js";
import type { MoltbotConfig } from "../config/types.js";
type LoggingConfig = ClawdbotConfig["logging"];
type LoggingConfig = MoltbotConfig["logging"];
export function readLoggingConfig(): LoggingConfig | undefined {
const configPath = resolveConfigPath();

View File

@@ -126,7 +126,7 @@ describe("enableConsoleCapture", () => {
});
function tempLogPath() {
return path.join(os.tmpdir(), `clawdbot-log-${crypto.randomUUID()}.log`);
return path.join(os.tmpdir(), `moltbot-log-${crypto.randomUUID()}.log`);
}
function eioError() {

View File

@@ -1,7 +1,7 @@
import { createRequire } from "node:module";
import util from "node:util";
import type { ClawdbotConfig } from "../config/types.js";
import type { MoltbotConfig } from "../config/types.js";
import { isVerbose } from "../globals.js";
import { stripAnsi } from "../terminal/ansi.js";
import { type LogLevel, normalizeLogLevel } from "./levels.js";
@@ -32,7 +32,7 @@ function normalizeConsoleStyle(style?: string): ConsoleStyle {
}
function resolveConsoleSettings(): ConsoleSettings {
let cfg: ClawdbotConfig["logging"] | undefined =
let cfg: MoltbotConfig["logging"] | undefined =
(loggingState.overrideSettings as LoggerSettings | null) ?? readLoggingConfig();
if (!cfg) {
if (loggingState.resolvingConsoleSettings) {
@@ -41,7 +41,7 @@ function resolveConsoleSettings(): ConsoleSettings {
loggingState.resolvingConsoleSettings = true;
try {
const loaded = requireConfig("../config/config.js") as {
loadConfig?: () => ClawdbotConfig;
loadConfig?: () => MoltbotConfig;
};
cfg = loaded.loadConfig?.().logging;
} catch {

View File

@@ -4,7 +4,7 @@ import path from "node:path";
import { Logger as TsLogger } from "tslog";
import type { ClawdbotConfig } from "../config/types.js";
import type { MoltbotConfig } from "../config/types.js";
import type { ConsoleStyle } from "./console.js";
import { type LogLevel, levelToMinLevel, normalizeLogLevel } from "./levels.js";
import { readLoggingConfig } from "./config.js";
@@ -12,10 +12,10 @@ import { loggingState } from "./state.js";
// Pin to /tmp so mac Debug UI and docs match; os.tmpdir() can be a per-user
// randomized path on macOS which made the “Open log” button a no-op.
export const DEFAULT_LOG_DIR = "/tmp/clawdbot";
export const DEFAULT_LOG_FILE = path.join(DEFAULT_LOG_DIR, "clawdbot.log"); // legacy single-file path
export const DEFAULT_LOG_DIR = "/tmp/moltbot";
export const DEFAULT_LOG_FILE = path.join(DEFAULT_LOG_DIR, "moltbot.log"); // legacy single-file path
const LOG_PREFIX = "clawdbot";
const LOG_PREFIX = "moltbot";
const LOG_SUFFIX = ".log";
const MAX_LOG_AGE_MS = 24 * 60 * 60 * 1000; // 24h
@@ -52,12 +52,12 @@ function attachExternalTransport(logger: TsLogger<LogObj>, transport: LogTranspo
}
function resolveSettings(): ResolvedSettings {
let cfg: ClawdbotConfig["logging"] | undefined =
let cfg: MoltbotConfig["logging"] | undefined =
(loggingState.overrideSettings as LoggerSettings | null) ?? readLoggingConfig();
if (!cfg) {
try {
const loaded = requireConfig("../config/config.js") as {
loadConfig?: () => ClawdbotConfig;
loadConfig?: () => MoltbotConfig;
};
cfg = loaded.loadConfig?.().logging;
} catch {
@@ -88,7 +88,7 @@ function buildLogger(settings: ResolvedSettings): TsLogger<LogObj> {
pruneOldRollingLogs(path.dirname(settings.file));
}
const logger = new TsLogger<LogObj>({
name: "clawdbot",
name: "moltbot",
minLevel: levelToMinLevel(settings.level),
type: "hidden", // no ansi formatting
});

View File

@@ -1,6 +1,6 @@
import { createRequire } from "node:module";
import type { ClawdbotConfig } from "../config/config.js";
import type { MoltbotConfig } from "../config/config.js";
const requireConfig = createRequire(import.meta.url);
@@ -97,10 +97,10 @@ function redactText(text: string, patterns: RegExp[]): string {
}
function resolveConfigRedaction(): RedactOptions {
let cfg: ClawdbotConfig["logging"] | undefined;
let cfg: MoltbotConfig["logging"] | undefined;
try {
const loaded = requireConfig("../config/config.js") as {
loadConfig?: () => ClawdbotConfig;
loadConfig?: () => MoltbotConfig;
};
cfg = loaded.loadConfig?.().logging;
} catch {