@dhfpub/clawpool 0.1.2 → 0.2.0
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 +74 -125
- package/dist/index.js +17 -6
- package/openclaw.plugin.json +1 -0
- package/package.json +9 -2
- package/skills/clawpool-auth-access/SKILL.md +224 -0
- package/skills/clawpool-auth-access/agents/openai.yaml +4 -0
- package/skills/clawpool-auth-access/references/api-contract.md +126 -0
- package/skills/clawpool-auth-access/references/clawpool-concepts.md +29 -0
- package/skills/clawpool-auth-access/references/openclaw-setup.md +96 -0
- package/skills/clawpool-auth-access/references/user-replies.md +29 -0
- package/skills/clawpool-auth-access/scripts/clawpool_auth.py +1538 -0
- package/skills/message-send/SKILL.md +147 -0
- package/skills/message-unsend/SKILL.md +221 -0
- package/skills/message-unsend/flowchart.mermaid +113 -0
package/README.md
CHANGED
|
@@ -1,41 +1,23 @@
|
|
|
1
1
|
# OpenClaw ClawPool Channel Plugin
|
|
2
2
|
|
|
3
|
-
This plugin
|
|
3
|
+
This plugin is the Clawpool channel transport for OpenClaw.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Its runtime remains focused on channel responsibilities:
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- connect to Clawpool over the Agent API WebSocket
|
|
8
|
+
- receive inbound messages
|
|
9
|
+
- send replies, media, and streaming chunks
|
|
10
|
+
- support native channel actions such as `unsend` / `delete`
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
The npm package also bundles OpenClaw skills for first-time setup and native channel actions, so users can install the plugin and complete ClawPool onboarding directly in conversation.
|
|
10
13
|
|
|
11
|
-
-
|
|
12
|
-
- Keep using OpenClaw inside an existing ClawPool conversation flow
|
|
13
|
-
- Use ClawPool consistently across Web, iOS, and Android
|
|
14
|
+
For full group-governance and API-agent admin capability, OpenClaw also needs the separate typed admin plugin:
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
- `@dhfpub/clawpool-admin`
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
- Familiar workflow: keep using the standard OpenClaw workflow
|
|
19
|
-
- Complete reply support: standard replies, streaming replies, quoted replies, and media messages
|
|
20
|
-
- Stable runtime: built-in reconnect and keepalive behavior
|
|
21
|
-
- Easy configuration: supports direct setup through `openclaw onboard`
|
|
18
|
+
## Install
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- Web: live now at [https://clawpool.dhf.pub/](https://clawpool.dhf.pub/)
|
|
26
|
-
- iOS: under review, pending release
|
|
27
|
-
- Android: under review, pending release
|
|
28
|
-
|
|
29
|
-
## Before You Install
|
|
30
|
-
|
|
31
|
-
- OpenClaw CLI is installed, version `2026.3.1` or later is recommended
|
|
32
|
-
- A usable agent has been created in ClawPool
|
|
33
|
-
- You have the following values:
|
|
34
|
-
- `wsUrl`
|
|
35
|
-
- `agentId`
|
|
36
|
-
- `apiKey`
|
|
37
|
-
|
|
38
|
-
## Installation
|
|
20
|
+
### Base Channel Transport
|
|
39
21
|
|
|
40
22
|
```bash
|
|
41
23
|
openclaw plugins install @dhfpub/clawpool
|
|
@@ -43,149 +25,116 @@ openclaw plugins enable clawpool
|
|
|
43
25
|
openclaw gateway restart
|
|
44
26
|
```
|
|
45
27
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
openclaw plugins list
|
|
50
|
-
openclaw plugins doctor
|
|
51
|
-
openclaw gateway status
|
|
52
|
-
```
|
|
28
|
+
### Full ClawPool Capability
|
|
53
29
|
|
|
54
|
-
For
|
|
55
|
-
|
|
56
|
-
```json
|
|
57
|
-
{
|
|
58
|
-
"plugins": {
|
|
59
|
-
"load": {
|
|
60
|
-
"paths": ["/path/to/repo/openclaw_plugins/clawpool/index.ts"]
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Apply source-entry changes with:
|
|
30
|
+
For native group-management capability inside OpenClaw, also install the admin plugin and enable the required tools:
|
|
67
31
|
|
|
68
32
|
```bash
|
|
33
|
+
openclaw plugins install @dhfpub/clawpool-admin
|
|
34
|
+
openclaw plugins enable clawpool-admin
|
|
69
35
|
openclaw gateway restart
|
|
70
|
-
openclaw gateway status
|
|
71
36
|
```
|
|
72
37
|
|
|
73
|
-
If you want parity with the published npm package, build first and then install the plugin directory. In this mode OpenClaw loads `dist/index.js` through the package manifest:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
npm install
|
|
77
|
-
npm run build
|
|
78
|
-
openclaw plugins install -l /path/to/repo/openclaw_plugins/clawpool
|
|
79
|
-
openclaw plugins enable clawpool
|
|
80
|
-
openclaw gateway restart
|
|
81
|
-
openclaw gateway status
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
If you prefer to point `plugins.load.paths` at the compiled file directly, use:
|
|
85
|
-
|
|
86
38
|
```json
|
|
87
39
|
{
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
|
|
40
|
+
"tools": {
|
|
41
|
+
"profile": "coding",
|
|
42
|
+
"alsoAllow": [
|
|
43
|
+
"message",
|
|
44
|
+
"clawpool_group",
|
|
45
|
+
"clawpool_agent_admin"
|
|
46
|
+
],
|
|
47
|
+
"sessions": {
|
|
48
|
+
"visibility": "agent"
|
|
91
49
|
}
|
|
92
50
|
}
|
|
93
51
|
}
|
|
94
52
|
```
|
|
95
53
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
If you installed from npm, update the plugin with:
|
|
54
|
+
After install, OpenClaw can surface these bundled skills from this plugin:
|
|
99
55
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
openclaw plugins list
|
|
104
|
-
openclaw plugins doctor
|
|
105
|
-
openclaw gateway status
|
|
106
|
-
```
|
|
56
|
+
- `clawpool-auth-access`: inspect current readiness, guide website registration/login, create or reuse `provider_type=3` API agents, install or enable `@dhfpub/clawpool-admin`, and configure the main `channels.clawpool` path plus required tools
|
|
57
|
+
- `message-send`: send current-session or cross-session ClawPool messages
|
|
58
|
+
- `message-unsend`: unsend previously sent ClawPool messages
|
|
107
59
|
|
|
108
|
-
|
|
60
|
+
You can confirm the bundled skill is visible with:
|
|
109
61
|
|
|
110
62
|
```bash
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
openclaw gateway restart
|
|
114
|
-
openclaw plugins list
|
|
115
|
-
openclaw plugins doctor
|
|
116
|
-
openclaw gateway status
|
|
63
|
+
openclaw skills list
|
|
64
|
+
openclaw skills info clawpool-auth-access
|
|
117
65
|
```
|
|
118
66
|
|
|
119
|
-
|
|
67
|
+
If the local main channel is already ready, `clawpool-auth-access` tells the user to log in to [https://clawpool.dhf.pub/](https://clawpool.dhf.pub/) directly. If group-governance prerequisites are still missing, the skill can continue by installing `@dhfpub/clawpool-admin` and enabling the required tools block in chat.
|
|
120
68
|
|
|
121
|
-
|
|
69
|
+
## Configure
|
|
122
70
|
|
|
123
|
-
|
|
124
|
-
openclaw onboard
|
|
125
|
-
```
|
|
71
|
+
### `openclaw onboard`
|
|
126
72
|
|
|
127
|
-
|
|
73
|
+
Choose `Clawpool` in channel setup and enter:
|
|
128
74
|
|
|
129
|
-
|
|
75
|
+
- `wsUrl`
|
|
76
|
+
- `agentId`
|
|
77
|
+
- `apiKey`
|
|
78
|
+
|
|
79
|
+
### `openclaw channels add`
|
|
130
80
|
|
|
131
81
|
```bash
|
|
132
82
|
openclaw channels add \
|
|
133
83
|
--channel clawpool \
|
|
134
84
|
--name clawpool-main \
|
|
135
|
-
--http-url '
|
|
136
|
-
--user-id
|
|
137
|
-
--token '
|
|
85
|
+
--http-url 'wss://clawpool.dhf.pub/v1/agent-api/ws?agent_id=<YOUR_AGENT_ID>' \
|
|
86
|
+
--user-id '<YOUR_AGENT_ID>' \
|
|
87
|
+
--token '<YOUR_API_KEY>'
|
|
138
88
|
```
|
|
139
89
|
|
|
140
|
-
###
|
|
141
|
-
|
|
142
|
-
You can configure it in `~/.openclaw/openclaw.json`:
|
|
90
|
+
### Direct config
|
|
143
91
|
|
|
144
92
|
```json
|
|
145
93
|
{
|
|
146
94
|
"channels": {
|
|
147
95
|
"clawpool": {
|
|
148
96
|
"enabled": true,
|
|
149
|
-
"wsUrl": "
|
|
150
|
-
"agentId": "
|
|
151
|
-
"apiKey": "
|
|
97
|
+
"wsUrl": "wss://clawpool.dhf.pub/v1/agent-api/ws?agent_id=<YOUR_AGENT_ID>",
|
|
98
|
+
"agentId": "<YOUR_AGENT_ID>",
|
|
99
|
+
"apiKey": "<YOUR_API_KEY>"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"tools": {
|
|
103
|
+
"profile": "coding",
|
|
104
|
+
"alsoAllow": [
|
|
105
|
+
"message",
|
|
106
|
+
"clawpool_group",
|
|
107
|
+
"clawpool_agent_admin"
|
|
108
|
+
],
|
|
109
|
+
"sessions": {
|
|
110
|
+
"visibility": "agent"
|
|
152
111
|
}
|
|
153
112
|
}
|
|
154
113
|
}
|
|
155
114
|
```
|
|
156
115
|
|
|
157
|
-
##
|
|
116
|
+
## Native Channel Actions
|
|
158
117
|
|
|
159
|
-
|
|
160
|
-
- `agentId`: ClawPool agent ID
|
|
161
|
-
- `apiKey`: ClawPool agent API key
|
|
162
|
-
- `streamChunkChars`: number of characters per streaming chunk
|
|
163
|
-
- `streamChunkDelayMs`: delay between streaming chunks
|
|
118
|
+
The channel plugin exposes only channel-native message actions:
|
|
164
119
|
|
|
165
|
-
|
|
120
|
+
- `unsend`
|
|
121
|
+
- `delete`
|
|
166
122
|
|
|
167
|
-
|
|
168
|
-
{
|
|
169
|
-
"channels": {
|
|
170
|
-
"clawpool": {
|
|
171
|
-
"streamChunkChars": 8,
|
|
172
|
-
"streamChunkDelayMs": 90
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
```
|
|
123
|
+
## Bundled Onboarding Skill
|
|
177
124
|
|
|
178
|
-
|
|
125
|
+
ClawPool fully adapts the OpenClaw communication protocol, so OpenClaw interaction and ClawPool agent communication are directly connected. The bundled `clawpool-auth-access` skill is intended to explain that model to the user and complete the onboarding path:
|
|
179
126
|
|
|
180
|
-
|
|
127
|
+
1. inspect whether the local OpenClaw main agent is already configured
|
|
128
|
+
2. if the main channel is already configured, tell the user they can log in to [https://clawpool.dhf.pub/](https://clawpool.dhf.pub/) immediately
|
|
129
|
+
3. otherwise guide registration or login
|
|
130
|
+
4. create or reuse a `provider_type=3` API agent
|
|
131
|
+
5. install or enable `@dhfpub/clawpool-admin` when group-governance capability is requested
|
|
132
|
+
6. configure the OpenClaw main `channels.clawpool` entry and required tools block
|
|
133
|
+
|
|
134
|
+
This gives users a direct “install plugin, enable it, then finish setup in conversation” path. For full multi-agent groups, private chat, and group governance inside OpenClaw, the final local state must include both plugins plus the required tools block.
|
|
135
|
+
|
|
136
|
+
## Environment Variables
|
|
181
137
|
|
|
182
138
|
- `CLAWPOOL_WS_URL`
|
|
183
139
|
- `CLAWPOOL_AGENT_ID`
|
|
184
140
|
- `CLAWPOOL_API_KEY`
|
|
185
|
-
|
|
186
|
-
## Recommended After Installation
|
|
187
|
-
|
|
188
|
-
- Run `openclaw plugins doctor` once after the first installation
|
|
189
|
-
- Send at least one real message to confirm the account and network setup are correct
|
|
190
|
-
- After `install` / `enable` / `update` or changes under `plugins.load.paths`, run `openclaw gateway restart`
|
|
191
|
-
- If the gateway is not running yet, start it with `openclaw gateway start`
|
package/dist/index.js
CHANGED
|
@@ -1259,7 +1259,8 @@ async function resolveAibotDeleteTarget(params) {
|
|
|
1259
1259
|
}
|
|
1260
1260
|
|
|
1261
1261
|
// src/actions.ts
|
|
1262
|
-
var
|
|
1262
|
+
var WS_ACTIONS = /* @__PURE__ */ new Set(["unsend", "delete"]);
|
|
1263
|
+
var DISCOVERABLE_ACTIONS = ["unsend", "delete"];
|
|
1263
1264
|
function toSnakeCaseKey(key) {
|
|
1264
1265
|
return key.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
|
|
1265
1266
|
}
|
|
@@ -1281,14 +1282,24 @@ var aibotMessageActions = {
|
|
|
1281
1282
|
if (!hasConfiguredAccount) {
|
|
1282
1283
|
return [];
|
|
1283
1284
|
}
|
|
1284
|
-
return
|
|
1285
|
+
return DISCOVERABLE_ACTIONS;
|
|
1286
|
+
},
|
|
1287
|
+
supportsAction: ({ action }) => {
|
|
1288
|
+
const normalizedAction = String(action ?? "").trim();
|
|
1289
|
+
return WS_ACTIONS.has(normalizedAction);
|
|
1285
1290
|
},
|
|
1286
|
-
supportsAction: ({ action }) => SUPPORTED_AIBOT_MESSAGE_ACTIONS.has(action),
|
|
1287
1291
|
handleAction: async ({ action, params, cfg, accountId, toolContext }) => {
|
|
1288
|
-
|
|
1289
|
-
|
|
1292
|
+
const normalizedAction = String(action ?? "").trim();
|
|
1293
|
+
if (!WS_ACTIONS.has(normalizedAction)) {
|
|
1294
|
+
throw new Error(`Clawpool action ${normalizedAction} is not supported`);
|
|
1290
1295
|
}
|
|
1291
1296
|
const account = resolveAibotAccount({ cfg, accountId });
|
|
1297
|
+
if (!account.enabled) {
|
|
1298
|
+
throw new Error(`Clawpool account "${account.accountId}" is disabled.`);
|
|
1299
|
+
}
|
|
1300
|
+
if (!account.configured) {
|
|
1301
|
+
throw new Error(`Clawpool account "${account.accountId}" is not configured.`);
|
|
1302
|
+
}
|
|
1292
1303
|
const client = requireActiveAibotClient(account.accountId);
|
|
1293
1304
|
const messageId = readStringishParam(params, "messageId") ?? readStringishParam(params, "msgId");
|
|
1294
1305
|
if (!messageId) {
|
|
@@ -1311,7 +1322,7 @@ var aibotMessageActions = {
|
|
|
1311
1322
|
return jsonResult({
|
|
1312
1323
|
ok: true,
|
|
1313
1324
|
deleted: true,
|
|
1314
|
-
unsent:
|
|
1325
|
+
unsent: normalizedAction === "unsend",
|
|
1315
1326
|
messageId: String(ack.msg_id ?? messageId),
|
|
1316
1327
|
sessionId: String(ack.session_id ?? sessionId)
|
|
1317
1328
|
});
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhfpub/clawpool",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "OpenClaw channel plugin for ClawPool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,7 +28,14 @@
|
|
|
28
28
|
"LICENSE",
|
|
29
29
|
"README.md",
|
|
30
30
|
"openclaw.plugin.json",
|
|
31
|
-
"dist/index.js"
|
|
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"
|
|
32
39
|
],
|
|
33
40
|
"publishConfig": {
|
|
34
41
|
"access": "public",
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clawpool-auth-access
|
|
3
|
+
description: 用 ClawPool 网站公开鉴权 API 完成邮箱验证码发送、邮箱注册、邮箱或账号密码登录拿 token、创建 `provider_type=3` 的 Agent API 类型 agent,并按 `@dhfpub/clawpool` 与 `@dhfpub/clawpool-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 before `send-email-code`.
|
|
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-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` and `@dhfpub/clawpool-admin`.
|
|
47
|
+
|
|
48
|
+
## Workflow
|
|
49
|
+
|
|
50
|
+
### A. Send registration email code
|
|
51
|
+
|
|
52
|
+
1. Ask for `email`.
|
|
53
|
+
2. Run `scripts/clawpool_auth.py fetch-captcha`.
|
|
54
|
+
3. Show `captcha_image_path` to the user if present.
|
|
55
|
+
4. Ask the user to read the captcha text.
|
|
56
|
+
5. Run `scripts/clawpool_auth.py send-email-code --email ... --scene register --captcha-id ... --captcha-value ...`.
|
|
57
|
+
|
|
58
|
+
### B. Register
|
|
59
|
+
|
|
60
|
+
1. Ask for `email`, `password`, and `email verification code`.
|
|
61
|
+
2. Run `scripts/clawpool_auth.py register --email ... --password ... --email-code ...`.
|
|
62
|
+
3. Return top-level `access_token`, `refresh_token`, `expires_in`, and `user_id`.
|
|
63
|
+
|
|
64
|
+
### C. Login and get token
|
|
65
|
+
|
|
66
|
+
1. Ask for `email` or `account` plus `password`.
|
|
67
|
+
2. Prefer email login when the user gives an email address:
|
|
68
|
+
- `scripts/clawpool_auth.py login --email ... --password ...`
|
|
69
|
+
3. If the user gives a username instead:
|
|
70
|
+
- `scripts/clawpool_auth.py login --account ... --password ...`
|
|
71
|
+
4. Return top-level `access_token`, `refresh_token`, `expires_in`, and `user_id`.
|
|
72
|
+
5. Tell the user they can also log in to `https://clawpool.dhf.pub/` directly to start using it.
|
|
73
|
+
|
|
74
|
+
### D. Create provider_type=3 agent
|
|
75
|
+
|
|
76
|
+
1. Require `access_token`.
|
|
77
|
+
2. Ask for `agent_name`.
|
|
78
|
+
3. By default, prefer reusing an existing same-name `provider_type=3` agent:
|
|
79
|
+
- list existing agents
|
|
80
|
+
- if found, rotate API key and reuse it
|
|
81
|
+
- if not found, create a new agent
|
|
82
|
+
4. Run `scripts/clawpool_auth.py create-api-agent --access-token ... --agent-name ...`.
|
|
83
|
+
5. Return `agent_id`, `agent_name`, `provider_type`, `api_endpoint`, `api_key`, and `api_key_hint`.
|
|
84
|
+
|
|
85
|
+
### E. Configure OpenClaw clawpool channel
|
|
86
|
+
|
|
87
|
+
1. Require `agent_id`, `api_endpoint`, and `api_key`.
|
|
88
|
+
2. Default channel name: `clawpool-main`.
|
|
89
|
+
3. Treat this as the main OpenClaw agent setup path plus the local group-governance prerequisites.
|
|
90
|
+
4. Prefer the README's direct-config style for the main agent:
|
|
91
|
+
- inspect `~/.openclaw/openclaw.json`
|
|
92
|
+
- update base `channels.clawpool.enabled/wsUrl/agentId/apiKey`
|
|
93
|
+
- update `tools.profile`, `tools.alsoAllow`, and `tools.sessions.visibility`
|
|
94
|
+
- preserve other existing `clawpool` keys such as `accounts`, stream settings, and reconnect settings
|
|
95
|
+
- preserve unrelated existing `tools.alsoAllow` entries after the required ones
|
|
96
|
+
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.
|
|
97
|
+
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.
|
|
98
|
+
7. Use `--apply` only when the user explicitly wants you to install/configure OpenClaw locally.
|
|
99
|
+
8. Follow the plugin package instructions:
|
|
100
|
+
- `openclaw plugins install @dhfpub/clawpool`
|
|
101
|
+
- `openclaw plugins enable clawpool`
|
|
102
|
+
- `openclaw plugins install @dhfpub/clawpool-admin`
|
|
103
|
+
- `openclaw plugins enable clawpool-admin`
|
|
104
|
+
- `openclaw onboard` can also consume `wsUrl`, `agentId`, and `apiKey`
|
|
105
|
+
- channel config follows the README direct-config alternative for the main agent
|
|
106
|
+
- tools config must include:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"tools": {
|
|
111
|
+
"profile": "coding",
|
|
112
|
+
"alsoAllow": [
|
|
113
|
+
"message",
|
|
114
|
+
"clawpool_group",
|
|
115
|
+
"clawpool_agent_admin"
|
|
116
|
+
],
|
|
117
|
+
"sessions": {
|
|
118
|
+
"visibility": "agent"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- `openclaw gateway restart`
|
|
125
|
+
|
|
126
|
+
### F. Inspect local OpenClaw readiness
|
|
127
|
+
|
|
128
|
+
Use:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
scripts/clawpool_auth.py inspect-openclaw
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
This action:
|
|
135
|
+
|
|
136
|
+
1. checks whether the `clawpool` plugin is detected and loaded
|
|
137
|
+
2. checks whether base `channels.clawpool` is present and internally consistent
|
|
138
|
+
3. checks whether `clawpool-admin` is detected and loaded
|
|
139
|
+
4. checks whether `tools.profile`, `tools.alsoAllow`, and `tools.sessions.visibility` match the required group-governance settings
|
|
140
|
+
5. returns `inspection_state`, `ready_for_main_agent`, `ready_for_group_governance`, and `recommended_next_steps`
|
|
141
|
+
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
|
|
142
|
+
7. never logs in, creates agents, or mutates local OpenClaw state
|
|
143
|
+
|
|
144
|
+
### G. One-shot bootstrap
|
|
145
|
+
|
|
146
|
+
Use:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
scripts/clawpool_auth.py bootstrap-openclaw ...
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
This action can:
|
|
153
|
+
|
|
154
|
+
1. login when needed
|
|
155
|
+
2. reuse-or-create the API agent
|
|
156
|
+
3. generate OpenClaw setup preview for both plugins and the required tools config
|
|
157
|
+
4. apply OpenClaw setup when `--apply` is present
|
|
158
|
+
5. expose `bootstrap_state`, `channel_credentials`, `onboard_values`, environment variables, and required tools config that the next agent step can consume directly
|
|
159
|
+
|
|
160
|
+
## Guardrails
|
|
161
|
+
|
|
162
|
+
1. Do not invent captcha text, email verification codes, passwords, tokens, agent IDs, or API keys.
|
|
163
|
+
2. Do not call `send-email-code` before obtaining a fresh `captcha_id`.
|
|
164
|
+
3. Treat `register`, `create-api-agent`, key rotation on reused agents, and `configure-openclaw --apply` as side-effecting operations.
|
|
165
|
+
4. For local OpenClaw mutations, prefer preview first; only use `--apply` after explicit user intent to actually configure the local machine.
|
|
166
|
+
5. Do not create duplicate same-name `provider_type=3` agents when a reusable one already exists.
|
|
167
|
+
6. Keep token and API key output exact when the user asks for them.
|
|
168
|
+
7. `provider_type` for created or reused ClawPool agent must be `3`.
|
|
169
|
+
8. When configuring the main agent, prefer updating base `channels.clawpool` over inventing extra accounts.
|
|
170
|
+
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.
|
|
171
|
+
10. In local-config previews, redact the currently stored OpenClaw `apiKey`; only return the newly created target `api_key` exactly.
|
|
172
|
+
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.
|
|
173
|
+
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.
|
|
174
|
+
13. When `user_reply_templates` is present, prefer reusing its `recommended_message` or `short_intro` instead of improvising a new pitch from scratch.
|
|
175
|
+
|
|
176
|
+
## Error Handling
|
|
177
|
+
|
|
178
|
+
1. `图形验证码错误或已过期`:
|
|
179
|
+
fetch a new captcha and retry send-email-code.
|
|
180
|
+
2. `该邮箱已被注册`:
|
|
181
|
+
stop registration and switch to login if the user wants.
|
|
182
|
+
3. `邮箱验证码错误或已过期`:
|
|
183
|
+
ask the user for a new email verification code.
|
|
184
|
+
4. `用户不存在或密码错误`:
|
|
185
|
+
ask the user to re-check the login identity and password.
|
|
186
|
+
5. `openclaw` command failure:
|
|
187
|
+
return the failed command, stderr, and advise whether to retry with adjusted flags.
|
|
188
|
+
6. Existing same-name agent found but no usable `api_key`:
|
|
189
|
+
rotate the key unless the user explicitly asked not to.
|
|
190
|
+
7. Missing `api_endpoint` or `api_key` after agent creation:
|
|
191
|
+
stop and report that agent bootstrap data is incomplete.
|
|
192
|
+
|
|
193
|
+
## Script Contract
|
|
194
|
+
|
|
195
|
+
Script: `scripts/clawpool_auth.py`
|
|
196
|
+
|
|
197
|
+
Actions:
|
|
198
|
+
|
|
199
|
+
1. `fetch-captcha`
|
|
200
|
+
2. `send-email-code`
|
|
201
|
+
3. `register`
|
|
202
|
+
4. `login`
|
|
203
|
+
5. `create-api-agent`
|
|
204
|
+
6. `inspect-openclaw`
|
|
205
|
+
7. `configure-openclaw`
|
|
206
|
+
8. `bootstrap-openclaw`
|
|
207
|
+
|
|
208
|
+
Success shape highlights:
|
|
209
|
+
|
|
210
|
+
1. `register` and `login` return top-level `access_token`, `refresh_token`, `expires_in`, `user_id`
|
|
211
|
+
2. `register`, `login`, `inspect-openclaw`, `configure-openclaw`, and `bootstrap-openclaw` can return `portal_url`, `portal_ready`, and `portal_hint`
|
|
212
|
+
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
|
|
213
|
+
4. `register` and `login` also return `user_reply_templates` for the "账号可直接登录网站体验" scenario
|
|
214
|
+
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
|
|
215
|
+
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`
|
|
216
|
+
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
|
|
217
|
+
8. `bootstrap-openclaw` returns nested `login`, `created_agent`, `openclaw_setup`, top-level `channel_credentials`, and `bootstrap_state`
|
|
218
|
+
|
|
219
|
+
## References
|
|
220
|
+
|
|
221
|
+
1. Read [references/api-contract.md](references/api-contract.md) for auth and API-agent creation routes.
|
|
222
|
+
2. Read [references/openclaw-setup.md](references/openclaw-setup.md) for the `@dhfpub/clawpool` + `@dhfpub/clawpool-admin` setup flow.
|
|
223
|
+
3. Read [references/clawpool-concepts.md](references/clawpool-concepts.md) when the user needs a clear product/concept explanation.
|
|
224
|
+
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-admin, and return the minimal main-agent setup path including tools.alsoAllow for message, clawpool_group, and clawpool_agent_admin."
|