openclaw-channel-dmwork 0.5.19-dev.891496ab → 0.5.19

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 CHANGED
@@ -7,89 +7,42 @@ Repository: https://github.com/yujiawei/dmwork-adapters
7
7
  ## Prerequisites
8
8
 
9
9
  - Node.js >= 18
10
- - OpenClaw installed and configured (`npm i -g openclaw`)
10
+ - OpenClaw installed and configured
11
11
  - A bot created via BotFather in DMWork (send `/newbot` to BotFather)
12
12
 
13
- ## Install
14
-
15
- One-command install via npx (BotFather will provide the exact command):
16
-
17
- ```bash
18
- npx -y openclaw-channel-dmwork install \
19
- --bot-token bf_your_token_here \
20
- --api-url http://your-server:8090 \
21
- --account-id my_bot
22
- ```
23
-
24
- This will:
25
- 1. Install the plugin via `openclaw plugins install`
26
- 2. Configure the bot account in `channels.dmwork.accounts.<account-id>`
27
- 3. Restart the OpenClaw gateway
28
-
29
- ### Interactive install
30
-
31
- Run without arguments to be prompted for each value:
13
+ ## Install as OpenClaw Extension
32
14
 
33
15
  ```bash
34
- npx -y openclaw-channel-dmwork install
16
+ git clone https://github.com/yujiawei/dmwork-adapters.git
17
+ cp -r dmwork-adapters/openclaw-channel-dmwork ~/.openclaw/extensions/dmwork
18
+ cd ~/.openclaw/extensions/dmwork && npm install
35
19
  ```
36
20
 
37
- ## CLI Commands
38
-
39
- ```bash
40
- # Update the plugin to the latest version
41
- npx -y openclaw-channel-dmwork update
42
-
43
- # Diagnose plugin health
44
- npx -y openclaw-channel-dmwork doctor
21
+ ## Configure
45
22
 
46
- # Uninstall (removes plugin and all bot configs)
47
- npx -y openclaw-channel-dmwork uninstall
23
+ Add to your `~/.openclaw/config.yaml`:
48
24
 
49
- # Remove a single bot account
50
- npx -y openclaw-channel-dmwork remove-account --account-id my_bot
25
+ ```yaml
26
+ channels:
27
+ dmwork:
28
+ botToken: "bf_your_token_here" # Bot token from BotFather
29
+ apiUrl: "http://your-server:8090" # DMWork server API URL
30
+ # wsUrl: "ws://your-server:5200" # Optional — auto-detected from register if omitted
51
31
  ```
52
32
 
53
- ### OpenClaw internal commands
33
+ Configuration fields:
54
34
 
55
- After installation, these commands are available inside OpenClaw:
35
+ - `botToken` (required): Bot token from BotFather (`bf_` prefix)
36
+ - `apiUrl` (required): DMWork server API URL, e.g. `http://192.168.1.100:8090`
37
+ - `wsUrl` (optional): DMWORK WebSocket URL. Auto-detected from register if omitted.
56
38
 
57
- ```
58
- /dmwork_doctor # Check plugin status and connectivity
59
- /dmwork_doctor my_bot # Check a specific account
60
- ```
39
+ ## Run
61
40
 
62
- ## Configuration
63
-
64
- Bot accounts are stored in `~/.openclaw/openclaw.json` under `channels.dmwork.accounts`:
65
-
66
- ```json
67
- {
68
- "channels": {
69
- "dmwork": {
70
- "apiUrl": "http://your-server:8090",
71
- "accounts": {
72
- "my_bot": {
73
- "botToken": "bf_your_token_here",
74
- "apiUrl": "http://your-server:8090"
75
- },
76
- "another_bot": {
77
- "botToken": "bf_another_token",
78
- "apiUrl": "https://im.example.com/api"
79
- }
80
- }
81
- }
82
- }
83
- }
41
+ ```bash
42
+ openclaw gateway restart
84
43
  ```
85
44
 
86
- Configuration fields per account:
87
-
88
- - `botToken` (required): Bot token from BotFather (`bf_` prefix)
89
- - `apiUrl` (required): DMWork server API URL
90
- - `wsUrl` (optional): DMWORK WebSocket URL. Auto-detected if omitted.
91
- - `requireMention` (optional): Only respond when @mentioned in groups
92
- - `historyLimit` (optional): Group chat history message limit (default: 20)
45
+ The plugin is loaded automatically by OpenClaw when the gateway starts.
93
46
 
94
47
  ## What it does
95
48
 
@@ -107,7 +60,6 @@ The `index.ts` exports a standard OpenClaw plugin object. When loaded by OpenCla
107
60
  - `register(api)` is called automatically
108
61
  - `api.runtime` is injected for logging and lifecycle management
109
62
  - `api.registerChannel()` registers the DMWork channel plugin
110
- - `api.registerCommand()` registers `/dmwork_doctor`
111
63
  - Configuration is read from `channels.dmwork` in OpenClaw's config
112
64
 
113
65
  The plugin uses the `ChannelPlugin` SDK interface with support for:
package/dist/index.js CHANGED
@@ -4,13 +4,9 @@
4
4
  * OpenClaw channel plugin for DMWork messaging platform.
5
5
  * Connects via WuKongIM WebSocket for real-time messaging.
6
6
  */
7
- import { execFileSync } from "node:child_process";
8
7
  import { dmworkPlugin } from "./src/channel.js";
9
8
  import { setDmworkRuntime } from "./src/runtime.js";
10
9
  import { getGroupMdForPrompt } from "./src/group-md.js";
11
- import { inProcessConfigReader, runDoctorChecks, formatDoctorResult, } from "./cli/doctor.js";
12
- import { getOpenClawVersion, pluginsInspect, configGet, configGetJson, configSet, configUnset, gatewayRestart, pluginsInstall, pluginsUninstall, removeChannelConfigFromFile, } from "./cli/openclaw-cli.js";
13
- import { PLUGIN_ID, RECOMMENDED_DM_SCOPE, validateAccountId } from "./cli/utils.js";
14
10
  const plugin = {
15
11
  id: "openclaw-channel-dmwork",
16
12
  name: "DMWork",
@@ -18,168 +14,6 @@ const plugin = {
18
14
  register(api) {
19
15
  setDmworkRuntime(api.runtime);
20
16
  api.registerChannel({ plugin: dmworkPlugin });
21
- api.registerCommand({
22
- name: "dmwork_doctor",
23
- description: "Check DMWork plugin status and connectivity",
24
- acceptsArgs: true,
25
- async handler(ctx) {
26
- const reader = inProcessConfigReader(ctx.config);
27
- const result = await runDoctorChecks({
28
- reader,
29
- accountId: ctx.args?.trim() || undefined,
30
- inProcess: true,
31
- });
32
- return { text: formatDoctorResult(result) };
33
- },
34
- });
35
- // /dmwork_info
36
- api.registerCommand({
37
- name: "dmwork_info",
38
- description: "Show DMWork plugin version info",
39
- acceptsArgs: false,
40
- async handler() {
41
- const openclawVersion = getOpenClawVersion() ?? "not found";
42
- const inspect = pluginsInspect(PLUGIN_ID);
43
- const installedVersion = inspect?.plugin?.version ?? "not installed";
44
- return {
45
- text: [
46
- `openclaw-channel-dmwork: ${installedVersion}`,
47
- `openclaw: ${openclawVersion}`,
48
- `plugin package: ${PLUGIN_ID}`,
49
- ].join("\n"),
50
- };
51
- },
52
- });
53
- // /dmwork_install
54
- api.registerCommand({
55
- name: "dmwork_install",
56
- description: "Install or reinstall the DMWork plugin",
57
- acceptsArgs: true,
58
- async handler(ctx) {
59
- const args = ctx.args?.trim() ?? "";
60
- // Parse: --force or empty
61
- const force = args.includes("--force");
62
- try {
63
- const inspect = pluginsInspect(PLUGIN_ID);
64
- if (inspect?.plugin && !force) {
65
- return { text: `DMWork plugin already installed (v${inspect.plugin.version}). Use --force to reinstall.` };
66
- }
67
- pluginsInstall(PLUGIN_ID, true, force);
68
- gatewayRestart(true);
69
- const after = pluginsInspect(PLUGIN_ID);
70
- return { text: `DMWork plugin installed (v${after?.plugin?.version ?? "unknown"}). Gateway restarted.` };
71
- }
72
- catch (e) {
73
- return { text: `Install failed: ${e instanceof Error ? e.message : String(e)}`, isError: true };
74
- }
75
- },
76
- });
77
- // /dmwork_update
78
- api.registerCommand({
79
- name: "dmwork_update",
80
- description: "Update DMWork plugin to latest version",
81
- acceptsArgs: false,
82
- async handler() {
83
- try {
84
- const inspect = pluginsInspect(PLUGIN_ID);
85
- if (!inspect?.plugin) {
86
- return { text: "DMWork plugin is not installed. Use /dmwork_install first.", isError: true };
87
- }
88
- const currentVersion = inspect.plugin.version;
89
- const targetVersion = execFileSync("npm", ["view", `${PLUGIN_ID}@latest`, "version"], {
90
- encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"],
91
- }).trim();
92
- if (currentVersion === targetVersion) {
93
- return { text: `Already up to date (v${currentVersion}).` };
94
- }
95
- pluginsInstall(`${PLUGIN_ID}@latest`, true, true);
96
- gatewayRestart(true);
97
- return { text: `Updated: v${currentVersion} -> v${targetVersion}. Gateway restarted.` };
98
- }
99
- catch (e) {
100
- return { text: `Update failed: ${e instanceof Error ? e.message : String(e)}`, isError: true };
101
- }
102
- },
103
- });
104
- // /dmwork_uninstall
105
- api.registerCommand({
106
- name: "dmwork_uninstall",
107
- description: "Uninstall DMWork plugin and remove all bot configs",
108
- acceptsArgs: false,
109
- async handler() {
110
- try {
111
- removeChannelConfigFromFile();
112
- pluginsUninstall(PLUGIN_ID, true);
113
- gatewayRestart(true);
114
- return { text: "DMWork plugin uninstalled. All bot configs removed." };
115
- }
116
- catch (e) {
117
- return { text: `Uninstall failed: ${e instanceof Error ? e.message : String(e)}`, isError: true };
118
- }
119
- },
120
- });
121
- // /dmwork_add_account <account_id> <bot_token> <api_url>
122
- api.registerCommand({
123
- name: "dmwork_add_account",
124
- description: "Add or update a DMWork bot account. Args: <account_id> <bot_token> <api_url>",
125
- acceptsArgs: true,
126
- async handler(ctx) {
127
- const parts = ctx.args?.trim().split(/\s+/) ?? [];
128
- if (parts.length < 3) {
129
- return { text: "Usage: /dmwork_add_account <account_id> <bot_token> <api_url>", isError: true };
130
- }
131
- const [accountId, botToken, apiUrl] = parts;
132
- if (!validateAccountId(accountId)) {
133
- return { text: `Invalid account ID "${accountId}". Only letters, digits, and underscores allowed.`, isError: true };
134
- }
135
- if (!botToken.startsWith("bf_")) {
136
- return { text: "Bot token must start with 'bf_'.", isError: true };
137
- }
138
- try {
139
- const existed = Boolean(configGet(`channels.dmwork.accounts.${accountId}.botToken`));
140
- configSet(`channels.dmwork.accounts.${accountId}.botToken`, botToken);
141
- configSet(`channels.dmwork.accounts.${accountId}.apiUrl`, apiUrl);
142
- const dmScope = configGet("session.dmScope");
143
- if (!dmScope) {
144
- configSet("session.dmScope", RECOMMENDED_DM_SCOPE);
145
- }
146
- gatewayRestart(true);
147
- return { text: `${existed ? "Updated" : "Added"} bot account: ${accountId} (API: ${apiUrl}). Gateway restarted.` };
148
- }
149
- catch (e) {
150
- return { text: `Failed: ${e instanceof Error ? e.message : String(e)}`, isError: true };
151
- }
152
- },
153
- });
154
- // /dmwork_remove_account <account_id>
155
- api.registerCommand({
156
- name: "dmwork_remove_account",
157
- description: "Remove a DMWork bot account. Args: <account_id>",
158
- acceptsArgs: true,
159
- async handler(ctx) {
160
- const accountId = ctx.args?.trim();
161
- if (!accountId) {
162
- return { text: "Usage: /dmwork_remove_account <account_id>", isError: true };
163
- }
164
- if (!validateAccountId(accountId)) {
165
- return { text: `Invalid account ID "${accountId}". Only letters, digits, and underscores allowed.`, isError: true };
166
- }
167
- try {
168
- const token = configGet(`channels.dmwork.accounts.${accountId}.botToken`);
169
- if (!token) {
170
- return { text: `Account "${accountId}" does not exist.`, isError: true };
171
- }
172
- configUnset(`channels.dmwork.accounts.${accountId}`);
173
- gatewayRestart(true);
174
- const remaining = configGetJson("channels.dmwork.accounts");
175
- const count = remaining ? Object.keys(remaining).length : 0;
176
- return { text: `Removed account: ${accountId}. ${count} account(s) remaining. Gateway restarted.` };
177
- }
178
- catch (e) {
179
- return { text: `Failed: ${e instanceof Error ? e.message : String(e)}`, isError: true };
180
- }
181
- },
182
- });
183
17
  console.log('[dmwork] registering before_prompt_build hook');
184
18
  api.on('before_prompt_build', (_event, ctx) => {
185
19
  const content = getGroupMdForPrompt(ctx);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,aAAa,EACb,SAAS,EACT,WAAW,EACX,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEpF,MAAM,MAAM,GAK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AoB,OAAO,oBAAoB,EAAE,CAAC;YACnF,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,MAAM,GAKR;IACF,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,uDAAuD;IACpE,QAAQ,CAAC,GAAG;QACV,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC9B,GAAG,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;QAE9C,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;QAC7D,GAAG,CAAC,EAAE,CAAC,qBAAqB,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;YAC5C,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;YACzC,IAAI,CAAC,OAAO;gBAAE,OAAO;YACrB,MAAM,MAAM,GAAG,EAAE,cAAc,EAAE,oBAAoB,OAAO,oBAAoB,EAAE,CAAC;YACnF,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/dist/package.json CHANGED
@@ -3,18 +3,13 @@
3
3
  "version": "0.5.19",
4
4
  "description": "DMWork channel plugin for OpenClaw via WuKongIM WebSocket",
5
5
  "main": "dist/index.js",
6
- "bin": {
7
- "openclaw-channel-dmwork": "bin/dmwork.js"
8
- },
9
6
  "types": "dist/index.d.ts",
10
7
  "type": "module",
11
8
  "files": [
12
- "bin",
13
9
  "dist",
14
10
  "openclaw.plugin.json"
15
11
  ],
16
12
  "scripts": {
17
- "prebuild": "rm -rf dist",
18
13
  "build": "tsc",
19
14
  "type-check": "tsc --noEmit",
20
15
  "test": "vitest run",
@@ -22,7 +17,6 @@
22
17
  },
23
18
  "dependencies": {
24
19
  "axios": "^1.7.0",
25
- "commander": "^12.1.0",
26
20
  "cos-nodejs-sdk-v5": "^2.15.4",
27
21
  "crypto-js": "^4.2.0",
28
22
  "curve25519-js": "^0.0.4",
package/package.json CHANGED
@@ -1,20 +1,15 @@
1
1
  {
2
2
  "name": "openclaw-channel-dmwork",
3
- "version": "0.5.19-dev.891496ab",
3
+ "version": "0.5.19",
4
4
  "description": "DMWork channel plugin for OpenClaw via WuKongIM WebSocket",
5
5
  "main": "dist/index.js",
6
- "bin": {
7
- "openclaw-channel-dmwork": "bin/dmwork.js"
8
- },
9
6
  "types": "dist/index.d.ts",
10
7
  "type": "module",
11
8
  "files": [
12
- "bin",
13
9
  "dist",
14
10
  "openclaw.plugin.json"
15
11
  ],
16
12
  "scripts": {
17
- "prebuild": "rm -rf dist",
18
13
  "build": "tsc",
19
14
  "type-check": "tsc --noEmit",
20
15
  "test": "vitest run",
@@ -22,7 +17,6 @@
22
17
  },
23
18
  "dependencies": {
24
19
  "axios": "^1.7.0",
25
- "commander": "^12.1.0",
26
20
  "cos-nodejs-sdk-v5": "^2.15.4",
27
21
  "crypto-js": "^4.2.0",
28
22
  "curve25519-js": "^0.0.4",
package/bin/dmwork.js DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import "../dist/cli/index.js";
@@ -1,33 +0,0 @@
1
- /**
2
- * doctor command: diagnose and optionally fix DMWork plugin health.
3
- *
4
- * Exports a pure check function reusable from both CLI mode
5
- * (using openclaw config get) and in-process mode (using ctx.config).
6
- */
7
- export type CheckStatus = "PASS" | "FAIL" | "WARN" | "FIXED";
8
- export interface CheckResult {
9
- name: string;
10
- status: CheckStatus;
11
- detail: string;
12
- }
13
- export interface DoctorResult {
14
- checks: CheckResult[];
15
- errors: number;
16
- warnings: number;
17
- fixed: number;
18
- }
19
- export interface ConfigReader {
20
- get(path: string): string | null;
21
- getJson(path: string): any;
22
- }
23
- /** CLI mode: reads via openclaw config get */
24
- export declare const cliConfigReader: ConfigReader;
25
- /** In-process mode: reads from a config object */
26
- export declare function inProcessConfigReader(config: any): ConfigReader;
27
- export declare function runDoctorChecks(params: {
28
- reader?: ConfigReader;
29
- accountId?: string;
30
- inProcess?: boolean;
31
- fix?: boolean;
32
- }): Promise<DoctorResult>;
33
- export declare function formatDoctorResult(result: DoctorResult): string;