memgraph-context-graph 0.6.0__tar.gz → 0.7.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.
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/PKG-INFO +1 -2
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/pyproject.toml +1 -4
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/setup/cli.py +18 -5
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/setup/engine.py +25 -8
- memgraph_context_graph-0.7.0/src/memgraph_context_graph/setup/prompts.py +675 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_setup.py +194 -51
- memgraph_context_graph-0.6.0/src/memgraph_context_graph/setup/tui.py +0 -227
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/.gitignore +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/CONTEXT.md +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/LICENSE +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/README.md +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/docs/adr/0001-runtime-adapter-terminology.md +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/docs/adr/0002-config-file-only-hook-resolution.md +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/docs/adr/0003-config-path-override.md +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/docs/adr/0004-user-id-in-session-start-event.md +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/docs/adr/0005-config-file-covers-llm-key-and-subprocess-env.md +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/docs/adr/0006-memory-tool-writes-explicit-memory.md +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/docs/command-hooks.md +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/docs/research/2026-10-codex-memory.md +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/__init__.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/__init__.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/_identity.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/_opencode_plugin.js +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/_spec.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/antigravity_cli.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/claude.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/claude_code.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/claude_code_memory.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/codex.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/codex_memory.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/copilot_cli.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/cursor.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/grok.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/openai.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/adapters/opencode.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/capture_log.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/cli.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/events.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/hooks/__init__.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/hooks/cli.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/hooks/runner.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/hooks/runtime_plugin.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/link.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/mcp_server.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/memory_backend.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/protocols.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/setup/__init__.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/setup/agents.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/setup/memgraph.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/setup/tool.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/setup/uninstall.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/spaces.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/src/memgraph_context_graph/tools.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/__init__.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/conftest.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/fake_agent_cli.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_antigravity_cli_adapter.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_capture_log.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_claude_code_adapter.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_codex_adapter.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_config_cli.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_context_before_tool.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_copilot_cli_adapter.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_cursor_adapter.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_dev_scripts.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_events.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_grok_adapter.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_hook_cli.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_identity.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_link.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_opencode_adapter.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_plugin_hooks.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_runner_sessions_graph_connector.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_runtime_plugin.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_setup_docker.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_spaces.py +0 -0
- {memgraph_context_graph-0.6.0 → memgraph_context_graph-0.7.0}/tests/test_tools.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: memgraph-context-graph
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Connect agent SDKs to context-graph components (actions-graph, skills-graph, etc.)
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -10,7 +10,6 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.13
|
|
11
11
|
Requires-Python: >=3.10
|
|
12
12
|
Requires-Dist: memgraph-toolbox>=0.1.11
|
|
13
|
-
Requires-Dist: textual<9,>=8.2
|
|
14
13
|
Requires-Dist: tomlkit<1,>=0.13
|
|
15
14
|
Provides-Extra: claude
|
|
16
15
|
Requires-Dist: claude-agent-sdk>=0.1.0; extra == 'claude'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "memgraph-context-graph"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.7.0"
|
|
4
4
|
description = "Connect agent SDKs to context-graph components (actions-graph, skills-graph, etc.)"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = { text = "MIT" }
|
|
@@ -15,9 +15,6 @@ dependencies = [
|
|
|
15
15
|
"memgraph-toolbox>=0.1.11",
|
|
16
16
|
# Edits ~/.codex/config.toml when switching Codex's memory, keeping the user's comments and layout.
|
|
17
17
|
"tomlkit>=0.13,<1",
|
|
18
|
-
# setup's interactive installer. Imported only when it runs, so hooks never load it; pinned to the
|
|
19
|
-
# major the viewer uses, since Textual's API moves between majors.
|
|
20
|
-
"textual>=8.2,<9",
|
|
21
18
|
]
|
|
22
19
|
|
|
23
20
|
[project.scripts]
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""``memgraph-context-graph setup`` and ``uninstall``: flags, and the plain front end.
|
|
2
2
|
|
|
3
|
-
The
|
|
4
|
-
``</dev/tty`` stdin is the script, and
|
|
3
|
+
The interactive front end (the questions in ``prompts.py``) runs only when stdin and stdout are both
|
|
4
|
+
terminals. Under ``curl | bash`` without ``</dev/tty`` stdin is the script, and it would wait for keys that
|
|
5
|
+
can never arrive (#534).
|
|
5
6
|
"""
|
|
6
7
|
|
|
7
8
|
from __future__ import annotations
|
|
@@ -55,9 +56,20 @@ def setup_main(argv: Sequence[str]) -> int:
|
|
|
55
56
|
)
|
|
56
57
|
parser.add_argument("--plan", action="store_true", help="print what setup would do, and change nothing")
|
|
57
58
|
parser.add_argument("--no-tui", action="store_true", help="plain output even on a terminal") # fmt: skip
|
|
59
|
+
parser.add_argument("--no-banner", action="store_true", help="don't draw the Memgraph wordmark first")
|
|
58
60
|
args = parser.parse_args(list(argv))
|
|
59
61
|
_check_runtimes(parser, args.runtimes)
|
|
60
62
|
|
|
63
|
+
interactive = not args.plan and not args.no_tui and _interactive()
|
|
64
|
+
terminal = None
|
|
65
|
+
if interactive:
|
|
66
|
+
from memgraph_context_graph.setup.prompts import Prompts, StdTerminal
|
|
67
|
+
|
|
68
|
+
terminal = StdTerminal()
|
|
69
|
+
if not args.no_banner:
|
|
70
|
+
# Drawn before looking around, which asks each agent's CLI and can take a second or more.
|
|
71
|
+
Prompts(terminal).banner()
|
|
72
|
+
|
|
61
73
|
env = engine.look_around()
|
|
62
74
|
choices = engine.default_choices(
|
|
63
75
|
env,
|
|
@@ -72,10 +84,11 @@ def setup_main(argv: Sequence[str]) -> int:
|
|
|
72
84
|
if args.plan:
|
|
73
85
|
_print_plan(choices, env)
|
|
74
86
|
return 0
|
|
75
|
-
if
|
|
76
|
-
from memgraph_context_graph.setup.
|
|
87
|
+
if interactive:
|
|
88
|
+
from memgraph_context_graph.setup.prompts import run_setup_prompts
|
|
77
89
|
|
|
78
|
-
|
|
90
|
+
# Agents named on the command line start ticked; otherwise the ones already set up are.
|
|
91
|
+
return run_setup_prompts(choices, env, terminal, banner=False, preselect=bool(args.runtimes))
|
|
79
92
|
_print_plan(choices, env)
|
|
80
93
|
print()
|
|
81
94
|
outcomes = engine.run(choices, env, log=_log, report=_report)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""What setup will do and does: the choices, the steps they turn into, and the outcome of each.
|
|
2
2
|
|
|
3
|
-
Both front ends (plain and
|
|
3
|
+
Both front ends (plain, and the questions) build :class:`Choices`, show :func:`plan` and call :func:`run`; neither
|
|
4
4
|
does any work itself. Every step checks before it changes anything, so running setup again reports
|
|
5
5
|
"already" instead of redoing work (#533).
|
|
6
6
|
"""
|
|
@@ -57,21 +57,34 @@ class Environment:
|
|
|
57
57
|
configured_url: str | None
|
|
58
58
|
configured_user: str | None
|
|
59
59
|
found_agents: tuple[str, ...]
|
|
60
|
+
#: Found agents that already capture: their plugin is installed, or the current project is wired.
|
|
61
|
+
wired_agents: tuple[str, ...] = ()
|
|
62
|
+
configured_memory_backend: str | None = None
|
|
60
63
|
|
|
61
64
|
|
|
62
|
-
def look_around() -> Environment:
|
|
63
|
-
"""Read the config file and
|
|
65
|
+
def look_around(cwd: Path | None = None) -> Environment:
|
|
66
|
+
"""Read the config file, PATH and what is already wired (plugins, and *cwd*'s hook files); changes nothing."""
|
|
64
67
|
from memgraph_context_graph.adapters._identity import load_config
|
|
65
68
|
|
|
66
69
|
config = load_config()
|
|
70
|
+
cwd = (cwd or Path.cwd()).resolve()
|
|
71
|
+
found = agents_mod.detected()
|
|
67
72
|
return Environment(
|
|
68
73
|
edition=config.edition or "community",
|
|
69
74
|
configured_url=config.memgraph_url if "memgraph.url" in config.present else None,
|
|
70
75
|
configured_user=config.user_id if "identity.user_id" in config.present and config.user_id else None,
|
|
71
|
-
found_agents=tuple(agent.runtime for agent in
|
|
76
|
+
found_agents=tuple(agent.runtime for agent in found),
|
|
77
|
+
wired_agents=tuple(agent.runtime for agent in found if _wired(agent, cwd)),
|
|
78
|
+
configured_memory_backend=config.memory_backend,
|
|
72
79
|
)
|
|
73
80
|
|
|
74
81
|
|
|
82
|
+
def _wired(agent: agents_mod.Agent, cwd: Path) -> bool:
|
|
83
|
+
if agent.wiring == "plugin":
|
|
84
|
+
return agents_mod.plugin_wired(agent)
|
|
85
|
+
return cwd != Path.home().resolve() and agents_mod.project_wired(agent, cwd)
|
|
86
|
+
|
|
87
|
+
|
|
75
88
|
def default_choices(
|
|
76
89
|
env: Environment,
|
|
77
90
|
*,
|
|
@@ -130,7 +143,9 @@ def plan(choices: Choices, env: Environment) -> list[str]:
|
|
|
130
143
|
lines.append(f"Packages: install {', '.join(packages)}" if packages else "Packages: all installed")
|
|
131
144
|
for runtime in choices.runtimes:
|
|
132
145
|
agent = agents_mod.BY_RUNTIME[runtime]
|
|
133
|
-
if agent.wiring == "plugin":
|
|
146
|
+
if agent.wiring == "plugin" and runtime in env.wired_agents:
|
|
147
|
+
lines.append(f"{agent.label}: plugin already installed; checked again")
|
|
148
|
+
elif agent.wiring == "plugin":
|
|
134
149
|
lines.append(f"{agent.label}: install the Context Graph plugin (user-wide)")
|
|
135
150
|
elif choices.project_dirs:
|
|
136
151
|
lines.append(f"{agent.label}: wire {', '.join(str(path) for path in choices.project_dirs)}")
|
|
@@ -138,10 +153,11 @@ def plan(choices: Choices, env: Environment) -> list[str]:
|
|
|
138
153
|
lines.append(f"{agent.label}: skipped, no project directory (pass --project-dir)")
|
|
139
154
|
if choices.memory_backend:
|
|
140
155
|
switchable = [
|
|
141
|
-
agents_mod.BY_RUNTIME[runtime].label for runtime in choices.runtimes if
|
|
156
|
+
agents_mod.BY_RUNTIME[runtime].label for runtime in choices.runtimes if has_native_memory(runtime)
|
|
142
157
|
]
|
|
158
|
+
already = "; already set, checked again" if choices.memory_backend == env.configured_memory_backend else ""
|
|
143
159
|
if switchable:
|
|
144
|
-
lines.append(f"Memory: memory.backend = {choices.memory_backend} for {' and '.join(switchable)}")
|
|
160
|
+
lines.append(f"Memory: memory.backend = {choices.memory_backend} for {' and '.join(switchable)}{already}")
|
|
145
161
|
else:
|
|
146
162
|
lines.append("Memory: no selected agent has a built-in memory to switch")
|
|
147
163
|
lines.append("Verify: doctor's checks, and each agent's hook probe")
|
|
@@ -183,7 +199,8 @@ def run(
|
|
|
183
199
|
return outcomes
|
|
184
200
|
|
|
185
201
|
|
|
186
|
-
def
|
|
202
|
+
def has_native_memory(runtime: str) -> bool:
|
|
203
|
+
"""Whether *runtime* has a built-in memory that ``--memory-backend`` can switch."""
|
|
187
204
|
from memgraph_context_graph.hooks.runtime_plugin import get_runtime_plugin
|
|
188
205
|
from memgraph_context_graph.memory_backend import native_memory_of
|
|
189
206
|
|