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

@@ -19,9 +19,7 @@ export function getBearerToken(req: IncomingMessage): string | undefined {
export function resolveAgentIdFromHeader(req: IncomingMessage): string | undefined {
const raw =
getHeader(req, "x-clawdbot-agent-id")?.trim() ||
getHeader(req, "x-clawdbot-agent")?.trim() ||
"";
getHeader(req, "x-moltbot-agent-id")?.trim() || getHeader(req, "x-moltbot-agent")?.trim() || "";
if (!raw) return undefined;
return normalizeAgentId(raw);
}
@@ -31,7 +29,7 @@ export function resolveAgentIdFromModel(model: string | undefined): string | und
if (!raw) return undefined;
const m =
raw.match(/^clawdbot[:/](?<agentId>[a-z0-9][a-z0-9_-]{0,63})$/i) ??
raw.match(/^moltbot[:/](?<agentId>[a-z0-9][a-z0-9_-]{0,63})$/i) ??
raw.match(/^agent:(?<agentId>[a-z0-9][a-z0-9_-]{0,63})$/i);
const agentId = m?.groups?.agentId;
if (!agentId) return undefined;
@@ -55,7 +53,7 @@ export function resolveSessionKey(params: {
user?: string | undefined;
prefix: string;
}): string {
const explicit = getHeader(params.req, "x-clawdbot-session-key")?.trim();
const explicit = getHeader(params.req, "x-moltbot-session-key")?.trim();
if (explicit) return explicit;
const user = params.user?.trim();