@okxweb3/a2a-node 0.0.21 → 0.0.22-beta-e1f6d0f26b-260629152447
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 +157 -33
- package/dist/index.js +15 -8
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7819,7 +7819,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
7819
7819
|
client: {
|
|
7820
7820
|
id: "gateway-client",
|
|
7821
7821
|
displayName: "okx-a2a-node",
|
|
7822
|
-
version: "0.0.
|
|
7822
|
+
version: "0.0.22-beta-e1f6d0f26b-260629152447",
|
|
7823
7823
|
platform: "node",
|
|
7824
7824
|
mode: "backend",
|
|
7825
7825
|
instanceId
|
|
@@ -7830,7 +7830,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
7830
7830
|
commands: [],
|
|
7831
7831
|
permissions: {},
|
|
7832
7832
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
7833
|
-
userAgent: `okx-a2a-node/${"0.0.
|
|
7833
|
+
userAgent: `okx-a2a-node/${"0.0.22-beta-e1f6d0f26b-260629152447"}`,
|
|
7834
7834
|
auth: {
|
|
7835
7835
|
...config.token ? { token: config.token } : {},
|
|
7836
7836
|
...config.password ? { password: config.password } : {}
|
|
@@ -25049,7 +25049,7 @@ var init_sentry_config = __esm({
|
|
|
25049
25049
|
environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
25050
25050
|
SENTRY_CONFIG = {
|
|
25051
25051
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
25052
|
-
release: "0.0.
|
|
25052
|
+
release: "0.0.22-beta-e1f6d0f26b-260629152447",
|
|
25053
25053
|
environment
|
|
25054
25054
|
};
|
|
25055
25055
|
}
|
|
@@ -92875,12 +92875,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
92875
92875
|
}));
|
|
92876
92876
|
}
|
|
92877
92877
|
});
|
|
92878
|
-
service.setPluginVersion("0.0.
|
|
92878
|
+
service.setPluginVersion("0.0.22-beta-e1f6d0f26b-260629152447");
|
|
92879
92879
|
await service.init();
|
|
92880
92880
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
92881
92881
|
if (pluginVersionStatus.unavailable) {
|
|
92882
92882
|
throw new Error(
|
|
92883
|
-
`@okxweb3/a2a-node v${"0.0.
|
|
92883
|
+
`@okxweb3/a2a-node v${"0.0.22-beta-e1f6d0f26b-260629152447"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
92884
92884
|
);
|
|
92885
92885
|
}
|
|
92886
92886
|
const systemConfig = service.getSystemConfig();
|
|
@@ -92898,7 +92898,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
92898
92898
|
onchainosAgentId: "*",
|
|
92899
92899
|
reason: "system-config missing sentryDsn",
|
|
92900
92900
|
pluginId: "@okxweb3/a2a-node",
|
|
92901
|
-
pluginVersion: "0.0.
|
|
92901
|
+
pluginVersion: "0.0.22-beta-e1f6d0f26b-260629152447"
|
|
92902
92902
|
});
|
|
92903
92903
|
}
|
|
92904
92904
|
logWithTimestamp(
|
|
@@ -94331,7 +94331,7 @@ function resolveUserAttentionProvider(store, jobId) {
|
|
|
94331
94331
|
return "codex";
|
|
94332
94332
|
}
|
|
94333
94333
|
function bindHermesAttentionRouteIfAvailable(store, input) {
|
|
94334
|
-
const
|
|
94334
|
+
const envRoutes = currentHermesRoutesFromEnv();
|
|
94335
94335
|
logHermesRouteBinding("hermes_route_bind_attempt", {
|
|
94336
94336
|
provider: input.provider,
|
|
94337
94337
|
jobId: normalizeOptionalText3(input.jobId),
|
|
@@ -94339,7 +94339,8 @@ function bindHermesAttentionRouteIfAvailable(store, input) {
|
|
|
94339
94339
|
envPlatform: normalizeOptionalText3(process.env.OKX_A2A_CURRENT_GATEWAY_PLATFORM),
|
|
94340
94340
|
envChatId: normalizeOptionalText3(process.env.OKX_A2A_CURRENT_GATEWAY_CHAT_ID),
|
|
94341
94341
|
envThreadId: normalizeOptionalText3(process.env.OKX_A2A_CURRENT_GATEWAY_THREAD_ID),
|
|
94342
|
-
envGatewaySessionKey: normalizeOptionalText3(process.env.OKX_A2A_CURRENT_GATEWAY_SESSION_KEY)
|
|
94342
|
+
envGatewaySessionKey: normalizeOptionalText3(process.env.OKX_A2A_CURRENT_GATEWAY_SESSION_KEY),
|
|
94343
|
+
envGatewaySessionKeys: readGatewaySessionKeysFromEnv(process.env)
|
|
94343
94344
|
});
|
|
94344
94345
|
if (input.provider !== "hermes") {
|
|
94345
94346
|
logHermesRouteBinding("hermes_route_bind_skip", {
|
|
@@ -94356,8 +94357,7 @@ function bindHermesAttentionRouteIfAvailable(store, input) {
|
|
|
94356
94357
|
});
|
|
94357
94358
|
return;
|
|
94358
94359
|
}
|
|
94359
|
-
|
|
94360
|
-
if (!route) {
|
|
94360
|
+
if (envRoutes.length === 0) {
|
|
94361
94361
|
logHermesRouteBinding("hermes_route_bind_skip", {
|
|
94362
94362
|
reason: "missing_gateway_env",
|
|
94363
94363
|
jobId,
|
|
@@ -94373,26 +94373,53 @@ function bindHermesAttentionRouteIfAvailable(store, input) {
|
|
|
94373
94373
|
sessionKeys.add(sessionKey);
|
|
94374
94374
|
}
|
|
94375
94375
|
sessionKeys.add(`backup:${encodeURIComponent(jobId)}`);
|
|
94376
|
-
|
|
94376
|
+
for (const route of envRoutes) {
|
|
94377
|
+
persistHermesRouteBinding(store, { jobId, route });
|
|
94378
|
+
}
|
|
94377
94379
|
logHermesRouteBinding("hermes_route_bind_success", {
|
|
94378
94380
|
jobId,
|
|
94379
94381
|
sessionKeys: [...sessionKeys],
|
|
94380
|
-
|
|
94381
|
-
|
|
94382
|
-
|
|
94382
|
+
gatewaySessionKeys: envRoutes.map((route) => route.gateway_session_key ?? route.session_key),
|
|
94383
|
+
routes: envRoutes.map((route) => ({
|
|
94384
|
+
platform: route.platform,
|
|
94385
|
+
chatId: route.chat_id,
|
|
94386
|
+
threadId: route.thread_id
|
|
94387
|
+
}))
|
|
94383
94388
|
});
|
|
94384
94389
|
}
|
|
94385
|
-
function
|
|
94386
|
-
const
|
|
94387
|
-
const
|
|
94390
|
+
function currentHermesRoutesFromEnv(env = process.env) {
|
|
94391
|
+
const routes = [];
|
|
94392
|
+
const append = (route) => {
|
|
94393
|
+
if (!route) {
|
|
94394
|
+
return;
|
|
94395
|
+
}
|
|
94396
|
+
const key = `${route.platform}
|
|
94397
|
+
${route.chat_id}
|
|
94398
|
+
${route.thread_id}`;
|
|
94399
|
+
if (routes.some((existing) => `${existing.platform}
|
|
94400
|
+
${existing.chat_id}
|
|
94401
|
+
${existing.thread_id}` === key)) {
|
|
94402
|
+
return;
|
|
94403
|
+
}
|
|
94404
|
+
routes.push(route);
|
|
94405
|
+
};
|
|
94406
|
+
for (const sessionKey of readGatewaySessionKeysFromEnv(env)) {
|
|
94407
|
+
append(hermesRouteFromSessionKey(sessionKey));
|
|
94408
|
+
}
|
|
94409
|
+
append(currentHermesRouteFromEnv(env));
|
|
94410
|
+
return routes;
|
|
94411
|
+
}
|
|
94412
|
+
function currentHermesRouteFromEnv(env = process.env) {
|
|
94413
|
+
const platform = normalizeOptionalText3(env.OKX_A2A_CURRENT_GATEWAY_PLATFORM);
|
|
94414
|
+
const chatId = normalizeOptionalText3(env.OKX_A2A_CURRENT_GATEWAY_CHAT_ID);
|
|
94388
94415
|
if (!platform || !chatId) {
|
|
94389
94416
|
return null;
|
|
94390
94417
|
}
|
|
94391
|
-
const envGatewaySessionKey = normalizeOptionalText3(
|
|
94418
|
+
const envGatewaySessionKey = normalizeOptionalText3(env.OKX_A2A_CURRENT_GATEWAY_SESSION_KEY);
|
|
94392
94419
|
const parsedGatewaySession = parseHermesGatewaySessionKey2(envGatewaySessionKey);
|
|
94393
|
-
const threadId = normalizeOptionalText3(
|
|
94420
|
+
const threadId = normalizeOptionalText3(env.OKX_A2A_CURRENT_GATEWAY_THREAD_ID) ?? matchingParsedThreadId2(parsedGatewaySession, { platform, chatId });
|
|
94394
94421
|
const chatType = threadId ? "thread" : "dm";
|
|
94395
|
-
const gatewaySessionKey = envGatewaySessionKey ?? (
|
|
94422
|
+
const gatewaySessionKey = envGatewaySessionKey ?? hermesGatewaySessionKey({ platform, chatId, threadId });
|
|
94396
94423
|
return {
|
|
94397
94424
|
platform,
|
|
94398
94425
|
chat_id: chatId,
|
|
@@ -94405,24 +94432,89 @@ function currentHermesRouteFromEnv() {
|
|
|
94405
94432
|
gateway_session_key: gatewaySessionKey
|
|
94406
94433
|
};
|
|
94407
94434
|
}
|
|
94435
|
+
function hermesGatewaySessionKey(input) {
|
|
94436
|
+
const chatId = encodeURIComponent(input.chatId);
|
|
94437
|
+
const threadId = input.threadId ? encodeURIComponent(input.threadId) : "";
|
|
94438
|
+
if (input.platform === "telegram") {
|
|
94439
|
+
return threadId ? `agent:main:telegram:dm:${chatId}:${threadId}` : `agent:main:telegram:dm:${chatId}`;
|
|
94440
|
+
}
|
|
94441
|
+
return threadId ? `agent:main:${input.platform}:thread:${chatId}:${threadId}` : `agent:main:${input.platform}:dm:${chatId}`;
|
|
94442
|
+
}
|
|
94443
|
+
function hermesRouteFromSessionKey(sessionKey) {
|
|
94444
|
+
const parsed = parseHermesGatewaySessionKey2(sessionKey);
|
|
94445
|
+
if (!parsed) {
|
|
94446
|
+
return null;
|
|
94447
|
+
}
|
|
94448
|
+
const threadId = parsed.threadId ?? "";
|
|
94449
|
+
const canonicalSessionKey = hermesGatewaySessionKey({
|
|
94450
|
+
platform: parsed.platform,
|
|
94451
|
+
chatId: parsed.chatId,
|
|
94452
|
+
threadId
|
|
94453
|
+
});
|
|
94454
|
+
return {
|
|
94455
|
+
platform: parsed.platform,
|
|
94456
|
+
chat_id: parsed.chatId,
|
|
94457
|
+
chat_name: "",
|
|
94458
|
+
chat_type: threadId ? "thread" : "dm",
|
|
94459
|
+
thread_id: threadId,
|
|
94460
|
+
user_id: "",
|
|
94461
|
+
user_name: "",
|
|
94462
|
+
session_key: canonicalSessionKey,
|
|
94463
|
+
gateway_session_key: canonicalSessionKey
|
|
94464
|
+
};
|
|
94465
|
+
}
|
|
94466
|
+
function readGatewaySessionKeysFromEnv(env) {
|
|
94467
|
+
const keys = /* @__PURE__ */ new Set();
|
|
94468
|
+
const list = normalizeOptionalText3(env[CURRENT_GATEWAY_SESSION_KEYS_ENV2]);
|
|
94469
|
+
if (list) {
|
|
94470
|
+
try {
|
|
94471
|
+
const parsed = JSON.parse(list);
|
|
94472
|
+
if (Array.isArray(parsed)) {
|
|
94473
|
+
for (const item of parsed) {
|
|
94474
|
+
if (typeof item === "string" && item.trim()) {
|
|
94475
|
+
keys.add(item.trim());
|
|
94476
|
+
}
|
|
94477
|
+
}
|
|
94478
|
+
}
|
|
94479
|
+
} catch {
|
|
94480
|
+
for (const item of list.split(",")) {
|
|
94481
|
+
if (item.trim()) {
|
|
94482
|
+
keys.add(item.trim());
|
|
94483
|
+
}
|
|
94484
|
+
}
|
|
94485
|
+
}
|
|
94486
|
+
}
|
|
94487
|
+
const single = normalizeOptionalText3(env.OKX_A2A_CURRENT_GATEWAY_SESSION_KEY);
|
|
94488
|
+
if (single) {
|
|
94489
|
+
keys.add(single);
|
|
94490
|
+
}
|
|
94491
|
+
return [...keys];
|
|
94492
|
+
}
|
|
94408
94493
|
function parseHermesGatewaySessionKey2(sessionKey) {
|
|
94409
94494
|
const normalized = normalizeOptionalText3(sessionKey);
|
|
94410
94495
|
if (!normalized) {
|
|
94411
94496
|
return null;
|
|
94412
94497
|
}
|
|
94413
94498
|
const parts = normalized.startsWith("agent:") ? normalized.split(":").slice(2) : normalized.split(":");
|
|
94414
|
-
if (parts.length <
|
|
94499
|
+
if (parts.length < 2) {
|
|
94415
94500
|
return null;
|
|
94416
94501
|
}
|
|
94417
94502
|
const [platform, scope, ...rest] = parts;
|
|
94418
94503
|
if (!platform || platform === "okx-a2a" || platform === "backup" || platform === "job") {
|
|
94419
94504
|
return null;
|
|
94420
94505
|
}
|
|
94421
|
-
if (scope
|
|
94506
|
+
if (!isHermesGatewayScope(scope)) {
|
|
94507
|
+
return {
|
|
94508
|
+
platform,
|
|
94509
|
+
chatId: safeDecodeURIComponent4(scope),
|
|
94510
|
+
...rest.length > 0 ? { threadId: safeDecodeURIComponent4(rest.join(":")) } : {}
|
|
94511
|
+
};
|
|
94512
|
+
}
|
|
94513
|
+
if ((scope === "dm" || scope === "direct" || scope === "channel") && rest[0]) {
|
|
94422
94514
|
return {
|
|
94423
94515
|
platform,
|
|
94424
94516
|
chatId: safeDecodeURIComponent4(rest[0]),
|
|
94425
|
-
...platform === "telegram" && rest[1] ? { threadId: safeDecodeURIComponent4(rest.slice(1)
|
|
94517
|
+
...platform === "telegram" && rest[1] ? { threadId: safeDecodeURIComponent4(parseTelegramTopicSuffix3(rest.slice(1))) } : {}
|
|
94426
94518
|
};
|
|
94427
94519
|
}
|
|
94428
94520
|
if (scope === "thread" && rest[0] && rest[1]) {
|
|
@@ -94432,8 +94524,31 @@ function parseHermesGatewaySessionKey2(sessionKey) {
|
|
|
94432
94524
|
threadId: safeDecodeURIComponent4(rest.slice(1).join(":"))
|
|
94433
94525
|
};
|
|
94434
94526
|
}
|
|
94527
|
+
if (platform === "telegram" && scope === "group" && rest[0]) {
|
|
94528
|
+
const threadId = parseTelegramTopicSuffix3(rest.slice(1));
|
|
94529
|
+
return {
|
|
94530
|
+
platform,
|
|
94531
|
+
chatId: safeDecodeURIComponent4(rest[0]),
|
|
94532
|
+
...threadId ? { threadId: safeDecodeURIComponent4(threadId) } : {}
|
|
94533
|
+
};
|
|
94534
|
+
}
|
|
94435
94535
|
return null;
|
|
94436
94536
|
}
|
|
94537
|
+
function isHermesGatewayScope(value) {
|
|
94538
|
+
return value === "dm" || value === "direct" || value === "channel" || value === "thread" || value === "group";
|
|
94539
|
+
}
|
|
94540
|
+
function parseTelegramTopicSuffix3(parts) {
|
|
94541
|
+
if (parts.length === 0) {
|
|
94542
|
+
return "";
|
|
94543
|
+
}
|
|
94544
|
+
if (parts[0] === "topic") {
|
|
94545
|
+
return parts[1] ?? "";
|
|
94546
|
+
}
|
|
94547
|
+
if (parts[0] === "thread") {
|
|
94548
|
+
return parts.length >= 3 ? parts.slice(2).join(":") : parts[1] ?? "";
|
|
94549
|
+
}
|
|
94550
|
+
return parts.join(":");
|
|
94551
|
+
}
|
|
94437
94552
|
function matchingParsedThreadId2(parsed, expected) {
|
|
94438
94553
|
if (!parsed || parsed.platform !== expected.platform || parsed.chatId !== expected.chatId) {
|
|
94439
94554
|
return null;
|
|
@@ -94530,6 +94645,7 @@ function readExpireTime(parsed) {
|
|
|
94530
94645
|
}
|
|
94531
94646
|
return value;
|
|
94532
94647
|
}
|
|
94648
|
+
var CURRENT_GATEWAY_SESSION_KEYS_ENV2;
|
|
94533
94649
|
var init_user_attention_cli = __esm({
|
|
94534
94650
|
"src/user-attention-cli.ts"() {
|
|
94535
94651
|
"use strict";
|
|
@@ -94542,6 +94658,7 @@ var init_user_attention_cli = __esm({
|
|
|
94542
94658
|
init_openclaw_gateway_config();
|
|
94543
94659
|
init_sentry_logger();
|
|
94544
94660
|
init_user_attention_watchers();
|
|
94661
|
+
CURRENT_GATEWAY_SESSION_KEYS_ENV2 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
|
|
94545
94662
|
}
|
|
94546
94663
|
});
|
|
94547
94664
|
|
|
@@ -96063,7 +96180,7 @@ async function getCurrentNodeCliVersion() {
|
|
|
96063
96180
|
return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
|
|
96064
96181
|
}
|
|
96065
96182
|
function getBundledNodeCliVersion() {
|
|
96066
|
-
return true ? "0.0.
|
|
96183
|
+
return true ? "0.0.22-beta-e1f6d0f26b-260629152447" : null;
|
|
96067
96184
|
}
|
|
96068
96185
|
function readConfiguredAiProvider() {
|
|
96069
96186
|
const explicit = process.env.OKX_AGENT_TASK_AI_CLI ?? process.env.OKX_A2A_AI_PROVIDER;
|
|
@@ -96149,6 +96266,9 @@ async function ensureOpenClawOkxA2aPluginConfig() {
|
|
|
96149
96266
|
try {
|
|
96150
96267
|
const dmScope = await getOpenClawConfigValue(OPENCLAW_SESSION_DM_SCOPE_CONFIG_PATH);
|
|
96151
96268
|
const allow = await getOpenClawConfigValue(OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH);
|
|
96269
|
+
const conversationHookAccess = await getOpenClawConfigValue(
|
|
96270
|
+
OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH
|
|
96271
|
+
);
|
|
96152
96272
|
const normalizedAllow = normalizeOpenClawPluginAllowValue(allow.found ? allow.value : void 0);
|
|
96153
96273
|
const operations = [];
|
|
96154
96274
|
if (dmScope.value !== OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE) {
|
|
@@ -96157,15 +96277,18 @@ async function ensureOpenClawOkxA2aPluginConfig() {
|
|
|
96157
96277
|
if (!allow.found || normalizedAllow.changed) {
|
|
96158
96278
|
operations.push({ path: OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH, value: normalizedAllow.value });
|
|
96159
96279
|
}
|
|
96280
|
+
if (conversationHookAccess.value !== true) {
|
|
96281
|
+
operations.push({ path: OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH, value: true });
|
|
96282
|
+
}
|
|
96160
96283
|
if (operations.length === 0) {
|
|
96161
96284
|
return false;
|
|
96162
96285
|
}
|
|
96163
96286
|
await runCommand("openclaw", ["config", "set", "--batch-json", JSON.stringify(operations)]);
|
|
96164
|
-
console.log("[update] normalized OpenClaw session.dmScope/plugins.allow okx-a2a config through openclaw config set");
|
|
96287
|
+
console.log("[update] normalized OpenClaw session.dmScope/plugins.allow/hooks okx-a2a config through openclaw config set");
|
|
96165
96288
|
return true;
|
|
96166
96289
|
} catch (error) {
|
|
96167
96290
|
const detail = error instanceof Error ? error.message : String(error);
|
|
96168
|
-
console.warn(`[update] skipped OpenClaw session.dmScope/plugins.allow okx-a2a config normalization through openclaw CLI: ${detail}`);
|
|
96291
|
+
console.warn(`[update] skipped OpenClaw session.dmScope/plugins.allow/hooks okx-a2a config normalization through openclaw CLI: ${detail}`);
|
|
96169
96292
|
return false;
|
|
96170
96293
|
}
|
|
96171
96294
|
}
|
|
@@ -96854,7 +96977,7 @@ async function runCommandCaptureOptional(command, args) {
|
|
|
96854
96977
|
});
|
|
96855
96978
|
});
|
|
96856
96979
|
}
|
|
96857
|
-
var import_node_child_process8, import_node_fs18, import_promises8, import_node_os9, import_node_path22, UPDATE_PACKAGES, OPENCLAW_FORCE_INSTALL_FLAG, OPENCLAW_UNSAFE_INSTALL_FLAG, OKX_A2A_PLUGIN_ID, OPENCLAW_SESSION_DM_SCOPE_CONFIG_PATH, OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE, OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH, redirectCommandStdoutToStderr;
|
|
96980
|
+
var import_node_child_process8, import_node_fs18, import_promises8, import_node_os9, import_node_path22, UPDATE_PACKAGES, OPENCLAW_FORCE_INSTALL_FLAG, OPENCLAW_UNSAFE_INSTALL_FLAG, OKX_A2A_PLUGIN_ID, OPENCLAW_SESSION_DM_SCOPE_CONFIG_PATH, OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE, OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH, OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH, redirectCommandStdoutToStderr;
|
|
96858
96981
|
var init_update_cli = __esm({
|
|
96859
96982
|
"src/update-cli.ts"() {
|
|
96860
96983
|
"use strict";
|
|
@@ -96877,6 +97000,7 @@ var init_update_cli = __esm({
|
|
|
96877
97000
|
OPENCLAW_SESSION_DM_SCOPE_CONFIG_PATH = "session.dmScope";
|
|
96878
97001
|
OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE = "per-channel-peer";
|
|
96879
97002
|
OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH = "plugins.allow";
|
|
97003
|
+
OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH = "plugins.entries.okx-a2a.hooks.allowConversationAccess";
|
|
96880
97004
|
redirectCommandStdoutToStderr = false;
|
|
96881
97005
|
}
|
|
96882
97006
|
});
|
|
@@ -96897,9 +97021,9 @@ init_paths();
|
|
|
96897
97021
|
init_task_config();
|
|
96898
97022
|
init_sentry_logger();
|
|
96899
97023
|
init_sentry_config();
|
|
96900
|
-
var
|
|
97024
|
+
var CURRENT_GATEWAY_SESSION_KEYS_ENV3 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
|
|
96901
97025
|
function printUsage2() {
|
|
96902
|
-
console.log(`okx-a2a ${"0.0.
|
|
97026
|
+
console.log(`okx-a2a ${"0.0.22-beta-e1f6d0f26b-260629152447"}
|
|
96903
97027
|
|
|
96904
97028
|
Usage:
|
|
96905
97029
|
okx-a2a <command> [options]
|
|
@@ -96936,7 +97060,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
|
|
|
96936
97060
|
`);
|
|
96937
97061
|
}
|
|
96938
97062
|
function printVersion() {
|
|
96939
|
-
console.log("0.0.
|
|
97063
|
+
console.log("0.0.22-beta-e1f6d0f26b-260629152447");
|
|
96940
97064
|
}
|
|
96941
97065
|
function printDaemonUsage() {
|
|
96942
97066
|
console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
|
|
@@ -97297,7 +97421,7 @@ async function queueXmtpSend(args) {
|
|
|
97297
97421
|
myAgentId: target.myAgentId,
|
|
97298
97422
|
toAgentId: target.toAgentId,
|
|
97299
97423
|
toXmtpAddress: toXmtpAddress ?? target.toXmtpAddress,
|
|
97300
|
-
gatewaySessionKeys:
|
|
97424
|
+
gatewaySessionKeys: readGatewaySessionKeysFromEnv2()
|
|
97301
97425
|
});
|
|
97302
97426
|
await commands.submit(command);
|
|
97303
97427
|
const result = await commands.waitForResult(command.id, Number.POSITIVE_INFINITY);
|
|
@@ -97321,9 +97445,9 @@ async function queueXmtpSend(args) {
|
|
|
97321
97445
|
commands.close();
|
|
97322
97446
|
}
|
|
97323
97447
|
}
|
|
97324
|
-
function
|
|
97448
|
+
function readGatewaySessionKeysFromEnv2(env = process.env) {
|
|
97325
97449
|
const keys = /* @__PURE__ */ new Set();
|
|
97326
|
-
const list = env[
|
|
97450
|
+
const list = env[CURRENT_GATEWAY_SESSION_KEYS_ENV3]?.trim();
|
|
97327
97451
|
if (list) {
|
|
97328
97452
|
try {
|
|
97329
97453
|
const parsed = JSON.parse(list);
|
package/dist/index.js
CHANGED
|
@@ -86691,7 +86691,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
86691
86691
|
client: {
|
|
86692
86692
|
id: "gateway-client",
|
|
86693
86693
|
displayName: "okx-a2a-node",
|
|
86694
|
-
version: "0.0.
|
|
86694
|
+
version: "0.0.22-beta-e1f6d0f26b-260629152447",
|
|
86695
86695
|
platform: "node",
|
|
86696
86696
|
mode: "backend",
|
|
86697
86697
|
instanceId
|
|
@@ -86702,7 +86702,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
86702
86702
|
commands: [],
|
|
86703
86703
|
permissions: {},
|
|
86704
86704
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
86705
|
-
userAgent: `okx-a2a-node/${"0.0.
|
|
86705
|
+
userAgent: `okx-a2a-node/${"0.0.22-beta-e1f6d0f26b-260629152447"}`,
|
|
86706
86706
|
auth: {
|
|
86707
86707
|
...config.token ? { token: config.token } : {},
|
|
86708
86708
|
...config.password ? { password: config.password } : {}
|
|
@@ -90975,7 +90975,7 @@ function userWatchEventDeliveredSentryExtra(event) {
|
|
|
90975
90975
|
var environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
90976
90976
|
var SENTRY_CONFIG = {
|
|
90977
90977
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
90978
|
-
release: "0.0.
|
|
90978
|
+
release: "0.0.22-beta-e1f6d0f26b-260629152447",
|
|
90979
90979
|
environment
|
|
90980
90980
|
};
|
|
90981
90981
|
|
|
@@ -91202,12 +91202,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
91202
91202
|
}));
|
|
91203
91203
|
}
|
|
91204
91204
|
});
|
|
91205
|
-
service.setPluginVersion("0.0.
|
|
91205
|
+
service.setPluginVersion("0.0.22-beta-e1f6d0f26b-260629152447");
|
|
91206
91206
|
await service.init();
|
|
91207
91207
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
91208
91208
|
if (pluginVersionStatus.unavailable) {
|
|
91209
91209
|
throw new Error(
|
|
91210
|
-
`@okxweb3/a2a-node v${"0.0.
|
|
91210
|
+
`@okxweb3/a2a-node v${"0.0.22-beta-e1f6d0f26b-260629152447"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
91211
91211
|
);
|
|
91212
91212
|
}
|
|
91213
91213
|
const systemConfig = service.getSystemConfig();
|
|
@@ -91225,7 +91225,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
91225
91225
|
onchainosAgentId: "*",
|
|
91226
91226
|
reason: "system-config missing sentryDsn",
|
|
91227
91227
|
pluginId: "@okxweb3/a2a-node",
|
|
91228
|
-
pluginVersion: "0.0.
|
|
91228
|
+
pluginVersion: "0.0.22-beta-e1f6d0f26b-260629152447"
|
|
91229
91229
|
});
|
|
91230
91230
|
}
|
|
91231
91231
|
logWithTimestamp(
|
|
@@ -91564,6 +91564,7 @@ var OKX_A2A_PLUGIN_ID = "okx-a2a";
|
|
|
91564
91564
|
var OPENCLAW_SESSION_DM_SCOPE_CONFIG_PATH = "session.dmScope";
|
|
91565
91565
|
var OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE = "per-channel-peer";
|
|
91566
91566
|
var OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH = "plugins.allow";
|
|
91567
|
+
var OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH = "plugins.entries.okx-a2a.hooks.allowConversationAccess";
|
|
91567
91568
|
var redirectCommandStdoutToStderr = false;
|
|
91568
91569
|
function isPrereleaseVersion(version2) {
|
|
91569
91570
|
return /\d+\.\d+\.\d+-[0-9A-Za-z.-]+/.test(version2);
|
|
@@ -91572,6 +91573,9 @@ async function ensureOpenClawOkxA2aPluginConfig() {
|
|
|
91572
91573
|
try {
|
|
91573
91574
|
const dmScope = await getOpenClawConfigValue(OPENCLAW_SESSION_DM_SCOPE_CONFIG_PATH);
|
|
91574
91575
|
const allow = await getOpenClawConfigValue(OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH);
|
|
91576
|
+
const conversationHookAccess = await getOpenClawConfigValue(
|
|
91577
|
+
OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH
|
|
91578
|
+
);
|
|
91575
91579
|
const normalizedAllow = normalizeOpenClawPluginAllowValue(allow.found ? allow.value : void 0);
|
|
91576
91580
|
const operations = [];
|
|
91577
91581
|
if (dmScope.value !== OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE) {
|
|
@@ -91580,15 +91584,18 @@ async function ensureOpenClawOkxA2aPluginConfig() {
|
|
|
91580
91584
|
if (!allow.found || normalizedAllow.changed) {
|
|
91581
91585
|
operations.push({ path: OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH, value: normalizedAllow.value });
|
|
91582
91586
|
}
|
|
91587
|
+
if (conversationHookAccess.value !== true) {
|
|
91588
|
+
operations.push({ path: OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH, value: true });
|
|
91589
|
+
}
|
|
91583
91590
|
if (operations.length === 0) {
|
|
91584
91591
|
return false;
|
|
91585
91592
|
}
|
|
91586
91593
|
await runCommand("openclaw", ["config", "set", "--batch-json", JSON.stringify(operations)]);
|
|
91587
|
-
console.log("[update] normalized OpenClaw session.dmScope/plugins.allow okx-a2a config through openclaw config set");
|
|
91594
|
+
console.log("[update] normalized OpenClaw session.dmScope/plugins.allow/hooks okx-a2a config through openclaw config set");
|
|
91588
91595
|
return true;
|
|
91589
91596
|
} catch (error) {
|
|
91590
91597
|
const detail = error instanceof Error ? error.message : String(error);
|
|
91591
|
-
console.warn(`[update] skipped OpenClaw session.dmScope/plugins.allow okx-a2a config normalization through openclaw CLI: ${detail}`);
|
|
91598
|
+
console.warn(`[update] skipped OpenClaw session.dmScope/plugins.allow/hooks okx-a2a config normalization through openclaw CLI: ${detail}`);
|
|
91592
91599
|
return false;
|
|
91593
91600
|
}
|
|
91594
91601
|
}
|
package/package.json
CHANGED