mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 23:28:27 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
import { buildChannelUiCatalog } from "../../channels/plugins/catalog.js";
|
||||
import { buildChannelAccountSnapshot } from "../../channels/plugins/status.js";
|
||||
import type { ChannelAccountSnapshot, ChannelPlugin } from "../../channels/plugins/types.js";
|
||||
import type { MoltbotConfig } from "../../config/config.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { loadConfig, readConfigFileSnapshot } from "../../config/config.js";
|
||||
import { getChannelActivity } from "../../infra/channel-activity.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../routing/session-key.js";
|
||||
@@ -33,7 +33,7 @@ type ChannelLogoutPayload = {
|
||||
export async function logoutChannelAccount(params: {
|
||||
channelId: ChannelId;
|
||||
accountId?: string | null;
|
||||
cfg: MoltbotConfig;
|
||||
cfg: OpenClawConfig;
|
||||
context: GatewayRequestContext;
|
||||
plugin: ChannelPlugin;
|
||||
}): Promise<ChannelLogoutPayload> {
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
writeRestartSentinel,
|
||||
} from "../../infra/restart-sentinel.js";
|
||||
import { listChannelPlugins } from "../../channels/plugins/index.js";
|
||||
import { loadMoltbotPlugins } from "../../plugins/loader.js";
|
||||
import { loadOpenClawPlugins } from "../../plugins/loader.js";
|
||||
import {
|
||||
ErrorCodes,
|
||||
errorShape,
|
||||
@@ -112,7 +112,7 @@ export const configHandlers: GatewayRequestHandlers = {
|
||||
}
|
||||
const cfg = loadConfig();
|
||||
const workspaceDir = resolveAgentWorkspaceDir(cfg, resolveDefaultAgentId(cfg));
|
||||
const pluginRegistry = loadMoltbotPlugins({
|
||||
const pluginRegistry = loadOpenClawPlugins({
|
||||
config: cfg,
|
||||
workspaceDir,
|
||||
logger: {
|
||||
|
||||
@@ -16,16 +16,16 @@ describe("logs.tail", () => {
|
||||
});
|
||||
|
||||
it("falls back to latest rolling log file when today is missing", async () => {
|
||||
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-logs-"));
|
||||
const older = path.join(tempDir, "moltbot-2026-01-20.log");
|
||||
const newer = path.join(tempDir, "moltbot-2026-01-21.log");
|
||||
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-logs-"));
|
||||
const older = path.join(tempDir, "openclaw-2026-01-20.log");
|
||||
const newer = path.join(tempDir, "openclaw-2026-01-21.log");
|
||||
|
||||
await fs.writeFile(older, '{"msg":"old"}\n');
|
||||
await fs.writeFile(newer, '{"msg":"new"}\n');
|
||||
await fs.utimes(older, new Date(0), new Date(0));
|
||||
await fs.utimes(newer, new Date(), new Date());
|
||||
|
||||
setLoggerOverride({ file: path.join(tempDir, "moltbot-2026-01-22.log") });
|
||||
setLoggerOverride({ file: path.join(tempDir, "openclaw-2026-01-22.log") });
|
||||
|
||||
const respond = vi.fn();
|
||||
await logsHandlers["logs.tail"]({
|
||||
|
||||
@@ -13,7 +13,7 @@ const DEFAULT_LIMIT = 500;
|
||||
const DEFAULT_MAX_BYTES = 250_000;
|
||||
const MAX_LIMIT = 5000;
|
||||
const MAX_BYTES = 1_000_000;
|
||||
const ROLLING_LOG_RE = /^moltbot-\d{4}-\d{2}-\d{2}\.log$/;
|
||||
const ROLLING_LOG_RE = /^openclaw-\d{4}-\d{2}-\d{2}\.log$/;
|
||||
|
||||
function clamp(value: number, min: number, max: number) {
|
||||
return Math.max(min, Math.min(max, value));
|
||||
|
||||
@@ -2,7 +2,7 @@ import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../agents/ag
|
||||
import { installSkill } from "../../agents/skills-install.js";
|
||||
import { buildWorkspaceSkillStatus } from "../../agents/skills-status.js";
|
||||
import { loadWorkspaceSkillEntries, type SkillEntry } from "../../agents/skills.js";
|
||||
import type { MoltbotConfig } from "../../config/config.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { loadConfig, writeConfigFile } from "../../config/config.js";
|
||||
import { getRemoteSkillEligibility } from "../../infra/skills-remote.js";
|
||||
import {
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
} from "../protocol/index.js";
|
||||
import type { GatewayRequestHandlers } from "./types.js";
|
||||
|
||||
function listWorkspaceDirs(cfg: MoltbotConfig): string[] {
|
||||
function listWorkspaceDirs(cfg: OpenClawConfig): string[] {
|
||||
const dirs = new Set<string>();
|
||||
const list = cfg.agents?.list;
|
||||
if (Array.isArray(list)) {
|
||||
@@ -172,7 +172,7 @@ export const skillsHandlers: GatewayRequestHandlers = {
|
||||
}
|
||||
entries[p.skillKey] = current;
|
||||
skills.entries = entries;
|
||||
const nextConfig: MoltbotConfig = {
|
||||
const nextConfig: OpenClawConfig = {
|
||||
...cfg,
|
||||
skills,
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { resolveMoltbotPackageRoot } from "../../infra/moltbot-root.js";
|
||||
import { resolveOpenClawPackageRoot } from "../../infra/openclaw-root.js";
|
||||
import { scheduleGatewaySigusr1Restart } from "../../infra/restart.js";
|
||||
import {
|
||||
formatDoctorNonInteractiveHint,
|
||||
@@ -49,7 +49,7 @@ export const updateHandlers: GatewayRequestHandlers = {
|
||||
let result: Awaited<ReturnType<typeof runGatewayUpdate>>;
|
||||
try {
|
||||
const root =
|
||||
(await resolveMoltbotPackageRoot({
|
||||
(await resolveOpenClawPackageRoot({
|
||||
moduleUrl: import.meta.url,
|
||||
argv1: process.argv[1],
|
||||
cwd: process.cwd(),
|
||||
|
||||
Reference in New Issue
Block a user