opentakeoff-mcp 0.9.105 → 0.9.116

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.
Files changed (3) hide show
  1. package/README.md +27 -18
  2. package/dist/server-core.js +6315 -623
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -44,9 +44,9 @@ what's missing where rendering isn't available.
44
44
  engine is re-validated against a wider plan corpus: `tools/list` never names them, the
45
45
  initialize `instructions` say so and point at `measure_polygon`, and no other tool's
46
46
  description sends an agent to a verb that is not there. A default build registers
47
- **<!--tool-count-->62<!--/tool-count--> tools**. Everything else — sweeps, counts, `derive_base`, `derive_transitions`, the
47
+ **<!--tool-count-->70<!--/tool-count--> tools**. Everything else — sweeps, counts, `derive_base`, `derive_transitions`, the
48
48
  exports — is unchanged. Set `OPENTAKEOFF_ONE_CLICK=1` in the server's environment to
49
- register both verbs (<!--tool-count-all-->64<!--/tool-count-all--> tools); the parity, conformance and e2e tests run that way, and
49
+ register both verbs (<!--tool-count-all-->72<!--/tool-count-all--> tools); the parity, conformance and e2e tests run that way, and
50
50
  `test/gate.test.ts` pins both surfaces. The rows and examples below that use `one_click`
51
51
  describe the lifted build. Design note: [`docs/design/ONE_CLICK_GATE.md`](../docs/design/ONE_CLICK_GATE.md).
52
52
 
@@ -123,7 +123,7 @@ includes document text, shape vertices, or result payload content.
123
123
 
124
124
  ### Staged tool exposure (opt-in)
125
125
 
126
- By default every client gets all <!--tool-count-->62<!--/tool-count--> tool schemas on `tools/list`—the flat
126
+ By default every client gets all <!--tool-count-->70<!--/tool-count--> tool schemas on `tools/list`—the flat
127
127
  contract every published client already expects. Fifty-two descriptions is real
128
128
  token weight for an agent session that may never touch half of them, so the
129
129
  server can instead stage the surface along the workflow it already teaches:
@@ -132,7 +132,7 @@ server can instead stage the surface along the workflow it already teaches:
132
132
  OPENTAKEOFF_MCP_STAGED_TOOLS=1 npx -y opentakeoff-mcp
133
133
  ```
134
134
 
135
- Staged, only the **setup** stage (load, scale, read the set—<!--tool-count-setup-->15<!--/tool-count-setup--> tools) starts
135
+ Staged, only the **setup** stage (load, scale, read the set—<!--tool-count-setup-->22<!--/tool-count-setup--> tools) starts
136
136
  enabled, plus one opener: `open_tool_stage`. Calling it with `"measure"`,
137
137
  `"revise"`, or `"handoff"` enables that stage's tools and fires
138
138
  `tools/list_changed`, so any client that supports dynamic tool lists (Claude
@@ -201,6 +201,7 @@ The [generated tool index](../docs/MCP_TOOL_INDEX.md) lists stages and required
201
201
  | `delete_rfi` | Withdraw an RFI. A **tombstone, never a renumber**: the number stays reserved, the register and the marked set keep printing a gap where it was, and the next RFI takes the next number. Linked markups keep their note and lose the link (the canvas's own delete rule). `undo_last` puts the record and its links back. |
202
202
  | `set_pricing` | Price one condition for the estimate (the canvas **Estimate** panel's row): `unit` (SF / SY / LF / EA), `material` and `labor` $ per unit, and `materials` [{name, price}] for its supporting-material rows per their own unit. Material prices the **order** quantity (waste applied), labor the **measured** one. `null` clears a price to *not entered*; `0` is an explicit $0. Prices come from the estimator, never from the agent. One `undo_last` step restores the condition's prices verbatim; they ride `export_takeoff` into the app. |
203
203
  | `set_estimate_settings` | The project's **markups** (`tax_pct` on material, `overhead_pct`, `profit_pct` as a `markup` or a `margin`), **proposal** text and layout (`itemized`, `scope_note`, `inclusions`, `exclusions`, `terms`, `valid_days`) and **client** (name, address, reference): the canvas's `estimate_settings`, `bid_proposal` and `client_info`. Only what you pass changes; `undo_last` restores all three. |
204
+ | `compare_sheets` | Visual revision comparison of two sheets (or revisions of a sheet): discovers what moved between them. Automatically aligns vector linework, computes segment differences, groups modified/added/removed ink into changed region bounding hulls, and returns existing takeoff shape IDs on `sheet_a` that intersect changed ink so an agent can re-check only what moved. |
204
205
  | `read_sheet_text` | Positioned page text (image px), optionally restricted to a region—title blocks, room labels, finish schedules. |
205
206
  | `find_text` | **Locate** a known string—the complement to `read_sheet_text` (which returns what a region *says*; this finds *where* a string sits). Case-insensitive substring match per pdf.js text run; each hit's center feeds straight into `one_click`'s seed. |
206
207
  | `sheet_graph` | The plan-set INDEX (#87): every sheet's role with evidence, the schedule tables found, every room tag with its stacked name, the detail callouts, and every revision marker (text `Δ2`/`REV 2` tags AND drawn deltas—a bare digit inside a triangle of linework, proven from the sheet's vector geometry—in `revisions`)—how an agent decides WHAT to measure without a human enumerating rooms. |
@@ -209,6 +210,13 @@ The [generated tool index](../docs/MCP_TOOL_INDEX.md) lists stages and required
209
210
  | `sheet_context` | The region's STRUCTURE in one frame: classified vector segments (endpoints as drawn, meta byte per segment), text spans with bboxes, and hatch-family instances with content-derived ids—same pattern spec ⇒ same id anywhere on the sheet, so plan↔legend matching is `id === id`. Decimation is declared and counted on every reply: `kept + dropped === total_in_region`, cap applies longest-first so walls survive. |
210
211
  | `get_sheet_vectors` | The STROKES (#367): the sheet's vector layer exactly as the engine is fed it—flat `[x1, y1, x2, y2, …]` points in image px, one meta byte per segment (curve / clip / fill-only / polyline-arc flags, pen width in the high nibble), per-segment stroke luminance, the drawn figure each segment belongs to, the placed-image area, and the PDF layer table with a per-segment layer index. Nothing classified, decimated, or merged—so a reader can run its own room finder, symbol matcher, or wall classifier against the same array and commit through the existing verbs. Paged (default 20,000 segments, ceiling 100,000) with `offset + returned + dropped === total` on every page; `next_cursor` recovers exactly what `dropped` counts. Read-only and stateless. Refuses on a scan and names `view_sheet` as the path. |
211
212
  | `view_sheet` | The agent's eyes: render the sheet (or an image-px crop) to PNG. `overlay` burns committed shapes in (solid = human-affirmed, dashed = unreviewed) to verify geometry landed; `grid` burns in a calibrated 1-ft/5-ft measuring grid with foot labels (`"auto"` from the set scale, or the drawing scale like `"1/4"`) so dimensions are counted off cells, not guessed; `marks` (#297) burns disclosure layers in — `question` (withheld placements, orange ?-circle), `struck` (rejections, magenta struck ×), `ring` (the sweep's seed, violet double ring) — in colors off the common CAD pens, so what a reply names, the picture shows. |
213
+ | `stitch_sheets` | Stitch 2–4 plan sheets together into a composite working surface across match-lines (#161)—the browser canvas's Stitched Sheets feature. Shapes traced on the returned stitch reference bind to the composite key (`stitch:<uid>`) and measure continuously across seam boundaries once aligned. By default sheets create in auto-butt layout (`aligned: false`). Member sheets must have calibrated, matching scales. |
214
+ | `align_stitch` | Align member sheets of a composite stitch surface using anchor and moving reference points across a match line. Performs automated seam linework analysis, calculating displacement and leftover rotation across the seam, and withholds the stitch if tolerances are exceeded (0.50" / 0.25°). |
215
+ | `list_stitches` | List all existing composite stitched sheet surfaces in the current session, including dimensions, member sheet placements, inherited scale, alignment status, seam check results, and shape counts. |
216
+ | `rotate_page` | Rotate a sheet's page in the PDF (90, 180, or 270 degrees clockwise) before measuring. Transforms all existing takeoff shapes, markups, and calibrations on that sheet to remain locked to the drawing. |
217
+ | `reorder_pages` | Reorder pages in a loaded PDF document. Remaps all takeoff sheet keys so measurements and annotations follow their pages. |
218
+ | `extract_pages` | Extract a subset of pages from a loaded PDF into a new PDF file on disk. Carries all takeoff shapes and annotations on those pages into the new document (mapped to pages 1..N). |
219
+ | `merge_documents` | Merge multiple PDF files into one combined PDF document on disk. Combines the pages and remaps takeoff keys from all source documents. |
212
220
 
213
221
  ### The Assistant window — talk to your AI from inside the canvas
214
222
 
@@ -233,6 +241,7 @@ once, at open time, instead of riding every turn. The long form is the
233
241
  | Suite | Divisions | Tool it adds |
234
242
  |---|---|---|
235
243
  | finishes | 09 | none: core tools (`measure_polygon`, `derive_base`, `derive_transitions`, `measure_surface`) |
244
+ | acoustical_ceilings | 09 | `ceiling_takeoff`: from lay-in areas on the reflected ceiling plan and the module (2x2, 2x4, or 600x600 / 600x1200 in metric): tiles before and with waste, main runners, long and short cross tees, hanger wires at the spec spacing, all as material rows; each area's perimeter committed as a wall angle run. |
236
245
  | roofing | 07 | `roof_takeoff`: sloped SF and squares from plan-view planes and a stated pitch, true rake/hip/valley LF, drip edge, starter, ridge cap, underlayment, ice & water. Writes the slope factors onto the conditions so every total reads true. |
237
246
  | siding | 07 | `siding_takeoff`: net wall SF and squares from elevation faces minus openings, opening trim (doors 3 sides), starter along wall bottoms, corner LF, lap pieces. |
238
247
  | soffit_fascia | 07 | `soffit_takeoff`: soffit SF (eave/rake LF × depth from the wall section), fascia LF, wall receiver, attic intake vent area. |
@@ -245,7 +254,9 @@ The suite tools are derives: they read what is already committed and commit
245
254
  what follows as unreviewed shapes or material rows, one `undo_last` step per
246
255
  write (each reply says how many). They never measure the drawing themselves and
247
256
  never invent a document value: pitch, soffit depth, grid and hanger spacing are
248
- arguments, and every allowance is reported as an allowance.
257
+ arguments, and every allowance is reported as an allowance. Each takes
258
+ `units: "metric"` for arguments and a reply in mm, mm², m and m², and names
259
+ any argument it does not take, in `unknown_args` or in its refusal.
249
260
 
250
261
  A client that reads the tool list only once can pre-open suites:
251
262
 
@@ -422,19 +433,17 @@ sheet number (`A-101`) wherever a sheet is named.
422
433
  has nothing for `detect_rooms`/`sheet_graph`/`resolve_tag` to read: seeds
423
434
  come from you (`view_sheet`, then `one_click`). The raster path needs the
424
435
  same optional `@napi-rs/canvas` as `view_sheet`.
425
- - **Stitching is human-only—deliberately, not a gap.** The canvas can join
426
- 2–4 sheets split at a match line into one composite surface (#200), but no
427
- MCP verb creates, aligns, or addresses a stitch. Joining the match line
428
- means clicking the same drawn wall junction on both halves—a judgment
429
- call with a worse blast radius than a bad scale, because a sloppy align
430
- silently skews every quantity that crosses the seam. That stays behind
431
- human eyes; it is not staged for later exposure. For a split floor: a
432
- human stitches and aligns in the canvas, and over MCP you work each member
433
- sheet as its own surface—a seam-crossing room belongs to the canvas.
434
- This server also doesn't read the app's additive `stitches` payload field,
435
- so a stitched takeoff round-tripped through `import_takeoff` →
436
- `export_takeoff` comes back without its stitches—when a stitch is in
437
- play, the app's own save is the one to keep.
436
+ - **Stitching is gated by a seam check.** `stitch_sheets` joins 2–4 sheets
437
+ split at a match line into one composite surface (`stitch:<uid>`), and
438
+ `align_stitch` places them from a point both sheets draw. A sloppy join
439
+ skews every quantity that crosses the seam, so the server compares the two
440
+ sheets' linework after each alignment and refuses to measure across a seam
441
+ while the stitch is unaligned or the check is withheld (maximum miss over
442
+ 0.5 in by default, any leftover rotation, or no linework at the seam).
443
+ When it withholds, measure each member sheet on its own and tell the user.
444
+ `export_takeoff` and `import_takeoff` carry stitch records. The steps,
445
+ the numbers in the check and a run on a real split pair are in
446
+ [Stitching sheets over MCP](../docs/MCP_STITCHING.md).
438
447
  - `load_plan` replaces the session by default; `merge: true` builds a multi-document working set (#152). Reloading a merged file is refused—reload = replace, deliberately.
439
448
  - The takeoff lives in memory. `export_takeoff` (the app's exact save payload,
440
449
  nothing lost in translation) and `export_marked_pdf` (the reviewable marked