You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/mcp/README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,10 +33,11 @@ structured JSON. `compile` also accepts `plan_json` (the Plan-JSON / RPLAN shape
33
33
34
34
| Tool | What it does |
35
35
|------|--------------|
36
-
|`compile`| Render source (or `plan_json`) to SVG, or to zero-dep ASCII (`format:"txt"`). `accessible`, `overlay:"circulation"` opt-ins. Returns output + diagnostics. |
37
-
|`describe`| Semantic facts (rooms, areas, adjacency, doors, circulation, and a `freedom` report of which positions are hand-authored vs resolver-derived) — verify intent without an image. |
36
+
|`compile`| Render source (or `plan_json`) to SVG, or to zero-dep ASCII (`format:"txt"`). `accessible`, `overlay:"circulation"` opt-ins. Returns output + diagnostics. A multi-storey plan returns every storey in `pages[]`; `level` renders one. |
37
+
|`describe`| Semantic facts (rooms, areas, adjacency, doors, circulation, zones, storeys, the exact `floor_polygon`/`floor_circle` shape, and a `freedom` report of which positions are hand-authored vs resolver-derived) — verify intent without an image. |
38
38
|`lint`| Advisory `W_*` soundness warnings (may include the fix-carrying `W_ALIAS_MATCH` for a room use inferred from an indirect label alias); `profile` selects a ruleset. |
39
-
|`validate`| Parse + resolve + lint, the ship gate. `strict` fails on warnings; `graph` checks interior-door adjacency against an intended room graph. |
39
+
|`validate`| Parse + resolve + lint, the ship gate. `strict` fails on warnings; `graph` checks interior-door adjacency against an intended room graph; `intent` gates on a brief's contract (per `archlang://intent-schema`). |
40
+
|`score`| The continuous intent METER: how much of a brief a plan satisfies (`satisfied`/`total`/`score`/`subscores`). Measures, never gates. |
40
41
|`repair`| Explicit corrector: furniture out of walls/doorways/swings → new `.arch` source + change log. Never adds doors/windows. |
41
42
|`fix`| Apply the machine-applicable fixes on a plan's diagnostics (syntactic corrector; bounded fixpoint). `unsafe` widens to `maybe-incorrect`. |
42
43
|`suggest`| Advisory door/window statements (each referencing its wall by a stable ref — an authored id or a unique category — or absolute coordinates, never a re-bindable positional id) to resolve unreachable rooms / windowless bedrooms — data, never applied. |
@@ -50,6 +51,7 @@ structured JSON. `compile` also accepts `plan_json` (the Plan-JSON / RPLAN shape
Copy file name to clipboardExpand all lines: packages/mcp/package.json
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
{
2
2
"name": "@chanmeng666/archlang-mcp",
3
-
"version": "0.2.2",
3
+
"version": "0.2.3",
4
4
"mcpName": "io.github.ChanMeng666/archlang-mcp",
5
-
"description": "Model Context Protocol (MCP) server for ArchLang — compile, describe, lint, validate, score, repair, fix and suggest floor plans over stdio, plus the v1.14 intent channel (gate + continuous score against a brief). A thin shim over @chanmeng666/archlang; the CLI stays the primary, token-cheaper interface.",
5
+
"description": "Model Context Protocol (MCP) server for ArchLang — compile, describe, lint, validate, score, repair, fix and suggest floor plans over stdio, plus the intent channel (gate + continuous score against a brief). Covers the whole current language: multi-storey `level` plans with stairs, `place`d components, zones, scaled paper with dimension chains and room schedules, and non-rectilinear `room polygon` / `room circle` / `arc` walls. A thin shim over @chanmeng666/archlang; the CLI stays the primary, token-cheaper interface.",
'Compile ArchLang `.arch` source (or a Plan-JSON object) to an SVG floor plan, or to a zero-dependency ASCII text plan (format:"txt"). Returns the rendered output plus diagnostics — each a byte span, line/col, catalogued E_/W_ code, and a machine-applicable fix. Errors are DATA, never exceptions: read `diagnostics` and correct the source.',
136
+
'Compile ArchLang `.arch` source (or a Plan-JSON object) to an SVG floor plan, or to a zero-dependency ASCII text plan (format:"txt"). Returns the rendered output plus diagnostics — each a byte span, line/col, catalogued E_/W_ code, and a machine-applicable fix. Errors are DATA, never exceptions: read `diagnostics` and correct the source. A MULTI-STOREY plan (`level <n> { … }`) is a set of drawings: `output` is the lowest storey and every storey comes back in `pages[]` ({ level, name, output }), so pass `level` to render just one.',
114
137
inputSchema: {
115
138
source: z.string().optional().describe('ArchLang source (a `plan "…" { … }`). Provide this OR plan_json.'),
116
139
plan_json: z
@@ -120,21 +143,59 @@ export function createServer(): McpServer {
120
143
format: z.enum(["svg","txt"]).optional().describe("svg (default) or txt (zero-dependency ASCII)."),
// A `level` this plan does not declare is refused with the real set — never silently
168
+
// answered with the ground floor, which would look like a successful render of it.
169
+
if(a.level!==undefined){
170
+
constlevels=pages?.map((p)=>p.level)??[];
171
+
constwant=pages?.find((p)=>p.level===a.level);
172
+
if(!want)
173
+
returnjson({ok: false, format,error: `no level ${a.level} in this plan`, levels,diagnostics: diags});
174
+
returnjson({
175
+
ok: true,
176
+
format,
177
+
level: want.level,
178
+
output: render(want.svg,want.scene),
179
+
levels,
180
+
diagnostics: diags,
181
+
});
182
+
}
183
+
returnjson({
184
+
ok: true,
185
+
format,
186
+
output: render(svg,scene),
187
+
// Present only for a genuinely multi-storey plan, so a single-storey result is unchanged.
188
+
...(pages
189
+
? {
190
+
pages: pages.map((p)=>({
191
+
level: p.level,
192
+
...(p.name!==undefined ? {name: p.name} : {}),
193
+
output: render(p.svg,p.scene),
194
+
})),
195
+
}
196
+
: {}),
197
+
diagnostics: diags,
198
+
});
138
199
},
139
200
);
140
201
@@ -143,7 +204,7 @@ export function createServer(): McpServer {
143
204
{
144
205
title: "Describe a plan (facts, no render)",
145
206
description:
146
-
"Semantic facts about a plan without rendering: rooms (areas, bboxes, adjacency, uses), doors (what they connect), windows, circulation (walk distance / bottleneck width / detour), and totals. The channel a text-only agent uses to VERIFY that a plan matches intent.",
207
+
"Semantic facts about a plan without rendering: rooms (areas, bboxes, adjacency, uses, and the exact shape — `floor_polygon` for a `room polygon`, `floor_circle` for a `room circle`, whose area is exact πR²), doors (what they connect), windows, circulation (walk distance / bottleneck width / detour), zones, storeys (`levels[i]` carries the same facts per floor) with the shafts that join them and which storeys stay reachable (`vertical`), the drawing extent (`bbox`, `bbox_outer`), `freedom` (which positions are hand-authored vs resolver-derived), and totals. The channel a text-only agent uses to VERIFY that a plan matches intent.",
0 commit comments