eva-cli 3.0.0__py3-none-any.whl

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.
Files changed (74) hide show
  1. eva/__init__.py +3 -0
  2. eva/budget.py +31 -0
  3. eva/cache/__init__.py +17 -0
  4. eva/cache/cache.py +40 -0
  5. eva/cache.py +19 -0
  6. eva/chat_session.py +5 -0
  7. eva/cli/__init__.py +3 -0
  8. eva/cli/app.py +851 -0
  9. eva/cli.py +5 -0
  10. eva/config/__init__.py +33 -0
  11. eva/config/config.py +129 -0
  12. eva/config.py +35 -0
  13. eva/context/__init__.py +19 -0
  14. eva/context/finder.py +5 -0
  15. eva/context/gitignore.py +5 -0
  16. eva/context/io.py +5 -0
  17. eva/context/tokenizer.py +5 -0
  18. eva/context/tree.py +5 -0
  19. eva/diagnostics.py +9 -0
  20. eva/git_ops.py +15 -0
  21. eva/indexing/__init__.py +18 -0
  22. eva/indexing/finder.py +42 -0
  23. eva/indexing/io.py +35 -0
  24. eva/indexing/repo_index.py +240 -0
  25. eva/indexing/tokenizer.py +37 -0
  26. eva/indexing/tree.py +60 -0
  27. eva/plugins/__init__.py +3 -0
  28. eva/prompts/__init__.py +36 -0
  29. eva/providers/__init__.py +150 -0
  30. eva/providers/gemini_provider.py +72 -0
  31. eva/providers/groq_provider.py +37 -0
  32. eva/providers/llamacpp_provider.py +69 -0
  33. eva/providers/ollama_provider.py +70 -0
  34. eva/providers/openai_compat.py +57 -0
  35. eva/providers/opencode_zen_provider.py +53 -0
  36. eva/providers/openrouter_provider.py +55 -0
  37. eva/replay/__init__.py +11 -0
  38. eva/replay/player.py +91 -0
  39. eva/replay/recorder.py +67 -0
  40. eva/router/__init__.py +25 -0
  41. eva/router/gemini_provider.py +5 -0
  42. eva/router/groq_provider.py +5 -0
  43. eva/router/openai_compat.py +5 -0
  44. eva/router/opencode_zen_provider.py +5 -0
  45. eva/router/openrouter_provider.py +5 -0
  46. eva/security/__init__.py +32 -0
  47. eva/security/audit.py +126 -0
  48. eva/security/redaction.py +80 -0
  49. eva/security/sandbox.py +55 -0
  50. eva/security/work_safety.py +85 -0
  51. eva/shell/__init__.py +3 -0
  52. eva/shell/runner.py +6 -0
  53. eva/telemetry/__init__.py +10 -0
  54. eva/telemetry/diagnostics.py +43 -0
  55. eva/telemetry/metrics.py +68 -0
  56. eva/ui/formatter.py +46 -0
  57. eva/ui/streaming.py +21 -0
  58. eva/work_safety.py +21 -0
  59. eva/workflows/__init__.py +39 -0
  60. eva/workflows/budget.py +139 -0
  61. eva/workflows/builtins/dependency_audit.yaml +12 -0
  62. eva/workflows/builtins/repo_health.yaml +16 -0
  63. eva/workflows/builtins/security_scan.yaml +12 -0
  64. eva/workflows/chat_session.py +54 -0
  65. eva/workflows/engine.py +267 -0
  66. eva/workspace/__init__.py +39 -0
  67. eva/workspace/git_ops.py +202 -0
  68. eva/workspace/gitignore.py +47 -0
  69. eva/workspace/session.py +184 -0
  70. eva_cli-3.0.0.dist-info/METADATA +344 -0
  71. eva_cli-3.0.0.dist-info/RECORD +74 -0
  72. eva_cli-3.0.0.dist-info/WHEEL +4 -0
  73. eva_cli-3.0.0.dist-info/entry_points.txt +2 -0
  74. eva_cli-3.0.0.dist-info/licenses/LICENSE +21 -0
eva/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """Eva CLI package."""
2
+
3
+ __version__ = "3.0.0"
eva/budget.py ADDED
@@ -0,0 +1,31 @@
1
+ """Compatibility re-exports for budget."""
2
+
3
+ from eva.config import get_config_dir
4
+ from eva.workflows.budget import (
5
+ Budget,
6
+ UsageStats,
7
+ check_and_increment,
8
+ get_budget_file,
9
+ get_budget_lock_file,
10
+ get_live_budget,
11
+ load_budget,
12
+ normalize_usage_stats,
13
+ remaining_budget,
14
+ reset_provider_usage,
15
+ save_budget,
16
+ )
17
+
18
+ __all__ = [
19
+ "Budget",
20
+ "UsageStats",
21
+ "check_and_increment",
22
+ "get_budget_file",
23
+ "get_budget_lock_file",
24
+ "get_config_dir",
25
+ "get_live_budget",
26
+ "load_budget",
27
+ "normalize_usage_stats",
28
+ "remaining_budget",
29
+ "reset_provider_usage",
30
+ "save_budget",
31
+ ]
eva/cache/__init__.py ADDED
@@ -0,0 +1,17 @@
1
+ from eva.cache.cache import (
2
+ clear_cache,
3
+ generate_cache_key,
4
+ get_cache,
5
+ get_cache_dir,
6
+ get_cached_response,
7
+ set_cached_response,
8
+ )
9
+
10
+ __all__ = [
11
+ "clear_cache",
12
+ "generate_cache_key",
13
+ "get_cache",
14
+ "get_cache_dir",
15
+ "get_cached_response",
16
+ "set_cached_response",
17
+ ]
eva/cache/cache.py ADDED
@@ -0,0 +1,40 @@
1
+ import hashlib
2
+ import json
3
+
4
+ from diskcache import Cache
5
+
6
+ from eva.config import get_config_dir
7
+
8
+
9
+ def get_cache_dir():
10
+ return get_config_dir() / "cache"
11
+
12
+
13
+ def get_cache() -> Cache:
14
+ return Cache(get_cache_dir())
15
+
16
+
17
+ def generate_cache_key(model: str, system_prompt: str, user_prompt: str, context: str) -> str:
18
+ key_data = {
19
+ "model": model,
20
+ "system_prompt": system_prompt,
21
+ "user_prompt": user_prompt,
22
+ "context_hash": hashlib.sha256(context.encode("utf-8")).hexdigest() if context else "",
23
+ }
24
+ key_str = json.dumps(key_data, sort_keys=True)
25
+ return hashlib.sha256(key_str.encode("utf-8")).hexdigest()
26
+
27
+
28
+ def get_cached_response(key: str) -> str | None:
29
+ with get_cache() as cache:
30
+ return cache.get(key)
31
+
32
+
33
+ def set_cached_response(key: str, response: str, ttl_hours: int = 24):
34
+ with get_cache() as cache:
35
+ cache.set(key, response, expire=ttl_hours * 3600)
36
+
37
+
38
+ def clear_cache():
39
+ with get_cache() as cache:
40
+ cache.clear()
eva/cache.py ADDED
@@ -0,0 +1,19 @@
1
+ """Compatibility re-exports for cache."""
2
+
3
+ from eva.cache.cache import (
4
+ clear_cache,
5
+ generate_cache_key,
6
+ get_cache,
7
+ get_cache_dir,
8
+ get_cached_response,
9
+ set_cached_response,
10
+ )
11
+
12
+ __all__ = [
13
+ "clear_cache",
14
+ "generate_cache_key",
15
+ "get_cache",
16
+ "get_cache_dir",
17
+ "get_cached_response",
18
+ "set_cached_response",
19
+ ]
eva/chat_session.py ADDED
@@ -0,0 +1,5 @@
1
+ """Compatibility re-exports for chat_session."""
2
+
3
+ from eva.workflows.chat_session import run_chat_session
4
+
5
+ __all__ = ["run_chat_session"]
eva/cli/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ from eva.cli.app import app, main_entry
2
+
3
+ __all__ = ["app", "main_entry"]