mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 14:48:28 +00:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -2,20 +2,20 @@ import { getChannelDock } from "../channels/dock.js";
|
||||
import { getChannelPlugin, listChannelPlugins } from "../channels/plugins/index.js";
|
||||
import { normalizeAnyChannelId } from "../channels/registry.js";
|
||||
import type { ChannelAgentTool, ChannelMessageActionName } from "../channels/plugins/types.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
|
||||
/**
|
||||
* Get the list of supported message actions for a specific channel.
|
||||
* Returns an empty array if channel is not found or has no actions configured.
|
||||
*/
|
||||
export function listChannelSupportedActions(params: {
|
||||
cfg?: ClawdbotConfig;
|
||||
cfg?: MoltbotConfig;
|
||||
channel?: string;
|
||||
}): ChannelMessageActionName[] {
|
||||
if (!params.channel) return [];
|
||||
const plugin = getChannelPlugin(params.channel as Parameters<typeof getChannelPlugin>[0]);
|
||||
if (!plugin?.actions?.listActions) return [];
|
||||
const cfg = params.cfg ?? ({} as ClawdbotConfig);
|
||||
const cfg = params.cfg ?? ({} as MoltbotConfig);
|
||||
return plugin.actions.listActions({ cfg });
|
||||
}
|
||||
|
||||
@@ -23,12 +23,12 @@ export function listChannelSupportedActions(params: {
|
||||
* Get the list of all supported message actions across all configured channels.
|
||||
*/
|
||||
export function listAllChannelSupportedActions(params: {
|
||||
cfg?: ClawdbotConfig;
|
||||
cfg?: MoltbotConfig;
|
||||
}): ChannelMessageActionName[] {
|
||||
const actions = new Set<ChannelMessageActionName>();
|
||||
for (const plugin of listChannelPlugins()) {
|
||||
if (!plugin.actions?.listActions) continue;
|
||||
const cfg = params.cfg ?? ({} as ClawdbotConfig);
|
||||
const cfg = params.cfg ?? ({} as MoltbotConfig);
|
||||
const channelActions = plugin.actions.listActions({ cfg });
|
||||
for (const action of channelActions) {
|
||||
actions.add(action);
|
||||
@@ -37,7 +37,7 @@ export function listAllChannelSupportedActions(params: {
|
||||
return Array.from(actions);
|
||||
}
|
||||
|
||||
export function listChannelAgentTools(params: { cfg?: ClawdbotConfig }): ChannelAgentTool[] {
|
||||
export function listChannelAgentTools(params: { cfg?: MoltbotConfig }): ChannelAgentTool[] {
|
||||
// Channel docking: aggregate channel-owned tools (login, etc.).
|
||||
const tools: ChannelAgentTool[] = [];
|
||||
for (const plugin of listChannelPlugins()) {
|
||||
@@ -50,7 +50,7 @@ export function listChannelAgentTools(params: { cfg?: ClawdbotConfig }): Channel
|
||||
}
|
||||
|
||||
export function resolveChannelMessageToolHints(params: {
|
||||
cfg?: ClawdbotConfig;
|
||||
cfg?: MoltbotConfig;
|
||||
channel?: string | null;
|
||||
accountId?: string | null;
|
||||
}): string[] {
|
||||
@@ -59,7 +59,7 @@ export function resolveChannelMessageToolHints(params: {
|
||||
const dock = getChannelDock(channelId);
|
||||
const resolve = dock?.agentPrompt?.messageToolHints;
|
||||
if (!resolve) return [];
|
||||
const cfg = params.cfg ?? ({} as ClawdbotConfig);
|
||||
const cfg = params.cfg ?? ({} as MoltbotConfig);
|
||||
return (resolve({ cfg, accountId: params.accountId }) ?? [])
|
||||
.map((entry) => entry.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
Reference in New Issue
Block a user