tscode-kg 0.5.1__tar.gz → 0.6.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.
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/PKG-INFO +6 -6
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/README.md +3 -3
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/pyproject.toml +4 -40
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/__init__.py +1 -1
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/mcp_server.py +19 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/LICENSE +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/__main__.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/analysis.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/app.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/bridge.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/centrality.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/__init__.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_analyze.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_bridges.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_build.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_centrality.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_explain.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_framework_nodes.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_hooks.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_init.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_mcp.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_model.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_query.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_snapshot.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/cmd_viz.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/cli/main.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/coderank.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/config.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/explain.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/extractor.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/framework_detector.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/kg.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/layout3d.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/snapshots.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/viz3d.py +0 -0
- {tscode_kg-0.5.1 → tscode_kg-0.6.0}/src/tscode_kg/viz3d_timeline.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tscode-kg
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Knowledge graph for TypeScript/JavaScript codebases — AST extraction, hybrid semantic+structural search
|
|
5
5
|
License-Expression: Elastic-2.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -19,9 +19,9 @@ Provides-Extra: viz
|
|
|
19
19
|
Provides-Extra: viz3d
|
|
20
20
|
Requires-Dist: PyQt5 (>=5.15.11,<5.16) ; extra == "viz3d"
|
|
21
21
|
Requires-Dist: click (>=8.1.0,<9)
|
|
22
|
-
Requires-Dist: kgmodule-utils[semantic,sqlite-vec] (>=0.
|
|
22
|
+
Requires-Dist: kgmodule-utils[semantic,sqlite-vec] (>=0.23.0)
|
|
23
23
|
Requires-Dist: markdown (>=3.10,<3.11) ; extra == "viz3d"
|
|
24
|
-
Requires-Dist: mcp (>=1.
|
|
24
|
+
Requires-Dist: mcp (>=1.3.0,<2)
|
|
25
25
|
Requires-Dist: networkx (>=3.0)
|
|
26
26
|
Requires-Dist: param (>=2.4,<2.5) ; extra == "viz3d"
|
|
27
27
|
Requires-Dist: plotly (>=6.8.0,<6.9) ; extra == "viz"
|
|
@@ -42,7 +42,7 @@ Description-Content-Type: text/markdown
|
|
|
42
42
|
[](https://www.python.org/)
|
|
43
43
|
[](https://www.elastic.co/licensing/elastic-license)
|
|
44
44
|
[](https://pypi.org/project/tscode-kg/)
|
|
45
|
-
[](https://github.com/Flux-Frontiers/tscode_kg/releases)
|
|
46
46
|
[](https://github.com/Flux-Frontiers/tscode_kg/actions/workflows/ci.yml)
|
|
47
47
|
[](https://python-poetry.org/)
|
|
48
48
|
[](https://doi.org/10.5281/zenodo.22559450)
|
|
@@ -195,13 +195,13 @@ If you use TypeScriptKG in your research or project, please cite it:
|
|
|
195
195
|
|
|
196
196
|
[](https://doi.org/10.5281/zenodo.22559450)
|
|
197
197
|
|
|
198
|
-
> Suchanek, E. G. (2026). *TypeScriptKG: Semantic Knowledge Graph for TypeScript/JavaScript Codebases* (Version 0.
|
|
198
|
+
> Suchanek, E. G. (2026). *TypeScriptKG: Semantic Knowledge Graph for TypeScript/JavaScript Codebases* (Version 0.6.0) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.22559450
|
|
199
199
|
|
|
200
200
|
```bibtex
|
|
201
201
|
@software{suchanek_tscode_kg,
|
|
202
202
|
author = {Suchanek, Eric G.},
|
|
203
203
|
title = {{TypeScriptKG}: Semantic Knowledge Graph for TypeScript/JavaScript Codebases},
|
|
204
|
-
version = {0.
|
|
204
|
+
version = {0.6.0},
|
|
205
205
|
year = {2026},
|
|
206
206
|
publisher = {Flux-Frontiers},
|
|
207
207
|
doi = {10.5281/zenodo.22559450},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.python.org/)
|
|
4
4
|
[](https://www.elastic.co/licensing/elastic-license)
|
|
5
5
|
[](https://pypi.org/project/tscode-kg/)
|
|
6
|
-
[](https://github.com/Flux-Frontiers/tscode_kg/releases)
|
|
7
7
|
[](https://github.com/Flux-Frontiers/tscode_kg/actions/workflows/ci.yml)
|
|
8
8
|
[](https://python-poetry.org/)
|
|
9
9
|
[](https://doi.org/10.5281/zenodo.22559450)
|
|
@@ -156,13 +156,13 @@ If you use TypeScriptKG in your research or project, please cite it:
|
|
|
156
156
|
|
|
157
157
|
[](https://doi.org/10.5281/zenodo.22559450)
|
|
158
158
|
|
|
159
|
-
> Suchanek, E. G. (2026). *TypeScriptKG: Semantic Knowledge Graph for TypeScript/JavaScript Codebases* (Version 0.
|
|
159
|
+
> Suchanek, E. G. (2026). *TypeScriptKG: Semantic Knowledge Graph for TypeScript/JavaScript Codebases* (Version 0.6.0) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.22559450
|
|
160
160
|
|
|
161
161
|
```bibtex
|
|
162
162
|
@software{suchanek_tscode_kg,
|
|
163
163
|
author = {Suchanek, Eric G.},
|
|
164
164
|
title = {{TypeScriptKG}: Semantic Knowledge Graph for TypeScript/JavaScript Codebases},
|
|
165
|
-
version = {0.
|
|
165
|
+
version = {0.6.0},
|
|
166
166
|
year = {2026},
|
|
167
167
|
publisher = {Flux-Frontiers},
|
|
168
168
|
doi = {10.5281/zenodo.22559450},
|
|
@@ -38,7 +38,7 @@ packages = [{ include = "tscode_kg", from = "src" }]
|
|
|
38
38
|
|
|
39
39
|
[project]
|
|
40
40
|
name = "tscode-kg"
|
|
41
|
-
version = "0.
|
|
41
|
+
version = "0.6.0"
|
|
42
42
|
description = "Knowledge graph for TypeScript/JavaScript codebases — AST extraction, hybrid semantic+structural search"
|
|
43
43
|
readme = "README.md"
|
|
44
44
|
license = "Elastic-2.0"
|
|
@@ -68,7 +68,7 @@ dependencies = [
|
|
|
68
68
|
# manager is now the package_name class attribute, where it used to be an
|
|
69
69
|
# __init__ that only forwarded to super(). Against 0.19.x the manager
|
|
70
70
|
# reports itself as "kg-utils" in every snapshot's tool field.
|
|
71
|
-
"kgmodule-utils[semantic,sqlite-vec]>=0.
|
|
71
|
+
"kgmodule-utils[semantic,sqlite-vec]>=0.23.0",
|
|
72
72
|
"click>=8.1.0,<9",
|
|
73
73
|
# Upper-bounded: mcp 2.0 removed the bundled `mcp.server.fastmcp` module
|
|
74
74
|
# (FastMCP was split out into the standalone `fastmcp` package) and rebuilt
|
|
@@ -76,7 +76,7 @@ dependencies = [
|
|
|
76
76
|
# FastMCP from mcp, so an unbounded floor lets a clean install pull 2.x and
|
|
77
77
|
# break `tscodekg-mcp` at import time. Lift this only alongside a port to
|
|
78
78
|
# the standalone fastmcp package.
|
|
79
|
-
"mcp>=1.
|
|
79
|
+
"mcp>=1.3.0,<2",
|
|
80
80
|
"networkx>=3.0",
|
|
81
81
|
]
|
|
82
82
|
|
|
@@ -123,43 +123,7 @@ pytest-cov = ">=5.0.0"
|
|
|
123
123
|
# Capped below 0.16 to match the fleet: 0.16 formats Python inside Markdown
|
|
124
124
|
# code blocks as stable behaviour. The floor was unbounded, so the lock could
|
|
125
125
|
# drift away from the version .pre-commit-config.yaml pins.
|
|
126
|
-
ruff = ">=0.
|
|
127
|
-
|
|
128
|
-
# ---------------------------------------------------------------------------
|
|
129
|
-
# Maintainer tooling (Poetry group, not a PEP 621 extra)
|
|
130
|
-
# ---------------------------------------------------------------------------
|
|
131
|
-
# pycode-kg is a tool this repo *runs*, not a library it imports: PyCodeKG
|
|
132
|
-
# indexes this repo's Python source from the outside, via the `pycodekg` CLI in
|
|
133
|
-
# .git/hooks/pre-commit. It belongs in a Poetry group -- locked and installable,
|
|
134
|
-
# but never written into the wheel, so no published extra acquires a sibling.
|
|
135
|
-
#
|
|
136
|
-
# doc-kg rides along for fleet uniformity: every repo's `kg` group carries the
|
|
137
|
-
# same two CLIs, so `poetry install --with kg` means one thing everywhere. This
|
|
138
|
-
# repo has no DocKG index today (no .mcp.json, no `dockg` invocation), so the
|
|
139
|
-
# CLI is simply available rather than required -- and it is here, not in an
|
|
140
|
-
# extra, precisely because nothing depends on it at runtime.
|
|
141
|
-
#
|
|
142
|
-
# poetry install --with kg # get the pycodekg CLI into .venv/bin
|
|
143
|
-
# poetry install # default: group is optional, skipped
|
|
144
|
-
#
|
|
145
|
-
# This supersedes the standing "install it by hand" workaround. That note
|
|
146
|
-
# described a real deadlock -- older pycode-kg capped transformers below 4.57
|
|
147
|
-
# while kgmodule-utils >=0.9.0 needs >=5.5.0, which silently held this repo on
|
|
148
|
-
# the pre-CVE transformers line. pycode-kg 0.21.4 no longer pins transformers at
|
|
149
|
-
# all; it inherits the same kgmodule-utils[semantic] constraint this project
|
|
150
|
-
# already uses, so the two no longer conflict. Verified: locking with this group
|
|
151
|
-
# keeps transformers at 5.14.1.
|
|
152
|
-
[tool.poetry.group.kg]
|
|
153
|
-
optional = true
|
|
154
|
-
|
|
155
|
-
[tool.poetry.group.kg.dependencies]
|
|
156
|
-
# Both floors are the releases that retired these packages' own snapshot
|
|
157
|
-
# overrides and moved them onto kgmodule-utils>=0.20.0, the same SDK this repo
|
|
158
|
-
# now requires. Pinned lower, `poetry install --with kg` could resolve a dockg
|
|
159
|
-
# or pycodekg predating the shared extension points into the same environment
|
|
160
|
-
# as a tscode_kg that depends on them.
|
|
161
|
-
doc-kg = ">=0.26.0"
|
|
162
|
-
pycode-kg = ">=0.27.1"
|
|
126
|
+
ruff = ">=0.15,<0.16"
|
|
163
127
|
|
|
164
128
|
[project.urls]
|
|
165
129
|
Homepage = "https://github.com/Flux-Frontiers/tscode_kg"
|
|
@@ -74,6 +74,8 @@ from __future__ import annotations
|
|
|
74
74
|
import argparse
|
|
75
75
|
import json
|
|
76
76
|
import sys
|
|
77
|
+
from collections.abc import AsyncIterator
|
|
78
|
+
from contextlib import asynccontextmanager
|
|
77
79
|
from pathlib import Path
|
|
78
80
|
|
|
79
81
|
from kg_utils.semantic import DEFAULT_MODEL
|
|
@@ -142,6 +144,22 @@ def _snapshot_freshness(snapshot_total_nodes: int) -> dict:
|
|
|
142
144
|
# MCP server
|
|
143
145
|
# ---------------------------------------------------------------------------
|
|
144
146
|
|
|
147
|
+
|
|
148
|
+
@asynccontextmanager
|
|
149
|
+
async def _lifespan(_server: FastMCP) -> AsyncIterator[None]:
|
|
150
|
+
"""Close the graph's SQLite connection(s) when the server shuts down.
|
|
151
|
+
|
|
152
|
+
``main()`` sets the module-level ``_kg`` before ``mcp.run()`` calls into
|
|
153
|
+
this, and both the stdio and SSE transports route through the same
|
|
154
|
+
underlying ``Server.run()``, so this fires on either one.
|
|
155
|
+
"""
|
|
156
|
+
try:
|
|
157
|
+
yield
|
|
158
|
+
finally:
|
|
159
|
+
if _kg is not None:
|
|
160
|
+
_kg.close()
|
|
161
|
+
|
|
162
|
+
|
|
145
163
|
mcp = FastMCP(
|
|
146
164
|
"tscodekg",
|
|
147
165
|
instructions=(
|
|
@@ -202,6 +220,7 @@ mcp = FastMCP(
|
|
|
202
220
|
"- **Track codebase evolution**: snapshot_list → snapshot_diff(key_a, key_b)\n"
|
|
203
221
|
"- **Answer 'how does X work?'**: pack_snippets with a descriptive query\n"
|
|
204
222
|
),
|
|
223
|
+
lifespan=_lifespan,
|
|
205
224
|
)
|
|
206
225
|
|
|
207
226
|
|
|
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
|