grix-connector 4.2.3 → 4.2.4

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.
Files changed (40) hide show
  1. package/dist/adapter/claude/claude-adapter.js +18 -17
  2. package/dist/adapter/claude/claude-bridge-server.js +1 -1
  3. package/dist/adapter/claude/claude-tools.js +1 -1
  4. package/dist/adapter/claude/claude-worker-client.js +1 -1
  5. package/dist/adapter/claude/mcp-http-launcher.js +2 -2
  6. package/dist/adapter/claude/result-timeout.js +1 -1
  7. package/dist/assets/dsh-bridge/{grix-dsh-bridge-4.2.3.tgz → grix-dsh-bridge-4.2.4.tgz} +0 -0
  8. package/dist/assets/dsh-bridge/manifest.json +4 -4
  9. package/dist/core/access/allowlist-store.js +1 -1
  10. package/dist/core/file-ops/list-files.js +1 -1
  11. package/dist/default-skills/grix-access-control/SKILL.md +1 -1
  12. package/dist/default-skills/grix-admin/SKILL.md +110 -155
  13. package/dist/default-skills/grix-admin/references/api-contract.md +23 -12
  14. package/dist/default-skills/grix-agent-dispatch/SKILL.md +152 -188
  15. package/dist/default-skills/grix-audit-data/SKILL.md +1 -1
  16. package/dist/default-skills/grix-chat-state/SKILL.md +26 -43
  17. package/dist/default-skills/grix-egg/SKILL.md +1 -1
  18. package/dist/default-skills/grix-group/SKILL.md +1 -1
  19. package/dist/default-skills/grix-owner-relay/SKILL.md +30 -64
  20. package/dist/default-skills/grix-query/SKILL.md +1 -1
  21. package/dist/default-skills/grix-skill-library/SKILL.md +52 -0
  22. package/dist/default-skills/grix-widget-visitor-ban/SKILL.md +1 -1
  23. package/dist/default-skills/message-send/SKILL.md +1 -1
  24. package/dist/default-skills/message-unsend/SKILL.md +1 -1
  25. package/dist/default-skills/tailnet-file-share/SKILL.md +38 -72
  26. package/dist/default-skills/tailnet-file-share/references/certificate-trust.md +64 -0
  27. package/dist/log.js +2 -2
  28. package/dist/mcp/stream-http/config.js +1 -1
  29. package/dist/mcp/stream-http/connection-binding.js +1 -1
  30. package/dist/mcp/stream-http/security.js +1 -1
  31. package/dist/mcp/stream-http/tool-executor.js +1 -1
  32. package/dist/mcp/stream-http/tool-registry.js +1 -1
  33. package/dist/mcp/stream-http/tool-schemas.js +1 -1
  34. package/openclaw-plugin/skills/grix-admin/SKILL.md +122 -156
  35. package/openclaw-plugin/skills/grix-group/SKILL.md +52 -159
  36. package/openclaw-plugin/skills/grix-query/SKILL.md +54 -248
  37. package/openclaw-plugin/skills/grix-update/SKILL.md +70 -304
  38. package/openclaw-plugin/skills/message-send/SKILL.md +41 -172
  39. package/openclaw-plugin/skills/message-unsend/SKILL.md +29 -170
  40. package/package.json +1 -1
@@ -1,164 +1,130 @@
1
1
  ---
2
2
  name: grix-admin
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.
3
+ description: Grix agent administration for OpenClaw create remote API agents, manage agent categories, and rotate API keys through `grix_admin`, and bind an agent's remote parameters into the local OpenClaw configuration with validation and routing verification. Trigger when the user asks to create a new agent, bind an agent into this OpenClaw host, or manage agent categories.
4
4
  ---
5
5
 
6
- # Grix Agent Admin
7
-
8
- `grix-admin` is responsible for three things:
9
-
10
- 1. Landing existing remote agent parameters into local OpenClaw and handling runtime convergence after binding.
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
- 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
-
14
- ## Entry Method
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`, 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
- 3. In new flows, always explicitly pass `action` when directly calling `grix_admin`:
19
- - `create_agent`
20
- - `list_categories`
21
- - `create_category`
22
- - `update_category`
23
- - `assign_category`
24
- 4. The legacy direct call format for `create_agent` is still compatible, but should not be used in new flows.
25
-
26
- ## Agent Creation Intake
27
-
28
- Before any `create_agent` API call:
29
-
30
- 1. Ensure both `agentName` and `introduction` are present and specific. Never create an Agent with an empty, generic, or placeholder introduction.
31
- 2. If either the Agent name or a usable introduction is missing or too vague, pause before calling the tool and ask one concise question: “这个 Agent 主要做什么?核心职责、服务对象和工作边界是什么?”
32
- 3. Convert the user's answer into:
33
- - A concise, professional `agentName` that reflects the Agent's role.
34
- - A professional `introduction` that states its purpose, core responsibilities, intended users or scenarios, operating expectations, and important boundaries.
35
- 4. Preserve the user's facts and intent. Do not invent permissions, business authority, expertise, or responsibilities that the user did not grant.
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`.
38
-
39
- ## Direct Action List
40
-
41
- 1. `action=create_agent`
42
- - Required by this skill: `agentName`, `introduction`
43
- - Optional: `isMain`, `categoryId`, `categoryName`, `parentCategoryId`, `categorySortOrder`
44
- - `categoryId` and `categoryName` cannot be provided simultaneously
45
- - When `categoryName` is given, it first checks for duplicates under `parentCategoryId`; if not found, creates and assigns
46
- 2. `action=list_categories`
47
- - Required: none
48
- 3. `action=create_category`
49
- - Required: `name`, `parentId`
50
- - Optional: `sortOrder`
51
- 4. `action=update_category`
52
- - Required: `categoryId`, `name`, `parentId`
53
- - Optional: `sortOrder`
54
- 5. `action=assign_category`
55
- - Required: `agentId`, `categoryId`
56
- - `categoryId=0` means clear the category
57
-
58
- ## Mode A: bind-local (OpenClaw Local Binding)
59
-
60
- Input fields (written in `grix_admin.task`):
61
-
62
- 1. First line must be `bind-local`
63
- 2. `agent_name` (required)
64
- 3. `agent_id` (required)
65
- 4. `api_endpoint` (required)
66
- 5. `api_key` (required)
67
-
68
- Execution rules:
69
-
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:
72
- - `workspace=~/.openclaw/workspace-<agent_name>`
73
- - `agentDir=~/.openclaw/agents/<agent_name>/agent`
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:
6
+ # Grix Agent Admin (OpenClaw)
7
+
8
+ Three workflows:
9
+
10
+ | Workflow | What it does |
11
+ |---|---|
12
+ | [`bind-local`](#workflow-a--bind-local) | Bind an existing remote agent's parameters into local OpenClaw, validate, verify routing |
13
+ | [`create-and-bind`](#workflow-b--create-and-bind) | Create a remote agent via `grix_admin`, then run `bind-local` |
14
+ | [`category-manage`](#workflow-c--category-manage) | List / create / update / assign categories via `grix_admin` |
15
+
16
+ ## Two ways `grix_admin` is called
17
+
18
+ 1. **Delegated workflow** the caller passes only `task`, whose first line
19
+ names the workflow (`bind-local`, `create-and-bind`, `category-manage`)
20
+ followed by `key=value` lines. `grix-register` hands off this way. You then
21
+ run the workflow described below.
22
+ 2. **Direct action** — pass `action` plus its fields (table below). Use this
23
+ for every remote call *inside* a workflow. `task` and `action` cannot be
24
+ combined in one call.
25
+
26
+ All remote operations go through `grix_admin` on the current account's WS
27
+ channel — never hand-written HTTP or scripts, never across accounts, and
28
+ never ask the user for a website account or password.
29
+
30
+ ## `grix_admin` direct actions
31
+
32
+ | `action` | Required | Optional |
33
+ |---|---|---|
34
+ | `create_agent` | `agentName`, `introduction` | `isMain`, `categoryId`, `categoryName`, `parentCategoryId`, `categorySortOrder` |
35
+ | `list_categories` | | |
36
+ | `create_category` | `name`, `parentId` | `sortOrder` |
37
+ | `update_category` | `categoryId`, `name`, `parentId` | `sortOrder` |
38
+ | `assign_category` | `agentId`, `categoryId` (`0` clears) | — |
39
+ | `rotate_api_key` | `agentId` | — |
40
+
41
+ Notes:
42
+
43
+ - `categoryId` and `categoryName` are mutually exclusive — report the conflict
44
+ and stop if both are given.
45
+ - With `categoryName`, the backend looks for an exact match under
46
+ `parentCategoryId`, creating it if absent. If several exact matches exist,
47
+ stop and ask the owner for an explicit `categoryId`.
48
+ - `isMain=true` only when actually creating a new main API agent.
49
+ - `code=4003` means a missing scope — report the exact `agent.api.create` or
50
+ `agent.category.*` scope.
51
+
52
+ ## Agent creation intake (before any `create_agent`)
53
+
54
+ 1. `agentName` and `introduction` must both be present and specific. Never
55
+ create an agent with an empty, generic, or placeholder introduction.
56
+ 2. If either is missing or vague, ask one concise question in the user's
57
+ language: what does this agent mainly do — core responsibilities, whom it
58
+ serves, and its boundaries?
59
+ 3. Turn the answer into a concise professional `agentName` and an
60
+ `introduction` that states purpose, core responsibilities, intended users or
61
+ scenarios, operating expectations, and boundaries. Treat `introduction` as
62
+ the agent's behavioral specification, not marketing copy.
63
+ 4. Preserve the user's facts and intent; do not invent permissions, authority,
64
+ or expertise they did not grant.
65
+
66
+ ## Workflow A — `bind-local`
67
+
68
+ Inputs: `agent_name`, `agent_id`, `api_endpoint`, `api_key` (all required).
69
+ Missing field → say which and stop. Do not create anything remotely, and do
70
+ not call back to `grix-register`.
71
+
72
+ 1. Prepare local directories: `workspace=~/.openclaw/workspace-<agent_name>`
73
+ and `agentDir=~/.openclaw/agents/<agent_name>/agent`. Persona files live
74
+ only in the workspace root; add minimal `IDENTITY.md`, `SOUL.md`, and
75
+ `AGENTS.md` if missing.
76
+ 2. Read the current account, agent, tool profile, tool allowlist, session
77
+ visibility, and binding configuration.
78
+ 3. Resolve `model`: reuse the existing agent model, else
79
+ `agents.defaults.model.primary`; if neither exists, report the missing
80
+ model and stop.
81
+ 4. Merge the account and agent entries, bind the agent to
82
+ `grix:<agent_name>`, set the coding tool profile and required Grix tools,
83
+ and restore `channels.grix.enabled=true` only if it was explicitly
84
+ disabled. Apply each change with the official OpenClaw CLI item by item —
85
+ never overwrite or hand-edit `openclaw.json`.
86
+ 5. Static validation:
80
87
  - `openclaw config validate`
81
88
  - `openclaw config get --json channels.grix.accounts.<agent_name>`
82
89
  - `openclaw config get --json agents.list`
83
90
  - `openclaw agents bindings --agent <agent_name> --json`
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”.
87
-
88
- ## Mode B: create-and-bind (Create Remote Agent Then Bind Locally)
89
-
90
- Fields written in `grix_admin.task`:
91
-
92
- 1. First line must be `create-and-bind`
93
- 2. `agentName` (required)
94
- 3. `introduction` (required; professionally organized according to **Agent Creation Intake**)
95
- 4. `isMain` (optional, default `false`)
96
- 5. `categoryId` (optional)
97
- 6. `categoryName` (optional)
98
- 7. `parentCategoryId` (optional, default `0`)
99
- 8. `categorySortOrder` (optional)
100
-
101
- Execution rules:
102
-
103
- 1. Confirm the current session is bound to a valid Grix account; cross-account execution is prohibited.
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.
112
-
113
- ## Mode C: category-manage (Category Management)
114
-
115
- Fields written in `grix_admin.task`:
116
-
117
- 1. First line must be `category-manage`
118
- 2. `operation` (required): `list`, `create`, `update`, or `assign`
119
- 3. `name` (`create` / `update` required)
120
- 4. `parentId` (`create` / `update` required)
121
- 5. `sortOrder` (`create` / `update` optional)
122
- 6. `categoryId` (`update` / `assign` required; `0` clears an assignment)
123
- 7. `agentId` (`assign` required)
124
-
125
- Execution rules:
126
-
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.
131
-
132
- ## Remote Creation Fallback
133
-
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`.
135
-
136
- ## Guardrails
137
-
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`.
145
-
146
- ## Error Handling
147
-
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.
154
-
155
- ## Response Style
156
-
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.
161
-
162
- ## References
163
-
164
- 1. [references/api-contract.md](references/api-contract.md)
91
+ 6. If real routing verification is available, run it now. Falling back to the
92
+ main agent, default assistant behavior, an old persona, or an ID mismatch
93
+ means the runtime has not switched.
94
+ 7. Only when static validation passes but routing verification fails, run
95
+ **one** `openclaw gateway restart` and repeat the verification once.
96
+
97
+ Reporting: distinguish "config written and statically valid" from "runtime
98
+ verified". If verification cannot be run, say "config has been written,
99
+ runtime not yet tested, needs the upper-level flow to continue verification".
100
+ Never echo the full `api_key` in plaintext.
101
+
102
+ ## Workflow B `create-and-bind`
103
+
104
+ Inputs: `agentName`, `introduction` (required; run the intake above);
105
+ `isMain`, `categoryId` | `categoryName`, `parentCategoryId` (default `0`),
106
+ `categorySortOrder` (optional).
107
+
108
+ 1. Call `grix_admin` once with `action=create_agent` and the supplied fields.
109
+ 2. Read `createdAgent.id`, `agent_name`, `api_endpoint`, `api_key` from the
110
+ result. If a requested category was not applied, finish it with the
111
+ category actions.
112
+ 3. Continue immediately with Workflow A using those values.
113
+ 4. Report remote creation and local binding as separate phases; if binding
114
+ fails after creation succeeded, report the overall result as partial.
115
+
116
+ Fallback: if no agent parameters exist and the current account lacks
117
+ `agent.api.create`, stop and ask the owner to create the agent in the backend
118
+ admin, then run Workflow A with the parameters they provide.
119
+
120
+ ## Workflow C — `category-manage`
121
+
122
+ Inputs: `operation` (`list` | `create` | `update` | `assign`) plus the fields
123
+ required by the matching action above. Map directly to `list_categories`,
124
+ `create_category`, `update_category`, `assign_category`. If the request also
125
+ creates an agent, use Workflow B instead.
126
+
127
+ ## Reference
128
+
129
+ [references/api-contract.md](references/api-contract.md) request/response
130
+ shapes for each action and the local binding checklist.
@@ -3,162 +3,55 @@ name: grix-group
3
3
  description: Use the typed `grix_group` tool for Grix group lifecycle and membership operations. Trigger when users ask to create, inspect, leave, update, or dissolve groups, or when these operations fail with scope or permission errors.
4
4
  ---
5
5
 
6
- # Grix Group Governance
7
-
8
- Operate group-governance actions through the `grix_group` tool.
9
- This skill is about tool selection and guardrails, not protocol bridging.
10
-
11
- ## Workflow
12
-
13
- 1. Parse the user request into one action:
14
- `create`, `detail`, `leave`, `add_members`, `remove_members`, `update_member_role`, `update_all_members_muted`, `update_member_speaking`, or `dissolve`.
15
- 2. Validate required fields before any call.
16
- 3. Call `grix_group` exactly once per business action.
17
- 4. Classify failures by HTTP/BizCode and return exact remediation.
18
- 5. Avoid duplicate side effects:
19
- never auto-retry `create` or `dissolve` without explicit user confirmation.
20
-
21
- ## Tool Contract
22
-
23
- For Grix group governance, always call:
24
-
25
- 1. Tool: `grix_group`
26
- 2. `action`: one of `create`, `detail`, `leave`, `add_members`, `remove_members`, `update_member_role`, `update_all_members_muted`, `update_member_speaking`, `dissolve`
27
- 3. `accountId`: always pass `{{AccountId}}` from the current conversation context for every action, including `leave`.
28
-
29
- Rules:
30
-
31
- 1. Pass business parameters with their exact typed field names.
32
- 2. Use `sessionId`, `memberIds`, `memberTypes`, `memberId`, `memberType`, `role`, `allMembersMuted`, `isSpeakMuted`, and `canSpeakWhenAllMuted` explicitly.
33
- 3. Do not invent aliases or fallback fields.
34
- 4. Keep one tool call per action for audit clarity.
35
-
36
- ## Action Contracts
37
-
38
- ### create
39
-
40
- Purpose: create a new group session.
41
-
42
- Required input:
43
-
44
- 1. `name` (non-empty string)
45
- 2. `memberIds` (optional string array; each item numeric text)
46
- 3. `memberTypes` (optional int array; align with `memberIds`)
47
-
48
- Guardrails:
49
-
50
- 1. Ask for clarification if group name is missing.
51
- 2. Ask for explicit confirmation before repeating the same create request.
52
- 3. Treat this action as non-idempotent.
53
-
54
- ### add_members
55
-
56
- Purpose: add members into an existing group.
57
-
58
- Required input:
59
-
60
- 1. `sessionId` (non-empty string)
61
- 2. `memberIds` (non-empty string array; each item numeric text)
62
- 3. `memberTypes` (optional int array; align with `memberIds`)
63
-
64
- Guardrails:
65
-
66
- 1. Reject empty `sessionId` before calling the tool.
67
- 2. Reject non-numeric `memberIds` before calling the tool.
68
- 3. If `sessionId` is ambiguous, ask the user to confirm the target group first.
69
-
70
- ### leave
71
-
72
- Purpose: let the current Agent leave a group by itself.
73
-
74
- Required input:
75
-
76
- 1. `sessionId`
77
-
78
- Guardrails:
79
-
80
- 1. Only execute this when the requester is clearly the current Agent owner, or an already-established authorized operator in the current context.
81
- 2. If the requester identity is unclear, ask for confirmation first; if it is clearly unauthorized, reject directly and do not call `grix_group`.
82
- 3. This action is only for the current Agent leaving its own group membership.
83
- 4. Never translate a request to remove other members into `leave`; use `remove_members` for that.
84
- 5. Do not send `memberId`, `memberIds`, or `memberTypes` with this action.
85
- 6. This action does not require scope and should not be described as a scope-grant workflow.
86
- 7. Execute `leave` silently: do not send any pre-leave or farewell message to the group before leaving.
87
-
88
- ### remove_members
89
-
90
- Required input:
91
-
92
- 1. `sessionId`
93
- 2. `memberIds`
94
-
95
- ### update_member_role
96
-
97
- Required input:
98
-
99
- 1. `sessionId`
100
- 2. `memberId`
101
- 3. `role`
102
-
103
- Guardrails:
104
-
105
- 1. Only use `memberType=1` for role updates.
106
- 2. Never guess a role value; confirm when unclear.
107
-
108
- ### update_all_members_muted
109
-
110
- Required input:
111
-
112
- 1. `sessionId`
113
- 2. `allMembersMuted`
114
-
115
- Guardrails:
116
-
117
- 1. Only use this for group-wide mute state changes.
118
- 2. Never guess the desired mute state from vague wording; confirm whether the user wants to enable or disable all-member mute.
119
-
120
- ### update_member_speaking
121
-
122
- Required input:
123
-
124
- 1. `sessionId`
125
- 2. `memberId`
126
- 3. At least one of `isSpeakMuted` or `canSpeakWhenAllMuted`
127
-
128
- Guardrails:
129
-
130
- 1. Only use `memberType=1` or `memberType=2`.
131
- 2. Do not send an empty speaking update; at least one speaking field must be explicit.
132
- 3. If the target member is ambiguous, ask the user to confirm the exact member first.
133
-
134
- ### detail / dissolve
135
-
136
- Required input:
137
-
138
- 1. `sessionId`
139
-
140
- ## Error Handling Rules
141
-
142
- 1. `403/20011`:
143
- report missing scope and ask owner to grant the scope in Aibot Agent permission page.
144
- Do not use this remediation for `leave`, because `leave` is scope-free.
145
- 2. `401/10001`:
146
- report invalid key/auth and suggest checking agent config or rotating API key.
147
- 3. `403/10002`:
148
- report agent is not active or invalid provider type.
149
- 4. `400/10003`:
150
- report invalid/missing parameters and ask user for corrected values.
151
- 5. Other errors:
152
- return backend `msg` and stop automatic retries.
153
-
154
- ## Response Style
155
-
156
- 1. State action result first.
157
- 2. Include key identifiers (`session_id`, member count, mute state) when successful.
158
- 3. Include exact remediation when failed.
159
- 4. Never hide scope or auth errors behind generic wording.
160
- 5. For `leave`, report result to the requester only; do not post extra messages into the group session.
161
-
162
- ## References
163
-
164
- 1. Load [references/api-contract.md](references/api-contract.md) when you need exact tool mapping, payload examples, and scope matrix.
6
+ # Grix Group
7
+
8
+ Use `grix_group` for group lifecycle and membership management. The Grix
9
+ account is resolved from the current agent context; you do not pass it.
10
+
11
+ ## Tool contract
12
+
13
+ Call `grix_group` with one `action`; use the exact typed field names below.
14
+
15
+ | `action` | Required | Optional |
16
+ |---|---|---|
17
+ | `create` | `name` | `memberIds` (numeric strings) + `memberTypes` (1=user, 2=agent), aligned by index |
18
+ | `detail` | `sessionId` | — |
19
+ | `leave` | `sessionId` | (never send member fields) |
20
+ | `dissolve` | `sessionId` | — |
21
+ | `add_members` / `remove_members` | `sessionId`, `memberIds` | `memberTypes`, aligned by index |
22
+ | `update_member_role` | `sessionId`, `memberId`, `role` (1=admin, 2=member) | — (`memberType` is always 1) |
23
+ | `update_all_members_muted` | `sessionId`, `allMembersMuted` | — |
24
+ | `update_member_speaking` | `sessionId`, `memberId`, at least one of `isSpeakMuted` / `canSpeakWhenAllMuted` | `memberType` (1 or 2) |
25
+
26
+ ## Rules
27
+
28
+ 1. Validate required fields before calling; reject non-numeric `memberIds`
29
+ and empty `sessionId` yourself. Resolve an unknown or ambiguous group with
30
+ `grix_query` (`session_search`) and confirm with the user first.
31
+ 2. One call per business action. `create` and `dissolve` are not idempotent —
32
+ never auto-retry them; ask for explicit confirmation before repeating.
33
+ 3. Never guess a role or mute state from vague wording; confirm whether the
34
+ user wants it enabled or disabled.
35
+ 4. `leave` removes only the current agent from the group. Execute it only
36
+ for the owner or an already-established authorized operator; if identity
37
+ is unclear, confirm first. Leave silently — no farewell message — and
38
+ report the result only to the requester. To remove someone else use
39
+ `remove_members`. `leave` needs no scope, so never answer a `leave`
40
+ failure with scope-grant guidance.
41
+ 5. On errors, report the exact failure and fix; do not retry blindly:
42
+ - `403/20011` — missing scope (usually not an admin of that group); ask the
43
+ owner to grant it in the agent permission page.
44
+ - `401/10001` invalid key/auth; check agent config or rotate the key.
45
+ - `403/10002` agent not active or invalid provider type.
46
+ - `400/10003` invalid or missing parameters.
47
+
48
+ ## Response style
49
+
50
+ State the result first with key identifiers (`session_id`, member count,
51
+ mute state); on failure give the exact remediation and never hide scope or
52
+ auth errors behind generic wording.
53
+
54
+ ## Reference
55
+
56
+ [references/api-contract.md](references/api-contract.md) exact tool
57
+ mapping, payload examples, and scope matrix.