@evident-ai/cli 3.6.1-dev.2fd7890 → 3.6.1-dev.43c1fd7
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 +17 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1442,7 +1442,7 @@ import ora4 from "ora";
|
|
|
1442
1442
|
import { select as select4 } from "@inquirer/prompts";
|
|
1443
1443
|
|
|
1444
1444
|
// src/lib/telemetry.ts
|
|
1445
|
-
var CLI_VERSION = (true ? "3.6.1-dev.
|
|
1445
|
+
var CLI_VERSION = (true ? "3.6.1-dev.43c1fd7" : void 0) ?? process.env.npm_package_version ?? "unknown";
|
|
1446
1446
|
function getCliVersion() {
|
|
1447
1447
|
return CLI_VERSION;
|
|
1448
1448
|
}
|
|
@@ -6666,6 +6666,7 @@ function connectTunnel(options) {
|
|
|
6666
6666
|
}, 3e4);
|
|
6667
6667
|
let relaySilenceTimeout;
|
|
6668
6668
|
let relaySilenceTimedOut = false;
|
|
6669
|
+
let relayConnectionId;
|
|
6669
6670
|
const clearRelaySilenceTimeout = () => {
|
|
6670
6671
|
if (relaySilenceTimeout === void 0) return;
|
|
6671
6672
|
clearTimeout(relaySilenceTimeout);
|
|
@@ -6751,7 +6752,8 @@ function connectTunnel(options) {
|
|
|
6751
6752
|
armRelaySilenceTimeout();
|
|
6752
6753
|
forwarder.setBinaryFramesSupported(message.binary_frames === true);
|
|
6753
6754
|
const connectedAgentId = message.agent_id ?? agentId;
|
|
6754
|
-
|
|
6755
|
+
relayConnectionId = message.connection_id;
|
|
6756
|
+
onConnected?.(connectedAgentId, relayConnectionId);
|
|
6755
6757
|
resolve5({
|
|
6756
6758
|
ws,
|
|
6757
6759
|
close: () => ws.close(1e3, "CLI shutdown")
|
|
@@ -6788,7 +6790,7 @@ function connectTunnel(options) {
|
|
|
6788
6790
|
clearRelaySilenceTimeout();
|
|
6789
6791
|
const reasonStr = (relaySilenceTimedOut ? "no relay heartbeat for 90s \u2014 reconnecting" : void 0) || reason.toString() || upgradeRejection || (code === 1006 ? "abnormal closure" : "No reason provided");
|
|
6790
6792
|
forwarder.abortAll();
|
|
6791
|
-
onDisconnected?.(code, reasonStr);
|
|
6793
|
+
onDisconnected?.(code, reasonStr, relayConnectionId);
|
|
6792
6794
|
});
|
|
6793
6795
|
});
|
|
6794
6796
|
}
|
|
@@ -6851,7 +6853,7 @@ var RunnerConnection = class _RunnerConnection {
|
|
|
6851
6853
|
authHeader: this.opts.getAuthHeader(),
|
|
6852
6854
|
port: this.opts.port,
|
|
6853
6855
|
openCodePassword: this.opts.openCodePassword,
|
|
6854
|
-
onConnected: (agentId) => {
|
|
6856
|
+
onConnected: (agentId, relayConnectionId) => {
|
|
6855
6857
|
const attempt = this.reconnectAttempt + 1;
|
|
6856
6858
|
this.reconnectAttempt = 0;
|
|
6857
6859
|
this.reconnecting = false;
|
|
@@ -6861,13 +6863,17 @@ var RunnerConnection = class _RunnerConnection {
|
|
|
6861
6863
|
this.disconnectedAtMs = null;
|
|
6862
6864
|
events.onConnected(agentId, isReconnect, {
|
|
6863
6865
|
generation: this.generation,
|
|
6866
|
+
relayConnectionId: relayConnectionId ?? null,
|
|
6864
6867
|
attempt,
|
|
6865
6868
|
downtimeMs
|
|
6866
6869
|
});
|
|
6867
6870
|
},
|
|
6868
|
-
onDisconnected: (code, reason) => {
|
|
6871
|
+
onDisconnected: (code, reason, relayConnectionId) => {
|
|
6869
6872
|
this.disconnectedAtMs = this.now();
|
|
6870
|
-
events.onDisconnected(code, reason, {
|
|
6873
|
+
events.onDisconnected(code, reason, {
|
|
6874
|
+
generation: this.generation,
|
|
6875
|
+
relayConnectionId: relayConnectionId ?? null
|
|
6876
|
+
});
|
|
6871
6877
|
const relayRequestedReconnect = code === 1e3 && _RunnerConnection.RELAY_RECONNECT_CLOSE_REASONS.has(reason);
|
|
6872
6878
|
if (this.opts.isRunning() && (code !== 1e3 || relayRequestedReconnect) && !this.reconnecting) {
|
|
6873
6879
|
this.reconnectPromise = this.connectWithRetry(true).catch((err) => {
|
|
@@ -16689,7 +16695,7 @@ async function run(options) {
|
|
|
16689
16695
|
onConnected: (agentId, isReconnect, transition) => {
|
|
16690
16696
|
state.connected = true;
|
|
16691
16697
|
state.agentId = agentId;
|
|
16692
|
-
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})`;
|
|
16698
|
+
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"})`;
|
|
16693
16699
|
logActivity(state, {
|
|
16694
16700
|
type: "info",
|
|
16695
16701
|
message: connectionMessage
|
|
@@ -16722,6 +16728,7 @@ async function run(options) {
|
|
|
16722
16728
|
connected: state.opencodeConnected
|
|
16723
16729
|
}),
|
|
16724
16730
|
connection_generation: transition.generation,
|
|
16731
|
+
...transition.relayConnectionId !== null ? { relay_connection_id: transition.relayConnectionId } : {},
|
|
16725
16732
|
...isReconnect && transition.downtimeMs !== null ? {
|
|
16726
16733
|
reconnect_attempt: transition.attempt,
|
|
16727
16734
|
downtime_ms: transition.downtimeMs
|
|
@@ -16752,12 +16759,13 @@ async function run(options) {
|
|
|
16752
16759
|
const safeReason2 = redactDiagnosticText(reason).slice(0, MAX_DISCONNECT_REASON_LENGTH);
|
|
16753
16760
|
logActivity(state, {
|
|
16754
16761
|
type: "info",
|
|
16755
|
-
message: `Tunnel disconnected (generation: ${transition.generation}, code: ${code}, reason: ${safeReason2})`
|
|
16762
|
+
message: `Tunnel disconnected (generation: ${transition.generation}, relay connection: ${transition.relayConnectionId ?? "unknown"}, code: ${code}, reason: ${safeReason2})`
|
|
16756
16763
|
});
|
|
16757
16764
|
emitAgentDisconnected(state.agentId, {
|
|
16758
16765
|
code,
|
|
16759
16766
|
reason: safeReason2,
|
|
16760
|
-
connection_generation: transition.generation
|
|
16767
|
+
connection_generation: transition.generation,
|
|
16768
|
+
...transition.relayConnectionId !== null ? { relay_connection_id: transition.relayConnectionId } : {}
|
|
16761
16769
|
});
|
|
16762
16770
|
if (state.interactive) displayStatus(state);
|
|
16763
16771
|
},
|