agent-context-graph 0.1.9__tar.gz → 0.3.0__tar.gz

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 (45) hide show
  1. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/.gitignore +3 -5
  2. agent_context_graph-0.3.0/CONTEXT.md +97 -0
  3. agent_context_graph-0.3.0/PKG-INFO +603 -0
  4. agent_context_graph-0.3.0/README.md +579 -0
  5. agent_context_graph-0.3.0/docs/adr/0001-runtime-adapter-terminology.md +3 -0
  6. agent_context_graph-0.3.0/docs/adr/0002-config-file-only-hook-resolution.md +7 -0
  7. agent_context_graph-0.3.0/docs/adr/0003-config-path-override.md +26 -0
  8. agent_context_graph-0.3.0/docs/adr/0004-user-id-in-session-start-event.md +3 -0
  9. agent_context_graph-0.3.0/docs/adr/0005-config-file-covers-llm-key-and-subprocess-env.md +13 -0
  10. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/docs/command-hooks.md +42 -0
  11. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/pyproject.toml +9 -1
  12. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/src/agent_context_graph/__init__.py +10 -2
  13. agent_context_graph-0.3.0/src/agent_context_graph/adapters/_identity.py +434 -0
  14. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/src/agent_context_graph/adapters/claude.py +26 -9
  15. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/src/agent_context_graph/adapters/claude_code.py +51 -178
  16. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/src/agent_context_graph/adapters/codex.py +126 -177
  17. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/src/agent_context_graph/cli.py +214 -30
  18. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/src/agent_context_graph/events.py +1 -0
  19. agent_context_graph-0.3.0/src/agent_context_graph/hooks/cli.py +154 -0
  20. agent_context_graph-0.3.0/src/agent_context_graph/hooks/runner.py +222 -0
  21. agent_context_graph-0.3.0/src/agent_context_graph/hooks/runtime_plugin.py +79 -0
  22. agent_context_graph-0.3.0/src/agent_context_graph/mcp_server.py +76 -0
  23. agent_context_graph-0.3.0/src/agent_context_graph/tools.py +95 -0
  24. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/tests/test_claude_code_adapter.py +87 -6
  25. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/tests/test_codex_adapter.py +46 -4
  26. agent_context_graph-0.3.0/tests/test_config_cli.py +92 -0
  27. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/tests/test_hook_cli.py +48 -12
  28. agent_context_graph-0.3.0/tests/test_identity.py +258 -0
  29. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/tests/test_link.py +8 -3
  30. agent_context_graph-0.3.0/tests/test_runner_sessions_graph_connector.py +81 -0
  31. agent_context_graph-0.3.0/tests/test_runtime_plugin.py +50 -0
  32. agent_context_graph-0.3.0/tests/test_tools.py +149 -0
  33. agent_context_graph-0.1.9/PKG-INFO +0 -406
  34. agent_context_graph-0.1.9/README.md +0 -385
  35. agent_context_graph-0.1.9/src/agent_context_graph/adapters/_identity.py +0 -266
  36. agent_context_graph-0.1.9/src/agent_context_graph/hooks/cli.py +0 -249
  37. agent_context_graph-0.1.9/tests/test_identity.py +0 -135
  38. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/LICENSE +0 -0
  39. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/src/agent_context_graph/adapters/__init__.py +0 -0
  40. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/src/agent_context_graph/adapters/openai.py +0 -0
  41. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/src/agent_context_graph/hooks/__init__.py +0 -0
  42. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/src/agent_context_graph/link.py +0 -0
  43. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/src/agent_context_graph/protocols.py +0 -0
  44. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/tests/__init__.py +0 -0
  45. {agent_context_graph-0.1.9 → agent_context_graph-0.3.0}/tests/test_events.py +0 -0
@@ -181,12 +181,10 @@ cython_debug/
181
181
  # Local agent hook configuration
182
182
  /.codex/
183
183
  /.claude/settings.local.json
184
- /AGENTS.md
185
184
  /docs/agents/
186
- /context-graph/CONTEXT-MAP.md
187
- /context-graph/*/CONTEXT.md
188
- /context-graph/docs/adr/
189
- /context-graph/*/docs/adr/
190
185
 
191
186
  # Project specific files
192
187
  /enterprise-context/sic-agent/sic-scrapper/output/*
188
+
189
+ # deepeval writes run caches and telemetry here; build artifacts, not source.
190
+ .deepeval/
@@ -0,0 +1,97 @@
1
+ # Agent Context Graph
2
+
3
+ Adapter layer for Context Graph components. Normalizes agent SDK + runtime activity into events, routes to graph connectors.
4
+
5
+ ## Language
6
+
7
+ **Agent Context Graph**:
8
+ Adapter layer normalizing agent SDK + runtime activity into events, routing to graph connectors.
9
+ _Avoid_: Graph storage, skills graph, memory store
10
+
11
+ **Graph Connector**:
12
+ Integration point, owned by a graph component, deciding which normalized events matter to it + persisting their meaning.
13
+ _Avoid_: Adapter, hook, writer
14
+
15
+ **Agent Development SDK**:
16
+ Framework for building agent apps; integrations usually attach via in-process callbacks/hook objects.
17
+ _Avoid_: Runtime hook, command hook
18
+
19
+ **Runtime Hook**:
20
+ Hook emitted by an agent runtime around an already-running session, often via external command + JSON payload.
21
+ _Avoid_: Agent development SDK
22
+
23
+ **Runtime Adapter**:
24
+ Integration point translating one SDK/runtime-hook shape into shared event protocol.
25
+ _Avoid_: Graph connector, storage adapter
26
+
27
+ **Runtime Plugin**:
28
+ Host-specific distribution package installing runtime hooks, skills, commands, setup helpers, other host-native integration files.
29
+ _Avoid_: Graph component, graph connector, storage layer
30
+
31
+ **Codex Plugin**:
32
+ Runtime Plugin for OpenAI Codex; wires Codex lifecycle hooks to an Agent Context Graph runtime adapter entrypoint.
33
+ _Avoid_: Codex graph, skills graph plugin
34
+
35
+ **Claude Code Plugin**:
36
+ Runtime Plugin for Claude Code; wires Claude Code lifecycle hooks to an Agent Context Graph runtime adapter entrypoint.
37
+ _Avoid_: Claude graph, skills graph plugin
38
+
39
+ **Event Protocol**:
40
+ Runtime-agnostic set of agent activity events, emitted by runtime adapters, consumed by graph connectors.
41
+ _Avoid_: Graph event, graph protocol, hook payload, callback data
42
+
43
+ **Agent Session**:
44
+ Runtime-side unit of agent activity grouping related events under shared session identifier.
45
+ _Avoid_: Session node
46
+
47
+ **Hook Configuration**:
48
+ Persistent TOML file supplying identity + connection settings to hook subprocesses. Default path `~/.config/context-graph/config.toml`; `CONTEXT_GRAPH_CONFIG` may select another file. At hook runtime, config values come only from selected file. Env var selects file; never supplies a value from it.
49
+ _Avoid_: env config, runtime config, shell config
50
+
51
+ **Runtime Registration**:
52
+ Python object implementing `RuntimeCLIPlugin`. Package publishes it via `agent_context_graph.runtimes` entry-point group. CLI resolves runtime name through it to find adapter, hook response, hook config, optional initializer.
53
+
54
+ Not a **Runtime Plugin**: plugin installs host-facing files; registration lets Agent Context Graph discover runtime support via `importlib.metadata.entry_points()`. Adding one needs no central registry change.
55
+ _Avoid_: Runtime Plugin (already means distribution package), Runtime Adapter (a Runtime Registration *references* one via `adapter_class`, isn't one)
56
+
57
+ **Tool Registration**:
58
+ Object implementing `Tool` (`tools.py`): a name, a description the model reads, an input schema, the connector whose graph it reads, an optional session-start hint, and `call(arguments, config)`. A graph component publishes it via the `agent_context_graph.tools` entry-point group; `agent-context-graph mcp` serves every registered tool, and the CLI runs one by name. Identity + connection come from **Hook Configuration**, never from tool arguments.
59
+ _Avoid_: MCP tool (the protocol it is served over, not the thing), Graph Connector (writes events; a tool reads)
60
+
61
+ ## Relationships
62
+
63
+ - **Agent Context Graph** belongs to broader **Context Graph** family.
64
+ - **Agent Context Graph** routes events to graph connectors owned by graph components.
65
+ - **Graph Connector** consumes normalized events emitted by **Agent Context Graph**.
66
+ - **Agent Development SDK** integration + **Runtime Hook** integration both use a **Runtime Adapter** to emit same event protocol.
67
+ - **Runtime Plugin** = deployment surface for runtime hooks/setup helpers; not a graph component.
68
+ - **Codex Plugin** installs Codex hook wiring invoking the Codex runtime adapter command.
69
+ - **Claude Code Plugin** installs Claude Code hook wiring invoking the Claude Code runtime adapter command.
70
+ - **Event Protocol** carries agent activity, not graph semantics.
71
+ - **Agent Session** may be persisted as a session node by a graph component; **Event Protocol** only carries the session identifier.
72
+ - Tool/message events carry `agent_name` when runtime identifies a subagent. Agent Context Graph only transports this id; Graph Connectors decide how to use it. Codex adapter doesn't yet handle subagent lifecycle/ids ([#275](https://github.com/memgraph/ai-toolkit/issues/275)).
73
+ - Runtime Plugin's generated command calls `hook run <name>`. CLI resolves name via Runtime Registration; plugin never names an adapter class directly.
74
+ - Built-in Runtime Registrations: `codex`, `claude-code`. Other packages may publish more.
75
+
76
+ ## Example dialogue
77
+
78
+ > **Dev:** "Should Agent Context Graph write the skill usage edge?"
79
+ > **Domain expert:** "No. Agent Context Graph emits the tool event; Skills Graph decides whether that event represents skill usage."
80
+
81
+ > **Dev:** "Are OpenAI Agents SDK and Codex hooks the same kind of integration?"
82
+ > **Domain expert:** "No. OpenAI Agents SDK is for agent development; Codex hooks are runtime hooks. Both become normalized events before graph connectors see them."
83
+
84
+ > **Dev:** "Should the Codex plugin know how to write skill usage?"
85
+ > **Domain expert:** "No. Plugin installs hook wiring. Codex runtime adapter emits events. Skills Graph decides if those events mean skill usage."
86
+
87
+ ## Flagged ambiguities
88
+
89
+ - "graph" = umbrella **Context Graph** family or specific component? Resolved: **Agent Context Graph** = adapter layer only, never persistence.
90
+ - "connector" can sound like generic transport plumbing. Resolved: **Graph Connector** owns graph-specific event interpretation.
91
+ - "adapter" can mean SDK integrations or runtime hooks. Resolved: **Runtime Adapter** = anything translating agent activity into shared event protocol.
92
+ - "SDK adapter" too narrow: Codex command hooks are runtime hooks, not SDK callbacks. Resolved: code/docs use **Runtime Adapter**.
93
+ - "event" shouldn't carry graph nomenclature. Resolved: graph meaning assigned by **Graph Connectors**, not **Event Protocol**.
94
+ - "Session" = activity or graph state? Use **Agent Session** for activity, "session node" for persisted state.
95
+ - "Plugin" can sound like a graph extension. Use **Runtime Plugin** for host-specific distribution; Graph Connectors own graph interpretation.
96
+ - Entry-point discovery = **Runtime Registration**, not a runtime/CLI plugin ([#269](https://github.com/memgraph/ai-toolkit/issues/269)).
97
+ - Code hasn't fully caught up to **Runtime Adapter** terminology: Event Protocol's `source_sdk` field (`events.py`, set by all 4 adapters, read by Actions Graph's connector) still names the rejected term (ADR 0001). Rename to e.g. `source_adapter` tracked, not done.