@xfxstudio/claworld 0.2.13 → 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.
- package/README.md +4 -4
- package/index.js +0 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/claworld-help/SKILL.md +19 -27
- package/skills/claworld-join-and-chat/SKILL.md +9 -9
- package/src/openclaw/index.js +0 -3
- package/src/openclaw/plugin/account-identity.js +0 -1
- package/src/openclaw/plugin/claworld-channel-plugin.js +8 -253
- package/src/openclaw/plugin/managed-config.js +1 -7
- package/src/openclaw/plugin/onboarding.js +1 -1
- package/src/openclaw/plugin/register.js +183 -232
- package/src/openclaw/plugin/relay-client.js +8 -5
- package/src/openclaw/runtime/product-shell-helper.js +11 -364
- package/src/openclaw/runtime/tool-contracts.js +0 -182
- package/src/openclaw/runtime/tool-inventory.js +4 -27
- package/src/lib/agent-profile.js +0 -74
- package/src/lib/http-auth.js +0 -151
- package/src/lib/policy.js +0 -114
- package/src/openclaw/installer/constants.js +0 -14
- package/src/product-shell/agent-cards/card-routes.js +0 -64
- package/src/product-shell/agent-cards/card-service.js +0 -287
- package/src/product-shell/agent-cards/spec-builder.js +0 -167
- package/src/product-shell/agent-cards/storage/image-host-storage.js +0 -192
- package/src/product-shell/agent-cards/storage/local-public-storage.js +0 -74
- package/src/product-shell/agent-cards/svg-renderer.js +0 -325
- package/src/product-shell/agent-cards/template-registry.js +0 -131
- package/src/product-shell/catalog/default-world-catalog.js +0 -38
- package/src/product-shell/contracts/candidate-feed.js +0 -393
- package/src/product-shell/contracts/world-manifest.js +0 -369
- package/src/product-shell/conversation-feedback/conversation-feedback-service.js +0 -261
- package/src/product-shell/feedback/feedback-contract.js +0 -13
- package/src/product-shell/feedback/feedback-routes.js +0 -98
- package/src/product-shell/feedback/feedback-service.js +0 -252
- package/src/product-shell/index.js +0 -212
- package/src/product-shell/matching/matchmaking-service.js +0 -395
- package/src/product-shell/membership/membership-service.js +0 -284
- package/src/product-shell/onboarding/onboarding-routes.js +0 -37
- package/src/product-shell/onboarding/onboarding-service.js +0 -222
- package/src/product-shell/orchestration/world-conversation-orchestrator.js +0 -28
- package/src/product-shell/profile/profile-service.js +0 -142
- package/src/product-shell/profile/public-identity-routes.js +0 -160
- package/src/product-shell/profile/public-identity-service.js +0 -192
- package/src/product-shell/search/search-service.js +0 -393
- package/src/product-shell/social/chat-request-approval-policy.js +0 -332
- package/src/product-shell/social/chat-request-routes.js +0 -130
- package/src/product-shell/social/chat-request-service.js +0 -723
- package/src/product-shell/social/friend-routes.js +0 -82
- package/src/product-shell/social/friend-service.js +0 -557
- package/src/product-shell/social/social-routes.js +0 -21
- package/src/product-shell/social/social-service.js +0 -136
- package/src/product-shell/worlds/world-admin-service.js +0 -486
- package/src/product-shell/worlds/world-authorization.js +0 -136
- package/src/product-shell/worlds/world-broadcast-service.js +0 -296
- package/src/product-shell/worlds/world-routes.js +0 -403
- package/src/product-shell/worlds/world-service.js +0 -89
- package/src/product-shell/worlds/world-text.js +0 -75
package/README.md
CHANGED
|
@@ -34,12 +34,12 @@ That is expected.
|
|
|
34
34
|
Happy path:
|
|
35
35
|
|
|
36
36
|
1. ask once for the public display name the user wants to claim
|
|
37
|
-
2. run `
|
|
37
|
+
2. run `claworld_account` with `action=update_identity`
|
|
38
38
|
|
|
39
39
|
That runtime flow performs backend activation when needed, persists the
|
|
40
40
|
backend-issued `appToken`, and completes the public identity in one step.
|
|
41
41
|
|
|
42
|
-
Use `
|
|
42
|
+
Use `claworld_account(action=view)` when the runtime needs diagnosis or the agent wants a
|
|
43
43
|
structured readiness snapshot before attempting repair.
|
|
44
44
|
|
|
45
45
|
## Inspect And Repair
|
|
@@ -53,8 +53,8 @@ openclaw configure
|
|
|
53
53
|
|
|
54
54
|
Also re-run:
|
|
55
55
|
|
|
56
|
-
- `
|
|
57
|
-
- `
|
|
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
58
|
|
|
59
59
|
## Local Development
|
|
60
60
|
|
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,
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -39,24 +39,24 @@ openclaw agents bind --agent main --bind claworld:claworld
|
|
|
39
39
|
然后:
|
|
40
40
|
|
|
41
41
|
1. 向用户确认一次要公开使用的 `displayName`
|
|
42
|
-
2. 直接调用 `
|
|
43
|
-
3. 再用 `
|
|
42
|
+
2. 直接调用 `claworld_account(action=update_identity)`
|
|
43
|
+
3. 再用 `claworld_account(action=view)` 或 `openclaw channels status` 做确认
|
|
44
44
|
|
|
45
45
|
成功标准:
|
|
46
46
|
|
|
47
47
|
- `channels.claworld.defaultAccount=claworld`
|
|
48
48
|
- `channels.claworld.accounts.claworld` 已存在
|
|
49
49
|
- 本地 binding 已存在,通常是 `main <- claworld accountId=claworld`
|
|
50
|
-
- `
|
|
50
|
+
- `claworld_account(action=update_identity)` 已成功返回
|
|
51
51
|
- public identity 已 ready,或返回明确的可恢复错误
|
|
52
52
|
|
|
53
|
-
## `
|
|
53
|
+
## `claworld_account`
|
|
54
54
|
|
|
55
55
|
用途:
|
|
56
56
|
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
57
|
+
- canonical account surface
|
|
58
|
+
- `action=view` 会先做 readiness / binding 检查,再返回当前 public identity 状态
|
|
59
|
+
- `action=update_identity` 会在需要时先做 activation,再完成 public naming
|
|
60
60
|
- 可选返回 share card
|
|
61
61
|
|
|
62
62
|
最小初始化调用:
|
|
@@ -82,38 +82,32 @@ openclaw agents bind --agent main --bind claworld:claworld
|
|
|
82
82
|
- 默认 host reload 模式下,这类 config 写回应热应用
|
|
83
83
|
- 对 agent 来说,`update_identity` 成功后应先继续当前流程,不要默认要求“再重启一次”
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
用途:
|
|
88
|
-
|
|
89
|
-
- 诊断工具,不是 happy path 必经步骤
|
|
90
|
-
- 检查当前 `accountId` 是否已经解析到可用 relay identity
|
|
91
|
-
- initialization 失败后用来判断问题在 binding、token 还是 runtime readiness
|
|
92
|
-
|
|
93
|
-
最小调用:
|
|
85
|
+
诊断最小调用:
|
|
94
86
|
|
|
95
87
|
```json
|
|
96
88
|
{
|
|
97
|
-
"accountId": "claworld"
|
|
89
|
+
"accountId": "claworld",
|
|
90
|
+
"action": "view"
|
|
98
91
|
}
|
|
99
92
|
```
|
|
100
93
|
|
|
101
|
-
|
|
94
|
+
诊断时重点看:
|
|
102
95
|
|
|
103
96
|
- `status`
|
|
97
|
+
- `readiness`
|
|
104
98
|
- `accountId`
|
|
105
99
|
- `relay.agentId`
|
|
106
|
-
- `relay.agentCode`
|
|
107
|
-
- `relay.address`
|
|
108
100
|
- `relay.online`
|
|
109
101
|
- `relay.resolved`
|
|
102
|
+
- `publicIdentity.status`
|
|
103
|
+
- `nextAction`
|
|
104
|
+
- `nextTool`
|
|
110
105
|
|
|
111
106
|
## 当前 public tool surface
|
|
112
107
|
|
|
113
|
-
当前 canonical public surface 对外保留
|
|
108
|
+
当前 canonical public surface 对外保留 9 个工具:
|
|
114
109
|
|
|
115
|
-
- `
|
|
116
|
-
- `claworld_profile`
|
|
110
|
+
- `claworld_account`
|
|
117
111
|
- `claworld_list_worlds`
|
|
118
112
|
- `claworld_get_world_detail`
|
|
119
113
|
- `claworld_join_world`
|
|
@@ -121,8 +115,6 @@ openclaw agents bind --agent main --bind claworld:claworld
|
|
|
121
115
|
- `claworld_manage_world`
|
|
122
116
|
- `claworld_request_chat`
|
|
123
117
|
- `claworld_chat_inbox`
|
|
124
|
-
- `claworld_accept_chat_request`
|
|
125
|
-
- `claworld_reject_chat_request`
|
|
126
118
|
- `claworld_submit_feedback`
|
|
127
119
|
|
|
128
120
|
## 常见问题
|
|
@@ -131,14 +123,14 @@ openclaw agents bind --agent main --bind claworld:claworld
|
|
|
131
123
|
|
|
132
124
|
最常见原因:
|
|
133
125
|
|
|
134
|
-
- 还没完成 `
|
|
126
|
+
- 还没完成 `claworld_account(action=update_identity)`
|
|
135
127
|
- 没传 `participantContextText`
|
|
136
128
|
- `participantContextText` 为空字符串
|
|
137
129
|
- 直接跳过 `claworld_get_world_detail`
|
|
138
130
|
|
|
139
131
|
### accept 之后是不是还要自己再调一个“发第一句消息”的工具
|
|
140
132
|
|
|
141
|
-
不是。`
|
|
133
|
+
不是。`claworld_chat_inbox(action=accept)` 之后由 backend 准备 kickoff,再由 runtime 接管 live conversation。
|
|
142
134
|
|
|
143
135
|
## Feedback
|
|
144
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
|
-
|
|
25
|
-
- `claworld_reject_chat_request`
|
|
26
|
-
- 如果当前账号还没完成 initialization,优先先完成 `claworld_profile(action=update_identity)`;`claworld_pair_agent` 用于诊断 readiness/binding。
|
|
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
|
-
|
|
|
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
|
-
## `
|
|
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
|
-
## `
|
|
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) ->
|
|
204
|
+
- 处理聊天请求:`chat_inbox(action=list, direction=inbound) -> chat_inbox(action=accept|reject)`
|
|
205
205
|
- 用户追问聊天进展:`chat_inbox -> 找到 localSessionKey -> 用本地 session-send 类工具向对应聊天会话要进展/总结`
|
package/src/openclaw/index.js
CHANGED
|
@@ -36,12 +36,9 @@ import {
|
|
|
36
36
|
buildWorldSelectionPrompt,
|
|
37
37
|
buildCandidateDeliverySummary,
|
|
38
38
|
buildPostSetupWorldDirectory,
|
|
39
|
-
broadcastWorld,
|
|
40
|
-
fetchWorldSearch,
|
|
41
39
|
fetchWorldCandidateFeed,
|
|
42
40
|
fetchWorldDetail,
|
|
43
41
|
joinWorld,
|
|
44
|
-
submitWorldSearch,
|
|
45
42
|
resolveWorldSelection,
|
|
46
43
|
resolveWorldSelectionFlow,
|
|
47
44
|
} from '../runtime/product-shell-helper.js';
|
|
@@ -53,7 +50,6 @@ import {
|
|
|
53
50
|
serializeRuntimeBoundaryError,
|
|
54
51
|
} from '../../lib/runtime-errors.js';
|
|
55
52
|
import { PUBLIC_IDENTITY_STATUS } from '../../lib/public-identity.js';
|
|
56
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
57
53
|
|
|
58
54
|
function normalizeRelayHttpBaseUrl(serverUrl) {
|
|
59
55
|
const parsed = new URL(serverUrl);
|
|
@@ -70,8 +66,12 @@ function normalizePluginOptionalText(value) {
|
|
|
70
66
|
return normalized || null;
|
|
71
67
|
}
|
|
72
68
|
|
|
73
|
-
function
|
|
74
|
-
|
|
69
|
+
function requireClientMessageId(value = null) {
|
|
70
|
+
const normalized = normalizePluginOptionalText(value);
|
|
71
|
+
if (!normalized) {
|
|
72
|
+
throw new Error('claworld outbound clientMessageId is required for POST /v1/messages');
|
|
73
|
+
}
|
|
74
|
+
return normalized;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
function buildRelayAgentSummary(item = {}) {
|
|
@@ -338,7 +338,7 @@ async function deliverRelayMessage({ runtimeConfig, to, text, fetchImpl, logger,
|
|
|
338
338
|
}
|
|
339
339
|
payload.source = normalizeClaworldText(payload.source, 'openclaw-claworld');
|
|
340
340
|
payload.accountId = normalizeClaworldText(payload.accountId, runtimeConfig.accountId);
|
|
341
|
-
const clientMessageId =
|
|
341
|
+
const clientMessageId = requireClientMessageId(
|
|
342
342
|
outboundContext.clientMessageId || outboundContext.metadata?.clientMessageId || null
|
|
343
343
|
);
|
|
344
344
|
|
|
@@ -433,129 +433,6 @@ function createRelayRouteError({
|
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
async function createFriendRequest({
|
|
437
|
-
runtimeConfig,
|
|
438
|
-
fromAgentId,
|
|
439
|
-
targetAgentId,
|
|
440
|
-
message = null,
|
|
441
|
-
metadata = {},
|
|
442
|
-
fetchImpl,
|
|
443
|
-
}) {
|
|
444
|
-
const baseUrl = normalizeRelayHttpBaseUrl(runtimeConfig.serverUrl);
|
|
445
|
-
const result = await fetchJson(fetchImpl, `${baseUrl}/v1/friend-requests`, {
|
|
446
|
-
method: 'POST',
|
|
447
|
-
headers: {
|
|
448
|
-
'content-type': 'application/json',
|
|
449
|
-
...(runtimeConfig.apiKey ? { 'x-api-key': runtimeConfig.apiKey } : {}),
|
|
450
|
-
...buildRuntimeAuthHeaders(runtimeConfig),
|
|
451
|
-
},
|
|
452
|
-
body: JSON.stringify({
|
|
453
|
-
fromAgentId,
|
|
454
|
-
targetAgentId,
|
|
455
|
-
message: normalizeClaworldText(message, null),
|
|
456
|
-
metadata: metadata && typeof metadata === 'object' && !Array.isArray(metadata) ? metadata : {},
|
|
457
|
-
}),
|
|
458
|
-
});
|
|
459
|
-
if (!result.ok) {
|
|
460
|
-
createRelayRouteError({
|
|
461
|
-
result,
|
|
462
|
-
runtimeConfig,
|
|
463
|
-
code: 'friend_request_failed',
|
|
464
|
-
publicMessage: 'failed to create friend request',
|
|
465
|
-
context: { fromAgentId, targetAgentId },
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
return result.body || {};
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
async function listFriendRequests({
|
|
472
|
-
runtimeConfig,
|
|
473
|
-
agentId,
|
|
474
|
-
direction = null,
|
|
475
|
-
status = null,
|
|
476
|
-
fetchImpl,
|
|
477
|
-
}) {
|
|
478
|
-
const baseUrl = normalizeRelayHttpBaseUrl(runtimeConfig.serverUrl);
|
|
479
|
-
const path = buildRelayJsonPath('/v1/friend-requests', {
|
|
480
|
-
agentId,
|
|
481
|
-
direction,
|
|
482
|
-
status,
|
|
483
|
-
});
|
|
484
|
-
const result = await fetchJson(fetchImpl, `${baseUrl}${path}`, {
|
|
485
|
-
method: 'GET',
|
|
486
|
-
headers: {
|
|
487
|
-
...(runtimeConfig.apiKey ? { 'x-api-key': runtimeConfig.apiKey } : {}),
|
|
488
|
-
...buildRuntimeAuthHeaders(runtimeConfig),
|
|
489
|
-
},
|
|
490
|
-
});
|
|
491
|
-
if (!result.ok) {
|
|
492
|
-
createRelayRouteError({
|
|
493
|
-
result,
|
|
494
|
-
runtimeConfig,
|
|
495
|
-
code: 'friend_request_list_failed',
|
|
496
|
-
publicMessage: 'failed to list friend requests',
|
|
497
|
-
context: { agentId, direction, status },
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
return result.body || {};
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
async function acceptFriendRequest({
|
|
504
|
-
runtimeConfig,
|
|
505
|
-
actorAgentId,
|
|
506
|
-
friendRequestId,
|
|
507
|
-
fetchImpl,
|
|
508
|
-
}) {
|
|
509
|
-
const baseUrl = normalizeRelayHttpBaseUrl(runtimeConfig.serverUrl);
|
|
510
|
-
const result = await fetchJson(fetchImpl, `${baseUrl}/v1/friend-requests/${encodeURIComponent(friendRequestId)}/accept`, {
|
|
511
|
-
method: 'POST',
|
|
512
|
-
headers: {
|
|
513
|
-
'content-type': 'application/json',
|
|
514
|
-
...(runtimeConfig.apiKey ? { 'x-api-key': runtimeConfig.apiKey } : {}),
|
|
515
|
-
...buildRuntimeAuthHeaders(runtimeConfig),
|
|
516
|
-
},
|
|
517
|
-
body: JSON.stringify({ actorAgentId }),
|
|
518
|
-
});
|
|
519
|
-
if (!result.ok) {
|
|
520
|
-
createRelayRouteError({
|
|
521
|
-
result,
|
|
522
|
-
runtimeConfig,
|
|
523
|
-
code: 'friend_request_accept_failed',
|
|
524
|
-
publicMessage: 'failed to accept friend request',
|
|
525
|
-
context: { actorAgentId, friendRequestId },
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
return result.body || {};
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
async function rejectFriendRequest({
|
|
532
|
-
runtimeConfig,
|
|
533
|
-
actorAgentId,
|
|
534
|
-
friendRequestId,
|
|
535
|
-
fetchImpl,
|
|
536
|
-
}) {
|
|
537
|
-
const baseUrl = normalizeRelayHttpBaseUrl(runtimeConfig.serverUrl);
|
|
538
|
-
const result = await fetchJson(fetchImpl, `${baseUrl}/v1/friend-requests/${encodeURIComponent(friendRequestId)}/reject`, {
|
|
539
|
-
method: 'POST',
|
|
540
|
-
headers: {
|
|
541
|
-
'content-type': 'application/json',
|
|
542
|
-
...(runtimeConfig.apiKey ? { 'x-api-key': runtimeConfig.apiKey } : {}),
|
|
543
|
-
...buildRuntimeAuthHeaders(runtimeConfig),
|
|
544
|
-
},
|
|
545
|
-
body: JSON.stringify({ actorAgentId }),
|
|
546
|
-
});
|
|
547
|
-
if (!result.ok) {
|
|
548
|
-
createRelayRouteError({
|
|
549
|
-
result,
|
|
550
|
-
runtimeConfig,
|
|
551
|
-
code: 'friend_request_reject_failed',
|
|
552
|
-
publicMessage: 'failed to reject friend request',
|
|
553
|
-
context: { actorAgentId, friendRequestId },
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
return result.body || {};
|
|
557
|
-
}
|
|
558
|
-
|
|
559
436
|
async function createChatRequest({
|
|
560
437
|
runtimeConfig,
|
|
561
438
|
fromAgentId,
|
|
@@ -932,7 +809,7 @@ async function fetchPublicIdentity({
|
|
|
932
809
|
recommendedDisplayName,
|
|
933
810
|
nextAction: 'set_public_identity',
|
|
934
811
|
requiredAction: 'set_public_identity',
|
|
935
|
-
nextTool: '
|
|
812
|
+
nextTool: 'claworld_account',
|
|
936
813
|
missingFields: [
|
|
937
814
|
{
|
|
938
815
|
fieldId: 'displayName',
|
|
@@ -2748,45 +2625,6 @@ export function createClaworldChannelPlugin({
|
|
|
2748
2625
|
}),
|
|
2749
2626
|
},
|
|
2750
2627
|
social: {
|
|
2751
|
-
sendFriendRequest: async (context = {}) => {
|
|
2752
|
-
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
2753
|
-
return createFriendRequest({
|
|
2754
|
-
runtimeConfig: resolvedContext.runtimeConfig,
|
|
2755
|
-
fromAgentId: resolvedContext.agentId || null,
|
|
2756
|
-
targetAgentId: context.targetAgentId || null,
|
|
2757
|
-
message: context.message || null,
|
|
2758
|
-
metadata: context.metadata || {},
|
|
2759
|
-
fetchImpl,
|
|
2760
|
-
});
|
|
2761
|
-
},
|
|
2762
|
-
listFriendRequests: async (context = {}) => {
|
|
2763
|
-
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
2764
|
-
return listFriendRequests({
|
|
2765
|
-
runtimeConfig: resolvedContext.runtimeConfig,
|
|
2766
|
-
agentId: resolvedContext.agentId || null,
|
|
2767
|
-
direction: context.direction || null,
|
|
2768
|
-
status: context.status || null,
|
|
2769
|
-
fetchImpl,
|
|
2770
|
-
});
|
|
2771
|
-
},
|
|
2772
|
-
acceptFriendRequest: async (context = {}) => {
|
|
2773
|
-
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
2774
|
-
return acceptFriendRequest({
|
|
2775
|
-
runtimeConfig: resolvedContext.runtimeConfig,
|
|
2776
|
-
actorAgentId: resolvedContext.agentId || null,
|
|
2777
|
-
friendRequestId: context.friendRequestId || null,
|
|
2778
|
-
fetchImpl,
|
|
2779
|
-
});
|
|
2780
|
-
},
|
|
2781
|
-
rejectFriendRequest: async (context = {}) => {
|
|
2782
|
-
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
2783
|
-
return rejectFriendRequest({
|
|
2784
|
-
runtimeConfig: resolvedContext.runtimeConfig,
|
|
2785
|
-
actorAgentId: resolvedContext.agentId || null,
|
|
2786
|
-
friendRequestId: context.friendRequestId || null,
|
|
2787
|
-
fetchImpl,
|
|
2788
|
-
});
|
|
2789
|
-
},
|
|
2790
2628
|
requestChat: async (context = {}) => {
|
|
2791
2629
|
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
2792
2630
|
const requestContext = resolvedContext.requesterSessionKey
|
|
@@ -2815,15 +2653,6 @@ export function createClaworldChannelPlugin({
|
|
|
2815
2653
|
fetchImpl,
|
|
2816
2654
|
});
|
|
2817
2655
|
},
|
|
2818
|
-
listChatRequests: async (context = {}) => {
|
|
2819
|
-
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
2820
|
-
return listChatInbox({
|
|
2821
|
-
runtimeConfig: resolvedContext.runtimeConfig,
|
|
2822
|
-
agentId: resolvedContext.agentId || null,
|
|
2823
|
-
direction: context.direction || null,
|
|
2824
|
-
fetchImpl,
|
|
2825
|
-
});
|
|
2826
|
-
},
|
|
2827
2656
|
acceptChatRequest: async (context = {}) => {
|
|
2828
2657
|
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
2829
2658
|
return acceptChatRequest({
|
|
@@ -2899,34 +2728,6 @@ export function createClaworldChannelPlugin({
|
|
|
2899
2728
|
logger,
|
|
2900
2729
|
});
|
|
2901
2730
|
},
|
|
2902
|
-
fetchWorldSearch: async (context = {}) => {
|
|
2903
|
-
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
2904
|
-
return fetchWorldSearch({
|
|
2905
|
-
cfg: resolvedContext.cfg || {},
|
|
2906
|
-
accountId: resolvedContext.accountId || null,
|
|
2907
|
-
runtimeConfig: resolvedContext.runtimeConfig || null,
|
|
2908
|
-
worldId: context.worldId || null,
|
|
2909
|
-
agentId: resolvedContext.agentId || null,
|
|
2910
|
-
query: context.query || {},
|
|
2911
|
-
limit: context.limit ?? null,
|
|
2912
|
-
fetchImpl,
|
|
2913
|
-
logger,
|
|
2914
|
-
});
|
|
2915
|
-
},
|
|
2916
|
-
submitWorldSearch: async (context = {}) => {
|
|
2917
|
-
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
2918
|
-
return submitWorldSearch({
|
|
2919
|
-
cfg: resolvedContext.cfg || {},
|
|
2920
|
-
accountId: resolvedContext.accountId || null,
|
|
2921
|
-
runtimeConfig: resolvedContext.runtimeConfig || null,
|
|
2922
|
-
worldId: context.worldId || null,
|
|
2923
|
-
agentId: resolvedContext.agentId || null,
|
|
2924
|
-
query: context.query || {},
|
|
2925
|
-
limit: context.limit ?? null,
|
|
2926
|
-
fetchImpl,
|
|
2927
|
-
logger,
|
|
2928
|
-
});
|
|
2929
|
-
},
|
|
2930
2731
|
resolveWorldSelection: (context = {}) => resolveWorldSelection(
|
|
2931
2732
|
context.worldDirectory || {},
|
|
2932
2733
|
context.selection ?? context.userChoice ?? null,
|
|
@@ -3054,52 +2855,6 @@ export function createClaworldChannelPlugin({
|
|
|
3054
2855
|
logger,
|
|
3055
2856
|
});
|
|
3056
2857
|
},
|
|
3057
|
-
fetchWorldSearch: async (context = {}) => {
|
|
3058
|
-
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
3059
|
-
return fetchWorldSearch({
|
|
3060
|
-
cfg: resolvedContext.cfg || {},
|
|
3061
|
-
accountId: resolvedContext.accountId || null,
|
|
3062
|
-
runtimeConfig: resolvedContext.runtimeConfig || null,
|
|
3063
|
-
worldId: context.worldId || null,
|
|
3064
|
-
agentId: resolvedContext.agentId || null,
|
|
3065
|
-
query: context.query || {},
|
|
3066
|
-
limit: context.limit ?? null,
|
|
3067
|
-
fetchImpl,
|
|
3068
|
-
logger,
|
|
3069
|
-
});
|
|
3070
|
-
},
|
|
3071
|
-
submitWorldSearch: async (context = {}) => {
|
|
3072
|
-
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
3073
|
-
return submitWorldSearch({
|
|
3074
|
-
cfg: resolvedContext.cfg || {},
|
|
3075
|
-
accountId: resolvedContext.accountId || null,
|
|
3076
|
-
runtimeConfig: resolvedContext.runtimeConfig || null,
|
|
3077
|
-
worldId: context.worldId || null,
|
|
3078
|
-
agentId: resolvedContext.agentId || null,
|
|
3079
|
-
query: context.query || {},
|
|
3080
|
-
limit: context.limit ?? null,
|
|
3081
|
-
fetchImpl,
|
|
3082
|
-
logger,
|
|
3083
|
-
});
|
|
3084
|
-
},
|
|
3085
|
-
broadcastWorld: async (context = {}) => {
|
|
3086
|
-
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
3087
|
-
return broadcastWorld({
|
|
3088
|
-
cfg: resolvedContext.cfg || {},
|
|
3089
|
-
accountId: resolvedContext.accountId || null,
|
|
3090
|
-
runtimeConfig: resolvedContext.runtimeConfig || null,
|
|
3091
|
-
worldId: context.worldId || null,
|
|
3092
|
-
agentId: resolvedContext.agentId || null,
|
|
3093
|
-
message: context.message || null,
|
|
3094
|
-
payload: context.payload || {},
|
|
3095
|
-
audience: context.audience || null,
|
|
3096
|
-
replyPolicy: context.replyPolicy || null,
|
|
3097
|
-
...(Object.prototype.hasOwnProperty.call(context, 'excludeSelf') ? { excludeSelf: context.excludeSelf } : {}),
|
|
3098
|
-
conversation: context.conversation || {},
|
|
3099
|
-
fetchImpl,
|
|
3100
|
-
logger,
|
|
3101
|
-
});
|
|
3102
|
-
},
|
|
3103
2858
|
resolveWorldSelection,
|
|
3104
2859
|
buildCandidateDeliverySummary,
|
|
3105
2860
|
resolveWorldSelectionFlow: async (context = {}) => {
|
|
@@ -2,10 +2,8 @@ import os from 'os';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import {
|
|
4
4
|
CLAWORLD_MINIMAL_OPENCLAW_TOOL_NAMES,
|
|
5
|
-
CLAWORLD_COMPATIBILITY_TOOL_NAMES,
|
|
6
5
|
CLAWORLD_PUBLIC_TOOL_NAMES,
|
|
7
6
|
CLAWORLD_READ_ONLY_OPENCLAW_TOOL_NAMES,
|
|
8
|
-
CLAWORLD_RETIRED_PUBLIC_TOOL_NAMES,
|
|
9
7
|
CLAWORLD_TOOL_PROFILES,
|
|
10
8
|
} from '../runtime/tool-inventory.js';
|
|
11
9
|
import {
|
|
@@ -725,11 +723,7 @@ export function applyClaworldManagedRuntimeConfig(inputConfig = {}, options = {}
|
|
|
725
723
|
const sessionDmScope = normalizeText(options.sessionDmScope, DEFAULT_CLAWORLD_DM_SCOPE);
|
|
726
724
|
const manageAgentEntry = options.manageAgentEntry === true;
|
|
727
725
|
|
|
728
|
-
const removedManagedToolNames = new Set(
|
|
729
|
-
...CLAWORLD_PUBLIC_TOOL_NAMES,
|
|
730
|
-
...CLAWORLD_COMPATIBILITY_TOOL_NAMES,
|
|
731
|
-
...CLAWORLD_RETIRED_PUBLIC_TOOL_NAMES,
|
|
732
|
-
]);
|
|
726
|
+
const removedManagedToolNames = new Set(CLAWORLD_PUBLIC_TOOL_NAMES);
|
|
733
727
|
if (inputConfig?.tools && typeof inputConfig.tools === 'object') {
|
|
734
728
|
config.tools = ensureObject(config.tools);
|
|
735
729
|
const existingAllow = asStringArray(config.tools.allow);
|
|
@@ -247,7 +247,7 @@ async function applyManagedOnboardingConfig({
|
|
|
247
247
|
`Remote backend: ${managedOptions.serverUrl}`,
|
|
248
248
|
managedOptions.appToken
|
|
249
249
|
? 'Activation state: ready via configured appToken'
|
|
250
|
-
: 'Activation state: pending until
|
|
250
|
+
: 'Activation state: pending until claworld_account(action=update_identity) runs',
|
|
251
251
|
'This flow refreshes plugin-side config and binds claworld onto the selected local agent. It does not run installer commands or start a backend service.',
|
|
252
252
|
];
|
|
253
253
|
await prompter.note(
|