aevs 0.1.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.
- aevs/__init__.py +99 -0
- aevs/_api.py +658 -0
- aevs/_drainer.py +177 -0
- aevs/_version.py +6 -0
- aevs/adapters/__init__.py +0 -0
- aevs/adapters/base.py +57 -0
- aevs/adapters/langchain.py +229 -0
- aevs/adapters/mcp.py +278 -0
- aevs/config.py +170 -0
- aevs/core/__init__.py +0 -0
- aevs/core/buffer.py +329 -0
- aevs/core/client.py +278 -0
- aevs/core/receipt.py +129 -0
- aevs/core/serializer.py +103 -0
- aevs/core/signer.py +40 -0
- aevs/core/types.py +32 -0
- aevs/crypto/__init__.py +0 -0
- aevs/crypto/chain.py +39 -0
- aevs/crypto/hkdf.py +16 -0
- aevs/crypto/hmac_auth.py +12 -0
- aevs/exceptions.py +18 -0
- aevs/py.typed +0 -0
- aevs-0.1.0.dist-info/LICENSE +21 -0
- aevs-0.1.0.dist-info/METADATA +263 -0
- aevs-0.1.0.dist-info/RECORD +26 -0
- aevs-0.1.0.dist-info/WHEEL +4 -0
aevs/__init__.py
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
from aevs._version import __version__
|
|
2
|
+
from aevs.config import AEVSConfig, configure, reset_config
|
|
3
|
+
from aevs.exceptions import (
|
|
4
|
+
AEVSAuthError,
|
|
5
|
+
AEVSBufferError,
|
|
6
|
+
AEVSConfigError,
|
|
7
|
+
AEVSError,
|
|
8
|
+
AEVSSerializationError,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"__version__",
|
|
13
|
+
"AEVSAuthError",
|
|
14
|
+
"AEVSBufferError",
|
|
15
|
+
"AEVSConfig",
|
|
16
|
+
"AEVSConfigError",
|
|
17
|
+
"AEVSError",
|
|
18
|
+
"AEVSSerializationError",
|
|
19
|
+
"clear_reference_ids",
|
|
20
|
+
"configure",
|
|
21
|
+
"disable",
|
|
22
|
+
"enable",
|
|
23
|
+
"flush",
|
|
24
|
+
"get_reference_id",
|
|
25
|
+
"get_reference_ids",
|
|
26
|
+
"get_session_id",
|
|
27
|
+
"is_healthy",
|
|
28
|
+
"reset_config",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def enable(*, frameworks: list[str] | None = None) -> None:
|
|
33
|
+
"""Detect installed frameworks and patch them to intercept tool calls."""
|
|
34
|
+
from aevs._api import enable as _enable
|
|
35
|
+
|
|
36
|
+
_enable(frameworks=frameworks)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def disable() -> None:
|
|
40
|
+
"""Unpatch all frameworks, restore original behavior."""
|
|
41
|
+
from aevs._api import disable as _disable
|
|
42
|
+
|
|
43
|
+
_disable()
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def flush() -> None:
|
|
47
|
+
"""Force-send all buffered receipts to the backend."""
|
|
48
|
+
from aevs._api import flush as _flush
|
|
49
|
+
|
|
50
|
+
_flush()
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def is_healthy(*, threshold: int = 3) -> bool:
|
|
54
|
+
"""Return ``False`` when the receipt buffer has had *threshold* or more
|
|
55
|
+
consecutive write failures — indicating a sustained storage problem.
|
|
56
|
+
|
|
57
|
+
Safe to call at any time; never raises.
|
|
58
|
+
"""
|
|
59
|
+
from aevs._api import is_healthy as _is_healthy
|
|
60
|
+
|
|
61
|
+
return _is_healthy(threshold=threshold)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def get_reference_id(lookup_id: str) -> str | None:
|
|
65
|
+
"""Return the AEVS reference_id for a run_id or tool_call_id."""
|
|
66
|
+
from aevs._api import get_reference_id as _get
|
|
67
|
+
|
|
68
|
+
return _get(lookup_id)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def get_reference_ids(*, clear: bool = False) -> list[dict[str, str | int | None]]:
|
|
72
|
+
"""Return all reference entries recorded since the last clear.
|
|
73
|
+
|
|
74
|
+
Pass ``clear=True`` to empty the registry after reading (recommended
|
|
75
|
+
for per-request web applications).
|
|
76
|
+
"""
|
|
77
|
+
from aevs._api import get_reference_ids as _get
|
|
78
|
+
|
|
79
|
+
return _get(clear=clear)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def clear_reference_ids() -> None:
|
|
83
|
+
"""Drop all stored reference entries."""
|
|
84
|
+
from aevs._api import clear_reference_ids as _clear
|
|
85
|
+
|
|
86
|
+
_clear()
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def get_session_id() -> str | None:
|
|
90
|
+
"""Return the active AEVS session UUID, or ``None`` when disabled.
|
|
91
|
+
|
|
92
|
+
A new UUIDv4 is minted on each ``enable()`` (or recovered from the
|
|
93
|
+
buffer on mid-session crash recovery). Useful for log correlation —
|
|
94
|
+
every receipt in the session carries this id and the chain anchor
|
|
95
|
+
is derived from it.
|
|
96
|
+
"""
|
|
97
|
+
from aevs._api import get_session_id as _get
|
|
98
|
+
|
|
99
|
+
return _get()
|