openclaw-channel-dmwork 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "id": "dmwork",
3
- "channels": ["dmwork"],
3
+ "channels": [
4
+ "dmwork"
5
+ ],
4
6
  "configSchema": {
5
7
  "type": "object",
6
8
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-channel-dmwork",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "DMWork channel plugin for OpenClaw via WuKongIM WebSocket",
5
5
  "main": "index.ts",
6
6
  "type": "module",
@@ -19,8 +19,7 @@
19
19
  "wukongimjssdk": "^1.3.4"
20
20
  },
21
21
  "peerDependencies": {
22
- "openclaw": ">=2026.2.0",
23
- "zod": ">=3.0.0"
22
+ "openclaw": ">=2026.2.0"
24
23
  },
25
24
  "devDependencies": {
26
25
  "@types/ws": "^8.5.10",
package/src/channel.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import {
2
- buildChannelConfigSchema,
3
2
  DEFAULT_ACCOUNT_ID,
4
3
  type ChannelOutboundContext,
5
4
  type ChannelPlugin,
6
5
  } from "openclaw/plugin-sdk";
7
6
  import type { OpenClawConfig } from "openclaw/plugin-sdk";
8
- import { DmworkConfigSchema } from "./config-schema.js";
7
+ import { DmworkConfigJsonSchema } from "./config-schema.js";
9
8
  import {
10
9
  listDmworkAccountIds,
11
10
  resolveDefaultDmworkAccountId,
@@ -51,7 +50,7 @@ export const dmworkPlugin: ChannelPlugin<ResolvedDmworkAccount> = {
51
50
  threads: false,
52
51
  },
53
52
  reload: { configPrefixes: ["channels.dmwork"] },
54
- configSchema: buildChannelConfigSchema(DmworkConfigSchema),
53
+ configSchema: DmworkConfigJsonSchema,
55
54
  config: {
56
55
  listAccountIds: (cfg) => listDmworkAccountIds(cfg),
57
56
  resolveAccount: (cfg, accountId) => resolveDmworkAccount({ cfg, accountId }),
@@ -1,28 +1,57 @@
1
- import { z } from "zod";
1
+ // Plain config types no external dependencies
2
2
 
3
- const DmworkAccountSchema = z.strictObject({
4
- name: z.string().optional(),
5
- enabled: z.boolean().optional(),
6
- botToken: z.string().optional(),
7
- apiUrl: z.string().optional(),
8
- wsUrl: z.string().optional(),
9
- pollIntervalMs: z.number().int().min(500).optional(),
10
- heartbeatIntervalMs: z.number().int().min(5000).optional(),
11
- requireMention: z.boolean().optional(),
12
- botUid: z.string().optional(),
13
- });
3
+ export interface DmworkAccountConfig {
4
+ name?: string;
5
+ enabled?: boolean;
6
+ botToken?: string;
7
+ apiUrl?: string;
8
+ wsUrl?: string;
9
+ pollIntervalMs?: number;
10
+ heartbeatIntervalMs?: number;
11
+ requireMention?: boolean;
12
+ botUid?: string;
13
+ }
14
14
 
15
- export const DmworkConfigSchema = z.strictObject({
16
- name: z.string().optional(),
17
- enabled: z.boolean().optional(),
18
- botToken: z.string().optional(),
19
- apiUrl: z.string().optional(),
20
- wsUrl: z.string().optional(),
21
- pollIntervalMs: z.number().int().min(500).optional(),
22
- heartbeatIntervalMs: z.number().int().min(5000).optional(),
23
- requireMention: z.boolean().optional(),
24
- botUid: z.string().optional(),
25
- accounts: z.record(z.string(), DmworkAccountSchema.optional()).optional(),
26
- });
15
+ export interface DmworkConfig {
16
+ name?: string;
17
+ enabled?: boolean;
18
+ botToken?: string;
19
+ apiUrl?: string;
20
+ wsUrl?: string;
21
+ pollIntervalMs?: number;
22
+ heartbeatIntervalMs?: number;
23
+ requireMention?: boolean;
24
+ botUid?: string;
25
+ accounts?: Record<string, DmworkAccountConfig | undefined>;
26
+ }
27
27
 
28
- export type DmworkConfig = z.infer<typeof DmworkConfigSchema>;
28
+ // JSON Schema for OpenClaw plugin config validation
29
+ export const DmworkConfigJsonSchema = {
30
+ type: "object" as const,
31
+ properties: {
32
+ name: { type: "string" },
33
+ enabled: { type: "boolean" },
34
+ botToken: { type: "string" },
35
+ apiUrl: { type: "string" },
36
+ wsUrl: { type: "string" },
37
+ pollIntervalMs: { type: "number", minimum: 500 },
38
+ heartbeatIntervalMs: { type: "number", minimum: 5000 },
39
+ requireMention: { type: "boolean" },
40
+ botUid: { type: "string" },
41
+ accounts: {
42
+ type: "object",
43
+ additionalProperties: {
44
+ type: "object",
45
+ properties: {
46
+ name: { type: "string" },
47
+ enabled: { type: "boolean" },
48
+ botToken: { type: "string" },
49
+ apiUrl: { type: "string" },
50
+ wsUrl: { type: "string" },
51
+ requireMention: { type: "boolean" },
52
+ botUid: { type: "string" },
53
+ },
54
+ },
55
+ },
56
+ },
57
+ };
package/src/inbound.ts CHANGED
@@ -165,6 +165,13 @@ export async function handleInboundMessage(params: {
165
165
  }
166
166
 
167
167
  const core = getDmworkRuntime();
168
+ if (!core?.channel?.reply?.dispatchReplyWithBufferedBlockDispatcher) {
169
+ log?.error?.(`dmwork: OpenClaw runtime missing required functions. Available: config=${!!core?.config}, channel=${!!core?.channel}, reply=${!!core?.channel?.reply}, routing=${!!core?.channel?.routing}, session=${!!core?.channel?.session}`);
170
+ log?.error?.(`dmwork: reply methods: ${core?.channel?.reply ? Object.keys(core.channel.reply).join(",") : "N/A"}`);
171
+ log?.error?.(`dmwork: session methods: ${core?.channel?.session ? Object.keys(core.channel.session).join(",") : "N/A"}`);
172
+ log?.error?.(`dmwork: routing methods: ${core?.channel?.routing ? Object.keys(core.channel.routing).join(",") : "N/A"}`);
173
+ return;
174
+ }
168
175
  const config = core.config.loadConfig() as OpenClawConfig;
169
176
 
170
177
  const route = core.channel.routing.resolveAgentRoute({