zhicuo-problem-probe 0.1.0__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.
- zhicuo_problem_probe/__init__.py +0 -0
- zhicuo_problem_probe/problem.json +35 -0
- zhicuo_problem_probe/server.py +22 -0
- zhicuo_problem_probe-0.1.0.dist-info/METADATA +15 -0
- zhicuo_problem_probe-0.1.0.dist-info/RECORD +7 -0
- zhicuo_problem_probe-0.1.0.dist-info/WHEEL +4 -0
- zhicuo_problem_probe-0.1.0.dist-info/entry_points.txt +2 -0
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "knapsack_basic",
|
|
3
|
+
"title": "背包中的单件物品",
|
|
4
|
+
"topic": "knapsack_01",
|
|
5
|
+
"family": "knapsack_01_at_most",
|
|
6
|
+
"split": "development",
|
|
7
|
+
"statement": "有 n 种物品,每种给出重量 w 和价值 v,总容量为 C。每种至多选取一次。要求总重量不超过 C,求最大总价值。允许不选任何物品,此时价值为 0。",
|
|
8
|
+
"input_format": "第一行输入 n C,随后 n 行每行输入 w v。",
|
|
9
|
+
"output_format": "输出不超过容量时的最大总价值。",
|
|
10
|
+
"constraints": {
|
|
11
|
+
"n_min": 1,
|
|
12
|
+
"n_max": 12,
|
|
13
|
+
"capacity_min": 0,
|
|
14
|
+
"capacity_max": 30,
|
|
15
|
+
"weight_min": 1,
|
|
16
|
+
"weight_max": 20,
|
|
17
|
+
"item_value_min": 1,
|
|
18
|
+
"item_value_max": 100
|
|
19
|
+
},
|
|
20
|
+
"samples": [
|
|
21
|
+
{
|
|
22
|
+
"stdin": "1 4\n2 3\n",
|
|
23
|
+
"expected_output": "3\n"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"stdin": "1 2\n2 3\n",
|
|
27
|
+
"expected_output": "3\n"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"knowledge_tags": [
|
|
31
|
+
"0/1背包",
|
|
32
|
+
"状态转移",
|
|
33
|
+
"容量约束"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Read one bundled development problem; never execute submitted student code."""
|
|
2
|
+
import json
|
|
3
|
+
from importlib.resources import files
|
|
4
|
+
from typing import Any
|
|
5
|
+
from mcp.server.fastmcp import FastMCP
|
|
6
|
+
|
|
7
|
+
problem = json.loads(files("zhicuo_problem_probe").joinpath("problem.json").read_text(encoding="utf-8"))
|
|
8
|
+
server = FastMCP("zhicuo_problem_probe_mcp", log_level="WARNING")
|
|
9
|
+
|
|
10
|
+
@server.tool(annotations={"readOnlyHint": True, "destructiveHint": False,
|
|
11
|
+
"idempotentHint": True, "openWorldHint": False})
|
|
12
|
+
def get_problem(problem_id: str) -> dict[str, Any]:
|
|
13
|
+
"""Read knapsack_basic: statement, constraints and samples. Other IDs are rejected."""
|
|
14
|
+
if problem_id != problem["id"]:
|
|
15
|
+
raise ValueError("Unknown problem_id; this probe contains only knapsack_basic.")
|
|
16
|
+
return problem
|
|
17
|
+
|
|
18
|
+
def main():
|
|
19
|
+
server.run(transport="stdio")
|
|
20
|
+
|
|
21
|
+
if __name__ == "__main__":
|
|
22
|
+
main()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: zhicuo-problem-probe
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Read-only MCP connectivity probe for one reviewed algorithm problem
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Requires-Dist: mcp==1.30.0
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# ZhicuO problem probe
|
|
10
|
+
|
|
11
|
+
Read-only MCP Stdio service exposing get_problem for knapsack_basic, one development problem.
|
|
12
|
+
Returns the bundled statement, constraints and samples; unknown IDs are rejected.
|
|
13
|
+
Does not execute student code, access a business database, or contain credentials or evaluation labels.
|
|
14
|
+
Requires Python 3.11 or later. Command entry point: zhicuo-problem-probe.
|
|
15
|
+
AgentArts installation and invocation must be verified separately.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
zhicuo_problem_probe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
zhicuo_problem_probe/problem.json,sha256=_j4daMP0CxyZ1v8N4auYbkPaKlcV44kIcjw1DjfZg2k,990
|
|
3
|
+
zhicuo_problem_probe/server.py,sha256=wEHkXW9qMJL_lnEMO85IIqJAFvg1X6KZIo5A0WRfQxc,889
|
|
4
|
+
zhicuo_problem_probe-0.1.0.dist-info/METADATA,sha256=cZY9HW-xqjCjzArk9j1zh4ai0IbS39noH1b5LP40ZHE,678
|
|
5
|
+
zhicuo_problem_probe-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
6
|
+
zhicuo_problem_probe-0.1.0.dist-info/entry_points.txt,sha256=zqQHIMAbpB6RnGjsBtKwVZeYxqyOD4PlFU4JYAZsii8,74
|
|
7
|
+
zhicuo_problem_probe-0.1.0.dist-info/RECORD,,
|