@okxweb3/a2a-node 0.1.3-beta-5afe085f69-260701185206 → 0.1.3

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 +60 -20
  2. package/dist/index.js +57 -16
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -7894,7 +7894,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
7894
7894
  client: {
7895
7895
  id: "gateway-client",
7896
7896
  displayName: "okx-a2a-node",
7897
- version: "0.1.3-beta-5afe085f69-260701185206",
7897
+ version: "0.1.3",
7898
7898
  platform: "node",
7899
7899
  mode: "backend",
7900
7900
  instanceId
@@ -7905,7 +7905,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
7905
7905
  commands: [],
7906
7906
  permissions: {},
7907
7907
  locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
7908
- userAgent: `okx-a2a-node/${"0.1.3-beta-5afe085f69-260701185206"}`,
7908
+ userAgent: `okx-a2a-node/${"0.1.3"}`,
7909
7909
  auth: {
7910
7910
  ...config.token ? { token: config.token } : {},
7911
7911
  ...config.password ? { password: config.password } : {}
@@ -25125,7 +25125,7 @@ var init_sentry_config = __esm({
25125
25125
  environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
25126
25126
  SENTRY_CONFIG = {
25127
25127
  projectName: "okx/openclaw-okx-a2a-extension",
25128
- release: "0.1.3-beta-5afe085f69-260701185206",
25128
+ release: "0.1.3",
25129
25129
  environment
25130
25130
  };
25131
25131
  }
@@ -88736,10 +88736,11 @@ function parseCodexCommandExecutionFailure(item, rawEvent) {
88736
88736
  return null;
88737
88737
  }
88738
88738
  const output4 = typeof item.aggregated_output === "string" ? item.aggregated_output : "";
88739
+ const errorType = classifyAiDispatchError(output4);
88739
88740
  return enrichPermissionDetails({
88740
88741
  provider: "codex",
88741
88742
  tool: "command_execution",
88742
- errorType: classifyAiDispatchError(output4),
88743
+ errorType: errorType === "unknown" ? "tool_failed" : errorType,
88743
88744
  command: typeof item.command === "string" ? item.command : void 0,
88744
88745
  exitCode,
88745
88746
  status,
@@ -88966,10 +88967,11 @@ function parseClaudeToolFailure(event, rawEvent, claudeToolCommands) {
88966
88967
  if (!isError && (explicitExitCode === null || explicitExitCode === 0)) {
88967
88968
  return null;
88968
88969
  }
88970
+ const errorType = classifyAiDispatchError(output4);
88969
88971
  return enrichPermissionDetails({
88970
88972
  provider: "claude",
88971
88973
  tool: "Bash",
88972
- errorType: classifyAiDispatchError(output4),
88974
+ errorType: errorType === "unknown" ? "tool_failed" : errorType,
88973
88975
  command: toolResult?.toolUseId ? claudeToolCommands.get(toolResult.toolUseId) : void 0,
88974
88976
  exitCode: explicitExitCode,
88975
88977
  status: isError ? "error" : "failed",
@@ -89763,7 +89765,7 @@ function providerLoginCommand(provider) {
89763
89765
  }
89764
89766
  function classifyAiDispatchError(message) {
89765
89767
  const normalized = message.toLowerCase();
89766
- if (isAiProviderAuthFailure(normalized)) {
89768
+ if (isAiProviderAuthFailure(message)) {
89767
89769
  return "provider_auth_required";
89768
89770
  }
89769
89771
  if (normalized.includes("without producing any output")) {
@@ -89811,13 +89813,51 @@ function formatAiTimeoutReason(timeoutMs, hadProviderOutput) {
89811
89813
  }
89812
89814
  return `timed out after ${timeoutMs}ms`;
89813
89815
  }
89814
- function isAiProviderAuthFailure(normalized) {
89815
- const hasStrongProviderAuthMarker = normalized.includes("authentication_failed") || normalized.includes("not logged in") || normalized.includes("please run /login") || normalized.includes("run codex login") || normalized.includes("run claude login") || normalized.includes("chatgpt authentication required") || normalized.includes("codex account authentication required") || normalized.includes("missing or invalid basic authentication") || normalized.includes("oauth authorization failed");
89816
- if (hasStrongProviderAuthMarker) {
89817
- return true;
89816
+ function isAiProviderAuthFailure(message) {
89817
+ return providerAuthCandidateSegments(message).some((segment) => {
89818
+ const local = segment.toLowerCase();
89819
+ if (hasStrongProviderAuthMarker(local)) {
89820
+ return true;
89821
+ }
89822
+ return hasProviderAuthContext(local) && hasAuthFailurePhrase(local);
89823
+ });
89824
+ }
89825
+ function providerAuthCandidateSegments(message) {
89826
+ const lines = message.split(/\r?\n/).map((line) => line.trim()).filter(Boolean).filter((line) => !isAiGeneratedContentLine(line));
89827
+ const segments = [...lines];
89828
+ for (let index2 = 0; index2 < lines.length - 1; index2 += 1) {
89829
+ segments.push(`${lines[index2]}
89830
+ ${lines[index2 + 1]}`);
89831
+ }
89832
+ return segments;
89833
+ }
89834
+ function isAiGeneratedContentLine(line) {
89835
+ if (!line.startsWith("{")) {
89836
+ return false;
89837
+ }
89838
+ let parsed;
89839
+ try {
89840
+ parsed = JSON.parse(line);
89841
+ } catch {
89842
+ return false;
89843
+ }
89844
+ if (!isRecord2(parsed)) {
89845
+ return false;
89818
89846
  }
89819
- const hasProviderAuthContext = normalized.includes("codex account") || normalized.includes("claude code") || normalized.includes("chatgpt") || normalized.includes("openai") || normalized.includes("oauth") || normalized.includes("basic authentication") || normalized.includes("authentication credentials") || normalized.includes("account authentication");
89820
- return hasProviderAuthContext && (normalized.includes("not authenticated") || normalized.includes("authentication required") || normalized.includes("login required") || normalized.includes("please log in") || normalized.includes("please login") || normalized.includes("authorization failed") || normalized.includes("unauthorized") || normalized.includes("invalid token") || normalized.includes("invalid api key"));
89847
+ if (parsed.type === "item.completed" && isRecord2(parsed.item)) {
89848
+ const itemType = parsed.item.type;
89849
+ return itemType === "agent_message" || itemType === "command_execution";
89850
+ }
89851
+ return parsed.type === "assistant" || parsed.type === "user";
89852
+ }
89853
+ function hasProviderAuthContext(normalized) {
89854
+ return normalized.includes("codex") || normalized.includes("claude") || normalized.includes("chatgpt") || normalized.includes("openai") || normalized.includes("oauth") || normalized.includes("basic authentication") || normalized.includes("authentication credentials") || normalized.includes("account authentication");
89855
+ }
89856
+ function hasStrongProviderAuthMarker(normalized) {
89857
+ return normalized.includes("authentication_failed") || normalized.includes("please run /login") || normalized.includes("run codex login") || normalized.includes("run claude login") || normalized.includes("chatgpt authentication required") || normalized.includes("codex account authentication required") || normalized.includes("missing or invalid basic authentication") || normalized.includes("oauth authorization failed");
89858
+ }
89859
+ function hasAuthFailurePhrase(normalized) {
89860
+ return normalized.includes("not logged in") || normalized.includes("not authenticated") || normalized.includes("authentication required") || normalized.includes("login required") || normalized.includes("please log in") || normalized.includes("please login") || normalized.includes("authorization failed") || normalized.includes("unauthorized") || normalized.includes("invalid token") || normalized.includes("invalid api key");
89821
89861
  }
89822
89862
  function isMissingResumeSessionFailure(input) {
89823
89863
  if (input.provider !== "codex" && input.provider !== "claude" || !input.existingAiSessionId || input.timedOut || input.exitCode === 0) {
@@ -90206,6 +90246,7 @@ var init_ai_runner = __esm({
90206
90246
  exitCode
90207
90247
  });
90208
90248
  const detectedToolFailures = syntheticToolFailure ? [...toolFailures.failures, syntheticToolFailure] : toolFailures.failures;
90249
+ const runFailureErrorType = fullOutputErrorType ?? detectedToolFailures.at(-1)?.errorType;
90209
90250
  const runFailureContext = {
90210
90251
  provider,
90211
90252
  toolFailures: [...detectedToolFailures],
@@ -90214,7 +90255,7 @@ var init_ai_runner = __esm({
90214
90255
  exitCode,
90215
90256
  closeSignal: closeResult.signal,
90216
90257
  timedOut,
90217
- errorType: fullOutputErrorType
90258
+ errorType: runFailureErrorType
90218
90259
  };
90219
90260
  await this.reportAiToolFailures(detectedToolFailures, {
90220
90261
  source: request.source,
@@ -93146,12 +93187,12 @@ async function runListenerWithLock(options, paths) {
93146
93187
  }));
93147
93188
  }
93148
93189
  });
93149
- service.setPluginVersion("0.1.3-beta-5afe085f69-260701185206");
93190
+ service.setPluginVersion("0.1.3");
93150
93191
  await service.init();
93151
93192
  const pluginVersionStatus = service.pluginVersionStatus;
93152
93193
  if (pluginVersionStatus.unavailable) {
93153
93194
  throw new Error(
93154
- `@okxweb3/a2a-node v${"0.1.3-beta-5afe085f69-260701185206"} is below the required minimum v${pluginVersionStatus.minVersion}`
93195
+ `@okxweb3/a2a-node v${"0.1.3"} is below the required minimum v${pluginVersionStatus.minVersion}`
93155
93196
  );
93156
93197
  }
93157
93198
  const systemConfig = service.getSystemConfig();
@@ -93169,7 +93210,7 @@ async function runListenerWithLock(options, paths) {
93169
93210
  onchainosAgentId: "*",
93170
93211
  reason: "system-config missing sentryDsn",
93171
93212
  pluginId: "@okxweb3/a2a-node",
93172
- pluginVersion: "0.1.3-beta-5afe085f69-260701185206"
93213
+ pluginVersion: "0.1.3"
93173
93214
  });
93174
93215
  }
93175
93216
  logWithTimestamp(
@@ -96761,7 +96802,7 @@ async function getCurrentNodeCliVersion() {
96761
96802
  return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
96762
96803
  }
96763
96804
  function getBundledNodeCliVersion() {
96764
- return true ? "0.1.3-beta-5afe085f69-260701185206" : null;
96805
+ return true ? "0.1.3" : null;
96765
96806
  }
96766
96807
  function readConfiguredAiProvider() {
96767
96808
  const explicit = process.env.OKX_A2A_AI_PROVIDER || process.env.OKX_AGENT_TASK_AI_CLI;
@@ -97669,7 +97710,7 @@ init_sentry_logger();
97669
97710
  init_sentry_config();
97670
97711
  var CURRENT_GATEWAY_SESSION_KEYS_ENV3 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
97671
97712
  function printUsage2() {
97672
- console.log(`okx-a2a ${"0.1.3-beta-5afe085f69-260701185206"}
97713
+ console.log(`okx-a2a ${"0.1.3"}
97673
97714
 
97674
97715
  Usage:
97675
97716
  okx-a2a <command> [options]
@@ -97706,7 +97747,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
97706
97747
  `);
97707
97748
  }
97708
97749
  function printVersion() {
97709
- console.log("0.1.3-beta-5afe085f69-260701185206");
97750
+ console.log("0.1.3");
97710
97751
  }
97711
97752
  function printDaemonUsage() {
97712
97753
  console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
@@ -98088,7 +98129,6 @@ async function queueXmtpSend(args) {
98088
98129
  }
98089
98130
  if (!result.ok) {
98090
98131
  printXmtpSendCommandResult(json, result);
98091
- process.exitCode = 1;
98092
98132
  return;
98093
98133
  }
98094
98134
  printXmtpSendCommandResult(json, result);
package/dist/index.js CHANGED
@@ -72925,6 +72925,7 @@ var AiRunner = class {
72925
72925
  exitCode
72926
72926
  });
72927
72927
  const detectedToolFailures = syntheticToolFailure ? [...toolFailures.failures, syntheticToolFailure] : toolFailures.failures;
72928
+ const runFailureErrorType = fullOutputErrorType ?? detectedToolFailures.at(-1)?.errorType;
72928
72929
  const runFailureContext = {
72929
72930
  provider,
72930
72931
  toolFailures: [...detectedToolFailures],
@@ -72933,7 +72934,7 @@ var AiRunner = class {
72933
72934
  exitCode,
72934
72935
  closeSignal: closeResult.signal,
72935
72936
  timedOut,
72936
- errorType: fullOutputErrorType
72937
+ errorType: runFailureErrorType
72937
72938
  };
72938
72939
  await this.reportAiToolFailures(detectedToolFailures, {
72939
72940
  source: request.source,
@@ -73583,10 +73584,11 @@ function parseCodexCommandExecutionFailure(item, rawEvent) {
73583
73584
  return null;
73584
73585
  }
73585
73586
  const output = typeof item.aggregated_output === "string" ? item.aggregated_output : "";
73587
+ const errorType = classifyAiDispatchError(output);
73586
73588
  return enrichPermissionDetails({
73587
73589
  provider: "codex",
73588
73590
  tool: "command_execution",
73589
- errorType: classifyAiDispatchError(output),
73591
+ errorType: errorType === "unknown" ? "tool_failed" : errorType,
73590
73592
  command: typeof item.command === "string" ? item.command : void 0,
73591
73593
  exitCode,
73592
73594
  status,
@@ -73813,10 +73815,11 @@ function parseClaudeToolFailure(event, rawEvent, claudeToolCommands) {
73813
73815
  if (!isError && (explicitExitCode === null || explicitExitCode === 0)) {
73814
73816
  return null;
73815
73817
  }
73818
+ const errorType = classifyAiDispatchError(output);
73816
73819
  return enrichPermissionDetails({
73817
73820
  provider: "claude",
73818
73821
  tool: "Bash",
73819
- errorType: classifyAiDispatchError(output),
73822
+ errorType: errorType === "unknown" ? "tool_failed" : errorType,
73820
73823
  command: toolResult?.toolUseId ? claudeToolCommands.get(toolResult.toolUseId) : void 0,
73821
73824
  exitCode: explicitExitCode,
73822
73825
  status: isError ? "error" : "failed",
@@ -74610,7 +74613,7 @@ function providerLoginCommand(provider) {
74610
74613
  }
74611
74614
  function classifyAiDispatchError(message) {
74612
74615
  const normalized = message.toLowerCase();
74613
- if (isAiProviderAuthFailure(normalized)) {
74616
+ if (isAiProviderAuthFailure(message)) {
74614
74617
  return "provider_auth_required";
74615
74618
  }
74616
74619
  if (normalized.includes("without producing any output")) {
@@ -74658,13 +74661,51 @@ function formatAiTimeoutReason(timeoutMs, hadProviderOutput) {
74658
74661
  }
74659
74662
  return `timed out after ${timeoutMs}ms`;
74660
74663
  }
74661
- function isAiProviderAuthFailure(normalized) {
74662
- const hasStrongProviderAuthMarker = normalized.includes("authentication_failed") || normalized.includes("not logged in") || normalized.includes("please run /login") || normalized.includes("run codex login") || normalized.includes("run claude login") || normalized.includes("chatgpt authentication required") || normalized.includes("codex account authentication required") || normalized.includes("missing or invalid basic authentication") || normalized.includes("oauth authorization failed");
74663
- if (hasStrongProviderAuthMarker) {
74664
- return true;
74664
+ function isAiProviderAuthFailure(message) {
74665
+ return providerAuthCandidateSegments(message).some((segment) => {
74666
+ const local = segment.toLowerCase();
74667
+ if (hasStrongProviderAuthMarker(local)) {
74668
+ return true;
74669
+ }
74670
+ return hasProviderAuthContext(local) && hasAuthFailurePhrase(local);
74671
+ });
74672
+ }
74673
+ function providerAuthCandidateSegments(message) {
74674
+ const lines = message.split(/\r?\n/).map((line) => line.trim()).filter(Boolean).filter((line) => !isAiGeneratedContentLine(line));
74675
+ const segments = [...lines];
74676
+ for (let index2 = 0; index2 < lines.length - 1; index2 += 1) {
74677
+ segments.push(`${lines[index2]}
74678
+ ${lines[index2 + 1]}`);
74665
74679
  }
74666
- const hasProviderAuthContext = normalized.includes("codex account") || normalized.includes("claude code") || normalized.includes("chatgpt") || normalized.includes("openai") || normalized.includes("oauth") || normalized.includes("basic authentication") || normalized.includes("authentication credentials") || normalized.includes("account authentication");
74667
- return hasProviderAuthContext && (normalized.includes("not authenticated") || normalized.includes("authentication required") || normalized.includes("login required") || normalized.includes("please log in") || normalized.includes("please login") || normalized.includes("authorization failed") || normalized.includes("unauthorized") || normalized.includes("invalid token") || normalized.includes("invalid api key"));
74680
+ return segments;
74681
+ }
74682
+ function isAiGeneratedContentLine(line) {
74683
+ if (!line.startsWith("{")) {
74684
+ return false;
74685
+ }
74686
+ let parsed;
74687
+ try {
74688
+ parsed = JSON.parse(line);
74689
+ } catch {
74690
+ return false;
74691
+ }
74692
+ if (!isRecord(parsed)) {
74693
+ return false;
74694
+ }
74695
+ if (parsed.type === "item.completed" && isRecord(parsed.item)) {
74696
+ const itemType = parsed.item.type;
74697
+ return itemType === "agent_message" || itemType === "command_execution";
74698
+ }
74699
+ return parsed.type === "assistant" || parsed.type === "user";
74700
+ }
74701
+ function hasProviderAuthContext(normalized) {
74702
+ return normalized.includes("codex") || normalized.includes("claude") || normalized.includes("chatgpt") || normalized.includes("openai") || normalized.includes("oauth") || normalized.includes("basic authentication") || normalized.includes("authentication credentials") || normalized.includes("account authentication");
74703
+ }
74704
+ function hasStrongProviderAuthMarker(normalized) {
74705
+ return normalized.includes("authentication_failed") || normalized.includes("please run /login") || normalized.includes("run codex login") || normalized.includes("run claude login") || normalized.includes("chatgpt authentication required") || normalized.includes("codex account authentication required") || normalized.includes("missing or invalid basic authentication") || normalized.includes("oauth authorization failed");
74706
+ }
74707
+ function hasAuthFailurePhrase(normalized) {
74708
+ return normalized.includes("not logged in") || normalized.includes("not authenticated") || normalized.includes("authentication required") || normalized.includes("login required") || normalized.includes("please log in") || normalized.includes("please login") || normalized.includes("authorization failed") || normalized.includes("unauthorized") || normalized.includes("invalid token") || normalized.includes("invalid api key");
74668
74709
  }
74669
74710
  function isMissingResumeSessionFailure(input) {
74670
74711
  if (input.provider !== "codex" && input.provider !== "claude" || !input.existingAiSessionId || input.timedOut || input.exitCode === 0) {
@@ -86778,7 +86819,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
86778
86819
  client: {
86779
86820
  id: "gateway-client",
86780
86821
  displayName: "okx-a2a-node",
86781
- version: "0.1.3-beta-5afe085f69-260701185206",
86822
+ version: "0.1.3",
86782
86823
  platform: "node",
86783
86824
  mode: "backend",
86784
86825
  instanceId
@@ -86789,7 +86830,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
86789
86830
  commands: [],
86790
86831
  permissions: {},
86791
86832
  locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
86792
- userAgent: `okx-a2a-node/${"0.1.3-beta-5afe085f69-260701185206"}`,
86833
+ userAgent: `okx-a2a-node/${"0.1.3"}`,
86793
86834
  auth: {
86794
86835
  ...config.token ? { token: config.token } : {},
86795
86836
  ...config.password ? { password: config.password } : {}
@@ -91214,7 +91255,7 @@ function userWatchEventDeliveredSentryExtra(event) {
91214
91255
  var environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
91215
91256
  var SENTRY_CONFIG = {
91216
91257
  projectName: "okx/openclaw-okx-a2a-extension",
91217
- release: "0.1.3-beta-5afe085f69-260701185206",
91258
+ release: "0.1.3",
91218
91259
  environment
91219
91260
  };
91220
91261
 
@@ -91441,12 +91482,12 @@ async function runListenerWithLock(options, paths) {
91441
91482
  }));
91442
91483
  }
91443
91484
  });
91444
- service.setPluginVersion("0.1.3-beta-5afe085f69-260701185206");
91485
+ service.setPluginVersion("0.1.3");
91445
91486
  await service.init();
91446
91487
  const pluginVersionStatus = service.pluginVersionStatus;
91447
91488
  if (pluginVersionStatus.unavailable) {
91448
91489
  throw new Error(
91449
- `@okxweb3/a2a-node v${"0.1.3-beta-5afe085f69-260701185206"} is below the required minimum v${pluginVersionStatus.minVersion}`
91490
+ `@okxweb3/a2a-node v${"0.1.3"} is below the required minimum v${pluginVersionStatus.minVersion}`
91450
91491
  );
91451
91492
  }
91452
91493
  const systemConfig = service.getSystemConfig();
@@ -91464,7 +91505,7 @@ async function runListenerWithLock(options, paths) {
91464
91505
  onchainosAgentId: "*",
91465
91506
  reason: "system-config missing sentryDsn",
91466
91507
  pluginId: "@okxweb3/a2a-node",
91467
- pluginVersion: "0.1.3-beta-5afe085f69-260701185206"
91508
+ pluginVersion: "0.1.3"
91468
91509
  });
91469
91510
  }
91470
91511
  logWithTimestamp(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okxweb3/a2a-node",
3
- "version": "0.1.3-beta-5afe085f69-260701185206",
3
+ "version": "0.1.3",
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": {