@okxweb3/a2a-node 0.2.4-beta-e7a52faf6f-260811185020 → 0.2.4-beta-e7a52faf6f-260812104443
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.
- package/dist/cli.js +116 -18
- package/dist/index.js +105 -14
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -26604,7 +26604,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
26604
26604
|
client: {
|
|
26605
26605
|
id: "gateway-client",
|
|
26606
26606
|
displayName: "okx-a2a-node",
|
|
26607
|
-
version: "0.2.4-beta-e7a52faf6f-
|
|
26607
|
+
version: "0.2.4-beta-e7a52faf6f-260812104443",
|
|
26608
26608
|
platform: "node",
|
|
26609
26609
|
mode: "backend",
|
|
26610
26610
|
instanceId
|
|
@@ -26615,7 +26615,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
26615
26615
|
commands: [],
|
|
26616
26616
|
permissions: {},
|
|
26617
26617
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
26618
|
-
userAgent: `okx-a2a-node/${"0.2.4-beta-e7a52faf6f-
|
|
26618
|
+
userAgent: `okx-a2a-node/${"0.2.4-beta-e7a52faf6f-260812104443"}`,
|
|
26619
26619
|
auth: {
|
|
26620
26620
|
...config.token ? { token: config.token } : {},
|
|
26621
26621
|
...config.password ? { password: config.password } : {}
|
|
@@ -28499,7 +28499,7 @@ var init_sentry_config = __esm({
|
|
|
28499
28499
|
environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
28500
28500
|
SENTRY_CONFIG = {
|
|
28501
28501
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
28502
|
-
release: "0.2.4-beta-e7a52faf6f-
|
|
28502
|
+
release: "0.2.4-beta-e7a52faf6f-260812104443",
|
|
28503
28503
|
environment,
|
|
28504
28504
|
runtimeContainer: normalizeRuntimeContainer(process.env.OKX_A2A_RUNTIME_CONTAINER)
|
|
28505
28505
|
};
|
|
@@ -39669,7 +39669,7 @@ async function exportDiagnosticLogs(options) {
|
|
|
39669
39669
|
node: process.version,
|
|
39670
39670
|
platform: process.platform,
|
|
39671
39671
|
arch: process.arch,
|
|
39672
|
-
packageVersion: true ? "0.2.4-beta-e7a52faf6f-
|
|
39672
|
+
packageVersion: true ? "0.2.4-beta-e7a52faf6f-260812104443" : "unknown",
|
|
39673
39673
|
sensitiveContentIncluded: options.includeSensitiveContent,
|
|
39674
39674
|
listenerAndLlmContentIncluded: true,
|
|
39675
39675
|
credentialsAlwaysRedacted: true,
|
|
@@ -58921,6 +58921,49 @@ var init_system_config = __esm({
|
|
|
58921
58921
|
}
|
|
58922
58922
|
});
|
|
58923
58923
|
|
|
58924
|
+
// ../core/src/xmtp-sdk/onchainos/wallet-status.ts
|
|
58925
|
+
function parseWalletLoginStatus(stdout) {
|
|
58926
|
+
const response = parseCliJson(stdout, "wallet-status");
|
|
58927
|
+
if (!response.ok) {
|
|
58928
|
+
const error = new Error("onchainos wallet status failed");
|
|
58929
|
+
logger.error(
|
|
58930
|
+
LogEvent.ONCHAINOS_CLI_ERROR,
|
|
58931
|
+
error,
|
|
58932
|
+
cliOkFalseExtras(stdout, "wallet-status")
|
|
58933
|
+
);
|
|
58934
|
+
throw error;
|
|
58935
|
+
}
|
|
58936
|
+
if (typeof response.data?.loggedIn !== "boolean") {
|
|
58937
|
+
const error = new Error("onchainos wallet status returned invalid loggedIn state");
|
|
58938
|
+
logger.error(LogEvent.ONCHAINOS_CLI_ERROR, error, {
|
|
58939
|
+
component: "onchainos_cli",
|
|
58940
|
+
source: "onchainos",
|
|
58941
|
+
stage: "response_validation",
|
|
58942
|
+
communicationClass: "onchainos_cli_or_api_issue",
|
|
58943
|
+
operation: "wallet-status",
|
|
58944
|
+
reason: "invalid_logged_in_state"
|
|
58945
|
+
});
|
|
58946
|
+
throw error;
|
|
58947
|
+
}
|
|
58948
|
+
return response.data.loggedIn;
|
|
58949
|
+
}
|
|
58950
|
+
async function queryWalletLoginStatus() {
|
|
58951
|
+
logWithTimestamp("[onchainos] checking wallet login status");
|
|
58952
|
+
const { stdout } = await exec(["wallet", "status"]);
|
|
58953
|
+
const loggedIn = parseWalletLoginStatus(stdout);
|
|
58954
|
+
logWithTimestamp(`[onchainos] wallet login status: ${loggedIn ? "logged in" : "logged out"}`);
|
|
58955
|
+
return loggedIn;
|
|
58956
|
+
}
|
|
58957
|
+
var init_wallet_status = __esm({
|
|
58958
|
+
"../core/src/xmtp-sdk/onchainos/wallet-status.ts"() {
|
|
58959
|
+
"use strict";
|
|
58960
|
+
init_log();
|
|
58961
|
+
init_sentry_logger();
|
|
58962
|
+
init_bin();
|
|
58963
|
+
init_cli_response();
|
|
58964
|
+
}
|
|
58965
|
+
});
|
|
58966
|
+
|
|
58924
58967
|
// ../core/src/xmtp-sdk/onchainos/index.ts
|
|
58925
58968
|
function messageEligibleUnavailableError(input) {
|
|
58926
58969
|
const lines = [
|
|
@@ -59408,6 +59451,7 @@ var init_onchainos = __esm({
|
|
|
59408
59451
|
init_cli_response();
|
|
59409
59452
|
init_session_expired();
|
|
59410
59453
|
init_system_config();
|
|
59454
|
+
init_wallet_status();
|
|
59411
59455
|
MESSAGE_ELIGIBILITY_SERVICE_UNAVAILABLE_AI_HINT = "Message eligibility service is temporarily unavailable. Please try again later.";
|
|
59412
59456
|
lastExpiredNotifyAt = 0;
|
|
59413
59457
|
EXPIRED_NOTIFY_COOLDOWN_MS = 5 * 60 * 1e3;
|
|
@@ -67023,6 +67067,7 @@ var init_user_attention_watchers = __esm({
|
|
|
67023
67067
|
// src/listener.ts
|
|
67024
67068
|
var listener_exports = {};
|
|
67025
67069
|
__export(listener_exports, {
|
|
67070
|
+
AUTH_RECOVERY_PROBE_INTERVAL_MS: () => AUTH_RECOVERY_PROBE_INTERVAL_MS,
|
|
67026
67071
|
AgentRefreshAuthGate: () => AgentRefreshAuthGate,
|
|
67027
67072
|
AgentRefreshCoordinator: () => AgentRefreshCoordinator,
|
|
67028
67073
|
DEFAULT_OFFLINE_REPLAY_INTERVAL_SEC: () => DEFAULT_OFFLINE_REPLAY_INTERVAL_SEC,
|
|
@@ -67248,10 +67293,11 @@ async function runListenerWithLock(options, paths) {
|
|
|
67248
67293
|
const agentRefreshCoordinator = new AgentRefreshCoordinator({
|
|
67249
67294
|
lookup: (previousFingerprint) => listAllAgentsWithMetadata(previousFingerprint),
|
|
67250
67295
|
refresh: () => service.refreshAgents(),
|
|
67296
|
+
checkLoggedIn: () => queryWalletLoginStatus(),
|
|
67251
67297
|
isStopping: () => stopping,
|
|
67252
67298
|
onAuthBlocked: () => {
|
|
67253
67299
|
logWithTimestamp(
|
|
67254
|
-
"[okx-agent-task] agent refresh auth blocked; periodic agent get paused.
|
|
67300
|
+
"[okx-agent-task] agent refresh auth blocked; periodic agent get paused. Wallet login recovery will be checked every 60s; run `okx-a2a agent refresh` to recover immediately"
|
|
67255
67301
|
);
|
|
67256
67302
|
},
|
|
67257
67303
|
onAuthRecovered: () => {
|
|
@@ -67287,7 +67333,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
67287
67333
|
}
|
|
67288
67334
|
}),
|
|
67289
67335
|
notifySessionExpired: (command) => {
|
|
67290
|
-
const rawText = `The onchainos login session has expired while running ${command}. Run \`onchainos wallet login
|
|
67336
|
+
const rawText = `The onchainos login session has expired while running ${command}. Run \`onchainos wallet login\`; A2A will recover within 60 seconds, or run \`okx-a2a agent refresh\` to recover immediately.`;
|
|
67291
67337
|
void store.appendBackup(buildSystemStoredMessage({
|
|
67292
67338
|
reason: "onchainos-session-expired",
|
|
67293
67339
|
rawText,
|
|
@@ -67315,12 +67361,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
67315
67361
|
});
|
|
67316
67362
|
}
|
|
67317
67363
|
});
|
|
67318
|
-
service.setPluginVersion("0.2.4-beta-e7a52faf6f-
|
|
67364
|
+
service.setPluginVersion("0.2.4-beta-e7a52faf6f-260812104443");
|
|
67319
67365
|
await service.init();
|
|
67320
67366
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
67321
67367
|
if (pluginVersionStatus.unavailable) {
|
|
67322
67368
|
throw new Error(
|
|
67323
|
-
`@okxweb3/a2a-node v${"0.2.4-beta-e7a52faf6f-
|
|
67369
|
+
`@okxweb3/a2a-node v${"0.2.4-beta-e7a52faf6f-260812104443"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
67324
67370
|
);
|
|
67325
67371
|
}
|
|
67326
67372
|
const systemConfig = service.getSystemConfig();
|
|
@@ -67338,7 +67384,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
67338
67384
|
onchainosAgentId: "*",
|
|
67339
67385
|
reason: "system-config missing sentryDsn",
|
|
67340
67386
|
pluginId: "@okxweb3/a2a-node",
|
|
67341
|
-
pluginVersion: "0.2.4-beta-e7a52faf6f-
|
|
67387
|
+
pluginVersion: "0.2.4-beta-e7a52faf6f-260812104443"
|
|
67342
67388
|
});
|
|
67343
67389
|
}
|
|
67344
67390
|
logWithTimestamp(
|
|
@@ -67679,6 +67725,26 @@ async function runListenerWithLock(options, paths) {
|
|
|
67679
67725
|
const systemConfigRefreshTimer = setInterval(() => {
|
|
67680
67726
|
void refreshSystemConfigTick();
|
|
67681
67727
|
}, 60 * 60 * 1e3);
|
|
67728
|
+
const authRecoveryProbeTimer = setInterval(() => {
|
|
67729
|
+
if (stopping || !agentRefreshCoordinator.blocked) {
|
|
67730
|
+
return;
|
|
67731
|
+
}
|
|
67732
|
+
void agentRefreshCoordinator.runRecoveryProbe().then((refresh) => {
|
|
67733
|
+
if (!refresh) {
|
|
67734
|
+
return;
|
|
67735
|
+
}
|
|
67736
|
+
logWithTimestamp(
|
|
67737
|
+
`[okx-agent-task] auth recovery refresh agents=${refresh.agentCount} added=${refresh.added.length} removed=${refresh.removed.length}`
|
|
67738
|
+
);
|
|
67739
|
+
}).catch((err2) => {
|
|
67740
|
+
logger.error(LogEvent.DAEMON_TICK_FAILED, err2 instanceof Error ? err2 : new Error(String(err2)), {
|
|
67741
|
+
component: "node_listener",
|
|
67742
|
+
stage: "auth_recovery_probe",
|
|
67743
|
+
reason: "auth_recovery_probe_failed"
|
|
67744
|
+
});
|
|
67745
|
+
logWithTimestamp("[okx-agent-task] auth recovery probe failed:", err2);
|
|
67746
|
+
});
|
|
67747
|
+
}, AUTH_RECOVERY_PROBE_INTERVAL_MS);
|
|
67682
67748
|
void runHeartbeatRefreshCycle({
|
|
67683
67749
|
heartbeat: heartbeatTick
|
|
67684
67750
|
});
|
|
@@ -67714,6 +67780,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
67714
67780
|
clearInterval(xmtpClientRecycleTimer);
|
|
67715
67781
|
}
|
|
67716
67782
|
clearInterval(systemConfigRefreshTimer);
|
|
67783
|
+
clearInterval(authRecoveryProbeTimer);
|
|
67717
67784
|
commandProcessor.stop();
|
|
67718
67785
|
await watcherCoordinator.stop();
|
|
67719
67786
|
try {
|
|
@@ -67745,7 +67812,7 @@ async function timeSettled(fn) {
|
|
|
67745
67812
|
return { durationMs: Date.now() - startedAt, error };
|
|
67746
67813
|
}
|
|
67747
67814
|
}
|
|
67748
|
-
var import_node_fs25, import_promises13, import_node_os11, import_node_path30, DEFAULT_OFFLINE_REPLAY_INTERVAL_SEC, DEFAULT_XMTP_CLIENT_RECYCLE_INTERVAL_SEC, XMTP_CLIENT_RECYCLE_INTERVAL_ENV, HEARTBEAT_GATEWAY_CHECK_TIMEOUT_MS, AgentRefreshAuthGate, AgentRefreshCoordinator, ListenerDeferredTaskScheduler, ListenerMaintenanceGate, UPGRADE_RECOMMENDATION_IDEMPOTENCY_KEY, SHUTDOWN_FORCE_RESOLVE_MS;
|
|
67815
|
+
var import_node_fs25, import_promises13, import_node_os11, import_node_path30, DEFAULT_OFFLINE_REPLAY_INTERVAL_SEC, DEFAULT_XMTP_CLIENT_RECYCLE_INTERVAL_SEC, XMTP_CLIENT_RECYCLE_INTERVAL_ENV, HEARTBEAT_GATEWAY_CHECK_TIMEOUT_MS, AUTH_RECOVERY_PROBE_INTERVAL_MS, AgentRefreshAuthGate, AgentRefreshCoordinator, ListenerDeferredTaskScheduler, ListenerMaintenanceGate, UPGRADE_RECOMMENDATION_IDEMPOTENCY_KEY, SHUTDOWN_FORCE_RESOLVE_MS;
|
|
67749
67816
|
var init_listener = __esm({
|
|
67750
67817
|
"src/listener.ts"() {
|
|
67751
67818
|
"use strict";
|
|
@@ -67778,6 +67845,7 @@ var init_listener = __esm({
|
|
|
67778
67845
|
DEFAULT_XMTP_CLIENT_RECYCLE_INTERVAL_SEC = 6 * 60 * 60;
|
|
67779
67846
|
XMTP_CLIENT_RECYCLE_INTERVAL_ENV = "OKX_A2A_XMTP_CLIENT_RECYCLE_INTERVAL_SEC";
|
|
67780
67847
|
HEARTBEAT_GATEWAY_CHECK_TIMEOUT_MS = 2e3;
|
|
67848
|
+
AUTH_RECOVERY_PROBE_INTERVAL_MS = 6e4;
|
|
67781
67849
|
AgentRefreshAuthGate = class {
|
|
67782
67850
|
authBlocked = false;
|
|
67783
67851
|
get blocked() {
|
|
@@ -67800,6 +67868,8 @@ var init_listener = __esm({
|
|
|
67800
67868
|
}
|
|
67801
67869
|
options;
|
|
67802
67870
|
authGate = new AgentRefreshAuthGate();
|
|
67871
|
+
refreshInFlight = null;
|
|
67872
|
+
recoveryProbeInFlight = null;
|
|
67803
67873
|
get blocked() {
|
|
67804
67874
|
return this.authGate.blocked;
|
|
67805
67875
|
}
|
|
@@ -67823,10 +67893,38 @@ var init_listener = __esm({
|
|
|
67823
67893
|
if (this.options.isStopping() || this.authGate.blocked) {
|
|
67824
67894
|
return null;
|
|
67825
67895
|
}
|
|
67826
|
-
return this.
|
|
67896
|
+
return this.runRefresh();
|
|
67827
67897
|
}
|
|
67828
67898
|
async runManual() {
|
|
67829
|
-
return this.
|
|
67899
|
+
return this.runRefresh();
|
|
67900
|
+
}
|
|
67901
|
+
runRecoveryProbe() {
|
|
67902
|
+
if (this.options.isStopping() || !this.authGate.blocked || !this.options.checkLoggedIn) {
|
|
67903
|
+
return Promise.resolve(null);
|
|
67904
|
+
}
|
|
67905
|
+
if (this.recoveryProbeInFlight) {
|
|
67906
|
+
return this.recoveryProbeInFlight;
|
|
67907
|
+
}
|
|
67908
|
+
this.recoveryProbeInFlight = (async () => {
|
|
67909
|
+
const loggedIn = await this.options.checkLoggedIn?.();
|
|
67910
|
+
if (this.options.isStopping() || !this.authGate.blocked || !loggedIn) {
|
|
67911
|
+
return null;
|
|
67912
|
+
}
|
|
67913
|
+
const refresh = await this.runRefresh();
|
|
67914
|
+
return this.authGate.blocked ? null : refresh;
|
|
67915
|
+
})().finally(() => {
|
|
67916
|
+
this.recoveryProbeInFlight = null;
|
|
67917
|
+
});
|
|
67918
|
+
return this.recoveryProbeInFlight;
|
|
67919
|
+
}
|
|
67920
|
+
runRefresh() {
|
|
67921
|
+
if (this.refreshInFlight) {
|
|
67922
|
+
return this.refreshInFlight;
|
|
67923
|
+
}
|
|
67924
|
+
this.refreshInFlight = this.options.refresh().finally(() => {
|
|
67925
|
+
this.refreshInFlight = null;
|
|
67926
|
+
});
|
|
67927
|
+
return this.refreshInFlight;
|
|
67830
67928
|
}
|
|
67831
67929
|
};
|
|
67832
67930
|
ListenerDeferredTaskScheduler = class {
|
|
@@ -115657,7 +115755,7 @@ async function getCurrentNodeCliVersion() {
|
|
|
115657
115755
|
return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
|
|
115658
115756
|
}
|
|
115659
115757
|
function getBundledNodeCliVersion() {
|
|
115660
|
-
return true ? "0.2.4-beta-e7a52faf6f-
|
|
115758
|
+
return true ? "0.2.4-beta-e7a52faf6f-260812104443" : null;
|
|
115661
115759
|
}
|
|
115662
115760
|
function readConfiguredAiProvider() {
|
|
115663
115761
|
const explicit = process.env.OKX_A2A_AI_PROVIDER || process.env.OKX_AGENT_TASK_AI_CLI;
|
|
@@ -115867,7 +115965,7 @@ async function updateHermes(release, options) {
|
|
|
115867
115965
|
}
|
|
115868
115966
|
}
|
|
115869
115967
|
async function installGatewayPluginForDoctor(target) {
|
|
115870
|
-
const release = isPrereleaseVersion("0.2.4-beta-e7a52faf6f-
|
|
115968
|
+
const release = isPrereleaseVersion("0.2.4-beta-e7a52faf6f-260812104443") ? "beta" : "latest";
|
|
115871
115969
|
const insideTargetGateway = detectGatewayInvocation() === target;
|
|
115872
115970
|
const options = {
|
|
115873
115971
|
restart: !insideTargetGateway,
|
|
@@ -116910,7 +117008,7 @@ async function runDoctor(options = {}) {
|
|
|
116910
117008
|
platform: options.platform ?? process.platform,
|
|
116911
117009
|
env: options.env ?? process.env,
|
|
116912
117010
|
target: options.target ?? resolveDoctorTarget(options.env ?? process.env),
|
|
116913
|
-
cliVersion: options.cliVersion ?? (true ? "0.2.4-beta-e7a52faf6f-
|
|
117011
|
+
cliVersion: options.cliVersion ?? (true ? "0.2.4-beta-e7a52faf6f-260812104443" : "0.0.0"),
|
|
116914
117012
|
fixMode: options.fix === true,
|
|
116915
117013
|
nonInteractive: options.nonInteractive === true,
|
|
116916
117014
|
packageChanged: false,
|
|
@@ -117907,7 +118005,7 @@ init_sentry_logger();
|
|
|
117907
118005
|
init_sentry_config();
|
|
117908
118006
|
var CURRENT_GATEWAY_SESSION_KEYS_ENV4 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
|
|
117909
118007
|
function printUsage3() {
|
|
117910
|
-
console.log(`okx-a2a ${"0.2.4-beta-e7a52faf6f-
|
|
118008
|
+
console.log(`okx-a2a ${"0.2.4-beta-e7a52faf6f-260812104443"}
|
|
117911
118009
|
|
|
117912
118010
|
Usage:
|
|
117913
118011
|
okx-a2a <command> [options]
|
|
@@ -117947,7 +118045,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
|
|
|
117947
118045
|
`);
|
|
117948
118046
|
}
|
|
117949
118047
|
function printVersion() {
|
|
117950
|
-
console.log("0.2.4-beta-e7a52faf6f-
|
|
118048
|
+
console.log("0.2.4-beta-e7a52faf6f-260812104443");
|
|
117951
118049
|
}
|
|
117952
118050
|
function printDaemonUsage() {
|
|
117953
118051
|
console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
|
|
@@ -119383,7 +119481,7 @@ async function main() {
|
|
|
119383
119481
|
if (command === "xmtp-test") {
|
|
119384
119482
|
const { handleXmtpTestCommand: handleXmtpTestCommand2 } = await Promise.resolve().then(() => (init_xmtp_test_cli(), xmtp_test_cli_exports));
|
|
119385
119483
|
await handleXmtpTestCommand2(process.argv.slice(3), {
|
|
119386
|
-
packageVersion: "0.2.4-beta-e7a52faf6f-
|
|
119484
|
+
packageVersion: "0.2.4-beta-e7a52faf6f-260812104443",
|
|
119387
119485
|
agentSdkVersion: "2.3.0",
|
|
119388
119486
|
nodeSdkVersion: "6.1.0",
|
|
119389
119487
|
nodeBindingsVersion: "1.11.0"
|
package/dist/index.js
CHANGED
|
@@ -32104,7 +32104,7 @@ var init_sentry_config = __esm({
|
|
|
32104
32104
|
environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
32105
32105
|
SENTRY_CONFIG = {
|
|
32106
32106
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
32107
|
-
release: "0.2.4-beta-e7a52faf6f-
|
|
32107
|
+
release: "0.2.4-beta-e7a52faf6f-260812104443",
|
|
32108
32108
|
environment,
|
|
32109
32109
|
runtimeContainer: normalizeRuntimeContainer(process.env.OKX_A2A_RUNTIME_CONTAINER)
|
|
32110
32110
|
};
|
|
@@ -33045,7 +33045,7 @@ async function getCurrentNodeCliVersion() {
|
|
|
33045
33045
|
return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
|
|
33046
33046
|
}
|
|
33047
33047
|
function getBundledNodeCliVersion() {
|
|
33048
|
-
return true ? "0.2.4-beta-e7a52faf6f-
|
|
33048
|
+
return true ? "0.2.4-beta-e7a52faf6f-260812104443" : null;
|
|
33049
33049
|
}
|
|
33050
33050
|
function readConfiguredAiProvider() {
|
|
33051
33051
|
const explicit = process.env.OKX_A2A_AI_PROVIDER || process.env.OKX_AGENT_TASK_AI_CLI;
|
|
@@ -33255,7 +33255,7 @@ async function updateHermes(release, options) {
|
|
|
33255
33255
|
}
|
|
33256
33256
|
}
|
|
33257
33257
|
async function installGatewayPluginForDoctor(target) {
|
|
33258
|
-
const release = isPrereleaseVersion("0.2.4-beta-e7a52faf6f-
|
|
33258
|
+
const release = isPrereleaseVersion("0.2.4-beta-e7a52faf6f-260812104443") ? "beta" : "latest";
|
|
33259
33259
|
const insideTargetGateway = detectGatewayInvocation() === target;
|
|
33260
33260
|
const options = {
|
|
33261
33261
|
restart: !insideTargetGateway,
|
|
@@ -44113,6 +44113,7 @@ __export(index_exports, {
|
|
|
44113
44113
|
notifyUserAttentionChanged: () => notifyUserAttentionChanged,
|
|
44114
44114
|
parseLogsExportArgs: () => parseLogsExportArgs,
|
|
44115
44115
|
parsePluginYamlVersion: () => parsePluginYamlVersion,
|
|
44116
|
+
parseWalletLoginStatus: () => parseWalletLoginStatus,
|
|
44116
44117
|
parseWindowsParentProcessJson: () => parseWindowsParentProcessJson,
|
|
44117
44118
|
performRuntimeSwitch: () => performRuntimeSwitch,
|
|
44118
44119
|
persistCurrentRuntimeSelectionForNewJob: () => persistCurrentRuntimeSelectionForNewJob,
|
|
@@ -58947,6 +58948,42 @@ async function fetchSystemConfig(options) {
|
|
|
58947
58948
|
return res.data;
|
|
58948
58949
|
}
|
|
58949
58950
|
|
|
58951
|
+
// ../core/src/xmtp-sdk/onchainos/wallet-status.ts
|
|
58952
|
+
init_log();
|
|
58953
|
+
init_sentry_logger();
|
|
58954
|
+
function parseWalletLoginStatus(stdout) {
|
|
58955
|
+
const response = parseCliJson(stdout, "wallet-status");
|
|
58956
|
+
if (!response.ok) {
|
|
58957
|
+
const error = new Error("onchainos wallet status failed");
|
|
58958
|
+
logger.error(
|
|
58959
|
+
LogEvent.ONCHAINOS_CLI_ERROR,
|
|
58960
|
+
error,
|
|
58961
|
+
cliOkFalseExtras(stdout, "wallet-status")
|
|
58962
|
+
);
|
|
58963
|
+
throw error;
|
|
58964
|
+
}
|
|
58965
|
+
if (typeof response.data?.loggedIn !== "boolean") {
|
|
58966
|
+
const error = new Error("onchainos wallet status returned invalid loggedIn state");
|
|
58967
|
+
logger.error(LogEvent.ONCHAINOS_CLI_ERROR, error, {
|
|
58968
|
+
component: "onchainos_cli",
|
|
58969
|
+
source: "onchainos",
|
|
58970
|
+
stage: "response_validation",
|
|
58971
|
+
communicationClass: "onchainos_cli_or_api_issue",
|
|
58972
|
+
operation: "wallet-status",
|
|
58973
|
+
reason: "invalid_logged_in_state"
|
|
58974
|
+
});
|
|
58975
|
+
throw error;
|
|
58976
|
+
}
|
|
58977
|
+
return response.data.loggedIn;
|
|
58978
|
+
}
|
|
58979
|
+
async function queryWalletLoginStatus() {
|
|
58980
|
+
logWithTimestamp("[onchainos] checking wallet login status");
|
|
58981
|
+
const { stdout } = await exec(["wallet", "status"]);
|
|
58982
|
+
const loggedIn = parseWalletLoginStatus(stdout);
|
|
58983
|
+
logWithTimestamp(`[onchainos] wallet login status: ${loggedIn ? "logged in" : "logged out"}`);
|
|
58984
|
+
return loggedIn;
|
|
58985
|
+
}
|
|
58986
|
+
|
|
58950
58987
|
// ../core/src/xmtp-sdk/onchainos/index.ts
|
|
58951
58988
|
var MESSAGE_ELIGIBILITY_SERVICE_UNAVAILABLE_AI_HINT = "Message eligibility service is temporarily unavailable. Please try again later.";
|
|
58952
58989
|
function messageEligibleUnavailableError(input) {
|
|
@@ -60205,7 +60242,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
60205
60242
|
client: {
|
|
60206
60243
|
id: "gateway-client",
|
|
60207
60244
|
displayName: "okx-a2a-node",
|
|
60208
|
-
version: "0.2.4-beta-e7a52faf6f-
|
|
60245
|
+
version: "0.2.4-beta-e7a52faf6f-260812104443",
|
|
60209
60246
|
platform: "node",
|
|
60210
60247
|
mode: "backend",
|
|
60211
60248
|
instanceId
|
|
@@ -60216,7 +60253,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
60216
60253
|
commands: [],
|
|
60217
60254
|
permissions: {},
|
|
60218
60255
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
60219
|
-
userAgent: `okx-a2a-node/${"0.2.4-beta-e7a52faf6f-
|
|
60256
|
+
userAgent: `okx-a2a-node/${"0.2.4-beta-e7a52faf6f-260812104443"}`,
|
|
60220
60257
|
auth: {
|
|
60221
60258
|
...config.token ? { token: config.token } : {},
|
|
60222
60259
|
...config.password ? { password: config.password } : {}
|
|
@@ -65998,6 +66035,7 @@ var DEFAULT_OFFLINE_REPLAY_INTERVAL_SEC = 300;
|
|
|
65998
66035
|
var DEFAULT_XMTP_CLIENT_RECYCLE_INTERVAL_SEC = 6 * 60 * 60;
|
|
65999
66036
|
var XMTP_CLIENT_RECYCLE_INTERVAL_ENV = "OKX_A2A_XMTP_CLIENT_RECYCLE_INTERVAL_SEC";
|
|
66000
66037
|
var HEARTBEAT_GATEWAY_CHECK_TIMEOUT_MS = 2e3;
|
|
66038
|
+
var AUTH_RECOVERY_PROBE_INTERVAL_MS = 6e4;
|
|
66001
66039
|
async function runHeartbeatRefreshCycle(options) {
|
|
66002
66040
|
const heartbeat = await timeSettled(options.heartbeat);
|
|
66003
66041
|
const refreshAllowed = heartbeat.value === "performed" || heartbeat.value === "refresh_safe";
|
|
@@ -66026,6 +66064,8 @@ var AgentRefreshCoordinator = class {
|
|
|
66026
66064
|
}
|
|
66027
66065
|
options;
|
|
66028
66066
|
authGate = new AgentRefreshAuthGate();
|
|
66067
|
+
refreshInFlight = null;
|
|
66068
|
+
recoveryProbeInFlight = null;
|
|
66029
66069
|
get blocked() {
|
|
66030
66070
|
return this.authGate.blocked;
|
|
66031
66071
|
}
|
|
@@ -66049,10 +66089,38 @@ var AgentRefreshCoordinator = class {
|
|
|
66049
66089
|
if (this.options.isStopping() || this.authGate.blocked) {
|
|
66050
66090
|
return null;
|
|
66051
66091
|
}
|
|
66052
|
-
return this.
|
|
66092
|
+
return this.runRefresh();
|
|
66053
66093
|
}
|
|
66054
66094
|
async runManual() {
|
|
66055
|
-
return this.
|
|
66095
|
+
return this.runRefresh();
|
|
66096
|
+
}
|
|
66097
|
+
runRecoveryProbe() {
|
|
66098
|
+
if (this.options.isStopping() || !this.authGate.blocked || !this.options.checkLoggedIn) {
|
|
66099
|
+
return Promise.resolve(null);
|
|
66100
|
+
}
|
|
66101
|
+
if (this.recoveryProbeInFlight) {
|
|
66102
|
+
return this.recoveryProbeInFlight;
|
|
66103
|
+
}
|
|
66104
|
+
this.recoveryProbeInFlight = (async () => {
|
|
66105
|
+
const loggedIn = await this.options.checkLoggedIn?.();
|
|
66106
|
+
if (this.options.isStopping() || !this.authGate.blocked || !loggedIn) {
|
|
66107
|
+
return null;
|
|
66108
|
+
}
|
|
66109
|
+
const refresh = await this.runRefresh();
|
|
66110
|
+
return this.authGate.blocked ? null : refresh;
|
|
66111
|
+
})().finally(() => {
|
|
66112
|
+
this.recoveryProbeInFlight = null;
|
|
66113
|
+
});
|
|
66114
|
+
return this.recoveryProbeInFlight;
|
|
66115
|
+
}
|
|
66116
|
+
runRefresh() {
|
|
66117
|
+
if (this.refreshInFlight) {
|
|
66118
|
+
return this.refreshInFlight;
|
|
66119
|
+
}
|
|
66120
|
+
this.refreshInFlight = this.options.refresh().finally(() => {
|
|
66121
|
+
this.refreshInFlight = null;
|
|
66122
|
+
});
|
|
66123
|
+
return this.refreshInFlight;
|
|
66056
66124
|
}
|
|
66057
66125
|
};
|
|
66058
66126
|
var ListenerDeferredTaskScheduler = class {
|
|
@@ -66309,10 +66377,11 @@ async function runListenerWithLock(options, paths) {
|
|
|
66309
66377
|
const agentRefreshCoordinator = new AgentRefreshCoordinator({
|
|
66310
66378
|
lookup: (previousFingerprint) => listAllAgentsWithMetadata(previousFingerprint),
|
|
66311
66379
|
refresh: () => service.refreshAgents(),
|
|
66380
|
+
checkLoggedIn: () => queryWalletLoginStatus(),
|
|
66312
66381
|
isStopping: () => stopping,
|
|
66313
66382
|
onAuthBlocked: () => {
|
|
66314
66383
|
logWithTimestamp(
|
|
66315
|
-
"[okx-agent-task] agent refresh auth blocked; periodic agent get paused.
|
|
66384
|
+
"[okx-agent-task] agent refresh auth blocked; periodic agent get paused. Wallet login recovery will be checked every 60s; run `okx-a2a agent refresh` to recover immediately"
|
|
66316
66385
|
);
|
|
66317
66386
|
},
|
|
66318
66387
|
onAuthRecovered: () => {
|
|
@@ -66348,7 +66417,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
66348
66417
|
}
|
|
66349
66418
|
}),
|
|
66350
66419
|
notifySessionExpired: (command) => {
|
|
66351
|
-
const rawText = `The onchainos login session has expired while running ${command}. Run \`onchainos wallet login
|
|
66420
|
+
const rawText = `The onchainos login session has expired while running ${command}. Run \`onchainos wallet login\`; A2A will recover within 60 seconds, or run \`okx-a2a agent refresh\` to recover immediately.`;
|
|
66352
66421
|
void store.appendBackup(buildSystemStoredMessage({
|
|
66353
66422
|
reason: "onchainos-session-expired",
|
|
66354
66423
|
rawText,
|
|
@@ -66376,12 +66445,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
66376
66445
|
});
|
|
66377
66446
|
}
|
|
66378
66447
|
});
|
|
66379
|
-
service.setPluginVersion("0.2.4-beta-e7a52faf6f-
|
|
66448
|
+
service.setPluginVersion("0.2.4-beta-e7a52faf6f-260812104443");
|
|
66380
66449
|
await service.init();
|
|
66381
66450
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
66382
66451
|
if (pluginVersionStatus.unavailable) {
|
|
66383
66452
|
throw new Error(
|
|
66384
|
-
`@okxweb3/a2a-node v${"0.2.4-beta-e7a52faf6f-
|
|
66453
|
+
`@okxweb3/a2a-node v${"0.2.4-beta-e7a52faf6f-260812104443"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
66385
66454
|
);
|
|
66386
66455
|
}
|
|
66387
66456
|
const systemConfig = service.getSystemConfig();
|
|
@@ -66399,7 +66468,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
66399
66468
|
onchainosAgentId: "*",
|
|
66400
66469
|
reason: "system-config missing sentryDsn",
|
|
66401
66470
|
pluginId: "@okxweb3/a2a-node",
|
|
66402
|
-
pluginVersion: "0.2.4-beta-e7a52faf6f-
|
|
66471
|
+
pluginVersion: "0.2.4-beta-e7a52faf6f-260812104443"
|
|
66403
66472
|
});
|
|
66404
66473
|
}
|
|
66405
66474
|
logWithTimestamp(
|
|
@@ -66740,6 +66809,26 @@ async function runListenerWithLock(options, paths) {
|
|
|
66740
66809
|
const systemConfigRefreshTimer = setInterval(() => {
|
|
66741
66810
|
void refreshSystemConfigTick();
|
|
66742
66811
|
}, 60 * 60 * 1e3);
|
|
66812
|
+
const authRecoveryProbeTimer = setInterval(() => {
|
|
66813
|
+
if (stopping || !agentRefreshCoordinator.blocked) {
|
|
66814
|
+
return;
|
|
66815
|
+
}
|
|
66816
|
+
void agentRefreshCoordinator.runRecoveryProbe().then((refresh) => {
|
|
66817
|
+
if (!refresh) {
|
|
66818
|
+
return;
|
|
66819
|
+
}
|
|
66820
|
+
logWithTimestamp(
|
|
66821
|
+
`[okx-agent-task] auth recovery refresh agents=${refresh.agentCount} added=${refresh.added.length} removed=${refresh.removed.length}`
|
|
66822
|
+
);
|
|
66823
|
+
}).catch((err) => {
|
|
66824
|
+
logger.error(LogEvent.DAEMON_TICK_FAILED, err instanceof Error ? err : new Error(String(err)), {
|
|
66825
|
+
component: "node_listener",
|
|
66826
|
+
stage: "auth_recovery_probe",
|
|
66827
|
+
reason: "auth_recovery_probe_failed"
|
|
66828
|
+
});
|
|
66829
|
+
logWithTimestamp("[okx-agent-task] auth recovery probe failed:", err);
|
|
66830
|
+
});
|
|
66831
|
+
}, AUTH_RECOVERY_PROBE_INTERVAL_MS);
|
|
66743
66832
|
void runHeartbeatRefreshCycle({
|
|
66744
66833
|
heartbeat: heartbeatTick
|
|
66745
66834
|
});
|
|
@@ -66775,6 +66864,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
66775
66864
|
clearInterval(xmtpClientRecycleTimer);
|
|
66776
66865
|
}
|
|
66777
66866
|
clearInterval(systemConfigRefreshTimer);
|
|
66867
|
+
clearInterval(authRecoveryProbeTimer);
|
|
66778
66868
|
commandProcessor.stop();
|
|
66779
66869
|
await watcherCoordinator.stop();
|
|
66780
66870
|
try {
|
|
@@ -69076,7 +69166,7 @@ async function exportDiagnosticLogs(options) {
|
|
|
69076
69166
|
node: process.version,
|
|
69077
69167
|
platform: process.platform,
|
|
69078
69168
|
arch: process.arch,
|
|
69079
|
-
packageVersion: true ? "0.2.4-beta-e7a52faf6f-
|
|
69169
|
+
packageVersion: true ? "0.2.4-beta-e7a52faf6f-260812104443" : "unknown",
|
|
69080
69170
|
sensitiveContentIncluded: options.includeSensitiveContent,
|
|
69081
69171
|
listenerAndLlmContentIncluded: true,
|
|
69082
69172
|
credentialsAlwaysRedacted: true,
|
|
@@ -70912,7 +71002,7 @@ async function runDoctor(options = {}) {
|
|
|
70912
71002
|
platform: options.platform ?? process.platform,
|
|
70913
71003
|
env: options.env ?? process.env,
|
|
70914
71004
|
target: options.target ?? resolveDoctorTarget(options.env ?? process.env),
|
|
70915
|
-
cliVersion: options.cliVersion ?? (true ? "0.2.4-beta-e7a52faf6f-
|
|
71005
|
+
cliVersion: options.cliVersion ?? (true ? "0.2.4-beta-e7a52faf6f-260812104443" : "0.0.0"),
|
|
70916
71006
|
fixMode: options.fix === true,
|
|
70917
71007
|
nonInteractive: options.nonInteractive === true,
|
|
70918
71008
|
packageChanged: false,
|
|
@@ -71302,6 +71392,7 @@ init_autostart_windows();
|
|
|
71302
71392
|
notifyUserAttentionChanged,
|
|
71303
71393
|
parseLogsExportArgs,
|
|
71304
71394
|
parsePluginYamlVersion,
|
|
71395
|
+
parseWalletLoginStatus,
|
|
71305
71396
|
parseWindowsParentProcessJson,
|
|
71306
71397
|
performRuntimeSwitch,
|
|
71307
71398
|
persistCurrentRuntimeSelectionForNewJob,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okxweb3/a2a-node",
|
|
3
|
-
"version": "0.2.4-beta-e7a52faf6f-
|
|
3
|
+
"version": "0.2.4-beta-e7a52faf6f-260812104443",
|
|
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": {
|