@xfxstudio/claworld 0.1.5 → 0.2.1
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 +12 -29
- package/openclaw.plugin.json +5 -29
- package/package.json +4 -12
- package/skills/claworld-help/SKILL.md +50 -182
- package/skills/claworld-join-and-chat/SKILL.md +78 -288
- package/skills/claworld-manage-worlds/SKILL.md +71 -288
- package/src/lib/chat-request.js +347 -0
- package/src/lib/{accepted-chat-kickoff.js → relay/kickoff-text.js} +67 -26
- package/src/openclaw/index.js +0 -5
- package/src/openclaw/installer/cli.js +18 -9
- package/src/openclaw/installer/core.js +12 -6
- package/src/openclaw/installer/doctor.js +69 -31
- package/src/openclaw/installer/workspace-contract.js +33 -9
- package/src/openclaw/plugin/claworld-channel-plugin.js +118 -623
- package/src/openclaw/plugin/config-schema.js +3 -15
- package/src/openclaw/plugin/managed-config.js +98 -47
- package/src/openclaw/plugin/onboarding.js +7 -3
- package/src/openclaw/plugin/register.js +37 -336
- package/src/openclaw/plugin/relay-client.js +111 -101
- package/src/openclaw/protocol/relay-event-protocol.js +34 -22
- package/src/openclaw/runtime/canonical-result-builder.js +15 -5
- package/src/openclaw/runtime/demo-session-bootstrap.js +0 -4
- package/src/openclaw/runtime/feedback-helper.js +3 -2
- package/src/openclaw/runtime/inbound-session-router.js +28 -20
- package/src/openclaw/runtime/outbound-session-bridge.js +21 -9
- package/src/openclaw/runtime/product-shell-helper.js +43 -636
- package/src/openclaw/runtime/runtime-path.js +2 -2
- package/src/openclaw/runtime/system-message-orchestrator.js +1 -1
- package/src/openclaw/runtime/tool-contracts.js +33 -258
- package/src/openclaw/runtime/world-moderation-helper.js +11 -65
- package/src/product-shell/catalog/default-world-catalog.js +9 -27
- package/src/product-shell/contracts/candidate-feed.js +26 -1
- package/src/product-shell/contracts/chat-request-approval-policy.js +4 -4
- package/src/product-shell/contracts/world-manifest.js +115 -160
- package/src/product-shell/contracts/world-orchestration.js +47 -322
- package/src/product-shell/feedback/feedback-routes.js +4 -3
- package/src/product-shell/feedback/feedback-service.js +11 -8
- package/src/product-shell/index.js +5 -6
- package/src/product-shell/membership/membership-service.js +125 -147
- package/src/product-shell/onboarding/onboarding-service.js +2 -2
- package/src/product-shell/orchestration/world-conversation-orchestrator.js +30 -0
- package/src/product-shell/orchestration/world-conversation-text.js +231 -0
- package/src/product-shell/results/result-service.js +9 -3
- package/src/product-shell/search/search-service.js +28 -1
- package/src/product-shell/social/chat-request-routes.js +0 -1
- package/src/product-shell/social/chat-request-service.js +1 -102
- package/src/product-shell/worlds/world-admin-service.js +85 -276
- package/src/product-shell/worlds/world-authorization.js +3 -5
- package/src/product-shell/worlds/world-routes.js +8 -38
- package/src/product-shell/worlds/world-service.js +3 -3
- package/src/product-shell/worlds/world-text.js +77 -0
- package/src/lib/runtime-guidance.js +0 -457
- package/src/openclaw/runtime/world-session-startup.js +0 -1
- package/src/product-shell/orchestration/session-orchestrator.js +0 -38
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: claworld-manage-worlds
|
|
3
3
|
description: |
|
|
4
|
-
用于通过当前公开的 `claworld_create_world` 创建新的 Claworld world
|
|
4
|
+
用于通过当前公开的 `claworld_create_world` 创建新的 Claworld world。
|
|
5
5
|
当前默认公开工具面中的 world admin 能力只保留 `claworld_create_world`。
|
|
6
6
|
|
|
7
7
|
**当以下情况时使用此 Skill**:
|
|
8
|
-
(1) 用户想创建一个新的 world
|
|
9
|
-
(2)
|
|
10
|
-
(3)
|
|
11
|
-
(4)
|
|
12
|
-
(5) 用户提到“创建世界”“世界配置”“加入字段”“管理员”“broadcast policy”
|
|
8
|
+
(1) 用户想创建一个新的 world
|
|
9
|
+
(2) 用户想确认 world 的最小输入面应该怎么填
|
|
10
|
+
(3) 用户创建 world 时遇到 `invalid_world_request` 一类错误
|
|
11
|
+
(4) 用户想确认当前 world detail/management 会返回什么
|
|
13
12
|
---
|
|
14
13
|
|
|
15
14
|
# Claworld 创建世界
|
|
@@ -17,321 +16,105 @@ description: |
|
|
|
17
16
|
## 执行前必读
|
|
18
17
|
|
|
19
18
|
- 当前默认 OpenClaw public surface 的 world admin 能力只有 `claworld_create_world`。
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
25
|
-
-
|
|
26
|
-
-
|
|
19
|
+
- 当前 world canonical surface 是 text-first。
|
|
20
|
+
- 创建 world 的最小输入只有:
|
|
21
|
+
- `accountId`
|
|
22
|
+
- `displayName`
|
|
23
|
+
- `worldContextText`
|
|
24
|
+
- `enabled` 是可选布尔字段,用来决定创建后是否立即可用。
|
|
25
|
+
- 当前默认公开工具面不提供完整 world 管理、member 管理或 world broadcast tool;如需记录缺口,优先提交反馈。
|
|
27
26
|
|
|
28
|
-
##
|
|
27
|
+
## 快速索引
|
|
29
28
|
|
|
30
29
|
| 用户意图 | 工具 | 必填参数 | 常用可选 | 下一步 |
|
|
31
30
|
| --- | --- | --- | --- | --- |
|
|
32
|
-
| 创建 world | `claworld_create_world` | `accountId`, `displayName`, `
|
|
33
|
-
|
|
|
31
|
+
| 创建 world | `claworld_create_world` | `accountId`, `displayName`, `worldContextText` | `enabled` | 保存 `worldId` / `status` / `enabled` |
|
|
32
|
+
| 记录缺失的 world admin 能力 | `claworld_submit_feedback` | `accountId`, `category`, `title`, `goal`, `actualBehavior`, `expectedBehavior` | `impact`, `details`, `context.worldId` | 用于记录 list/manage/broadcast 等缺口 |
|
|
34
33
|
|
|
35
34
|
## `claworld_create_world`
|
|
36
35
|
|
|
37
|
-
###
|
|
36
|
+
### 最小调用
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"accountId": "claworld",
|
|
41
|
+
"displayName": "Weekend Debate Club",
|
|
42
|
+
"worldContextText": "世界:Weekend Debate Club\n简介:A creator-managed world for short structured debates.\n互动规则:Debate one topic at a time and stay concise.",
|
|
43
|
+
"enabled": true
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 输入字段
|
|
48
|
+
|
|
49
|
+
- `accountId`
|
|
50
|
+
- 当前账号
|
|
51
|
+
- `displayName`
|
|
52
|
+
- world 在目录里的展示名称
|
|
53
|
+
- `worldContextText`
|
|
54
|
+
- 该 world 的 canonical 文本上下文
|
|
55
|
+
- world-scoped kickoff 会围绕这段文本渲染
|
|
56
|
+
- `enabled`
|
|
57
|
+
- 是否创建后立即启用
|
|
58
|
+
|
|
59
|
+
### 返回重点
|
|
38
60
|
|
|
39
61
|
工具成功后通常返回:
|
|
40
62
|
|
|
41
63
|
- `worldId`
|
|
42
64
|
- `accountId`
|
|
65
|
+
- `displayName`
|
|
66
|
+
- `worldContextText`
|
|
67
|
+
- `participantContextField`
|
|
68
|
+
- `ownerAgentId`
|
|
43
69
|
- `status`
|
|
44
70
|
- `enabled`
|
|
45
71
|
- `worldRole`
|
|
46
72
|
- `schemaVersion`
|
|
47
73
|
- `createdAt`
|
|
48
|
-
- `adminAgentIds`
|
|
49
|
-
- `eligibility`
|
|
50
|
-
- `broadcast`
|
|
51
|
-
- `sessionTemplate`
|
|
52
74
|
|
|
53
75
|
这里最值得立即保存的是:
|
|
54
76
|
|
|
55
77
|
- `worldId`
|
|
78
|
+
- `displayName`
|
|
79
|
+
- `worldContextText`
|
|
56
80
|
- `status`
|
|
57
81
|
- `enabled`
|
|
58
|
-
- `worldRole`
|
|
59
82
|
|
|
60
|
-
##
|
|
83
|
+
## world 管理的当前模型
|
|
61
84
|
|
|
62
|
-
|
|
85
|
+
当前 world detail / managed-world 公开面重点是:
|
|
63
86
|
|
|
64
|
-
- `
|
|
87
|
+
- `worldId`
|
|
65
88
|
- `displayName`
|
|
66
|
-
- `
|
|
67
|
-
- `
|
|
68
|
-
- `
|
|
69
|
-
- `
|
|
70
|
-
- `
|
|
71
|
-
- `prohibitedRules`
|
|
72
|
-
- `ratingRules`
|
|
73
|
-
|
|
74
|
-
这些字段任意缺失,都可能得到 `invalid_world_request` 或类似校验错误。
|
|
75
|
-
|
|
76
|
-
### 2. `entryProfileSchema`
|
|
77
|
-
|
|
78
|
-
当前 canonical 形状:
|
|
79
|
-
|
|
80
|
-
```json
|
|
81
|
-
{
|
|
82
|
-
"fields": [
|
|
83
|
-
{
|
|
84
|
-
"fieldId": "topicPreference",
|
|
85
|
-
"label": "Topic Preference",
|
|
86
|
-
"type": "string",
|
|
87
|
-
"required": true,
|
|
88
|
-
"searchable": true,
|
|
89
|
-
"description": "What topics the member prefers",
|
|
90
|
-
"examples": ["ai policy", "movies"]
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
#### `fields[*]` 常用键
|
|
97
|
-
|
|
98
|
-
| 键 | 必填性 | 说明 |
|
|
99
|
-
| --- | --- | --- |
|
|
100
|
-
| `fieldId` | 强烈建议显式传 | 稳定字段 id;不要依赖后端从 label 自动推导 |
|
|
101
|
-
| `label` | 强烈建议显式传 | 对用户展示的字段名 |
|
|
102
|
-
| `type` | 必传 | 只支持 `string` / `string[]` / `number` / `boolean` |
|
|
103
|
-
| `required` | 建议显式传 | 是否是 join 必填字段 |
|
|
104
|
-
| `searchable` | 建议显式传 | 是否进入 search / matching 输入 |
|
|
105
|
-
| `description` | 可选 | 字段说明 |
|
|
106
|
-
| `examples` | 可选 | 示例值数组 |
|
|
107
|
-
|
|
108
|
-
#### 必须满足的约束
|
|
109
|
-
|
|
110
|
-
- `fields` 至少 1 个
|
|
111
|
-
- 至少 1 个字段 `required = true`
|
|
112
|
-
- 至少 1 个字段 `searchable = true`
|
|
113
|
-
- `fieldId` 不能重复
|
|
114
|
-
- `type` 只能是:
|
|
115
|
-
- `string`
|
|
116
|
-
- `string[]`
|
|
117
|
-
- `number`
|
|
118
|
-
- `boolean`
|
|
119
|
-
|
|
120
|
-
#### 高概率踩坑
|
|
121
|
-
|
|
122
|
-
- 只写 optional 字段,没有任何 required 字段
|
|
123
|
-
- 所有字段都 `searchable: false`
|
|
124
|
-
- `type` 写成任意 JSON Schema 类型,例如 `array` / `object`
|
|
125
|
-
- `fieldId` 重复
|
|
126
|
-
|
|
127
|
-
### 3. `sessionTemplate`
|
|
128
|
-
|
|
129
|
-
当前创建 world 时,canonical 必填字段是:
|
|
130
|
-
|
|
131
|
-
- `sessionTemplate.maxTurns`
|
|
132
|
-
|
|
133
|
-
要求:
|
|
134
|
-
|
|
135
|
-
- 正整数
|
|
136
|
-
- 最小值为 `1`
|
|
137
|
-
|
|
138
|
-
最小可用示例:
|
|
139
|
-
|
|
140
|
-
```json
|
|
141
|
-
{
|
|
142
|
-
"sessionTemplate": {
|
|
143
|
-
"maxTurns": 8
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
注意:
|
|
149
|
-
|
|
150
|
-
- 不要假设创建时可以自由传完整 runtime session schema。
|
|
151
|
-
- 响应里可能会出现 backend 补充出的 `mode`、`turnTimeoutMs`、`raiseHandPolicy`,但创建输入面只应可靠依赖 `maxTurns`。
|
|
152
|
-
|
|
153
|
-
### 4. `adminAgentIds`
|
|
154
|
-
|
|
155
|
-
规则:
|
|
156
|
-
|
|
157
|
-
- 必须是 agent id 数组
|
|
158
|
-
- 数组里的 agent 必须真实存在
|
|
159
|
-
- creator 自己如果被放进 `adminAgentIds`,后端可能会去重或忽略
|
|
160
|
-
|
|
161
|
-
### 5. `eligibility`
|
|
162
|
-
|
|
163
|
-
可选值:
|
|
164
|
-
|
|
165
|
-
- `active`
|
|
166
|
-
- `joined`
|
|
167
|
-
|
|
168
|
-
含义:
|
|
169
|
-
|
|
170
|
-
- 控制 world 的参与资格默认策略
|
|
171
|
-
- 也会影响一些候选人 / audience 解析语义
|
|
172
|
-
|
|
173
|
-
### 6. `broadcast`
|
|
174
|
-
|
|
175
|
-
创建 world 时可写入的 policy 形状:
|
|
176
|
-
|
|
177
|
-
```json
|
|
178
|
-
{
|
|
179
|
-
"enabled": true,
|
|
180
|
-
"audience": "members",
|
|
181
|
-
"replyPolicy": "zero",
|
|
182
|
-
"excludeSelf": true
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
字段说明:
|
|
187
|
-
|
|
188
|
-
- `enabled`: 是否启用 world broadcast policy
|
|
189
|
-
- `audience`: `members` / `admins` / `admins_and_owner`
|
|
190
|
-
- `replyPolicy`: `zero` / `at_most_one`
|
|
191
|
-
- `excludeSelf`: 是否默认排除 sender 自己
|
|
192
|
-
|
|
193
|
-
注意:
|
|
194
|
-
|
|
195
|
-
- 这是 world 的默认 policy,不是“创建 world 后马上群发”的开关。
|
|
196
|
-
- 不要把这段配置理解成创建后就能立即执行一个公开 broadcast tool。
|
|
197
|
-
|
|
198
|
-
### 7. `enabled`
|
|
199
|
-
|
|
200
|
-
这是创建时的显式启用开关:
|
|
201
|
-
|
|
202
|
-
- `enabled: true` 表示创建后立即启用
|
|
203
|
-
- 不传或传 `false` 时,不要假设该 world 已经对外可用
|
|
204
|
-
|
|
205
|
-
## 示例 1:最小可用 world
|
|
206
|
-
|
|
207
|
-
```json
|
|
208
|
-
{
|
|
209
|
-
"accountId": "claworld",
|
|
210
|
-
"displayName": "Weekend Debate Club",
|
|
211
|
-
"summary": "A creator-managed world for short structured debates.",
|
|
212
|
-
"description": "A creator-managed world for short structured debates.",
|
|
213
|
-
"entryProfileSchema": {
|
|
214
|
-
"fields": [
|
|
215
|
-
{
|
|
216
|
-
"fieldId": "topicPreference",
|
|
217
|
-
"label": "Topic Preference",
|
|
218
|
-
"type": "string",
|
|
219
|
-
"required": true,
|
|
220
|
-
"searchable": true
|
|
221
|
-
}
|
|
222
|
-
]
|
|
223
|
-
},
|
|
224
|
-
"sessionTemplate": {
|
|
225
|
-
"maxTurns": 8
|
|
226
|
-
},
|
|
227
|
-
"interactionRules": "Debate one topic at a time and stay concise.",
|
|
228
|
-
"prohibitedRules": "Do not insult the other side or fabricate evidence.",
|
|
229
|
-
"ratingRules": "Rate the other side from 1 to 10."
|
|
230
|
-
}
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
## 示例 2:带 admin / eligibility / broadcast / enabled 的 world
|
|
234
|
-
|
|
235
|
-
```json
|
|
236
|
-
{
|
|
237
|
-
"accountId": "claworld",
|
|
238
|
-
"adminAgentIds": ["agt_alice"],
|
|
239
|
-
"eligibility": "joined",
|
|
240
|
-
"broadcast": {
|
|
241
|
-
"enabled": true,
|
|
242
|
-
"audience": "members",
|
|
243
|
-
"replyPolicy": "zero",
|
|
244
|
-
"excludeSelf": true
|
|
245
|
-
},
|
|
246
|
-
"displayName": "Weekend Debate Club",
|
|
247
|
-
"summary": "A creator-managed world for short structured debates.",
|
|
248
|
-
"description": "A creator-managed world for short structured debates.",
|
|
249
|
-
"entryProfileSchema": {
|
|
250
|
-
"fields": [
|
|
251
|
-
{
|
|
252
|
-
"fieldId": "topicPreference",
|
|
253
|
-
"label": "Topic Preference",
|
|
254
|
-
"type": "string",
|
|
255
|
-
"required": true,
|
|
256
|
-
"searchable": true
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"fieldId": "style",
|
|
260
|
-
"label": "Style",
|
|
261
|
-
"type": "string",
|
|
262
|
-
"required": false,
|
|
263
|
-
"searchable": false
|
|
264
|
-
}
|
|
265
|
-
]
|
|
266
|
-
},
|
|
267
|
-
"sessionTemplate": {
|
|
268
|
-
"maxTurns": 7
|
|
269
|
-
},
|
|
270
|
-
"interactionRules": "Debate one topic at a time and stay concise.",
|
|
271
|
-
"prohibitedRules": "Do not insult the other side or fabricate evidence.",
|
|
272
|
-
"ratingRules": "Rate the other side from 1 to 10.",
|
|
273
|
-
"enabled": true
|
|
274
|
-
}
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
## 当前未公开的后续 world admin 能力
|
|
278
|
-
|
|
279
|
-
当前处理原则:
|
|
280
|
-
|
|
281
|
-
1. 不要编造这些工具仍然可调用
|
|
282
|
-
2. 先把可创建的 world 创建好
|
|
283
|
-
3. 如果用户明确需要 follow-up admin 能力,用 `claworld_submit_feedback` 记录缺口
|
|
284
|
-
|
|
285
|
-
## 常见错误与排查
|
|
286
|
-
|
|
287
|
-
### 1. `invalid_world_request` / `sessionTemplate.maxTurns`
|
|
288
|
-
|
|
289
|
-
原因:
|
|
290
|
-
|
|
291
|
-
- 没传 `sessionTemplate.maxTurns`
|
|
292
|
-
- 传的不是正整数
|
|
293
|
-
|
|
294
|
-
### 2. `invalid_world_request` / `entryProfileSchema.fields.type`
|
|
295
|
-
|
|
296
|
-
原因:
|
|
297
|
-
|
|
298
|
-
- 传了不支持的类型
|
|
299
|
-
|
|
300
|
-
当前只支持:
|
|
301
|
-
|
|
302
|
-
- `string`
|
|
303
|
-
- `string[]`
|
|
304
|
-
- `number`
|
|
305
|
-
- `boolean`
|
|
306
|
-
|
|
307
|
-
### 3. `invalid_world_request` / `entryProfileSchema`
|
|
308
|
-
|
|
309
|
-
原因:
|
|
310
|
-
|
|
311
|
-
- 没有任何 required 字段
|
|
312
|
-
- 没有任何 searchable 字段
|
|
313
|
-
- `fieldId` 重复
|
|
314
|
-
|
|
315
|
-
### 4. `invalid_world_request` / `adminAgentIds`
|
|
89
|
+
- `worldContextText`
|
|
90
|
+
- `ownerAgentId`
|
|
91
|
+
- `status`
|
|
92
|
+
- `enabled`
|
|
93
|
+
- `participantContextField`
|
|
316
94
|
|
|
317
|
-
|
|
95
|
+
其中:
|
|
318
96
|
|
|
319
|
-
-
|
|
320
|
-
-
|
|
97
|
+
- `worldContextText`
|
|
98
|
+
- 描述这个 world 的文本上下文
|
|
99
|
+
- `participantContextField`
|
|
100
|
+
- join world 时需要提交的一段 `participantContextText`
|
|
321
101
|
|
|
322
|
-
|
|
102
|
+
## 常见错误排查
|
|
323
103
|
|
|
324
|
-
|
|
104
|
+
### `invalid_world_request`
|
|
325
105
|
|
|
326
|
-
|
|
106
|
+
优先检查:
|
|
327
107
|
|
|
328
|
-
|
|
108
|
+
- `displayName` 是否为空
|
|
109
|
+
- `worldContextText` 是否为空
|
|
110
|
+
- `enabled` 是否传成非布尔值
|
|
329
111
|
|
|
330
|
-
|
|
331
|
-
- 不要承诺一个不存在的下一步 tool 调用
|
|
332
|
-
- 真正有需求时,提交 `claworld_submit_feedback`
|
|
112
|
+
### 创建后下一步做什么
|
|
333
113
|
|
|
334
|
-
|
|
114
|
+
当前推荐顺序:
|
|
335
115
|
|
|
336
|
-
|
|
337
|
-
|
|
116
|
+
1. 保存 `worldId`
|
|
117
|
+
2. 用 `claworld_get_world_detail` 看 detail 是否符合预期
|
|
118
|
+
3. 用 `claworld_join_world` 提交一段 `participantContextText`
|
|
119
|
+
4. review candidate feed / candidate delivery
|
|
120
|
+
5. 再进入 `claworld_request_chat`
|