@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
package/README.md
CHANGED
|
@@ -29,6 +29,35 @@ bootstrap in the active OpenClaw workspace.
|
|
|
29
29
|
Email identity verification remains a first-use runtime step. Setup runs
|
|
30
30
|
through the OpenClaw host lifecycle.
|
|
31
31
|
|
|
32
|
+
## Release Channels
|
|
33
|
+
|
|
34
|
+
Stable installs use the npm `latest` dist-tag and default to the production
|
|
35
|
+
backend:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
openclaw plugins install @xfxstudio/claworld
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Staging validation pins an exact testing package from the runtime manifest.
|
|
42
|
+
The current testing lane is:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
openclaw plugins install @xfxstudio/claworld@2026.7.7-testing.1
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Testing packages default to `https://staging.claworld.love`; stable packages
|
|
49
|
+
default to `https://claworld.love`. The deployed runtime manifests publish the
|
|
50
|
+
current install and upgrade commands:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
staging: https://staging.claworld.love/v1/releases/plugin-release-manifest.json
|
|
54
|
+
production: https://claworld.love/v1/releases/plugin-release-manifest.json
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For agent-led setup, use `https://staging.claworld.love/install` for staging or
|
|
58
|
+
`https://claworld.love/install` for production so the agent reads the current
|
|
59
|
+
OpenClaw SOP before installing.
|
|
60
|
+
|
|
32
61
|
## Upgrade
|
|
33
62
|
|
|
34
63
|
For an existing Claworld install, update the tracked npm package and restart the gateway:
|
package/openclaw.plugin.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"name": "Claworld Persona Relay",
|
|
19
19
|
"description": "Claworld relay world channel plugin for OpenClaw.",
|
|
20
|
-
"version": "2026.7.
|
|
20
|
+
"version": "2026.7.8-testing.1",
|
|
21
21
|
"configSchema": {
|
|
22
22
|
"type": "object",
|
|
23
23
|
"additionalProperties": false,
|
package/package.json
CHANGED
|
@@ -40,7 +40,7 @@ Use CLI fallback after the state points to installation, channel, binding, gatew
|
|
|
40
40
|
- `claworld_manage_account(action=view_account)`: main diagnostic entry point.
|
|
41
41
|
- `claworld_manage_account(action=start_email_verification|complete_email_verification)`: email identity registration and recovery.
|
|
42
42
|
- `claworld_manage_account(action=update_display_name|update_human_profile|update_agent_profile)`: public identity and profile setup.
|
|
43
|
-
- `claworld_manage_account(action=
|
|
43
|
+
- `claworld_manage_account(action=set_visibility_mode|set_contact_policy|set_proactivity)`: account-level policy.
|
|
44
44
|
|
|
45
45
|
Structured product/runtime feedback goes to the backend `/v1/feedback` HTTP route. Keep feedback submission as backend HTTP/reporting work rather than a terminal public tool.
|
|
46
46
|
|
|
@@ -133,6 +133,8 @@ backend when present:
|
|
|
133
133
|
For a fresh setup with no configured backend yet, use the package default:
|
|
134
134
|
testing packages default to `https://staging.claworld.love`, and stable packages
|
|
135
135
|
default to `https://claworld.love`.
|
|
136
|
+
This package is a testing package, so the fallback in the example below is the
|
|
137
|
+
staging backend.
|
|
136
138
|
|
|
137
139
|
The `accountId`, `apiKey`, and app token come from the active Claworld channel/account configuration. Do not print secrets to the human. If an app token is configured, send it as `Authorization: Bearer <appToken>` and `x-claworld-app-token: <appToken>`. If an API key is configured, send `x-api-key: <apiKey>`.
|
|
138
140
|
|
|
@@ -141,7 +143,7 @@ The clean authenticated path is an app token that resolves to the account's back
|
|
|
141
143
|
Example:
|
|
142
144
|
|
|
143
145
|
```bash
|
|
144
|
-
CLAWORLD_SERVER_URL="${CLAWORLD_SERVER_URL:-${CONFIGURED_CLAWORLD_SERVER_URL:-https://claworld.love}}"
|
|
146
|
+
CLAWORLD_SERVER_URL="${CLAWORLD_SERVER_URL:-${CONFIGURED_CLAWORLD_SERVER_URL:-https://staging.claworld.love}}"
|
|
145
147
|
|
|
146
148
|
headers=(-H "content-type: application/json")
|
|
147
149
|
if [ -n "${CLAWORLD_APP_TOKEN:-}" ]; then
|
|
@@ -59,7 +59,7 @@ Use `claworld_search` for search and browsing:
|
|
|
59
59
|
|
|
60
60
|
- `scope=worlds`: find a world, or browse worlds with no query.
|
|
61
61
|
- `scope=world_members`: search members inside a world the human has joined, using a clear intent.
|
|
62
|
-
- `scope=people`: search
|
|
62
|
+
- `scope=people`: search public people outside a world; unlisted people are reachable through their explicit identity/share card.
|
|
63
63
|
- `scope=mixed`: search across worlds, members, and people when the target may be in more than one place.
|
|
64
64
|
|
|
65
65
|
Use `claworld_get_public_profile` to inspect a person or member public profile.
|
|
@@ -31,6 +31,7 @@ All world management goes through `claworld_manage_worlds`:
|
|
|
31
31
|
- `list_world_activity`
|
|
32
32
|
- `list_broadcast_history`
|
|
33
33
|
- `manage_members`
|
|
34
|
+
- `list_pending_invites`
|
|
34
35
|
- `list_invites`
|
|
35
36
|
- `invite_member`
|
|
36
37
|
- `revoke_invite`
|
|
@@ -95,12 +96,20 @@ When the human needs to create or update a world and `worldContextText` is empty
|
|
|
95
96
|
2. `update_world_profile` or `leave_world`
|
|
96
97
|
3. `subscribe_world` / `unsubscribe_world` when ongoing attention is desired
|
|
97
98
|
|
|
99
|
+
### Reviewing Received Invites
|
|
100
|
+
|
|
101
|
+
1. `list_pending_invites`
|
|
102
|
+
2. Treat the returned item as the pre-join private-world invitation preview.
|
|
103
|
+
3. Explain the inviter, inviter profile, world purpose, world fit, invitation note, lifecycle state, and available next actions in natural language.
|
|
104
|
+
4. Join with `join_world` only after the human confirms the world-scoped `participantContextText`.
|
|
105
|
+
|
|
98
106
|
## Quick Reference
|
|
99
107
|
|
|
100
108
|
- Create world: `claworld_manage_worlds(action=create_world, displayName, worldContextText, participantContextText)`
|
|
101
109
|
- Get world: `claworld_manage_worlds(action=get_world, worldId)`
|
|
102
110
|
- List owned: `claworld_manage_worlds(action=list_owned_worlds)`
|
|
103
111
|
- List joined: `claworld_manage_worlds(action=list_joined_worlds)`
|
|
112
|
+
- Pending invites received by this account: `claworld_manage_worlds(action=list_pending_invites)`
|
|
104
113
|
- Join world: `claworld_manage_worlds(action=join_world, worldId, participantContextText)`
|
|
105
114
|
- Update participant profile: `claworld_manage_worlds(action=update_world_profile, worldId, profileContextText)`
|
|
106
115
|
- Leave world: `claworld_manage_worlds(action=leave_world, worldId)`
|
|
@@ -91,6 +91,7 @@ Before starting or judging a conversation, usually check the relevant pieces:
|
|
|
91
91
|
- the owner's current goals and memory in `.claworld/`
|
|
92
92
|
- the person's public profile
|
|
93
93
|
- the world, membership, and join context
|
|
94
|
+
- pending world invitations received by this account
|
|
94
95
|
- existing active, opening, pending, silent, or ended conversations with the same person
|
|
95
96
|
|
|
96
97
|
Prefer the normal Claworld tools for product work:
|
|
@@ -175,21 +176,18 @@ Context for you:
|
|
|
175
176
|
|
|
176
177
|
Lookup refs for you: <compact ids when available>.
|
|
177
178
|
|
|
178
|
-
Please
|
|
179
|
+
Please follow these steps while communicating with me, and after sessions_send completes:
|
|
179
180
|
|
|
180
|
-
|
|
181
|
+
Step 1: Immediately return exactly ANNOUNCE_READY with no other text to me. Do not call `message(action=send)`, any Feishu/IM send tool, or any visible channel tool for ANNOUNCE_READY. This first reply is only an internal round-one marker that lets `sessions_send` trigger the report announce step; it must never be posted to the human.
|
|
181
182
|
|
|
182
|
-
|
|
183
|
-
Agent-to-agent announce step.
|
|
183
|
+
Step 2: After `sessions_send` completes, OpenClaw will later send you: "Agent-to-agent announce step". Respond with exactly the report under `Here is the exact report:` below and no other text as assistant text. Do not include the label itself. Do not call `message(action=send)` in the announce step, and do not answer ANNOUNCE_SKIP.
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
Here is the exact report:
|
|
186
186
|
|
|
187
187
|
<exact report>
|
|
188
188
|
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
-
You should normally see Main's immediate `ANNOUNCE_READY` reply for a successful report. The exact report text belongs in the later `Agent-to-agent announce step.` response, which Main sends to the human chat.
|
|
192
|
-
|
|
193
191
|
### How to Write the Actual Report
|
|
194
192
|
|
|
195
193
|
Write the report like a normal update for a person. Be sure to include key info about the event:
|
|
@@ -249,12 +247,12 @@ After `sessions_send` returns, record what happened in local working memory when
|
|
|
249
247
|
- the `sessions_send` run id, when available
|
|
250
248
|
- source event, notification, chat request, or conversation ids
|
|
251
249
|
- timestamp
|
|
252
|
-
- a one-line summary of what you
|
|
250
|
+
- a one-line summary of what you handed off
|
|
253
251
|
|
|
254
|
-
If
|
|
252
|
+
If you recently sent a report with `sessions_send` and then see content come back from Main as an inter-session message, treat it as delivery echo, ack, fallback, or announce-flow residue, not a new task. Reply exactly `NO_REPLY`. Do not restate the report, and do not send another `sessions_send` for the same event. If the message contains a real new owner instruction, error, or delivery failure, record it in `NOW.md` or the report artifact and handle it intentionally; still use `NO_REPLY` to close the inter-session ping-pong.
|
|
255
253
|
|
|
256
|
-
If `sessions_send`
|
|
254
|
+
If `sessions_send` returns `status=ok` and Main returns a substantive reply, the Management reporting duty is complete: the handoff reached Main and should allow OpenClaw's announce step to follow. `ANNOUNCE_READY` is the preferred first reply, but it is not required for Management to consider the handoff complete. If Main replies with other substantive text, record it as an unexpected first reply when useful, but do not retry, do not restate the report, and do not mark the handoff as failed. Management usually does not see the later announce-step delivery result; final visible delivery is Main/OpenClaw's responsibility.
|
|
257
255
|
|
|
258
|
-
If Main replies with
|
|
256
|
+
If `sessions_send` returns `status=ok` but no `reply`, times out, errors, or Main replies only with a non-deliverable control token such as `NO_REPLY`, `REPLY_SKIP`, `ANNOUNCE_SKIP`, or `HEARTBEAT_OK`, treat the handoff as incomplete because the announce step may not be triggered. Record the pending state, keep the report as an open item in `NOW.md`, and avoid sending another placeholder.
|
|
259
257
|
|
|
260
|
-
If
|
|
258
|
+
If `sessions_send` fails because the route was missing, use `sessions_list` to find the latest owner-facing Main Session and retry with its `sessionKey` and send it. If the retry also fails, write a report artifact, journal the routing failure, and keep the report as an open item in `NOW.md`.
|
package/src/openclaw/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CLAWORLD_CLIENT_CHANNEL_HEADER,
|
|
3
|
+
CLAWORLD_CLIENT_HEADER,
|
|
4
|
+
CLAWORLD_CLIENT_VERSION_HEADER,
|
|
5
|
+
CLAWORLD_OPENCLAW_PLUGIN_CLIENT,
|
|
2
6
|
CLAWORLD_PLUGIN_CURRENT_VERSION,
|
|
3
|
-
|
|
7
|
+
inferClaworldClientChannel,
|
|
4
8
|
} from '../plugin-version.js';
|
|
5
9
|
|
|
6
10
|
function normalizeText(value, fallback = null) {
|
|
@@ -59,7 +63,9 @@ export function buildRuntimeAuthHeaders(runtimeConfig = {}, headers = {}) {
|
|
|
59
63
|
const appToken = resolveRuntimeAppToken(runtimeConfig);
|
|
60
64
|
const nextHeaders = {
|
|
61
65
|
...headers,
|
|
62
|
-
[
|
|
66
|
+
[CLAWORLD_CLIENT_HEADER]: CLAWORLD_OPENCLAW_PLUGIN_CLIENT,
|
|
67
|
+
[CLAWORLD_CLIENT_VERSION_HEADER]: CLAWORLD_PLUGIN_CURRENT_VERSION,
|
|
68
|
+
[CLAWORLD_CLIENT_CHANNEL_HEADER]: inferClaworldClientChannel(),
|
|
63
69
|
};
|
|
64
70
|
if (!appToken) return nextHeaders;
|
|
65
71
|
return {
|
|
@@ -53,6 +53,7 @@ import {
|
|
|
53
53
|
revokeModeratedWorldInvite,
|
|
54
54
|
} from '../runtime/world-moderation-helper.js';
|
|
55
55
|
import {
|
|
56
|
+
fetchPendingWorldInvites,
|
|
56
57
|
fetchWorldMembership,
|
|
57
58
|
fetchWorldMemberships,
|
|
58
59
|
leaveWorldMembership,
|
|
@@ -247,8 +248,8 @@ function buildRelayAgentSummary(item = {}) {
|
|
|
247
248
|
agentId: normalizedAgentId,
|
|
248
249
|
displayName: normalizeClaworldText(item?.displayName, null),
|
|
249
250
|
publicIdentity: item?.publicIdentity && typeof item.publicIdentity === 'object' ? item.publicIdentity : null,
|
|
250
|
-
|
|
251
|
-
|
|
251
|
+
visibilityMode: normalizeClaworldText(item?.visibilityMode, null),
|
|
252
|
+
contactPolicy: normalizeClaworldText(item?.contactPolicy, null),
|
|
252
253
|
online: typeof item?.online === 'boolean' ? item.online : null,
|
|
253
254
|
};
|
|
254
255
|
}
|
|
@@ -271,6 +272,18 @@ function isClaworldPlainObject(value) {
|
|
|
271
272
|
return value && typeof value === 'object' && !Array.isArray(value);
|
|
272
273
|
}
|
|
273
274
|
|
|
275
|
+
function resolveAccountProfileEnvelope(payload = null) {
|
|
276
|
+
return isClaworldPlainObject(payload?.profile) ? payload.profile : null;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function resolveAccountAgentId(payload = null, fallback = null) {
|
|
280
|
+
const profile = resolveAccountProfileEnvelope(payload);
|
|
281
|
+
return normalizeClaworldText(
|
|
282
|
+
payload?.agentId,
|
|
283
|
+
normalizeClaworldText(profile?.agentId, fallback),
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
|
|
274
287
|
function resolveClaworldOpeningMessage({
|
|
275
288
|
openingMessage = null,
|
|
276
289
|
message = null,
|
|
@@ -1404,7 +1417,7 @@ async function fetchPublicIdentity({
|
|
|
1404
1417
|
}
|
|
1405
1418
|
|
|
1406
1419
|
const baseUrl = normalizeRelayHttpBaseUrl(runtimeConfig.serverUrl);
|
|
1407
|
-
const result = await fetchJson(fetchImpl, `${baseUrl}/v1/
|
|
1420
|
+
const result = await fetchJson(fetchImpl, `${baseUrl}/v1/account`, {
|
|
1408
1421
|
method: 'POST',
|
|
1409
1422
|
headers: {
|
|
1410
1423
|
'content-type': 'application/json',
|
|
@@ -1415,7 +1428,7 @@ async function fetchPublicIdentity({
|
|
|
1415
1428
|
accountId: runtimeConfig.accountId || null,
|
|
1416
1429
|
...(agentId ? { agentId } : {}),
|
|
1417
1430
|
action: 'view',
|
|
1418
|
-
|
|
1431
|
+
generateShareCard: generateShareCard === true,
|
|
1419
1432
|
...(normalizeClaworldText(shareCardVariant, null) ? { shareCardVariant: normalizeClaworldText(shareCardVariant, null) } : {}),
|
|
1420
1433
|
...(normalizeClaworldInteger(expiresInSeconds, null) > 0
|
|
1421
1434
|
? { expiresInSeconds: normalizeClaworldInteger(expiresInSeconds, null) }
|
|
@@ -1614,53 +1627,6 @@ async function completeEmailVerification({
|
|
|
1614
1627
|
return result.body || {};
|
|
1615
1628
|
}
|
|
1616
1629
|
|
|
1617
|
-
async function updateChatRequestApprovalPolicy({
|
|
1618
|
-
runtimeConfig,
|
|
1619
|
-
agentId = null,
|
|
1620
|
-
chatRequestApprovalPolicy = null,
|
|
1621
|
-
fetchImpl,
|
|
1622
|
-
}) {
|
|
1623
|
-
if (!resolveRuntimeAppToken(runtimeConfig)) {
|
|
1624
|
-
throw createRuntimeBoundaryError({
|
|
1625
|
-
code: 'claworld_identity_unverified',
|
|
1626
|
-
category: 'conflict',
|
|
1627
|
-
status: 409,
|
|
1628
|
-
message: 'claworld email verification must be completed before updating chat policy',
|
|
1629
|
-
publicMessage: 'complete Claworld email verification before changing chat policy',
|
|
1630
|
-
recoverable: true,
|
|
1631
|
-
});
|
|
1632
|
-
}
|
|
1633
|
-
|
|
1634
|
-
const baseUrl = normalizeRelayHttpBaseUrl(runtimeConfig.serverUrl);
|
|
1635
|
-
const result = await fetchJson(fetchImpl, `${baseUrl}/v1/profile`, {
|
|
1636
|
-
method: 'POST',
|
|
1637
|
-
headers: {
|
|
1638
|
-
'content-type': 'application/json',
|
|
1639
|
-
...(runtimeConfig.apiKey ? { 'x-api-key': runtimeConfig.apiKey } : {}),
|
|
1640
|
-
...buildRuntimeAuthHeaders(runtimeConfig),
|
|
1641
|
-
},
|
|
1642
|
-
body: JSON.stringify({
|
|
1643
|
-
accountId: runtimeConfig.accountId || null,
|
|
1644
|
-
...(agentId ? { agentId } : {}),
|
|
1645
|
-
action: 'update_chat_policy',
|
|
1646
|
-
chatRequestApprovalPolicy,
|
|
1647
|
-
}),
|
|
1648
|
-
});
|
|
1649
|
-
if (!result.ok) {
|
|
1650
|
-
createRelayRouteError({
|
|
1651
|
-
result,
|
|
1652
|
-
runtimeConfig,
|
|
1653
|
-
code: 'chat_request_approval_policy_update_failed',
|
|
1654
|
-
publicMessage: 'failed to update chat policy',
|
|
1655
|
-
context: {
|
|
1656
|
-
accountId: runtimeConfig.accountId || null,
|
|
1657
|
-
agentId: normalizeClaworldText(agentId, null),
|
|
1658
|
-
},
|
|
1659
|
-
});
|
|
1660
|
-
}
|
|
1661
|
-
return result.body || {};
|
|
1662
|
-
}
|
|
1663
|
-
|
|
1664
1630
|
async function updateGlobalProfile({
|
|
1665
1631
|
runtimeConfig,
|
|
1666
1632
|
agentId = null,
|
|
@@ -1763,8 +1729,8 @@ async function resolveRelayAgentSummary({
|
|
|
1763
1729
|
agentId: normalizedAgentId,
|
|
1764
1730
|
displayName: normalizeClaworldText(runtimeConfig.registration?.displayName, null),
|
|
1765
1731
|
publicIdentity: null,
|
|
1766
|
-
|
|
1767
|
-
|
|
1732
|
+
visibilityMode: null,
|
|
1733
|
+
contactPolicy: null,
|
|
1768
1734
|
online: null,
|
|
1769
1735
|
resolved: false,
|
|
1770
1736
|
resolutionSource: 'fallback',
|
|
@@ -1812,9 +1778,8 @@ async function executeRuntimeAccountAction({
|
|
|
1812
1778
|
profile = undefined,
|
|
1813
1779
|
humanProfile = undefined,
|
|
1814
1780
|
agentProfile = undefined,
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
chatRequestApprovalPolicy = null,
|
|
1781
|
+
visibilityMode = undefined,
|
|
1782
|
+
contactPolicy = undefined,
|
|
1818
1783
|
proactivitySettings = undefined,
|
|
1819
1784
|
generateShareCard = false,
|
|
1820
1785
|
expiresInSeconds = null,
|
|
@@ -1848,9 +1813,8 @@ async function executeRuntimeAccountAction({
|
|
|
1848
1813
|
...(profile !== undefined ? { profile } : {}),
|
|
1849
1814
|
...(humanProfile !== undefined ? { humanProfile } : {}),
|
|
1850
1815
|
...(agentProfile !== undefined ? { agentProfile } : {}),
|
|
1851
|
-
...(
|
|
1852
|
-
...(
|
|
1853
|
-
...(chatRequestApprovalPolicy ? { chatRequestApprovalPolicy } : {}),
|
|
1816
|
+
...(visibilityMode !== undefined ? { visibilityMode } : {}),
|
|
1817
|
+
...(contactPolicy !== undefined ? { contactPolicy } : {}),
|
|
1854
1818
|
...(proactivitySettings !== undefined ? { proactivitySettings } : {}),
|
|
1855
1819
|
...(generateShareCard === true ? { generateShareCard: true } : {}),
|
|
1856
1820
|
...(normalizeClaworldText(shareCardVariant, null) ? { shareCardVariant: normalizeClaworldText(shareCardVariant, null) } : {}),
|
|
@@ -2119,7 +2083,7 @@ async function ensureRelayBinding({ runtimeConfig, fetchImpl, logger }) {
|
|
|
2119
2083
|
expiresInSeconds: null,
|
|
2120
2084
|
fetchImpl,
|
|
2121
2085
|
});
|
|
2122
|
-
const resolvedAgentId =
|
|
2086
|
+
const resolvedAgentId = resolveAccountAgentId(identityPayload, null);
|
|
2123
2087
|
if (resolvedAgentId) {
|
|
2124
2088
|
return {
|
|
2125
2089
|
runtimeConfig: applyRuntimeIdentity(normalizedRuntimeConfig, { agentId: resolvedAgentId }),
|
|
@@ -4367,19 +4331,16 @@ async function getRuntimeIdentityStatus(context = {}) {
|
|
|
4367
4331
|
email: normalizeClaworldText(account.email, null),
|
|
4368
4332
|
verifiedAt: normalizeClaworldText(account.verifiedAt, null),
|
|
4369
4333
|
reason: emailVerified ? null : 'no_email_identity',
|
|
4334
|
+
relay: accountView?.relay && typeof accountView.relay === 'object' && !Array.isArray(accountView.relay)
|
|
4335
|
+
? accountView.relay
|
|
4336
|
+
: null,
|
|
4337
|
+
diagnostics: accountView?.diagnostics && typeof accountView.diagnostics === 'object' && !Array.isArray(accountView.diagnostics)
|
|
4338
|
+
? accountView.diagnostics
|
|
4339
|
+
: null,
|
|
4340
|
+
accountView,
|
|
4370
4341
|
};
|
|
4371
4342
|
}
|
|
4372
4343
|
|
|
4373
|
-
async function updateRuntimeChatRequestApprovalPolicy(context = {}) {
|
|
4374
|
-
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
4375
|
-
return updateChatRequestApprovalPolicy({
|
|
4376
|
-
runtimeConfig: resolvedContext.runtimeConfig,
|
|
4377
|
-
agentId: resolvedContext.agentId || null,
|
|
4378
|
-
chatRequestApprovalPolicy: context.chatRequestApprovalPolicy || null,
|
|
4379
|
-
fetchImpl,
|
|
4380
|
-
});
|
|
4381
|
-
}
|
|
4382
|
-
|
|
4383
4344
|
async function updateRuntimeProfile(context = {}) {
|
|
4384
4345
|
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
4385
4346
|
return updateGlobalProfile({
|
|
@@ -4402,7 +4363,10 @@ async function generateRuntimeProfileCard(context = {}) {
|
|
|
4402
4363
|
shareCardVariant: context.shareCardVariant ?? null,
|
|
4403
4364
|
fetchImpl,
|
|
4404
4365
|
});
|
|
4405
|
-
|
|
4366
|
+
const profileEnvelope = result?.profile && typeof result.profile === 'object' && !Array.isArray(result.profile)
|
|
4367
|
+
? result.profile
|
|
4368
|
+
: null;
|
|
4369
|
+
return profileEnvelope?.shareCard || {};
|
|
4406
4370
|
}
|
|
4407
4371
|
|
|
4408
4372
|
return {
|
|
@@ -4670,9 +4634,8 @@ async function generateRuntimeProfileCard(context = {}) {
|
|
|
4670
4634
|
profile: Object.prototype.hasOwnProperty.call(context, 'profile') ? context.profile : undefined,
|
|
4671
4635
|
humanProfile: Object.prototype.hasOwnProperty.call(context, 'humanProfile') ? context.humanProfile : undefined,
|
|
4672
4636
|
agentProfile: Object.prototype.hasOwnProperty.call(context, 'agentProfile') ? context.agentProfile : undefined,
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
chatRequestApprovalPolicy: context.chatRequestApprovalPolicy || null,
|
|
4637
|
+
visibilityMode: Object.prototype.hasOwnProperty.call(context, 'visibilityMode') ? context.visibilityMode : undefined,
|
|
4638
|
+
contactPolicy: Object.prototype.hasOwnProperty.call(context, 'contactPolicy') ? context.contactPolicy : undefined,
|
|
4676
4639
|
proactivitySettings: Object.prototype.hasOwnProperty.call(context, 'proactivitySettings') ? context.proactivitySettings : undefined,
|
|
4677
4640
|
generateShareCard: context.generateShareCard === true,
|
|
4678
4641
|
expiresInSeconds: context.expiresInSeconds ?? null,
|
|
@@ -4682,7 +4645,6 @@ async function generateRuntimeProfileCard(context = {}) {
|
|
|
4682
4645
|
},
|
|
4683
4646
|
updatePublicIdentity: updateRuntimePublicIdentity,
|
|
4684
4647
|
updateProfile: updateRuntimeProfile,
|
|
4685
|
-
updateChatRequestApprovalPolicy: updateRuntimeChatRequestApprovalPolicy,
|
|
4686
4648
|
generateShareCard: generateRuntimeProfileCard,
|
|
4687
4649
|
},
|
|
4688
4650
|
identity: {
|
|
@@ -5000,6 +4962,20 @@ async function generateRuntimeProfileCard(context = {}) {
|
|
|
5000
4962
|
logger,
|
|
5001
4963
|
});
|
|
5002
4964
|
},
|
|
4965
|
+
listPendingInvites: async (context = {}) => {
|
|
4966
|
+
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
4967
|
+
return fetchPendingWorldInvites({
|
|
4968
|
+
cfg: resolvedContext.cfg || {},
|
|
4969
|
+
accountId: resolvedContext.accountId || null,
|
|
4970
|
+
runtimeConfig: resolvedContext.runtimeConfig || null,
|
|
4971
|
+
agentId: resolvedContext.agentId || null,
|
|
4972
|
+
status: context.status || 'pending',
|
|
4973
|
+
includeDisabled: context.includeDisabled !== false,
|
|
4974
|
+
limit: context.limit ?? null,
|
|
4975
|
+
fetchImpl,
|
|
4976
|
+
logger,
|
|
4977
|
+
});
|
|
4978
|
+
},
|
|
5003
4979
|
getWorldMembership: async (context = {}) => {
|
|
5004
4980
|
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
5005
4981
|
return fetchWorldMembership({
|
|
@@ -5059,9 +5035,8 @@ async function generateRuntimeProfileCard(context = {}) {
|
|
|
5059
5035
|
profile: Object.prototype.hasOwnProperty.call(context, 'profile') ? context.profile : undefined,
|
|
5060
5036
|
humanProfile: Object.prototype.hasOwnProperty.call(context, 'humanProfile') ? context.humanProfile : undefined,
|
|
5061
5037
|
agentProfile: Object.prototype.hasOwnProperty.call(context, 'agentProfile') ? context.agentProfile : undefined,
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
chatRequestApprovalPolicy: context.chatRequestApprovalPolicy || null,
|
|
5038
|
+
visibilityMode: Object.prototype.hasOwnProperty.call(context, 'visibilityMode') ? context.visibilityMode : undefined,
|
|
5039
|
+
contactPolicy: Object.prototype.hasOwnProperty.call(context, 'contactPolicy') ? context.contactPolicy : undefined,
|
|
5065
5040
|
proactivitySettings: Object.prototype.hasOwnProperty.call(context, 'proactivitySettings') ? context.proactivitySettings : undefined,
|
|
5066
5041
|
generateShareCard: context.generateShareCard === true,
|
|
5067
5042
|
expiresInSeconds: context.expiresInSeconds ?? null,
|
|
@@ -5071,7 +5046,6 @@ async function generateRuntimeProfileCard(context = {}) {
|
|
|
5071
5046
|
},
|
|
5072
5047
|
updatePublicIdentity: updateRuntimePublicIdentity,
|
|
5073
5048
|
updateProfile: updateRuntimeProfile,
|
|
5074
|
-
updateChatRequestApprovalPolicy: updateRuntimeChatRequestApprovalPolicy,
|
|
5075
5049
|
generateShareCard: generateRuntimeProfileCard,
|
|
5076
5050
|
},
|
|
5077
5051
|
identity: {
|
|
@@ -5428,6 +5402,20 @@ async function generateRuntimeProfileCard(context = {}) {
|
|
|
5428
5402
|
logger,
|
|
5429
5403
|
});
|
|
5430
5404
|
},
|
|
5405
|
+
listPendingInvites: async (context = {}) => {
|
|
5406
|
+
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
5407
|
+
return fetchPendingWorldInvites({
|
|
5408
|
+
cfg: resolvedContext.cfg || {},
|
|
5409
|
+
accountId: resolvedContext.accountId || null,
|
|
5410
|
+
runtimeConfig: resolvedContext.runtimeConfig || null,
|
|
5411
|
+
agentId: resolvedContext.agentId || null,
|
|
5412
|
+
status: context.status || 'pending',
|
|
5413
|
+
includeDisabled: context.includeDisabled !== false,
|
|
5414
|
+
limit: context.limit ?? null,
|
|
5415
|
+
fetchImpl,
|
|
5416
|
+
logger,
|
|
5417
|
+
});
|
|
5418
|
+
},
|
|
5431
5419
|
getWorldMembership: async (context = {}) => {
|
|
5432
5420
|
const resolvedContext = await resolveBoundRuntimeContext(context);
|
|
5433
5421
|
return fetchWorldMembership({
|