gitcad 0.9.0__tar.gz → 0.9.2__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.
- {gitcad-0.9.0 → gitcad-0.9.2}/PKG-INFO +4 -4
- {gitcad-0.9.0 → gitcad-0.9.2}/pyproject.toml +4 -4
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/mcp/server.py +75 -1
- {gitcad-0.9.0 → gitcad-0.9.2}/.gitignore +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/README.md +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/bench/__init__.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/bench/corpus.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/bench/scorecard.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/bridge.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/convert.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/explore.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/fasteners.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/init.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/lots.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/mcp/__init__.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/merge3.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/pcba.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/release.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/render.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/requirements.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/review.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/viewer/__init__.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/viewer/boardsvg.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/viewer/page.py +0 -0
- {gitcad-0.9.0 → gitcad-0.9.2}/src/gitcad/viewer/server.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitcad
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: Headless, git-native B-rep CAD (metapackage: core, mechanical, and electrical)
|
|
5
5
|
Project-URL: Homepage, https://gitcad.xyz
|
|
6
6
|
Project-URL: Repository, https://github.com/gitcad-xyz/gitcad
|
|
@@ -18,9 +18,9 @@ Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
|
|
|
18
18
|
Classifier: Topic :: Scientific/Engineering
|
|
19
19
|
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
|
|
20
20
|
Requires-Python: >=3.10
|
|
21
|
-
Requires-Dist: gitcad-core==0.9.
|
|
22
|
-
Requires-Dist: gitcad-ecad==0.9.
|
|
23
|
-
Requires-Dist: gitcad-mech==0.9.
|
|
21
|
+
Requires-Dist: gitcad-core==0.9.2
|
|
22
|
+
Requires-Dist: gitcad-ecad==0.9.2
|
|
23
|
+
Requires-Dist: gitcad-mech==0.9.2
|
|
24
24
|
Requires-Dist: mcp>=1.0
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "gitcad"
|
|
7
|
-
version = "0.9.
|
|
7
|
+
version = "0.9.2"
|
|
8
8
|
description = "Headless, git-native B-rep CAD (metapackage: core, mechanical, and electrical)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -26,9 +26,9 @@ classifiers = [
|
|
|
26
26
|
# compiled kernel (forgekernel_rs) is likewise a default dep of gitcad-mech on
|
|
27
27
|
# mainstream architectures — no extra needed for either.
|
|
28
28
|
dependencies = [
|
|
29
|
-
"gitcad-core==0.9.
|
|
30
|
-
"gitcad-mech==0.9.
|
|
31
|
-
"gitcad-ecad==0.9.
|
|
29
|
+
"gitcad-core==0.9.2",
|
|
30
|
+
"gitcad-mech==0.9.2",
|
|
31
|
+
"gitcad-ecad==0.9.2",
|
|
32
32
|
"mcp>=1.0",
|
|
33
33
|
]
|
|
34
34
|
|
|
@@ -56,6 +56,61 @@ def model_new() -> dict[str, Any]:
|
|
|
56
56
|
return {"model": Document().dumps()}
|
|
57
57
|
|
|
58
58
|
|
|
59
|
+
_DESIGN_EXTS = {".model": "model", ".gitcad": "assembly", ".sch": "schematic",
|
|
60
|
+
".board": "board", ".pcba": "pcba", ".part": "part",
|
|
61
|
+
".reqs": "requirements"}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@tool("get_started")
|
|
65
|
+
def get_started(cwd: str = ".") -> dict[str, Any]:
|
|
66
|
+
"""CALL THIS FIRST at the start of a session. Onboards the user: scans the
|
|
67
|
+
working directory for existing gitcad designs and returns the recommended
|
|
68
|
+
next steps — initialize a project if there is none, and open the interactive
|
|
69
|
+
GUI (viewer_open) so the user can see the 3D model, drawings, checks, and
|
|
70
|
+
review tabs. Returns a ready-to-build starter model too."""
|
|
71
|
+
from pathlib import Path
|
|
72
|
+
|
|
73
|
+
root = Path(cwd)
|
|
74
|
+
found: list[dict[str, str]] = []
|
|
75
|
+
try:
|
|
76
|
+
for p in sorted(root.rglob("*")):
|
|
77
|
+
if (p.suffix in _DESIGN_EXTS and p.is_file()
|
|
78
|
+
and "__pycache__" not in p.parts and ".git" not in p.parts):
|
|
79
|
+
found.append({"path": str(p), "kind": _DESIGN_EXTS[p.suffix]})
|
|
80
|
+
if len(found) >= 50:
|
|
81
|
+
break
|
|
82
|
+
except OSError:
|
|
83
|
+
pass
|
|
84
|
+
|
|
85
|
+
gui = ("The GUI is a local web app (viewer_open returns a http://127.0.0.1 "
|
|
86
|
+
"URL). Most MCP hosts can open it, or the user opens it in a browser. "
|
|
87
|
+
"It has tabs for the 3D model, 2D drawings (PDF/SVG), checks/DRC, the "
|
|
88
|
+
"schematic, and PR review — the human-facing side of the headless kernel.")
|
|
89
|
+
|
|
90
|
+
if found:
|
|
91
|
+
steps = [
|
|
92
|
+
f"Found {len(found)} design(s) here. Open one in the GUI: "
|
|
93
|
+
"viewer_open(path='<one of designs_found>').",
|
|
94
|
+
"Then iterate: add features / edit, and the GUI live-reloads.",
|
|
95
|
+
"Verify with the check tools and export (STEP/STL/drawings/Gerbers).",
|
|
96
|
+
]
|
|
97
|
+
else:
|
|
98
|
+
steps = [
|
|
99
|
+
"No gitcad design found here — offer to start one.",
|
|
100
|
+
"Mechanical: model_new -> feature_add (box, hole, extrude, fillet, ...) "
|
|
101
|
+
"-> viewer_open to see it live.",
|
|
102
|
+
"Electronics: author a schematic/board, or board_import / schematic_import "
|
|
103
|
+
"an existing KiCad design.",
|
|
104
|
+
"Import existing CAD: model_import a STEP file (planar solids come in exact).",
|
|
105
|
+
"Whatever you make, call viewer_open early so the user watches it take shape.",
|
|
106
|
+
]
|
|
107
|
+
return {"has_project": bool(found), "designs_found": found,
|
|
108
|
+
"recommended_next_steps": steps, "open_the_gui": gui,
|
|
109
|
+
"starter_model": Document().dumps(),
|
|
110
|
+
"tip": "Proactively offer to initialize a project and open the GUI — "
|
|
111
|
+
"do not wait to be asked."}
|
|
112
|
+
|
|
113
|
+
|
|
59
114
|
@tool("sheetmetal_author")
|
|
60
115
|
def sheetmetal_author(spec: dict[str, Any]) -> dict[str, Any]:
|
|
61
116
|
"""Sheet metal (SW-map P3) — the mech Gerber. ``spec`` declares the
|
|
@@ -1358,13 +1413,32 @@ def main() -> None: # pragma: no cover - process entrypoint
|
|
|
1358
1413
|
f"(import error: {exc!r})"
|
|
1359
1414
|
)
|
|
1360
1415
|
|
|
1361
|
-
server = FastMCP("gitcad")
|
|
1416
|
+
server = FastMCP("gitcad", instructions=_SERVER_INSTRUCTIONS)
|
|
1362
1417
|
for name, fn in REGISTRY.items():
|
|
1363
1418
|
server.add_tool(_image_bridge(fn, _Image), name=name)
|
|
1364
1419
|
_start_update_watch() # periodic PyPI update check (surfaced on stderr)
|
|
1365
1420
|
server.run()
|
|
1366
1421
|
|
|
1367
1422
|
|
|
1423
|
+
_SERVER_INSTRUCTIONS = (
|
|
1424
|
+
"gitcad — agent-first, git-native, headless B-rep CAD (mechanical + "
|
|
1425
|
+
"electronic). Real exact-arithmetic geometry, associative 2D drawings, and a "
|
|
1426
|
+
"verify/render loop, all as plain text you can commit.\n\n"
|
|
1427
|
+
"START HERE every session: call the `get_started` tool first. It scans the "
|
|
1428
|
+
"working directory for existing designs and returns the next steps. Then "
|
|
1429
|
+
"PROACTIVELY — without waiting to be asked — offer to (1) initialize a project "
|
|
1430
|
+
"(model_new for mechanical; a board/schematic or *_import for electronics) and "
|
|
1431
|
+
"(2) open the interactive GUI with `viewer_open`, sharing the returned "
|
|
1432
|
+
"http://127.0.0.1 URL (most MCP hosts can open it; otherwise the user opens it "
|
|
1433
|
+
"in a browser). Call viewer_open early and keep it open so the user watches "
|
|
1434
|
+
"the design take shape — the GUI has tabs for the 3D model, 2D drawings, "
|
|
1435
|
+
"checks/DRC, schematic, and PR review, and it live-reloads as you edit.\n\n"
|
|
1436
|
+
"Everything is verifiable: build, then check (interference, DRC/ERC, "
|
|
1437
|
+
"requirements) and export (STEP/STL/drawings/Gerbers). Prefer showing results "
|
|
1438
|
+
"in the GUI over describing them."
|
|
1439
|
+
)
|
|
1440
|
+
|
|
1441
|
+
|
|
1368
1442
|
import contextlib
|
|
1369
1443
|
|
|
1370
1444
|
|
|
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
|