@okxweb3/a2a-node 0.1.1 → 0.1.2-beta-3bdae0ceae-260630205417
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 +127 -10
- package/dist/index.js +6 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7852,7 +7852,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
7852
7852
|
client: {
|
|
7853
7853
|
id: "gateway-client",
|
|
7854
7854
|
displayName: "okx-a2a-node",
|
|
7855
|
-
version: "0.1.
|
|
7855
|
+
version: "0.1.2-beta-3bdae0ceae-260630205417",
|
|
7856
7856
|
platform: "node",
|
|
7857
7857
|
mode: "backend",
|
|
7858
7858
|
instanceId
|
|
@@ -7863,7 +7863,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
7863
7863
|
commands: [],
|
|
7864
7864
|
permissions: {},
|
|
7865
7865
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
7866
|
-
userAgent: `okx-a2a-node/${"0.1.
|
|
7866
|
+
userAgent: `okx-a2a-node/${"0.1.2-beta-3bdae0ceae-260630205417"}`,
|
|
7867
7867
|
auth: {
|
|
7868
7868
|
...config.token ? { token: config.token } : {},
|
|
7869
7869
|
...config.password ? { password: config.password } : {}
|
|
@@ -25082,7 +25082,7 @@ var init_sentry_config = __esm({
|
|
|
25082
25082
|
environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
25083
25083
|
SENTRY_CONFIG = {
|
|
25084
25084
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
25085
|
-
release: "0.1.
|
|
25085
|
+
release: "0.1.2-beta-3bdae0ceae-260630205417",
|
|
25086
25086
|
environment
|
|
25087
25087
|
};
|
|
25088
25088
|
}
|
|
@@ -93065,12 +93065,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
93065
93065
|
}));
|
|
93066
93066
|
}
|
|
93067
93067
|
});
|
|
93068
|
-
service.setPluginVersion("0.1.
|
|
93068
|
+
service.setPluginVersion("0.1.2-beta-3bdae0ceae-260630205417");
|
|
93069
93069
|
await service.init();
|
|
93070
93070
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
93071
93071
|
if (pluginVersionStatus.unavailable) {
|
|
93072
93072
|
throw new Error(
|
|
93073
|
-
`@okxweb3/a2a-node v${"0.1.
|
|
93073
|
+
`@okxweb3/a2a-node v${"0.1.2-beta-3bdae0ceae-260630205417"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
93074
93074
|
);
|
|
93075
93075
|
}
|
|
93076
93076
|
const systemConfig = service.getSystemConfig();
|
|
@@ -93088,7 +93088,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
93088
93088
|
onchainosAgentId: "*",
|
|
93089
93089
|
reason: "system-config missing sentryDsn",
|
|
93090
93090
|
pluginId: "@okxweb3/a2a-node",
|
|
93091
|
-
pluginVersion: "0.1.
|
|
93091
|
+
pluginVersion: "0.1.2-beta-3bdae0ceae-260630205417"
|
|
93092
93092
|
});
|
|
93093
93093
|
}
|
|
93094
93094
|
logWithTimestamp(
|
|
@@ -96161,6 +96161,12 @@ async function handleSetupJson(args) {
|
|
|
96161
96161
|
`);
|
|
96162
96162
|
} catch (error) {
|
|
96163
96163
|
console.log = originalLog;
|
|
96164
|
+
if (error instanceof SetupBlockedError) {
|
|
96165
|
+
process.stdout.write(`${JSON.stringify(error.result)}
|
|
96166
|
+
`);
|
|
96167
|
+
process.exitCode = 2;
|
|
96168
|
+
return;
|
|
96169
|
+
}
|
|
96164
96170
|
const message = error instanceof Error ? error.message : String(error);
|
|
96165
96171
|
const state = isSetupNeedsUserActionMessage(message) ? "needs_user_action" : "failed";
|
|
96166
96172
|
const result = {
|
|
@@ -96193,6 +96199,7 @@ async function runSetup(options) {
|
|
|
96193
96199
|
const runtime = detectRuntime();
|
|
96194
96200
|
if (runtime === "codex" || runtime === "claude") {
|
|
96195
96201
|
switchDefaultProviderForSetup(runtime);
|
|
96202
|
+
await ensureAiCliAuthReadyForSetup(runtime, resolvedTarget, releasePlan.resultRelease);
|
|
96196
96203
|
}
|
|
96197
96204
|
if (nodeChange.nodeChanged && (runtime === "codex" || runtime === "claude")) {
|
|
96198
96205
|
await restartNodeDaemonAfterNodeSetup();
|
|
@@ -96310,6 +96317,72 @@ function switchDefaultProviderForSetup(provider) {
|
|
|
96310
96317
|
store.close();
|
|
96311
96318
|
}
|
|
96312
96319
|
}
|
|
96320
|
+
async function ensureAiCliAuthReadyForSetup(provider, target, release) {
|
|
96321
|
+
const command = resolveAiProviderCommand(provider);
|
|
96322
|
+
const status = provider === "claude" ? await checkClaudeCliAuthStatus(command) : await checkCodexCliAuthStatus(command);
|
|
96323
|
+
if (status.ok) {
|
|
96324
|
+
console.log(`[setup] ${provider} CLI auth status is ready`);
|
|
96325
|
+
return;
|
|
96326
|
+
}
|
|
96327
|
+
const reason = status.reason;
|
|
96328
|
+
const installCommand = provider === "claude" ? "npm install -g @anthropic-ai/claude-code" : "npm install -g @openai/codex";
|
|
96329
|
+
const nextCommand = provider === "claude" ? "claude auth login --claudeai" : "codex login --device-auth";
|
|
96330
|
+
const verifyCommand = provider === "claude" ? "claude auth status --json" : "codex login status";
|
|
96331
|
+
const providerLabel = provider === "claude" ? "Claude Code" : "Codex";
|
|
96332
|
+
const missing = reason === "provider_cli_missing";
|
|
96333
|
+
const commandText = missing ? `${installCommand} && ${nextCommand}` : nextCommand;
|
|
96334
|
+
const detail = status.detail ? `
|
|
96335
|
+
|
|
96336
|
+
Detail:
|
|
96337
|
+
${status.detail}` : "";
|
|
96338
|
+
throw new SetupBlockedError({
|
|
96339
|
+
ok: false,
|
|
96340
|
+
state: "blocked",
|
|
96341
|
+
target,
|
|
96342
|
+
release,
|
|
96343
|
+
reason,
|
|
96344
|
+
installCommand: missing ? installCommand : void 0,
|
|
96345
|
+
nextCommand,
|
|
96346
|
+
verifyCommand,
|
|
96347
|
+
userMessage: [
|
|
96348
|
+
`${providerLabel} CLI is ${missing ? "not installed or not on PATH" : "not logged in"}.`,
|
|
96349
|
+
"Your GUI session may be active, but OKX A2A uses the local CLI credential store.",
|
|
96350
|
+
`Run this in your own local terminal: ${commandText}`,
|
|
96351
|
+
`Then rerun: okx-a2a setup --json`
|
|
96352
|
+
].join(" "),
|
|
96353
|
+
detail: detail.trim() || void 0
|
|
96354
|
+
});
|
|
96355
|
+
}
|
|
96356
|
+
async function checkClaudeCliAuthStatus(command) {
|
|
96357
|
+
const result = await runCommandCaptureStatus(command, ["auth", "status", "--json"]);
|
|
96358
|
+
if (result.errorCode === "ENOENT") {
|
|
96359
|
+
return { ok: false, reason: "provider_cli_missing", detail: result.detail };
|
|
96360
|
+
}
|
|
96361
|
+
if (result.code !== 0) {
|
|
96362
|
+
return { ok: false, reason: "provider_cli_not_logged_in", detail: result.detail };
|
|
96363
|
+
}
|
|
96364
|
+
try {
|
|
96365
|
+
const payload = JSON.parse(result.stdout);
|
|
96366
|
+
if (payload.loggedIn === true) {
|
|
96367
|
+
return { ok: true };
|
|
96368
|
+
}
|
|
96369
|
+
return { ok: false, reason: "provider_cli_not_logged_in", detail: result.stdout.trim() || result.detail };
|
|
96370
|
+
} catch (error) {
|
|
96371
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
96372
|
+
return { ok: false, reason: "provider_cli_auth_status_invalid", detail: `${message}
|
|
96373
|
+
${result.stdout}`.trim() };
|
|
96374
|
+
}
|
|
96375
|
+
}
|
|
96376
|
+
async function checkCodexCliAuthStatus(command) {
|
|
96377
|
+
const result = await runCommandCaptureStatus(command, ["login", "status"]);
|
|
96378
|
+
if (result.errorCode === "ENOENT") {
|
|
96379
|
+
return { ok: false, reason: "provider_cli_missing", detail: result.detail };
|
|
96380
|
+
}
|
|
96381
|
+
if (result.code === 0) {
|
|
96382
|
+
return { ok: true };
|
|
96383
|
+
}
|
|
96384
|
+
return { ok: false, reason: "provider_cli_not_logged_in", detail: result.detail };
|
|
96385
|
+
}
|
|
96313
96386
|
function logSetupChangeState(target, changes) {
|
|
96314
96387
|
console.log(
|
|
96315
96388
|
`[setup] ${target} desiredGateway=${changes.desiredGatewayVersion} desiredNode=${changes.desiredNodeVersion ?? "(preserved)"} installedGateway=${changes.gatewayVersion ?? "(not installed)"} installedNode=${changes.nodeVersion ?? "(not installed)"} configChanged=${changes.configChanged ? "yes" : "no"}`
|
|
@@ -96376,7 +96449,7 @@ async function getCurrentNodeCliVersion() {
|
|
|
96376
96449
|
return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
|
|
96377
96450
|
}
|
|
96378
96451
|
function getBundledNodeCliVersion() {
|
|
96379
|
-
return true ? "0.1.
|
|
96452
|
+
return true ? "0.1.2-beta-3bdae0ceae-260630205417" : null;
|
|
96380
96453
|
}
|
|
96381
96454
|
function readConfiguredAiProvider() {
|
|
96382
96455
|
const explicit = process.env.OKX_AGENT_TASK_AI_CLI ?? process.env.OKX_A2A_AI_PROVIDER;
|
|
@@ -97169,7 +97242,42 @@ async function runCommandCaptureOptional(command, args) {
|
|
|
97169
97242
|
});
|
|
97170
97243
|
});
|
|
97171
97244
|
}
|
|
97172
|
-
|
|
97245
|
+
async function runCommandCaptureStatus(command, args) {
|
|
97246
|
+
return await new Promise((resolvePromise) => {
|
|
97247
|
+
const child = (0, import_node_child_process8.spawn)(command, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
97248
|
+
let stdout = "";
|
|
97249
|
+
let stderr = "";
|
|
97250
|
+
child.stdout.setEncoding("utf8");
|
|
97251
|
+
child.stderr.setEncoding("utf8");
|
|
97252
|
+
child.stdout.on("data", (chunk) => {
|
|
97253
|
+
stdout += chunk;
|
|
97254
|
+
});
|
|
97255
|
+
child.stderr.on("data", (chunk) => {
|
|
97256
|
+
stderr += chunk;
|
|
97257
|
+
});
|
|
97258
|
+
child.on("error", (error) => {
|
|
97259
|
+
const detail = error.message;
|
|
97260
|
+
resolvePromise({
|
|
97261
|
+
code: null,
|
|
97262
|
+
stdout,
|
|
97263
|
+
stderr,
|
|
97264
|
+
detail,
|
|
97265
|
+
errorCode: error.code
|
|
97266
|
+
});
|
|
97267
|
+
});
|
|
97268
|
+
child.on("close", (code2, signal) => {
|
|
97269
|
+
const signalDetail = signal ? `signal=${signal}` : "";
|
|
97270
|
+
const detail = [stderr.trim(), stdout.trim(), signalDetail].filter(Boolean).join("\n");
|
|
97271
|
+
resolvePromise({
|
|
97272
|
+
code: code2,
|
|
97273
|
+
stdout,
|
|
97274
|
+
stderr,
|
|
97275
|
+
detail
|
|
97276
|
+
});
|
|
97277
|
+
});
|
|
97278
|
+
});
|
|
97279
|
+
}
|
|
97280
|
+
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, SetupBlockedError, redirectCommandStdoutToStderr;
|
|
97173
97281
|
var init_update_cli = __esm({
|
|
97174
97282
|
"src/update-cli.ts"() {
|
|
97175
97283
|
"use strict";
|
|
@@ -97178,6 +97286,7 @@ var init_update_cli = __esm({
|
|
|
97178
97286
|
import_promises8 = require("node:fs/promises");
|
|
97179
97287
|
import_node_os9 = require("node:os");
|
|
97180
97288
|
import_node_path22 = require("node:path");
|
|
97289
|
+
init_ai_command();
|
|
97181
97290
|
init_ai_provider();
|
|
97182
97291
|
init_session_store();
|
|
97183
97292
|
UPDATE_PACKAGES = {
|
|
@@ -97192,6 +97301,14 @@ var init_update_cli = __esm({
|
|
|
97192
97301
|
OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE = "per-channel-peer";
|
|
97193
97302
|
OPENCLAW_PLUGIN_ALLOW_CONFIG_PATH = "plugins.allow";
|
|
97194
97303
|
OPENCLAW_OKX_A2A_CONVERSATION_HOOK_ACCESS_CONFIG_PATH = "plugins.entries.okx-a2a.hooks.allowConversationAccess";
|
|
97304
|
+
SetupBlockedError = class extends Error {
|
|
97305
|
+
result;
|
|
97306
|
+
constructor(result) {
|
|
97307
|
+
super(result.userMessage ?? "OKX A2A setup needs user action.");
|
|
97308
|
+
this.name = "SetupBlockedError";
|
|
97309
|
+
this.result = result;
|
|
97310
|
+
}
|
|
97311
|
+
};
|
|
97195
97312
|
redirectCommandStdoutToStderr = false;
|
|
97196
97313
|
}
|
|
97197
97314
|
});
|
|
@@ -97214,7 +97331,7 @@ init_sentry_logger();
|
|
|
97214
97331
|
init_sentry_config();
|
|
97215
97332
|
var CURRENT_GATEWAY_SESSION_KEYS_ENV3 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
|
|
97216
97333
|
function printUsage2() {
|
|
97217
|
-
console.log(`okx-a2a ${"0.1.
|
|
97334
|
+
console.log(`okx-a2a ${"0.1.2-beta-3bdae0ceae-260630205417"}
|
|
97218
97335
|
|
|
97219
97336
|
Usage:
|
|
97220
97337
|
okx-a2a <command> [options]
|
|
@@ -97251,7 +97368,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
|
|
|
97251
97368
|
`);
|
|
97252
97369
|
}
|
|
97253
97370
|
function printVersion() {
|
|
97254
|
-
console.log("0.1.
|
|
97371
|
+
console.log("0.1.2-beta-3bdae0ceae-260630205417");
|
|
97255
97372
|
}
|
|
97256
97373
|
function printDaemonUsage() {
|
|
97257
97374
|
console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
|
package/dist/index.js
CHANGED
|
@@ -86724,7 +86724,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
86724
86724
|
client: {
|
|
86725
86725
|
id: "gateway-client",
|
|
86726
86726
|
displayName: "okx-a2a-node",
|
|
86727
|
-
version: "0.1.
|
|
86727
|
+
version: "0.1.2-beta-3bdae0ceae-260630205417",
|
|
86728
86728
|
platform: "node",
|
|
86729
86729
|
mode: "backend",
|
|
86730
86730
|
instanceId
|
|
@@ -86735,7 +86735,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
86735
86735
|
commands: [],
|
|
86736
86736
|
permissions: {},
|
|
86737
86737
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
86738
|
-
userAgent: `okx-a2a-node/${"0.1.
|
|
86738
|
+
userAgent: `okx-a2a-node/${"0.1.2-beta-3bdae0ceae-260630205417"}`,
|
|
86739
86739
|
auth: {
|
|
86740
86740
|
...config.token ? { token: config.token } : {},
|
|
86741
86741
|
...config.password ? { password: config.password } : {}
|
|
@@ -91154,7 +91154,7 @@ function userWatchEventDeliveredSentryExtra(event) {
|
|
|
91154
91154
|
var environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
91155
91155
|
var SENTRY_CONFIG = {
|
|
91156
91156
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
91157
|
-
release: "0.1.
|
|
91157
|
+
release: "0.1.2-beta-3bdae0ceae-260630205417",
|
|
91158
91158
|
environment
|
|
91159
91159
|
};
|
|
91160
91160
|
|
|
@@ -91381,12 +91381,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
91381
91381
|
}));
|
|
91382
91382
|
}
|
|
91383
91383
|
});
|
|
91384
|
-
service.setPluginVersion("0.1.
|
|
91384
|
+
service.setPluginVersion("0.1.2-beta-3bdae0ceae-260630205417");
|
|
91385
91385
|
await service.init();
|
|
91386
91386
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
91387
91387
|
if (pluginVersionStatus.unavailable) {
|
|
91388
91388
|
throw new Error(
|
|
91389
|
-
`@okxweb3/a2a-node v${"0.1.
|
|
91389
|
+
`@okxweb3/a2a-node v${"0.1.2-beta-3bdae0ceae-260630205417"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
91390
91390
|
);
|
|
91391
91391
|
}
|
|
91392
91392
|
const systemConfig = service.getSystemConfig();
|
|
@@ -91404,7 +91404,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
91404
91404
|
onchainosAgentId: "*",
|
|
91405
91405
|
reason: "system-config missing sentryDsn",
|
|
91406
91406
|
pluginId: "@okxweb3/a2a-node",
|
|
91407
|
-
pluginVersion: "0.1.
|
|
91407
|
+
pluginVersion: "0.1.2-beta-3bdae0ceae-260630205417"
|
|
91408
91408
|
});
|
|
91409
91409
|
}
|
|
91410
91410
|
logWithTimestamp(
|
package/package.json
CHANGED