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

@@ -1,4 +1,4 @@
import type { MoltbotConfig } from "../../config/config.js";
import type { OpenClawConfig } from "../../config/config.js";
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../routing/session-key.js";
type ChannelSectionBase = {
@@ -6,14 +6,14 @@ type ChannelSectionBase = {
accounts?: Record<string, Record<string, unknown>>;
};
function channelHasAccounts(cfg: MoltbotConfig, channelKey: string): boolean {
function channelHasAccounts(cfg: OpenClawConfig, channelKey: string): boolean {
const channels = cfg.channels as Record<string, unknown> | undefined;
const base = channels?.[channelKey] as ChannelSectionBase | undefined;
return Boolean(base?.accounts && Object.keys(base.accounts).length > 0);
}
function shouldStoreNameInAccounts(params: {
cfg: MoltbotConfig;
cfg: OpenClawConfig;
channelKey: string;
accountId: string;
alwaysUseAccounts?: boolean;
@@ -24,12 +24,12 @@ function shouldStoreNameInAccounts(params: {
}
export function applyAccountNameToChannelSection(params: {
cfg: MoltbotConfig;
cfg: OpenClawConfig;
channelKey: string;
accountId: string;
name?: string;
alwaysUseAccounts?: boolean;
}): MoltbotConfig {
}): OpenClawConfig {
const trimmed = params.name?.trim();
if (!trimmed) return params.cfg;
const accountId = normalizeAccountId(params.accountId);
@@ -54,7 +54,7 @@ export function applyAccountNameToChannelSection(params: {
name: trimmed,
},
},
} as MoltbotConfig;
} as OpenClawConfig;
}
const baseAccounts: Record<string, Record<string, unknown>> = base?.accounts ?? {};
const existingAccount = baseAccounts[accountId] ?? {};
@@ -77,14 +77,14 @@ export function applyAccountNameToChannelSection(params: {
},
},
},
} as MoltbotConfig;
} as OpenClawConfig;
}
export function migrateBaseNameToDefaultAccount(params: {
cfg: MoltbotConfig;
cfg: OpenClawConfig;
channelKey: string;
alwaysUseAccounts?: boolean;
}): MoltbotConfig {
}): OpenClawConfig {
if (params.alwaysUseAccounts) return params.cfg;
const channels = params.cfg.channels as Record<string, unknown> | undefined;
const base = channels?.[params.channelKey] as ChannelSectionBase | undefined;
@@ -107,5 +107,5 @@ export function migrateBaseNameToDefaultAccount(params: {
accounts,
},
},
} as MoltbotConfig;
} as OpenClawConfig;
}