@xfxstudio/claworld 2026.7.7-testing.1 → 2026.7.9-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 +12 -1
- package/index.js +0 -1
- package/openclaw.plugin.json +3 -2
- package/package.json +3 -2
- package/skills/claworld-help/SKILL.md +10 -68
- package/skills/claworld-main-session/SKILL.md +16 -2
- package/skills/claworld-manage-worlds/SKILL.md +20 -11
- package/skills/claworld-management-session/SKILL.md +104 -21
- package/src/openclaw/index.js +2 -2
- package/src/openclaw/plugin/claworld-channel-plugin.js +49 -3
- package/src/openclaw/plugin/register-tooling.js +99 -37
- package/src/openclaw/plugin/register.js +325 -14
- package/src/openclaw/runtime/feedback-helper.js +6 -2
- package/src/openclaw/runtime/tool-contracts.js +1 -0
- package/src/openclaw/runtime/tool-inventory.js +4 -0
- package/src/openclaw/runtime/transcript-report.js +1309 -0
- package/src/openclaw/runtime/working-memory.js +26 -4
- package/src/openclaw/runtime/world-membership-helper.js +157 -0
- package/src/product-shell/contracts/search-item.js +2 -0
- package/src/openclaw/runtime/system-message-orchestrator.js +0 -1
|
@@ -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',
|
|
@@ -512,31 +562,36 @@ export function inferAccountAction(params = {}) {
|
|
|
512
562
|
}
|
|
513
563
|
|
|
514
564
|
function projectToolPublicIdentity(payload = null) {
|
|
515
|
-
|
|
565
|
+
const identityPayload = resolveToolIdentityPayload(payload);
|
|
566
|
+
if (!identityPayload) return null;
|
|
567
|
+
const publicIdentity = resolveToolPublicIdentityPayload(payload);
|
|
516
568
|
return {
|
|
517
|
-
status:
|
|
518
|
-
ready:
|
|
519
|
-
publicIdentity:
|
|
569
|
+
status: normalizePlainText(identityPayload.status, null),
|
|
570
|
+
ready: identityPayload.ready ?? null,
|
|
571
|
+
publicIdentity: publicIdentity
|
|
520
572
|
? {
|
|
521
|
-
status:
|
|
522
|
-
displayIdentity:
|
|
523
|
-
displayName:
|
|
524
|
-
code:
|
|
525
|
-
confirmedAt:
|
|
526
|
-
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),
|
|
527
579
|
}
|
|
528
580
|
: null,
|
|
529
|
-
recommendedDisplayName:
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
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'
|
|
535
590
|
? {
|
|
536
|
-
totalLikesReceived: Number(
|
|
537
|
-
totalDislikesReceived: Number(
|
|
538
|
-
totalLikesGiven: Number(
|
|
539
|
-
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),
|
|
540
595
|
}
|
|
541
596
|
: null,
|
|
542
597
|
};
|
|
@@ -596,23 +651,28 @@ function projectToolAccountIdentityFields(identityPayload = null) {
|
|
|
596
651
|
}
|
|
597
652
|
|
|
598
653
|
function projectToolAccountProfile(identityPayload = null) {
|
|
599
|
-
|
|
654
|
+
const identityPayloadSource = resolveToolIdentityPayload(identityPayload);
|
|
655
|
+
const profilePayload = resolveToolAccountProfilePayload(identityPayload);
|
|
656
|
+
return normalizePlainText(
|
|
657
|
+
profilePayload?.profile,
|
|
658
|
+
normalizePlainText(identityPayloadSource?.profile, null),
|
|
659
|
+
);
|
|
600
660
|
}
|
|
601
661
|
|
|
602
662
|
function projectToolAccountProfileState(identityPayload = null) {
|
|
603
|
-
const profilePayload =
|
|
604
|
-
const profile =
|
|
663
|
+
const profilePayload = resolveToolAccountProfilePayload(identityPayload);
|
|
664
|
+
const profile = normalizePlainText(profilePayload?.profile, projectToolAccountProfile(identityPayload));
|
|
605
665
|
const ready = profilePayload
|
|
606
666
|
? profilePayload.ready === true
|
|
607
667
|
: Boolean(profile);
|
|
608
668
|
return {
|
|
609
|
-
status:
|
|
669
|
+
status: normalizePlainText(profilePayload?.status, ready ? 'ready' : 'pending'),
|
|
610
670
|
ready,
|
|
611
671
|
profile,
|
|
612
|
-
reason:
|
|
613
|
-
requiredAction:
|
|
614
|
-
nextAction:
|
|
615
|
-
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'),
|
|
616
676
|
missingFields: Array.isArray(profilePayload?.missingFields)
|
|
617
677
|
? profilePayload.missingFields
|
|
618
678
|
: (ready
|
|
@@ -630,9 +690,9 @@ function projectToolAccountProfileState(identityPayload = null) {
|
|
|
630
690
|
function resolveToolPublicIdentityReady(identityPayload = null, publicIdentityState = {}) {
|
|
631
691
|
const diagnostics = normalizeObject(identityPayload?.diagnostics, null);
|
|
632
692
|
if (typeof diagnostics?.publicIdentityReady === 'boolean') return diagnostics.publicIdentityReady;
|
|
633
|
-
const identityStatus =
|
|
693
|
+
const identityStatus = normalizePlainText(publicIdentityState?.publicIdentity?.status, null);
|
|
634
694
|
if (identityStatus) return identityStatus === 'ready';
|
|
635
|
-
return identityPayload?.ready === true;
|
|
695
|
+
return resolveToolIdentityPayload(identityPayload)?.ready === true || identityPayload?.ready === true;
|
|
636
696
|
}
|
|
637
697
|
|
|
638
698
|
function projectToolPluginVersionStatus(payload = null) {
|
|
@@ -746,8 +806,9 @@ export function projectToolAccountViewResponse({
|
|
|
746
806
|
const relayResolved = typeof accountRelay?.resolved === 'boolean'
|
|
747
807
|
? accountRelay.resolved
|
|
748
808
|
: (typeof relayOnline === 'boolean');
|
|
749
|
-
const
|
|
750
|
-
|
|
809
|
+
const shareCardPayload = resolveToolShareCardPayload(identityPayload);
|
|
810
|
+
const resolvedShareCard = shareCardPayload !== undefined
|
|
811
|
+
? projectToolShareCard(shareCardPayload)
|
|
751
812
|
: undefined;
|
|
752
813
|
return {
|
|
753
814
|
action: 'view',
|
|
@@ -799,7 +860,7 @@ export function projectToolAccountViewResponse({
|
|
|
799
860
|
nextAction: blockedAction.nextAction,
|
|
800
861
|
nextTool: blockedAction.nextTool,
|
|
801
862
|
missingFields: blockedAction.missingFields,
|
|
802
|
-
pluginVersionStatus: projectToolPluginVersionStatus(identityPayload
|
|
863
|
+
pluginVersionStatus: projectToolPluginVersionStatus(resolveToolPluginVersionPayload(identityPayload)),
|
|
803
864
|
...(resolvedShareCard !== undefined ? { shareCard: resolvedShareCard } : {}),
|
|
804
865
|
};
|
|
805
866
|
}
|
|
@@ -813,10 +874,11 @@ export function projectToolAccountMutationResponse({
|
|
|
813
874
|
} = {}) {
|
|
814
875
|
const publicIdentityState = projectToolAccountIdentityFields(identityPayload);
|
|
815
876
|
const accountProfile = projectToolAccountProfileState(identityPayload);
|
|
877
|
+
const identityShareCardPayload = resolveToolShareCardPayload(identityPayload);
|
|
816
878
|
const resolvedShareCard = shareCard !== undefined
|
|
817
879
|
? shareCard
|
|
818
|
-
: (
|
|
819
|
-
? projectToolShareCard(
|
|
880
|
+
: (identityShareCardPayload !== undefined
|
|
881
|
+
? projectToolShareCard(identityShareCardPayload)
|
|
820
882
|
: undefined);
|
|
821
883
|
const publicIdentityReady = resolveToolPublicIdentityReady(identityPayload, publicIdentityState);
|
|
822
884
|
const accountProfileReady = accountProfile.ready === true;
|
|
@@ -885,7 +947,7 @@ export function projectToolAccountMutationResponse({
|
|
|
885
947
|
nextTool: blockedAction.nextTool,
|
|
886
948
|
missingFields: blockedAction.missingFields,
|
|
887
949
|
reason: blockedAction.reason,
|
|
888
|
-
pluginVersionStatus: projectToolPluginVersionStatus(identityPayload
|
|
950
|
+
pluginVersionStatus: projectToolPluginVersionStatus(resolveToolPluginVersionPayload(identityPayload)),
|
|
889
951
|
...(resolvedShareCard !== undefined ? { shareCard: resolvedShareCard } : {}),
|
|
890
952
|
...(runtimeIdentity ? { runtimeIdentity } : {}),
|
|
891
953
|
...(action === 'update_identity'
|