@dhfpub/clawpool 0.2.0 → 0.3.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 CHANGED
@@ -15,6 +15,16 @@ For full group-governance and API-agent admin capability, OpenClaw also needs th
15
15
 
16
16
  - `@dhfpub/clawpool-admin`
17
17
 
18
+ If you are reading the admin plugin documentation first, also read:
19
+
20
+ - `openclaw_plugins/clawpool-admin/README.md`
21
+
22
+ ## Which Package Do I Need?
23
+
24
+ - Install only `@dhfpub/clawpool` when you only need ClawPool channel transport and the bundled onboarding skill
25
+ - Install both `@dhfpub/clawpool` and `@dhfpub/clawpool-admin` when you want OpenClaw agents to use typed group governance or API-agent admin tools
26
+ - Never install only `@dhfpub/clawpool-admin` without configuring `@dhfpub/clawpool` first, because the admin plugin reads credentials from `channels.clawpool`
27
+
18
28
  ## Install
19
29
 
20
30
  ### Base Channel Transport
@@ -35,6 +45,18 @@ openclaw plugins enable clawpool-admin
35
45
  openclaw gateway restart
36
46
  ```
37
47
 
48
+ Recommended order:
49
+
50
+ 1. Install and configure `@dhfpub/clawpool`
51
+ 2. Confirm `channels.clawpool` is healthy
52
+ 3. Install and enable `@dhfpub/clawpool-admin`
53
+ 4. Enable the required `tools` block
54
+ 5. Restart the OpenClaw gateway
55
+
56
+ If you need the detailed admin-side requirements, see:
57
+
58
+ - `openclaw_plugins/clawpool-admin/README.md`
59
+
38
60
  ```json
39
61
  {
40
62
  "tools": {
@@ -113,6 +135,8 @@ openclaw channels add \
113
135
  }
114
136
  ```
115
137
 
138
+ The `channels.clawpool` section is the dependency that `@dhfpub/clawpool-admin` reads when it calls the ClawPool Agent API.
139
+
116
140
  ## Native Channel Actions
117
141
 
118
142
  The channel plugin exposes only channel-native message actions:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhfpub/clawpool",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "OpenClaw channel plugin for ClawPool",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,7 +17,7 @@ Use the bundled scripts and local OpenClaw CLI to bootstrap ClawPool channel acc
17
17
  6. `configure-openclaw`
18
18
  7. `bootstrap-openclaw`
19
19
 
20
- `fetch-captcha` is only a helper step before `send-email-code`.
20
+ `fetch-captcha` is only a helper step for `reset` and `change_password` email-code sends.
21
21
 
22
22
  ## Explain ClawPool
23
23
 
@@ -49,11 +49,16 @@ If the user wants the main OpenClaw agent to gain ClawPool channel ability quick
49
49
 
50
50
  ### A. Send registration email code
51
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
+
52
57
  1. Ask for `email`.
53
58
  2. Run `scripts/clawpool_auth.py fetch-captcha`.
54
59
  3. Show `captcha_image_path` to the user if present.
55
60
  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 ...`.
61
+ 5. Run `scripts/clawpool_auth.py send-email-code --email ... --scene reset --captcha-id ... --captcha-value ...`.
57
62
 
58
63
  ### B. Register
59
64
 
@@ -160,7 +165,7 @@ This action can:
160
165
  ## Guardrails
161
166
 
162
167
  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`.
168
+ 2. Do not call `send-email-code` for `reset` or `change_password` before obtaining a fresh `captcha_id`.
164
169
  3. Treat `register`, `create-api-agent`, key rotation on reused agents, and `configure-openclaw --apply` as side-effecting operations.
165
170
  4. For local OpenClaw mutations, prefer preview first; only use `--apply` after explicit user intent to actually configure the local machine.
166
171
  5. Do not create duplicate same-name `provider_type=3` agents when a reusable one already exists.
@@ -176,7 +181,7 @@ This action can:
176
181
  ## Error Handling
177
182
 
178
183
  1. `图形验证码错误或已过期`:
179
- fetch a new captcha and retry send-email-code.
184
+ for `reset` or `change_password`, fetch a new captcha and retry send-email-code.
180
185
  2. `该邮箱已被注册`:
181
186
  stop registration and switch to login if the user wants.
182
187
  3. `邮箱验证码错误或已过期`:
@@ -19,7 +19,7 @@ Helper prerequisite:
19
19
 
20
20
  | Helper Action | Method | Route | Purpose |
21
21
  |---|---|---|---|
22
- | `fetch-captcha` | `GET` | `/auth/captcha` | Fetch a fresh captcha before `send-email-code` |
22
+ | `fetch-captcha` | `GET` | `/auth/captcha` | Fetch a fresh captcha before `send-email-code` for `reset` or `change_password` |
23
23
 
24
24
  ### Agent bootstrap action
25
25
 
@@ -36,7 +36,16 @@ Helper prerequisite:
36
36
  ```json
37
37
  {
38
38
  "email": "user@example.com",
39
- "scene": "register",
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",
40
49
  "captcha_id": "captcha-id",
41
50
  "captcha_value": "ab12"
42
51
  }
@@ -94,7 +103,7 @@ When the same-name `provider_type=3` agent already exists, the skill should:
94
103
 
95
104
  ### Captcha helper
96
105
 
97
- `fetch-captcha` returns `captcha_id` and `b64s`. The bundled script also returns `captcha_image_path` when image decoding succeeds.
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.
98
107
 
99
108
  ### `register` / `login`
100
109
 
@@ -119,7 +128,7 @@ The bundled script lifts these fields to the top level:
119
128
 
120
129
  ## Common Errors
121
130
 
122
- 1. `图形验证码错误或已过期`
131
+ 1. `图形验证码错误或已过期` for `reset` or `change_password`
123
132
  2. `邮箱验证码错误或已过期`
124
133
  3. `该邮箱已被注册`
125
134
  4. `用户不存在或密码错误`
@@ -1231,16 +1231,28 @@ def handle_fetch_captcha(args):
1231
1231
 
1232
1232
 
1233
1233
  def handle_send_email_code(args):
1234
+ scene = args.scene.strip()
1235
+ payload = {
1236
+ "email": args.email.strip(),
1237
+ "scene": scene,
1238
+ }
1239
+ captcha_id = (args.captcha_id or "").strip()
1240
+ captcha_value = (args.captcha_value or "").strip()
1241
+ if scene in {"reset", "change_password"}:
1242
+ if not captcha_id or not captcha_value:
1243
+ raise ClawpoolAuthError(
1244
+ "captcha_id and captcha_value are required for reset/change_password"
1245
+ )
1246
+ if captcha_id:
1247
+ payload["captcha_id"] = captcha_id
1248
+ if captcha_value:
1249
+ payload["captcha_value"] = captcha_value
1250
+
1234
1251
  result = request_json(
1235
1252
  "POST",
1236
1253
  "/auth/send-code",
1237
1254
  args.base_url,
1238
- body={
1239
- "email": args.email.strip(),
1240
- "scene": args.scene.strip(),
1241
- "captcha_id": args.captcha_id.strip(),
1242
- "captcha_value": args.captcha_value.strip(),
1243
- },
1255
+ body=payload,
1244
1256
  )
1245
1257
  print_json(
1246
1258
  {
@@ -1409,8 +1421,8 @@ def build_parser():
1409
1421
  send_email_code = subparsers.add_parser("send-email-code", help="Send email verification code")
1410
1422
  send_email_code.add_argument("--email", required=True)
1411
1423
  send_email_code.add_argument("--scene", required=True, choices=["register", "reset", "change_password"])
1412
- send_email_code.add_argument("--captcha-id", required=True)
1413
- send_email_code.add_argument("--captcha-value", required=True)
1424
+ send_email_code.add_argument("--captcha-id", default="")
1425
+ send_email_code.add_argument("--captcha-value", default="")
1414
1426
  send_email_code.set_defaults(handler=handle_send_email_code)
1415
1427
 
1416
1428
  register = subparsers.add_parser("register", help="Register by email verification code")