@okxweb3/a2a-node 0.1.0 → 0.1.1-beta-b61454118d-260630145950
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 +102 -31
- package/dist/index.js +23 -17
- 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.
|
|
7855
|
+
version: "0.1.1-beta-b61454118d-260630145950",
|
|
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.
|
|
7866
|
+
userAgent: `okx-a2a-node/${"0.1.1-beta-b61454118d-260630145950"}`,
|
|
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.
|
|
25085
|
+
release: "0.1.1-beta-b61454118d-260630145950",
|
|
25080
25086
|
environment
|
|
25081
25087
|
};
|
|
25082
25088
|
}
|
|
@@ -25091,6 +25097,7 @@ __export(autostart_exports, {
|
|
|
25091
25097
|
installAutostart: () => installAutostart,
|
|
25092
25098
|
installLaunchdAutostart: () => installLaunchdAutostart,
|
|
25093
25099
|
installSystemdAutostart: () => installSystemdAutostart,
|
|
25100
|
+
isAutostartInstalled: () => isAutostartInstalled,
|
|
25094
25101
|
printLaunchdPlist: () => printLaunchdPlist,
|
|
25095
25102
|
printSystemdAutostartUnit: () => printSystemdAutostartUnit,
|
|
25096
25103
|
resolveLaunchdAutostartPaths: () => resolveLaunchdAutostartPaths,
|
|
@@ -25378,6 +25385,15 @@ async function restartAutostart() {
|
|
|
25378
25385
|
}
|
|
25379
25386
|
throw new Error(`autostart is not supported on ${process.platform}`);
|
|
25380
25387
|
}
|
|
25388
|
+
function isAutostartInstalled() {
|
|
25389
|
+
if (process.platform === "linux") {
|
|
25390
|
+
return (0, import_node_fs10.existsSync)(resolveSystemdAutostartPaths().servicePath);
|
|
25391
|
+
}
|
|
25392
|
+
if (process.platform === "darwin") {
|
|
25393
|
+
return (0, import_node_fs10.existsSync)(resolveLaunchdAutostartPaths().plistPath);
|
|
25394
|
+
}
|
|
25395
|
+
return false;
|
|
25396
|
+
}
|
|
25381
25397
|
function autostartStatus() {
|
|
25382
25398
|
if (process.platform === "linux") {
|
|
25383
25399
|
return printSystemdAutostartUnit();
|
|
@@ -92865,7 +92881,7 @@ async function isGatewayAvailableForHeartbeat(options) {
|
|
|
92865
92881
|
}
|
|
92866
92882
|
async function isHermesGatewayPluginEnabled(options = {}) {
|
|
92867
92883
|
const env = options.env ?? process.env;
|
|
92868
|
-
if (detectGatewayInvocation(env) !== "hermes") {
|
|
92884
|
+
if (options.requireGatewayRuntime && detectGatewayInvocation(env) !== "hermes") {
|
|
92869
92885
|
return false;
|
|
92870
92886
|
}
|
|
92871
92887
|
const hermesHome = env.HERMES_HOME?.trim() || (0, import_node_path19.join)((0, import_node_os7.homedir)(), ".hermes");
|
|
@@ -93049,12 +93065,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
93049
93065
|
}));
|
|
93050
93066
|
}
|
|
93051
93067
|
});
|
|
93052
|
-
service.setPluginVersion("0.1.
|
|
93068
|
+
service.setPluginVersion("0.1.1-beta-b61454118d-260630145950");
|
|
93053
93069
|
await service.init();
|
|
93054
93070
|
const pluginVersionStatus = service.pluginVersionStatus;
|
|
93055
93071
|
if (pluginVersionStatus.unavailable) {
|
|
93056
93072
|
throw new Error(
|
|
93057
|
-
`@okxweb3/a2a-node v${"0.1.
|
|
93073
|
+
`@okxweb3/a2a-node v${"0.1.1-beta-b61454118d-260630145950"} is below the required minimum v${pluginVersionStatus.minVersion}`
|
|
93058
93074
|
);
|
|
93059
93075
|
}
|
|
93060
93076
|
const systemConfig = service.getSystemConfig();
|
|
@@ -93072,7 +93088,7 @@ async function runListenerWithLock(options, paths) {
|
|
|
93072
93088
|
onchainosAgentId: "*",
|
|
93073
93089
|
reason: "system-config missing sentryDsn",
|
|
93074
93090
|
pluginId: "@okxweb3/a2a-node",
|
|
93075
|
-
pluginVersion: "0.1.
|
|
93091
|
+
pluginVersion: "0.1.1-beta-b61454118d-260630145950"
|
|
93076
93092
|
});
|
|
93077
93093
|
}
|
|
93078
93094
|
logWithTimestamp(
|
|
@@ -96186,7 +96202,7 @@ async function runSetup(options) {
|
|
|
96186
96202
|
};
|
|
96187
96203
|
}
|
|
96188
96204
|
const changes = await detectSetupChanges(resolvedTarget, releasePlan);
|
|
96189
|
-
|
|
96205
|
+
switchDefaultProviderForSetup(resolvedTarget);
|
|
96190
96206
|
logSetupChangeState(resolvedTarget, changes);
|
|
96191
96207
|
if (resolvedTarget === "openclaw") {
|
|
96192
96208
|
const pluginAlreadyInstalled2 = await isGatewayPluginInstalled("openclaw");
|
|
@@ -96203,7 +96219,7 @@ async function runSetup(options) {
|
|
|
96203
96219
|
if (changes.pluginChanged) {
|
|
96204
96220
|
await updateOpenClaw(releasePlan.gatewayRelease, { restart: false, deferRestart: true, label: "setup", allowGatewayRuntime: true });
|
|
96205
96221
|
}
|
|
96206
|
-
if (changes.nodeChanged
|
|
96222
|
+
if (changes.nodeChanged) {
|
|
96207
96223
|
await restartNodeDaemonAfterSetup(resolvedTarget);
|
|
96208
96224
|
}
|
|
96209
96225
|
if (changes.pluginChanged) {
|
|
@@ -96234,9 +96250,7 @@ async function runSetup(options) {
|
|
|
96234
96250
|
if (changes.pluginChanged) {
|
|
96235
96251
|
await updateHermes(releasePlan.gatewayRelease, { restart: false, deferRestart: true, label: "setup", allowGatewayRuntime: true });
|
|
96236
96252
|
}
|
|
96237
|
-
if (changes.nodeChanged
|
|
96238
|
-
await restartNodeDaemonAfterSetup(resolvedTarget);
|
|
96239
|
-
} else if (changes.configChanged) {
|
|
96253
|
+
if (changes.nodeChanged) {
|
|
96240
96254
|
await restartNodeDaemonAfterSetup(resolvedTarget);
|
|
96241
96255
|
}
|
|
96242
96256
|
if (changes.pluginChanged || changes.configChanged) {
|
|
@@ -96359,7 +96373,7 @@ async function getCurrentNodeCliVersion() {
|
|
|
96359
96373
|
return await getGlobalNpmPackageVersion(UPDATE_PACKAGES.node) ?? getBundledNodeCliVersion();
|
|
96360
96374
|
}
|
|
96361
96375
|
function getBundledNodeCliVersion() {
|
|
96362
|
-
return true ? "0.1.
|
|
96376
|
+
return true ? "0.1.1-beta-b61454118d-260630145950" : null;
|
|
96363
96377
|
}
|
|
96364
96378
|
function readConfiguredAiProvider() {
|
|
96365
96379
|
const explicit = process.env.OKX_AGENT_TASK_AI_CLI ?? process.env.OKX_A2A_AI_PROVIDER;
|
|
@@ -97202,7 +97216,7 @@ init_sentry_logger();
|
|
|
97202
97216
|
init_sentry_config();
|
|
97203
97217
|
var CURRENT_GATEWAY_SESSION_KEYS_ENV3 = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
|
|
97204
97218
|
function printUsage2() {
|
|
97205
|
-
console.log(`okx-a2a ${"0.1.
|
|
97219
|
+
console.log(`okx-a2a ${"0.1.1-beta-b61454118d-260630145950"}
|
|
97206
97220
|
|
|
97207
97221
|
Usage:
|
|
97208
97222
|
okx-a2a <command> [options]
|
|
@@ -97239,7 +97253,7 @@ Run \`okx-a2a <command> -h\` for command-specific help.
|
|
|
97239
97253
|
`);
|
|
97240
97254
|
}
|
|
97241
97255
|
function printVersion() {
|
|
97242
|
-
console.log("0.1.
|
|
97256
|
+
console.log("0.1.1-beta-b61454118d-260630145950");
|
|
97243
97257
|
}
|
|
97244
97258
|
function printDaemonUsage() {
|
|
97245
97259
|
console.log(`Usage: okx-a2a daemon <start|restart|stop|status|autostart> [options]
|
|
@@ -97953,7 +97967,7 @@ async function assertDaemonRunningForQueuedCommand2(commandName) {
|
|
|
97953
97967
|
throw err2;
|
|
97954
97968
|
}
|
|
97955
97969
|
}
|
|
97956
|
-
async function configureDefaultAiProviderForLifecycle(args) {
|
|
97970
|
+
async function configureDefaultAiProviderForLifecycle(args, options = {}) {
|
|
97957
97971
|
const store = new SessionStore();
|
|
97958
97972
|
try {
|
|
97959
97973
|
const provider = await ensureDefaultAiProvider({
|
|
@@ -97962,18 +97976,36 @@ async function configureDefaultAiProviderForLifecycle(args) {
|
|
|
97962
97976
|
stdin: process.stdin,
|
|
97963
97977
|
stdout: process.stdout,
|
|
97964
97978
|
stderr: process.stderr,
|
|
97965
|
-
promptIfMissing: true
|
|
97979
|
+
promptIfMissing: options.promptIfMissing ?? true,
|
|
97980
|
+
allowUnavailableProvider: options.allowUnavailableProvider
|
|
97966
97981
|
});
|
|
97967
97982
|
console.log(provider.message);
|
|
97968
97983
|
} finally {
|
|
97969
97984
|
store.close();
|
|
97970
97985
|
}
|
|
97971
97986
|
}
|
|
97987
|
+
async function configureDefaultAiProviderForAutostartRestart(args) {
|
|
97988
|
+
const requestedProvider = readLifecycleProviderOption(args);
|
|
97989
|
+
try {
|
|
97990
|
+
await configureDefaultAiProviderForLifecycle(args, {
|
|
97991
|
+
allowUnavailableProvider: true,
|
|
97992
|
+
promptIfMissing: false
|
|
97993
|
+
});
|
|
97994
|
+
} catch (err2) {
|
|
97995
|
+
if (requestedProvider) {
|
|
97996
|
+
throw err2;
|
|
97997
|
+
}
|
|
97998
|
+
const message = err2 instanceof Error ? err2.message : String(err2);
|
|
97999
|
+
console.warn(`AI provider configuration skipped before restart: ${message}`);
|
|
98000
|
+
}
|
|
98001
|
+
}
|
|
97972
98002
|
async function handleStart(args) {
|
|
97973
98003
|
await configureDefaultAiProviderForLifecycle(args);
|
|
97974
98004
|
if (shouldInstallAutostart(args)) {
|
|
98005
|
+
let autostartInstalled = false;
|
|
97975
98006
|
try {
|
|
97976
|
-
const { installAutostart: installAutostart2 } = await Promise.resolve().then(() => (init_autostart(), autostart_exports));
|
|
98007
|
+
const { installAutostart: installAutostart2, isAutostartInstalled: isAutostartInstalled2 } = await Promise.resolve().then(() => (init_autostart(), autostart_exports));
|
|
98008
|
+
autostartInstalled = isAutostartInstalled2();
|
|
97977
98009
|
const result2 = await installAutostart2();
|
|
97978
98010
|
console.log(`installed ${result2.platform} autostart ${result2.path}`);
|
|
97979
98011
|
const status = await getDaemonStatus();
|
|
@@ -97983,6 +98015,11 @@ async function handleStart(args) {
|
|
|
97983
98015
|
return;
|
|
97984
98016
|
} catch (err2) {
|
|
97985
98017
|
const message = err2 instanceof Error ? err2.message : String(err2);
|
|
98018
|
+
if (autostartInstalled) {
|
|
98019
|
+
throw new Error(
|
|
98020
|
+
`autostart install failed while an autostart service is already installed; refusing to start a second manual daemon. ${message}`
|
|
98021
|
+
);
|
|
98022
|
+
}
|
|
97986
98023
|
console.warn(`autostart install failed; starting without autostart: ${message}`);
|
|
97987
98024
|
}
|
|
97988
98025
|
}
|
|
@@ -97994,6 +98031,34 @@ async function handleStart(args) {
|
|
|
97994
98031
|
}
|
|
97995
98032
|
}
|
|
97996
98033
|
async function handleRestart(args) {
|
|
98034
|
+
let autostartApi = null;
|
|
98035
|
+
let autostartInstalled = false;
|
|
98036
|
+
try {
|
|
98037
|
+
autostartApi = await Promise.resolve().then(() => (init_autostart(), autostart_exports));
|
|
98038
|
+
autostartInstalled = autostartApi.isAutostartInstalled();
|
|
98039
|
+
if (autostartInstalled) {
|
|
98040
|
+
await configureDefaultAiProviderForAutostartRestart(args);
|
|
98041
|
+
const stopResult2 = await stopDaemon();
|
|
98042
|
+
if (stopResult2.stopped || stopResult2.running) {
|
|
98043
|
+
printStopDaemonResult(stopResult2);
|
|
98044
|
+
}
|
|
98045
|
+
if (stopResult2.running) {
|
|
98046
|
+
throw new Error(`existing daemon pid=${stopResult2.pid} did not stop; refusing to start a second daemon`);
|
|
98047
|
+
}
|
|
98048
|
+
const autostart = await autostartApi.restartAutostart();
|
|
98049
|
+
if (!autostart.restarted) {
|
|
98050
|
+
throw new Error(autostart.message || "autostart service did not restart");
|
|
98051
|
+
}
|
|
98052
|
+
console.log(`restarted ${autostart.platform} autostart service ${autostart.path}`);
|
|
98053
|
+
return;
|
|
98054
|
+
}
|
|
98055
|
+
} catch (err2) {
|
|
98056
|
+
const message = err2 instanceof Error ? err2.message : String(err2);
|
|
98057
|
+
if (autostartInstalled) {
|
|
98058
|
+
throw new Error(`autostart restart failed; refusing to start a second manual daemon. ${message}`);
|
|
98059
|
+
}
|
|
98060
|
+
autostartInstalled = false;
|
|
98061
|
+
}
|
|
97997
98062
|
await configureDefaultAiProviderForLifecycle(args);
|
|
97998
98063
|
const stopResult = await stopDaemon();
|
|
97999
98064
|
if (stopResult.stopped || stopResult.running) {
|
|
@@ -98003,13 +98068,14 @@ async function handleRestart(args) {
|
|
|
98003
98068
|
return;
|
|
98004
98069
|
}
|
|
98005
98070
|
try {
|
|
98006
|
-
|
|
98007
|
-
|
|
98071
|
+
autostartApi = autostartApi ?? await Promise.resolve().then(() => (init_autostart(), autostart_exports));
|
|
98072
|
+
autostartInstalled = autostartInstalled || autostartApi.isAutostartInstalled();
|
|
98073
|
+
const autostart = await autostartApi.restartAutostart();
|
|
98008
98074
|
if (autostart.restarted) {
|
|
98009
98075
|
console.log(`restarted ${autostart.platform} autostart service ${autostart.path}`);
|
|
98010
98076
|
return;
|
|
98011
98077
|
}
|
|
98012
|
-
const installed = await
|
|
98078
|
+
const installed = await autostartApi.installAutostart();
|
|
98013
98079
|
console.log(`installed ${installed.platform} autostart ${installed.path}`);
|
|
98014
98080
|
const status = await getDaemonStatus();
|
|
98015
98081
|
if (status.running) {
|
|
@@ -98018,6 +98084,11 @@ async function handleRestart(args) {
|
|
|
98018
98084
|
return;
|
|
98019
98085
|
} catch (err2) {
|
|
98020
98086
|
const message = err2 instanceof Error ? err2.message : String(err2);
|
|
98087
|
+
if (autostartInstalled) {
|
|
98088
|
+
throw new Error(
|
|
98089
|
+
`autostart restart failed while an autostart service is installed; refusing to start a second manual daemon. ${message}`
|
|
98090
|
+
);
|
|
98091
|
+
}
|
|
98021
98092
|
console.warn(`autostart restart skipped: ${message}`);
|
|
98022
98093
|
}
|
|
98023
98094
|
const startResult = await startDaemon();
|
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.
|
|
86727
|
+
version: "0.1.1-beta-b61454118d-260630145950",
|
|
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.
|
|
86738
|
+
userAgent: `okx-a2a-node/${"0.1.1-beta-b61454118d-260630145950"}`,
|
|
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.
|
|
91157
|
+
release: "0.1.1-beta-b61454118d-260630145950",
|
|
91152
91158
|
environment
|
|
91153
91159
|
};
|
|
91154
91160
|
|
|
@@ -91190,7 +91196,7 @@ async function isGatewayAvailableForHeartbeat(options) {
|
|
|
91190
91196
|
}
|
|
91191
91197
|
async function isHermesGatewayPluginEnabled(options = {}) {
|
|
91192
91198
|
const env = options.env ?? process.env;
|
|
91193
|
-
if (detectGatewayInvocation(env) !== "hermes") {
|
|
91199
|
+
if (options.requireGatewayRuntime && detectGatewayInvocation(env) !== "hermes") {
|
|
91194
91200
|
return false;
|
|
91195
91201
|
}
|
|
91196
91202
|
const hermesHome = env.HERMES_HOME?.trim() || (0, import_node_path18.join)((0, import_node_os6.homedir)(), ".hermes");
|
|
@@ -91375,12 +91381,12 @@ async function runListenerWithLock(options, paths) {
|
|
|
91375
91381
|
}));
|
|
91376
91382
|
}
|
|
91377
91383
|
});
|
|
91378
|
-
service.setPluginVersion("0.1.
|
|
91384
|
+
service.setPluginVersion("0.1.1-beta-b61454118d-260630145950");
|
|
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.
|
|
91389
|
+
`@okxweb3/a2a-node v${"0.1.1-beta-b61454118d-260630145950"} 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.
|
|
91407
|
+
pluginVersion: "0.1.1-beta-b61454118d-260630145950"
|
|
91402
91408
|
});
|
|
91403
91409
|
}
|
|
91404
91410
|
logWithTimestamp(
|
package/package.json
CHANGED