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

@@ -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
});