@okxweb3/a2a-node 0.2.8-beta-174fcb5625-260819112349 → 0.2.8

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 +427 -58
  2. package/dist/index.js +419 -44
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1536,6 +1536,16 @@ var init_session_store = __esm({
1536
1536
  }
1537
1537
  return null;
1538
1538
  }
1539
+ setAiRuntimeSurface(surface) {
1540
+ if (surface !== "desktop" && surface !== "cli" && surface !== "unknown") {
1541
+ throw new Error(`Unsupported AI runtime surface: ${surface}`);
1542
+ }
1543
+ this.setSetting("ai_runtime_surface", surface);
1544
+ }
1545
+ getAiRuntimeSurface() {
1546
+ const value = this.getSetting("ai_runtime_surface");
1547
+ return value === "desktop" || value === "cli" || value === "unknown" ? value : null;
1548
+ }
1539
1549
  setAiProviderCommand(provider, command) {
1540
1550
  assertAiProvider(provider);
1541
1551
  assertNonEmpty(command, "command");
@@ -2691,7 +2701,7 @@ __export(autostart_exports, {
2691
2701
  uninstallSystemdAutostart: () => uninstallSystemdAutostart
2692
2702
  });
2693
2703
  function isSystemdManagerUnavailableMessage(message) {
2694
- return /spawn systemctl ENOENT|system has not been booted with systemd|failed to connect to bus/i.test(message);
2704
+ return /spawn systemctl ENOENT|system has not been booted with systemd|failed to connect to bus|systemctl shim:\s*unsupported unit\b/i.test(message);
2695
2705
  }
2696
2706
  function isAutostartManagerUnavailableError(error) {
2697
2707
  return error instanceof AutostartManagerUnavailableError || typeof error === "object" && error !== null && "code" in error && error.code === "AUTOSTART_MANAGER_UNAVAILABLE";
@@ -2821,35 +2831,81 @@ async function runSystemctl(args, options = {}) {
2821
2831
  throw new Error(message);
2822
2832
  }
2823
2833
  }
2824
- async function probeSystemdManager() {
2834
+ async function systemdRuntimePresence() {
2835
+ if (process.platform !== "linux") {
2836
+ return "unknown";
2837
+ }
2838
+ if ((0, import_node_fs6.existsSync)("/run/systemd/system")) {
2839
+ return "present";
2840
+ }
2841
+ const runtimeDir = process.env.XDG_RUNTIME_DIR?.trim();
2842
+ if (runtimeDir && (0, import_node_fs6.existsSync)((0, import_node_path9.join)(runtimeDir, "systemd"))) {
2843
+ return "present";
2844
+ }
2845
+ try {
2846
+ const initName = (await (0, import_promises3.readFile)("/proc/1/comm", "utf8")).trim();
2847
+ return initName === "systemd" ? "present" : "absent";
2848
+ } catch {
2849
+ return "unknown";
2850
+ }
2851
+ }
2852
+ function isDefinitiveSystemdUnavailableMessage(message) {
2853
+ return /spawn systemctl ENOENT|system has not been booted with systemd|systemctl shim:\s*unsupported unit\b/i.test(message);
2854
+ }
2855
+ async function classifyFailedSystemdProbe(message, options = {}) {
2856
+ if (isDefinitiveSystemdUnavailableMessage(message)) {
2857
+ return "unavailable";
2858
+ }
2859
+ if (options.previouslyAvailable) {
2860
+ return "unknown";
2861
+ }
2862
+ const runtime = await systemdRuntimePresence();
2863
+ if (runtime === "absent") {
2864
+ return "unavailable";
2865
+ }
2866
+ if (runtime === "present") {
2867
+ return "unknown";
2868
+ }
2869
+ return isSystemdManagerUnavailableMessage(message) ? "unavailable" : "unknown";
2870
+ }
2871
+ async function probeSystemdManager(options = {}) {
2825
2872
  const manager = await runSystemctl(["show", "--property=Version", "--value"], { tolerateFailure: true });
2826
2873
  if (!manager.ok) {
2827
2874
  const message = (manager.stderr || manager.stdout).trim();
2828
2875
  return {
2829
- managed: false,
2876
+ state: await classifyFailedSystemdProbe(message, options),
2830
2877
  message: message || "systemd user manager is unavailable"
2831
2878
  };
2832
2879
  }
2833
- return { managed: true };
2880
+ return { state: "available" };
2834
2881
  }
2835
- async function probeSystemdUnitOwnership() {
2836
- const manager = await probeSystemdManager();
2837
- if (!manager.managed) {
2838
- return manager;
2882
+ async function probeSystemdUnitOwnership(options = {}) {
2883
+ const manager = await probeSystemdManager({ previouslyAvailable: options.managerPreviouslyAvailable });
2884
+ if (manager.state !== "available") {
2885
+ return { state: manager.state, ...manager.message ? { message: manager.message } : {} };
2839
2886
  }
2840
2887
  const unit = await runSystemctl(
2841
2888
  ["show", SERVICE_NAME, "--property=LoadState", "--value"],
2842
2889
  { tolerateFailure: true }
2843
2890
  );
2844
2891
  const loadState = unit.stdout.trim().toLowerCase();
2845
- if (!unit.ok || loadState !== "loaded") {
2846
- const detail = (unit.stderr || unit.stdout).trim();
2892
+ if (unit.ok) {
2893
+ if (loadState === "loaded") {
2894
+ return { state: "managed" };
2895
+ }
2847
2896
  return {
2848
- managed: false,
2849
- message: detail || `systemd reports ${SERVICE_NAME} LoadState=${loadState || "unknown"}`
2897
+ state: "unmanaged",
2898
+ message: `systemd reports ${SERVICE_NAME} LoadState=${loadState || "unknown"}`
2850
2899
  };
2851
2900
  }
2852
- return { managed: true };
2901
+ const detail = (unit.stderr || unit.stdout).trim();
2902
+ if (loadState || isSystemdMissingServiceMessage(detail)) {
2903
+ return { state: "unmanaged", ...detail ? { message: detail } : {} };
2904
+ }
2905
+ return {
2906
+ state: await classifyFailedSystemdProbe(detail, { previouslyAvailable: true }),
2907
+ message: detail || `could not verify whether systemd manages ${SERVICE_NAME}`
2908
+ };
2853
2909
  }
2854
2910
  async function runLaunchctl(args, options = {}) {
2855
2911
  try {
@@ -2885,20 +2941,16 @@ async function installSystemdAutostart() {
2885
2941
  const paths = resolveSystemdAutostartPaths();
2886
2942
  const previousContent = (0, import_node_fs6.existsSync)(paths.servicePath) ? await (0, import_promises3.readFile)(paths.servicePath, "utf8") : null;
2887
2943
  const manager = await probeSystemdManager();
2888
- if (!manager.managed) {
2944
+ if (manager.state === "unavailable") {
2889
2945
  await (0, import_promises3.rm)(paths.servicePath, { force: true });
2890
2946
  throw new AutostartManagerUnavailableError(
2891
2947
  manager.message || "systemd user manager is unavailable"
2892
2948
  );
2893
2949
  }
2894
- if (previousContent !== null) {
2895
- const ownership = await probeSystemdUnitOwnership();
2896
- if (!ownership.managed) {
2897
- await (0, import_promises3.rm)(paths.servicePath, { force: true });
2898
- throw new AutostartManagerUnavailableError(
2899
- ownership.message || `systemd does not manage ${SERVICE_NAME}`
2900
- );
2901
- }
2950
+ if (manager.state === "unknown") {
2951
+ throw new Error(
2952
+ `could not verify systemd user manager availability${manager.message ? `: ${manager.message}` : ""}`
2953
+ );
2902
2954
  }
2903
2955
  await (0, import_promises3.mkdir)(paths.serviceDir, { recursive: true });
2904
2956
  await (0, import_promises3.writeFile)(paths.servicePath, buildSystemdUserService(), "utf8");
@@ -2906,11 +2958,21 @@ async function installSystemdAutostart() {
2906
2958
  await runSystemctl(["daemon-reload"]);
2907
2959
  await runSystemctl(["enable", "--now", SERVICE_NAME]);
2908
2960
  } catch (error) {
2909
- if (isAutostartManagerUnavailableError(error) || previousContent === null) {
2961
+ const managerAfterFailure = await probeSystemdManager({ previouslyAvailable: true });
2962
+ if (managerAfterFailure.state === "unavailable") {
2963
+ await (0, import_promises3.rm)(paths.servicePath, { force: true });
2964
+ throw new AutostartManagerUnavailableError(
2965
+ managerAfterFailure.message || (error instanceof Error ? error.message : String(error))
2966
+ );
2967
+ }
2968
+ if (previousContent === null) {
2910
2969
  await (0, import_promises3.rm)(paths.servicePath, { force: true });
2911
2970
  } else {
2912
2971
  await (0, import_promises3.writeFile)(paths.servicePath, previousContent, "utf8");
2913
2972
  }
2973
+ if (isAutostartManagerUnavailableError(error)) {
2974
+ throw new Error(error instanceof Error ? error.message : String(error));
2975
+ }
2914
2976
  throw error;
2915
2977
  }
2916
2978
  return { platform: "linux-systemd", path: paths.servicePath };
@@ -2941,7 +3003,7 @@ async function stopSystemdAutostart() {
2941
3003
  return {
2942
3004
  platform: "linux-systemd",
2943
3005
  path: paths.servicePath,
2944
- stopped: !missing,
3006
+ stopped: result.ok && !missing,
2945
3007
  ...message ? { message } : {}
2946
3008
  };
2947
3009
  }
@@ -2956,7 +3018,7 @@ async function restartSystemdAutostart() {
2956
3018
  };
2957
3019
  }
2958
3020
  const ownership = await probeSystemdUnitOwnership();
2959
- if (!ownership.managed) {
3021
+ if (ownership.state === "unavailable") {
2960
3022
  await (0, import_promises3.rm)(paths.servicePath, { force: true });
2961
3023
  return {
2962
3024
  platform: "linux-systemd",
@@ -2966,11 +3028,27 @@ async function restartSystemdAutostart() {
2966
3028
  ...ownership.message ? { message: ownership.message } : {}
2967
3029
  };
2968
3030
  }
3031
+ if (ownership.state === "unknown") {
3032
+ return {
3033
+ platform: "linux-systemd",
3034
+ path: paths.servicePath,
3035
+ restarted: false,
3036
+ message: ownership.message || `could not verify whether systemd manages ${SERVICE_NAME}`
3037
+ };
3038
+ }
3039
+ if (ownership.state === "unmanaged") {
3040
+ const installed = await installSystemdAutostart();
3041
+ return {
3042
+ ...installed,
3043
+ restarted: true,
3044
+ ...ownership.message ? { message: `systemd service was not loaded; reinstalled autostart. ${ownership.message}` } : {}
3045
+ };
3046
+ }
2969
3047
  const result = await runSystemctl(["restart", SERVICE_NAME], { tolerateFailure: true });
2970
3048
  const message = (result.stderr || result.stdout).trim();
2971
3049
  if (!result.ok) {
2972
- const ownershipAfterFailure = await probeSystemdUnitOwnership();
2973
- if (!ownershipAfterFailure.managed) {
3050
+ const ownershipAfterFailure = await probeSystemdUnitOwnership({ managerPreviouslyAvailable: true });
3051
+ if (ownershipAfterFailure.state === "unavailable") {
2974
3052
  await (0, import_promises3.rm)(paths.servicePath, { force: true });
2975
3053
  return {
2976
3054
  platform: "linux-systemd",
@@ -2980,6 +3058,14 @@ async function restartSystemdAutostart() {
2980
3058
  message: ownershipAfterFailure.message || message
2981
3059
  };
2982
3060
  }
3061
+ if (ownershipAfterFailure.state === "unmanaged") {
3062
+ const installed = await installSystemdAutostart();
3063
+ return {
3064
+ ...installed,
3065
+ restarted: true,
3066
+ message: ownershipAfterFailure.message || message
3067
+ };
3068
+ }
2983
3069
  }
2984
3070
  return {
2985
3071
  platform: "linux-systemd",
@@ -19874,6 +19960,7 @@ var init_events = __esm({
19874
19960
  PROVIDER_READINESS_CHECKED: "Provider readiness checked",
19875
19961
  PROVIDER_SWITCHED: "Provider switched",
19876
19962
  JOB_PROVIDER_BOUND: "Job provider bound",
19963
+ ONCHAINOS_VERSION_OBSERVED: "OnchainOS version observed",
19877
19964
  // Hermes user-channel delivery only. The node and openclaw user-channel hops
19878
19965
  // keep emitting USER_DISPATCHED / PROMPT_USER_CHECKPOINT — one name per
19879
19966
  // transport is the whole point of splitting the send events.
@@ -20410,7 +20497,84 @@ var init_error_diagnostics = __esm({
20410
20497
  }
20411
20498
  });
20412
20499
 
20500
+ // ../core/src/sentry-logger/runtime-metadata.ts
20501
+ function normalizeAiRuntimeProvider(provider) {
20502
+ const normalized = provider?.trim().toLowerCase();
20503
+ if (normalized === "codex") {
20504
+ return "codex";
20505
+ }
20506
+ if (normalized === "claude" || normalized === "claude-code") {
20507
+ return "claude-code";
20508
+ }
20509
+ if (normalized === "openclaw") {
20510
+ return "openclaw";
20511
+ }
20512
+ if (normalized === "hermes") {
20513
+ return "hermes";
20514
+ }
20515
+ return "unknown";
20516
+ }
20517
+ function detectAiRuntimeSurface(provider, env = process.env) {
20518
+ const override = env.OKX_A2A_RUNTIME_SURFACE?.trim().toLowerCase();
20519
+ if (override === "desktop" || override === "cli" || override === "unknown") {
20520
+ return override;
20521
+ }
20522
+ const normalizedProvider = normalizeAiRuntimeProvider(provider);
20523
+ if (normalizedProvider === "codex") {
20524
+ return env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE === "Codex Desktop" ? "desktop" : "cli";
20525
+ }
20526
+ if (normalizedProvider === "claude-code") {
20527
+ return env.CLAUDE_CODE_ENTRYPOINT?.trim().toLowerCase() === "remote_cowork" ? "desktop" : "cli";
20528
+ }
20529
+ return "unknown";
20530
+ }
20531
+ function parseOnchainosVersionOutput(output5) {
20532
+ const normalized = output5.trim().replace(/\s+/g, " ");
20533
+ if (!normalized) {
20534
+ return UNKNOWN_RUNTIME_METADATA;
20535
+ }
20536
+ const match = ` ${normalized} `.match(SEMVER_PATTERN);
20537
+ return match?.[1]?.slice(0, 128) ?? UNKNOWN_RUNTIME_METADATA;
20538
+ }
20539
+ function runtimeMetadataFields(input = {}) {
20540
+ const observedAt = Number(input.onchainosVersionObservedAtMs);
20541
+ return {
20542
+ aiProvider: normalizeAiRuntimeProvider(input.aiProvider),
20543
+ runtimeSurface: input.runtimeSurface === "desktop" || input.runtimeSurface === "cli" ? input.runtimeSurface : UNKNOWN_RUNTIME_METADATA,
20544
+ onchainosVersion: typeof input.onchainosVersion === "string" && input.onchainosVersion.trim() ? input.onchainosVersion.trim().slice(0, 128) : UNKNOWN_RUNTIME_METADATA,
20545
+ onchainosVersionObservedAtMs: Number.isFinite(observedAt) && observedAt > 0 ? String(Math.trunc(observedAt)) : "0",
20546
+ onchainosVersionProbeStatus: typeof input.onchainosVersionProbeStatus === "string" && input.onchainosVersionProbeStatus.trim() ? input.onchainosVersionProbeStatus.trim().toLowerCase().slice(0, 32) : UNKNOWN_RUNTIME_METADATA
20547
+ };
20548
+ }
20549
+ var UNKNOWN_RUNTIME_METADATA, SEMVER_PATTERN;
20550
+ var init_runtime_metadata = __esm({
20551
+ "../core/src/sentry-logger/runtime-metadata.ts"() {
20552
+ "use strict";
20553
+ UNKNOWN_RUNTIME_METADATA = "unknown";
20554
+ SEMVER_PATTERN = /(?:^|[^0-9])v?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)(?:$|[^0-9A-Za-z.-])/;
20555
+ }
20556
+ });
20557
+
20413
20558
  // ../core/src/sentry-logger/index.ts
20559
+ function setRuntimeMetadata(metadata) {
20560
+ const next = runtimeMetadataFields({
20561
+ ...RUNTIME_FIELDS,
20562
+ ...metadata
20563
+ });
20564
+ RUNTIME_FIELDS = next;
20565
+ try {
20566
+ Sentry.setTags({
20567
+ aiProvider: next.aiProvider,
20568
+ runtimeSurface: next.runtimeSurface,
20569
+ onchainosVersion: next.onchainosVersion,
20570
+ onchainosVersionProbeStatus: next.onchainosVersionProbeStatus
20571
+ });
20572
+ } catch {
20573
+ }
20574
+ }
20575
+ function getRuntimeMetadata() {
20576
+ return { ...RUNTIME_FIELDS };
20577
+ }
20414
20578
  function applyFatalEventDefaults(event) {
20415
20579
  try {
20416
20580
  const classified = event?.extra?.eventName ?? event?.tags?.eventName;
@@ -20420,6 +20584,7 @@ function applyFatalEventDefaults(event) {
20420
20584
  const target = event;
20421
20585
  target.extra = {
20422
20586
  ...RELEASE_FIELDS,
20587
+ ...RUNTIME_FIELDS,
20423
20588
  ...target.extra ?? {},
20424
20589
  eventName: LogEvent.FATAL_UNCAUGHT,
20425
20590
  eventFamily: "diagnostics",
@@ -20445,7 +20610,7 @@ function agentExtras(identity) {
20445
20610
  role: identity.role != null && identity.role !== "" ? String(identity.role) : UNKNOWN_FIELD
20446
20611
  };
20447
20612
  }
20448
- var Sentry, import_node_crypto4, FLOW_ID, SENTRY_EXTRA_BLOCKLIST, SENTRY_EXTRA_BLOCKED_KEY_PARTS, SENTRY_FULL_STRING_EXTRA_KEYS, SENTRY_TAG_KEYS, SENTRY_FINGERPRINT_KEYS, SENTRY_INFO_ALLOWLIST, MAX_EXTRA_STRING_LENGTH, MAX_TAG_VALUE_LENGTH, RELEASE_FIELDS, SentryLogger, logger, initLogger, shutdown, UNKNOWN_FIELD;
20613
+ var Sentry, import_node_crypto4, FLOW_ID, SENTRY_EXTRA_BLOCKLIST, SENTRY_EXTRA_BLOCKED_KEY_PARTS, SENTRY_FULL_STRING_EXTRA_KEYS, SENTRY_TAG_KEYS, SENTRY_FINGERPRINT_KEYS, SENTRY_INFO_ALLOWLIST, MAX_EXTRA_STRING_LENGTH, MAX_TAG_VALUE_LENGTH, RELEASE_FIELDS, RUNTIME_FIELDS, SentryLogger, logger, initLogger, shutdown, UNKNOWN_FIELD;
20449
20614
  var init_sentry_logger = __esm({
20450
20615
  "../core/src/sentry-logger/index.ts"() {
20451
20616
  "use strict";
@@ -20456,6 +20621,7 @@ var init_sentry_logger = __esm({
20456
20621
  init_log_fields();
20457
20622
  init_xmtp_test_metrics();
20458
20623
  init_error_diagnostics();
20624
+ init_runtime_metadata();
20459
20625
  init_events();
20460
20626
  init_log_fields();
20461
20627
  FLOW_ID = (0, import_node_crypto4.randomUUID)();
@@ -20542,6 +20708,7 @@ var init_sentry_logger = __esm({
20542
20708
  SENTRY_TAG_KEYS = /* @__PURE__ */ new Set([
20543
20709
  "agentId",
20544
20710
  "agentPlatform",
20711
+ "aiProvider",
20545
20712
  "cacheName",
20546
20713
  "causeCode",
20547
20714
  "causeType",
@@ -20564,6 +20731,8 @@ var init_sentry_logger = __esm({
20564
20731
  "kind",
20565
20732
  "method",
20566
20733
  "onchainosAgentId",
20734
+ "onchainosVersion",
20735
+ "onchainosVersionProbeStatus",
20567
20736
  "operation",
20568
20737
  "originPlatform",
20569
20738
  "outcome",
@@ -20580,6 +20749,7 @@ var init_sentry_logger = __esm({
20580
20749
  "role",
20581
20750
  "runId",
20582
20751
  "runtimeContainer",
20752
+ "runtimeSurface",
20583
20753
  "senderAgentId",
20584
20754
  "source",
20585
20755
  "stage",
@@ -20650,6 +20820,7 @@ var init_sentry_logger = __esm({
20650
20820
  LogEvent.PROVIDER_READINESS_CHECKED,
20651
20821
  LogEvent.PROVIDER_SWITCHED,
20652
20822
  LogEvent.JOB_PROVIDER_BOUND,
20823
+ LogEvent.ONCHAINOS_VERSION_OBSERVED,
20653
20824
  LogEvent.USER_CHANNEL_MESSAGE_DELIVERED,
20654
20825
  LogEvent.SYSTEM_NOTIFICATION_RECEIVED,
20655
20826
  LogEvent.SYSTEM_NOTIFICATION_ROUTED,
@@ -20705,6 +20876,7 @@ var init_sentry_logger = __esm({
20705
20876
  MAX_EXTRA_STRING_LENGTH = 256;
20706
20877
  MAX_TAG_VALUE_LENGTH = 128;
20707
20878
  RELEASE_FIELDS = {};
20879
+ RUNTIME_FIELDS = runtimeMetadataFields();
20708
20880
  SentryLogger = class _SentryLogger {
20709
20881
  static instance;
20710
20882
  initialized = false;
@@ -20724,6 +20896,9 @@ var init_sentry_logger = __esm({
20724
20896
  }
20725
20897
  try {
20726
20898
  RELEASE_FIELDS = releaseFields(config.release);
20899
+ if (config.runtimeMetadata) {
20900
+ setRuntimeMetadata(config.runtimeMetadata);
20901
+ }
20727
20902
  Sentry.init({
20728
20903
  dsn: config.dsn,
20729
20904
  release: config.release,
@@ -20743,6 +20918,14 @@ var init_sentry_logger = __esm({
20743
20918
  if (config.runtimeContainer) {
20744
20919
  tags.runtimeContainer = config.runtimeContainer;
20745
20920
  }
20921
+ for (const key of [
20922
+ "aiProvider",
20923
+ "runtimeSurface",
20924
+ "onchainosVersion",
20925
+ "onchainosVersionProbeStatus"
20926
+ ]) {
20927
+ tags[key] = RUNTIME_FIELDS[key] ?? "unknown";
20928
+ }
20746
20929
  Sentry.setTags(tags);
20747
20930
  } catch {
20748
20931
  return;
@@ -20755,6 +20938,7 @@ var init_sentry_logger = __esm({
20755
20938
  enrichCorrelationFields({
20756
20939
  flowId: FLOW_ID,
20757
20940
  ...RELEASE_FIELDS,
20941
+ ...RUNTIME_FIELDS,
20758
20942
  ...extra ?? {}
20759
20943
  })
20760
20944
  );
@@ -20789,6 +20973,7 @@ var init_sentry_logger = __esm({
20789
20973
  enrichCorrelationFields({
20790
20974
  flowId: FLOW_ID,
20791
20975
  ...RELEASE_FIELDS,
20976
+ ...RUNTIME_FIELDS,
20792
20977
  ...extra ?? {}
20793
20978
  })
20794
20979
  );
@@ -26747,7 +26932,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
26747
26932
  client: {
26748
26933
  id: "gateway-client",
26749
26934
  displayName: "okx-a2a-node",
26750
- version: "0.2.8-beta-174fcb5625-260819112349",
26935
+ version: "0.2.8",
26751
26936
  platform: "node",
26752
26937
  mode: "backend",
26753
26938
  instanceId
@@ -26758,7 +26943,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
26758
26943
  commands: [],
26759
26944
  permissions: {},
26760
26945
  locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
26761
- userAgent: `okx-a2a-node/${"0.2.8-beta-174fcb5625-260819112349"}`,
26946
+ userAgent: `okx-a2a-node/${"0.2.8"}`,
26762
26947
  auth: {
26763
26948
  ...config.token ? { token: config.token } : {},
26764
26949
  ...config.password ? { password: config.password } : {}
@@ -28229,6 +28414,48 @@ var init_outbound_behavior = __esm({
28229
28414
  }
28230
28415
  });
28231
28416
 
28417
+ // src/runtime-metadata-store.ts
28418
+ function defaultWarning(message) {
28419
+ console.warn(message);
28420
+ }
28421
+ function errorMessage(error) {
28422
+ return error instanceof Error ? error.message : String(error);
28423
+ }
28424
+ function warnBestEffort(warn, message) {
28425
+ try {
28426
+ warn(message);
28427
+ } catch {
28428
+ }
28429
+ }
28430
+ function persistAiRuntimeSurfaceBestEffort(store, surface, warn = defaultWarning) {
28431
+ try {
28432
+ store.setAiRuntimeSurface(surface);
28433
+ return true;
28434
+ } catch (error) {
28435
+ warnBestEffort(
28436
+ warn,
28437
+ `[runtime] failed to persist diagnostic runtime surface: ${errorMessage(error)}`
28438
+ );
28439
+ return false;
28440
+ }
28441
+ }
28442
+ function readAiRuntimeSurfaceBestEffort(store, fallback, warn = defaultWarning) {
28443
+ try {
28444
+ return store.getAiRuntimeSurface() ?? fallback;
28445
+ } catch (error) {
28446
+ warnBestEffort(
28447
+ warn,
28448
+ `[runtime] failed to read diagnostic runtime surface: ${errorMessage(error)}`
28449
+ );
28450
+ return fallback;
28451
+ }
28452
+ }
28453
+ var init_runtime_metadata_store = __esm({
28454
+ "src/runtime-metadata-store.ts"() {
28455
+ "use strict";
28456
+ }
28457
+ });
28458
+
28232
28459
  // src/runtime-switch.ts
28233
28460
  async function performRuntimeSwitch(store, options = {}) {
28234
28461
  const result = await switchProviderWithReadinessGate({
@@ -28242,11 +28469,25 @@ async function performRuntimeSwitch(store, options = {}) {
28242
28469
  }
28243
28470
  async function switchProviderWithReadinessGate(options) {
28244
28471
  const gated = await switchProviderWithReadinessGateCore(options);
28245
- emitRuntimeSwitchCheckpoints(gated);
28472
+ if (gated.result.ok) {
28473
+ const provider = normalizeAiRuntimeProvider(gated.result.provider);
28474
+ persistAiRuntimeSurfaceBestEffort(
28475
+ options.store,
28476
+ detectAiRuntimeSurface(provider, options.env)
28477
+ );
28478
+ }
28479
+ emitRuntimeSwitchCheckpoints(gated, options.env);
28246
28480
  return gated.result;
28247
28481
  }
28248
- function emitRuntimeSwitchCheckpoints(gated) {
28482
+ function emitRuntimeSwitchCheckpoints(gated, env = process.env) {
28249
28483
  const { result, runtime, readiness } = gated;
28484
+ const runtimeProvider = normalizeAiRuntimeProvider(
28485
+ result.ok ? result.provider : runtime
28486
+ );
28487
+ setRuntimeMetadata({
28488
+ aiProvider: runtimeProvider,
28489
+ runtimeSurface: detectAiRuntimeSurface(runtimeProvider, env)
28490
+ });
28250
28491
  logger.info(LogEvent.RUNTIME_DETECTED, {
28251
28492
  component: RUNTIME_SWITCH_COMPONENT,
28252
28493
  provider: runtime,
@@ -28318,8 +28559,10 @@ var init_runtime_switch = __esm({
28318
28559
  init_ai_provider();
28319
28560
  init_outbound_behavior();
28320
28561
  init_openclaw_route();
28562
+ init_runtime_metadata_store();
28321
28563
  init_sentry_logger();
28322
28564
  init_log_fields();
28565
+ init_runtime_metadata();
28323
28566
  RUNTIME_SWITCH_COMPONENT = "node_runtime_switch";
28324
28567
  }
28325
28568
  });
@@ -28667,7 +28910,7 @@ var init_sentry_config = __esm({
28667
28910
  environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
28668
28911
  SENTRY_CONFIG = {
28669
28912
  projectName: "okx/openclaw-okx-a2a-extension",
28670
- release: "0.2.8-beta-174fcb5625-260819112349",
28913
+ release: "0.2.8",
28671
28914
  environment,
28672
28915
  runtimeContainer: normalizeRuntimeContainer(process.env.OKX_A2A_RUNTIME_CONTAINER)
28673
28916
  };
@@ -39837,7 +40080,7 @@ async function exportDiagnosticLogs(options) {
39837
40080
  node: process.version,
39838
40081
  platform: process.platform,
39839
40082
  arch: process.arch,
39840
- packageVersion: true ? "0.2.8-beta-174fcb5625-260819112349" : "unknown",
40083
+ packageVersion: true ? "0.2.8" : "unknown",
39841
40084
  sensitiveContentIncluded: options.includeSensitiveContent,
39842
40085
  listenerAndLlmContentIncluded: true,
39843
40086
  credentialsAlwaysRedacted: true,
@@ -40761,7 +41004,87 @@ var init_capabilities_cli = __esm({
40761
41004
  });
40762
41005
 
40763
41006
  // ../core/src/xmtp-sdk/onchainos/bin.ts
40764
- async function resolve9() {
41007
+ async function refreshOnchainosVersionMetadata(options = {}) {
41008
+ const now = options.now ?? Date.now;
41009
+ const current = getRuntimeMetadata();
41010
+ const previousVersion = current.onchainosVersion ?? UNKNOWN_RUNTIME_METADATA;
41011
+ const previousObservedAtMs = Number(current.onchainosVersionObservedAtMs ?? 0);
41012
+ if (versionProbeInFlight) {
41013
+ return versionProbeInFlight;
41014
+ }
41015
+ versionProbeInFlight = (async () => {
41016
+ const observedAtMs = now();
41017
+ try {
41018
+ const bin = await resolve9(
41019
+ options.resolveTimeoutMs ?? ONCHAINOS_BIN_RESOLVE_TIMEOUT_MS
41020
+ );
41021
+ const output5 = options.runVersionCommand ? await options.runVersionCommand(bin) : await runVersionCommand(bin);
41022
+ const version3 = parseOnchainosVersionOutput(output5);
41023
+ if (version3 === UNKNOWN_RUNTIME_METADATA) {
41024
+ throw new Error("OnchainOS version output did not contain a semantic version");
41025
+ }
41026
+ const changed = previousVersion !== UNKNOWN_RUNTIME_METADATA && previousVersion !== version3;
41027
+ setRuntimeMetadata({
41028
+ onchainosVersion: version3,
41029
+ onchainosVersionObservedAtMs: observedAtMs,
41030
+ onchainosVersionProbeStatus: "ok"
41031
+ });
41032
+ if (previousVersion !== version3) {
41033
+ logger.info(LogEvent.ONCHAINOS_VERSION_OBSERVED, {
41034
+ component: "onchainos_cli",
41035
+ source: "onchainos",
41036
+ checkpoint: changed ? "version_changed" : "version_detected",
41037
+ outcome: "success",
41038
+ previousOnchainosVersion: previousVersion,
41039
+ versionChanged: String(changed),
41040
+ onchainosVersionObservedAtMs: String(observedAtMs)
41041
+ });
41042
+ }
41043
+ return {
41044
+ version: version3,
41045
+ observedAtMs,
41046
+ probeStatus: "ok",
41047
+ changed
41048
+ };
41049
+ } catch {
41050
+ const hasLastKnownVersion = previousVersion !== UNKNOWN_RUNTIME_METADATA;
41051
+ setRuntimeMetadata({
41052
+ onchainosVersion: previousVersion,
41053
+ onchainosVersionObservedAtMs: previousObservedAtMs,
41054
+ onchainosVersionProbeStatus: "failed"
41055
+ });
41056
+ if (!hasLastKnownVersion) {
41057
+ logger.info(LogEvent.ONCHAINOS_VERSION_OBSERVED, {
41058
+ component: "onchainos_cli",
41059
+ source: "onchainos",
41060
+ checkpoint: "version_probe_failed",
41061
+ outcome: "failed",
41062
+ reason: "version_unavailable",
41063
+ onchainosVersionObservedAtMs: "0"
41064
+ });
41065
+ }
41066
+ return {
41067
+ version: previousVersion,
41068
+ observedAtMs: previousObservedAtMs,
41069
+ probeStatus: "failed",
41070
+ changed: false
41071
+ };
41072
+ } finally {
41073
+ versionProbeInFlight = null;
41074
+ }
41075
+ })();
41076
+ return versionProbeInFlight;
41077
+ }
41078
+ async function runVersionCommand(bin) {
41079
+ const invocation = toWindowsInvocation(bin, ["--version"]);
41080
+ const result = await execFileAsync2(invocation.command, invocation.args, {
41081
+ windowsHide: true,
41082
+ windowsVerbatimArguments: invocation.windowsVerbatimArguments,
41083
+ timeout: ONCHAINOS_VERSION_PROBE_TIMEOUT_MS
41084
+ });
41085
+ return [result.stdout, result.stderr].filter(Boolean).join("\n");
41086
+ }
41087
+ async function resolve9(timeoutMs) {
40765
41088
  if (resolvedBin) {
40766
41089
  return resolvedBin;
40767
41090
  }
@@ -40781,7 +41104,8 @@ async function resolve9() {
40781
41104
  try {
40782
41105
  const shell = process.env.SHELL || "/bin/bash";
40783
41106
  const { stdout } = await execFileAsync2(shell, ["-lc", "command -v onchainos"], {
40784
- windowsHide: true
41107
+ windowsHide: true,
41108
+ timeout: timeoutMs
40785
41109
  });
40786
41110
  const bin = extractExecutablePath(stdout);
40787
41111
  if (bin) {
@@ -41006,7 +41330,7 @@ async function exec(args, options = {}) {
41006
41330
  throw err2;
41007
41331
  }
41008
41332
  }
41009
- var import_node_fs20, import_node_child_process8, import_node_path23, import_node_util2, execFileAsync2, resolvedBin, REDACTED_VALUE_FLAGS, WINDOWS_APPS_ALIAS_MARKER;
41333
+ var import_node_fs20, import_node_child_process8, import_node_path23, import_node_util2, execFileAsync2, resolvedBin, versionProbeInFlight, REDACTED_VALUE_FLAGS, ONCHAINOS_VERSION_PROBE_TIMEOUT_MS, ONCHAINOS_BIN_RESOLVE_TIMEOUT_MS, WINDOWS_APPS_ALIAS_MARKER;
41010
41334
  var init_bin = __esm({
41011
41335
  "../core/src/xmtp-sdk/onchainos/bin.ts"() {
41012
41336
  "use strict";
@@ -41016,10 +41340,14 @@ var init_bin = __esm({
41016
41340
  import_node_path23 = require("node:path");
41017
41341
  import_node_util2 = require("node:util");
41018
41342
  init_sentry_logger();
41343
+ init_runtime_metadata();
41019
41344
  init_win_compat();
41020
41345
  execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process8.execFile);
41021
41346
  resolvedBin = null;
41347
+ versionProbeInFlight = null;
41022
41348
  REDACTED_VALUE_FLAGS = /* @__PURE__ */ new Set(["--message"]);
41349
+ ONCHAINOS_VERSION_PROBE_TIMEOUT_MS = 5e3;
41350
+ ONCHAINOS_BIN_RESOLVE_TIMEOUT_MS = 5e3;
41023
41351
  WINDOWS_APPS_ALIAS_MARKER = "\\microsoft\\windowsapps\\";
41024
41352
  }
41025
41353
  });
@@ -61766,6 +62094,8 @@ function aiRunSentryExtra(input) {
61766
62094
  // Every event this builder feeds describes one AI CLI child process.
61767
62095
  transport: "cli",
61768
62096
  eventFamily: "ai_run",
62097
+ // A daemon-spawned AI process is not a user-selected Desktop/CLI surface.
62098
+ runtimeSurface: "unknown",
61769
62099
  source: input.source,
61770
62100
  sessionKey: input.sessionKey,
61771
62101
  jobId: input.jobId ?? "",
@@ -63502,6 +63832,7 @@ var init_ai_runner = __esm({
63502
63832
  env: buildAiProviderEnv(command, {
63503
63833
  ...process.env,
63504
63834
  OKX_A2A_IS_CLI: "1",
63835
+ OKX_A2A_RUNTIME_SURFACE: "unknown",
63505
63836
  OKX_AGENT_TASK_AI_PROVIDER: provider,
63506
63837
  OKX_A2A_CURRENT_SESSION_KEY: request.sessionKey,
63507
63838
  OKX_A2A_CURRENT_MESSAGE_ID: request.messageId,
@@ -67474,8 +67805,9 @@ __export(listener_exports, {
67474
67805
  async function runHeartbeatRefreshCycle(options) {
67475
67806
  const heartbeat = await timeSettled(options.heartbeat);
67476
67807
  const refreshAllowed = heartbeat.value === "performed" || heartbeat.value === "refresh_safe";
67808
+ const versionRefresh = options.versionRefresh && refreshAllowed ? await timeSettled(options.versionRefresh) : void 0;
67477
67809
  const refresh = options.refresh && refreshAllowed ? await timeSettled(options.refresh) : void 0;
67478
- return { heartbeat, refresh };
67810
+ return { heartbeat, versionRefresh, refresh };
67479
67811
  }
67480
67812
  function resolveOfflineReplayIntervalSec(systemConfig) {
67481
67813
  const interval = systemConfig.offlineReplayInterval;
@@ -67747,15 +68079,25 @@ async function runListenerWithLock(options, paths) {
67747
68079
  });
67748
68080
  }
67749
68081
  });
67750
- service.setPluginVersion("0.2.8-beta-174fcb5625-260819112349");
68082
+ service.setPluginVersion("0.2.8");
67751
68083
  await service.init();
67752
68084
  const pluginVersionStatus = service.pluginVersionStatus;
67753
68085
  if (pluginVersionStatus.unavailable) {
67754
68086
  throw new Error(
67755
- `@okxweb3/a2a-node v${"0.2.8-beta-174fcb5625-260819112349"} is below the required minimum v${pluginVersionStatus.minVersion}`
68087
+ `@okxweb3/a2a-node v${"0.2.8"} is below the required minimum v${pluginVersionStatus.minVersion}`
67756
68088
  );
67757
68089
  }
67758
68090
  const systemConfig = service.getSystemConfig();
68091
+ const configuredProvider = resolveConfiguredAiProvider({ store: sessionStore }) ?? detectGatewayInvocation();
68092
+ const aiProvider = normalizeAiRuntimeProvider(configuredProvider);
68093
+ setRuntimeMetadata({
68094
+ aiProvider,
68095
+ runtimeSurface: readAiRuntimeSurfaceBestEffort(
68096
+ sessionStore,
68097
+ detectAiRuntimeSurface(aiProvider),
68098
+ (message) => logWithTimestamp(message)
68099
+ )
68100
+ });
67759
68101
  if (systemConfig.sentryDsn) {
67760
68102
  initLogger({
67761
68103
  dsn: systemConfig.sentryDsn,
@@ -67770,7 +68112,7 @@ async function runListenerWithLock(options, paths) {
67770
68112
  onchainosAgentId: "*",
67771
68113
  reason: "system-config missing sentryDsn",
67772
68114
  pluginId: "@okxweb3/a2a-node",
67773
- pluginVersion: "0.2.8-beta-174fcb5625-260819112349"
68115
+ pluginVersion: "0.2.8"
67774
68116
  });
67775
68117
  }
67776
68118
  logWithTimestamp(
@@ -68028,6 +68370,7 @@ async function runListenerWithLock(options, paths) {
68028
68370
  timer = setInterval(() => {
68029
68371
  void runHeartbeatRefreshCycle({
68030
68372
  heartbeat: heartbeatTick,
68373
+ versionRefresh: refreshOnchainosVersionMetadata,
68031
68374
  refresh: syncTick
68032
68375
  });
68033
68376
  }, intervalSec * 1e3);
@@ -68132,7 +68475,8 @@ async function runListenerWithLock(options, paths) {
68132
68475
  });
68133
68476
  }, AUTH_RECOVERY_PROBE_INTERVAL_MS);
68134
68477
  void runHeartbeatRefreshCycle({
68135
- heartbeat: heartbeatTick
68478
+ heartbeat: heartbeatTick,
68479
+ versionRefresh: refreshOnchainosVersionMetadata
68136
68480
  });
68137
68481
  const commandProcessor = startCommandProcessor({
68138
68482
  service,
@@ -68211,6 +68555,7 @@ var init_listener = __esm({
68211
68555
  init_system_config();
68212
68556
  init_offline_replay_capability();
68213
68557
  init_signer();
68558
+ init_bin();
68214
68559
  init_xmtp_sdk();
68215
68560
  init_file_store();
68216
68561
  init_session_store();
@@ -68225,7 +68570,9 @@ var init_listener = __esm({
68225
68570
  init_daemon_lock();
68226
68571
  init_ai_provider();
68227
68572
  init_openclaw_gateway();
68573
+ init_runtime_metadata_store();
68228
68574
  init_sentry_logger();
68575
+ init_runtime_metadata();
68229
68576
  init_sentry_config();
68230
68577
  DEFAULT_OFFLINE_REPLAY_INTERVAL_SEC = 300;
68231
68578
  DEFAULT_XMTP_CLIENT_RECYCLE_INTERVAL_SEC = 6 * 60 * 60;
@@ -116172,7 +116519,7 @@ async function getCurrentNodeCliVersion() {
116172
116519
  return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
116173
116520
  }
116174
116521
  function getBundledNodeCliVersion() {
116175
- return true ? "0.2.8-beta-174fcb5625-260819112349" : null;
116522
+ return true ? "0.2.8" : null;
116176
116523
  }
116177
116524
  function readConfiguredAiProvider() {
116178
116525
  const explicit = process.env.OKX_A2A_AI_PROVIDER || process.env.OKX_AGENT_TASK_AI_CLI;
@@ -116382,7 +116729,7 @@ async function updateHermes(release, options) {
116382
116729
  }
116383
116730
  }
116384
116731
  async function installGatewayPluginForDoctor(target) {
116385
- const release = isPrereleaseVersion("0.2.8-beta-174fcb5625-260819112349") ? "beta" : "latest";
116732
+ const release = isPrereleaseVersion("0.2.8") ? "beta" : "latest";
116386
116733
  const insideTargetGateway = detectGatewayInvocation() === target;
116387
116734
  const options = {
116388
116735
  restart: !insideTargetGateway,
@@ -117225,6 +117572,11 @@ function initDoctorSentry() {
117225
117572
  }
117226
117573
  try {
117227
117574
  const dsn = process.env.OKX_A2A_SENTRY_DSN?.trim() || process.env.SENTRY_DSN?.trim() || FALLBACK_SENTRY_DSN;
117575
+ const aiProvider = normalizeAiRuntimeProvider(detectCurrentAiProvider());
117576
+ setRuntimeMetadata({
117577
+ aiProvider,
117578
+ runtimeSurface: detectAiRuntimeSurface(aiProvider)
117579
+ });
117228
117580
  initLogger({
117229
117581
  dsn,
117230
117582
  ...SENTRY_CONFIG,
@@ -117308,6 +117660,8 @@ var init_doctor_sentry = __esm({
117308
117660
  "use strict";
117309
117661
  init_sentry_config();
117310
117662
  init_sentry_logger();
117663
+ init_runtime_metadata();
117664
+ init_ai_provider();
117311
117665
  sentryReady = false;
117312
117666
  }
117313
117667
  });
@@ -117428,7 +117782,7 @@ async function runDoctor(options = {}) {
117428
117782
  platform: options.platform ?? process.platform,
117429
117783
  env: options.env ?? process.env,
117430
117784
  target: options.target ?? resolveDoctorTarget(options.env ?? process.env),
117431
- cliVersion: options.cliVersion ?? (true ? "0.2.8-beta-174fcb5625-260819112349" : "0.0.0"),
117785
+ cliVersion: options.cliVersion ?? (true ? "0.2.8" : "0.0.0"),
117432
117786
  fixMode: options.fix === true,
117433
117787
  nonInteractive: options.nonInteractive === true,
117434
117788
  packageChanged: false,
@@ -118444,6 +118798,7 @@ init_command_store();
118444
118798
  init_file_store();
118445
118799
  init_ai_provider();
118446
118800
  init_runtime_switch();
118801
+ init_runtime_metadata_store();
118447
118802
  init_job_provider();
118448
118803
  init_session_store();
118449
118804
  init_paths();
@@ -118452,9 +118807,10 @@ init_log_tail();
118452
118807
  init_win_spawn();
118453
118808
  init_sentry_logger();
118454
118809
  init_sentry_config();
118810
+ init_runtime_metadata();
118455
118811
  var CURRENT_GATEWAY_SESSION_KEYS_ENV4 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
118456
118812
  function printUsage3() {
118457
- console.log(`okx-a2a ${"0.2.8-beta-174fcb5625-260819112349"}
118813
+ console.log(`okx-a2a ${"0.2.8"}
118458
118814
 
118459
118815
  Usage:
118460
118816
  okx-a2a <command> [options]
@@ -118494,7 +118850,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
118494
118850
  `);
118495
118851
  }
118496
118852
  function printVersion() {
118497
- console.log("0.2.8-beta-174fcb5625-260819112349");
118853
+ console.log("0.2.8");
118498
118854
  }
118499
118855
  function printDaemonUsage() {
118500
118856
  console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
@@ -119327,6 +119683,10 @@ async function configureDefaultAiProviderForLifecycle(args, options = {}) {
119327
119683
  promptIfMissing: options.promptIfMissing ?? true,
119328
119684
  allowUnavailableProvider: options.allowUnavailableProvider
119329
119685
  });
119686
+ persistAiRuntimeSurfaceBestEffort(
119687
+ store,
119688
+ detectAiRuntimeSurface(provider.provider)
119689
+ );
119330
119690
  console.log(provider.message);
119331
119691
  } finally {
119332
119692
  store.close();
@@ -119546,6 +119906,10 @@ async function handleAiProvider(args) {
119546
119906
  requestedProvider: rawProvider,
119547
119907
  stderr: process.stderr
119548
119908
  });
119909
+ persistAiRuntimeSurfaceBestEffort(
119910
+ store,
119911
+ detectAiRuntimeSurface(choice.provider)
119912
+ );
119549
119913
  if (json) {
119550
119914
  console.log(JSON.stringify({ ok: true, provider: choice.provider, source: choice.source }));
119551
119915
  } else {
@@ -119820,7 +120184,7 @@ function assertSupportedNodeVersion() {
119820
120184
  var cliSentryInitAttempted = false;
119821
120185
  var cliSentryInitialized = false;
119822
120186
  var cliSentryFlushTimedOut = false;
119823
- function initDirectCliSentry() {
120187
+ async function initDirectCliSentry() {
119824
120188
  if (cliSentryInitAttempted) {
119825
120189
  return;
119826
120190
  }
@@ -119834,6 +120198,11 @@ function initDirectCliSentry() {
119834
120198
  if (typeof config.sentryDsn !== "string" || !config.sentryDsn) {
119835
120199
  return;
119836
120200
  }
120201
+ const aiProvider = normalizeAiRuntimeProvider(detectCurrentAiProvider());
120202
+ setRuntimeMetadata({
120203
+ aiProvider,
120204
+ runtimeSurface: detectAiRuntimeSurface(aiProvider)
120205
+ });
119837
120206
  initLogger({
119838
120207
  dsn: config.sentryDsn,
119839
120208
  ...SENTRY_CONFIG,
@@ -119962,7 +120331,7 @@ async function main() {
119962
120331
  if (command === "xmtp-test") {
119963
120332
  const { handleXmtpTestCommand: handleXmtpTestCommand2 } = await Promise.resolve().then(() => (init_xmtp_test_cli(), xmtp_test_cli_exports));
119964
120333
  await handleXmtpTestCommand2(process.argv.slice(3), {
119965
- packageVersion: "0.2.8-beta-174fcb5625-260819112349",
120334
+ packageVersion: "0.2.8",
119966
120335
  agentSdkVersion: "2.3.0",
119967
120336
  nodeSdkVersion: "6.1.0",
119968
120337
  nodeBindingsVersion: "1.11.0"
@@ -119970,53 +120339,53 @@ async function main() {
119970
120339
  return;
119971
120340
  }
119972
120341
  if (command === "xmtp-send") {
119973
- initDirectCliSentry();
120342
+ await initDirectCliSentry();
119974
120343
  await queueXmtpSend(process.argv.slice(3));
119975
120344
  await flushDirectCliSentry();
119976
120345
  return;
119977
120346
  }
119978
120347
  if (command === "task") {
119979
- initDirectCliSentry();
120348
+ await initDirectCliSentry();
119980
120349
  await handleTaskCommand(process.argv.slice(3));
119981
120350
  await flushDirectCliSentry();
119982
120351
  return;
119983
120352
  }
119984
120353
  if (command === "agent") {
119985
- initDirectCliSentry();
120354
+ await initDirectCliSentry();
119986
120355
  await handleAgentCommand(process.argv.slice(3));
119987
120356
  await flushDirectCliSentry();
119988
120357
  return;
119989
120358
  }
119990
120359
  if (command === "file") {
119991
- initDirectCliSentry();
120360
+ await initDirectCliSentry();
119992
120361
  const { handleFileCommand: handleFileCommand2 } = await Promise.resolve().then(() => (init_file_cli(), file_cli_exports));
119993
120362
  await handleFileCommand2(process.argv.slice(3));
119994
120363
  await flushDirectCliSentry();
119995
120364
  return;
119996
120365
  }
119997
120366
  if (command === "user") {
119998
- initDirectCliSentry();
120367
+ await initDirectCliSentry();
119999
120368
  const { handleUserCommand: handleUserCommand2 } = await Promise.resolve().then(() => (init_user_attention_cli(), user_attention_cli_exports));
120000
120369
  await handleUserCommand2(process.argv.slice(3));
120001
120370
  await flushDirectCliSentry();
120002
120371
  return;
120003
120372
  }
120004
120373
  if (command === "session") {
120005
- initDirectCliSentry();
120374
+ await initDirectCliSentry();
120006
120375
  const { handleSessionCommand: handleSessionCommand2 } = await Promise.resolve().then(() => (init_session_cli(), session_cli_exports));
120007
120376
  await handleSessionCommand2(process.argv.slice(3));
120008
120377
  await flushDirectCliSentry();
120009
120378
  return;
120010
120379
  }
120011
120380
  if (command === "xmtp-debug") {
120012
- initDirectCliSentry();
120381
+ await initDirectCliSentry();
120013
120382
  const { handleXmtpDebugCli: handleXmtpDebugCli2 } = await Promise.resolve().then(() => (init_xmtp_debug_cli(), xmtp_debug_cli_exports));
120014
120383
  await handleXmtpDebugCli2(process.argv.slice(3));
120015
120384
  await flushDirectCliSentry();
120016
120385
  return;
120017
120386
  }
120018
120387
  if (command === "ai") {
120019
- initDirectCliSentry();
120388
+ await initDirectCliSentry();
120020
120389
  const { handleAiCommand: handleAiCommand2 } = await Promise.resolve().then(() => (init_ai_cli(), ai_cli_exports));
120021
120390
  await handleAiCommand2(process.argv.slice(3));
120022
120391
  await flushDirectCliSentry();
@@ -120083,7 +120452,7 @@ main().then(() => {
120083
120452
  }
120084
120453
  console.error(err2 instanceof Error ? err2.stack ?? err2.message : String(err2));
120085
120454
  try {
120086
- initDirectCliSentry();
120455
+ await initDirectCliSentry();
120087
120456
  const command = process.argv[2] ?? "status";
120088
120457
  const subcommand = process.argv[3] ?? "";
120089
120458
  logger.error(LogEvent.DIRECT_CLI_FAILED, err2 instanceof Error ? err2 : new Error(String(err2)), directCliSentryExtra(command, {