grix-connector 3.29.2 → 3.30.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 +10 -0
- package/dist/adapter/deepseek-harness/bridge-installer.js +3 -3
- package/dist/adapter/deepseek-harness/grix-tool-bridge.js +1 -1
- package/dist/adapter/deepseek-harness/jsonrpc-adapter.js +2 -2
- package/dist/adapter/deepseek-harness/process-runtime.js +1 -1
- package/dist/adapter/deepseek-harness/profile-resolver.js +1 -1
- package/dist/adapter/deepseek-harness/profile-runtime.js +2 -2
- package/dist/adapter/deepseek-harness/profile-supervisor.js +2 -2
- package/dist/adapter/deepseek-harness/toolbar-state.js +1 -1
- package/dist/adapter/deepseek-harness/types.js +1 -0
- package/dist/assets/dsh-bridge/grix-dsh-bridge-3.30.0.tgz +0 -0
- package/dist/assets/dsh-bridge/manifest.json +6 -6
- package/dist/bridge/bridge.js +4 -4
- package/dist/core/persistence/session-binding-store.js +2 -2
- package/dist/default-skills/grix-admin/SKILL.md +71 -211
- package/dist/default-skills/grix-admin/references/api-contract.md +43 -214
- package/dist/manager.js +1 -1
- package/dist/mcp/stream-http/security.js +1 -1
- package/openclaw-plugin/skills/grix-admin/SKILL.md +65 -202
- package/openclaw-plugin/skills/grix-admin/references/api-contract.md +35 -211
- package/package.json +1 -1
- package/dist/assets/dsh-bridge/grix-dsh-bridge-3.29.2.tgz +0 -0
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
# API Contract
|
|
1
|
+
# API Contract for OpenClaw
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
1. Create new remote API agents
|
|
8
|
-
2. Query agent categories under the current account
|
|
9
|
-
3. Create categories
|
|
10
|
-
4. Modify categories
|
|
11
|
-
5. Assign or clear categories for specified agents
|
|
5
|
+
This contract covers remote Agent and category administration through `grix_admin`, followed by local OpenClaw binding when required.
|
|
12
6
|
|
|
13
7
|
## Base Rules
|
|
14
8
|
|
|
15
|
-
1. Do not ask users
|
|
16
|
-
2.
|
|
17
|
-
3.
|
|
18
|
-
4.
|
|
19
|
-
5.
|
|
20
|
-
6.
|
|
21
|
-
7. Always send the finalized behavioral description in the actual `introduction` field of `action=create_agent`; never substitute a chat summary, `soulContent`, or local persona file for this API field.
|
|
9
|
+
1. Do not ask users for a website account or password.
|
|
10
|
+
2. Perform remote creation and category actions through `grix_admin` on the current account's authenticated WS channel.
|
|
11
|
+
3. Require a concrete `agentName` and professional `introduction` before remote creation.
|
|
12
|
+
4. If agent parameters are incomplete and the current account cannot create remotely, require backend admin creation first.
|
|
13
|
+
5. Report the exact missing scope when the service returns `code=4003`.
|
|
14
|
+
6. Static config writing alone is not full convergence when real routing verification is available.
|
|
22
15
|
|
|
23
|
-
## Direct
|
|
16
|
+
## Direct Actions
|
|
24
17
|
|
|
25
|
-
###
|
|
18
|
+
### Create Agent
|
|
26
19
|
|
|
27
20
|
```json
|
|
28
21
|
{
|
|
@@ -36,33 +29,14 @@
|
|
|
36
29
|
}
|
|
37
30
|
```
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
1. `createdAgent.id`
|
|
42
|
-
2. `createdAgent.agent_name`
|
|
43
|
-
3. `createdAgent.api_endpoint`
|
|
44
|
-
4. `createdAgent.api_key`
|
|
45
|
-
|
|
46
|
-
Required scope:
|
|
47
|
-
|
|
48
|
-
1. `agent.api.create`
|
|
49
|
-
2. If `categoryName` is included, may additionally need `agent.category.list`, `agent.category.create`, `agent.category.assign`
|
|
50
|
-
3. If `categoryId` is included, additionally needs `agent.category.assign`
|
|
32
|
+
Read `createdAgent.id`, `createdAgent.agent_name`, `createdAgent.api_endpoint`, and `createdAgent.api_key` from the result. Required scope is `agent.api.create`, plus category scopes when category fields are supplied.
|
|
51
33
|
|
|
52
|
-
###
|
|
34
|
+
### Category Actions
|
|
53
35
|
|
|
54
36
|
```json
|
|
55
|
-
{
|
|
56
|
-
"action": "list_categories"
|
|
57
|
-
}
|
|
37
|
+
{ "action": "list_categories" }
|
|
58
38
|
```
|
|
59
39
|
|
|
60
|
-
Required scope:
|
|
61
|
-
|
|
62
|
-
1. `agent.category.list`
|
|
63
|
-
|
|
64
|
-
### 3. Create Category
|
|
65
|
-
|
|
66
40
|
```json
|
|
67
41
|
{
|
|
68
42
|
"action": "create_category",
|
|
@@ -72,12 +46,6 @@ Required scope:
|
|
|
72
46
|
}
|
|
73
47
|
```
|
|
74
48
|
|
|
75
|
-
Required scope:
|
|
76
|
-
|
|
77
|
-
1. `agent.category.create`
|
|
78
|
-
|
|
79
|
-
### 4. Update Category
|
|
80
|
-
|
|
81
49
|
```json
|
|
82
50
|
{
|
|
83
51
|
"action": "update_category",
|
|
@@ -88,12 +56,6 @@ Required scope:
|
|
|
88
56
|
}
|
|
89
57
|
```
|
|
90
58
|
|
|
91
|
-
Required scope:
|
|
92
|
-
|
|
93
|
-
1. `agent.category.update`
|
|
94
|
-
|
|
95
|
-
### 5. Assign or Clear Category
|
|
96
|
-
|
|
97
59
|
```json
|
|
98
60
|
{
|
|
99
61
|
"action": "assign_category",
|
|
@@ -102,89 +64,26 @@ Required scope:
|
|
|
102
64
|
}
|
|
103
65
|
```
|
|
104
66
|
|
|
105
|
-
|
|
67
|
+
Use `categoryId: "0"` to clear an assignment. Required scopes are `agent.category.list`, `agent.category.create`, `agent.category.update`, and `agent.category.assign` respectively.
|
|
106
68
|
|
|
107
|
-
|
|
108
|
-
{
|
|
109
|
-
"action": "assign_category",
|
|
110
|
-
"agentId": "10001",
|
|
111
|
-
"categoryId": "0"
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Required scope:
|
|
116
|
-
|
|
117
|
-
1. `agent.category.assign`
|
|
118
|
-
|
|
119
|
-
## Local Bind Steps
|
|
120
|
-
|
|
121
|
-
After remote agent parameters are complete, continue with local binding. The target environment determines which path to follow.
|
|
122
|
-
|
|
123
|
-
### Path A: OpenClaw
|
|
69
|
+
## Local Binding
|
|
124
70
|
|
|
125
71
|
Use official OpenClaw CLI commands:
|
|
126
72
|
|
|
127
|
-
1. Prepare
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
- `agents.defaults.model.primary`
|
|
134
|
-
- If still unavailable, clearly report error and stop
|
|
135
|
-
3. Read current config and merge:
|
|
136
|
-
- `channels.grix.accounts`
|
|
137
|
-
- `agents.list`
|
|
138
|
-
- `tools.profile`
|
|
139
|
-
- `tools.alsoAllow`
|
|
140
|
-
- `tools.sessions.visibility`
|
|
141
|
-
4. Write back using official CLI:
|
|
142
|
-
- `channels.grix.accounts.<agent_name>`
|
|
143
|
-
- `agents.list`
|
|
144
|
-
- `openclaw agents bind --agent <agent_name> --bind grix:<agent_name>`
|
|
145
|
-
- `tools.profile`
|
|
146
|
-
- `tools.alsoAllow`
|
|
147
|
-
- `tools.sessions.visibility`
|
|
148
|
-
- If needed, restore `channels.grix.enabled=true`
|
|
149
|
-
5. After writing, perform static validation first:
|
|
73
|
+
1. Prepare `~/.openclaw/workspace-<agent_name>` and `~/.openclaw/agents/<agent_name>/agent`.
|
|
74
|
+
2. Keep persona files in the workspace root and create minimal required files if missing.
|
|
75
|
+
3. Resolve the model from the existing agent entry, then `agents.defaults.model.primary`; stop if neither exists.
|
|
76
|
+
4. Merge the Grix account and agent entries, bind the agent to `grix:<agent_name>`, configure the coding profile and required Grix tools, and restore `channels.grix.enabled=true` only when explicitly disabled.
|
|
77
|
+
5. Do not overwrite `openclaw.json` directly.
|
|
78
|
+
6. Validate with:
|
|
150
79
|
- `openclaw config validate`
|
|
151
80
|
- `openclaw config get --json channels.grix.accounts.<agent_name>`
|
|
152
81
|
- `openclaw config get --json agents.list`
|
|
153
82
|
- `openclaw agents bindings --agent <agent_name> --json`
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
8. If this invocation cannot perform real verification, can only state "config has been written, runtime not yet tested, needs subsequent flow to continue verification"; do not write it as "already fully taken effect".
|
|
157
|
-
|
|
158
|
-
### Path B: grix-connector
|
|
159
|
-
|
|
160
|
-
Directly manage `~/.grix/config/agents.json` and hot-reload the daemon:
|
|
161
|
-
|
|
162
|
-
1. Target file: `~/.grix/config/agents.json`. Initialize as `{ "agents": [] }` if missing.
|
|
163
|
-
2. Read the existing `agents` array. Match by `name === agent_name`:
|
|
164
|
-
- If found, update the existing entry in place.
|
|
165
|
-
- If not found, append a new entry.
|
|
166
|
-
3. Write the entry with these fields:
|
|
167
|
-
- `name`: `agent_name`
|
|
168
|
-
- `ws_url`: `api_endpoint`
|
|
169
|
-
- `agent_id`: `agent_id`
|
|
170
|
-
- `api_key`: `api_key`
|
|
171
|
-
- `client_type`: `client_type` (default `pi`)
|
|
172
|
-
4. Preserve valid JSON, set file permissions to `0o600`, and create a timestamped backup (also `0o600`) before writing.
|
|
173
|
-
5. Trigger reload through the synchronous Admin API:
|
|
174
|
-
- Default endpoint: `POST http://127.0.0.1:19580/api/reload`
|
|
175
|
-
- The endpoint waits for `manager.reload()` to complete and returns `{ ok: true, result }` or an error. Use this instead of the CLI `grix-connector reload` to avoid races and to surface reload failures.
|
|
176
|
-
- If the admin port was customized via `GRIX_ADMIN_PORT` or `--admin-port`, read the actual port from `~/.grix/data/admin-port`.
|
|
177
|
-
6. Verify via Admin API `GET http://127.0.0.1:<admin-port>/api/agents`:
|
|
178
|
-
- Find entry where `name === agent_name`.
|
|
179
|
-
- Confirm the entry exists and reports `alive === true`.
|
|
180
|
-
- **Caveat**: `alive=true` only means the daemon started the instance. It does **not** prove the Agent successfully authenticated with the Grix platform.
|
|
181
|
-
7. Perform secondary platform-connection verification:
|
|
182
|
-
- Inspect daemon logs for WebSocket connection success / authentication failure messages for this Agent.
|
|
183
|
-
- Or ask the owner to send a test message to the Agent and confirm it responds.
|
|
184
|
-
8. If verification fails, report the observed status and stop; do not claim success.
|
|
185
|
-
9. If this invocation cannot perform real verification, can only state "config has been written, reload completed, runtime not yet tested"; do not write it as "already fully taken effect".
|
|
83
|
+
7. When real routing verification is available, verify the target identity, persona, and binding.
|
|
84
|
+
8. Only when static validation passes but real verification fails may one `openclaw gateway restart` be used, followed by one retest.
|
|
186
85
|
|
|
187
|
-
## `bind-local`
|
|
86
|
+
## `bind-local`
|
|
188
87
|
|
|
189
88
|
```json
|
|
190
89
|
{
|
|
@@ -192,37 +91,9 @@ Directly manage `~/.grix/config/agents.json` and hot-reload the daemon:
|
|
|
192
91
|
}
|
|
193
92
|
```
|
|
194
93
|
|
|
195
|
-
This mode
|
|
94
|
+
This mode performs local binding only. If real routing verification is unavailable, report static completion and hand verification responsibility back to the upper-level flow.
|
|
196
95
|
|
|
197
|
-
## `
|
|
198
|
-
|
|
199
|
-
```json
|
|
200
|
-
{
|
|
201
|
-
"task": "connector-bind-local\nagent_name=programmer-pi\nagent_id=2079349263263338496\napi_endpoint=wss://grix.dhf.pub/v1/agent-api/ws?agent_id=2079349263263338496\napi_key=ak_xxx\nclient_type=pi"
|
|
202
|
-
}
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Field mapping to `~/.grix/config/agents.json`:
|
|
206
|
-
|
|
207
|
-
| Input field | JSON field | Notes |
|
|
208
|
-
| -------------- | ------------ | ------------------------------------------ |
|
|
209
|
-
| `agent_name` | `name` | Also used as the matching key |
|
|
210
|
-
| `api_endpoint` | `ws_url` | The WebSocket URL for the agent API |
|
|
211
|
-
| `agent_id` | `agent_id` | Platform agent ID |
|
|
212
|
-
| `api_key` | `api_key` | Agent API key |
|
|
213
|
-
| `client_type` | `client_type`| Optional, default `pi` |
|
|
214
|
-
|
|
215
|
-
Convergence rules:
|
|
216
|
-
|
|
217
|
-
1. Backup `~/.grix/config/agents.json` before writing; set backup permissions to `0o600`.
|
|
218
|
-
2. Preserve valid JSON and set file permissions to `0o600`.
|
|
219
|
-
3. Trigger reload via synchronous Admin API `POST http://127.0.0.1:19580/api/reload` (or the port stored in `~/.grix/data/admin-port` if customized).
|
|
220
|
-
4. Verify via `GET http://127.0.0.1:<admin-port>/api/agents` that the entry exists and has `alive=true`.
|
|
221
|
-
5. Perform secondary platform-connection verification by checking daemon logs or sending a test message; do not treat `alive=true` as proof of successful platform authentication.
|
|
222
|
-
|
|
223
|
-
## `create-and-bind` Input Contract
|
|
224
|
-
|
|
225
|
-
When the main agent already has an available account and `agent.api.create` scope, can enter the creation flow through `grix_admin.task`:
|
|
96
|
+
## `create-and-bind`
|
|
226
97
|
|
|
227
98
|
```json
|
|
228
99
|
{
|
|
@@ -230,52 +101,16 @@ When the main agent already has an available account and `agent.api.create` scop
|
|
|
230
101
|
}
|
|
231
102
|
```
|
|
232
103
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
1. Confirm `agentName` and a professionally organized `introduction` are both present; otherwise ask the user about the Agent's purpose, core responsibilities, intended users, and boundaries before continuing
|
|
236
|
-
2. First make one direct call with `action=create_agent`, passing `agentName`, `introduction`, and optional `categoryId` / `categoryName` / `parentCategoryId` / `categorySortOrder` together
|
|
237
|
-
3. If the return already includes the category assignment result, continue directly
|
|
238
|
-
4. If the caller used a legacy path, or the return does not include the category assignment result, supplement with:
|
|
239
|
-
- `categoryId` -> `action=assign_category`
|
|
240
|
-
- `categoryName` -> `action=list_categories`
|
|
241
|
-
- Not found -> `action=create_category`
|
|
242
|
-
- After obtaining category ID -> `action=assign_category`
|
|
243
|
-
5. Finally follow the same local binding and runtime convergence flow as `bind-local`
|
|
244
|
-
|
|
245
|
-
Notes:
|
|
246
|
-
|
|
247
|
-
1. `categoryId` and `categoryName` cannot be provided simultaneously
|
|
248
|
-
2. When matching `categoryName`, must also consider `parentCategoryId`
|
|
249
|
-
3. If the remote return indicates missing `agent.api.create` or any `agent.category.*` scope, clearly state which specific scope is missing
|
|
250
|
-
|
|
251
|
-
## `create-and-connector-bind` Input Contract
|
|
252
|
-
|
|
253
|
-
When the main agent already has an available account and `agent.api.create` scope, and the target runtime is grix-connector:
|
|
254
|
-
|
|
255
|
-
```json
|
|
256
|
-
{
|
|
257
|
-
"task": "create-and-connector-bind\nagentName=程序员 pi\nintroduction=专业软件工程 Agent,负责分析需求、设计实现、编写并验证代码;涉及破坏性操作或需求边界不明确时先请求确认。\nisMain=false\nclientType=pi\ncategoryName=Developers\nparentCategoryId=0\ncategorySortOrder=10"
|
|
258
|
-
}
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
This mode requires steps in order:
|
|
262
|
-
|
|
263
|
-
1. Confirm `agentName` and a professionally organized `introduction` are both present; otherwise ask the user about the Agent's purpose, core responsibilities, intended users, and boundaries before continuing.
|
|
264
|
-
2. Make one direct call with `action=create_agent`, passing `agentName`, `introduction`, and optional `categoryId` / `categoryName` / `parentCategoryId` / `categorySortOrder` together.
|
|
265
|
-
3. If the return already includes the category assignment result, continue directly; otherwise supplement with the same category resolution logic as `create-and-bind`.
|
|
266
|
-
4. Read `createdAgent.id`, `createdAgent.agent_name`, `createdAgent.api_endpoint`, `createdAgent.api_key` from the result.
|
|
267
|
-
5. Follow the `connector-bind-local` local binding and runtime convergence flow, using `clientType` (default `pi`) for the `client_type` field.
|
|
268
|
-
6. Trigger reload via the synchronous Admin API `POST /api/reload`, verify the Agent entry exists and `alive=true` via `GET /api/agents`, and perform secondary platform-connection verification (log inspection or test message).
|
|
269
|
-
|
|
270
|
-
Notes:
|
|
271
|
-
|
|
272
|
-
1. `categoryId` and `categoryName` cannot be provided simultaneously.
|
|
273
|
-
2. `clientType` defaults to `pi` when omitted.
|
|
274
|
-
3. If the remote return indicates missing `agent.api.create` or any `agent.category.*` scope, clearly state which specific scope is missing.
|
|
104
|
+
Execution order:
|
|
275
105
|
|
|
276
|
-
|
|
106
|
+
1. Validate `agentName`, `introduction`, and category-field exclusivity.
|
|
107
|
+
2. Call `action=create_agent` once with all supplied creation and category fields.
|
|
108
|
+
3. Supplement category resolution only if the response did not complete it.
|
|
109
|
+
4. Read the returned agent parameters.
|
|
110
|
+
5. Continue with `bind-local`.
|
|
111
|
+
6. Complete static validation and any available real routing verification before claiming full convergence.
|
|
277
112
|
|
|
278
|
-
|
|
113
|
+
## `category-manage`
|
|
279
114
|
|
|
280
115
|
```json
|
|
281
116
|
{
|
|
@@ -283,15 +118,4 @@ When only doing subsequent category management, enter through `grix_admin.task`:
|
|
|
283
118
|
}
|
|
284
119
|
```
|
|
285
120
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
1. `operation=list` -> `action=list_categories`
|
|
289
|
-
2. `operation=create` -> `action=create_category`
|
|
290
|
-
3. `operation=update` -> `action=update_category`
|
|
291
|
-
4. `operation=assign` -> `action=assign_category`
|
|
292
|
-
|
|
293
|
-
Notes:
|
|
294
|
-
|
|
295
|
-
1. For `operation=assign`, `categoryId=0` means clear the category
|
|
296
|
-
2. No step can be executed cross-account
|
|
297
|
-
3. Do not hand-write HTTP or fall back to legacy scripts
|
|
121
|
+
Map `list`, `create`, `update`, and `assign` to their corresponding direct actions. Never execute across accounts or fall back to handwritten HTTP.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grix-connector",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.30.0",
|
|
4
4
|
"description": "Connect local AI coding agents (Claude, Codex, Gemini, Qwen, DeepSeek, Cursor, OpenCode, Pi, OpenHuman, Reasonix) to the Grix scheduling platform. Also serves as an OpenClaw plugin for Grix channel transport.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
Binary file
|