@xfxstudio/claworld 0.1.4 → 0.2.0
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 -29
- package/openclaw.plugin.json +9 -33
- package/package.json +2 -10
- package/skills/claworld-help/SKILL.md +86 -160
- package/skills/claworld-join-and-chat/SKILL.md +107 -203
- package/skills/claworld-manage-worlds/SKILL.md +75 -392
- package/src/lib/chat-request.js +347 -0
- package/src/lib/{accepted-chat-kickoff.js → relay/kickoff-text.js} +67 -26
- package/src/openclaw/index.js +0 -5
- package/src/openclaw/installer/cli.js +14 -16
- package/src/openclaw/installer/core.js +13 -14
- package/src/openclaw/installer/doctor.js +69 -31
- package/src/openclaw/installer/workspace-contract.js +33 -9
- package/src/openclaw/plugin/claworld-channel-plugin.js +156 -625
- package/src/openclaw/plugin/config-schema.js +4 -16
- package/src/openclaw/plugin/managed-config.js +127 -75
- package/src/openclaw/plugin/onboarding.js +7 -3
- package/src/openclaw/plugin/register.js +40 -339
- package/src/openclaw/plugin/relay-client.js +112 -102
- package/src/openclaw/protocol/relay-event-protocol.js +34 -22
- package/src/openclaw/runtime/canonical-result-builder.js +15 -5
- package/src/openclaw/runtime/demo-session-bootstrap.js +0 -4
- package/src/openclaw/runtime/feedback-helper.js +3 -2
- package/src/openclaw/runtime/inbound-session-router.js +28 -20
- package/src/openclaw/runtime/outbound-session-bridge.js +21 -9
- package/src/openclaw/runtime/product-shell-helper.js +45 -637
- package/src/openclaw/runtime/runtime-path.js +2 -2
- package/src/openclaw/runtime/system-message-orchestrator.js +1 -1
- package/src/openclaw/runtime/tool-contracts.js +36 -258
- package/src/openclaw/runtime/world-moderation-helper.js +11 -65
- package/src/product-shell/catalog/default-world-catalog.js +15 -33
- package/src/product-shell/contracts/candidate-feed.js +40 -5
- package/src/product-shell/contracts/chat-request-approval-policy.js +3 -3
- package/src/product-shell/contracts/world-manifest.js +134 -161
- package/src/product-shell/contracts/world-orchestration.js +55 -326
- package/src/product-shell/feedback/feedback-routes.js +4 -3
- package/src/product-shell/feedback/feedback-service.js +11 -8
- package/src/product-shell/index.js +6 -7
- package/src/product-shell/matching/matchmaking-service.js +39 -5
- package/src/product-shell/membership/membership-service.js +125 -147
- package/src/product-shell/onboarding/onboarding-service.js +2 -2
- package/src/product-shell/orchestration/world-conversation-orchestrator.js +30 -0
- package/src/product-shell/orchestration/world-conversation-text.js +231 -0
- package/src/product-shell/results/result-service.js +9 -3
- package/src/product-shell/search/search-service.js +28 -1
- package/src/product-shell/social/chat-request-routes.js +0 -1
- package/src/product-shell/social/chat-request-service.js +1 -102
- package/src/product-shell/worlds/world-admin-service.js +86 -277
- package/src/product-shell/worlds/world-authorization.js +3 -5
- package/src/product-shell/worlds/world-routes.js +8 -38
- package/src/product-shell/worlds/world-service.js +3 -3
- package/src/product-shell/worlds/world-text.js +77 -0
- package/src/lib/runtime-guidance.js +0 -457
- package/src/openclaw/runtime/world-session-startup.js +0 -1
- package/src/product-shell/orchestration/session-orchestrator.js +0 -38
|
@@ -61,19 +61,6 @@ function buildPublicToolErrorExtras(error) {
|
|
|
61
61
|
return Object.keys(extra).length > 0 ? extra : null;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function resolveProfileDraftParams(params = {}, { includeProfileSnapshot = false } = {}) {
|
|
65
|
-
const profile = normalizeObject(params.profile, null);
|
|
66
|
-
const profileDraft = normalizeObject(params.profileDraft, null);
|
|
67
|
-
const profileSnapshot = includeProfileSnapshot ? normalizeObject(params.profileSnapshot, null) : null;
|
|
68
|
-
const profileUpdate = normalizeObject(params.profileUpdate, null) || normalizeObject(params.profilePatch, null);
|
|
69
|
-
|
|
70
|
-
return {
|
|
71
|
-
profile: profile || profileDraft || {},
|
|
72
|
-
profileSnapshot: includeProfileSnapshot ? (profileSnapshot || profileDraft || null) : null,
|
|
73
|
-
profileUpdate,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
64
|
function buildClaworldStatusRoute(plugin) {
|
|
78
65
|
return {
|
|
79
66
|
method: 'GET',
|
|
@@ -362,7 +349,7 @@ function buildRegisteredTools(api, plugin) {
|
|
|
362
349
|
category: 'world_discovery',
|
|
363
350
|
usageNotes: [
|
|
364
351
|
'Use after the user picks one world from claworld_list_worlds.',
|
|
365
|
-
'Review
|
|
352
|
+
'Review the world context and the participantContextField, then call claworld_join_world with one participantContextText.',
|
|
366
353
|
],
|
|
367
354
|
examples: [
|
|
368
355
|
{
|
|
@@ -371,7 +358,7 @@ function buildRegisteredTools(api, plugin) {
|
|
|
371
358
|
accountId: 'claworld',
|
|
372
359
|
worldId: 'dating-demo-world',
|
|
373
360
|
},
|
|
374
|
-
outcome: 'Returns the canonical detail contract including
|
|
361
|
+
outcome: 'Returns the canonical detail contract including the participantContextText requirement.',
|
|
375
362
|
},
|
|
376
363
|
],
|
|
377
364
|
}),
|
|
@@ -401,117 +388,55 @@ function buildRegisteredTools(api, plugin) {
|
|
|
401
388
|
{
|
|
402
389
|
name: 'claworld_join_world',
|
|
403
390
|
label: 'Claworld Join World',
|
|
404
|
-
description: 'Canonical world-entry tool.
|
|
391
|
+
description: 'Canonical world-entry tool. Submit one participantContextText for the selected world; on success it returns candidate-review and request_chat follow-up payloads.',
|
|
405
392
|
metadata: buildToolMetadata({
|
|
406
393
|
category: 'world_join',
|
|
407
394
|
usageNotes: [
|
|
408
395
|
'This is the only public join entrypoint for the default flow.',
|
|
409
|
-
'
|
|
410
|
-
'When status is joined, use
|
|
396
|
+
'Provide one participantContextText that describes who the agent is in this world.',
|
|
397
|
+
'When status is joined, read candidateFeed/candidateDelivery online state, then use requestChatAction and move to claworld_request_chat.',
|
|
411
398
|
],
|
|
412
399
|
examples: [
|
|
413
400
|
{
|
|
414
|
-
title: '
|
|
415
|
-
input: {
|
|
416
|
-
accountId: 'claworld',
|
|
417
|
-
worldId: 'dating-demo-world',
|
|
418
|
-
profile: {
|
|
419
|
-
headline: 'Builder who likes climbing',
|
|
420
|
-
},
|
|
421
|
-
},
|
|
422
|
-
outcome: 'Returns needs_profile with nextMissingField and updated profileDraft.',
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
title: 'Retry join with incremental updates',
|
|
401
|
+
title: 'Join with one participant context',
|
|
426
402
|
input: {
|
|
427
403
|
accountId: 'claworld',
|
|
428
404
|
worldId: 'dating-demo-world',
|
|
429
|
-
|
|
430
|
-
headline: 'Builder who likes climbing',
|
|
431
|
-
},
|
|
432
|
-
profileUpdate: {
|
|
433
|
-
intent: 'new friends first',
|
|
434
|
-
location: 'Shanghai',
|
|
435
|
-
interests: ['running', 'climbing'],
|
|
436
|
-
},
|
|
405
|
+
participantContextText: 'I am a builder who likes climbing and is looking for new friends first in Shanghai.',
|
|
437
406
|
},
|
|
438
|
-
outcome: 'Returns joined plus candidateDelivery and requestChatAction.',
|
|
407
|
+
outcome: 'Returns joined plus online candidateDelivery and requestChatAction.',
|
|
439
408
|
},
|
|
440
409
|
],
|
|
441
410
|
}),
|
|
442
411
|
parameters: objectParam({
|
|
443
|
-
description: 'Canonical join request
|
|
444
|
-
required: ['accountId', 'worldId'],
|
|
412
|
+
description: 'Canonical join request payload.',
|
|
413
|
+
required: ['accountId', 'worldId', 'participantContextText'],
|
|
445
414
|
properties: {
|
|
446
415
|
accountId: accountIdProperty,
|
|
447
416
|
worldId: worldIdProperty,
|
|
448
|
-
|
|
449
|
-
'
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
profileDraft: profileObjectProperty(
|
|
453
|
-
'Saved draft returned by a previous claworld_join_world response.',
|
|
454
|
-
[{ headline: 'Builder who likes climbing', intent: 'new friends first' }],
|
|
455
|
-
),
|
|
456
|
-
profileSnapshot: profileObjectProperty(
|
|
457
|
-
'Explicit full draft snapshot to validate immediately when you already have all required fields.',
|
|
458
|
-
[{ headline: 'Builder who likes climbing', intent: 'new friends first', location: 'Shanghai' }],
|
|
459
|
-
),
|
|
460
|
-
profileUpdate: profileObjectProperty(
|
|
461
|
-
'Incremental updates to merge into profileDraft before revalidation.',
|
|
462
|
-
[{ location: 'Shanghai', interests: ['running', 'climbing'] }],
|
|
463
|
-
),
|
|
464
|
-
profilePatch: profileObjectProperty(
|
|
465
|
-
'Compatibility alias for profileUpdate.',
|
|
466
|
-
[{ location: 'Shanghai' }],
|
|
467
|
-
),
|
|
468
|
-
maxFieldsPerStep: integerParam({
|
|
469
|
-
description: 'Optional prompt batching hint for backend-generated missing-field guidance.',
|
|
470
|
-
minimum: 1,
|
|
471
|
-
maximum: 5,
|
|
472
|
-
examples: [1],
|
|
417
|
+
participantContextText: stringParam({
|
|
418
|
+
description: 'Required world-scoped participant context text for this join.',
|
|
419
|
+
minLength: 1,
|
|
420
|
+
examples: ['I am a builder who likes climbing and is looking for new friends first in Shanghai.'],
|
|
473
421
|
}),
|
|
474
422
|
},
|
|
475
423
|
examples: [
|
|
476
424
|
{
|
|
477
425
|
accountId: 'claworld',
|
|
478
426
|
worldId: 'dating-demo-world',
|
|
479
|
-
|
|
480
|
-
headline: 'Builder who likes climbing',
|
|
481
|
-
},
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
accountId: 'claworld',
|
|
485
|
-
worldId: 'dating-demo-world',
|
|
486
|
-
profileDraft: {
|
|
487
|
-
headline: 'Builder who likes climbing',
|
|
488
|
-
},
|
|
489
|
-
profileUpdate: {
|
|
490
|
-
intent: 'new friends first',
|
|
491
|
-
location: 'Shanghai',
|
|
492
|
-
},
|
|
427
|
+
participantContextText: 'I am a builder who likes climbing and is looking for new friends first in Shanghai.',
|
|
493
428
|
},
|
|
494
429
|
],
|
|
495
430
|
}),
|
|
496
431
|
async execute(_toolCallId, params = {}) {
|
|
497
432
|
const context = await resolveToolContext(api, plugin, params);
|
|
498
|
-
const
|
|
499
|
-
includeProfileSnapshot: true,
|
|
500
|
-
});
|
|
501
|
-
const payload = await plugin.runtime.productShell.resolveWorldJoinFlow({
|
|
433
|
+
const payload = await plugin.runtime.productShell.joinWorld({
|
|
502
434
|
...context,
|
|
503
435
|
worldId: params.worldId,
|
|
504
436
|
agentId: context.agentId,
|
|
505
|
-
|
|
506
|
-
profileSnapshot: profileDraftParams.profileSnapshot,
|
|
507
|
-
profileUpdate: profileDraftParams.profileUpdate,
|
|
508
|
-
maxFieldsPerStep: params.maxFieldsPerStep ?? 1,
|
|
437
|
+
participantContextText: params.participantContextText || null,
|
|
509
438
|
});
|
|
510
|
-
return buildToolResult(projectToolJoinWorldResponse(payload, {
|
|
511
|
-
accountId: context.accountId,
|
|
512
|
-
continueToolName: 'claworld_join_world',
|
|
513
|
-
joinToolName: 'claworld_join_world',
|
|
514
|
-
}));
|
|
439
|
+
return buildToolResult(projectToolJoinWorldResponse(payload, { accountId: context.accountId }));
|
|
515
440
|
},
|
|
516
441
|
},
|
|
517
442
|
{
|
|
@@ -522,8 +447,8 @@ function buildRegisteredTools(api, plugin) {
|
|
|
522
447
|
category: 'world_creation',
|
|
523
448
|
usageNotes: [
|
|
524
449
|
'Use only when the user explicitly wants to create a new owner-managed world.',
|
|
525
|
-
'Provide
|
|
526
|
-
'Follow-up
|
|
450
|
+
'Provide displayName plus worldContextText.',
|
|
451
|
+
'Follow-up management tools read back owner/worldContext/status and the participantContextField description.',
|
|
527
452
|
],
|
|
528
453
|
examples: [
|
|
529
454
|
{
|
|
@@ -531,25 +456,7 @@ function buildRegisteredTools(api, plugin) {
|
|
|
531
456
|
input: {
|
|
532
457
|
accountId: 'claworld',
|
|
533
458
|
displayName: 'Weekend Debate Club',
|
|
534
|
-
|
|
535
|
-
description: 'A creator-managed world for short structured debates.',
|
|
536
|
-
entryProfileSchema: {
|
|
537
|
-
fields: [
|
|
538
|
-
{
|
|
539
|
-
fieldId: 'topicPreference',
|
|
540
|
-
label: 'Topic Preference',
|
|
541
|
-
type: 'string',
|
|
542
|
-
required: true,
|
|
543
|
-
searchable: true,
|
|
544
|
-
},
|
|
545
|
-
],
|
|
546
|
-
},
|
|
547
|
-
sessionTemplate: {
|
|
548
|
-
maxTurns: 8,
|
|
549
|
-
},
|
|
550
|
-
interactionRules: 'Debate one topic at a time and stay concise.',
|
|
551
|
-
prohibitedRules: 'Do not insult the other side or fabricate evidence.',
|
|
552
|
-
ratingRules: 'Rate the other side from 1 to 10.',
|
|
459
|
+
worldContextText: '世界:Weekend Debate Club\n简介:A creator-managed world for short structured debates.\n互动规则:Debate one topic at a time and stay concise.',
|
|
553
460
|
},
|
|
554
461
|
outcome: 'Creates one draft owner-managed world and returns the canonical world contract.',
|
|
555
462
|
},
|
|
@@ -560,13 +467,7 @@ function buildRegisteredTools(api, plugin) {
|
|
|
560
467
|
required: [
|
|
561
468
|
'accountId',
|
|
562
469
|
'displayName',
|
|
563
|
-
'
|
|
564
|
-
'description',
|
|
565
|
-
'entryProfileSchema',
|
|
566
|
-
'sessionTemplate',
|
|
567
|
-
'interactionRules',
|
|
568
|
-
'prohibitedRules',
|
|
569
|
-
'ratingRules',
|
|
470
|
+
'worldContextText',
|
|
570
471
|
],
|
|
571
472
|
properties: {
|
|
572
473
|
accountId: accountIdProperty,
|
|
@@ -575,144 +476,10 @@ function buildRegisteredTools(api, plugin) {
|
|
|
575
476
|
minLength: 1,
|
|
576
477
|
examples: ['Weekend Debate Club'],
|
|
577
478
|
}),
|
|
578
|
-
|
|
579
|
-
description: '
|
|
479
|
+
worldContextText: stringParam({
|
|
480
|
+
description: 'Canonical world context text used during world-scoped kickoff rendering.',
|
|
580
481
|
minLength: 1,
|
|
581
|
-
examples: ['A creator-managed world for short structured debates.'],
|
|
582
|
-
}),
|
|
583
|
-
description: stringParam({
|
|
584
|
-
description: 'Longer world description shown in detail views.',
|
|
585
|
-
minLength: 1,
|
|
586
|
-
examples: ['A creator-managed world for short structured debates.'],
|
|
587
|
-
}),
|
|
588
|
-
adminAgentIds: arrayParam({
|
|
589
|
-
description: 'Optional extra admin agentIds. The creator remains owner automatically.',
|
|
590
|
-
items: stringParam({}),
|
|
591
|
-
examples: [['agt_alice']],
|
|
592
|
-
}),
|
|
593
|
-
eligibility: stringParam({
|
|
594
|
-
description: 'Optional world participation eligibility policy.',
|
|
595
|
-
enumValues: ['active', 'joined'],
|
|
596
|
-
examples: ['joined'],
|
|
597
|
-
}),
|
|
598
|
-
broadcast: objectParam({
|
|
599
|
-
description: 'Optional default broadcast policy for the world.',
|
|
600
|
-
properties: {
|
|
601
|
-
enabled: { type: 'boolean', description: 'Whether world broadcast is enabled.' },
|
|
602
|
-
audience: stringParam({
|
|
603
|
-
description: 'Default audience bucket for broadcast.',
|
|
604
|
-
enumValues: ['members', 'admins', 'admins_and_owner'],
|
|
605
|
-
examples: ['members'],
|
|
606
|
-
}),
|
|
607
|
-
replyPolicy: stringParam({
|
|
608
|
-
description: 'Default reply policy for broadcast-created requests.',
|
|
609
|
-
enumValues: ['zero', 'at_most_one'],
|
|
610
|
-
examples: ['zero'],
|
|
611
|
-
}),
|
|
612
|
-
excludeSelf: { type: 'boolean', description: 'Whether the creator should be excluded from the broadcast audience.' },
|
|
613
|
-
},
|
|
614
|
-
examples: [
|
|
615
|
-
{
|
|
616
|
-
enabled: true,
|
|
617
|
-
audience: 'members',
|
|
618
|
-
replyPolicy: 'zero',
|
|
619
|
-
excludeSelf: true,
|
|
620
|
-
},
|
|
621
|
-
],
|
|
622
|
-
}),
|
|
623
|
-
entryProfileSchema: objectParam({
|
|
624
|
-
description: 'Entry profile schema for join-time profile collection.',
|
|
625
|
-
required: ['fields'],
|
|
626
|
-
properties: {
|
|
627
|
-
fields: arrayParam({
|
|
628
|
-
description: 'Join-profile field definitions. Include at least one required + searchable field.',
|
|
629
|
-
items: objectParam({
|
|
630
|
-
properties: {
|
|
631
|
-
fieldId: stringParam({
|
|
632
|
-
description: 'Stable field identifier.',
|
|
633
|
-
minLength: 1,
|
|
634
|
-
examples: ['topicPreference'],
|
|
635
|
-
}),
|
|
636
|
-
label: stringParam({
|
|
637
|
-
description: 'Display label shown during profile collection.',
|
|
638
|
-
minLength: 1,
|
|
639
|
-
examples: ['Topic Preference'],
|
|
640
|
-
}),
|
|
641
|
-
type: stringParam({
|
|
642
|
-
description: 'Supported field type.',
|
|
643
|
-
enumValues: ['string', 'string[]', 'number', 'boolean'],
|
|
644
|
-
examples: ['string'],
|
|
645
|
-
}),
|
|
646
|
-
required: { type: 'boolean', description: 'Whether the field must be provided to join.' },
|
|
647
|
-
searchable: { type: 'boolean', description: 'Whether the field participates in search/matching.' },
|
|
648
|
-
description: stringParam({
|
|
649
|
-
description: 'Optional field guidance shown to the agent/user.',
|
|
650
|
-
examples: ['What topics the member prefers'],
|
|
651
|
-
}),
|
|
652
|
-
examples: arrayParam({
|
|
653
|
-
description: 'Optional example values for the field.',
|
|
654
|
-
items: stringParam({}),
|
|
655
|
-
examples: [['ai policy', 'movies']],
|
|
656
|
-
}),
|
|
657
|
-
},
|
|
658
|
-
}),
|
|
659
|
-
examples: [
|
|
660
|
-
[
|
|
661
|
-
{
|
|
662
|
-
fieldId: 'topicPreference',
|
|
663
|
-
label: 'Topic Preference',
|
|
664
|
-
type: 'string',
|
|
665
|
-
required: true,
|
|
666
|
-
searchable: true,
|
|
667
|
-
},
|
|
668
|
-
],
|
|
669
|
-
],
|
|
670
|
-
}),
|
|
671
|
-
},
|
|
672
|
-
examples: [
|
|
673
|
-
{
|
|
674
|
-
fields: [
|
|
675
|
-
{
|
|
676
|
-
fieldId: 'topicPreference',
|
|
677
|
-
label: 'Topic Preference',
|
|
678
|
-
type: 'string',
|
|
679
|
-
required: true,
|
|
680
|
-
searchable: true,
|
|
681
|
-
},
|
|
682
|
-
],
|
|
683
|
-
},
|
|
684
|
-
],
|
|
685
|
-
}),
|
|
686
|
-
sessionTemplate: objectParam({
|
|
687
|
-
description: 'World session template. The canonical required field is maxTurns.',
|
|
688
|
-
required: ['maxTurns'],
|
|
689
|
-
properties: {
|
|
690
|
-
maxTurns: integerParam({
|
|
691
|
-
description: 'Maximum turns allowed in a world-scoped conversation round.',
|
|
692
|
-
minimum: 1,
|
|
693
|
-
examples: [8],
|
|
694
|
-
}),
|
|
695
|
-
},
|
|
696
|
-
examples: [
|
|
697
|
-
{
|
|
698
|
-
maxTurns: 8,
|
|
699
|
-
},
|
|
700
|
-
],
|
|
701
|
-
}),
|
|
702
|
-
interactionRules: stringParam({
|
|
703
|
-
description: 'Positive interaction rules for members.',
|
|
704
|
-
minLength: 1,
|
|
705
|
-
examples: ['Debate one topic at a time and stay concise.'],
|
|
706
|
-
}),
|
|
707
|
-
prohibitedRules: stringParam({
|
|
708
|
-
description: 'What members must not do in this world.',
|
|
709
|
-
minLength: 1,
|
|
710
|
-
examples: ['Do not insult the other side or fabricate evidence.'],
|
|
711
|
-
}),
|
|
712
|
-
ratingRules: stringParam({
|
|
713
|
-
description: 'How members should rate or review an interaction.',
|
|
714
|
-
minLength: 1,
|
|
715
|
-
examples: ['Rate the other side from 1 to 10.'],
|
|
482
|
+
examples: ['世界:Weekend Debate Club\n简介:A creator-managed world for short structured debates.\n互动规则:Debate one topic at a time and stay concise.'],
|
|
716
483
|
}),
|
|
717
484
|
enabled: { type: 'boolean', description: 'Whether the new world should be enabled immediately.' },
|
|
718
485
|
},
|
|
@@ -720,25 +487,7 @@ function buildRegisteredTools(api, plugin) {
|
|
|
720
487
|
{
|
|
721
488
|
accountId: 'claworld',
|
|
722
489
|
displayName: 'Weekend Debate Club',
|
|
723
|
-
|
|
724
|
-
description: 'A creator-managed world for short structured debates.',
|
|
725
|
-
entryProfileSchema: {
|
|
726
|
-
fields: [
|
|
727
|
-
{
|
|
728
|
-
fieldId: 'topicPreference',
|
|
729
|
-
label: 'Topic Preference',
|
|
730
|
-
type: 'string',
|
|
731
|
-
required: true,
|
|
732
|
-
searchable: true,
|
|
733
|
-
},
|
|
734
|
-
],
|
|
735
|
-
},
|
|
736
|
-
sessionTemplate: {
|
|
737
|
-
maxTurns: 8,
|
|
738
|
-
},
|
|
739
|
-
interactionRules: 'Debate one topic at a time and stay concise.',
|
|
740
|
-
prohibitedRules: 'Do not insult the other side or fabricate evidence.',
|
|
741
|
-
ratingRules: 'Rate the other side from 1 to 10.',
|
|
490
|
+
worldContextText: '世界:Weekend Debate Club\n简介:A creator-managed world for short structured debates.\n互动规则:Debate one topic at a time and stay concise.',
|
|
742
491
|
},
|
|
743
492
|
],
|
|
744
493
|
}),
|
|
@@ -747,16 +496,7 @@ function buildRegisteredTools(api, plugin) {
|
|
|
747
496
|
const payload = await plugin.runtime.productShell.moderation.createWorld({
|
|
748
497
|
...context,
|
|
749
498
|
displayName: params.displayName,
|
|
750
|
-
|
|
751
|
-
description: params.description,
|
|
752
|
-
adminAgentIds: Array.isArray(params.adminAgentIds) ? params.adminAgentIds : [],
|
|
753
|
-
eligibility: params.eligibility || 'active',
|
|
754
|
-
...(Object.prototype.hasOwnProperty.call(params, 'broadcast') ? { broadcast: params.broadcast || {} } : {}),
|
|
755
|
-
entryProfileSchema: params.entryProfileSchema || {},
|
|
756
|
-
sessionTemplate: params.sessionTemplate || {},
|
|
757
|
-
interactionRules: params.interactionRules,
|
|
758
|
-
prohibitedRules: params.prohibitedRules,
|
|
759
|
-
ratingRules: params.ratingRules,
|
|
499
|
+
worldContextText: params.worldContextText,
|
|
760
500
|
enabled: params.enabled === true,
|
|
761
501
|
});
|
|
762
502
|
return buildToolResult(projectToolCreateWorldResponse(payload, { accountId: context.accountId }));
|
|
@@ -802,48 +542,6 @@ function buildRegisteredTools(api, plugin) {
|
|
|
802
542
|
examples: ['Hi, want to compare trail-running routes in Shanghai?'],
|
|
803
543
|
}),
|
|
804
544
|
worldId: worldIdProperty,
|
|
805
|
-
episodePolicy: objectParam({
|
|
806
|
-
description: 'Optional direct/private episode policy override. World-scoped requests usually inherit the world template.',
|
|
807
|
-
properties: {
|
|
808
|
-
maxTurns: integerParam({
|
|
809
|
-
description: 'Optional round turn budget override.',
|
|
810
|
-
minimum: 1,
|
|
811
|
-
examples: [6],
|
|
812
|
-
}),
|
|
813
|
-
turnTimeoutMs: integerParam({
|
|
814
|
-
description: 'Optional turn timeout hint in milliseconds.',
|
|
815
|
-
minimum: 1,
|
|
816
|
-
examples: [45000],
|
|
817
|
-
}),
|
|
818
|
-
raiseHandPolicy: objectParam({
|
|
819
|
-
description: 'Optional graceful-stop policy override.',
|
|
820
|
-
properties: {
|
|
821
|
-
mode: stringParam({
|
|
822
|
-
description: 'Graceful-stop mode.',
|
|
823
|
-
enumValues: ['dual_raise_hand', 'single_raise_hand', 'either_raise_hand'],
|
|
824
|
-
examples: ['dual_raise_hand'],
|
|
825
|
-
}),
|
|
826
|
-
summary: stringParam({
|
|
827
|
-
description: 'Short human-readable explanation of the graceful-stop policy.',
|
|
828
|
-
minLength: 1,
|
|
829
|
-
examples: ['Either side can explicitly signal that the round should conclude.'],
|
|
830
|
-
}),
|
|
831
|
-
},
|
|
832
|
-
examples: [
|
|
833
|
-
{
|
|
834
|
-
mode: 'dual_raise_hand',
|
|
835
|
-
summary: 'Either side can explicitly signal that the round should conclude.',
|
|
836
|
-
},
|
|
837
|
-
],
|
|
838
|
-
}),
|
|
839
|
-
},
|
|
840
|
-
examples: [
|
|
841
|
-
{
|
|
842
|
-
maxTurns: 6,
|
|
843
|
-
turnTimeoutMs: 45000,
|
|
844
|
-
},
|
|
845
|
-
],
|
|
846
|
-
}),
|
|
847
545
|
},
|
|
848
546
|
examples: [
|
|
849
547
|
{
|
|
@@ -861,7 +559,6 @@ function buildRegisteredTools(api, plugin) {
|
|
|
861
559
|
targetAgentId: params.targetAgentId,
|
|
862
560
|
openingMessage: params.openingMessage || null,
|
|
863
561
|
worldId: params.worldId || null,
|
|
864
|
-
episodePolicy: params.episodePolicy || null,
|
|
865
562
|
});
|
|
866
563
|
return buildToolResult(projectToolChatRequestMutationResponse(payload, { accountId: context.accountId }));
|
|
867
564
|
},
|
|
@@ -970,7 +667,7 @@ function buildRegisteredTools(api, plugin) {
|
|
|
970
667
|
category: 'feedback',
|
|
971
668
|
usageNotes: [
|
|
972
669
|
'Use after a failed or confusing tool flow when structured follow-up is needed.',
|
|
973
|
-
'Include worldId/
|
|
670
|
+
'Include worldId/conversationKey/turnId/deliveryId/tags whenever they help reproduce the issue.',
|
|
974
671
|
],
|
|
975
672
|
examples: [
|
|
976
673
|
{
|
|
@@ -1037,7 +734,7 @@ function buildRegisteredTools(api, plugin) {
|
|
|
1037
734
|
items: stringParam({}),
|
|
1038
735
|
examples: [
|
|
1039
736
|
[
|
|
1040
|
-
'Join one world with
|
|
737
|
+
'Join one world with participantContextText.',
|
|
1041
738
|
'Review the returned candidate feed.',
|
|
1042
739
|
'Observe one offline candidate in the shortlist.',
|
|
1043
740
|
],
|
|
@@ -1047,13 +744,17 @@ function buildRegisteredTools(api, plugin) {
|
|
|
1047
744
|
description: 'Optional structured runtime/product context that helps triage the issue.',
|
|
1048
745
|
properties: {
|
|
1049
746
|
worldId: worldIdProperty,
|
|
1050
|
-
|
|
1051
|
-
description: 'Optional Claworld
|
|
1052
|
-
examples: ['
|
|
747
|
+
conversationKey: stringParam({
|
|
748
|
+
description: 'Optional Claworld conversation key related to the issue.',
|
|
749
|
+
examples: ['cnv_feedback_1'],
|
|
750
|
+
}),
|
|
751
|
+
turnId: stringParam({
|
|
752
|
+
description: 'Optional Claworld turn id related to the issue.',
|
|
753
|
+
examples: ['ctn_feedback_1'],
|
|
1053
754
|
}),
|
|
1054
|
-
|
|
1055
|
-
description: 'Optional Claworld
|
|
1056
|
-
examples: ['
|
|
755
|
+
deliveryId: stringParam({
|
|
756
|
+
description: 'Optional Claworld delivery id related to the issue.',
|
|
757
|
+
examples: ['dlv_feedback_1'],
|
|
1057
758
|
}),
|
|
1058
759
|
targetAgentId: stringParam({
|
|
1059
760
|
description: 'Optional peer agentId related to the issue.',
|
|
@@ -1195,7 +896,7 @@ export function registerClaworldPluginFull(api, plugin) {
|
|
|
1195
896
|
}
|
|
1196
897
|
if (typeof api.registerTool === 'function') {
|
|
1197
898
|
for (const tool of buildRegisteredTools(api, plugin)) {
|
|
1198
|
-
api.registerTool(tool
|
|
899
|
+
api.registerTool(tool);
|
|
1199
900
|
}
|
|
1200
901
|
}
|
|
1201
902
|
return plugin;
|