@okxweb3/a2a-node 0.1.2 → 0.1.3-beta-5afe085f69-260701174158

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.
Files changed (3) hide show
  1. package/dist/cli.js +71 -23
  2. package/dist/index.js +50 -15
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -2285,6 +2285,7 @@ var init_command_store = __esm({
2285
2285
  toAgentId: params.toAgentId,
2286
2286
  toXmtpAddress: params.toXmtpAddress,
2287
2287
  gatewaySessionKeys: params.gatewaySessionKeys,
2288
+ payload: params.payload,
2288
2289
  createdAt: Date.now()
2289
2290
  };
2290
2291
  }
@@ -7893,7 +7894,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
7893
7894
  client: {
7894
7895
  id: "gateway-client",
7895
7896
  displayName: "okx-a2a-node",
7896
- version: "0.1.2",
7897
+ version: "0.1.3-beta-5afe085f69-260701174158",
7897
7898
  platform: "node",
7898
7899
  mode: "backend",
7899
7900
  instanceId
@@ -7904,7 +7905,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
7904
7905
  commands: [],
7905
7906
  permissions: {},
7906
7907
  locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
7907
- userAgent: `okx-a2a-node/${"0.1.2"}`,
7908
+ userAgent: `okx-a2a-node/${"0.1.3-beta-5afe085f69-260701174158"}`,
7908
7909
  auth: {
7909
7910
  ...config.token ? { token: config.token } : {},
7910
7911
  ...config.password ? { password: config.password } : {}
@@ -23945,6 +23946,7 @@ var init_events = __esm({
23945
23946
  ONCHAINOS_SESSION_EXPIRED: "Onchainos session expired",
23946
23947
  ONCHAINOS_CLI_ERROR: "Onchainos CLI error",
23947
23948
  HEARTBEAT_FAILED: "Heartbeat failed",
23949
+ HEARTBEAT_SKIPPED: "Heartbeat skipped",
23948
23950
  MESSAGE_PARSE_FAILED: "Message parse failed",
23949
23951
  MESSAGE_HANDLER_ERROR: "Message handler error",
23950
23952
  OFFLINE_REPLAY_FAILED: "Offline replay failed",
@@ -25123,7 +25125,7 @@ var init_sentry_config = __esm({
25123
25125
  environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
25124
25126
  SENTRY_CONFIG = {
25125
25127
  projectName: "okx/openclaw-okx-a2a-extension",
25126
- release: "0.1.2",
25128
+ release: "0.1.3-beta-5afe085f69-260701174158",
25127
25129
  environment
25128
25130
  };
25129
25131
  }
@@ -87267,6 +87269,12 @@ function buildTaskPayload(replyToMessageId) {
87267
87269
  replyToMessageId: replyToMessageId ?? null
87268
87270
  };
87269
87271
  }
87272
+ function resolveEnvelopePayload(command, replyToMessageId) {
87273
+ if (command.payload !== void 0) {
87274
+ return command.payload;
87275
+ }
87276
+ return buildTaskPayload(replyToMessageId);
87277
+ }
87270
87278
  function parseJson(raw) {
87271
87279
  try {
87272
87280
  return JSON.parse(raw);
@@ -87374,7 +87382,7 @@ function buildGroupReplyRaw(command, target, myXmtpAddress, localAgent) {
87374
87382
  jobId: command.jobId,
87375
87383
  senderAgent: localAgent,
87376
87384
  receiverAgentId: readString(sender?.agentId),
87377
- payload: buildTaskPayload(command.replyToMessageId ?? target.id)
87385
+ payload: resolveEnvelopePayload(command, command.replyToMessageId ?? target.id)
87378
87386
  });
87379
87387
  }
87380
87388
  async function assertOutboundEligible(params) {
@@ -87706,7 +87714,7 @@ async function handleSqliteGroupSendCommand(params) {
87706
87714
  jobId: command.jobId,
87707
87715
  senderAgent,
87708
87716
  receiverAgentId: remote.remoteAgent?.agentId ?? remote.toAgentId ?? null,
87709
- payload: buildTaskPayload(command.replyToMessageId)
87717
+ payload: resolveEnvelopePayload(command, command.replyToMessageId)
87710
87718
  });
87711
87719
  logWithTimestamp(`[okx-agent-task] xmtp envelope ${rawText}`);
87712
87720
  await conversation.send(rawText);
@@ -87843,7 +87851,7 @@ async function handleGroupSendCommand(params) {
87843
87851
  jobId: command.jobId,
87844
87852
  senderAgent,
87845
87853
  receiverAgentId: remoteAgent?.agentId ?? session.toAgentId ?? null,
87846
- payload: buildTaskPayload(command.replyToMessageId)
87854
+ payload: resolveEnvelopePayload(command, command.replyToMessageId)
87847
87855
  });
87848
87856
  logWithTimestamp(`[okx-agent-task] xmtp envelope ${rawText}`);
87849
87857
  await conversation.send(rawText);
@@ -93116,12 +93124,12 @@ async function runListenerWithLock(options, paths) {
93116
93124
  }));
93117
93125
  }
93118
93126
  });
93119
- service.setPluginVersion("0.1.2");
93127
+ service.setPluginVersion("0.1.3-beta-5afe085f69-260701174158");
93120
93128
  await service.init();
93121
93129
  const pluginVersionStatus = service.pluginVersionStatus;
93122
93130
  if (pluginVersionStatus.unavailable) {
93123
93131
  throw new Error(
93124
- `@okxweb3/a2a-node v${"0.1.2"} is below the required minimum v${pluginVersionStatus.minVersion}`
93132
+ `@okxweb3/a2a-node v${"0.1.3-beta-5afe085f69-260701174158"} is below the required minimum v${pluginVersionStatus.minVersion}`
93125
93133
  );
93126
93134
  }
93127
93135
  const systemConfig = service.getSystemConfig();
@@ -93139,7 +93147,7 @@ async function runListenerWithLock(options, paths) {
93139
93147
  onchainosAgentId: "*",
93140
93148
  reason: "system-config missing sentryDsn",
93141
93149
  pluginId: "@okxweb3/a2a-node",
93142
- pluginVersion: "0.1.2"
93150
+ pluginVersion: "0.1.3-beta-5afe085f69-260701174158"
93143
93151
  });
93144
93152
  }
93145
93153
  logWithTimestamp(
@@ -93188,10 +93196,33 @@ async function runListenerWithLock(options, paths) {
93188
93196
  logWithTimestamp(
93189
93197
  `[okx-agent-task] provider=${heartbeatProvider ?? "(not set)"} gateway unavailable, skipping heartbeat`
93190
93198
  );
93199
+ logger.error(
93200
+ LogEvent.HEARTBEAT_SKIPPED,
93201
+ new Error(`heartbeat skipped: provider=${heartbeatProvider ?? "(not set)"} gateway unavailable`),
93202
+ {
93203
+ component: "node_listener",
93204
+ stage: "sync_tick",
93205
+ reason: "gateway_unavailable",
93206
+ provider: heartbeatProvider ?? "(not set)",
93207
+ chainIndex: ONCHAINOS_CHAIN_INDEX,
93208
+ communicationClass: "gateway_or_plugin"
93209
+ }
93210
+ );
93191
93211
  }
93192
93212
  }
93193
93213
  if (!hasActiveAgents) {
93194
93214
  logWithTimestamp("[okx-agent-task] no active agents, skipping heartbeat");
93215
+ logger.error(
93216
+ LogEvent.HEARTBEAT_SKIPPED,
93217
+ new Error("heartbeat skipped: no active agents"),
93218
+ {
93219
+ component: "node_listener",
93220
+ stage: "sync_tick",
93221
+ reason: "no_active_agents",
93222
+ provider: heartbeatProvider ?? "(not set)",
93223
+ chainIndex: ONCHAINOS_CHAIN_INDEX
93224
+ }
93225
+ );
93195
93226
  }
93196
93227
  const skippedTiming = { durationMs: 0 };
93197
93228
  const heartbeatResult = shouldHeartbeat ? await timeSettled(() => sendHeartbeat(ONCHAINOS_CHAIN_INDEX)) : skippedTiming;
@@ -96708,7 +96739,7 @@ async function getCurrentNodeCliVersion() {
96708
96739
  return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
96709
96740
  }
96710
96741
  function getBundledNodeCliVersion() {
96711
- return true ? "0.1.2" : null;
96742
+ return true ? "0.1.3-beta-5afe085f69-260701174158" : null;
96712
96743
  }
96713
96744
  function readConfiguredAiProvider() {
96714
96745
  const explicit = process.env.OKX_A2A_AI_PROVIDER || process.env.OKX_AGENT_TASK_AI_CLI;
@@ -96793,13 +96824,15 @@ async function ensureOpenClawOkxA2aPluginConfig() {
96793
96824
  const conversationHookAccess = await getOpenClawConfigValue(
96794
96825
  OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH
96795
96826
  );
96796
- const normalizedAllow = normalizeOpenClawPluginAllowValue(allow.found ? allow.value : void 0);
96797
96827
  const operations = [];
96798
96828
  if (dmScope.value !== OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE) {
96799
96829
  operations.push({ path: OPENCLAW_SESSION_DM_SCOPE_CONFIG_PATH, value: OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE });
96800
96830
  }
96801
- if (!allow.found || normalizedAllow.changed) {
96802
- operations.push({ path: OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH, value: normalizedAllow.value });
96831
+ if (allow.found) {
96832
+ const normalizedAllow = normalizeOpenClawPluginAllowValue(allow.value);
96833
+ if (normalizedAllow.changed) {
96834
+ operations.push({ path: OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH, value: normalizedAllow.value });
96835
+ }
96803
96836
  }
96804
96837
  if (conversationHookAccess.value !== true) {
96805
96838
  operations.push({ path: OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH, value: true });
@@ -96808,11 +96841,11 @@ async function ensureOpenClawOkxA2aPluginConfig() {
96808
96841
  return false;
96809
96842
  }
96810
96843
  await runCommand("openclaw", ["config", "set", "--batch-json", JSON.stringify(operations)]);
96811
- console.log("[update] normalized OpenClaw session.dmScope/plugins.allow/hooks okx-a2a config through openclaw config set");
96844
+ console.log("[update] normalized OpenClaw okx-a2a gateway config through openclaw config set");
96812
96845
  return true;
96813
96846
  } catch (error) {
96814
96847
  const detail = error instanceof Error ? error.message : String(error);
96815
- console.warn(`[update] skipped OpenClaw session.dmScope/plugins.allow/hooks okx-a2a config normalization through openclaw CLI: ${detail}`);
96848
+ console.warn(`[update] skipped OpenClaw okx-a2a gateway config normalization through openclaw CLI: ${detail}`);
96816
96849
  return false;
96817
96850
  }
96818
96851
  }
@@ -96830,7 +96863,7 @@ async function getOpenClawConfigValue(path) {
96830
96863
  }
96831
96864
  function normalizeOpenClawPluginAllowValue(allow) {
96832
96865
  if (!Array.isArray(allow)) {
96833
- return { value: [OKX_A2A_PLUGIN_ID], changed: true };
96866
+ return { value: allow, changed: false };
96834
96867
  }
96835
96868
  const nextAllow = [];
96836
96869
  let allowChanged = false;
@@ -97614,7 +97647,7 @@ init_sentry_logger();
97614
97647
  init_sentry_config();
97615
97648
  var CURRENT_GATEWAY_SESSION_KEYS_ENV3 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
97616
97649
  function printUsage2() {
97617
- console.log(`okx-a2a ${"0.1.2"}
97650
+ console.log(`okx-a2a ${"0.1.3-beta-5afe085f69-260701174158"}
97618
97651
 
97619
97652
  Usage:
97620
97653
  okx-a2a <command> [options]
@@ -97651,7 +97684,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
97651
97684
  `);
97652
97685
  }
97653
97686
  function printVersion() {
97654
- console.log("0.1.2");
97687
+ console.log("0.1.3-beta-5afe085f69-260701174158");
97655
97688
  }
97656
97689
  function printDaemonUsage() {
97657
97690
  console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
@@ -97716,8 +97749,8 @@ function printAgentUsage() {
97716
97749
  console.log(`Usage: okx-a2a agent <refresh|bypass> [options]
97717
97750
 
97718
97751
  Commands:
97719
- refresh [--json]
97720
- Refresh the listener agent list.
97752
+ refresh [--json] [--timeout-ms <ms>]
97753
+ Refresh the listener agent list and wait for the daemon result.
97721
97754
  bypass <on|off> [--json]
97722
97755
  Configure AI subsession bypass permissions.
97723
97756
  `);
@@ -97730,6 +97763,7 @@ Options:
97730
97763
  --to-address <xmtpAddress> Recipient XMTP address fallback
97731
97764
  --reply-to <messageId> Reply-to message id
97732
97765
  --session-agent-id <id> Session agent id for task file routing
97766
+ --payload <json> JSON string; when valid, fully replaces the envelope payload
97733
97767
  --json Print machine-readable output with ok boolean
97734
97768
  `);
97735
97769
  }
@@ -97980,7 +98014,8 @@ async function queueXmtpSend(args) {
97980
98014
  "--session-key",
97981
98015
  "--to-agent-id",
97982
98016
  "--to-address",
97983
- "--to-xmtp-address"
98017
+ "--to-xmtp-address",
98018
+ "--payload"
97984
98019
  ]),
97985
98020
  flags: /* @__PURE__ */ new Set(["--json"])
97986
98021
  });
@@ -97992,6 +98027,7 @@ async function queueXmtpSend(args) {
97992
98027
  const explicitToAgentId = readOption3(args, "--to-agent-id");
97993
98028
  const sessionKey = readOption3(args, "--session-key");
97994
98029
  const toXmtpAddress = readOption3(args, "--to-address") ?? readOption3(args, "--to-xmtp-address");
98030
+ const payloadOverride = parseXmtpSendPayloadOption(readOption3(args, "--payload"));
97995
98031
  const target = resolveXmtpSendTarget({
97996
98032
  sessionKey,
97997
98033
  jobId: explicitJobId,
@@ -98013,7 +98049,8 @@ async function queueXmtpSend(args) {
98013
98049
  myAgentId: target.myAgentId,
98014
98050
  toAgentId: target.toAgentId,
98015
98051
  toXmtpAddress: toXmtpAddress ?? target.toXmtpAddress,
98016
- gatewaySessionKeys: readGatewaySessionKeysFromEnv2()
98052
+ gatewaySessionKeys: readGatewaySessionKeysFromEnv2(),
98053
+ payload: payloadOverride
98017
98054
  });
98018
98055
  await commands.submit(command);
98019
98056
  const result = await commands.waitForResult(command.id, Number.POSITIVE_INFINITY);
@@ -98037,6 +98074,17 @@ async function queueXmtpSend(args) {
98037
98074
  commands.close();
98038
98075
  }
98039
98076
  }
98077
+ function parseXmtpSendPayloadOption(raw) {
98078
+ const trimmed = raw?.trim();
98079
+ if (!trimmed) {
98080
+ return void 0;
98081
+ }
98082
+ try {
98083
+ return JSON.parse(trimmed);
98084
+ } catch {
98085
+ return void 0;
98086
+ }
98087
+ }
98040
98088
  function readGatewaySessionKeysFromEnv2(env = process.env) {
98041
98089
  const keys = /* @__PURE__ */ new Set();
98042
98090
  const list = env[CURRENT_GATEWAY_SESSION_KEYS_ENV3]?.trim();
@@ -98161,7 +98209,7 @@ function assertOnlyKnownOptions(args, input) {
98161
98209
  async function queueXmtpDaemonCommand(args, type) {
98162
98210
  const json = hasFlag2(args, "--json");
98163
98211
  const timeoutMsRaw = readOption3(args, "--timeout-ms");
98164
- const wait3 = type === "xmtp-get-pending-list" || type === "xmtp-deny-pending-conversation";
98212
+ const wait3 = type === "xmtp-get-pending-list" || type === "xmtp-deny-pending-conversation" || type === "xmtp-refresh-agents";
98165
98213
  await assertDaemonRunningForQueuedCommand2(type);
98166
98214
  const commands = new CommandStore();
98167
98215
  const command = type === "xmtp-get-pending-list" ? commands.createXmtpGetPendingListCommand() : type === "xmtp-deny-pending-conversation" ? commands.createXmtpDenyPendingConversationCommand(readDenyPendingConversationOptions(args)) : commands.createXmtpRefreshAgentsCommand();
package/dist/index.js CHANGED
@@ -68009,6 +68009,7 @@ __export(index_exports, {
68009
68009
  resolveConfiguredAiProvider: () => resolveConfiguredAiProvider,
68010
68010
  resolveConfiguredAiProviderForJob: () => resolveConfiguredAiProviderForJob,
68011
68011
  resolveDirectCommunicationSessionTarget: () => resolveDirectCommunicationSessionTarget,
68012
+ resolveEnvelopePayload: () => resolveEnvelopePayload,
68012
68013
  resolveOfflineReplayIntervalSec: () => resolveOfflineReplayIntervalSec,
68013
68014
  resolveOpenClawGatewayConfig: () => resolveOpenClawGatewayConfig,
68014
68015
  resolveOpenClawGatewayRoute: () => resolveOpenClawGatewayRoute,
@@ -71555,6 +71556,7 @@ var LogEvent = {
71555
71556
  ONCHAINOS_SESSION_EXPIRED: "Onchainos session expired",
71556
71557
  ONCHAINOS_CLI_ERROR: "Onchainos CLI error",
71557
71558
  HEARTBEAT_FAILED: "Heartbeat failed",
71559
+ HEARTBEAT_SKIPPED: "Heartbeat skipped",
71558
71560
  MESSAGE_PARSE_FAILED: "Message parse failed",
71559
71561
  MESSAGE_HANDLER_ERROR: "Message handler error",
71560
71562
  OFFLINE_REPLAY_FAILED: "Offline replay failed",
@@ -74744,6 +74746,7 @@ var CommandStore = class {
74744
74746
  toAgentId: params.toAgentId,
74745
74747
  toXmtpAddress: params.toXmtpAddress,
74746
74748
  gatewaySessionKeys: params.gatewaySessionKeys,
74749
+ payload: params.payload,
74747
74750
  createdAt: Date.now()
74748
74751
  };
74749
74752
  }
@@ -86775,7 +86778,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
86775
86778
  client: {
86776
86779
  id: "gateway-client",
86777
86780
  displayName: "okx-a2a-node",
86778
- version: "0.1.2",
86781
+ version: "0.1.3-beta-5afe085f69-260701174158",
86779
86782
  platform: "node",
86780
86783
  mode: "backend",
86781
86784
  instanceId
@@ -86786,7 +86789,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
86786
86789
  commands: [],
86787
86790
  permissions: {},
86788
86791
  locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
86789
- userAgent: `okx-a2a-node/${"0.1.2"}`,
86792
+ userAgent: `okx-a2a-node/${"0.1.3-beta-5afe085f69-260701174158"}`,
86790
86793
  auth: {
86791
86794
  ...config.token ? { token: config.token } : {},
86792
86795
  ...config.password ? { password: config.password } : {}
@@ -88130,6 +88133,12 @@ function buildTaskPayload(replyToMessageId) {
88130
88133
  replyToMessageId: replyToMessageId ?? null
88131
88134
  };
88132
88135
  }
88136
+ function resolveEnvelopePayload(command, replyToMessageId) {
88137
+ if (command.payload !== void 0) {
88138
+ return command.payload;
88139
+ }
88140
+ return buildTaskPayload(replyToMessageId);
88141
+ }
88133
88142
  function parseJson(raw) {
88134
88143
  try {
88135
88144
  return JSON.parse(raw);
@@ -88237,7 +88246,7 @@ function buildGroupReplyRaw(command, target, myXmtpAddress, localAgent) {
88237
88246
  jobId: command.jobId,
88238
88247
  senderAgent: localAgent,
88239
88248
  receiverAgentId: readString(sender?.agentId),
88240
- payload: buildTaskPayload(command.replyToMessageId ?? target.id)
88249
+ payload: resolveEnvelopePayload(command, command.replyToMessageId ?? target.id)
88241
88250
  });
88242
88251
  }
88243
88252
  async function assertOutboundEligible(params) {
@@ -88571,7 +88580,7 @@ async function handleSqliteGroupSendCommand(params) {
88571
88580
  jobId: command.jobId,
88572
88581
  senderAgent,
88573
88582
  receiverAgentId: remote.remoteAgent?.agentId ?? remote.toAgentId ?? null,
88574
- payload: buildTaskPayload(command.replyToMessageId)
88583
+ payload: resolveEnvelopePayload(command, command.replyToMessageId)
88575
88584
  });
88576
88585
  logWithTimestamp(`[okx-agent-task] xmtp envelope ${rawText}`);
88577
88586
  await conversation.send(rawText);
@@ -88708,7 +88717,7 @@ async function handleGroupSendCommand(params) {
88708
88717
  jobId: command.jobId,
88709
88718
  senderAgent,
88710
88719
  receiverAgentId: remoteAgent?.agentId ?? session.toAgentId ?? null,
88711
- payload: buildTaskPayload(command.replyToMessageId)
88720
+ payload: resolveEnvelopePayload(command, command.replyToMessageId)
88712
88721
  });
88713
88722
  logWithTimestamp(`[okx-agent-task] xmtp envelope ${rawText}`);
88714
88723
  await conversation.send(rawText);
@@ -91205,7 +91214,7 @@ function userWatchEventDeliveredSentryExtra(event) {
91205
91214
  var environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
91206
91215
  var SENTRY_CONFIG = {
91207
91216
  projectName: "okx/openclaw-okx-a2a-extension",
91208
- release: "0.1.2",
91217
+ release: "0.1.3-beta-5afe085f69-260701174158",
91209
91218
  environment
91210
91219
  };
91211
91220
 
@@ -91432,12 +91441,12 @@ async function runListenerWithLock(options, paths) {
91432
91441
  }));
91433
91442
  }
91434
91443
  });
91435
- service.setPluginVersion("0.1.2");
91444
+ service.setPluginVersion("0.1.3-beta-5afe085f69-260701174158");
91436
91445
  await service.init();
91437
91446
  const pluginVersionStatus = service.pluginVersionStatus;
91438
91447
  if (pluginVersionStatus.unavailable) {
91439
91448
  throw new Error(
91440
- `@okxweb3/a2a-node v${"0.1.2"} is below the required minimum v${pluginVersionStatus.minVersion}`
91449
+ `@okxweb3/a2a-node v${"0.1.3-beta-5afe085f69-260701174158"} is below the required minimum v${pluginVersionStatus.minVersion}`
91441
91450
  );
91442
91451
  }
91443
91452
  const systemConfig = service.getSystemConfig();
@@ -91455,7 +91464,7 @@ async function runListenerWithLock(options, paths) {
91455
91464
  onchainosAgentId: "*",
91456
91465
  reason: "system-config missing sentryDsn",
91457
91466
  pluginId: "@okxweb3/a2a-node",
91458
- pluginVersion: "0.1.2"
91467
+ pluginVersion: "0.1.3-beta-5afe085f69-260701174158"
91459
91468
  });
91460
91469
  }
91461
91470
  logWithTimestamp(
@@ -91504,10 +91513,33 @@ async function runListenerWithLock(options, paths) {
91504
91513
  logWithTimestamp(
91505
91514
  `[okx-agent-task] provider=${heartbeatProvider ?? "(not set)"} gateway unavailable, skipping heartbeat`
91506
91515
  );
91516
+ logger.error(
91517
+ LogEvent.HEARTBEAT_SKIPPED,
91518
+ new Error(`heartbeat skipped: provider=${heartbeatProvider ?? "(not set)"} gateway unavailable`),
91519
+ {
91520
+ component: "node_listener",
91521
+ stage: "sync_tick",
91522
+ reason: "gateway_unavailable",
91523
+ provider: heartbeatProvider ?? "(not set)",
91524
+ chainIndex: ONCHAINOS_CHAIN_INDEX,
91525
+ communicationClass: "gateway_or_plugin"
91526
+ }
91527
+ );
91507
91528
  }
91508
91529
  }
91509
91530
  if (!hasActiveAgents) {
91510
91531
  logWithTimestamp("[okx-agent-task] no active agents, skipping heartbeat");
91532
+ logger.error(
91533
+ LogEvent.HEARTBEAT_SKIPPED,
91534
+ new Error("heartbeat skipped: no active agents"),
91535
+ {
91536
+ component: "node_listener",
91537
+ stage: "sync_tick",
91538
+ reason: "no_active_agents",
91539
+ provider: heartbeatProvider ?? "(not set)",
91540
+ chainIndex: ONCHAINOS_CHAIN_INDEX
91541
+ }
91542
+ );
91511
91543
  }
91512
91544
  const skippedTiming = { durationMs: 0 };
91513
91545
  const heartbeatResult = shouldHeartbeat ? await timeSettled(() => sendHeartbeat(ONCHAINOS_CHAIN_INDEX)) : skippedTiming;
@@ -91807,13 +91839,15 @@ async function ensureOpenClawOkxA2aPluginConfig() {
91807
91839
  const conversationHookAccess = await getOpenClawConfigValue(
91808
91840
  OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH
91809
91841
  );
91810
- const normalizedAllow = normalizeOpenClawPluginAllowValue(allow.found ? allow.value : void 0);
91811
91842
  const operations = [];
91812
91843
  if (dmScope.value !== OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE) {
91813
91844
  operations.push({ path: OPENCLAW_SESSION_DM_SCOPE_CONFIG_PATH, value: OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE });
91814
91845
  }
91815
- if (!allow.found || normalizedAllow.changed) {
91816
- operations.push({ path: OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH, value: normalizedAllow.value });
91846
+ if (allow.found) {
91847
+ const normalizedAllow = normalizeOpenClawPluginAllowValue(allow.value);
91848
+ if (normalizedAllow.changed) {
91849
+ operations.push({ path: OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH, value: normalizedAllow.value });
91850
+ }
91817
91851
  }
91818
91852
  if (conversationHookAccess.value !== true) {
91819
91853
  operations.push({ path: OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH, value: true });
@@ -91822,11 +91856,11 @@ async function ensureOpenClawOkxA2aPluginConfig() {
91822
91856
  return false;
91823
91857
  }
91824
91858
  await runCommand("openclaw", ["config", "set", "--batch-json", JSON.stringify(operations)]);
91825
- console.log("[update] normalized OpenClaw session.dmScope/plugins.allow/hooks okx-a2a config through openclaw config set");
91859
+ console.log("[update] normalized OpenClaw okx-a2a gateway config through openclaw config set");
91826
91860
  return true;
91827
91861
  } catch (error) {
91828
91862
  const detail = error instanceof Error ? error.message : String(error);
91829
- console.warn(`[update] skipped OpenClaw session.dmScope/plugins.allow/hooks okx-a2a config normalization through openclaw CLI: ${detail}`);
91863
+ console.warn(`[update] skipped OpenClaw okx-a2a gateway config normalization through openclaw CLI: ${detail}`);
91830
91864
  return false;
91831
91865
  }
91832
91866
  }
@@ -91844,7 +91878,7 @@ async function getOpenClawConfigValue(path) {
91844
91878
  }
91845
91879
  function normalizeOpenClawPluginAllowValue(allow) {
91846
91880
  if (!Array.isArray(allow)) {
91847
- return { value: [OKX_A2A_PLUGIN_ID], changed: true };
91881
+ return { value: allow, changed: false };
91848
91882
  }
91849
91883
  const nextAllow = [];
91850
91884
  let allowChanged = false;
@@ -92257,6 +92291,7 @@ async function runCommandCaptureOptional(command, args) {
92257
92291
  resolveConfiguredAiProvider,
92258
92292
  resolveConfiguredAiProviderForJob,
92259
92293
  resolveDirectCommunicationSessionTarget,
92294
+ resolveEnvelopePayload,
92260
92295
  resolveOfflineReplayIntervalSec,
92261
92296
  resolveOpenClawGatewayConfig,
92262
92297
  resolveOpenClawGatewayRoute,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okxweb3/a2a-node",
3
- "version": "0.1.2",
3
+ "version": "0.1.3-beta-5afe085f69-260701174158",
4
4
  "description": "Host-agnostic Node CLI for E2E encrypted agent-to-agent communication via XMTP",
5
5
  "main": "dist/index.js",
6
6
  "bin": {