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

@@ -9,7 +9,7 @@ import {
loadAgentIdentityFromWorkspace,
parseIdentityMarkdown as parseIdentityMarkdownFile,
} from "../agents/identity-file.js";
import type { MoltbotConfig } from "../config/config.js";
import type { OpenClawConfig } from "../config/config.js";
import { normalizeAgentId } from "../routing/session-key.js";
export type AgentSummary = {
@@ -28,11 +28,11 @@ export type AgentSummary = {
isDefault: boolean;
};
type AgentEntry = NonNullable<NonNullable<MoltbotConfig["agents"]>["list"]>[number];
type AgentEntry = NonNullable<NonNullable<OpenClawConfig["agents"]>["list"]>[number];
export type AgentIdentity = AgentIdentityFile;
export function listAgentEntries(cfg: MoltbotConfig): AgentEntry[] {
export function listAgentEntries(cfg: OpenClawConfig): AgentEntry[] {
const list = cfg.agents?.list;
if (!Array.isArray(list)) return [];
return list.filter((entry): entry is AgentEntry => Boolean(entry && typeof entry === "object"));
@@ -43,14 +43,14 @@ export function findAgentEntryIndex(list: AgentEntry[], agentId: string): number
return list.findIndex((entry) => normalizeAgentId(entry.id) === id);
}
function resolveAgentName(cfg: MoltbotConfig, agentId: string) {
function resolveAgentName(cfg: OpenClawConfig, agentId: string) {
const entry = listAgentEntries(cfg).find(
(agent) => normalizeAgentId(agent.id) === normalizeAgentId(agentId),
);
return entry?.name?.trim() || undefined;
}
function resolveAgentModel(cfg: MoltbotConfig, agentId: string) {
function resolveAgentModel(cfg: OpenClawConfig, agentId: string) {
const entry = listAgentEntries(cfg).find(
(agent) => normalizeAgentId(agent.id) === normalizeAgentId(agentId),
);
@@ -78,7 +78,7 @@ export function loadAgentIdentity(workspace: string): AgentIdentity | null {
return identityHasValues(parsed) ? parsed : null;
}
export function buildAgentSummaries(cfg: MoltbotConfig): AgentSummary[] {
export function buildAgentSummaries(cfg: OpenClawConfig): AgentSummary[] {
const defaultAgentId = normalizeAgentId(resolveDefaultAgentId(cfg));
const configuredAgents = listAgentEntries(cfg);
const orderedIds =
@@ -122,7 +122,7 @@ export function buildAgentSummaries(cfg: MoltbotConfig): AgentSummary[] {
}
export function applyAgentConfig(
cfg: MoltbotConfig,
cfg: OpenClawConfig,
params: {
agentId: string;
name?: string;
@@ -130,7 +130,7 @@ export function applyAgentConfig(
agentDir?: string;
model?: string;
},
): MoltbotConfig {
): OpenClawConfig {
const agentId = normalizeAgentId(params.agentId);
const name = params.name?.trim();
const list = listAgentEntries(cfg);
@@ -162,10 +162,10 @@ export function applyAgentConfig(
}
export function pruneAgentConfig(
cfg: MoltbotConfig,
cfg: OpenClawConfig,
agentId: string,
): {
config: MoltbotConfig;
config: OpenClawConfig;
removedBindings: number;
removedAllow: number;
} {