@dhf-openclaw/grix 0.4.8 → 0.4.9
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 +4 -20
- package/package.json +1 -6
- package/skills/egg-install/SKILL.md +0 -149
- package/skills/grix-auth-access/SKILL.md +0 -173
- package/skills/grix-auth-access/agents/openai.yaml +0 -4
- package/skills/grix-auth-access/references/api-contract.md +0 -56
- package/skills/grix-auth-access/references/grix-concepts.md +0 -30
- package/skills/grix-auth-access/references/openclaw-setup.md +0 -154
- package/skills/grix-auth-access/references/user-replies.md +0 -25
- package/skills/grix-auth-access/scripts/grix_auth.py +0 -1527
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Its runtime remains focused on channel responsibilities:
|
|
|
13
13
|
- send replies, media, and streaming chunks
|
|
14
14
|
- support native channel actions such as `unsend` / `delete`
|
|
15
15
|
|
|
16
|
-
The npm package also bundles OpenClaw skills for
|
|
16
|
+
The npm package also bundles OpenClaw skills for channel helpers and native channel actions.
|
|
17
17
|
|
|
18
18
|
For full group-governance and API-agent admin capability, OpenClaw also needs the separate typed admin plugin:
|
|
19
19
|
|
|
@@ -23,7 +23,7 @@ If you are reading the admin plugin documentation first, also read the companion
|
|
|
23
23
|
|
|
24
24
|
## Which Package Do I Need?
|
|
25
25
|
|
|
26
|
-
- Install only `@dhf-openclaw/grix` when you only need Grix channel transport and
|
|
26
|
+
- Install only `@dhf-openclaw/grix` when you only need Grix channel transport and bundled helper skills
|
|
27
27
|
- Install both `@dhf-openclaw/grix` and `@dhf-openclaw/grix-admin` when you want OpenClaw agents to use typed group governance or API-agent admin tools
|
|
28
28
|
- Never install only `@dhf-openclaw/grix-admin` without configuring `@dhf-openclaw/grix` first, because the admin plugin reads credentials from `channels.grix`
|
|
29
29
|
|
|
@@ -91,20 +91,17 @@ If you need the detailed admin-side requirements, see the companion Grix admin p
|
|
|
91
91
|
|
|
92
92
|
After install, OpenClaw can surface these bundled skills from this plugin:
|
|
93
93
|
|
|
94
|
-
- `grix-auth-access`: inspect current readiness, follow the protocol-based main-agent path, create or reuse `provider_type=3` API agents when an access token is already available, install or enable `@dhf-openclaw/grix-admin`, and configure the main `channels.grix` path plus required tools
|
|
95
|
-
- `egg-install`: handle Shrimp Pond egg install chats, confirm targets with the user in the current private conversation, execute persona.zip or skill.zip installation with正规步骤, and report progress or failures in normal dialogue
|
|
96
94
|
- `message-send`: send current-session or cross-session Grix messages
|
|
97
95
|
- `message-unsend`: unsend previously sent Grix messages
|
|
98
96
|
|
|
97
|
+
`egg-install` is bundled in `@dhf-openclaw/grix-admin` so install the admin plugin when you need Shrimp Pond install workflow.
|
|
98
|
+
|
|
99
99
|
You can confirm the bundled skill is visible with:
|
|
100
100
|
|
|
101
101
|
```bash
|
|
102
102
|
openclaw skills list
|
|
103
|
-
openclaw skills info grix-auth-access
|
|
104
103
|
```
|
|
105
104
|
|
|
106
|
-
If the local main channel is already ready, `grix-auth-access` tells the user to log in to [https://grix.dhf.pub/](https://grix.dhf.pub/) directly. If group-governance prerequisites are still missing, the skill can continue by installing `@dhf-openclaw/grix-admin` and enabling the required tools block in chat.
|
|
107
|
-
|
|
108
105
|
## Configure
|
|
109
106
|
|
|
110
107
|
### `openclaw onboard`
|
|
@@ -296,19 +293,6 @@ The channel plugin exposes only channel-native message actions:
|
|
|
296
293
|
- `unsend`
|
|
297
294
|
- `delete`
|
|
298
295
|
|
|
299
|
-
## Bundled Onboarding Skill
|
|
300
|
-
|
|
301
|
-
Grix fully adapts the OpenClaw communication protocol, so OpenClaw interaction and Grix agent communication are directly connected. The bundled `grix-auth-access` skill is intended to explain that model to the user and complete the onboarding path:
|
|
302
|
-
|
|
303
|
-
1. inspect whether the local OpenClaw main agent is already configured
|
|
304
|
-
2. if the main channel is already configured, tell the user they can log in to [https://grix.dhf.pub/](https://grix.dhf.pub/) immediately
|
|
305
|
-
3. otherwise continue with the protocol-based agent setup path
|
|
306
|
-
4. create or reuse a `provider_type=3` API agent
|
|
307
|
-
5. install or enable `@dhf-openclaw/grix-admin` when group-governance capability is requested
|
|
308
|
-
6. configure the OpenClaw main `channels.grix` entry and required tools block
|
|
309
|
-
|
|
310
|
-
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.
|
|
311
|
-
|
|
312
296
|
## Environment Variables
|
|
313
297
|
|
|
314
298
|
- `GRIX_WS_URL`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhf-openclaw/grix",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "Connect OpenClaw to grix.dhf.pub for OpenClaw website management with mobile PWA support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,11 +28,6 @@
|
|
|
28
28
|
"README.md",
|
|
29
29
|
"openclaw.plugin.json",
|
|
30
30
|
"dist/index.js",
|
|
31
|
-
"skills/grix-auth-access/SKILL.md",
|
|
32
|
-
"skills/grix-auth-access/agents/openai.yaml",
|
|
33
|
-
"skills/grix-auth-access/references",
|
|
34
|
-
"skills/grix-auth-access/scripts/grix_auth.py",
|
|
35
|
-
"skills/egg-install/SKILL.md",
|
|
36
31
|
"skills/message-send/SKILL.md",
|
|
37
32
|
"skills/message-unsend/SKILL.md",
|
|
38
33
|
"skills/message-unsend/flowchart.mermaid"
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: egg-install
|
|
3
|
-
description: 在虾塘触发的安装私聊中处理 egg 安装。适用于主 OpenClaw agent 收到包含 install_id、egg、install、main_agent 的安装上下文时,负责与用户多轮确认、执行 persona.zip 到 OpenClaw agent 或 skill.zip 到 Claude agent 的正规安装流程,并在当前私聊里持续回报进度、失败原因和最终结果。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Egg Install
|
|
7
|
-
|
|
8
|
-
仅在"虾塘发起的安装私聊"里使用这个技能。
|
|
9
|
-
|
|
10
|
-
这类会话通常会先收到一条系统代发的安装请求,正文里会带一个 JSON 上下文块,至少包含:
|
|
11
|
-
|
|
12
|
-
- `install_id` — 安装单唯一 ID,所有状态指令必须使用原值
|
|
13
|
-
- `egg` — egg 包标识,格式为 `<name>@<version>` 或带完整下载 URL 的对象
|
|
14
|
-
- `install` — 安装模式,枚举值:`create_new`(新建目标 agent)或 `existing_agent`(安装到已有 agent)
|
|
15
|
-
- `main_agent` — 发起安装的主 OpenClaw agent ID,安装完成后如需通知或回调,使用该 ID
|
|
16
|
-
|
|
17
|
-
你的职责不是返回隐藏协议结果,而是直接在当前私聊里把安装流程做完。
|
|
18
|
-
|
|
19
|
-
## 工作方式
|
|
20
|
-
|
|
21
|
-
1. 先读完整个 JSON 上下文,确认 egg、版本、安装模式和目标类型。
|
|
22
|
-
2. 在真正动手前,先在当前私聊里和用户确认关键目标。
|
|
23
|
-
3. `create_new` 时,先确认新 agent 的命名和用途,再继续创建。
|
|
24
|
-
4. `existing_agent` 时,只能操作上下文里指定的目标 agent,不要私自换目标。
|
|
25
|
-
5. 安装过程中,每完成一个关键动作就用自然语言回报一次进度。
|
|
26
|
-
6. 在"包下载完成"和"安装内容落位完成待校验"两个节点,各额外发送一条 `status=running` 的**独立安装状态指令消息**。
|
|
27
|
-
7. 最终成功或失败时,必须发送一条 `status=success` 或 `status=failed` 的**独立安装状态指令消息**。
|
|
28
|
-
8. 出错时,直接说明失败点、影响和下一步建议,不要模糊带过。
|
|
29
|
-
9. 最终明确告诉用户:装到了哪个 agent、结果成功还是失败、后续是否还要继续操作。
|
|
30
|
-
|
|
31
|
-
## 绝对规则
|
|
32
|
-
|
|
33
|
-
- 只在当前私聊里沟通,不要切换到隐藏协议,不要输出机器专用 JSON。
|
|
34
|
-
- 必须按 OpenClaw / Claude 的正规步骤安装,不要直接改后端数据库。
|
|
35
|
-
- 需要创建远端 API agent 时,使用 `grix_agent_admin`。
|
|
36
|
-
- `persona.zip` 只能面向 OpenClaw 目标。
|
|
37
|
-
- `skill.zip` 只能面向 Claude 目标。
|
|
38
|
-
- 不要自动新建 Claude 目标 agent。
|
|
39
|
-
- 没完成校验前,绝不能宣称安装成功。
|
|
40
|
-
- 如果新建目标后又失败了,能安全回滚就先回滚;不能回滚就如实告诉用户当前残留状态。
|
|
41
|
-
- 最终成功或失败时,必须发送一条独立的 `egg-install-status` 指令消息。
|
|
42
|
-
- 状态指令消息必须单独发送,不要和自然语言解释混在同一条里。
|
|
43
|
-
- 用户拒绝确认或主动取消时,必须发送 `status=failed`、`error_code=user_cancelled` 的状态指令后再结束。
|
|
44
|
-
|
|
45
|
-
## 安装状态指令
|
|
46
|
-
|
|
47
|
-
server 不会猜自然语言。要让安装单进入"进行中 / 成功 / 失败",你必须发送这类单行消息:
|
|
48
|
-
|
|
49
|
-
```text
|
|
50
|
-
[[egg-install-status|install_id=<INSTALL_ID>|status=<running|success|failed>|step=<STEP>|summary=<URI_ENCODED_SUMMARY>]]
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
常用可选字段:
|
|
54
|
-
|
|
55
|
-
- `target_agent_id=<AGENT_ID>`:成功时尽量带上,尤其是 `create_new`。
|
|
56
|
-
- `detail_text=<URI_ENCODED_DETAIL>`:补充更长说明。
|
|
57
|
-
- `error_code=<ERROR_CODE>`:失败时建议带上。
|
|
58
|
-
- `error_msg=<URI_ENCODED_ERROR_MSG>`:失败时建议带上。
|
|
59
|
-
|
|
60
|
-
规则:
|
|
61
|
-
|
|
62
|
-
1. `install_id` 必须使用上下文里的原值。
|
|
63
|
-
2. `status` 只能是 `running`、`success`、`failed`。
|
|
64
|
-
3. `summary`、`detail_text`、`error_msg` 如果有空格、中文或特殊字符,按 URI component 编码。
|
|
65
|
-
4. 这条指令只负责状态收口;如果要跟用户解释原因,另发一条正常文字消息。
|
|
66
|
-
5. `create_new` 成功时,必须尽量带 `target_agent_id`,否则 server 可能无法通过最终校验。
|
|
67
|
-
|
|
68
|
-
## 推荐流程
|
|
69
|
-
|
|
70
|
-
### `persona.zip` -> OpenClaw
|
|
71
|
-
|
|
72
|
-
1. 读取上下文,确认是 `create_new` 还是 `existing_agent`。
|
|
73
|
-
2. 和用户确认目标 agent 或新 agent 命名;**用户拒绝则发 `failed/user_cancelled` 指令后结束**。
|
|
74
|
-
3. 如果需要新建远端 API agent,用 `grix_agent_admin` 创建。
|
|
75
|
-
4. 用 OpenClaw 正规步骤准备本地目标目录和配置。
|
|
76
|
-
5. 下载 egg 包,并校验 hash / manifest(如果上下文提供)。
|
|
77
|
-
6. 发送 `status=running`、`step=downloaded` 状态指令。
|
|
78
|
-
7. 安装 persona 内容。
|
|
79
|
-
8. 发送 `status=running`、`step=installed` 状态指令。
|
|
80
|
-
9. 按需刷新或重启本地运行时。
|
|
81
|
-
10. 校验目标 agent 仍然可用。
|
|
82
|
-
- 校验失败 → 尝试回滚(含步骤3新建的远端 agent),无法回滚则如实告知残留状态 → 发 `failed` 指令后结束。
|
|
83
|
-
11. 发送 `status=success` 状态指令(带 `target_agent_id`),再向用户汇报完成。
|
|
84
|
-
|
|
85
|
-
### `skill.zip` -> Claude
|
|
86
|
-
|
|
87
|
-
1. 确认上下文指定的 Claude 目标 agent 存在;**不存在则发 `failed/target_not_found` 指令后结束**。
|
|
88
|
-
2. 和用户确认目标 agent;**用户拒绝则发 `failed/user_cancelled` 指令后结束**。
|
|
89
|
-
3. 下载 skill 包,并校验 hash / manifest(如果上下文提供)。
|
|
90
|
-
4. 发送 `status=running`、`step=downloaded` 状态指令。
|
|
91
|
-
5. 用 Claude 正规步骤安装 skill 包。
|
|
92
|
-
6. 发送 `status=running`、`step=installed` 状态指令。
|
|
93
|
-
7. 按需刷新配置或重载运行时。
|
|
94
|
-
8. 校验目标 agent 仍然可用。
|
|
95
|
-
- 校验失败 → 如实告知用户 → 发 `failed` 指令后结束。
|
|
96
|
-
9. 发送 `status=success` 状态指令(带 `target_agent_id`),再向用户汇报完成。
|
|
97
|
-
|
|
98
|
-
## 每次安装至少校验这些点
|
|
99
|
-
|
|
100
|
-
- 目标 agent 选对了
|
|
101
|
-
- 包已成功下载
|
|
102
|
-
- hash / manifest 校验通过(如果提供)
|
|
103
|
-
- 安装内容已经落到目标位置
|
|
104
|
-
- 目标 agent 安装后仍然可用
|
|
105
|
-
|
|
106
|
-
## 指令示例
|
|
107
|
-
|
|
108
|
-
进行中(下载完成):
|
|
109
|
-
|
|
110
|
-
```text
|
|
111
|
-
[[egg-install-status|install_id=eggins_20370001|status=running|step=downloaded|summary=%E5%B7%B2%E4%B8%8B%E8%BD%BD%E5%B9%B6%E9%AA%8C%E8%AF%81%E5%AE%89%E8%A3%85%E5%8C%85]]
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
进行中(安装落位完成):
|
|
115
|
-
|
|
116
|
-
```text
|
|
117
|
-
[[egg-install-status|install_id=eggins_20370001|status=running|step=installed|summary=%E5%AE%89%E8%A3%85%E5%86%85%E5%AE%B9%E5%B7%B2%E8%90%BD%E4%BD%8D%EF%BC%8C%E6%A0%A1%E9%AA%8C%E4%B8%AD]]
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
成功:
|
|
121
|
-
|
|
122
|
-
```text
|
|
123
|
-
[[egg-install-status|install_id=eggins_20370001|status=success|step=completed|target_agent_id=2035123456789012345|summary=%E5%B7%B2%E5%AE%8C%E6%88%90%E5%AE%89%E8%A3%85]]
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
失败(用户取消):
|
|
127
|
-
|
|
128
|
-
```text
|
|
129
|
-
[[egg-install-status|install_id=eggins_20370001|status=failed|step=user_cancelled|error_code=user_cancelled|summary=%E7%94%A8%E6%88%B7%E5%8F%96%E6%B6%88%E5%AE%89%E8%A3%85]]
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
失败(目标不存在):
|
|
133
|
-
|
|
134
|
-
```text
|
|
135
|
-
[[egg-install-status|install_id=eggins_20370001|status=failed|step=target_not_found|error_code=target_not_found|error_msg=%E6%8C%87%E5%AE%9A%E7%9A%84%20Claude%20agent%20%E4%B8%8D%E5%AD%98%E5%9C%A8|summary=%E5%AE%89%E8%A3%85%E5%A4%B1%E8%B4%A5]]
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
失败(下载失败):
|
|
139
|
-
|
|
140
|
-
```text
|
|
141
|
-
[[egg-install-status|install_id=eggins_20370001|status=failed|step=download_failed|error_code=download_failed|error_msg=%E4%B8%8B%E8%BD%BD%E5%AE%89%E8%A3%85%E5%8C%85%E5%A4%B1%E8%B4%A5|summary=%E5%AE%89%E8%A3%85%E5%A4%B1%E8%B4%A5]]
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## 回复风格
|
|
145
|
-
|
|
146
|
-
- 用正常对话回复用户
|
|
147
|
-
- 进度回报要短、明确、可执行
|
|
148
|
-
- 失败说明要具体
|
|
149
|
-
- 最终总结必须包含目标 agent 和安装结果
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: grix-auth-access
|
|
3
|
-
description: 用 Grix 协议创建或复用 `provider_type=3` 的 Agent API 类型 agent,并按 `@dhf-openclaw/grix` 与 `@dhf-openclaw/grix-admin` 说明为 OpenClaw 主 agent 配置 grix 渠道和群管理能力。插件接入目标是让用户在 `https://grix.dhf.pub/` 管理 OpenClaw,并支持移动端 PWA 页面。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Grix Auth Access
|
|
7
|
-
|
|
8
|
-
Use the bundled scripts and local OpenClaw CLI to bootstrap Grix channel access for the main OpenClaw agent.
|
|
9
|
-
|
|
10
|
-
## Business Capabilities
|
|
11
|
-
|
|
12
|
-
1. `create-api-agent`
|
|
13
|
-
2. `inspect@dhf-openclaw`
|
|
14
|
-
3. `configure@dhf-openclaw`
|
|
15
|
-
4. `bootstrap@dhf-openclaw`
|
|
16
|
-
|
|
17
|
-
## Explain Grix
|
|
18
|
-
|
|
19
|
-
When the user asks what Grix is, what they gain after setup, or whether it is worth configuring, explain it with these points:
|
|
20
|
-
|
|
21
|
-
1. Start by saying this plugin is connected so the user can manage OpenClaw on `https://grix.dhf.pub/`, with mobile PWA page support.
|
|
22
|
-
2. Grix fully adapts the OpenClaw communication protocol, so OpenClaw interaction and channel transport are natively connected.
|
|
23
|
-
3. It supports multi-agent group chat, agent private chat, and agent-to-agent communication in one connected path.
|
|
24
|
-
4. 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 `@dhf-openclaw/grix-admin` and the required tools block.
|
|
25
|
-
5. If the result says `portal_ready=true`, tell the user they can log in to `https://grix.dhf.pub/` directly and start using it.
|
|
26
|
-
6. Prefer the returned `user_reply_templates.recommended_message` when you want a concise user-facing answer.
|
|
27
|
-
|
|
28
|
-
## Fast Path
|
|
29
|
-
|
|
30
|
-
If the user wants the main OpenClaw agent to gain Grix channel ability quickly:
|
|
31
|
-
|
|
32
|
-
1. If the request is first to verify whether the local machine is already ready, run `inspect@dhf-openclaw` before any local mutation.
|
|
33
|
-
2. If `inspect@dhf-openclaw` returns `inspection_state=already_configured` and the user did not ask to bind a different Grix account or agent, stop there and tell the user to log in to `https://grix.dhf.pub/` directly.
|
|
34
|
-
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.
|
|
35
|
-
4. Otherwise prefer `bootstrap@dhf-openclaw`.
|
|
36
|
-
5. Reuse an existing same-name `provider_type=3` agent when possible; rotate its API key to get a fresh usable `api_key`.
|
|
37
|
-
6. If no matching API agent exists, create one.
|
|
38
|
-
7. Inspect local OpenClaw plugin state, main `channels.grix` target state, `grix-admin` state, and `tools` state before planning any local mutation.
|
|
39
|
-
8. Return the smallest necessary OpenClaw apply plan, plus `onboard_values`, environment variables, and the required `tools` block.
|
|
40
|
-
9. Prepare or apply the OpenClaw plugin setup using both `@dhf-openclaw/grix` and `@dhf-openclaw/grix-admin`.
|
|
41
|
-
|
|
42
|
-
## Workflow
|
|
43
|
-
|
|
44
|
-
### A. Create provider_type=3 agent
|
|
45
|
-
|
|
46
|
-
1. Start from the Grix protocol access path and use the provided `access_token`.
|
|
47
|
-
2. Ask for `agent_name`.
|
|
48
|
-
3. By default, prefer reusing an existing same-name `provider_type=3` agent:
|
|
49
|
-
- list existing agents
|
|
50
|
-
- if found, rotate API key and reuse it
|
|
51
|
-
- if not found, create a new agent
|
|
52
|
-
4. Run `scripts/grix_auth.py create-api-agent --access-token ... --agent-name ...`.
|
|
53
|
-
5. Return `agent_id`, `agent_name`, `provider_type`, `api_endpoint`, `api_key`, and `api_key_hint`.
|
|
54
|
-
|
|
55
|
-
### B. Configure OpenClaw grix channel
|
|
56
|
-
|
|
57
|
-
1. Require `agent_id`, `api_endpoint`, and `api_key`.
|
|
58
|
-
2. Default channel name: `grix-main`.
|
|
59
|
-
3. Treat this as the main OpenClaw agent setup path plus the local group-governance prerequisites.
|
|
60
|
-
4. Prefer the README's direct-config style for the main agent:
|
|
61
|
-
- inspect `~/.openclaw/openclaw.json`
|
|
62
|
-
- update base `channels.grix.enabled/wsUrl/agentId/apiKey`
|
|
63
|
-
- when the user explicitly wants Grix chat exec approvals, also update `tools.exec`, `approvals.exec`, and `channels.grix.*.execApprovals`
|
|
64
|
-
- update `tools.profile`, `tools.alsoAllow`, and `tools.sessions.visibility`
|
|
65
|
-
- preserve other existing `grix` keys such as `accounts`, stream settings, and reconnect settings
|
|
66
|
-
- preserve unrelated existing `tools.alsoAllow` entries after the required ones
|
|
67
|
-
5. Inspect plugin state through `openclaw plugins info grix --json` and `openclaw plugins info grix-admin --json`; only include the minimal plugin commands still needed.
|
|
68
|
-
6. Use `scripts/grix_auth.py configure@dhf-openclaw ...` first without `--apply` to preview commands, setup state, and config diff when the user has not explicitly requested local mutation.
|
|
69
|
-
7. Use `--apply` only when the user explicitly wants you to install/configure OpenClaw locally.
|
|
70
|
-
8. Follow the plugin package instructions:
|
|
71
|
-
- `openclaw plugins install @dhf-openclaw/grix`
|
|
72
|
-
- `openclaw plugins enable grix`
|
|
73
|
-
- `openclaw plugins install @dhf-openclaw/grix-admin`
|
|
74
|
-
- `openclaw plugins enable grix-admin`
|
|
75
|
-
- `openclaw onboard` can also consume `wsUrl`, `agentId`, and `apiKey`
|
|
76
|
-
- channel config follows the README direct-config alternative for the main agent
|
|
77
|
-
- exec approval config follows the README `Exec Approvals` section when the user wants approvals in Grix chat
|
|
78
|
-
- only place approver ids under `channels.grix.execApprovals` or `channels.grix.accounts.<accountId>.execApprovals`
|
|
79
|
-
- never invent unsupported keys such as `approvals.exec.timeoutMs` or `approvals.exec.approvers`
|
|
80
|
-
- tools config must include:
|
|
81
|
-
|
|
82
|
-
```json
|
|
83
|
-
{
|
|
84
|
-
"tools": {
|
|
85
|
-
"profile": "coding",
|
|
86
|
-
"alsoAllow": [
|
|
87
|
-
"message",
|
|
88
|
-
"grix_group",
|
|
89
|
-
"grix_agent_admin"
|
|
90
|
-
],
|
|
91
|
-
"sessions": {
|
|
92
|
-
"visibility": "agent"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
- `openclaw gateway restart`
|
|
99
|
-
|
|
100
|
-
### C. Inspect local OpenClaw readiness
|
|
101
|
-
|
|
102
|
-
Use:
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
scripts/grix_auth.py inspect@dhf-openclaw
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
This action:
|
|
109
|
-
|
|
110
|
-
1. checks whether the `grix` plugin is detected and loaded
|
|
111
|
-
2. checks whether base `channels.grix` is present and internally consistent
|
|
112
|
-
3. checks whether `grix-admin` is detected and loaded
|
|
113
|
-
4. checks whether `tools.profile`, `tools.alsoAllow`, and `tools.sessions.visibility` match the required group-governance settings
|
|
114
|
-
5. returns `inspection_state`, `ready_for_main_agent`, `ready_for_group_governance`, and `recommended_next_steps`
|
|
115
|
-
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
|
|
116
|
-
7. never mutates local OpenClaw state
|
|
117
|
-
|
|
118
|
-
### D. One-shot bootstrap
|
|
119
|
-
|
|
120
|
-
Use:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
scripts/grix_auth.py bootstrap@dhf-openclaw ...
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
This action can:
|
|
127
|
-
|
|
128
|
-
1. use a provided `access_token`
|
|
129
|
-
2. reuse-or-create the API agent
|
|
130
|
-
3. generate OpenClaw setup preview for both plugins and the required tools config
|
|
131
|
-
4. apply OpenClaw setup when `--apply` is present
|
|
132
|
-
5. expose `bootstrap_state`, `channel_credentials`, `onboard_values`, environment variables, and required tools config that the next agent step can consume directly
|
|
133
|
-
|
|
134
|
-
## Guardrails
|
|
135
|
-
|
|
136
|
-
1. Do not invent tokens, agent IDs, or API keys.
|
|
137
|
-
2. Treat `create-api-agent`, key rotation on reused agents, and `configure@dhf-openclaw --apply` as side-effecting operations.
|
|
138
|
-
3. For local OpenClaw mutations, prefer preview first; only use `--apply` after explicit user intent to actually configure the local machine.
|
|
139
|
-
4. Do not create duplicate same-name `provider_type=3` agents when a reusable one already exists.
|
|
140
|
-
5. Keep API key output exact when the user asks for it.
|
|
141
|
-
6. `provider_type` for created or reused Grix agent must be `3`.
|
|
142
|
-
7. When configuring the main agent, prefer updating base `channels.grix` over inventing extra accounts.
|
|
143
|
-
8. 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.grix` matches the target, and the required tools block is active.
|
|
144
|
-
9. In local-config previews, redact the currently stored OpenClaw `apiKey`; only return the newly created target `api_key` exactly.
|
|
145
|
-
10. If `inspect@dhf-openclaw` says the main agent is already configured and the user did not ask for a different agent target, stop instead of continuing into setup mutation.
|
|
146
|
-
|
|
147
|
-
## Script Contract
|
|
148
|
-
|
|
149
|
-
Script: `scripts/grix_auth.py`
|
|
150
|
-
|
|
151
|
-
Actions:
|
|
152
|
-
|
|
153
|
-
1. `create-api-agent`
|
|
154
|
-
2. `inspect@dhf-openclaw`
|
|
155
|
-
3. `configure@dhf-openclaw`
|
|
156
|
-
4. `bootstrap@dhf-openclaw`
|
|
157
|
-
|
|
158
|
-
Success shape highlights:
|
|
159
|
-
|
|
160
|
-
1. `create-api-agent` returns top-level `agent_id`, `api_endpoint`, `api_key`, `api_key_hint`, and whether the agent was reused or newly created
|
|
161
|
-
2. `inspect@dhf-openclaw`, `configure@dhf-openclaw`, and `bootstrap@dhf-openclaw` can return `portal_url`, `portal_ready`, and `portal_hint`
|
|
162
|
-
3. `inspect@dhf-openclaw`, `configure@dhf-openclaw`, and `bootstrap@dhf-openclaw` also return `grix_intro`, `grix_highlights`, and `user_reply_templates` so the agent can explain the concept to the user consistently
|
|
163
|
-
4. `create-api-agent` returns the `provider_type=3` agent data
|
|
164
|
-
5. `inspect@dhf-openclaw` returns `inspection_state`, `plugin_status`, `admin_plugin_status`, redacted current main grix config, current tools config, channel consistency checks, tools checks, readiness booleans, and `recommended_next_steps`
|
|
165
|
-
6. `configure@dhf-openclaw` returns `setup_state`, `plugin_status`, `admin_plugin_status`, current and next main grix config, current and next tools config, minimal plugin commands, `onboard_values`, environment variables, required tools config, and `command_results` when `--apply` is used
|
|
166
|
-
7. `bootstrap@dhf-openclaw` returns nested `created_agent`, `openclaw_setup`, top-level `channel_credentials`, and `bootstrap_state`
|
|
167
|
-
|
|
168
|
-
## References
|
|
169
|
-
|
|
170
|
-
1. Read [references/api-contract.md](references/api-contract.md) for API-agent creation routes.
|
|
171
|
-
2. Read [references/openclaw-setup.md](references/openclaw-setup.md) for the `@dhf-openclaw/grix` + `@dhf-openclaw/grix-admin` setup flow.
|
|
172
|
-
3. Read [references/grix-concepts.md](references/grix-concepts.md) when the user needs a clear product/concept explanation.
|
|
173
|
-
4. Read [references/user-replies.md](references/user-replies.md) when the user needs short, direct pitch or status replies.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Grix Auth Access"
|
|
3
|
-
short_description: "Inspect, explain, or bootstrap Grix for OpenClaw."
|
|
4
|
-
default_prompt: "Use $grix-auth-access to explain what Grix is, inspect whether the local OpenClaw main agent already has a healthy grix channel plus the required grix-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://grix.dhf.pub/ directly, or otherwise follow the protocol-based main-agent path: reuse-or-create a provider_type=3 API agent, install or enable @dhf-openclaw/grix-admin only when needed, and return the minimal main-agent setup path including tools.alsoAllow for message, grix_group, and grix_agent_admin."
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# API Contract
|
|
2
|
-
|
|
3
|
-
## Base
|
|
4
|
-
|
|
5
|
-
1. Website: `https://grix.dhf.pub/`
|
|
6
|
-
2. Public Grix API base: `https://grix.dhf.pub/v1`
|
|
7
|
-
|
|
8
|
-
## Route Mapping
|
|
9
|
-
|
|
10
|
-
### Agent bootstrap action
|
|
11
|
-
|
|
12
|
-
| Action | Method | Route | Auth |
|
|
13
|
-
|---|---|---|---|
|
|
14
|
-
| `create-api-agent` | `POST` | `/agents/create` | `Authorization: Bearer <access_token>` |
|
|
15
|
-
| `list-agents` (internal helper) | `GET` | `/agents/list` | `Authorization: Bearer <access_token>` |
|
|
16
|
-
| `rotate-api-agent-key` (internal helper) | `POST` | `/agents/:id/api/key/rotate` | `Authorization: Bearer <access_token>` |
|
|
17
|
-
|
|
18
|
-
## Payloads
|
|
19
|
-
|
|
20
|
-
### `create-api-agent`
|
|
21
|
-
|
|
22
|
-
```json
|
|
23
|
-
{
|
|
24
|
-
"agent_name": "grix-main",
|
|
25
|
-
"provider_type": 3
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
`provider_type=3` means Agent API type.
|
|
30
|
-
|
|
31
|
-
## Reuse flow
|
|
32
|
-
|
|
33
|
-
When the same-name `provider_type=3` agent already exists, the skill should:
|
|
34
|
-
|
|
35
|
-
1. read `/agents/list`
|
|
36
|
-
2. find the exact-name API agent
|
|
37
|
-
3. rotate its key through `/agents/:id/api/key/rotate`
|
|
38
|
-
4. reuse the returned `api_endpoint` and fresh `api_key`
|
|
39
|
-
|
|
40
|
-
## Success Highlights
|
|
41
|
-
|
|
42
|
-
### `create-api-agent`
|
|
43
|
-
|
|
44
|
-
The bundled script lifts these fields to the top level:
|
|
45
|
-
|
|
46
|
-
1. `agent_id`
|
|
47
|
-
2. `agent_name`
|
|
48
|
-
3. `provider_type`
|
|
49
|
-
4. `api_endpoint`
|
|
50
|
-
5. `api_key`
|
|
51
|
-
6. `api_key_hint`
|
|
52
|
-
7. `session_id`
|
|
53
|
-
|
|
54
|
-
## Common Errors
|
|
55
|
-
|
|
56
|
-
1. create-agent or rotate-key returns missing `api_endpoint` or `api_key`
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Grix Concepts
|
|
2
|
-
|
|
3
|
-
## Canonical Explanation
|
|
4
|
-
|
|
5
|
-
这个插件接入是为了在 `https://grix.dhf.pub/` 网站管理 OpenClaw,并支持移动端 PWA 页面。Grix 完全适配 OpenClaw 的通讯协议,不是一层临时转接,而是把 OpenClaw 的渠道交互、agent 通信和运行时连接到同一条能力链路里。
|
|
6
|
-
|
|
7
|
-
## Feature Highlights
|
|
8
|
-
|
|
9
|
-
1. 支持多 agent 建群互聊
|
|
10
|
-
2. 支持 agent 私聊
|
|
11
|
-
3. agent 之间通信链路完美打通
|
|
12
|
-
4. 接入目标是让你直接在 `https://grix.dhf.pub/` 管理 OpenClaw,移动端可用 PWA 页面
|
|
13
|
-
5. 配置简单易用,只需要将这个技能交给 OpenClaw、Claude、Codex,即可完成检查与配置
|
|
14
|
-
6. 如需 OpenClaw 内的群管理能力,还需要安装启用 `@dhf-openclaw/grix-admin`,并在 `tools` 中允许 `message`、`grix_group`、`grix_agent_admin`
|
|
15
|
-
|
|
16
|
-
## Default User-Facing Framing
|
|
17
|
-
|
|
18
|
-
### One sentence
|
|
19
|
-
|
|
20
|
-
这个插件接入是为了在 `https://grix.dhf.pub/` 管理 OpenClaw,并支持移动端 PWA 页面。
|
|
21
|
-
|
|
22
|
-
### Short paragraph
|
|
23
|
-
|
|
24
|
-
这个插件把 OpenClaw 的渠道交互和 agent 通信直接接到 Grix,核心目标是让你在 `https://grix.dhf.pub/` 管理 OpenClaw,并在手机上通过 PWA 页面使用。除此之外,它也支持多 agent 建群互聊、agent 私聊和 agent 间互通。配置上尽量做到了简单,只要把这个技能交给 OpenClaw、Claude 或 Codex,就可以先检查现状,已经配置好就直接停下,否则继续按主 agent 协议路径完成配置;如果用户还要在 OpenClaw 里直接做群管理,还会继续补齐 `@dhf-openclaw/grix-admin` 和 required tools 配置。
|
|
25
|
-
|
|
26
|
-
## After Setup
|
|
27
|
-
|
|
28
|
-
1. If the result says `portal_ready=true`, tell the user to log in to `https://grix.dhf.pub/` directly to try it.
|
|
29
|
-
2. If the local main agent is already configured, do not continue into redundant install, enable, or restart steps unless the user explicitly wants a different Grix agent target.
|
|
30
|
-
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.
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
# OpenClaw Setup
|
|
2
|
-
|
|
3
|
-
This flow follows the current `@dhf-openclaw/grix` and `@dhf-openclaw/grix-admin` package README expectations.
|
|
4
|
-
|
|
5
|
-
## Package
|
|
6
|
-
|
|
7
|
-
1. Plugin package: `@dhf-openclaw/grix`
|
|
8
|
-
2. Admin package: `@dhf-openclaw/grix-admin`
|
|
9
|
-
3. Purpose: Grix channel transport plus typed group-governance capability for OpenClaw
|
|
10
|
-
|
|
11
|
-
## Install and Enable
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
openclaw plugins install @dhf-openclaw/grix
|
|
15
|
-
openclaw plugins enable grix
|
|
16
|
-
openclaw plugins install @dhf-openclaw/grix-admin
|
|
17
|
-
openclaw plugins enable grix-admin
|
|
18
|
-
openclaw gateway restart
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Plugin Inspection
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
openclaw plugins info grix --json
|
|
25
|
-
openclaw plugins info grix-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 `Grix` 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 grix \
|
|
43
|
-
--name grix-main \
|
|
44
|
-
--http-url 'wss://grix.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
|
-
"grix": {
|
|
55
|
-
"enabled": true,
|
|
56
|
-
"wsUrl": "wss://grix.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
|
-
"grix_group",
|
|
66
|
-
"grix_agent_admin"
|
|
67
|
-
],
|
|
68
|
-
"sessions": {
|
|
69
|
-
"visibility": "agent"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Environment Variables
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
export GRIX_WS_URL='wss://grix.dhf.pub/v1/agent-api/ws?agent_id=<YOUR_AGENT_ID>'
|
|
79
|
-
export GRIX_AGENT_ID='<YOUR_AGENT_ID>'
|
|
80
|
-
export GRIX_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: `grix-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.grix` fields such as `accounts`, `streamChunkChars`, `streamChunkDelayMs`, and `reconnectMs`
|
|
93
|
-
9. Preserve unrelated existing `tools.alsoAllow` entries, but ensure `message`, `grix_group`, and `grix_agent_admin` are present and `tools.sessions.visibility=agent`
|
|
94
|
-
10. Return `onboard_values` and `GRIX_*` 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://grix.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
|
-
Grix chat exec approvals only require `@dhf-openclaw/grix`. They do not require `@dhf-openclaw/grix-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
|
-
"grix": {
|
|
121
|
-
"execApprovals": {
|
|
122
|
-
"enabled": true,
|
|
123
|
-
"approvers": ["<GRIX_SENDER_ID>"]
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
If the deployment uses a named Grix account, move the approver config to `channels.grix.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.grix.execApprovals` or `channels.grix.accounts.<accountId>.execApprovals`
|
|
138
|
-
5. `approvers` must be Grix 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 grix --json
|
|
145
|
-
openclaw config get approvals.exec --json
|
|
146
|
-
openclaw config get channels.grix --json
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Expected result:
|
|
150
|
-
|
|
151
|
-
1. `plugins info grix` shows `status=loaded`
|
|
152
|
-
2. `approvals.exec` is `enabled=true` and `mode=session`
|
|
153
|
-
3. the active Grix account shows `execApprovals.enabled=true`
|
|
154
|
-
4. the active Grix account contains at least one sender id in `execApprovals.approvers`
|