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.
- package/openclaw.plugin.json +3 -1
- package/package.json +2 -3
- package/src/channel.ts +2 -3
- package/src/config-schema.ts +54 -25
- package/src/inbound.ts +7 -0
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-channel-dmwork",
|
|
3
|
-
"version": "0.2.
|
|
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 {
|
|
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:
|
|
53
|
+
configSchema: DmworkConfigJsonSchema,
|
|
55
54
|
config: {
|
|
56
55
|
listAccountIds: (cfg) => listDmworkAccountIds(cfg),
|
|
57
56
|
resolveAccount: (cfg, accountId) => resolveDmworkAccount({ cfg, accountId }),
|
package/src/config-schema.ts
CHANGED
|
@@ -1,28 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
// Plain config types — no external dependencies
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
name
|
|
5
|
-
enabled
|
|
6
|
-
botToken
|
|
7
|
-
apiUrl
|
|
8
|
-
wsUrl
|
|
9
|
-
pollIntervalMs
|
|
10
|
-
heartbeatIntervalMs
|
|
11
|
-
requireMention
|
|
12
|
-
botUid
|
|
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
|
|
16
|
-
name
|
|
17
|
-
enabled
|
|
18
|
-
botToken
|
|
19
|
-
apiUrl
|
|
20
|
-
wsUrl
|
|
21
|
-
pollIntervalMs
|
|
22
|
-
heartbeatIntervalMs
|
|
23
|
-
requireMention
|
|
24
|
-
botUid
|
|
25
|
-
accounts
|
|
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
|
-
|
|
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({
|