ctxgraph-code 0.6.0__tar.gz → 0.6.1__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_code-0.6.0 → ctxgraph_code-0.6.1}/PKG-INFO +1 -1
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/pyproject.toml +1 -1
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/cli.py +14 -21
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/hooks.py +1 -49
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/PKG-INFO +1 -1
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/README.md +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/setup.cfg +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/__init__.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/__main__.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/__init__.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/python/__init__.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/python/importer.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/python/semantic.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/python/symbols.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/treesitter/__init__.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/treesitter/analyzer.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/treesitter/languages.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/__init__.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/build_status.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/global_paths.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/init.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/settings.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/exclude/__init__.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/exclude/patterns.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/graph/__init__.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/graph/builder.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/graph/models.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/graph/query.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/graph/storage.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/render/__init__.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/render/_text.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/render/mermaid.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/view/__init__.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/view/visualizer.py +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/SOURCES.txt +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/dependency_links.txt +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/entry_points.txt +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/requires.txt +0 -0
- {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ctxgraph-code"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.1"
|
|
8
8
|
description = "Code knowledge graph for Claude Code. Build a relationship graph of your Python codebase and query it during coding sessions."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -254,29 +254,22 @@ def _write_slash_command(slash_path: Path, path: Path):
|
|
|
254
254
|
|
|
255
255
|
SLASH_COMMAND_TEMPLATE = """# ctxgraph-code: Code Relationship Graph
|
|
256
256
|
|
|
257
|
-
**First time in this project?** Tell the user to run `ctxgraph-code setup` in their terminal.
|
|
258
|
-
|
|
259
|
-
**Graph needs refresh?** Tell the user to run `ctxgraph-code build`.
|
|
260
|
-
|
|
261
257
|
**Available graphs:** {available}
|
|
262
258
|
|
|
263
259
|
**Commands:**
|
|
264
|
-
- `ctxgraph-code query "terms"` --
|
|
265
|
-
- `ctxgraph-code probe "question"` -- Search
|
|
266
|
-
- `ctxgraph-code deps <path>` --
|
|
267
|
-
- `ctxgraph-code usedby <path>` --
|
|
268
|
-
- `ctxgraph-code overview --dir <name>` --
|
|
269
|
-
- `ctxgraph-code symbols <path>` --
|
|
270
|
-
- `ctxgraph-code context "task"` --
|
|
271
|
-
- `ctxgraph-code subgraph "task"` --
|
|
272
|
-
- `ctxgraph-code diff` --
|
|
273
|
-
- `ctxgraph-code mermaid --type classDiagram` --
|
|
274
|
-
- `ctxgraph-code view --dir <name>` --
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
**Tip:** Use `--dir <name>` to scope queries to a per-directory graph.
|
|
279
|
-
When passing a file path like `auth/login.py`, the correct graph is auto-detected.
|
|
260
|
+
- `ctxgraph-code query "terms"` -- Files, classes, functions
|
|
261
|
+
- `ctxgraph-code probe "question"` -- Search + read source inline
|
|
262
|
+
- `ctxgraph-code deps <path>` -- Dependencies of a file
|
|
263
|
+
- `ctxgraph-code usedby <path>` -- What depends on a file
|
|
264
|
+
- `ctxgraph-code overview --dir <name>` -- Project structure
|
|
265
|
+
- `ctxgraph-code symbols <path>` -- Classes/functions in a file
|
|
266
|
+
- `ctxgraph-code context "task"` -- Focused context summary
|
|
267
|
+
- `ctxgraph-code subgraph "task"` -- Focused subgraph with source
|
|
268
|
+
- `ctxgraph-code diff` -- Files changed since build
|
|
269
|
+
- `ctxgraph-code mermaid --type classDiagram` -- Mermaid diagram
|
|
270
|
+
- `ctxgraph-code view --dir <name>` -- Interactive D3.js graph
|
|
271
|
+
|
|
272
|
+
Use `--dir <name>` to scope queries. File paths auto-detect the graph dir.
|
|
280
273
|
"""
|
|
281
274
|
|
|
282
275
|
|
|
@@ -1110,7 +1103,7 @@ def version():
|
|
|
1110
1103
|
try:
|
|
1111
1104
|
ver = _v("ctxgraph-code")
|
|
1112
1105
|
except Exception:
|
|
1113
|
-
ver = "0.6.
|
|
1106
|
+
ver = "0.6.1"
|
|
1114
1107
|
console.print(f"ctxgraph-code version [bold]{ver}[/bold]")
|
|
1115
1108
|
|
|
1116
1109
|
|
|
@@ -79,8 +79,6 @@ def uninstall_hooks(project_path: Path, local: bool = False) -> bool:
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
def compute_hint_summary(repo_path: Path) -> Optional[str]:
|
|
82
|
-
import hashlib
|
|
83
|
-
|
|
84
82
|
avail = get_available_graphs(repo_path)
|
|
85
83
|
if not avail["_combined"] and not avail["dirs"]:
|
|
86
84
|
return None
|
|
@@ -100,8 +98,6 @@ def compute_hint_summary(repo_path: Path) -> Optional[str]:
|
|
|
100
98
|
total_edges = stats.get("edges", 0)
|
|
101
99
|
types = stats.get("types", {})
|
|
102
100
|
|
|
103
|
-
top_files = _get_top_files(storage, 5)
|
|
104
|
-
|
|
105
101
|
file_count = types.get("file", 0)
|
|
106
102
|
class_count = types.get("class", 0)
|
|
107
103
|
func_count = types.get("function", 0)
|
|
@@ -112,55 +108,11 @@ def compute_hint_summary(repo_path: Path) -> Optional[str]:
|
|
|
112
108
|
]
|
|
113
109
|
if file_count:
|
|
114
110
|
lines.append(f"Files: {file_count} | Classes: {class_count} | Functions: {func_count}.")
|
|
115
|
-
if top_files:
|
|
116
|
-
lines.append(f"Key files: {', '.join(top_files)}.")
|
|
117
|
-
|
|
118
|
-
# ── Tamper detection ──────────────────────────────────────
|
|
119
|
-
hashes_json = storage.get_metadata("content_hashes")
|
|
120
|
-
tampered: int = 0
|
|
121
|
-
if hashes_json:
|
|
122
|
-
try:
|
|
123
|
-
stored_hashes = json.loads(hashes_json)
|
|
124
|
-
for rel_path, stored_hash in stored_hashes.items():
|
|
125
|
-
fp = repo_path / rel_path
|
|
126
|
-
if not fp.is_file():
|
|
127
|
-
tampered += 1
|
|
128
|
-
continue
|
|
129
|
-
try:
|
|
130
|
-
actual = hashlib.sha256(
|
|
131
|
-
fp.read_text(encoding="utf-8", errors="replace")
|
|
132
|
-
.encode("utf-8")
|
|
133
|
-
).hexdigest()
|
|
134
|
-
if actual != stored_hash:
|
|
135
|
-
tampered += 1
|
|
136
|
-
except OSError:
|
|
137
|
-
tampered += 1
|
|
138
|
-
except (json.JSONDecodeError, OSError):
|
|
139
|
-
pass
|
|
140
|
-
if tampered:
|
|
141
|
-
lines.append(
|
|
142
|
-
f"Warning: {tampered} file(s) have changed since graph was built. "
|
|
143
|
-
"Run `ctxgraph-code build --incremental` to update."
|
|
144
|
-
)
|
|
145
111
|
|
|
146
112
|
lines.append(
|
|
147
|
-
"Use `ctxgraph-code probe
|
|
148
|
-
"`ctxgraph-code subgraph \"<task>\"`, or "
|
|
149
|
-
"`/ctxgraph-code` for help."
|
|
113
|
+
"Use `ctxgraph-code probe` or `/ctxgraph-code` for help."
|
|
150
114
|
)
|
|
151
115
|
|
|
152
116
|
return "\n".join(lines)
|
|
153
117
|
finally:
|
|
154
118
|
storage.close()
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
def _get_top_files(storage, limit: int = 5) -> list[str]:
|
|
158
|
-
try:
|
|
159
|
-
rows = storage.conn.execute(
|
|
160
|
-
"SELECT path FROM nodes WHERE type = 'file' AND path IS NOT NULL "
|
|
161
|
-
"ORDER BY size_bytes DESC LIMIT ?",
|
|
162
|
-
(limit,),
|
|
163
|
-
).fetchall()
|
|
164
|
-
return [r[0] for r in rows if r[0]]
|
|
165
|
-
except Exception:
|
|
166
|
-
return []
|
|
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
|
{ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/treesitter/__init__.py
RENAMED
|
File without changes
|
{ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/treesitter/analyzer.py
RENAMED
|
File without changes
|
{ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/treesitter/languages.py
RENAMED
|
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
|