ht32-code-mcp 0.5.3__tar.gz → 0.5.4__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.
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/PKG-INFO +1 -1
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/pyproject.toml +1 -1
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/server.py +7 -1
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/test_version_file.py +38 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/uv.lock +1 -1
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/.gitignore +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/.gitkeep +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/DEPLOY.md +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/README.md +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/components.example.json +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/e2e_scenario_a.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/e2e_scenario_b.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/smoke_http.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/smoke_stdio.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/__init__.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/__main__.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/component_exporter.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/component_source.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/components.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/exporter.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/index.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/knowledge.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/materializer.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/release.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/src/ht32_code_mcp/usage.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/conftest.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/test_component_export.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/test_component_redact.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/test_component_source.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/test_component_tools.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/test_components.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/test_export_cloud_mode.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/test_knowledge_grounding.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/test_recipe_claims.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/test_tool_output_budget.py +0 -0
- {ht32_code_mcp-0.5.3 → ht32_code_mcp-0.5.4}/tests/test_tools.py +0 -0
|
@@ -132,7 +132,13 @@ try:
|
|
|
132
132
|
except PackageNotFoundError:
|
|
133
133
|
_MCP_VERSION = "unknown (开发模式)"
|
|
134
134
|
|
|
135
|
-
_INSTRUCTIONS = """
|
|
135
|
+
_INSTRUCTIONS = """## 入口前置(最高优先)
|
|
136
|
+
本服务是 ht32 编排 Skill 的知识后端。凡涉及 HT32 开发任务(写码/建工程/编译/烧录/调试/排障),
|
|
137
|
+
先调用宿主 Skill `ht32`,由它决定调用顺序与本地执行;不要用本服务工具自行拼流程。
|
|
138
|
+
仅纯知识查询(查 API/例程/规格)可直接使用本服务。
|
|
139
|
+
若宿主未安装 ht32 Skill,提示用户按 ht32-skills README 安装后再继续。
|
|
140
|
+
|
|
141
|
+
HT32 代码知识库(函数库/例程/工程模板),当前覆盖 7 个官方固件库包:
|
|
136
142
|
M0+(HT32F5 / L5)、M3(HT32F1 / F175x-275x)、M4(F490x1 / F491x3 / F493x5)。
|
|
137
143
|
写 HT32 代码必须基于本库真实函数库知识,不要编造 API/宏/路径。
|
|
138
144
|
|
|
@@ -108,3 +108,41 @@ def test_version_mcp_line_matches_pyproject():
|
|
|
108
108
|
assert match, "VERSION 末行格式不对,无法比对 pyproject 版本"
|
|
109
109
|
assert match.group(1) == pkg_version, (
|
|
110
110
|
f"VERSION 末行 {match.group(1)} != pyproject.toml {pkg_version}")
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def test_release_version_pins_match():
|
|
114
|
+
"""发布版本四处必须一致:pyproject / VERSION 末行 / Dockerfile ARG / compose 镜像 tag。
|
|
115
|
+
|
|
116
|
+
历史问题:0.5.3 发布时只改了 pyproject 与 VERSION,Dockerfile 与 compose 仍钉在
|
|
117
|
+
0.5.2,线上容器装的是旧包,`get_code_version` 头部与 VERSION 回显不一致。
|
|
118
|
+
"""
|
|
119
|
+
pyproject = srv.CODE_ROOT / ".work" / "mcp-server" / "pyproject.toml"
|
|
120
|
+
with pyproject.open("rb") as fh:
|
|
121
|
+
pyproject_version = tomllib.load(fh)["project"]["version"]
|
|
122
|
+
|
|
123
|
+
match = _MCP_LINE.match(_lines()[-1])
|
|
124
|
+
assert match, "VERSION 末行格式不对,无法比对版本"
|
|
125
|
+
version_line = match.group(1)
|
|
126
|
+
|
|
127
|
+
dockerfile = srv.CODE_ROOT / ".work" / "docker" / "Dockerfile"
|
|
128
|
+
docker_match = re.search(
|
|
129
|
+
r"^ARG\s+HT32_CODE_MCP_VERSION=(\d+\.\d+\.\d+)\s*$",
|
|
130
|
+
dockerfile.read_text(encoding="utf-8"), re.MULTILINE)
|
|
131
|
+
assert docker_match, "Dockerfile 缺少 'ARG HT32_CODE_MCP_VERSION=X.Y.Z'"
|
|
132
|
+
docker_version = docker_match.group(1)
|
|
133
|
+
|
|
134
|
+
compose = srv.CODE_ROOT / ".work" / "docker" / "docker-compose.yml"
|
|
135
|
+
compose_match = re.search(
|
|
136
|
+
r"image:\s*ht32-code-mcp:(\d+\.\d+\.\d+)",
|
|
137
|
+
compose.read_text(encoding="utf-8"))
|
|
138
|
+
assert compose_match, "docker-compose.yml 缺少 'image: ht32-code-mcp:X.Y.Z'"
|
|
139
|
+
compose_version = compose_match.group(1)
|
|
140
|
+
|
|
141
|
+
versions = {
|
|
142
|
+
"pyproject.toml": pyproject_version,
|
|
143
|
+
"VERSION": version_line,
|
|
144
|
+
"Dockerfile": docker_version,
|
|
145
|
+
"docker-compose.yml": compose_version,
|
|
146
|
+
}
|
|
147
|
+
assert len(set(versions.values())) == 1, (
|
|
148
|
+
"发布版本四处必须一致,当前:" + ", ".join(f"{k}={v}" for k, v in versions.items()))
|
|
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
|