openclaw-channel-dmwork 0.5.18-dev.a83ea4f8 → 0.5.19-dev.47fa1d22
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 +69 -21
- package/bin/dmwork.js +2 -0
- package/dist/cli/doctor.d.ts +33 -0
- package/dist/cli/doctor.js +346 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.js +114 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/install.d.ts +15 -0
- package/dist/cli/install.js +151 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/cli/openclaw-cli.d.ts +58 -0
- package/dist/cli/openclaw-cli.js +276 -0
- package/dist/cli/openclaw-cli.js.map +1 -0
- package/dist/cli/remove-account.d.ts +8 -0
- package/dist/cli/remove-account.js +52 -0
- package/dist/cli/remove-account.js.map +1 -0
- package/dist/cli/uninstall.d.ts +8 -0
- package/dist/cli/uninstall.js +33 -0
- package/dist/cli/uninstall.js.map +1 -0
- package/dist/cli/update.d.ts +11 -0
- package/dist/cli/update.js +79 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/cli/utils.d.ts +21 -0
- package/dist/cli/utils.js +98 -0
- package/dist/cli/utils.js.map +1 -0
- package/dist/index.js +166 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json +8 -2
- package/dist/src/agent-tools.js +84 -11
- package/dist/src/agent-tools.js.map +1 -1
- package/dist/src/api-fetch.d.ts +41 -0
- package/dist/src/api-fetch.js +47 -0
- package/dist/src/api-fetch.js.map +1 -1
- package/dist/src/group-md.d.ts +65 -0
- package/dist/src/group-md.js +219 -6
- package/dist/src/group-md.js.map +1 -1
- package/dist/src/inbound.js +74 -15
- package/dist/src/inbound.js.map +1 -1
- package/dist/src/types.d.ts +2 -0
- package/dist/src/types.js.map +1 -1
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -7,42 +7,89 @@ Repository: https://github.com/yujiawei/dmwork-adapters
|
|
|
7
7
|
## Prerequisites
|
|
8
8
|
|
|
9
9
|
- Node.js >= 18
|
|
10
|
-
- OpenClaw installed and configured
|
|
10
|
+
- OpenClaw installed and configured (`npm i -g openclaw`)
|
|
11
11
|
- A bot created via BotFather in DMWork (send `/newbot` to BotFather)
|
|
12
12
|
|
|
13
|
-
## Install
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
One-command install via npx (BotFather will provide the exact command):
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
19
22
|
```
|
|
20
23
|
|
|
21
|
-
|
|
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
|
|
22
30
|
|
|
23
|
-
|
|
31
|
+
Run without arguments to be prompted for each value:
|
|
24
32
|
|
|
25
|
-
```
|
|
26
|
-
|
|
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
|
|
33
|
+
```bash
|
|
34
|
+
npx -y openclaw-channel-dmwork install
|
|
31
35
|
```
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
## CLI Commands
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-
|
|
39
|
+
```bash
|
|
40
|
+
# Update the plugin to the latest version
|
|
41
|
+
npx -y openclaw-channel-dmwork update
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
# Diagnose plugin health
|
|
44
|
+
npx -y openclaw-channel-dmwork doctor
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
openclaw
|
|
46
|
+
# Uninstall (removes plugin and all bot configs)
|
|
47
|
+
npx -y openclaw-channel-dmwork uninstall
|
|
48
|
+
|
|
49
|
+
# Remove a single bot account
|
|
50
|
+
npx -y openclaw-channel-dmwork remove-account --account-id my_bot
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### OpenClaw internal commands
|
|
54
|
+
|
|
55
|
+
After installation, these commands are available inside OpenClaw:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
/dmwork_doctor # Check plugin status and connectivity
|
|
59
|
+
/dmwork_doctor my_bot # Check a specific account
|
|
43
60
|
```
|
|
44
61
|
|
|
45
|
-
|
|
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
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
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)
|
|
46
93
|
|
|
47
94
|
## What it does
|
|
48
95
|
|
|
@@ -60,6 +107,7 @@ The `index.ts` exports a standard OpenClaw plugin object. When loaded by OpenCla
|
|
|
60
107
|
- `register(api)` is called automatically
|
|
61
108
|
- `api.runtime` is injected for logging and lifecycle management
|
|
62
109
|
- `api.registerChannel()` registers the DMWork channel plugin
|
|
110
|
+
- `api.registerCommand()` registers `/dmwork_doctor`
|
|
63
111
|
- Configuration is read from `channels.dmwork` in OpenClaw's config
|
|
64
112
|
|
|
65
113
|
The plugin uses the `ChannelPlugin` SDK interface with support for:
|
package/bin/dmwork.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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;
|
|
@@ -0,0 +1,346 @@
|
|
|
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
|
+
import { existsSync } from "node:fs";
|
|
8
|
+
import { execFileSync } from "node:child_process";
|
|
9
|
+
import { configGet, configGetJson, configSet, gatewayRestart, gatewayStatus, pluginsInspect, pluginsInstall, removeChannelConfigFromFile, removeOrphanedBindingsFromFile, readConfigFromFile, } from "./openclaw-cli.js";
|
|
10
|
+
import { PLUGIN_ID, RECOMMENDED_DM_SCOPE } from "./utils.js";
|
|
11
|
+
/** CLI mode: reads via openclaw config get */
|
|
12
|
+
export const cliConfigReader = {
|
|
13
|
+
get: configGet,
|
|
14
|
+
getJson: configGetJson,
|
|
15
|
+
};
|
|
16
|
+
/** In-process mode: reads from a config object */
|
|
17
|
+
export function inProcessConfigReader(config) {
|
|
18
|
+
return {
|
|
19
|
+
get(path) {
|
|
20
|
+
const parts = path.split(".");
|
|
21
|
+
let cur = config;
|
|
22
|
+
for (const p of parts) {
|
|
23
|
+
if (cur == null || typeof cur !== "object")
|
|
24
|
+
return null;
|
|
25
|
+
cur = cur[p];
|
|
26
|
+
}
|
|
27
|
+
if (cur == null)
|
|
28
|
+
return null;
|
|
29
|
+
return String(cur);
|
|
30
|
+
},
|
|
31
|
+
getJson(path) {
|
|
32
|
+
const parts = path.split(".");
|
|
33
|
+
let cur = config;
|
|
34
|
+
for (const p of parts) {
|
|
35
|
+
if (cur == null || typeof cur !== "object")
|
|
36
|
+
return null;
|
|
37
|
+
cur = cur[p];
|
|
38
|
+
}
|
|
39
|
+
return cur ?? null;
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Doctor checks (with optional fix)
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
export async function runDoctorChecks(params) {
|
|
47
|
+
const fix = params.fix ?? false;
|
|
48
|
+
const checks = [];
|
|
49
|
+
// =========================================================================
|
|
50
|
+
// Phase 1: Fatal config issues (OpenClaw CLI may not work)
|
|
51
|
+
// =========================================================================
|
|
52
|
+
if (!params.inProcess && fix) {
|
|
53
|
+
const cfg = readConfigFromFile();
|
|
54
|
+
if (cfg) {
|
|
55
|
+
const hasDmworkChannel = Boolean(cfg.channels?.dmwork);
|
|
56
|
+
// Check if plugin actually exists on disk, not just config records
|
|
57
|
+
const installPath = cfg.plugins?.installs?.["openclaw-channel-dmwork"]?.installPath;
|
|
58
|
+
const pluginOnDisk = installPath
|
|
59
|
+
? existsSync(installPath.replace(/^~/, process.env.HOME ?? ""))
|
|
60
|
+
: false;
|
|
61
|
+
// channels.dmwork exists but plugin not on disk → residual config
|
|
62
|
+
if (hasDmworkChannel && !pluginOnDisk) {
|
|
63
|
+
removeChannelConfigFromFile();
|
|
64
|
+
checks.push({
|
|
65
|
+
name: "Residual channels.dmwork",
|
|
66
|
+
status: "FIXED",
|
|
67
|
+
detail: "Removed orphaned channel config (plugin not installed)",
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// Orphaned dmwork bindings
|
|
71
|
+
const bindings = cfg.bindings;
|
|
72
|
+
const dmworkBindings = bindings?.filter((b) => b.match?.channel === "dmwork") ?? [];
|
|
73
|
+
const configuredAccounts = cfg.channels?.dmwork?.accounts
|
|
74
|
+
? Object.keys(cfg.channels.dmwork.accounts)
|
|
75
|
+
: [];
|
|
76
|
+
if (dmworkBindings.length > 0 && !hasDmworkChannel) {
|
|
77
|
+
// All dmwork bindings are orphaned — no channel config at all
|
|
78
|
+
removeOrphanedBindingsFromFile("dmwork");
|
|
79
|
+
checks.push({
|
|
80
|
+
name: "Orphaned bindings",
|
|
81
|
+
status: "FIXED",
|
|
82
|
+
detail: `Removed ${dmworkBindings.length} orphaned dmwork binding(s)`,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
else if (dmworkBindings.length > 0 && configuredAccounts.length > 0) {
|
|
86
|
+
// Check for bindings referencing non-existent accounts
|
|
87
|
+
const orphaned = dmworkBindings.filter((b) => b.match?.accountId && !configuredAccounts.includes(b.match.accountId));
|
|
88
|
+
if (orphaned.length > 0) {
|
|
89
|
+
removeOrphanedBindingsFromFile("dmwork", configuredAccounts);
|
|
90
|
+
checks.push({
|
|
91
|
+
name: "Orphaned bindings",
|
|
92
|
+
status: "FIXED",
|
|
93
|
+
detail: `Removed ${orphaned.length} binding(s) for non-existent account(s)`,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// =========================================================================
|
|
100
|
+
// Phase 2: Standard checks (with fix support)
|
|
101
|
+
// =========================================================================
|
|
102
|
+
const reader = params.reader ?? cliConfigReader;
|
|
103
|
+
// 1. Plugin installed
|
|
104
|
+
if (!params.inProcess) {
|
|
105
|
+
const inspect = pluginsInspect(PLUGIN_ID);
|
|
106
|
+
if (inspect?.plugin) {
|
|
107
|
+
checks.push({
|
|
108
|
+
name: "Plugin installed",
|
|
109
|
+
status: "PASS",
|
|
110
|
+
detail: `v${inspect.plugin.version}`,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
else if (fix) {
|
|
114
|
+
try {
|
|
115
|
+
pluginsInstall(PLUGIN_ID, true);
|
|
116
|
+
const after = pluginsInspect(PLUGIN_ID);
|
|
117
|
+
checks.push({
|
|
118
|
+
name: "Plugin installed",
|
|
119
|
+
status: "FIXED",
|
|
120
|
+
detail: `Installed v${after?.plugin?.version ?? "unknown"}`,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
checks.push({
|
|
125
|
+
name: "Plugin installed",
|
|
126
|
+
status: "FAIL",
|
|
127
|
+
detail: "Not installed (auto-install failed)",
|
|
128
|
+
});
|
|
129
|
+
return summarize(checks);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
checks.push({
|
|
134
|
+
name: "Plugin installed",
|
|
135
|
+
status: "FAIL",
|
|
136
|
+
detail: "Not installed",
|
|
137
|
+
});
|
|
138
|
+
return summarize(checks);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// 2. Plugin enabled
|
|
142
|
+
if (!params.inProcess) {
|
|
143
|
+
const enabled = reader.get("plugins.entries.openclaw-channel-dmwork.enabled");
|
|
144
|
+
if (enabled === "true") {
|
|
145
|
+
checks.push({ name: "Plugin enabled", status: "PASS", detail: "Yes" });
|
|
146
|
+
}
|
|
147
|
+
else if (fix) {
|
|
148
|
+
try {
|
|
149
|
+
configSet("plugins.entries.openclaw-channel-dmwork.enabled", "true");
|
|
150
|
+
checks.push({ name: "Plugin enabled", status: "FIXED", detail: "Enabled" });
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
checks.push({ name: "Plugin enabled", status: "FAIL", detail: "No (auto-fix failed)" });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
checks.push({ name: "Plugin enabled", status: "FAIL", detail: "No" });
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// 3. node_modules check
|
|
161
|
+
if (!params.inProcess) {
|
|
162
|
+
const inspect = pluginsInspect(PLUGIN_ID);
|
|
163
|
+
const installPath = inspect?.install?.installPath;
|
|
164
|
+
if (installPath) {
|
|
165
|
+
const nmPath = installPath.replace(/^~/, process.env.HOME ?? "") + "/node_modules";
|
|
166
|
+
if (existsSync(nmPath)) {
|
|
167
|
+
checks.push({ name: "Dependencies", status: "PASS", detail: "node_modules exists" });
|
|
168
|
+
}
|
|
169
|
+
else if (fix) {
|
|
170
|
+
try {
|
|
171
|
+
execFileSync("npm", ["install", "--production", "--ignore-scripts"], {
|
|
172
|
+
cwd: installPath.replace(/^~/, process.env.HOME ?? ""),
|
|
173
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
174
|
+
});
|
|
175
|
+
checks.push({ name: "Dependencies", status: "FIXED", detail: "npm install completed" });
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
checks.push({ name: "Dependencies", status: "FAIL", detail: "node_modules missing (npm install failed)" });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
checks.push({ name: "Dependencies", status: "FAIL", detail: "node_modules missing" });
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// 4. Accounts configured (with legacy fallback)
|
|
187
|
+
const accounts = reader.getJson("channels.dmwork.accounts");
|
|
188
|
+
const accountIds = accounts ? Object.keys(accounts) : [];
|
|
189
|
+
const legacyToken = reader.get("channels.dmwork.botToken");
|
|
190
|
+
if (accountIds.length > 0) {
|
|
191
|
+
checks.push({
|
|
192
|
+
name: "Accounts configured",
|
|
193
|
+
status: "PASS",
|
|
194
|
+
detail: `${accountIds.join(", ")} (${accountIds.length} total)`,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
else if (legacyToken) {
|
|
198
|
+
checks.push({
|
|
199
|
+
name: "Accounts configured",
|
|
200
|
+
status: "PASS",
|
|
201
|
+
detail: "Legacy flat config (top-level botToken)",
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
checks.push({
|
|
206
|
+
name: "Accounts configured",
|
|
207
|
+
status: "FAIL",
|
|
208
|
+
detail: "No accounts configured (run install to add a bot)",
|
|
209
|
+
});
|
|
210
|
+
// Don't return early — continue checking other items
|
|
211
|
+
}
|
|
212
|
+
// 5 & 6. Per-account checks: botToken + API reachability
|
|
213
|
+
const targetAccounts = params.accountId
|
|
214
|
+
? [params.accountId]
|
|
215
|
+
: accountIds.length > 0
|
|
216
|
+
? accountIds
|
|
217
|
+
: legacyToken
|
|
218
|
+
? ["__legacy__"]
|
|
219
|
+
: [];
|
|
220
|
+
for (const acctId of targetAccounts) {
|
|
221
|
+
const isLegacy = acctId === "__legacy__";
|
|
222
|
+
const label = isLegacy ? "default" : acctId;
|
|
223
|
+
const tokenPath = isLegacy
|
|
224
|
+
? "channels.dmwork.botToken"
|
|
225
|
+
: `channels.dmwork.accounts.${acctId}.botToken`;
|
|
226
|
+
const tokenVal = reader.get(tokenPath);
|
|
227
|
+
if (tokenVal) {
|
|
228
|
+
if (params.inProcess && !tokenVal.startsWith("bf_")) {
|
|
229
|
+
checks.push({
|
|
230
|
+
name: `${label}: botToken format`,
|
|
231
|
+
status: "WARN",
|
|
232
|
+
detail: "Does not start with bf_",
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
checks.push({
|
|
237
|
+
name: `${label}: botToken`,
|
|
238
|
+
status: "PASS",
|
|
239
|
+
detail: "Configured",
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
checks.push({
|
|
245
|
+
name: `${label}: botToken`,
|
|
246
|
+
status: "FAIL",
|
|
247
|
+
detail: "Not configured",
|
|
248
|
+
});
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
const apiUrlPath = isLegacy
|
|
252
|
+
? "channels.dmwork.apiUrl"
|
|
253
|
+
: `channels.dmwork.accounts.${acctId}.apiUrl`;
|
|
254
|
+
let apiUrl = reader.get(apiUrlPath);
|
|
255
|
+
if (!apiUrl)
|
|
256
|
+
apiUrl = reader.get("channels.dmwork.apiUrl");
|
|
257
|
+
if (!apiUrl)
|
|
258
|
+
apiUrl = "http://localhost:8090";
|
|
259
|
+
try {
|
|
260
|
+
const probeUrl = `${apiUrl.replace(/\/+$/, "")}/v1/bot/skill.md`;
|
|
261
|
+
const resp = await fetch(probeUrl, { signal: AbortSignal.timeout(5000) });
|
|
262
|
+
checks.push({
|
|
263
|
+
name: `${label}: API reachable`,
|
|
264
|
+
status: resp.ok ? "PASS" : "FAIL",
|
|
265
|
+
detail: resp.ok ? apiUrl : `HTTP ${resp.status}`,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
catch (err) {
|
|
269
|
+
checks.push({
|
|
270
|
+
name: `${label}: API reachable`,
|
|
271
|
+
status: "FAIL",
|
|
272
|
+
detail: `${apiUrl} - ${err instanceof Error ? err.message : String(err)}`,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
// 7. Gateway running
|
|
277
|
+
if (!params.inProcess) {
|
|
278
|
+
const gw = gatewayStatus();
|
|
279
|
+
if (gw.running) {
|
|
280
|
+
checks.push({ name: "Gateway running", status: "PASS", detail: "Yes" });
|
|
281
|
+
}
|
|
282
|
+
else if (fix) {
|
|
283
|
+
if (gatewayRestart()) {
|
|
284
|
+
checks.push({ name: "Gateway running", status: "FIXED", detail: "Restarted" });
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
checks.push({ name: "Gateway running", status: "FAIL", detail: "Not running (restart failed)" });
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
checks.push({ name: "Gateway running", status: "FAIL", detail: "Not running" });
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
// 8. session.dmScope
|
|
295
|
+
const dmScope = reader.get("session.dmScope");
|
|
296
|
+
if (dmScope === RECOMMENDED_DM_SCOPE) {
|
|
297
|
+
checks.push({ name: "session.dmScope", status: "PASS", detail: dmScope });
|
|
298
|
+
}
|
|
299
|
+
else if (!dmScope && fix) {
|
|
300
|
+
try {
|
|
301
|
+
configSet("session.dmScope", RECOMMENDED_DM_SCOPE);
|
|
302
|
+
checks.push({ name: "session.dmScope", status: "FIXED", detail: `Set to ${RECOMMENDED_DM_SCOPE}` });
|
|
303
|
+
}
|
|
304
|
+
catch {
|
|
305
|
+
checks.push({ name: "session.dmScope", status: "WARN", detail: `Not set (recommended: ${RECOMMENDED_DM_SCOPE})` });
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
else if (!dmScope) {
|
|
309
|
+
checks.push({ name: "session.dmScope", status: "WARN", detail: `Not set (recommended: ${RECOMMENDED_DM_SCOPE})` });
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
checks.push({ name: "session.dmScope", status: "WARN", detail: `${dmScope} (recommended: ${RECOMMENDED_DM_SCOPE})` });
|
|
313
|
+
}
|
|
314
|
+
return summarize(checks);
|
|
315
|
+
}
|
|
316
|
+
// ---------------------------------------------------------------------------
|
|
317
|
+
// Formatting
|
|
318
|
+
// ---------------------------------------------------------------------------
|
|
319
|
+
function summarize(checks) {
|
|
320
|
+
return {
|
|
321
|
+
checks,
|
|
322
|
+
errors: checks.filter((c) => c.status === "FAIL").length,
|
|
323
|
+
warnings: checks.filter((c) => c.status === "WARN").length,
|
|
324
|
+
fixed: checks.filter((c) => c.status === "FIXED").length,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
export function formatDoctorResult(result) {
|
|
328
|
+
const lines = ["DMWork Plugin Doctor"];
|
|
329
|
+
for (const c of result.checks) {
|
|
330
|
+
const tag = c.status === "PASS"
|
|
331
|
+
? "[PASS] "
|
|
332
|
+
: c.status === "WARN"
|
|
333
|
+
? "[WARN] "
|
|
334
|
+
: c.status === "FIXED"
|
|
335
|
+
? "[FIXED]"
|
|
336
|
+
: "[FAIL] ";
|
|
337
|
+
lines.push(` ${tag} ${c.name} (${c.detail})`);
|
|
338
|
+
}
|
|
339
|
+
lines.push("");
|
|
340
|
+
const parts = [`${result.errors} error(s)`, `${result.warnings} warning(s)`];
|
|
341
|
+
if (result.fixed > 0)
|
|
342
|
+
parts.push(`${result.fixed} fixed`);
|
|
343
|
+
lines.push(parts.join(", ") + ".");
|
|
344
|
+
return lines.join("\n");
|
|
345
|
+
}
|
|
346
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../cli/doctor.ts"],"names":[],"mappings":"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C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI entry point: register 5 subcommands with commander.
|
|
3
|
+
*/
|
|
4
|
+
import { Command, Option } from "commander";
|
|
5
|
+
import { runInstall } from "./install.js";
|
|
6
|
+
import { runUpdate } from "./update.js";
|
|
7
|
+
import { cliConfigReader, formatDoctorResult, runDoctorChecks, } from "./doctor.js";
|
|
8
|
+
import { runUninstall } from "./uninstall.js";
|
|
9
|
+
import { runRemoveAccount } from "./remove-account.js";
|
|
10
|
+
import { ensureOpenClawCompat, PLUGIN_ID } from "./utils.js";
|
|
11
|
+
import { getOpenClawVersion, pluginsInspect } from "./openclaw-cli.js";
|
|
12
|
+
import { createRequire } from "node:module";
|
|
13
|
+
const program = new Command();
|
|
14
|
+
program
|
|
15
|
+
.name("openclaw-channel-dmwork")
|
|
16
|
+
.description("DMWork channel plugin CLI for OpenClaw")
|
|
17
|
+
.version("0.5.19");
|
|
18
|
+
// --- info ---
|
|
19
|
+
program
|
|
20
|
+
.command("info")
|
|
21
|
+
.description("Show CLI and plugin version info")
|
|
22
|
+
.action(() => {
|
|
23
|
+
const require = createRequire(import.meta.url);
|
|
24
|
+
const cliPkg = require("../package.json");
|
|
25
|
+
const openclawVersion = getOpenClawVersion() ?? "not found";
|
|
26
|
+
const inspect = pluginsInspect(PLUGIN_ID);
|
|
27
|
+
const installedVersion = inspect?.plugin?.version ?? "not installed";
|
|
28
|
+
// ANSI: \x1b[1m = bold, \x1b[32m = green, \x1b[4m = underline, \x1b[0m = reset
|
|
29
|
+
const b = "\x1b[1m"; // bold
|
|
30
|
+
const g = "\x1b[32m"; // green
|
|
31
|
+
const u = "\x1b[4m"; // underline
|
|
32
|
+
const r = "\x1b[0m"; // reset
|
|
33
|
+
console.log(`${b}openclaw-channel-dmwork-cli:${r} ${g}${cliPkg.version}${r}`);
|
|
34
|
+
console.log(`${b}openclaw:${r} ${g}${openclawVersion}${r}`);
|
|
35
|
+
console.log(`${b}openclaw-channel-dmwork:${r} ${g}${installedVersion}${r}`);
|
|
36
|
+
console.log(`${b}plugin package:${r} ${g}${PLUGIN_ID}${r}`);
|
|
37
|
+
console.log();
|
|
38
|
+
console.log(`${b}环境信息:${r}`);
|
|
39
|
+
console.log(`${b}OS:${r} ${g}${process.platform} ${process.arch}${r}`);
|
|
40
|
+
console.log(`${b}Node.js:${r} ${g}${process.version}${r}`);
|
|
41
|
+
console.log(`${b}Shell:${r} ${g}${process.env.SHELL ?? "unknown"}${r}`);
|
|
42
|
+
});
|
|
43
|
+
// --- install ---
|
|
44
|
+
program
|
|
45
|
+
.command("install")
|
|
46
|
+
.description("Install the DMWork plugin and configure a bot account")
|
|
47
|
+
.option("--bot-token <token>", "Bot token (starts with bf_)")
|
|
48
|
+
.option("--api-url <url>", "API server URL")
|
|
49
|
+
.option("--account-id <id>", "Account ID (required in non-interactive mode)")
|
|
50
|
+
.option("--skip-config", "Skip bot configuration", false)
|
|
51
|
+
.option("--force", "Force reinstall", false)
|
|
52
|
+
.addOption(new Option("--dev").hideHelp().default(false))
|
|
53
|
+
.action(async (opts) => {
|
|
54
|
+
await runInstall({
|
|
55
|
+
botToken: opts.botToken,
|
|
56
|
+
apiUrl: opts.apiUrl,
|
|
57
|
+
accountId: opts.accountId,
|
|
58
|
+
skipConfig: opts.skipConfig,
|
|
59
|
+
force: opts.force,
|
|
60
|
+
dev: opts.dev,
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
// --- update ---
|
|
64
|
+
program
|
|
65
|
+
.command("update")
|
|
66
|
+
.description("Update the DMWork plugin to the latest version")
|
|
67
|
+
.option("--json", "Output JSON", false)
|
|
68
|
+
.addOption(new Option("--dev").hideHelp().default(false))
|
|
69
|
+
.action(async (opts) => {
|
|
70
|
+
await runUpdate({ json: opts.json, dev: opts.dev });
|
|
71
|
+
});
|
|
72
|
+
// --- doctor ---
|
|
73
|
+
program
|
|
74
|
+
.command("doctor")
|
|
75
|
+
.description("Diagnose DMWork plugin health")
|
|
76
|
+
.option("--account-id <id>", "Check a specific account only")
|
|
77
|
+
.option("--fix", "Attempt to automatically fix issues", false)
|
|
78
|
+
.option("--json", "Output JSON", false)
|
|
79
|
+
.action(async (opts) => {
|
|
80
|
+
ensureOpenClawCompat();
|
|
81
|
+
const result = await runDoctorChecks({
|
|
82
|
+
reader: cliConfigReader,
|
|
83
|
+
accountId: opts.accountId,
|
|
84
|
+
fix: opts.fix,
|
|
85
|
+
});
|
|
86
|
+
if (opts.json) {
|
|
87
|
+
console.log(JSON.stringify(result, null, 2));
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
console.log(formatDoctorResult(result));
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
// --- uninstall ---
|
|
94
|
+
program
|
|
95
|
+
.command("uninstall")
|
|
96
|
+
.description("Uninstall the DMWork plugin and remove all bot configs")
|
|
97
|
+
.option("--yes", "Skip confirmation", false)
|
|
98
|
+
.action(async (opts) => {
|
|
99
|
+
await runUninstall({ yes: opts.yes });
|
|
100
|
+
});
|
|
101
|
+
// --- remove-account ---
|
|
102
|
+
program
|
|
103
|
+
.command("remove-account")
|
|
104
|
+
.description("Remove a single bot account config")
|
|
105
|
+
.requiredOption("--account-id <id>", "Account ID to remove")
|
|
106
|
+
.option("--yes", "Skip confirmation", false)
|
|
107
|
+
.action(async (opts) => {
|
|
108
|
+
await runRemoveAccount({
|
|
109
|
+
accountId: opts.accountId,
|
|
110
|
+
yes: opts.yes,
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
program.parse();
|
|
114
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../cli/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OA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AAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* install command: install plugin via official CLI + interactive config setup.
|
|
3
|
+
*
|
|
4
|
+
* Only manages channels.dmwork account config. Agent creation (binding,
|
|
5
|
+
* workspace, agent.md) is left to the user via `openclaw agents add`.
|
|
6
|
+
*/
|
|
7
|
+
export interface InstallOptions {
|
|
8
|
+
botToken?: string;
|
|
9
|
+
apiUrl?: string;
|
|
10
|
+
accountId?: string;
|
|
11
|
+
skipConfig?: boolean;
|
|
12
|
+
force?: boolean;
|
|
13
|
+
dev?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function runInstall(opts: InstallOptions): Promise<void>;
|