@okxweb3/a2a-node 0.0.22-beta-e1f6d0f26b-260629161834 → 0.1.0
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 +46 -15
- package/dist/index.js +34 -8
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -416,12 +416,17 @@ function normalizeGatewayRouteInput(value, provider) {
|
|
|
416
416
|
platform,
|
|
417
417
|
chatId,
|
|
418
418
|
chatName: readText(item.chatName) ?? readText(item.chat_name) ?? "",
|
|
419
|
-
chatType: normalizeGatewayRouteChatType(
|
|
419
|
+
chatType: normalizeGatewayRouteChatType(
|
|
420
|
+
readText(item.chatType) ?? readText(item.chat_type),
|
|
421
|
+
parsedRoute?.chatType,
|
|
422
|
+
threadId
|
|
423
|
+
),
|
|
420
424
|
threadId,
|
|
421
425
|
userId: readText(item.userId) ?? readText(item.user_id) ?? "",
|
|
422
426
|
userName: readText(item.userName) ?? readText(item.user_name) ?? "",
|
|
423
427
|
sessionKey,
|
|
424
428
|
gatewaySessionKey,
|
|
429
|
+
sessionAliases: readTextArray(item.sessionAliases) ?? readTextArray(item.session_aliases) ?? [],
|
|
425
430
|
updatedAt: readText(item.updatedAt) ?? readText(item.updated_at) ?? ""
|
|
426
431
|
};
|
|
427
432
|
}
|
|
@@ -438,15 +443,26 @@ function normalizeGatewayRoute(route, updatedAt, provider) {
|
|
|
438
443
|
userName: route.userName ?? "",
|
|
439
444
|
sessionKey: route.sessionKey ?? route.gatewaySessionKey ?? "",
|
|
440
445
|
gatewaySessionKey: route.gatewaySessionKey ?? route.sessionKey ?? "",
|
|
446
|
+
sessionAliases: normalizeGatewayRouteAliases(route.sessionAliases),
|
|
441
447
|
updatedAt
|
|
442
448
|
};
|
|
443
449
|
}
|
|
444
450
|
function upsertGatewayRoute(routes, route) {
|
|
445
451
|
const key = gatewayRouteKey(route);
|
|
446
452
|
const next = routes.filter((item) => gatewayRouteKey(item) !== key);
|
|
447
|
-
|
|
453
|
+
const existing = routes.find((item) => gatewayRouteKey(item) === key);
|
|
454
|
+
next.push({
|
|
455
|
+
...route,
|
|
456
|
+
sessionAliases: normalizeGatewayRouteAliases([
|
|
457
|
+
...existing?.sessionAliases ?? [],
|
|
458
|
+
...route.sessionAliases ?? []
|
|
459
|
+
])
|
|
460
|
+
});
|
|
448
461
|
return next;
|
|
449
462
|
}
|
|
463
|
+
function normalizeGatewayRouteAliases(values) {
|
|
464
|
+
return [...new Set((values ?? []).map((value) => value.trim()).filter(Boolean))];
|
|
465
|
+
}
|
|
450
466
|
function gatewayRouteKey(route) {
|
|
451
467
|
return `${route.platform}
|
|
452
468
|
${route.chatId}
|
|
@@ -548,6 +564,16 @@ function readText(value) {
|
|
|
548
564
|
const trimmed = value.trim();
|
|
549
565
|
return trimmed || null;
|
|
550
566
|
}
|
|
567
|
+
function readTextArray(value) {
|
|
568
|
+
if (!Array.isArray(value)) {
|
|
569
|
+
return null;
|
|
570
|
+
}
|
|
571
|
+
const values = value.flatMap((item) => {
|
|
572
|
+
const text = readText(item);
|
|
573
|
+
return text ? [text] : [];
|
|
574
|
+
});
|
|
575
|
+
return normalizeGatewayRouteAliases(values);
|
|
576
|
+
}
|
|
551
577
|
var import_node_crypto, import_node_fs2, import_node_path3, DatabaseSync, SYSTEM_NOTIFICATION_SESSION_KEY, SessionStore;
|
|
552
578
|
var init_session_store = __esm({
|
|
553
579
|
"src/session-store.ts"() {
|
|
@@ -7820,7 +7846,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
7820
7846
|
client: {
|
|
7821
7847
|
id: "gateway-client",
|
|
7822
7848
|
displayName: "okx-a2a-node",
|
|
7823
|
-
version: "0.0
|
|
7849
|
+
version: "0.1.0",
|
|
7824
7850
|
platform: "node",
|
|
7825
7851
|
mode: "backend",
|
|
7826
7852
|
instanceId
|
|
@@ -7831,7 +7857,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
7831
7857
|
commands: [],
|
|
7832
7858
|
permissions: {},
|
|
7833
7859
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
7834
|
-
userAgent: `okx-a2a-node/${"0.0
|
|
7860
|
+
userAgent: `okx-a2a-node/${"0.1.0"}`,
|
|
7835
7861
|
auth: {
|
|
7836
7862
|
...config.token ? { token: config.token } : {},
|
|
7837
7863
|
...config.password ? { password: config.password } : {}
|
|
@@ -25050,7 +25076,7 @@ var init_sentry_config = __esm({
|
|
|
25050
25076
|
environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
25051
25077
|
SENTRY_CONFIG = {
|
|
25052
25078
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
25053
|
-
release: "0.0
|
|
25079
|
+
release: "0.1.0",
|
|
25054
25080
|
environment
|
|
25055
25081
|
};
|
|
25056
25082
|
}
|
|
@@ -93023,12 +93049,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
93023
93049
|
}));
|
|
93024
93050
|
}
|
|
93025
93051
|
});
|
|
93026
|
-
service.setPluginVersion("0.0
|
|
93052
|
+
service.setPluginVersion("0.1.0");
|
|
93027
93053
|
await service.init();
|
|
93028
93054
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
93029
93055
|
if (pluginVersionStatus.unavailable) {
|
|
93030
93056
|
throw new Error(
|
|
93031
|
-
`@okxweb3/a2a-node v${"0.0
|
|
93057
|
+
`@okxweb3/a2a-node v${"0.1.0"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
93032
93058
|
);
|
|
93033
93059
|
}
|
|
93034
93060
|
const systemConfig = service.getSystemConfig();
|
|
@@ -93046,7 +93072,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
93046
93072
|
onchainosAgentId: "*",
|
|
93047
93073
|
reason: "system-config missing sentryDsn",
|
|
93048
93074
|
pluginId: "@okxweb3/a2a-node",
|
|
93049
|
-
pluginVersion: "0.0
|
|
93075
|
+
pluginVersion: "0.1.0"
|
|
93050
93076
|
});
|
|
93051
93077
|
}
|
|
93052
93078
|
logWithTimestamp(
|
|
@@ -94522,7 +94548,7 @@ function bindHermesAttentionRouteIfAvailable(store, input) {
|
|
|
94522
94548
|
}
|
|
94523
94549
|
sessionKeys.add(`backup:${encodeURIComponent(jobId)}`);
|
|
94524
94550
|
for (const route of envRoutes) {
|
|
94525
|
-
persistHermesRouteBinding(store, { jobId, route });
|
|
94551
|
+
persistHermesRouteBinding(store, { jobId, route, sessionAliases: [...sessionKeys] });
|
|
94526
94552
|
}
|
|
94527
94553
|
logHermesRouteBinding("hermes_route_bind_success", {
|
|
94528
94554
|
jobId,
|
|
@@ -94707,10 +94733,10 @@ function persistHermesRouteBinding(store, input) {
|
|
|
94707
94733
|
store.upsertJobGatewayRoute({
|
|
94708
94734
|
jobId: input.jobId,
|
|
94709
94735
|
provider: "hermes",
|
|
94710
|
-
route: hermesRouteEntryToGatewayRoute(input.route)
|
|
94736
|
+
route: hermesRouteEntryToGatewayRoute(input.route, input.sessionAliases)
|
|
94711
94737
|
});
|
|
94712
94738
|
}
|
|
94713
|
-
function hermesRouteEntryToGatewayRoute(route) {
|
|
94739
|
+
function hermesRouteEntryToGatewayRoute(route, sessionAliases = []) {
|
|
94714
94740
|
return {
|
|
94715
94741
|
platform: route.platform,
|
|
94716
94742
|
chatId: route.chat_id,
|
|
@@ -94720,7 +94746,12 @@ function hermesRouteEntryToGatewayRoute(route) {
|
|
|
94720
94746
|
userId: route.user_id,
|
|
94721
94747
|
userName: route.user_name,
|
|
94722
94748
|
sessionKey: route.session_key,
|
|
94723
|
-
gatewaySessionKey: route.gateway_session_key
|
|
94749
|
+
gatewaySessionKey: route.gateway_session_key,
|
|
94750
|
+
sessionAliases: [
|
|
94751
|
+
...new Set(
|
|
94752
|
+
[...route.session_aliases ?? [], ...sessionAliases].map((value) => value.trim()).filter(Boolean)
|
|
94753
|
+
)
|
|
94754
|
+
]
|
|
94724
94755
|
};
|
|
94725
94756
|
}
|
|
94726
94757
|
function logHermesRouteBinding(event, fields) {
|
|
@@ -96328,7 +96359,7 @@ async function getCurrentNodeCliVersion() {
|
|
|
96328
96359
|
return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
|
|
96329
96360
|
}
|
|
96330
96361
|
function getBundledNodeCliVersion() {
|
|
96331
|
-
return true ? "0.0
|
|
96362
|
+
return true ? "0.1.0" : null;
|
|
96332
96363
|
}
|
|
96333
96364
|
function readConfiguredAiProvider() {
|
|
96334
96365
|
const explicit = process.env.OKX_AGENT_TASK_AI_CLI ?? process.env.OKX_A2A_AI_PROVIDER;
|
|
@@ -97171,7 +97202,7 @@ init_sentry_logger();
|
|
|
97171
97202
|
init_sentry_config();
|
|
97172
97203
|
var CURRENT_GATEWAY_SESSION_KEYS_ENV3 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
|
|
97173
97204
|
function printUsage2() {
|
|
97174
|
-
console.log(`okx-a2a ${"0.0
|
|
97205
|
+
console.log(`okx-a2a ${"0.1.0"}
|
|
97175
97206
|
|
|
97176
97207
|
Usage:
|
|
97177
97208
|
okx-a2a <command> [options]
|
|
@@ -97208,7 +97239,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
|
|
|
97208
97239
|
`);
|
|
97209
97240
|
}
|
|
97210
97241
|
function printVersion() {
|
|
97211
|
-
console.log("0.0
|
|
97242
|
+
console.log("0.1.0");
|
|
97212
97243
|
}
|
|
97213
97244
|
function printDaemonUsage() {
|
|
97214
97245
|
console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
|
package/dist/index.js
CHANGED
|
@@ -69474,12 +69474,17 @@ function normalizeGatewayRouteInput(value, provider) {
|
|
|
69474
69474
|
platform,
|
|
69475
69475
|
chatId,
|
|
69476
69476
|
chatName: readText(item.chatName) ?? readText(item.chat_name) ?? "",
|
|
69477
|
-
chatType: normalizeGatewayRouteChatType(
|
|
69477
|
+
chatType: normalizeGatewayRouteChatType(
|
|
69478
|
+
readText(item.chatType) ?? readText(item.chat_type),
|
|
69479
|
+
parsedRoute?.chatType,
|
|
69480
|
+
threadId
|
|
69481
|
+
),
|
|
69478
69482
|
threadId,
|
|
69479
69483
|
userId: readText(item.userId) ?? readText(item.user_id) ?? "",
|
|
69480
69484
|
userName: readText(item.userName) ?? readText(item.user_name) ?? "",
|
|
69481
69485
|
sessionKey,
|
|
69482
69486
|
gatewaySessionKey,
|
|
69487
|
+
sessionAliases: readTextArray(item.sessionAliases) ?? readTextArray(item.session_aliases) ?? [],
|
|
69483
69488
|
updatedAt: readText(item.updatedAt) ?? readText(item.updated_at) ?? ""
|
|
69484
69489
|
};
|
|
69485
69490
|
}
|
|
@@ -69496,15 +69501,26 @@ function normalizeGatewayRoute(route, updatedAt, provider) {
|
|
|
69496
69501
|
userName: route.userName ?? "",
|
|
69497
69502
|
sessionKey: route.sessionKey ?? route.gatewaySessionKey ?? "",
|
|
69498
69503
|
gatewaySessionKey: route.gatewaySessionKey ?? route.sessionKey ?? "",
|
|
69504
|
+
sessionAliases: normalizeGatewayRouteAliases(route.sessionAliases),
|
|
69499
69505
|
updatedAt
|
|
69500
69506
|
};
|
|
69501
69507
|
}
|
|
69502
69508
|
function upsertGatewayRoute(routes, route) {
|
|
69503
69509
|
const key = gatewayRouteKey(route);
|
|
69504
69510
|
const next = routes.filter((item) => gatewayRouteKey(item) !== key);
|
|
69505
|
-
|
|
69511
|
+
const existing = routes.find((item) => gatewayRouteKey(item) === key);
|
|
69512
|
+
next.push({
|
|
69513
|
+
...route,
|
|
69514
|
+
sessionAliases: normalizeGatewayRouteAliases([
|
|
69515
|
+
...existing?.sessionAliases ?? [],
|
|
69516
|
+
...route.sessionAliases ?? []
|
|
69517
|
+
])
|
|
69518
|
+
});
|
|
69506
69519
|
return next;
|
|
69507
69520
|
}
|
|
69521
|
+
function normalizeGatewayRouteAliases(values) {
|
|
69522
|
+
return [...new Set((values ?? []).map((value) => value.trim()).filter(Boolean))];
|
|
69523
|
+
}
|
|
69508
69524
|
function gatewayRouteKey(route) {
|
|
69509
69525
|
return `${route.platform}
|
|
69510
69526
|
${route.chatId}
|
|
@@ -69606,6 +69622,16 @@ function readText(value) {
|
|
|
69606
69622
|
const trimmed = value.trim();
|
|
69607
69623
|
return trimmed || null;
|
|
69608
69624
|
}
|
|
69625
|
+
function readTextArray(value) {
|
|
69626
|
+
if (!Array.isArray(value)) {
|
|
69627
|
+
return null;
|
|
69628
|
+
}
|
|
69629
|
+
const values = value.flatMap((item) => {
|
|
69630
|
+
const text = readText(item);
|
|
69631
|
+
return text ? [text] : [];
|
|
69632
|
+
});
|
|
69633
|
+
return normalizeGatewayRouteAliases(values);
|
|
69634
|
+
}
|
|
69609
69635
|
|
|
69610
69636
|
// src/daemon-lock.ts
|
|
69611
69637
|
var import_promises = require("node:fs/promises");
|
|
@@ -86692,7 +86718,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
86692
86718
|
client: {
|
|
86693
86719
|
id: "gateway-client",
|
|
86694
86720
|
displayName: "okx-a2a-node",
|
|
86695
|
-
version: "0.0
|
|
86721
|
+
version: "0.1.0",
|
|
86696
86722
|
platform: "node",
|
|
86697
86723
|
mode: "backend",
|
|
86698
86724
|
instanceId
|
|
@@ -86703,7 +86729,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
86703
86729
|
commands: [],
|
|
86704
86730
|
permissions: {},
|
|
86705
86731
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
86706
|
-
userAgent: `okx-a2a-node/${"0.0
|
|
86732
|
+
userAgent: `okx-a2a-node/${"0.1.0"}`,
|
|
86707
86733
|
auth: {
|
|
86708
86734
|
...config.token ? { token: config.token } : {},
|
|
86709
86735
|
...config.password ? { password: config.password } : {}
|
|
@@ -91122,7 +91148,7 @@ function userWatchEventDeliveredSentryExtra(event) {
|
|
|
91122
91148
|
var environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
91123
91149
|
var SENTRY_CONFIG = {
|
|
91124
91150
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
91125
|
-
release: "0.0
|
|
91151
|
+
release: "0.1.0",
|
|
91126
91152
|
environment
|
|
91127
91153
|
};
|
|
91128
91154
|
|
|
@@ -91349,12 +91375,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
91349
91375
|
}));
|
|
91350
91376
|
}
|
|
91351
91377
|
});
|
|
91352
|
-
service.setPluginVersion("0.0
|
|
91378
|
+
service.setPluginVersion("0.1.0");
|
|
91353
91379
|
await service.init();
|
|
91354
91380
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
91355
91381
|
if (pluginVersionStatus.unavailable) {
|
|
91356
91382
|
throw new Error(
|
|
91357
|
-
`@okxweb3/a2a-node v${"0.0
|
|
91383
|
+
`@okxweb3/a2a-node v${"0.1.0"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
91358
91384
|
);
|
|
91359
91385
|
}
|
|
91360
91386
|
const systemConfig = service.getSystemConfig();
|
|
@@ -91372,7 +91398,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
91372
91398
|
onchainosAgentId: "*",
|
|
91373
91399
|
reason: "system-config missing sentryDsn",
|
|
91374
91400
|
pluginId: "@okxweb3/a2a-node",
|
|
91375
|
-
pluginVersion: "0.0
|
|
91401
|
+
pluginVersion: "0.1.0"
|
|
91376
91402
|
});
|
|
91377
91403
|
}
|
|
91378
91404
|
logWithTimestamp(
|
package/package.json
CHANGED