@evident-ai/cli 3.6.1-dev.4831868 → 3.6.1-dev.69de1a0
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/index.js +45 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1332,8 +1332,29 @@ var NATIVE_PROVIDERS = {
|
|
|
1332
1332
|
name: "Evident Kimi credential proxy",
|
|
1333
1333
|
npm: "@ai-sdk/openai-compatible",
|
|
1334
1334
|
sdkName: "evident-kimi"
|
|
1335
|
+
},
|
|
1336
|
+
antigravity: {
|
|
1337
|
+
namespace: "evident-antigravity",
|
|
1338
|
+
name: "Evident Antigravity credential proxy",
|
|
1339
|
+
npm: "@ai-sdk/openai-compatible",
|
|
1340
|
+
sdkName: "evident-antigravity"
|
|
1341
|
+
},
|
|
1342
|
+
xai: {
|
|
1343
|
+
namespace: "evident-xai",
|
|
1344
|
+
name: "Evident xAI credential proxy",
|
|
1345
|
+
npm: "@ai-sdk/openai-compatible",
|
|
1346
|
+
sdkName: "evident-xai"
|
|
1347
|
+
},
|
|
1348
|
+
mistral: {
|
|
1349
|
+
namespace: "evident-mistral",
|
|
1350
|
+
name: "Evident Mistral credential proxy",
|
|
1351
|
+
npm: "@ai-sdk/openai-compatible",
|
|
1352
|
+
sdkName: "evident-mistral"
|
|
1335
1353
|
}
|
|
1336
1354
|
};
|
|
1355
|
+
var CREDENTIAL_PROXY_NATIVE_NAMESPACES = [
|
|
1356
|
+
...new Set(Object.values(NATIVE_PROVIDERS).map(({ namespace }) => namespace))
|
|
1357
|
+
];
|
|
1337
1358
|
function credentialProxyInferenceUrl(baseUrl) {
|
|
1338
1359
|
const trimmed = baseUrl.trim().replace(/\/+$/, "");
|
|
1339
1360
|
return /\/v1$/i.test(trimmed) ? trimmed : `${trimmed}/v1`;
|
|
@@ -1421,7 +1442,7 @@ import ora4 from "ora";
|
|
|
1421
1442
|
import { select as select4 } from "@inquirer/prompts";
|
|
1422
1443
|
|
|
1423
1444
|
// src/lib/telemetry.ts
|
|
1424
|
-
var CLI_VERSION = (true ? "3.6.1-dev.
|
|
1445
|
+
var CLI_VERSION = (true ? "3.6.1-dev.69de1a0" : void 0) ?? process.env.npm_package_version ?? "unknown";
|
|
1425
1446
|
function getCliVersion() {
|
|
1426
1447
|
return CLI_VERSION;
|
|
1427
1448
|
}
|
|
@@ -5600,7 +5621,11 @@ function isSessionDbProvenanceRecord(value) {
|
|
|
5600
5621
|
var OPENCODE2_PACKAGE_SPEC = "@opencode-ai/cli@0.0.0-beta-17823";
|
|
5601
5622
|
|
|
5602
5623
|
// src/lib/opencode/opencode-version-gate.ts
|
|
5603
|
-
var QUEUE_VALIDATED_OPENCODE_VERSIONS = [
|
|
5624
|
+
var QUEUE_VALIDATED_OPENCODE_VERSIONS = [
|
|
5625
|
+
"1.17.11",
|
|
5626
|
+
"1.18.3",
|
|
5627
|
+
"1.18.35"
|
|
5628
|
+
];
|
|
5604
5629
|
function isQueueValidatedVersion(version2) {
|
|
5605
5630
|
if (!version2) return false;
|
|
5606
5631
|
return QUEUE_VALIDATED_OPENCODE_VERSIONS.includes(version2);
|
|
@@ -6645,6 +6670,7 @@ function connectTunnel(options) {
|
|
|
6645
6670
|
}, 3e4);
|
|
6646
6671
|
let relaySilenceTimeout;
|
|
6647
6672
|
let relaySilenceTimedOut = false;
|
|
6673
|
+
let relayConnectionId;
|
|
6648
6674
|
const clearRelaySilenceTimeout = () => {
|
|
6649
6675
|
if (relaySilenceTimeout === void 0) return;
|
|
6650
6676
|
clearTimeout(relaySilenceTimeout);
|
|
@@ -6730,7 +6756,8 @@ function connectTunnel(options) {
|
|
|
6730
6756
|
armRelaySilenceTimeout();
|
|
6731
6757
|
forwarder.setBinaryFramesSupported(message.binary_frames === true);
|
|
6732
6758
|
const connectedAgentId = message.agent_id ?? agentId;
|
|
6733
|
-
|
|
6759
|
+
relayConnectionId = message.connection_id;
|
|
6760
|
+
onConnected?.(connectedAgentId, relayConnectionId);
|
|
6734
6761
|
resolve5({
|
|
6735
6762
|
ws,
|
|
6736
6763
|
close: () => ws.close(1e3, "CLI shutdown")
|
|
@@ -6767,7 +6794,7 @@ function connectTunnel(options) {
|
|
|
6767
6794
|
clearRelaySilenceTimeout();
|
|
6768
6795
|
const reasonStr = (relaySilenceTimedOut ? "no relay heartbeat for 90s \u2014 reconnecting" : void 0) || reason.toString() || upgradeRejection || (code === 1006 ? "abnormal closure" : "No reason provided");
|
|
6769
6796
|
forwarder.abortAll();
|
|
6770
|
-
onDisconnected?.(code, reasonStr);
|
|
6797
|
+
onDisconnected?.(code, reasonStr, relayConnectionId);
|
|
6771
6798
|
});
|
|
6772
6799
|
});
|
|
6773
6800
|
}
|
|
@@ -6830,7 +6857,7 @@ var RunnerConnection = class _RunnerConnection {
|
|
|
6830
6857
|
authHeader: this.opts.getAuthHeader(),
|
|
6831
6858
|
port: this.opts.port,
|
|
6832
6859
|
openCodePassword: this.opts.openCodePassword,
|
|
6833
|
-
onConnected: (agentId) => {
|
|
6860
|
+
onConnected: (agentId, relayConnectionId) => {
|
|
6834
6861
|
const attempt = this.reconnectAttempt + 1;
|
|
6835
6862
|
this.reconnectAttempt = 0;
|
|
6836
6863
|
this.reconnecting = false;
|
|
@@ -6840,13 +6867,17 @@ var RunnerConnection = class _RunnerConnection {
|
|
|
6840
6867
|
this.disconnectedAtMs = null;
|
|
6841
6868
|
events.onConnected(agentId, isReconnect, {
|
|
6842
6869
|
generation: this.generation,
|
|
6870
|
+
relayConnectionId: relayConnectionId ?? null,
|
|
6843
6871
|
attempt,
|
|
6844
6872
|
downtimeMs
|
|
6845
6873
|
});
|
|
6846
6874
|
},
|
|
6847
|
-
onDisconnected: (code, reason) => {
|
|
6875
|
+
onDisconnected: (code, reason, relayConnectionId) => {
|
|
6848
6876
|
this.disconnectedAtMs = this.now();
|
|
6849
|
-
events.onDisconnected(code, reason, {
|
|
6877
|
+
events.onDisconnected(code, reason, {
|
|
6878
|
+
generation: this.generation,
|
|
6879
|
+
relayConnectionId: relayConnectionId ?? null
|
|
6880
|
+
});
|
|
6850
6881
|
const relayRequestedReconnect = code === 1e3 && _RunnerConnection.RELAY_RECONNECT_CLOSE_REASONS.has(reason);
|
|
6851
6882
|
if (this.opts.isRunning() && (code !== 1e3 || relayRequestedReconnect) && !this.reconnecting) {
|
|
6852
6883
|
this.reconnectPromise = this.connectWithRetry(true).catch((err) => {
|
|
@@ -13873,12 +13904,6 @@ async function configureGitHubAccess({ env, log: log3 }) {
|
|
|
13873
13904
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
13874
13905
|
import { copyFileSync, existsSync as existsSync2, statSync as statSync6 } from "node:fs";
|
|
13875
13906
|
import { isAbsolute as isAbsolute3, join as join11, resolve as resolve4 } from "node:path";
|
|
13876
|
-
var MANAGED_PROVIDER_NAMESPACES = [
|
|
13877
|
-
"evident-claude",
|
|
13878
|
-
"evident-codex",
|
|
13879
|
-
"evident-openai",
|
|
13880
|
-
"evident-kimi"
|
|
13881
|
-
];
|
|
13882
13907
|
function parseConfigContent(content) {
|
|
13883
13908
|
if (!content?.trim()) return {};
|
|
13884
13909
|
const parsed = JSON.parse(content);
|
|
@@ -13890,7 +13915,7 @@ function parseConfigContent(content) {
|
|
|
13890
13915
|
function mergeManagedOpenCodeConfigContent(content, managedProviders) {
|
|
13891
13916
|
const config = parseConfigContent(content);
|
|
13892
13917
|
const provider = typeof config.provider === "object" && config.provider !== null && !Array.isArray(config.provider) ? { ...config.provider } : {};
|
|
13893
|
-
for (const namespace of
|
|
13918
|
+
for (const namespace of CREDENTIAL_PROXY_NATIVE_NAMESPACES) {
|
|
13894
13919
|
delete provider[namespace];
|
|
13895
13920
|
}
|
|
13896
13921
|
return JSON.stringify({ ...config, provider: { ...provider, ...managedProviders } });
|
|
@@ -13903,7 +13928,7 @@ function removeManagedOpenCodeConfigContent(content) {
|
|
|
13903
13928
|
}
|
|
13904
13929
|
const provider = { ...config.provider };
|
|
13905
13930
|
let changed = false;
|
|
13906
|
-
for (const namespace of
|
|
13931
|
+
for (const namespace of CREDENTIAL_PROXY_NATIVE_NAMESPACES) {
|
|
13907
13932
|
if (namespace in provider) {
|
|
13908
13933
|
delete provider[namespace];
|
|
13909
13934
|
changed = true;
|
|
@@ -16674,7 +16699,7 @@ async function run(options) {
|
|
|
16674
16699
|
onConnected: (agentId, isReconnect, transition) => {
|
|
16675
16700
|
state.connected = true;
|
|
16676
16701
|
state.agentId = agentId;
|
|
16677
|
-
const connectionMessage = isReconnect ? `Tunnel reconnected (runner: ${agentId}, generation: ${transition.generation}, attempt: ${transition.attempt}, offline for ${transition.downtimeMs}ms)` : `Tunnel connected (runner: ${agentId}, generation: ${transition.generation})`;
|
|
16702
|
+
const connectionMessage = isReconnect ? `Tunnel reconnected (runner: ${agentId}, generation: ${transition.generation}, relay connection: ${transition.relayConnectionId ?? "unknown"}, attempt: ${transition.attempt}, offline for ${transition.downtimeMs}ms)` : `Tunnel connected (runner: ${agentId}, generation: ${transition.generation}, relay connection: ${transition.relayConnectionId ?? "unknown"})`;
|
|
16678
16703
|
logActivity(state, {
|
|
16679
16704
|
type: "info",
|
|
16680
16705
|
message: connectionMessage
|
|
@@ -16707,6 +16732,7 @@ async function run(options) {
|
|
|
16707
16732
|
connected: state.opencodeConnected
|
|
16708
16733
|
}),
|
|
16709
16734
|
connection_generation: transition.generation,
|
|
16735
|
+
...transition.relayConnectionId !== null ? { relay_connection_id: transition.relayConnectionId } : {},
|
|
16710
16736
|
...isReconnect && transition.downtimeMs !== null ? {
|
|
16711
16737
|
reconnect_attempt: transition.attempt,
|
|
16712
16738
|
downtime_ms: transition.downtimeMs
|
|
@@ -16737,12 +16763,13 @@ async function run(options) {
|
|
|
16737
16763
|
const safeReason2 = redactDiagnosticText(reason).slice(0, MAX_DISCONNECT_REASON_LENGTH);
|
|
16738
16764
|
logActivity(state, {
|
|
16739
16765
|
type: "info",
|
|
16740
|
-
message: `Tunnel disconnected (generation: ${transition.generation}, code: ${code}, reason: ${safeReason2})`
|
|
16766
|
+
message: `Tunnel disconnected (generation: ${transition.generation}, relay connection: ${transition.relayConnectionId ?? "unknown"}, code: ${code}, reason: ${safeReason2})`
|
|
16741
16767
|
});
|
|
16742
16768
|
emitAgentDisconnected(state.agentId, {
|
|
16743
16769
|
code,
|
|
16744
16770
|
reason: safeReason2,
|
|
16745
|
-
connection_generation: transition.generation
|
|
16771
|
+
connection_generation: transition.generation,
|
|
16772
|
+
...transition.relayConnectionId !== null ? { relay_connection_id: transition.relayConnectionId } : {}
|
|
16746
16773
|
});
|
|
16747
16774
|
if (state.interactive) displayStatus(state);
|
|
16748
16775
|
},
|