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

@@ -6,7 +6,7 @@ import {
type ChannelMessageActionContext,
type ChannelMessageActionName,
type ChannelToolSend,
} from "clawdbot/plugin-sdk";
} from "openclaw/plugin-sdk";
import { resolveMatrixAccount } from "./matrix/accounts.js";
import { handleMatrixAction } from "./tool-actions.js";
import type { CoreConfig } from "./types.js";

View File

@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it } from "vitest";
import type { PluginRuntime } from "clawdbot/plugin-sdk";
import type { PluginRuntime } from "openclaw/plugin-sdk";
import type { CoreConfig } from "./types.js";
import { matrixPlugin } from "./channel.js";

View File

@@ -8,7 +8,7 @@ import {
PAIRING_APPROVED_MESSAGE,
setAccountEnabledInConfigSection,
type ChannelPlugin,
} from "clawdbot/plugin-sdk";
} from "openclaw/plugin-sdk";
import { matrixMessageActions } from "./actions.js";
import { MatrixConfigSchema } from "./config-schema.js";

View File

@@ -1,4 +1,4 @@
import { MarkdownConfigSchema, ToolPolicySchema } from "clawdbot/plugin-sdk";
import { MarkdownConfigSchema, ToolPolicySchema } from "openclaw/plugin-sdk";
import { z } from "zod";
const allowFromEntry = z.union([z.string(), z.number()]);

View File

@@ -1,4 +1,4 @@
import type { ChannelDirectoryEntry } from "clawdbot/plugin-sdk";
import type { ChannelDirectoryEntry } from "openclaw/plugin-sdk";
import { resolveMatrixAuth } from "./matrix/client.js";

View File

@@ -1,4 +1,4 @@
import type { ChannelGroupContext, GroupToolPolicyConfig } from "clawdbot/plugin-sdk";
import type { ChannelGroupContext, GroupToolPolicyConfig } from "openclaw/plugin-sdk";
import { resolveMatrixRoomConfig } from "./matrix/monitor/rooms.js";
import type { CoreConfig } from "./types.js";

View File

@@ -1,4 +1,4 @@
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "clawdbot/plugin-sdk";
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk";
import type { CoreConfig, MatrixConfig } from "../types.js";
import { resolveMatrixConfig } from "./client.js";
import { credentialsMatchConfig, loadMatrixCredentials } from "./credentials.js";

View File

@@ -22,7 +22,7 @@ export async function resolveActionClient(
if (opts.client) return { client: opts.client, stopOnDone: false };
const active = getActiveMatrixClient();
if (active) return { client: active, stopOnDone: false };
const shouldShareClient = Boolean(process.env.CLAWDBOT_GATEWAY_PORT);
const shouldShareClient = Boolean(process.env.OPENCLAW_GATEWAY_PORT);
if (shouldShareClient) {
const client = await resolveSharedMatrixClient({
cfg: getMatrixRuntime().config.loadConfig() as CoreConfig,

View File

@@ -125,7 +125,7 @@ export async function resolveMatrixAuth(params?: {
type: "m.login.password",
identifier: { type: "m.id.user", user: resolved.userId },
password: resolved.password,
initial_device_display_name: resolved.deviceName ?? "Moltbot Gateway",
initial_device_display_name: resolved.deviceName ?? "OpenClaw Gateway",
}),
});

View File

@@ -3,7 +3,7 @@ import path from "node:path";
import { createRequire } from "node:module";
import { fileURLToPath } from "node:url";
import type { RuntimeEnv } from "clawdbot/plugin-sdk";
import type { RuntimeEnv } from "openclaw/plugin-sdk";
import { getMatrixRuntime } from "../runtime.js";
const MATRIX_SDK_PACKAGE = "@vector-im/matrix-bot-sdk";

View File

@@ -1,4 +1,4 @@
import type { AllowlistMatch } from "clawdbot/plugin-sdk";
import type { AllowlistMatch } from "openclaw/plugin-sdk";
function normalizeAllowList(list?: Array<string | number>) {
return (list ?? []).map((entry) => String(entry).trim()).filter(Boolean);

View File

@@ -1,7 +1,7 @@
import type { MatrixClient } from "@vector-im/matrix-bot-sdk";
import { AutojoinRoomsMixin } from "@vector-im/matrix-bot-sdk";
import type { RuntimeEnv } from "clawdbot/plugin-sdk";
import type { RuntimeEnv } from "openclaw/plugin-sdk";
import type { CoreConfig } from "../../types.js";
import { getMatrixRuntime } from "../../runtime.js";

View File

@@ -1,5 +1,5 @@
import type { MatrixClient } from "@vector-im/matrix-bot-sdk";
import type { PluginRuntime } from "clawdbot/plugin-sdk";
import type { PluginRuntime } from "openclaw/plugin-sdk";
import type { MatrixAuth } from "../client.js";
import type { MatrixRawEvent } from "./types.js";

View File

@@ -8,7 +8,7 @@ import {
logTypingFailure,
resolveControlCommandGate,
type RuntimeEnv,
} from "clawdbot/plugin-sdk";
} from "openclaw/plugin-sdk";
import type { CoreConfig, ReplyToMode } from "../../types.js";
import {
formatPollAsText,
@@ -37,7 +37,7 @@ export type MatrixMonitorHandlerParams = {
logging: {
shouldLogVerbose: () => boolean;
};
channel: typeof import("clawdbot/plugin-sdk")["channel"];
channel: typeof import("openclaw/plugin-sdk")["channel"];
system: {
enqueueSystemEvent: (
text: string,
@@ -59,7 +59,7 @@ export type MatrixMonitorHandlerParams = {
: Record<string, unknown> | undefined
: Record<string, unknown> | undefined;
mentionRegexes: ReturnType<
typeof import("clawdbot/plugin-sdk")["channel"]["mentions"]["buildMentionRegexes"]
typeof import("openclaw/plugin-sdk")["channel"]["mentions"]["buildMentionRegexes"]
>;
groupPolicy: "open" | "allowlist" | "disabled";
replyToMode: ReplyToMode;
@@ -252,12 +252,12 @@ export function createMatrixRoomMessageHandler(params: MatrixMonitorHandlerParam
await sendMessageMatrix(
`room:${roomId}`,
[
"Moltbot: access not configured.",
"OpenClaw: access not configured.",
"",
`Pairing code: ${code}`,
"",
"Ask the bot owner to approve with:",
"moltbot pairing approve matrix <code>",
"openclaw pairing approve matrix <code>",
].join("\n"),
{ client },
);

View File

@@ -4,7 +4,7 @@ import {
mergeAllowlist,
summarizeMapping,
type RuntimeEnv,
} from "clawdbot/plugin-sdk";
} from "openclaw/plugin-sdk";
import type { CoreConfig, ReplyToMode } from "../../types.js";
import { setActiveMatrixClient } from "../active-client.js";
import {

View File

@@ -4,7 +4,7 @@ import {
formatLocationText,
toLocationContext,
type NormalizedLocation,
} from "clawdbot/plugin-sdk";
} from "openclaw/plugin-sdk";
import { EventType } from "./types.js";
export type MatrixLocationPayload = {

View File

@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { PluginRuntime } from "clawdbot/plugin-sdk";
import type { PluginRuntime } from "openclaw/plugin-sdk";
import { setMatrixRuntime } from "../../runtime.js";
import { downloadMatrixMedia } from "./media.js";

View File

@@ -1,6 +1,6 @@
import type { MatrixClient } from "@vector-im/matrix-bot-sdk";
import type { MarkdownTableMode, ReplyPayload, RuntimeEnv } from "clawdbot/plugin-sdk";
import type { MarkdownTableMode, ReplyPayload, RuntimeEnv } from "openclaw/plugin-sdk";
import { sendMessageMatrix } from "../send.js";
import { getMatrixRuntime } from "../../runtime.js";

View File

@@ -1,5 +1,5 @@
import type { MatrixRoomConfig } from "../../types.js";
import { buildChannelKeyCandidates, resolveChannelEntryMatch } from "clawdbot/plugin-sdk";
import { buildChannelKeyCandidates, resolveChannelEntryMatch } from "openclaw/plugin-sdk";
export type MatrixRoomConfigResolved = {
allowed: boolean;

View File

@@ -7,7 +7,7 @@
* - m.poll.end - Closes a poll
*/
import type { PollInput } from "clawdbot/plugin-sdk";
import type { PollInput } from "openclaw/plugin-sdk";
export const M_POLL_START = "m.poll.start" as const;
export const M_POLL_RESPONSE = "m.poll.response" as const;

View File

@@ -1,6 +1,6 @@
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import type { PluginRuntime } from "clawdbot/plugin-sdk";
import type { PluginRuntime } from "openclaw/plugin-sdk";
import { setMatrixRuntime } from "../runtime.js";
vi.mock("@vector-im/matrix-bot-sdk", () => ({

View File

@@ -1,6 +1,6 @@
import type { MatrixClient } from "@vector-im/matrix-bot-sdk";
import type { PollInput } from "clawdbot/plugin-sdk";
import type { PollInput } from "openclaw/plugin-sdk";
import { getMatrixRuntime } from "../runtime.js";
import { buildPollStartContent, M_POLL_START } from "./poll-types.js";
import { resolveMatrixClient, resolveMediaMaxBytes } from "./send/client.js";

View File

@@ -34,7 +34,7 @@ export async function resolveMatrixClient(opts: {
if (opts.client) return { client: opts.client, stopOnDone: false };
const active = getActiveMatrixClient();
if (active) return { client: active, stopOnDone: false };
const shouldShareClient = Boolean(process.env.CLAWDBOT_GATEWAY_PORT);
const shouldShareClient = Boolean(process.env.OPENCLAW_GATEWAY_PORT);
if (shouldShareClient) {
const client = await resolveSharedMatrixClient({
timeoutMs: opts.timeoutMs,

View File

@@ -5,7 +5,7 @@ import {
type ChannelOnboardingAdapter,
type ChannelOnboardingDmPolicy,
type WizardPrompter,
} from "clawdbot/plugin-sdk";
} from "openclaw/plugin-sdk";
import { listMatrixDirectoryGroupsLive } from "./directory-live.js";
import { listMatrixDirectoryPeersLive } from "./directory-live.js";
import { resolveMatrixAccount } from "./matrix/accounts.js";
@@ -318,7 +318,7 @@ export const matrixOnboardingAdapter: ChannelOnboardingAdapter = {
const deviceName = String(
await prompter.text({
message: "Matrix device name (optional)",
initialValue: existing.deviceName ?? "Moltbot Gateway",
initialValue: existing.deviceName ?? "OpenClaw Gateway",
}),
).trim();

View File

@@ -1,4 +1,4 @@
import type { ChannelOutboundAdapter } from "clawdbot/plugin-sdk";
import type { ChannelOutboundAdapter } from "openclaw/plugin-sdk";
import { getMatrixRuntime } from "./runtime.js";
import { sendMessageMatrix, sendPollMatrix } from "./matrix/send.js";

View File

@@ -3,7 +3,7 @@ import type {
ChannelResolveKind,
ChannelResolveResult,
RuntimeEnv,
} from "clawdbot/plugin-sdk";
} from "openclaw/plugin-sdk";
import {
listMatrixDirectoryGroupsLive,

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;

View File

@@ -21,7 +21,7 @@ import {
readNumberParam,
readReactionParams,
readStringParam,
} from "clawdbot/plugin-sdk";
} from "openclaw/plugin-sdk";
const messageActions = new Set(["sendMessage", "editMessage", "deleteMessage", "readMessages"]);
const reactionActions = new Set(["react", "reactions"]);