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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/api-manifest.full.json +10406 -0
  2. package/api-manifest.json +737 -54
  3. package/dist/api/analysis/daylight.d.ts +5 -5
  4. package/dist/api/analysis/solar.d.ts +2 -2
  5. package/dist/api/core/camera/index.d.ts +29 -0
  6. package/dist/api/core/camera/index.d.ts.map +1 -1
  7. package/dist/api/core/geom/create/index.d.ts +7 -1
  8. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  9. package/dist/api/core/geom/update/contour.d.ts +8 -2
  10. package/dist/api/core/geom/update/contour.d.ts.map +1 -1
  11. package/dist/api/core/zoom/index.d.ts +13 -0
  12. package/dist/api/core/zoom/index.d.ts.map +1 -1
  13. package/dist/api/design/bim.d.ts +209 -0
  14. package/dist/api/design/bim.d.ts.map +1 -0
  15. package/dist/api/design/boolean/index.d.ts +2 -0
  16. package/dist/api/design/boolean/index.d.ts.map +1 -1
  17. package/dist/api/design/catalog.d.ts +320 -0
  18. package/dist/api/design/catalog.d.ts.map +1 -0
  19. package/dist/api/design/create/bulk-items.d.ts +65 -25
  20. package/dist/api/design/create/bulk-items.d.ts.map +1 -1
  21. package/dist/api/design/create/index.d.ts +272 -99
  22. package/dist/api/design/create/index.d.ts.map +1 -1
  23. package/dist/api/design/create/opening-fields.d.ts +13 -12
  24. package/dist/api/design/create/opening-fields.d.ts.map +1 -1
  25. package/dist/api/design/delete/index.d.ts +1 -0
  26. package/dist/api/design/delete/index.d.ts.map +1 -1
  27. package/dist/api/design/doors/index.d.ts +18 -24
  28. package/dist/api/design/doors/index.d.ts.map +1 -1
  29. package/dist/api/design/family.d.ts +797 -27
  30. package/dist/api/design/family.d.ts.map +1 -1
  31. package/dist/api/design/index.d.ts +16 -0
  32. package/dist/api/design/index.d.ts.map +1 -1
  33. package/dist/api/design/networks.d.ts +1703 -0
  34. package/dist/api/design/networks.d.ts.map +1 -0
  35. package/dist/api/design/query/index.d.ts +42 -32
  36. package/dist/api/design/query/index.d.ts.map +1 -1
  37. package/dist/api/design/selection/index.d.ts +10 -10
  38. package/dist/api/design/types/index.d.ts +40 -24
  39. package/dist/api/design/types/index.d.ts.map +1 -1
  40. package/dist/api/design/update/index.d.ts +43 -3
  41. package/dist/api/design/update/index.d.ts.map +1 -1
  42. package/dist/api/design/windows/index.d.ts +8 -8
  43. package/dist/api/design/windows/index.d.ts.map +1 -1
  44. package/dist/api/presentation/aiInspiration.d.ts +10 -10
  45. package/dist/api/presentation/annotate.d.ts +38 -22
  46. package/dist/api/presentation/annotate.d.ts.map +1 -1
  47. package/dist/api/presentation/drawingContract.d.ts +32 -0
  48. package/dist/api/presentation/drawingContract.d.ts.map +1 -0
  49. package/dist/api/presentation/drawings.d.ts +3523 -0
  50. package/dist/api/presentation/drawings.d.ts.map +1 -0
  51. package/dist/api/presentation/export.d.ts +23 -5
  52. package/dist/api/presentation/export.d.ts.map +1 -1
  53. package/dist/api/presentation/index.d.ts +32 -12
  54. package/dist/api/presentation/index.d.ts.map +1 -1
  55. package/dist/api/presentation/placedViews.d.ts +106 -6
  56. package/dist/api/presentation/placedViews.d.ts.map +1 -1
  57. package/dist/api/presentation/shapes.d.ts +2 -2
  58. package/dist/api/presentation/sheets.d.ts +175 -19
  59. package/dist/api/presentation/sheets.d.ts.map +1 -1
  60. package/dist/api/presentation/viewPresets.d.ts +222 -0
  61. package/dist/api/presentation/viewPresets.d.ts.map +1 -0
  62. package/dist/api/presentation/views.d.ts +103 -5
  63. package/dist/api/presentation/views.d.ts.map +1 -1
  64. package/dist/api/presentation/walkthroughs.d.ts +6 -6
  65. package/dist/errors/codes.d.ts +3 -1
  66. package/dist/errors/codes.d.ts.map +1 -1
  67. package/dist/index.cjs +3693 -2383
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.js +3573 -2383
  70. package/dist/index.js.map +1 -1
  71. package/package.json +1 -1
  72. package/scripts/generate-manifest.mjs +5 -0
  73. package/src/api/core/camera/index.ts +29 -0
  74. package/src/api/core/geom/create/index.ts +7 -1
  75. package/src/api/core/geom/update/contour.ts +8 -2
  76. package/src/api/core/zoom/index.ts +13 -0
  77. package/src/api/design/bim.ts +121 -0
  78. package/src/api/design/boolean/index.ts +2 -0
  79. package/src/api/design/catalog.ts +203 -0
  80. package/src/api/design/create/bulk-items.ts +57 -17
  81. package/src/api/design/create/index.ts +288 -120
  82. package/src/api/design/create/opening-fields.ts +15 -12
  83. package/src/api/design/delete/index.ts +1 -0
  84. package/src/api/design/doors/index.ts +58 -42
  85. package/src/api/design/family.ts +662 -32
  86. package/src/api/design/index.ts +34 -4
  87. package/src/api/design/networks.ts +607 -0
  88. package/src/api/design/query/index.ts +12 -2
  89. package/src/api/design/types/index.ts +31 -24
  90. package/src/api/design/update/index.ts +44 -3
  91. package/src/api/design/windows/index.ts +40 -22
  92. package/src/api/presentation/annotate.ts +90 -58
  93. package/src/api/presentation/drawingContract.ts +70 -0
  94. package/src/api/presentation/drawings.ts +1179 -0
  95. package/src/api/presentation/export.ts +32 -6
  96. package/src/api/presentation/index.ts +39 -14
  97. package/src/api/presentation/placedViews.ts +119 -28
  98. package/src/api/presentation/sheets.ts +181 -20
  99. package/src/api/presentation/viewPresets.ts +241 -0
  100. package/src/api/presentation/views.ts +46 -6
  101. package/src/errors/codes.ts +7 -0
  102. package/test/drawingContract.test.mjs +288 -0
  103. package/test/errors.test.mjs +1 -0
@@ -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.
136
225
  *
137
- * @returns The draft bundle, or `null`
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.
233
+ *
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
  *
@@ -196,6 +331,9 @@ export declare abstract class PluginDesignFamilyApi {
196
331
  *
197
332
  * // interactive — the user clicks
198
333
  * await snaptrude.design.family.place()
334
+ *
335
+ * // hosted — a door in a wall, near a point along it
336
+ * await snaptrude.design.family.place({ id: doorId, host: wall, position: { x: 3, y: 0, z: 0 } })
199
337
  * ```
200
338
  */
201
339
  abstract place(args?: PluginDesignFamilyPlaceArgs): PluginApiReturn<PluginFamilyPlaceResult>;
@@ -232,6 +370,34 @@ export declare abstract class PluginDesignFamilyApi {
232
370
  * that does not is accepted and stored (it round-trips to Revit) but nothing
233
371
  * visible happens — say so rather than claiming a change the user cannot see.
234
372
  *
373
+ * NESTED children: `children: { "<path>": { key: value } }` sets a nested
374
+ * child's own values (every copy of it). A value its parent sets is sent up
375
+ * to what it follows when that is a plain relationship; otherwise it is
376
+ * refused with what to change instead (see `refused`).
377
+ *
378
+ * LINKS: `links: { key: { from, expr } }` makes this family's `key` follow
379
+ * another placed object — `from` is a family (it reports its parameters and
380
+ * outputs) or a wall (it reports thickness, length, height); `expr` is an
381
+ * expression over those reports. `null` removes a link. Links that would
382
+ * make objects follow each other in a loop are refused. Values accept unit
383
+ * literals ("600mm").
384
+ *
385
+ * RELATIONS: `relations: { add: [...], remove: ["r1"] }` sets how the family
386
+ * sits against other placed objects or cuts its host:
387
+ * - `attach` — `{ kind: "attach", side: "base" | "top", to: <object> | { level, face? }, offset? }`:
388
+ * sits on a surface, or its top reaches one (reports `reach`, `gap`, `surface`).
389
+ * - `join` — `{ kind: "join", end, to: <family>, toEnd, bindOther? }`: its end moves onto
390
+ * the other's end (reports `angle`, `absAngle`, `mitre`).
391
+ * - `span` — `{ kind: "span", from, to, at? }`: pinned between two objects, running along
392
+ * its +X (reports `distance`, `run`, `rise`, `slope`, `from.*`, `to.*`).
393
+ * - `path` — `{ kind: "path", from? | points, closed? }`: follows a wall's centreline, a
394
+ * family's run or given points (reports `length`; the recipe reads the path).
395
+ * - `cut` — `{ kind: "cut", to: "host" }`: applies recipe voids to the current host.
396
+ * Removing it closes the opening without detaching or deleting the family.
397
+ * Door/window placement adds it. Hosting alone does not cut. No parameter binds.
398
+ * Placement relations take `bind: { <param>: "<expression over its reports>" }`; bound
399
+ * parameters are read-only. A relation with an existing `id` replaces it.
400
+ *
235
401
  * `length` values are Snaptrude units: the same 254 mm unit as the kernel's
236
402
  * internal (`"babylon"`) unit — convert the user's number with
237
403
  * `core.units.convert` first; a bare `400` is 400 SU, not 400 mm. Kernel part
@@ -246,18 +412,39 @@ export declare abstract class PluginDesignFamilyApi {
246
412
  * # Example
247
413
  * ```ts
248
414
  * await snaptrude.design.family.setParameters({ component, values: { seats: 8 } })
415
+ * await snaptrude.design.family.setParameters({ component, children: { chair: { width: "380mm" } } })
416
+ * await snaptrude.design.family.setParameters({
417
+ * component: railing,
418
+ * links: { steps: { from: stair, expr: "steps" }, side: { from: stair, expr: "width - 40mm" } },
419
+ * })
420
+ * await snaptrude.design.family.setParameters({
421
+ * component: post,
422
+ * relations: { add: [{ kind: "attach", side: "top", to: slab, bind: { height: "reach" } }] },
423
+ * })
249
424
  * ```
250
425
  */
251
426
  abstract setParameters(args: PluginDesignFamilySetParametersArgs): PluginApiReturn<PluginFamilyInstanceParameters>;
252
427
  /**
253
428
  * Save the prepared bundle to the library — the user's personal library
254
429
  * 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.
430
+ * saves generic components. Hosted doors/windows save without placement;
431
+ * they need a wall and position through `design.create.door` / `design.create.window`.
432
+ * For a non-hosted family with no placed instance, saving also drops one
433
+ * standalone sample at the current view centre on the active storey
434
+ * (`placed: true`). This includes architectural families: the sample does
435
+ * not assign a family to a native host.
436
+ *
437
+ * When the draft edits a saved family (opened with `get({ id })` /
438
+ * `get({ component })`), or its name is already taken in that library, the
439
+ * APP asks the user in its own window whether to save a new version of that
440
+ * family — every placed copy in this project moves to it, and families
441
+ * nesting it may be offered theirs — or a new family ("new family" is the
442
+ * default). The agent never asks this itself and cannot answer the window.
443
+ * `decision` reports what the user chose; `"cancelled"` means nothing was
444
+ * saved (`ok: false`) and nothing will auto-save until `create` is called again.
258
445
  *
259
446
  * @param args Optional library name and team scope
260
- * @returns The catalogued definition's id and version
447
+ * @returns The catalogued definition's id and version, and what the user chose
261
448
  *
262
449
  * @examplePrompt Save this as a family called Vertical Louvre
263
450
  * @examplePrompt Add it to my library
@@ -290,7 +477,42 @@ export declare abstract class PluginDesignFamilyApi {
290
477
  * await snaptrude.design.family.delete({ id: "revit:steel-bollard~bef047", instances: true })
291
478
  * ```
292
479
  */
293
- abstract delete(args?: PluginDesignFamilyDeleteArgs): PluginApiReturn<PluginFamilyDeleteResult>;
480
+ abstract delete(args?: PluginDesignFamilyDeleteArgs | string): PluginApiReturn<PluginFamilyDeleteResult>;
481
+ }
482
+ /** Optional reference sections keep unrelated grammar out of the core response. */
483
+ export declare const PluginFamilyReferenceSection: z.ZodEnum<{
484
+ architectural: "architectural";
485
+ networks: "networks";
486
+ relations: "relations";
487
+ }>;
488
+ export type PluginFamilyReferenceSection = z.infer<typeof PluginFamilyReferenceSection>;
489
+ /** Omit section for the core grammar, workflow and example catalogue. */
490
+ export declare const PluginDesignFamilyGetReferenceArgs: z.ZodObject<{
491
+ section: z.ZodOptional<z.ZodEnum<{
492
+ architectural: "architectural";
493
+ networks: "networks";
494
+ relations: "relations";
495
+ }>>;
496
+ }, z.core.$strip>;
497
+ export type PluginDesignFamilyGetReferenceArgs = z.infer<typeof PluginDesignFamilyGetReferenceArgs>;
498
+ /** Compact output is opt-in: existing object consumers must retain their metadata. */
499
+ export declare const PluginDesignFamilyListArgs: z.ZodObject<{
500
+ compact: z.ZodOptional<z.ZodBoolean>;
501
+ }, z.core.$strip>;
502
+ export type PluginDesignFamilyListArgs = z.infer<typeof PluginDesignFamilyListArgs>;
503
+ /** One worked example in the catalogue returned by `getExamples`. */
504
+ export interface PluginFamilyExampleSummary {
505
+ id: string;
506
+ label: string;
507
+ discipline: "architecture" | "structure" | "mep" | "furniture";
508
+ /** The patterns it demonstrates, e.g. "nesting", "slot", "path", "union", "trim". */
509
+ teaches: string[];
510
+ /** Size of the bundle as compact JSON, kilobytes — what fetching it costs. */
511
+ sizeKB: number;
512
+ }
513
+ /** One worked example with its full bundle, from `getExamples({ id })`. */
514
+ export interface PluginFamilyExample extends PluginFamilyExampleSummary {
515
+ bundle: PluginFamilyBundle;
294
516
  }
295
517
  /** The family-spec DSL reference returned by `getReference`. */
296
518
  export interface PluginFamilyReference {
@@ -309,6 +531,31 @@ export interface PluginFamilyReference {
309
531
  export interface PluginFamilyBundle {
310
532
  root: Record<string, unknown>;
311
533
  deps?: Record<string, Record<string, unknown>>;
534
+ /** Connector metadata saved with the recipe; network placement evaluates these expressions. */
535
+ network?: NetworkFamilyContract;
536
+ }
537
+ /** Which saved family a draft edits. */
538
+ export interface PluginFamilyEditing {
539
+ /** Library id of the family being edited. */
540
+ familyId: string;
541
+ /** The version that was opened. */
542
+ version: number;
543
+ /** Its library name — an update saves under this name. */
544
+ name: string;
545
+ /** "your library", or the team library's name. */
546
+ library: string;
547
+ }
548
+ /** What `get` returns: the bundle, plus `editing` when the draft edits a saved family. */
549
+ export interface PluginFamilyGetResult extends PluginFamilyBundle {
550
+ editing?: PluginFamilyEditing;
551
+ }
552
+ /** A family at a version, as `create` reports parents it did or did not update. */
553
+ export interface PluginFamilyVersionRef {
554
+ id: string;
555
+ name: string;
556
+ version: number;
557
+ /** Set when the user chose to update it but the update failed. */
558
+ error?: string;
312
559
  }
313
560
  /** Axis-aligned extents of a built family. Snaptrude units (1 SU = 254 mm), +Y up. */
314
561
  export interface PluginFamilyBBox {
@@ -342,7 +589,11 @@ export interface PluginFamilyParameter {
342
589
  export interface PluginFamilyDiagnostic {
343
590
  /** JSON pointer, e.g. `"/root/geometry/2/body/0/w"`. */
344
591
  path: string;
345
- code: "schema" | "bad-expression" | "unknown-name" | "unknown-def" | "cycle" | "duplicate-name" | "unbounded-repeat" | "depth" | "bad-dimension" | "proportion";
592
+ code: "schema" | "bad-expression" | "unknown-name" | "unknown-def" | "cycle" | "duplicate-name" | "unbounded-repeat" | "depth" | "bad-dimension" | "proportion"
593
+ /** A part the geometry kernel could not build exactly; drawn approximately. */
594
+ | "kernel-fallback"
595
+ /** A part whose hole loop crosses its outline. */
596
+ | "profile-hole";
346
597
  message: string;
347
598
  hint?: string;
348
599
  }
@@ -422,6 +673,13 @@ export interface PluginFamilySummary {
422
673
  version: number;
423
674
  label: string;
424
675
  category?: string;
676
+ /** The category's type token (`root.subType`), e.g. singleDoor or casementDouble. */
677
+ subType?: string;
678
+ /**
679
+ * Opening contract kind, distinct from provenance (`kind`). Place with the
680
+ * positional `design.create.door` / `window` API and edit via family parameters.
681
+ */
682
+ openingKind?: "door" | "window";
425
683
  /** Number of rows on the family's parameter sheet. */
426
684
  parameters: number;
427
685
  /**
@@ -437,6 +695,93 @@ export interface PluginFamilySummary {
437
695
  */
438
696
  kind: "native" | "revit";
439
697
  }
698
+ /** Exact catalog pin. Unsaved session definitions are not catalog inventory. */
699
+ export declare const PluginDesignFamilyGetDefinitionArgs: z.ZodObject<{
700
+ id: z.ZodString;
701
+ version: z.ZodNumber;
702
+ }, z.core.$strip>;
703
+ export type PluginDesignFamilyGetDefinitionArgs = z.infer<typeof PluginDesignFamilyGetDefinitionArgs>;
704
+ /** Saved-family metadata. Physical lengths use mm; angle entries retain degrees. */
705
+ export declare const PluginFamilyDefinitionParameter: z.ZodObject<{
706
+ key: z.ZodString;
707
+ label: z.ZodString;
708
+ type: z.ZodEnum<{
709
+ boolean: "boolean";
710
+ enum: "enum";
711
+ length: "length";
712
+ text: "text";
713
+ integer: "integer";
714
+ }>;
715
+ unit: z.ZodOptional<z.ZodEnum<{
716
+ mm: "mm";
717
+ degrees: "degrees";
718
+ }>>;
719
+ default: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
720
+ min: z.ZodOptional<z.ZodNumber>;
721
+ max: z.ZodOptional<z.ZodNumber>;
722
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
723
+ drivesGeometry: z.ZodBoolean;
724
+ readOnly: z.ZodBoolean;
725
+ formulaDriven: z.ZodBoolean;
726
+ isInstance: z.ZodBoolean;
727
+ }, z.core.$strip>;
728
+ export type PluginFamilyDefinitionParameter = z.infer<typeof PluginFamilyDefinitionParameter>;
729
+ /** Read-only catalog inventory. Boolean defaults retain the family DSL's Yes/No strings. */
730
+ export declare const PluginFamilyDefinition: z.ZodObject<{
731
+ id: z.ZodString;
732
+ version: z.ZodNumber;
733
+ label: z.ZodString;
734
+ category: z.ZodOptional<z.ZodString>;
735
+ lengthUnit: z.ZodLiteral<"mm">;
736
+ parameters: z.ZodArray<z.ZodObject<{
737
+ key: z.ZodString;
738
+ label: z.ZodString;
739
+ type: z.ZodEnum<{
740
+ boolean: "boolean";
741
+ enum: "enum";
742
+ length: "length";
743
+ text: "text";
744
+ integer: "integer";
745
+ }>;
746
+ unit: z.ZodOptional<z.ZodEnum<{
747
+ mm: "mm";
748
+ degrees: "degrees";
749
+ }>>;
750
+ default: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
751
+ min: z.ZodOptional<z.ZodNumber>;
752
+ max: z.ZodOptional<z.ZodNumber>;
753
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
754
+ drivesGeometry: z.ZodBoolean;
755
+ readOnly: z.ZodBoolean;
756
+ formulaDriven: z.ZodBoolean;
757
+ isInstance: z.ZodBoolean;
758
+ }, z.core.$strip>>;
759
+ network: z.ZodOptional<z.ZodObject<{
760
+ schemaVersion: z.ZodLiteral<1>;
761
+ role: z.ZodEnum<{
762
+ pipe: "pipe";
763
+ duct: "duct";
764
+ wire: "wire";
765
+ cable: "cable";
766
+ conduit: "conduit";
767
+ cableDuct: "cableDuct";
768
+ cableTray: "cableTray";
769
+ connector: "connector";
770
+ equipment: "equipment";
771
+ }>;
772
+ lengthParameter: z.ZodOptional<z.ZodString>;
773
+ ports: z.ZodArray<z.ZodObject<{
774
+ id: z.ZodString;
775
+ position: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
776
+ direction: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
777
+ size: z.ZodString;
778
+ height: z.ZodOptional<z.ZodString>;
779
+ widthDirection: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
780
+ systems: z.ZodArray<z.ZodString>;
781
+ }, z.core.$strict>>;
782
+ }, z.core.$strict>>;
783
+ }, z.core.$strip>;
784
+ export type PluginFamilyDefinition = z.infer<typeof PluginFamilyDefinition>;
440
785
  /** What `place` reports. */
441
786
  export interface PluginFamilyPlaceResult {
442
787
  ok: boolean;
@@ -464,6 +809,108 @@ export interface PluginFamilyInstanceParameters {
464
809
  parts?: PluginFamilyPart[];
465
810
  /** Present when `getParameters` was asked for a `snapshot`. */
466
811
  snapshot?: PluginFamilySnapshot;
812
+ /** The family's `outputs`, as last built. */
813
+ reports?: Record<string, number | string>;
814
+ /** Every declared nested child, as last built. */
815
+ children?: PluginFamilyNestedChild[];
816
+ /** Parameters that follow another object (links) or the host. */
817
+ follows?: PluginFamilyFollow[];
818
+ /** Where a hosted family sits: a system wall, or a family by id. */
819
+ host?: ({
820
+ kind: "wall";
821
+ } | {
822
+ kind: "family";
823
+ id: string;
824
+ }) & {
825
+ /** True when the host no longer has room for it: it is out of the model until it fits again. */
826
+ parked?: boolean;
827
+ };
828
+ /** Guests hosted in THIS family that no longer fit it (parked); they return when they fit. */
829
+ parkedGuests?: {
830
+ id: string;
831
+ family: string;
832
+ }[];
833
+ /** How it sits against other placed objects (attach, join, span, path), with current reports. */
834
+ relations?: PluginFamilyRelation[];
835
+ /** setParameters only: the edits refused, each with what to change instead. */
836
+ refused?: string[];
837
+ }
838
+ /** A nested child of a placed family. */
839
+ export interface PluginFamilyNestedChild {
840
+ /** "chair", or "chair/cushion" for a child of a child — the key for `children` edits. */
841
+ path: string;
842
+ label: string;
843
+ /** The family it is now (a slot's current pick). */
844
+ family: string;
845
+ familyLabel: string;
846
+ /** How many copies the parent places. */
847
+ copies: number;
848
+ slot?: {
849
+ expr: string;
850
+ options: string[];
851
+ };
852
+ values: Record<string, number | string>;
853
+ /** Values the parent sets, with the expression it sets them by. */
854
+ setBy: Record<string, string | undefined>;
855
+ reports: Record<string, number | string>;
856
+ }
857
+ /** A placed relation as stored, plus what it measures now. */
858
+ export type PluginFamilyRelation = PluginFamilyRelationInput & {
859
+ id: string;
860
+ /** "Attached to", "Joins", "Spans between", "Along a path", "Cuts host". */
861
+ label: string;
862
+ summary: string;
863
+ /** False when a target is gone: the family stayed where it was. */
864
+ live: boolean;
865
+ reports: Record<string, number | string>;
866
+ };
867
+ /** One relation to add (`relations.add`). Targets are handles, except a cut's symbolic "host". */
868
+ export type PluginFamilyRelationInput = {
869
+ /** Replaces the relation with this id; a new one gets "r1", "r2"… */
870
+ id?: string;
871
+ /** This family's parameter → an expression over the relation's reports and own parameters. */
872
+ bind?: Record<string, string>;
873
+ } & ({
874
+ kind: "attach";
875
+ side: "base" | "top";
876
+ to: ComponentHandle | {
877
+ level: number;
878
+ face?: "base" | "top";
879
+ };
880
+ offset?: number;
881
+ } | {
882
+ kind: "join";
883
+ end: "start" | "end";
884
+ to: ComponentHandle;
885
+ toEnd: "start" | "end";
886
+ /** The other family's parameters, over the same reports. */
887
+ bindOther?: Record<string, string>;
888
+ } | {
889
+ kind: "span";
890
+ from: ComponentHandle;
891
+ to: ComponentHandle;
892
+ at?: "top" | "centre" | "base";
893
+ } | {
894
+ kind: "path";
895
+ from?: ComponentHandle;
896
+ points?: [number, number, number][];
897
+ closed?: boolean;
898
+ } | {
899
+ /** Apply recipe voids to the existing host without adding another host ID. */
900
+ kind: "cut";
901
+ to: "host";
902
+ bind?: never;
903
+ });
904
+ /** One parameter that follows something else. */
905
+ export interface PluginFamilyFollow {
906
+ key: string;
907
+ /** "relation": set by a placed relation — `from` is the relation's id. */
908
+ kind: "link" | "host" | "relation";
909
+ /** The source's id. */
910
+ from: string;
911
+ fromLabel: string;
912
+ /** The expression over the source's reports (for a host: the report name). */
913
+ expr: string;
467
914
  }
468
915
  /** What `create` reports. */
469
916
  export interface PluginFamilyCreateResult {
@@ -475,6 +922,36 @@ export interface PluginFamilyCreateResult {
475
922
  placed?: boolean;
476
923
  /** Host guidance for the caller, e.g. that an instance was placed at the view centre. */
477
924
  hint?: string;
925
+ /**
926
+ * What the user chose in the app's window: `"version"` (a new version of
927
+ * the saved family), `"new"` (a new family), `"cancelled"` (nothing saved).
928
+ * `"saved"` = no question was needed.
929
+ */
930
+ decision?: "version" | "new" | "cancelled" | "saved";
931
+ /** The library name it was saved under. */
932
+ name?: string;
933
+ /** Placed copies in this project moved to the new version (the family's and updated parents'). */
934
+ movedCopies?: number;
935
+ /** What the moved copies lost because the new version no longer has it. */
936
+ dropped?: {
937
+ values: Array<{
938
+ copy: string;
939
+ key: string;
940
+ }>;
941
+ childValues: Array<{
942
+ copy: string;
943
+ path: string;
944
+ }>;
945
+ follows: Array<{
946
+ copy: string;
947
+ key: string;
948
+ kind: "link" | "relation";
949
+ }>;
950
+ };
951
+ /** Families nesting this one that the user chose to update, at their new versions. */
952
+ parentsUpdated?: PluginFamilyVersionRef[];
953
+ /** Families nesting this one that keep their version. */
954
+ parentsKept?: PluginFamilyVersionRef[];
478
955
  error?: string;
479
956
  }
480
957
  /** What `delete` reports. */
@@ -497,6 +974,30 @@ export interface PluginFamilyDeleteResult {
497
974
  export declare const PluginFamilyBundleSchema: z.ZodObject<{
498
975
  root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
499
976
  deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
977
+ network: z.ZodOptional<z.ZodObject<{
978
+ schemaVersion: z.ZodLiteral<1>;
979
+ role: z.ZodEnum<{
980
+ pipe: "pipe";
981
+ duct: "duct";
982
+ wire: "wire";
983
+ cable: "cable";
984
+ conduit: "conduit";
985
+ cableDuct: "cableDuct";
986
+ cableTray: "cableTray";
987
+ connector: "connector";
988
+ equipment: "equipment";
989
+ }>;
990
+ lengthParameter: z.ZodOptional<z.ZodString>;
991
+ ports: z.ZodArray<z.ZodObject<{
992
+ id: z.ZodString;
993
+ position: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
994
+ direction: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
995
+ size: z.ZodString;
996
+ height: z.ZodOptional<z.ZodString>;
997
+ widthDirection: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
998
+ systems: z.ZodArray<z.ZodString>;
999
+ }, z.core.$strict>>;
1000
+ }, z.core.$strict>>;
500
1001
  }, z.core.$strip>;
501
1002
  /**
502
1003
  * Arguments for {@linkcode PluginDesignFamilyApi.prepare}.
@@ -517,7 +1018,42 @@ export declare const PluginFamilyBundleSchema: z.ZodObject<{
517
1018
  * the viewport is not moved — and comes back as a PNG data URL in the result's
518
1019
  * `snapshot.image`. Through the agent's `run_worker`, return the result and the
519
1020
  * image reaches the model as an image.
1021
+ *
1022
+ * `focus` makes it a close-up: `{ parts: ["seat", "back", "slat@*"] }` frames
1023
+ * the joint where those groups meet (`*` matches any run of characters;
1024
+ * nested names are `a/b`), or their full bounds if they do not meet. A margin
1025
+ * of a quarter of their size (at least 50 mm) surrounds the joint.
1026
+ * `{ box: { min, max } }` frames a region in family space
1027
+ * (Snaptrude units, +Y up). Every other part is still drawn; the dimension line
1028
+ * then gives the framed region and the result says `closeUp: true`. A part
1029
+ * name that matches nothing fails the snapshot with a list of real names.
520
1030
  */
1031
+ export declare const PluginFamilySnapshotFocus: z.ZodUnion<readonly [z.ZodObject<{
1032
+ parts: z.ZodArray<z.ZodString>;
1033
+ }, z.core.$strip>, z.ZodObject<{
1034
+ box: z.ZodObject<{
1035
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1036
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1037
+ }, z.core.$strip>;
1038
+ }, z.core.$strip>]>;
1039
+ export type PluginFamilySnapshotFocus = z.infer<typeof PluginFamilySnapshotFocus>;
1040
+ /** One close-up tile; omission of view uses the sheet's first view. */
1041
+ export declare const PluginFamilySnapshotCloseUp: z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
1042
+ parts: z.ZodArray<z.ZodString>;
1043
+ }, z.core.$strip>, z.ZodObject<{
1044
+ box: z.ZodObject<{
1045
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1046
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1047
+ }, z.core.$strip>;
1048
+ }, z.core.$strip>]>, z.ZodObject<{
1049
+ view: z.ZodOptional<z.ZodEnum<{
1050
+ top: "top";
1051
+ front: "front";
1052
+ right: "right";
1053
+ iso: "iso";
1054
+ }>>;
1055
+ }, z.core.$strip>>;
1056
+ export type PluginFamilySnapshotCloseUp = z.infer<typeof PluginFamilySnapshotCloseUp>;
521
1057
  export declare const PluginFamilySnapshotOption: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
522
1058
  views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
523
1059
  top: "top";
@@ -526,6 +1062,28 @@ export declare const PluginFamilySnapshotOption: z.ZodUnion<readonly [z.ZodBoole
526
1062
  iso: "iso";
527
1063
  }>>>;
528
1064
  tileSize: z.ZodOptional<z.ZodNumber>;
1065
+ focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
1066
+ parts: z.ZodArray<z.ZodString>;
1067
+ }, z.core.$strip>, z.ZodObject<{
1068
+ box: z.ZodObject<{
1069
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1070
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1071
+ }, z.core.$strip>;
1072
+ }, z.core.$strip>]>, z.ZodArray<z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
1073
+ parts: z.ZodArray<z.ZodString>;
1074
+ }, z.core.$strip>, z.ZodObject<{
1075
+ box: z.ZodObject<{
1076
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1077
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1078
+ }, z.core.$strip>;
1079
+ }, z.core.$strip>]>, z.ZodObject<{
1080
+ view: z.ZodOptional<z.ZodEnum<{
1081
+ top: "top";
1082
+ front: "front";
1083
+ right: "right";
1084
+ iso: "iso";
1085
+ }>>;
1086
+ }, z.core.$strip>>>]>>;
529
1087
  }, z.core.$strip>]>;
530
1088
  export type PluginFamilySnapshotOption = z.infer<typeof PluginFamilySnapshotOption>;
531
1089
  /** The picture block on prepare / flex / getParameters results when `snapshot` was asked for. */
@@ -534,9 +1092,18 @@ export interface PluginFamilySnapshot {
534
1092
  /** PNG data URL of the composed sheet. */
535
1093
  image?: string;
536
1094
  views?: ("iso" | "front" | "right" | "top")[];
537
- /** [width, height, depth] in Snaptrude units. */
1095
+ /** [width, height, depth] in SU. For a close-up list, this remains the whole family's size. */
538
1096
  size?: [number, number, number];
539
1097
  ms?: number;
1098
+ /** True when the sheet is a close-up (`focus`), not the whole family. */
1099
+ closeUp?: boolean;
1100
+ /** Per-tile results for a focus list. One invalid target does not discard other tiles. */
1101
+ closeUps?: Array<{
1102
+ view: "iso" | "front" | "right" | "top";
1103
+ label: string;
1104
+ size?: [number, number, number];
1105
+ error?: string;
1106
+ }>;
540
1107
  /** Set when the picture could not be taken (e.g. the legacy renderer); the call itself still succeeded. */
541
1108
  error?: string;
542
1109
  }
@@ -544,10 +1111,58 @@ export declare const PluginDesignFamilyPrepareArgs: z.ZodObject<{
544
1111
  bundle: z.ZodOptional<z.ZodObject<{
545
1112
  root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
546
1113
  deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1114
+ network: z.ZodOptional<z.ZodObject<{
1115
+ schemaVersion: z.ZodLiteral<1>;
1116
+ role: z.ZodEnum<{
1117
+ pipe: "pipe";
1118
+ duct: "duct";
1119
+ wire: "wire";
1120
+ cable: "cable";
1121
+ conduit: "conduit";
1122
+ cableDuct: "cableDuct";
1123
+ cableTray: "cableTray";
1124
+ connector: "connector";
1125
+ equipment: "equipment";
1126
+ }>;
1127
+ lengthParameter: z.ZodOptional<z.ZodString>;
1128
+ ports: z.ZodArray<z.ZodObject<{
1129
+ id: z.ZodString;
1130
+ position: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
1131
+ direction: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
1132
+ size: z.ZodString;
1133
+ height: z.ZodOptional<z.ZodString>;
1134
+ widthDirection: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
1135
+ systems: z.ZodArray<z.ZodString>;
1136
+ }, z.core.$strict>>;
1137
+ }, z.core.$strict>>;
547
1138
  }, z.core.$strip>>;
548
1139
  spec: z.ZodOptional<z.ZodObject<{
549
1140
  root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
550
1141
  deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1142
+ network: z.ZodOptional<z.ZodObject<{
1143
+ schemaVersion: z.ZodLiteral<1>;
1144
+ role: z.ZodEnum<{
1145
+ pipe: "pipe";
1146
+ duct: "duct";
1147
+ wire: "wire";
1148
+ cable: "cable";
1149
+ conduit: "conduit";
1150
+ cableDuct: "cableDuct";
1151
+ cableTray: "cableTray";
1152
+ connector: "connector";
1153
+ equipment: "equipment";
1154
+ }>;
1155
+ lengthParameter: z.ZodOptional<z.ZodString>;
1156
+ ports: z.ZodArray<z.ZodObject<{
1157
+ id: z.ZodString;
1158
+ position: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
1159
+ direction: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
1160
+ size: z.ZodString;
1161
+ height: z.ZodOptional<z.ZodString>;
1162
+ widthDirection: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>>;
1163
+ systems: z.ZodArray<z.ZodString>;
1164
+ }, z.core.$strict>>;
1165
+ }, z.core.$strict>>;
551
1166
  }, z.core.$strip>>;
552
1167
  snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
553
1168
  views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -557,6 +1172,28 @@ export declare const PluginDesignFamilyPrepareArgs: z.ZodObject<{
557
1172
  iso: "iso";
558
1173
  }>>>;
559
1174
  tileSize: z.ZodOptional<z.ZodNumber>;
1175
+ focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
1176
+ parts: z.ZodArray<z.ZodString>;
1177
+ }, z.core.$strip>, z.ZodObject<{
1178
+ box: z.ZodObject<{
1179
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1180
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1181
+ }, z.core.$strip>;
1182
+ }, z.core.$strip>]>, z.ZodArray<z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
1183
+ parts: z.ZodArray<z.ZodString>;
1184
+ }, z.core.$strip>, z.ZodObject<{
1185
+ box: z.ZodObject<{
1186
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1187
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1188
+ }, z.core.$strip>;
1189
+ }, z.core.$strip>]>, z.ZodObject<{
1190
+ view: z.ZodOptional<z.ZodEnum<{
1191
+ top: "top";
1192
+ front: "front";
1193
+ right: "right";
1194
+ iso: "iso";
1195
+ }>>;
1196
+ }, z.core.$strip>>>]>>;
560
1197
  }, z.core.$strip>]>>;
561
1198
  }, z.core.$strip>;
562
1199
  export type PluginDesignFamilyPrepareArgs = z.infer<typeof PluginDesignFamilyPrepareArgs>;
@@ -565,11 +1202,11 @@ export type PluginDesignFamilyPrepareArgs = z.infer<typeof PluginDesignFamilyPre
565
1202
  *
566
1203
  * | Property | Type | Description |
567
1204
  * |---|---|---|
568
- * | `values` | `Record<string, number \| string>` | Parameter values to change (partial) |
1205
+ * | `values` | `Record<string, number \| string>` | Optional sparse changes; omission does not rebuild |
569
1206
  * | `snapshot` | {@linkcode PluginFamilySnapshotOption} | Also return a picture of the flexed family |
570
1207
  */
571
1208
  export declare const PluginDesignFamilyFlexArgs: z.ZodObject<{
572
- values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
1209
+ values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
573
1210
  snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
574
1211
  views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
575
1212
  top: "top";
@@ -578,9 +1215,110 @@ export declare const PluginDesignFamilyFlexArgs: z.ZodObject<{
578
1215
  iso: "iso";
579
1216
  }>>>;
580
1217
  tileSize: z.ZodOptional<z.ZodNumber>;
1218
+ focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
1219
+ parts: z.ZodArray<z.ZodString>;
1220
+ }, z.core.$strip>, z.ZodObject<{
1221
+ box: z.ZodObject<{
1222
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1223
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1224
+ }, z.core.$strip>;
1225
+ }, z.core.$strip>]>, z.ZodArray<z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
1226
+ parts: z.ZodArray<z.ZodString>;
1227
+ }, z.core.$strip>, z.ZodObject<{
1228
+ box: z.ZodObject<{
1229
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1230
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1231
+ }, z.core.$strip>;
1232
+ }, z.core.$strip>]>, z.ZodObject<{
1233
+ view: z.ZodOptional<z.ZodEnum<{
1234
+ top: "top";
1235
+ front: "front";
1236
+ right: "right";
1237
+ iso: "iso";
1238
+ }>>;
1239
+ }, z.core.$strip>>>]>>;
581
1240
  }, z.core.$strip>]>>;
582
1241
  }, z.core.$strip>;
583
1242
  export type PluginDesignFamilyFlexArgs = z.infer<typeof PluginDesignFamilyFlexArgs>;
1243
+ /**
1244
+ * Arguments for {@linkcode PluginDesignFamilyApi.get}. All optional — no
1245
+ * arguments returns the prepared draft.
1246
+ *
1247
+ * | Property | Type | Description |
1248
+ * |---|---|---|
1249
+ * | `id` | `string` | A saved family to open for editing, from {@linkcode PluginDesignFamilyApi.list} |
1250
+ * | `version` | `number` | Exact version to open; defaults to the newest |
1251
+ * | `component` | {@linkcode ComponentHandle} | Open the family of this placed copy, at its version |
1252
+ */
1253
+ export declare const PluginDesignFamilyGetArgs: z.ZodObject<{
1254
+ id: z.ZodOptional<z.ZodString>;
1255
+ version: z.ZodOptional<z.ZodNumber>;
1256
+ component: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
1257
+ }, z.core.$strip>;
1258
+ export type PluginDesignFamilyGetArgs = z.infer<typeof PluginDesignFamilyGetArgs>;
1259
+ /**
1260
+ * Arguments for {@linkcode PluginDesignFamilyApi.getExamples}.
1261
+ *
1262
+ * | Property | Type | Description |
1263
+ * |---|---|---|
1264
+ * | `id` | `string` | One example's id — returns its bundle |
1265
+ * | `discipline` | `string` | List only this discipline: architecture, structure, mep, furniture |
1266
+ * | `tag` | `string` | List only examples teaching this pattern (e.g. "path", "union") |
1267
+ */
1268
+ export declare const PluginDesignFamilyGetExamplesArgs: z.ZodObject<{
1269
+ id: z.ZodOptional<z.ZodString>;
1270
+ discipline: z.ZodOptional<z.ZodEnum<{
1271
+ architecture: "architecture";
1272
+ structure: "structure";
1273
+ mep: "mep";
1274
+ furniture: "furniture";
1275
+ }>>;
1276
+ tag: z.ZodOptional<z.ZodString>;
1277
+ }, z.core.$strip>;
1278
+ export type PluginDesignFamilyGetExamplesArgs = z.infer<typeof PluginDesignFamilyGetExamplesArgs>;
1279
+ /**
1280
+ * Arguments for {@linkcode PluginDesignFamilyApi.getTemplate}.
1281
+ * `kind` selects the opening contract. `subType` is a nonempty type token;
1282
+ * omission selects singleDoor / fixedWindow. Unsupported tokens return the
1283
+ * default template with guidance rather than preventing custom subtype authoring.
1284
+ */
1285
+ export declare const PluginDesignFamilyGetTemplateArgs: z.ZodObject<{
1286
+ kind: z.ZodEnum<{
1287
+ door: "door";
1288
+ window: "window";
1289
+ }>;
1290
+ subType: z.ZodOptional<z.ZodString>;
1291
+ }, z.core.$strip>;
1292
+ export type PluginDesignFamilyGetTemplateArgs = z.infer<typeof PluginDesignFamilyGetTemplateArgs>;
1293
+ /**
1294
+ * Maps opening dimensions to authored length parameter KEYS, not values.
1295
+ * Width and height describe the wall hole; sill measures from the wall base
1296
+ * to the hole bottom (windows). Wall thickness follows the host wall.
1297
+ * The recipe and family parameter APIs use Snaptrude units (1 SU = 254 mm).
1298
+ */
1299
+ export interface PluginFamilyOpeningContract {
1300
+ kind: "door" | "window";
1301
+ width: string;
1302
+ height: string;
1303
+ sill?: string;
1304
+ wallThickness?: string;
1305
+ }
1306
+ /** Starter recipe metadata returned by `getTemplate`; instances are ParametricComponents. */
1307
+ export interface PluginFamilyTemplateResult {
1308
+ /** Validated recipe bundle: edit its style while preserving the contract. */
1309
+ bundle: PluginFamilyBundle;
1310
+ contract: PluginFamilyOpeningContract;
1311
+ /** Actual template subtype, including when an unsupported token used the default. */
1312
+ subType: string;
1313
+ /** Authoring rules and any note about an unsupported requested subtype. */
1314
+ guidance: string[];
1315
+ /** Available starter templates for the requested kind. */
1316
+ available: Array<{
1317
+ subType: string;
1318
+ label: string;
1319
+ teaches: string[];
1320
+ }>;
1321
+ }
584
1322
  /**
585
1323
  * Arguments for {@linkcode PluginDesignFamilyApi.create}.
586
1324
  *
@@ -614,7 +1352,7 @@ export type PluginDesignFamilyDeleteArgs = z.infer<typeof PluginDesignFamilyDele
614
1352
  * |---|---|---|
615
1353
  * | `id` | `string` | Family to place, from {@linkcode PluginDesignFamilyApi.list}. Omit to place the prepared draft |
616
1354
  * | `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 |
1355
+ * | `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
1356
  * | `rotation` | `number` | Yaw in degrees about +Y. Only with `position` |
619
1357
  * | `values` | `Record<string, number \| string>` | Parameter values for THIS instance |
620
1358
  * | `storey` | `number` | Storey to place on; defaults to the active one |
@@ -622,14 +1360,15 @@ export type PluginDesignFamilyDeleteArgs = z.infer<typeof PluginDesignFamilyDele
622
1360
  export declare const PluginDesignFamilyPlaceArgs: z.ZodObject<{
623
1361
  id: z.ZodOptional<z.ZodString>;
624
1362
  version: z.ZodOptional<z.ZodNumber>;
625
- position: z.ZodOptional<z.ZodObject<{
1363
+ 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
1364
  x: z.ZodNumber;
627
1365
  y: z.ZodNumber;
628
1366
  z: z.ZodNumber;
629
- }, z.core.$strip>>;
1367
+ }, z.core.$strip>]>>;
630
1368
  rotation: z.ZodOptional<z.ZodNumber>;
631
1369
  values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
632
1370
  storey: z.ZodOptional<z.ZodNumber>;
1371
+ host: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
633
1372
  }, z.core.$strip>;
634
1373
  export type PluginDesignFamilyPlaceArgs = z.infer<typeof PluginDesignFamilyPlaceArgs>;
635
1374
  /**
@@ -649,6 +1388,28 @@ export declare const PluginDesignFamilyGetParametersArgs: z.ZodObject<{
649
1388
  iso: "iso";
650
1389
  }>>>;
651
1390
  tileSize: z.ZodOptional<z.ZodNumber>;
1391
+ focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
1392
+ parts: z.ZodArray<z.ZodString>;
1393
+ }, z.core.$strip>, z.ZodObject<{
1394
+ box: z.ZodObject<{
1395
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1396
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1397
+ }, z.core.$strip>;
1398
+ }, z.core.$strip>]>, z.ZodArray<z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
1399
+ parts: z.ZodArray<z.ZodString>;
1400
+ }, z.core.$strip>, z.ZodObject<{
1401
+ box: z.ZodObject<{
1402
+ min: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1403
+ max: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1404
+ }, z.core.$strip>;
1405
+ }, z.core.$strip>]>, z.ZodObject<{
1406
+ view: z.ZodOptional<z.ZodEnum<{
1407
+ top: "top";
1408
+ front: "front";
1409
+ right: "right";
1410
+ iso: "iso";
1411
+ }>>;
1412
+ }, z.core.$strip>>>]>>;
652
1413
  }, z.core.$strip>]>>;
653
1414
  }, z.core.$strip>;
654
1415
  export type PluginDesignFamilyGetParametersArgs = z.infer<typeof PluginDesignFamilyGetParametersArgs>;
@@ -662,7 +1423,16 @@ export type PluginDesignFamilyGetParametersArgs = z.infer<typeof PluginDesignFam
662
1423
  */
663
1424
  export declare const PluginDesignFamilySetParametersArgs: z.ZodObject<{
664
1425
  component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
665
- values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
1426
+ values: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>>;
1427
+ children: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>>;
1428
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1429
+ from: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
1430
+ expr: z.ZodString;
1431
+ }, z.core.$strip>, z.ZodNull]>>>;
1432
+ relations: z.ZodOptional<z.ZodObject<{
1433
+ add: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1434
+ remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
1435
+ }, z.core.$strip>>;
666
1436
  }, z.core.$strip>;
667
1437
  export type PluginDesignFamilySetParametersArgs = z.infer<typeof PluginDesignFamilySetParametersArgs>;
668
1438
  //# sourceMappingURL=family.d.ts.map