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,27 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: grix-admin
|
|
3
|
-
description: Responsible for OpenClaw
|
|
3
|
+
description: Responsible for OpenClaw local configuration, binding, and runtime convergence; can create new remote API agents through the current agent's WS channel, and supports querying, creating, modifying agent categories and assigning categories to agents.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Grix Agent Admin
|
|
7
7
|
|
|
8
8
|
`grix-admin` is responsible for three things:
|
|
9
9
|
|
|
10
|
-
1. Landing existing remote agent parameters into local OpenClaw
|
|
10
|
+
1. Landing existing remote agent parameters into local OpenClaw and handling runtime convergence after binding.
|
|
11
11
|
2. When the current main agent is already online and has the corresponding scope, creating new remote API agents through `grix_admin`'s direct actions, then continuing with local landing.
|
|
12
12
|
3. During agent creation or subsequent agent management, reusing `grix_admin`'s direct actions to query categories, create categories, modify categories, and assign categories to agents.
|
|
13
13
|
|
|
14
14
|
## Entry Method
|
|
15
15
|
|
|
16
|
-
1. In most cases, enter this skill from `grix_admin`'s `task` entry; the first line of `task` must clearly state `bind-local`, `create-and-bind`, `category-manage
|
|
17
|
-
2. Only when executing
|
|
16
|
+
1. In most cases, enter this skill from `grix_admin`'s `task` entry; the first line of `task` must clearly state `bind-local`, `create-and-bind`, or `category-manage`.
|
|
17
|
+
2. Only when executing remote API agent creation or category operations within this skill should you directly call `grix_admin` once, without passing `task` again.
|
|
18
18
|
3. In new flows, always explicitly pass `action` when directly calling `grix_admin`:
|
|
19
19
|
- `create_agent`
|
|
20
20
|
- `list_categories`
|
|
21
21
|
- `create_category`
|
|
22
22
|
- `update_category`
|
|
23
23
|
- `assign_category`
|
|
24
|
-
4. The legacy direct call format for `create_agent`
|
|
25
|
-
5. Use `bind-local` / `create-and-bind` for **OpenClaw** local configuration; use `connector-bind-local` / `create-and-connector-bind` for **grix-connector** local configuration. Do not mix the two targets in a single invocation.
|
|
24
|
+
4. The legacy direct call format for `create_agent` is still compatible, but should not be used in new flows.
|
|
26
25
|
|
|
27
26
|
## Agent Creation Intake
|
|
28
27
|
|
|
@@ -34,8 +33,8 @@ Before any `create_agent` API call:
|
|
|
34
33
|
- A concise, professional `agentName` that reflects the Agent's role.
|
|
35
34
|
- A professional `introduction` that states its purpose, core responsibilities, intended users or scenarios, operating expectations, and important boundaries.
|
|
36
35
|
4. Preserve the user's facts and intent. Do not invent permissions, business authority, expertise, or responsibilities that the user did not grant.
|
|
37
|
-
5. Treat `introduction` as the Agent's behavioral specification, not promotional copy.
|
|
38
|
-
6. Pass the finalized professional text in the actual `introduction` field of `action=create_agent
|
|
36
|
+
5. Treat `introduction` as the Agent's behavioral specification, not promotional copy.
|
|
37
|
+
6. Pass the finalized professional text in the actual `introduction` field of `action=create_agent`.
|
|
39
38
|
|
|
40
39
|
## Direct Action List
|
|
41
40
|
|
|
@@ -45,7 +44,7 @@ Before any `create_agent` API call:
|
|
|
45
44
|
- `categoryId` and `categoryName` cannot be provided simultaneously
|
|
46
45
|
- When `categoryName` is given, it first checks for duplicates under `parentCategoryId`; if not found, creates and assigns
|
|
47
46
|
2. `action=list_categories`
|
|
48
|
-
- Required:
|
|
47
|
+
- Required: none
|
|
49
48
|
3. `action=create_category`
|
|
50
49
|
- Required: `name`, `parentId`
|
|
51
50
|
- Optional: `sortOrder`
|
|
@@ -56,69 +55,37 @@ Before any `create_agent` API call:
|
|
|
56
55
|
- Required: `agentId`, `categoryId`
|
|
57
56
|
- `categoryId=0` means clear the category
|
|
58
57
|
|
|
59
|
-
## Mode A: bind-local (
|
|
58
|
+
## Mode A: bind-local (OpenClaw Local Binding)
|
|
60
59
|
|
|
61
|
-
Input fields (written in `grix_admin.task
|
|
60
|
+
Input fields (written in `grix_admin.task`):
|
|
62
61
|
|
|
63
62
|
1. First line must be `bind-local`
|
|
64
|
-
2. `agent_name`
|
|
65
|
-
3. `agent_id`
|
|
66
|
-
4. `api_endpoint`
|
|
67
|
-
5. `api_key`
|
|
63
|
+
2. `agent_name` (required)
|
|
64
|
+
3. `agent_id` (required)
|
|
65
|
+
4. `api_endpoint` (required)
|
|
66
|
+
5. `api_key` (required)
|
|
68
67
|
|
|
69
68
|
Execution rules:
|
|
70
69
|
|
|
71
|
-
1. Do not perform remote creation; execute local binding directly. Do not call
|
|
72
|
-
2. Prepare local directories
|
|
70
|
+
1. Do not perform remote creation; execute local binding directly. Do not call scripts that directly modify `openclaw.json`.
|
|
71
|
+
2. Prepare local directories:
|
|
73
72
|
- `workspace=~/.openclaw/workspace-<agent_name>`
|
|
74
73
|
- `agentDir=~/.openclaw/agents/<agent_name>/agent`
|
|
75
|
-
- Persona files
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
- `tools.profile`
|
|
82
|
-
- `tools.alsoAllow`
|
|
83
|
-
- `tools.sessions.visibility`
|
|
84
|
-
- To confirm existing Grix bindings, additionally use `openclaw agents bindings --agent <agent_name> --json` to view the current binding list
|
|
85
|
-
4. Calculate target values for this operation:
|
|
86
|
-
- `channels.grix.accounts.<agent_name>`: write `name`, `enabled=true`, `apiKey`, `wsUrl`, `agentId`
|
|
87
|
-
- `agents.list`: ensure entry exists with `id=<agent_name>`, `name=<agent_name>`, `workspace`, `agentDir`, `model`
|
|
88
|
-
- Grix binding: ensure the target agent is ultimately bound to `grix:<agent_name>`
|
|
89
|
-
- `tools.profile`: set to `"coding"`
|
|
90
|
-
- `tools.alsoAllow`: must include at least `message`, `grix_query`, `grix_group`, `grix_register`, `grix_message_send`, `grix_message_unsend`
|
|
91
|
-
- If the current binding target is the main agent, also ensure that agent's own `tools.alsoAllow` retains `grix_admin`, `grix_egg`, `grix_update`, `openclaw_memory_setup`; this set goes only at the agent level, not in global `tools.alsoAllow`
|
|
92
|
-
- `tools.sessions.visibility`: set to `"agent"`
|
|
93
|
-
- If `channels.grix.enabled=false`, change it back to `true`
|
|
94
|
-
5. Rules for determining `model`:
|
|
95
|
-
- First reuse the existing `model` from that local agent's entry
|
|
96
|
-
- If the existing entry has none, use `agents.defaults.model.primary`
|
|
97
|
-
- If still unavailable, clearly state that model is missing, stop execution, do not guess
|
|
98
|
-
6. Write using official CLI item by item; do not overwrite the entire config:
|
|
99
|
-
- `openclaw config set channels.grix.accounts.<agent_name> '<ACCOUNT_JSON>' --strict-json`
|
|
100
|
-
- `openclaw config set agents.list '<NEXT_AGENTS_LIST_JSON>' --strict-json`
|
|
101
|
-
- `openclaw agents bind --agent <agent_name> --bind grix:<agent_name>`
|
|
102
|
-
- `openclaw config set tools.profile '"coding"' --strict-json`
|
|
103
|
-
- `openclaw config set tools.alsoAllow '["message","grix_query","grix_group","grix_register","grix_message_send","grix_message_unsend"]' --strict-json`
|
|
104
|
-
- If the current binding target is the main agent, also merge `grix_admin`, `grix_egg`, `grix_update`, `openclaw_memory_setup` into that agent's own `agents.list` record's `tools.alsoAllow`; do not put this set in global `tools.alsoAllow`
|
|
105
|
-
- `openclaw config set tools.sessions.visibility '"agent"' --strict-json`
|
|
106
|
-
- Only when the current config explicitly has `channels.grix.enabled` turned off, execute `openclaw config set channels.grix.enabled true --strict-json`
|
|
107
|
-
7. After writing, must perform static validation:
|
|
74
|
+
- Persona files belong only in the workspace root; add minimal `IDENTITY.md`, `SOUL.md`, and `AGENTS.md` if required files are missing.
|
|
75
|
+
3. Read the current account, agent, tool profile, tool allowlist, session visibility, and binding configuration.
|
|
76
|
+
4. Resolve `model` by reusing the existing agent model, then `agents.defaults.model.primary`; if neither exists, report the missing model and stop.
|
|
77
|
+
5. Merge the account and agent entries, bind the agent to `grix:<agent_name>`, set the coding tool profile and required Grix tools, and restore `channels.grix.enabled=true` only if it is explicitly disabled.
|
|
78
|
+
6. Use official OpenClaw CLI commands item by item; do not overwrite the entire config.
|
|
79
|
+
7. Perform static validation:
|
|
108
80
|
- `openclaw config validate`
|
|
109
81
|
- `openclaw config get --json channels.grix.accounts.<agent_name>`
|
|
110
82
|
- `openclaw config get --json agents.list`
|
|
111
83
|
- `openclaw agents bindings --agent <agent_name> --json`
|
|
112
|
-
8. If
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
- Reply still shows old persona, old config, or obvious ID mismatch
|
|
116
|
-
9. Only when this `bind-local` invocation itself handles real verification, and step 7 static validation passed but step 8 real routing verification still fails, is one `openclaw gateway restart` allowed as targeted remediation; after restart, must redo the same round of real routing verification.
|
|
117
|
-
10. Success definition:
|
|
118
|
-
- Can perform real verification: only "static validation passed + real routing verification passed" counts as `bind-local` complete
|
|
119
|
-
- This invocation cannot yet perform real verification: can only clearly state "config has been written, runtime not yet tested, needs subsequent upper-level flow to continue verification"; do not claim it has fully taken effect
|
|
84
|
+
8. If real routing verification is available, perform it immediately. Falling back to the main agent, default assistant behavior, an old persona, or an ID mismatch means the runtime has not switched.
|
|
85
|
+
9. Only when static validation passes but real routing verification fails may one `openclaw gateway restart` be used as targeted remediation; then repeat the same verification once.
|
|
86
|
+
10. If real verification is unavailable, state “config has been written, runtime not yet tested, needs subsequent upper-level flow to continue verification”.
|
|
120
87
|
|
|
121
|
-
## Mode B: create-and-bind (
|
|
88
|
+
## Mode B: create-and-bind (Create Remote Agent Then Bind Locally)
|
|
122
89
|
|
|
123
90
|
Fields written in `grix_admin.task`:
|
|
124
91
|
|
|
@@ -126,175 +93,71 @@ Fields written in `grix_admin.task`:
|
|
|
126
93
|
2. `agentName` (required)
|
|
127
94
|
3. `introduction` (required; professionally organized according to **Agent Creation Intake**)
|
|
128
95
|
4. `isMain` (optional, default `false`)
|
|
129
|
-
5. `categoryId` (optional)
|
|
130
|
-
6. `categoryName` (optional)
|
|
131
|
-
7. `parentCategoryId` (optional
|
|
132
|
-
8. `categorySortOrder` (optional)
|
|
96
|
+
5. `categoryId` (optional)
|
|
97
|
+
6. `categoryName` (optional)
|
|
98
|
+
7. `parentCategoryId` (optional, default `0`)
|
|
99
|
+
8. `categorySortOrder` (optional)
|
|
133
100
|
|
|
134
101
|
Execution rules:
|
|
135
102
|
|
|
136
103
|
1. Confirm the current session is bound to a valid Grix account; cross-account execution is prohibited.
|
|
137
|
-
2. If both `categoryId` and `categoryName` are provided, report an error and stop
|
|
138
|
-
3. Call `grix_admin`
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
- Optional `parentCategoryId`
|
|
146
|
-
- Optional `categorySortOrder`
|
|
147
|
-
4. After remote creation succeeds, read `createdAgent.id`, `createdAgent.agent_name`, `createdAgent.api_endpoint`, `createdAgent.api_key` from the return result.
|
|
148
|
-
5. If the request included category information, check whether the return already includes the category assignment result; if not, proceed with supplementary steps according to `categoryId` / `categoryName` rules and explain the reason.
|
|
149
|
-
6. In the `categoryName` flow, if multiple categories with the exact same name appear under the same parent, stop and ask the owner to clean up categories or use an explicit `categoryId` instead.
|
|
150
|
-
7. After remote creation and optional category steps succeed, immediately transition to the `bind-local` local binding steps; if this invocation already has real verification context, follow the same "static validation -> real routing verification -> one restart if needed -> same-round retest" convergence rules; otherwise explicitly hand the "continue real verification" responsibility back to the upper-level flow.
|
|
151
|
-
8. `isMain=true` should only be used when actually creating a new main API agent; generally subsequent new agents should not enable this by default.
|
|
152
|
-
9. Throughout the `create-and-bind` flow, do not treat "config written successfully" as completion; only when this invocation itself handles real routing verification and verification fails should one `openclaw gateway restart` be treated as targeted remediation.
|
|
104
|
+
2. If both `categoryId` and `categoryName` are provided, report an error and stop.
|
|
105
|
+
3. Call `grix_admin` once with `action=create_agent`, passing `agentName`, `introduction`, and the supplied optional fields.
|
|
106
|
+
4. Read `createdAgent.id`, `createdAgent.agent_name`, `createdAgent.api_endpoint`, and `createdAgent.api_key` from the result.
|
|
107
|
+
5. If category assignment was requested but not completed by the return result, supplement it through the appropriate direct category actions.
|
|
108
|
+
6. In the `categoryName` flow, if multiple exact matches exist under the same parent, stop and ask the owner to use an explicit `categoryId`.
|
|
109
|
+
7. Continue immediately with `bind-local` using the returned parameters.
|
|
110
|
+
8. `isMain=true` should only be used when actually creating a new main API agent.
|
|
111
|
+
9. Do not claim completion until static validation and any available real routing verification pass.
|
|
153
112
|
|
|
154
113
|
## Mode C: category-manage (Category Management)
|
|
155
114
|
|
|
156
115
|
Fields written in `grix_admin.task`:
|
|
157
116
|
|
|
158
117
|
1. First line must be `category-manage`
|
|
159
|
-
2. `operation` (required):
|
|
118
|
+
2. `operation` (required): `list`, `create`, `update`, or `assign`
|
|
160
119
|
3. `name` (`create` / `update` required)
|
|
161
120
|
4. `parentId` (`create` / `update` required)
|
|
162
121
|
5. `sortOrder` (`create` / `update` optional)
|
|
163
|
-
6. `categoryId` (`update` / `assign` required;
|
|
122
|
+
6. `categoryId` (`update` / `assign` required; `0` clears an assignment)
|
|
164
123
|
7. `agentId` (`assign` required)
|
|
165
124
|
|
|
166
125
|
Execution rules:
|
|
167
126
|
|
|
168
|
-
1. Strictly
|
|
169
|
-
2.
|
|
170
|
-
3. `
|
|
171
|
-
|
|
172
|
-
4. `operation=create`
|
|
173
|
-
- Call `action=create_category`
|
|
174
|
-
5. `operation=update`
|
|
175
|
-
- Call `action=update_category`
|
|
176
|
-
6. `operation=assign`
|
|
177
|
-
- Call `action=assign_category`
|
|
178
|
-
- `categoryId=0` explicitly means clear the agent's current category
|
|
179
|
-
7. If the current management task also includes "creating a new agent", prefer using `create-and-bind`; do not split remote creation into other custom flows.
|
|
180
|
-
|
|
181
|
-
## Mode D: connector-bind-local (grix-connector Local Binding)
|
|
182
|
-
|
|
183
|
-
Input fields (written in `grix_admin.task`, all required):
|
|
184
|
-
|
|
185
|
-
1. First line must be `connector-bind-local`
|
|
186
|
-
2. `agent_name`
|
|
187
|
-
3. `agent_id`
|
|
188
|
-
4. `api_endpoint`
|
|
189
|
-
5. `api_key`
|
|
190
|
-
6. `client_type` (optional, default `pi`)
|
|
127
|
+
1. Strictly bind all operations to the current session account; cross-account execution is prohibited.
|
|
128
|
+
2. Complete all remote steps through `grix_admin` direct actions; do not hand-write HTTP or temporary scripts.
|
|
129
|
+
3. Map operations directly: `list_categories`, `create_category`, `update_category`, or `assign_category`.
|
|
130
|
+
4. If the task also creates a new agent, use `create-and-bind` instead.
|
|
191
131
|
|
|
192
|
-
|
|
132
|
+
## Remote Creation Fallback
|
|
193
133
|
|
|
194
|
-
|
|
195
|
-
2. Target file: `~/.grix/config/agents.json`. If the file or directory does not exist, initialize it as `{ "agents": [] }`.
|
|
196
|
-
3. Read the existing `agents` array. If an entry with the same `name` as `agent_name` already exists, update it in place; otherwise append a new entry.
|
|
197
|
-
4. Write the following fields into the entry:
|
|
198
|
-
- `name`: `agent_name`
|
|
199
|
-
- `ws_url`: `api_endpoint`
|
|
200
|
-
- `agent_id`: `agent_id`
|
|
201
|
-
- `api_key`: `api_key`
|
|
202
|
-
- `client_type`: `client_type` (default `pi`)
|
|
203
|
-
5. Preserve valid JSON and set file permissions to `0o600`. Before writing, create a timestamped backup at `~/.grix/config/agents.json.bak.<YYYYMMDDHHMMSS>` and also set the backup file permissions to `0o600`.
|
|
204
|
-
6. If `grix-connector` daemon is running (`grix-connector status` returns `daemon_state=running`), trigger reload via the daemon Admin API:
|
|
205
|
-
- Default endpoint: `POST http://127.0.0.1:19580/api/reload`
|
|
206
|
-
- The actual admin port may be overridden by `GRIX_ADMIN_PORT` or `--admin-port`; if the default fails, read `~/.grix/data/admin-port` for the current port.
|
|
207
|
-
- This endpoint is synchronous: it waits for `manager.reload()` to finish and returns `{ ok: true, result }` or an error. Unlike the CLI `grix-connector reload`, it does not suffer from "signal sent but config not yet applied" race conditions, and it surfaces JSON parse errors or `RELOAD_UNSAFE` failures to the caller.
|
|
208
|
-
- If the reload request returns an error, report the error and stop; do not proceed to verification.
|
|
209
|
-
7. After reload succeeds, verify that the daemon has loaded the new entry via `GET /api/agents`:
|
|
210
|
-
- Find an entry where `name === agent_name`.
|
|
211
|
-
- Confirm the entry exists and reports `alive === true`.
|
|
212
|
-
- **Important**: `alive=true` only means the daemon has started the Agent instance; it does **not** prove the Agent has successfully connected to the Grix platform or that the API key is valid. Authentication failures do not flip `alive` to `false`.
|
|
213
|
-
- Therefore, perform a secondary convergence check: inspect the latest daemon log in `~/.grix/log/` (files are named `grix-connector-<YYYY-MM-DD>.log`; list the directory and open the most recent one) for WebSocket connection success / authentication failure messages for this Agent, or ask the owner to send a test message to the Agent.
|
|
214
|
-
- If the secondary check fails, state "config loaded and instance started, but platform connection not yet verified"; do not claim full convergence.
|
|
215
|
-
8. If this invocation cannot perform real verification, clearly state "config has been written, reload completed, runtime not yet tested, needs subsequent flow to continue verification"; do not claim it has fully taken effect.
|
|
216
|
-
9. Success definition:
|
|
217
|
-
- Can perform real verification: "config written + reload succeeded + Agent entry exists with `alive=true` + platform connection verified (log or test message)" counts as `connector-bind-local` complete.
|
|
218
|
-
- Cannot perform real verification: only "config written + reload succeeded" can be claimed.
|
|
219
|
-
|
|
220
|
-
## Mode E: create-and-connector-bind (Create Remote Agent Then Bind to grix-connector)
|
|
134
|
+
If the task has neither existing agent parameters nor an online main channel with `agent.api.create`, stop and ask the owner to create the remote agent through the backend admin path. After obtaining the parameters, proceed with `bind-local`.
|
|
221
135
|
|
|
222
|
-
|
|
136
|
+
## Guardrails
|
|
223
137
|
|
|
224
|
-
1.
|
|
225
|
-
2. `
|
|
226
|
-
3. `
|
|
227
|
-
4.
|
|
228
|
-
5. `
|
|
229
|
-
6.
|
|
230
|
-
7.
|
|
231
|
-
8. `parentCategoryId` (optional): only used in the `categoryName` approach, default `0`
|
|
232
|
-
9. `categorySortOrder` (optional): only used when creating a category
|
|
138
|
+
1. Never ask for a website account or password.
|
|
139
|
+
2. `bind-local` must not call back to `grix-register`.
|
|
140
|
+
3. All remote creation and category actions must go through `grix_admin` direct actions via the current account's WS channel.
|
|
141
|
+
4. Never repeatedly echo the complete `api_key` in plaintext.
|
|
142
|
+
5. Do not manually modify `openclaw.json`; use official OpenClaw CLI commands.
|
|
143
|
+
6. Do not claim full convergence until static validation and any available real routing verification pass.
|
|
144
|
+
7. Use at most one targeted gateway restart, only under the failure conditions defined by `bind-local`.
|
|
233
145
|
|
|
234
|
-
|
|
146
|
+
## Error Handling
|
|
235
147
|
|
|
236
|
-
1.
|
|
237
|
-
2. If
|
|
238
|
-
3.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
- Optional `isMain`
|
|
243
|
-
- Optional `categoryId`
|
|
244
|
-
- Optional `categoryName`
|
|
245
|
-
- Optional `parentCategoryId`
|
|
246
|
-
- Optional `categorySortOrder`
|
|
247
|
-
4. After remote creation succeeds, read `createdAgent.id`, `createdAgent.agent_name`, `createdAgent.api_endpoint`, `createdAgent.api_key` from the return result.
|
|
248
|
-
5. If the request included category information, check whether the return already includes the category assignment result; if not, proceed with supplementary steps according to `categoryId` / `categoryName` rules and explain the reason.
|
|
249
|
-
6. In the `categoryName` flow, if multiple categories with the exact same name appear under the same parent, stop and ask the owner to clean up categories or use an explicit `categoryId` instead.
|
|
250
|
-
7. After remote creation and optional category steps succeed, immediately transition to the `connector-bind-local` local binding steps using the returned parameters and `clientType`.
|
|
251
|
-
8. Trigger reload via the synchronous Admin API `POST /api/reload` (see Mode D for port resolution and failure handling); then verify the new Agent entry exists and `alive=true` via `GET /api/agents`, and perform the secondary platform-connection verification (log inspection or test message).
|
|
252
|
-
9. `isMain=true` should only be used when actually creating a new main API agent; generally subsequent new agents should not enable this by default.
|
|
253
|
-
10. Throughout the `create-and-connector-bind` flow, do not treat "config written successfully" as completion; only when this invocation handles real verification and verification passes is it complete.
|
|
254
|
-
|
|
255
|
-
## Remote Creation Fallback Conditions
|
|
256
|
-
|
|
257
|
-
If the current task has neither an existing `agent_name`, `agent_id`, `api_endpoint`, `api_key`, nor an available online main channel or `agent.api.create` permission, stop this skill first and clearly prompt the user to create the remote agent through the backend admin path. After obtaining these parameters:
|
|
258
|
-
|
|
259
|
-
- For OpenClaw target, proceed with `bind-local`.
|
|
260
|
-
- For grix-connector target, proceed with `connector-bind-local`.
|
|
261
|
-
|
|
262
|
-
## Guardrails (Applicable to All Modes)
|
|
263
|
-
|
|
264
|
-
1. Never ask user for website account/password.
|
|
265
|
-
2. `bind-local` mode must not call back to `grix-register` to avoid circular routing.
|
|
266
|
-
3. All remote creation / category-related actions must only go through `grix_admin` direct actions via the current account's WS channel; do not hand-write HTTP or fall back to legacy scripts.
|
|
267
|
-
4. The complete `api_key` is only passed back once; do not repeatedly echo it in plaintext.
|
|
268
|
-
5. Before local `openclaw config set` / `validate` succeeds, do not claim config is complete; when this invocation can perform real verification, do not claim `bind-local` / `create-and-bind` is complete until real routing verification passes.
|
|
269
|
-
6. During an install private chat, do not manually modify `openclaw.json` and then execute `openclaw gateway restart`.
|
|
270
|
-
7. Do not reference or call `grix_agent_bind.py`; for OpenClaw modes this skill only uses official OpenClaw CLI commands.
|
|
271
|
-
8. For `connector-bind-local` / `create-and-connector-bind`, directly reading and writing `~/.grix/config/agents.json` is the intended mechanism; this is grix-connector's own configuration domain, not a third-party product.
|
|
272
|
-
9. When writing `~/.grix/config/agents.json`, always create a timestamped backup first, preserve valid JSON, and set both the config file and the backup file permissions to `0o600`.
|
|
273
|
-
10. After writing grix-connector config, trigger reload through the synchronous Admin API `POST /api/reload` (not the CLI `grix-connector reload`) so that reload errors are visible to the caller. Verify the Agent entry exists and reports `alive=true`, and perform a secondary platform-connection check before claiming full convergence.
|
|
274
|
-
|
|
275
|
-
## Error Handling Rules
|
|
276
|
-
|
|
277
|
-
1. `bind-local` / `connector-bind-local` missing fields: clearly state which field is missing and stop.
|
|
278
|
-
2. `create-and-bind` / `create-and-connector-bind` missing `agentName` or `introduction`: do not call the creation API; ask for the Agent's purpose, core responsibilities, intended users, and boundaries, then professionally organize both fields.
|
|
279
|
-
3. `create-and-bind` / `create-and-connector-bind` with both `categoryId` and `categoryName`: clearly state the conflict and stop.
|
|
280
|
-
4. `category-manage` missing `operation` or operation-specific fields: clearly state which field is missing and stop.
|
|
281
|
-
5. Remote returns `code=4003` or message explicitly mentions `agent.api.create`: tell the owner to grant `agent.api.create` on the Agent permissions page.
|
|
282
|
-
6. Remote returns `code=4003` or message explicitly mentions `agent.category.list` / `agent.category.create` / `agent.category.update` / `agent.category.assign`: tell the owner to grant the corresponding scope on the Agent permissions page.
|
|
283
|
-
7. Missing remote agent parameters and current account cannot create: clearly require backend admin creation first.
|
|
284
|
-
8. Local config failure (OpenClaw): return the failed command and result, then stop; emphasize which `get` / `set` / `validate` step failed.
|
|
285
|
-
9. Local config failure (grix-connector): report the exact JSON parse error, write error, or `~/.grix/config/agents.json` state, then stop.
|
|
286
|
-
10. Synchronous Admin API reload failed (e.g., returns non-2xx, `RELOAD_UNSAFE`, JSON parse error in agents.json): report the error body and daemon status; do not proceed to verification or claim the Agent is online.
|
|
287
|
-
11. Admin API verification failed (Agent entry missing or not `alive=true`): report the observed entry or missing entry, then stop.
|
|
288
|
-
12. Secondary platform-connection verification failed (log shows authentication/connection errors, or test message not delivered): state "config loaded and instance started, but platform connection not verified"; converge as partially complete, do not claim full convergence.
|
|
289
|
-
13. This invocation handles real routing verification, and after one `openclaw gateway restart` retest still fails: clearly state "static config has been written, but runtime has not yet switched successfully"; converge as failed or partially complete, do not write it as success.
|
|
148
|
+
1. For missing fields, clearly state which field is missing and stop.
|
|
149
|
+
2. If `agentName` or a usable `introduction` is missing, ask for the Agent's purpose, responsibilities, intended users, and boundaries before remote creation.
|
|
150
|
+
3. If both `categoryId` and `categoryName` are supplied, report the conflict and stop.
|
|
151
|
+
4. For `code=4003`, report the exact missing `agent.api.create` or `agent.category.*` scope.
|
|
152
|
+
5. Report the exact failed OpenClaw CLI command and validation result.
|
|
153
|
+
6. If one permitted restart and retest still fail, report the flow as failed or partially complete.
|
|
290
154
|
|
|
291
155
|
## Response Style
|
|
292
156
|
|
|
293
|
-
1. Clearly state whether the
|
|
294
|
-
2. Report
|
|
295
|
-
3. Clearly
|
|
296
|
-
4.
|
|
297
|
-
5. If remote creation succeeded but category or local binding subsequently failed, clearly state it is "partially complete"; do not generically write it as success.
|
|
157
|
+
1. Clearly state whether the execution is `bind-local`, `create-and-bind`, or `category-manage`.
|
|
158
|
+
2. Report remote creation, category handling, local config writing, and validation as separate phases when applicable.
|
|
159
|
+
3. Clearly distinguish static configuration success from verified runtime convergence.
|
|
160
|
+
4. If a later phase fails after remote creation, report the overall result as partially complete.
|
|
298
161
|
|
|
299
162
|
## References
|
|
300
163
|
|