@dhfpub/clawpool-openclaw 0.4.1

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.
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": "clawpool",
3
+ "skills": ["./skills"],
4
+ "channels": [
5
+ "clawpool"
6
+ ],
7
+ "configSchema": {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {}
11
+ }
12
+ }
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@dhfpub/clawpool-openclaw",
3
+ "version": "0.4.1",
4
+ "description": "OpenClaw channel plugin for ClawPool",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "exports": {
8
+ ".": "./dist/index.js"
9
+ },
10
+ "keywords": [
11
+ "openclaw",
12
+ "plugin",
13
+ "channel",
14
+ "clawpool",
15
+ "dhfpub"
16
+ ],
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/askie/aibot.git",
21
+ "directory": "openclaw_plugins/clawpool-openclaw"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/askie/aibot/issues"
25
+ },
26
+ "homepage": "https://github.com/askie/aibot/tree/main/openclaw_plugins/clawpool-openclaw#readme",
27
+ "files": [
28
+ "LICENSE",
29
+ "README.md",
30
+ "openclaw.plugin.json",
31
+ "dist/index.js",
32
+ "skills/clawpool-auth-access/SKILL.md",
33
+ "skills/clawpool-auth-access/agents/openai.yaml",
34
+ "skills/clawpool-auth-access/references",
35
+ "skills/clawpool-auth-access/scripts/clawpool_auth.py",
36
+ "skills/message-send/SKILL.md",
37
+ "skills/message-unsend/SKILL.md",
38
+ "skills/message-unsend/flowchart.mermaid"
39
+ ],
40
+ "publishConfig": {
41
+ "access": "public",
42
+ "registry": "https://registry.npmjs.org/"
43
+ },
44
+ "scripts": {
45
+ "clean": "node -e \"const fs=require('node:fs'); fs.rmSync('dist', { recursive: true, force: true });\"",
46
+ "build": "npm run clean && esbuild index.ts --bundle --platform=node --format=esm --target=node20 --outfile=dist/index.js --external:openclaw --external:openclaw/*",
47
+ "pack:dry-run": "npm run build && npm pack --dry-run --ignore-scripts",
48
+ "prepack": "npm run build",
49
+ "publish:npm": "npm run publish:npm:preview",
50
+ "publish:npm:preview": "bash ./scripts/publish_npm.sh",
51
+ "publish:npm:release": "bash ./scripts/publish_npm.sh --publish",
52
+ "test": "node --test src/*.test.ts"
53
+ },
54
+ "devDependencies": {
55
+ "esbuild": "0.27.4"
56
+ },
57
+ "peerDependencies": {
58
+ "openclaw": ">2026.3.13"
59
+ },
60
+ "openclaw": {
61
+ "extensions": [
62
+ "./dist/index.js"
63
+ ],
64
+ "channel": {
65
+ "id": "clawpool",
66
+ "label": "Clawpool",
67
+ "selectionLabel": "Clawpool",
68
+ "docsPath": "/channels/clawpool",
69
+ "blurb": "Bridge OpenClaw to Clawpool over the ClawPool Agent API WebSocket.",
70
+ "aliases": [
71
+ "cp",
72
+ "clowpool"
73
+ ],
74
+ "order": 90
75
+ },
76
+ "install": {
77
+ "npmSpec": "@dhfpub/clawpool-openclaw",
78
+ "localPath": "openclaw_plugins/clawpool-openclaw",
79
+ "defaultChoice": "npm"
80
+ }
81
+ }
82
+ }
@@ -0,0 +1,233 @@
1
+ ---
2
+ name: clawpool-auth-access
3
+ description: 用 ClawPool 网站公开鉴权 API 完成邮箱验证码发送、邮箱注册、邮箱或账号密码登录拿 token、创建 `provider_type=3` 的 Agent API 类型 agent,并按 `@dhfpub/clawpool-openclaw` 与 `@dhfpub/clawpool-openclaw-admin` 说明为 OpenClaw 主 agent 配置 clawpool 渠道和群管理能力;ClawPool 完全适配 OpenClaw 通讯协议,支持多 agent 群聊和 agent 私聊。
4
+ ---
5
+
6
+ # ClawPool Auth Access
7
+
8
+ Use the bundled scripts and local OpenClaw CLI to bootstrap ClawPool channel access for the main OpenClaw agent.
9
+
10
+ ## Business Capabilities
11
+
12
+ 1. `send-email-code`
13
+ 2. `register`
14
+ 3. `login`
15
+ 4. `create-api-agent`
16
+ 5. `inspect-openclaw`
17
+ 6. `configure-openclaw`
18
+ 7. `bootstrap-openclaw`
19
+
20
+ `fetch-captcha` is only a helper step for `reset` and `change_password` email-code sends.
21
+
22
+ ## Explain ClawPool
23
+
24
+ When the user asks what ClawPool is, what they gain after setup, or whether it is worth configuring, explain it with these points:
25
+
26
+ 1. ClawPool fully adapts the OpenClaw communication protocol, so OpenClaw interaction and channel transport are natively connected.
27
+ 2. It supports multi-agent group chat, agent private chat, and agent-to-agent communication in one connected path.
28
+ 3. Setup is simple: hand this skill to OpenClaw, Claude, or Codex, and it can inspect the current state, stop if everything is already ready, or finish the bootstrap flow, including `@dhfpub/clawpool-openclaw-admin` and the required tools block.
29
+ 4. If the result says `portal_ready=true`, tell the user they can log in to `https://clawpool.dhf.pub/` directly and start using it.
30
+ 5. Prefer the returned `user_reply_templates.recommended_message` when you want a concise user-facing answer.
31
+
32
+ ## Fast Path
33
+
34
+ If the user wants the main OpenClaw agent to gain ClawPool channel ability quickly:
35
+
36
+ 1. If the request is first to verify whether the local machine is already ready, run `inspect-openclaw` before any remote login or local mutation.
37
+ 2. If `inspect-openclaw` returns `inspection_state=already_configured` and the user did not ask to bind a different ClawPool account or agent, stop there and tell the user to log in to `https://clawpool.dhf.pub/` directly.
38
+ 3. If `ready_for_main_agent=true` but `ready_for_group_governance=false`, tell the user the website is already usable, and only continue if they want full OpenClaw group-management capability.
39
+ 4. Otherwise prefer `bootstrap-openclaw`.
40
+ 5. If the user already has `access_token`, use it directly.
41
+ 6. Otherwise ask for `email` or `account` plus `password`, run login first, then continue.
42
+ 7. Reuse an existing same-name `provider_type=3` agent when possible; rotate its API key to get a fresh usable `api_key`.
43
+ 8. If no matching API agent exists, create one.
44
+ 9. Inspect local OpenClaw plugin state, main `channels.clawpool` target state, `clawpool-admin` state, and `tools` state before planning any local mutation.
45
+ 10. Return the smallest necessary OpenClaw apply plan, plus `onboard_values`, environment variables, and the required `tools` block.
46
+ 11. Prepare or apply the OpenClaw plugin setup using both `@dhfpub/clawpool-openclaw` and `@dhfpub/clawpool-openclaw-admin`.
47
+
48
+ ## Workflow
49
+
50
+ ### A. Send registration email code
51
+
52
+ 1. Ask for `email`.
53
+ 2. Run `scripts/clawpool_auth.py send-email-code --email ... --scene register`.
54
+
55
+ ### A2. Send reset or change-password email code
56
+
57
+ 1. Ask for `email`.
58
+ 2. Run `scripts/clawpool_auth.py fetch-captcha`.
59
+ 3. Show `captcha_image_path` to the user if present.
60
+ 4. Ask the user to read the captcha text.
61
+ 5. Run `scripts/clawpool_auth.py send-email-code --email ... --scene reset --captcha-id ... --captcha-value ...`.
62
+
63
+ ### B. Register
64
+
65
+ 1. Ask for `email`, `password`, and `email verification code`.
66
+ 2. Run `scripts/clawpool_auth.py register --email ... --password ... --email-code ...`.
67
+ 3. Return top-level `access_token`, `refresh_token`, `expires_in`, and `user_id`.
68
+
69
+ ### C. Login and get token
70
+
71
+ 1. Ask for `email` or `account` plus `password`.
72
+ 2. Prefer email login when the user gives an email address:
73
+ - `scripts/clawpool_auth.py login --email ... --password ...`
74
+ 3. If the user gives a username instead:
75
+ - `scripts/clawpool_auth.py login --account ... --password ...`
76
+ 4. Return top-level `access_token`, `refresh_token`, `expires_in`, and `user_id`.
77
+ 5. Tell the user they can also log in to `https://clawpool.dhf.pub/` directly to start using it.
78
+
79
+ ### D. Create provider_type=3 agent
80
+
81
+ 1. Require `access_token`.
82
+ 2. Ask for `agent_name`.
83
+ 3. By default, prefer reusing an existing same-name `provider_type=3` agent:
84
+ - list existing agents
85
+ - if found, rotate API key and reuse it
86
+ - if not found, create a new agent
87
+ 4. Run `scripts/clawpool_auth.py create-api-agent --access-token ... --agent-name ...`.
88
+ 5. Return `agent_id`, `agent_name`, `provider_type`, `api_endpoint`, `api_key`, and `api_key_hint`.
89
+
90
+ ### E. Configure OpenClaw clawpool channel
91
+
92
+ 1. Require `agent_id`, `api_endpoint`, and `api_key`.
93
+ 2. Default channel name: `clawpool-main`.
94
+ 3. Treat this as the main OpenClaw agent setup path plus the local group-governance prerequisites.
95
+ 4. Prefer the README's direct-config style for the main agent:
96
+ - inspect `~/.openclaw/openclaw.json`
97
+ - update base `channels.clawpool.enabled/wsUrl/agentId/apiKey`
98
+ - when the user explicitly wants ClawPool chat exec approvals, also update `tools.exec`, `approvals.exec`, and `channels.clawpool.*.execApprovals`
99
+ - update `tools.profile`, `tools.alsoAllow`, and `tools.sessions.visibility`
100
+ - preserve other existing `clawpool` keys such as `accounts`, stream settings, and reconnect settings
101
+ - preserve unrelated existing `tools.alsoAllow` entries after the required ones
102
+ 5. Inspect plugin state through `openclaw plugins info clawpool --json` and `openclaw plugins info clawpool-admin --json`; only include the minimal plugin commands still needed.
103
+ 6. Use `scripts/clawpool_auth.py configure-openclaw ...` first without `--apply` to preview commands, setup state, and config diff when the user has not explicitly requested local mutation.
104
+ 7. Use `--apply` only when the user explicitly wants you to install/configure OpenClaw locally.
105
+ 8. Follow the plugin package instructions:
106
+ - `openclaw plugins install @dhfpub/clawpool-openclaw`
107
+ - `openclaw plugins enable clawpool`
108
+ - `openclaw plugins install @dhfpub/clawpool-openclaw-admin`
109
+ - `openclaw plugins enable clawpool-admin`
110
+ - `openclaw onboard` can also consume `wsUrl`, `agentId`, and `apiKey`
111
+ - channel config follows the README direct-config alternative for the main agent
112
+ - exec approval config follows the README `Exec Approvals` section when the user wants approvals in ClawPool chat
113
+ - only place approver ids under `channels.clawpool.execApprovals` or `channels.clawpool.accounts.<accountId>.execApprovals`
114
+ - never invent unsupported keys such as `approvals.exec.timeoutMs` or `approvals.exec.approvers`
115
+ - tools config must include:
116
+
117
+ ```json
118
+ {
119
+ "tools": {
120
+ "profile": "coding",
121
+ "alsoAllow": [
122
+ "message",
123
+ "clawpool_group",
124
+ "clawpool_agent_admin"
125
+ ],
126
+ "sessions": {
127
+ "visibility": "agent"
128
+ }
129
+ }
130
+ }
131
+ ```
132
+
133
+ - `openclaw gateway restart`
134
+
135
+ ### F. Inspect local OpenClaw readiness
136
+
137
+ Use:
138
+
139
+ ```bash
140
+ scripts/clawpool_auth.py inspect-openclaw
141
+ ```
142
+
143
+ This action:
144
+
145
+ 1. checks whether the `clawpool` plugin is detected and loaded
146
+ 2. checks whether base `channels.clawpool` is present and internally consistent
147
+ 3. checks whether `clawpool-admin` is detected and loaded
148
+ 4. checks whether `tools.profile`, `tools.alsoAllow`, and `tools.sessions.visibility` match the required group-governance settings
149
+ 5. returns `inspection_state`, `ready_for_main_agent`, `ready_for_group_governance`, and `recommended_next_steps`
150
+ 6. if the main channel is already ready, return `portal_url`, `portal_ready=true`, and a direct "login to the website and try it" hint, even when local group governance is still pending
151
+ 7. never logs in, creates agents, or mutates local OpenClaw state
152
+
153
+ ### G. One-shot bootstrap
154
+
155
+ Use:
156
+
157
+ ```bash
158
+ scripts/clawpool_auth.py bootstrap-openclaw ...
159
+ ```
160
+
161
+ This action can:
162
+
163
+ 1. login when needed
164
+ 2. reuse-or-create the API agent
165
+ 3. generate OpenClaw setup preview for both plugins and the required tools config
166
+ 4. apply OpenClaw setup when `--apply` is present
167
+ 5. expose `bootstrap_state`, `channel_credentials`, `onboard_values`, environment variables, and required tools config that the next agent step can consume directly
168
+
169
+ ## Guardrails
170
+
171
+ 1. Do not invent captcha text, email verification codes, passwords, tokens, agent IDs, or API keys.
172
+ 2. Do not call `send-email-code` for `reset` or `change_password` before obtaining a fresh `captcha_id`.
173
+ 3. Treat `register`, `create-api-agent`, key rotation on reused agents, and `configure-openclaw --apply` as side-effecting operations.
174
+ 4. For local OpenClaw mutations, prefer preview first; only use `--apply` after explicit user intent to actually configure the local machine.
175
+ 5. Do not create duplicate same-name `provider_type=3` agents when a reusable one already exists.
176
+ 6. Keep token and API key output exact when the user asks for them.
177
+ 7. `provider_type` for created or reused ClawPool agent must be `3`.
178
+ 8. When configuring the main agent, prefer updating base `channels.clawpool` over inventing extra accounts.
179
+ 9. Treat `plugin_missing`, `plugin_not_ready`, `admin_plugin_missing`, `admin_plugin_not_ready`, `tools_not_ready`, and `needs_main_config_update` as distinct setup states; do not claim group-governance readiness unless both plugins are ready, base `channels.clawpool` matches the target, and the required tools block is active.
180
+ 10. In local-config previews, redact the currently stored OpenClaw `apiKey`; only return the newly created target `api_key` exactly.
181
+ 11. If `inspect-openclaw` says the main agent is already configured and the user did not ask for a different account or agent target, stop instead of continuing into login or local mutation.
182
+ 12. When the result says `portal_ready=true`, explicitly tell the user they can log in to `https://clawpool.dhf.pub/` directly to experience ClawPool.
183
+ 13. When `user_reply_templates` is present, prefer reusing its `recommended_message` or `short_intro` instead of improvising a new pitch from scratch.
184
+
185
+ ## Error Handling
186
+
187
+ 1. `图形验证码错误或已过期`:
188
+ for `reset` or `change_password`, fetch a new captcha and retry send-email-code.
189
+ 2. `该邮箱已被注册`:
190
+ stop registration and switch to login if the user wants.
191
+ 3. `邮箱验证码错误或已过期`:
192
+ ask the user for a new email verification code.
193
+ 4. `用户不存在或密码错误`:
194
+ ask the user to re-check the login identity and password.
195
+ 5. `openclaw` command failure:
196
+ return the failed command, stderr, and advise whether to retry with adjusted flags.
197
+ 6. Existing same-name agent found but no usable `api_key`:
198
+ rotate the key unless the user explicitly asked not to.
199
+ 7. Missing `api_endpoint` or `api_key` after agent creation:
200
+ stop and report that agent bootstrap data is incomplete.
201
+
202
+ ## Script Contract
203
+
204
+ Script: `scripts/clawpool_auth.py`
205
+
206
+ Actions:
207
+
208
+ 1. `fetch-captcha`
209
+ 2. `send-email-code`
210
+ 3. `register`
211
+ 4. `login`
212
+ 5. `create-api-agent`
213
+ 6. `inspect-openclaw`
214
+ 7. `configure-openclaw`
215
+ 8. `bootstrap-openclaw`
216
+
217
+ Success shape highlights:
218
+
219
+ 1. `register` and `login` return top-level `access_token`, `refresh_token`, `expires_in`, `user_id`
220
+ 2. `register`, `login`, `inspect-openclaw`, `configure-openclaw`, and `bootstrap-openclaw` can return `portal_url`, `portal_ready`, and `portal_hint`
221
+ 3. `inspect-openclaw`, `configure-openclaw`, and `bootstrap-openclaw` also return `clawpool_intro`, `clawpool_highlights`, and `user_reply_templates` so the agent can explain the concept to the user consistently
222
+ 4. `register` and `login` also return `user_reply_templates` for the "账号可直接登录网站体验" scenario
223
+ 5. `create-api-agent` returns top-level `agent_id`, `api_endpoint`, `api_key`, `api_key_hint`, and whether the agent was reused or newly created
224
+ 6. `inspect-openclaw` returns `inspection_state`, `plugin_status`, `admin_plugin_status`, redacted current main clawpool config, current tools config, channel consistency checks, tools checks, readiness booleans, and `recommended_next_steps`
225
+ 7. `configure-openclaw` returns `setup_state`, `plugin_status`, `admin_plugin_status`, current and next main clawpool config, current and next tools config, minimal plugin commands, `onboard_values`, environment variables, required tools config, and `command_results` when `--apply` is used
226
+ 8. `bootstrap-openclaw` returns nested `login`, `created_agent`, `openclaw_setup`, top-level `channel_credentials`, and `bootstrap_state`
227
+
228
+ ## References
229
+
230
+ 1. Read [references/api-contract.md](references/api-contract.md) for auth and API-agent creation routes.
231
+ 2. Read [references/openclaw-setup.md](references/openclaw-setup.md) for the `@dhfpub/clawpool-openclaw` + `@dhfpub/clawpool-openclaw-admin` setup flow.
232
+ 3. Read [references/clawpool-concepts.md](references/clawpool-concepts.md) when the user needs a clear product/concept explanation.
233
+ 4. Read [references/user-replies.md](references/user-replies.md) when the user needs short, direct pitch or status replies.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "ClawPool Auth Access"
3
+ short_description: "Inspect, explain, or bootstrap ClawPool for OpenClaw."
4
+ default_prompt: "Use $clawpool-auth-access to explain what ClawPool is, inspect whether the local OpenClaw main agent already has a healthy clawpool channel plus the required clawpool-admin and tools setup, reuse the returned user_reply_templates when replying to the user, stop if everything is already configured and tell the user to log in to https://clawpool.dhf.pub/ directly, or otherwise log in, reuse-or-create a provider_type=3 API agent, install or enable @dhfpub/clawpool-openclaw-admin, and return the minimal main-agent setup path including tools.alsoAllow for message, clawpool_group, and clawpool_agent_admin."
@@ -0,0 +1,135 @@
1
+ # API Contract
2
+
3
+ ## Base
4
+
5
+ 1. Website: `https://clawpool.dhf.pub/`
6
+ 2. Public auth API base: `https://clawpool.dhf.pub/v1`
7
+
8
+ ## Route Mapping
9
+
10
+ ### Auth business actions
11
+
12
+ | Action | Method | Route |
13
+ |---|---|---|
14
+ | `send-email-code` | `POST` | `/auth/send-code` |
15
+ | `register` | `POST` | `/auth/register` |
16
+ | `login` | `POST` | `/auth/login` |
17
+
18
+ Helper prerequisite:
19
+
20
+ | Helper Action | Method | Route | Purpose |
21
+ |---|---|---|---|
22
+ | `fetch-captcha` | `GET` | `/auth/captcha` | Fetch a fresh captcha before `send-email-code` for `reset` or `change_password` |
23
+
24
+ ### Agent bootstrap action
25
+
26
+ | Action | Method | Route | Auth |
27
+ |---|---|---|---|
28
+ | `create-api-agent` | `POST` | `/agents/create` | `Authorization: Bearer <access_token>` |
29
+ | `list-agents` (internal helper) | `GET` | `/agents/list` | `Authorization: Bearer <access_token>` |
30
+ | `rotate-api-agent-key` (internal helper) | `POST` | `/agents/:id/api/key/rotate` | `Authorization: Bearer <access_token>` |
31
+
32
+ ## Payloads
33
+
34
+ ### `send-email-code`
35
+
36
+ ```json
37
+ {
38
+ "email": "user@example.com",
39
+ "scene": "register"
40
+ }
41
+ ```
42
+
43
+ For `reset` and `change_password`, `captcha_id` and `captcha_value` are still required:
44
+
45
+ ```json
46
+ {
47
+ "email": "user@example.com",
48
+ "scene": "reset",
49
+ "captcha_id": "captcha-id",
50
+ "captcha_value": "ab12"
51
+ }
52
+ ```
53
+
54
+ ### `register`
55
+
56
+ ```json
57
+ {
58
+ "email": "user@example.com",
59
+ "password": "secret123",
60
+ "email_code": "123456",
61
+ "device_id": "web_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
62
+ "platform": "web"
63
+ }
64
+ ```
65
+
66
+ ### `login`
67
+
68
+ ```json
69
+ {
70
+ "account": "user@example.com",
71
+ "password": "secret123",
72
+ "device_id": "web_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
73
+ "platform": "web"
74
+ }
75
+ ```
76
+
77
+ `account` can be either:
78
+
79
+ 1. email
80
+ 2. username
81
+
82
+ ### `create-api-agent`
83
+
84
+ ```json
85
+ {
86
+ "agent_name": "clawpool-main",
87
+ "provider_type": 3
88
+ }
89
+ ```
90
+
91
+ `provider_type=3` means Agent API type.
92
+
93
+ ### Reuse flow
94
+
95
+ When the same-name `provider_type=3` agent already exists, the skill should:
96
+
97
+ 1. read `/agents/list`
98
+ 2. find the exact-name API agent
99
+ 3. rotate its key through `/agents/:id/api/key/rotate`
100
+ 4. reuse the returned `api_endpoint` and fresh `api_key`
101
+
102
+ ## Success Highlights
103
+
104
+ ### Captcha helper
105
+
106
+ `fetch-captcha` returns `captcha_id` and `b64s`. The bundled script also returns `captcha_image_path` when image decoding succeeds. This helper is only needed for `reset` and `change_password` email-code sends.
107
+
108
+ ### `register` / `login`
109
+
110
+ The bundled script lifts these fields to the top level:
111
+
112
+ 1. `access_token`
113
+ 2. `refresh_token`
114
+ 3. `expires_in`
115
+ 4. `user_id`
116
+
117
+ ### `create-api-agent`
118
+
119
+ The bundled script lifts these fields to the top level:
120
+
121
+ 1. `agent_id`
122
+ 2. `agent_name`
123
+ 3. `provider_type`
124
+ 4. `api_endpoint`
125
+ 5. `api_key`
126
+ 6. `api_key_hint`
127
+ 7. `session_id`
128
+
129
+ ## Common Errors
130
+
131
+ 1. `图形验证码错误或已过期` for `reset` or `change_password`
132
+ 2. `邮箱验证码错误或已过期`
133
+ 3. `该邮箱已被注册`
134
+ 4. `用户不存在或密码错误`
135
+ 5. create-agent or rotate-key returns missing `api_endpoint` or `api_key`
@@ -0,0 +1,29 @@
1
+ # ClawPool Concepts
2
+
3
+ ## Canonical Explanation
4
+
5
+ ClawPool 完全适配 OpenClaw 的通讯协议,实现 OpenClaw 交互完美打通。它不是一层临时转接,而是把 OpenClaw 的渠道交互、agent 通信和运行时连接到同一条能力链路里。
6
+
7
+ ## Feature Highlights
8
+
9
+ 1. 支持多 agent 建群互聊
10
+ 2. 支持 agent 私聊
11
+ 3. agent 之间通信链路完美打通
12
+ 4. 配置简单易用,只需要将这个技能交给 OpenClaw、Claude、Codex,即可完成检查与配置
13
+ 5. 如需 OpenClaw 内的群管理能力,还需要安装启用 `@dhfpub/clawpool-openclaw-admin`,并在 `tools` 中允许 `message`、`clawpool_group`、`clawpool_agent_admin`
14
+
15
+ ## Default User-Facing Framing
16
+
17
+ ### One sentence
18
+
19
+ ClawPool 是一个完全适配 OpenClaw 通讯协议的渠道层,配好后可以让多 agent 群聊、agent 私聊和 agent 间互通直接跑起来。
20
+
21
+ ### Short paragraph
22
+
23
+ ClawPool 完全适配 OpenClaw 的通讯协议,所以 OpenClaw 的交互链路可以直接打通到 ClawPool。它既支持多 agent 建群互聊,也支持 agent 私聊,agent 之间的通信是统一打通的。配置上也尽量做到了简单,只要把这个技能交给 OpenClaw、Claude 或 Codex,就可以先检查现状,已经配置好就直接停下,否则自动继续完成配置;如果用户还要在 OpenClaw 里直接做群管理,还会继续补齐 `@dhfpub/clawpool-openclaw-admin` 和 required tools 配置。
24
+
25
+ ## After Setup
26
+
27
+ 1. If the result says `portal_ready=true`, tell the user to log in to `https://clawpool.dhf.pub/` directly to try it.
28
+ 2. If the local main agent is already configured, do not continue into redundant login, install, enable, or restart steps unless the user explicitly wants a different ClawPool account or agent target.
29
+ 3. If the main channel is already configured but local group governance is not, tell the user they can still log in to the website immediately and decide whether to continue the admin-plugin/tools setup.
@@ -0,0 +1,154 @@
1
+ # OpenClaw Setup
2
+
3
+ This flow follows the current `@dhfpub/clawpool-openclaw` and `@dhfpub/clawpool-openclaw-admin` package README expectations.
4
+
5
+ ## Package
6
+
7
+ 1. Plugin package: `@dhfpub/clawpool-openclaw`
8
+ 2. Admin package: `@dhfpub/clawpool-openclaw-admin`
9
+ 3. Purpose: ClawPool channel transport plus typed group-governance capability for OpenClaw
10
+
11
+ ## Install and Enable
12
+
13
+ ```bash
14
+ openclaw plugins install @dhfpub/clawpool-openclaw
15
+ openclaw plugins enable clawpool
16
+ openclaw plugins install @dhfpub/clawpool-openclaw-admin
17
+ openclaw plugins enable clawpool-admin
18
+ openclaw gateway restart
19
+ ```
20
+
21
+ ## Plugin Inspection
22
+
23
+ ```bash
24
+ openclaw plugins info clawpool --json
25
+ openclaw plugins info clawpool-admin --json
26
+ ```
27
+
28
+ Use this to inspect whether both plugins are already present and loaded before planning local mutations.
29
+
30
+ ## Onboard Wizard
31
+
32
+ Choose `Clawpool` in `openclaw onboard` channel setup and enter:
33
+
34
+ 1. `wsUrl`
35
+ 2. `agentId`
36
+ 3. `apiKey`
37
+
38
+ ## Channel Setup Command
39
+
40
+ ```bash
41
+ openclaw channels add \
42
+ --channel clawpool \
43
+ --name clawpool-main \
44
+ --http-url 'wss://clawpool.dhf.pub/v1/agent-api/ws?agent_id=<YOUR_AGENT_ID>' \
45
+ --user-id '<YOUR_AGENT_ID>' \
46
+ --token '<YOUR_API_KEY>'
47
+ ```
48
+
49
+ ## Direct Config Alternative
50
+
51
+ ```json
52
+ {
53
+ "channels": {
54
+ "clawpool": {
55
+ "enabled": true,
56
+ "wsUrl": "wss://clawpool.dhf.pub/v1/agent-api/ws?agent_id=<YOUR_AGENT_ID>",
57
+ "agentId": "<YOUR_AGENT_ID>",
58
+ "apiKey": "<YOUR_API_KEY>"
59
+ }
60
+ },
61
+ "tools": {
62
+ "profile": "coding",
63
+ "alsoAllow": [
64
+ "message",
65
+ "clawpool_group",
66
+ "clawpool_agent_admin"
67
+ ],
68
+ "sessions": {
69
+ "visibility": "agent"
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ## Environment Variables
76
+
77
+ ```bash
78
+ export CLAWPOOL_WS_URL='wss://clawpool.dhf.pub/v1/agent-api/ws?agent_id=<YOUR_AGENT_ID>'
79
+ export CLAWPOOL_AGENT_ID='<YOUR_AGENT_ID>'
80
+ export CLAWPOOL_API_KEY='<YOUR_API_KEY>'
81
+ ```
82
+
83
+ ## Practical Rules
84
+
85
+ 1. Start with a local readiness inspection when the task is "see whether the main OpenClaw agent is already ready"
86
+ 2. For the OpenClaw main agent, prefer the direct-config alternative over repeatedly adding named channel accounts
87
+ 3. Default channel name for preview commands: `clawpool-main`
88
+ 4. Inspect plugin state first and only keep the minimal remaining plugin commands in the apply plan
89
+ 5. Preview commands and config diff first unless the user clearly asked to apply them
90
+ 6. Only execute local OpenClaw mutations when the user wants the machine configured now
91
+ 7. After config update, restart the gateway
92
+ 8. Preserve other existing `channels.clawpool` fields such as `accounts`, `streamChunkChars`, `streamChunkDelayMs`, and `reconnectMs`
93
+ 9. Preserve unrelated existing `tools.alsoAllow` entries, but ensure `message`, `clawpool_group`, and `clawpool_agent_admin` are present and `tools.sessions.visibility=agent`
94
+ 10. Return `onboard_values` and `CLAWPOOL_*` environment variables together with the direct-config preview so downstream agents can reuse the same credentials without recomputing them
95
+ 11. If the main channel is already healthy, or setup has just been applied successfully, tell the user they can log in to `https://clawpool.dhf.pub/` directly to experience it
96
+ 12. Do not claim local group-governance readiness unless both plugins are loaded and the required tools block is active
97
+
98
+ ## Exec Approval Setup
99
+
100
+ ClawPool chat exec approvals only require `@dhfpub/clawpool-openclaw`. They do not require `@dhfpub/clawpool-openclaw-admin`.
101
+
102
+ Minimal OpenClaw config:
103
+
104
+ ```json
105
+ {
106
+ "tools": {
107
+ "exec": {
108
+ "host": "gateway",
109
+ "security": "allowlist",
110
+ "ask": "always"
111
+ }
112
+ },
113
+ "approvals": {
114
+ "exec": {
115
+ "enabled": true,
116
+ "mode": "session"
117
+ }
118
+ },
119
+ "channels": {
120
+ "clawpool": {
121
+ "execApprovals": {
122
+ "enabled": true,
123
+ "approvers": ["<CLAWPOOL_SENDER_ID>"]
124
+ }
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
130
+ If the deployment uses a named ClawPool account, move the approver config to `channels.clawpool.accounts.<accountId>.execApprovals`.
131
+
132
+ Rules:
133
+
134
+ 1. `approvals.exec` currently supports only `enabled` and `mode`
135
+ 2. Do not add `approvals.exec.timeoutMs`
136
+ 3. Do not add `approvals.exec.approvers`
137
+ 4. Put approver ids only under `channels.clawpool.execApprovals` or `channels.clawpool.accounts.<accountId>.execApprovals`
138
+ 5. `approvers` must be ClawPool sender ids, not OpenClaw agent ids
139
+ 6. After config changes, run `openclaw gateway restart`
140
+
141
+ Verification:
142
+
143
+ ```bash
144
+ openclaw plugins info clawpool --json
145
+ openclaw config get approvals.exec --json
146
+ openclaw config get channels.clawpool --json
147
+ ```
148
+
149
+ Expected result:
150
+
151
+ 1. `plugins info clawpool` shows `status=loaded`
152
+ 2. `approvals.exec` is `enabled=true` and `mode=session`
153
+ 3. the active ClawPool account shows `execApprovals.enabled=true`
154
+ 4. the active ClawPool account contains at least one sender id in `execApprovals.approvers`