refactor(core): lift Settings, TokenManager, and tool-credentials into crewai-core

- New crewai_core.{settings,token_manager,tool_credentials} absorb the previously
  duplicated Settings class (~200 LOC), TokenManager (~185 LOC), and
  build_env_with_*_credentials helpers from both crewai and crewai-cli.
- crewai_core.constants gains the OAuth2/enterprise URL constants.
- crewai.settings, crewai.auth.token_manager, crewai_cli.config, and
  crewai_cli.shared.token_manager are now thin re-export shims (deprecation
  warnings on the crewai.* paths; crewai_cli.* paths kept silent re-exports).
- Internal callers (plus_api, auth.token, auth.oauth2, agent_utils,
  trace_batch_manager) migrated to crewai_core.* imports.
- Tests updated to patch crewai_core.{settings,token_manager}.* paths.
- crewai-core gains pydantic, cryptography, tomli deps; crewai-cli's redundant
  cryptography dep can stay (still imported by crewai_cli.shared.token_manager
  shim users) — no behavior change.
- Standalone CLI smoke still passes; crewai's full mypy (471 files) clean.
This commit is contained in:
Greyson Lalonde
2026-05-05 14:20:41 +08:00
parent 8b641014aa
commit fb045534aa
22 changed files with 557 additions and 937 deletions

6
uv.lock generated
View File

@@ -1476,21 +1476,27 @@ name = "crewai-core"
source = { editable = "lib/crewai-core" }
dependencies = [
{ name = "appdirs" },
{ name = "cryptography" },
{ name = "opentelemetry-api" },
{ name = "opentelemetry-exporter-otlp-proto-http" },
{ name = "opentelemetry-sdk" },
{ name = "portalocker" },
{ name = "pydantic" },
{ name = "rich" },
{ name = "tomli" },
]
[package.metadata]
requires-dist = [
{ name = "appdirs", specifier = "~=1.4.4" },
{ name = "cryptography", specifier = ">=42.0" },
{ name = "opentelemetry-api", specifier = "~=1.34.0" },
{ name = "opentelemetry-exporter-otlp-proto-http", specifier = "~=1.34.0" },
{ name = "opentelemetry-sdk", specifier = "~=1.34.0" },
{ name = "portalocker", specifier = "~=2.7.0" },
{ name = "pydantic", specifier = ">=2.11.9,<2.13" },
{ name = "rich", specifier = ">=13.7.1" },
{ name = "tomli", specifier = "~=2.0.2" },
]
[[package]]