mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
Mirrors hanzoai/mcp's Rust `lsp` exactly: one tool, two planes, picked by data
the caller already has. `file` names the file; `repo` (a git.hanzo.ai slug,
optional `rev`) says which world it lives in. Without `repo` nothing changes —
the same language server on the same tree. With it, the question goes to the
indexed corpus behind /v1/code/lsp, which reaches across a repo's dependencies
without checking anything out.
One table maps actions onto ops: locate carries a relation (definition|
reference|type|implementation) because "where is X" is one question with four
answers, not four routes; hover, symbols, diagnostics and complete stand on
their own. The body is {repo, rev?, path, line, character, relation?} in LSP's
own frame — 0-based line, UTF-16 character — shifted from the tool's 1-based
`line` by the same expression the local plane uses.
The call goes through the shared HanzoCloud client hanzo-tools-code and
hanzo-tools-net already compose, so there is no second client and no second
lsp tool. Actions a plane cannot serve say so up front rather than spawning a
server or calling out.
test_lsp_tools.py asked for a class named `LspTool`; the class is `LSPTool`,
so those two never ran. One name, and they run.
Co-authored-by: Hanzo Dev <[email protected]>
26 lines
665 B
TOML
26 lines
665 B
TOML
[build-system]
|
|
requires = ["setuptools>=61.0.0", "wheel"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "hanzo-tools-lsp"
|
|
version = "0.2.1"
|
|
description = "Language Server Protocol tools for code intelligence"
|
|
readme = "README.md"
|
|
requires-python = ">=3.12"
|
|
license = { text = "MIT" }
|
|
authors = [{ name = "Hanzo Industries Inc", email = "[email protected]" }]
|
|
keywords = ["hanzo", "tools", "lsp", "language-server", "mcp", "ai"]
|
|
dependencies = [
|
|
"hanzo-tools>=0.3.0",
|
|
"mcp>=1.25.0",
|
|
"pydantic>=2.12.5",
|
|
]
|
|
|
|
[project.entry-points."hanzo.tools"]
|
|
lsp = "hanzo_tools.lsp:TOOLS"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["."]
|
|
include = ["hanzo_tools*"]
|