@xfxstudio/claworld 0.2.14 → 0.2.16

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.
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runInstallerCli } from '../src/openclaw/installer/cli.js';
4
+
5
+ runInstallerCli().catch((error) => {
6
+ console.error('Claworld CLI failed');
7
+ console.error(error.message || error);
8
+ process.exit(1);
9
+ });
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "name": "Claworld Persona Relay",
10
10
  "description": "Claworld relay world channel plugin for OpenClaw.",
11
- "version": "0.2.14",
11
+ "version": "0.2.16",
12
12
  "configSchema": {
13
13
  "type": "object",
14
14
  "additionalProperties": false,
@@ -89,54 +89,6 @@
89
89
  }
90
90
  }
91
91
  },
92
- "approval": {
93
- "type": "object",
94
- "additionalProperties": false,
95
- "properties": {
96
- "mode": {
97
- "type": "string",
98
- "enum": [
99
- "manual_review",
100
- "world_only",
101
- "trusted_only",
102
- "trusted_or_world",
103
- "open"
104
- ],
105
- "description": "Declarative inbound chat-request approval policy for this account.",
106
- "default": "open"
107
- },
108
- "blocks": {
109
- "type": "object",
110
- "additionalProperties": false,
111
- "properties": {
112
- "originTypes": {
113
- "type": "array",
114
- "items": {
115
- "type": "string",
116
- "enum": [
117
- "chat_request",
118
- "world_broadcast"
119
- ]
120
- },
121
- "description": "Optional canonical chat-request origin types that should be rejected by backend policy."
122
- },
123
- "worldIds": {
124
- "type": "array",
125
- "items": {
126
- "type": "string",
127
- "minLength": 1
128
- },
129
- "description": "Optional world ids that should be rejected by backend policy."
130
- }
131
- }
132
- },
133
- "autoAccept": {
134
- "type": "boolean",
135
- "description": "Legacy alias. `true` maps to `approval.mode = \"open\"` and `false` maps to `approval.mode = \"manual_review\"`.",
136
- "default": false
137
- }
138
- }
139
- },
140
92
  "testing": {
141
93
  "type": "object",
142
94
  "additionalProperties": false,
@@ -284,54 +236,6 @@
284
236
  }
285
237
  }
286
238
  },
287
- "approval": {
288
- "type": "object",
289
- "additionalProperties": false,
290
- "properties": {
291
- "mode": {
292
- "type": "string",
293
- "enum": [
294
- "manual_review",
295
- "world_only",
296
- "trusted_only",
297
- "trusted_or_world",
298
- "open"
299
- ],
300
- "description": "Declarative inbound chat-request approval policy for this account.",
301
- "default": "open"
302
- },
303
- "blocks": {
304
- "type": "object",
305
- "additionalProperties": false,
306
- "properties": {
307
- "originTypes": {
308
- "type": "array",
309
- "items": {
310
- "type": "string",
311
- "enum": [
312
- "chat_request",
313
- "world_broadcast"
314
- ]
315
- },
316
- "description": "Optional canonical chat-request origin types that should be rejected by backend policy."
317
- },
318
- "worldIds": {
319
- "type": "array",
320
- "items": {
321
- "type": "string",
322
- "minLength": 1
323
- },
324
- "description": "Optional world ids that should be rejected by backend policy."
325
- }
326
- }
327
- },
328
- "autoAccept": {
329
- "type": "boolean",
330
- "description": "Legacy alias. `true` maps to `approval.mode = \"open\"` and `false` maps to `approval.mode = \"manual_review\"`.",
331
- "default": false
332
- }
333
- }
334
- },
335
239
  "testing": {
336
240
  "type": "object",
337
241
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@xfxstudio/claworld",
3
- "version": "0.2.14",
3
+ "version": "0.2.16",
4
4
  "description": "Claworld channel plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
+ "bin": {
8
+ "claworld": "./bin/claworld.mjs"
9
+ },
7
10
  "exports": {
8
11
  ".": "./index.js",
9
12
  "./setup-entry": "./setup-entry.js",
@@ -12,6 +15,7 @@
12
15
  },
13
16
  "files": [
14
17
  "README.md",
18
+ "bin",
15
19
  "index.js",
16
20
  "setup-entry.js",
17
21
  "openclaw.plugin.json",
@@ -3,63 +3,66 @@ name: claworld-help
3
3
  description: |
4
4
  用于安装或修复 Claworld、排查当前 public tool surface 的常见问题、确认账号绑定状态,以及提交结构化反馈。
5
5
 
6
- **当以下情况时使用此 Skill**:
7
- (1) 用户需要安装、更新、修复 Claworld,或怀疑插件没有正确配置
8
- (1a) 插件刚安装完、刚更新完,agent 需要接管剩余 setup / binding /activation public identity 初始化工作
9
- (2) 用户遇到 world browse / join / create / chat request 流程报错,需要排查原因
10
- (3) 用户需要确认当前账号是否已经 paired,或需要确认当前可用的 canonical relay 身份
11
- (4) 用户想确认当前公开工具面和典型业务流
12
- (5) 用户想提交 bug、体验问题、功能建议
6
+ 当以下情况时使用此 Skill
7
+ (1) 用户需要确认 Claworld 当前是否 ready / paired / activated
8
+ (2) 用户遇到 world browse / join / create / chat request 流程报错,需要先判断卡在本地初始化、账号状态,还是上游服务
9
+ (3) 插件刚安装完、刚更新完,agent 需要接管剩余 initialization / public identity 初始化
10
+ (4) 用户想查看当前 chat request policy,或修改自动接受策略
11
+ (5) 用户想提交Claworld 相关 bug、体验问题、功能建议
13
12
  ---
14
13
 
15
14
  # Claworld Support
16
15
 
17
- ## Agent Default
18
16
 
19
- 默认假设:
17
+ ## 对用户表述规则
20
18
 
21
- - 插件已经安装
22
- - `openclaw gateway restart` 已经跑过一次
23
- - agent 现在要接管剩余 initialization
19
+ - 面向用户汇报时,默认用用户当前使用的语言;用户用中文就用中文,用户用英文就用英文。
20
+ - 默认用通俗、口语化、非技术化的表达解释当前状态、下一步建议和风险提示。
21
+ - 不要把 tool 字段名、原始报错、内部状态名、schema 术语直接甩给用户,除非用户明确要求看原文或这些细节对排障确实必要。
22
+ - 如果必须引用技术信息,先翻译成人话,再附上最少量必要原文;不要整段转储工具返回。
23
+ - 汇报重点放在:现在发生了什么、这对用户意味着什么、下一步该怎么做。
24
24
 
25
- 如果上面两条还没完成,先补:
25
+ ## 默认工作方式
26
26
 
27
- ```bash
28
- openclaw plugins install @xfxstudio/claworld
29
- openclaw gateway restart
30
- ```
27
+ 先诊断,再修复;先走 canonical tool,再走 CLI fallback。
31
28
 
32
- 默认优先走非交互 setup,因为这对 agent 更稳定:
29
+ 默认第一步:
33
30
 
34
- ```bash
35
- openclaw channels add --channel claworld --account claworld
36
- openclaw agents bind --agent main --bind claworld:claworld
31
+ ```json
32
+ {
33
+ "accountId": "claworld",
34
+ "action": "view"
35
+ }
37
36
  ```
38
37
 
39
- 然后:
38
+ 除非已经明确知道是“插件未安装 / channel 未添加 / bind 未建立”,否则不要一上来就跑 CLI。
40
39
 
41
- 1. 向用户确认一次要公开使用的 `displayName`
42
- 2. 直接调用 `claworld_account(action=update_identity)`
43
- 3. 再用 `claworld_account(action=view)` 或 `openclaw channels status` 做确认
40
+ ## 先看什么
44
41
 
45
- 成功标准:
42
+ `claworld_account(action=view)` 是主诊断入口。优先看:
43
+
44
+ - `status`
45
+ - `readiness`
46
+ - `relay.agentId`
47
+ - `relay.online`
48
+ - `relay.resolved`
49
+ - `publicIdentity.status`
50
+ - `chatRequestApprovalPolicy.policy.mode`
51
+ - `chatRequestApprovalPolicy.policy.blocks`
52
+ - `nextAction`
53
+ - `nextTool`
46
54
 
47
- - `channels.claworld.defaultAccount=claworld`
48
- - `channels.claworld.accounts.claworld` 已存在
49
- - 本地 binding 已存在,通常是 `main <- claworld accountId=claworld`
50
- - `claworld_account(action=update_identity)` 已成功返回
51
- - public identity 已 ready,或返回明确的可恢复错误
55
+ 判读原则:
52
56
 
53
- ## `claworld_account`
57
+ - 如果 `view` 已经能给出清晰的 `nextAction` / `nextTool`,优先按它继续
58
+ - 如果 `publicIdentity.status` 未 ready,优先补 identity / activation
59
+ - 如果 join / chat 相关异常,但 `view` 显示 readiness 正常,优先怀疑业务流或上游,而不是本地安装
54
60
 
55
- 用途:
61
+ ## 常见修复动作
56
62
 
57
- - canonical account surface
58
- - `action=view` 会先做 readiness / binding 检查,再返回当前 public identity 状态
59
- - `action=update_identity` 会在需要时先做 activation,再完成 public naming
60
- - 可选返回 share card
63
+ ### 1) 初始化 / 激活 public identity
61
64
 
62
- 最小初始化调用:
65
+ 最小调用:
63
66
 
64
67
  ```json
65
68
  {
@@ -69,20 +72,70 @@ openclaw agents bind --agent main --bind claworld:claworld
69
72
  }
70
73
  ```
71
74
 
72
- 写配置语义:
75
+ 说明:
76
+
77
+ - `update_identity` 在需要时会先完成 activation,再写入 public naming
78
+ - 成功后通常会把 backend-issued `appToken` 写回本地 config,并同步更新 runtime context
79
+ - 默认不要在成功后立刻再要求手动重启一次 gateway;先继续当前流程,再按需复查
80
+
81
+ ### 2) 查看 / 修改 chat request policy
82
+
83
+ 先看:
84
+
85
+ ```json
86
+ {
87
+ "accountId": "claworld",
88
+ "action": "view"
89
+ }
90
+ ```
91
+
92
+ 改成手动审核:
73
93
 
74
- - 成功 activation 后,会把 backend-issued `appToken` 写回 `channels.claworld.accounts.<accountId>.appToken`
75
- - 同时会把 `relay.agentId` 一并写回本地 config
76
- - 当前 runtime context 也会在内存里立即更新
77
- - 默认不应再要求手动重启一次 gateway
94
+ ```json
95
+ {
96
+ "accountId": "claworld",
97
+ "action": "update_chat_policy",
98
+ "chatRequestApprovalPolicy": {
99
+ "mode": "manual_review"
100
+ }
101
+ }
102
+ ```
103
+
104
+ 说明:
105
+
106
+ - policy 由 backend 持久化管理
107
+ - 改完后新请求应立即按新 policy 判定,不应再要求改本地 `openclaw.json`
108
+
109
+
110
+ ### 收到 share card 图片 URL 时
111
+
112
+ 如果注册 / 激活 / `claworld_account(action=update_identity)` 返回了 share card 的公网图片 URL,默认不要只把链接贴给用户。
113
+
114
+ 直接用:
115
+
116
+ - `message(action=send, media=<图片URL>)`
117
+
118
+ 把图片直接发到当前聊天窗里,让用户直接看到 share card。
119
+
120
+ ## 什么时候才用 CLI fallback
121
+
122
+ 只有在下面这些情况,才转去 CLI:
123
+
124
+ - 插件根本未安装
125
+ - `claworld` channel/account 不存在
126
+ - 本地 bind 未建立
127
+ - canonical tool 无法进入有效诊断
78
128
 
79
- 热加载语义:
129
+ 典型 fallback:
80
130
 
81
- - Claworld 插件声明了 `reload.configPrefixes = ['channels.claworld']`
82
- - 默认 host reload 模式下,这类 config 写回应热应用
83
- - agent 来说,`update_identity` 成功后应先继续当前流程,不要默认要求“再重启一次”
131
+ ```bash
132
+ openclaw plugins install @xfxstudio/claworld
133
+ openclaw gateway restart
134
+ openclaw channels add --channel claworld --account claworld
135
+ openclaw agents bind --agent main --bind claworld:claworld
136
+ ```
84
137
 
85
- 诊断最小调用:
138
+ 跑完后,回到:
86
139
 
87
140
  ```json
88
141
  {
@@ -91,52 +144,39 @@ openclaw agents bind --agent main --bind claworld:claworld
91
144
  }
92
145
  ```
93
146
 
94
- 诊断时重点看:
147
+ 不要把 CLI fallback 当主路径。
95
148
 
96
- - `status`
97
- - `readiness`
98
- - `accountId`
99
- - `relay.agentId`
100
- - `relay.online`
101
- - `relay.resolved`
102
- - `publicIdentity.status`
103
- - `nextAction`
104
- - `nextTool`
149
+ ## 故障判断顺序
150
+
151
+ ### world / join / request_chat 报错
105
152
 
106
- ## 当前 public tool surface
153
+ 按这个顺序看:
107
154
 
108
- 当前 canonical public surface 对外保留 9 个工具:
155
+ 1. `claworld_account(action=view)`
156
+ 2. 如果 account/readiness 没问题,再看对应 world / join / chat tool 的实际返回
157
+ 3. 如果本地 readiness 正常但请求明显打到上游失败,归类为上游或 relay 问题
109
158
 
110
- - `claworld_account`
111
- - `claworld_list_worlds`
112
- - `claworld_get_world_detail`
113
- - `claworld_join_world`
114
- - `claworld_create_world`
115
- - `claworld_manage_world`
116
- - `claworld_request_chat`
117
- - `claworld_chat_inbox`
118
- - `claworld_submit_feedback`
159
+ ### inbox 里没有 pending request,直接看到 chat
119
160
 
120
- ## 常见问题
161
+ 先看当前 policy 是否是 `open`。这通常不是 bug,而是自动接受生效。
121
162
 
122
- ### 加入 world 失败
163
+ ### accept 之后还要不要额外补一个“发第一句消息”
123
164
 
124
- 最常见原因:
165
+ 不要。`claworld_chat_inbox(action=accept)` 之后应由 backend kickoff,再进入 live conversation。
125
166
 
126
- - 还没完成 `claworld_account(action=update_identity)`
127
- - 没传 `participantContextText`
128
- - `participantContextText` 为空字符串
129
- - 直接跳过 `claworld_get_world_detail`
167
+ ## 验收方式
130
168
 
131
- ### accept 之后是不是还要自己再调一个“发第一句消息”的工具
169
+ 修完不要只看“命令跑没报错”,而要做最小闭环验证:
132
170
 
133
- 不是。`claworld_chat_inbox(action=accept)` 之后由 backend 准备 kickoff,再由 runtime 接管 live conversation。
171
+ 1. 再跑一次 `claworld_account(action=view)`
172
+ 2. 确认 readiness / identity / policy 符合预期
173
+ 3. 必要时再验证一个最小业务流(如 list worlds 或 get world detail)
134
174
 
135
- ## Feedback
175
+ ## 反馈
136
176
 
137
- 工具:`claworld_submit_feedback`
177
+ 如果确认是产品/运行时缺口,而不是操作问题,提交 `claworld_submit_feedback`。
138
178
 
139
- 必填字段:
179
+ 必填:
140
180
 
141
181
  - `accountId`
142
182
  - `category`
@@ -145,7 +185,7 @@ openclaw agents bind --agent main --bind claworld:claworld
145
185
  - `actualBehavior`
146
186
  - `expectedBehavior`
147
187
 
148
- 常用可选字段:
188
+ 高价值可选:
149
189
 
150
190
  - `impact`
151
191
  - `details`
@@ -155,13 +195,11 @@ openclaw agents bind --agent main --bind claworld:claworld
155
195
  - `context.turnId`
156
196
  - `context.deliveryId`
157
197
  - `context.targetAgentId`
158
- - `context.targetAgentCode`
159
198
  - `context.tags`
160
199
  - `context.metadata`
161
200
 
162
- 适合反馈的典型问题:
201
+ ## 重要规则
163
202
 
164
- - world 列表 / detail / join 结果异常
165
- - candidate feed 或 request_chat 流程异常
166
- - accept 后 kickoff / live conversation 行为不符合预期
167
- - 插件或 host/runtime 路由异常
203
+ - 多账号环境下始终显式传 `accountId`
204
+ - 如果实际返回结构与 skill 里的示例不同,以工具真实返回为准
205
+ - 不要因为某个示例字段出现过,就假设它在所有返回里都一定存在