openclaw-channel-dmwork 0.4.3 → 0.4.4
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/README.md +3 -3
- package/index.ts +9 -0
- package/package.json +2 -1
- package/src/actions.test.ts +760 -0
- package/src/actions.ts +438 -0
- package/src/agent-tools.test.ts +404 -0
- package/src/agent-tools.ts +269 -0
- package/src/api-fetch.test.ts +422 -0
- package/src/api-fetch.ts +257 -3
- package/src/channel.ts +198 -44
- package/src/group-md.test.ts +383 -0
- package/src/group-md.ts +393 -0
- package/src/inbound.test.ts +42 -1
- package/src/inbound.ts +154 -47
- package/src/types.ts +5 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# openclaw-channel-dmwork
|
|
2
2
|
|
|
3
|
-
DMWork channel plugin for OpenClaw. Connects via
|
|
3
|
+
DMWork channel plugin for OpenClaw. Connects via DMWORK WebSocket for real-time messaging.
|
|
4
4
|
|
|
5
5
|
Repository: https://github.com/yujiawei/dmwork-adapters
|
|
6
6
|
|
|
@@ -34,7 +34,7 @@ Configuration fields:
|
|
|
34
34
|
|
|
35
35
|
- `botToken` (required): Bot token from BotFather (`bf_` prefix)
|
|
36
36
|
- `apiUrl` (required): DMWork server API URL, e.g. `http://192.168.1.100:8090`
|
|
37
|
-
- `wsUrl` (optional):
|
|
37
|
+
- `wsUrl` (optional): DMWORK WebSocket URL. Auto-detected from register if omitted.
|
|
38
38
|
|
|
39
39
|
## Run
|
|
40
40
|
|
|
@@ -47,7 +47,7 @@ The plugin is loaded automatically by OpenClaw when the gateway starts.
|
|
|
47
47
|
## What it does
|
|
48
48
|
|
|
49
49
|
1. Registers the bot with the DMWork server via REST API
|
|
50
|
-
2. Connects to
|
|
50
|
+
2. Connects to DMWORK WebSocket for real-time message receiving
|
|
51
51
|
3. Auto-reconnects on disconnection
|
|
52
52
|
4. Sends a greeting to the bot owner on connect
|
|
53
53
|
5. Dispatches incoming messages to OpenClaw's message handler
|
package/index.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
9
9
|
import { dmworkPlugin } from "./src/channel.js";
|
|
10
10
|
import { setDmworkRuntime } from "./src/runtime.js";
|
|
11
|
+
import { getGroupMdForPrompt } from "./src/group-md.js";
|
|
11
12
|
|
|
12
13
|
const plugin: {
|
|
13
14
|
id: string;
|
|
@@ -21,6 +22,14 @@ const plugin: {
|
|
|
21
22
|
register(api) {
|
|
22
23
|
setDmworkRuntime(api.runtime);
|
|
23
24
|
api.registerChannel({ plugin: dmworkPlugin });
|
|
25
|
+
|
|
26
|
+
console.log('[dmwork] registering before_prompt_build hook');
|
|
27
|
+
api.on('before_prompt_build', (_event, ctx) => {
|
|
28
|
+
const content = getGroupMdForPrompt(ctx);
|
|
29
|
+
if (!content) return;
|
|
30
|
+
const result = { prependContext: `[GROUP CONTEXT]\n${content}\n[/GROUP CONTEXT]` };
|
|
31
|
+
return result;
|
|
32
|
+
});
|
|
24
33
|
},
|
|
25
34
|
};
|
|
26
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-channel-dmwork",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "DMWork channel plugin for OpenClaw via WuKongIM WebSocket",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"axios": "^1.7.0",
|
|
20
|
+
"cos-nodejs-sdk-v5": "^2.15.4",
|
|
20
21
|
"crypto-js": "^4.2.0",
|
|
21
22
|
"curve25519-js": "^0.0.4",
|
|
22
23
|
"md5-typescript": "^1.0.5",
|