@xfxstudio/claworld 2026.7.2-testing.1 → 2026.7.8-testing.1
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 +29 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/claworld-help/SKILL.md +4 -2
- package/skills/claworld-main-session/SKILL.md +1 -1
- package/skills/claworld-manage-worlds/SKILL.md +9 -0
- package/skills/claworld-management-session/SKILL.md +10 -12
- package/src/openclaw/index.js +1 -0
- package/src/openclaw/plugin/account-identity.js +8 -2
- package/src/openclaw/plugin/claworld-channel-plugin.js +67 -79
- package/src/openclaw/plugin/register-tooling.js +150 -82
- package/src/openclaw/plugin/register.js +97 -110
- package/src/openclaw/plugin/relay-client.js +6 -2
- package/src/openclaw/plugin-version.js +9 -22
- package/src/openclaw/runtime/tool-contracts.js +2 -2
- package/src/openclaw/runtime/world-membership-helper.js +157 -0
- package/src/product-shell/contracts/chat-request-approval-policy.js +6 -0
- package/src/product-shell/contracts/search-item.js +3 -3
|
@@ -32,6 +32,56 @@ export function normalizeObject(value, fallback = null) {
|
|
|
32
32
|
return value;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
function normalizePlainText(value, fallback = null) {
|
|
36
|
+
if (value == null || typeof value === 'object' || typeof value === 'function') return fallback;
|
|
37
|
+
return normalizeText(value, fallback);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function resolveAccountManagementProfilePayload(payload = null) {
|
|
41
|
+
return normalizeObject(payload?.profile, null);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function resolveToolIdentityPayload(payload = null) {
|
|
45
|
+
return resolveAccountManagementProfilePayload(payload) || normalizeObject(payload, null);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function resolveToolPublicIdentityPayload(payload = null) {
|
|
49
|
+
const identityPayload = resolveToolIdentityPayload(payload);
|
|
50
|
+
return normalizeObject(identityPayload?.publicIdentity, null);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function resolveToolAccountProfilePayload(payload = null) {
|
|
54
|
+
const identityPayload = resolveToolIdentityPayload(payload);
|
|
55
|
+
return normalizeObject(identityPayload?.accountProfile, null);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function resolveToolShareCardPayload(payload = null) {
|
|
59
|
+
const identityPayload = resolveToolIdentityPayload(payload);
|
|
60
|
+
if (identityPayload && Object.prototype.hasOwnProperty.call(identityPayload, 'shareCard')) {
|
|
61
|
+
return identityPayload.shareCard;
|
|
62
|
+
}
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function resolveToolPluginVersionPayload(payload = null) {
|
|
67
|
+
const identityPayload = resolveToolIdentityPayload(payload);
|
|
68
|
+
return identityPayload?.clientVersionStatus || null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function resolveToolAgentId(payload = null, fallback = null) {
|
|
72
|
+
const identityPayload = resolveToolIdentityPayload(payload);
|
|
73
|
+
return normalizePlainText(identityPayload?.agentId, fallback);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function resolveToolDisplayName(payload = null, fallback = null) {
|
|
77
|
+
const identityPayload = resolveToolIdentityPayload(payload);
|
|
78
|
+
const publicIdentity = resolveToolPublicIdentityPayload(payload);
|
|
79
|
+
return normalizePlainText(
|
|
80
|
+
publicIdentity?.displayName,
|
|
81
|
+
normalizePlainText(identityPayload?.recommendedDisplayName, fallback),
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
35
85
|
function resolveRuntimeAppToken(runtimeConfig = {}) {
|
|
36
86
|
return normalizeText(
|
|
37
87
|
runtimeConfig?.appToken,
|
|
@@ -94,7 +144,7 @@ async function buildPendingPublicIdentityError({
|
|
|
94
144
|
accountId: normalizeText(accountId, null),
|
|
95
145
|
agentId: normalizeText(
|
|
96
146
|
agentId,
|
|
97
|
-
|
|
147
|
+
resolveToolAgentId(identityPayload, null),
|
|
98
148
|
),
|
|
99
149
|
httpStatus: 409,
|
|
100
150
|
backendCode: 'public_identity_incomplete',
|
|
@@ -496,7 +546,6 @@ export const ACCOUNT_ACTIONS = Object.freeze([
|
|
|
496
546
|
'view',
|
|
497
547
|
'update_identity',
|
|
498
548
|
'update_profile',
|
|
499
|
-
'update_chat_policy',
|
|
500
549
|
]);
|
|
501
550
|
|
|
502
551
|
function normalizeAccountAction(value, fallback = null) {
|
|
@@ -509,36 +558,40 @@ export function inferAccountAction(params = {}) {
|
|
|
509
558
|
if (explicitAction) return explicitAction;
|
|
510
559
|
if (normalizeText(params.displayName, null)) return 'update_identity';
|
|
511
560
|
if (Object.prototype.hasOwnProperty.call(params, 'profile')) return 'update_profile';
|
|
512
|
-
if (normalizeObject(params.chatRequestApprovalPolicy, null)) return 'update_chat_policy';
|
|
513
561
|
return 'view';
|
|
514
562
|
}
|
|
515
563
|
|
|
516
564
|
function projectToolPublicIdentity(payload = null) {
|
|
517
|
-
|
|
565
|
+
const identityPayload = resolveToolIdentityPayload(payload);
|
|
566
|
+
if (!identityPayload) return null;
|
|
567
|
+
const publicIdentity = resolveToolPublicIdentityPayload(payload);
|
|
518
568
|
return {
|
|
519
|
-
status:
|
|
520
|
-
ready:
|
|
521
|
-
publicIdentity:
|
|
569
|
+
status: normalizePlainText(identityPayload.status, null),
|
|
570
|
+
ready: identityPayload.ready ?? null,
|
|
571
|
+
publicIdentity: publicIdentity
|
|
522
572
|
? {
|
|
523
|
-
status:
|
|
524
|
-
displayIdentity:
|
|
525
|
-
displayName:
|
|
526
|
-
code:
|
|
527
|
-
confirmedAt:
|
|
528
|
-
updatedAt:
|
|
573
|
+
status: normalizePlainText(publicIdentity.status, null),
|
|
574
|
+
displayIdentity: normalizePlainText(publicIdentity.displayIdentity, null),
|
|
575
|
+
displayName: normalizePlainText(publicIdentity.displayName, null),
|
|
576
|
+
code: normalizePlainText(publicIdentity.code, null),
|
|
577
|
+
confirmedAt: normalizePlainText(publicIdentity.confirmedAt, null),
|
|
578
|
+
updatedAt: normalizePlainText(publicIdentity.updatedAt, null),
|
|
529
579
|
}
|
|
530
580
|
: null,
|
|
531
|
-
recommendedDisplayName:
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
581
|
+
recommendedDisplayName: normalizePlainText(
|
|
582
|
+
identityPayload.recommendedDisplayName,
|
|
583
|
+
null,
|
|
584
|
+
),
|
|
585
|
+
requiredAction: normalizePlainText(identityPayload.requiredAction, null),
|
|
586
|
+
nextAction: normalizePlainText(identityPayload.nextAction, null),
|
|
587
|
+
nextTool: normalizePlainText(identityPayload.nextTool, null),
|
|
588
|
+
missingFields: Array.isArray(identityPayload.missingFields) ? identityPayload.missingFields : [],
|
|
589
|
+
feedbackSummary: identityPayload.feedbackSummary && typeof identityPayload.feedbackSummary === 'object'
|
|
537
590
|
? {
|
|
538
|
-
totalLikesReceived: Number(
|
|
539
|
-
totalDislikesReceived: Number(
|
|
540
|
-
totalLikesGiven: Number(
|
|
541
|
-
totalDislikesGiven: Number(
|
|
591
|
+
totalLikesReceived: Number(identityPayload.feedbackSummary.totalLikesReceived || 0),
|
|
592
|
+
totalDislikesReceived: Number(identityPayload.feedbackSummary.totalDislikesReceived || 0),
|
|
593
|
+
totalLikesGiven: Number(identityPayload.feedbackSummary.totalLikesGiven || 0),
|
|
594
|
+
totalDislikesGiven: Number(identityPayload.feedbackSummary.totalDislikesGiven || 0),
|
|
542
595
|
}
|
|
543
596
|
: null,
|
|
544
597
|
};
|
|
@@ -598,23 +651,28 @@ function projectToolAccountIdentityFields(identityPayload = null) {
|
|
|
598
651
|
}
|
|
599
652
|
|
|
600
653
|
function projectToolAccountProfile(identityPayload = null) {
|
|
601
|
-
|
|
654
|
+
const identityPayloadSource = resolveToolIdentityPayload(identityPayload);
|
|
655
|
+
const profilePayload = resolveToolAccountProfilePayload(identityPayload);
|
|
656
|
+
return normalizePlainText(
|
|
657
|
+
profilePayload?.profile,
|
|
658
|
+
normalizePlainText(identityPayloadSource?.profile, null),
|
|
659
|
+
);
|
|
602
660
|
}
|
|
603
661
|
|
|
604
662
|
function projectToolAccountProfileState(identityPayload = null) {
|
|
605
|
-
const profilePayload =
|
|
606
|
-
const profile =
|
|
663
|
+
const profilePayload = resolveToolAccountProfilePayload(identityPayload);
|
|
664
|
+
const profile = normalizePlainText(profilePayload?.profile, projectToolAccountProfile(identityPayload));
|
|
607
665
|
const ready = profilePayload
|
|
608
666
|
? profilePayload.ready === true
|
|
609
667
|
: Boolean(profile);
|
|
610
668
|
return {
|
|
611
|
-
status:
|
|
669
|
+
status: normalizePlainText(profilePayload?.status, ready ? 'ready' : 'pending'),
|
|
612
670
|
ready,
|
|
613
671
|
profile,
|
|
614
|
-
reason:
|
|
615
|
-
requiredAction:
|
|
616
|
-
nextAction:
|
|
617
|
-
nextTool:
|
|
672
|
+
reason: normalizePlainText(profilePayload?.reason, ready ? null : 'account_profile_missing'),
|
|
673
|
+
requiredAction: normalizePlainText(profilePayload?.requiredAction, ready ? null : 'update_agent_profile'),
|
|
674
|
+
nextAction: normalizePlainText(profilePayload?.nextAction, ready ? null : 'update_agent_profile'),
|
|
675
|
+
nextTool: normalizePlainText(profilePayload?.nextTool, ready ? null : 'claworld_manage_account'),
|
|
618
676
|
missingFields: Array.isArray(profilePayload?.missingFields)
|
|
619
677
|
? profilePayload.missingFields
|
|
620
678
|
: (ready
|
|
@@ -629,31 +687,12 @@ function projectToolAccountProfileState(identityPayload = null) {
|
|
|
629
687
|
};
|
|
630
688
|
}
|
|
631
689
|
|
|
632
|
-
function
|
|
633
|
-
const
|
|
634
|
-
if (
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
syncedAt: normalizeText(policy.syncedAt, null),
|
|
639
|
-
credentialId: normalizeText(policy.credentialId, null),
|
|
640
|
-
source: normalizeObject(policy.source, {})
|
|
641
|
-
? {
|
|
642
|
-
channel: normalizeText(policy.source?.channel, null),
|
|
643
|
-
integration: normalizeText(policy.source?.integration, null),
|
|
644
|
-
accountId: normalizeText(policy.source?.accountId, null),
|
|
645
|
-
}
|
|
646
|
-
: {},
|
|
647
|
-
policy: normalizeObject(policy.policy, {})
|
|
648
|
-
? {
|
|
649
|
-
mode: normalizeText(policy.policy?.mode, null),
|
|
650
|
-
blocks: {
|
|
651
|
-
originTypes: Array.isArray(policy.policy?.blocks?.originTypes) ? policy.policy.blocks.originTypes : [],
|
|
652
|
-
worldIds: Array.isArray(policy.policy?.blocks?.worldIds) ? policy.policy.blocks.worldIds : [],
|
|
653
|
-
},
|
|
654
|
-
}
|
|
655
|
-
: null,
|
|
656
|
-
};
|
|
690
|
+
function resolveToolPublicIdentityReady(identityPayload = null, publicIdentityState = {}) {
|
|
691
|
+
const diagnostics = normalizeObject(identityPayload?.diagnostics, null);
|
|
692
|
+
if (typeof diagnostics?.publicIdentityReady === 'boolean') return diagnostics.publicIdentityReady;
|
|
693
|
+
const identityStatus = normalizePlainText(publicIdentityState?.publicIdentity?.status, null);
|
|
694
|
+
if (identityStatus) return identityStatus === 'ready';
|
|
695
|
+
return resolveToolIdentityPayload(identityPayload)?.ready === true || identityPayload?.ready === true;
|
|
657
696
|
}
|
|
658
697
|
|
|
659
698
|
function projectToolPluginVersionStatus(payload = null) {
|
|
@@ -685,11 +724,34 @@ export function projectToolAccountViewResponse({
|
|
|
685
724
|
accountId = null,
|
|
686
725
|
pairingPayload = null,
|
|
687
726
|
identityPayload = null,
|
|
727
|
+
accountPayload = null,
|
|
688
728
|
} = {}) {
|
|
689
729
|
const publicIdentityState = projectToolAccountIdentityFields(identityPayload);
|
|
690
730
|
const accountProfile = projectToolAccountProfileState(identityPayload);
|
|
691
|
-
const
|
|
692
|
-
const
|
|
731
|
+
const accountView = normalizeObject(accountPayload, null);
|
|
732
|
+
const accountRecord = normalizeObject(accountView?.account, null);
|
|
733
|
+
const accountRelay = normalizeObject(accountView?.relay, null);
|
|
734
|
+
const accountDiagnostics = normalizeObject(accountView?.diagnostics, null);
|
|
735
|
+
const publicIdentityReady = resolveToolPublicIdentityReady(identityPayload, publicIdentityState);
|
|
736
|
+
const accountProfileReady = accountProfile.ready === true
|
|
737
|
+
|| accountRecord?.profileReady === true
|
|
738
|
+
|| accountDiagnostics?.accountProfileReady === true;
|
|
739
|
+
const resolvedAccountProfile = accountProfile.ready === true
|
|
740
|
+
? accountProfile
|
|
741
|
+
: {
|
|
742
|
+
...accountProfile,
|
|
743
|
+
status: accountProfileReady ? 'ready' : accountProfile.status,
|
|
744
|
+
ready: accountProfileReady,
|
|
745
|
+
profile: normalizeText(
|
|
746
|
+
accountRecord?.agentProfile,
|
|
747
|
+
normalizeText(accountRecord?.profile, accountProfile.profile),
|
|
748
|
+
),
|
|
749
|
+
reason: accountProfileReady ? null : accountProfile.reason,
|
|
750
|
+
requiredAction: accountProfileReady ? null : accountProfile.requiredAction,
|
|
751
|
+
nextAction: accountProfileReady ? null : accountProfile.nextAction,
|
|
752
|
+
nextTool: accountProfileReady ? null : accountProfile.nextTool,
|
|
753
|
+
missingFields: accountProfileReady ? [] : accountProfile.missingFields,
|
|
754
|
+
};
|
|
693
755
|
const emailVerified = pairingPayload?.emailVerified === true;
|
|
694
756
|
const runtimePaired = pairingPayload?.status === 'paired';
|
|
695
757
|
const bindingReady = typeof pairingPayload?.bindingReady === 'boolean'
|
|
@@ -720,11 +782,11 @@ export function projectToolAccountViewResponse({
|
|
|
720
782
|
}
|
|
721
783
|
: !accountProfileReady
|
|
722
784
|
? {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
785
|
+
requiredAction: resolvedAccountProfile.requiredAction,
|
|
786
|
+
nextAction: resolvedAccountProfile.nextAction,
|
|
787
|
+
nextTool: resolvedAccountProfile.nextTool,
|
|
788
|
+
missingFields: resolvedAccountProfile.missingFields,
|
|
789
|
+
reason: resolvedAccountProfile.reason,
|
|
728
790
|
}
|
|
729
791
|
: {
|
|
730
792
|
requiredAction: null,
|
|
@@ -733,10 +795,20 @@ export function projectToolAccountViewResponse({
|
|
|
733
795
|
missingFields: [],
|
|
734
796
|
reason: null,
|
|
735
797
|
};
|
|
736
|
-
const
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
798
|
+
const relayIdentityResolved = typeof pairingPayload?.relayAgent?.resolved === 'boolean'
|
|
799
|
+
? pairingPayload.relayAgent.resolved
|
|
800
|
+
: null;
|
|
801
|
+
const relayOnline = typeof accountRelay?.online === 'boolean'
|
|
802
|
+
? accountRelay.online
|
|
803
|
+
: (typeof accountDiagnostics?.relayOnline === 'boolean'
|
|
804
|
+
? accountDiagnostics.relayOnline
|
|
805
|
+
: (typeof pairingPayload?.relayAgent?.online === 'boolean' ? pairingPayload.relayAgent.online : null));
|
|
806
|
+
const relayResolved = typeof accountRelay?.resolved === 'boolean'
|
|
807
|
+
? accountRelay.resolved
|
|
808
|
+
: (typeof relayOnline === 'boolean');
|
|
809
|
+
const shareCardPayload = resolveToolShareCardPayload(identityPayload);
|
|
810
|
+
const resolvedShareCard = shareCardPayload !== undefined
|
|
811
|
+
? projectToolShareCard(shareCardPayload)
|
|
740
812
|
: undefined;
|
|
741
813
|
return {
|
|
742
814
|
action: 'view',
|
|
@@ -765,6 +837,7 @@ export function projectToolAccountViewResponse({
|
|
|
765
837
|
bindingStatus,
|
|
766
838
|
publicIdentityReady,
|
|
767
839
|
accountProfileReady,
|
|
840
|
+
relayIdentityResolved,
|
|
768
841
|
relayPresenceResolved: relayResolved,
|
|
769
842
|
relayOnline,
|
|
770
843
|
},
|
|
@@ -774,21 +847,20 @@ export function projectToolAccountViewResponse({
|
|
|
774
847
|
normalizeText(pairingPayload?.relayAgent?.agentId, null),
|
|
775
848
|
),
|
|
776
849
|
displayName: normalizeText(pairingPayload?.relayAgent?.displayName, null),
|
|
777
|
-
|
|
778
|
-
|
|
850
|
+
visibilityMode: normalizeText(pairingPayload?.relayAgent?.visibilityMode, null),
|
|
851
|
+
contactPolicy: normalizeText(pairingPayload?.relayAgent?.contactPolicy, null),
|
|
779
852
|
online: relayOnline,
|
|
780
853
|
resolved: relayResolved,
|
|
781
854
|
bindingStatus,
|
|
782
855
|
},
|
|
783
|
-
profile:
|
|
856
|
+
profile: resolvedAccountProfile.profile,
|
|
784
857
|
...publicIdentityState,
|
|
785
|
-
accountProfile,
|
|
858
|
+
accountProfile: resolvedAccountProfile,
|
|
786
859
|
requiredAction: blockedAction.requiredAction,
|
|
787
860
|
nextAction: blockedAction.nextAction,
|
|
788
861
|
nextTool: blockedAction.nextTool,
|
|
789
862
|
missingFields: blockedAction.missingFields,
|
|
790
|
-
pluginVersionStatus: projectToolPluginVersionStatus(identityPayload
|
|
791
|
-
chatRequestApprovalPolicy: projectToolChatRequestApprovalPolicy(identityPayload?.chatRequestApprovalPolicy),
|
|
863
|
+
pluginVersionStatus: projectToolPluginVersionStatus(resolveToolPluginVersionPayload(identityPayload)),
|
|
792
864
|
...(resolvedShareCard !== undefined ? { shareCard: resolvedShareCard } : {}),
|
|
793
865
|
};
|
|
794
866
|
}
|
|
@@ -802,12 +874,13 @@ export function projectToolAccountMutationResponse({
|
|
|
802
874
|
} = {}) {
|
|
803
875
|
const publicIdentityState = projectToolAccountIdentityFields(identityPayload);
|
|
804
876
|
const accountProfile = projectToolAccountProfileState(identityPayload);
|
|
877
|
+
const identityShareCardPayload = resolveToolShareCardPayload(identityPayload);
|
|
805
878
|
const resolvedShareCard = shareCard !== undefined
|
|
806
879
|
? shareCard
|
|
807
|
-
: (
|
|
808
|
-
? projectToolShareCard(
|
|
880
|
+
: (identityShareCardPayload !== undefined
|
|
881
|
+
? projectToolShareCard(identityShareCardPayload)
|
|
809
882
|
: undefined);
|
|
810
|
-
const publicIdentityReady = identityPayload
|
|
883
|
+
const publicIdentityReady = resolveToolPublicIdentityReady(identityPayload, publicIdentityState);
|
|
811
884
|
const accountProfileReady = accountProfile.ready === true;
|
|
812
885
|
const emailVerificationPayload = normalizeObject(identityPayload?.emailVerification, null);
|
|
813
886
|
const emailVerified = identityPayload?.emailVerified === true
|
|
@@ -874,8 +947,7 @@ export function projectToolAccountMutationResponse({
|
|
|
874
947
|
nextTool: blockedAction.nextTool,
|
|
875
948
|
missingFields: blockedAction.missingFields,
|
|
876
949
|
reason: blockedAction.reason,
|
|
877
|
-
pluginVersionStatus: projectToolPluginVersionStatus(identityPayload
|
|
878
|
-
chatRequestApprovalPolicy: projectToolChatRequestApprovalPolicy(identityPayload?.chatRequestApprovalPolicy),
|
|
950
|
+
pluginVersionStatus: projectToolPluginVersionStatus(resolveToolPluginVersionPayload(identityPayload)),
|
|
879
951
|
...(resolvedShareCard !== undefined ? { shareCard: resolvedShareCard } : {}),
|
|
880
952
|
...(runtimeIdentity ? { runtimeIdentity } : {}),
|
|
881
953
|
...(action === 'update_identity'
|
|
@@ -888,10 +960,6 @@ export function projectToolAccountMutationResponse({
|
|
|
888
960
|
? {
|
|
889
961
|
updated: ['profile'],
|
|
890
962
|
}
|
|
891
|
-
: action === 'update_chat_policy'
|
|
892
|
-
? {
|
|
893
|
-
updated: ['chatRequestApprovalPolicy'],
|
|
894
|
-
}
|
|
895
963
|
: {}),
|
|
896
964
|
};
|
|
897
965
|
}
|