typetrace 0.3.2__py3-none-any.whl
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.
typetrace/__init__.py
ADDED
typetrace/__main__.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""
|
|
2
|
+
`typetrace` from PyPI: runs the TypeTrace command-line tool (the npm package `typetrace-cli`, the same version as this
|
|
3
|
+
package) with the Node.js runtime that the `nodejs-wheel-binaries` dependency installs. No separate Node install is
|
|
4
|
+
needed. A Node.js 22.13 or newer already on the PATH is not used, so the version is always the one that was tested.
|
|
5
|
+
|
|
6
|
+
uvx typetrace init . # or: pip install typetrace && typetrace init .
|
|
7
|
+
typetrace query . "where is the session token refreshed?"
|
|
8
|
+
|
|
9
|
+
The MCP entries that `typetrace init` writes start the server the way this package was started (`uvx typetrace==X
|
|
10
|
+
serve ...` under uvx, else this Python environment's `python -m typetrace serve ...`), so they work without Node on
|
|
11
|
+
the PATH.
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import json
|
|
16
|
+
import os
|
|
17
|
+
import shutil
|
|
18
|
+
import sys
|
|
19
|
+
from importlib.metadata import version
|
|
20
|
+
|
|
21
|
+
NPM_PACKAGE = "typetrace-cli"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _version() -> str:
|
|
25
|
+
return version("typetrace")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _node_bin_dir() -> str:
|
|
29
|
+
from nodejs_wheel import executable # the bundled Node.js runtime
|
|
30
|
+
|
|
31
|
+
return executable.ROOT_DIR if os.name == "nt" else os.path.join(executable.ROOT_DIR, "bin")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _launch_command(v: str) -> list[str]:
|
|
35
|
+
"""How MCP clients should start the server, mirroring how this package was started."""
|
|
36
|
+
if "archive-v" in sys.prefix and shutil.which("uvx"):
|
|
37
|
+
return ["uvx", f"typetrace=={v}"] # an ephemeral `uvx` environment: never point at its path
|
|
38
|
+
return [sys.executable, "-m", "typetrace"]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def main(argv: list[str] | None = None) -> int:
|
|
42
|
+
args = list(sys.argv[1:] if argv is None else argv)
|
|
43
|
+
v = _version()
|
|
44
|
+
if args[:1] in (["--version"], ["version"]):
|
|
45
|
+
print(v)
|
|
46
|
+
return 0
|
|
47
|
+
from nodejs_wheel import npx
|
|
48
|
+
|
|
49
|
+
bin_dir = _node_bin_dir()
|
|
50
|
+
env = dict(os.environ)
|
|
51
|
+
# The npm package's own entry point is `#!/usr/bin/env node`: put the bundled Node first on the PATH.
|
|
52
|
+
env["PATH"] = bin_dir + os.pathsep + env.get("PATH", "")
|
|
53
|
+
env.setdefault("TYPETRACE_LAUNCH", json.dumps(_launch_command(v)))
|
|
54
|
+
# The Claude Code hook that `init` writes runs on this Node.js too (users of this package may have none on the PATH).
|
|
55
|
+
env.setdefault("TYPETRACE_HOOK_NODE", os.path.join(bin_dir, "node.exe" if os.name == "nt" else "node"))
|
|
56
|
+
try:
|
|
57
|
+
# TYPETRACE_NPM_SPEC (testing, offline installs): another npm package spec, e.g. the path of a packed tarball.
|
|
58
|
+
spec = os.environ.get("TYPETRACE_NPM_SPEC") or f"{NPM_PACKAGE}@{v}"
|
|
59
|
+
return npx(["--yes", "--prefer-offline", "--package", spec, "--", "typetrace", *args], env=env)
|
|
60
|
+
except KeyboardInterrupt:
|
|
61
|
+
return 130
|
|
62
|
+
except FileNotFoundError as e: # pragma: no cover - a broken nodejs-wheel install
|
|
63
|
+
print(f"typetrace: the bundled Node.js runtime is missing ({e}); reinstall: pip install --force-reinstall typetrace", file=sys.stderr)
|
|
64
|
+
return 1
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
if __name__ == "__main__":
|
|
68
|
+
sys.exit(main())
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: typetrace
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: Local code search plus call graph for AI coding agents, served over MCP (Claude Code, Cursor, Codex, Copilot and more). Runs the typetrace-cli npm package with a bundled Node.js.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Atrix21/typetrace
|
|
6
|
+
Project-URL: Repository, https://github.com/Atrix21/typetrace
|
|
7
|
+
Project-URL: Changelog, https://github.com/Atrix21/typetrace/blob/main/CHANGELOG.md
|
|
8
|
+
Author: Atrix21
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai-agents,call-graph,claude-code,code-search,mcp
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Software Development
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Requires-Dist: nodejs-wheel-binaries>=22.13
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# TypeTrace
|
|
22
|
+
|
|
23
|
+
Finds the code an AI coding agent needs: file:line pointers plus their callers and callees, from a local index of
|
|
24
|
+
your repository (keyword search, a local embedding model and a call graph). It is served over MCP to Claude Code,
|
|
25
|
+
Cursor, VS Code (GitHub Copilot), Codex, Gemini CLI, OpenCode, Kiro, Windsurf and Zed. No API keys; nothing leaves
|
|
26
|
+
your machine.
|
|
27
|
+
|
|
28
|
+
This is the PyPI distribution of the [`typetrace-cli`](https://www.npmjs.com/package/typetrace-cli) npm package. It
|
|
29
|
+
brings its own Node.js (through `nodejs-wheel-binaries`), so you need only Python:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
uvx typetrace init . # index the repository and register the MCP server with your AI coding tools
|
|
33
|
+
typetrace status . # what is indexed, what is still running
|
|
34
|
+
typetrace query . "where is the session token refreshed?"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`init` writes MCP entries that start the server the same way (`uvx typetrace==<version> serve ...`, or this Python
|
|
38
|
+
environment when installed with pip). The first run downloads the npm package; the first full index downloads the
|
|
39
|
+
embedding model (~2.4 GB, cached).
|
|
40
|
+
|
|
41
|
+
Documentation, benchmarks and the experiments behind every claim: https://github.com/Atrix21/typetrace
|
|
42
|
+
|
|
43
|
+
<!-- MCP Registry ownership check -->
|
|
44
|
+
mcp-name: io.github.Atrix21/typetrace
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
typetrace/__init__.py,sha256=B0CEoTzQX0tmNOWefcQpDZvZxnoZhEm-fsKDZ00mQoU,201
|
|
2
|
+
typetrace/__main__.py,sha256=z0gKWbn3seUautsQtyh2y3QBuTCGdXQyvK7P9cfBZ3o,2915
|
|
3
|
+
typetrace-0.3.2.dist-info/METADATA,sha256=ACVRRGRuxVP34gTFDcpvHoDY6rDCu4JaK9XxigHyQTM,2145
|
|
4
|
+
typetrace-0.3.2.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
5
|
+
typetrace-0.3.2.dist-info/entry_points.txt,sha256=zKFJIjOt4u-H6x6ND4KYy6qPjz2fO5R_bjC4mT6WytY,54
|
|
6
|
+
typetrace-0.3.2.dist-info/licenses/LICENSE,sha256=M5EB329pRbEgf5oRtknGtlLGSwxCa4aJz-f5Wq8zjgY,1064
|
|
7
|
+
typetrace-0.3.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Atrix21
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|