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

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) {
@@ -4714,6 +4719,19 @@ async function run(options) {
4714
4719
  sessionCleanupTimers: [],
4715
4720
  authHeader: ""
4716
4721
  };
4722
+ if (!options.runner && options.agent) {
4723
+ telemetry.info(
4724
+ EventTypes.DEPRECATED_AGENT_FLAG_USED,
4725
+ "Deprecated --agent flag used instead of --runner",
4726
+ { command: "run" },
4727
+ state.agentId
4728
+ );
4729
+ const agentFlagNotice = "--agent is deprecated, use --runner instead; will be removed in a future release.";
4730
+ log2(state, agentFlagNotice, "warn");
4731
+ if (state.interactive && !state.json) {
4732
+ logActivity(state, { type: "info", level: "warn", message: agentFlagNotice });
4733
+ }
4734
+ }
4717
4735
  if (state.idleTimeout === null && (process.env.GITHUB_ACTIONS || process.env.CI)) {
4718
4736
  log2(
4719
4737
  state,
@@ -4764,6 +4782,19 @@ async function run(options) {
4764
4782
  logActivity(state, { type: "info", level: "warn", message: credentials2.notice });
4765
4783
  }
4766
4784
  }
4785
+ if (credentials2.keySource === "agent_key") {
4786
+ telemetry.info(
4787
+ EventTypes.DEPRECATED_AGENT_KEY_ENV_USED,
4788
+ "Deprecated EVIDENT_AGENT_KEY env var used instead of EVIDENT_RUNNER_KEY",
4789
+ { command: "run" },
4790
+ state.agentId
4791
+ );
4792
+ const agentKeyNotice = "EVIDENT_AGENT_KEY is deprecated, use EVIDENT_RUNNER_KEY instead; will be removed in a future release.";
4793
+ log2(state, agentKeyNotice, "warn");
4794
+ if (state.interactive && !state.json) {
4795
+ logActivity(state, { type: "info", level: "warn", message: agentKeyNotice });
4796
+ }
4797
+ }
4767
4798
  if (!state.agentId) {
4768
4799
  if (credentials2.authType === "agent_key") {
4769
4800
  const resolved = await resolveAgentIdFromKey(state.authHeader);