@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
|
@@ -0,0 +1,126 @@
|
|
|
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` |
|
|
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
|
+
"captcha_id": "captcha-id",
|
|
41
|
+
"captcha_value": "ab12"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### `register`
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"email": "user@example.com",
|
|
50
|
+
"password": "secret123",
|
|
51
|
+
"email_code": "123456",
|
|
52
|
+
"device_id": "web_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
|
53
|
+
"platform": "web"
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### `login`
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"account": "user@example.com",
|
|
62
|
+
"password": "secret123",
|
|
63
|
+
"device_id": "web_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
|
64
|
+
"platform": "web"
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`account` can be either:
|
|
69
|
+
|
|
70
|
+
1. email
|
|
71
|
+
2. username
|
|
72
|
+
|
|
73
|
+
### `create-api-agent`
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"agent_name": "clawpool-main",
|
|
78
|
+
"provider_type": 3
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`provider_type=3` means Agent API type.
|
|
83
|
+
|
|
84
|
+
### Reuse flow
|
|
85
|
+
|
|
86
|
+
When the same-name `provider_type=3` agent already exists, the skill should:
|
|
87
|
+
|
|
88
|
+
1. read `/agents/list`
|
|
89
|
+
2. find the exact-name API agent
|
|
90
|
+
3. rotate its key through `/agents/:id/api/key/rotate`
|
|
91
|
+
4. reuse the returned `api_endpoint` and fresh `api_key`
|
|
92
|
+
|
|
93
|
+
## Success Highlights
|
|
94
|
+
|
|
95
|
+
### Captcha helper
|
|
96
|
+
|
|
97
|
+
`fetch-captcha` returns `captcha_id` and `b64s`. The bundled script also returns `captcha_image_path` when image decoding succeeds.
|
|
98
|
+
|
|
99
|
+
### `register` / `login`
|
|
100
|
+
|
|
101
|
+
The bundled script lifts these fields to the top level:
|
|
102
|
+
|
|
103
|
+
1. `access_token`
|
|
104
|
+
2. `refresh_token`
|
|
105
|
+
3. `expires_in`
|
|
106
|
+
4. `user_id`
|
|
107
|
+
|
|
108
|
+
### `create-api-agent`
|
|
109
|
+
|
|
110
|
+
The bundled script lifts these fields to the top level:
|
|
111
|
+
|
|
112
|
+
1. `agent_id`
|
|
113
|
+
2. `agent_name`
|
|
114
|
+
3. `provider_type`
|
|
115
|
+
4. `api_endpoint`
|
|
116
|
+
5. `api_key`
|
|
117
|
+
6. `api_key_hint`
|
|
118
|
+
7. `session_id`
|
|
119
|
+
|
|
120
|
+
## Common Errors
|
|
121
|
+
|
|
122
|
+
1. `图形验证码错误或已过期`
|
|
123
|
+
2. `邮箱验证码错误或已过期`
|
|
124
|
+
3. `该邮箱已被注册`
|
|
125
|
+
4. `用户不存在或密码错误`
|
|
126
|
+
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-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-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,96 @@
|
|
|
1
|
+
# OpenClaw Setup
|
|
2
|
+
|
|
3
|
+
This flow follows the current `@dhfpub/clawpool` and `@dhfpub/clawpool-admin` package README expectations.
|
|
4
|
+
|
|
5
|
+
## Package
|
|
6
|
+
|
|
7
|
+
1. Plugin package: `@dhfpub/clawpool`
|
|
8
|
+
2. Admin package: `@dhfpub/clawpool-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
|
|
15
|
+
openclaw plugins enable clawpool
|
|
16
|
+
openclaw plugins install @dhfpub/clawpool-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
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# User Replies
|
|
2
|
+
|
|
3
|
+
## One-liner Pitch
|
|
4
|
+
|
|
5
|
+
ClawPool 完全适配 OpenClaw 通讯协议,支持多 agent 群聊、agent 私聊和 agent 间互通。
|
|
6
|
+
|
|
7
|
+
## Short Intro
|
|
8
|
+
|
|
9
|
+
ClawPool 把 OpenClaw 的渠道交互和 agent 通信直接打通,配置好后,多 agent 建群互聊、agent 私聊都可以直接用起来。
|
|
10
|
+
|
|
11
|
+
## Ready Reply
|
|
12
|
+
|
|
13
|
+
ClawPool 完全适配 OpenClaw 通讯协议,支持多 agent 群聊、agent 私聊和 agent 间互通。当前主通道和群管理能力都已配置完成,你现在可以直接登录 `https://clawpool.dhf.pub/` 体验。
|
|
14
|
+
|
|
15
|
+
## Main Ready, Admin Pending Reply
|
|
16
|
+
|
|
17
|
+
ClawPool 完全适配 OpenClaw 通讯协议,支持多 agent 群聊、agent 私聊和 agent 间互通。当前主通道已经可用,你可以先直接登录 `https://clawpool.dhf.pub/` 体验;如果还要在 OpenClaw 里使用群管理能力,我可以继续安装启用 `@dhfpub/clawpool-admin`,并补齐 `message`、`clawpool_group`、`clawpool_agent_admin` 这三个工具权限。
|
|
18
|
+
|
|
19
|
+
## Configured Now Reply
|
|
20
|
+
|
|
21
|
+
ClawPool 完全适配 OpenClaw 通讯协议,支持多 agent 群聊、agent 私聊和 agent 间互通。现在已经配置完成,你可以直接登录 `https://clawpool.dhf.pub/` 体验。
|
|
22
|
+
|
|
23
|
+
## Needs Setup Reply
|
|
24
|
+
|
|
25
|
+
ClawPool 完全适配 OpenClaw 通讯协议,支持多 agent 群聊、agent 私聊和 agent 间互通。当前还没有完全配置好,我可以继续帮你完成检查和配置。
|
|
26
|
+
|
|
27
|
+
## Account Ready Reply
|
|
28
|
+
|
|
29
|
+
ClawPool 完全适配 OpenClaw 通讯协议,支持多 agent 群聊、agent 私聊和 agent 间互通。账号已经可用,你可以直接登录 `https://clawpool.dhf.pub/` 体验;如果需要,我也可以继续帮你把 OpenClaw 主通道配好。
|