@snaptrude/plugin-core 0.9.16-networks-20261012.1 → 0.9.17

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 (88) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/api-manifest.json +9711 -0
  3. package/dist/api/analysis/daylight.d.ts +5 -5
  4. package/dist/api/analysis/solar.d.ts +2 -2
  5. package/dist/api/core/camera/index.d.ts +0 -29
  6. package/dist/api/core/camera/index.d.ts.map +1 -1
  7. package/dist/api/core/zoom/index.d.ts +0 -13
  8. package/dist/api/core/zoom/index.d.ts.map +1 -1
  9. package/dist/api/design/create/bulk-items.d.ts +21 -40
  10. package/dist/api/design/create/bulk-items.d.ts.map +1 -1
  11. package/dist/api/design/create/index.d.ts +97 -120
  12. package/dist/api/design/create/index.d.ts.map +1 -1
  13. package/dist/api/design/create/opening-fields.d.ts +12 -13
  14. package/dist/api/design/create/opening-fields.d.ts.map +1 -1
  15. package/dist/api/design/doors/index.d.ts +24 -18
  16. package/dist/api/design/doors/index.d.ts.map +1 -1
  17. package/dist/api/design/family.d.ts +27 -797
  18. package/dist/api/design/family.d.ts.map +1 -1
  19. package/dist/api/design/index.d.ts +0 -16
  20. package/dist/api/design/index.d.ts.map +1 -1
  21. package/dist/api/design/query/index.d.ts +30 -30
  22. package/dist/api/design/selection/index.d.ts +10 -10
  23. package/dist/api/design/types/index.d.ts +24 -40
  24. package/dist/api/design/types/index.d.ts.map +1 -1
  25. package/dist/api/design/update/index.d.ts +3 -40
  26. package/dist/api/design/update/index.d.ts.map +1 -1
  27. package/dist/api/design/windows/index.d.ts +8 -8
  28. package/dist/api/design/windows/index.d.ts.map +1 -1
  29. package/dist/api/presentation/aiInspiration.d.ts +10 -10
  30. package/dist/api/presentation/annotate.d.ts +22 -38
  31. package/dist/api/presentation/annotate.d.ts.map +1 -1
  32. package/dist/api/presentation/export.d.ts +5 -23
  33. package/dist/api/presentation/export.d.ts.map +1 -1
  34. package/dist/api/presentation/index.d.ts +21 -32
  35. package/dist/api/presentation/index.d.ts.map +1 -1
  36. package/dist/api/presentation/placedViews.d.ts +6 -106
  37. package/dist/api/presentation/placedViews.d.ts.map +1 -1
  38. package/dist/api/presentation/sections.d.ts +461 -0
  39. package/dist/api/presentation/sections.d.ts.map +1 -0
  40. package/dist/api/presentation/shapes.d.ts +2 -2
  41. package/dist/api/presentation/sheets.d.ts +19 -175
  42. package/dist/api/presentation/sheets.d.ts.map +1 -1
  43. package/dist/api/presentation/views.d.ts +5 -103
  44. package/dist/api/presentation/views.d.ts.map +1 -1
  45. package/dist/api/presentation/walkthroughs.d.ts +6 -6
  46. package/dist/index.cjs +2434 -3619
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.js +2421 -3501
  49. package/dist/index.js.map +1 -1
  50. package/package.json +1 -1
  51. package/scripts/generate-manifest.mjs +0 -5
  52. package/src/api/core/camera/index.ts +0 -29
  53. package/src/api/core/zoom/index.ts +0 -13
  54. package/src/api/design/create/bulk-items.ts +16 -23
  55. package/src/api/design/create/index.ts +119 -129
  56. package/src/api/design/create/opening-fields.ts +12 -15
  57. package/src/api/design/doors/index.ts +42 -58
  58. package/src/api/design/family.ts +32 -662
  59. package/src/api/design/index.ts +4 -34
  60. package/src/api/design/types/index.ts +24 -31
  61. package/src/api/design/update/index.ts +3 -41
  62. package/src/api/design/windows/index.ts +22 -40
  63. package/src/api/presentation/annotate.ts +58 -90
  64. package/src/api/presentation/export.ts +6 -32
  65. package/src/api/presentation/index.ts +23 -39
  66. package/src/api/presentation/placedViews.ts +28 -119
  67. package/src/api/presentation/sections.ts +420 -0
  68. package/src/api/presentation/sheets.ts +20 -181
  69. package/src/api/presentation/views.ts +6 -46
  70. package/dist/api/design/bim.d.ts +0 -209
  71. package/dist/api/design/bim.d.ts.map +0 -1
  72. package/dist/api/design/catalog.d.ts +0 -320
  73. package/dist/api/design/catalog.d.ts.map +0 -1
  74. package/dist/api/design/networks.d.ts +0 -1703
  75. package/dist/api/design/networks.d.ts.map +0 -1
  76. package/dist/api/presentation/drawingContract.d.ts +0 -32
  77. package/dist/api/presentation/drawingContract.d.ts.map +0 -1
  78. package/dist/api/presentation/drawings.d.ts +0 -3523
  79. package/dist/api/presentation/drawings.d.ts.map +0 -1
  80. package/dist/api/presentation/viewPresets.d.ts +0 -222
  81. package/dist/api/presentation/viewPresets.d.ts.map +0 -1
  82. package/src/api/design/bim.ts +0 -121
  83. package/src/api/design/catalog.ts +0 -203
  84. package/src/api/design/networks.ts +0 -607
  85. package/src/api/presentation/drawingContract.ts +0 -70
  86. package/src/api/presentation/drawings.ts +0 -1179
  87. package/src/api/presentation/viewPresets.ts +0 -241
  88. package/test/drawingContract.test.mjs +0 -288
@@ -1,6 +1,5 @@
1
1
  import * as z from "zod"
2
2
  import { PluginApiReturn } from "../../types"
3
- import { PluginStandardDrawingScale } from "./drawingContract"
4
3
 
5
4
  /**
6
5
  * Presentation sheets — the layout sheets a presentation is assembled on.
@@ -11,16 +10,9 @@ import { PluginStandardDrawingScale } from "./drawingContract"
11
10
  *
12
11
  * `list`/`get` are reads; the rest mutate and require Present mode to be open:
13
12
  * `create` adds a sheet, `place` drops a saved view onto a sheet as a live
14
- * linked view shape (fitted to that sheet), `placeDrawing` moves an existing
15
- * drawing onto a sheet (scaled down to fit by default), `rename` relabels a
16
- * sheet, `delete` removes one, `reorder` moves one in the sheet order,
17
- * `setActive` navigates to one, and `updatePlacedView` re-renders placed views
18
- * to the current model.
19
- *
20
- * `presentation.drawings.create` never puts a drawing on a sheet: it makes the
21
- * drawing beside its source view on the canvas. To put a view on a sheet, call
22
- * `place(sheetId, viewId)`; to move a drawing you already made, call
23
- * `placeDrawing(sheetId, drawingId)`.
13
+ * linked view shape, `rename` relabels a sheet, `delete` removes one, `reorder`
14
+ * moves one in the sheet order, `setActive` navigates to one, and
15
+ * `updatePlacedView` re-renders placed views to the current model.
24
16
  *
25
17
  * Accessed via `snaptrude.presentation.sheets`.
26
18
  */
@@ -163,75 +155,37 @@ export abstract class PluginPresentationSheetsApi {
163
155
  ): PluginApiReturn<PluginPresentationSheet>
164
156
 
165
157
  /**
166
- * Place a saved view onto a sheet. This is the call that puts a view on a
167
- * sheet (`presentation.drawings.create` makes a drawing beside its source
168
- * view, not on a sheet). When `scale` is omitted the view is fitted to the
169
- * target sheet: a 2D or site-plan view is placed at the largest
170
- * standard scale at which it fits inside the target sheet's margin, and
171
- * never at a larger scale than the normal view drop would pick; a 3D view
172
- * has no scale, so it is shrunk evenly to fit instead. This is the same fit
173
- * as `placeDrawing`. Omit `position` unless the user asked for a specific
174
- * place.
175
- * Without a `position` the drawing goes to the sheet centre when that is
176
- * free, otherwise to the nearest free spot to the centre inside the margin,
177
- * beside the drawings already there; when there is no free spot it is
178
- * centred anyway and the result has `overlaps: true`. With a `position` it
179
- * is placed as given, and the result has `overlaps: true` when it covers
180
- * another drawing, but it is not moved. In both cases only other drawings
181
- * count (placed views and their title blocks and labels): text, images and
182
- * other shapes on the sheet are ignored. Each call fits one view to the
183
- * whole sheet, so a second fitted view often has no free spot: when several
184
- * views should share a sheet, pass a `scale` small enough for all of them;
185
- * otherwise use `sheets.create` per view. When the result's `overlaps` is
186
- * true, move the drawing or put it on its own sheet.
187
- * An explicit `scale` is always kept, even when the drawing (title block
188
- * included) does not fit inside the sheet's margin at that scale; the result
189
- * then has `overflows: true`. When it is true, pass a smaller scale (larger
190
- * denominator), omit `scale` to fit, or use a larger sheet.
191
- * `scale` must be a standard architectural scale denominator (100 means 1:100)
192
- * in the project's unit system; any other value is rejected. Metric: 10, 20, 50,
193
- * 100, 150, 200, 250, 500, 1000. Imperial detail: 12, 16, 24, 32, 48, 64, 96, 128,
194
- * 192, 384, 768, 1536 (1" = 1' to 1/128" = 1'; 48 is 1/4" = 1', 96 is 1/8" = 1').
195
- * Imperial site: 120, 240, 360, 480, 600, 1200, 2400, 3600, 4800 (1" = 10' to
196
- * 1" = 400'). Pick the LARGEST standard scale (smallest denominator) at which the
197
- * view still fits its frame or sheet and its room labels stay readable: for a
198
- * building floor plan that is usually 1:50 to 1:200 (1/4" = 1' to 1/16" = 1').
199
- * Never use a site-sized scale (1:500 and up, 1/64" = 1' (768) and smaller,
200
- * 1" = 20' (240) and up) for a single building plan unless the user asked for it.
158
+ * Place a saved view onto a sheet.
201
159
  *
202
160
  * Drops the given view onto the sheet through the **native view drop** — the
203
161
  * placed shape is a live linked view (the same shape the Present views panel's
204
162
  * drag-drop creates), re-rendered from the current model, so
205
163
  * {@linkcode PluginPresentationSheetsApi.updatePlacedView} refreshes it later.
206
- * 2D and site-plan views are placed at an architectural scale: the fitted
207
- * standard scale described above by default, or the explicit `scale` when
208
- * given (one of the standard values above). 3D views have no scale; passing
209
- * `scale` for one throws. Requires Present mode to be open.
164
+ * 2D and site-plan views are placed at an architectural scale: the closest
165
+ * standard scale by default (the native auto-fit), or the explicit `scale`
166
+ * when given — one of the standard values the placed view's Scale dropdown
167
+ * offers for the project's unit system (metric `10, 20, 50, 100, 150, 200,
168
+ * 250, 500, 1000`; imperial e.g. `48` for 1/4″ = 1′, `96` for 1/8″ = 1′,
169
+ * `120` for 1″ = 10′). 3D views have no scale — passing `scale` for one
170
+ * throws. Requires Present mode to be open.
210
171
  *
211
172
  * @param sheetId - The id of the sheet to place onto.
212
173
  * @param viewId - The id of the saved view to place.
213
174
  * @param options - Optional `position` ({@linkcode PluginSheetPosition}) —
214
- * where to place it (when omitted, the sheet centre or the nearest free
215
- * spot) — and `scale` — a standard scale value for the project's unit system (2D/site-plan views only;
216
- * fitted to the target sheet when omitted).
175
+ * where to place it (sheet centre when omitted) — and `scale` — a standard
176
+ * scale value for the project's unit system (2D/site-plan views only;
177
+ * auto-fit when omitted).
217
178
  * @returns A {@linkcode PluginPresentationSheetsPlaceResult} with the created
218
- * `shapeId`, the `scale` used (`null` for a 3D view), whether the fit
219
- * `rescaled` it, whether it `overlaps` another drawing on the sheet, and
220
- * whether it `overflows` the sheet's margin at an explicit `scale`.
221
- * (Hosts older than the fit return only `shapeId`.)
179
+ * `shapeId`.
222
180
  * @throws If Present mode is not open, the sheet/view id is invalid, `scale`
223
181
  * is not a standard value for the project's unit system, or `scale` is
224
- * passed for a 3D view. `PRECONDITION_FAILED` when the view does not fit
225
- * the sheet even at the smallest standard scale, or the title block alone
226
- * is larger than the sheet's drawable area (use a larger sheet); no
227
- * drawing is left on the sheet.
182
+ * passed for a 3D view.
228
183
  *
229
184
  * @examplePrompt Place the floor plan on Sheet 1
230
185
  * @examplePrompt Add this 3D view to the cover sheet
231
186
  * @examplePrompt Drop the site plan onto the layout sheet at 100, 200
232
187
  * @examplePrompt Put the Ground Floor view on sheet_1 at 1:100 scale
233
188
  * @examplePrompt Place the plan on the cover sheet at quarter-inch scale
234
- * @examplePrompt Add a floor plan drawing of each storey to this sheet
235
189
  *
236
190
  * # Example
237
191
  * ```ts
@@ -246,72 +200,6 @@ export abstract class PluginPresentationSheetsApi {
246
200
  options?: { position?: PluginSheetPosition; scale?: number },
247
201
  ): PluginApiReturn<PluginPresentationSheetsPlaceResult>
248
202
 
249
- /**
250
- * Move an existing drawing onto a sheet without copying or regenerating it,
251
- * scaled down to fit the sheet when it is too big. `presentation.drawings.create`
252
- * leaves a drawing beside its source view, not on a sheet; this is the call
253
- * that puts it on one. To place a saved view on a sheet in one call, use
254
- * `sheets.place(sheetId, viewId)`, which fits it the same way.
255
- * By default (`fit` true or omitted) a drawing larger than the sheet's
256
- * drawable area (the sheet inside its margin) is moved to the LARGEST standard
257
- * architectural scale at which it fits; a drawing that already fits keeps its
258
- * scale, and a drawing is never scaled up. A 3D drawing has no architectural
259
- * scale, so it is shrunk uniformly to fit instead. With `fit: false` the scale
260
- * is kept and a drawing that does not fit is rejected with an error naming the
261
- * drawing, the sheet and the scale, and saying to call `placeDrawing` without
262
- * `fit: false` to fit it, or use a larger sheet. When even
263
- * the smallest standard scale does not fit, the call is rejected with an error
264
- * suggesting a larger sheet size.
265
- * Without a `position` the drawing goes to the sheet centre when that is
266
- * free, otherwise to the nearest free spot to the centre inside the margin,
267
- * beside the drawings already there; when there is no free spot it is
268
- * centred anyway and the result has `overlaps: true`. With a `position` it
269
- * is placed as given, and the result has `overlaps: true` when it covers
270
- * another drawing, but it is not moved. In both cases only other drawings
271
- * count (placed views and their title blocks and labels): text, images and
272
- * other shapes on the sheet are ignored. Each call fits one drawing to the
273
- * whole sheet, so a second fitted drawing often has no free spot: when
274
- * several drawings should share a sheet, give them scales small enough for
275
- * all of them; otherwise use `sheets.create` per drawing.
276
- * The position is sheet-local. The drawing's
277
- * stable id remains unchanged; `shapeId` therefore identifies the moved
278
- * drawing. The result reports the architectural scale the drawing has on the
279
- * sheet and whether this call changed it; a host that reports it also says
280
- * whether the drawing `overlaps` another drawing on the sheet (move it or
281
- * put it on its own sheet when true).
282
- *
283
- * @param sheetId - The id of the destination sheet.
284
- * @param drawingId - The id of an existing drawing deliverable.
285
- * @param options - Optional sheet-local `position` (when omitted, the sheet centre or the nearest free spot)
286
- * and `fit` (default `true`: scale a drawing that does not fit down to fit;
287
- * `false`: keep its scale and reject a drawing that does not fit).
288
- * @returns A {@linkcode PluginPresentationSheetsPlaceDrawingResult} with the
289
- * drawing's `shapeId`, the `scale` used (`null` for a 3D drawing),
290
- * `rescaled`, and optionally `overlaps`.
291
- * @throws `PRECONDITION_FAILED` if Present mode is closed, the sheet is locked,
292
- * the drawing does not fit with `fit: false`, or it does not fit even at the
293
- * smallest standard scale; `HANDLE_INVALID` if either id is invalid or the
294
- * shape is not a drawing.
295
- *
296
- * @examplePrompt Move this drawing onto the cover sheet
297
- * @examplePrompt Place drawing_1 at the center of sheet_2
298
- * @examplePrompt Put the level 2 plan drawing on the Level 2 Plan sheet
299
- * @examplePrompt Add the floor plan drawings to this sheet
300
- *
301
- * # Example
302
- * ```ts
303
- * const { scale, rescaled } = await snaptrude.presentation.sheets.placeDrawing(
304
- * sheet.id,
305
- * drawing.id,
306
- * )
307
- * ```
308
- */
309
- public abstract placeDrawing(
310
- sheetId: string,
311
- drawingId: string,
312
- options?: { position?: PluginSheetPosition; fit?: boolean },
313
- ): PluginApiReturn<PluginPresentationSheetsPlaceDrawingResult>
314
-
315
203
  /**
316
204
  * Rename a layout sheet.
317
205
  *
@@ -579,82 +467,33 @@ export type PluginPresentationSheetsSetMarginArgs = z.infer<
579
467
  * |---|---|---|
580
468
  * | `sheetId` | `string` | The sheet to place onto |
581
469
  * | `viewId` | `string` | The saved view to place |
582
- * | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Where to place it (when omitted, the sheet centre or the nearest free spot) |
583
- * | `scale` | `number \| undefined` | Standard scale value for the project's unit system (2D/site-plan views only; when omitted, the largest standard scale that fits inside the target sheet's margin, never larger than the normal view drop's) |
470
+ * | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Where to place it (sheet centre when omitted) |
471
+ * | `scale` | `number \| undefined` | Standard scale value for the project's unit system (2D/site-plan views only; auto-fit to the closest standard scale when omitted) |
584
472
  */
585
473
  export const PluginPresentationSheetsPlaceArgs = z.object({
586
474
  sheetId: z.string(),
587
475
  viewId: z.string(),
588
476
  position: PluginSheetPosition.optional(),
589
- scale: PluginStandardDrawingScale.optional(),
477
+ scale: z.number().positive().optional(),
590
478
  })
591
479
  export type PluginPresentationSheetsPlaceArgs = z.infer<
592
480
  typeof PluginPresentationSheetsPlaceArgs
593
481
  >
594
482
 
595
483
  /**
596
- * Arguments for {@linkcode PluginPresentationSheetsApi.placeDrawing}.
597
- *
598
- * | Property | Type | Description |
599
- * |---|---|---|
600
- * | `sheetId` | `string` | The destination sheet |
601
- * | `drawingId` | `string` | The existing drawing to move |
602
- * | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Sheet-local position (when omitted, the sheet centre or the nearest free spot) |
603
- * | `fit` | `boolean \| undefined` | `true` (default) scales a drawing that does not fit down to fit; `false` keeps its scale and rejects a drawing that does not fit |
604
- */
605
- export const PluginPresentationSheetsPlaceDrawingArgs = z.object({
606
- sheetId: z.string().min(1),
607
- drawingId: z.string().min(1),
608
- position: PluginSheetPosition.optional(),
609
- fit: z.boolean().optional(),
610
- })
611
- export type PluginPresentationSheetsPlaceDrawingArgs = z.infer<
612
- typeof PluginPresentationSheetsPlaceDrawingArgs
613
- >
614
-
615
- /**
616
- * Result of {@linkcode PluginPresentationSheetsApi.place}. The host returns
617
- * `scale` and `rescaled` (and `overlaps`, `overflows`); they are optional only
618
- * because hosts that predate the fit report `shapeId` alone.
484
+ * Result of {@linkcode PluginPresentationSheetsApi.place}.
619
485
  *
620
486
  * | Property | Type | Description |
621
487
  * |---|---|---|
622
488
  * | `shapeId` | `string` | Id of the created canvas shape |
623
- * | `scale` | `number \| null \| undefined` | Architectural scale denominator the view has on the sheet (`null` for a 3D view) |
624
- * | `rescaled` | `boolean \| undefined` | Whether the fit changed the view's size from the normal view drop's |
625
- * | `overlaps` | `boolean \| undefined` | Whether the placed drawing overlaps another drawing on the sheet (only drawings count, not text, images or other shapes) |
626
- * | `overflows` | `boolean \| undefined` | `true` when the drawing, title block included, does not fit inside the sheet's margin at the explicit `scale` passed (the scale is kept); absent otherwise |
627
489
  */
628
490
  export const PluginPresentationSheetsPlaceResult = z.object({
629
491
  shapeId: z.string(),
630
- scale: z.number().finite().nullable().optional(),
631
- rescaled: z.boolean().optional(),
632
- overlaps: z.boolean().optional(),
633
- overflows: z.boolean().optional(),
634
492
  })
635
493
  export type PluginPresentationSheetsPlaceResult = z.infer<
636
494
  typeof PluginPresentationSheetsPlaceResult
637
495
  >
638
496
 
639
- /**
640
- * Result of {@linkcode PluginPresentationSheetsApi.placeDrawing}.
641
- *
642
- * | Property | Type | Description |
643
- * |---|---|---|
644
- * | `shapeId` | `string` | Id of the moved drawing (the drawing id, unchanged) |
645
- * | `scale` | `number \| null` | Architectural scale denominator the drawing has on the sheet (`null` for a 3D drawing) |
646
- * | `rescaled` | `boolean` | Whether this call changed the drawing's size to fit the sheet |
647
- * | `overlaps` | `boolean \| undefined` | Whether the drawing overlaps another drawing on the sheet (only drawings count, not text, images or other shapes) |
648
- */
649
- export const PluginPresentationSheetsPlaceDrawingResult =
650
- PluginPresentationSheetsPlaceResult.omit({ overflows: true }).extend({
651
- scale: z.number().finite().nullable(),
652
- rescaled: z.boolean(),
653
- })
654
- export type PluginPresentationSheetsPlaceDrawingResult = z.infer<
655
- typeof PluginPresentationSheetsPlaceDrawingResult
656
- >
657
-
658
497
  /**
659
498
  * Arguments for {@linkcode PluginPresentationSheetsApi.rename}.
660
499
  *
@@ -2,7 +2,7 @@ import * as z from "zod"
2
2
  import { PluginApiReturn } from "../../types"
3
3
 
4
4
  /**
5
- * Presentation views — read the saved plan, 3D, and elevation views used to prepare presentations.
5
+ * Presentation views — read the saved 2D/3D views used to prepare presentations.
6
6
  *
7
7
  * A **view** is a saved camera/plan: a sheet-ready 2D plan or a saved 3D view.
8
8
  * A plugin can list and read views, capture them to images, activate one (move
@@ -24,10 +24,10 @@ export abstract class PluginPresentationViewsApi {
24
24
  * List the saved views in the active project.
25
25
  *
26
26
  * @returns A {@linkcode PluginPresentationViewsListResult} with a `views` array
27
- * of plan, 3D, and elevation views (empty when the project has none).
27
+ * of 2D and 3D views (empty when the project has none).
28
28
  *
29
29
  * @examplePrompt List all the saved views
30
- * @examplePrompt What plan, 3D, and elevation views are in this project?
30
+ * @examplePrompt What 2D and 3D views are in this project?
31
31
  * @examplePrompt Which view is currently active?
32
32
  * @examplePrompt Get the names of every presentation view
33
33
  * @examplePrompt Show me the 3D views I can put on a sheet
@@ -115,10 +115,6 @@ export abstract class PluginPresentationViewsApi {
115
115
  * Applies the view's camera, visibility, and storey state to the live scene.
116
116
  * Paired with {@linkcode PluginPresentationViewsApi.getActive}.
117
117
  *
118
- * While Present is open this sets the Design frame a view saved in Present
119
- * is taken from; it never moves the Present sheet canvas; use
120
- * `presentation.camera` for that.
121
- *
122
118
  * @param viewId - The id of the view to activate.
123
119
  * @returns The id of the now-active view.
124
120
  * @throws If no view has the given id.
@@ -142,15 +138,6 @@ export abstract class PluginPresentationViewsApi {
142
138
  *
143
139
  * Creates a camera bookmark (not geometry) from where the camera is now.
144
140
  *
145
- * Works while Present mode is open. Present draws its drawings on the same
146
- * 3D scene, so a view saved in Present takes its framing (camera, 2D or 3D
147
- * mode, projection, storey, building) from the Design frame instead: the one
148
- * the user had when Present opened, or one a plugin set since with
149
- * `setActive`, `updateSettings({ viewMode })`, `core.camera`, `core.zoom`,
150
- * `core.storeys.setActive`, `core.storeys.layers.setActive` or
151
- * `core.buildings.setActive`. It never moves the Present sheet canvas; use
152
- * `presentation.camera` for that.
153
- *
154
141
  * @param name - Name for the new view (a default is used when omitted).
155
142
  * @param options - Optional `kind` (what kind of view to save, default
156
143
  * `"view"`) and `storey` (save the view on a specific storey — the storey is
@@ -328,36 +315,13 @@ export abstract class PluginPresentationViewsApi {
328
315
  }
329
316
 
330
317
  /**
331
- * The rendering category of a saved view. Existing plan/3D values are preserved;
332
- * elevations are identified independently of their orthographic 3D camera.
318
+ * The kind of a saved view: a 2D plan view or a 3D view.
333
319
  */
334
- export const PluginPresentationViewType = z.enum(["2d", "3d", "elevation"])
320
+ export const PluginPresentationViewType = z.enum(["2d", "3d"])
335
321
  export type PluginPresentationViewType = z.infer<
336
322
  typeof PluginPresentationViewType
337
323
  >
338
324
 
339
- /** The native semantic kind persisted for a saved view. */
340
- export const PluginPresentationViewKind = z.enum([
341
- "plan",
342
- "sitePlan",
343
- "threeD",
344
- "elevation",
345
- ])
346
- export type PluginPresentationViewKind = z.infer<
347
- typeof PluginPresentationViewKind
348
- >
349
-
350
- /** Cardinal direction for an elevation; non-elevation views return `null`. */
351
- export const PluginPresentationElevationDirection = z.enum([
352
- "north",
353
- "east",
354
- "south",
355
- "west",
356
- ])
357
- export type PluginPresentationElevationDirection = z.infer<
358
- typeof PluginPresentationElevationDirection
359
- >
360
-
361
325
  /**
362
326
  * A saved presentation view.
363
327
  *
@@ -365,9 +329,7 @@ export type PluginPresentationElevationDirection = z.infer<
365
329
  * |---|---|---|
366
330
  * | `id` | `string` | Unique view id |
367
331
  * | `name` | `string` | Display name |
368
- * | `type` | `"2d" \| "3d" \| "elevation"` | Rendering category; elevations are distinct from ordinary 3D views |
369
- * | `kind` | {@linkcode PluginPresentationViewKind} | Native semantic view kind |
370
- * | `direction` | {@linkcode PluginPresentationElevationDirection}` \| null` | Cardinal direction for elevations; otherwise `null` |
332
+ * | `type` | `"2d" \| "3d"` | Whether this is a 2D plan view or a 3D view |
371
333
  * | `isActive` | `boolean` | Whether this view is the currently active view |
372
334
  * | `storey` | `number \| null` | The storey this view was saved on (`null` on older views saved without one) |
373
335
  */
@@ -375,8 +337,6 @@ export const PluginPresentationView = z.object({
375
337
  id: z.string(),
376
338
  name: z.string(),
377
339
  type: PluginPresentationViewType,
378
- kind: PluginPresentationViewKind,
379
- direction: PluginPresentationElevationDirection.nullable(),
380
340
  isActive: z.boolean(),
381
341
  storey: z.number().nullable(),
382
342
  })
@@ -1,209 +0,0 @@
1
- import * as z from "zod";
2
- import { ComponentHandle } from "../../handles";
3
- import type { PluginApiReturn } from "../../types";
4
- /** Read scope. Omit spaces to inspect the active proposal's sketch spaces. */
5
- export declare const PluginBimContextArgs: z.ZodObject<{
6
- spaces: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>>;
7
- }, z.core.$strict>;
8
- export type PluginBimContextArgs = z.infer<typeof PluginBimContextArgs>;
9
- /** Directed graph edge. Side A lies along world-up × curve-direction; side B is opposite.
10
- * Region IDs are snapshot identifiers, not component handles. Null means no adjacent region.
11
- */
12
- export declare const PluginBimEdge: z.ZodObject<{
13
- id: z.ZodString;
14
- startMm: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
15
- endMm: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
16
- lengthMm: z.ZodNumber;
17
- heightMm: z.ZodNumber;
18
- sideA: z.ZodNullable<z.ZodString>;
19
- sideB: z.ZodNullable<z.ZodString>;
20
- wall: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
21
- supported: z.ZodBoolean;
22
- }, z.core.$strip>;
23
- export type PluginBimEdge = z.infer<typeof PluginBimEdge>;
24
- /** Construction context is detached. Revision covers geometry, room metadata and construction state. */
25
- export declare const PluginBimContext: z.ZodObject<{
26
- revision: z.ZodString;
27
- proposalId: z.ZodString;
28
- units: z.ZodLiteral<"mm">;
29
- spaces: z.ZodArray<z.ZodObject<{
30
- component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
31
- label: z.ZodString;
32
- storey: z.ZodNumber;
33
- eligible: z.ZodBoolean;
34
- reason: z.ZodOptional<z.ZodString>;
35
- }, z.core.$strip>>;
36
- regions: z.ZodArray<z.ZodObject<{
37
- id: z.ZodString;
38
- spaces: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
39
- }, z.core.$strip>>;
40
- edges: z.ZodArray<z.ZodObject<{
41
- id: z.ZodString;
42
- startMm: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
43
- endMm: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
44
- lengthMm: z.ZodNumber;
45
- heightMm: z.ZodNumber;
46
- sideA: z.ZodNullable<z.ZodString>;
47
- sideB: z.ZodNullable<z.ZodString>;
48
- wall: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
49
- supported: z.ZodBoolean;
50
- }, z.core.$strip>>;
51
- }, z.core.$strip>;
52
- export type PluginBimContext = z.infer<typeof PluginBimContext>;
53
- /** Plan-local key selects either an existing construction or a new project-only native recipe.
54
- * Bundles use the native DSL's SU/unit-expression rules; values overrides use mm/degrees.
55
- */
56
- export declare const PluginBimConstruction: z.ZodUnion<readonly [z.ZodObject<{
57
- key: z.ZodString;
58
- reference: z.ZodUnion<readonly [z.ZodObject<{
59
- id: z.ZodString;
60
- version: z.ZodNumber;
61
- }, z.core.$strict>, z.ZodString]>;
62
- }, z.core.$strict>, z.ZodObject<{
63
- key: z.ZodString;
64
- bundle: z.ZodObject<{
65
- root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
66
- deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
67
- network: z.ZodOptional<z.ZodObject<{
68
- schemaVersion: z.ZodLiteral<1>;
69
- role: z.ZodEnum<{
70
- pipe: "pipe";
71
- duct: "duct";
72
- wire: "wire";
73
- cable: "cable";
74
- conduit: "conduit";
75
- cableDuct: "cableDuct";
76
- cableTray: "cableTray";
77
- connector: "connector";
78
- equipment: "equipment";
79
- }>;
80
- lengthParameter: z.ZodOptional<z.ZodString>;
81
- ports: z.ZodArray<z.ZodObject<{
82
- id: z.ZodString;
83
- position: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
84
- direction: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
85
- size: z.ZodString;
86
- height: z.ZodOptional<z.ZodString>;
87
- widthDirection: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
88
- systems: z.ZodArray<z.ZodString>;
89
- }, z.core.$strict>>;
90
- }, z.core.$strict>>;
91
- }, z.core.$strip>;
92
- }, z.core.$strict>]>;
93
- export type PluginBimConstruction = z.infer<typeof PluginBimConstruction>;
94
- /** Every unwalled edge in the selected scope needs exactly one assignment.
95
- * The first authored layer faces sideA unless reversed. Alignment sets the initial core-centre offset.
96
- * Later parameter edits preserve the offset and reject invalid core alignment.
97
- */
98
- export declare const PluginBimWallAssignment: z.ZodObject<{
99
- edgeId: z.ZodString;
100
- construction: z.ZodString;
101
- values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean]>>>;
102
- reversed: z.ZodBoolean;
103
- alignment: z.ZodLiteral<"coreCentre">;
104
- }, z.core.$strict>;
105
- export type PluginBimWallAssignment = z.infer<typeof PluginBimWallAssignment>;
106
- export declare const PluginBimPrepareArgs: z.ZodObject<{
107
- revision: z.ZodString;
108
- spaces: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
109
- constructions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
110
- key: z.ZodString;
111
- reference: z.ZodUnion<readonly [z.ZodObject<{
112
- id: z.ZodString;
113
- version: z.ZodNumber;
114
- }, z.core.$strict>, z.ZodString]>;
115
- }, z.core.$strict>, z.ZodObject<{
116
- key: z.ZodString;
117
- bundle: z.ZodObject<{
118
- root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
119
- deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
120
- network: z.ZodOptional<z.ZodObject<{
121
- schemaVersion: z.ZodLiteral<1>;
122
- role: z.ZodEnum<{
123
- pipe: "pipe";
124
- duct: "duct";
125
- wire: "wire";
126
- cable: "cable";
127
- conduit: "conduit";
128
- cableDuct: "cableDuct";
129
- cableTray: "cableTray";
130
- connector: "connector";
131
- equipment: "equipment";
132
- }>;
133
- lengthParameter: z.ZodOptional<z.ZodString>;
134
- ports: z.ZodArray<z.ZodObject<{
135
- id: z.ZodString;
136
- position: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
137
- direction: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
138
- size: z.ZodString;
139
- height: z.ZodOptional<z.ZodString>;
140
- widthDirection: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
141
- systems: z.ZodArray<z.ZodString>;
142
- }, z.core.$strict>>;
143
- }, z.core.$strict>>;
144
- }, z.core.$strip>;
145
- }, z.core.$strict>]>>;
146
- walls: z.ZodArray<z.ZodObject<{
147
- edgeId: z.ZodString;
148
- construction: z.ZodString;
149
- values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean]>>>;
150
- reversed: z.ZodBoolean;
151
- alignment: z.ZodLiteral<"coreCentre">;
152
- }, z.core.$strict>>;
153
- }, z.core.$strict>;
154
- export type PluginBimPrepareArgs = z.infer<typeof PluginBimPrepareArgs>;
155
- /** Expected recipe/plan failures are diagnostics. No scene or library change occurs during prepare. */
156
- export declare const PluginBimPreparation: z.ZodObject<{
157
- ok: z.ZodBoolean;
158
- preparationId: z.ZodOptional<z.ZodString>;
159
- diagnostics: z.ZodArray<z.ZodObject<{
160
- path: z.ZodString;
161
- message: z.ZodString;
162
- }, z.core.$strip>>;
163
- }, z.core.$strip>;
164
- export type PluginBimPreparation = z.infer<typeof PluginBimPreparation>;
165
- export declare const PluginBimCreateArgs: z.ZodObject<{
166
- preparationId: z.ZodString;
167
- }, z.core.$strict>;
168
- /** Source IDs identify removed sketch spaces, not live handles. Successful storeys share one undo step.
169
- * Failed storeys remain spaces. Cancellation rolls back the whole conversion. Persistence is queued
170
- * through normal model commands; this result is not a durable server-save acknowledgement.
171
- */
172
- export declare const PluginBimResult: z.ZodObject<{
173
- status: z.ZodEnum<{
174
- created: "created";
175
- cancelled: "cancelled";
176
- partial: "partial";
177
- unchanged: "unchanged";
178
- }>;
179
- convertedSpaceIds: z.ZodArray<z.ZodString>;
180
- created: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
181
- kept: z.ZodArray<z.ZodObject<{
182
- space: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
183
- reason: z.ZodString;
184
- }, z.core.$strip>>;
185
- }, z.core.$strip>;
186
- export type PluginBimResult = z.infer<typeof PluginBimResult>;
187
- /** Agent-driven Sketch-to-BIM. Uses PG2 topology; never redraws routes or publishes library families. */
188
- export declare abstract class PluginDesignBimApi {
189
- /** Read room adjacency and native conversion eligibility in the active proposal.
190
- * @param options Optional explicit spaces; filters edges but keeps adjacent room metadata.
191
- * @returns Rooms, directed boundaries in mm, eligibility and revision.
192
- * @examplePrompt Inspect the rooms on each side of these sketch wall boundaries
193
- */
194
- abstract getContext(options?: PluginBimContextArgs): PluginApiReturn<PluginBimContext>;
195
- /** Stage a complete wall-construction assignment. A new prepare replaces this plugin's prior plan.
196
- * @param plan Exact context revision, selected spaces, constructions and edge assignments.
197
- * @returns Diagnostics or an opaque preparation ID, scoped to the caller and current project.
198
- * @examplePrompt Validate wall layer assignments before converting sketch rooms to BIM
199
- */
200
- abstract prepare(plan: PluginBimPrepareArgs): PluginApiReturn<PluginBimPreparation>;
201
- /** Execute native Sketch-to-BIM. Revalidates scope, catalogue access and construction before mutation.
202
- * Uses native progress/cancel controls and worker cancellation. Floors/roofs retain project defaults.
203
- * @param preparationId ID returned by prepare. Consumed once; stale or foreign IDs throw PRECONDITION_FAILED.
204
- * @returns Created component handles and explicit converted/kept outcomes, including partial success.
205
- * @examplePrompt Convert these sketch rooms to BIM with wall layers chosen for each room boundary
206
- */
207
- abstract create(preparationId: string): PluginApiReturn<PluginBimResult>;
208
- }
209
- //# sourceMappingURL=bim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bim.d.ts","sourceRoot":"","sources":["../../../src/api/design/bim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAOlD,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB;;kBAAmD,CAAA;AACpF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;iBAUxB,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEzD,wGAAwG;AACxG,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa3B,CAAA;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAGhC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;kBAMzB,CAAA;AACX,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAKtB,CAAA;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE,uGAAuG;AACvG,eAAO,MAAM,oBAAoB;;;;;;;iBAI/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACvE,eAAO,MAAM,mBAAmB;;kBAA2C,CAAA;AAE3E;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;iBAK1B,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE7D,yGAAyG;AACzG,8BAAsB,kBAAkB;IACtC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,eAAe,CAAC,gBAAgB,CAAC;IAEtF;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,oBAAoB,GAAG,eAAe,CAAC,oBAAoB,CAAC;IAEnF;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,eAAe,CAAC,eAAe,CAAC;CACzE"}