@snaptrude/plugin-core 0.9.15 → 0.9.16-networks-20261008.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 (50) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/api/analysis/daylight.d.ts +5 -5
  3. package/dist/api/analysis/solar.d.ts +2 -2
  4. package/dist/api/core/camera/index.d.ts +418 -0
  5. package/dist/api/core/camera/index.d.ts.map +1 -1
  6. package/dist/api/design/bim.d.ts +209 -0
  7. package/dist/api/design/bim.d.ts.map +1 -0
  8. package/dist/api/design/catalog.d.ts +242 -0
  9. package/dist/api/design/catalog.d.ts.map +1 -0
  10. package/dist/api/design/create/bulk-items.d.ts +11 -3
  11. package/dist/api/design/create/bulk-items.d.ts.map +1 -1
  12. package/dist/api/design/create/index.d.ts +47 -20
  13. package/dist/api/design/create/index.d.ts.map +1 -1
  14. package/dist/api/design/family.d.ts +576 -12
  15. package/dist/api/design/family.d.ts.map +1 -1
  16. package/dist/api/design/index.d.ts +16 -0
  17. package/dist/api/design/index.d.ts.map +1 -1
  18. package/dist/api/design/networks.d.ts +1703 -0
  19. package/dist/api/design/networks.d.ts.map +1 -0
  20. package/dist/api/design/query/index.d.ts +30 -30
  21. package/dist/api/design/selection/index.d.ts +10 -10
  22. package/dist/api/design/types/index.d.ts +40 -24
  23. package/dist/api/design/types/index.d.ts.map +1 -1
  24. package/dist/api/design/update/index.d.ts +40 -3
  25. package/dist/api/design/update/index.d.ts.map +1 -1
  26. package/dist/api/presentation/aiInspiration.d.ts +10 -10
  27. package/dist/api/presentation/index.d.ts +9 -0
  28. package/dist/api/presentation/index.d.ts.map +1 -1
  29. package/dist/api/presentation/walkthroughs.d.ts +1350 -0
  30. package/dist/api/presentation/walkthroughs.d.ts.map +1 -0
  31. package/dist/index.cjs +3255 -2176
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.js +3146 -2176
  34. package/dist/index.js.map +1 -1
  35. package/package.json +1 -1
  36. package/scripts/generate-manifest.mjs +5 -0
  37. package/src/api/core/camera/index.ts +400 -1
  38. package/src/api/design/bim.ts +121 -0
  39. package/src/api/design/catalog.ts +128 -0
  40. package/src/api/design/create/bulk-items.ts +6 -2
  41. package/src/api/design/create/index.ts +62 -32
  42. package/src/api/design/family.ts +448 -17
  43. package/src/api/design/index.ts +34 -4
  44. package/src/api/design/networks.ts +607 -0
  45. package/src/api/design/types/index.ts +31 -24
  46. package/src/api/design/update/index.ts +41 -3
  47. package/src/api/presentation/index.ts +9 -0
  48. package/src/api/presentation/walkthroughs.ts +1201 -0
  49. package/api-manifest.full.json +0 -8930
  50. package/api-manifest.json +0 -9318
@@ -1,23 +1,25 @@
1
1
  import * as z from "zod"
2
2
  import { PluginApiReturn } from "../../../types"
3
3
 
4
+ /** An exact saved native wall family. Access is checked on every use; Draw selection is not registration. */
5
+ export const PluginNativeWallType = z.object({
6
+ id: z.string().min(1),
7
+ version: z.number().int().positive(),
8
+ })
9
+ export type PluginNativeWallType = z.infer<typeof PluginNativeWallType>
10
+
11
+ /** Legacy project type name/id, or an exact authorized native wall family pin. */
12
+ export const PluginWallType = z.union([z.string().trim().min(1), PluginNativeWallType])
13
+ export type PluginWallType = z.infer<typeof PluginWallType>
14
+
4
15
  /**
5
- * `snaptrude.design.types` — READ-ONLY reference over the project's building
6
- * **type / assembly** system (the Project Properties layer stacks: External /
7
- * Internal walls, slabs, floors, ceilings, roofs). A type bundles a labelled
8
- * layer stack — each layer's role, thickness (engine units) and material — plus a
9
- * summed total thickness. Both the built-in defaults and any team/user-added types
10
- * are surfaced.
11
- *
12
- * Types are plain value records ({@linkcode PluginBuildingType}) — NOT scene
13
- * entities/handles. A type's `id` is a stable `"<kind>:<name>"` token
14
- * (e.g. `"wall:brickWithPlasterAndPaint"`) returned by
15
- * {@linkcode PluginDesignTypesApi.list} and consumed by
16
- * {@linkcode PluginDesignTypesApi.get}. Reads never throw — an unknown id yields
17
- * `null`; a kind with no types yields `[]`.
18
- *
19
- * These are reads only: there is no engine seam to author a type from a plugin
20
- * (types are created through the construction/project-properties UI).
16
+ * Read-only project assemblies and authorized saved native wall families.
17
+ * Legacy ids use `"<kind>:<name>"`. Native wall records carry `nativeFamily`:
18
+ * pass that exact `{ id, version }` pin to get, create.walls, create.wallRuns,
19
+ * or update.wall. Labels and bare definition ids do not select native families.
20
+ * Native lengths use Snaptrude units (1 SU = 254 mm).
21
+ * Missing ids return null; catalog/network failures reject rather than return
22
+ * an incomplete catalog. Author native families with design.family.
21
23
  */
22
24
  export abstract class PluginDesignTypesApi {
23
25
  constructor() {}
@@ -46,10 +48,10 @@ export abstract class PluginDesignTypesApi {
46
48
  ): PluginApiReturn<PluginBuildingTypeSummary[]>
47
49
 
48
50
  /**
49
- * Get one building type by its `"<kind>:<name>"` id — its labelled layer stack
51
+ * Get one building type by its legacy id or exact native wall pin — its labelled layer stack
50
52
  * (each layer's role, thickness and material) plus the summed total thickness.
51
53
  *
52
- * @param typeId The type id from {@linkcode PluginDesignTypesApi.list} (e.g. `"wall:exposedConcrete"`)
54
+ * @param typeId The legacy id or nativeFamily pin from {@linkcode PluginDesignTypesApi.list}
53
55
  * @returns The full type, or `null` if no type matches
54
56
  *
55
57
  * @examplePrompt What layers make up this wall type?
@@ -60,11 +62,11 @@ export abstract class PluginDesignTypesApi {
60
62
  * # Example
61
63
  * ```ts
62
64
  * const [first] = await snaptrude.design.types.list("wall")
63
- * const type = await snaptrude.design.types.get(first.id)
65
+ * const type = await snaptrude.design.types.get(first.nativeFamily ?? first.id)
64
66
  * if (type) for (const layer of type.layers) console.log(layer.name, layer.thickness)
65
67
  * ```
66
68
  */
67
- public abstract get(typeId: string): PluginApiReturn<PluginBuildingType | null>
69
+ public abstract get(typeId: PluginWallType): PluginApiReturn<PluginBuildingType | null>
68
70
  }
69
71
 
70
72
  /** The building-type families exposed by {@linkcode PluginDesignTypesApi}. */
@@ -85,6 +87,8 @@ export const PluginTypeLayer = z.object({
85
87
  name: z.string(),
86
88
  role: z.string(),
87
89
  thickness: z.number(),
90
+ /** Native authored core membership. Never inferred from material or layer name. */
91
+ isCore: z.boolean().optional(),
88
92
  material: z
89
93
  .object({
90
94
  name: z.string(),
@@ -99,7 +103,7 @@ export type PluginTypeLayer = z.infer<typeof PluginTypeLayer>
99
103
  *
100
104
  * | Property | Type | Description |
101
105
  * |---|---|---|
102
- * | `id` | `string` | Stable `"<kind>:<name>"` token — pass to `design.types.get` |
106
+ * | `id` | `string` | Legacy `"<kind>:<name>"` token or native definition id; native lookups use `nativeFamily` |
103
107
  * | `kind` | {@linkcode PluginBuildingTypeKind} | Which family it belongs to |
104
108
  * | `label` | `string` | Human-readable label |
105
109
  * | `isDefault` | `boolean` | `true` for a built-in type, `false` for a team/user type |
@@ -111,6 +115,8 @@ export const PluginBuildingTypeSummary = z.object({
111
115
  label: z.string(),
112
116
  isDefault: z.boolean(),
113
117
  thickness: z.number(),
118
+ /** Present for native walls. Pass the whole pin to get/create/update, not its label or bare id. */
119
+ nativeFamily: PluginNativeWallType.optional(),
114
120
  })
115
121
  export type PluginBuildingTypeSummary = z.infer<typeof PluginBuildingTypeSummary>
116
122
 
@@ -119,7 +125,7 @@ export type PluginBuildingTypeSummary = z.infer<typeof PluginBuildingTypeSummary
119
125
  *
120
126
  * | Property | Type | Description |
121
127
  * |---|---|---|
122
- * | `id` | `string` | Stable `"<kind>:<name>"` token |
128
+ * | `id` | `string` | Legacy type token or native definition id |
123
129
  * | `kind` | {@linkcode PluginBuildingTypeKind} | Which family it belongs to |
124
130
  * | `label` | `string` | Human-readable label |
125
131
  * | `isDefault` | `boolean` | `true` for a built-in type |
@@ -148,9 +154,10 @@ export type PluginDesignTypesListArgs = z.infer<typeof PluginDesignTypesListArgs
148
154
  *
149
155
  * | Property | Type | Description |
150
156
  * |---|---|---|
151
- * | `typeId` | `string` | The `"<kind>:<name>"` id from `design.types.list` |
157
+ * | `typeId` | {@linkcode PluginWallType} | A legacy `"<kind>:<name>"` id or exact `nativeFamily` pin from `design.types.list` |
152
158
  */
153
159
  export const PluginDesignTypesGetArgs = z.object({
154
- typeId: z.string(),
160
+ // Preserve legacy lookup behavior: malformed string ids return null in the host.
161
+ typeId: z.union([z.string(), PluginNativeWallType]),
155
162
  })
156
163
  export type PluginDesignTypesGetArgs = z.infer<typeof PluginDesignTypesGetArgs>
@@ -9,7 +9,10 @@ import {
9
9
  PluginSpaceUpdateResult,
10
10
  } from "../../entity/space"
11
11
  import { PluginDesignChangeResult } from "../lock"
12
- import { MassParametersPatch, type MassParametersRecord } from "../../../massParameters"
12
+ import {
13
+ MassParametersPatch,
14
+ type MassParametersRecord,
15
+ } from "../../../massParameters"
13
16
  import {
14
17
  PluginBuildableEnvelopePolygonVertex,
15
18
  PluginBuildableEnvelopeSetbackTier,
@@ -18,6 +21,12 @@ import {
18
21
  } from "../../entity/buildableEnvelope"
19
22
  import { PluginGridStyleOptions } from "../create/grids"
20
23
  import { PluginEntityType } from "../query"
24
+ import { PluginWallType } from "../types"
25
+ import {
26
+ PluginConstructionType,
27
+ PluginFamilyValues,
28
+ type PluginFamilyUpdates,
29
+ } from "../catalog"
21
30
 
22
31
  /**
23
32
  * Sparse property updates for a space. Only provided fields change.
@@ -165,13 +174,14 @@ export type PluginDesignUpdateParametersArgs = z.infer<
165
174
  * |---|---|---|
166
175
  * | `thickness` | `number`? | Wall thickness, engine units (> 0) |
167
176
  * | `height` | `number`? | Wall height, engine units (> 0) |
168
- * | `type` | `string`? | Convert the wall to another wall type — a name (or `wall:`-prefixed id) from `design.types.list("wall")` |
177
+ * | `type` | {@linkcode PluginWallType}? | Legacy name/id or exact authorized native `{ id, version }` pin from `design.types.list("wall")` |
169
178
  */
170
179
  export const PluginWallUpdates = z
171
180
  .object({
172
181
  thickness: z.number().positive().optional(),
173
182
  height: z.number().positive().optional(),
174
- type: z.string().trim().min(1).optional(),
183
+ type: PluginWallType.optional(),
184
+ values: PluginFamilyValues.optional(),
175
185
  })
176
186
  .refine((p) => Object.keys(p).length > 0, {
177
187
  message: "PluginWallUpdates requires at least one field to change",
@@ -196,6 +206,8 @@ export const PluginSlabUpdates = z
196
206
  .object({
197
207
  thickness: z.number().positive().optional(),
198
208
  overhang: z.number().optional(),
209
+ type: PluginConstructionType.optional(),
210
+ values: PluginFamilyValues.optional(),
199
211
  })
200
212
  .refine((p) => Object.keys(p).length > 0, {
201
213
  message: "PluginSlabUpdates requires at least one field to change",
@@ -313,6 +325,11 @@ export type PluginDesignUpdateGridArgs = z.infer<
313
325
  *
314
326
  * Migrated from the removed `entity.space.{update, updateGeometryFromProfile, bulkUpdate}`.
315
327
  * Only provided fields change; each call is undoable. Failures throw (RPC rejects).
328
+ *
329
+ * Native family edits accept `type` and/or sparse `values` from `design.catalog`.
330
+ * Length overrides use mm; dimensional arguments use SU. Contours and axes stay unchanged.
331
+ * Shared/type overrides are refused. A thickness argument must agree with the layer values.
332
+ * Family roof overhang is unsupported; use the native slab path for family overhang edits.
316
333
  */
317
334
  export abstract class PluginDesignUpdateApi {
318
335
  constructor() {}
@@ -566,6 +583,9 @@ export abstract class PluginDesignUpdateApi {
566
583
  * chamfer (the kernel numbers its faces differently): send the twist/taper
567
584
  * keys with `operations: []` first (the message names them), re-select on
568
585
  * the new shape, then send `{ operations }` back.
586
+ * Graph-bound spaces accept amount-only extrusion edits. Footprint, twist,
587
+ * taper and operation edits require the owning boundary tools, so generated
588
+ * walls, junctions and hosted openings remain synchronized.
569
589
  * @throws VALIDATION for a key the kind does not have (the message lists the
570
590
  * kind's keys), `kind` or `version` in a partial patch, or a value outside
571
591
  * the constructor's own rules (torus tube ≥ ring, revolution angle ∉
@@ -773,6 +793,24 @@ export abstract class PluginDesignUpdateApi {
773
793
  updates: PluginSlabUpdates,
774
794
  ): PluginApiReturn<PluginDesignChangeResult>
775
795
 
796
+ /** Replace a native beam family while preserving its authored axis. Values use mm/degrees.
797
+ * @param component Native beam. @param updates Saved family reference and optional instance values.
798
+ * @returns Affected component IDs. One undoable operation; unsupported geometry fails before mutation.
799
+ */
800
+ public abstract beam(
801
+ component: ComponentHandle,
802
+ updates: PluginFamilyUpdates,
803
+ ): PluginApiReturn<PluginDesignChangeResult>
804
+
805
+ /** Replace a native column family while preserving its authored axis. Values use mm/degrees.
806
+ * @param component Native column. @param updates Saved family reference and optional instance values.
807
+ * @returns Affected component IDs. One undoable operation; unsupported geometry fails before mutation.
808
+ */
809
+ public abstract column(
810
+ component: ComponentHandle,
811
+ updates: PluginFamilyUpdates,
812
+ ): PluginApiReturn<PluginDesignChangeResult>
813
+
776
814
  /**
777
815
  * Set a component's **absolute world elevation** — moves it vertically so its
778
816
  * base (the bounding-box bottom, world Y) lands at `elevation`. Composed over
@@ -10,6 +10,7 @@ import { PluginPresentationShapesApi } from "./shapes"
10
10
  import { PluginPresentationTablesApi } from "./tables"
11
11
  import { PluginPresentationSlideshowApi } from "./slideshow"
12
12
  import { PluginPresentationImportApi } from "./import"
13
+ import { PluginPresentationWalkthroughsApi } from "./walkthroughs"
13
14
  import {
14
15
  PluginPresentationExportResult,
15
16
  type PluginPresentationExportFormat,
@@ -35,6 +36,7 @@ import {
35
36
  * - {@linkcode PluginPresentationApi.slideshow} — Run the Present-mode slideshow
36
37
  * - {@linkcode PluginPresentationApi.import} — Import reference images/PDFs onto the canvas
37
38
  * - {@linkcode PluginPresentationApi.aiInspiration} — Present-mode AI image/video generation
39
+ * - {@linkcode PluginPresentationApi.walkthroughs} — Camera paths through the model: create, play, capture, export as video
38
40
  *
39
41
  * Accessed via `snaptrude.presentation`.
40
42
  */
@@ -64,6 +66,12 @@ export abstract class PluginPresentationApi {
64
66
  * {@linkcode PluginPresentationAIInspirationApi}.
65
67
  */
66
68
  public abstract aiInspiration: PluginPresentationAIInspirationApi
69
+ /**
70
+ * Walkthroughs — camera paths through the model: create (keyframes, floor
71
+ * points, camera-move presets), play, capture and export as video onto the
72
+ * Present canvas. See {@linkcode PluginPresentationWalkthroughsApi}.
73
+ */
74
+ public abstract walkthroughs: PluginPresentationWalkthroughsApi
67
75
 
68
76
  /**
69
77
  * Export the presentation's layout sheets to a downloadable file (PDF / PNG /
@@ -114,4 +122,5 @@ export * from "./tables"
114
122
  export * from "./slideshow"
115
123
  export * from "./import"
116
124
  export * from "./aiInspiration"
125
+ export * from "./walkthroughs"
117
126
  export * from "./export"