@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 +128 -159
- package/dist/index.js +1279 -1
- package/package.json +4 -11
- package/skills/egg-install/SKILL.md +21 -0
- package/skills/egg-install/references/api-contract.md +38 -0
- package/skills/grix-agent-admin/SKILL.md +85 -0
- package/skills/grix-agent-admin/agents/openai.yaml +4 -0
- package/skills/grix-agent-admin/references/api-contract.md +87 -0
- package/skills/grix-agent-admin/scripts/grix_agent_bind.py +587 -0
- package/skills/grix-group-governance/SKILL.md +144 -0
- package/skills/grix-group-governance/agents/openai.yaml +4 -0
- package/skills/grix-group-governance/references/api-contract.md +73 -0
- package/skills/grix-query/SKILL.md +151 -0
- package/skills/grix-query/agents/openai.yaml +4 -0
- package/skills/grix-auth-access/SKILL.md +0 -173
- package/skills/grix-auth-access/agents/openai.yaml +0 -4
- package/skills/grix-auth-access/references/api-contract.md +0 -56
- package/skills/grix-auth-access/references/grix-concepts.md +0 -30
- package/skills/grix-auth-access/references/openclaw-setup.md +0 -154
- package/skills/grix-auth-access/references/user-replies.md +0 -25
- package/skills/grix-auth-access/scripts/grix_auth.py +0 -1527
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grix-group-governance
|
|
3
|
+
description: Use the typed `grix_group` tool for Grix group lifecycle and membership operations. Trigger when users ask to create, inspect, update, or dissolve groups, or when these operations fail with scope or permission errors.
|
|
4
|
+
---
|
|
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`, `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`, `add_members`, `remove_members`, `update_member_role`, `update_all_members_muted`, `update_member_speaking`, `dissolve`
|
|
27
|
+
3. `accountId`: optional; include it when the configured account is ambiguous
|
|
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
|
+
### remove_members
|
|
71
|
+
|
|
72
|
+
Required input:
|
|
73
|
+
|
|
74
|
+
1. `sessionId`
|
|
75
|
+
2. `memberIds`
|
|
76
|
+
|
|
77
|
+
### update_member_role
|
|
78
|
+
|
|
79
|
+
Required input:
|
|
80
|
+
|
|
81
|
+
1. `sessionId`
|
|
82
|
+
2. `memberId`
|
|
83
|
+
3. `role`
|
|
84
|
+
|
|
85
|
+
Guardrails:
|
|
86
|
+
|
|
87
|
+
1. Only use `memberType=1` for role updates.
|
|
88
|
+
2. Never guess a role value; confirm when unclear.
|
|
89
|
+
|
|
90
|
+
### update_all_members_muted
|
|
91
|
+
|
|
92
|
+
Required input:
|
|
93
|
+
|
|
94
|
+
1. `sessionId`
|
|
95
|
+
2. `allMembersMuted`
|
|
96
|
+
|
|
97
|
+
Guardrails:
|
|
98
|
+
|
|
99
|
+
1. Only use this for group-wide mute state changes.
|
|
100
|
+
2. Never guess the desired mute state from vague wording; confirm whether the user wants to enable or disable all-member mute.
|
|
101
|
+
|
|
102
|
+
### update_member_speaking
|
|
103
|
+
|
|
104
|
+
Required input:
|
|
105
|
+
|
|
106
|
+
1. `sessionId`
|
|
107
|
+
2. `memberId`
|
|
108
|
+
3. At least one of `isSpeakMuted` or `canSpeakWhenAllMuted`
|
|
109
|
+
|
|
110
|
+
Guardrails:
|
|
111
|
+
|
|
112
|
+
1. Only use `memberType=1` or `memberType=2`.
|
|
113
|
+
2. Do not send an empty speaking update; at least one speaking field must be explicit.
|
|
114
|
+
3. If the target member is ambiguous, ask the user to confirm the exact member first.
|
|
115
|
+
|
|
116
|
+
### detail / dissolve
|
|
117
|
+
|
|
118
|
+
Required input:
|
|
119
|
+
|
|
120
|
+
1. `sessionId`
|
|
121
|
+
|
|
122
|
+
## Error Handling Rules
|
|
123
|
+
|
|
124
|
+
1. `403/20011`:
|
|
125
|
+
report missing scope and ask owner to grant the scope in Aibot Agent permission page.
|
|
126
|
+
2. `401/10001`:
|
|
127
|
+
report invalid key/auth and suggest checking agent config or rotating API key.
|
|
128
|
+
3. `403/10002`:
|
|
129
|
+
report agent is not active or invalid provider type.
|
|
130
|
+
4. `400/10003`:
|
|
131
|
+
report invalid/missing parameters and ask user for corrected values.
|
|
132
|
+
5. Other errors:
|
|
133
|
+
return backend `msg` and stop automatic retries.
|
|
134
|
+
|
|
135
|
+
## Response Style
|
|
136
|
+
|
|
137
|
+
1. State action result first.
|
|
138
|
+
2. Include key identifiers (`session_id`, member count, mute state) when successful.
|
|
139
|
+
3. Include exact remediation when failed.
|
|
140
|
+
4. Never hide scope or auth errors behind generic wording.
|
|
141
|
+
|
|
142
|
+
## References
|
|
143
|
+
|
|
144
|
+
1. Load [references/api-contract.md](references/api-contract.md) when you need exact tool mapping, payload examples, and scope matrix.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Grix Group Governance"
|
|
3
|
+
short_description: "Use the typed grix_group tool for Grix group operations."
|
|
4
|
+
default_prompt: "Use this skill when users ask to create, inspect, update, or dissolve Grix groups. Validate parameters, call grix_group exactly once per action, and return clear remediation for scope/auth/parameter failures."
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# API Contract
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Map high-level governance actions to Aibot Agent API HTTP routes.
|
|
6
|
+
|
|
7
|
+
## Base Rules
|
|
8
|
+
|
|
9
|
+
1. Base path: `/v1/agent-api`
|
|
10
|
+
2. Auth: `Authorization: Bearer <agent_api_key>`
|
|
11
|
+
3. Only `provider_type=3` and `status=active` agent can access.
|
|
12
|
+
4. Scope middleware executes before service business checks.
|
|
13
|
+
|
|
14
|
+
## Action Mapping (v1)
|
|
15
|
+
|
|
16
|
+
| Action | Method | Route | Required Scope |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| `group_create` | `POST` | `/sessions/create_group` | `group.create` |
|
|
19
|
+
| `group_member_add` | `POST` | `/sessions/members/add` | `group.member.add` |
|
|
20
|
+
|
|
21
|
+
## OpenClaw Tool Mapping
|
|
22
|
+
|
|
23
|
+
Use the native `grix_group` tool with typed fields:
|
|
24
|
+
|
|
25
|
+
| Tool action | HTTP action | Required fields |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| `create` | `group_create` | `name` |
|
|
28
|
+
| `detail` | `group_detail_read` | `sessionId` |
|
|
29
|
+
| `add_members` | `group_member_add` | `sessionId`, `memberIds` |
|
|
30
|
+
| `remove_members` | `group_member_remove` | `sessionId`, `memberIds` |
|
|
31
|
+
| `update_member_role` | `group_member_role_update` | `sessionId`, `memberId`, `role` |
|
|
32
|
+
| `update_all_members_muted` | `group_all_members_muted_update` | `sessionId`, `allMembersMuted` |
|
|
33
|
+
| `update_member_speaking` | `group_member_speaking_update` | `sessionId`, `memberId`, `isSpeakMuted` or `canSpeakWhenAllMuted` |
|
|
34
|
+
| `dissolve` | `group_dissolve` | `sessionId` |
|
|
35
|
+
|
|
36
|
+
## Payload Templates
|
|
37
|
+
|
|
38
|
+
### create
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"action": "create",
|
|
43
|
+
"name": "项目协作群",
|
|
44
|
+
"memberIds": ["1002", "9991"],
|
|
45
|
+
"memberTypes": [1, 2]
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### add_members
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"action": "add_members",
|
|
54
|
+
"sessionId": "task_room_9083",
|
|
55
|
+
"memberIds": ["1003"],
|
|
56
|
+
"memberTypes": [1]
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Error Matrix
|
|
61
|
+
|
|
62
|
+
| HTTP/BizCode | Meaning | Skill Response |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `403/20011` | agent scope forbidden | Tell owner to grant corresponding scope |
|
|
65
|
+
| `400/10003` | invalid request payload | Ask for missing or corrected parameters |
|
|
66
|
+
| `401/10001` | invalid or missing auth | Check api_key and account config |
|
|
67
|
+
| `403/10002` | agent not active / invalid provider | Ask owner to activate the agent |
|
|
68
|
+
|
|
69
|
+
## Retry Policy
|
|
70
|
+
|
|
71
|
+
1. Never auto-retry `group_create` unless user confirms.
|
|
72
|
+
2. Allow one retry for transient network failure only.
|
|
73
|
+
3. Do not retry auth/scope/parameter failures automatically.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grix-query
|
|
3
|
+
description: Use the typed `grix_query` tool for Grix contact search, session search, and session message history lookup. Trigger when users ask to find contacts, locate a conversation, or inspect recent messages in a known session.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Grix Query
|
|
7
|
+
|
|
8
|
+
Use the `grix_query` tool for read-only Grix lookup actions.
|
|
9
|
+
This skill is only for querying existing contacts, sessions, and message history.
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
1. Parse the user request into one action:
|
|
14
|
+
`contact_search`, `session_search`, or `message_history`.
|
|
15
|
+
2. Validate required fields before any tool call.
|
|
16
|
+
3. Call `grix_query` exactly once per business action.
|
|
17
|
+
4. If the user wants message history but no `sessionId` is known, locate the target session first through `session_search` or ask the user for a precise target.
|
|
18
|
+
5. Return exact remediation for scope, auth, and parameter failures.
|
|
19
|
+
|
|
20
|
+
## Tool Contract
|
|
21
|
+
|
|
22
|
+
For Grix query actions, always call:
|
|
23
|
+
|
|
24
|
+
1. Tool: `grix_query`
|
|
25
|
+
2. `action`: one of `contact_search`, `session_search`, or `message_history`
|
|
26
|
+
3. `accountId`: optional; include it when the configured account is ambiguous
|
|
27
|
+
|
|
28
|
+
Rules:
|
|
29
|
+
|
|
30
|
+
1. Pass query parameters with their exact typed field names.
|
|
31
|
+
2. Use `id` for `contact_search` and `session_search`.
|
|
32
|
+
3. Use `sessionId`, `beforeId`, and `limit` explicitly for message history.
|
|
33
|
+
4. Never invent a `sessionId`. Resolve it from context, from a previous tool result, or ask the user.
|
|
34
|
+
5. Keep one tool call per action for audit clarity.
|
|
35
|
+
|
|
36
|
+
## Single Lookup Usage
|
|
37
|
+
|
|
38
|
+
When the user already provides one exact ID, do not do fuzzy search.
|
|
39
|
+
Call the corresponding search action once and return the backend result as-is in the normal search-result shape.
|
|
40
|
+
|
|
41
|
+
1. Single contact lookup:
|
|
42
|
+
use `action: "contact_search"` and pass `id`
|
|
43
|
+
2. Single session lookup:
|
|
44
|
+
use `action: "session_search"` and pass `id`
|
|
45
|
+
|
|
46
|
+
ID meaning:
|
|
47
|
+
|
|
48
|
+
1. `contact_search.id`:
|
|
49
|
+
contact or Agent numeric ID, for example `1002` or `9992`
|
|
50
|
+
2. `session_search.id`:
|
|
51
|
+
exact session ID string, for example `task_room_9083`
|
|
52
|
+
|
|
53
|
+
Examples:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"action": "contact_search",
|
|
58
|
+
"id": "1002"
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"action": "session_search",
|
|
65
|
+
"id": "task_room_9083"
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Action Contracts
|
|
70
|
+
|
|
71
|
+
### contact_search
|
|
72
|
+
|
|
73
|
+
Purpose: search the owner's Grix contact directory.
|
|
74
|
+
When `id` is provided, return the exact matching contact record in the same search-result shape.
|
|
75
|
+
|
|
76
|
+
Required input:
|
|
77
|
+
|
|
78
|
+
1. `id` (contact ID, numeric string)
|
|
79
|
+
|
|
80
|
+
Optional input:
|
|
81
|
+
|
|
82
|
+
1. `limit`
|
|
83
|
+
2. `offset`
|
|
84
|
+
|
|
85
|
+
Guardrails:
|
|
86
|
+
|
|
87
|
+
1. Use this when the target contact ID is already known and you need the exact contact entry.
|
|
88
|
+
2. Do not jump directly to session history from a vague contact hint; resolve the contact or session first.
|
|
89
|
+
3. `id` must be the current contact's numeric ID, not username, nickname, remark name, or session ID.
|
|
90
|
+
|
|
91
|
+
### session_search
|
|
92
|
+
|
|
93
|
+
Purpose: search the owner's visible sessions by final display title.
|
|
94
|
+
When `id` is provided, return the exact matching session in the same search-result shape.
|
|
95
|
+
|
|
96
|
+
Required input:
|
|
97
|
+
|
|
98
|
+
1. `id` (session ID)
|
|
99
|
+
|
|
100
|
+
Optional input:
|
|
101
|
+
|
|
102
|
+
1. `limit`
|
|
103
|
+
2. `offset`
|
|
104
|
+
|
|
105
|
+
Guardrails:
|
|
106
|
+
|
|
107
|
+
1. Use this when the target session ID is already known and you need the exact session entry.
|
|
108
|
+
2. If multiple sessions match, present the candidates and let the user choose before reading history.
|
|
109
|
+
3. `id` must be the exact current `session_id`, not group name, title text, or contact ID.
|
|
110
|
+
|
|
111
|
+
### message_history
|
|
112
|
+
|
|
113
|
+
Purpose: read recent message history from a known session.
|
|
114
|
+
|
|
115
|
+
Required input:
|
|
116
|
+
|
|
117
|
+
1. `sessionId`
|
|
118
|
+
|
|
119
|
+
Optional input:
|
|
120
|
+
|
|
121
|
+
1. `beforeId`
|
|
122
|
+
2. `limit`
|
|
123
|
+
|
|
124
|
+
Guardrails:
|
|
125
|
+
|
|
126
|
+
1. Only call this after the target session is unambiguous.
|
|
127
|
+
2. Use `beforeId` only for older-page pagination.
|
|
128
|
+
3. Do not claim to have full history if only one page was fetched.
|
|
129
|
+
|
|
130
|
+
## Error Handling Rules
|
|
131
|
+
|
|
132
|
+
1. `403/20011`:
|
|
133
|
+
report missing scope and ask the owner to grant the required scope in the Aibot Agent permission page.
|
|
134
|
+
2. `401/10001`:
|
|
135
|
+
report invalid key/auth and suggest checking agent config or rotating the API key.
|
|
136
|
+
3. `403/10002`:
|
|
137
|
+
report the agent is not active or has an invalid provider type.
|
|
138
|
+
4. `400/10003`:
|
|
139
|
+
report invalid or missing parameters and ask the user for corrected values.
|
|
140
|
+
5. `404/4004`:
|
|
141
|
+
report the target session does not exist or is not visible.
|
|
142
|
+
6. Other errors:
|
|
143
|
+
return the backend `msg` and stop automatic retries.
|
|
144
|
+
|
|
145
|
+
## Response Style
|
|
146
|
+
|
|
147
|
+
1. State the query result first.
|
|
148
|
+
2. Include key identifiers from successful lookups:
|
|
149
|
+
`peer_id` / `peer_type` for contacts, `session_id` for sessions, and message identifiers for history.
|
|
150
|
+
3. If history results may be partial, state that clearly.
|
|
151
|
+
4. Never hide scope or auth errors behind generic wording.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
agent:
|
|
3
|
+
name: grix-query
|
|
4
|
+
default_prompt: "Use this skill when users ask to find Grix contacts, locate sessions, or inspect a known session's message history. Validate required parameters, call grix_query exactly once per action, and do not fabricate a sessionId."
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: grix-auth-access
|
|
3
|
-
description: 用 Grix 协议创建或复用 `provider_type=3` 的 Agent API 类型 agent,并按 `@dhf-openclaw/grix` 与 `@dhf-openclaw/grix-admin` 说明为 OpenClaw 主 agent 配置 grix 渠道和群管理能力。插件接入目标是让用户在 `https://grix.dhf.pub/` 管理 OpenClaw,并支持移动端 PWA 页面。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Grix Auth Access
|
|
7
|
-
|
|
8
|
-
Use the bundled scripts and local OpenClaw CLI to bootstrap Grix channel access for the main OpenClaw agent.
|
|
9
|
-
|
|
10
|
-
## Business Capabilities
|
|
11
|
-
|
|
12
|
-
1. `create-api-agent`
|
|
13
|
-
2. `inspect@dhf-openclaw`
|
|
14
|
-
3. `configure@dhf-openclaw`
|
|
15
|
-
4. `bootstrap@dhf-openclaw`
|
|
16
|
-
|
|
17
|
-
## Explain Grix
|
|
18
|
-
|
|
19
|
-
When the user asks what Grix is, what they gain after setup, or whether it is worth configuring, explain it with these points:
|
|
20
|
-
|
|
21
|
-
1. Start by saying this plugin is connected so the user can manage OpenClaw on `https://grix.dhf.pub/`, with mobile PWA page support.
|
|
22
|
-
2. Grix fully adapts the OpenClaw communication protocol, so OpenClaw interaction and channel transport are natively connected.
|
|
23
|
-
3. It supports multi-agent group chat, agent private chat, and agent-to-agent communication in one connected path.
|
|
24
|
-
4. Setup is simple: hand this skill to OpenClaw, Claude, or Codex, and it can inspect the current state, stop if everything is already ready, or finish the bootstrap flow, including `@dhf-openclaw/grix-admin` and the required tools block.
|
|
25
|
-
5. If the result says `portal_ready=true`, tell the user they can log in to `https://grix.dhf.pub/` directly and start using it.
|
|
26
|
-
6. Prefer the returned `user_reply_templates.recommended_message` when you want a concise user-facing answer.
|
|
27
|
-
|
|
28
|
-
## Fast Path
|
|
29
|
-
|
|
30
|
-
If the user wants the main OpenClaw agent to gain Grix channel ability quickly:
|
|
31
|
-
|
|
32
|
-
1. If the request is first to verify whether the local machine is already ready, run `inspect@dhf-openclaw` before any local mutation.
|
|
33
|
-
2. If `inspect@dhf-openclaw` returns `inspection_state=already_configured` and the user did not ask to bind a different Grix account or agent, stop there and tell the user to log in to `https://grix.dhf.pub/` directly.
|
|
34
|
-
3. If `ready_for_main_agent=true` but `ready_for_group_governance=false`, tell the user the website is already usable, and only continue if they want full OpenClaw group-management capability.
|
|
35
|
-
4. Otherwise prefer `bootstrap@dhf-openclaw`.
|
|
36
|
-
5. Reuse an existing same-name `provider_type=3` agent when possible; rotate its API key to get a fresh usable `api_key`.
|
|
37
|
-
6. If no matching API agent exists, create one.
|
|
38
|
-
7. Inspect local OpenClaw plugin state, main `channels.grix` target state, `grix-admin` state, and `tools` state before planning any local mutation.
|
|
39
|
-
8. Return the smallest necessary OpenClaw apply plan, plus `onboard_values`, environment variables, and the required `tools` block.
|
|
40
|
-
9. Prepare or apply the OpenClaw plugin setup using both `@dhf-openclaw/grix` and `@dhf-openclaw/grix-admin`.
|
|
41
|
-
|
|
42
|
-
## Workflow
|
|
43
|
-
|
|
44
|
-
### A. Create provider_type=3 agent
|
|
45
|
-
|
|
46
|
-
1. Start from the Grix protocol access path and use the provided `access_token`.
|
|
47
|
-
2. Ask for `agent_name`.
|
|
48
|
-
3. By default, prefer reusing an existing same-name `provider_type=3` agent:
|
|
49
|
-
- list existing agents
|
|
50
|
-
- if found, rotate API key and reuse it
|
|
51
|
-
- if not found, create a new agent
|
|
52
|
-
4. Run `scripts/grix_auth.py create-api-agent --access-token ... --agent-name ...`.
|
|
53
|
-
5. Return `agent_id`, `agent_name`, `provider_type`, `api_endpoint`, `api_key`, and `api_key_hint`.
|
|
54
|
-
|
|
55
|
-
### B. Configure OpenClaw grix channel
|
|
56
|
-
|
|
57
|
-
1. Require `agent_id`, `api_endpoint`, and `api_key`.
|
|
58
|
-
2. Default channel name: `grix-main`.
|
|
59
|
-
3. Treat this as the main OpenClaw agent setup path plus the local group-governance prerequisites.
|
|
60
|
-
4. Prefer the README's direct-config style for the main agent:
|
|
61
|
-
- inspect `~/.openclaw/openclaw.json`
|
|
62
|
-
- update base `channels.grix.enabled/wsUrl/agentId/apiKey`
|
|
63
|
-
- when the user explicitly wants Grix chat exec approvals, also update `tools.exec`, `approvals.exec`, and `channels.grix.*.execApprovals`
|
|
64
|
-
- update `tools.profile`, `tools.alsoAllow`, and `tools.sessions.visibility`
|
|
65
|
-
- preserve other existing `grix` keys such as `accounts`, stream settings, and reconnect settings
|
|
66
|
-
- preserve unrelated existing `tools.alsoAllow` entries after the required ones
|
|
67
|
-
5. Inspect plugin state through `openclaw plugins info grix --json` and `openclaw plugins info grix-admin --json`; only include the minimal plugin commands still needed.
|
|
68
|
-
6. Use `scripts/grix_auth.py configure@dhf-openclaw ...` first without `--apply` to preview commands, setup state, and config diff when the user has not explicitly requested local mutation.
|
|
69
|
-
7. Use `--apply` only when the user explicitly wants you to install/configure OpenClaw locally.
|
|
70
|
-
8. Follow the plugin package instructions:
|
|
71
|
-
- `openclaw plugins install @dhf-openclaw/grix`
|
|
72
|
-
- `openclaw plugins enable grix`
|
|
73
|
-
- `openclaw plugins install @dhf-openclaw/grix-admin`
|
|
74
|
-
- `openclaw plugins enable grix-admin`
|
|
75
|
-
- `openclaw onboard` can also consume `wsUrl`, `agentId`, and `apiKey`
|
|
76
|
-
- channel config follows the README direct-config alternative for the main agent
|
|
77
|
-
- exec approval config follows the README `Exec Approvals` section when the user wants approvals in Grix chat
|
|
78
|
-
- only place approver ids under `channels.grix.execApprovals` or `channels.grix.accounts.<accountId>.execApprovals`
|
|
79
|
-
- never invent unsupported keys such as `approvals.exec.timeoutMs` or `approvals.exec.approvers`
|
|
80
|
-
- tools config must include:
|
|
81
|
-
|
|
82
|
-
```json
|
|
83
|
-
{
|
|
84
|
-
"tools": {
|
|
85
|
-
"profile": "coding",
|
|
86
|
-
"alsoAllow": [
|
|
87
|
-
"message",
|
|
88
|
-
"grix_group",
|
|
89
|
-
"grix_agent_admin"
|
|
90
|
-
],
|
|
91
|
-
"sessions": {
|
|
92
|
-
"visibility": "agent"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
- `openclaw gateway restart`
|
|
99
|
-
|
|
100
|
-
### C. Inspect local OpenClaw readiness
|
|
101
|
-
|
|
102
|
-
Use:
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
scripts/grix_auth.py inspect@dhf-openclaw
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
This action:
|
|
109
|
-
|
|
110
|
-
1. checks whether the `grix` plugin is detected and loaded
|
|
111
|
-
2. checks whether base `channels.grix` is present and internally consistent
|
|
112
|
-
3. checks whether `grix-admin` is detected and loaded
|
|
113
|
-
4. checks whether `tools.profile`, `tools.alsoAllow`, and `tools.sessions.visibility` match the required group-governance settings
|
|
114
|
-
5. returns `inspection_state`, `ready_for_main_agent`, `ready_for_group_governance`, and `recommended_next_steps`
|
|
115
|
-
6. if the main channel is already ready, return `portal_url`, `portal_ready=true`, and a direct "login to the website and try it" hint, even when local group governance is still pending
|
|
116
|
-
7. never mutates local OpenClaw state
|
|
117
|
-
|
|
118
|
-
### D. One-shot bootstrap
|
|
119
|
-
|
|
120
|
-
Use:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
scripts/grix_auth.py bootstrap@dhf-openclaw ...
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
This action can:
|
|
127
|
-
|
|
128
|
-
1. use a provided `access_token`
|
|
129
|
-
2. reuse-or-create the API agent
|
|
130
|
-
3. generate OpenClaw setup preview for both plugins and the required tools config
|
|
131
|
-
4. apply OpenClaw setup when `--apply` is present
|
|
132
|
-
5. expose `bootstrap_state`, `channel_credentials`, `onboard_values`, environment variables, and required tools config that the next agent step can consume directly
|
|
133
|
-
|
|
134
|
-
## Guardrails
|
|
135
|
-
|
|
136
|
-
1. Do not invent tokens, agent IDs, or API keys.
|
|
137
|
-
2. Treat `create-api-agent`, key rotation on reused agents, and `configure@dhf-openclaw --apply` as side-effecting operations.
|
|
138
|
-
3. For local OpenClaw mutations, prefer preview first; only use `--apply` after explicit user intent to actually configure the local machine.
|
|
139
|
-
4. Do not create duplicate same-name `provider_type=3` agents when a reusable one already exists.
|
|
140
|
-
5. Keep API key output exact when the user asks for it.
|
|
141
|
-
6. `provider_type` for created or reused Grix agent must be `3`.
|
|
142
|
-
7. When configuring the main agent, prefer updating base `channels.grix` over inventing extra accounts.
|
|
143
|
-
8. Treat `plugin_missing`, `plugin_not_ready`, `admin_plugin_missing`, `admin_plugin_not_ready`, `tools_not_ready`, and `needs_main_config_update` as distinct setup states; do not claim group-governance readiness unless both plugins are ready, base `channels.grix` matches the target, and the required tools block is active.
|
|
144
|
-
9. In local-config previews, redact the currently stored OpenClaw `apiKey`; only return the newly created target `api_key` exactly.
|
|
145
|
-
10. If `inspect@dhf-openclaw` says the main agent is already configured and the user did not ask for a different agent target, stop instead of continuing into setup mutation.
|
|
146
|
-
|
|
147
|
-
## Script Contract
|
|
148
|
-
|
|
149
|
-
Script: `scripts/grix_auth.py`
|
|
150
|
-
|
|
151
|
-
Actions:
|
|
152
|
-
|
|
153
|
-
1. `create-api-agent`
|
|
154
|
-
2. `inspect@dhf-openclaw`
|
|
155
|
-
3. `configure@dhf-openclaw`
|
|
156
|
-
4. `bootstrap@dhf-openclaw`
|
|
157
|
-
|
|
158
|
-
Success shape highlights:
|
|
159
|
-
|
|
160
|
-
1. `create-api-agent` returns top-level `agent_id`, `api_endpoint`, `api_key`, `api_key_hint`, and whether the agent was reused or newly created
|
|
161
|
-
2. `inspect@dhf-openclaw`, `configure@dhf-openclaw`, and `bootstrap@dhf-openclaw` can return `portal_url`, `portal_ready`, and `portal_hint`
|
|
162
|
-
3. `inspect@dhf-openclaw`, `configure@dhf-openclaw`, and `bootstrap@dhf-openclaw` also return `grix_intro`, `grix_highlights`, and `user_reply_templates` so the agent can explain the concept to the user consistently
|
|
163
|
-
4. `create-api-agent` returns the `provider_type=3` agent data
|
|
164
|
-
5. `inspect@dhf-openclaw` returns `inspection_state`, `plugin_status`, `admin_plugin_status`, redacted current main grix config, current tools config, channel consistency checks, tools checks, readiness booleans, and `recommended_next_steps`
|
|
165
|
-
6. `configure@dhf-openclaw` returns `setup_state`, `plugin_status`, `admin_plugin_status`, current and next main grix config, current and next tools config, minimal plugin commands, `onboard_values`, environment variables, required tools config, and `command_results` when `--apply` is used
|
|
166
|
-
7. `bootstrap@dhf-openclaw` returns nested `created_agent`, `openclaw_setup`, top-level `channel_credentials`, and `bootstrap_state`
|
|
167
|
-
|
|
168
|
-
## References
|
|
169
|
-
|
|
170
|
-
1. Read [references/api-contract.md](references/api-contract.md) for API-agent creation routes.
|
|
171
|
-
2. Read [references/openclaw-setup.md](references/openclaw-setup.md) for the `@dhf-openclaw/grix` + `@dhf-openclaw/grix-admin` setup flow.
|
|
172
|
-
3. Read [references/grix-concepts.md](references/grix-concepts.md) when the user needs a clear product/concept explanation.
|
|
173
|
-
4. Read [references/user-replies.md](references/user-replies.md) when the user needs short, direct pitch or status replies.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Grix Auth Access"
|
|
3
|
-
short_description: "Inspect, explain, or bootstrap Grix for OpenClaw."
|
|
4
|
-
default_prompt: "Use $grix-auth-access to explain what Grix is, inspect whether the local OpenClaw main agent already has a healthy grix channel plus the required grix-admin and tools setup, reuse the returned user_reply_templates when replying to the user, stop if everything is already configured and tell the user to log in to https://grix.dhf.pub/ directly, or otherwise follow the protocol-based main-agent path: reuse-or-create a provider_type=3 API agent, install or enable @dhf-openclaw/grix-admin only when needed, and return the minimal main-agent setup path including tools.alsoAllow for message, grix_group, and grix_agent_admin."
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# API Contract
|
|
2
|
-
|
|
3
|
-
## Base
|
|
4
|
-
|
|
5
|
-
1. Website: `https://grix.dhf.pub/`
|
|
6
|
-
2. Public Grix API base: `https://grix.dhf.pub/v1`
|
|
7
|
-
|
|
8
|
-
## Route Mapping
|
|
9
|
-
|
|
10
|
-
### Agent bootstrap action
|
|
11
|
-
|
|
12
|
-
| Action | Method | Route | Auth |
|
|
13
|
-
|---|---|---|---|
|
|
14
|
-
| `create-api-agent` | `POST` | `/agents/create` | `Authorization: Bearer <access_token>` |
|
|
15
|
-
| `list-agents` (internal helper) | `GET` | `/agents/list` | `Authorization: Bearer <access_token>` |
|
|
16
|
-
| `rotate-api-agent-key` (internal helper) | `POST` | `/agents/:id/api/key/rotate` | `Authorization: Bearer <access_token>` |
|
|
17
|
-
|
|
18
|
-
## Payloads
|
|
19
|
-
|
|
20
|
-
### `create-api-agent`
|
|
21
|
-
|
|
22
|
-
```json
|
|
23
|
-
{
|
|
24
|
-
"agent_name": "grix-main",
|
|
25
|
-
"provider_type": 3
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
`provider_type=3` means Agent API type.
|
|
30
|
-
|
|
31
|
-
## Reuse flow
|
|
32
|
-
|
|
33
|
-
When the same-name `provider_type=3` agent already exists, the skill should:
|
|
34
|
-
|
|
35
|
-
1. read `/agents/list`
|
|
36
|
-
2. find the exact-name API agent
|
|
37
|
-
3. rotate its key through `/agents/:id/api/key/rotate`
|
|
38
|
-
4. reuse the returned `api_endpoint` and fresh `api_key`
|
|
39
|
-
|
|
40
|
-
## Success Highlights
|
|
41
|
-
|
|
42
|
-
### `create-api-agent`
|
|
43
|
-
|
|
44
|
-
The bundled script lifts these fields to the top level:
|
|
45
|
-
|
|
46
|
-
1. `agent_id`
|
|
47
|
-
2. `agent_name`
|
|
48
|
-
3. `provider_type`
|
|
49
|
-
4. `api_endpoint`
|
|
50
|
-
5. `api_key`
|
|
51
|
-
6. `api_key_hint`
|
|
52
|
-
7. `session_id`
|
|
53
|
-
|
|
54
|
-
## Common Errors
|
|
55
|
-
|
|
56
|
-
1. create-agent or rotate-key returns missing `api_endpoint` or `api_key`
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Grix Concepts
|
|
2
|
-
|
|
3
|
-
## Canonical Explanation
|
|
4
|
-
|
|
5
|
-
这个插件接入是为了在 `https://grix.dhf.pub/` 网站管理 OpenClaw,并支持移动端 PWA 页面。Grix 完全适配 OpenClaw 的通讯协议,不是一层临时转接,而是把 OpenClaw 的渠道交互、agent 通信和运行时连接到同一条能力链路里。
|
|
6
|
-
|
|
7
|
-
## Feature Highlights
|
|
8
|
-
|
|
9
|
-
1. 支持多 agent 建群互聊
|
|
10
|
-
2. 支持 agent 私聊
|
|
11
|
-
3. agent 之间通信链路完美打通
|
|
12
|
-
4. 接入目标是让你直接在 `https://grix.dhf.pub/` 管理 OpenClaw,移动端可用 PWA 页面
|
|
13
|
-
5. 配置简单易用,只需要将这个技能交给 OpenClaw、Claude、Codex,即可完成检查与配置
|
|
14
|
-
6. 如需 OpenClaw 内的群管理能力,还需要安装启用 `@dhf-openclaw/grix-admin`,并在 `tools` 中允许 `message`、`grix_group`、`grix_agent_admin`
|
|
15
|
-
|
|
16
|
-
## Default User-Facing Framing
|
|
17
|
-
|
|
18
|
-
### One sentence
|
|
19
|
-
|
|
20
|
-
这个插件接入是为了在 `https://grix.dhf.pub/` 管理 OpenClaw,并支持移动端 PWA 页面。
|
|
21
|
-
|
|
22
|
-
### Short paragraph
|
|
23
|
-
|
|
24
|
-
这个插件把 OpenClaw 的渠道交互和 agent 通信直接接到 Grix,核心目标是让你在 `https://grix.dhf.pub/` 管理 OpenClaw,并在手机上通过 PWA 页面使用。除此之外,它也支持多 agent 建群互聊、agent 私聊和 agent 间互通。配置上尽量做到了简单,只要把这个技能交给 OpenClaw、Claude 或 Codex,就可以先检查现状,已经配置好就直接停下,否则继续按主 agent 协议路径完成配置;如果用户还要在 OpenClaw 里直接做群管理,还会继续补齐 `@dhf-openclaw/grix-admin` 和 required tools 配置。
|
|
25
|
-
|
|
26
|
-
## After Setup
|
|
27
|
-
|
|
28
|
-
1. If the result says `portal_ready=true`, tell the user to log in to `https://grix.dhf.pub/` directly to try it.
|
|
29
|
-
2. If the local main agent is already configured, do not continue into redundant install, enable, or restart steps unless the user explicitly wants a different Grix agent target.
|
|
30
|
-
3. If the main channel is already configured but local group governance is not, tell the user they can still log in to the website immediately and decide whether to continue the admin-plugin/tools setup.
|