@okxweb3/a2a-node 0.2.13-beta-7449a77b9d-260910153412 → 0.2.13
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 +99 -86
- package/dist/index.js +96 -77
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4501,12 +4501,6 @@ function probeCodexAuthStatus(command, env, platform, timeoutMs) {
|
|
|
4501
4501
|
});
|
|
4502
4502
|
});
|
|
4503
4503
|
}
|
|
4504
|
-
function readCachedCodexReadiness(options = {}) {
|
|
4505
|
-
const env = options.env ?? process.env;
|
|
4506
|
-
const nowMs = options.nowMs ?? Date.now;
|
|
4507
|
-
const cached = readCacheEntry(options.cacheKey ?? codexReadinessCacheKey(env), nowMs());
|
|
4508
|
-
return cached ? { ...cached, fromCache: true } : null;
|
|
4509
|
-
}
|
|
4510
4504
|
function checkCodexReadiness(options = {}) {
|
|
4511
4505
|
const env = options.env ?? process.env;
|
|
4512
4506
|
const nowMs = options.nowMs ?? Date.now;
|
|
@@ -21547,21 +21541,40 @@ async function ensureProviderReadyForBinding(options) {
|
|
|
21547
21541
|
if (options.provider !== "codex") {
|
|
21548
21542
|
return notRequiredReadinessGate(options.provider);
|
|
21549
21543
|
}
|
|
21550
|
-
const
|
|
21551
|
-
const
|
|
21552
|
-
|
|
21553
|
-
|
|
21554
|
-
|
|
21555
|
-
|
|
21556
|
-
|
|
21544
|
+
const env = options.env ?? process.env;
|
|
21545
|
+
const platform = options.platform ?? process.platform;
|
|
21546
|
+
const store = options.store ?? null;
|
|
21547
|
+
const candidate = resolveCodexCommandSource(env, store?.getAiProviderCommand("codex") ?? null, platform);
|
|
21548
|
+
if (!candidate) {
|
|
21549
|
+
return {
|
|
21550
|
+
provider: "codex",
|
|
21551
|
+
ready: false,
|
|
21552
|
+
state: "not_installed",
|
|
21553
|
+
commandSource: null,
|
|
21554
|
+
commandPersisted: false,
|
|
21555
|
+
recoveryAction: "install_cli",
|
|
21556
|
+
recoveryGuidance: "Codex was not found. Install the Codex CLI or Codex desktop app, then retry."
|
|
21557
|
+
};
|
|
21558
|
+
}
|
|
21559
|
+
let commandPersisted = false;
|
|
21560
|
+
if (store && (candidate.source !== "explicit_override" || options.persistOverrideCommand === true)) {
|
|
21561
|
+
try {
|
|
21562
|
+
if (store.getAiProviderCommand("codex") !== candidate.command) {
|
|
21563
|
+
store.setAiProviderCommand("codex", candidate.command);
|
|
21564
|
+
}
|
|
21565
|
+
commandPersisted = true;
|
|
21566
|
+
} catch {
|
|
21567
|
+
commandPersisted = false;
|
|
21568
|
+
}
|
|
21569
|
+
}
|
|
21557
21570
|
return {
|
|
21558
21571
|
provider: "codex",
|
|
21559
|
-
ready:
|
|
21560
|
-
state:
|
|
21561
|
-
commandSource:
|
|
21562
|
-
commandPersisted
|
|
21563
|
-
recoveryAction:
|
|
21564
|
-
recoveryGuidance:
|
|
21572
|
+
ready: true,
|
|
21573
|
+
state: "ready",
|
|
21574
|
+
commandSource: candidate.source,
|
|
21575
|
+
commandPersisted,
|
|
21576
|
+
recoveryAction: "none",
|
|
21577
|
+
recoveryGuidance: ""
|
|
21565
21578
|
};
|
|
21566
21579
|
}
|
|
21567
21580
|
async function switchProviderWithReadinessGateCore(options) {
|
|
@@ -21589,7 +21602,7 @@ async function switchProviderWithReadinessGateCore(options) {
|
|
|
21589
21602
|
store: options.store,
|
|
21590
21603
|
env,
|
|
21591
21604
|
platform: options.platform,
|
|
21592
|
-
|
|
21605
|
+
persistOverrideCommand: true
|
|
21593
21606
|
});
|
|
21594
21607
|
if (!readiness.ready) {
|
|
21595
21608
|
const previousProvider = options.store.getDefaultAiProvider();
|
|
@@ -22043,21 +22056,12 @@ async function resolveAiProviderForDispatchWithReadiness(options) {
|
|
|
22043
22056
|
if (candidate !== "codex") {
|
|
22044
22057
|
return resolveAiProviderForDispatch(options);
|
|
22045
22058
|
}
|
|
22046
|
-
|
|
22059
|
+
const gate = await ensureProviderReadyForBinding({
|
|
22047
22060
|
provider: candidate,
|
|
22048
22061
|
store: options.store,
|
|
22049
22062
|
env,
|
|
22050
|
-
platform: options.platform
|
|
22051
|
-
|
|
22052
|
-
}) : cachedProviderReadinessGate(candidate, env);
|
|
22053
|
-
if (!gate) {
|
|
22054
|
-
gate = await ensureProviderReadyForBinding({
|
|
22055
|
-
provider: candidate,
|
|
22056
|
-
store: options.store,
|
|
22057
|
-
env,
|
|
22058
|
-
platform: options.platform
|
|
22059
|
-
});
|
|
22060
|
-
}
|
|
22063
|
+
platform: options.platform
|
|
22064
|
+
});
|
|
22061
22065
|
logProviderReadinessChecked(jobId, gate);
|
|
22062
22066
|
if (!gate.ready) {
|
|
22063
22067
|
throw new ProviderNotReadyError(candidate, gate);
|
|
@@ -22067,13 +22071,6 @@ async function resolveAiProviderForDispatchWithReadiness(options) {
|
|
|
22067
22071
|
(provider) => bindDispatchProviderIfNeeded(options.store, jobId, env, provider, true)
|
|
22068
22072
|
);
|
|
22069
22073
|
}
|
|
22070
|
-
function cachedProviderReadinessGate(provider, env) {
|
|
22071
|
-
if (provider !== "codex") {
|
|
22072
|
-
return notRequiredReadinessGate(provider);
|
|
22073
|
-
}
|
|
22074
|
-
const cached = readCachedCodexReadiness({ env });
|
|
22075
|
-
return cached ? readinessGateFromResult(cached) : null;
|
|
22076
|
-
}
|
|
22077
22074
|
function assertCodexBindingPermitted(store, input) {
|
|
22078
22075
|
if (input.provider !== "codex" || input.readinessVerified) {
|
|
22079
22076
|
return;
|
|
@@ -22081,35 +22078,25 @@ function assertCodexBindingPermitted(store, input) {
|
|
|
22081
22078
|
if (store.getJobProviderBinding?.(input.jobId)) {
|
|
22082
22079
|
return;
|
|
22083
22080
|
}
|
|
22084
|
-
const
|
|
22085
|
-
|
|
22081
|
+
const env = input.env ?? process.env;
|
|
22082
|
+
const candidate = resolveCodexCommandSource(env, store.getAiProviderCommand?.("codex") ?? null, process.platform);
|
|
22083
|
+
if (candidate) {
|
|
22086
22084
|
return;
|
|
22087
22085
|
}
|
|
22088
22086
|
throw new ProviderNotReadyError(
|
|
22089
22087
|
input.provider,
|
|
22090
|
-
|
|
22088
|
+
unavailableCodexGate()
|
|
22091
22089
|
);
|
|
22092
22090
|
}
|
|
22093
|
-
function
|
|
22091
|
+
function unavailableCodexGate() {
|
|
22094
22092
|
return {
|
|
22095
22093
|
provider: "codex",
|
|
22096
22094
|
ready: false,
|
|
22097
|
-
state: "
|
|
22095
|
+
state: "not_installed",
|
|
22098
22096
|
commandSource: null,
|
|
22099
22097
|
commandPersisted: false,
|
|
22100
|
-
recoveryAction: "
|
|
22101
|
-
recoveryGuidance: "Codex
|
|
22102
|
-
};
|
|
22103
|
-
}
|
|
22104
|
-
function readinessGateFromResult(result) {
|
|
22105
|
-
return {
|
|
22106
|
-
provider: result.provider,
|
|
22107
|
-
ready: result.ready,
|
|
22108
|
-
state: result.state,
|
|
22109
|
-
commandSource: result.commandSource,
|
|
22110
|
-
commandPersisted: result.commandPersisted,
|
|
22111
|
-
recoveryAction: result.recoveryAction,
|
|
22112
|
-
recoveryGuidance: result.recoveryGuidance
|
|
22098
|
+
recoveryAction: "install_cli",
|
|
22099
|
+
recoveryGuidance: "Codex was not found. Install the Codex CLI or Codex desktop app, then retry."
|
|
22113
22100
|
};
|
|
22114
22101
|
}
|
|
22115
22102
|
function resolveDispatchProvider(options, bind) {
|
|
@@ -26938,7 +26925,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
26938
26925
|
client: {
|
|
26939
26926
|
id: "gateway-client",
|
|
26940
26927
|
displayName: "okx-a2a-node",
|
|
26941
|
-
version: "0.2.13
|
|
26928
|
+
version: "0.2.13",
|
|
26942
26929
|
platform: "node",
|
|
26943
26930
|
mode: "backend",
|
|
26944
26931
|
instanceId
|
|
@@ -26949,7 +26936,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
26949
26936
|
commands: [],
|
|
26950
26937
|
permissions: {},
|
|
26951
26938
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
26952
|
-
userAgent: `okx-a2a-node/${"0.2.13
|
|
26939
|
+
userAgent: `okx-a2a-node/${"0.2.13"}`,
|
|
26953
26940
|
auth: {
|
|
26954
26941
|
...config.token ? { token: config.token } : {},
|
|
26955
26942
|
...config.password ? { password: config.password } : {}
|
|
@@ -29008,7 +28995,7 @@ var init_sentry_config = __esm({
|
|
|
29008
28995
|
environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
29009
28996
|
SENTRY_CONFIG = {
|
|
29010
28997
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
29011
|
-
release: "0.2.13
|
|
28998
|
+
release: "0.2.13",
|
|
29012
28999
|
environment,
|
|
29013
29000
|
runtimeContainer: normalizeRuntimeContainer(process.env.OKX_A2A_RUNTIME_CONTAINER)
|
|
29014
29001
|
};
|
|
@@ -40178,7 +40165,7 @@ async function exportDiagnosticLogs(options) {
|
|
|
40178
40165
|
node: process.version,
|
|
40179
40166
|
platform: process.platform,
|
|
40180
40167
|
arch: process.arch,
|
|
40181
|
-
packageVersion: true ? "0.2.13
|
|
40168
|
+
packageVersion: true ? "0.2.13" : "unknown",
|
|
40182
40169
|
sensitiveContentIncluded: options.includeSensitiveContent,
|
|
40183
40170
|
listenerAndLlmContentIncluded: true,
|
|
40184
40171
|
credentialsAlwaysRedacted: true,
|
|
@@ -69684,12 +69671,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
69684
69671
|
});
|
|
69685
69672
|
}
|
|
69686
69673
|
});
|
|
69687
|
-
service.setPluginVersion("0.2.13
|
|
69674
|
+
service.setPluginVersion("0.2.13");
|
|
69688
69675
|
await service.init();
|
|
69689
69676
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
69690
69677
|
if (pluginVersionStatus.unavailable) {
|
|
69691
69678
|
throw new Error(
|
|
69692
|
-
`@okxweb3/a2a-node v${"0.2.13
|
|
69679
|
+
`@okxweb3/a2a-node v${"0.2.13"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
69693
69680
|
);
|
|
69694
69681
|
}
|
|
69695
69682
|
const systemConfig = service.getSystemConfig();
|
|
@@ -69717,7 +69704,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
69717
69704
|
onchainosAgentId: "*",
|
|
69718
69705
|
reason: "system-config missing sentryDsn",
|
|
69719
69706
|
pluginId: "@okxweb3/a2a-node",
|
|
69720
|
-
pluginVersion: "0.2.13
|
|
69707
|
+
pluginVersion: "0.2.13"
|
|
69721
69708
|
});
|
|
69722
69709
|
}
|
|
69723
69710
|
logWithTimestamp(
|
|
@@ -117559,7 +117546,7 @@ async function runSetup(options) {
|
|
|
117559
117546
|
state: "ready",
|
|
117560
117547
|
target: resolvedTarget,
|
|
117561
117548
|
release: releasePlan.resultRelease,
|
|
117562
|
-
userMessage: "OKX A2A node CLI setup is ready.",
|
|
117549
|
+
userMessage: providerReadiness?.authStatus === "not_logged_in" ? "OKX A2A node CLI setup is ready. Warning: Codex CLI is not logged in." : "OKX A2A node CLI setup is ready.",
|
|
117563
117550
|
...providerReadiness
|
|
117564
117551
|
};
|
|
117565
117552
|
}
|
|
@@ -117677,7 +117664,7 @@ function switchDefaultProviderForSetup(provider) {
|
|
|
117677
117664
|
}
|
|
117678
117665
|
}
|
|
117679
117666
|
function persistProviderCommandForSetup(metadata, platform = process.platform) {
|
|
117680
|
-
if (metadata.authStatus !== "ready") {
|
|
117667
|
+
if (metadata.authStatus !== "ready" && !(metadata.provider === "codex" && metadata.authStatus === "not_logged_in")) {
|
|
117681
117668
|
return metadata;
|
|
117682
117669
|
}
|
|
117683
117670
|
if (!metadata.providerCommand) {
|
|
@@ -117753,6 +117740,21 @@ async function ensureCodexCliAuthReadyForSetup(target, release) {
|
|
|
117753
117740
|
console.log(`[setup] codex CLI auth status is ready (${cli.installType}: ${command})`);
|
|
117754
117741
|
return metadataFromCodexCli(cli, "ready");
|
|
117755
117742
|
}
|
|
117743
|
+
if (status.reason === "provider_cli_not_logged_in") {
|
|
117744
|
+
const commandForUser = quoteUserFacingCommandPath(command);
|
|
117745
|
+
const loginCommand = `${commandForUser} login --device-auth`;
|
|
117746
|
+
console.log("[setup] warning: codex CLI is installed but not logged in; setup will continue");
|
|
117747
|
+
return {
|
|
117748
|
+
...metadataFromCodexCli(cli, "not_logged_in"),
|
|
117749
|
+
warnings: [{
|
|
117750
|
+
type: "warning",
|
|
117751
|
+
code: "provider_cli_not_logged_in",
|
|
117752
|
+
provider: "codex",
|
|
117753
|
+
message: "Codex CLI is installed but not logged in; log in before running Codex-backed AI work.",
|
|
117754
|
+
command: loginCommand
|
|
117755
|
+
}]
|
|
117756
|
+
};
|
|
117757
|
+
}
|
|
117756
117758
|
await runAiProviderLoginForSetup("codex", command, target, release);
|
|
117757
117759
|
const verified = await checkCodexCliAuthStatus(command);
|
|
117758
117760
|
if (verified.ok) {
|
|
@@ -118044,7 +118046,7 @@ async function getCurrentNodeCliVersion() {
|
|
|
118044
118046
|
return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
|
|
118045
118047
|
}
|
|
118046
118048
|
function getBundledNodeCliVersion() {
|
|
118047
|
-
return true ? "0.2.13
|
|
118049
|
+
return true ? "0.2.13" : null;
|
|
118048
118050
|
}
|
|
118049
118051
|
function readConfiguredAiProvider() {
|
|
118050
118052
|
const explicit = process.env.OKX_A2A_AI_PROVIDER || process.env.OKX_AGENT_TASK_AI_CLI;
|
|
@@ -118254,7 +118256,7 @@ async function updateHermes(release, options) {
|
|
|
118254
118256
|
}
|
|
118255
118257
|
}
|
|
118256
118258
|
async function installGatewayPluginForDoctor(target) {
|
|
118257
|
-
const release = isPrereleaseVersion("0.2.13
|
|
118259
|
+
const release = isPrereleaseVersion("0.2.13") ? "beta" : "latest";
|
|
118258
118260
|
const insideTargetGateway = detectGatewayInvocation() === target;
|
|
118259
118261
|
const options = {
|
|
118260
118262
|
restart: !insideTargetGateway,
|
|
@@ -119307,7 +119309,7 @@ async function runDoctor(options = {}) {
|
|
|
119307
119309
|
platform: options.platform ?? process.platform,
|
|
119308
119310
|
env: options.env ?? process.env,
|
|
119309
119311
|
target: options.target ?? resolveDoctorTarget(options.env ?? process.env),
|
|
119310
|
-
cliVersion: options.cliVersion ?? (true ? "0.2.13
|
|
119312
|
+
cliVersion: options.cliVersion ?? (true ? "0.2.13" : "0.0.0"),
|
|
119311
119313
|
fixMode: options.fix === true,
|
|
119312
119314
|
nonInteractive: options.nonInteractive === true,
|
|
119313
119315
|
packageChanged: false,
|
|
@@ -119909,26 +119911,37 @@ var init_doctor_cli = __esm({
|
|
|
119909
119911
|
}
|
|
119910
119912
|
}
|
|
119911
119913
|
const auth = provider === "codex" ? await checkCodexCliAuthStatus(resolved) : await checkClaudeCliAuthStatus(resolved);
|
|
119914
|
+
let providerLoggedOut = false;
|
|
119912
119915
|
if (!auth.ok) {
|
|
119913
|
-
if (
|
|
119914
|
-
|
|
119915
|
-
|
|
119916
|
-
|
|
119917
|
-
|
|
119918
|
-
|
|
119919
|
-
|
|
119920
|
-
|
|
119921
|
-
|
|
119922
|
-
|
|
119923
|
-
|
|
119924
|
-
|
|
119925
|
-
|
|
119916
|
+
if (auth.reason === "provider_cli_not_logged_in") {
|
|
119917
|
+
providerLoggedOut = true;
|
|
119918
|
+
steps.push("provider login remains a non-blocking warning");
|
|
119919
|
+
} else {
|
|
119920
|
+
if (ctx.nonInteractive) {
|
|
119921
|
+
throw new Error(
|
|
119922
|
+
`${provider} CLI authentication status could not be verified; non-interactive mode skips the login flow \u2014 inspect the CLI and re-run okx-a2a doctor`
|
|
119923
|
+
);
|
|
119924
|
+
}
|
|
119925
|
+
errorWithTimestamp(`[doctor] launching ${provider} CLI login (interactive; waiting for completion)`);
|
|
119926
|
+
const login = await runProviderLoginInteractive(provider, resolved);
|
|
119927
|
+
if (!login.ok) {
|
|
119928
|
+
throw new Error(`${provider} login did not complete (${login.reason}): ${login.detail.slice(0, 300)}`);
|
|
119929
|
+
}
|
|
119930
|
+
const verified = provider === "codex" ? await checkCodexCliAuthStatus(resolved) : await checkClaudeCliAuthStatus(resolved);
|
|
119931
|
+
if (!verified.ok) {
|
|
119932
|
+
throw new Error(`${provider} login flow finished but the CLI still reports ${verified.reason}`);
|
|
119933
|
+
}
|
|
119934
|
+
steps.push("completed interactive login");
|
|
119926
119935
|
}
|
|
119927
|
-
steps.push("completed interactive login");
|
|
119928
119936
|
}
|
|
119929
119937
|
if (provider === "codex") {
|
|
119930
119938
|
const store = new SessionStore();
|
|
119931
119939
|
try {
|
|
119940
|
+
if (providerLoggedOut) {
|
|
119941
|
+
store.setAiProviderCommand("codex", resolved);
|
|
119942
|
+
steps.push("persisted the codex command without requiring login");
|
|
119943
|
+
return steps.join("; ");
|
|
119944
|
+
}
|
|
119932
119945
|
const readiness = await checkCodexReadiness({
|
|
119933
119946
|
store,
|
|
119934
119947
|
env: ctx.env,
|
|
@@ -120403,7 +120416,7 @@ init_sentry_config();
|
|
|
120403
120416
|
init_runtime_metadata();
|
|
120404
120417
|
var CURRENT_GATEWAY_SESSION_KEYS_ENV4 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
|
|
120405
120418
|
function printUsage3() {
|
|
120406
|
-
console.log(`okx-a2a ${"0.2.13
|
|
120419
|
+
console.log(`okx-a2a ${"0.2.13"}
|
|
120407
120420
|
|
|
120408
120421
|
Usage:
|
|
120409
120422
|
okx-a2a <command> [options]
|
|
@@ -120445,7 +120458,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
|
|
|
120445
120458
|
`);
|
|
120446
120459
|
}
|
|
120447
120460
|
function printVersion() {
|
|
120448
|
-
console.log("0.2.13
|
|
120461
|
+
console.log("0.2.13");
|
|
120449
120462
|
}
|
|
120450
120463
|
function printDaemonUsage() {
|
|
120451
120464
|
console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
|
|
@@ -121935,7 +121948,7 @@ async function main() {
|
|
|
121935
121948
|
if (command === "xmtp-test") {
|
|
121936
121949
|
const { handleXmtpTestCommand: handleXmtpTestCommand2 } = await Promise.resolve().then(() => (init_xmtp_test_cli(), xmtp_test_cli_exports));
|
|
121937
121950
|
await handleXmtpTestCommand2(process.argv.slice(3), {
|
|
121938
|
-
packageVersion: "0.2.13
|
|
121951
|
+
packageVersion: "0.2.13",
|
|
121939
121952
|
agentSdkVersion: "2.3.0",
|
|
121940
121953
|
nodeSdkVersion: "6.1.0",
|
|
121941
121954
|
nodeBindingsVersion: "1.11.0"
|
package/dist/index.js
CHANGED
|
@@ -20959,21 +20959,40 @@ async function ensureProviderReadyForBinding(options) {
|
|
|
20959
20959
|
if (options.provider !== "codex") {
|
|
20960
20960
|
return notRequiredReadinessGate(options.provider);
|
|
20961
20961
|
}
|
|
20962
|
-
const
|
|
20963
|
-
const
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20962
|
+
const env = options.env ?? process.env;
|
|
20963
|
+
const platform = options.platform ?? process.platform;
|
|
20964
|
+
const store = options.store ?? null;
|
|
20965
|
+
const candidate = resolveCodexCommandSource(env, store?.getAiProviderCommand("codex") ?? null, platform);
|
|
20966
|
+
if (!candidate) {
|
|
20967
|
+
return {
|
|
20968
|
+
provider: "codex",
|
|
20969
|
+
ready: false,
|
|
20970
|
+
state: "not_installed",
|
|
20971
|
+
commandSource: null,
|
|
20972
|
+
commandPersisted: false,
|
|
20973
|
+
recoveryAction: "install_cli",
|
|
20974
|
+
recoveryGuidance: "Codex was not found. Install the Codex CLI or Codex desktop app, then retry."
|
|
20975
|
+
};
|
|
20976
|
+
}
|
|
20977
|
+
let commandPersisted = false;
|
|
20978
|
+
if (store && (candidate.source !== "explicit_override" || options.persistOverrideCommand === true)) {
|
|
20979
|
+
try {
|
|
20980
|
+
if (store.getAiProviderCommand("codex") !== candidate.command) {
|
|
20981
|
+
store.setAiProviderCommand("codex", candidate.command);
|
|
20982
|
+
}
|
|
20983
|
+
commandPersisted = true;
|
|
20984
|
+
} catch {
|
|
20985
|
+
commandPersisted = false;
|
|
20986
|
+
}
|
|
20987
|
+
}
|
|
20969
20988
|
return {
|
|
20970
20989
|
provider: "codex",
|
|
20971
|
-
ready:
|
|
20972
|
-
state:
|
|
20973
|
-
commandSource:
|
|
20974
|
-
commandPersisted
|
|
20975
|
-
recoveryAction:
|
|
20976
|
-
recoveryGuidance:
|
|
20990
|
+
ready: true,
|
|
20991
|
+
state: "ready",
|
|
20992
|
+
commandSource: candidate.source,
|
|
20993
|
+
commandPersisted,
|
|
20994
|
+
recoveryAction: "none",
|
|
20995
|
+
recoveryGuidance: ""
|
|
20977
20996
|
};
|
|
20978
20997
|
}
|
|
20979
20998
|
async function switchProviderWithReadinessGateCore(options) {
|
|
@@ -21001,7 +21020,7 @@ async function switchProviderWithReadinessGateCore(options) {
|
|
|
21001
21020
|
store: options.store,
|
|
21002
21021
|
env,
|
|
21003
21022
|
platform: options.platform,
|
|
21004
|
-
|
|
21023
|
+
persistOverrideCommand: true
|
|
21005
21024
|
});
|
|
21006
21025
|
if (!readiness.ready) {
|
|
21007
21026
|
const previousProvider = options.store.getDefaultAiProvider();
|
|
@@ -21485,21 +21504,12 @@ async function resolveAiProviderForDispatchWithReadiness(options) {
|
|
|
21485
21504
|
if (candidate !== "codex") {
|
|
21486
21505
|
return resolveAiProviderForDispatch(options);
|
|
21487
21506
|
}
|
|
21488
|
-
|
|
21507
|
+
const gate = await ensureProviderReadyForBinding({
|
|
21489
21508
|
provider: candidate,
|
|
21490
21509
|
store: options.store,
|
|
21491
21510
|
env,
|
|
21492
|
-
platform: options.platform
|
|
21493
|
-
|
|
21494
|
-
}) : cachedProviderReadinessGate(candidate, env);
|
|
21495
|
-
if (!gate) {
|
|
21496
|
-
gate = await ensureProviderReadyForBinding({
|
|
21497
|
-
provider: candidate,
|
|
21498
|
-
store: options.store,
|
|
21499
|
-
env,
|
|
21500
|
-
platform: options.platform
|
|
21501
|
-
});
|
|
21502
|
-
}
|
|
21511
|
+
platform: options.platform
|
|
21512
|
+
});
|
|
21503
21513
|
logProviderReadinessChecked(jobId, gate);
|
|
21504
21514
|
if (!gate.ready) {
|
|
21505
21515
|
throw new ProviderNotReadyError(candidate, gate);
|
|
@@ -21509,13 +21519,6 @@ async function resolveAiProviderForDispatchWithReadiness(options) {
|
|
|
21509
21519
|
(provider) => bindDispatchProviderIfNeeded(options.store, jobId, env, provider, true)
|
|
21510
21520
|
);
|
|
21511
21521
|
}
|
|
21512
|
-
function cachedProviderReadinessGate(provider, env) {
|
|
21513
|
-
if (provider !== "codex") {
|
|
21514
|
-
return notRequiredReadinessGate(provider);
|
|
21515
|
-
}
|
|
21516
|
-
const cached = readCachedCodexReadiness({ env });
|
|
21517
|
-
return cached ? readinessGateFromResult(cached) : null;
|
|
21518
|
-
}
|
|
21519
21522
|
function assertCodexBindingPermitted(store, input) {
|
|
21520
21523
|
if (input.provider !== "codex" || input.readinessVerified) {
|
|
21521
21524
|
return;
|
|
@@ -21523,35 +21526,25 @@ function assertCodexBindingPermitted(store, input) {
|
|
|
21523
21526
|
if (store.getJobProviderBinding?.(input.jobId)) {
|
|
21524
21527
|
return;
|
|
21525
21528
|
}
|
|
21526
|
-
const
|
|
21527
|
-
|
|
21529
|
+
const env = input.env ?? process.env;
|
|
21530
|
+
const candidate = resolveCodexCommandSource(env, store.getAiProviderCommand?.("codex") ?? null, process.platform);
|
|
21531
|
+
if (candidate) {
|
|
21528
21532
|
return;
|
|
21529
21533
|
}
|
|
21530
21534
|
throw new ProviderNotReadyError(
|
|
21531
21535
|
input.provider,
|
|
21532
|
-
|
|
21536
|
+
unavailableCodexGate()
|
|
21533
21537
|
);
|
|
21534
21538
|
}
|
|
21535
|
-
function
|
|
21539
|
+
function unavailableCodexGate() {
|
|
21536
21540
|
return {
|
|
21537
21541
|
provider: "codex",
|
|
21538
21542
|
ready: false,
|
|
21539
|
-
state: "
|
|
21543
|
+
state: "not_installed",
|
|
21540
21544
|
commandSource: null,
|
|
21541
21545
|
commandPersisted: false,
|
|
21542
|
-
recoveryAction: "
|
|
21543
|
-
recoveryGuidance: "Codex
|
|
21544
|
-
};
|
|
21545
|
-
}
|
|
21546
|
-
function readinessGateFromResult(result) {
|
|
21547
|
-
return {
|
|
21548
|
-
provider: result.provider,
|
|
21549
|
-
ready: result.ready,
|
|
21550
|
-
state: result.state,
|
|
21551
|
-
commandSource: result.commandSource,
|
|
21552
|
-
commandPersisted: result.commandPersisted,
|
|
21553
|
-
recoveryAction: result.recoveryAction,
|
|
21554
|
-
recoveryGuidance: result.recoveryGuidance
|
|
21546
|
+
recoveryAction: "install_cli",
|
|
21547
|
+
recoveryGuidance: "Codex was not found. Install the Codex CLI or Codex desktop app, then retry."
|
|
21555
21548
|
};
|
|
21556
21549
|
}
|
|
21557
21550
|
function resolveDispatchProvider(options, bind) {
|
|
@@ -32441,7 +32434,7 @@ var init_sentry_config = __esm({
|
|
|
32441
32434
|
environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
32442
32435
|
SENTRY_CONFIG = {
|
|
32443
32436
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
32444
|
-
release: "0.2.13
|
|
32437
|
+
release: "0.2.13",
|
|
32445
32438
|
environment,
|
|
32446
32439
|
runtimeContainer: normalizeRuntimeContainer(process.env.OKX_A2A_RUNTIME_CONTAINER)
|
|
32447
32440
|
};
|
|
@@ -32897,7 +32890,7 @@ async function runSetup(options) {
|
|
|
32897
32890
|
state: "ready",
|
|
32898
32891
|
target: resolvedTarget,
|
|
32899
32892
|
release: releasePlan.resultRelease,
|
|
32900
|
-
userMessage: "OKX A2A node CLI setup is ready.",
|
|
32893
|
+
userMessage: providerReadiness?.authStatus === "not_logged_in" ? "OKX A2A node CLI setup is ready. Warning: Codex CLI is not logged in." : "OKX A2A node CLI setup is ready.",
|
|
32901
32894
|
...providerReadiness
|
|
32902
32895
|
};
|
|
32903
32896
|
}
|
|
@@ -33015,7 +33008,7 @@ function switchDefaultProviderForSetup(provider) {
|
|
|
33015
33008
|
}
|
|
33016
33009
|
}
|
|
33017
33010
|
function persistProviderCommandForSetup(metadata, platform = process.platform) {
|
|
33018
|
-
if (metadata.authStatus !== "ready") {
|
|
33011
|
+
if (metadata.authStatus !== "ready" && !(metadata.provider === "codex" && metadata.authStatus === "not_logged_in")) {
|
|
33019
33012
|
return metadata;
|
|
33020
33013
|
}
|
|
33021
33014
|
if (!metadata.providerCommand) {
|
|
@@ -33091,6 +33084,21 @@ async function ensureCodexCliAuthReadyForSetup(target, release) {
|
|
|
33091
33084
|
console.log(`[setup] codex CLI auth status is ready (${cli.installType}: ${command})`);
|
|
33092
33085
|
return metadataFromCodexCli(cli, "ready");
|
|
33093
33086
|
}
|
|
33087
|
+
if (status.reason === "provider_cli_not_logged_in") {
|
|
33088
|
+
const commandForUser = quoteUserFacingCommandPath(command);
|
|
33089
|
+
const loginCommand = `${commandForUser} login --device-auth`;
|
|
33090
|
+
console.log("[setup] warning: codex CLI is installed but not logged in; setup will continue");
|
|
33091
|
+
return {
|
|
33092
|
+
...metadataFromCodexCli(cli, "not_logged_in"),
|
|
33093
|
+
warnings: [{
|
|
33094
|
+
type: "warning",
|
|
33095
|
+
code: "provider_cli_not_logged_in",
|
|
33096
|
+
provider: "codex",
|
|
33097
|
+
message: "Codex CLI is installed but not logged in; log in before running Codex-backed AI work.",
|
|
33098
|
+
command: loginCommand
|
|
33099
|
+
}]
|
|
33100
|
+
};
|
|
33101
|
+
}
|
|
33094
33102
|
await runAiProviderLoginForSetup("codex", command, target, release);
|
|
33095
33103
|
const verified = await checkCodexCliAuthStatus(command);
|
|
33096
33104
|
if (verified.ok) {
|
|
@@ -33382,7 +33390,7 @@ async function getCurrentNodeCliVersion() {
|
|
|
33382
33390
|
return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
|
|
33383
33391
|
}
|
|
33384
33392
|
function getBundledNodeCliVersion() {
|
|
33385
|
-
return true ? "0.2.13
|
|
33393
|
+
return true ? "0.2.13" : null;
|
|
33386
33394
|
}
|
|
33387
33395
|
function readConfiguredAiProvider() {
|
|
33388
33396
|
const explicit = process.env.OKX_A2A_AI_PROVIDER || process.env.OKX_AGENT_TASK_AI_CLI;
|
|
@@ -33592,7 +33600,7 @@ async function updateHermes(release, options) {
|
|
|
33592
33600
|
}
|
|
33593
33601
|
}
|
|
33594
33602
|
async function installGatewayPluginForDoctor(target) {
|
|
33595
|
-
const release = isPrereleaseVersion("0.2.13
|
|
33603
|
+
const release = isPrereleaseVersion("0.2.13") ? "beta" : "latest";
|
|
33596
33604
|
const insideTargetGateway = detectGatewayInvocation() === target;
|
|
33597
33605
|
const options = {
|
|
33598
33606
|
restart: !insideTargetGateway,
|
|
@@ -61310,7 +61318,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
61310
61318
|
client: {
|
|
61311
61319
|
id: "gateway-client",
|
|
61312
61320
|
displayName: "okx-a2a-node",
|
|
61313
|
-
version: "0.2.13
|
|
61321
|
+
version: "0.2.13",
|
|
61314
61322
|
platform: "node",
|
|
61315
61323
|
mode: "backend",
|
|
61316
61324
|
instanceId
|
|
@@ -61321,7 +61329,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
61321
61329
|
commands: [],
|
|
61322
61330
|
permissions: {},
|
|
61323
61331
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
61324
|
-
userAgent: `okx-a2a-node/${"0.2.13
|
|
61332
|
+
userAgent: `okx-a2a-node/${"0.2.13"}`,
|
|
61325
61333
|
auth: {
|
|
61326
61334
|
...config.token ? { token: config.token } : {},
|
|
61327
61335
|
...config.password ? { password: config.password } : {}
|
|
@@ -67660,12 +67668,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
67660
67668
|
});
|
|
67661
67669
|
}
|
|
67662
67670
|
});
|
|
67663
|
-
service.setPluginVersion("0.2.13
|
|
67671
|
+
service.setPluginVersion("0.2.13");
|
|
67664
67672
|
await service.init();
|
|
67665
67673
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
67666
67674
|
if (pluginVersionStatus.unavailable) {
|
|
67667
67675
|
throw new Error(
|
|
67668
|
-
`@okxweb3/a2a-node v${"0.2.13
|
|
67676
|
+
`@okxweb3/a2a-node v${"0.2.13"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
67669
67677
|
);
|
|
67670
67678
|
}
|
|
67671
67679
|
const systemConfig = service.getSystemConfig();
|
|
@@ -67693,7 +67701,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
67693
67701
|
onchainosAgentId: "*",
|
|
67694
67702
|
reason: "system-config missing sentryDsn",
|
|
67695
67703
|
pluginId: "@okxweb3/a2a-node",
|
|
67696
|
-
pluginVersion: "0.2.13
|
|
67704
|
+
pluginVersion: "0.2.13"
|
|
67697
67705
|
});
|
|
67698
67706
|
}
|
|
67699
67707
|
logWithTimestamp(
|
|
@@ -70466,7 +70474,7 @@ async function exportDiagnosticLogs(options) {
|
|
|
70466
70474
|
node: process.version,
|
|
70467
70475
|
platform: process.platform,
|
|
70468
70476
|
arch: process.arch,
|
|
70469
|
-
packageVersion: true ? "0.2.13
|
|
70477
|
+
packageVersion: true ? "0.2.13" : "unknown",
|
|
70470
70478
|
sensitiveContentIncluded: options.includeSensitiveContent,
|
|
70471
70479
|
listenerAndLlmContentIncluded: true,
|
|
70472
70480
|
credentialsAlwaysRedacted: true,
|
|
@@ -71948,26 +71956,37 @@ var providerCliChecker = {
|
|
|
71948
71956
|
}
|
|
71949
71957
|
}
|
|
71950
71958
|
const auth = provider === "codex" ? await checkCodexCliAuthStatus(resolved) : await checkClaudeCliAuthStatus(resolved);
|
|
71959
|
+
let providerLoggedOut = false;
|
|
71951
71960
|
if (!auth.ok) {
|
|
71952
|
-
if (
|
|
71953
|
-
|
|
71954
|
-
|
|
71955
|
-
|
|
71956
|
-
|
|
71957
|
-
|
|
71958
|
-
|
|
71959
|
-
|
|
71960
|
-
|
|
71961
|
-
|
|
71962
|
-
|
|
71963
|
-
|
|
71964
|
-
|
|
71961
|
+
if (auth.reason === "provider_cli_not_logged_in") {
|
|
71962
|
+
providerLoggedOut = true;
|
|
71963
|
+
steps.push("provider login remains a non-blocking warning");
|
|
71964
|
+
} else {
|
|
71965
|
+
if (ctx.nonInteractive) {
|
|
71966
|
+
throw new Error(
|
|
71967
|
+
`${provider} CLI authentication status could not be verified; non-interactive mode skips the login flow \u2014 inspect the CLI and re-run okx-a2a doctor`
|
|
71968
|
+
);
|
|
71969
|
+
}
|
|
71970
|
+
errorWithTimestamp(`[doctor] launching ${provider} CLI login (interactive; waiting for completion)`);
|
|
71971
|
+
const login = await runProviderLoginInteractive(provider, resolved);
|
|
71972
|
+
if (!login.ok) {
|
|
71973
|
+
throw new Error(`${provider} login did not complete (${login.reason}): ${login.detail.slice(0, 300)}`);
|
|
71974
|
+
}
|
|
71975
|
+
const verified = provider === "codex" ? await checkCodexCliAuthStatus(resolved) : await checkClaudeCliAuthStatus(resolved);
|
|
71976
|
+
if (!verified.ok) {
|
|
71977
|
+
throw new Error(`${provider} login flow finished but the CLI still reports ${verified.reason}`);
|
|
71978
|
+
}
|
|
71979
|
+
steps.push("completed interactive login");
|
|
71965
71980
|
}
|
|
71966
|
-
steps.push("completed interactive login");
|
|
71967
71981
|
}
|
|
71968
71982
|
if (provider === "codex") {
|
|
71969
71983
|
const store = new SessionStore();
|
|
71970
71984
|
try {
|
|
71985
|
+
if (providerLoggedOut) {
|
|
71986
|
+
store.setAiProviderCommand("codex", resolved);
|
|
71987
|
+
steps.push("persisted the codex command without requiring login");
|
|
71988
|
+
return steps.join("; ");
|
|
71989
|
+
}
|
|
71971
71990
|
const readiness = await checkCodexReadiness({
|
|
71972
71991
|
store,
|
|
71973
71992
|
env: ctx.env,
|
|
@@ -72367,7 +72386,7 @@ async function runDoctor(options = {}) {
|
|
|
72367
72386
|
platform: options.platform ?? process.platform,
|
|
72368
72387
|
env: options.env ?? process.env,
|
|
72369
72388
|
target: options.target ?? resolveDoctorTarget(options.env ?? process.env),
|
|
72370
|
-
cliVersion: options.cliVersion ?? (true ? "0.2.13
|
|
72389
|
+
cliVersion: options.cliVersion ?? (true ? "0.2.13" : "0.0.0"),
|
|
72371
72390
|
fixMode: options.fix === true,
|
|
72372
72391
|
nonInteractive: options.nonInteractive === true,
|
|
72373
72392
|
packageChanged: false,
|
package/package.json
CHANGED