mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-30 20:41:46 +00:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { ClawdbotConfig } from "../../config/config.js";
|
||||
import type { MoltbotConfig } from "../../config/config.js";
|
||||
import type { MsgContext } from "../templating.js";
|
||||
import type { GetReplyOptions, ReplyPayload } from "../types.js";
|
||||
import type { ReplyDispatcher } from "./reply-dispatcher.js";
|
||||
@@ -84,7 +84,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
aborted: false,
|
||||
});
|
||||
mocks.routeReply.mockClear();
|
||||
const cfg = {} as ClawdbotConfig;
|
||||
const cfg = {} as MoltbotConfig;
|
||||
const dispatcher = createDispatcher();
|
||||
const ctx = buildTestCtx({
|
||||
Provider: "slack",
|
||||
@@ -96,7 +96,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
const replyResolver = async (
|
||||
_ctx: MsgContext,
|
||||
_opts: GetReplyOptions | undefined,
|
||||
_cfg: ClawdbotConfig,
|
||||
_cfg: MoltbotConfig,
|
||||
) => ({ text: "hi" }) satisfies ReplyPayload;
|
||||
await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });
|
||||
|
||||
@@ -110,7 +110,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
aborted: false,
|
||||
});
|
||||
mocks.routeReply.mockClear();
|
||||
const cfg = {} as ClawdbotConfig;
|
||||
const cfg = {} as MoltbotConfig;
|
||||
const dispatcher = createDispatcher();
|
||||
const ctx = buildTestCtx({
|
||||
Provider: "slack",
|
||||
@@ -123,7 +123,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
const replyResolver = async (
|
||||
_ctx: MsgContext,
|
||||
_opts: GetReplyOptions | undefined,
|
||||
_cfg: ClawdbotConfig,
|
||||
_cfg: MoltbotConfig,
|
||||
) => ({ text: "hi" }) satisfies ReplyPayload;
|
||||
await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });
|
||||
|
||||
@@ -144,7 +144,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
aborted: false,
|
||||
});
|
||||
mocks.routeReply.mockClear();
|
||||
const cfg = {} as ClawdbotConfig;
|
||||
const cfg = {} as MoltbotConfig;
|
||||
const dispatcher = createDispatcher();
|
||||
const ctx = buildTestCtx({
|
||||
Provider: "slack",
|
||||
@@ -155,7 +155,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
const replyResolver = async (
|
||||
_ctx: MsgContext,
|
||||
opts: GetReplyOptions | undefined,
|
||||
_cfg: ClawdbotConfig,
|
||||
_cfg: MoltbotConfig,
|
||||
) => {
|
||||
expect(opts?.onToolResult).toBeUndefined();
|
||||
return { text: "hi" } satisfies ReplyPayload;
|
||||
@@ -175,7 +175,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
handled: true,
|
||||
aborted: true,
|
||||
});
|
||||
const cfg = {} as ClawdbotConfig;
|
||||
const cfg = {} as MoltbotConfig;
|
||||
const dispatcher = createDispatcher();
|
||||
const ctx = buildTestCtx({
|
||||
Provider: "telegram",
|
||||
@@ -197,7 +197,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
aborted: true,
|
||||
stoppedSubagents: 2,
|
||||
});
|
||||
const cfg = {} as ClawdbotConfig;
|
||||
const cfg = {} as MoltbotConfig;
|
||||
const dispatcher = createDispatcher();
|
||||
const ctx = buildTestCtx({
|
||||
Provider: "telegram",
|
||||
@@ -221,7 +221,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
handled: false,
|
||||
aborted: false,
|
||||
});
|
||||
const cfg = {} as ClawdbotConfig;
|
||||
const cfg = {} as MoltbotConfig;
|
||||
const ctx = buildTestCtx({
|
||||
Provider: "whatsapp",
|
||||
OriginatingChannel: "whatsapp",
|
||||
@@ -252,7 +252,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
aborted: false,
|
||||
});
|
||||
hookMocks.runner.hasHooks.mockReturnValue(true);
|
||||
const cfg = {} as ClawdbotConfig;
|
||||
const cfg = {} as MoltbotConfig;
|
||||
const dispatcher = createDispatcher();
|
||||
const ctx = buildTestCtx({
|
||||
Provider: "slack",
|
||||
@@ -302,7 +302,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
handled: false,
|
||||
aborted: false,
|
||||
});
|
||||
const cfg = { diagnostics: { enabled: true } } as ClawdbotConfig;
|
||||
const cfg = { diagnostics: { enabled: true } } as MoltbotConfig;
|
||||
const dispatcher = createDispatcher();
|
||||
const ctx = buildTestCtx({
|
||||
Provider: "slack",
|
||||
@@ -335,7 +335,7 @@ describe("dispatchReplyFromConfig", () => {
|
||||
handled: false,
|
||||
aborted: false,
|
||||
});
|
||||
const cfg = { diagnostics: { enabled: true } } as ClawdbotConfig;
|
||||
const cfg = { diagnostics: { enabled: true } } as MoltbotConfig;
|
||||
const ctx = buildTestCtx({
|
||||
Provider: "whatsapp",
|
||||
OriginatingChannel: "whatsapp",
|
||||
|
||||
Reference in New Issue
Block a user