@snaptrude/plugin-core 0.9.10 → 0.9.12

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.
package/api-manifest.json CHANGED
@@ -3403,8 +3403,7 @@
3403
3403
  "examplePrompts": [
3404
3404
  "Switch to present mode",
3405
3405
  "Open BIM mode",
3406
- "Go back to design mode",
3407
- "Open program mode\n\n# Example\n```ts\nawait snaptrude.core.mode.set(\"present\")\n// ... presentation work ...\nawait snaptrude.core.mode.set(\"design\")\n```"
3406
+ "Go back to design mode\n\n# Example\n```ts\nawait snaptrude.core.mode.set(\"present\")\n// ... presentation work ...\nawait snaptrude.core.mode.set(\"design\")\n```"
3408
3407
  ],
3409
3408
  "argsType": "PluginAppMode",
3410
3409
  "resultType": "PluginCoreModeSetResult"
@@ -4039,19 +4038,6 @@
4039
4038
  "argsType": "ComponentHandle",
4040
4039
  "resultType": "PluginCoreTagsGetTagsForComponentResult"
4041
4040
  },
4042
- {
4043
- "path": "core.tags.listForComponents",
4044
- "namespace": "core.tags",
4045
- "summary": "List the tags carried by many components in one call.",
4046
- "examplePrompts": [
4047
- "Get the tags of every space with their colors",
4048
- "List the tags on all rooms so I can color them by Occupancy",
4049
- "Which tag does each selected space carry?\n\n# Example\n```ts\nconst { components } = await snaptrude.core.tags.listForComponents()\nfor (const c of components) {\nconst occupancy = c.tags.find((t) => t.categoryName === \"Occupancy\")\nif (occupancy) paint(c.componentId, occupancy.color)\n}\n```"
4050
- ],
4051
- "argsType": "ComponentHandle[]",
4052
- "resultType": "PluginCoreTagsListForComponentsResult",
4053
- "performance": "One round-trip for any number of components — use this instead of a `listForComponent` loop."
4054
- },
4055
4041
  {
4056
4042
  "path": "core.tags.unassign",
4057
4043
  "namespace": "core.tags",
@@ -4313,27 +4299,10 @@
4313
4299
  "Put a door from the catalog at this point on the wall",
4314
4300
  "Insert the entrance door into this wall",
4315
4301
  "Add a door to the wall and call it Entry-01",
4316
- "Add a door that opens into the living room",
4317
- "Put a door here hinged on the north jamb\n\n# Example\n```ts\nconst [wall] = await snaptrude.design.query.listWalls({ isSelected: true })\nconst [entry] = await snaptrude.design.doors.listCatalog()\nconst door = await snaptrude.design.create.door(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ label: \"Entry-01\" },\n)\n// …facing a specific side of the wall (pass a point inside that room):\nconst intoKitchen = await snaptrude.design.create.door(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\nundefined,\nawait snaptrude.core.math.vec3.new(3, 0, 9),\n)\n// …and hinged on the jamb nearest a point (here the +x end of the opening):\nconst hingedRight = await snaptrude.design.create.door(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ hinge: await snaptrude.core.math.vec3.new(3.5, 0, 5) },\nawait snaptrude.core.math.vec3.new(3, 0, 9),\n)\n```"
4302
+ "Add a door that opens into the living room\n\n# Example\n```ts\nconst [wall] = await snaptrude.design.query.listWalls({ isSelected: true })\nconst [entry] = await snaptrude.design.doors.listCatalog()\nconst door = await snaptrude.design.create.door(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ label: \"Entry-01\" },\n)\n// …facing a specific side of the wall (pass a point inside that room):\nconst intoKitchen = await snaptrude.design.create.door(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\nundefined,\nawait snaptrude.core.math.vec3.new(3, 0, 9),\n)\n```"
4318
4303
  ],
4319
4304
  "argsType": "string",
4320
- "resultType": "ComponentHandle",
4321
- "performance": "For MORE THAN ONE door, call `design.create.doors(items[])` — one host round-trip and ONE undo entry, with each host wall re-cut once per opening inside that single call. Looping this single-door creator is N round-trips."
4322
- },
4323
- {
4324
- "path": "design.create.doors",
4325
- "namespace": "design.create",
4326
- "summary": "Place **many doors** into host walls in one undoable operation (bulk plural of {@linkcode door}). Each item carries its own catalog id, host wall, world position, and optional `facing`, `label`, `width` and `height` — the same fields as a `\"door\"` {@linkcode PluginDesignCreateOpeningOptions}. Validate-all-or-throw; one command.",
4327
- "examplePrompts": [
4328
- "Add doors to all of these walls at once",
4329
- "Place a door in every room in one operation",
4330
- "Bulk add the entrance doors from this schedule",
4331
- "Put three doors on this wall in a single undo step",
4332
- "Add all the doors for this floor plan together"
4333
- ],
4334
- "argsType": "PluginCreateDoorItem[]",
4335
- "resultType": "ComponentHandle[]",
4336
- "performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry, and each distinct catalog source loads once. Always prefer this over calling `design.create.door` in a loop: build the full `items[]` array first (all host walls and points up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const [wall] = await snaptrude.design.query.listWalls({ isSelected: true }) const [entry] = await snaptrude.design.doors.listCatalog() const [front, side] = await snaptrude.design.create.doors([ { catalogId: entry.id, hostWall: wall, position: await v.new(2, 0, 5), label: \"D-01\" }, { catalogId: entry.id, hostWall: wall, position: await v.new(6, 0, 5), width: 1.2 }, ]) // `wall` was re-cut twice and no longer resolves — ask the opening for its host: const currentWall = await snaptrude.design.query.getHost(front) ```"
4305
+ "resultType": "ComponentHandle"
4337
4306
  },
4338
4307
  {
4339
4308
  "path": "design.create.floor",
@@ -4346,23 +4315,7 @@
4346
4315
  "Put a floor at this position with 150mm thickness\n\n# Example\n```ts\nconst rect = await snaptrude.core.geom.create.profileRect(5, 4)\nconst contour = await snaptrude.core.geom.create.contourFromProfile(rect)\nconst floor = await snaptrude.design.create.floor(contour, 0.1)\n```"
4347
4316
  ],
4348
4317
  "argsType": "ContourHandle",
4349
- "resultType": "ComponentHandle",
4350
- "performance": "For MORE THAN ONE floor, call `design.create.floors(items[])` — one host round-trip and ONE undo entry for the whole batch. Looping this single-floor creator is N round-trips and N undo entries."
4351
- },
4352
- {
4353
- "path": "design.create.floors",
4354
- "namespace": "design.create",
4355
- "summary": "Create **many floors** in one undoable operation (bulk plural of {@linkcode floor}). Each item extrudes its own footprint contour (outer profile + holes) upward by its own `thickness`, at its own optional position offset. Validate-all-or-throw; one command.",
4356
- "examplePrompts": [
4357
- "Create floors for all these room outlines at once",
4358
- "Add a floor to every space in one operation",
4359
- "Bulk create the floor plates for this building",
4360
- "Lay 100mm floors across these five footprints in one undo step",
4361
- "Create the ground and first floor slabs together"
4362
- ],
4363
- "argsType": "PluginCreateFloorItem[]",
4364
- "resultType": "ComponentHandle[]",
4365
- "performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry. Always prefer this over calling `design.create.floor` in a loop: build the full `items[]` array first (all contours and offsets up front), then make one call. # Example ```ts const rect = await snaptrude.core.geom.create.profileRect(5, 4) const contour = await snaptrude.core.geom.create.contourFromProfile(rect) const [ground, upper] = await snaptrude.design.create.floors([ { contour, thickness: 0.1 }, { contour, thickness: 0.1, position: await snaptrude.core.math.vec3.new(0, 3, 0) }, ]) ```"
4318
+ "resultType": "ComponentHandle"
4366
4319
  },
4367
4320
  {
4368
4321
  "path": "design.create.furniture",
@@ -4377,23 +4330,7 @@
4377
4330
  "Place a chair here rotated 90 degrees\n\n# Example\n```ts\nconst chair = await snaptrude.design.create.furniture(\n\"6620f1a…\", // from design.furniture.listCatalog()\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ label: \"Chair-01\" },\n)\n// …placed already turned 90° about the vertical axis:\nconst turned = await snaptrude.design.create.furniture(\n\"6620f1a…\",\nawait snaptrude.core.math.vec3.new(3, 0, 5),\nundefined,\n90,\n)\n```"
4378
4331
  ],
4379
4332
  "argsType": "string",
4380
- "resultType": "ComponentHandle",
4381
- "performance": "For MORE THAN ONE item, call `design.create.furnitureItems(items[])` — one host round-trip and ONE undo entry, and a catalog source shared by several items is fetched once. Looping this single-item creator is N round-trips."
4382
- },
4383
- {
4384
- "path": "design.create.furnitureItems",
4385
- "namespace": "design.create",
4386
- "summary": "Place **many furniture items** in one undoable operation (bulk plural of {@linkcode furniture}). Each item names a catalog id and an absolute world position (`position.y` is the REST elevation — the same grounding contract as the singular creator), with optional label and rotation. A catalog source shared by several items is fetched and recorded once for the whole batch, so the host — not the caller — owns source persistence (there is no per-item `createNewSourceMesh`). Validate-all-or-throw; one command.",
4387
- "examplePrompts": [
4388
- "Place all the desks for this office at once",
4389
- "Furnish every bedroom in one operation",
4390
- "Bulk place these chairs around the table",
4391
- "Add the whole furniture layout in a single undo step",
4392
- "Drop twenty copies of this chair at these positions"
4393
- ],
4394
- "argsType": "PluginCreateFurnitureItem[]",
4395
- "resultType": "ComponentHandle[]",
4396
- "performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry, and each distinct catalog source loads once. Always prefer this over calling `design.create.furniture` in a loop: build the full `items[]` array first (all positions and angles up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const [chair] = await snaptrude.design.furniture.listCatalog() const placed = await snaptrude.design.create.furnitureItems([ { catalogId: chair.id, position: await v.new(3, 0, 5), label: \"Chair-01\" }, { catalogId: chair.id, position: await v.new(4, 0, 5), angleInDegrees: 90 }, { catalogId: chair.id, position: await v.new(5, 0, 5), angleInDegrees: 180 }, ]) ```"
4333
+ "resultType": "ComponentHandle"
4397
4334
  },
4398
4335
  {
4399
4336
  "path": "design.create.mass",
@@ -4430,7 +4367,7 @@
4430
4367
  ],
4431
4368
  "argsType": "PluginDesignCreateOpeningOptions",
4432
4369
  "resultType": "ComponentHandle",
4433
- "performance": "Single-opening creator — use it for one hosted opening. For MORE THAN ONE, call `design.create.doors(items[])` / `design.create.windows(items[])`: the same per-item fields, one host round-trip, ONE undo entry. # Example ```ts const opening = await snaptrude.design.create.opening({ kind: \"window\", catalogId: windowType.id, hostWall: wall, position: await snaptrude.core.math.vec3.new(3, 0, 5), width: 1.2, height: 1.5, sillHeight: 0.9, }) ```"
4370
+ "performance": "Single-opening creator — use it for one hosted opening. A plural API is intentionally unavailable until host placement can be atomic. # Example ```ts const opening = await snaptrude.design.create.opening({ kind: \"window\", catalogId: windowType.id, hostWall: wall, position: await snaptrude.core.math.vec3.new(3, 0, 5), width: 1.2, height: 1.5, sillHeight: 0.9, }) ```"
4434
4371
  },
4435
4372
  {
4436
4373
  "path": "design.create.referenceLines",
@@ -4532,21 +4469,6 @@
4532
4469
  "argsType": "PluginStaircasePreset",
4533
4470
  "resultType": "ComponentHandle"
4534
4471
  },
4535
- {
4536
- "path": "design.create.wallRuns",
4537
- "namespace": "design.create",
4538
- "summary": "Create **many wall runs** in one undoable operation (bulk plural of {@linkcode walls}). Each item is one full run — a wall per curve in that item's profile chain, mitred at shared endpoints. Junctions resolve within a run, not between runs. Each item carries its own dimensions, `wallType` and `storey`, so a single call can build a whole floor plate or several storeys at once. Validate-all-or-throw; one command.",
4539
- "examplePrompts": [
4540
- "Draw all the walls of this floor plan at once",
4541
- "Build every room's perimeter in one operation",
4542
- "Bulk create wall runs from these centerlines",
4543
- "Create the walls for both storeys in a single undo step",
4544
- "Turn these polylines into 200mm brick walls together"
4545
- ],
4546
- "argsType": "PluginCreateWallRunItem[]",
4547
- "resultType": "ComponentHandle[][]",
4548
- "performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry. Always prefer this over calling `design.create.walls` in a loop: build the full `items[]` array first (all profiles up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const ground = await snaptrude.core.geom.create.profileFromLinePoints([ await v.new(0, 0, 0), await v.new(8, 0, 0), await v.new(8, 0, 6), ]) const upper = await snaptrude.core.geom.create.profileFromLinePoints([ await v.new(0, 0, 0), await v.new(8, 0, 0), ]) const [groundWalls, upperWalls] = await snaptrude.design.create.wallRuns([ { profile: ground, height: 3, thickness: 0.2 }, { profile: upper, height: 3, storey: 2 }, ]) console.log(groundWalls.length, \"walls on the ground floor\") ```"
4549
- },
4550
4472
  {
4551
4473
  "path": "design.create.walls",
4552
4474
  "namespace": "design.create",
@@ -4561,8 +4483,7 @@
4561
4483
  "Build the perimeter in exposed concrete walls\n\n# Example\n```ts\nconst v = snaptrude.core.math.vec3\nconst centerlines = await snaptrude.core.geom.create.profileFromLinePoints([\nawait v.new(0, 0, 0),\nawait v.new(8, 0, 0),\nawait v.new(8, 0, 6),\n])\nconst walls = await snaptrude.design.create.walls(centerlines, 3, 0.2)\n// …built as a specific wall type (layers/material/thickness from the type):\nconst [brick] = await snaptrude.design.types.list(\"wall\")\nconst brickWalls = await snaptrude.design.create.walls(\ncenterlines, 3, undefined, brick.label,\n)\n```"
4562
4484
  ],
4563
4485
  "argsType": "ProfileHandle",
4564
- "resultType": "ComponentHandle[]",
4565
- "performance": "For MORE THAN ONE run, call `design.create.wallRuns(items[])` — one host round-trip and ONE undo entry for every run in the batch. Looping this single-run creator is N round-trips and N undo entries."
4486
+ "resultType": "ComponentHandle[]"
4566
4487
  },
4567
4488
  {
4568
4489
  "path": "design.create.window",
@@ -4577,23 +4498,7 @@
4577
4498
  "Add a casement window opening toward the garden side\n\n# Example\n```ts\nconst [wall] = await snaptrude.design.query.listWalls({ isSelected: true })\nconst [entry] = await snaptrude.design.windows.listCatalog()\nconst window = await snaptrude.design.create.window(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ label: \"Win-01\" },\n)\n```"
4578
4499
  ],
4579
4500
  "argsType": "string",
4580
- "resultType": "ComponentHandle",
4581
- "performance": "For MORE THAN ONE window, call `design.create.windows(items[])` — one host round-trip and ONE undo entry, with each host wall re-cut once per opening inside that single call. Looping this single-window creator is N round-trips."
4582
- },
4583
- {
4584
- "path": "design.create.windows",
4585
- "namespace": "design.create",
4586
- "summary": "Place **many windows** into host walls in one undoable operation (bulk plural of {@linkcode window}). Each item carries its own catalog id, host wall, world position, and optional `facing`, `label`, `width`, `height` and `sillHeight` — the same fields as a `\"window\"` {@linkcode PluginDesignCreateOpeningOptions}. `sillHeight` is measured from the host wall base to the BOTTOM of the window. Validate-all-or-throw; one command.",
4587
- "examplePrompts": [
4588
- "Add windows along this whole facade at once",
4589
- "Place a window in every bedroom in one operation",
4590
- "Bulk add the windows from this schedule",
4591
- "Put four windows on this wall in a single undo step",
4592
- "Add all the windows with a 0.9m sill height together"
4593
- ],
4594
- "argsType": "PluginCreateWindowItem[]",
4595
- "resultType": "ComponentHandle[]",
4596
- "performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry, and each distinct catalog source loads once. Always prefer this over calling `design.create.window` in a loop: build the full `items[]` array first (all host walls and points up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const [wall] = await snaptrude.design.query.listWalls({ isSelected: true }) const [casement] = await snaptrude.design.windows.listCatalog() const placed = await snaptrude.design.create.windows([ { catalogId: casement.id, hostWall: wall, position: await v.new(2, 0, 5), sillHeight: 0.9 }, { catalogId: casement.id, hostWall: wall, position: await v.new(5, 0, 5), sillHeight: 0.9 }, ]) const currentWall = await snaptrude.design.query.getHost(placed[0]) ```"
4501
+ "resultType": "ComponentHandle"
4597
4502
  },
4598
4503
  {
4599
4504
  "path": "design.delete.entities",
@@ -4610,82 +4515,6 @@
4610
4515
  "resultType": "PluginDesignChangeResult",
4611
4516
  "performance": "Array delete — pass every target in one call (one host round-trip). There is no per-item delete; collect the whole set and never loop this per entity. # Example ```ts // Hard-delete every furniture item on storey 2 (a single undo entry) const furniture = await snaptrude.design.query.listFurniture({ storeys: [2] }) if (furniture.length > 0) { const { affected } = await snaptrude.design.delete.entities(furniture) } ```"
4612
4517
  },
4613
- {
4614
- "path": "design.dimensions.create",
4615
- "namespace": "design.dimensions",
4616
- "summary": "Draw one dimension line between two world points, anchored to a component.",
4617
- "examplePrompts": [
4618
- "Dimension every wall on level 2",
4619
- "Add a dimension line along this wall",
4620
- "Measure the width of this room and label it on the plan\n\n# Example\n```ts\nconst { design, core } = snaptrude\nconst v = core.math.vec3\nconst curve = core.geom.query.curve\nfor (const wall of await design.query.listWalls({ storeys: [2] })) {\nconst cl = await design.query.geometry.getCenterline(wall)\nif (!cl) continue\nconst a = await curve.getStartPoint(cl)\nconst b = await curve.getEndPoint(cl)\nawait design.dimensions.create(\nawait v.new(a.x, a.y, a.z),\nawait v.new(b.x, b.y, b.z),\nwall,\n)\n}\n```"
4621
- ],
4622
- "argsType": "Vec3Handle",
4623
- "resultType": "DimensionHandle"
4624
- },
4625
- {
4626
- "path": "design.dimensions.delete",
4627
- "namespace": "design.dimensions",
4628
- "summary": "Delete dimension lines — the same hard removal as selecting them and pressing Delete. Undoable as a **single** entry for the whole batch.",
4629
- "examplePrompts": [
4630
- "Remove all dimension lines",
4631
- "Delete the dimensions on this wall",
4632
- "Clear the measurements I added to level 2"
4633
- ],
4634
- "argsType": "DimensionHandle[]",
4635
- "resultType": "PluginDimensionsChangeResult",
4636
- "performance": "Array API — pass the whole set in one call (one host round-trip, one undo entry). Never loop this per dimension. # Example ```ts const dims = snaptrude.design.dimensions const onWall = await dims.list({ anchors: [wall] }) if (onWall.length > 0) await dims.delete(onWall.map((d) => d.id)) ```"
4637
- },
4638
- {
4639
- "path": "design.dimensions.get",
4640
- "namespace": "design.dimensions",
4641
- "summary": "Read one dimension line by handle.",
4642
- "examplePrompts": [
4643
- "Read the dimension line I just created",
4644
- "How long is this dimension and what does its label say?",
4645
- "Check whether that dimension line still exists\n\n# Example\n```ts\nconst dim = await snaptrude.design.dimensions.get(handle)\nif (dim) console.log(dim.label, dim.length, dim.storey)\n```"
4646
- ],
4647
- "argsType": "DimensionHandle",
4648
- "resultType": "PluginDimensionLine | null"
4649
- },
4650
- {
4651
- "path": "design.dimensions.hide",
4652
- "namespace": "design.dimensions",
4653
- "summary": "Hide dimension lines from the viewport — the same as the right-click \"Hide\" action (it sets the user Hide flag, `isHidden`). Undoable. Already-hidden dimensions are skipped and are not reported in `affected`.",
4654
- "examplePrompts": [
4655
- "Hide the dimensions on this storey",
4656
- "Hide every dimension line while I present",
4657
- "Temporarily hide the measurements on level 3"
4658
- ],
4659
- "argsType": "DimensionHandle[]",
4660
- "resultType": "PluginDimensionsChangeResult",
4661
- "performance": "Array API — one host round-trip and one undo entry for the whole set. # Example ```ts const dims = snaptrude.design.dimensions const onLevel3 = await dims.list({ storeys: [3] }) const { affected } = await dims.hide(onLevel3.map((d) => d.id)) ```"
4662
- },
4663
- {
4664
- "path": "design.dimensions.list",
4665
- "namespace": "design.dimensions",
4666
- "summary": "List the dimension lines in the project as full records.",
4667
- "examplePrompts": [
4668
- "List all the dimension lines in this model",
4669
- "Which dimensions are on level 3?",
4670
- "Flag any dimension line shorter than 600 mm"
4671
- ],
4672
- "argsType": "{\n storeys?: number[]\n anchors?: ComponentHandle[]\n isHidden?: boolean\n }",
4673
- "resultType": "PluginDimensionLine[]",
4674
- "performance": "Array read — one host round-trip returns every record. Filter in one call rather than calling `get` per dimension. # Example ```ts const units = snaptrude.core.units const min = await units.convert(600, \"millimeters\", await units.getBabylonType()) const short = (await snaptrude.design.dimensions.list()).filter( (d) => d.length < min, ) console.log(short.map((d) => `${d.label} on storey ${d.storey}`)) ```"
4675
- },
4676
- {
4677
- "path": "design.dimensions.show",
4678
- "namespace": "design.dimensions",
4679
- "summary": "Reveal hidden dimension lines — clear the user Hide flag, the inverse of {@linkcode PluginDesignDimensionsApi.hide}. Undoable. Already-visible dimensions are skipped and are not reported in `affected`.",
4680
- "examplePrompts": [
4681
- "Show the dimension lines again",
4682
- "Unhide all the hidden dimensions",
4683
- "Bring back the measurements I hid on this storey"
4684
- ],
4685
- "argsType": "DimensionHandle[]",
4686
- "resultType": "PluginDimensionsChangeResult",
4687
- "performance": "Array API — one host round-trip and one undo entry for the whole set. # Example ```ts const dims = snaptrude.design.dimensions const hidden = await dims.list({ isHidden: true }) await dims.show(hidden.map((d) => d.id)) ```"
4688
- },
4689
4518
  {
4690
4519
  "path": "design.doors.exists",
4691
4520
  "namespace": "design.doors",
@@ -4767,7 +4596,7 @@
4767
4596
  {
4768
4597
  "path": "design.doors.getSwingDirection",
4769
4598
  "namespace": "design.doors",
4770
- "summary": "Get a door's swing (hinge) handedness. Stand on the side the door swings open to, facing the door: `'left'` when the hinged jamb is on your left, `'right'` when it is on your right. Derived from the placed mesh's orientation (the same reflection `mirror` and the `hinge` placement option apply), not a persisted field.",
4599
+ "summary": "Get a door's swing (hinge) handedness — whether it opens as a left-hand or right-hand door. Derived from the door mesh's reflection state, not a persisted field.",
4771
4600
  "examplePrompts": [
4772
4601
  "Which way does this door swing?",
4773
4602
  "Is the selected door left-handed or right-handed?",
@@ -4832,13 +4661,13 @@
4832
4661
  {
4833
4662
  "path": "design.doors.mirror",
4834
4663
  "namespace": "design.doors",
4835
- "summary": "Mirror a door about its own axes. `'x'` (default) flips the swing side — the door opens to the other side of the wall; `'z'` swaps the hinged jamb (left-hand ↔ right-hand, same swing side); `'y'` turns it upside down. Undoable as a single command.",
4664
+ "summary": "Mirror a door across an axis, flipping its swing so it opens from the other side. Undoable as a single command.",
4836
4665
  "examplePrompts": [
4837
4666
  "Flip this door's swing",
4838
4667
  "Mirror the selected door",
4839
4668
  "Make this door open the other way",
4840
4669
  "Reverse the hinge side of the entrance door",
4841
- "Change the door to swing from the other side\n\n# Example\n```ts\n// Flip the selected door's swing side — axis defaults to \"x\"\nconst [door] = await snaptrude.design.query.listDoors({ isSelected: true })\nconst { affected } = await snaptrude.design.doors.mirror(door)\n// …or swap the hinged jamb instead (keeps the swing side)\nawait snaptrude.design.doors.mirror(door, \"z\")\n```"
4670
+ "Change the door to swing from the other side\n\n# Example\n```ts\n// Flip the selected door's swing — axis defaults to \"x\" (the swing-flip\n// axis); pass \"y\" or \"z\" to reflect across a different axis\nconst [door] = await snaptrude.design.query.listDoors({ isSelected: true })\nconst { affected } = await snaptrude.design.doors.mirror(door)\n```"
4842
4671
  ],
4843
4672
  "argsType": "ComponentHandle",
4844
4673
  "resultType": "PluginDesignChangeResult"
@@ -4910,6 +4739,103 @@
4910
4739
  "argsType": "PluginDesignListErasableEdgesArgs",
4911
4740
  "resultType": "ErasableEdgeRef[]"
4912
4741
  },
4742
+ {
4743
+ "path": "design.family.create",
4744
+ "namespace": "design.family",
4745
+ "summary": "Commit the prepared bundle to the project's parametric-definition library, so it survives the session and appears in the Families panel.",
4746
+ "examplePrompts": [
4747
+ "Save this as a family called Vertical Louvre",
4748
+ "Add it to my library\n\n# Example\n```ts\nconst { definitionId } = await snaptrude.design.family.create({ name: \"Louvre Screen\" })\n```"
4749
+ ],
4750
+ "argsType": "PluginDesignFamilyCreateArgs",
4751
+ "resultType": "PluginFamilyCreateResult"
4752
+ },
4753
+ {
4754
+ "path": "design.family.flex",
4755
+ "namespace": "design.family",
4756
+ "summary": "Re-run the prepared family's recipe at new parameter values.",
4757
+ "examplePrompts": [
4758
+ "Change it to 6 bays",
4759
+ "Show me what happens with 20 blades\n\n# Example\n```ts\nconst { changed } = await snaptrude.design.family.flex({ values: { bays: 6 } })\nconsole.log(`removed ${changed.removed}, rebuilt ${changed.rebuilt}`)\n```"
4760
+ ],
4761
+ "argsType": "PluginDesignFamilyFlexArgs",
4762
+ "resultType": "PluginFamilyFlexResult"
4763
+ },
4764
+ {
4765
+ "path": "design.family.get",
4766
+ "namespace": "design.family",
4767
+ "summary": "The prepared family's spec bundle, or `null` when nothing is prepared.",
4768
+ "examplePrompts": [],
4769
+ "argsType": null,
4770
+ "resultType": "PluginFamilyBundle | null"
4771
+ },
4772
+ {
4773
+ "path": "design.family.getParameters",
4774
+ "namespace": "design.family",
4775
+ "summary": "Read a placed component's current parameter values and its sheet.",
4776
+ "examplePrompts": [
4777
+ "What size is that table?",
4778
+ "Show me the parameters on this partition\n\n# Example\n```ts\nconst { values, parameters } = await snaptrude.design.family.getParameters({ component })\n```"
4779
+ ],
4780
+ "argsType": "PluginDesignFamilyGetParametersArgs",
4781
+ "resultType": "PluginFamilyInstanceParameters | null"
4782
+ },
4783
+ {
4784
+ "path": "design.family.getReference",
4785
+ "namespace": "design.family",
4786
+ "summary": "Read the family-spec DSL reference: grammar, the op table, the expression whitelist, the coordinate convention, the repair contract, and a worked example taken from a registered family.",
4787
+ "examplePrompts": [
4788
+ "How do I write a parametric family spec?",
4789
+ "Show me the family DSL\n\n# Example\n```ts\nconst { reference } = await snaptrude.design.family.getReference()\n```"
4790
+ ],
4791
+ "argsType": null,
4792
+ "resultType": "PluginFamilyReference"
4793
+ },
4794
+ {
4795
+ "path": "design.family.list",
4796
+ "namespace": "design.family",
4797
+ "summary": "Every parametric family registered in this session — native and imported.",
4798
+ "examplePrompts": [
4799
+ "What families are available?\n\n# Example\n```ts\nconst families = await snaptrude.design.family.list()\n```"
4800
+ ],
4801
+ "argsType": null,
4802
+ "resultType": "PluginFamilySummary[]"
4803
+ },
4804
+ {
4805
+ "path": "design.family.place",
4806
+ "namespace": "design.family",
4807
+ "summary": "Put a family into the model — either the prepared draft or any family from {@linkcode PluginDesignFamilyApi.list}.",
4808
+ "examplePrompts": [
4809
+ "Place it in the model",
4810
+ "Put a louvre screen at the origin",
4811
+ "Copy that table two metres to the right\n\n# Example\n```ts\n// positioned — geometry exists when this resolves\nconst { component } = await snaptrude.design.family.place({\nid: \"revit:gypsum-stud-partition~90ad72\",\nposition: { x: 0, y: 0, z: 0 },\nrotation: 90,\n})\nawait snaptrude.design.transform.move([component], { x: 2, y: 0, z: 0 })\n\n// interactive — the user clicks\nawait snaptrude.design.family.place()\n```"
4812
+ ],
4813
+ "argsType": "PluginDesignFamilyPlaceArgs",
4814
+ "resultType": "PluginFamilyPlaceResult"
4815
+ },
4816
+ {
4817
+ "path": "design.family.prepare",
4818
+ "namespace": "design.family",
4819
+ "summary": "Validate, compile and preview a family spec. Nothing is committed to the model or the library — call {@linkcode PluginDesignFamilyApi.place} or {@linkcode PluginDesignFamilyApi.create} for that.",
4820
+ "examplePrompts": [
4821
+ "Make a louvre screen with adjustable blade count and tilt",
4822
+ "Design a curtain wall panel family with 8 bays",
4823
+ "Create a railing family I can adjust\n\n# Example\n```ts\nconst r = await snaptrude.design.family.prepare({ bundle })\nif (!r.ok) console.error(r.errors[0].path, r.errors[0].message)\n```"
4824
+ ],
4825
+ "argsType": "PluginDesignFamilyPrepareArgs",
4826
+ "resultType": "PluginFamilyPrepareResult"
4827
+ },
4828
+ {
4829
+ "path": "design.family.setParameters",
4830
+ "namespace": "design.family",
4831
+ "summary": "Change a placed component's parameters and rebuild its geometry in place.",
4832
+ "examplePrompts": [
4833
+ "Make that table seat 8",
4834
+ "Change the stud spacing to 400\n\n# Example\n```ts\nawait snaptrude.design.family.setParameters({ component, values: { seats: 8 } })\n```"
4835
+ ],
4836
+ "argsType": "PluginDesignFamilySetParametersArgs",
4837
+ "resultType": "PluginFamilyInstanceParameters"
4838
+ },
4913
4839
  {
4914
4840
  "path": "design.furniture.exists",
4915
4841
  "namespace": "design.furniture",
@@ -7676,18 +7602,6 @@
7676
7602
  "argsType": "string",
7677
7603
  "resultType": "PluginProgramDepartmentsSetTargetAreaResult"
7678
7604
  },
7679
- {
7680
- "path": "program.departments.setTargetCount",
7681
- "namespace": "program.departments",
7682
- "summary": "Set a department's target unit count.",
7683
- "examplePrompts": [
7684
- "Set the Bedrooms department unit count to 12",
7685
- "The program needs 4 clinic blocks — update the department count",
7686
- "Update the target count for department dep_123\n\n# Example\n```ts\nawait snaptrude.program.departments.setTargetCount(\"dep_123\", 12)\n```"
7687
- ],
7688
- "argsType": "string",
7689
- "resultType": "PluginProgramDepartmentsSetTargetCountResult"
7690
- },
7691
7605
  {
7692
7606
  "path": "program.departments.unassign",
7693
7607
  "namespace": "program.departments",
@@ -7714,65 +7628,6 @@
7714
7628
  "argsType": "string",
7715
7629
  "resultType": "PluginProgramDepartmentsUpdateResult"
7716
7630
  },
7717
- {
7718
- "path": "program.labels.create",
7719
- "namespace": "program.labels",
7720
- "summary": "Create labels (program rows), optionally creating their spaces too.",
7721
- "examplePrompts": [
7722
- "Add program rows for 4 exam rooms of 120 sqft each",
7723
- "Create the labels from this interpreted program",
7724
- "Add an Office label with a 2000 sqft target to the Admin department",
7725
- "Create program rows and their spaces on the canvas\n\n# Example\n```ts\nconst { labelIds } = await snaptrude.program.labels.create(\n[{ name: \"Exam Room\", targetArea: 480, targetCount: 4, departmentName: \"Clinic\" }],\n{ units: \"ft2\" },\n)\n```"
7726
- ],
7727
- "argsType": "PluginProgramLabelCreateItem[]",
7728
- "resultType": "PluginProgramLabelsCreateResult"
7729
- },
7730
- {
7731
- "path": "program.labels.get",
7732
- "namespace": "program.labels",
7733
- "summary": "Get a single label by id.",
7734
- "examplePrompts": [
7735
- "Get the label with id lbl_12",
7736
- "What is the target area of this program row?\n\n# Example\n```ts\nconst label = await snaptrude.program.labels.get(\"lbl_12\")\nif (label) console.log(label.name, label.targetArea, label.units)\n```"
7737
- ],
7738
- "argsType": "string",
7739
- "resultType": "PluginProgramLabelsGetResult"
7740
- },
7741
- {
7742
- "path": "program.labels.list",
7743
- "namespace": "program.labels",
7744
- "summary": "List the labels (program rows) of the active program.",
7745
- "examplePrompts": [
7746
- "List all the program rows with their target areas",
7747
- "What space labels are in the program and how many of each?",
7748
- "Show every label with its department and target\n\n# Example\n```ts\nconst { units, labels } = await snaptrude.program.labels.list()\nfor (const l of labels) console.log(l.name, l.targetArea, units, l.targetCount)\n```"
7749
- ],
7750
- "argsType": null,
7751
- "resultType": "PluginProgramLabelsListResult"
7752
- },
7753
- {
7754
- "path": "program.labels.setTargetArea",
7755
- "namespace": "program.labels",
7756
- "summary": "Set a label's total target area.",
7757
- "examplePrompts": [
7758
- "Set the Exam Room target area to 480 sqft",
7759
- "Give the Corridor program row a 150 sqm target",
7760
- "Update the area target for label lbl_12\n\n# Example\n```ts\nawait snaptrude.program.labels.setTargetArea(\"lbl_12\", 480, \"ft2\")\n```"
7761
- ],
7762
- "argsType": "string",
7763
- "resultType": "PluginProgramLabelsSetTargetAreaResult"
7764
- },
7765
- {
7766
- "path": "program.labels.setTargetCount",
7767
- "namespace": "program.labels",
7768
- "summary": "Set a label's target unit count (how many of this space the program calls for).",
7769
- "examplePrompts": [
7770
- "Set the Exam Room count to 6",
7771
- "The program needs 12 patient rooms — update the count\n\n# Example\n```ts\nawait snaptrude.program.labels.setTargetCount(\"lbl_12\", 6)\n```"
7772
- ],
7773
- "argsType": "string",
7774
- "resultType": "PluginProgramLabelsSetTargetCountResult"
7775
- },
7776
7631
  {
7777
7632
  "path": "program.layout.applySolution",
7778
7633
  "namespace": "program.layout",
@@ -7846,81 +7701,6 @@
7846
7701
  "argsType": null,
7847
7702
  "resultType": "PluginProgramLayoutStackResult"
7848
7703
  },
7849
- {
7850
- "path": "program.metadata.createHeader",
7851
- "namespace": "program.metadata",
7852
- "summary": "Create a metadata header (a custom column on the Program Data sheet).",
7853
- "examplePrompts": [
7854
- "Add a custom column called Occupancy to the program sheet",
7855
- "Create a metadata header named Department Code",
7856
- "Make a new program-mode column for Finish Level\n\n# Example\n```ts\nconst header = await snaptrude.program.metadata.createHeader(\"Occupancy\", {\ndescription: \"People per room\",\n})\n```"
7857
- ],
7858
- "argsType": "string",
7859
- "resultType": "PluginProgramMetadataCreateHeaderResult"
7860
- },
7861
- {
7862
- "path": "program.metadata.get",
7863
- "namespace": "program.metadata",
7864
- "summary": "Get one space's metadata values, keyed by header id.",
7865
- "examplePrompts": [
7866
- "Get the metadata on this space",
7867
- "Read the custom column values for space sp_12",
7868
- "What is this room's Occupancy metadata?\n\n# Example\n```ts\nconst record = await snaptrude.program.metadata.get(\"sp_12\")\nif (record) console.log(record.values)\n```"
7869
- ],
7870
- "argsType": "ComponentHandle",
7871
- "resultType": "PluginProgramMetadataGetResult"
7872
- },
7873
- {
7874
- "path": "program.metadata.list",
7875
- "namespace": "program.metadata",
7876
- "summary": "List metadata values for many spaces at once.",
7877
- "examplePrompts": [
7878
- "List the metadata of every space",
7879
- "Read the custom column values for all rooms",
7880
- "Get the metadata for these three spaces in one call\n\n# Example\n```ts\nconst { records } = await snaptrude.program.metadata.list()\nconst byId = Object.fromEntries(records.map((r) => [r.spaceId, r.values]))\n```"
7881
- ],
7882
- "argsType": "ComponentHandle[]",
7883
- "resultType": "PluginProgramMetadataListResult",
7884
- "performance": "One round-trip for any number of spaces — use this instead of a `get` loop."
7885
- },
7886
- {
7887
- "path": "program.metadata.listHeaders",
7888
- "namespace": "program.metadata",
7889
- "summary": "List the metadata headers (custom columns) of the Program Data sheet.",
7890
- "examplePrompts": [
7891
- "List the custom metadata columns in program mode",
7892
- "What metadata headers does the program sheet have?",
7893
- "Show every custom column with its id\n\n# Example\n```ts\nconst { headers } = await snaptrude.program.metadata.listHeaders()\nfor (const h of headers) console.log(h.headerId, h.name)\n```"
7894
- ],
7895
- "argsType": null,
7896
- "resultType": "PluginProgramMetadataListHeadersResult"
7897
- },
7898
- {
7899
- "path": "program.metadata.update",
7900
- "namespace": "program.metadata",
7901
- "summary": "Update a space's metadata values (sparse).",
7902
- "examplePrompts": [
7903
- "Set the Occupancy metadata of this space to 4",
7904
- "Store a department code on the selected rooms",
7905
- "Write custom column values onto space sp_12",
7906
- "Clear the Finish Level metadata on this space\n\n# Example\n```ts\nconst header = await snaptrude.program.metadata.createHeader(\"Occupancy\")\nawait snaptrude.program.metadata.update(\"sp_12\", { [header.headerId]: 4 })\n```"
7907
- ],
7908
- "argsType": "ComponentHandle",
7909
- "resultType": "PluginProgramMetadataUpdateResult"
7910
- },
7911
- {
7912
- "path": "program.metadata.updateMany",
7913
- "namespace": "program.metadata",
7914
- "summary": "Update metadata values on many spaces in one undoable step.",
7915
- "examplePrompts": [
7916
- "Fill the Occupancy column for all bedrooms",
7917
- "Write metadata onto every selected space at once",
7918
- "Bulk-update custom column values\n\n# Example\n```ts\nawait snaptrude.program.metadata.updateMany([\n{ spaceId: \"sp_12\", values: { [headerId]: 4 } },\n{ spaceId: \"sp_13\", values: { [headerId]: 2 } },\n])\n```"
7919
- ],
7920
- "argsType": "PluginProgramMetadataUpdateItem[]",
7921
- "resultType": "PluginProgramMetadataUpdateManyResult",
7922
- "performance": "One round-trip and one undo step for up to 1000 spaces — use this instead of an `update` loop."
7923
- },
7924
7704
  {
7925
7705
  "path": "program.metrics.get",
7926
7706
  "namespace": "program.metrics",
@@ -8159,19 +7939,6 @@
8159
7939
  "argsType": "{\n name?: string\n }",
8160
7940
  "resultType": "PluginProgramSpreadsheetBindingsRefreshResult"
8161
7941
  },
8162
- {
8163
- "path": "program.spreadsheet.createCustomSheet",
8164
- "namespace": "program.spreadsheet",
8165
- "summary": "Create a **custom program sheet** — a live view of the program grouped by a configurable hierarchy (the Program tab's \"Custom\" sheet with *Organize → Group by*).",
8166
- "examplePrompts": [
8167
- "Create a custom sheet grouped by department then sub-department",
8168
- "Make a program view grouped by storey and label",
8169
- "Build a grouped program sheet for the healthcare hierarchy",
8170
- "Add a custom sheet with a department → room type group-by\n\n# Example\n```ts\nconst { headers } = await snaptrude.program.metadata.listHeaders()\nconst subDept = headers.find((h) => h.name === \"Sub-department\")\nawait snaptrude.program.spreadsheet.createCustomSheet(\"Clinical Program\", {\ngroupBy: [\"departmentName\", subDept.headerId, \"label\"],\nproperties: [\"label\", \"count\", \"areas\", \"netAreaAchieved\"],\n})\n```"
8171
- ],
8172
- "argsType": "string",
8173
- "resultType": "PluginProgramSpreadsheetCustomSheetResult"
8174
- },
8175
7942
  {
8176
7943
  "path": "program.spreadsheet.createSheet",
8177
7944
  "namespace": "program.spreadsheet",
@@ -8237,17 +8004,6 @@
8237
8004
  "argsType": "{\n limit?: number\n }",
8238
8005
  "resultType": "PluginProgramSpreadsheetGetAuditLogResult"
8239
8006
  },
8240
- {
8241
- "path": "program.spreadsheet.getCustomSheet",
8242
- "namespace": "program.spreadsheet",
8243
- "summary": "Get a custom program sheet's configuration.",
8244
- "examplePrompts": [
8245
- "How is the Clinical Program sheet grouped?",
8246
- "Get the group-by configuration of this custom sheet\n\n# Example\n```ts\nconst cfg = await snaptrude.program.spreadsheet.getCustomSheet(\"Clinical Program\")\nif (cfg) console.log(cfg.groupBy, cfg.properties)\n```"
8247
- ],
8248
- "argsType": "string",
8249
- "resultType": "PluginProgramSpreadsheetGetCustomSheetResult"
8250
- },
8251
8007
  {
8252
8008
  "path": "program.spreadsheet.getMaterialTakeoff",
8253
8009
  "namespace": "program.spreadsheet",
@@ -8314,28 +8070,6 @@
8314
8070
  "argsType": "string",
8315
8071
  "resultType": "PluginProgramSpreadsheetHighlightCellsResult"
8316
8072
  },
8317
- {
8318
- "path": "program.spreadsheet.listCustomSheetProperties",
8319
- "namespace": "program.spreadsheet",
8320
- "summary": "List the property ids a custom program sheet can show as columns or group by.",
8321
- "examplePrompts": [
8322
- "What can I group a custom program sheet by?",
8323
- "List the columns available for a custom sheet\n\n# Example\n```ts\nconst { properties } = await snaptrude.program.spreadsheet.listCustomSheetProperties()\nconst groupable = properties.filter((p) => p.groupable).map((p) => p.id)\n```"
8324
- ],
8325
- "argsType": null,
8326
- "resultType": "PluginProgramSpreadsheetListCustomSheetPropertiesResult"
8327
- },
8328
- {
8329
- "path": "program.spreadsheet.listCustomSheets",
8330
- "namespace": "program.spreadsheet",
8331
- "summary": "List the custom program sheets in the workbook with their configurations.",
8332
- "examplePrompts": [
8333
- "List the custom program sheets",
8334
- "Which sheets are grouped program views?\n\n# Example\n```ts\nconst { sheets } = await snaptrude.program.spreadsheet.listCustomSheets()\n```"
8335
- ],
8336
- "argsType": null,
8337
- "resultType": "PluginProgramSpreadsheetListCustomSheetsResult"
8338
- },
8339
8073
  {
8340
8074
  "path": "program.spreadsheet.listSheets",
8341
8075
  "namespace": "program.spreadsheet",
@@ -8512,18 +8246,6 @@
8512
8246
  "argsType": "PluginSpreadsheetTransactionOp[]",
8513
8247
  "resultType": "PluginProgramSpreadsheetTransactionResult"
8514
8248
  },
8515
- {
8516
- "path": "program.spreadsheet.updateCustomSheet",
8517
- "namespace": "program.spreadsheet",
8518
- "summary": "Update a custom program sheet's group-by hierarchy, columns, or group colors.",
8519
- "examplePrompts": [
8520
- "Change the custom sheet to group by storey first",
8521
- "Add the Occupancy column to my grouped program sheet",
8522
- "Regroup the Clinical Program sheet by department only\n\n# Example\n```ts\nawait snaptrude.program.spreadsheet.updateCustomSheet(\"Clinical Program\", {\ngroupBy: [\"storey\", \"departmentName\"],\n})\n```"
8523
- ],
8524
- "argsType": "string",
8525
- "resultType": "PluginProgramSpreadsheetCustomSheetResult"
8526
- },
8527
8249
  {
8528
8250
  "path": "workspace.closePresentMode",
8529
8251
  "namespace": "workspace",
@@ -8536,17 +8258,6 @@
8536
8258
  "argsType": null,
8537
8259
  "resultType": "void"
8538
8260
  },
8539
- {
8540
- "path": "workspace.closeProgramMode",
8541
- "namespace": "workspace",
8542
- "summary": "Close the Program tab.",
8543
- "examplePrompts": [
8544
- "Close program mode",
8545
- "Close the Program tab\n\n# Example\n```ts\nawait snaptrude.workspace.closeProgramMode()\n```"
8546
- ],
8547
- "argsType": null,
8548
- "resultType": "void"
8549
- },
8550
8261
  {
8551
8262
  "path": "workspace.openPresentMode",
8552
8263
  "namespace": "workspace",
@@ -8559,18 +8270,6 @@
8559
8270
  "argsType": null,
8560
8271
  "resultType": "void"
8561
8272
  },
8562
- {
8563
- "path": "workspace.openProgramMode",
8564
- "namespace": "workspace",
8565
- "summary": "Open Program mode — the Program tab the `program.spreadsheet.*` calls run in.",
8566
- "examplePrompts": [
8567
- "Open program mode",
8568
- "Open the Program tab so I can build a custom sheet",
8569
- "Switch to the program spreadsheet\n\n# Example\n```ts\nawait snaptrude.workspace.openProgramMode()\nconst { sheets } = await snaptrude.program.spreadsheet.listSheets()\n```"
8570
- ],
8571
- "argsType": null,
8572
- "resultType": "void"
8573
- },
8574
8273
  {
8575
8274
  "path": "workspace.projects.copy",
8576
8275
  "namespace": "workspace.projects",