mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:48:27 +00:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
normalizeChannelId,
|
||||
} from "../channels/plugins/index.js";
|
||||
import type { ChannelId } from "../channels/plugins/types.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { AgentBinding } from "../config/types.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../routing/session-key.js";
|
||||
|
||||
@@ -43,7 +43,7 @@ function formatProviderState(entry: ProviderAccountStatus): string {
|
||||
}
|
||||
|
||||
export async function buildProviderStatusIndex(
|
||||
cfg: ClawdbotConfig,
|
||||
cfg: MoltbotConfig,
|
||||
): Promise<Map<string, ProviderAccountStatus>> {
|
||||
const map = new Map<string, ProviderAccountStatus>();
|
||||
|
||||
@@ -91,13 +91,13 @@ export async function buildProviderStatusIndex(
|
||||
return map;
|
||||
}
|
||||
|
||||
function resolveDefaultAccountId(cfg: ClawdbotConfig, provider: ChannelId): string {
|
||||
function resolveDefaultAccountId(cfg: MoltbotConfig, provider: ChannelId): string {
|
||||
const plugin = getChannelPlugin(provider);
|
||||
if (!plugin) return DEFAULT_ACCOUNT_ID;
|
||||
return resolveChannelDefaultAccountId({ plugin, cfg });
|
||||
}
|
||||
|
||||
function shouldShowProviderEntry(entry: ProviderAccountStatus, cfg: ClawdbotConfig): boolean {
|
||||
function shouldShowProviderEntry(entry: ProviderAccountStatus, cfg: MoltbotConfig): boolean {
|
||||
const plugin = getChannelPlugin(entry.provider);
|
||||
if (!plugin) return Boolean(entry.configured);
|
||||
if (plugin.meta.showConfigured === false) {
|
||||
@@ -116,7 +116,7 @@ function formatProviderEntry(entry: ProviderAccountStatus): string {
|
||||
return `${label}: ${formatProviderState(entry)}`;
|
||||
}
|
||||
|
||||
export function summarizeBindings(cfg: ClawdbotConfig, bindings: AgentBinding[]): string[] {
|
||||
export function summarizeBindings(cfg: MoltbotConfig, bindings: AgentBinding[]): string[] {
|
||||
if (bindings.length === 0) return [];
|
||||
const seen = new Map<string, string>();
|
||||
for (const binding of bindings) {
|
||||
@@ -137,7 +137,7 @@ export function summarizeBindings(cfg: ClawdbotConfig, bindings: AgentBinding[])
|
||||
|
||||
export function listProvidersForAgent(params: {
|
||||
summaryIsDefault: boolean;
|
||||
cfg: ClawdbotConfig;
|
||||
cfg: MoltbotConfig;
|
||||
bindings: AgentBinding[];
|
||||
providerStatus: Map<string, ProviderAccountStatus>;
|
||||
}): string[] {
|
||||
|
||||
Reference in New Issue
Block a user