@xfxstudio/claworld 2026.4.29-testing.2 → 2026.4.29-testing.4

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.
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "name": "Claworld Persona Relay",
10
10
  "description": "Claworld relay world channel plugin for OpenClaw.",
11
- "version": "2026.4.29-testing.2",
11
+ "version": "2026.4.29-testing.4",
12
12
  "configSchema": {
13
13
  "type": "object",
14
14
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfxstudio/claworld",
3
- "version": "2026.4.29-testing.2",
3
+ "version": "2026.4.29-testing.4",
4
4
  "description": "Claworld channel plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -653,7 +653,10 @@ export function projectToolAccountViewResponse({
653
653
  identityPayload = null,
654
654
  } = {}) {
655
655
  const identityReady = identityPayload?.ready === true;
656
- const ready = pairingPayload?.status === 'paired' && identityReady;
656
+ const bindingReady = pairingPayload?.status === 'paired';
657
+ const ready = bindingReady && identityReady;
658
+ const relayResolved = pairingPayload?.relayAgent?.resolved ?? null;
659
+ const relayOnline = pairingPayload?.relayAgent?.online ?? null;
657
660
  const resolvedShareCard = identityPayload && Object.prototype.hasOwnProperty.call(identityPayload, 'shareCard')
658
661
  ? projectToolShareCard(identityPayload.shareCard)
659
662
  : undefined;
@@ -668,7 +671,14 @@ export function projectToolAccountViewResponse({
668
671
  reason: normalizeText(pairingPayload?.reason, null),
669
672
  bindingSource: normalizeText(pairingPayload?.bindingSource, null),
670
673
  activation: {
671
- status: pairingPayload?.status === 'paired' ? 'ready' : 'pending',
674
+ status: bindingReady ? 'ready' : 'pending',
675
+ },
676
+ diagnostics: {
677
+ toolReachable: true,
678
+ bindingReady,
679
+ publicIdentityReady: identityReady,
680
+ relayPresenceResolved: relayResolved,
681
+ relayOnline,
672
682
  },
673
683
  relay: {
674
684
  agentId: normalizeText(
@@ -678,9 +688,9 @@ export function projectToolAccountViewResponse({
678
688
  displayName: normalizeText(pairingPayload?.relayAgent?.displayName, null),
679
689
  discoverable: pairingPayload?.relayAgent?.discoverable ?? null,
680
690
  contactable: pairingPayload?.relayAgent?.contactable ?? null,
681
- online: pairingPayload?.relayAgent?.online ?? null,
682
- resolved: pairingPayload?.relayAgent?.resolved ?? null,
683
- bindingStatus: pairingPayload?.status === 'paired' ? 'bound' : 'unactivated',
691
+ online: relayOnline,
692
+ resolved: relayResolved,
693
+ bindingStatus: bindingReady ? 'bound' : 'unactivated',
684
694
  },
685
695
  profile: projectToolAccountProfile(identityPayload),
686
696
  ...projectToolAccountIdentityFields(identityPayload),
@@ -1968,7 +1968,16 @@ function buildRegisteredTools(api, plugin) {
1968
1968
  expiresInSeconds: params.expiresInSeconds ?? null,
1969
1969
  });
1970
1970
  const pairedAgentId = identityPayload?.agentId || runtimeConfig.relay?.agentId || null;
1971
- const relayAgent = pairedAgentId
1971
+ const pairedRuntimeConfig = pairedAgentId
1972
+ ? {
1973
+ ...runtimeConfig,
1974
+ relay: {
1975
+ ...(runtimeConfig.relay && typeof runtimeConfig.relay === 'object' ? runtimeConfig.relay : {}),
1976
+ agentId: pairedAgentId,
1977
+ },
1978
+ }
1979
+ : runtimeConfig;
1980
+ const relayAgentFallback = pairedAgentId
1972
1981
  ? {
1973
1982
  agentId: pairedAgentId,
1974
1983
  displayName: normalizeText(
@@ -1989,6 +1998,23 @@ function buildRegisteredTools(api, plugin) {
1989
1998
  || runtimeConfig.relay?.appToken
1990
1999
  || runtimeConfig.relay?.credentialToken,
1991
2000
  );
2001
+ let relayAgent = relayAgentFallback;
2002
+ if (hasConfiguredAppToken && pairedAgentId && typeof plugin.helpers?.pairing?.resolveAgentIdentity === 'function') {
2003
+ const resolvedRelayAgent = await plugin.helpers.pairing.resolveAgentIdentity({
2004
+ cfg,
2005
+ accountId,
2006
+ runtimeConfig: pairedRuntimeConfig,
2007
+ agentId: pairedAgentId,
2008
+ });
2009
+ if (resolvedRelayAgent && typeof resolvedRelayAgent === 'object') {
2010
+ relayAgent = {
2011
+ ...relayAgentFallback,
2012
+ ...resolvedRelayAgent,
2013
+ agentId: normalizeText(resolvedRelayAgent.agentId, pairedAgentId),
2014
+ displayName: normalizeText(resolvedRelayAgent.displayName, relayAgentFallback?.displayName ?? null),
2015
+ };
2016
+ }
2017
+ }
1992
2018
  const pairingPayload = {
1993
2019
  status: hasConfiguredAppToken ? 'paired' : 'unpaired',
1994
2020
  reason: hasConfiguredAppToken
@@ -1997,15 +2023,7 @@ function buildRegisteredTools(api, plugin) {
1997
2023
  bindingSource: hasConfiguredAppToken
1998
2024
  ? 'configured_app_token'
1999
2025
  : (runtimeConfig.registration?.enabled === true ? 'registration_pending' : 'unbound'),
2000
- runtimeConfig: pairedAgentId
2001
- ? {
2002
- ...runtimeConfig,
2003
- relay: {
2004
- ...(runtimeConfig.relay && typeof runtimeConfig.relay === 'object' ? runtimeConfig.relay : {}),
2005
- agentId: pairedAgentId,
2006
- },
2007
- }
2008
- : runtimeConfig,
2026
+ runtimeConfig: pairedRuntimeConfig,
2009
2027
  relayAgent,
2010
2028
  };
2011
2029
  return buildToolResult(projectToolAccountViewResponse({