@xfxstudio/claworld 0.2.17 → 0.2.19

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.
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "name": "Claworld Persona Relay",
10
10
  "description": "Claworld relay world channel plugin for OpenClaw.",
11
- "version": "0.2.17",
11
+ "version": "0.2.19",
12
12
  "configSchema": {
13
13
  "type": "object",
14
14
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfxstudio/claworld",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "description": "Claworld channel plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -45,7 +45,6 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "openclaw": "2026.3.31",
49
48
  "ws": "^8.19.0"
50
49
  },
51
50
  "publishConfig": {
@@ -1020,60 +1020,6 @@ async function updateGlobalProfile({
1020
1020
  return result.body || {};
1021
1021
  }
1022
1022
 
1023
- async function renderAgentCard({
1024
- runtimeConfig,
1025
- agentId = null,
1026
- expiresInSeconds = null,
1027
- forceRegenerate = true,
1028
- fetchImpl,
1029
- }) {
1030
- const resolvedAgentId = normalizeClaworldText(
1031
- agentId,
1032
- normalizeClaworldText(runtimeConfig?.relay?.agentId, null),
1033
- );
1034
- if (!resolvedAgentId) {
1035
- throw createRuntimeBoundaryError({
1036
- code: 'tool_input_invalid',
1037
- category: 'input',
1038
- status: 400,
1039
- message: 'claworld profile card rendering requires agentId',
1040
- publicMessage: 'claworld profile card rendering requires agentId',
1041
- recoverable: true,
1042
- context: { field: 'agentId' },
1043
- });
1044
- }
1045
-
1046
- const baseUrl = normalizeRelayHttpBaseUrl(runtimeConfig.serverUrl);
1047
- const normalizedExpiresInSeconds = normalizeClaworldInteger(expiresInSeconds, null);
1048
- const result = await fetchJson(fetchImpl, `${baseUrl}/v1/agent-cards/render`, {
1049
- method: 'POST',
1050
- headers: {
1051
- 'content-type': 'application/json',
1052
- ...(runtimeConfig.apiKey ? { 'x-api-key': runtimeConfig.apiKey } : {}),
1053
- ...buildRuntimeAuthHeaders(runtimeConfig),
1054
- },
1055
- body: JSON.stringify({
1056
- agentId: resolvedAgentId,
1057
- forceRegenerate: forceRegenerate === true,
1058
- ...(normalizedExpiresInSeconds && normalizedExpiresInSeconds > 0
1059
- ? { expiresInSeconds: normalizedExpiresInSeconds }
1060
- : {}),
1061
- }),
1062
- });
1063
- if (!result.ok) {
1064
- createRelayRouteError({
1065
- result,
1066
- runtimeConfig,
1067
- code: 'agent_card_render_failed',
1068
- publicMessage: 'failed to generate public identity card',
1069
- context: {
1070
- agentId: resolvedAgentId,
1071
- },
1072
- });
1073
- }
1074
- return result.body || {};
1075
- }
1076
-
1077
1023
  async function fetchRelayAgents({ runtimeConfig, fetchImpl, logger }) {
1078
1024
  if (typeof fetchImpl !== 'function') {
1079
1025
  throw new Error('fetch is unavailable for relay agent lookup');
@@ -2451,13 +2397,14 @@ async function updateRuntimeProfile(context = {}) {
2451
2397
 
2452
2398
  async function generateRuntimeProfileCard(context = {}) {
2453
2399
  const resolvedContext = await resolveBoundRuntimeContext(context);
2454
- return renderAgentCard({
2400
+ const result = await fetchPublicIdentity({
2455
2401
  runtimeConfig: resolvedContext.runtimeConfig,
2456
2402
  agentId: context.agentId || resolvedContext.agentId || null,
2403
+ generateShareCard: true,
2457
2404
  expiresInSeconds: context.expiresInSeconds ?? null,
2458
- forceRegenerate: context.forceRegenerate !== false,
2459
2405
  fetchImpl,
2460
2406
  });
2407
+ return result?.shareCard || {};
2461
2408
  }
2462
2409
 
2463
2410
  return {
@@ -394,12 +394,11 @@ function projectToolPublicIdentity(payload = null) {
394
394
  }
395
395
 
396
396
  function projectToolShareCard(payload = null) {
397
- const card = payload?.card && typeof payload.card === 'object' ? payload.card : null;
398
- const imageUrl = normalizeText(card?.imageUrl, normalizeText(payload?.imageUrl, null));
399
- const downloadUrl = normalizeText(card?.downloadUrl, normalizeText(payload?.downloadUrl, imageUrl));
400
- const templateId = normalizeText(card?.templateId, normalizeText(payload?.templateId, null));
401
- const expiresAt = normalizeText(card?.expiresAt, normalizeText(payload?.expiresAt, null));
402
- const description = normalizeText(card?.description, normalizeText(payload?.description, null));
397
+ const imageUrl = normalizeText(payload?.imageUrl, null);
398
+ const downloadUrl = normalizeText(payload?.downloadUrl, imageUrl);
399
+ const templateId = normalizeText(payload?.templateId, null);
400
+ const expiresAt = normalizeText(payload?.expiresAt, null);
401
+ const description = normalizeText(payload?.description, null);
403
402
  if (!imageUrl && !downloadUrl && !templateId && !expiresAt && !description) {
404
403
  return {
405
404
  status: normalizeText(payload?.status, 'unavailable'),
@@ -459,7 +459,7 @@ export class ClaworldRelayClient extends EventEmitter {
459
459
  config,
460
460
  agentId,
461
461
  credential = null,
462
- clientVersion = 'claworld-plugin/0.2.17',
462
+ clientVersion = 'claworld-plugin/0.2.19',
463
463
  sessionTarget,
464
464
  fallbackTarget,
465
465
  } = {}) {