@okxweb3/a2a-node 0.0.6-beta-38940d220c-260612154925 → 0.0.6

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 +34 -33
  2. package/dist/index.js +34 -33
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -18444,7 +18444,7 @@ var init_sentry_config = __esm({
18444
18444
  environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
18445
18445
  SENTRY_CONFIG = {
18446
18446
  projectName: "okx/openclaw-okx-a2a-extension",
18447
- release: "0.0.6-beta-38940d220c-260612154925",
18447
+ release: "0.0.6",
18448
18448
  environment
18449
18449
  };
18450
18450
  }
@@ -82352,7 +82352,7 @@ function classifyAiDispatchError(message) {
82352
82352
  return "permission_denied";
82353
82353
  }
82354
82354
  if (normalized.includes("timed out") || normalized.includes("timeout")) {
82355
- return "timeout";
82355
+ return "provider_timeout";
82356
82356
  }
82357
82357
  if (normalized.includes("rate limit") || normalized.includes("too many requests")) {
82358
82358
  return "rate_limited";
@@ -82365,8 +82365,29 @@ function classifyAiDispatchError(message) {
82365
82365
  }
82366
82366
  return "unknown";
82367
82367
  }
82368
+ function classifyAiRunFailureType(input) {
82369
+ const outputErrorType = classifyAiDispatchError(input.output);
82370
+ if (outputErrorType !== "unknown") {
82371
+ return outputErrorType;
82372
+ }
82373
+ return input.timedOut ? "provider_timeout" : void 0;
82374
+ }
82375
+ function formatAiTimeoutReason(timeoutMs, hadProviderOutput) {
82376
+ if (hadProviderOutput) {
82377
+ return [
82378
+ `CLI exceeded the ${timeoutMs}ms timeout while still producing output`,
82379
+ "this usually means the provider was slow or stuck, not necessarily logged out"
82380
+ ].join("; ");
82381
+ }
82382
+ return `timed out after ${timeoutMs}ms`;
82383
+ }
82368
82384
  function isAiProviderAuthFailure(normalized) {
82369
- return normalized.includes("authentication_failed") || normalized.includes("not authenticated") || normalized.includes("authentication required") || normalized.includes("chatgpt authentication required") || normalized.includes("not logged in") || normalized.includes("login required") || normalized.includes("please log in") || normalized.includes("please login") || normalized.includes("please run /login") || normalized.includes('"apikeysource":"none"') || normalized.includes('"apikeysource": "none"') || normalized.includes("run codex login") || normalized.includes("run claude login") || normalized.includes("authorization failed") || normalized.includes("unauthorized") || normalized.includes("missing or invalid basic authentication") || normalized.includes("invalid token") || normalized.includes("invalid api key");
82385
+ 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");
82386
+ if (hasStrongProviderAuthMarker) {
82387
+ return true;
82388
+ }
82389
+ 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");
82390
+ 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"));
82370
82391
  }
82371
82392
  function isMissingResumeSessionFailure(input) {
82372
82393
  if (input.provider !== "codex" && input.provider !== "claude" || !input.existingAiSessionId || input.timedOut || input.exitCode === 0) {
@@ -82726,7 +82747,10 @@ var init_ai_runner = __esm({
82726
82747
  toolFailures.processLine(trailingStdoutLine);
82727
82748
  }
82728
82749
  const fullOutputForClassification = [stderrFull, stdoutFull].filter(Boolean).join("\n");
82729
- const fullOutputErrorType = classifyAiDispatchError(fullOutputForClassification);
82750
+ const fullOutputErrorType = classifyAiRunFailureType({
82751
+ output: fullOutputForClassification,
82752
+ timedOut
82753
+ });
82730
82754
  const runFailureContext = {
82731
82755
  provider,
82732
82756
  toolFailures: [...toolFailures.failures],
@@ -82735,7 +82759,7 @@ var init_ai_runner = __esm({
82735
82759
  exitCode,
82736
82760
  closeSignal: closeResult.signal,
82737
82761
  timedOut,
82738
- errorType: fullOutputErrorType === "unknown" ? void 0 : fullOutputErrorType
82762
+ errorType: fullOutputErrorType
82739
82763
  };
82740
82764
  await this.reportAiToolFailures(toolFailures.failures, {
82741
82765
  source: request.source,
@@ -82841,6 +82865,7 @@ var init_ai_runner = __esm({
82841
82865
  return this.runAi(request, enqueuedAt, triggeredAt, true);
82842
82866
  }
82843
82867
  if (timedOut) {
82868
+ const timeoutReason = formatAiTimeoutReason(timeoutMs, firstStdoutAt !== null || firstStderrAt !== null);
82844
82869
  logger.error(
82845
82870
  LogEvent.AI_RUN_TIMEOUT,
82846
82871
  new Error(`${provider} AI run timed out after ${timeoutMs}ms`),
@@ -82849,7 +82874,7 @@ var init_ai_runner = __esm({
82849
82874
  throw buildAiRunFailureError(formatAiCliFailure({
82850
82875
  provider,
82851
82876
  target: this.formatRunTarget(request),
82852
- reason: `timed out after ${timeoutMs}ms`,
82877
+ reason: timeoutReason,
82853
82878
  stderrText,
82854
82879
  stdoutText,
82855
82880
  logPath
@@ -83006,30 +83031,6 @@ var init_ai_runner = __esm({
83006
83031
  });
83007
83032
  }
83008
83033
  }
83009
- buildArgs(provider, event, aiSessionId, cwd = this.resolveAiWorkingDir()) {
83010
- const sessionKey = buildDispatchSessionKey(event.jobId, event.sessionAgentId);
83011
- return this.buildRunArgs(provider, {
83012
- source: "job-dispatch",
83013
- sessionKey,
83014
- prompt: this.buildPrompt(event),
83015
- jobId: event.jobId,
83016
- agentId: event.sessionAgentId,
83017
- messageId: event.message.id,
83018
- jobFilePath: event.jobFilePath,
83019
- sessionAgentId: event.sessionAgentId
83020
- }, aiSessionId, cwd);
83021
- }
83022
- buildSessionArgs(provider, event, aiSessionId, cwd = this.resolveAiWorkingDir()) {
83023
- const messageId = event.messageId ?? `session-${Date.now()}`;
83024
- return this.buildRunArgs(provider, {
83025
- source: "session-message",
83026
- sessionKey: event.sessionKey,
83027
- prompt: this.buildSessionPrompt({ ...event, messageId }),
83028
- jobId: event.jobId,
83029
- agentId: event.agentId,
83030
- messageId
83031
- }, aiSessionId, cwd);
83032
- }
83033
83034
  buildRunArgs(provider, request, aiSessionId, cwd = this.resolveAiWorkingDir()) {
83034
83035
  const permissionPreset = this.resolveAiPermissionPresetForRun();
83035
83036
  const prompt = provider === "codex" ? buildCodexToolFailureContractPrompt(request.prompt) : request.prompt;
@@ -84846,12 +84847,12 @@ async function runListenerWithLock(options, paths) {
84846
84847
  }));
84847
84848
  }
84848
84849
  });
84849
- service.setPluginVersion("0.0.6-beta-38940d220c-260612154925");
84850
+ service.setPluginVersion("0.0.6");
84850
84851
  await service.init();
84851
84852
  const pluginVersionStatus = service.pluginVersionStatus;
84852
84853
  if (pluginVersionStatus.unavailable) {
84853
84854
  throw new Error(
84854
- `@okxweb3/a2a-node v${"0.0.6-beta-38940d220c-260612154925"} is below the required minimum v${pluginVersionStatus.minVersion}`
84855
+ `@okxweb3/a2a-node v${"0.0.6"} is below the required minimum v${pluginVersionStatus.minVersion}`
84855
84856
  );
84856
84857
  }
84857
84858
  const systemConfig = service.getSystemConfig();
@@ -84869,7 +84870,7 @@ async function runListenerWithLock(options, paths) {
84869
84870
  onchainosAgentId: "*",
84870
84871
  reason: "system-config missing sentryDsn",
84871
84872
  pluginId: "@okxweb3/a2a-node",
84872
- pluginVersion: "0.0.6-beta-38940d220c-260612154925"
84873
+ pluginVersion: "0.0.6"
84873
84874
  });
84874
84875
  }
84875
84876
  console.log(
package/dist/index.js CHANGED
@@ -68021,7 +68021,10 @@ var AiRunner = class {
68021
68021
  toolFailures.processLine(trailingStdoutLine);
68022
68022
  }
68023
68023
  const fullOutputForClassification = [stderrFull, stdoutFull].filter(Boolean).join("\n");
68024
- const fullOutputErrorType = classifyAiDispatchError(fullOutputForClassification);
68024
+ const fullOutputErrorType = classifyAiRunFailureType({
68025
+ output: fullOutputForClassification,
68026
+ timedOut
68027
+ });
68025
68028
  const runFailureContext = {
68026
68029
  provider,
68027
68030
  toolFailures: [...toolFailures.failures],
@@ -68030,7 +68033,7 @@ var AiRunner = class {
68030
68033
  exitCode,
68031
68034
  closeSignal: closeResult.signal,
68032
68035
  timedOut,
68033
- errorType: fullOutputErrorType === "unknown" ? void 0 : fullOutputErrorType
68036
+ errorType: fullOutputErrorType
68034
68037
  };
68035
68038
  await this.reportAiToolFailures(toolFailures.failures, {
68036
68039
  source: request.source,
@@ -68136,6 +68139,7 @@ var AiRunner = class {
68136
68139
  return this.runAi(request, enqueuedAt, triggeredAt, true);
68137
68140
  }
68138
68141
  if (timedOut) {
68142
+ const timeoutReason = formatAiTimeoutReason(timeoutMs, firstStdoutAt !== null || firstStderrAt !== null);
68139
68143
  logger.error(
68140
68144
  LogEvent.AI_RUN_TIMEOUT,
68141
68145
  new Error(`${provider} AI run timed out after ${timeoutMs}ms`),
@@ -68144,7 +68148,7 @@ var AiRunner = class {
68144
68148
  throw buildAiRunFailureError(formatAiCliFailure({
68145
68149
  provider,
68146
68150
  target: this.formatRunTarget(request),
68147
- reason: `timed out after ${timeoutMs}ms`,
68151
+ reason: timeoutReason,
68148
68152
  stderrText,
68149
68153
  stdoutText,
68150
68154
  logPath
@@ -68301,30 +68305,6 @@ var AiRunner = class {
68301
68305
  });
68302
68306
  }
68303
68307
  }
68304
- buildArgs(provider, event, aiSessionId, cwd = this.resolveAiWorkingDir()) {
68305
- const sessionKey = buildDispatchSessionKey(event.jobId, event.sessionAgentId);
68306
- return this.buildRunArgs(provider, {
68307
- source: "job-dispatch",
68308
- sessionKey,
68309
- prompt: this.buildPrompt(event),
68310
- jobId: event.jobId,
68311
- agentId: event.sessionAgentId,
68312
- messageId: event.message.id,
68313
- jobFilePath: event.jobFilePath,
68314
- sessionAgentId: event.sessionAgentId
68315
- }, aiSessionId, cwd);
68316
- }
68317
- buildSessionArgs(provider, event, aiSessionId, cwd = this.resolveAiWorkingDir()) {
68318
- const messageId = event.messageId ?? `session-${Date.now()}`;
68319
- return this.buildRunArgs(provider, {
68320
- source: "session-message",
68321
- sessionKey: event.sessionKey,
68322
- prompt: this.buildSessionPrompt({ ...event, messageId }),
68323
- jobId: event.jobId,
68324
- agentId: event.agentId,
68325
- messageId
68326
- }, aiSessionId, cwd);
68327
- }
68328
68308
  buildRunArgs(provider, request, aiSessionId, cwd = this.resolveAiWorkingDir()) {
68329
68309
  const permissionPreset = this.resolveAiPermissionPresetForRun();
68330
68310
  const prompt = provider === "codex" ? buildCodexToolFailureContractPrompt(request.prompt) : request.prompt;
@@ -69756,7 +69736,7 @@ function classifyAiDispatchError(message) {
69756
69736
  return "permission_denied";
69757
69737
  }
69758
69738
  if (normalized.includes("timed out") || normalized.includes("timeout")) {
69759
- return "timeout";
69739
+ return "provider_timeout";
69760
69740
  }
69761
69741
  if (normalized.includes("rate limit") || normalized.includes("too many requests")) {
69762
69742
  return "rate_limited";
@@ -69769,8 +69749,29 @@ function classifyAiDispatchError(message) {
69769
69749
  }
69770
69750
  return "unknown";
69771
69751
  }
69752
+ function classifyAiRunFailureType(input) {
69753
+ const outputErrorType = classifyAiDispatchError(input.output);
69754
+ if (outputErrorType !== "unknown") {
69755
+ return outputErrorType;
69756
+ }
69757
+ return input.timedOut ? "provider_timeout" : void 0;
69758
+ }
69759
+ function formatAiTimeoutReason(timeoutMs, hadProviderOutput) {
69760
+ if (hadProviderOutput) {
69761
+ return [
69762
+ `CLI exceeded the ${timeoutMs}ms timeout while still producing output`,
69763
+ "this usually means the provider was slow or stuck, not necessarily logged out"
69764
+ ].join("; ");
69765
+ }
69766
+ return `timed out after ${timeoutMs}ms`;
69767
+ }
69772
69768
  function isAiProviderAuthFailure(normalized) {
69773
- return normalized.includes("authentication_failed") || normalized.includes("not authenticated") || normalized.includes("authentication required") || normalized.includes("chatgpt authentication required") || normalized.includes("not logged in") || normalized.includes("login required") || normalized.includes("please log in") || normalized.includes("please login") || normalized.includes("please run /login") || normalized.includes('"apikeysource":"none"') || normalized.includes('"apikeysource": "none"') || normalized.includes("run codex login") || normalized.includes("run claude login") || normalized.includes("authorization failed") || normalized.includes("unauthorized") || normalized.includes("missing or invalid basic authentication") || normalized.includes("invalid token") || normalized.includes("invalid api key");
69769
+ 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");
69770
+ if (hasStrongProviderAuthMarker) {
69771
+ return true;
69772
+ }
69773
+ 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");
69774
+ 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"));
69774
69775
  }
69775
69776
  function isMissingResumeSessionFailure(input) {
69776
69777
  if (input.provider !== "codex" && input.provider !== "claude" || !input.existingAiSessionId || input.timedOut || input.exitCode === 0) {
@@ -83433,7 +83434,7 @@ function startUserAttentionWatcherCoordinator(options) {
83433
83434
  var environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
83434
83435
  var SENTRY_CONFIG = {
83435
83436
  projectName: "okx/openclaw-okx-a2a-extension",
83436
- release: "0.0.6-beta-38940d220c-260612154925",
83437
+ release: "0.0.6",
83437
83438
  environment
83438
83439
  };
83439
83440
 
@@ -83552,12 +83553,12 @@ async function runListenerWithLock(options, paths) {
83552
83553
  }));
83553
83554
  }
83554
83555
  });
83555
- service.setPluginVersion("0.0.6-beta-38940d220c-260612154925");
83556
+ service.setPluginVersion("0.0.6");
83556
83557
  await service.init();
83557
83558
  const pluginVersionStatus = service.pluginVersionStatus;
83558
83559
  if (pluginVersionStatus.unavailable) {
83559
83560
  throw new Error(
83560
- `@okxweb3/a2a-node v${"0.0.6-beta-38940d220c-260612154925"} is below the required minimum v${pluginVersionStatus.minVersion}`
83561
+ `@okxweb3/a2a-node v${"0.0.6"} is below the required minimum v${pluginVersionStatus.minVersion}`
83561
83562
  );
83562
83563
  }
83563
83564
  const systemConfig = service.getSystemConfig();
@@ -83575,7 +83576,7 @@ async function runListenerWithLock(options, paths) {
83575
83576
  onchainosAgentId: "*",
83576
83577
  reason: "system-config missing sentryDsn",
83577
83578
  pluginId: "@okxweb3/a2a-node",
83578
- pluginVersion: "0.0.6-beta-38940d220c-260612154925"
83579
+ pluginVersion: "0.0.6"
83579
83580
  });
83580
83581
  }
83581
83582
  console.log(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okxweb3/a2a-node",
3
- "version": "0.0.6-beta-38940d220c-260612154925",
3
+ "version": "0.0.6",
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": {