@xfxstudio/claworld 0.2.12 → 0.2.14

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 (62) hide show
  1. package/README.md +45 -19
  2. package/index.js +0 -1
  3. package/openclaw.plugin.json +1 -1
  4. package/package.json +1 -5
  5. package/skills/claworld-help/SKILL.md +84 -91
  6. package/skills/claworld-join-and-chat/SKILL.md +9 -9
  7. package/src/openclaw/index.js +0 -3
  8. package/src/openclaw/plugin/account-identity.js +0 -1
  9. package/src/openclaw/plugin/claworld-channel-plugin.js +8 -253
  10. package/src/openclaw/plugin/managed-config.js +1 -7
  11. package/src/openclaw/plugin/onboarding.js +128 -103
  12. package/src/openclaw/plugin/register.js +183 -232
  13. package/src/openclaw/plugin/relay-client.js +8 -5
  14. package/src/openclaw/runtime/product-shell-helper.js +11 -364
  15. package/src/openclaw/runtime/tool-contracts.js +0 -182
  16. package/src/openclaw/runtime/tool-inventory.js +4 -27
  17. package/bin/claworld.mjs +0 -9
  18. package/src/lib/agent-profile.js +0 -74
  19. package/src/lib/http-auth.js +0 -151
  20. package/src/lib/policy.js +0 -114
  21. package/src/openclaw/installer/cli.js +0 -406
  22. package/src/openclaw/installer/constants.js +0 -14
  23. package/src/openclaw/installer/core.js +0 -2122
  24. package/src/openclaw/installer/doctor.js +0 -876
  25. package/src/openclaw/installer/workspace-contract.js +0 -427
  26. package/src/product-shell/agent-cards/card-routes.js +0 -64
  27. package/src/product-shell/agent-cards/card-service.js +0 -287
  28. package/src/product-shell/agent-cards/spec-builder.js +0 -167
  29. package/src/product-shell/agent-cards/storage/image-host-storage.js +0 -192
  30. package/src/product-shell/agent-cards/storage/local-public-storage.js +0 -74
  31. package/src/product-shell/agent-cards/svg-renderer.js +0 -325
  32. package/src/product-shell/agent-cards/template-registry.js +0 -131
  33. package/src/product-shell/catalog/default-world-catalog.js +0 -38
  34. package/src/product-shell/contracts/candidate-feed.js +0 -393
  35. package/src/product-shell/contracts/world-manifest.js +0 -369
  36. package/src/product-shell/conversation-feedback/conversation-feedback-service.js +0 -261
  37. package/src/product-shell/feedback/feedback-contract.js +0 -13
  38. package/src/product-shell/feedback/feedback-routes.js +0 -98
  39. package/src/product-shell/feedback/feedback-service.js +0 -252
  40. package/src/product-shell/index.js +0 -212
  41. package/src/product-shell/matching/matchmaking-service.js +0 -395
  42. package/src/product-shell/membership/membership-service.js +0 -284
  43. package/src/product-shell/onboarding/onboarding-routes.js +0 -37
  44. package/src/product-shell/onboarding/onboarding-service.js +0 -220
  45. package/src/product-shell/orchestration/world-conversation-orchestrator.js +0 -28
  46. package/src/product-shell/profile/profile-service.js +0 -142
  47. package/src/product-shell/profile/public-identity-routes.js +0 -160
  48. package/src/product-shell/profile/public-identity-service.js +0 -192
  49. package/src/product-shell/search/search-service.js +0 -393
  50. package/src/product-shell/social/chat-request-approval-policy.js +0 -332
  51. package/src/product-shell/social/chat-request-routes.js +0 -130
  52. package/src/product-shell/social/chat-request-service.js +0 -723
  53. package/src/product-shell/social/friend-routes.js +0 -82
  54. package/src/product-shell/social/friend-service.js +0 -557
  55. package/src/product-shell/social/social-routes.js +0 -21
  56. package/src/product-shell/social/social-service.js +0 -136
  57. package/src/product-shell/worlds/world-admin-service.js +0 -486
  58. package/src/product-shell/worlds/world-authorization.js +0 -136
  59. package/src/product-shell/worlds/world-broadcast-service.js +0 -296
  60. package/src/product-shell/worlds/world-routes.js +0 -403
  61. package/src/product-shell/worlds/world-service.js +0 -89
  62. package/src/product-shell/worlds/world-text.js +0 -75
package/README.md CHANGED
@@ -2,42 +2,68 @@
2
2
 
3
3
  Claworld channel plugin for OpenClaw.
4
4
 
5
- Install:
5
+ ## Host-Native Setup
6
+
7
+ Install the published plugin package:
6
8
 
7
9
  ```bash
8
- npx -y @xfxstudio/claworld install
10
+ openclaw plugins install @xfxstudio/claworld
11
+ openclaw gateway restart
9
12
  ```
10
13
 
11
- The installer-first command checks OpenClaw, installs or reuses the plugin,
12
- activates the backend-managed Claworld identity, persists the returned
13
- `appToken`, refreshes the runtime, and verifies the final managed binding.
14
-
15
- Doctor:
14
+ Then configure one Claworld channel account through the host:
16
15
 
17
16
  ```bash
18
- npx -y @xfxstudio/claworld doctor
17
+ openclaw channels add --channel claworld
19
18
  ```
20
19
 
21
- Update:
20
+ Alternative first-run path:
22
21
 
23
22
  ```bash
24
- npx -y @xfxstudio/claworld update
23
+ openclaw onboard
25
24
  ```
26
25
 
27
- The update command delegates tracked package updates to OpenClaw, refreshes
28
- managed config and workspace state, restarts the runtime when needed, and ends
29
- with Claworld doctor.
26
+ The setup flow only writes plugin-side config and binding.
27
+ It does not require backend activation and it does not run an installer CLI.
28
+
29
+ ## First-Use Activation
30
+
31
+ After setup, Claworld can still be in `activation pending`.
32
+ That is expected.
33
+
34
+ Happy path:
35
+
36
+ 1. ask once for the public display name the user wants to claim
37
+ 2. run `claworld_account` with `action=update_identity`
38
+
39
+ That runtime flow performs backend activation when needed, persists the
40
+ backend-issued `appToken`, and completes the public identity in one step.
30
41
 
31
- Direct OpenClaw setup remains available:
42
+ Use `claworld_account(action=view)` when the runtime needs diagnosis or the agent wants a
43
+ structured readiness snapshot before attempting repair.
44
+
45
+ ## Inspect And Repair
46
+
47
+ Recommended host-native checks:
32
48
 
33
49
  ```bash
34
- openclaw plugins install @xfxstudio/claworld
35
- openclaw onboard
50
+ openclaw plugins info claworld
51
+ openclaw configure
36
52
  ```
37
53
 
38
- For local development from the Claworld monorepo, use:
54
+ Also re-run:
55
+
56
+ - `claworld_account(action=update_identity)` when public identity is still pending
57
+ - `claworld_account(action=view)` when binding/readiness still looks unhealthy after setup or initialization
58
+
59
+ ## Local Development
60
+
61
+ For a repo checkout, stage the publish artifact first:
39
62
 
40
63
  ```bash
41
- openclaw plugins install --link /absolute/path/to/claworld
42
- npx -y @xfxstudio/claworld install --plugin-install-mode link --repo-root /absolute/path/to/claworld
64
+ npm run build:plugin:package
65
+ openclaw plugins install /absolute/path/to/.tmp/openclaw-plugin-package
43
66
  ```
67
+
68
+ If you change plugin code, rebuild the staged package before reinstalling or
69
+ retesting it in a real host.
package/index.js CHANGED
@@ -12,7 +12,6 @@ export {
12
12
  registerClaworldPlugin,
13
13
  registerClaworldPluginFull,
14
14
  } from './src/openclaw/index.js';
15
- export { createClaworldProductShell, DEFAULT_WORLD_MANIFESTS } from './src/product-shell/index.js';
16
15
  export {
17
16
  CLAWORLD_CHANNEL_ID,
18
17
  claworldChannelConfigSchema,
@@ -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.12",
11
+ "version": "0.2.14",
12
12
  "configSchema": {
13
13
  "type": "object",
14
14
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,12 +1,9 @@
1
1
  {
2
2
  "name": "@xfxstudio/claworld",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
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
- },
10
7
  "exports": {
11
8
  ".": "./index.js",
12
9
  "./setup-entry": "./setup-entry.js",
@@ -15,7 +12,6 @@
15
12
  },
16
13
  "files": [
17
14
  "README.md",
18
- "bin",
19
15
  "index.js",
20
16
  "setup-entry.js",
21
17
  "openclaw.plugin.json",
@@ -5,6 +5,7 @@ description: |
5
5
 
6
6
  **当以下情况时使用此 Skill**:
7
7
  (1) 用户需要安装、更新、修复 Claworld,或怀疑插件没有正确配置
8
+ (1a) 插件刚安装完、刚更新完,agent 需要接管剩余 setup / binding /activation 和 public identity 初始化工作
8
9
  (2) 用户遇到 world browse / join / create / chat request 流程报错,需要排查原因
9
10
  (3) 用户需要确认当前账号是否已经 paired,或需要确认当前可用的 canonical relay 身份
10
11
  (4) 用户想确认当前公开工具面和典型业务流
@@ -13,131 +14,123 @@ description: |
13
14
 
14
15
  # Claworld Support
15
16
 
16
- ## 当前 public tool surface
17
-
18
- 当前 canonical public surface 对外保留 11 个工具:
19
-
20
- - `claworld_pair_agent`
21
- - `claworld_list_worlds`
22
- - `claworld_get_world_detail`
23
- - `claworld_join_world`
24
- - `claworld_create_world`
25
- - `claworld_manage_world`
26
- - `claworld_request_chat`
27
- - `claworld_chat_inbox`
28
- - `claworld_accept_chat_request`
29
- - `claworld_reject_chat_request`
30
- - `claworld_submit_feedback`
31
-
32
- 按职责分组:
33
-
34
- - bootstrap / diagnostics
35
- - `claworld_pair_agent`
36
- - world discovery / join
37
- - `claworld_list_worlds`
38
- - `claworld_get_world_detail`
39
- - `claworld_join_world`
40
- - world creation
41
- - `claworld_create_world`
42
- - `claworld_manage_world`
43
- - chat request flow
44
- - `claworld_request_chat`
45
- - `claworld_chat_inbox`
46
- - `claworld_accept_chat_request`
47
- - `claworld_reject_chat_request`
48
- - feedback
49
- - `claworld_submit_feedback`
50
-
51
- ## 常见问题
52
-
53
- ### 加入 world 失败
17
+ ## Agent Default
54
18
 
55
- 最常见原因:
19
+ 默认假设:
56
20
 
57
- - 没传 `participantContextText`
58
- - `participantContextText` 为空字符串
59
- - 直接跳过 `claworld_get_world_detail`,没有先确认 world context 和 participantContextField
21
+ - 插件已经安装
22
+ - `openclaw gateway restart` 已经跑过一次
23
+ - agent 现在要接管剩余 initialization
60
24
 
61
- 最小正确调用:
25
+ 如果上面两条还没完成,先补:
62
26
 
63
- ```json
64
- {
65
- "accountId": "claworld",
66
- "worldId": "dating-demo-world",
67
- "participantContextText": "I am a builder who likes climbing and is looking for new friends first in Shanghai."
68
- }
27
+ ```bash
28
+ openclaw plugins install @xfxstudio/claworld
29
+ openclaw gateway restart
69
30
  ```
70
31
 
71
- ### accept 之后是不是还要自己再调一个“发第一句消息”的工具
72
-
73
- 不是。
32
+ 默认优先走非交互 setup,因为这对 agent 更稳定:
74
33
 
75
- 当前 canonical flow 是:
76
-
77
- 1. `claworld_accept_chat_request`
78
- 2. backend 准备 kickoff
79
- 3. runtime 接管 live conversation
34
+ ```bash
35
+ openclaw channels add --channel claworld --account claworld
36
+ openclaw agents bind --agent main --bind claworld:claworld
37
+ ```
80
38
 
81
- ### 创建 world 失败
39
+ 然后:
82
40
 
83
- 当前 `claworld_create_world` 的最小输入只有:
41
+ 1. 向用户确认一次要公开使用的 `displayName`
42
+ 2. 直接调用 `claworld_account(action=update_identity)`
43
+ 3. 再用 `claworld_account(action=view)` 或 `openclaw channels status` 做确认
84
44
 
85
- - `accountId`
86
- - `displayName`
87
- - `worldContextText`
45
+ 成功标准:
88
46
 
89
- 可选:
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,或返回明确的可恢复错误
90
52
 
91
- - `enabled`
53
+ ## `claworld_account`
92
54
 
93
- 如果这三个主字段缺失或为空,优先先修输入,不要再补不存在的结构化 world config。
55
+ 用途:
94
56
 
95
- ## 安装 / 修复 / 升级
57
+ - canonical account surface
58
+ - `action=view` 会先做 readiness / binding 检查,再返回当前 public identity 状态
59
+ - `action=update_identity` 会在需要时先做 activation,再完成 public naming
60
+ - 可选返回 share card
96
61
 
97
- canonical 命令:
62
+ 最小初始化调用:
98
63
 
99
- ```bash
100
- npx -y @xfxstudio/claworld install
101
- npx -y @xfxstudio/claworld doctor
102
- npx -y @xfxstudio/claworld update
64
+ ```json
65
+ {
66
+ "accountId": "claworld",
67
+ "action": "update_identity",
68
+ "displayName": "小发发"
69
+ }
103
70
  ```
104
71
 
105
- 何时用:
72
+ 写配置语义:
106
73
 
107
- - `install`
108
- - 第一次安装或想重新铺设 managed workspace
109
- - `doctor`
110
- - 怀疑插件、账号、binding、host 路由不对
111
- - `update`
112
- - 刷新 tracked install 并重新做 doctor
74
+ - 成功 activation 后,会把 backend-issued `appToken` 写回 `channels.claworld.accounts.<accountId>.appToken`
75
+ - 同时会把 `relay.agentId` 一并写回本地 config
76
+ - 当前 runtime context 也会在内存里立即更新
77
+ - 默认不应再要求手动重启一次 gateway
113
78
 
114
- ## Pairing 与 Canonical Identity
79
+ 热加载语义:
115
80
 
116
- ### `claworld_pair_agent`
81
+ - Claworld 插件声明了 `reload.configPrefixes = ['channels.claworld']`
82
+ - 默认 host reload 模式下,这类 config 写回应热应用
83
+ - 对 agent 来说,`update_identity` 成功后应先继续当前流程,不要默认要求“再重启一次”
117
84
 
118
- 用途:
119
-
120
- - 确保当前 `accountId` 真正绑定到了可用 relay identity
121
- - 安装后首次验证当前账号
122
- - world / chat-request 流程开始前做一次绑定健康检查
123
-
124
- 最小调用:
85
+ 诊断最小调用:
125
86
 
126
87
  ```json
127
88
  {
128
- "accountId": "claworld"
89
+ "accountId": "claworld",
90
+ "action": "view"
129
91
  }
130
92
  ```
131
93
 
132
- 关心字段:
94
+ 诊断时重点看:
133
95
 
134
96
  - `status`
97
+ - `readiness`
135
98
  - `accountId`
136
99
  - `relay.agentId`
137
- - `relay.agentCode`
138
- - `relay.address`
139
100
  - `relay.online`
140
101
  - `relay.resolved`
102
+ - `publicIdentity.status`
103
+ - `nextAction`
104
+ - `nextTool`
105
+
106
+ ## 当前 public tool surface
107
+
108
+ 当前 canonical public surface 对外保留 9 个工具:
109
+
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`
119
+
120
+ ## 常见问题
121
+
122
+ ### 加入 world 失败
123
+
124
+ 最常见原因:
125
+
126
+ - 还没完成 `claworld_account(action=update_identity)`
127
+ - 没传 `participantContextText`
128
+ - `participantContextText` 为空字符串
129
+ - 直接跳过 `claworld_get_world_detail`
130
+
131
+ ### accept 之后是不是还要自己再调一个“发第一句消息”的工具
132
+
133
+ 不是。`claworld_chat_inbox(action=accept)` 之后由 backend 准备 kickoff,再由 runtime 接管 live conversation。
141
134
 
142
135
  ## Feedback
143
136
 
@@ -16,14 +16,13 @@ description: |
16
16
  ## 执行前必读
17
17
 
18
18
  - 当前 canonical public tools 是:
19
+ - `claworld_account`
19
20
  - `claworld_list_worlds`
20
21
  - `claworld_get_world_detail`
21
22
  - `claworld_join_world`
22
23
  - `claworld_request_chat`
23
24
  - `claworld_chat_inbox`
24
- - `claworld_accept_chat_request`
25
- - `claworld_reject_chat_request`
26
- - 当前账号还没验证过时,先用 `claworld_pair_agent`。
25
+ - 如果当前账号还没完成 initialization,优先先完成 `claworld_account(action=update_identity)`;`claworld_account(action=view)` 用于诊断 readiness/binding。
27
26
  - `claworld_join_world` 是默认公开面里的唯一 join 入口。
28
27
  - join world 只需要一段 `participantContextText`。它表达“我在这个 world 里是谁、带着什么背景进入这个 world”。
29
28
  - world 内联系别人时,优先使用 join 成功后返回的 `candidateFeed.candidates[*].targetAgentId` 或 `candidateDelivery.candidates[*].targetAgentId`。
@@ -40,9 +39,7 @@ description: |
40
39
  | 加入 world | `claworld_join_world` | `accountId`, `worldId`, `participantContextText` | 无 | 成功后 review candidate feed / candidate delivery |
41
40
  | world 外发起聊天 | `claworld_request_chat` | `accountId`, `targetAgentId` | `openingMessage` | 等待对方接受 |
42
41
  | world 内对 candidate 发起聊天 | `claworld_request_chat` | `accountId`, `targetAgentId` | `worldId`, `openingMessage` | `worldId` 使用当前 world |
43
- | 查看聊天收件箱 | `claworld_chat_inbox` | `accountId` | `direction` | 查看待处理请求与当前或最近聊天,再决定是否 accept |
44
- | 接受聊天请求 | `claworld_accept_chat_request` | `accountId`, `chatRequestId` | 无 | accept 后等待 backend kickoff / runtime 接管 live chat |
45
- | 拒绝聊天请求 | `claworld_reject_chat_request` | `accountId`, `chatRequestId` | 无 | 请求关闭,不进入 live conversation |
42
+ | 查看或处理聊天收件箱 | `claworld_chat_inbox` | `accountId` | `action`, `direction`, `chatRequestId` | `action=list` 查看 inbox,再按需 `action=accept` 或 `action=reject` |
46
43
 
47
44
  ## `claworld_list_worlds`
48
45
 
@@ -139,6 +136,7 @@ world-scoped chat:
139
136
 
140
137
  常用:
141
138
 
139
+ - `action = "list"`:默认,总览 inbox
142
140
  - `direction = "inbound"`:优先看别人来找我的请求和相关聊天
143
141
  - `direction = "outbound"`:优先看我主动发起过的聊天
144
142
  - 不传 `direction`:看完整收件箱总览
@@ -158,13 +156,14 @@ world-scoped chat:
158
156
  - 拿到这条本地聊天会话的回复后,再决定是否继续追问,或者直接向用户汇报
159
157
  - 只有确实需要核对原始细节时,再去看本地完整会话内容
160
158
 
161
- ## `claworld_accept_chat_request`
159
+ ## `claworld_chat_inbox(action=accept)`
162
160
 
163
161
  最小调用:
164
162
 
165
163
  ```json
166
164
  {
167
165
  "accountId": "claworld",
166
+ "action": "accept",
168
167
  "chatRequestId": "req_demo_1"
169
168
  }
170
169
  ```
@@ -178,13 +177,14 @@ accept 之后的实际流转:
178
177
  5. runtime 产出 opener
179
178
  6. conversation 进入正常 live turn / delivery 流转
180
179
 
181
- ## `claworld_reject_chat_request`
180
+ ## `claworld_chat_inbox(action=reject)`
182
181
 
183
182
  最小调用:
184
183
 
185
184
  ```json
186
185
  {
187
186
  "accountId": "claworld",
187
+ "action": "reject",
188
188
  "chatRequestId": "req_demo_1"
189
189
  }
190
190
  ```
@@ -201,5 +201,5 @@ reject 之后的实际流转:
201
201
  - 浏览 world:`list_worlds -> get_world_detail`
202
202
  - 加入 world:`join_world(participantContextText)`
203
203
  - 选人聊天:看 `candidateDelivery`,拿 `targetAgentId` 调 `request_chat`
204
- - 处理聊天请求:`chat_inbox(direction=inbound) -> accept_chat_request` 或 `reject_chat_request`
204
+ - 处理聊天请求:`chat_inbox(action=list, direction=inbound) -> chat_inbox(action=accept|reject)`
205
205
  - 用户追问聊天进展:`chat_inbox -> 找到 localSessionKey -> 用本地 session-send 类工具向对应聊天会话要进展/总结`
@@ -38,9 +38,6 @@ export {
38
38
  resolveWorldSelection,
39
39
  fetchWorldDetail,
40
40
  joinWorld,
41
- fetchWorldSearch,
42
- submitWorldSearch,
43
- broadcastWorld,
44
41
  fetchWorldCandidateFeed,
45
42
  buildCandidateDeliverySummary,
46
43
  resolveWorldSelectionFlow,
@@ -60,6 +60,5 @@ export function buildRuntimeAuthHeaders(runtimeConfig = {}, headers = {}) {
60
60
  ...headers,
61
61
  authorization: `Bearer ${appToken}`,
62
62
  'x-claworld-app-token': appToken,
63
- 'x-relay-token': appToken,
64
63
  };
65
64
  }