agentdatabase 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.
- agentdatabase-0.1.0.dist-info/METADATA +847 -0
- agentdatabase-0.1.0.dist-info/RECORD +35 -0
- agentdatabase-0.1.0.dist-info/WHEEL +5 -0
- agentdatabase-0.1.0.dist-info/entry_points.txt +2 -0
- agentdatabase-0.1.0.dist-info/licenses/LICENSE +651 -0
- agentdatabase-0.1.0.dist-info/top_level.txt +1 -0
- agentdb/__init__.py +5 -0
- agentdb/adapters/claude_agent_sdk.py +831 -0
- agentdb/adapters/hermes.py +247 -0
- agentdb/backend.py +75 -0
- agentdb/core/__init__.py +19 -0
- agentdb/core/directory_tracking.py +59 -0
- agentdb/core/file_integrity.py +79 -0
- agentdb/core/models.py +90 -0
- agentdb/core/profiles.py +116 -0
- agentdb/core/store.py +373 -0
- agentdb/core/system.py +86 -0
- agentdb/embeddings/__init__.py +7 -0
- agentdb/embeddings/provider.py +99 -0
- agentdb/embeddings/store.py +199 -0
- agentdb/embeddings/text.py +20 -0
- agentdb/gateway/__init__.py +189 -0
- agentdb/gateway/adapter.py +58 -0
- agentdb/governance/__init__.py +3 -0
- agentdb/governance/conflict_detector.py +103 -0
- agentdb/governance/lifecycle_manager.py +226 -0
- agentdb/governance/permission_router.py +131 -0
- agentdb/interface/__init__.py +25 -0
- agentdb/interface/client.py +1108 -0
- agentdb/interface/mcp_server.py +96 -0
- agentdb/retrieval/__init__.py +3 -0
- agentdb/retrieval/algorithm.py +207 -0
- agentdb/skills/__init__.py +3 -0
- agentdb/skills/skill_store.py +351 -0
- agentdb/testing.py +68 -0
agentdb/testing.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Test doubles for AgentDB adapters, maintained alongside the real classes so
|
|
3
|
+
downstream integrations don't need to hand-roll and manually keep a fake in
|
|
4
|
+
sync with real constructor signatures. tests/unit/test_testing_fakes.py
|
|
5
|
+
asserts the fakes' curated params still exist on the real adapter — any
|
|
6
|
+
drift is caught here, in this repo's own suite, not downstream in
|
|
7
|
+
production (see docs/integrations/claude-agent-sdk-gateway-guide.md for the
|
|
8
|
+
incident that motivated this module).
|
|
9
|
+
"""
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from typing import Any, Optional
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class FakeAgentDBClaudeMiddleware:
|
|
16
|
+
"""
|
|
17
|
+
Minimal in-memory stand-in for AgentDBClaudeMiddleware, for downstream
|
|
18
|
+
apps testing their OWN wiring code (e.g. "did we pass the right
|
|
19
|
+
constructor args?") without needing a real AgentDB/SQLite instance or
|
|
20
|
+
re-testing AgentDB's own retrieval/persistence logic.
|
|
21
|
+
|
|
22
|
+
Deliberately does not implement prepare_turn/finalize_turn/run_turn —
|
|
23
|
+
those exercise real retrieval and persistence behavior already covered
|
|
24
|
+
by AgentDB's own test suite; faking them here would just be
|
|
25
|
+
re-implementing (and risking diverging from) that logic. Use a real
|
|
26
|
+
AgentDBClaudeMiddleware backed by a tmp-path SQLite AgentDB instance if
|
|
27
|
+
you need to test turn behavior itself.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
def __init__(
|
|
31
|
+
self,
|
|
32
|
+
db: Any,
|
|
33
|
+
agent_id: str,
|
|
34
|
+
) -> None:
|
|
35
|
+
self.db = db
|
|
36
|
+
self.agent_id = agent_id
|
|
37
|
+
self._conflicts: list = []
|
|
38
|
+
self._proposals: dict[str, dict] = {}
|
|
39
|
+
|
|
40
|
+
def pending_conflicts(self, resolved: bool = False) -> list:
|
|
41
|
+
return self._conflicts
|
|
42
|
+
|
|
43
|
+
def propose_skill(
|
|
44
|
+
self,
|
|
45
|
+
name: str,
|
|
46
|
+
content: str,
|
|
47
|
+
scope: list[str],
|
|
48
|
+
entities: Optional[list[str]] = None,
|
|
49
|
+
session_id: Optional[str] = None,
|
|
50
|
+
) -> str:
|
|
51
|
+
proposal_id = f"fake-proposal-{len(self._proposals) + 1}"
|
|
52
|
+
self._proposals[proposal_id] = {
|
|
53
|
+
"proposal_id": proposal_id,
|
|
54
|
+
"name": name,
|
|
55
|
+
"content": content,
|
|
56
|
+
"scope": scope,
|
|
57
|
+
"status": "pending",
|
|
58
|
+
}
|
|
59
|
+
return proposal_id
|
|
60
|
+
|
|
61
|
+
def approve_proposal(self, proposal_id: str, resolution: Optional[str] = None) -> None:
|
|
62
|
+
self._proposals[proposal_id]["status"] = "approved"
|
|
63
|
+
|
|
64
|
+
def reject_proposal(self, proposal_id: str, reason: Optional[str] = None) -> None:
|
|
65
|
+
self._proposals[proposal_id]["status"] = "rejected"
|
|
66
|
+
|
|
67
|
+
def list_proposals(self, status: str = "pending") -> list[dict]:
|
|
68
|
+
return [p for p in self._proposals.values() if p["status"] == status]
|