@dhf-openclaw/grix 0.4.8 → 0.4.10

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
@@ -1,38 +1,42 @@
1
- # OpenClaw Grix Channel Plugin
1
+ # OpenClaw Grix Unified Plugin
2
2
 
3
- This plugin connects OpenClaw to [https://grix.dhf.pub/](https://grix.dhf.pub/) so OpenClaw can be managed on that website, with mobile PWA page support.
3
+ This plugin connects OpenClaw to [https://grix.dhf.pub/](https://grix.dhf.pub/) and provides a single, unified integration for:
4
+
5
+ - Grix channel transport (WebSocket Agent API)
6
+ - native message actions (`unsend` / `delete`)
7
+ - typed Grix admin tools
8
+ - operator CLI commands
9
+ - bundled Grix workflow skills
4
10
 
5
11
  Compatibility:
6
12
 
7
13
  - Requires `OpenClaw >= 2026.3.13`
8
14
 
9
- Its runtime remains focused on channel responsibilities:
10
-
11
- - connect to Grix over the Agent API WebSocket
12
- - receive inbound messages
13
- - send replies, media, and streaming chunks
14
- - support native channel actions such as `unsend` / `delete`
15
-
16
- The npm package also bundles OpenClaw skills for first-time setup and native channel actions, so users can install the plugin and complete Grix onboarding directly in conversation.
17
-
18
- For full group-governance and API-agent admin capability, OpenClaw also needs the separate typed admin plugin:
19
-
20
- - `@dhf-openclaw/grix-admin`
21
-
22
- If you are reading the admin plugin documentation first, also read the companion Grix admin plugin README.
23
-
24
- ## Which Package Do I Need?
25
-
26
- - Install only `@dhf-openclaw/grix` when you only need Grix channel transport and the bundled onboarding skill
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
- - Never install only `@dhf-openclaw/grix-admin` without configuring `@dhf-openclaw/grix` first, because the admin plugin reads credentials from `channels.grix`
15
+ ## Included Capability
16
+
17
+ After installation, one plugin covers all major Grix workflows:
18
+
19
+ - Channel runtime:
20
+ - inbound message receive
21
+ - outbound reply / media / streaming chunk send
22
+ - native channel actions (`unsend`, `delete`)
23
+ - Typed admin tools:
24
+ - `grix_query`
25
+ - `grix_group`
26
+ - `grix_agent_admin`
27
+ - Operator CLI:
28
+ - `openclaw grix doctor`
29
+ - `openclaw grix create-agent ...`
30
+ - Bundled skills:
31
+ - `message-send`
32
+ - `message-unsend`
33
+ - `egg-install`
34
+ - `grix-query`
35
+ - `grix-group-governance`
36
+ - `grix-agent-admin`
29
37
 
30
38
  ## Install
31
39
 
32
- Before install, confirm your local OpenClaw version is greater than or equal to `2026.3.13`.
33
-
34
- ### Base Channel Transport
35
-
36
40
  ```bash
37
41
  openclaw plugins install @dhf-openclaw/grix
38
42
  openclaw plugins enable grix
@@ -41,37 +45,31 @@ openclaw gateway restart
41
45
 
42
46
  ### Local Source Checkout
43
47
 
44
- If you load this plugin directly from a local checkout instead of the published npm package, install repo dependencies first so `openclaw/plugin-sdk` can resolve from this workspace:
48
+ If you load from a local checkout:
45
49
 
46
50
  ```bash
47
51
  npm install
48
- ```
49
-
50
- Then point OpenClaw at the tracked local entry file:
51
-
52
- ```bash
53
52
  openclaw plugins install ./grix.ts
54
53
  ```
55
54
 
56
- ### Full Grix Capability
55
+ ## Required OpenClaw Config
57
56
 
58
- For native group-management capability inside OpenClaw, also install the admin plugin and enable the required tools:
57
+ ### Channel Config (`channels.grix`)
59
58
 
60
- ```bash
61
- openclaw plugins install @dhf-openclaw/grix-admin
62
- openclaw plugins enable grix-admin
63
- openclaw gateway restart
59
+ ```json
60
+ {
61
+ "channels": {
62
+ "grix": {
63
+ "enabled": true,
64
+ "wsUrl": "wss://grix.dhf.pub/v1/agent-api/ws?agent_id=<YOUR_AGENT_ID>",
65
+ "agentId": "<YOUR_AGENT_ID>",
66
+ "apiKey": "<YOUR_API_KEY>"
67
+ }
68
+ }
69
+ }
64
70
  ```
65
71
 
66
- Recommended order:
67
-
68
- 1. Install and configure `@dhf-openclaw/grix`
69
- 2. Confirm `channels.grix` is healthy
70
- 3. Install and enable `@dhf-openclaw/grix-admin`
71
- 4. Enable the required `tools` block
72
- 5. Restart the OpenClaw gateway
73
-
74
- If you need the detailed admin-side requirements, see the companion Grix admin plugin README.
72
+ ### Tool Exposure Config
75
73
 
76
74
  ```json
77
75
  {
@@ -79,6 +77,7 @@ If you need the detailed admin-side requirements, see the companion Grix admin p
79
77
  "profile": "coding",
80
78
  "alsoAllow": [
81
79
  "message",
80
+ "grix_query",
82
81
  "grix_group",
83
82
  "grix_agent_admin"
84
83
  ],
@@ -89,44 +88,7 @@ If you need the detailed admin-side requirements, see the companion Grix admin p
89
88
  }
90
89
  ```
91
90
 
92
- After install, OpenClaw can surface these bundled skills from this plugin:
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
- - `message-send`: send current-session or cross-session Grix messages
97
- - `message-unsend`: unsend previously sent Grix messages
98
-
99
- You can confirm the bundled skill is visible with:
100
-
101
- ```bash
102
- openclaw skills list
103
- openclaw skills info grix-auth-access
104
- ```
105
-
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
- ## Configure
109
-
110
- ### `openclaw onboard`
111
-
112
- Choose `Grix` in channel setup and enter:
113
-
114
- - `wsUrl`
115
- - `agentId`
116
- - `apiKey`
117
-
118
- ### `openclaw channels add`
119
-
120
- ```bash
121
- openclaw channels add \
122
- --channel grix \
123
- --name grix-main \
124
- --http-url 'wss://grix.dhf.pub/v1/agent-api/ws?agent_id=<YOUR_AGENT_ID>' \
125
- --user-id '<YOUR_AGENT_ID>' \
126
- --token '<YOUR_API_KEY>'
127
- ```
128
-
129
- ### Direct config
91
+ Full example:
130
92
 
131
93
  ```json
132
94
  {
@@ -142,6 +104,7 @@ openclaw channels add \
142
104
  "profile": "coding",
143
105
  "alsoAllow": [
144
106
  "message",
107
+ "grix_query",
145
108
  "grix_group",
146
109
  "grix_agent_admin"
147
110
  ],
@@ -152,18 +115,71 @@ openclaw channels add \
152
115
  }
153
116
  ```
154
117
 
155
- The `channels.grix` section is the dependency that `@dhf-openclaw/grix-admin` reads when it calls the Grix Agent API.
118
+ After any config change:
119
+
120
+ ```bash
121
+ openclaw gateway restart
122
+ ```
123
+
124
+ ## Typed Tools
125
+
126
+ ### `grix_query`
127
+
128
+ Supported actions:
129
+
130
+ - `contact_search`
131
+ - `session_search`
132
+ - `message_history`
133
+
134
+ ### `grix_group`
135
+
136
+ Supported actions:
137
+
138
+ - `create`
139
+ - `detail`
140
+ - `add_members`
141
+ - `remove_members`
142
+ - `update_member_role`
143
+ - `update_all_members_muted`
144
+ - `update_member_speaking`
145
+ - `dissolve`
146
+
147
+ ### `grix_agent_admin`
148
+
149
+ Creates `provider_type=3` API agents with typed parameters.
150
+
151
+ This tool creates the remote Grix API agent only. It does not directly mutate local OpenClaw channel config.
152
+
153
+ ## Operator CLI
154
+
155
+ ### Inspect Grix accounts
156
+
157
+ ```bash
158
+ openclaw grix doctor
159
+ ```
160
+
161
+ ### Create API agent
162
+
163
+ ```bash
164
+ openclaw grix create-agent \
165
+ --agent-name ops-assistant \
166
+ --describe-message-tool '{"actions":["unsend","delete"]}'
167
+ ```
168
+
169
+ `create-agent` prints:
170
+
171
+ - created agent payload
172
+ - one-time API key in result payload
173
+ - safe next-step channel binding command template
174
+
175
+ `--describe-message-tool` is required and must follow OpenClaw `describeMessageTool` discovery structure.
156
176
 
157
177
  ## Exec Approvals
158
178
 
159
179
  Grix can approve OpenClaw host `exec` requests in chat.
160
180
 
161
- `exec` approvals only require `@dhf-openclaw/grix`. They do not require `@dhf-openclaw/grix-admin`.
162
-
163
181
  ### 1. Configure Grix approvers
164
182
 
165
- Add the Grix sender ids that are allowed to approve:
166
-
167
183
  ```json
168
184
  {
169
185
  "channels": {
@@ -177,14 +193,14 @@ Add the Grix sender ids that are allowed to approve:
177
193
  }
178
194
  ```
179
195
 
180
- If you use a named Grix account, configure approvers under that account:
196
+ If using named accounts:
181
197
 
182
198
  ```json
183
199
  {
184
200
  "channels": {
185
201
  "grix": {
186
202
  "accounts": {
187
- "xiami": {
203
+ "ops": {
188
204
  "execApprovals": {
189
205
  "enabled": true,
190
206
  "approvers": ["<GRIX_SENDER_ID>"]
@@ -198,8 +214,6 @@ If you use a named Grix account, configure approvers under that account:
198
214
 
199
215
  ### 2. Enable OpenClaw exec approvals
200
216
 
201
- Minimal OpenClaw config:
202
-
203
217
  ```json
204
218
  {
205
219
  "tools": {
@@ -226,17 +240,13 @@ Minimal OpenClaw config:
226
240
  }
227
241
  ```
228
242
 
229
- Mode selection:
230
-
231
- - `session`: send the approval prompt back to the current Grix chat
232
- - `targets`: send the approval prompt to the explicit targets configured in `approvals.exec.targets`
233
- - `both`: send to the current chat and to explicit targets
243
+ Mode choices:
234
244
 
235
- If needed, you can also use OpenClaw's upstream `approvals.exec` fields such as `agentFilter`, `sessionFilter`, and `targets`.
245
+ - `session`: send approval prompt to current Grix chat
246
+ - `targets`: send approval prompt to configured `approvals.exec.targets`
247
+ - `both`: send to both
236
248
 
237
- ### 3. Restart the gateway
238
-
239
- After changing any approval-related config:
249
+ ### 3. Restart
240
250
 
241
251
  ```bash
242
252
  openclaw gateway restart
@@ -244,73 +254,32 @@ openclaw gateway restart
244
254
 
245
255
  ### 4. Approve in chat
246
256
 
247
- Usage flow:
257
+ Flow:
248
258
 
249
- 1. Ask OpenClaw to run an `exec` command that requires approval.
250
- 2. OpenClaw sends the approval prompt to Grix according to `approvals.exec.mode`.
259
+ 1. Ask OpenClaw to run an `exec` command that needs approval.
260
+ 2. OpenClaw sends approval prompt to Grix.
251
261
  3. An allowed approver can:
252
262
  - click `Allow Once`, `Allow Always`, or `Deny`
253
263
  - or send `/approve <id> allow-once|allow-always|deny`
254
- 4. OpenClaw continues or denies the `exec` request based on that decision.
264
+ 4. OpenClaw continues or denies execution.
255
265
 
256
266
  Notes:
257
267
 
258
- - `approvers` must be Grix sender ids, not OpenClaw agent ids
259
- - put approvers under the Grix account that is actually serving the session
260
- - approval requests and approval results are shown in chat
261
- - some OpenClaw lifecycle notices may still appear as normal text
268
+ - approvers must be Grix sender IDs, not OpenClaw agent IDs
269
+ - configure approvers under the serving account
270
+ - approval requests and results are posted in chat
262
271
 
263
- ### 5. Quick checks
272
+ ## Verification
264
273
 
265
274
  ```bash
266
275
  openclaw plugins info grix --json
267
- openclaw config get approvals.exec --json
268
- openclaw config get channels.grix --json
276
+ openclaw skills list
277
+ openclaw grix doctor
269
278
  ```
270
279
 
271
- Check that:
272
-
273
- - `plugins info grix` reports `status = "loaded"`
274
- - `approvals.exec.enabled = true`
275
- - `approvals.exec.mode` matches your intended delivery path
276
- - the active Grix account has `execApprovals.enabled = true`
277
- - the active Grix account has at least one sender id in `execApprovals.approvers`
278
-
279
- Troubleshooting:
280
-
281
- - if no approval card appears in the current chat, first confirm `tools.exec.ask = "always"` and `approvals.exec.mode = "session"`
282
- - if you are forwarding to explicit Grix targets, confirm `approvals.exec.targets` points to the correct `channel = "grix"` target
283
- - if the chat shows approval text but approvers cannot operate it, check that `approvers` contains the human Grix sender id
284
- - if `openclaw gateway restart` fails config validation, remove invalid keys under `approvals.exec` and keep approver ids only under `channels.grix.*.execApprovals`
285
-
286
- For an end-to-end verification checklist, see:
287
-
288
- - [docs/openclaw_exec_approval_e2e.md](../../docs/openclaw_exec_approval_e2e.md)
289
-
290
- For multi-account setups, put `execApprovals` under `channels.grix.accounts.<accountId>`.
291
-
292
- ## Native Channel Actions
293
-
294
- The channel plugin exposes only channel-native message actions:
295
-
296
- - `unsend`
297
- - `delete`
298
-
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
- ## Environment Variables
280
+ Expected:
313
281
 
314
- - `GRIX_WS_URL`
315
- - `GRIX_AGENT_ID`
316
- - `GRIX_API_KEY`
282
+ - plugin `grix` is enabled and loaded
283
+ - typed tools are callable when `tools.alsoAllow` is configured
284
+ - bundled skills are visible in skills list
285
+ - `openclaw grix doctor` can read configured `channels.grix` accounts