@dhf-openclaw/grix 0.4.7

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 askie and contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,316 @@
1
+ # OpenClaw Grix Channel Plugin
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.
4
+
5
+ Compatibility:
6
+
7
+ - Requires `OpenClaw >= 2026.3.13`
8
+
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`
29
+
30
+ ## Install
31
+
32
+ Before install, confirm your local OpenClaw version is greater than or equal to `2026.3.13`.
33
+
34
+ ### Base Channel Transport
35
+
36
+ ```bash
37
+ openclaw plugins install @dhf-openclaw/grix
38
+ openclaw plugins enable grix
39
+ openclaw gateway restart
40
+ ```
41
+
42
+ ### Local Source Checkout
43
+
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:
45
+
46
+ ```bash
47
+ npm install
48
+ ```
49
+
50
+ Then point OpenClaw at the tracked local entry file:
51
+
52
+ ```bash
53
+ openclaw plugins install ./grix.ts
54
+ ```
55
+
56
+ ### Full Grix Capability
57
+
58
+ For native group-management capability inside OpenClaw, also install the admin plugin and enable the required tools:
59
+
60
+ ```bash
61
+ openclaw plugins install @dhf-openclaw/grix-admin
62
+ openclaw plugins enable grix-admin
63
+ openclaw gateway restart
64
+ ```
65
+
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.
75
+
76
+ ```json
77
+ {
78
+ "tools": {
79
+ "profile": "coding",
80
+ "alsoAllow": [
81
+ "message",
82
+ "grix_group",
83
+ "grix_agent_admin"
84
+ ],
85
+ "sessions": {
86
+ "visibility": "agent"
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ After install, OpenClaw can surface these bundled skills from this plugin:
93
+
94
+ - `grix-auth-access`: inspect current readiness, guide website registration/login, create or reuse `provider_type=3` API agents, 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
130
+
131
+ ```json
132
+ {
133
+ "channels": {
134
+ "grix": {
135
+ "enabled": true,
136
+ "wsUrl": "wss://grix.dhf.pub/v1/agent-api/ws?agent_id=<YOUR_AGENT_ID>",
137
+ "agentId": "<YOUR_AGENT_ID>",
138
+ "apiKey": "<YOUR_API_KEY>"
139
+ }
140
+ },
141
+ "tools": {
142
+ "profile": "coding",
143
+ "alsoAllow": [
144
+ "message",
145
+ "grix_group",
146
+ "grix_agent_admin"
147
+ ],
148
+ "sessions": {
149
+ "visibility": "agent"
150
+ }
151
+ }
152
+ }
153
+ ```
154
+
155
+ The `channels.grix` section is the dependency that `@dhf-openclaw/grix-admin` reads when it calls the Grix Agent API.
156
+
157
+ ## Exec Approvals
158
+
159
+ Grix can approve OpenClaw host `exec` requests in chat.
160
+
161
+ `exec` approvals only require `@dhf-openclaw/grix`. They do not require `@dhf-openclaw/grix-admin`.
162
+
163
+ ### 1. Configure Grix approvers
164
+
165
+ Add the Grix sender ids that are allowed to approve:
166
+
167
+ ```json
168
+ {
169
+ "channels": {
170
+ "grix": {
171
+ "execApprovals": {
172
+ "enabled": true,
173
+ "approvers": ["<GRIX_SENDER_ID>"]
174
+ }
175
+ }
176
+ }
177
+ }
178
+ ```
179
+
180
+ If you use a named Grix account, configure approvers under that account:
181
+
182
+ ```json
183
+ {
184
+ "channels": {
185
+ "grix": {
186
+ "accounts": {
187
+ "xiami": {
188
+ "execApprovals": {
189
+ "enabled": true,
190
+ "approvers": ["<GRIX_SENDER_ID>"]
191
+ }
192
+ }
193
+ }
194
+ }
195
+ }
196
+ }
197
+ ```
198
+
199
+ ### 2. Enable OpenClaw exec approvals
200
+
201
+ Minimal OpenClaw config:
202
+
203
+ ```json
204
+ {
205
+ "tools": {
206
+ "exec": {
207
+ "host": "gateway",
208
+ "security": "allowlist",
209
+ "ask": "always"
210
+ }
211
+ },
212
+ "approvals": {
213
+ "exec": {
214
+ "enabled": true,
215
+ "mode": "session"
216
+ }
217
+ },
218
+ "channels": {
219
+ "grix": {
220
+ "execApprovals": {
221
+ "enabled": true,
222
+ "approvers": ["<GRIX_SENDER_ID>"]
223
+ }
224
+ }
225
+ }
226
+ }
227
+ ```
228
+
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
234
+
235
+ If needed, you can also use OpenClaw's upstream `approvals.exec` fields such as `agentFilter`, `sessionFilter`, and `targets`.
236
+
237
+ ### 3. Restart the gateway
238
+
239
+ After changing any approval-related config:
240
+
241
+ ```bash
242
+ openclaw gateway restart
243
+ ```
244
+
245
+ ### 4. Approve in chat
246
+
247
+ Usage flow:
248
+
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`.
251
+ 3. An allowed approver can:
252
+ - click `Allow Once`, `Allow Always`, or `Deny`
253
+ - or send `/approve <id> allow-once|allow-always|deny`
254
+ 4. OpenClaw continues or denies the `exec` request based on that decision.
255
+
256
+ Notes:
257
+
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
262
+
263
+ ### 5. Quick checks
264
+
265
+ ```bash
266
+ openclaw plugins info grix --json
267
+ openclaw config get approvals.exec --json
268
+ openclaw config get channels.grix --json
269
+ ```
270
+
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 guide registration or login
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
313
+
314
+ - `GRIX_WS_URL`
315
+ - `GRIX_AGENT_ID`
316
+ - `GRIX_API_KEY`