@okxweb3/a2a-node 0.1.1-beta-b61454118d-260630143950 → 0.1.1
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 +86 -57
- package/dist/index.js +22 -16
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3127,12 +3127,14 @@ async function ensureDefaultAiProvider(options) {
|
|
|
3127
3127
|
const detection = detectAiProviders(commandExists2, env);
|
|
3128
3128
|
if (options.requestedProvider) {
|
|
3129
3129
|
const provider = normalizeAiProvider(options.requestedProvider);
|
|
3130
|
-
|
|
3130
|
+
if (!options.allowUnavailableProvider) {
|
|
3131
|
+
assertInstalled(provider, detection);
|
|
3132
|
+
}
|
|
3131
3133
|
options.store.setDefaultAiProvider(provider);
|
|
3132
3134
|
return {
|
|
3133
3135
|
provider,
|
|
3134
3136
|
source: "requested",
|
|
3135
|
-
message: `default AI provider set to ${provider}`
|
|
3137
|
+
message: isInstalled(provider, detection) ? `default AI provider set to ${provider}` : `default AI provider set to ${provider}; availability was not verified on PATH`
|
|
3136
3138
|
};
|
|
3137
3139
|
}
|
|
3138
3140
|
if (options.forcePrompt) {
|
|
@@ -3151,29 +3153,33 @@ async function ensureDefaultAiProvider(options) {
|
|
|
3151
3153
|
}
|
|
3152
3154
|
if (env.OKX_AGENT_TASK_AI_CLI) {
|
|
3153
3155
|
const provider = normalizeAiProvider(env.OKX_AGENT_TASK_AI_CLI);
|
|
3154
|
-
|
|
3156
|
+
if (!options.allowUnavailableProvider) {
|
|
3157
|
+
assertInstalled(provider, detection);
|
|
3158
|
+
}
|
|
3155
3159
|
options.store.setDefaultAiProvider(provider);
|
|
3156
3160
|
return {
|
|
3157
3161
|
provider,
|
|
3158
3162
|
source: "env",
|
|
3159
|
-
message: `default AI provider set to ${provider} from OKX_AGENT_TASK_AI_CLI`
|
|
3163
|
+
message: isInstalled(provider, detection) ? `default AI provider set to ${provider} from OKX_AGENT_TASK_AI_CLI` : `default AI provider set to ${provider} from OKX_AGENT_TASK_AI_CLI; availability was not verified on PATH`
|
|
3160
3164
|
};
|
|
3161
3165
|
}
|
|
3162
3166
|
if (env.OKX_A2A_AI_PROVIDER) {
|
|
3163
3167
|
const provider = normalizeAiProvider(env.OKX_A2A_AI_PROVIDER);
|
|
3164
|
-
|
|
3168
|
+
if (!options.allowUnavailableProvider) {
|
|
3169
|
+
assertInstalled(provider, detection);
|
|
3170
|
+
}
|
|
3165
3171
|
return {
|
|
3166
3172
|
provider,
|
|
3167
3173
|
source: "env",
|
|
3168
|
-
message: `AI provider resolved from OKX_A2A_AI_PROVIDER: ${provider}`
|
|
3174
|
+
message: isInstalled(provider, detection) ? `AI provider resolved from OKX_A2A_AI_PROVIDER: ${provider}` : `AI provider resolved from OKX_A2A_AI_PROVIDER: ${provider}; availability was not verified on PATH`
|
|
3169
3175
|
};
|
|
3170
3176
|
}
|
|
3171
3177
|
const stored = options.store.getDefaultAiProvider();
|
|
3172
|
-
if (stored && isInstalled(stored, detection)) {
|
|
3178
|
+
if (stored && (options.allowUnavailableProvider || isInstalled(stored, detection))) {
|
|
3173
3179
|
return {
|
|
3174
3180
|
provider: stored,
|
|
3175
3181
|
source: "stored",
|
|
3176
|
-
message: `default AI provider is ${stored}`
|
|
3182
|
+
message: isInstalled(stored, detection) ? `default AI provider is ${stored}` : `default AI provider is ${stored}; availability was not verified on PATH`
|
|
3177
3183
|
};
|
|
3178
3184
|
}
|
|
3179
3185
|
if (stored) {
|
|
@@ -3197,11 +3203,11 @@ async function ensureDefaultAiProvider(options) {
|
|
|
3197
3203
|
};
|
|
3198
3204
|
}
|
|
3199
3205
|
const current = detectCurrentAiProvider(env);
|
|
3200
|
-
if (current && isInstalled(current, detection)) {
|
|
3206
|
+
if (current && (options.allowUnavailableProvider || isInstalled(current, detection))) {
|
|
3201
3207
|
return {
|
|
3202
3208
|
provider: current,
|
|
3203
3209
|
source: "env",
|
|
3204
|
-
message: `AI provider resolved from current environment: ${current}`
|
|
3210
|
+
message: isInstalled(current, detection) ? `AI provider resolved from current environment: ${current}` : `AI provider resolved from current environment: ${current}; availability was not verified on PATH`
|
|
3205
3211
|
};
|
|
3206
3212
|
}
|
|
3207
3213
|
if (detection.available.length === 0) {
|
|
@@ -7846,7 +7852,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
7846
7852
|
client: {
|
|
7847
7853
|
id: "gateway-client",
|
|
7848
7854
|
displayName: "okx-a2a-node",
|
|
7849
|
-
version: "0.1.1
|
|
7855
|
+
version: "0.1.1",
|
|
7850
7856
|
platform: "node",
|
|
7851
7857
|
mode: "backend",
|
|
7852
7858
|
instanceId
|
|
@@ -7857,7 +7863,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
7857
7863
|
commands: [],
|
|
7858
7864
|
permissions: {},
|
|
7859
7865
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
7860
|
-
userAgent: `okx-a2a-node/${"0.1.1
|
|
7866
|
+
userAgent: `okx-a2a-node/${"0.1.1"}`,
|
|
7861
7867
|
auth: {
|
|
7862
7868
|
...config.token ? { token: config.token } : {},
|
|
7863
7869
|
...config.password ? { password: config.password } : {}
|
|
@@ -25076,7 +25082,7 @@ var init_sentry_config = __esm({
|
|
|
25076
25082
|
environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
25077
25083
|
SENTRY_CONFIG = {
|
|
25078
25084
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
25079
|
-
release: "0.1.1
|
|
25085
|
+
release: "0.1.1",
|
|
25080
25086
|
environment
|
|
25081
25087
|
};
|
|
25082
25088
|
}
|
|
@@ -93059,12 +93065,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
93059
93065
|
}));
|
|
93060
93066
|
}
|
|
93061
93067
|
});
|
|
93062
|
-
service.setPluginVersion("0.1.1
|
|
93068
|
+
service.setPluginVersion("0.1.1");
|
|
93063
93069
|
await service.init();
|
|
93064
93070
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
93065
93071
|
if (pluginVersionStatus.unavailable) {
|
|
93066
93072
|
throw new Error(
|
|
93067
|
-
`@okxweb3/a2a-node v${"0.1.1
|
|
93073
|
+
`@okxweb3/a2a-node v${"0.1.1"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
93068
93074
|
);
|
|
93069
93075
|
}
|
|
93070
93076
|
const systemConfig = service.getSystemConfig();
|
|
@@ -93082,7 +93088,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
93082
93088
|
onchainosAgentId: "*",
|
|
93083
93089
|
reason: "system-config missing sentryDsn",
|
|
93084
93090
|
pluginId: "@okxweb3/a2a-node",
|
|
93085
|
-
pluginVersion: "0.1.1
|
|
93091
|
+
pluginVersion: "0.1.1"
|
|
93086
93092
|
});
|
|
93087
93093
|
}
|
|
93088
93094
|
logWithTimestamp(
|
|
@@ -96006,11 +96012,11 @@ Commands:
|
|
|
96006
96012
|
update openclaw --release latest
|
|
96007
96013
|
Update an already installed OpenClaw plugin release, then refresh the plugin without restarting.
|
|
96008
96014
|
update openclaw --release latest --restart --yes
|
|
96009
|
-
Update and refresh an already installed OpenClaw plugin release, then restart OpenClaw gateway
|
|
96015
|
+
Update and refresh an already installed OpenClaw plugin release, then restart OpenClaw gateway.
|
|
96010
96016
|
update hermes --release latest
|
|
96011
96017
|
Update an already installed Hermes plugin release without restarting.
|
|
96012
96018
|
update hermes --release latest --restart --yes
|
|
96013
|
-
Update an already installed Hermes plugin release, then restart Hermes gateway
|
|
96019
|
+
Update an already installed Hermes plugin release, then restart Hermes gateway.
|
|
96014
96020
|
|
|
96015
96021
|
Use \`okx-a2a setup\` to detect a runtime and install missing plugins.
|
|
96016
96022
|
`);
|
|
@@ -96110,7 +96116,6 @@ async function handleUpdateCommand(args) {
|
|
|
96110
96116
|
await preflightGatewayUpdateRelease("openclaw", release);
|
|
96111
96117
|
await updateOpenClaw(release, { restart: false, deferRestart: restart, label: "update", allowGatewayRuntime: restart });
|
|
96112
96118
|
if (restart) {
|
|
96113
|
-
await restartNodeDaemonAfterGatewayUpdate(resolvedTarget);
|
|
96114
96119
|
await restartGatewayAfterUpdate(resolvedTarget);
|
|
96115
96120
|
}
|
|
96116
96121
|
warnIfProviderMismatch(resolvedTarget);
|
|
@@ -96120,7 +96125,6 @@ async function handleUpdateCommand(args) {
|
|
|
96120
96125
|
await preflightGatewayUpdateRelease("hermes", release);
|
|
96121
96126
|
await updateHermes(release, { restart: false, deferRestart: restart, label: "update", allowGatewayRuntime: restart });
|
|
96122
96127
|
if (restart) {
|
|
96123
|
-
await restartNodeDaemonAfterGatewayUpdate(resolvedTarget);
|
|
96124
96128
|
await restartGatewayAfterUpdate(resolvedTarget);
|
|
96125
96129
|
}
|
|
96126
96130
|
warnIfProviderMismatch(resolvedTarget);
|
|
@@ -96179,13 +96183,19 @@ async function runSetup(options) {
|
|
|
96179
96183
|
const releasePlan = await resolveSetupRelease(resolvedTarget, options);
|
|
96180
96184
|
console.log(`[setup] target: ${resolvedTarget}`);
|
|
96181
96185
|
if (resolvedTarget === "node") {
|
|
96182
|
-
|
|
96186
|
+
const nodeChange = await detectNodeSetupChange(releasePlan);
|
|
96187
|
+
console.log(`[setup] okx-a2a node CLI installedNode=${nodeChange.nodeVersion ?? "(not installed)"} desiredNode=${nodeChange.desiredNodeVersion}`);
|
|
96188
|
+
if (nodeChange.nodeChanged) {
|
|
96189
|
+
await installNode(releasePlan.nodeRelease, "setup");
|
|
96190
|
+
} else {
|
|
96191
|
+
console.log("[setup] okx-a2a node CLI is already up to date; restart skipped");
|
|
96192
|
+
}
|
|
96183
96193
|
const runtime = detectRuntime();
|
|
96184
96194
|
if (runtime === "codex" || runtime === "claude") {
|
|
96185
96195
|
switchDefaultProviderForSetup(runtime);
|
|
96186
96196
|
}
|
|
96187
|
-
if (runtime === "codex" || runtime === "claude") {
|
|
96188
|
-
await restartNodeDaemonAfterNodeSetup(
|
|
96197
|
+
if (nodeChange.nodeChanged && (runtime === "codex" || runtime === "claude")) {
|
|
96198
|
+
await restartNodeDaemonAfterNodeSetup();
|
|
96189
96199
|
}
|
|
96190
96200
|
return {
|
|
96191
96201
|
ok: true,
|
|
@@ -96259,6 +96269,15 @@ async function runSetup(options) {
|
|
|
96259
96269
|
userMessage: setupReadyMessage(resolvedTarget)
|
|
96260
96270
|
};
|
|
96261
96271
|
}
|
|
96272
|
+
async function detectNodeSetupChange(releasePlan) {
|
|
96273
|
+
const nodeVersion = await getCurrentNodeCliVersion();
|
|
96274
|
+
const desiredNodeVersion = await resolveRequiredNpmPackageVersion("node", releasePlan.nodeRelease);
|
|
96275
|
+
return {
|
|
96276
|
+
nodeVersion,
|
|
96277
|
+
desiredNodeVersion,
|
|
96278
|
+
nodeChanged: nodeVersion !== desiredNodeVersion
|
|
96279
|
+
};
|
|
96280
|
+
}
|
|
96262
96281
|
async function detectSetupChanges(target, releasePlan) {
|
|
96263
96282
|
const desiredGatewayVersion = await resolveRequiredNpmPackageVersion(target, releasePlan.gatewayRelease);
|
|
96264
96283
|
const nodeVersion = await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node);
|
|
@@ -96308,17 +96327,7 @@ function detectSetupTarget() {
|
|
|
96308
96327
|
if (configured === "openclaw" || configured === "hermes") {
|
|
96309
96328
|
return configured;
|
|
96310
96329
|
}
|
|
96311
|
-
|
|
96312
|
-
...commandExists("openclaw") ? ["openclaw"] : [],
|
|
96313
|
-
...commandExists("hermes") || (0, import_node_fs18.existsSync)((0, import_node_path22.join)(process.env.HERMES_HOME ?? (0, import_node_path22.join)((0, import_node_os9.homedir)(), ".hermes"))) ? ["hermes"] : []
|
|
96314
|
-
];
|
|
96315
|
-
if (gatewayProviders.length === 1) {
|
|
96316
|
-
return gatewayProviders[0];
|
|
96317
|
-
}
|
|
96318
|
-
if (gatewayProviders.length > 1) {
|
|
96319
|
-
throw new Error("setup detected both OpenClaw and Hermes. Run `okx-a2a setup openclaw` or `okx-a2a setup hermes`.");
|
|
96320
|
-
}
|
|
96321
|
-
throw new Error("setup could not detect OpenClaw or Hermes. Run `okx-a2a setup openclaw` or `okx-a2a setup hermes`.");
|
|
96330
|
+
throw new Error("setup could not detect OpenClaw or Hermes from the runtime environment. Run `okx-a2a setup openclaw` or `okx-a2a setup hermes`.");
|
|
96322
96331
|
}
|
|
96323
96332
|
function isSetupNeedsUserActionMessage(message) {
|
|
96324
96333
|
return message.includes("setup detected both OpenClaw and Hermes") || message.includes("setup could not detect OpenClaw or Hermes") || message.includes("Refusing to update openclaw from inside the openclaw gateway runtime") || message.includes("Refusing to update hermes from inside the hermes gateway runtime");
|
|
@@ -96367,7 +96376,7 @@ async function getCurrentNodeCliVersion() {
|
|
|
96367
96376
|
return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
|
|
96368
96377
|
}
|
|
96369
96378
|
function getBundledNodeCliVersion() {
|
|
96370
|
-
return true ? "0.1.1
|
|
96379
|
+
return true ? "0.1.1" : null;
|
|
96371
96380
|
}
|
|
96372
96381
|
function readConfiguredAiProvider() {
|
|
96373
96382
|
const explicit = process.env.OKX_AGENT_TASK_AI_CLI ?? process.env.OKX_A2A_AI_PROVIDER;
|
|
@@ -96406,13 +96415,9 @@ async function restartNodeDaemonAfterSetup(provider) {
|
|
|
96406
96415
|
console.log(`[setup] restarting okx-a2a daemon after node CLI setup with provider=${provider}`);
|
|
96407
96416
|
await runCommand("okx-a2a", ["daemon", "restart", "--provider", provider]);
|
|
96408
96417
|
}
|
|
96409
|
-
async function restartNodeDaemonAfterNodeSetup(
|
|
96410
|
-
console.log(
|
|
96411
|
-
await runCommand("okx-a2a", ["daemon", "restart"
|
|
96412
|
-
}
|
|
96413
|
-
async function restartNodeDaemonAfterGatewayUpdate(provider) {
|
|
96414
|
-
console.log(`[update] restarting okx-a2a daemon after gateway update with provider=${provider}`);
|
|
96415
|
-
await runCommand("okx-a2a", ["daemon", "restart", "--provider", provider]);
|
|
96418
|
+
async function restartNodeDaemonAfterNodeSetup() {
|
|
96419
|
+
console.log("[setup] restarting okx-a2a daemon after node CLI setup");
|
|
96420
|
+
await runCommand("okx-a2a", ["daemon", "restart"]);
|
|
96416
96421
|
}
|
|
96417
96422
|
async function restartGatewayAfterSetup(provider) {
|
|
96418
96423
|
if (provider === "hermes" && detectGatewayInvocation() === "hermes") {
|
|
@@ -97174,7 +97179,6 @@ var init_update_cli = __esm({
|
|
|
97174
97179
|
import_node_os9 = require("node:os");
|
|
97175
97180
|
import_node_path22 = require("node:path");
|
|
97176
97181
|
init_ai_provider();
|
|
97177
|
-
init_ai_command();
|
|
97178
97182
|
init_session_store();
|
|
97179
97183
|
UPDATE_PACKAGES = {
|
|
97180
97184
|
node: "@okxweb3/a2a-node",
|
|
@@ -97210,7 +97214,7 @@ init_sentry_logger();
|
|
|
97210
97214
|
init_sentry_config();
|
|
97211
97215
|
var CURRENT_GATEWAY_SESSION_KEYS_ENV3 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
|
|
97212
97216
|
function printUsage2() {
|
|
97213
|
-
console.log(`okx-a2a ${"0.1.1
|
|
97217
|
+
console.log(`okx-a2a ${"0.1.1"}
|
|
97214
97218
|
|
|
97215
97219
|
Usage:
|
|
97216
97220
|
okx-a2a <command> [options]
|
|
@@ -97247,7 +97251,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
|
|
|
97247
97251
|
`);
|
|
97248
97252
|
}
|
|
97249
97253
|
function printVersion() {
|
|
97250
|
-
console.log("0.1.1
|
|
97254
|
+
console.log("0.1.1");
|
|
97251
97255
|
}
|
|
97252
97256
|
function printDaemonUsage() {
|
|
97253
97257
|
console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
|
|
@@ -97455,11 +97459,11 @@ Commands:
|
|
|
97455
97459
|
update openclaw --release latest
|
|
97456
97460
|
Update an already installed OpenClaw plugin release, then refresh the plugin without restarting.
|
|
97457
97461
|
update openclaw --release latest --restart --yes
|
|
97458
|
-
Update and refresh an already installed OpenClaw plugin release, then restart OpenClaw gateway
|
|
97462
|
+
Update and refresh an already installed OpenClaw plugin release, then restart OpenClaw gateway.
|
|
97459
97463
|
update hermes --release latest
|
|
97460
97464
|
Update an already installed Hermes plugin release without restarting.
|
|
97461
97465
|
update hermes --release latest --restart --yes
|
|
97462
|
-
Update an already installed Hermes plugin release, then restart Hermes gateway
|
|
97466
|
+
Update an already installed Hermes plugin release, then restart Hermes gateway.
|
|
97463
97467
|
|
|
97464
97468
|
Use \`okx-a2a setup\` to detect a runtime and install missing plugins.
|
|
97465
97469
|
`);
|
|
@@ -97961,7 +97965,7 @@ async function assertDaemonRunningForQueuedCommand2(commandName) {
|
|
|
97961
97965
|
throw err2;
|
|
97962
97966
|
}
|
|
97963
97967
|
}
|
|
97964
|
-
async function configureDefaultAiProviderForLifecycle(args) {
|
|
97968
|
+
async function configureDefaultAiProviderForLifecycle(args, options = {}) {
|
|
97965
97969
|
const store = new SessionStore();
|
|
97966
97970
|
try {
|
|
97967
97971
|
const provider = await ensureDefaultAiProvider({
|
|
@@ -97970,13 +97974,29 @@ async function configureDefaultAiProviderForLifecycle(args) {
|
|
|
97970
97974
|
stdin: process.stdin,
|
|
97971
97975
|
stdout: process.stdout,
|
|
97972
97976
|
stderr: process.stderr,
|
|
97973
|
-
promptIfMissing: true
|
|
97977
|
+
promptIfMissing: options.promptIfMissing ?? true,
|
|
97978
|
+
allowUnavailableProvider: options.allowUnavailableProvider
|
|
97974
97979
|
});
|
|
97975
97980
|
console.log(provider.message);
|
|
97976
97981
|
} finally {
|
|
97977
97982
|
store.close();
|
|
97978
97983
|
}
|
|
97979
97984
|
}
|
|
97985
|
+
async function configureDefaultAiProviderForAutostartRestart(args) {
|
|
97986
|
+
const requestedProvider = readLifecycleProviderOption(args);
|
|
97987
|
+
try {
|
|
97988
|
+
await configureDefaultAiProviderForLifecycle(args, {
|
|
97989
|
+
allowUnavailableProvider: true,
|
|
97990
|
+
promptIfMissing: false
|
|
97991
|
+
});
|
|
97992
|
+
} catch (err2) {
|
|
97993
|
+
if (requestedProvider) {
|
|
97994
|
+
throw err2;
|
|
97995
|
+
}
|
|
97996
|
+
const message = err2 instanceof Error ? err2.message : String(err2);
|
|
97997
|
+
console.warn(`AI provider configuration skipped before restart: ${message}`);
|
|
97998
|
+
}
|
|
97999
|
+
}
|
|
97980
98000
|
async function handleStart(args) {
|
|
97981
98001
|
await configureDefaultAiProviderForLifecycle(args);
|
|
97982
98002
|
if (shouldInstallAutostart(args)) {
|
|
@@ -98009,13 +98029,21 @@ async function handleStart(args) {
|
|
|
98009
98029
|
}
|
|
98010
98030
|
}
|
|
98011
98031
|
async function handleRestart(args) {
|
|
98012
|
-
|
|
98032
|
+
let autostartApi = null;
|
|
98013
98033
|
let autostartInstalled = false;
|
|
98014
98034
|
try {
|
|
98015
|
-
|
|
98016
|
-
autostartInstalled =
|
|
98035
|
+
autostartApi = await Promise.resolve().then(() => (init_autostart(), autostart_exports));
|
|
98036
|
+
autostartInstalled = autostartApi.isAutostartInstalled();
|
|
98017
98037
|
if (autostartInstalled) {
|
|
98018
|
-
|
|
98038
|
+
await configureDefaultAiProviderForAutostartRestart(args);
|
|
98039
|
+
const stopResult2 = await stopDaemon();
|
|
98040
|
+
if (stopResult2.stopped || stopResult2.running) {
|
|
98041
|
+
printStopDaemonResult(stopResult2);
|
|
98042
|
+
}
|
|
98043
|
+
if (stopResult2.running) {
|
|
98044
|
+
throw new Error(`existing daemon pid=${stopResult2.pid} did not stop; refusing to start a second daemon`);
|
|
98045
|
+
}
|
|
98046
|
+
const autostart = await autostartApi.restartAutostart();
|
|
98019
98047
|
if (!autostart.restarted) {
|
|
98020
98048
|
throw new Error(autostart.message || "autostart service did not restart");
|
|
98021
98049
|
}
|
|
@@ -98029,6 +98057,7 @@ async function handleRestart(args) {
|
|
|
98029
98057
|
}
|
|
98030
98058
|
autostartInstalled = false;
|
|
98031
98059
|
}
|
|
98060
|
+
await configureDefaultAiProviderForLifecycle(args);
|
|
98032
98061
|
const stopResult = await stopDaemon();
|
|
98033
98062
|
if (stopResult.stopped || stopResult.running) {
|
|
98034
98063
|
printStopDaemonResult(stopResult);
|
|
@@ -98037,14 +98066,14 @@ async function handleRestart(args) {
|
|
|
98037
98066
|
return;
|
|
98038
98067
|
}
|
|
98039
98068
|
try {
|
|
98040
|
-
|
|
98041
|
-
autostartInstalled = autostartInstalled ||
|
|
98042
|
-
const autostart = await
|
|
98069
|
+
autostartApi = autostartApi ?? await Promise.resolve().then(() => (init_autostart(), autostart_exports));
|
|
98070
|
+
autostartInstalled = autostartInstalled || autostartApi.isAutostartInstalled();
|
|
98071
|
+
const autostart = await autostartApi.restartAutostart();
|
|
98043
98072
|
if (autostart.restarted) {
|
|
98044
98073
|
console.log(`restarted ${autostart.platform} autostart service ${autostart.path}`);
|
|
98045
98074
|
return;
|
|
98046
98075
|
}
|
|
98047
|
-
const installed = await
|
|
98076
|
+
const installed = await autostartApi.installAutostart();
|
|
98048
98077
|
console.log(`installed ${installed.platform} autostart ${installed.path}`);
|
|
98049
98078
|
const status = await getDaemonStatus();
|
|
98050
98079
|
if (status.running) {
|
package/dist/index.js
CHANGED
|
@@ -70739,12 +70739,14 @@ async function ensureDefaultAiProvider(options) {
|
|
|
70739
70739
|
const detection = detectAiProviders(commandExists2, env);
|
|
70740
70740
|
if (options.requestedProvider) {
|
|
70741
70741
|
const provider = normalizeAiProvider(options.requestedProvider);
|
|
70742
|
-
|
|
70742
|
+
if (!options.allowUnavailableProvider) {
|
|
70743
|
+
assertInstalled(provider, detection);
|
|
70744
|
+
}
|
|
70743
70745
|
options.store.setDefaultAiProvider(provider);
|
|
70744
70746
|
return {
|
|
70745
70747
|
provider,
|
|
70746
70748
|
source: "requested",
|
|
70747
|
-
message: `default AI provider set to ${provider}`
|
|
70749
|
+
message: isInstalled(provider, detection) ? `default AI provider set to ${provider}` : `default AI provider set to ${provider}; availability was not verified on PATH`
|
|
70748
70750
|
};
|
|
70749
70751
|
}
|
|
70750
70752
|
if (options.forcePrompt) {
|
|
@@ -70763,29 +70765,33 @@ async function ensureDefaultAiProvider(options) {
|
|
|
70763
70765
|
}
|
|
70764
70766
|
if (env.OKX_AGENT_TASK_AI_CLI) {
|
|
70765
70767
|
const provider = normalizeAiProvider(env.OKX_AGENT_TASK_AI_CLI);
|
|
70766
|
-
|
|
70768
|
+
if (!options.allowUnavailableProvider) {
|
|
70769
|
+
assertInstalled(provider, detection);
|
|
70770
|
+
}
|
|
70767
70771
|
options.store.setDefaultAiProvider(provider);
|
|
70768
70772
|
return {
|
|
70769
70773
|
provider,
|
|
70770
70774
|
source: "env",
|
|
70771
|
-
message: `default AI provider set to ${provider} from OKX_AGENT_TASK_AI_CLI`
|
|
70775
|
+
message: isInstalled(provider, detection) ? `default AI provider set to ${provider} from OKX_AGENT_TASK_AI_CLI` : `default AI provider set to ${provider} from OKX_AGENT_TASK_AI_CLI; availability was not verified on PATH`
|
|
70772
70776
|
};
|
|
70773
70777
|
}
|
|
70774
70778
|
if (env.OKX_A2A_AI_PROVIDER) {
|
|
70775
70779
|
const provider = normalizeAiProvider(env.OKX_A2A_AI_PROVIDER);
|
|
70776
|
-
|
|
70780
|
+
if (!options.allowUnavailableProvider) {
|
|
70781
|
+
assertInstalled(provider, detection);
|
|
70782
|
+
}
|
|
70777
70783
|
return {
|
|
70778
70784
|
provider,
|
|
70779
70785
|
source: "env",
|
|
70780
|
-
message: `AI provider resolved from OKX_A2A_AI_PROVIDER: ${provider}`
|
|
70786
|
+
message: isInstalled(provider, detection) ? `AI provider resolved from OKX_A2A_AI_PROVIDER: ${provider}` : `AI provider resolved from OKX_A2A_AI_PROVIDER: ${provider}; availability was not verified on PATH`
|
|
70781
70787
|
};
|
|
70782
70788
|
}
|
|
70783
70789
|
const stored = options.store.getDefaultAiProvider();
|
|
70784
|
-
if (stored && isInstalled(stored, detection)) {
|
|
70790
|
+
if (stored && (options.allowUnavailableProvider || isInstalled(stored, detection))) {
|
|
70785
70791
|
return {
|
|
70786
70792
|
provider: stored,
|
|
70787
70793
|
source: "stored",
|
|
70788
|
-
message: `default AI provider is ${stored}`
|
|
70794
|
+
message: isInstalled(stored, detection) ? `default AI provider is ${stored}` : `default AI provider is ${stored}; availability was not verified on PATH`
|
|
70789
70795
|
};
|
|
70790
70796
|
}
|
|
70791
70797
|
if (stored) {
|
|
@@ -70809,11 +70815,11 @@ async function ensureDefaultAiProvider(options) {
|
|
|
70809
70815
|
};
|
|
70810
70816
|
}
|
|
70811
70817
|
const current = detectCurrentAiProvider(env);
|
|
70812
|
-
if (current && isInstalled(current, detection)) {
|
|
70818
|
+
if (current && (options.allowUnavailableProvider || isInstalled(current, detection))) {
|
|
70813
70819
|
return {
|
|
70814
70820
|
provider: current,
|
|
70815
70821
|
source: "env",
|
|
70816
|
-
message: `AI provider resolved from current environment: ${current}`
|
|
70822
|
+
message: isInstalled(current, detection) ? `AI provider resolved from current environment: ${current}` : `AI provider resolved from current environment: ${current}; availability was not verified on PATH`
|
|
70817
70823
|
};
|
|
70818
70824
|
}
|
|
70819
70825
|
if (detection.available.length === 0) {
|
|
@@ -86718,7 +86724,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
86718
86724
|
client: {
|
|
86719
86725
|
id: "gateway-client",
|
|
86720
86726
|
displayName: "okx-a2a-node",
|
|
86721
|
-
version: "0.1.1
|
|
86727
|
+
version: "0.1.1",
|
|
86722
86728
|
platform: "node",
|
|
86723
86729
|
mode: "backend",
|
|
86724
86730
|
instanceId
|
|
@@ -86729,7 +86735,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
|
|
|
86729
86735
|
commands: [],
|
|
86730
86736
|
permissions: {},
|
|
86731
86737
|
locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
|
|
86732
|
-
userAgent: `okx-a2a-node/${"0.1.1
|
|
86738
|
+
userAgent: `okx-a2a-node/${"0.1.1"}`,
|
|
86733
86739
|
auth: {
|
|
86734
86740
|
...config.token ? { token: config.token } : {},
|
|
86735
86741
|
...config.password ? { password: config.password } : {}
|
|
@@ -91148,7 +91154,7 @@ function userWatchEventDeliveredSentryExtra(event) {
|
|
|
91148
91154
|
var environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
|
|
91149
91155
|
var SENTRY_CONFIG = {
|
|
91150
91156
|
projectName: "okx/openclaw-okx-a2a-extension",
|
|
91151
|
-
release: "0.1.1
|
|
91157
|
+
release: "0.1.1",
|
|
91152
91158
|
environment
|
|
91153
91159
|
};
|
|
91154
91160
|
|
|
@@ -91375,12 +91381,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
91375
91381
|
}));
|
|
91376
91382
|
}
|
|
91377
91383
|
});
|
|
91378
|
-
service.setPluginVersion("0.1.1
|
|
91384
|
+
service.setPluginVersion("0.1.1");
|
|
91379
91385
|
await service.init();
|
|
91380
91386
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
91381
91387
|
if (pluginVersionStatus.unavailable) {
|
|
91382
91388
|
throw new Error(
|
|
91383
|
-
`@okxweb3/a2a-node v${"0.1.1
|
|
91389
|
+
`@okxweb3/a2a-node v${"0.1.1"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
91384
91390
|
);
|
|
91385
91391
|
}
|
|
91386
91392
|
const systemConfig = service.getSystemConfig();
|
|
@@ -91398,7 +91404,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
91398
91404
|
onchainosAgentId: "*",
|
|
91399
91405
|
reason: "system-config missing sentryDsn",
|
|
91400
91406
|
pluginId: "@okxweb3/a2a-node",
|
|
91401
|
-
pluginVersion: "0.1.1
|
|
91407
|
+
pluginVersion: "0.1.1"
|
|
91402
91408
|
});
|
|
91403
91409
|
}
|
|
91404
91410
|
logWithTimestamp(
|
package/package.json
CHANGED