@okxweb3/a2a-node 0.0.18-beta-8614cb2a91-260625201617 → 0.0.18

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 +22 -83
  2. package/dist/index.js +19 -80
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -7577,7 +7577,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
7577
7577
  client: {
7578
7578
  id: "gateway-client",
7579
7579
  displayName: "okx-a2a-node",
7580
- version: "0.0.18-beta-8614cb2a91-260625201617",
7580
+ version: "0.0.18",
7581
7581
  platform: "node",
7582
7582
  mode: "backend",
7583
7583
  instanceId
@@ -7588,7 +7588,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
7588
7588
  commands: [],
7589
7589
  permissions: {},
7590
7590
  locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
7591
- userAgent: `okx-a2a-node/${"0.0.18-beta-8614cb2a91-260625201617"}`,
7591
+ userAgent: `okx-a2a-node/${"0.0.18"}`,
7592
7592
  auth: {
7593
7593
  ...config.token ? { token: config.token } : {},
7594
7594
  ...config.password ? { password: config.password } : {}
@@ -7927,7 +7927,7 @@ var init_openclaw_session_key = __esm({
7927
7927
  function currentOpenClawGatewaySessionKey(env = process.env) {
7928
7928
  for (const candidate of currentOpenClawGatewaySessionCandidates(env)) {
7929
7929
  if (candidate.ok) {
7930
- return canonicalizeOpenClawGatewaySessionKey(candidate.sessionKey);
7930
+ return candidate.sessionKey;
7931
7931
  }
7932
7932
  }
7933
7933
  return null;
@@ -7952,12 +7952,11 @@ function bindOpenClawGatewayRouteFromEnv(store, input, env = process.env) {
7952
7952
  });
7953
7953
  continue;
7954
7954
  }
7955
- const sessionKey = canonicalizeOpenClawGatewaySessionKey(candidate.sessionKey);
7956
- const channel = channelFromOpenClawGatewaySessionKey(sessionKey);
7955
+ const channel = channelFromOpenClawGatewaySessionKey(candidate.sessionKey);
7957
7956
  if (!channel) {
7958
7957
  logOpenClawRouteSkip("invalid_gateway_session_key", {
7959
7958
  jobId,
7960
- sessionKey,
7959
+ sessionKey: candidate.sessionKey,
7961
7960
  existingRoute: resolveOpenClawGatewayRoute(store, { jobId })
7962
7961
  });
7963
7962
  continue;
@@ -7967,7 +7966,7 @@ function bindOpenClawGatewayRouteFromEnv(store, input, env = process.env) {
7967
7966
  firstBound ??= existingRoute.gatewaySessionKey || existingRoute.sessionKey || null;
7968
7967
  continue;
7969
7968
  }
7970
- const route = buildOpenClawRouteEntry(sessionKey, channel);
7969
+ const route = buildOpenClawRouteEntry(candidate.sessionKey, channel);
7971
7970
  routes = [...routes, route];
7972
7971
  const binding = store.upsertJobGatewayRoute({ jobId, provider: "openclaw", route });
7973
7972
  if (binding.provider !== "openclaw") {
@@ -8054,9 +8053,7 @@ function readOpenClawRouteEntries(store, jobId) {
8054
8053
  const channelOrder = [];
8055
8054
  const routeByChannel = /* @__PURE__ */ new Map();
8056
8055
  for (const route of routes) {
8057
- const sessionKey = canonicalizeOpenClawGatewaySessionKey(
8058
- normalizeText(route.gatewaySessionKey) ?? normalizeText(route.sessionKey) ?? ""
8059
- );
8056
+ const sessionKey = normalizeText(route.gatewaySessionKey) ?? normalizeText(route.sessionKey);
8060
8057
  const channel = channelFromOpenClawGatewaySessionKey(sessionKey);
8061
8058
  if (!sessionKey || !channel) {
8062
8059
  continue;
@@ -8109,70 +8106,20 @@ function parseOpenClawGatewaySessionKey(sessionKey) {
8109
8106
  };
8110
8107
  }
8111
8108
  if (platform === "telegram" && targetKind === "direct") {
8112
- const threadId = parseTelegramTopicSuffix(parts.slice(5));
8113
- return {
8114
- ...parts[4] ? { chatId: parts[4] } : {},
8115
- ...threadId ? { threadId } : {},
8116
- chatType: "dm"
8117
- };
8118
- }
8119
- if (platform === "telegram" && targetKind === "dm") {
8120
- const threadId = parseTelegramTopicSuffix(parts.slice(5));
8121
8109
  return {
8122
8110
  ...parts[4] ? { chatId: parts[4] } : {},
8123
- ...threadId ? { threadId } : {},
8124
8111
  chatType: "dm"
8125
8112
  };
8126
8113
  }
8127
8114
  if (platform === "telegram" && targetKind === "group") {
8128
- const threadId = parts[5] === "topic" ? parts[6] : parts[5];
8129
8115
  return {
8130
8116
  ...parts[4] ? { chatId: parts[4] } : {},
8131
- ...threadId ? { threadId } : {},
8132
- chatType: threadId ? "thread" : "group"
8117
+ ...parts[6] ? { threadId: parts[6] } : {},
8118
+ chatType: parts[6] ? "thread" : "group"
8133
8119
  };
8134
8120
  }
8135
8121
  return {};
8136
8122
  }
8137
- function canonicalizeOpenClawGatewaySessionKey(sessionKey) {
8138
- const key = normalizeText(sessionKey);
8139
- if (!key) {
8140
- return sessionKey;
8141
- }
8142
- const parts = key.split(":");
8143
- if (parts.length < 4 || parts[0] !== "agent") {
8144
- return key;
8145
- }
8146
- const platform = parts[2];
8147
- const targetKind = parts[3];
8148
- if (platform !== "telegram") {
8149
- return key;
8150
- }
8151
- if ((targetKind === "direct" || targetKind === "dm") && parts[4]) {
8152
- const threadId = parseTelegramTopicSuffix(parts.slice(5));
8153
- return threadId ? `agent:${parts[1]}:telegram:direct:${parts[4]}:topic:${threadId}` : `agent:${parts[1]}:telegram:direct:${parts[4]}`;
8154
- }
8155
- if (targetKind === "group" && parts[4]) {
8156
- const threadId = parts[5] === "topic" ? parts[6] : parts[5];
8157
- return threadId ? `agent:${parts[1]}:telegram:group:${parts[4]}:topic:${threadId}` : `agent:${parts[1]}:telegram:group:${parts[4]}`;
8158
- }
8159
- return key;
8160
- }
8161
- function parseTelegramTopicSuffix(parts) {
8162
- if (parts.length === 0) {
8163
- return void 0;
8164
- }
8165
- if (parts[0] === "topic") {
8166
- return parts[1] || void 0;
8167
- }
8168
- if (parts[0] === "thread") {
8169
- if (parts.length >= 3) {
8170
- return parts.slice(2).join(":") || void 0;
8171
- }
8172
- return parts[1] || void 0;
8173
- }
8174
- return parts[0] || void 0;
8175
- }
8176
8123
  function validateOpenClawGatewaySessionKey(sessionKey) {
8177
8124
  const key = normalizeText(sessionKey);
8178
8125
  if (!key) {
@@ -8212,16 +8159,10 @@ function deriveOpenClawGatewaySessionKey(input) {
8212
8159
  const chatId = encodeURIComponent(input.chatId);
8213
8160
  const threadId = input.threadId ? encodeURIComponent(input.threadId) : "";
8214
8161
  if (input.platform === "telegram") {
8215
- if (!threadId) {
8216
- return `agent:main:telegram:direct:${chatId}`;
8217
- }
8218
- return isTelegramGroupChatId(input.chatId) ? `agent:main:telegram:group:${chatId}:topic:${threadId}` : `agent:main:telegram:direct:${chatId}:topic:${threadId}`;
8162
+ return threadId ? `agent:main:telegram:group:${chatId}:topic:${threadId}` : `agent:main:telegram:direct:${chatId}`;
8219
8163
  }
8220
8164
  return threadId ? `agent:main:${input.platform}:thread:${chatId}:${threadId}` : `agent:main:${input.platform}:dm:${chatId}`;
8221
8165
  }
8222
- function isTelegramGroupChatId(chatId) {
8223
- return chatId.startsWith("-") || chatId.startsWith("@");
8224
- }
8225
8166
  function readGatewaySessionKeysEnv(env) {
8226
8167
  const raw = normalizeText(env[CURRENT_GATEWAY_SESSION_KEYS_ENV]);
8227
8168
  if (!raw) {
@@ -24807,7 +24748,7 @@ var init_sentry_config = __esm({
24807
24748
  environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
24808
24749
  SENTRY_CONFIG = {
24809
24750
  projectName: "okx/openclaw-okx-a2a-extension",
24810
- release: "0.0.18-beta-8614cb2a91-260625201617",
24751
+ release: "0.0.18",
24811
24752
  environment
24812
24753
  };
24813
24754
  }
@@ -91951,13 +91892,11 @@ async function processFileMessage(ctx, deps, options = {}) {
91951
91892
  reason: "unknown_group_without_session",
91952
91893
  ...timing.extras()
91953
91894
  });
91954
- if (!options.skipNotify) {
91955
- notifyPendingConversationToBackup({
91956
- deps,
91957
- jobId: route.jobId,
91958
- messageId: routedMessageId
91959
- });
91960
- }
91895
+ notifyPendingConversationToBackup({
91896
+ deps,
91897
+ jobId: route.jobId,
91898
+ messageId: routedMessageId
91899
+ });
91961
91900
  return true;
91962
91901
  }
91963
91902
  deps.sessionStore?.upsertSession({
@@ -92549,12 +92488,12 @@ async function runListenerWithLock(options, paths) {
92549
92488
  }));
92550
92489
  }
92551
92490
  });
92552
- service.setPluginVersion("0.0.18-beta-8614cb2a91-260625201617");
92491
+ service.setPluginVersion("0.0.18");
92553
92492
  await service.init();
92554
92493
  const pluginVersionStatus = service.pluginVersionStatus;
92555
92494
  if (pluginVersionStatus.unavailable) {
92556
92495
  throw new Error(
92557
- `@okxweb3/a2a-node v${"0.0.18-beta-8614cb2a91-260625201617"} is below the required minimum v${pluginVersionStatus.minVersion}`
92496
+ `@okxweb3/a2a-node v${"0.0.18"} is below the required minimum v${pluginVersionStatus.minVersion}`
92558
92497
  );
92559
92498
  }
92560
92499
  const systemConfig = service.getSystemConfig();
@@ -92572,7 +92511,7 @@ async function runListenerWithLock(options, paths) {
92572
92511
  onchainosAgentId: "*",
92573
92512
  reason: "system-config missing sentryDsn",
92574
92513
  pluginId: "@okxweb3/a2a-node",
92575
- pluginVersion: "0.0.18-beta-8614cb2a91-260625201617"
92514
+ pluginVersion: "0.0.18"
92576
92515
  });
92577
92516
  }
92578
92517
  logWithTimestamp(
@@ -95684,7 +95623,7 @@ async function getCurrentNodeCliVersion() {
95684
95623
  return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
95685
95624
  }
95686
95625
  function getBundledNodeCliVersion() {
95687
- return true ? "0.0.18-beta-8614cb2a91-260625201617" : null;
95626
+ return true ? "0.0.18" : null;
95688
95627
  }
95689
95628
  function readConfiguredAiProvider() {
95690
95629
  const explicit = process.env.OKX_AGENT_TASK_AI_CLI ?? process.env.OKX_A2A_AI_PROVIDER;
@@ -96517,7 +96456,7 @@ init_sentry_logger();
96517
96456
  init_sentry_config();
96518
96457
  var CURRENT_GATEWAY_SESSION_KEYS_ENV2 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
96519
96458
  function printUsage2() {
96520
- console.log(`okx-a2a ${"0.0.18-beta-8614cb2a91-260625201617"}
96459
+ console.log(`okx-a2a ${"0.0.18"}
96521
96460
 
96522
96461
  Usage:
96523
96462
  okx-a2a <command> [options]
@@ -96554,7 +96493,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
96554
96493
  `);
96555
96494
  }
96556
96495
  function printVersion() {
96557
- console.log("0.0.18-beta-8614cb2a91-260625201617");
96496
+ console.log("0.0.18");
96558
96497
  }
96559
96498
  function printDaemonUsage() {
96560
96499
  console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
package/dist/index.js CHANGED
@@ -86421,7 +86421,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
86421
86421
  client: {
86422
86422
  id: "gateway-client",
86423
86423
  displayName: "okx-a2a-node",
86424
- version: "0.0.18-beta-8614cb2a91-260625201617",
86424
+ version: "0.0.18",
86425
86425
  platform: "node",
86426
86426
  mode: "backend",
86427
86427
  instanceId
@@ -86432,7 +86432,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
86432
86432
  commands: [],
86433
86433
  permissions: {},
86434
86434
  locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
86435
- userAgent: `okx-a2a-node/${"0.0.18-beta-8614cb2a91-260625201617"}`,
86435
+ userAgent: `okx-a2a-node/${"0.0.18"}`,
86436
86436
  auth: {
86437
86437
  ...config.token ? { token: config.token } : {},
86438
86438
  ...config.password ? { password: config.password } : {}
@@ -86568,7 +86568,7 @@ var ACTIVE_ORIGIN_TTL_MS = 30 * 6e4;
86568
86568
  function currentOpenClawGatewaySessionKey(env = process.env) {
86569
86569
  for (const candidate of currentOpenClawGatewaySessionCandidates(env)) {
86570
86570
  if (candidate.ok) {
86571
- return canonicalizeOpenClawGatewaySessionKey(candidate.sessionKey);
86571
+ return candidate.sessionKey;
86572
86572
  }
86573
86573
  }
86574
86574
  return null;
@@ -86593,12 +86593,11 @@ function bindOpenClawGatewayRouteFromEnv(store, input, env = process.env) {
86593
86593
  });
86594
86594
  continue;
86595
86595
  }
86596
- const sessionKey = canonicalizeOpenClawGatewaySessionKey(candidate.sessionKey);
86597
- const channel = channelFromOpenClawGatewaySessionKey(sessionKey);
86596
+ const channel = channelFromOpenClawGatewaySessionKey(candidate.sessionKey);
86598
86597
  if (!channel) {
86599
86598
  logOpenClawRouteSkip("invalid_gateway_session_key", {
86600
86599
  jobId,
86601
- sessionKey,
86600
+ sessionKey: candidate.sessionKey,
86602
86601
  existingRoute: resolveOpenClawGatewayRoute(store, { jobId })
86603
86602
  });
86604
86603
  continue;
@@ -86608,7 +86607,7 @@ function bindOpenClawGatewayRouteFromEnv(store, input, env = process.env) {
86608
86607
  firstBound ??= existingRoute.gatewaySessionKey || existingRoute.sessionKey || null;
86609
86608
  continue;
86610
86609
  }
86611
- const route = buildOpenClawRouteEntry(sessionKey, channel);
86610
+ const route = buildOpenClawRouteEntry(candidate.sessionKey, channel);
86612
86611
  routes = [...routes, route];
86613
86612
  const binding = store.upsertJobGatewayRoute({ jobId, provider: "openclaw", route });
86614
86613
  if (binding.provider !== "openclaw") {
@@ -86695,9 +86694,7 @@ function readOpenClawRouteEntries(store, jobId) {
86695
86694
  const channelOrder = [];
86696
86695
  const routeByChannel = /* @__PURE__ */ new Map();
86697
86696
  for (const route of routes) {
86698
- const sessionKey = canonicalizeOpenClawGatewaySessionKey(
86699
- normalizeText(route.gatewaySessionKey) ?? normalizeText(route.sessionKey) ?? ""
86700
- );
86697
+ const sessionKey = normalizeText(route.gatewaySessionKey) ?? normalizeText(route.sessionKey);
86701
86698
  const channel = channelFromOpenClawGatewaySessionKey(sessionKey);
86702
86699
  if (!sessionKey || !channel) {
86703
86700
  continue;
@@ -86750,70 +86747,20 @@ function parseOpenClawGatewaySessionKey(sessionKey) {
86750
86747
  };
86751
86748
  }
86752
86749
  if (platform === "telegram" && targetKind === "direct") {
86753
- const threadId = parseTelegramTopicSuffix(parts.slice(5));
86754
- return {
86755
- ...parts[4] ? { chatId: parts[4] } : {},
86756
- ...threadId ? { threadId } : {},
86757
- chatType: "dm"
86758
- };
86759
- }
86760
- if (platform === "telegram" && targetKind === "dm") {
86761
- const threadId = parseTelegramTopicSuffix(parts.slice(5));
86762
86750
  return {
86763
86751
  ...parts[4] ? { chatId: parts[4] } : {},
86764
- ...threadId ? { threadId } : {},
86765
86752
  chatType: "dm"
86766
86753
  };
86767
86754
  }
86768
86755
  if (platform === "telegram" && targetKind === "group") {
86769
- const threadId = parts[5] === "topic" ? parts[6] : parts[5];
86770
86756
  return {
86771
86757
  ...parts[4] ? { chatId: parts[4] } : {},
86772
- ...threadId ? { threadId } : {},
86773
- chatType: threadId ? "thread" : "group"
86758
+ ...parts[6] ? { threadId: parts[6] } : {},
86759
+ chatType: parts[6] ? "thread" : "group"
86774
86760
  };
86775
86761
  }
86776
86762
  return {};
86777
86763
  }
86778
- function canonicalizeOpenClawGatewaySessionKey(sessionKey) {
86779
- const key = normalizeText(sessionKey);
86780
- if (!key) {
86781
- return sessionKey;
86782
- }
86783
- const parts = key.split(":");
86784
- if (parts.length < 4 || parts[0] !== "agent") {
86785
- return key;
86786
- }
86787
- const platform = parts[2];
86788
- const targetKind = parts[3];
86789
- if (platform !== "telegram") {
86790
- return key;
86791
- }
86792
- if ((targetKind === "direct" || targetKind === "dm") && parts[4]) {
86793
- const threadId = parseTelegramTopicSuffix(parts.slice(5));
86794
- return threadId ? `agent:${parts[1]}:telegram:direct:${parts[4]}:topic:${threadId}` : `agent:${parts[1]}:telegram:direct:${parts[4]}`;
86795
- }
86796
- if (targetKind === "group" && parts[4]) {
86797
- const threadId = parts[5] === "topic" ? parts[6] : parts[5];
86798
- return threadId ? `agent:${parts[1]}:telegram:group:${parts[4]}:topic:${threadId}` : `agent:${parts[1]}:telegram:group:${parts[4]}`;
86799
- }
86800
- return key;
86801
- }
86802
- function parseTelegramTopicSuffix(parts) {
86803
- if (parts.length === 0) {
86804
- return void 0;
86805
- }
86806
- if (parts[0] === "topic") {
86807
- return parts[1] || void 0;
86808
- }
86809
- if (parts[0] === "thread") {
86810
- if (parts.length >= 3) {
86811
- return parts.slice(2).join(":") || void 0;
86812
- }
86813
- return parts[1] || void 0;
86814
- }
86815
- return parts[0] || void 0;
86816
- }
86817
86764
  function validateOpenClawGatewaySessionKey(sessionKey) {
86818
86765
  const key = normalizeText(sessionKey);
86819
86766
  if (!key) {
@@ -86853,16 +86800,10 @@ function deriveOpenClawGatewaySessionKey(input) {
86853
86800
  const chatId = encodeURIComponent(input.chatId);
86854
86801
  const threadId = input.threadId ? encodeURIComponent(input.threadId) : "";
86855
86802
  if (input.platform === "telegram") {
86856
- if (!threadId) {
86857
- return `agent:main:telegram:direct:${chatId}`;
86858
- }
86859
- return isTelegramGroupChatId(input.chatId) ? `agent:main:telegram:group:${chatId}:topic:${threadId}` : `agent:main:telegram:direct:${chatId}:topic:${threadId}`;
86803
+ return threadId ? `agent:main:telegram:group:${chatId}:topic:${threadId}` : `agent:main:telegram:direct:${chatId}`;
86860
86804
  }
86861
86805
  return threadId ? `agent:main:${input.platform}:thread:${chatId}:${threadId}` : `agent:main:${input.platform}:dm:${chatId}`;
86862
86806
  }
86863
- function isTelegramGroupChatId(chatId) {
86864
- return chatId.startsWith("-") || chatId.startsWith("@");
86865
- }
86866
86807
  function readGatewaySessionKeysEnv(env) {
86867
86808
  const raw = normalizeText(env[CURRENT_GATEWAY_SESSION_KEYS_ENV]);
86868
86809
  if (!raw) {
@@ -90202,13 +90143,11 @@ async function processFileMessage(ctx, deps, options = {}) {
90202
90143
  reason: "unknown_group_without_session",
90203
90144
  ...timing.extras()
90204
90145
  });
90205
- if (!options.skipNotify) {
90206
- notifyPendingConversationToBackup({
90207
- deps,
90208
- jobId: route.jobId,
90209
- messageId: routedMessageId
90210
- });
90211
- }
90146
+ notifyPendingConversationToBackup({
90147
+ deps,
90148
+ jobId: route.jobId,
90149
+ messageId: routedMessageId
90150
+ });
90212
90151
  return true;
90213
90152
  }
90214
90153
  deps.sessionStore?.upsertSession({
@@ -90649,7 +90588,7 @@ function userWatchEventDeliveredSentryExtra(event) {
90649
90588
  var environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
90650
90589
  var SENTRY_CONFIG = {
90651
90590
  projectName: "okx/openclaw-okx-a2a-extension",
90652
- release: "0.0.18-beta-8614cb2a91-260625201617",
90591
+ release: "0.0.18",
90653
90592
  environment
90654
90593
  };
90655
90594
 
@@ -90876,12 +90815,12 @@ async function runListenerWithLock(options, paths) {
90876
90815
  }));
90877
90816
  }
90878
90817
  });
90879
- service.setPluginVersion("0.0.18-beta-8614cb2a91-260625201617");
90818
+ service.setPluginVersion("0.0.18");
90880
90819
  await service.init();
90881
90820
  const pluginVersionStatus = service.pluginVersionStatus;
90882
90821
  if (pluginVersionStatus.unavailable) {
90883
90822
  throw new Error(
90884
- `@okxweb3/a2a-node v${"0.0.18-beta-8614cb2a91-260625201617"} is below the required minimum v${pluginVersionStatus.minVersion}`
90823
+ `@okxweb3/a2a-node v${"0.0.18"} is below the required minimum v${pluginVersionStatus.minVersion}`
90885
90824
  );
90886
90825
  }
90887
90826
  const systemConfig = service.getSystemConfig();
@@ -90899,7 +90838,7 @@ async function runListenerWithLock(options, paths) {
90899
90838
  onchainosAgentId: "*",
90900
90839
  reason: "system-config missing sentryDsn",
90901
90840
  pluginId: "@okxweb3/a2a-node",
90902
- pluginVersion: "0.0.18-beta-8614cb2a91-260625201617"
90841
+ pluginVersion: "0.0.18"
90903
90842
  });
90904
90843
  }
90905
90844
  logWithTimestamp(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okxweb3/a2a-node",
3
- "version": "0.0.18-beta-8614cb2a91-260625201617",
3
+ "version": "0.0.18",
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": {