ctxgraph 0.5.1__tar.gz → 0.5.2__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.
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/PKG-INFO +2 -2
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/README.md +1 -1
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/pyproject.toml +1 -1
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/mcp/server.py +68 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph.egg-info/PKG-INFO +2 -2
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/setup.cfg +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/analyzers/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/analyzers/python/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/analyzers/python/importer.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/analyzers/python/semantic.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/analyzers/python/symbols.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/capsule/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/capsule/renderer.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/capsule/savings.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/chat.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/cli/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/cli/main.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/clients/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/clients/models.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/config/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/config/init.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/config/providers.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/config/settings.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/exclude/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/exclude/patterns.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/graph/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/graph/builder.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/graph/models.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/graph/query.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/graph/storage.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/history.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/mcp/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/skills/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/skills/field-guide.toml +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/skills/project-style.toml +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/skills/template.example.toml +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/view/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/view/visualizer.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/wrapper/__init__.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph/wrapper/claude.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph.egg-info/SOURCES.txt +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph.egg-info/dependency_links.txt +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph.egg-info/entry_points.txt +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph.egg-info/requires.txt +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/src/ctxgraph.egg-info/top_level.txt +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/tests/test_analyzers.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/tests/test_benchmark.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/tests/test_capsule.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/tests/test_config.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/tests/test_e2e.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/tests/test_integration.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/tests/test_model_mode.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/tests/test_models.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/tests/test_query.py +0 -0
- {ctxgraph-0.5.1 → ctxgraph-0.5.2}/tests/test_storage.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ctxgraph
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: 97% cheaper AI coding. ctxgraph builds a knowledge graph of your Python codebase, then generates token-efficient context capsules for any AI tool. Or hook up Ollama/Claude/OpenAI and use it as a code-aware coding assistant — like ChatGPT or Claude Code, but with built-in graph context. Cut token costs by 97%, work offline with just a graph, or connect your favorite LLM.
|
|
5
5
|
Author: ctxgraph contributors
|
|
6
6
|
License: MIT
|
|
@@ -545,7 +545,7 @@ Or set the `CTXGRAPH_REPO_PATH` environment variable instead of passing `--repo`
|
|
|
545
545
|
}
|
|
546
546
|
```
|
|
547
547
|
|
|
548
|
-
Tools: `search_graph`, `get_context_capsule`, `get_file_dependencies`, `get_project_overview`.
|
|
548
|
+
Tools: `search_graph`, `get_context_capsule`, `get_file_dependencies`, `get_project_overview`, `read_file`, `search_files`.
|
|
549
549
|
|
|
550
550
|
> **Windows users:** Claude Desktop may not set the working directory to your project root. Always use `--repo` or `CTXGRAPH_REPO_PATH` to ensure the server can find your graph.
|
|
551
551
|
|
|
@@ -516,7 +516,7 @@ Or set the `CTXGRAPH_REPO_PATH` environment variable instead of passing `--repo`
|
|
|
516
516
|
}
|
|
517
517
|
```
|
|
518
518
|
|
|
519
|
-
Tools: `search_graph`, `get_context_capsule`, `get_file_dependencies`, `get_project_overview`.
|
|
519
|
+
Tools: `search_graph`, `get_context_capsule`, `get_file_dependencies`, `get_project_overview`, `read_file`, `search_files`.
|
|
520
520
|
|
|
521
521
|
> **Windows users:** Claude Desktop may not set the working directory to your project root. Always use `--repo` or `CTXGRAPH_REPO_PATH` to ensure the server can find your graph.
|
|
522
522
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ctxgraph"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.2"
|
|
8
8
|
description = "97% cheaper AI coding. ctxgraph builds a knowledge graph of your Python codebase, then generates token-efficient context capsules for any AI tool. Or hook up Ollama/Claude/OpenAI and use it as a code-aware coding assistant — like ChatGPT or Claude Code, but with built-in graph context. Cut token costs by 97%, work offline with just a graph, or connect your favorite LLM."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -149,6 +149,34 @@ def create_server(repo_path: Optional[str] = None) -> Optional[Any]:
|
|
|
149
149
|
"properties": {},
|
|
150
150
|
},
|
|
151
151
|
),
|
|
152
|
+
types.Tool(
|
|
153
|
+
name="read_file",
|
|
154
|
+
description="Read the full contents of a source file from the repository",
|
|
155
|
+
inputSchema={
|
|
156
|
+
"type": "object",
|
|
157
|
+
"properties": {
|
|
158
|
+
"file_path": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"description": "Path to the file (relative to repo root)",
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
"required": ["file_path"],
|
|
164
|
+
},
|
|
165
|
+
),
|
|
166
|
+
types.Tool(
|
|
167
|
+
name="search_files",
|
|
168
|
+
description="Search for files in the repository matching a glob pattern",
|
|
169
|
+
inputSchema={
|
|
170
|
+
"type": "object",
|
|
171
|
+
"properties": {
|
|
172
|
+
"pattern": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"description": "Glob pattern (e.g. '**/*.py', 'src/**/*service*', '**/*test*')",
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
"required": ["pattern"],
|
|
178
|
+
},
|
|
179
|
+
),
|
|
152
180
|
]
|
|
153
181
|
|
|
154
182
|
@server.call_tool()
|
|
@@ -209,6 +237,46 @@ def create_server(repo_path: Optional[str] = None) -> Optional[Any]:
|
|
|
209
237
|
overview = render_project_overview(storage)
|
|
210
238
|
return [types.TextContent(type="text", text=overview)]
|
|
211
239
|
|
|
240
|
+
elif name == "read_file":
|
|
241
|
+
file_path = arguments.get("file_path", "")
|
|
242
|
+
full_path = (path / file_path).resolve()
|
|
243
|
+
if not str(full_path).startswith(str(path.resolve())):
|
|
244
|
+
return [types.TextContent(
|
|
245
|
+
type="text",
|
|
246
|
+
text=f"Access denied: {file_path} is outside the repository root.",
|
|
247
|
+
)]
|
|
248
|
+
if not full_path.exists():
|
|
249
|
+
return [types.TextContent(
|
|
250
|
+
type="text",
|
|
251
|
+
text=f"File not found: {file_path}",
|
|
252
|
+
)]
|
|
253
|
+
if not full_path.is_file():
|
|
254
|
+
return [types.TextContent(
|
|
255
|
+
type="text",
|
|
256
|
+
text=f"Not a file: {file_path}",
|
|
257
|
+
)]
|
|
258
|
+
content = full_path.read_text(encoding="utf-8", errors="replace")
|
|
259
|
+
lines = content.count("\n") + 1
|
|
260
|
+
tokens = max(1, len(content) // 4)
|
|
261
|
+
content += f"\n---\nLine count: {lines} | Tokens: ~{tokens}"
|
|
262
|
+
return [types.TextContent(type="text", text=content)]
|
|
263
|
+
|
|
264
|
+
elif name == "search_files":
|
|
265
|
+
pattern = arguments.get("pattern", "")
|
|
266
|
+
matches = sorted(path.rglob(pattern))
|
|
267
|
+
matches = [m for m in matches if m.is_file()]
|
|
268
|
+
if not matches:
|
|
269
|
+
return [types.TextContent(
|
|
270
|
+
type="text",
|
|
271
|
+
text=f"No files found matching: {pattern}",
|
|
272
|
+
)]
|
|
273
|
+
lines = [f"Files matching '{pattern}':", ""]
|
|
274
|
+
for m in matches[:100]:
|
|
275
|
+
lines.append(f" {m.relative_to(path).as_posix()}")
|
|
276
|
+
if len(matches) > 100:
|
|
277
|
+
lines.append(f" ... and {len(matches) - 100} more")
|
|
278
|
+
return [types.TextContent(type="text", text="\n".join(lines))]
|
|
279
|
+
|
|
212
280
|
else:
|
|
213
281
|
return [types.TextContent(type="text", text=f"Unknown tool: {name}")]
|
|
214
282
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ctxgraph
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: 97% cheaper AI coding. ctxgraph builds a knowledge graph of your Python codebase, then generates token-efficient context capsules for any AI tool. Or hook up Ollama/Claude/OpenAI and use it as a code-aware coding assistant — like ChatGPT or Claude Code, but with built-in graph context. Cut token costs by 97%, work offline with just a graph, or connect your favorite LLM.
|
|
5
5
|
Author: ctxgraph contributors
|
|
6
6
|
License: MIT
|
|
@@ -545,7 +545,7 @@ Or set the `CTXGRAPH_REPO_PATH` environment variable instead of passing `--repo`
|
|
|
545
545
|
}
|
|
546
546
|
```
|
|
547
547
|
|
|
548
|
-
Tools: `search_graph`, `get_context_capsule`, `get_file_dependencies`, `get_project_overview`.
|
|
548
|
+
Tools: `search_graph`, `get_context_capsule`, `get_file_dependencies`, `get_project_overview`, `read_file`, `search_files`.
|
|
549
549
|
|
|
550
550
|
> **Windows users:** Claude Desktop may not set the working directory to your project root. Always use `--repo` or `CTXGRAPH_REPO_PATH` to ensure the server can find your graph.
|
|
551
551
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|