@xfxstudio/claworld 2026.4.22-testing.4 → 2026.4.22-testing.6
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/index.js +0 -14
- package/openclaw.plugin.json +7 -7
- package/package.json +1 -1
- package/skills/claworld-a2a-channel-agent/SKILL.md +0 -6
- package/skills/claworld-help/SKILL.md +0 -2
- package/skills/claworld-join-and-chat/SKILL.md +5 -58
- package/src/lib/relay/kickoff-progress.js +8 -0
- package/src/openclaw/index.js +0 -15
- package/src/openclaw/plugin/claworld-channel-plugin.js +0 -25
- package/src/openclaw/plugin/config-schema.js +3 -3
- package/src/openclaw/plugin/register.js +7 -177
- package/src/openclaw/plugin/relay-client.js +16 -0
- package/src/openclaw/runtime/product-shell-helper.js +0 -119
- package/src/openclaw/runtime/tool-contracts.js +11 -52
- package/src/openclaw/runtime/tool-inventory.js +0 -6
- package/src/openclaw/runtime/world-moderation-helper.js +11 -1
- package/src/product-shell/contracts/world-orchestration.js +4 -4
- package/src/openclaw/runtime/working-memory.js +0 -702
|
@@ -517,75 +517,6 @@ export function normalizeWorldMemberSearchResponse(payload = {}, { accountId = n
|
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
-
function normalizeSocialPublicProfile(profile = {}) {
|
|
521
|
-
return {
|
|
522
|
-
identity: normalizeText(profile.identity, null),
|
|
523
|
-
displayName: normalizeText(profile.displayName, null),
|
|
524
|
-
code: normalizeText(profile.code, null)?.toUpperCase() || null,
|
|
525
|
-
profile: normalizeText(profile.profile, null),
|
|
526
|
-
discoverable: typeof profile.discoverable === 'boolean' ? profile.discoverable : null,
|
|
527
|
-
contactable: typeof profile.contactable === 'boolean' ? profile.contactable : null,
|
|
528
|
-
};
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
function normalizeSocialActiveWorldItem(world = {}) {
|
|
532
|
-
return {
|
|
533
|
-
worldId: normalizeText(world.worldId, null),
|
|
534
|
-
displayName: normalizeText(world.displayName, null),
|
|
535
|
-
summary: normalizeText(world.summary, null),
|
|
536
|
-
category: normalizeText(world.category, null),
|
|
537
|
-
};
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
function normalizeSocialRequestChat(requestChat = null, publicProfile = {}) {
|
|
541
|
-
const candidate = requestChat && typeof requestChat === 'object' && !Array.isArray(requestChat)
|
|
542
|
-
? requestChat
|
|
543
|
-
: {};
|
|
544
|
-
const displayName = normalizeText(candidate.displayName, normalizeText(publicProfile.displayName, null));
|
|
545
|
-
const agentCode = normalizeText(candidate.agentCode, normalizeText(publicProfile.code, null))?.toUpperCase() || null;
|
|
546
|
-
if (!displayName || !agentCode) return null;
|
|
547
|
-
return {
|
|
548
|
-
displayName,
|
|
549
|
-
agentCode,
|
|
550
|
-
};
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
function normalizeSocialAgentSearchItem(item = {}) {
|
|
554
|
-
const publicProfile = normalizeSocialPublicProfile(item.publicProfile || {});
|
|
555
|
-
const activeWorldItems = item.activeWorlds?.items && Array.isArray(item.activeWorlds.items)
|
|
556
|
-
? item.activeWorlds.items.map((world) => normalizeSocialActiveWorldItem(world))
|
|
557
|
-
: [];
|
|
558
|
-
|
|
559
|
-
return {
|
|
560
|
-
publicProfile,
|
|
561
|
-
activeWorlds: {
|
|
562
|
-
totalCount: normalizeInteger(item.activeWorlds?.totalCount, activeWorldItems.length),
|
|
563
|
-
items: activeWorldItems,
|
|
564
|
-
},
|
|
565
|
-
requestChat: normalizeSocialRequestChat(item.requestChat, publicProfile),
|
|
566
|
-
score: normalizeInteger(item.score, 0),
|
|
567
|
-
matchedFieldIds: normalizeStringList(item.matchedFieldIds),
|
|
568
|
-
reasonSummary: normalizeText(item.reasonSummary, null),
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
export function normalizeSocialAgentSearchResponse(payload = {}, { accountId = null } = {}) {
|
|
573
|
-
const items = Array.isArray(payload.items)
|
|
574
|
-
? payload.items.map((item) => normalizeSocialAgentSearchItem(item))
|
|
575
|
-
: [];
|
|
576
|
-
|
|
577
|
-
return {
|
|
578
|
-
status: normalizeText(payload.status, items.length > 0 ? 'search_ready' : 'no_matches'),
|
|
579
|
-
source: 'product_shell',
|
|
580
|
-
accountId: normalizeText(accountId, null),
|
|
581
|
-
query: normalizeText(payload.query, null),
|
|
582
|
-
limit: normalizeInteger(payload.limit, items.length > 0 ? items.length : 10),
|
|
583
|
-
totalMatches: normalizeInteger(payload.totalMatches, items.length),
|
|
584
|
-
nextAction: normalizeText(payload.nextAction, items.length > 0 ? 'review_profiles_or_request_chat' : 'refine_agent_search'),
|
|
585
|
-
items,
|
|
586
|
-
};
|
|
587
|
-
}
|
|
588
|
-
|
|
589
520
|
export function resolveWorldSelection(worldDirectory = {}, selection = null) {
|
|
590
521
|
return resolveBackendWorldSelection(worldDirectory, selection);
|
|
591
522
|
}
|
|
@@ -750,56 +681,6 @@ export async function searchWorlds({
|
|
|
750
681
|
});
|
|
751
682
|
}
|
|
752
683
|
|
|
753
|
-
export async function searchAgents({
|
|
754
|
-
cfg = {},
|
|
755
|
-
accountId = null,
|
|
756
|
-
runtimeConfig = null,
|
|
757
|
-
query = null,
|
|
758
|
-
limit = null,
|
|
759
|
-
fetchImpl,
|
|
760
|
-
logger = console,
|
|
761
|
-
} = {}) {
|
|
762
|
-
if (typeof fetchImpl !== 'function') {
|
|
763
|
-
throw new Error('fetch is unavailable for claworld product-shell social search helper');
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
const normalizedQuery = normalizeText(query, null);
|
|
767
|
-
if (!normalizedQuery) {
|
|
768
|
-
throw new Error('claworld product-shell social search helper requires query');
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
const resolvedRuntimeConfig = runtimeConfig || resolveClaworldRuntimeConfig(cfg, accountId);
|
|
772
|
-
const baseUrl = normalizeRelayHttpBaseUrl(resolvedRuntimeConfig.serverUrl);
|
|
773
|
-
const searchResult = await fetchJson(fetchImpl, `${baseUrl}/v1/social/agents/search`, {
|
|
774
|
-
method: 'POST',
|
|
775
|
-
headers: buildRuntimeAuthHeaders(resolvedRuntimeConfig, {
|
|
776
|
-
accept: 'application/json',
|
|
777
|
-
'content-type': 'application/json',
|
|
778
|
-
...(resolvedRuntimeConfig.apiKey ? { 'x-api-key': resolvedRuntimeConfig.apiKey } : {}),
|
|
779
|
-
}),
|
|
780
|
-
body: JSON.stringify({
|
|
781
|
-
query: normalizedQuery,
|
|
782
|
-
limit: limit == null ? null : normalizeInteger(limit, 0),
|
|
783
|
-
}),
|
|
784
|
-
});
|
|
785
|
-
|
|
786
|
-
if (!searchResult.ok) {
|
|
787
|
-
logger.error?.('[claworld:product-shell] social agent search failed', {
|
|
788
|
-
status: searchResult.status,
|
|
789
|
-
query: normalizedQuery,
|
|
790
|
-
accountId: resolvedRuntimeConfig.accountId || accountId || null,
|
|
791
|
-
body: searchResult.body,
|
|
792
|
-
});
|
|
793
|
-
throw createProductShellHttpError('social_agent_search', searchResult, {
|
|
794
|
-
accountId: resolvedRuntimeConfig.accountId || accountId || null,
|
|
795
|
-
});
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
return normalizeSocialAgentSearchResponse(searchResult.body, {
|
|
799
|
-
accountId: resolvedRuntimeConfig.accountId || accountId || null,
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
|
-
|
|
803
684
|
export async function joinWorld({
|
|
804
685
|
cfg = {},
|
|
805
686
|
accountId = null,
|
|
@@ -122,21 +122,21 @@ function projectRequestChatPayload(
|
|
|
122
122
|
} = {},
|
|
123
123
|
) {
|
|
124
124
|
if (!requestChat || typeof requestChat !== 'object' || Array.isArray(requestChat)) return null;
|
|
125
|
+
const worldId = normalizeText(requestChat.worldId, null);
|
|
125
126
|
const displayName = normalizeText(requestChat.displayName, null);
|
|
126
127
|
const agentCode = normalizeText(requestChat.agentCode, null)?.toUpperCase() || null;
|
|
127
|
-
|
|
128
|
-
if (!displayName || !agentCode) return null;
|
|
128
|
+
if (!worldId || !displayName || !agentCode) return null;
|
|
129
129
|
|
|
130
130
|
const normalizedAccountId = normalizeText(accountId, null);
|
|
131
131
|
|
|
132
132
|
return {
|
|
133
|
-
|
|
133
|
+
worldId,
|
|
134
134
|
displayName,
|
|
135
135
|
agentCode,
|
|
136
136
|
requestTool: normalizeText(requestToolName, null),
|
|
137
137
|
requestPayload: {
|
|
138
138
|
...(normalizedAccountId ? { accountId: normalizedAccountId } : {}),
|
|
139
|
-
|
|
139
|
+
worldId,
|
|
140
140
|
displayName,
|
|
141
141
|
agentCode,
|
|
142
142
|
},
|
|
@@ -166,6 +166,7 @@ function projectRequestChatAction(
|
|
|
166
166
|
worldId,
|
|
167
167
|
displayName: ':displayName',
|
|
168
168
|
agentCode: ':agentCode',
|
|
169
|
+
openingMessage: ':openingMessage',
|
|
169
170
|
},
|
|
170
171
|
summary: normalizeText(requestChatAction.summary, null),
|
|
171
172
|
};
|
|
@@ -588,7 +589,12 @@ function projectToolWorldBroadcastFailureItem(item = {}) {
|
|
|
588
589
|
export function projectToolWorldBroadcastResponse(payload = {}, { accountId = null } = {}) {
|
|
589
590
|
return {
|
|
590
591
|
accountId: normalizeText(accountId, null),
|
|
592
|
+
accepted: payload.accepted === true,
|
|
591
593
|
status: normalizeText(payload.status, null),
|
|
594
|
+
commandId: normalizeText(payload.commandId, null),
|
|
595
|
+
command: payload.command && typeof payload.command === 'object' && !Array.isArray(payload.command)
|
|
596
|
+
? payload.command
|
|
597
|
+
: null,
|
|
592
598
|
worldId: normalizeText(payload.worldId, null),
|
|
593
599
|
senderAgentId: normalizeText(payload.senderAgentId, null),
|
|
594
600
|
senderRole: projectWorldRole(payload.senderRole, null),
|
|
@@ -596,6 +602,7 @@ export function projectToolWorldBroadcastResponse(payload = {}, { accountId = nu
|
|
|
596
602
|
excludeSelf: normalizeOptionalBoolean(payload.excludeSelf, null),
|
|
597
603
|
eligibility: normalizeText(payload.eligibility, null),
|
|
598
604
|
broadcastId: normalizeText(payload.broadcastId, null),
|
|
605
|
+
fanoutStatus: normalizeText(payload.fanoutStatus, null),
|
|
599
606
|
totalTargets: normalizeOptionalInteger(payload.totalTargets, null),
|
|
600
607
|
createdCount: normalizeOptionalInteger(payload.createdCount, null),
|
|
601
608
|
failedCount: normalizeOptionalInteger(payload.failedCount, null),
|
|
@@ -675,54 +682,6 @@ export function projectToolWorldMemberSearchResponse(payload = {}, { accountId =
|
|
|
675
682
|
};
|
|
676
683
|
}
|
|
677
684
|
|
|
678
|
-
function projectToolSocialActiveWorldSummary(world = {}) {
|
|
679
|
-
return {
|
|
680
|
-
worldId: normalizeText(world.worldId, null),
|
|
681
|
-
displayName: normalizeText(world.displayName, null),
|
|
682
|
-
summary: normalizeText(world.summary, null),
|
|
683
|
-
category: normalizeText(world.category, null),
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
function projectToolSocialPublicProfile(profile = {}) {
|
|
688
|
-
return {
|
|
689
|
-
identity: normalizeText(profile.identity, null),
|
|
690
|
-
displayName: normalizeText(profile.displayName, null),
|
|
691
|
-
code: normalizeText(profile.code, null)?.toUpperCase() || null,
|
|
692
|
-
profile: normalizeText(profile.profile, null),
|
|
693
|
-
discoverable: typeof profile.discoverable === 'boolean' ? profile.discoverable : null,
|
|
694
|
-
contactable: typeof profile.contactable === 'boolean' ? profile.contactable : null,
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
export function projectToolSocialAgentSearchResponse(payload = {}, { accountId = null } = {}) {
|
|
699
|
-
const items = Array.isArray(payload.items)
|
|
700
|
-
? payload.items.map((item) => ({
|
|
701
|
-
publicProfile: projectToolSocialPublicProfile(item.publicProfile || {}),
|
|
702
|
-
activeWorlds: {
|
|
703
|
-
totalCount: normalizeInteger(item.activeWorlds?.totalCount, Array.isArray(item.activeWorlds?.items) ? item.activeWorlds.items.length : 0),
|
|
704
|
-
items: Array.isArray(item.activeWorlds?.items)
|
|
705
|
-
? item.activeWorlds.items.map((world) => projectToolSocialActiveWorldSummary(world))
|
|
706
|
-
: [],
|
|
707
|
-
},
|
|
708
|
-
matchedFieldIds: normalizeStringList(item.matchedFieldIds),
|
|
709
|
-
reasonSummary: normalizeText(item.reasonSummary, null),
|
|
710
|
-
score: normalizeInteger(item.score, 0),
|
|
711
|
-
requestChat: projectRequestChatPayload(item.requestChat, { accountId }),
|
|
712
|
-
}))
|
|
713
|
-
: [];
|
|
714
|
-
|
|
715
|
-
return {
|
|
716
|
-
accountId: normalizeText(accountId, null),
|
|
717
|
-
status: normalizeText(payload.status, items.length > 0 ? 'search_ready' : 'no_matches'),
|
|
718
|
-
query: normalizeText(payload.query, null),
|
|
719
|
-
limit: normalizeInteger(payload.limit, items.length > 0 ? items.length : 10),
|
|
720
|
-
totalMatches: normalizeInteger(payload.totalMatches, items.length),
|
|
721
|
-
nextAction: normalizeText(payload.nextAction, items.length > 0 ? 'review_profiles_or_request_chat' : 'refine_agent_search'),
|
|
722
|
-
agents: items,
|
|
723
|
-
};
|
|
724
|
-
}
|
|
725
|
-
|
|
726
685
|
export function projectToolFeedbackSubmissionResponse(result = {}) {
|
|
727
686
|
const feedback = result.feedback && typeof result.feedback === 'object' ? result.feedback : {};
|
|
728
687
|
const reporter = feedback.reporter && typeof feedback.reporter === 'object' ? feedback.reporter : {};
|
|
@@ -9,10 +9,6 @@ export const CLAWORLD_ACCOUNT_TOOL_NAMES = Object.freeze([
|
|
|
9
9
|
'claworld_account',
|
|
10
10
|
]);
|
|
11
11
|
|
|
12
|
-
export const CLAWORLD_SOCIAL_DISCOVERY_TOOL_NAMES = Object.freeze([
|
|
13
|
-
'claworld_search_agents',
|
|
14
|
-
]);
|
|
15
|
-
|
|
16
12
|
export const CLAWORLD_FEEDBACK_TOOL_NAMES = Object.freeze([
|
|
17
13
|
'claworld_submit_feedback',
|
|
18
14
|
]);
|
|
@@ -33,7 +29,6 @@ export const CLAWORLD_WORLD_ADMIN_PUBLIC_TOOL_NAMES = Object.freeze([
|
|
|
33
29
|
|
|
34
30
|
export const CLAWORLD_REGISTERED_TOOL_NAMES = Object.freeze([
|
|
35
31
|
...CLAWORLD_ACCOUNT_TOOL_NAMES,
|
|
36
|
-
...CLAWORLD_SOCIAL_DISCOVERY_TOOL_NAMES,
|
|
37
32
|
...CLAWORLD_WORLD_TOOL_NAMES,
|
|
38
33
|
...CLAWORLD_WORLD_ADMIN_PUBLIC_TOOL_NAMES,
|
|
39
34
|
...CLAWORLD_CHAT_REQUEST_TOOL_NAMES,
|
|
@@ -58,7 +53,6 @@ export const CLAWORLD_READ_ONLY_OPENCLAW_TOOL_NAMES = Object.freeze([
|
|
|
58
53
|
|
|
59
54
|
export const CLAWORLD_PLUGIN_SMOKE_REQUIRED_TOOL_NAMES = Object.freeze([
|
|
60
55
|
...CLAWORLD_ACCOUNT_TOOL_NAMES,
|
|
61
|
-
...CLAWORLD_SOCIAL_DISCOVERY_TOOL_NAMES,
|
|
62
56
|
...CLAWORLD_WORLD_TOOL_NAMES,
|
|
63
57
|
...CLAWORLD_WORLD_ADMIN_PUBLIC_TOOL_NAMES,
|
|
64
58
|
...CLAWORLD_CHAT_REQUEST_TOOL_NAMES,
|
|
@@ -167,7 +167,12 @@ function normalizeWorldBroadcastFailureItem(item = {}) {
|
|
|
167
167
|
|
|
168
168
|
function normalizeWorldBroadcastResponse(payload = {}) {
|
|
169
169
|
return {
|
|
170
|
+
accepted: payload.accepted === true,
|
|
170
171
|
status: normalizeText(payload.status, null),
|
|
172
|
+
commandId: normalizeText(payload.commandId, null),
|
|
173
|
+
command: payload.command && typeof payload.command === 'object' && !Array.isArray(payload.command)
|
|
174
|
+
? payload.command
|
|
175
|
+
: null,
|
|
171
176
|
worldId: normalizeText(payload.worldId, null),
|
|
172
177
|
senderAgentId: normalizeText(payload.senderAgentId, null),
|
|
173
178
|
senderRole: normalizeWorldRole(payload.senderRole, null),
|
|
@@ -175,6 +180,7 @@ function normalizeWorldBroadcastResponse(payload = {}) {
|
|
|
175
180
|
excludeSelf: normalizeOptionalBoolean(payload.excludeSelf, null),
|
|
176
181
|
eligibility: normalizeText(payload.eligibility, null),
|
|
177
182
|
broadcastId: normalizeText(payload.broadcastId, null),
|
|
183
|
+
fanoutStatus: normalizeText(payload.fanoutStatus, null),
|
|
178
184
|
totalTargets: normalizeOptionalInteger(payload.totalTargets, null),
|
|
179
185
|
createdCount: normalizeOptionalInteger(payload.createdCount, null),
|
|
180
186
|
failedCount: normalizeOptionalInteger(payload.failedCount, null),
|
|
@@ -504,5 +510,9 @@ export async function broadcastModeratedWorld({
|
|
|
504
510
|
});
|
|
505
511
|
}
|
|
506
512
|
|
|
507
|
-
return normalizeWorldBroadcastResponse(
|
|
513
|
+
return normalizeWorldBroadcastResponse({
|
|
514
|
+
...result.body,
|
|
515
|
+
worldId: resolvedWorldId,
|
|
516
|
+
senderAgentId: resolvedAgentId,
|
|
517
|
+
});
|
|
508
518
|
}
|
|
@@ -615,9 +615,9 @@ export function buildCandidateDeliverySummary(candidateFeed = {}, { worldDetail
|
|
|
615
615
|
const requestChatAction = {
|
|
616
616
|
action: 'request_chat',
|
|
617
617
|
worldId: normalizedFeed.worldId,
|
|
618
|
-
requiredFields: ['worldId', 'displayName', 'agentCode'],
|
|
618
|
+
requiredFields: ['worldId', 'displayName', 'agentCode', 'openingMessage'],
|
|
619
619
|
summary:
|
|
620
|
-
'After the user chooses a candidate, request_chat with this worldId, displayName, and
|
|
620
|
+
'After the user chooses a candidate, request_chat with this worldId, displayName, agentCode, and a non-blank openingMessage.',
|
|
621
621
|
};
|
|
622
622
|
const candidateSummaries = normalizedFeed.candidates.slice(0, summaryLimit).map((candidate, index) => {
|
|
623
623
|
const name = candidate.profileSummary.displayName || `Candidate ${index + 1}`;
|
|
@@ -695,8 +695,8 @@ export function buildCandidateDeliverySummary(candidateFeed = {}, { worldDetail
|
|
|
695
695
|
user: [heading, promptBody].filter(Boolean).join('\n\n'),
|
|
696
696
|
followUp: deliveredCandidateCount > 0
|
|
697
697
|
? (remainingCandidateCount > 0
|
|
698
|
-
? `Share these ${deliveredCandidateCount} candidate summaries first. If the user chooses someone now, continue with request_chat using that candidate's {worldId, displayName, agentCode}. If they want more options first, continue with the remaining ${remainingCandidateCount} candidate${remainingCandidateCount === 1 ? '' : 's'} from the same feed.`
|
|
699
|
-
: 'Share these candidate summaries and, if the user chooses one, continue with request_chat using the attached {worldId, displayName, agentCode} payload
|
|
698
|
+
? `Share these ${deliveredCandidateCount} candidate summaries first. If the user chooses someone now, continue with request_chat using that candidate's {worldId, displayName, agentCode} plus a non-blank openingMessage from the user. If they want more options first, continue with the remaining ${remainingCandidateCount} candidate${remainingCandidateCount === 1 ? '' : 's'} from the same feed.`
|
|
699
|
+
: 'Share these candidate summaries and, if the user chooses one, continue with request_chat using the attached {worldId, displayName, agentCode} payload plus a non-blank openingMessage from the user.')
|
|
700
700
|
: 'Tell the user candidate delivery can be retried later through the same backend-authored world flow.',
|
|
701
701
|
},
|
|
702
702
|
};
|