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.
- eva/__init__.py +3 -0
- eva/budget.py +31 -0
- eva/cache/__init__.py +17 -0
- eva/cache/cache.py +40 -0
- eva/cache.py +19 -0
- eva/chat_session.py +5 -0
- eva/cli/__init__.py +3 -0
- eva/cli/app.py +851 -0
- eva/cli.py +5 -0
- eva/config/__init__.py +33 -0
- eva/config/config.py +129 -0
- eva/config.py +35 -0
- eva/context/__init__.py +19 -0
- eva/context/finder.py +5 -0
- eva/context/gitignore.py +5 -0
- eva/context/io.py +5 -0
- eva/context/tokenizer.py +5 -0
- eva/context/tree.py +5 -0
- eva/diagnostics.py +9 -0
- eva/git_ops.py +15 -0
- eva/indexing/__init__.py +18 -0
- eva/indexing/finder.py +42 -0
- eva/indexing/io.py +35 -0
- eva/indexing/repo_index.py +240 -0
- eva/indexing/tokenizer.py +37 -0
- eva/indexing/tree.py +60 -0
- eva/plugins/__init__.py +3 -0
- eva/prompts/__init__.py +36 -0
- eva/providers/__init__.py +150 -0
- eva/providers/gemini_provider.py +72 -0
- eva/providers/groq_provider.py +37 -0
- eva/providers/llamacpp_provider.py +69 -0
- eva/providers/ollama_provider.py +70 -0
- eva/providers/openai_compat.py +57 -0
- eva/providers/opencode_zen_provider.py +53 -0
- eva/providers/openrouter_provider.py +55 -0
- eva/replay/__init__.py +11 -0
- eva/replay/player.py +91 -0
- eva/replay/recorder.py +67 -0
- eva/router/__init__.py +25 -0
- eva/router/gemini_provider.py +5 -0
- eva/router/groq_provider.py +5 -0
- eva/router/openai_compat.py +5 -0
- eva/router/opencode_zen_provider.py +5 -0
- eva/router/openrouter_provider.py +5 -0
- eva/security/__init__.py +32 -0
- eva/security/audit.py +126 -0
- eva/security/redaction.py +80 -0
- eva/security/sandbox.py +55 -0
- eva/security/work_safety.py +85 -0
- eva/shell/__init__.py +3 -0
- eva/shell/runner.py +6 -0
- eva/telemetry/__init__.py +10 -0
- eva/telemetry/diagnostics.py +43 -0
- eva/telemetry/metrics.py +68 -0
- eva/ui/formatter.py +46 -0
- eva/ui/streaming.py +21 -0
- eva/work_safety.py +21 -0
- eva/workflows/__init__.py +39 -0
- eva/workflows/budget.py +139 -0
- eva/workflows/builtins/dependency_audit.yaml +12 -0
- eva/workflows/builtins/repo_health.yaml +16 -0
- eva/workflows/builtins/security_scan.yaml +12 -0
- eva/workflows/chat_session.py +54 -0
- eva/workflows/engine.py +267 -0
- eva/workspace/__init__.py +39 -0
- eva/workspace/git_ops.py +202 -0
- eva/workspace/gitignore.py +47 -0
- eva/workspace/session.py +184 -0
- eva_cli-3.0.0.dist-info/METADATA +344 -0
- eva_cli-3.0.0.dist-info/RECORD +74 -0
- eva_cli-3.0.0.dist-info/WHEEL +4 -0
- eva_cli-3.0.0.dist-info/entry_points.txt +2 -0
- eva_cli-3.0.0.dist-info/licenses/LICENSE +21 -0
eva/__init__.py
ADDED
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
eva/cli/__init__.py
ADDED