refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -8,7 +8,7 @@ import type {
|
||||
ChannelOutboundAdapter,
|
||||
ChannelPlugin,
|
||||
} from "../src/channels/plugins/types.js";
|
||||
import type { ClawdbotConfig } from "../src/config/config.js";
|
||||
import type { MoltbotConfig } from "../src/config/config.js";
|
||||
import type { OutboundSendDeps } from "../src/infra/outbound/deliver.js";
|
||||
import { installProcessWarningFilter } from "../src/infra/warnings.js";
|
||||
import { setActivePluginRegistry } from "../src/plugins/runtime.js";
|
||||
@@ -80,7 +80,7 @@ const createStubPlugin = (params: {
|
||||
},
|
||||
capabilities: { chatTypes: ["direct", "group"] },
|
||||
config: {
|
||||
listAccountIds: (cfg: ClawdbotConfig) => {
|
||||
listAccountIds: (cfg: MoltbotConfig) => {
|
||||
const channels = cfg.channels as Record<string, unknown> | undefined;
|
||||
const entry = channels?.[params.id];
|
||||
if (!entry || typeof entry !== "object") return [];
|
||||
@@ -88,7 +88,7 @@ const createStubPlugin = (params: {
|
||||
const ids = accounts ? Object.keys(accounts).filter(Boolean) : [];
|
||||
return ids.length > 0 ? ids : ["default"];
|
||||
},
|
||||
resolveAccount: (cfg: ClawdbotConfig, accountId: string) => {
|
||||
resolveAccount: (cfg: MoltbotConfig, accountId: string) => {
|
||||
const channels = cfg.channels as Record<string, unknown> | undefined;
|
||||
const entry = channels?.[params.id];
|
||||
if (!entry || typeof entry !== "object") return {};
|
||||
@@ -96,7 +96,7 @@ const createStubPlugin = (params: {
|
||||
const match = accounts?.[accountId];
|
||||
return (match && typeof match === "object") || typeof match === "string" ? match : entry;
|
||||
},
|
||||
isConfigured: async (_account, cfg: ClawdbotConfig) => {
|
||||
isConfigured: async (_account, cfg: MoltbotConfig) => {
|
||||
const channels = cfg.channels as Record<string, unknown> | undefined;
|
||||
return Boolean(channels?.[params.id]);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user