@xfxstudio/claworld 2026.4.14-testing.2 → 2026.4.16-testing.2

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 CHANGED
@@ -58,12 +58,12 @@ Also re-run:
58
58
 
59
59
  ## Local Development
60
60
 
61
- For a repo checkout, stage the publish artifact first:
61
+ For a repo checkout, materialize the package root first:
62
62
 
63
63
  ```bash
64
64
  npm run build:plugin:package
65
- openclaw plugins install /absolute/path/to/.tmp/openclaw-plugin-package
65
+ openclaw plugins install /absolute/path/to/packages/openclaw-plugin
66
66
  ```
67
67
 
68
- If you change plugin code, rebuild the staged package before reinstalling or
68
+ If you change plugin code, rebuild the package root before reinstalling or
69
69
  retesting it in a real host.
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "name": "Claworld Persona Relay",
10
10
  "description": "Claworld relay world channel plugin for OpenClaw.",
11
- "version": "2026.4.14-testing.2",
11
+ "version": "2026.4.16-testing.2",
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": "2026.4.14-testing.2",
3
+ "version": "2026.4.16-testing.2",
4
4
  "description": "Claworld channel plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -51,6 +51,9 @@
51
51
  "registry": "https://registry.npmjs.org/",
52
52
  "access": "public"
53
53
  },
54
+ "scripts": {
55
+ "prepack": "node ../../scripts/build-openclaw-plugin-package.mjs --output-dir ."
56
+ },
54
57
  "openclaw": {
55
58
  "extensions": [
56
59
  "./index.js"
@@ -87,7 +87,7 @@ function normalizePluginOptionalText(value) {
87
87
  function requireClientMessageId(value = null) {
88
88
  const normalized = normalizePluginOptionalText(value);
89
89
  if (!normalized) {
90
- throw new Error('claworld outbound clientMessageId is required for POST /v1/messages');
90
+ throw new Error('claworld outbound clientMessageId is required for POST /v1/orchestration/messages');
91
91
  }
92
92
  return normalized;
93
93
  }
@@ -96,6 +96,8 @@ function buildGeneratedClientMessageId() {
96
96
  return `openclaw_manual_${randomUUID()}`;
97
97
  }
98
98
 
99
+ const DEFAULT_RELAY_HTTP_TIMEOUT_MS = 15_000;
100
+
99
101
  function buildRelayAgentSummary(item = {}) {
100
102
  const normalizedAgentId = normalizeClaworldText(item?.agentId, null);
101
103
  return {
@@ -521,7 +523,7 @@ async function deliverRelayMessage({ runtimeConfig, to, text, fetchImpl, logger,
521
523
  const relaySessionKey = resolveRelaySessionKeyFromOutboundContext(outboundContext);
522
524
 
523
525
  const baseUrl = normalizeRelayHttpBaseUrl(runtimeConfig.serverUrl);
524
- const result = await fetchJson(fetchImpl, `${baseUrl}/v1/messages`, {
526
+ const result = await fetchJson(fetchImpl, `${baseUrl}/v1/orchestration/messages`, {
525
527
  method: 'POST',
526
528
  headers: {
527
529
  'content-type': 'application/json',
@@ -908,8 +910,19 @@ function resolveRuntimeConfigSource(context = {}) {
908
910
  }
909
911
 
910
912
  async function fetchJson(fetchImpl, url, init = {}) {
913
+ const timeoutMs = Number.isFinite(Number(init?.timeoutMs))
914
+ ? Math.max(1, Number(init.timeoutMs))
915
+ : DEFAULT_RELAY_HTTP_TIMEOUT_MS;
916
+ const controller = new AbortController();
917
+ const timeoutId = setTimeout(() => controller.abort(new Error('request_timeout')), timeoutMs);
918
+ if (typeof timeoutId?.unref === 'function') timeoutId.unref();
919
+ const requestInit = {
920
+ ...init,
921
+ signal: controller.signal,
922
+ };
923
+ delete requestInit.timeoutMs;
911
924
  try {
912
- const response = await fetchImpl(url, init);
925
+ const response = await fetchImpl(url, requestInit);
913
926
  let body = null;
914
927
  try {
915
928
  body = await response.json();
@@ -923,15 +936,18 @@ async function fetchJson(fetchImpl, url, init = {}) {
923
936
  category: 'transport',
924
937
  status: 502,
925
938
  message: `fetch failed: ${error?.message || String(error)}`,
926
- publicMessage: 'relay fetch failed',
927
- recoverable: true,
928
- context: {
929
- fetchUrl: url,
930
- fetchMethod: init?.method || 'GET',
931
- fetchHeaders: init?.headers || null,
932
- },
933
- cause: error,
934
- });
939
+ publicMessage: 'relay fetch failed',
940
+ recoverable: true,
941
+ context: {
942
+ fetchUrl: url,
943
+ fetchMethod: requestInit.method || 'GET',
944
+ fetchHeaders: requestInit.headers || null,
945
+ timeoutMs,
946
+ },
947
+ cause: error,
948
+ });
949
+ } finally {
950
+ clearTimeout(timeoutId);
935
951
  }
936
952
  }
937
953
 
@@ -50,7 +50,7 @@ export function normalizeOptionalText(value) {
50
50
  export function requireClientMessageId(value = null) {
51
51
  const normalized = normalizeOptionalText(value);
52
52
  if (!normalized) {
53
- throw new Error('claworld relay clientMessageId is required for POST /v1/messages');
53
+ throw new Error('claworld relay clientMessageId is required for POST /v1/orchestration/messages');
54
54
  }
55
55
  return normalized;
56
56
  }
@@ -907,7 +907,7 @@ export class ClaworldRelayClient extends EventEmitter {
907
907
  replyText,
908
908
  source,
909
909
  });
910
- const result = await this.requestJsonWithDeliveryVisibilityRetry(`/v1/deliveries/${encodeURIComponent(envelope.deliveryId)}/reply`, {
910
+ const result = await this.requestJsonWithDeliveryVisibilityRetry(`/v1/runtime-deliveries/${encodeURIComponent(envelope.deliveryId)}/reply`, {
911
911
  method: 'POST',
912
912
  headers: buildRuntimeAuthHeaders(this.runtimeConfig, { 'content-type': 'application/json' }),
913
913
  body: JSON.stringify({
@@ -929,7 +929,7 @@ export class ClaworldRelayClient extends EventEmitter {
929
929
 
930
930
  async acceptDeliveryHttp({ deliveryId, sessionKey = null, source = 'runtime_dispatch' } = {}) {
931
931
  const normalizedDeliveryId = normalizeOptionalText(deliveryId);
932
- const result = await this.requestJsonWithDeliveryVisibilityRetry(`/v1/deliveries/${encodeURIComponent(normalizedDeliveryId)}/accepted`, {
932
+ const result = await this.requestJsonWithDeliveryVisibilityRetry(`/v1/runtime-deliveries/${encodeURIComponent(normalizedDeliveryId)}/accepted`, {
933
933
  method: 'POST',
934
934
  headers: buildRuntimeAuthHeaders(this.runtimeConfig, { 'content-type': 'application/json' }),
935
935
  body: JSON.stringify({
@@ -1130,7 +1130,7 @@ export class ClaworldRelayClient extends EventEmitter {
1130
1130
 
1131
1131
  async keepDeliverySilentHttp({ deliveryId, reason = null, source = 'openclaw-autochain' } = {}) {
1132
1132
  const normalizedDeliveryId = normalizeOptionalText(deliveryId);
1133
- const result = await this.requestJsonWithDeliveryVisibilityRetry(`/v1/deliveries/${encodeURIComponent(normalizedDeliveryId)}/kept-silent`, {
1133
+ const result = await this.requestJsonWithDeliveryVisibilityRetry(`/v1/runtime-deliveries/${encodeURIComponent(normalizedDeliveryId)}/kept-silent`, {
1134
1134
  method: 'POST',
1135
1135
  headers: buildRuntimeAuthHeaders(this.runtimeConfig, { 'content-type': 'application/json' }),
1136
1136
  body: JSON.stringify({
@@ -1322,7 +1322,7 @@ export class ClaworldRelayClient extends EventEmitter {
1322
1322
 
1323
1323
  async deliverMessage({ fromAgentId, targetAgentId, clientMessageId = null, payload = {}, conversation = {} } = {}) {
1324
1324
  const resolvedClientMessageId = requireClientMessageId(clientMessageId);
1325
- const result = await this.requestJson('/v1/messages', {
1325
+ const result = await this.requestJson('/v1/orchestration/messages', {
1326
1326
  method: 'POST',
1327
1327
  headers: buildRuntimeAuthHeaders(this.runtimeConfig, { 'content-type': 'application/json' }),
1328
1328
  body: JSON.stringify({ fromAgentId, targetAgentId, clientMessageId: resolvedClientMessageId, payload, conversation }),