@okxweb3/a2a-node 0.2.4 → 0.2.5
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 +91 -74
- package/dist/index.js +88 -71
- 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.
|
|
26607
|
+
version: "0.2.5",
|
|
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.
|
|
26618
|
+
userAgent: `okx-a2a-node/${"0.2.5"}`,
|
|
26619
26619
|
auth: {
|
|
26620
26620
|
...config.token ? { token: config.token } : {},
|
|
26621
26621
|
...config.password ? { password: config.password } : {}
|
|
@@ -28524,7 +28524,7 @@ var init_sentry_config = __esm({
|
|
|
28524
28524
|
environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
28525
28525
|
SENTRY_CONFIG = {
|
|
28526
28526
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
28527
|
-
release: "0.2.
|
|
28527
|
+
release: "0.2.5",
|
|
28528
28528
|
environment,
|
|
28529
28529
|
runtimeContainer: normalizeRuntimeContainer(process.env.OKX_A2A_RUNTIME_CONTAINER)
|
|
28530
28530
|
};
|
|
@@ -39694,7 +39694,7 @@ async function exportDiagnosticLogs(options) {
|
|
|
39694
39694
|
node: process.version,
|
|
39695
39695
|
platform: process.platform,
|
|
39696
39696
|
arch: process.arch,
|
|
39697
|
-
packageVersion: true ? "0.2.
|
|
39697
|
+
packageVersion: true ? "0.2.5" : "unknown",
|
|
39698
39698
|
sensitiveContentIncluded: options.includeSensitiveContent,
|
|
39699
39699
|
listenerAndLlmContentIncluded: true,
|
|
39700
39700
|
credentialsAlwaysRedacted: true,
|
|
@@ -66287,67 +66287,50 @@ async function verifyInboundA2AGroupMessage(params) {
|
|
|
66287
66287
|
const sender = isPlainObject3(payload.sender) ? payload.sender : null;
|
|
66288
66288
|
const senderAgentId = readString5(sender?.agentId);
|
|
66289
66289
|
const senderRole = readNumber(sender?.role);
|
|
66290
|
-
if (
|
|
66291
|
-
const
|
|
66292
|
-
|
|
66293
|
-
|
|
66294
|
-
|
|
66295
|
-
|
|
66296
|
-
|
|
66297
|
-
|
|
66298
|
-
|
|
66299
|
-
|
|
66300
|
-
|
|
66301
|
-
|
|
66302
|
-
|
|
66303
|
-
|
|
66304
|
-
|
|
66305
|
-
|
|
66306
|
-
|
|
66307
|
-
|
|
66308
|
-
|
|
66309
|
-
|
|
66310
|
-
|
|
66311
|
-
|
|
66312
|
-
|
|
66313
|
-
|
|
66314
|
-
|
|
66315
|
-
|
|
66316
|
-
|
|
66317
|
-
|
|
66318
|
-
|
|
66319
|
-
|
|
66320
|
-
|
|
66321
|
-
|
|
66322
|
-
|
|
66323
|
-
|
|
66324
|
-
|
|
66325
|
-
|
|
66326
|
-
|
|
66327
|
-
|
|
66328
|
-
|
|
66329
|
-
|
|
66330
|
-
messageId,
|
|
66331
|
-
groupId,
|
|
66332
|
-
jobId,
|
|
66333
|
-
agentId: senderAgentId,
|
|
66334
|
-
localAgentId: myAgent.agentId,
|
|
66335
|
-
senderAddress,
|
|
66336
|
-
senderInboxId,
|
|
66337
|
-
reason: result.reason ?? "message_ineligible",
|
|
66338
|
-
stage: "inbound/eligibility_check",
|
|
66339
|
-
logTag: `[okx-agent-task:${myXmtpAddress}]`
|
|
66340
|
-
});
|
|
66341
|
-
return false;
|
|
66342
|
-
}
|
|
66343
|
-
} catch (err2) {
|
|
66344
|
-
const failureMessage = err2 instanceof Error ? err2.message : String(err2);
|
|
66290
|
+
if (!senderAgentId || !myAgent) {
|
|
66291
|
+
const reason = !senderAgentId ? "missing_sender_agent_id" : "local_agent_not_found";
|
|
66292
|
+
logWithTimestamp(
|
|
66293
|
+
`[okx-agent-task:${myXmtpAddress}] inbound agent identity missing, dropping: sender=${senderAddress} job=${jobId} group=${groupId} reason=${reason}`
|
|
66294
|
+
);
|
|
66295
|
+
recordInvalidXmtpMessageBestEffort({
|
|
66296
|
+
messageId,
|
|
66297
|
+
groupId,
|
|
66298
|
+
jobId,
|
|
66299
|
+
agentId: senderAgentId,
|
|
66300
|
+
localAgentId: myAgent?.agentId ?? null,
|
|
66301
|
+
senderAddress,
|
|
66302
|
+
senderInboxId,
|
|
66303
|
+
reason,
|
|
66304
|
+
stage: "inbound/identity_check",
|
|
66305
|
+
logTag: `[okx-agent-task:${myXmtpAddress}]`
|
|
66306
|
+
});
|
|
66307
|
+
return false;
|
|
66308
|
+
}
|
|
66309
|
+
const isSenderClient = senderRole === 1 /* CLIENT */;
|
|
66310
|
+
const providerSecurityRate = (isSenderClient ? myAgent.securityRate : XmtpService.getInstance().getAgentByAgentId(senderAgentId)?.securityRate) ?? 0;
|
|
66311
|
+
try {
|
|
66312
|
+
const eligibilityStartedAt = Date.now();
|
|
66313
|
+
const result = await checkMessageEligible({
|
|
66314
|
+
agentId: myAgent.agentId,
|
|
66315
|
+
clientAgentId: isSenderClient ? senderAgentId : myAgent.agentId,
|
|
66316
|
+
providerAgentId: isSenderClient ? myAgent.agentId : senderAgentId,
|
|
66317
|
+
clientCommunicationAddress: isSenderClient ? senderAddress : myXmtpAddress,
|
|
66318
|
+
providerCommunicationAddress: isSenderClient ? myXmtpAddress : senderAddress,
|
|
66319
|
+
jobId,
|
|
66320
|
+
groupId,
|
|
66321
|
+
direction: isSenderClient ? "client_to_provider" : "provider_to_client",
|
|
66322
|
+
providerSecurityRate,
|
|
66323
|
+
isOfflineReplay
|
|
66324
|
+
});
|
|
66325
|
+
timing?.mark("eligibilityCheck", eligibilityStartedAt);
|
|
66326
|
+
logWithTimestamp(
|
|
66327
|
+
`[okx-agent-task:${myXmtpAddress}] inbound message-eligible: senderAgentId=${senderAgentId} job=${jobId} group=${groupId} result=${JSON.stringify(result)}`
|
|
66328
|
+
);
|
|
66329
|
+
if (!result.eligible) {
|
|
66345
66330
|
logWithTimestamp(
|
|
66346
|
-
`[okx-agent-task:${myXmtpAddress}] message-eligible
|
|
66347
|
-
${failureMessage}`,
|
|
66348
|
-
err2
|
|
66331
|
+
`[okx-agent-task:${myXmtpAddress}] message-eligible check failed, dropping: sender=${senderAddress} job=${jobId} reason=${result.reason ?? ""}`
|
|
66349
66332
|
);
|
|
66350
|
-
logger.
|
|
66333
|
+
logger.info(LogEvent.INBOUND_BLOCKED_INELIGIBLE, {
|
|
66351
66334
|
...agentExtras({ walletAddress: myXmtpAddress, onchainosAgentId: myAgent.agentId }),
|
|
66352
66335
|
peerWalletAddress: senderAddress,
|
|
66353
66336
|
peerInboxId: senderInboxId,
|
|
@@ -66358,7 +66341,7 @@ ${failureMessage}`,
|
|
|
66358
66341
|
direction: isSenderClient ? "client_to_provider" : "provider_to_client",
|
|
66359
66342
|
providerSecurityRate: String(providerSecurityRate),
|
|
66360
66343
|
...inboundStageExtras("inbound/eligibility_check", "blocked"),
|
|
66361
|
-
reason: "
|
|
66344
|
+
reason: result.reason ?? "",
|
|
66362
66345
|
...timing?.extras()
|
|
66363
66346
|
});
|
|
66364
66347
|
recordInvalidXmtpMessageBestEffort({
|
|
@@ -66369,12 +66352,46 @@ ${failureMessage}`,
|
|
|
66369
66352
|
localAgentId: myAgent.agentId,
|
|
66370
66353
|
senderAddress,
|
|
66371
66354
|
senderInboxId,
|
|
66372
|
-
reason:
|
|
66355
|
+
reason: result.reason ?? "message_ineligible",
|
|
66373
66356
|
stage: "inbound/eligibility_check",
|
|
66374
66357
|
logTag: `[okx-agent-task:${myXmtpAddress}]`
|
|
66375
66358
|
});
|
|
66376
66359
|
return false;
|
|
66377
66360
|
}
|
|
66361
|
+
} catch (err2) {
|
|
66362
|
+
const failureMessage = err2 instanceof Error ? err2.message : String(err2);
|
|
66363
|
+
logWithTimestamp(
|
|
66364
|
+
`[okx-agent-task:${myXmtpAddress}] message-eligible call failed, dropping message:
|
|
66365
|
+
${failureMessage}`,
|
|
66366
|
+
err2
|
|
66367
|
+
);
|
|
66368
|
+
logger.error(LogEvent.INBOUND_BLOCKED_INELIGIBLE, err2 instanceof Error ? err2 : new Error(String(err2)), {
|
|
66369
|
+
...agentExtras({ walletAddress: myXmtpAddress, onchainosAgentId: myAgent.agentId }),
|
|
66370
|
+
peerWalletAddress: senderAddress,
|
|
66371
|
+
peerInboxId: senderInboxId,
|
|
66372
|
+
peerAgentId: senderAgentId,
|
|
66373
|
+
taskId: jobId,
|
|
66374
|
+
conversationId: groupId,
|
|
66375
|
+
messageId,
|
|
66376
|
+
direction: isSenderClient ? "client_to_provider" : "provider_to_client",
|
|
66377
|
+
providerSecurityRate: String(providerSecurityRate),
|
|
66378
|
+
...inboundStageExtras("inbound/eligibility_check", "blocked"),
|
|
66379
|
+
reason: "eligibility_service_error",
|
|
66380
|
+
...timing?.extras()
|
|
66381
|
+
});
|
|
66382
|
+
recordInvalidXmtpMessageBestEffort({
|
|
66383
|
+
messageId,
|
|
66384
|
+
groupId,
|
|
66385
|
+
jobId,
|
|
66386
|
+
agentId: senderAgentId,
|
|
66387
|
+
localAgentId: myAgent.agentId,
|
|
66388
|
+
senderAddress,
|
|
66389
|
+
senderInboxId,
|
|
66390
|
+
reason: failureMessage,
|
|
66391
|
+
stage: "inbound/eligibility_check",
|
|
66392
|
+
logTag: `[okx-agent-task:${myXmtpAddress}]`
|
|
66393
|
+
});
|
|
66394
|
+
return false;
|
|
66378
66395
|
}
|
|
66379
66396
|
const content2 = readString5(payload.content);
|
|
66380
66397
|
if (!content2) {
|
|
@@ -67483,12 +67500,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
67483
67500
|
});
|
|
67484
67501
|
}
|
|
67485
67502
|
});
|
|
67486
|
-
service.setPluginVersion("0.2.
|
|
67503
|
+
service.setPluginVersion("0.2.5");
|
|
67487
67504
|
await service.init();
|
|
67488
67505
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
67489
67506
|
if (pluginVersionStatus.unavailable) {
|
|
67490
67507
|
throw new Error(
|
|
67491
|
-
`@okxweb3/a2a-node v${"0.2.
|
|
67508
|
+
`@okxweb3/a2a-node v${"0.2.5"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
67492
67509
|
);
|
|
67493
67510
|
}
|
|
67494
67511
|
const systemConfig = service.getSystemConfig();
|
|
@@ -67506,7 +67523,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
67506
67523
|
onchainosAgentId: "*",
|
|
67507
67524
|
reason: "system-config missing sentryDsn",
|
|
67508
67525
|
pluginId: "@okxweb3/a2a-node",
|
|
67509
|
-
pluginVersion: "0.2.
|
|
67526
|
+
pluginVersion: "0.2.5"
|
|
67510
67527
|
});
|
|
67511
67528
|
}
|
|
67512
67529
|
logWithTimestamp(
|
|
@@ -115908,7 +115925,7 @@ async function getCurrentNodeCliVersion() {
|
|
|
115908
115925
|
return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
|
|
115909
115926
|
}
|
|
115910
115927
|
function getBundledNodeCliVersion() {
|
|
115911
|
-
return true ? "0.2.
|
|
115928
|
+
return true ? "0.2.5" : null;
|
|
115912
115929
|
}
|
|
115913
115930
|
function readConfiguredAiProvider() {
|
|
115914
115931
|
const explicit = process.env.OKX_A2A_AI_PROVIDER || process.env.OKX_AGENT_TASK_AI_CLI;
|
|
@@ -116118,7 +116135,7 @@ async function updateHermes(release, options) {
|
|
|
116118
116135
|
}
|
|
116119
116136
|
}
|
|
116120
116137
|
async function installGatewayPluginForDoctor(target) {
|
|
116121
|
-
const release = isPrereleaseVersion("0.2.
|
|
116138
|
+
const release = isPrereleaseVersion("0.2.5") ? "beta" : "latest";
|
|
116122
116139
|
const insideTargetGateway = detectGatewayInvocation() === target;
|
|
116123
116140
|
const options = {
|
|
116124
116141
|
restart: !insideTargetGateway,
|
|
@@ -117161,7 +117178,7 @@ async function runDoctor(options = {}) {
|
|
|
117161
117178
|
platform: options.platform ?? process.platform,
|
|
117162
117179
|
env: options.env ?? process.env,
|
|
117163
117180
|
target: options.target ?? resolveDoctorTarget(options.env ?? process.env),
|
|
117164
|
-
cliVersion: options.cliVersion ?? (true ? "0.2.
|
|
117181
|
+
cliVersion: options.cliVersion ?? (true ? "0.2.5" : "0.0.0"),
|
|
117165
117182
|
fixMode: options.fix === true,
|
|
117166
117183
|
nonInteractive: options.nonInteractive === true,
|
|
117167
117184
|
packageChanged: false,
|
|
@@ -118159,7 +118176,7 @@ init_sentry_logger();
|
|
|
118159
118176
|
init_sentry_config();
|
|
118160
118177
|
var CURRENT_GATEWAY_SESSION_KEYS_ENV4 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
|
|
118161
118178
|
function printUsage3() {
|
|
118162
|
-
console.log(`okx-a2a ${"0.2.
|
|
118179
|
+
console.log(`okx-a2a ${"0.2.5"}
|
|
118163
118180
|
|
|
118164
118181
|
Usage:
|
|
118165
118182
|
okx-a2a <command> [options]
|
|
@@ -118199,7 +118216,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
|
|
|
118199
118216
|
`);
|
|
118200
118217
|
}
|
|
118201
118218
|
function printVersion() {
|
|
118202
|
-
console.log("0.2.
|
|
118219
|
+
console.log("0.2.5");
|
|
118203
118220
|
}
|
|
118204
118221
|
function printDaemonUsage() {
|
|
118205
118222
|
console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
|
|
@@ -119638,7 +119655,7 @@ async function main() {
|
|
|
119638
119655
|
if (command === "xmtp-test") {
|
|
119639
119656
|
const { handleXmtpTestCommand: handleXmtpTestCommand2 } = await Promise.resolve().then(() => (init_xmtp_test_cli(), xmtp_test_cli_exports));
|
|
119640
119657
|
await handleXmtpTestCommand2(process.argv.slice(3), {
|
|
119641
|
-
packageVersion: "0.2.
|
|
119658
|
+
packageVersion: "0.2.5",
|
|
119642
119659
|
agentSdkVersion: "2.3.0",
|
|
119643
119660
|
nodeSdkVersion: "6.1.0",
|
|
119644
119661
|
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.
|
|
32107
|
+
release: "0.2.5",
|
|
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.
|
|
33048
|
+
return true ? "0.2.5" : 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.
|
|
33258
|
+
const release = isPrereleaseVersion("0.2.5") ? "beta" : "latest";
|
|
33259
33259
|
const insideTargetGateway = detectGatewayInvocation() === target;
|
|
33260
33260
|
const options = {
|
|
33261
33261
|
restart: !insideTargetGateway,
|
|
@@ -60395,7 +60395,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
60395
60395
|
client: {
|
|
60396
60396
|
id: "gateway-client",
|
|
60397
60397
|
displayName: "okx-a2a-node",
|
|
60398
|
-
version: "0.2.
|
|
60398
|
+
version: "0.2.5",
|
|
60399
60399
|
platform: "node",
|
|
60400
60400
|
mode: "backend",
|
|
60401
60401
|
instanceId
|
|
@@ -60406,7 +60406,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
60406
60406
|
commands: [],
|
|
60407
60407
|
permissions: {},
|
|
60408
60408
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
60409
|
-
userAgent: `okx-a2a-node/${"0.2.
|
|
60409
|
+
userAgent: `okx-a2a-node/${"0.2.5"}`,
|
|
60410
60410
|
auth: {
|
|
60411
60411
|
...config.token ? { token: config.token } : {},
|
|
60412
60412
|
...config.password ? { password: config.password } : {}
|
|
@@ -65121,67 +65121,50 @@ async function verifyInboundA2AGroupMessage(params) {
|
|
|
65121
65121
|
const sender = isPlainObject3(payload.sender) ? payload.sender : null;
|
|
65122
65122
|
const senderAgentId = readString3(sender?.agentId);
|
|
65123
65123
|
const senderRole = readNumber(sender?.role);
|
|
65124
|
-
if (
|
|
65125
|
-
const
|
|
65126
|
-
|
|
65127
|
-
|
|
65128
|
-
|
|
65129
|
-
|
|
65130
|
-
|
|
65131
|
-
|
|
65132
|
-
|
|
65133
|
-
|
|
65134
|
-
|
|
65135
|
-
|
|
65136
|
-
|
|
65137
|
-
|
|
65138
|
-
|
|
65139
|
-
|
|
65140
|
-
|
|
65141
|
-
|
|
65142
|
-
|
|
65143
|
-
|
|
65144
|
-
|
|
65145
|
-
|
|
65146
|
-
|
|
65147
|
-
|
|
65148
|
-
|
|
65149
|
-
|
|
65150
|
-
|
|
65151
|
-
|
|
65152
|
-
|
|
65153
|
-
|
|
65154
|
-
|
|
65155
|
-
|
|
65156
|
-
|
|
65157
|
-
|
|
65158
|
-
|
|
65159
|
-
|
|
65160
|
-
|
|
65161
|
-
|
|
65162
|
-
|
|
65163
|
-
|
|
65164
|
-
messageId,
|
|
65165
|
-
groupId,
|
|
65166
|
-
jobId,
|
|
65167
|
-
agentId: senderAgentId,
|
|
65168
|
-
localAgentId: myAgent.agentId,
|
|
65169
|
-
senderAddress,
|
|
65170
|
-
senderInboxId,
|
|
65171
|
-
reason: result.reason ?? "message_ineligible",
|
|
65172
|
-
stage: "inbound/eligibility_check",
|
|
65173
|
-
logTag: `[okx-agent-task:${myXmtpAddress}]`
|
|
65174
|
-
});
|
|
65175
|
-
return false;
|
|
65176
|
-
}
|
|
65177
|
-
} catch (err) {
|
|
65178
|
-
const failureMessage = err instanceof Error ? err.message : String(err);
|
|
65124
|
+
if (!senderAgentId || !myAgent) {
|
|
65125
|
+
const reason = !senderAgentId ? "missing_sender_agent_id" : "local_agent_not_found";
|
|
65126
|
+
logWithTimestamp(
|
|
65127
|
+
`[okx-agent-task:${myXmtpAddress}] inbound agent identity missing, dropping: sender=${senderAddress} job=${jobId} group=${groupId} reason=${reason}`
|
|
65128
|
+
);
|
|
65129
|
+
recordInvalidXmtpMessageBestEffort({
|
|
65130
|
+
messageId,
|
|
65131
|
+
groupId,
|
|
65132
|
+
jobId,
|
|
65133
|
+
agentId: senderAgentId,
|
|
65134
|
+
localAgentId: myAgent?.agentId ?? null,
|
|
65135
|
+
senderAddress,
|
|
65136
|
+
senderInboxId,
|
|
65137
|
+
reason,
|
|
65138
|
+
stage: "inbound/identity_check",
|
|
65139
|
+
logTag: `[okx-agent-task:${myXmtpAddress}]`
|
|
65140
|
+
});
|
|
65141
|
+
return false;
|
|
65142
|
+
}
|
|
65143
|
+
const isSenderClient = senderRole === 1 /* CLIENT */;
|
|
65144
|
+
const providerSecurityRate = (isSenderClient ? myAgent.securityRate : XmtpService.getInstance().getAgentByAgentId(senderAgentId)?.securityRate) ?? 0;
|
|
65145
|
+
try {
|
|
65146
|
+
const eligibilityStartedAt = Date.now();
|
|
65147
|
+
const result = await checkMessageEligible({
|
|
65148
|
+
agentId: myAgent.agentId,
|
|
65149
|
+
clientAgentId: isSenderClient ? senderAgentId : myAgent.agentId,
|
|
65150
|
+
providerAgentId: isSenderClient ? myAgent.agentId : senderAgentId,
|
|
65151
|
+
clientCommunicationAddress: isSenderClient ? senderAddress : myXmtpAddress,
|
|
65152
|
+
providerCommunicationAddress: isSenderClient ? myXmtpAddress : senderAddress,
|
|
65153
|
+
jobId,
|
|
65154
|
+
groupId,
|
|
65155
|
+
direction: isSenderClient ? "client_to_provider" : "provider_to_client",
|
|
65156
|
+
providerSecurityRate,
|
|
65157
|
+
isOfflineReplay
|
|
65158
|
+
});
|
|
65159
|
+
timing?.mark("eligibilityCheck", eligibilityStartedAt);
|
|
65160
|
+
logWithTimestamp(
|
|
65161
|
+
`[okx-agent-task:${myXmtpAddress}] inbound message-eligible: senderAgentId=${senderAgentId} job=${jobId} group=${groupId} result=${JSON.stringify(result)}`
|
|
65162
|
+
);
|
|
65163
|
+
if (!result.eligible) {
|
|
65179
65164
|
logWithTimestamp(
|
|
65180
|
-
`[okx-agent-task:${myXmtpAddress}] message-eligible
|
|
65181
|
-
${failureMessage}`,
|
|
65182
|
-
err
|
|
65165
|
+
`[okx-agent-task:${myXmtpAddress}] message-eligible check failed, dropping: sender=${senderAddress} job=${jobId} reason=${result.reason ?? ""}`
|
|
65183
65166
|
);
|
|
65184
|
-
logger.
|
|
65167
|
+
logger.info(LogEvent.INBOUND_BLOCKED_INELIGIBLE, {
|
|
65185
65168
|
...agentExtras({ walletAddress: myXmtpAddress, onchainosAgentId: myAgent.agentId }),
|
|
65186
65169
|
peerWalletAddress: senderAddress,
|
|
65187
65170
|
peerInboxId: senderInboxId,
|
|
@@ -65192,7 +65175,7 @@ ${failureMessage}`,
|
|
|
65192
65175
|
direction: isSenderClient ? "client_to_provider" : "provider_to_client",
|
|
65193
65176
|
providerSecurityRate: String(providerSecurityRate),
|
|
65194
65177
|
...inboundStageExtras("inbound/eligibility_check", "blocked"),
|
|
65195
|
-
reason: "
|
|
65178
|
+
reason: result.reason ?? "",
|
|
65196
65179
|
...timing?.extras()
|
|
65197
65180
|
});
|
|
65198
65181
|
recordInvalidXmtpMessageBestEffort({
|
|
@@ -65203,12 +65186,46 @@ ${failureMessage}`,
|
|
|
65203
65186
|
localAgentId: myAgent.agentId,
|
|
65204
65187
|
senderAddress,
|
|
65205
65188
|
senderInboxId,
|
|
65206
|
-
reason:
|
|
65189
|
+
reason: result.reason ?? "message_ineligible",
|
|
65207
65190
|
stage: "inbound/eligibility_check",
|
|
65208
65191
|
logTag: `[okx-agent-task:${myXmtpAddress}]`
|
|
65209
65192
|
});
|
|
65210
65193
|
return false;
|
|
65211
65194
|
}
|
|
65195
|
+
} catch (err) {
|
|
65196
|
+
const failureMessage = err instanceof Error ? err.message : String(err);
|
|
65197
|
+
logWithTimestamp(
|
|
65198
|
+
`[okx-agent-task:${myXmtpAddress}] message-eligible call failed, dropping message:
|
|
65199
|
+
${failureMessage}`,
|
|
65200
|
+
err
|
|
65201
|
+
);
|
|
65202
|
+
logger.error(LogEvent.INBOUND_BLOCKED_INELIGIBLE, err instanceof Error ? err : new Error(String(err)), {
|
|
65203
|
+
...agentExtras({ walletAddress: myXmtpAddress, onchainosAgentId: myAgent.agentId }),
|
|
65204
|
+
peerWalletAddress: senderAddress,
|
|
65205
|
+
peerInboxId: senderInboxId,
|
|
65206
|
+
peerAgentId: senderAgentId,
|
|
65207
|
+
taskId: jobId,
|
|
65208
|
+
conversationId: groupId,
|
|
65209
|
+
messageId,
|
|
65210
|
+
direction: isSenderClient ? "client_to_provider" : "provider_to_client",
|
|
65211
|
+
providerSecurityRate: String(providerSecurityRate),
|
|
65212
|
+
...inboundStageExtras("inbound/eligibility_check", "blocked"),
|
|
65213
|
+
reason: "eligibility_service_error",
|
|
65214
|
+
...timing?.extras()
|
|
65215
|
+
});
|
|
65216
|
+
recordInvalidXmtpMessageBestEffort({
|
|
65217
|
+
messageId,
|
|
65218
|
+
groupId,
|
|
65219
|
+
jobId,
|
|
65220
|
+
agentId: senderAgentId,
|
|
65221
|
+
localAgentId: myAgent.agentId,
|
|
65222
|
+
senderAddress,
|
|
65223
|
+
senderInboxId,
|
|
65224
|
+
reason: failureMessage,
|
|
65225
|
+
stage: "inbound/eligibility_check",
|
|
65226
|
+
logTag: `[okx-agent-task:${myXmtpAddress}]`
|
|
65227
|
+
});
|
|
65228
|
+
return false;
|
|
65212
65229
|
}
|
|
65213
65230
|
const content = readString3(payload.content);
|
|
65214
65231
|
if (!content) {
|
|
@@ -66565,12 +66582,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
66565
66582
|
});
|
|
66566
66583
|
}
|
|
66567
66584
|
});
|
|
66568
|
-
service.setPluginVersion("0.2.
|
|
66585
|
+
service.setPluginVersion("0.2.5");
|
|
66569
66586
|
await service.init();
|
|
66570
66587
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
66571
66588
|
if (pluginVersionStatus.unavailable) {
|
|
66572
66589
|
throw new Error(
|
|
66573
|
-
`@okxweb3/a2a-node v${"0.2.
|
|
66590
|
+
`@okxweb3/a2a-node v${"0.2.5"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
66574
66591
|
);
|
|
66575
66592
|
}
|
|
66576
66593
|
const systemConfig = service.getSystemConfig();
|
|
@@ -66588,7 +66605,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
66588
66605
|
onchainosAgentId: "*",
|
|
66589
66606
|
reason: "system-config missing sentryDsn",
|
|
66590
66607
|
pluginId: "@okxweb3/a2a-node",
|
|
66591
|
-
pluginVersion: "0.2.
|
|
66608
|
+
pluginVersion: "0.2.5"
|
|
66592
66609
|
});
|
|
66593
66610
|
}
|
|
66594
66611
|
logWithTimestamp(
|
|
@@ -69286,7 +69303,7 @@ async function exportDiagnosticLogs(options) {
|
|
|
69286
69303
|
node: process.version,
|
|
69287
69304
|
platform: process.platform,
|
|
69288
69305
|
arch: process.arch,
|
|
69289
|
-
packageVersion: true ? "0.2.
|
|
69306
|
+
packageVersion: true ? "0.2.5" : "unknown",
|
|
69290
69307
|
sensitiveContentIncluded: options.includeSensitiveContent,
|
|
69291
69308
|
listenerAndLlmContentIncluded: true,
|
|
69292
69309
|
credentialsAlwaysRedacted: true,
|
|
@@ -71122,7 +71139,7 @@ async function runDoctor(options = {}) {
|
|
|
71122
71139
|
platform: options.platform ?? process.platform,
|
|
71123
71140
|
env: options.env ?? process.env,
|
|
71124
71141
|
target: options.target ?? resolveDoctorTarget(options.env ?? process.env),
|
|
71125
|
-
cliVersion: options.cliVersion ?? (true ? "0.2.
|
|
71142
|
+
cliVersion: options.cliVersion ?? (true ? "0.2.5" : "0.0.0"),
|
|
71126
71143
|
fixMode: options.fix === true,
|
|
71127
71144
|
nonInteractive: options.nonInteractive === true,
|
|
71128
71145
|
packageChanged: false,
|