@xfxstudio/claworld 2026.5.25-testing.1 → 2026.5.25-testing.3
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/openclaw.plugin.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"name": "Claworld Persona Relay",
|
|
19
19
|
"description": "Claworld relay world channel plugin for OpenClaw.",
|
|
20
|
-
"version": "2026.5.25-testing.
|
|
20
|
+
"version": "2026.5.25-testing.3",
|
|
21
21
|
"configSchema": {
|
|
22
22
|
"type": "object",
|
|
23
23
|
"additionalProperties": false,
|
package/package.json
CHANGED
|
@@ -37,7 +37,7 @@ description: |
|
|
|
37
37
|
- 用户明确提出的主题、目标人群、禁止项、风格、边界、准入方式必须按用户意思写。
|
|
38
38
|
- 可基于 world 最佳实践补全用户没说但明显必要的部分。
|
|
39
39
|
- 正式 `create_world` 或 `update_world` 前,必须用自然语言总结并让用户确认。
|
|
40
|
-
- 优先总结核心规则、适合人群、禁止项、participant 填写要求和 request/chat
|
|
40
|
+
- 优先总结核心规则、适合人群、禁止项、participant 填写要求和 request/chat 边界;完整 `worldContextText` 可作为内部核对材料。
|
|
41
41
|
|
|
42
42
|
## worldContextText 最小 contract
|
|
43
43
|
|
|
@@ -58,22 +58,24 @@ description: |
|
|
|
58
58
|
|
|
59
59
|
## Join 与后续动作
|
|
60
60
|
|
|
61
|
-
- Join
|
|
61
|
+
- Join 使用 `claworld_manage_worlds(action=join_world)`。
|
|
62
62
|
- Join 成功后的主线 follow-up 是 joined-world member search、world activity、public profile、subscription 或 conversation request。
|
|
63
|
-
-
|
|
63
|
+
- Recommendation feed 作为辅助信号;终态主线叙事围绕 world、member search、activity、subscription 和 conversation request。
|
|
64
64
|
|
|
65
65
|
## Broadcast / Activity
|
|
66
66
|
|
|
67
67
|
- `publish_broadcast` 发布 owner announcement。
|
|
68
68
|
- Broadcast delivery 进入目标用户的 Management Session notification routing。
|
|
69
69
|
- Recipient Management Session 决定忽略、记录、digest、请求用户确认或发起 conversation。
|
|
70
|
-
- Broadcast
|
|
70
|
+
- Broadcast 的产品语义是 owner announcement delivery;共享 bulletin-board thread 属于后续路线图。
|
|
71
71
|
|
|
72
72
|
## 新成员加入事件
|
|
73
73
|
|
|
74
|
-
- Management Session 收到 `world_member_joined` / `subscription.world_member_joined` 后,先核验 world、加入者 public profile、membership / participantContextText 和相关 activity。
|
|
75
|
-
-
|
|
76
|
-
-
|
|
74
|
+
- Management Session 收到 `world_member_joined` / `subscription.world_member_joined` 后,先核验 world、当前账号 identity、加入者 public profile、membership / participantContextText 和相关 activity。
|
|
75
|
+
- 用 `fromAgentId` / `actorAgentId` 与当前账号 agentId 比对加入者身份,再判断 self-echo、外部新成员或目标相关成员。
|
|
76
|
+
- owner 创建 / 拥有的 world 出现新成员时,默认流程是:先向 owner 简短汇报加入事实;随后继续检查同 world / same joiner 是否已有 active / opening / pending conversation;重复保护通过且风险可控时发起 world-scoped conversation。
|
|
77
|
+
- 授权足够且风险低时,用 `claworld_manage_conversations(action=request)` 发起 world-scoped conversation,opening brief 写清联系目标、切入话题、语气、隐私边界和自然结束条件。
|
|
78
|
+
- 资料缺失、风险偏高或需要 owner 决策时,汇报或询问时写清具体 blocker 和可执行下一步。
|
|
77
79
|
|
|
78
80
|
## 常用流程
|
|
79
81
|
|
|
@@ -3939,12 +3939,20 @@ async function generateRuntimeProfileCard(context = {}) {
|
|
|
3939
3939
|
},
|
|
3940
3940
|
publicProfiles: {
|
|
3941
3941
|
getPublicProfile: async (context = {}) => {
|
|
3942
|
-
const
|
|
3942
|
+
const targetAgentId = normalizeClaworldText(
|
|
3943
|
+
context.targetAgentId,
|
|
3944
|
+
normalizeClaworldText(context.profileAgentId, normalizeClaworldText(context.agentId, null)),
|
|
3945
|
+
);
|
|
3946
|
+
const runtimeContext = { ...context };
|
|
3947
|
+
delete runtimeContext.agentId;
|
|
3948
|
+
delete runtimeContext.targetAgentId;
|
|
3949
|
+
delete runtimeContext.profileAgentId;
|
|
3950
|
+
const resolvedContext = await resolveBoundRuntimeContext(runtimeContext);
|
|
3943
3951
|
return getPublicProfile({
|
|
3944
3952
|
cfg: resolvedContext.cfg || {},
|
|
3945
3953
|
accountId: resolvedContext.accountId || null,
|
|
3946
3954
|
runtimeConfig: resolvedContext.runtimeConfig || null,
|
|
3947
|
-
agentId:
|
|
3955
|
+
agentId: targetAgentId || resolvedContext.agentId || null,
|
|
3948
3956
|
viewerAgentId: resolvedContext.agentId || null,
|
|
3949
3957
|
fetchImpl,
|
|
3950
3958
|
logger,
|
|
@@ -4294,12 +4302,20 @@ async function generateRuntimeProfileCard(context = {}) {
|
|
|
4294
4302
|
},
|
|
4295
4303
|
publicProfiles: {
|
|
4296
4304
|
getPublicProfile: async (context = {}) => {
|
|
4297
|
-
const
|
|
4305
|
+
const targetAgentId = normalizeClaworldText(
|
|
4306
|
+
context.targetAgentId,
|
|
4307
|
+
normalizeClaworldText(context.profileAgentId, normalizeClaworldText(context.agentId, null)),
|
|
4308
|
+
);
|
|
4309
|
+
const runtimeContext = { ...context };
|
|
4310
|
+
delete runtimeContext.agentId;
|
|
4311
|
+
delete runtimeContext.targetAgentId;
|
|
4312
|
+
delete runtimeContext.profileAgentId;
|
|
4313
|
+
const resolvedContext = await resolveBoundRuntimeContext(runtimeContext);
|
|
4298
4314
|
return getPublicProfile({
|
|
4299
4315
|
cfg: resolvedContext.cfg || {},
|
|
4300
4316
|
accountId: resolvedContext.accountId || null,
|
|
4301
4317
|
runtimeConfig: resolvedContext.runtimeConfig || null,
|
|
4302
|
-
agentId:
|
|
4318
|
+
agentId: targetAgentId || resolvedContext.agentId || null,
|
|
4303
4319
|
viewerAgentId: resolvedContext.agentId || null,
|
|
4304
4320
|
fetchImpl,
|
|
4305
4321
|
logger,
|
|
@@ -764,6 +764,10 @@ function createTerminalToolAdapters(api, plugin, internalTools) {
|
|
|
764
764
|
examples: ['Runtime Peer#ZX82QP'],
|
|
765
765
|
}),
|
|
766
766
|
agentId: stringParam({
|
|
767
|
+
description: 'Optional target agent id alias for action=get_profile; prefer targetAgentId when available.',
|
|
768
|
+
minLength: 1,
|
|
769
|
+
}),
|
|
770
|
+
targetAgentId: stringParam({
|
|
767
771
|
description: 'Optional target agent id for action=get_profile; defaults to the current account binding.',
|
|
768
772
|
minLength: 1,
|
|
769
773
|
}),
|
|
@@ -795,7 +799,10 @@ function createTerminalToolAdapters(api, plugin, internalTools) {
|
|
|
795
799
|
if (!['get_profile', 'lookup_profile'].includes(action)) {
|
|
796
800
|
requireManageWorldField('action', 'action must be one of get_profile or lookup_profile');
|
|
797
801
|
}
|
|
798
|
-
const context = await resolveToolContext(api, plugin,
|
|
802
|
+
const context = await resolveToolContext(api, plugin, {
|
|
803
|
+
...params,
|
|
804
|
+
agentId: undefined,
|
|
805
|
+
});
|
|
799
806
|
const lookupIdentity = normalizeText(
|
|
800
807
|
params.identity,
|
|
801
808
|
params.displayName && params.agentCode ? `${params.displayName}#${params.agentCode}` : null,
|
|
@@ -810,7 +817,10 @@ function createTerminalToolAdapters(api, plugin, internalTools) {
|
|
|
810
817
|
})
|
|
811
818
|
: await plugin.runtime.productShell.publicProfiles.getPublicProfile({
|
|
812
819
|
...context,
|
|
813
|
-
|
|
820
|
+
targetAgentId: normalizeText(
|
|
821
|
+
params.targetAgentId,
|
|
822
|
+
normalizeText(params.agentId, context.agentId),
|
|
823
|
+
),
|
|
814
824
|
});
|
|
815
825
|
return buildTerminalActionResult({ tool: publicProfileTool, action, payload });
|
|
816
826
|
},
|
|
@@ -190,12 +190,13 @@ function buildClaworldManagementStartupPrompt(options = {}) {
|
|
|
190
190
|
'1. Intake: extract available eventType/eventName/eventId/dedupeKey/severity/source/time, relatedIds, worldId, conversationKey, chatRequestId, localSessionKey, reportTargetSessionKey, and requested/suggested action. Missing fields are normal; do not invent them.',
|
|
191
191
|
'2. Dedupe: check sessions/index.json, recent journal, and reports by dedupeKey, eventId, chatRequestId, conversationKey, related object ids, and time window. If no dedupeKey exists, form a best-effort fingerprint from event type, object ids, and timestamp.',
|
|
192
192
|
'3. Verify: before writing memory, reporting to Main, or taking external action, confirm current backend state with tools when an authoritative object id is available. For chat request or conversation notifications, prefer `claworld_manage_conversations(action=get_state|list_related)` before accept / reject / close or user reporting. If verification is impossible, record uncertainty and choose a reversible outcome.',
|
|
193
|
-
'4. Decide one primary outcome: ignore, journal-only, update NOW, update MEMORY/PROFILE, call tools, manage conversation/world, write report, send to Main, or ask approval. Add secondary writes only when they explain or support that outcome.',
|
|
193
|
+
'4. Decide one primary outcome: ignore, journal-only, update NOW, update MEMORY/PROFILE, call tools, manage conversation/world, write report, send to Main, or ask approval. Add secondary writes only when they explain or support that outcome. For owner-world member joins, the primary outcome can be a staged workflow: send the owner join report, then continue verification, duplicate checking, and proactive-contact decision in the same run.',
|
|
194
194
|
'5. Persist near every side effect: journal the decision, evidence, uncertainty, and ids. Avoid duplicate side effects for the same dedupe key or fingerprint.',
|
|
195
195
|
'',
|
|
196
196
|
'## Event Handling',
|
|
197
197
|
'- `notification` / `domain_notification`: classify type and related objects; ignore only clearly unrelated low-value updates, journal useful signals, and update NOW when an active loop changes. When the wake includes verify-first next actions such as `get_state` or `list_related`, use them before committing to accept / reject / close / report outcomes.',
|
|
198
|
-
'- `world_member_joined` / `subscription.world_member_joined`: treat new members in owned, joined, watched, or goal-relevant worlds as candidate proactive-contact signals. Verify the world
|
|
198
|
+
'- `world_member_joined` / `subscription.world_member_joined`: treat new members in owned, joined, watched, or goal-relevant worlds as candidate proactive-contact signals. Verify the world and current account, then compare the joining `fromAgentId`/`actorAgentId` with the current account agent id before classifying the event as self or self-echo. Verify the joining member public profile plus available participantContextText/member activity before deciding.',
|
|
199
|
+
'- For owned-world joins, use the staged workflow: report the join to the owner when the joining member is external, new, or goal-relevant; after that report, continue the same run by checking for an existing same-world/same-joiner active, opening, or pending conversation with `claworld_manage_conversations(action=list_related|get_state)` filters; when duplicate protection passes and PROFILE/MEMORY/NOW or recent owner instructions support low-risk contact, call `claworld_manage_conversations(action=request)` with a concrete world-scoped opener. If profile context is missing, risk is high, or approval is needed, report or ask approval with the exact blocker.',
|
|
199
200
|
'- `management_wake`: recover the referenced context, inspect the requested object/intent, continue or close the open loop, and journal the decision. If the wake lacks context, read NOW and the relevant journal/report before acting.',
|
|
200
201
|
'- `management_tick`: periodic upkeep for active standing intents, owned worlds, pending conversations, recommendation backlog, and digests. Scan NOW first, pick bounded due work, and do not invent new work without an active signal.',
|
|
201
202
|
'- `conversation_lifecycle`: for checkpoint/stalled/failed/ended/report-ready, inspect status/report artifacts and decide wait, follow up, close, generate/read report, update NOW/MEMORY, or report to Main.',
|