@snaptrude/plugin-core 0.9.17 → 0.9.18-networks-20261020.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 (106) hide show
  1. package/dist/api/analysis/daylight.d.ts +5 -5
  2. package/dist/api/analysis/solar.d.ts +2 -2
  3. package/dist/api/core/camera/index.d.ts +29 -0
  4. package/dist/api/core/camera/index.d.ts.map +1 -1
  5. package/dist/api/core/geom/create/index.d.ts +7 -1
  6. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  7. package/dist/api/core/geom/update/contour.d.ts +8 -2
  8. package/dist/api/core/geom/update/contour.d.ts.map +1 -1
  9. package/dist/api/core/storeys/index.d.ts +5 -2
  10. package/dist/api/core/storeys/index.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 +299 -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 +801 -28
  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 +141 -8
  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 +3744 -2383
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.js +3621 -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/storeys/index.ts +5 -2
  77. package/src/api/core/zoom/index.ts +13 -0
  78. package/src/api/design/bim.ts +210 -0
  79. package/src/api/design/boolean/index.ts +2 -0
  80. package/src/api/design/catalog.ts +203 -0
  81. package/src/api/design/create/bulk-items.ts +57 -17
  82. package/src/api/design/create/index.ts +288 -120
  83. package/src/api/design/create/opening-fields.ts +15 -12
  84. package/src/api/design/delete/index.ts +1 -0
  85. package/src/api/design/doors/index.ts +58 -42
  86. package/src/api/design/family.ts +666 -33
  87. package/src/api/design/index.ts +34 -4
  88. package/src/api/design/networks.ts +607 -0
  89. package/src/api/design/query/index.ts +12 -2
  90. package/src/api/design/types/index.ts +31 -24
  91. package/src/api/design/update/index.ts +44 -3
  92. package/src/api/design/windows/index.ts +40 -22
  93. package/src/api/presentation/annotate.ts +90 -58
  94. package/src/api/presentation/drawingContract.ts +70 -0
  95. package/src/api/presentation/drawings.ts +1179 -0
  96. package/src/api/presentation/export.ts +32 -6
  97. package/src/api/presentation/index.ts +39 -14
  98. package/src/api/presentation/placedViews.ts +119 -28
  99. package/src/api/presentation/sheets.ts +181 -20
  100. package/src/api/presentation/viewPresets.ts +241 -0
  101. package/src/api/presentation/views.ts +78 -9
  102. package/src/errors/codes.ts +7 -0
  103. package/test/drawingContract.test.mjs +288 -0
  104. package/test/errors.test.mjs +1 -0
  105. package/test/presentationViewSettings.test.mjs +85 -0
  106. package/api-manifest.json +0 -9711
@@ -1,6 +1,7 @@
1
1
  import * as z from "zod";
2
2
  import { PluginApiReturn } from "../../types";
3
3
  import { BrepHandle, ComponentHandle } from "../../handles";
4
+ import { NetworkFamilyContract } from "./networks";
4
5
  /**
5
6
  * `snaptrude.design.family.*` — author NATIVE parametric families from a JSON spec.
6
7
  *
@@ -11,19 +12,52 @@ import { BrepHandle, ComponentHandle } from "../../handles";
11
12
  * compiles that into a live parametric definition the user can place, flex and
12
13
  * save to their library.
13
14
  *
14
- * ## Workflow
15
+ * ## Generic component workflow
15
16
  *
16
17
  * ```
17
- * getReference() read the spec DSL once — grammar, ops, expressions, example
18
- * prepare({ bundle }) validate + compile + show a live ghost; nothing committed
18
+ * getReference() read the spec DSL once — grammar, ops, expressions, examples
19
+ * getExamples() worked example families by discipline; getExamples({ id }) for one
20
+ * prepare({ bundle }) validate + compile; nothing committed, nothing in the viewport
19
21
  * flex({ values }) re-run at new values; returns the geometry delta
20
22
  * place({ position }) put it in the model — saves the family as the first instance drops
21
23
  * place() save the family, then arm placement — the USER clicks to drop it
24
+ * create() save an EDIT of a saved family — the app asks the user
22
25
  * create({ teamId }) share with a team; a save with nothing placed also drops one instance
23
26
  * ```
24
27
  *
25
28
  * `place` saves the prepared family to the user's personal library, so it
26
- * survives reload with no extra step; finish on `place`, not on `create`.
29
+ * survives reload with no extra step; finish a NEW generic component on
30
+ * `place`, not on `create` (`create` ends only an edit of a saved family, below).
31
+ *
32
+ * Architectural types use `create({ name })` to save the prepared recipe.
33
+ * Saving does not assign a family to a native host.
34
+ * Read `design.catalog` and pass the saved `{ id, version }` reference to the
35
+ * native `design.create` method with its contour, wall profile, or straight axis.
36
+ * Standalone placement does not create a native host. Selecting a Draw type
37
+ * does not register an API type. Native creator values use mm, while this
38
+ * generic family API uses SU. Read `family_authoring` for the full workflow.
39
+ *
40
+ * ## Door and window templates
41
+ *
42
+ * Start with `getTemplate({ kind: "door" | "window", subType? })`, edit the
43
+ * recipe's style while keeping its contract, then `prepare` → `flex` → `create`.
44
+ * Place the saved family with
45
+ * `design.create.door(familyId, hostWall, position, { version, values, hinge }, facing)`
46
+ * or `design.create.window` with the same positional signature. Positions,
47
+ * hinge and facing are vec3 handles; values use the authored parameter keys.
48
+ * Templates produce ParametricComponents, not separate OpeningComponents. Read
49
+ * and edit their instances through `getParameters` / `setParameters`.
50
+ * The contract maps opening dimensions to parameter keys; do not assume the
51
+ * recipe names its width parameter `width`. Generic family lengths use SU.
52
+ * Hosted door/window `create({ name })` saves without placing a standalone
53
+ * sample. Supply the host and position in a subsequent placement.
54
+ *
55
+ * ## Changing a saved family
56
+ *
57
+ * Open it with `get({ id })` or `get({ component })`, edit with `prepare` /
58
+ * `flex`, then `create()`. The app — not the agent — asks the user whether to
59
+ * update that family (this project's placed copies move to the new version) or
60
+ * save a new family. Do not ask this yourself; report the returned `decision`.
27
61
  *
28
62
  * ## Read getReference() first
29
63
  *
@@ -70,6 +104,8 @@ export declare abstract class PluginDesignFamilyApi {
70
104
  * Read this before authoring a family for the first time in a session. The
71
105
  * DSL is a closed language — a guessed op or function is a rejected spec.
72
106
  *
107
+ * @param args Optional section, or its bare name. Omit for the core reference.
108
+ * Fetch architectural, networks or relations only when the family needs them.
73
109
  * @returns The reference text
74
110
  *
75
111
  * @examplePrompt How do I write a parametric family spec?
@@ -80,7 +116,53 @@ export declare abstract class PluginDesignFamilyApi {
80
116
  * const { reference } = await snaptrude.design.family.getReference()
81
117
  * ```
82
118
  */
83
- abstract getReference(): PluginApiReturn<PluginFamilyReference>;
119
+ abstract getReference(args?: PluginDesignFamilyGetReferenceArgs | PluginFamilyReferenceSection): PluginApiReturn<PluginFamilyReference>;
120
+ /**
121
+ * Worked example families to learn from: real, tested bundles by discipline
122
+ * (architecture, structure, MEP, furniture). With no `id`, returns the
123
+ * catalogue — each example's id, label, discipline and the patterns it
124
+ * teaches — filtered by `discipline` / `tag` when given. With an `id`,
125
+ * returns that example's full bundle. Fetch the one closest to the task
126
+ * before authoring and borrow its patterns; examples are patterns to
127
+ * combine, not templates to copy whole.
128
+ *
129
+ * @param args - `{ id }` for one bundle, or `{ discipline?, tag? }` to list
130
+ * @returns The catalogue, or one example with its bundle
131
+ *
132
+ * @examplePrompt Show me an example of a structural family
133
+ * @examplePrompt How is a hosted door family written?
134
+ *
135
+ * # Example
136
+ * ```ts
137
+ * const list = await snaptrude.design.family.getExamples({ discipline: "mep" })
138
+ * const ex = await snaptrude.design.family.getExamples({ id: list[0].id })
139
+ * ```
140
+ */
141
+ abstract getExamples(args?: PluginDesignFamilyGetExamplesArgs | string): PluginApiReturn<PluginFamilyExampleSummary[] | PluginFamilyExample>;
142
+ /**
143
+ * Get a validated starter recipe for a door or window, with an opening
144
+ * contract, host wall-thickness binding and role-named parts. Edit profiles,
145
+ * panels, glazing, hardware and materials while preserving the contract.
146
+ * Use `prepare` / `flex` to check the recipe, then `create` to save it and
147
+ * `design.create.door(familyId, hostWall, position, { version, values }, facing)`
148
+ * (or `window`) to place it. Edit the resulting ParametricComponent through
149
+ * `getParameters` / `setParameters`, not a separate opening API.
150
+ *
151
+ * `subType` defaults to `singleDoor` / `fixedWindow`. An unsupported subType
152
+ * returns the kind's default template, a note in `guidance`, and `available`
153
+ * templates. Start from the closest recipe and set `root.subType` to your token.
154
+ *
155
+ * @param args The opening kind and optional subtype token
156
+ * @returns The bundle, parameter-key contract, subtype, guidance and available templates
157
+ * @example
158
+ * const { bundle, contract } = await snaptrude.design.family.getTemplate({
159
+ * kind: "door", subType: "doubleDoor",
160
+ * })
161
+ * // Flex the authored width key, not an assumed parameter name (lengths in SU).
162
+ * await snaptrude.design.family.prepare({ bundle })
163
+ * await snaptrude.design.family.flex({ values: { [contract.width]: 4 } })
164
+ */
165
+ abstract getTemplate(args: PluginDesignFamilyGetTemplateArgs): PluginApiReturn<PluginFamilyTemplateResult>;
84
166
  /**
85
167
  * Validate, compile and preview a family spec. Nothing is committed to the
86
168
  * model or the library — call {@linkcode PluginDesignFamilyApi.place} to put
@@ -118,7 +200,8 @@ export declare abstract class PluginDesignFamilyApi {
118
200
  * buckets are the host's own diff of what the geometry did — flexing a
119
201
  * driving parameter and reporting them demonstrates the family is parametric.
120
202
  *
121
- * @param args The parameter values to change
203
+ * @param args The parameter values to change. Omit values (or pass an empty
204
+ * record) to report or photograph the current draft without rebuilding it.
122
205
  * @returns The new build plus the geometry delta
123
206
  *
124
207
  * @examplePrompt Change it to 6 bays
@@ -130,22 +213,44 @@ export declare abstract class PluginDesignFamilyApi {
130
213
  * console.log(`removed ${changed.removed}, rebuilt ${changed.rebuilt}`)
131
214
  * ```
132
215
  */
133
- abstract flex(args: PluginDesignFamilyFlexArgs): PluginApiReturn<PluginFamilyFlexResult>;
216
+ abstract flex(args?: PluginDesignFamilyFlexArgs): PluginApiReturn<PluginFamilyFlexResult>;
134
217
  /**
135
- * The prepared family's spec bundle, or `null` when nothing is prepared.
218
+ * A family's spec bundle: the prepared draft's, or — to CHANGE a saved
219
+ * family — that family's recipe, opened as the new draft.
220
+ *
221
+ * - No arguments: the prepared draft, or `null` when nothing is prepared.
222
+ * - `{ id, version? }`: open a saved family from the library (newest version
223
+ * when `version` is omitted).
224
+ * - `{ component }`: open the family (at its version) of that placed copy.
225
+ *
226
+ * Opening makes the recipe the current draft and returns `editing` — which
227
+ * saved family it is. Edit it with `prepare` / `flex`, then call `create`.
228
+ * On that save the APP shows the user its own window asking whether to
229
+ * update the family (every placed copy in this project moves to the new
230
+ * version) or save it as a new family — "new family" is the default. Never
231
+ * ask the user this yourself, and never promise either outcome: report what
232
+ * `create` returns.
136
233
  *
137
- * @returns The draft bundle, or `null`
234
+ * @param args Optional: which saved family to open
235
+ * @returns The bundle (plus `editing` when it edits a saved family), or `null`
236
+ *
237
+ * @examplePrompt Make the chairs I placed 50 mm wider
238
+ * @examplePrompt Change the Louvre Screen family so its blades are deeper
138
239
  *
139
240
  * # Example
140
241
  * ```ts
141
- * const bundle = await snaptrude.design.family.get()
242
+ * const draft = await snaptrude.design.family.get()
243
+ * const family = await snaptrude.design.family.get({ component })
244
+ * // family.editing → { familyId, version, name, library }
142
245
  * ```
143
246
  */
144
- abstract get(): PluginApiReturn<PluginFamilyBundle | null>;
247
+ abstract get(args?: PluginDesignFamilyGetArgs | string): PluginApiReturn<PluginFamilyGetResult | null>;
145
248
  /**
146
- * Every parametric family registered in this session — native and imported.
249
+ * Every available parametric family, merging the session registry and catalog.
147
250
  *
148
- * @returns One summary per family
251
+ * @param args Opt into compact lines for generic discovery. The default stays
252
+ * object-shaped so existing callers retain version, openingKind and subType.
253
+ * @returns Summary objects, or `id | label | category | kind` lines when compact.
149
254
  *
150
255
  * @examplePrompt What families are available?
151
256
  *
@@ -154,7 +259,30 @@ export declare abstract class PluginDesignFamilyApi {
154
259
  * const families = await snaptrude.design.family.list()
155
260
  * ```
156
261
  */
157
- abstract list(): PluginApiReturn<PluginFamilySummary[]>;
262
+ abstract list(args: PluginDesignFamilyListArgs & {
263
+ compact: true;
264
+ }): PluginApiReturn<string[]>;
265
+ abstract list(args?: PluginDesignFamilyListArgs & {
266
+ compact?: false;
267
+ }): PluginApiReturn<PluginFamilySummary[]>;
268
+ abstract list(args?: PluginDesignFamilyListArgs): PluginApiReturn<PluginFamilySummary[] | string[]>;
269
+ /**
270
+ * Read one saved catalog definition without opening a draft or placing geometry.
271
+ * Both id and version are required. The catalog checks access on every read.
272
+ * Length defaults and bounds are in mm, ready for network graph overrides;
273
+ * angle parameters retain degrees, identified by each parameter's unit.
274
+ * existing getParameters/place/setParameters continue to use Snaptrude units.
275
+ * Defaults include current catalog overrides, which can change without a new version.
276
+ * No scene, registry, history, or persistence state is changed.
277
+ * Missing/inaccessible pins and invalid recipes fail; no latest-version fallback.
278
+ * This metadata does not certify connectors or engineering compatibility.
279
+ *
280
+ * @param args Exact saved catalog id and version, from list()
281
+ * @returns Compact parameter metadata, not geometry or the recipe bundle
282
+ * @example
283
+ * const definition = await snaptrude.design.family.getDefinition({ id, version })
284
+ */
285
+ abstract getDefinition(args: PluginDesignFamilyGetDefinitionArgs): PluginApiReturn<PluginFamilyDefinition>;
158
286
  /**
159
287
  * Put a family into the model — either the prepared draft or any family from
160
288
  * {@linkcode PluginDesignFamilyApi.list}.
@@ -177,6 +305,13 @@ export declare abstract class PluginDesignFamilyApi {
177
305
  * To COPY a placed component, place its family again at the new position with
178
306
  * the same `values` — there is no separate copy call.
179
307
  *
308
+ * HOSTED families (doors, windows — anything with an `opening`, a `host`
309
+ * block, or a void with `cuts: "host"`) take `host`: a wall or a placed
310
+ * family. The family is set into the host's face nearest `position` (the
311
+ * host's middle when omitted), and the host is cut — a system wall by the
312
+ * wall cutter, a family by its own recipe. Host-bound parameters then follow
313
+ * the host (a door's wall thickness follows the wall).
314
+ *
180
315
  * @param args Which family, where, and at what parameter values
181
316
  * @returns What was placed; `component` is present only in positioned mode
182
317
  *
@@ -194,8 +329,14 @@ export declare abstract class PluginDesignFamilyApi {
194
329
  * })
195
330
  * await snaptrude.design.transform.move([component], { x: 2, y: 0, z: 0 })
196
331
  *
332
+ * // on the first floor — position.y is an offset above storey 2's base
333
+ * await snaptrude.design.family.place({ id: familyId, position: { x: 4, y: 0, z: 0 }, storey: 2 })
334
+ *
197
335
  * // interactive — the user clicks
198
336
  * await snaptrude.design.family.place()
337
+ *
338
+ * // hosted — a door in a wall, near a point along it
339
+ * await snaptrude.design.family.place({ id: doorId, host: wall, position: { x: 3, y: 0, z: 0 } })
199
340
  * ```
200
341
  */
201
342
  abstract place(args?: PluginDesignFamilyPlaceArgs): PluginApiReturn<PluginFamilyPlaceResult>;
@@ -232,6 +373,34 @@ export declare abstract class PluginDesignFamilyApi {
232
373
  * that does not is accepted and stored (it round-trips to Revit) but nothing
233
374
  * visible happens — say so rather than claiming a change the user cannot see.
234
375
  *
376
+ * NESTED children: `children: { "<path>": { key: value } }` sets a nested
377
+ * child's own values (every copy of it). A value its parent sets is sent up
378
+ * to what it follows when that is a plain relationship; otherwise it is
379
+ * refused with what to change instead (see `refused`).
380
+ *
381
+ * LINKS: `links: { key: { from, expr } }` makes this family's `key` follow
382
+ * another placed object — `from` is a family (it reports its parameters and
383
+ * outputs) or a wall (it reports thickness, length, height); `expr` is an
384
+ * expression over those reports. `null` removes a link. Links that would
385
+ * make objects follow each other in a loop are refused. Values accept unit
386
+ * literals ("600mm").
387
+ *
388
+ * RELATIONS: `relations: { add: [...], remove: ["r1"] }` sets how the family
389
+ * sits against other placed objects or cuts its host:
390
+ * - `attach` — `{ kind: "attach", side: "base" | "top", to: <object> | { level, face? }, offset? }`:
391
+ * sits on a surface, or its top reaches one (reports `reach`, `gap`, `surface`).
392
+ * - `join` — `{ kind: "join", end, to: <family>, toEnd, bindOther? }`: its end moves onto
393
+ * the other's end (reports `angle`, `absAngle`, `mitre`).
394
+ * - `span` — `{ kind: "span", from, to, at? }`: pinned between two objects, running along
395
+ * its +X (reports `distance`, `run`, `rise`, `slope`, `from.*`, `to.*`).
396
+ * - `path` — `{ kind: "path", from? | points, closed? }`: follows a wall's centreline, a
397
+ * family's run or given points (reports `length`; the recipe reads the path).
398
+ * - `cut` — `{ kind: "cut", to: "host" }`: applies recipe voids to the current host.
399
+ * Removing it closes the opening without detaching or deleting the family.
400
+ * Door/window placement adds it. Hosting alone does not cut. No parameter binds.
401
+ * Placement relations take `bind: { <param>: "<expression over its reports>" }`; bound
402
+ * parameters are read-only. A relation with an existing `id` replaces it.
403
+ *
235
404
  * `length` values are Snaptrude units: the same 254 mm unit as the kernel's
236
405
  * internal (`"babylon"`) unit — convert the user's number with
237
406
  * `core.units.convert` first; a bare `400` is 400 SU, not 400 mm. Kernel part
@@ -246,18 +415,39 @@ export declare abstract class PluginDesignFamilyApi {
246
415
  * # Example
247
416
  * ```ts
248
417
  * await snaptrude.design.family.setParameters({ component, values: { seats: 8 } })
418
+ * await snaptrude.design.family.setParameters({ component, children: { chair: { width: "380mm" } } })
419
+ * await snaptrude.design.family.setParameters({
420
+ * component: railing,
421
+ * links: { steps: { from: stair, expr: "steps" }, side: { from: stair, expr: "width - 40mm" } },
422
+ * })
423
+ * await snaptrude.design.family.setParameters({
424
+ * component: post,
425
+ * relations: { add: [{ kind: "attach", side: "top", to: slab, bind: { height: "reach" } }] },
426
+ * })
249
427
  * ```
250
428
  */
251
429
  abstract setParameters(args: PluginDesignFamilySetParametersArgs): PluginApiReturn<PluginFamilyInstanceParameters>;
252
430
  /**
253
431
  * Save the prepared bundle to the library — the user's personal library
254
432
  * unless `teamId` is given. {@linkcode PluginDesignFamilyApi.place} already
255
- * saves, so `create` is for sharing with a team. When nothing of the family is
256
- * in the model yet, one instance is also dropped at the centre of the current
257
- * view on the active storey (`placed: true`), so a save is never invisible.
433
+ * saves generic components. Hosted doors/windows save without placement;
434
+ * they need a wall and position through `design.create.door` / `design.create.window`.
435
+ * For a non-hosted family with no placed instance, saving also drops one
436
+ * standalone sample at the current view centre on the active storey
437
+ * (`placed: true`). This includes architectural families: the sample does
438
+ * not assign a family to a native host.
439
+ *
440
+ * When the draft edits a saved family (opened with `get({ id })` /
441
+ * `get({ component })`), or its name is already taken in that library, the
442
+ * APP asks the user in its own window whether to save a new version of that
443
+ * family — every placed copy in this project moves to it, and families
444
+ * nesting it may be offered theirs — or a new family ("new family" is the
445
+ * default). The agent never asks this itself and cannot answer the window.
446
+ * `decision` reports what the user chose; `"cancelled"` means nothing was
447
+ * saved (`ok: false`) and nothing will auto-save until `create` is called again.
258
448
  *
259
449
  * @param args Optional library name and team scope
260
- * @returns The catalogued definition's id and version
450
+ * @returns The catalogued definition's id and version, and what the user chose
261
451
  *
262
452
  * @examplePrompt Save this as a family called Vertical Louvre
263
453
  * @examplePrompt Add it to my library
@@ -290,7 +480,42 @@ export declare abstract class PluginDesignFamilyApi {
290
480
  * await snaptrude.design.family.delete({ id: "revit:steel-bollard~bef047", instances: true })
291
481
  * ```
292
482
  */
293
- abstract delete(args?: PluginDesignFamilyDeleteArgs): PluginApiReturn<PluginFamilyDeleteResult>;
483
+ abstract delete(args?: PluginDesignFamilyDeleteArgs | string): PluginApiReturn<PluginFamilyDeleteResult>;
484
+ }
485
+ /** Optional reference sections keep unrelated grammar out of the core response. */
486
+ export declare const PluginFamilyReferenceSection: z.ZodEnum<{
487
+ architectural: "architectural";
488
+ networks: "networks";
489
+ relations: "relations";
490
+ }>;
491
+ export type PluginFamilyReferenceSection = z.infer<typeof PluginFamilyReferenceSection>;
492
+ /** Omit section for the core grammar, workflow and example catalogue. */
493
+ export declare const PluginDesignFamilyGetReferenceArgs: z.ZodObject<{
494
+ section: z.ZodOptional<z.ZodEnum<{
495
+ architectural: "architectural";
496
+ networks: "networks";
497
+ relations: "relations";
498
+ }>>;
499
+ }, z.core.$strip>;
500
+ export type PluginDesignFamilyGetReferenceArgs = z.infer<typeof PluginDesignFamilyGetReferenceArgs>;
501
+ /** Compact output is opt-in: existing object consumers must retain their metadata. */
502
+ export declare const PluginDesignFamilyListArgs: z.ZodObject<{
503
+ compact: z.ZodOptional<z.ZodBoolean>;
504
+ }, z.core.$strip>;
505
+ export type PluginDesignFamilyListArgs = z.infer<typeof PluginDesignFamilyListArgs>;
506
+ /** One worked example in the catalogue returned by `getExamples`. */
507
+ export interface PluginFamilyExampleSummary {
508
+ id: string;
509
+ label: string;
510
+ discipline: "architecture" | "structure" | "mep" | "furniture";
511
+ /** The patterns it demonstrates, e.g. "nesting", "slot", "path", "union", "trim". */
512
+ teaches: string[];
513
+ /** Size of the bundle as compact JSON, kilobytes — what fetching it costs. */
514
+ sizeKB: number;
515
+ }
516
+ /** One worked example with its full bundle, from `getExamples({ id })`. */
517
+ export interface PluginFamilyExample extends PluginFamilyExampleSummary {
518
+ bundle: PluginFamilyBundle;
294
519
  }
295
520
  /** The family-spec DSL reference returned by `getReference`. */
296
521
  export interface PluginFamilyReference {
@@ -309,6 +534,31 @@ export interface PluginFamilyReference {
309
534
  export interface PluginFamilyBundle {
310
535
  root: Record<string, unknown>;
311
536
  deps?: Record<string, Record<string, unknown>>;
537
+ /** Connector metadata saved with the recipe; network placement evaluates these expressions. */
538
+ network?: NetworkFamilyContract;
539
+ }
540
+ /** Which saved family a draft edits. */
541
+ export interface PluginFamilyEditing {
542
+ /** Library id of the family being edited. */
543
+ familyId: string;
544
+ /** The version that was opened. */
545
+ version: number;
546
+ /** Its library name — an update saves under this name. */
547
+ name: string;
548
+ /** "your library", or the team library's name. */
549
+ library: string;
550
+ }
551
+ /** What `get` returns: the bundle, plus `editing` when the draft edits a saved family. */
552
+ export interface PluginFamilyGetResult extends PluginFamilyBundle {
553
+ editing?: PluginFamilyEditing;
554
+ }
555
+ /** A family at a version, as `create` reports parents it did or did not update. */
556
+ export interface PluginFamilyVersionRef {
557
+ id: string;
558
+ name: string;
559
+ version: number;
560
+ /** Set when the user chose to update it but the update failed. */
561
+ error?: string;
312
562
  }
313
563
  /** Axis-aligned extents of a built family. Snaptrude units (1 SU = 254 mm), +Y up. */
314
564
  export interface PluginFamilyBBox {
@@ -342,7 +592,11 @@ export interface PluginFamilyParameter {
342
592
  export interface PluginFamilyDiagnostic {
343
593
  /** JSON pointer, e.g. `"/root/geometry/2/body/0/w"`. */
344
594
  path: string;
345
- code: "schema" | "bad-expression" | "unknown-name" | "unknown-def" | "cycle" | "duplicate-name" | "unbounded-repeat" | "depth" | "bad-dimension" | "proportion";
595
+ code: "schema" | "bad-expression" | "unknown-name" | "unknown-def" | "cycle" | "duplicate-name" | "unbounded-repeat" | "depth" | "bad-dimension" | "proportion"
596
+ /** A part the geometry kernel could not build exactly; drawn approximately. */
597
+ | "kernel-fallback"
598
+ /** A part whose hole loop crosses its outline. */
599
+ | "profile-hole";
346
600
  message: string;
347
601
  hint?: string;
348
602
  }
@@ -422,6 +676,13 @@ export interface PluginFamilySummary {
422
676
  version: number;
423
677
  label: string;
424
678
  category?: string;
679
+ /** The category's type token (`root.subType`), e.g. singleDoor or casementDouble. */
680
+ subType?: string;
681
+ /**
682
+ * Opening contract kind, distinct from provenance (`kind`). Place with the
683
+ * positional `design.create.door` / `window` API and edit via family parameters.
684
+ */
685
+ openingKind?: "door" | "window";
425
686
  /** Number of rows on the family's parameter sheet. */
426
687
  parameters: number;
427
688
  /**
@@ -437,6 +698,93 @@ export interface PluginFamilySummary {
437
698
  */
438
699
  kind: "native" | "revit";
439
700
  }
701
+ /** Exact catalog pin. Unsaved session definitions are not catalog inventory. */
702
+ export declare const PluginDesignFamilyGetDefinitionArgs: z.ZodObject<{
703
+ id: z.ZodString;
704
+ version: z.ZodNumber;
705
+ }, z.core.$strip>;
706
+ export type PluginDesignFamilyGetDefinitionArgs = z.infer<typeof PluginDesignFamilyGetDefinitionArgs>;
707
+ /** Saved-family metadata. Physical lengths use mm; angle entries retain degrees. */
708
+ export declare const PluginFamilyDefinitionParameter: z.ZodObject<{
709
+ key: z.ZodString;
710
+ label: z.ZodString;
711
+ type: z.ZodEnum<{
712
+ boolean: "boolean";
713
+ enum: "enum";
714
+ length: "length";
715
+ text: "text";
716
+ integer: "integer";
717
+ }>;
718
+ unit: z.ZodOptional<z.ZodEnum<{
719
+ mm: "mm";
720
+ degrees: "degrees";
721
+ }>>;
722
+ default: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
723
+ min: z.ZodOptional<z.ZodNumber>;
724
+ max: z.ZodOptional<z.ZodNumber>;
725
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
726
+ drivesGeometry: z.ZodBoolean;
727
+ readOnly: z.ZodBoolean;
728
+ formulaDriven: z.ZodBoolean;
729
+ isInstance: z.ZodBoolean;
730
+ }, z.core.$strip>;
731
+ export type PluginFamilyDefinitionParameter = z.infer<typeof PluginFamilyDefinitionParameter>;
732
+ /** Read-only catalog inventory. Boolean defaults retain the family DSL's Yes/No strings. */
733
+ export declare const PluginFamilyDefinition: z.ZodObject<{
734
+ id: z.ZodString;
735
+ version: z.ZodNumber;
736
+ label: z.ZodString;
737
+ category: z.ZodOptional<z.ZodString>;
738
+ lengthUnit: z.ZodLiteral<"mm">;
739
+ parameters: z.ZodArray<z.ZodObject<{
740
+ key: z.ZodString;
741
+ label: z.ZodString;
742
+ type: z.ZodEnum<{
743
+ boolean: "boolean";
744
+ enum: "enum";
745
+ length: "length";
746
+ text: "text";
747
+ integer: "integer";
748
+ }>;
749
+ unit: z.ZodOptional<z.ZodEnum<{
750
+ mm: "mm";
751
+ degrees: "degrees";
752
+ }>>;
753
+ default: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
754
+ min: z.ZodOptional<z.ZodNumber>;
755
+ max: z.ZodOptional<z.ZodNumber>;
756
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
757
+ drivesGeometry: z.ZodBoolean;
758
+ readOnly: z.ZodBoolean;
759
+ formulaDriven: z.ZodBoolean;
760
+ isInstance: z.ZodBoolean;
761
+ }, z.core.$strip>>;
762
+ network: z.ZodOptional<z.ZodObject<{
763
+ schemaVersion: z.ZodLiteral<1>;
764
+ role: z.ZodEnum<{
765
+ pipe: "pipe";
766
+ duct: "duct";
767
+ wire: "wire";
768
+ cable: "cable";
769
+ conduit: "conduit";
770
+ cableDuct: "cableDuct";
771
+ cableTray: "cableTray";
772
+ connector: "connector";
773
+ equipment: "equipment";
774
+ }>;
775
+ lengthParameter: z.ZodOptional<z.ZodString>;
776
+ ports: z.ZodArray<z.ZodObject<{
777
+ id: z.ZodString;
778
+ position: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
779
+ direction: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
780
+ size: z.ZodString;
781
+ height: z.ZodOptional<z.ZodString>;
782
+ widthDirection: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
783
+ systems: z.ZodArray<z.ZodString>;
784
+ }, z.core.$strict>>;
785
+ }, z.core.$strict>>;
786
+ }, z.core.$strip>;
787
+ export type PluginFamilyDefinition = z.infer<typeof PluginFamilyDefinition>;
440
788
  /** What `place` reports. */
441
789
  export interface PluginFamilyPlaceResult {
442
790
  ok: boolean;
@@ -464,6 +812,108 @@ export interface PluginFamilyInstanceParameters {
464
812
  parts?: PluginFamilyPart[];
465
813
  /** Present when `getParameters` was asked for a `snapshot`. */
466
814
  snapshot?: PluginFamilySnapshot;
815
+ /** The family's `outputs`, as last built. */
816
+ reports?: Record<string, number | string>;
817
+ /** Every declared nested child, as last built. */
818
+ children?: PluginFamilyNestedChild[];
819
+ /** Parameters that follow another object (links) or the host. */
820
+ follows?: PluginFamilyFollow[];
821
+ /** Where a hosted family sits: a system wall, or a family by id. */
822
+ host?: ({
823
+ kind: "wall";
824
+ } | {
825
+ kind: "family";
826
+ id: string;
827
+ }) & {
828
+ /** True when the host no longer has room for it: it is out of the model until it fits again. */
829
+ parked?: boolean;
830
+ };
831
+ /** Guests hosted in THIS family that no longer fit it (parked); they return when they fit. */
832
+ parkedGuests?: {
833
+ id: string;
834
+ family: string;
835
+ }[];
836
+ /** How it sits against other placed objects (attach, join, span, path), with current reports. */
837
+ relations?: PluginFamilyRelation[];
838
+ /** setParameters only: the edits refused, each with what to change instead. */
839
+ refused?: string[];
840
+ }
841
+ /** A nested child of a placed family. */
842
+ export interface PluginFamilyNestedChild {
843
+ /** "chair", or "chair/cushion" for a child of a child — the key for `children` edits. */
844
+ path: string;
845
+ label: string;
846
+ /** The family it is now (a slot's current pick). */
847
+ family: string;
848
+ familyLabel: string;
849
+ /** How many copies the parent places. */
850
+ copies: number;
851
+ slot?: {
852
+ expr: string;
853
+ options: string[];
854
+ };
855
+ values: Record<string, number | string>;
856
+ /** Values the parent sets, with the expression it sets them by. */
857
+ setBy: Record<string, string | undefined>;
858
+ reports: Record<string, number | string>;
859
+ }
860
+ /** A placed relation as stored, plus what it measures now. */
861
+ export type PluginFamilyRelation = PluginFamilyRelationInput & {
862
+ id: string;
863
+ /** "Attached to", "Joins", "Spans between", "Along a path", "Cuts host". */
864
+ label: string;
865
+ summary: string;
866
+ /** False when a target is gone: the family stayed where it was. */
867
+ live: boolean;
868
+ reports: Record<string, number | string>;
869
+ };
870
+ /** One relation to add (`relations.add`). Targets are handles, except a cut's symbolic "host". */
871
+ export type PluginFamilyRelationInput = {
872
+ /** Replaces the relation with this id; a new one gets "r1", "r2"… */
873
+ id?: string;
874
+ /** This family's parameter → an expression over the relation's reports and own parameters. */
875
+ bind?: Record<string, string>;
876
+ } & ({
877
+ kind: "attach";
878
+ side: "base" | "top";
879
+ to: ComponentHandle | {
880
+ level: number;
881
+ face?: "base" | "top";
882
+ };
883
+ offset?: number;
884
+ } | {
885
+ kind: "join";
886
+ end: "start" | "end";
887
+ to: ComponentHandle;
888
+ toEnd: "start" | "end";
889
+ /** The other family's parameters, over the same reports. */
890
+ bindOther?: Record<string, string>;
891
+ } | {
892
+ kind: "span";
893
+ from: ComponentHandle;
894
+ to: ComponentHandle;
895
+ at?: "top" | "centre" | "base";
896
+ } | {
897
+ kind: "path";
898
+ from?: ComponentHandle;
899
+ points?: [number, number, number][];
900
+ closed?: boolean;
901
+ } | {
902
+ /** Apply recipe voids to the existing host without adding another host ID. */
903
+ kind: "cut";
904
+ to: "host";
905
+ bind?: never;
906
+ });
907
+ /** One parameter that follows something else. */
908
+ export interface PluginFamilyFollow {
909
+ key: string;
910
+ /** "relation": set by a placed relation — `from` is the relation's id. */
911
+ kind: "link" | "host" | "relation";
912
+ /** The source's id. */
913
+ from: string;
914
+ fromLabel: string;
915
+ /** The expression over the source's reports (for a host: the report name). */
916
+ expr: string;
467
917
  }
468
918
  /** What `create` reports. */
469
919
  export interface PluginFamilyCreateResult {
@@ -475,6 +925,36 @@ export interface PluginFamilyCreateResult {
475
925
  placed?: boolean;
476
926
  /** Host guidance for the caller, e.g. that an instance was placed at the view centre. */
477
927
  hint?: string;
928
+ /**
929
+ * What the user chose in the app's window: `"version"` (a new version of
930
+ * the saved family), `"new"` (a new family), `"cancelled"` (nothing saved).
931
+ * `"saved"` = no question was needed.
932
+ */
933
+ decision?: "version" | "new" | "cancelled" | "saved";
934
+ /** The library name it was saved under. */
935
+ name?: string;
936
+ /** Placed copies in this project moved to the new version (the family's and updated parents'). */
937
+ movedCopies?: number;
938
+ /** What the moved copies lost because the new version no longer has it. */
939
+ dropped?: {
940
+ values: Array<{
941
+ copy: string;
942
+ key: string;
943
+ }>;
944
+ childValues: Array<{
945
+ copy: string;
946
+ path: string;
947
+ }>;
948
+ follows: Array<{
949
+ copy: string;
950
+ key: string;
951
+ kind: "link" | "relation";
952
+ }>;
953
+ };
954
+ /** Families nesting this one that the user chose to update, at their new versions. */
955
+ parentsUpdated?: PluginFamilyVersionRef[];
956
+ /** Families nesting this one that keep their version. */
957
+ parentsKept?: PluginFamilyVersionRef[];
478
958
  error?: string;
479
959
  }
480
960
  /** What `delete` reports. */
@@ -497,6 +977,30 @@ export interface PluginFamilyDeleteResult {
497
977
  export declare const PluginFamilyBundleSchema: z.ZodObject<{
498
978
  root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
499
979
  deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
980
+ network: z.ZodOptional<z.ZodObject<{
981
+ schemaVersion: z.ZodLiteral<1>;
982
+ role: z.ZodEnum<{
983
+ pipe: "pipe";
984
+ duct: "duct";
985
+ wire: "wire";
986
+ cable: "cable";
987
+ conduit: "conduit";
988
+ cableDuct: "cableDuct";
989
+ cableTray: "cableTray";
990
+ connector: "connector";
991
+ equipment: "equipment";
992
+ }>;
993
+ lengthParameter: z.ZodOptional<z.ZodString>;
994
+ ports: z.ZodArray<z.ZodObject<{
995
+ id: z.ZodString;
996
+ position: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
997
+ direction: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
998
+ size: z.ZodString;
999
+ height: z.ZodOptional<z.ZodString>;
1000
+ widthDirection: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
1001
+ systems: z.ZodArray<z.ZodString>;
1002
+ }, z.core.$strict>>;
1003
+ }, z.core.$strict>>;
500
1004
  }, z.core.$strip>;
501
1005
  /**
502
1006
  * Arguments for {@linkcode PluginDesignFamilyApi.prepare}.
@@ -517,7 +1021,42 @@ export declare const PluginFamilyBundleSchema: z.ZodObject<{
517
1021
  * the viewport is not moved — and comes back as a PNG data URL in the result's
518
1022
  * `snapshot.image`. Through the agent's `run_worker`, return the result and the
519
1023
  * image reaches the model as an image.
1024
+ *
1025
+ * `focus` makes it a close-up: `{ parts: ["seat", "back", "slat@*"] }` frames
1026
+ * the joint where those groups meet (`*` matches any run of characters;
1027
+ * nested names are `a/b`), or their full bounds if they do not meet. A margin
1028
+ * of a quarter of their size (at least 50 mm) surrounds the joint.
1029
+ * `{ box: { min, max } }` frames a region in family space
1030
+ * (Snaptrude units, +Y up). Every other part is still drawn; the dimension line
1031
+ * then gives the framed region and the result says `closeUp: true`. A part
1032
+ * name that matches nothing fails the snapshot with a list of real names.
520
1033
  */
1034
+ export declare const PluginFamilySnapshotFocus: z.ZodUnion<readonly [z.ZodObject<{
1035
+ parts: z.ZodArray<z.ZodString>;
1036
+ }, z.core.$strip>, z.ZodObject<{
1037
+ box: z.ZodObject<{
1038
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1039
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1040
+ }, z.core.$strip>;
1041
+ }, z.core.$strip>]>;
1042
+ export type PluginFamilySnapshotFocus = z.infer<typeof PluginFamilySnapshotFocus>;
1043
+ /** One close-up tile; omission of view uses the sheet's first view. */
1044
+ export declare const PluginFamilySnapshotCloseUp: z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
1045
+ parts: z.ZodArray<z.ZodString>;
1046
+ }, z.core.$strip>, z.ZodObject<{
1047
+ box: z.ZodObject<{
1048
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1049
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1050
+ }, z.core.$strip>;
1051
+ }, z.core.$strip>]>, z.ZodObject<{
1052
+ view: z.ZodOptional<z.ZodEnum<{
1053
+ top: "top";
1054
+ front: "front";
1055
+ right: "right";
1056
+ iso: "iso";
1057
+ }>>;
1058
+ }, z.core.$strip>>;
1059
+ export type PluginFamilySnapshotCloseUp = z.infer<typeof PluginFamilySnapshotCloseUp>;
521
1060
  export declare const PluginFamilySnapshotOption: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
522
1061
  views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
523
1062
  top: "top";
@@ -526,6 +1065,28 @@ export declare const PluginFamilySnapshotOption: z.ZodUnion<readonly [z.ZodBoole
526
1065
  iso: "iso";
527
1066
  }>>>;
528
1067
  tileSize: z.ZodOptional<z.ZodNumber>;
1068
+ focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
1069
+ parts: z.ZodArray<z.ZodString>;
1070
+ }, z.core.$strip>, z.ZodObject<{
1071
+ box: z.ZodObject<{
1072
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1073
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1074
+ }, z.core.$strip>;
1075
+ }, z.core.$strip>]>, z.ZodArray<z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
1076
+ parts: z.ZodArray<z.ZodString>;
1077
+ }, z.core.$strip>, z.ZodObject<{
1078
+ box: z.ZodObject<{
1079
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1080
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1081
+ }, z.core.$strip>;
1082
+ }, z.core.$strip>]>, z.ZodObject<{
1083
+ view: z.ZodOptional<z.ZodEnum<{
1084
+ top: "top";
1085
+ front: "front";
1086
+ right: "right";
1087
+ iso: "iso";
1088
+ }>>;
1089
+ }, z.core.$strip>>>]>>;
529
1090
  }, z.core.$strip>]>;
530
1091
  export type PluginFamilySnapshotOption = z.infer<typeof PluginFamilySnapshotOption>;
531
1092
  /** The picture block on prepare / flex / getParameters results when `snapshot` was asked for. */
@@ -534,9 +1095,18 @@ export interface PluginFamilySnapshot {
534
1095
  /** PNG data URL of the composed sheet. */
535
1096
  image?: string;
536
1097
  views?: ("iso" | "front" | "right" | "top")[];
537
- /** [width, height, depth] in Snaptrude units. */
1098
+ /** [width, height, depth] in SU. For a close-up list, this remains the whole family's size. */
538
1099
  size?: [number, number, number];
539
1100
  ms?: number;
1101
+ /** True when the sheet is a close-up (`focus`), not the whole family. */
1102
+ closeUp?: boolean;
1103
+ /** Per-tile results for a focus list. One invalid target does not discard other tiles. */
1104
+ closeUps?: Array<{
1105
+ view: "iso" | "front" | "right" | "top";
1106
+ label: string;
1107
+ size?: [number, number, number];
1108
+ error?: string;
1109
+ }>;
540
1110
  /** Set when the picture could not be taken (e.g. the legacy renderer); the call itself still succeeded. */
541
1111
  error?: string;
542
1112
  }
@@ -544,10 +1114,58 @@ export declare const PluginDesignFamilyPrepareArgs: z.ZodObject<{
544
1114
  bundle: z.ZodOptional<z.ZodObject<{
545
1115
  root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
546
1116
  deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1117
+ network: z.ZodOptional<z.ZodObject<{
1118
+ schemaVersion: z.ZodLiteral<1>;
1119
+ role: z.ZodEnum<{
1120
+ pipe: "pipe";
1121
+ duct: "duct";
1122
+ wire: "wire";
1123
+ cable: "cable";
1124
+ conduit: "conduit";
1125
+ cableDuct: "cableDuct";
1126
+ cableTray: "cableTray";
1127
+ connector: "connector";
1128
+ equipment: "equipment";
1129
+ }>;
1130
+ lengthParameter: z.ZodOptional<z.ZodString>;
1131
+ ports: z.ZodArray<z.ZodObject<{
1132
+ id: z.ZodString;
1133
+ position: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
1134
+ direction: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
1135
+ size: z.ZodString;
1136
+ height: z.ZodOptional<z.ZodString>;
1137
+ widthDirection: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
1138
+ systems: z.ZodArray<z.ZodString>;
1139
+ }, z.core.$strict>>;
1140
+ }, z.core.$strict>>;
547
1141
  }, z.core.$strip>>;
548
1142
  spec: z.ZodOptional<z.ZodObject<{
549
1143
  root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
550
1144
  deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1145
+ network: z.ZodOptional<z.ZodObject<{
1146
+ schemaVersion: z.ZodLiteral<1>;
1147
+ role: z.ZodEnum<{
1148
+ pipe: "pipe";
1149
+ duct: "duct";
1150
+ wire: "wire";
1151
+ cable: "cable";
1152
+ conduit: "conduit";
1153
+ cableDuct: "cableDuct";
1154
+ cableTray: "cableTray";
1155
+ connector: "connector";
1156
+ equipment: "equipment";
1157
+ }>;
1158
+ lengthParameter: z.ZodOptional<z.ZodString>;
1159
+ ports: z.ZodArray<z.ZodObject<{
1160
+ id: z.ZodString;
1161
+ position: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
1162
+ direction: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
1163
+ size: z.ZodString;
1164
+ height: z.ZodOptional<z.ZodString>;
1165
+ widthDirection: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
1166
+ systems: z.ZodArray<z.ZodString>;
1167
+ }, z.core.$strict>>;
1168
+ }, z.core.$strict>>;
551
1169
  }, z.core.$strip>>;
552
1170
  snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
553
1171
  views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -557,6 +1175,28 @@ export declare const PluginDesignFamilyPrepareArgs: z.ZodObject<{
557
1175
  iso: "iso";
558
1176
  }>>>;
559
1177
  tileSize: z.ZodOptional<z.ZodNumber>;
1178
+ focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
1179
+ parts: z.ZodArray<z.ZodString>;
1180
+ }, z.core.$strip>, z.ZodObject<{
1181
+ box: z.ZodObject<{
1182
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1183
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1184
+ }, z.core.$strip>;
1185
+ }, z.core.$strip>]>, z.ZodArray<z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
1186
+ parts: z.ZodArray<z.ZodString>;
1187
+ }, z.core.$strip>, z.ZodObject<{
1188
+ box: z.ZodObject<{
1189
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1190
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1191
+ }, z.core.$strip>;
1192
+ }, z.core.$strip>]>, z.ZodObject<{
1193
+ view: z.ZodOptional<z.ZodEnum<{
1194
+ top: "top";
1195
+ front: "front";
1196
+ right: "right";
1197
+ iso: "iso";
1198
+ }>>;
1199
+ }, z.core.$strip>>>]>>;
560
1200
  }, z.core.$strip>]>>;
561
1201
  }, z.core.$strip>;
562
1202
  export type PluginDesignFamilyPrepareArgs = z.infer<typeof PluginDesignFamilyPrepareArgs>;
@@ -565,11 +1205,11 @@ export type PluginDesignFamilyPrepareArgs = z.infer<typeof PluginDesignFamilyPre
565
1205
  *
566
1206
  * | Property | Type | Description |
567
1207
  * |---|---|---|
568
- * | `values` | `Record<string, number \| string>` | Parameter values to change (partial) |
1208
+ * | `values` | `Record<string, number \| string>` | Optional sparse changes; omission does not rebuild |
569
1209
  * | `snapshot` | {@linkcode PluginFamilySnapshotOption} | Also return a picture of the flexed family |
570
1210
  */
571
1211
  export declare const PluginDesignFamilyFlexArgs: z.ZodObject<{
572
- values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
1212
+ values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
573
1213
  snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
574
1214
  views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
575
1215
  top: "top";
@@ -578,9 +1218,110 @@ export declare const PluginDesignFamilyFlexArgs: z.ZodObject<{
578
1218
  iso: "iso";
579
1219
  }>>>;
580
1220
  tileSize: z.ZodOptional<z.ZodNumber>;
1221
+ focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
1222
+ parts: z.ZodArray<z.ZodString>;
1223
+ }, z.core.$strip>, z.ZodObject<{
1224
+ box: z.ZodObject<{
1225
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1226
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1227
+ }, z.core.$strip>;
1228
+ }, z.core.$strip>]>, z.ZodArray<z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
1229
+ parts: z.ZodArray<z.ZodString>;
1230
+ }, z.core.$strip>, z.ZodObject<{
1231
+ box: z.ZodObject<{
1232
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1233
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1234
+ }, z.core.$strip>;
1235
+ }, z.core.$strip>]>, z.ZodObject<{
1236
+ view: z.ZodOptional<z.ZodEnum<{
1237
+ top: "top";
1238
+ front: "front";
1239
+ right: "right";
1240
+ iso: "iso";
1241
+ }>>;
1242
+ }, z.core.$strip>>>]>>;
581
1243
  }, z.core.$strip>]>>;
582
1244
  }, z.core.$strip>;
583
1245
  export type PluginDesignFamilyFlexArgs = z.infer<typeof PluginDesignFamilyFlexArgs>;
1246
+ /**
1247
+ * Arguments for {@linkcode PluginDesignFamilyApi.get}. All optional — no
1248
+ * arguments returns the prepared draft.
1249
+ *
1250
+ * | Property | Type | Description |
1251
+ * |---|---|---|
1252
+ * | `id` | `string` | A saved family to open for editing, from {@linkcode PluginDesignFamilyApi.list} |
1253
+ * | `version` | `number` | Exact version to open; defaults to the newest |
1254
+ * | `component` | {@linkcode ComponentHandle} | Open the family of this placed copy, at its version |
1255
+ */
1256
+ export declare const PluginDesignFamilyGetArgs: z.ZodObject<{
1257
+ id: z.ZodOptional<z.ZodString>;
1258
+ version: z.ZodOptional<z.ZodNumber>;
1259
+ component: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
1260
+ }, z.core.$strip>;
1261
+ export type PluginDesignFamilyGetArgs = z.infer<typeof PluginDesignFamilyGetArgs>;
1262
+ /**
1263
+ * Arguments for {@linkcode PluginDesignFamilyApi.getExamples}.
1264
+ *
1265
+ * | Property | Type | Description |
1266
+ * |---|---|---|
1267
+ * | `id` | `string` | One example's id — returns its bundle |
1268
+ * | `discipline` | `string` | List only this discipline: architecture, structure, mep, furniture |
1269
+ * | `tag` | `string` | List only examples teaching this pattern (e.g. "path", "union") |
1270
+ */
1271
+ export declare const PluginDesignFamilyGetExamplesArgs: z.ZodObject<{
1272
+ id: z.ZodOptional<z.ZodString>;
1273
+ discipline: z.ZodOptional<z.ZodEnum<{
1274
+ architecture: "architecture";
1275
+ structure: "structure";
1276
+ mep: "mep";
1277
+ furniture: "furniture";
1278
+ }>>;
1279
+ tag: z.ZodOptional<z.ZodString>;
1280
+ }, z.core.$strip>;
1281
+ export type PluginDesignFamilyGetExamplesArgs = z.infer<typeof PluginDesignFamilyGetExamplesArgs>;
1282
+ /**
1283
+ * Arguments for {@linkcode PluginDesignFamilyApi.getTemplate}.
1284
+ * `kind` selects the opening contract. `subType` is a nonempty type token;
1285
+ * omission selects singleDoor / fixedWindow. Unsupported tokens return the
1286
+ * default template with guidance rather than preventing custom subtype authoring.
1287
+ */
1288
+ export declare const PluginDesignFamilyGetTemplateArgs: z.ZodObject<{
1289
+ kind: z.ZodEnum<{
1290
+ door: "door";
1291
+ window: "window";
1292
+ }>;
1293
+ subType: z.ZodOptional<z.ZodString>;
1294
+ }, z.core.$strip>;
1295
+ export type PluginDesignFamilyGetTemplateArgs = z.infer<typeof PluginDesignFamilyGetTemplateArgs>;
1296
+ /**
1297
+ * Maps opening dimensions to authored length parameter KEYS, not values.
1298
+ * Width and height describe the wall hole; sill measures from the wall base
1299
+ * to the hole bottom (windows). Wall thickness follows the host wall.
1300
+ * The recipe and family parameter APIs use Snaptrude units (1 SU = 254 mm).
1301
+ */
1302
+ export interface PluginFamilyOpeningContract {
1303
+ kind: "door" | "window";
1304
+ width: string;
1305
+ height: string;
1306
+ sill?: string;
1307
+ wallThickness?: string;
1308
+ }
1309
+ /** Starter recipe metadata returned by `getTemplate`; instances are ParametricComponents. */
1310
+ export interface PluginFamilyTemplateResult {
1311
+ /** Validated recipe bundle: edit its style while preserving the contract. */
1312
+ bundle: PluginFamilyBundle;
1313
+ contract: PluginFamilyOpeningContract;
1314
+ /** Actual template subtype, including when an unsupported token used the default. */
1315
+ subType: string;
1316
+ /** Authoring rules and any note about an unsupported requested subtype. */
1317
+ guidance: string[];
1318
+ /** Available starter templates for the requested kind. */
1319
+ available: Array<{
1320
+ subType: string;
1321
+ label: string;
1322
+ teaches: string[];
1323
+ }>;
1324
+ }
584
1325
  /**
585
1326
  * Arguments for {@linkcode PluginDesignFamilyApi.create}.
586
1327
  *
@@ -614,22 +1355,23 @@ export type PluginDesignFamilyDeleteArgs = z.infer<typeof PluginDesignFamilyDele
614
1355
  * |---|---|---|
615
1356
  * | `id` | `string` | Family to place, from {@linkcode PluginDesignFamilyApi.list}. Omit to place the prepared draft |
616
1357
  * | `version` | `number` | Exact version; defaults to the newest known |
617
- * | `position` | `{ x, y, z }` | Place HERE, without user interaction. Omit to arm the cursor instead |
1358
+ * | `position` | `Vec3Handle` or `{ x, y, z }` | Place here in SU. Prefer a vec3 handle; coordinates remain for existing callers. Omit to arm the cursor |
618
1359
  * | `rotation` | `number` | Yaw in degrees about +Y. Only with `position` |
619
1360
  * | `values` | `Record<string, number \| string>` | Parameter values for THIS instance |
620
- * | `storey` | `number` | Storey to place on; defaults to the active one |
1361
+ * | `storey` | `number` | Target storey (integer: 1 ground, 2 first floor, -1 basement; must already exist). The family is lifted to that storey's base and `position.y` is an offset above it, like `design.create.walls`. Without it, `position` is absolute and the storey is derived from where the family's geometry sits. Ignored with `host`: a hosted family follows its host |
621
1362
  */
622
1363
  export declare const PluginDesignFamilyPlaceArgs: z.ZodObject<{
623
1364
  id: z.ZodOptional<z.ZodString>;
624
1365
  version: z.ZodOptional<z.ZodNumber>;
625
- position: z.ZodOptional<z.ZodObject<{
1366
+ position: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../..").Handle<"vec3">, string>>, z.ZodObject<{
626
1367
  x: z.ZodNumber;
627
1368
  y: z.ZodNumber;
628
1369
  z: z.ZodNumber;
629
- }, z.core.$strip>>;
1370
+ }, z.core.$strip>]>>;
630
1371
  rotation: z.ZodOptional<z.ZodNumber>;
631
1372
  values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
632
1373
  storey: z.ZodOptional<z.ZodNumber>;
1374
+ host: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
633
1375
  }, z.core.$strip>;
634
1376
  export type PluginDesignFamilyPlaceArgs = z.infer<typeof PluginDesignFamilyPlaceArgs>;
635
1377
  /**
@@ -649,6 +1391,28 @@ export declare const PluginDesignFamilyGetParametersArgs: z.ZodObject<{
649
1391
  iso: "iso";
650
1392
  }>>>;
651
1393
  tileSize: z.ZodOptional<z.ZodNumber>;
1394
+ focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
1395
+ parts: z.ZodArray<z.ZodString>;
1396
+ }, z.core.$strip>, z.ZodObject<{
1397
+ box: z.ZodObject<{
1398
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1399
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1400
+ }, z.core.$strip>;
1401
+ }, z.core.$strip>]>, z.ZodArray<z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
1402
+ parts: z.ZodArray<z.ZodString>;
1403
+ }, z.core.$strip>, z.ZodObject<{
1404
+ box: z.ZodObject<{
1405
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1406
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1407
+ }, z.core.$strip>;
1408
+ }, z.core.$strip>]>, z.ZodObject<{
1409
+ view: z.ZodOptional<z.ZodEnum<{
1410
+ top: "top";
1411
+ front: "front";
1412
+ right: "right";
1413
+ iso: "iso";
1414
+ }>>;
1415
+ }, z.core.$strip>>>]>>;
652
1416
  }, z.core.$strip>]>>;
653
1417
  }, z.core.$strip>;
654
1418
  export type PluginDesignFamilyGetParametersArgs = z.infer<typeof PluginDesignFamilyGetParametersArgs>;
@@ -662,7 +1426,16 @@ export type PluginDesignFamilyGetParametersArgs = z.infer<typeof PluginDesignFam
662
1426
  */
663
1427
  export declare const PluginDesignFamilySetParametersArgs: z.ZodObject<{
664
1428
  component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
665
- values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
1429
+ values: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>>;
1430
+ children: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>>;
1431
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1432
+ from: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
1433
+ expr: z.ZodString;
1434
+ }, z.core.$strip>, z.ZodNull]>>>;
1435
+ relations: z.ZodOptional<z.ZodObject<{
1436
+ add: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1437
+ remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
1438
+ }, z.core.$strip>>;
666
1439
  }, z.core.$strip>;
667
1440
  export type PluginDesignFamilySetParametersArgs = z.infer<typeof PluginDesignFamilySetParametersArgs>;
668
1441
  //# sourceMappingURL=family.d.ts.map