@evident-ai/cli 3.1.1-dev.a99e616 → 3.1.1-dev.bc26090

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 CHANGED
@@ -645,7 +645,11 @@ var EventTypes = {
645
645
  // CLI lifecycle
646
646
  CLI_STARTED: "cli.started",
647
647
  CLI_COMMAND: "cli.command",
648
- CLI_ERROR: "cli.error"
648
+ CLI_ERROR: "cli.error",
649
+ // Deprecation telemetry (#412) — usage of the old `--agent`/`EVIDENT_AGENT_KEY`
650
+ // names instead of the preferred `--runner`/`EVIDENT_RUNNER_KEY` (#409).
651
+ DEPRECATED_AGENT_FLAG_USED: "cli.deprecated_agent_flag_used",
652
+ DEPRECATED_AGENT_KEY_ENV_USED: "cli.deprecated_agent_key_env_used"
649
653
  };
650
654
 
651
655
  // src/lib/auth.ts
@@ -656,11 +660,12 @@ async function getAuthCredentials() {
656
660
  return {
657
661
  token: runnerKey,
658
662
  authType: "agent_key",
663
+ keySource: "runner_key",
659
664
  notice: agentKey ? "Both EVIDENT_RUNNER_KEY and EVIDENT_AGENT_KEY are set; using EVIDENT_RUNNER_KEY." : void 0
660
665
  };
661
666
  }
662
667
  if (agentKey) {
663
- return { token: agentKey, authType: "agent_key" };
668
+ return { token: agentKey, authType: "agent_key", keySource: "agent_key" };
664
669
  }
665
670
  const userToken = process.env.EVIDENT_TOKEN;
666
671
  if (userToken) {
@@ -1790,7 +1795,6 @@ function connectTunnel(options) {
1790
1795
  onConnected,
1791
1796
  onDisconnected,
1792
1797
  onError,
1793
- onRequest,
1794
1798
  onResponse,
1795
1799
  onInfo,
1796
1800
  onDrainPing
@@ -1803,18 +1807,8 @@ function connectTunnel(options) {
1803
1807
  Authorization: authHeader
1804
1808
  }
1805
1809
  });
1806
- const streamStartTimes = /* @__PURE__ */ new Map();
1807
1810
  const forwarder = new StreamForwarder(ws, port, {
1808
- onOpen: (sid, method, path) => {
1809
- if (path === TUNNEL_DRAIN_PING_PATH) return;
1810
- streamStartTimes.set(sid, Date.now());
1811
- onRequest?.(method, path, sid);
1812
- },
1813
- onHead: (sid, status) => {
1814
- const startedAt = streamStartTimes.get(sid);
1815
- streamStartTimes.delete(sid);
1816
- onResponse?.(status, startedAt ? Date.now() - startedAt : 0, sid);
1817
- },
1811
+ onHead: () => onResponse?.(),
1818
1812
  onDrainPing: () => onDrainPing?.()
1819
1813
  });
1820
1814
  const connectionTimeout = setTimeout(() => {
@@ -1890,7 +1884,6 @@ function connectTunnel(options) {
1890
1884
  ws.on("close", (code, reason) => {
1891
1885
  const reasonStr = reason.toString() || upgradeRejection || (code === 1006 ? "abnormal closure" : "No reason provided");
1892
1886
  forwarder.abortAll();
1893
- streamStartTimes.clear();
1894
1887
  onDisconnected?.(code, reasonStr);
1895
1888
  });
1896
1889
  });
@@ -4714,6 +4707,19 @@ async function run(options) {
4714
4707
  sessionCleanupTimers: [],
4715
4708
  authHeader: ""
4716
4709
  };
4710
+ if (!options.runner && options.agent) {
4711
+ telemetry.info(
4712
+ EventTypes.DEPRECATED_AGENT_FLAG_USED,
4713
+ "Deprecated --agent flag used instead of --runner",
4714
+ { command: "run" },
4715
+ state.agentId
4716
+ );
4717
+ const agentFlagNotice = "--agent is deprecated, use --runner instead; will be removed in a future release.";
4718
+ log2(state, agentFlagNotice, "warn");
4719
+ if (state.interactive && !state.json) {
4720
+ logActivity(state, { type: "info", level: "warn", message: agentFlagNotice });
4721
+ }
4722
+ }
4717
4723
  if (state.idleTimeout === null && (process.env.GITHUB_ACTIONS || process.env.CI)) {
4718
4724
  log2(
4719
4725
  state,
@@ -4764,6 +4770,19 @@ async function run(options) {
4764
4770
  logActivity(state, { type: "info", level: "warn", message: credentials2.notice });
4765
4771
  }
4766
4772
  }
4773
+ if (credentials2.keySource === "agent_key") {
4774
+ telemetry.info(
4775
+ EventTypes.DEPRECATED_AGENT_KEY_ENV_USED,
4776
+ "Deprecated EVIDENT_AGENT_KEY env var used instead of EVIDENT_RUNNER_KEY",
4777
+ { command: "run" },
4778
+ state.agentId
4779
+ );
4780
+ const agentKeyNotice = "EVIDENT_AGENT_KEY is deprecated, use EVIDENT_RUNNER_KEY instead; will be removed in a future release.";
4781
+ log2(state, agentKeyNotice, "warn");
4782
+ if (state.interactive && !state.json) {
4783
+ logActivity(state, { type: "info", level: "warn", message: agentKeyNotice });
4784
+ }
4785
+ }
4767
4786
  if (!state.agentId) {
4768
4787
  if (credentials2.authType === "agent_key") {
4769
4788
  const resolved = await resolveAgentIdFromKey(state.authHeader);