@dhf-openclaw/grix 0.4.10 → 0.4.13
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 +182 -166
- package/dist/index.js +347 -87
- package/package.json +2 -2
- package/skills/grix-admin/SKILL.md +81 -0
- package/skills/{grix-agent-admin → grix-admin}/references/api-contract.md +22 -3
- package/skills/{egg-install → grix-egg}/SKILL.md +1 -1
- package/skills/{grix-group-governance → grix-group}/SKILL.md +21 -5
- package/skills/{grix-group-governance → grix-group}/references/api-contract.md +15 -0
- package/skills/grix-register/SKILL.md +80 -0
- package/skills/grix-register/references/api-contract.md +72 -0
- package/skills/grix-register/references/grix-concepts.md +26 -0
- package/skills/grix-register/references/handoff-contract.md +24 -0
- package/skills/grix-register/references/openclaw-setup.md +6 -0
- package/skills/grix-register/references/user-replies.md +25 -0
- package/skills/grix-register/scripts/grix_auth.py +474 -0
- package/skills/grix-agent-admin/SKILL.md +0 -85
- package/skills/grix-agent-admin/agents/openai.yaml +0 -4
- package/skills/grix-group-governance/agents/openai.yaml +0 -4
- package/skills/grix-query/agents/openai.yaml +0 -4
- /package/skills/{grix-agent-admin → grix-admin}/scripts/grix_agent_bind.py +0 -0
- /package/skills/{egg-install → grix-egg}/references/api-contract.md +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhf-openclaw/grix",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.13",
|
|
4
4
|
"description": "Unified Grix OpenClaw plugin with channel transport, typed admin tools, and operator CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"label": "Grix",
|
|
61
61
|
"selectionLabel": "Grix",
|
|
62
62
|
"docsPath": "/channels/grix",
|
|
63
|
-
"blurb": "Connect OpenClaw to
|
|
63
|
+
"blurb": "Connect OpenClaw to a Grix deployment for website management with mobile PWA support.",
|
|
64
64
|
"aliases": [
|
|
65
65
|
"gr"
|
|
66
66
|
],
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grix-admin
|
|
3
|
+
description: 负责 OpenClaw 本地配置与后续 agent 管理;支持接收 grix-register 交接参数直接落地,也支持在已有主密钥下新建 agent 再落地。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Grix Agent Admin
|
|
7
|
+
|
|
8
|
+
`grix-admin` 只负责本地配置和管理动作。支持两个入口模式,二选一执行。
|
|
9
|
+
|
|
10
|
+
## Mode A: bind-local(来自 grix-register 的首次交接)
|
|
11
|
+
|
|
12
|
+
输入参数(全必填):
|
|
13
|
+
|
|
14
|
+
1. `mode=bind-local`
|
|
15
|
+
2. `agent_name`
|
|
16
|
+
3. `agent_id`
|
|
17
|
+
4. `api_endpoint`
|
|
18
|
+
5. `api_key`
|
|
19
|
+
|
|
20
|
+
执行规则:
|
|
21
|
+
|
|
22
|
+
1. 不做远端创建,直接执行本地绑定:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
scripts/grix_agent_bind.py configure-local-openclaw \
|
|
26
|
+
--agent-name <agent_name> \
|
|
27
|
+
--agent-id <agent_id> \
|
|
28
|
+
--api-endpoint '<api_endpoint>' \
|
|
29
|
+
--api-key '<api_key>' \
|
|
30
|
+
--apply
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2. 可选执行检查:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
scripts/grix_agent_bind.py inspect-local-openclaw --agent-name <agent_name>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Mode B: create-and-bind(已有主密钥时的后续管理)
|
|
40
|
+
|
|
41
|
+
输入参数:
|
|
42
|
+
|
|
43
|
+
1. `agentName`(必填):`^[a-z][a-z0-9-]{2,31}$`
|
|
44
|
+
2. `describeMessageTool`(必填):`actions` 非空
|
|
45
|
+
3. `accountId`(可选)
|
|
46
|
+
4. `avatarUrl`(可选)
|
|
47
|
+
|
|
48
|
+
执行规则:
|
|
49
|
+
|
|
50
|
+
1. 先检查 `~/.openclaw/openclaw.json` 的 `channels.grix.apiKey`。
|
|
51
|
+
2. 若缺失或为空,说明主通道还没完成,不做本模式,立刻切回 `grix-register`。
|
|
52
|
+
3. 若已存在,再调用 `grix_agent_admin` 创建远端 agent(仅一次,不自动重试)。
|
|
53
|
+
4. 创建成功后,执行本地绑定命令(同 Mode A)。
|
|
54
|
+
|
|
55
|
+
## Guardrails(两种模式都适用)
|
|
56
|
+
|
|
57
|
+
1. Never ask user for website account/password.
|
|
58
|
+
2. `bind-local` 模式禁止再次回调 `grix-register`,避免循环路由。
|
|
59
|
+
3. 远端创建(Mode B)视为非幂等,不确认不自动重试。
|
|
60
|
+
4. 完整 `api_key` 仅一次性回传,不要重复明文回显。
|
|
61
|
+
5. 本地 `--apply` 没成功前,不得宣称配置完成。
|
|
62
|
+
|
|
63
|
+
## Error Handling Rules
|
|
64
|
+
|
|
65
|
+
1. `bind-local` 缺少字段:明确指出缺哪个字段并停止。
|
|
66
|
+
2. invalid name(Mode B):要求用户提供合法小写英文名。
|
|
67
|
+
3. `403/20011`:提示 owner 授权 `agent.api.create`。
|
|
68
|
+
4. `401/10001`:检查本地 `agent_api_key` 或 grix 账号配置。
|
|
69
|
+
5. `409/20002`:要求更换 agent 名称。
|
|
70
|
+
6. 本地 apply 失败:返回失败命令与结果并停止。
|
|
71
|
+
|
|
72
|
+
## Response Style
|
|
73
|
+
|
|
74
|
+
1. 明确写出当前执行的是 `bind-local` 还是 `create-and-bind`。
|
|
75
|
+
2. 分阶段汇报:远端(如有)+ 本地绑定。
|
|
76
|
+
3. 明确说明本地是否已生效,失败则给具体原因。
|
|
77
|
+
|
|
78
|
+
## References
|
|
79
|
+
|
|
80
|
+
1. [references/api-contract.md](references/api-contract.md)
|
|
81
|
+
2. [scripts/grix_agent_bind.py](scripts/grix_agent_bind.py)
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`grix-admin` 负责本地绑定,支持两种入口:
|
|
6
|
+
|
|
7
|
+
1. `bind-local`:接收 `grix-register` 交接参数,直接本地绑定。
|
|
8
|
+
2. `create-and-bind`:在已有主密钥下先远端创建,再本地绑定。
|
|
6
9
|
|
|
7
10
|
## Base Rules
|
|
8
11
|
|
|
@@ -12,7 +15,7 @@ Map remote provisioning action to Aibot Agent API HTTP route, then hand over to
|
|
|
12
15
|
4. Route must pass scope middleware before service business checks.
|
|
13
16
|
5. Do not ask users to provide website account/password for this flow.
|
|
14
17
|
|
|
15
|
-
## Action Mapping (
|
|
18
|
+
## Action Mapping (create-and-bind only)
|
|
16
19
|
|
|
17
20
|
| Tool | Method | Route | Required Scope |
|
|
18
21
|
|---|---|---|---|
|
|
@@ -72,7 +75,7 @@ Map remote provisioning action to Aibot Agent API HTTP route, then hand over to
|
|
|
72
75
|
|
|
73
76
|
## Post-Create Handover
|
|
74
77
|
|
|
75
|
-
After `code=0
|
|
78
|
+
After `code=0` (or when using `bind-local` mode), continue with local OpenClaw binding via bundled script:
|
|
76
79
|
|
|
77
80
|
1. apply local changes directly:
|
|
78
81
|
- `scripts/grix_agent_bind.py configure-local-openclaw --agent-name <agent_name> --agent-id <agent_id> --api-endpoint '<api_endpoint>' --api-key '<api_key>' --apply`
|
|
@@ -85,3 +88,19 @@ Local apply writes:
|
|
|
85
88
|
2. `channels.grix.accounts.<agent_name>` entry
|
|
86
89
|
3. `bindings` route for `channel=grix`
|
|
87
90
|
4. required tools config and gateway restart
|
|
91
|
+
|
|
92
|
+
## bind-local Input Contract
|
|
93
|
+
|
|
94
|
+
When called from `grix-register`, `grix-admin` should accept:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"mode": "bind-local",
|
|
99
|
+
"agent_name": "grix-main",
|
|
100
|
+
"agent_id": "2029786829095440384",
|
|
101
|
+
"api_endpoint": "wss://grix.dhf.pub/v1/agent-api/ws?agent_id=2029786829095440384",
|
|
102
|
+
"api_key": "ak_xxx"
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
In this mode, skip remote create and execute local bind directly.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: grix-group
|
|
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.
|
|
2
|
+
name: grix-group
|
|
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
6
|
# Grix Group Governance
|
|
@@ -11,7 +11,7 @@ This skill is about tool selection and guardrails, not protocol bridging.
|
|
|
11
11
|
## Workflow
|
|
12
12
|
|
|
13
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`.
|
|
14
|
+
`create`, `detail`, `leave`, `add_members`, `remove_members`, `update_member_role`, `update_all_members_muted`, `update_member_speaking`, or `dissolve`.
|
|
15
15
|
2. Validate required fields before any call.
|
|
16
16
|
3. Call `grix_group` exactly once per business action.
|
|
17
17
|
4. Classify failures by HTTP/BizCode and return exact remediation.
|
|
@@ -23,8 +23,8 @@ This skill is about tool selection and guardrails, not protocol bridging.
|
|
|
23
23
|
For Grix group governance, always call:
|
|
24
24
|
|
|
25
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`:
|
|
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
28
|
|
|
29
29
|
Rules:
|
|
30
30
|
|
|
@@ -67,6 +67,21 @@ Guardrails:
|
|
|
67
67
|
2. Reject non-numeric `memberIds` before calling the tool.
|
|
68
68
|
3. If `sessionId` is ambiguous, ask the user to confirm the target group first.
|
|
69
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. This action is only for the current Agent leaving its own group membership.
|
|
81
|
+
2. Never translate a request to remove other members into `leave`; use `remove_members` for that.
|
|
82
|
+
3. Do not send `memberId`, `memberIds`, or `memberTypes` with this action.
|
|
83
|
+
4. This action does not require scope and should not be described as a scope-grant workflow.
|
|
84
|
+
|
|
70
85
|
### remove_members
|
|
71
86
|
|
|
72
87
|
Required input:
|
|
@@ -123,6 +138,7 @@ Required input:
|
|
|
123
138
|
|
|
124
139
|
1. `403/20011`:
|
|
125
140
|
report missing scope and ask owner to grant the scope in Aibot Agent permission page.
|
|
141
|
+
Do not use this remediation for `leave`, because `leave` is scope-free.
|
|
126
142
|
2. `401/10001`:
|
|
127
143
|
report invalid key/auth and suggest checking agent config or rotating API key.
|
|
128
144
|
3. `403/10002`:
|
|
@@ -16,6 +16,7 @@ Map high-level governance actions to Aibot Agent API HTTP routes.
|
|
|
16
16
|
| Action | Method | Route | Required Scope |
|
|
17
17
|
|---|---|---|---|
|
|
18
18
|
| `group_create` | `POST` | `/sessions/create_group` | `group.create` |
|
|
19
|
+
| `group_leave_self` | `POST` | `/sessions/leave` | - |
|
|
19
20
|
| `group_member_add` | `POST` | `/sessions/members/add` | `group.member.add` |
|
|
20
21
|
|
|
21
22
|
## OpenClaw Tool Mapping
|
|
@@ -26,6 +27,7 @@ Use the native `grix_group` tool with typed fields:
|
|
|
26
27
|
|---|---|---|
|
|
27
28
|
| `create` | `group_create` | `name` |
|
|
28
29
|
| `detail` | `group_detail_read` | `sessionId` |
|
|
30
|
+
| `leave` | `group_leave_self` | `sessionId` |
|
|
29
31
|
| `add_members` | `group_member_add` | `sessionId`, `memberIds` |
|
|
30
32
|
| `remove_members` | `group_member_remove` | `sessionId`, `memberIds` |
|
|
31
33
|
| `update_member_role` | `group_member_role_update` | `sessionId`, `memberId`, `role` |
|
|
@@ -57,6 +59,15 @@ Use the native `grix_group` tool with typed fields:
|
|
|
57
59
|
}
|
|
58
60
|
```
|
|
59
61
|
|
|
62
|
+
### leave
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"action": "leave",
|
|
67
|
+
"sessionId": "task_room_9083"
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
60
71
|
## Error Matrix
|
|
61
72
|
|
|
62
73
|
| HTTP/BizCode | Meaning | Skill Response |
|
|
@@ -66,6 +77,10 @@ Use the native `grix_group` tool with typed fields:
|
|
|
66
77
|
| `401/10001` | invalid or missing auth | Check api_key and account config |
|
|
67
78
|
| `403/10002` | agent not active / invalid provider | Ask owner to activate the agent |
|
|
68
79
|
|
|
80
|
+
Notes:
|
|
81
|
+
|
|
82
|
+
1. `leave` does not require scope and should not route `403/20011` into scope remediation.
|
|
83
|
+
|
|
69
84
|
## Retry Policy
|
|
70
85
|
|
|
71
86
|
1. Never auto-retry `group_create` unless user confirms.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grix-register
|
|
3
|
+
description: 仅用于初次安装阶段,完成 Grix 环境的账号注册/登录并拿到第一个 provider_type=3 Agent 的参数;本技能不做任何本地 OpenClaw 配置。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Grix Register
|
|
7
|
+
|
|
8
|
+
这个技能只负责“初次安装”的云端准备:账号注册/登录 + 生成首个 `provider_type=3` Agent 参数。
|
|
9
|
+
你(AI)在终端里全自动操作,**不需要用户打开浏览器**。拿到参数后,必须移交给 `grix-admin` 做本地配置。
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
### 0. 角色边界(先声明再执行)
|
|
14
|
+
|
|
15
|
+
1. 本技能**只能**做账号与云端 Agent 参数准备。
|
|
16
|
+
2. 本技能**不能**执行 `openclaw` 命令,也不能修改本地 `openclaw.json`。
|
|
17
|
+
3. 涉及本地配置、插件安装、工具权限、重启网关,一律交给 `grix-admin`。
|
|
18
|
+
|
|
19
|
+
### 1. 询问邮箱并发送验证码
|
|
20
|
+
|
|
21
|
+
1. 向用户询问 Email 地址。**不要让用户去网页端注册**,明确表示你会在对话里完成。
|
|
22
|
+
2. 拿到邮箱后,在终端执行发送验证码的命令:
|
|
23
|
+
```bash
|
|
24
|
+
scripts/grix_auth.py send-email-code --email "<用户的email>" --scene "register"
|
|
25
|
+
```
|
|
26
|
+
3. 等待命令执行成功后,提示用户去邮箱查收验证码,并询问该验证码。
|
|
27
|
+
|
|
28
|
+
### 2. 执行自动注册(获取 Token)
|
|
29
|
+
|
|
30
|
+
1. 用户提供验证码后,你需要为用户生成一个复杂度高且随机安全的密码(建议生成一个12位的强密码,包含大小写、数字和特殊字符)。
|
|
31
|
+
2. 使用收集到的信息,执行注册命令:
|
|
32
|
+
```bash
|
|
33
|
+
scripts/grix_auth.py register --email "<邮箱>" --password "<生成的随机密码>" --email-code "<验证码>"
|
|
34
|
+
```
|
|
35
|
+
3. 这个命令成功后会返回用户的 `access_token`。请在回复中安全地**将生成的密码告知用户**,建议他们妥善保存。
|
|
36
|
+
|
|
37
|
+
注:如果注册提示邮箱已注册,可切换 `scripts/grix_auth.py login` 路径继续获取 `access_token`。
|
|
38
|
+
|
|
39
|
+
### 3. 创建首个云端 Agent 参数
|
|
40
|
+
|
|
41
|
+
拿到 `access_token` 后,询问 Agent 名称(如果上下文已有就直接用),执行:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
scripts/grix_auth.py create-api-agent --access-token "<token>" --agent-name "<agent名称>"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
若同名 `provider_type=3` Agent 已存在,脚本会自动轮换 API Key 后复用。
|
|
48
|
+
|
|
49
|
+
### 4. 强制移交给 grix-admin
|
|
50
|
+
|
|
51
|
+
第三步执行成功后,脚本会返回一些关键设定:
|
|
52
|
+
- `agent_id`
|
|
53
|
+
- `agent_name`
|
|
54
|
+
- `api_endpoint`
|
|
55
|
+
- `api_key`
|
|
56
|
+
|
|
57
|
+
然后立刻交给 `grix-admin`,并传递如下 payload:
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"mode": "bind-local",
|
|
62
|
+
"agent_name": "<agent_name>",
|
|
63
|
+
"agent_id": "<agent_id>",
|
|
64
|
+
"api_endpoint": "<api_endpoint>",
|
|
65
|
+
"api_key": "<api_key>"
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Guardrails
|
|
70
|
+
|
|
71
|
+
1. 不要求用户去网页注册或手动点页面。
|
|
72
|
+
2. 不修改任何本地 OpenClaw 配置。
|
|
73
|
+
3. 不安装插件、不改工具权限、不重启 gateway。
|
|
74
|
+
4. 创建或复用出参数后,必须交接给 `grix-admin`。
|
|
75
|
+
|
|
76
|
+
## References
|
|
77
|
+
|
|
78
|
+
1. [references/api-contract.md](references/api-contract.md)
|
|
79
|
+
2. [references/handoff-contract.md](references/handoff-contract.md)
|
|
80
|
+
3. [scripts/grix_auth.py](scripts/grix_auth.py)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# API Contract
|
|
2
|
+
|
|
3
|
+
## Responsibility Boundary
|
|
4
|
+
|
|
5
|
+
1. `grix-register` 仅负责账号鉴权与云端 `provider_type=3` Agent 参数产出。
|
|
6
|
+
2. 本技能不负责本地 OpenClaw 配置。
|
|
7
|
+
3. 本地配置由 `grix-admin` 接手。
|
|
8
|
+
|
|
9
|
+
## Base
|
|
10
|
+
|
|
11
|
+
1. Default website: `https://grix.dhf.pub/`
|
|
12
|
+
2. Default public Grix API base: `https://grix.dhf.pub/v1`
|
|
13
|
+
3. Local development or private deployment can override the base URL.
|
|
14
|
+
|
|
15
|
+
## Route Mapping
|
|
16
|
+
|
|
17
|
+
### Agent bootstrap action
|
|
18
|
+
|
|
19
|
+
| Action | Method | Route | Auth |
|
|
20
|
+
|---|---|---|---|
|
|
21
|
+
| `create-api-agent` | `POST` | `/agents/create` | `Authorization: Bearer <access_token>` |
|
|
22
|
+
| `list-agents` (internal helper) | `GET` | `/agents/list` | `Authorization: Bearer <access_token>` |
|
|
23
|
+
| `rotate-api-agent-key` (internal helper) | `POST` | `/agents/:id/api/key/rotate` | `Authorization: Bearer <access_token>` |
|
|
24
|
+
|
|
25
|
+
## Payloads
|
|
26
|
+
|
|
27
|
+
### `create-api-agent`
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"agent_name": "grix-main",
|
|
32
|
+
"provider_type": 3
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`provider_type=3` means Agent API type.
|
|
37
|
+
|
|
38
|
+
## Reuse flow
|
|
39
|
+
|
|
40
|
+
When the same-name `provider_type=3` agent already exists, the skill should:
|
|
41
|
+
|
|
42
|
+
1. read `/agents/list`
|
|
43
|
+
2. find the exact-name API agent
|
|
44
|
+
3. rotate its key through `/agents/:id/api/key/rotate`
|
|
45
|
+
4. reuse the returned `api_endpoint` and fresh `api_key`
|
|
46
|
+
|
|
47
|
+
## Success Highlights
|
|
48
|
+
|
|
49
|
+
### `create-api-agent`
|
|
50
|
+
|
|
51
|
+
The bundled script lifts these fields to the top level:
|
|
52
|
+
|
|
53
|
+
1. `agent_id`
|
|
54
|
+
2. `agent_name`
|
|
55
|
+
3. `provider_type`
|
|
56
|
+
4. `api_endpoint`
|
|
57
|
+
5. `api_key`
|
|
58
|
+
6. `api_key_hint`
|
|
59
|
+
7. `session_id`
|
|
60
|
+
|
|
61
|
+
## Common Errors
|
|
62
|
+
|
|
63
|
+
1. create-agent or rotate-key returns missing `api_endpoint` or `api_key`
|
|
64
|
+
|
|
65
|
+
## Handoff
|
|
66
|
+
|
|
67
|
+
成功后输出这些字段,直接交给 `grix-admin`:
|
|
68
|
+
|
|
69
|
+
1. `agent_id`
|
|
70
|
+
2. `agent_name`
|
|
71
|
+
3. `api_endpoint`
|
|
72
|
+
4. `api_key`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Grix Concepts
|
|
2
|
+
|
|
3
|
+
## Canonical Explanation
|
|
4
|
+
|
|
5
|
+
这个插件接入是为了在 `https://grix.dhf.pub/` 网站管理 OpenClaw,并支持移动端 PWA 页面。
|
|
6
|
+
|
|
7
|
+
## Feature Highlights
|
|
8
|
+
|
|
9
|
+
1. `grix-register` 负责初次账号准备与首个 agent 参数生成
|
|
10
|
+
2. `grix-admin` 负责 OpenClaw 本地配置与后续管理
|
|
11
|
+
3. 两者串联后,用户可在 `https://grix.dhf.pub/` 使用和管理
|
|
12
|
+
|
|
13
|
+
## Default User-Facing Framing
|
|
14
|
+
|
|
15
|
+
### One sentence
|
|
16
|
+
|
|
17
|
+
`grix-register` 只做“注册账号并拿到第一个 agent 参数”,本地配置统一交给 `grix-admin`。
|
|
18
|
+
|
|
19
|
+
### Short paragraph
|
|
20
|
+
|
|
21
|
+
`grix-register` 只负责初次安装中的云端准备:注册/登录账号并生成第一个 `provider_type=3` agent 参数;随后必须把参数交给 `grix-admin`,由 `grix-admin` 负责本地 OpenClaw 配置。
|
|
22
|
+
|
|
23
|
+
## After Setup
|
|
24
|
+
|
|
25
|
+
1. `grix-register` 产出参数后,直接交接给 `grix-admin`。
|
|
26
|
+
2. `grix-register` 不执行任何本地配置动作。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Handoff Contract to grix-admin
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`grix-register` 完成账号与首个 Agent 参数准备后,统一把本地配置工作交给 `grix-admin`。
|
|
6
|
+
|
|
7
|
+
## Required Payload
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"mode": "bind-local",
|
|
12
|
+
"agent_name": "grix-main",
|
|
13
|
+
"agent_id": "2029786829095440384",
|
|
14
|
+
"api_endpoint": "wss://grix.dhf.pub/v1/agent-api/ws?agent_id=2029786829095440384",
|
|
15
|
+
"api_key": "ak_xxx"
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
|
|
21
|
+
1. `mode` 固定为 `bind-local`。
|
|
22
|
+
2. `agent_name`、`agent_id`、`api_endpoint`、`api_key` 必填。
|
|
23
|
+
3. `grix-register` 只负责生成以上参数,不执行本地配置命令。
|
|
24
|
+
4. 本地写入、插件处理、工具权限、gateway 重启都由 `grix-admin` 负责。
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# User Replies
|
|
2
|
+
|
|
3
|
+
## One-liner Pitch
|
|
4
|
+
|
|
5
|
+
我会先帮你完成注册并拿到第一个 agent 参数,然后交给 `grix-admin` 完成本地配置。
|
|
6
|
+
|
|
7
|
+
## Short Intro
|
|
8
|
+
|
|
9
|
+
`grix-register` 只负责账号和云端参数准备,不改本地配置;本地配置由 `grix-admin` 接手。
|
|
10
|
+
|
|
11
|
+
## Ready Reply
|
|
12
|
+
|
|
13
|
+
账号和首个 agent 参数已经准备好,接下来我会把参数交给 `grix-admin` 做本地配置。
|
|
14
|
+
|
|
15
|
+
## Main Ready, Admin Pending Reply
|
|
16
|
+
|
|
17
|
+
`grix-register` 阶段已完成,我现在只做参数移交,后续本地配置请由 `grix-admin` 继续。
|
|
18
|
+
|
|
19
|
+
## Configured Now Reply
|
|
20
|
+
|
|
21
|
+
参数已交接给 `grix-admin`,接下来由它完成本地配置。
|
|
22
|
+
|
|
23
|
+
## Needs Setup Reply
|
|
24
|
+
|
|
25
|
+
当前仍在 `grix-register` 阶段,我会继续完成注册并拿到第一个 agent 参数。
|