chore(core): address bot findings on extraction follow-up

- Add __all__ to all re-export shims (crewai.{settings,constants,utilities.{
  version,paths,printer,lock_store,constants,project_utils},auth.token_manager,
  events.utils.console_formatter}, crewai_cli.{config,shared.token_manager},
  crewai_cli.utils) to silence CodeQL "unused import" findings — the imports
  are the module's public API.
- Migrate three CLI internal callers (cli.py, authentication/main.py,
  authentication/token.py) off the deprecated crewai_cli.shared.token_manager
  shim, importing crewai_core.token_manager directly. Avoids a self-imposed
  DeprecationWarning on every CLI startup.
- Add Telemetry._safe_telemetry_procedure for void operations; switch the
  CLI-facing span methods (deploy/template/flow_creation/signup, _add_attribute)
  off _safe_telemetry_operation since they don't return a span.
- Delete unused crewai_cli.utils.update_env_vars (had a latent type-cast bug
  and zero callers).
This commit is contained in:
Greyson Lalonde
2026-05-05 20:59:42 +08:00
parent fb045534aa
commit 832fdb7c5d
17 changed files with 136 additions and 49 deletions

View File

@@ -2,13 +2,13 @@ import time
from typing import TYPE_CHECKING, Any, TypeVar, cast
import webbrowser
from crewai_core.token_manager import TokenManager
import httpx
from pydantic import BaseModel, Field
from rich.console import Console
from crewai_cli.authentication.utils import validate_jwt_token
from crewai_cli.config import Settings
from crewai_cli.shared.token_manager import TokenManager
console = Console()