@snaptrude/plugin-core 0.9.17 → 0.9.18-voids-20261016.1

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 (103) hide show
  1. package/api-manifest.full.json +10406 -0
  2. package/api-manifest.json +737 -54
  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 +29 -0
  6. package/dist/api/core/camera/index.d.ts.map +1 -1
  7. package/dist/api/core/geom/create/index.d.ts +7 -1
  8. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  9. package/dist/api/core/geom/update/contour.d.ts +8 -2
  10. package/dist/api/core/geom/update/contour.d.ts.map +1 -1
  11. package/dist/api/core/zoom/index.d.ts +13 -0
  12. package/dist/api/core/zoom/index.d.ts.map +1 -1
  13. package/dist/api/design/bim.d.ts +209 -0
  14. package/dist/api/design/bim.d.ts.map +1 -0
  15. package/dist/api/design/boolean/index.d.ts +2 -0
  16. package/dist/api/design/boolean/index.d.ts.map +1 -1
  17. package/dist/api/design/catalog.d.ts +320 -0
  18. package/dist/api/design/catalog.d.ts.map +1 -0
  19. package/dist/api/design/create/bulk-items.d.ts +65 -25
  20. package/dist/api/design/create/bulk-items.d.ts.map +1 -1
  21. package/dist/api/design/create/index.d.ts +272 -99
  22. package/dist/api/design/create/index.d.ts.map +1 -1
  23. package/dist/api/design/create/opening-fields.d.ts +13 -12
  24. package/dist/api/design/create/opening-fields.d.ts.map +1 -1
  25. package/dist/api/design/delete/index.d.ts +1 -0
  26. package/dist/api/design/delete/index.d.ts.map +1 -1
  27. package/dist/api/design/doors/index.d.ts +18 -24
  28. package/dist/api/design/doors/index.d.ts.map +1 -1
  29. package/dist/api/design/family.d.ts +797 -27
  30. package/dist/api/design/family.d.ts.map +1 -1
  31. package/dist/api/design/index.d.ts +16 -0
  32. package/dist/api/design/index.d.ts.map +1 -1
  33. package/dist/api/design/networks.d.ts +1703 -0
  34. package/dist/api/design/networks.d.ts.map +1 -0
  35. package/dist/api/design/query/index.d.ts +42 -32
  36. package/dist/api/design/query/index.d.ts.map +1 -1
  37. package/dist/api/design/selection/index.d.ts +10 -10
  38. package/dist/api/design/types/index.d.ts +40 -24
  39. package/dist/api/design/types/index.d.ts.map +1 -1
  40. package/dist/api/design/update/index.d.ts +43 -3
  41. package/dist/api/design/update/index.d.ts.map +1 -1
  42. package/dist/api/design/windows/index.d.ts +8 -8
  43. package/dist/api/design/windows/index.d.ts.map +1 -1
  44. package/dist/api/presentation/aiInspiration.d.ts +10 -10
  45. package/dist/api/presentation/annotate.d.ts +38 -22
  46. package/dist/api/presentation/annotate.d.ts.map +1 -1
  47. package/dist/api/presentation/drawingContract.d.ts +32 -0
  48. package/dist/api/presentation/drawingContract.d.ts.map +1 -0
  49. package/dist/api/presentation/drawings.d.ts +3523 -0
  50. package/dist/api/presentation/drawings.d.ts.map +1 -0
  51. package/dist/api/presentation/export.d.ts +23 -5
  52. package/dist/api/presentation/export.d.ts.map +1 -1
  53. package/dist/api/presentation/index.d.ts +32 -12
  54. package/dist/api/presentation/index.d.ts.map +1 -1
  55. package/dist/api/presentation/placedViews.d.ts +106 -6
  56. package/dist/api/presentation/placedViews.d.ts.map +1 -1
  57. package/dist/api/presentation/shapes.d.ts +2 -2
  58. package/dist/api/presentation/sheets.d.ts +175 -19
  59. package/dist/api/presentation/sheets.d.ts.map +1 -1
  60. package/dist/api/presentation/viewPresets.d.ts +222 -0
  61. package/dist/api/presentation/viewPresets.d.ts.map +1 -0
  62. package/dist/api/presentation/views.d.ts +103 -5
  63. package/dist/api/presentation/views.d.ts.map +1 -1
  64. package/dist/api/presentation/walkthroughs.d.ts +6 -6
  65. package/dist/errors/codes.d.ts +3 -1
  66. package/dist/errors/codes.d.ts.map +1 -1
  67. package/dist/index.cjs +3693 -2383
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.js +3573 -2383
  70. package/dist/index.js.map +1 -1
  71. package/package.json +1 -1
  72. package/scripts/generate-manifest.mjs +5 -0
  73. package/src/api/core/camera/index.ts +29 -0
  74. package/src/api/core/geom/create/index.ts +7 -1
  75. package/src/api/core/geom/update/contour.ts +8 -2
  76. package/src/api/core/zoom/index.ts +13 -0
  77. package/src/api/design/bim.ts +121 -0
  78. package/src/api/design/boolean/index.ts +2 -0
  79. package/src/api/design/catalog.ts +203 -0
  80. package/src/api/design/create/bulk-items.ts +57 -17
  81. package/src/api/design/create/index.ts +288 -120
  82. package/src/api/design/create/opening-fields.ts +15 -12
  83. package/src/api/design/delete/index.ts +1 -0
  84. package/src/api/design/doors/index.ts +58 -42
  85. package/src/api/design/family.ts +662 -32
  86. package/src/api/design/index.ts +34 -4
  87. package/src/api/design/networks.ts +607 -0
  88. package/src/api/design/query/index.ts +12 -2
  89. package/src/api/design/types/index.ts +31 -24
  90. package/src/api/design/update/index.ts +44 -3
  91. package/src/api/design/windows/index.ts +40 -22
  92. package/src/api/presentation/annotate.ts +90 -58
  93. package/src/api/presentation/drawingContract.ts +70 -0
  94. package/src/api/presentation/drawings.ts +1179 -0
  95. package/src/api/presentation/export.ts +32 -6
  96. package/src/api/presentation/index.ts +39 -14
  97. package/src/api/presentation/placedViews.ts +119 -28
  98. package/src/api/presentation/sheets.ts +181 -20
  99. package/src/api/presentation/viewPresets.ts +241 -0
  100. package/src/api/presentation/views.ts +46 -6
  101. package/src/errors/codes.ts +7 -0
  102. package/test/drawingContract.test.mjs +288 -0
  103. package/test/errors.test.mjs +1 -0
@@ -6,27 +6,30 @@ import { ComponentHandle, Vec3Handle } from "../../../handles"
6
6
  * {@linkcode PluginDesignCreateOpeningOptions} and by the bulk item schemas in
7
7
  * `bulk-items.ts`, so singular and plural openings validate identically.
8
8
  *
9
- * `facing` and `hinge` are WORLD POINTS, not directions: `facing` sits on the
10
- * side of the wall the leaf swings open to (where the plan symbol draws the
11
- * swing arc); `hinge` sits near the jamb the leaf is hinged on — the item is
12
- * reflected along the wall so its hinged jamb is the one nearer that point.
13
- * Either may be omitted (engine-chosen side / the catalog item's authored
14
- * hinge side). Neither has a visible effect on symmetric items such as
15
- * sliders or fixed windows.
9
+ * PC-only placement. The family recipe owns dimensions and geometry. Overrides
10
+ * are applied before fit checks and cutting, never by scaling generated meshes.
11
+ * `facing` selects the host frame's +Z side. `hinge` selects the declared
12
+ * `hand` parameter (left/right); families without that control reject it.
16
13
  *
17
14
  * | Property | Type | Description |
18
15
  * |---|---|---|
19
- * | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
16
+ * | `familyId` | `string` | Hosted parametric definition ID, not a mesh catalog ID |
17
+ * | `version` | `number`? | Exact family version; newest known by default |
18
+ * | `values` | `Record<string, number \| string>`? | Authored instance parameters; numeric lengths use Snaptrude units |
20
19
  * | `hostWall` | {@linkcode ComponentHandle} | The wall to host the opening |
21
20
  * | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
22
21
  * | `facing` | {@linkcode Vec3Handle}? | World point on the side of the wall the opening swings open to (default engine-chosen) |
23
- * | `hinge` | {@linkcode Vec3Handle}? | World point near the jamb the opening is hinged on (default the catalog item's authored side) |
22
+ * | `hinge` | {@linkcode Vec3Handle}? | World point near the hinged jamb; requires the recipe's hand parameter |
24
23
  * | `label` | `string`? | Instance name (optional) |
25
- * | `width` | `number`? | Width override (Snaptrude units, > 0; default the catalog item's) |
26
- * | `height` | `number`? | Height override (Snaptrude units, > 0; default the catalog item's) |
24
+ * | `width` | `number`? | Sets the declared width parameter, not the opening's evaluated envelope |
25
+ * | `height` | `number`? | Sets the declared height parameter |
27
26
  */
28
27
  export const PluginOpeningBaseOptions = {
29
- catalogId: z.string().min(1),
28
+ familyId: z.string().min(1),
29
+ version: z.number().int().positive().optional(),
30
+ values: z
31
+ .record(z.string(), z.union([z.number().finite(), z.string()]))
32
+ .optional(),
30
33
  hostWall: ComponentHandle,
31
34
  position: Vec3Handle,
32
35
  facing: Vec3Handle.optional(),
@@ -55,6 +55,7 @@ export abstract class PluginDesignDeleteApi {
55
55
  * @examplePrompt Get rid of this mass entirely
56
56
  * @examplePrompt Delete all the furniture I picked
57
57
  * @examplePrompt Remove the door and window I just created
58
+ * @examplePrompt Remove the void I cut in this slab
58
59
  *
59
60
  * @performance Array delete — pass every target in one call (one host round-trip). There is
60
61
  * no per-item delete; collect the whole set and never loop this per entity.
@@ -8,18 +8,15 @@ import { PluginDesignChangeResult } from "../lock"
8
8
  * `design.create.door`; generic reads (`listDoors`/`getHost`/`getProperties`) live at
9
9
  * `design.query.*`. Door targets are {@linkcode ComponentHandle}s.
10
10
  *
11
- * `getSwingDirection` is a DERIVED read (no persisted field) — computed from the placed
12
- * mesh's orientation: stand on the side the door swings open to, facing it; `'left'`
13
- * when the hinged jamb is on your left. `mirror` reflects the door about one of its own
14
- * axes (undoable, one command): `'x'` flips the swing side, `'z'` swaps the hinged jamb;
15
- * `setType` is intentionally absent (the engine has no in-place re-type —
16
- * it would require delete+recreate).
11
+ * PC-only: dimensions read the evaluated opening. Setters write declared width/height
12
+ * parameters, never mesh scale. Missing or derived controls reject. Linked copies follow
13
+ * the shared edit. Use design.family.setParameters for other parameters.
14
+ * getSwingDirection reads hand. mirror changes declared swing or hand controls.
17
15
  *
18
16
  * The **catalog** reads (`listCatalogGroups`/`listCatalog`/`getCatalogItem`/`exists`)
19
- * browse the placeable door library — plain value records keyed by a library id
20
- * (team `_id` or general `fullName`), NOT handles — and feed `design.create.door`.
21
- * They are network-backed but carry no `Async` suffix (§6.6) and never throw
22
- * (`[]`/`null`). The {@linkcode PluginObjectCatalogGroup} / {@linkcode PluginObjectCatalogItem}
17
+ * browse saved hosted door families, keyed by definition ID, and feed design.create.door.
18
+ * They reject if saved definitions cannot be loaded completely. A missing item returns null.
19
+ * The {@linkcode PluginObjectCatalogGroup} / {@linkcode PluginObjectCatalogItem}
23
20
  * DTOs are shared with `design.windows`.
24
21
  */
25
22
  export abstract class PluginDesignDoorsApi {
@@ -65,7 +62,9 @@ export abstract class PluginDesignDoorsApi {
65
62
  * if (family) console.log("family:", family)
66
63
  * ```
67
64
  */
68
- public abstract getFamily(door: ComponentHandle): PluginApiReturn<string | null>
65
+ public abstract getFamily(
66
+ door: ComponentHandle,
67
+ ): PluginApiReturn<string | null>
69
68
 
70
69
  /**
71
70
  * Get the width of a door — how wide its opening is along the host wall.
@@ -85,7 +84,9 @@ export abstract class PluginDesignDoorsApi {
85
84
  * if (width !== null) console.log("door width:", width)
86
85
  * ```
87
86
  */
88
- public abstract getWidth(door: ComponentHandle): PluginApiReturn<number | null>
87
+ public abstract getWidth(
88
+ door: ComponentHandle,
89
+ ): PluginApiReturn<number | null>
89
90
 
90
91
  /**
91
92
  * Get the height of a door — how tall its opening is from base to head.
@@ -105,12 +106,13 @@ export abstract class PluginDesignDoorsApi {
105
106
  * if (height !== null) console.log("door height:", height)
106
107
  * ```
107
108
  */
108
- public abstract getHeight(door: ComponentHandle): PluginApiReturn<number | null>
109
+ public abstract getHeight(
110
+ door: ComponentHandle,
111
+ ): PluginApiReturn<number | null>
109
112
 
110
113
  /**
111
- * Get a door's full dimensions in one call — width along the wall, vertical
112
- * height, and thickness through the wall — measured in the door's local
113
- * oriented space. Parity with {@linkcode PluginDesignWindowsApi.getDimensions}.
114
+ * Get evaluated opening width/height and host thickness, in Snaptrude units.
115
+ * The opening can include allowances beyond the width/height input parameters.
114
116
  *
115
117
  * @param door The door to query
116
118
  * @returns The dimensions, or `null`
@@ -128,12 +130,12 @@ export abstract class PluginDesignDoorsApi {
128
130
  * ```
129
131
  */
130
132
  public abstract getDimensions(
131
- door: ComponentHandle
133
+ door: ComponentHandle,
132
134
  ): PluginApiReturn<PluginDoorDimensions | null>
133
135
 
134
136
  /**
135
- * Get the floor a door is hosted on — the storey/level component that
136
- * supports the door.
137
+ * Returns null for recipe doors. Room floors own doorway infill; there is
138
+ * no separate support-floor entity.
137
139
  *
138
140
  * @param door The door to query
139
141
  * @returns The support floor {@linkcode ComponentHandle}, or `null`
@@ -153,14 +155,13 @@ export abstract class PluginDesignDoorsApi {
153
155
  * }
154
156
  * ```
155
157
  */
156
- public abstract getSupportFloor(door: ComponentHandle): PluginApiReturn<ComponentHandle | null>
158
+ public abstract getSupportFloor(
159
+ door: ComponentHandle,
160
+ ): PluginApiReturn<ComponentHandle | null>
157
161
 
158
162
  /**
159
- * Get a door's swing (hinge) handedness. Stand on the side the door swings
160
- * open to, facing the door: `'left'` when the hinged jamb is on your left,
161
- * `'right'` when it is on your right. Derived from the placed mesh's
162
- * orientation (the same reflection `mirror` and the `hinge` placement option
163
- * apply), not a persisted field.
163
+ * Read the saved hand parameter. left means local -X; right means local +X.
164
+ * Returns null when the recipe does not declare that control.
164
165
  *
165
166
  * @param door The door to query
166
167
  * @returns `'left'` / `'right'`, or `null` if indeterminate
@@ -178,14 +179,15 @@ export abstract class PluginDesignDoorsApi {
178
179
  * ```
179
180
  */
180
181
  public abstract getSwingDirection(
181
- door: ComponentHandle
182
+ door: ComponentHandle,
182
183
  ): PluginApiReturn<"left" | "right" | null>
183
184
 
184
185
  /**
185
- * Mirror a door about its own axes. `'x'` (default) flips the swing side —
186
- * the door opens to the other side of the wall; `'z'` swaps the hinged jamb
187
- * (left-hand ↔ right-hand, same swing side); `'y'` turns it upside down.
188
- * Undoable as a single command.
186
+ * Change authored controls in one undo step: x (default) toggles swing
187
+ * front/back; z toggles hand left/right. The recipe must declare these enums.
188
+ * Axis y rejects. No mesh reflection occurs. Recipes use outputs.swingSide
189
+ * (1 or -1) for the adjoining room's floor ownership. A door between two
190
+ * room floors requires this output; a missing or invalid report rejects the cut.
189
191
  *
190
192
  * @param door The door to mirror
191
193
  * @param axis Reflection axis (optional; default `'x'` — the swing-flip axis; `'z'` — the hinge-jamb axis)
@@ -208,7 +210,7 @@ export abstract class PluginDesignDoorsApi {
208
210
  */
209
211
  public abstract mirror(
210
212
  door: ComponentHandle,
211
- axis?: PluginMirrorAxis
213
+ axis?: PluginMirrorAxis,
212
214
  ): PluginApiReturn<PluginDesignChangeResult>
213
215
 
214
216
  /**
@@ -235,7 +237,7 @@ export abstract class PluginDesignDoorsApi {
235
237
  */
236
238
  public abstract setWidth(
237
239
  doors: ComponentHandle[],
238
- width: number
240
+ width: number,
239
241
  ): PluginApiReturn<PluginDesignChangeResult>
240
242
 
241
243
  /**
@@ -260,7 +262,7 @@ export abstract class PluginDesignDoorsApi {
260
262
  */
261
263
  public abstract setHeight(
262
264
  doors: ComponentHandle[],
263
- height: number
265
+ height: number,
264
266
  ): PluginApiReturn<PluginDesignChangeResult>
265
267
 
266
268
  /**
@@ -280,7 +282,9 @@ export abstract class PluginDesignDoorsApi {
280
282
  * for (const g of groups) console.log(g.dbType, g.label, g.source)
281
283
  * ```
282
284
  */
283
- public abstract listCatalogGroups(): PluginApiReturn<PluginObjectCatalogGroup[]>
285
+ public abstract listCatalogGroups(): PluginApiReturn<
286
+ PluginObjectCatalogGroup[]
287
+ >
284
288
 
285
289
  /**
286
290
  * List the placeable door catalog (team + general libraries), optionally
@@ -302,7 +306,7 @@ export abstract class PluginDesignDoorsApi {
302
306
  * ```
303
307
  */
304
308
  public abstract listCatalog(
305
- group?: string
309
+ group?: string,
306
310
  ): PluginApiReturn<PluginObjectCatalogItem[]>
307
311
 
308
312
  /**
@@ -324,7 +328,7 @@ export abstract class PluginDesignDoorsApi {
324
328
  * ```
325
329
  */
326
330
  public abstract getCatalogItem(
327
- id: string
331
+ id: string,
328
332
  ): PluginApiReturn<PluginObjectCatalogItem | null>
329
333
 
330
334
  /**
@@ -392,7 +396,9 @@ export const PluginDesignDoorMirrorArgs = z.object({
392
396
  door: ComponentHandle,
393
397
  axis: PluginMirrorAxis.optional(),
394
398
  })
395
- export type PluginDesignDoorMirrorArgs = z.infer<typeof PluginDesignDoorMirrorArgs>
399
+ export type PluginDesignDoorMirrorArgs = z.infer<
400
+ typeof PluginDesignDoorMirrorArgs
401
+ >
396
402
 
397
403
  /**
398
404
  * Arguments for {@linkcode PluginDesignDoorsApi.setWidth}.
@@ -406,7 +412,9 @@ export const PluginDesignDoorSetWidthArgs = z.object({
406
412
  doors: z.array(ComponentHandle),
407
413
  width: z.number(),
408
414
  })
409
- export type PluginDesignDoorSetWidthArgs = z.infer<typeof PluginDesignDoorSetWidthArgs>
415
+ export type PluginDesignDoorSetWidthArgs = z.infer<
416
+ typeof PluginDesignDoorSetWidthArgs
417
+ >
410
418
 
411
419
  /**
412
420
  * Arguments for {@linkcode PluginDesignDoorsApi.setHeight}.
@@ -420,7 +428,9 @@ export const PluginDesignDoorSetHeightArgs = z.object({
420
428
  doors: z.array(ComponentHandle),
421
429
  height: z.number(),
422
430
  })
423
- export type PluginDesignDoorSetHeightArgs = z.infer<typeof PluginDesignDoorSetHeightArgs>
431
+ export type PluginDesignDoorSetHeightArgs = z.infer<
432
+ typeof PluginDesignDoorSetHeightArgs
433
+ >
424
434
 
425
435
  // ---------------------------------------------------------------------------
426
436
  // catalog (shared by doors + windows)
@@ -482,7 +492,9 @@ export type PluginObjectCatalogItem = z.infer<typeof PluginObjectCatalogItem>
482
492
  export const PluginDesignDoorListCatalogArgs = z.object({
483
493
  group: z.string().optional(),
484
494
  })
485
- export type PluginDesignDoorListCatalogArgs = z.infer<typeof PluginDesignDoorListCatalogArgs>
495
+ export type PluginDesignDoorListCatalogArgs = z.infer<
496
+ typeof PluginDesignDoorListCatalogArgs
497
+ >
486
498
 
487
499
  /**
488
500
  * Arguments for {@linkcode PluginDesignDoorsApi.getCatalogItem} / {@linkcode PluginDesignDoorsApi.exists}.
@@ -494,7 +506,11 @@ export type PluginDesignDoorListCatalogArgs = z.infer<typeof PluginDesignDoorLis
494
506
  export const PluginDesignDoorGetCatalogItemArgs = z.object({
495
507
  id: z.string(),
496
508
  })
497
- export type PluginDesignDoorGetCatalogItemArgs = z.infer<typeof PluginDesignDoorGetCatalogItemArgs>
509
+ export type PluginDesignDoorGetCatalogItemArgs = z.infer<
510
+ typeof PluginDesignDoorGetCatalogItemArgs
511
+ >
498
512
 
499
513
  export const PluginDesignDoorExistsArgs = PluginDesignDoorGetCatalogItemArgs
500
- export type PluginDesignDoorExistsArgs = z.infer<typeof PluginDesignDoorExistsArgs>
514
+ export type PluginDesignDoorExistsArgs = z.infer<
515
+ typeof PluginDesignDoorExistsArgs
516
+ >