mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 10:27:38 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import { getChannelPlugin } from "../../channels/plugins/index.js";
|
||||
import type { ChannelId, ChannelSetupInput } from "../../channels/plugins/types.js";
|
||||
import type { MoltbotConfig } from "../../config/config.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { normalizeAccountId } from "../../routing/session-key.js";
|
||||
|
||||
type ChatChannel = ChannelId;
|
||||
|
||||
export function applyAccountName(params: {
|
||||
cfg: MoltbotConfig;
|
||||
cfg: OpenClawConfig;
|
||||
channel: ChatChannel;
|
||||
accountId: string;
|
||||
name?: string;
|
||||
}): MoltbotConfig {
|
||||
}): OpenClawConfig {
|
||||
const accountId = normalizeAccountId(params.accountId);
|
||||
const plugin = getChannelPlugin(params.channel);
|
||||
const apply = plugin?.setup?.applyAccountName;
|
||||
@@ -18,7 +18,7 @@ export function applyAccountName(params: {
|
||||
}
|
||||
|
||||
export function applyChannelAccountConfig(params: {
|
||||
cfg: MoltbotConfig;
|
||||
cfg: OpenClawConfig;
|
||||
channel: ChatChannel;
|
||||
accountId: string;
|
||||
name?: string;
|
||||
@@ -52,7 +52,7 @@ export function applyChannelAccountConfig(params: {
|
||||
groupChannels?: string[];
|
||||
dmAllowlist?: string[];
|
||||
autoDiscoverChannels?: boolean;
|
||||
}): MoltbotConfig {
|
||||
}): OpenClawConfig {
|
||||
const accountId = normalizeAccountId(params.accountId);
|
||||
const plugin = getChannelPlugin(params.channel);
|
||||
const apply = plugin?.setup?.applyAccountConfig;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../agents/ag
|
||||
import { listChannelPluginCatalogEntries } from "../../channels/plugins/catalog.js";
|
||||
import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js";
|
||||
import type { ChannelId } from "../../channels/plugins/types.js";
|
||||
import { writeConfigFile, type MoltbotConfig } from "../../config/config.js";
|
||||
import { writeConfigFile, type OpenClawConfig } from "../../config/config.js";
|
||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../routing/session-key.js";
|
||||
import { defaultRuntime, type RuntimeEnv } from "../../runtime.js";
|
||||
import { createClackPrompter } from "../../wizard/clack-prompter.js";
|
||||
@@ -60,7 +60,7 @@ function parseList(value: string | undefined): string[] | undefined {
|
||||
return parsed.length > 0 ? parsed : undefined;
|
||||
}
|
||||
|
||||
function resolveCatalogChannelEntry(raw: string, cfg: MoltbotConfig | null) {
|
||||
function resolveCatalogChannelEntry(raw: string, cfg: OpenClawConfig | null) {
|
||||
const trimmed = raw.trim().toLowerCase();
|
||||
if (!trimmed) return undefined;
|
||||
const workspaceDir = cfg ? resolveAgentWorkspaceDir(cfg, resolveDefaultAgentId(cfg)) : undefined;
|
||||
|
||||
@@ -89,7 +89,7 @@ describe("channelsCapabilitiesCommand", () => {
|
||||
botToken: "xoxb-bot",
|
||||
config: { userToken: "xoxp-user" },
|
||||
},
|
||||
probe: { ok: true, bot: { name: "moltbot" }, team: { name: "team" } },
|
||||
probe: { ok: true, bot: { name: "openclaw" }, team: { name: "team" } },
|
||||
});
|
||||
vi.mocked(listChannelPlugins).mockReturnValue([plugin]);
|
||||
vi.mocked(getChannelPlugin).mockReturnValue(plugin);
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { ChannelCapabilities, ChannelPlugin } from "../../channels/plugins/
|
||||
import { fetchChannelPermissionsDiscord } from "../../discord/send.js";
|
||||
import { parseDiscordTarget } from "../../discord/targets.js";
|
||||
import { danger } from "../../globals.js";
|
||||
import type { MoltbotConfig } from "../../config/config.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { defaultRuntime, type RuntimeEnv } from "../../runtime.js";
|
||||
import { fetchSlackScopes, type SlackScopesResult } from "../../slack/scopes.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
@@ -291,7 +291,7 @@ async function buildDiscordPermissions(params: {
|
||||
|
||||
async function resolveChannelReports(params: {
|
||||
plugin: ChannelPlugin;
|
||||
cfg: MoltbotConfig;
|
||||
cfg: OpenClawConfig;
|
||||
timeoutMs: number;
|
||||
accountOverride?: string;
|
||||
target?: string;
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
listChannelPlugins,
|
||||
normalizeChannelId,
|
||||
} from "../../channels/plugins/index.js";
|
||||
import { type MoltbotConfig, writeConfigFile } from "../../config/config.js";
|
||||
import { type OpenClawConfig, writeConfigFile } from "../../config/config.js";
|
||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../routing/session-key.js";
|
||||
import { defaultRuntime, type RuntimeEnv } from "../../runtime.js";
|
||||
import { createClackPrompter } from "../../wizard/clack-prompter.js";
|
||||
@@ -16,7 +16,7 @@ export type ChannelsRemoveOptions = {
|
||||
delete?: boolean;
|
||||
};
|
||||
|
||||
function listAccountIds(cfg: MoltbotConfig, channel: ChatChannel): string[] {
|
||||
function listAccountIds(cfg: OpenClawConfig, channel: ChatChannel): string[] {
|
||||
const plugin = getChannelPlugin(channel);
|
||||
if (!plugin) return [];
|
||||
return plugin.config.listAccountIds(cfg);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type ChannelId, getChannelPlugin } from "../../channels/plugins/index.js";
|
||||
import { formatCliCommand } from "../../cli/command-format.js";
|
||||
import { type MoltbotConfig, readConfigFileSnapshot } from "../../config/config.js";
|
||||
import { type OpenClawConfig, readConfigFileSnapshot } from "../../config/config.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../routing/session-key.js";
|
||||
import { defaultRuntime, type RuntimeEnv } from "../../runtime.js";
|
||||
|
||||
@@ -8,7 +8,7 @@ export type ChatChannel = ChannelId;
|
||||
|
||||
export async function requireValidConfig(
|
||||
runtime: RuntimeEnv = defaultRuntime,
|
||||
): Promise<MoltbotConfig | null> {
|
||||
): Promise<OpenClawConfig | null> {
|
||||
const snapshot = await readConfigFileSnapshot();
|
||||
if (snapshot.exists && !snapshot.valid) {
|
||||
const issues =
|
||||
@@ -16,7 +16,7 @@ export async function requireValidConfig(
|
||||
? snapshot.issues.map((issue) => `- ${issue.path}: ${issue.message}`).join("\n")
|
||||
: "Unknown validation issue.";
|
||||
runtime.error(`Config invalid:\n${issues}`);
|
||||
runtime.error(`Fix the config or run ${formatCliCommand("moltbot doctor")}.`);
|
||||
runtime.error(`Fix the config or run ${formatCliCommand("openclaw doctor")}.`);
|
||||
runtime.exit(1);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { listChannelPlugins } from "../../channels/plugins/index.js";
|
||||
import { buildChannelAccountSnapshot } from "../../channels/plugins/status.js";
|
||||
import type { ChannelAccountSnapshot } from "../../channels/plugins/types.js";
|
||||
import { withProgress } from "../../cli/progress.js";
|
||||
import { type MoltbotConfig, readConfigFileSnapshot } from "../../config/config.js";
|
||||
import { type OpenClawConfig, readConfigFileSnapshot } from "../../config/config.js";
|
||||
import { callGateway } from "../../gateway/call.js";
|
||||
import { formatAge } from "../../infra/channel-summary.js";
|
||||
import { collectChannelStatusIssues } from "../../infra/channels-status-issues.js";
|
||||
@@ -143,7 +143,7 @@ export function formatGatewayChannelsStatusLines(payload: Record<string, unknown
|
||||
`- ${issue.channel} ${issue.accountId}: ${issue.message}${issue.fix ? ` (${issue.fix})` : ""}`,
|
||||
);
|
||||
}
|
||||
lines.push(`- Run: ${formatCliCommand("moltbot doctor")}`);
|
||||
lines.push(`- Run: ${formatCliCommand("openclaw doctor")}`);
|
||||
lines.push("");
|
||||
}
|
||||
lines.push(
|
||||
@@ -153,7 +153,7 @@ export function formatGatewayChannelsStatusLines(payload: Record<string, unknown
|
||||
}
|
||||
|
||||
async function formatConfigChannelsStatusLines(
|
||||
cfg: MoltbotConfig,
|
||||
cfg: OpenClawConfig,
|
||||
meta: { path?: string; mode?: "local" | "remote" },
|
||||
): Promise<string[]> {
|
||||
const lines: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user