@snaptrude/plugin-core 0.6.0 → 0.7.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 (89) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/api-manifest.json +206 -704
  3. package/dist/api/core/index.d.ts +5 -0
  4. package/dist/api/core/index.d.ts.map +1 -1
  5. package/dist/api/core/proposals/index.d.ts +475 -0
  6. package/dist/api/core/proposals/index.d.ts.map +1 -0
  7. package/dist/api/design/create/index.d.ts +209 -0
  8. package/dist/api/design/create/index.d.ts.map +1 -1
  9. package/dist/api/design/doors/index.d.ts +159 -0
  10. package/dist/api/design/doors/index.d.ts.map +1 -1
  11. package/dist/api/design/furniture/index.d.ts +34 -5
  12. package/dist/api/design/furniture/index.d.ts.map +1 -1
  13. package/dist/api/design/index.d.ts +83 -0
  14. package/dist/api/design/index.d.ts.map +1 -1
  15. package/dist/api/design/lock.d.ts +26 -0
  16. package/dist/api/design/lock.d.ts.map +1 -1
  17. package/dist/api/design/materials/index.d.ts +159 -2
  18. package/dist/api/design/materials/index.d.ts.map +1 -1
  19. package/dist/api/design/query/index.d.ts +115 -5
  20. package/dist/api/design/query/index.d.ts.map +1 -1
  21. package/dist/api/design/selection/index.d.ts +2 -2
  22. package/dist/api/design/transform/index.d.ts +83 -2
  23. package/dist/api/design/transform/index.d.ts.map +1 -1
  24. package/dist/api/design/update/index.d.ts +168 -0
  25. package/dist/api/design/update/index.d.ts.map +1 -1
  26. package/dist/api/design/windows/index.d.ts +113 -2
  27. package/dist/api/design/windows/index.d.ts.map +1 -1
  28. package/dist/api/entity/story.d.ts +101 -7
  29. package/dist/api/entity/story.d.ts.map +1 -1
  30. package/dist/api/presentation/aiInspiration.d.ts +1967 -7
  31. package/dist/api/presentation/aiInspiration.d.ts.map +1 -1
  32. package/dist/api/presentation/import.d.ts +49 -4
  33. package/dist/api/presentation/import.d.ts.map +1 -1
  34. package/dist/api/presentation/index.d.ts +2 -3
  35. package/dist/api/presentation/index.d.ts.map +1 -1
  36. package/dist/api/presentation/views.d.ts +210 -5
  37. package/dist/api/presentation/views.d.ts.map +1 -1
  38. package/dist/api/program/areas.d.ts +42 -12
  39. package/dist/api/program/areas.d.ts.map +1 -1
  40. package/dist/api/program/index.d.ts +3 -11
  41. package/dist/api/program/index.d.ts.map +1 -1
  42. package/dist/api/program/layout.d.ts +186 -11
  43. package/dist/api/program/layout.d.ts.map +1 -1
  44. package/dist/errors/codes.d.ts +34 -0
  45. package/dist/errors/codes.d.ts.map +1 -0
  46. package/dist/errors/envelope.d.ts +56 -0
  47. package/dist/errors/envelope.d.ts.map +1 -0
  48. package/dist/errors/index.d.ts +6 -0
  49. package/dist/errors/index.d.ts.map +1 -0
  50. package/dist/errors/plugin-error.d.ts +69 -0
  51. package/dist/errors/plugin-error.d.ts.map +1 -0
  52. package/dist/host-utils.d.ts +4 -0
  53. package/dist/host-utils.d.ts.map +1 -1
  54. package/dist/index.cjs +1993 -1033
  55. package/dist/index.cjs.map +1 -1
  56. package/dist/index.d.ts +1 -0
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +1874 -1030
  59. package/dist/index.js.map +1 -1
  60. package/package.json +2 -1
  61. package/scripts/generate-manifest.test.mjs +77 -0
  62. package/src/api/core/index.ts +5 -0
  63. package/src/api/core/proposals/index.ts +509 -0
  64. package/src/api/design/create/index.ts +249 -0
  65. package/src/api/design/doors/index.ts +168 -0
  66. package/src/api/design/furniture/index.ts +36 -5
  67. package/src/api/design/index.ts +87 -0
  68. package/src/api/design/lock.ts +27 -0
  69. package/src/api/design/materials/index.ts +182 -2
  70. package/src/api/design/query/index.ts +81 -0
  71. package/src/api/design/transform/index.ts +74 -2
  72. package/src/api/design/update/index.ts +167 -0
  73. package/src/api/design/windows/index.ts +128 -2
  74. package/src/api/entity/story.ts +105 -7
  75. package/src/api/presentation/aiInspiration.ts +761 -7
  76. package/src/api/presentation/import.ts +45 -4
  77. package/src/api/presentation/index.ts +2 -3
  78. package/src/api/presentation/views.ts +221 -5
  79. package/src/api/program/areas.ts +34 -12
  80. package/src/api/program/index.ts +3 -11
  81. package/src/api/program/layout.ts +195 -11
  82. package/src/errors/codes.ts +136 -0
  83. package/src/errors/envelope.ts +75 -0
  84. package/src/errors/index.ts +21 -0
  85. package/src/errors/plugin-error.ts +134 -0
  86. package/src/host-utils.ts +4 -0
  87. package/src/index.ts +1 -0
  88. package/test/errors.test.mjs +184 -0
  89. package/api-manifest.full.json +0 -5600
@@ -14,6 +14,13 @@ import { PluginSpaceType, PluginMassType, PluginDepartmentId } from "../../entit
14
14
  * Footprint objects take a {@linkcode ContourHandle} (outer profile + holes);
15
15
  * build one with `snaptrude.core.geom.create.contourFromProfile(s)`.
16
16
  *
17
+ * `door`/`window` place a catalog item into a host wall (the world point is
18
+ * projected onto the wall face to locate the opening; the wall is re-cut in one
19
+ * undo entry) and throw if the point projects outside the wall. `smartLayout` is
20
+ * the one creator returning a grouped {@linkcode PluginSmartLayoutResult} rather
21
+ * than a handle — it clones an in-scene template into one or more target spaces,
22
+ * merging every target into a single undo batch (see its JSDoc).
23
+ *
17
24
  * Accessed via `snaptrude.design.create`.
18
25
  */
19
26
  export declare abstract class PluginDesignCreateApi {
@@ -354,6 +361,131 @@ export declare abstract class PluginDesignCreateApi {
354
361
  label?: string;
355
362
  createNewSourceMesh?: boolean;
356
363
  }): PluginApiReturn<ComponentHandle>;
364
+ /**
365
+ * Place a **door** from the catalog into a host wall.
366
+ *
367
+ * Identified by a **catalog (library) id** — the team object's stable `_id`
368
+ * or the general library's `fullName`. Discover ids with
369
+ * {@linkcode PluginDesignDoorsApi.listCatalog}. The world `position` is
370
+ * projected onto the host wall's face to locate the opening; the wall is
371
+ * re-cut and the door hosted in a single undo entry. Placement is
372
+ * asynchronous (the source mesh is fetched if not cached).
373
+ *
374
+ * @param catalogId - Library id: team `_id` or general `fullName`
375
+ * @param hostWall - The wall to host the door
376
+ * @param position - World point projected onto the wall to locate the opening
377
+ * @param options - Optional placement options: `label` — instance name
378
+ * @returns the {@linkcode ComponentHandle} of the placed door
379
+ * @throws if the catalog id is unknown, the host is not a wall, the source
380
+ * mesh fails to load, or the projected point falls **outside** the host wall
381
+ *
382
+ * @examplePrompt Add a door to this wall here
383
+ * @examplePrompt Place a sliding door on the selected wall
384
+ * @examplePrompt Put a door from the catalog at this point on the wall
385
+ * @examplePrompt Insert the entrance door into this wall
386
+ * @examplePrompt Add a door to the wall and call it Entry-01
387
+ *
388
+ * # Example
389
+ * ```ts
390
+ * const [wall] = await snaptrude.design.query.listWalls({ isSelected: true })
391
+ * const [entry] = await snaptrude.design.doors.listCatalog()
392
+ * const door = await snaptrude.design.create.door(
393
+ * entry.id,
394
+ * wall,
395
+ * await snaptrude.core.math.vec3.new(3, 0, 5),
396
+ * { label: "Entry-01" },
397
+ * )
398
+ * ```
399
+ */
400
+ abstract door(catalogId: string, hostWall: ComponentHandle, position: Vec3Handle, options?: {
401
+ label?: string;
402
+ }): PluginApiReturn<ComponentHandle>;
403
+ /**
404
+ * Place a **window** from the catalog into a host wall.
405
+ *
406
+ * Identified by a **catalog (library) id** — the team object's stable `_id`
407
+ * or the general library's `fullName`. Discover ids with
408
+ * {@linkcode PluginDesignWindowsApi.listCatalog}. The world `position` is
409
+ * projected onto the host wall's face to locate the opening; the wall is
410
+ * re-cut and the window hosted in a single undo entry. Placement is
411
+ * asynchronous (the source mesh is fetched if not cached).
412
+ *
413
+ * @param catalogId - Library id: team `_id` or general `fullName`
414
+ * @param hostWall - The wall to host the window
415
+ * @param position - World point projected onto the wall to locate the opening
416
+ * @param options - Optional placement options: `label` — instance name
417
+ * @returns the {@linkcode ComponentHandle} of the placed window
418
+ * @throws if the catalog id is unknown, the host is not a wall, the source
419
+ * mesh fails to load, or the projected point falls **outside** the host wall
420
+ *
421
+ * @examplePrompt Add a window to this wall here
422
+ * @examplePrompt Place a casement window on the selected wall
423
+ * @examplePrompt Put a window from the catalog at this point on the wall
424
+ * @examplePrompt Insert a window into the living room wall
425
+ * @examplePrompt Add a window to the wall and name it Win-01
426
+ *
427
+ * # Example
428
+ * ```ts
429
+ * const [wall] = await snaptrude.design.query.listWalls({ isSelected: true })
430
+ * const [entry] = await snaptrude.design.windows.listCatalog()
431
+ * const window = await snaptrude.design.create.window(
432
+ * entry.id,
433
+ * wall,
434
+ * await snaptrude.core.math.vec3.new(3, 0, 5),
435
+ * { label: "Win-01" },
436
+ * )
437
+ * ```
438
+ */
439
+ abstract window(catalogId: string, hostWall: ComponentHandle, position: Vec3Handle, options?: {
440
+ label?: string;
441
+ }): PluginApiReturn<ComponentHandle>;
442
+ /**
443
+ * Place a **smart layout** — clone an in-scene template cluster (walls,
444
+ * furniture, doors, windows, floors) into one or more target ROOM/DEPARTMENT
445
+ * spaces, adapting orientation and fit to each target.
446
+ *
447
+ * Supply the template as **exactly one** of `templateGroup` (a group **id**
448
+ * from `snaptrude.core.groups.list` — groups are string-id entities, not
449
+ * component handles) or
450
+ * `templateComponents` (an explicit component set); every target in `targets`
451
+ * (≥1) receives its own placement. By default the target spaces are hidden
452
+ * after placement (`hideTargets`, mirroring the product) — pass `false` to keep
453
+ * them visible.
454
+ *
455
+ * The whole operation — every wall/opening/furniture/floor across every target,
456
+ * plus the target-hide — is committed as a **single undo step**. Because all
457
+ * targets merge into one creation batch, the created entities are returned
458
+ * **flat, grouped by kind** ({@linkcode PluginSmartLayoutResult}), NOT attributed
459
+ * per target (per-target attribution would break the single-undo guarantee).
460
+ * `skippedWalls` is the interior-optimizer's best-candidate count of walls it
461
+ * could not place. Synchronous and heavy — many targets can jank the main thread.
462
+ *
463
+ * @param options - {@linkcode PluginSmartLayoutArgs}: template source, targets, and `hideTargets`
464
+ * @returns a {@linkcode PluginSmartLayoutResult} — created entities grouped by kind + `skippedWalls`
465
+ * @throws if smart layout is not enabled, the template group is invalid, there
466
+ * is no template / no targets / no valid mappings, or component creation fails
467
+ *
468
+ * @examplePrompt Copy this room's layout into the selected rooms
469
+ * @examplePrompt Apply this furniture arrangement to the other offices
470
+ * @examplePrompt Replicate this template into these two spaces
471
+ * @examplePrompt Place this desk cluster into every meeting room
472
+ * @examplePrompt Use this room as a template for the rooms I selected but keep them visible
473
+ *
474
+ * # Example
475
+ * ```ts
476
+ * const [templateRoom, ...targets] = await snaptrude.design.query.listSpaces({ isSelected: true })
477
+ * const result = await snaptrude.design.create.smartLayout({
478
+ * templateComponents: [templateRoom],
479
+ * targets,
480
+ * })
481
+ * console.log("placed walls:", result.created.walls.length, "skipped:", result.skippedWalls)
482
+ *
483
+ * // …or clone a saved group by its id (from core.groups.list)
484
+ * const { groups } = await snaptrude.core.groups.list()
485
+ * await snaptrude.design.create.smartLayout({ templateGroup: groups[0].id, targets })
486
+ * ```
487
+ */
488
+ abstract smartLayout(options: PluginSmartLayoutArgs): PluginApiReturn<PluginSmartLayoutResult>;
357
489
  /**
358
490
  * **Copy** existing entities, offsetting each copy by `displacement * i` (i = 1…count),
359
491
  * source positions preserved. Migrated from the removed `tools.copy`. In `"instance"`
@@ -725,6 +857,83 @@ export declare const PluginDesignCreateFurnitureArgs: z.ZodObject<{
725
857
  createNewSourceMesh: z.ZodOptional<z.ZodBoolean>;
726
858
  }, z.core.$strip>;
727
859
  export type PluginDesignCreateFurnitureArgs = z.infer<typeof PluginDesignCreateFurnitureArgs>;
860
+ /**
861
+ * Arguments for {@linkcode PluginDesignCreateApi.door}.
862
+ *
863
+ * | Property | Type | Description |
864
+ * |---|---|---|
865
+ * | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
866
+ * | `hostWall` | {@linkcode ComponentHandle} | The wall to host the door |
867
+ * | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
868
+ * | `label` | `string`? | Instance name (optional) |
869
+ */
870
+ export declare const PluginDesignCreateDoorArgs: z.ZodObject<{
871
+ catalogId: z.ZodString;
872
+ hostWall: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
873
+ position: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
874
+ label: z.ZodOptional<z.ZodString>;
875
+ }, z.core.$strip>;
876
+ export type PluginDesignCreateDoorArgs = z.infer<typeof PluginDesignCreateDoorArgs>;
877
+ /**
878
+ * Arguments for {@linkcode PluginDesignCreateApi.window}.
879
+ *
880
+ * | Property | Type | Description |
881
+ * |---|---|---|
882
+ * | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
883
+ * | `hostWall` | {@linkcode ComponentHandle} | The wall to host the window |
884
+ * | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
885
+ * | `label` | `string`? | Instance name (optional) |
886
+ */
887
+ export declare const PluginDesignCreateWindowArgs: z.ZodObject<{
888
+ catalogId: z.ZodString;
889
+ hostWall: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
890
+ position: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
891
+ label: z.ZodOptional<z.ZodString>;
892
+ }, z.core.$strip>;
893
+ export type PluginDesignCreateWindowArgs = z.infer<typeof PluginDesignCreateWindowArgs>;
894
+ /**
895
+ * Arguments for {@linkcode PluginDesignCreateApi.smartLayout}. Provide **exactly
896
+ * one** template source: `templateGroup` or a non-empty `templateComponents`.
897
+ *
898
+ * | Property | Type | Description |
899
+ * |---|---|---|
900
+ * | `templateGroup` | `string`? | Id of the group to clone as the template (a group id from `snaptrude.core.groups.list`, NOT a component handle) |
901
+ * | `templateComponents` | {@linkcode ComponentHandle}`[]`? | Explicit component set to clone as the template |
902
+ * | `targets` | {@linkcode ComponentHandle}`[]` | ROOM/DEPARTMENT spaces to place into (≥1) |
903
+ * | `hideTargets` | `boolean`? | Hide the target spaces after placement (default `true`) |
904
+ */
905
+ export declare const PluginSmartLayoutArgs: z.ZodObject<{
906
+ templateGroup: z.ZodOptional<z.ZodString>;
907
+ templateComponents: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>>;
908
+ targets: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
909
+ hideTargets: z.ZodOptional<z.ZodBoolean>;
910
+ }, z.core.$strip>;
911
+ export type PluginSmartLayoutArgs = z.infer<typeof PluginSmartLayoutArgs>;
912
+ /**
913
+ * Result of {@linkcode PluginDesignCreateApi.smartLayout} — the entities the run
914
+ * created, grouped by kind (flat across all targets; see the method JSDoc for why
915
+ * this is not attributed per target).
916
+ *
917
+ * | Property | Type | Description |
918
+ * |---|---|---|
919
+ * | `created.walls` | {@linkcode ComponentHandle}`[]` | Created walls |
920
+ * | `created.furniture` | {@linkcode ComponentHandle}`[]` | Created furniture |
921
+ * | `created.doors` | {@linkcode ComponentHandle}`[]` | Created doors |
922
+ * | `created.windows` | {@linkcode ComponentHandle}`[]` | Created windows |
923
+ * | `created.floors` | {@linkcode ComponentHandle}`[]` | Created floors |
924
+ * | `skippedWalls` | `number` | Walls the interior optimizer could not place |
925
+ */
926
+ export declare const PluginSmartLayoutResult: z.ZodObject<{
927
+ created: z.ZodObject<{
928
+ walls: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
929
+ furniture: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
930
+ doors: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
931
+ windows: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
932
+ floors: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
933
+ }, z.core.$strip>;
934
+ skippedWalls: z.ZodNumber;
935
+ }, z.core.$strip>;
936
+ export type PluginSmartLayoutResult = z.infer<typeof PluginSmartLayoutResult>;
728
937
  /**
729
938
  * Arguments for {@linkcode PluginDesignCreateApi.referenceLines}.
730
939
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/create/index.ts"],"names":[],"mapp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;;;;;;;;;iBASlC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAM7E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;iBAM/C,CAAA;AACF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,oCAAoC,CAC5C,CAAA;AAMD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;;EAAiC,CAAA;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;iBAKrC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAQnF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQhC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
@@ -11,6 +11,13 @@ import { PluginDesignChangeResult } from "../lock";
11
11
  * mesh reflection state. `mirror` reflects the door across an axis (undoable, one
12
12
  * command); `setType` is intentionally absent (the engine has no in-place re-type —
13
13
  * it would require delete+recreate).
14
+ *
15
+ * The **catalog** reads (`listCatalogGroups`/`listCatalog`/`getCatalogItem`/`exists`)
16
+ * browse the placeable door library — plain value records keyed by a library id
17
+ * (team `_id` or general `fullName`), NOT handles — and feed `design.create.door`.
18
+ * They are network-backed but carry no `Async` suffix (§6.6) and never throw
19
+ * (`[]`/`null`). The {@linkcode PluginObjectCatalogGroup} / {@linkcode PluginObjectCatalogItem}
20
+ * DTOs are shared with `design.windows`.
14
21
  */
15
22
  export declare abstract class PluginDesignDoorsApi {
16
23
  constructor();
@@ -203,6 +210,82 @@ export declare abstract class PluginDesignDoorsApi {
203
210
  * ```
204
211
  */
205
212
  abstract setHeight(doors: ComponentHandle[], height: number): PluginApiReturn<PluginDesignChangeResult>;
213
+ /**
214
+ * List the door catalog **groups** — the placement families (Swing, Sliding,
215
+ * Folding, Pivot, …), built-in groups merged with any team-custom types.
216
+ *
217
+ * @returns The groups as {@linkcode PluginObjectCatalogGroup}`[]` (`[]` when empty)
218
+ *
219
+ * @examplePrompt What kinds of doors can I place?
220
+ * @examplePrompt List the door groups in the catalog
221
+ * @examplePrompt Show me the door families available in this project
222
+ * @examplePrompt Which door types does this project support?
223
+ *
224
+ * # Example
225
+ * ```ts
226
+ * const groups = await snaptrude.design.doors.listCatalogGroups()
227
+ * for (const g of groups) console.log(g.dbType, g.label, g.source)
228
+ * ```
229
+ */
230
+ abstract listCatalogGroups(): PluginApiReturn<PluginObjectCatalogGroup[]>;
231
+ /**
232
+ * List the placeable door catalog (team + general libraries), optionally
233
+ * restricted to one group by its `dbType` token.
234
+ *
235
+ * @param group Restrict to one group's `dbType` (optional; e.g. `"singleDoor"`)
236
+ * @returns The catalog as {@linkcode PluginObjectCatalogItem}`[]` (`[]` when empty)
237
+ *
238
+ * @examplePrompt What doors can I place in this project?
239
+ * @examplePrompt List every door in the library
240
+ * @examplePrompt Show me the sliding doors I can add
241
+ * @examplePrompt Browse the door catalog
242
+ *
243
+ * # Example
244
+ * ```ts
245
+ * const [group] = await snaptrude.design.doors.listCatalogGroups()
246
+ * const items = await snaptrude.design.doors.listCatalog(group?.dbType)
247
+ * for (const item of items) console.log(item.id, item.name, item.thumbnailUrl)
248
+ * ```
249
+ */
250
+ abstract listCatalog(group?: string): PluginApiReturn<PluginObjectCatalogItem[]>;
251
+ /**
252
+ * Get a single door catalog item by its library id.
253
+ *
254
+ * @param id The catalog library id
255
+ * @returns The item, or `null` if no catalog item matches
256
+ *
257
+ * @examplePrompt Get the details of this door from the library
258
+ * @examplePrompt Look up the catalog entry for this door id
259
+ * @examplePrompt What is the cost of this door item?
260
+ * @examplePrompt Show me the family name of this door in the catalog
261
+ *
262
+ * # Example
263
+ * ```ts
264
+ * const [entry] = await snaptrude.design.doors.listCatalog()
265
+ * const item = await snaptrude.design.doors.getCatalogItem(entry.id)
266
+ * if (item) console.log(item.name, item.source, item.dbType)
267
+ * ```
268
+ */
269
+ abstract getCatalogItem(id: string): PluginApiReturn<PluginObjectCatalogItem | null>;
270
+ /**
271
+ * Test whether a door catalog item exists for the given library id.
272
+ *
273
+ * @param id The catalog library id
274
+ * @returns `true` if it exists, otherwise `false`
275
+ *
276
+ * @examplePrompt Is this door still in the library?
277
+ * @examplePrompt Check whether a door catalog item with this id exists
278
+ * @examplePrompt Does my team library have this door?
279
+ * @examplePrompt Verify the door is available before placing it
280
+ *
281
+ * # Example
282
+ * ```ts
283
+ * const [entry] = await snaptrude.design.doors.listCatalog()
284
+ * const stillAvailable = await snaptrude.design.doors.exists(entry.id)
285
+ * console.log(stillAvailable ? "safe to place" : "removed from library")
286
+ * ```
287
+ */
288
+ abstract exists(id: string): PluginApiReturn<boolean>;
206
289
  }
207
290
  /**
208
291
  * Arguments for the single-door read methods.
@@ -265,4 +348,80 @@ export declare const PluginDesignDoorSetHeightArgs: z.ZodObject<{
265
348
  height: z.ZodNumber;
266
349
  }, z.core.$strip>;
267
350
  export type PluginDesignDoorSetHeightArgs = z.infer<typeof PluginDesignDoorSetHeightArgs>;
351
+ /**
352
+ * A door/window catalog **group** — a placement family (e.g. Swing, Sliding,
353
+ * Casement). Shared by `design.doors` and `design.windows`.
354
+ *
355
+ * | Property | Type | Description |
356
+ * |---|---|---|
357
+ * | `dbType` | `string` | Stable engine token (e.g. `singleDoor`, `casementDouble`) |
358
+ * | `label` | `string` | Human-readable group label (e.g. `"Swing - 1 Shutter"`) |
359
+ * | `source` | `'default' \| 'team'` | Built-in group or a team-custom type |
360
+ */
361
+ export declare const PluginObjectCatalogGroup: z.ZodObject<{
362
+ dbType: z.ZodString;
363
+ label: z.ZodString;
364
+ source: z.ZodEnum<{
365
+ default: "default";
366
+ team: "team";
367
+ }>;
368
+ }, z.core.$strip>;
369
+ export type PluginObjectCatalogGroup = z.infer<typeof PluginObjectCatalogGroup>;
370
+ /**
371
+ * A placeable door/window catalog **item** (value record — not a scene
372
+ * entity/handle). Shared by `design.doors` and `design.windows`; symmetric with
373
+ * {@linkcode PluginFurnitureCatalogItem}. The raw mesh (`.babylon`) URL is never
374
+ * exposed — only `thumbnailUrl`.
375
+ *
376
+ * | Property | Type | Description |
377
+ * |---|---|---|
378
+ * | `id` | `string` | Library id (team `_id` or general `fullName`) — pass to `design.create.door`/`window` |
379
+ * | `name` | `string` | Display name |
380
+ * | `source` | `'team' \| 'general'` | Which library it came from |
381
+ * | `dbType` | `string` | The group token it belongs to (e.g. `singleDoor`) |
382
+ * | `subType` | `string`? | Engine sub-type (optional) |
383
+ * | `thumbnailUrl` | `string`? | Preview thumbnail URL (optional) |
384
+ * | `cost` | `number`? | Cost (optional; team items) |
385
+ * | `familyName` | `string`? | Family name (optional) |
386
+ */
387
+ export declare const PluginObjectCatalogItem: z.ZodObject<{
388
+ id: z.ZodString;
389
+ name: z.ZodString;
390
+ source: z.ZodEnum<{
391
+ team: "team";
392
+ general: "general";
393
+ }>;
394
+ dbType: z.ZodString;
395
+ subType: z.ZodOptional<z.ZodString>;
396
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
397
+ cost: z.ZodOptional<z.ZodNumber>;
398
+ familyName: z.ZodOptional<z.ZodString>;
399
+ }, z.core.$strip>;
400
+ export type PluginObjectCatalogItem = z.infer<typeof PluginObjectCatalogItem>;
401
+ /**
402
+ * Arguments for {@linkcode PluginDesignDoorsApi.listCatalog}.
403
+ *
404
+ * | Property | Type | Description |
405
+ * |---|---|---|
406
+ * | `group` | `string`? | Restrict to one group's `dbType` token (optional) |
407
+ */
408
+ export declare const PluginDesignDoorListCatalogArgs: z.ZodObject<{
409
+ group: z.ZodOptional<z.ZodString>;
410
+ }, z.core.$strip>;
411
+ export type PluginDesignDoorListCatalogArgs = z.infer<typeof PluginDesignDoorListCatalogArgs>;
412
+ /**
413
+ * Arguments for {@linkcode PluginDesignDoorsApi.getCatalogItem} / {@linkcode PluginDesignDoorsApi.exists}.
414
+ *
415
+ * | Property | Type | Description |
416
+ * |---|---|---|
417
+ * | `id` | `string` | The catalog library id |
418
+ */
419
+ export declare const PluginDesignDoorGetCatalogItemArgs: z.ZodObject<{
420
+ id: z.ZodString;
421
+ }, z.core.$strip>;
422
+ export type PluginDesignDoorGetCatalogItemArgs = z.infer<typeof PluginDesignDoorGetCatalogItemArgs>;
423
+ export declare const PluginDesignDoorExistsArgs: z.ZodObject<{
424
+ id: z.ZodString;
425
+ }, z.core.$strip>;
426
+ export type PluginDesignDoorExistsArgs = z.infer<typeof PluginDesignDoorExistsArgs>;
268
427
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/doors/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;;;;;GASG;AACH,8BAAsB,oBAAoB;;IAGxC;;;;;;;;;;;;;;;;;;OAkBG;aACa,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAE9E;;;;;;;;;;;;;;;;;;OAkBG;aACa,SAAS,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAEhF;;;;;;;;;;;;;;;;;OAiBG;aACa,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAE/E;;;;;;;;;;;;;;;;;OAi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AAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEvF;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B;;;iBAGxC,CAAA;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAMzF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;;;;;iBAInC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBASlC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;iBAE1C,CAAA;AACF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC;;iBAE7C,CAAA;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAEnG,eAAO,MAAM,0BAA0B;;iBAAqC,CAAA;AAC5E,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA"}
@@ -13,23 +13,46 @@ import { PluginApiReturn } from "../../../types";
13
13
  export declare abstract class PluginDesignFurnitureApi {
14
14
  constructor();
15
15
  /**
16
- * List the placeable furniture catalog (team + general libraries).
16
+ * List the categories (Living, Bedroom, Kitchen, …) that organize the
17
+ * furniture catalog — the picker taxonomy, merged from built-in categories,
18
+ * team types, and backend user types. Pass a value to
19
+ * {@linkcode PluginDesignFurnitureApi.listCatalog}'s `category` filter.
20
+ * @returns The category names (`[]` when empty)
21
+ *
22
+ * @examplePrompt What furniture categories are available?
23
+ * @examplePrompt List the furniture categories
24
+ * @examplePrompt Show me the furniture groups like living and bedroom
25
+ * @examplePrompt Which furniture categories can I filter by?
26
+ *
27
+ * # Example
28
+ * ```ts
29
+ * const categories = await snaptrude.design.furniture.listCategories()
30
+ * const [first] = categories
31
+ * const items = await snaptrude.design.furniture.listCatalog(undefined, first)
32
+ * console.log(first, "→", items.length, "items")
33
+ * ```
34
+ */
35
+ abstract listCategories(): PluginApiReturn<string[]>;
36
+ /**
37
+ * List the placeable furniture catalog (team + general libraries),
38
+ * optionally filtered by library `source` and/or `category`.
17
39
  * @param source Restrict to one library (optional)
40
+ * @param category Restrict to one category (optional; see {@linkcode PluginDesignFurnitureApi.listCategories})
18
41
  * @returns The catalog as {@linkcode PluginFurnitureCatalogItem}`[]` (`[]` when empty)
19
42
  *
20
43
  * @examplePrompt What furniture can I place in this project?
21
44
  * @examplePrompt Show me all the furniture available in the library
22
45
  * @examplePrompt List the chairs and tables I can add to the model
23
46
  * @examplePrompt Which furniture items are in my team's library?
24
- * @examplePrompt Browse the furniture catalog
47
+ * @examplePrompt Show me the bedroom furniture I can place
25
48
  *
26
49
  * # Example
27
50
  * ```ts
28
- * const teamItems = await snaptrude.design.furniture.listCatalog("team")
29
- * for (const item of teamItems) console.log(item.id, item.name, item.cost)
51
+ * const bedroom = await snaptrude.design.furniture.listCatalog("team", "bedroom")
52
+ * for (const item of bedroom) console.log(item.id, item.name, item.thumbnailUrl)
30
53
  * ```
31
54
  */
32
- abstract listCatalog(source?: "team" | "general"): PluginApiReturn<PluginFurnitureCatalogItem[]>;
55
+ abstract listCatalog(source?: "team" | "general", category?: string): PluginApiReturn<PluginFurnitureCatalogItem[]>;
33
56
  /**
34
57
  * Get a single catalog item by its library id.
35
58
  * @param id The catalog library id
@@ -76,6 +99,8 @@ export declare abstract class PluginDesignFurnitureApi {
76
99
  * | `name` | `string` | Display name |
77
100
  * | `source` | `'team' \| 'general'` | Which library it came from |
78
101
  * | `subType` | `string` | Sub-type (optional) |
102
+ * | `category` | `string` | Category the item belongs to (optional) |
103
+ * | `thumbnailUrl` | `string` | Preview thumbnail URL (optional; never the mesh URL) |
79
104
  * | `cost` | `number` | Cost (optional; team items) |
80
105
  * | `familyName` | `string` | Family name (optional) |
81
106
  */
@@ -87,6 +112,8 @@ export declare const PluginFurnitureCatalogItem: z.ZodObject<{
87
112
  general: "general";
88
113
  }>;
89
114
  subType: z.ZodOptional<z.ZodString>;
115
+ category: z.ZodOptional<z.ZodString>;
116
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
90
117
  cost: z.ZodOptional<z.ZodNumber>;
91
118
  familyName: z.ZodOptional<z.ZodString>;
92
119
  }, z.core.$strip>;
@@ -97,12 +124,14 @@ export type PluginFurnitureCatalogItem = z.infer<typeof PluginFurnitureCatalogIt
97
124
  * | Property | Type | Description |
98
125
  * |---|---|---|
99
126
  * | `source` | `'team' \| 'general'` | Restrict to one library (optional) |
127
+ * | `category` | `string` | Restrict to one category (optional) |
100
128
  */
101
129
  export declare const PluginDesignFurnitureListCatalogArgs: z.ZodObject<{
102
130
  source: z.ZodOptional<z.ZodEnum<{
103
131
  team: "team";
104
132
  general: "general";
105
133
  }>>;
134
+ category: z.ZodOptional<z.ZodString>;
106
135
  }, z.core.$strip>;
107
136
  export type PluginDesignFurnitureListCatalogArgs = z.infer<typeof PluginDesignFurnitureListCatalogArgs>;
108
137
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/furniture/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD;;;;;;;;;GASG;AACH,8BAA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;;;;;;;;;;;;;;OAkBG;aACa,WAAW,CACzB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,CAAC,EAAE,MAAM,GAChB,eAAe,CAAC,0BAA0B,EAAE,CAAC;IAEhD;;;;;;;;;;;;;;;;OAgBG;aACa,cAAc,CAC5B,EAAE,EAAE,MAAM,GACT,eAAe,CAAC,0BAA0B,GAAG,IAAI,CAAC;IAErD;;;;;;;;;;;;;;;;OAgBG;aACa,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC;CAC7D;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;iBASrC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF;;;;;;;GAOG;AACH,eAAO,MAAM,oCAAoC;;;;;;iBAG/C,CAAA;AACF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,oCAAoC,CAC5C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uCAAuC;;iBAElD,CAAA;AACF,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,uCAAuC,CAC/C,CAAA;AAED,eAAO,MAAM,+BAA+B;;iBAA0C,CAAA;AACtF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA"}
@@ -27,6 +27,7 @@ import { PluginDesignChangeResult } from "./lock";
27
27
  * - {@linkcode PluginDesignApi.erase} — plan-level adjacency-edge erase (NOT hard delete)
28
28
  * - {@linkcode PluginDesignApi.delete} — hard entity removal
29
29
  * - {@linkcode PluginDesignApi.lock} / {@linkcode PluginDesignApi.unlock} / {@linkcode PluginDesignApi.isLocked} / {@linkcode PluginDesignApi.listLocked} — lock state (top-level design verbs, §2A.1)
30
+ * - {@linkcode PluginDesignApi.lockArea} / {@linkcode PluginDesignApi.unlockArea} / {@linkcode PluginDesignApi.isAreaLocked} / {@linkcode PluginDesignApi.listAreaLocked} — footprint-area lock for Room/Department spaces
30
31
  *
31
32
  * Transform and edit operation namespaces land here in later waves.
32
33
  */
@@ -133,6 +134,88 @@ export declare abstract class PluginDesignApi {
133
134
  * ```
134
135
  */
135
136
  abstract listLocked(): PluginApiReturn<ComponentHandle[]>;
137
+ /**
138
+ * Lock the **footprint area** of one or more Room / Department mass spaces —
139
+ * geometry edits that would change the bottom-face area are then refused or
140
+ * auto-resized to preserve it. Distinct from {@linkcode PluginDesignApi.lock}
141
+ * (which freezes the whole object): this locks only the area. Cascades to the
142
+ * space's instances and its source mass. Undoable.
143
+ *
144
+ * Only Room / Department masses are area-lockable; any other handle throws.
145
+ * Requires the `area_lock` feature to be enabled — when it is off this throws.
146
+ *
147
+ * @param spaces Room / Department mass spaces to area-lock
148
+ * @returns The affected spaces (post-cascade, echoing the input handles)
149
+ *
150
+ * @examplePrompt Lock the floor area of the selected rooms
151
+ * @examplePrompt Freeze the footprint area of this department so its size can't drift
152
+ * @examplePrompt Area-lock every room on this storey
153
+ * @examplePrompt Pin the area of this space while I edit its walls
154
+ *
155
+ * # Example
156
+ * ```ts
157
+ * const rooms = await snaptrude.design.selection.get()
158
+ * const { affected } = await snaptrude.design.lockArea(rooms)
159
+ * console.log("area-locked", affected.length, "spaces")
160
+ * ```
161
+ */
162
+ abstract lockArea(spaces: ComponentHandle[]): PluginApiReturn<PluginDesignChangeResult>;
163
+ /**
164
+ * Unlock the footprint area of previously area-locked spaces so their area can
165
+ * change again. Paired with {@linkcode PluginDesignApi.lockArea}; cascades to
166
+ * instances + source; undoable. Requires the `area_lock` feature (throws if off).
167
+ *
168
+ * @param spaces Room / Department mass spaces to area-unlock
169
+ * @returns The affected spaces (post-cascade)
170
+ *
171
+ * @examplePrompt Unlock the area of the selected rooms
172
+ * @examplePrompt Remove the footprint-area lock from this department
173
+ * @examplePrompt Let me resize this space again by unlocking its area
174
+ * @examplePrompt Area-unlock everything I locked earlier
175
+ *
176
+ * # Example
177
+ * ```ts
178
+ * const locked = await snaptrude.design.listAreaLocked()
179
+ * const { affected } = await snaptrude.design.unlockArea(locked)
180
+ * ```
181
+ */
182
+ abstract unlockArea(spaces: ComponentHandle[]): PluginApiReturn<PluginDesignChangeResult>;
183
+ /**
184
+ * Test whether a space's footprint area is locked. A read — never throws;
185
+ * returns `false` for non-space handles and when the `area_lock` feature is off.
186
+ *
187
+ * @param space The space to test
188
+ * @returns `true` if the space's area is locked, otherwise `false`
189
+ *
190
+ * @examplePrompt Is the area of this room locked?
191
+ * @examplePrompt Check whether this department's footprint is pinned
192
+ * @examplePrompt Tell me if the selected space has its area locked
193
+ *
194
+ * # Example
195
+ * ```ts
196
+ * const [room] = await snaptrude.design.selection.get()
197
+ * const locked = await snaptrude.design.isAreaLocked(room)
198
+ * console.log(locked ? "area is locked" : "area is free")
199
+ * ```
200
+ */
201
+ abstract isAreaLocked(space: ComponentHandle): PluginApiReturn<boolean>;
202
+ /**
203
+ * List the spaces whose footprint area is locked. A read — never throws; returns
204
+ * `[]` when the `area_lock` feature is off.
205
+ *
206
+ * @returns The area-locked spaces as {@linkcode ComponentHandle}`[]`
207
+ *
208
+ * @examplePrompt Which spaces have their area locked?
209
+ * @examplePrompt List every room with a locked footprint
210
+ * @examplePrompt Show me all the area-locked departments
211
+ *
212
+ * # Example
213
+ * ```ts
214
+ * const locked = await snaptrude.design.listAreaLocked()
215
+ * console.log(locked.length, "area-locked spaces")
216
+ * ```
217
+ */
218
+ abstract listAreaLocked(): PluginApiReturn<ComponentHandle[]>;
136
219
  constructor();
137
220
  }
138
221
  export * from "./create";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/design/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,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