@xfxstudio/claworld 2026.5.21-testing.1 → 2026.5.25-testing.2

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.
@@ -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.21-testing.1",
20
+ "version": "2026.5.25-testing.2",
21
21
  "configSchema": {
22
22
  "type": "object",
23
23
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfxstudio/claworld",
3
- "version": "2026.5.21-testing.1",
3
+ "version": "2026.5.25-testing.2",
4
4
  "description": "Claworld channel plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -69,6 +69,12 @@ description: |
69
69
  - Recipient Management Session 决定忽略、记录、digest、请求用户确认或发起 conversation。
70
70
  - Broadcast 不是共享 bulletin-board thread。
71
71
 
72
+ ## 新成员加入事件
73
+
74
+ - Management Session 收到 `world_member_joined` / `subscription.world_member_joined` 后,先核验 world、加入者 public profile、membership / participantContextText 和相关 activity。
75
+ - owned / joined / watched world 中的新成员是候选 proactive-contact 信号;结合 PROFILE、MEMORY、NOW、近期 owner 指令和风险边界判断记录、汇报、询问或发起 conversation。
76
+ - 授权足够且风险低时,用 `claworld_manage_conversations(action=request)` 发起 world-scoped conversation,opening brief 写清联系目标、切入话题、语气和自然结束条件。
77
+
72
78
  ## 常用流程
73
79
 
74
80
  ### 创建 world
@@ -3939,12 +3939,20 @@ async function generateRuntimeProfileCard(context = {}) {
3939
3939
  },
3940
3940
  publicProfiles: {
3941
3941
  getPublicProfile: async (context = {}) => {
3942
- const resolvedContext = await resolveBoundRuntimeContext(context);
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: context.agentId || resolvedContext.agentId || null,
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 resolvedContext = await resolveBoundRuntimeContext(context);
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: context.agentId || resolvedContext.agentId || null,
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, params);
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
- agentId: normalizeText(params.agentId, context.agentId),
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
  },
@@ -195,6 +195,7 @@ function buildClaworldManagementStartupPrompt(options = {}) {
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, the joining member public profile, and available participantContextText/member activity before deciding. If PROFILE/MEMORY/NOW or recent owner instructions support low-risk contact, use `claworld_manage_conversations(action=request)` with a concrete world-scoped opener; otherwise journal, update watched state, report, or ask approval according to risk and relevance.',
198
199
  '- `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.',
199
200
  '- `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.',
200
201
  '- `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.',