refactor: rename to openclaw

This commit is contained in:
Peter Steinberger
2026-01-30 03:15:10 +01:00
parent 4583f88626
commit 9a7160786a
2357 changed files with 16688 additions and 16788 deletions

View File

@@ -1,5 +1,5 @@
import type { MoltbotPluginApi } from "clawdbot/plugin-sdk";
import { emptyPluginConfigSchema } from "clawdbot/plugin-sdk";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
import { linePlugin } from "./src/channel.js";
import { registerLineCardCommand } from "./src/card-command.js";
@@ -10,7 +10,7 @@ const plugin = {
name: "LINE",
description: "LINE Messaging API channel plugin",
configSchema: emptyPluginConfigSchema(),
register(api: MoltbotPluginApi) {
register(api: OpenClawPluginApi) {
setLineRuntime(api.runtime);
api.registerChannel({ plugin: linePlugin });
registerLineCardCommand(api);

View File

@@ -1,9 +1,9 @@
{
"name": "@moltbot/line",
"version": "2026.1.29",
"name": "@openclaw/line",
"version": "2026.1.27-beta.1",
"type": "module",
"description": "Moltbot LINE channel plugin",
"moltbot": {
"description": "OpenClaw LINE channel plugin",
"openclaw": {
"extensions": [
"./index.ts"
],
@@ -18,12 +18,12 @@
"quickstartAllowFrom": true
},
"install": {
"npmSpec": "@moltbot/line",
"npmSpec": "@openclaw/line",
"localPath": "extensions/line",
"defaultChoice": "npm"
}
},
"devDependencies": {
"moltbot": "workspace:*"
"openclaw": "workspace:*"
}
}

View File

@@ -1,4 +1,4 @@
import type { MoltbotPluginApi, LineChannelData, ReplyPayload } from "clawdbot/plugin-sdk";
import type { LineChannelData, OpenClawPluginApi, ReplyPayload } from "openclaw/plugin-sdk";
import {
createActionCard,
createImageCard,
@@ -7,7 +7,7 @@ import {
createReceiptCard,
type CardAction,
type ListItem,
} from "clawdbot/plugin-sdk";
} from "openclaw/plugin-sdk";
const CARD_USAGE = `Usage: /card <type> "title" "body" [options]
@@ -150,7 +150,7 @@ function parseCardArgs(argsStr: string): {
return result;
}
export function registerLineCardCommand(api: MoltbotPluginApi): void {
export function registerLineCardCommand(api: OpenClawPluginApi): void {
api.registerCommand({
name: "card",
description: "Send a rich card message (LINE).",

View File

@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { MoltbotConfig, PluginRuntime } from "clawdbot/plugin-sdk";
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk";
import { linePlugin } from "./channel.js";
import { setLineRuntime } from "./runtime.js";
@@ -12,7 +12,7 @@ type LineRuntimeMocks = {
function createRuntime(): { runtime: PluginRuntime; mocks: LineRuntimeMocks } {
const writeConfigFile = vi.fn(async () => {});
const resolveLineAccount = vi.fn(({ cfg, accountId }: { cfg: MoltbotConfig; accountId?: string }) => {
const resolveLineAccount = vi.fn(({ cfg, accountId }: { cfg: OpenClawConfig; accountId?: string }) => {
const lineConfig = (cfg.channels?.line ?? {}) as {
tokenFile?: string;
secretFile?: string;
@@ -48,7 +48,7 @@ describe("linePlugin gateway.logoutAccount", () => {
const { runtime, mocks } = createRuntime();
setLineRuntime(runtime);
const cfg: MoltbotConfig = {
const cfg: OpenClawConfig = {
channels: {
line: {
tokenFile: "/tmp/token",
@@ -71,7 +71,7 @@ describe("linePlugin gateway.logoutAccount", () => {
const { runtime, mocks } = createRuntime();
setLineRuntime(runtime);
const cfg: MoltbotConfig = {
const cfg: OpenClawConfig = {
channels: {
line: {
accounts: {

View File

@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from "vitest";
import type { MoltbotConfig, PluginRuntime } from "clawdbot/plugin-sdk";
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk";
import { linePlugin } from "./channel.js";
import { setLineRuntime } from "./runtime.js";
@@ -33,7 +33,7 @@ function createRuntime(): { runtime: PluginRuntime; mocks: LineRuntimeMocks } {
const sendMessageLine = vi.fn(async () => ({ messageId: "m-media", chatId: "c1" }));
const chunkMarkdownText = vi.fn((text: string) => [text]);
const resolveTextChunkLimit = vi.fn(() => 123);
const resolveLineAccount = vi.fn(({ cfg, accountId }: { cfg: MoltbotConfig; accountId?: string }) => {
const resolveLineAccount = vi.fn(({ cfg, accountId }: { cfg: OpenClawConfig; accountId?: string }) => {
const resolved = accountId ?? "default";
const lineConfig = (cfg.channels?.line ?? {}) as {
accounts?: Record<string, Record<string, unknown>>;
@@ -90,7 +90,7 @@ describe("linePlugin outbound.sendPayload", () => {
it("sends flex message without dropping text", async () => {
const { runtime, mocks } = createRuntime();
setLineRuntime(runtime);
const cfg = { channels: { line: {} } } as MoltbotConfig;
const cfg = { channels: { line: {} } } as OpenClawConfig;
const payload = {
text: "Now playing:",
@@ -121,7 +121,7 @@ describe("linePlugin outbound.sendPayload", () => {
it("sends template message without dropping text", async () => {
const { runtime, mocks } = createRuntime();
setLineRuntime(runtime);
const cfg = { channels: { line: {} } } as MoltbotConfig;
const cfg = { channels: { line: {} } } as OpenClawConfig;
const payload = {
text: "Choose one:",
@@ -157,7 +157,7 @@ describe("linePlugin outbound.sendPayload", () => {
it("attaches quick replies when no text chunks are present", async () => {
const { runtime, mocks } = createRuntime();
setLineRuntime(runtime);
const cfg = { channels: { line: {} } } as MoltbotConfig;
const cfg = { channels: { line: {} } } as OpenClawConfig;
const payload = {
channelData: {
@@ -197,7 +197,7 @@ describe("linePlugin outbound.sendPayload", () => {
it("sends media before quick-reply text so buttons stay visible", async () => {
const { runtime, mocks } = createRuntime();
setLineRuntime(runtime);
const cfg = { channels: { line: {} } } as MoltbotConfig;
const cfg = { channels: { line: {} } } as OpenClawConfig;
const payload = {
text: "Hello",
@@ -235,7 +235,7 @@ describe("linePlugin outbound.sendPayload", () => {
it("uses configured text chunk limit for payloads", async () => {
const { runtime, mocks } = createRuntime();
setLineRuntime(runtime);
const cfg = { channels: { line: { textChunkLimit: 123 } } } as MoltbotConfig;
const cfg = { channels: { line: { textChunkLimit: 123 } } } as OpenClawConfig;
const payload = {
text: "Hello world",
@@ -295,7 +295,7 @@ describe("linePlugin groups.resolveRequireMention", () => {
},
},
},
} as MoltbotConfig;
} as OpenClawConfig;
const requireMention = linePlugin.groups.resolveRequireMention({
cfg,

View File

@@ -4,11 +4,11 @@ import {
LineConfigSchema,
processLineMessage,
type ChannelPlugin,
type MoltbotConfig,
type OpenClawConfig,
type LineConfig,
type LineChannelData,
type ResolvedLineAccount,
} from "clawdbot/plugin-sdk";
} from "openclaw/plugin-sdk";
import { getLineRuntime } from "./runtime.js";
@@ -53,7 +53,7 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
if (!account.channelAccessToken) {
throw new Error("LINE channel access token not configured");
}
await line.pushMessageLine(id, "Moltbot: your access has been approved.", {
await line.pushMessageLine(id, "OpenClaw: your access has been approved.", {
channelAccessToken: account.channelAccessToken,
});
},
@@ -164,7 +164,7 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
allowFrom: account.config.allowFrom ?? [],
policyPath: `${basePath}dmPolicy`,
allowFromPath: basePath,
approveHint: "moltbot pairing approve line <code>",
approveHint: "openclaw pairing approve line <code>",
normalizeEntry: (raw) => raw.replace(/^line:(?:user:)?/i, ""),
};
},
@@ -639,7 +639,7 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
},
logoutAccount: async ({ accountId, cfg }) => {
const envToken = process.env.LINE_CHANNEL_ACCESS_TOKEN?.trim() ?? "";
const nextCfg = { ...cfg } as MoltbotConfig;
const nextCfg = { ...cfg } as OpenClawConfig;
const lineConfig = (cfg.channels?.line ?? {}) as LineConfig;
const nextLine = { ...lineConfig };
let cleared = false;

View File

@@ -1,4 +1,4 @@
import type { PluginRuntime } from "clawdbot/plugin-sdk";
import type { PluginRuntime } from "openclaw/plugin-sdk";
let runtime: PluginRuntime | null = null;