@snaptrude/plugin-core 0.0.0-dev-20260911064951 → 0.0.0-dev-20260921132444

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 (55) hide show
  1. package/AGENTS.md +4 -0
  2. package/CHANGELOG.md +35 -1
  3. package/dist/api/core/mode/index.d.ts +19 -7
  4. package/dist/api/core/mode/index.d.ts.map +1 -1
  5. package/dist/api/core/tags.d.ts +81 -0
  6. package/dist/api/core/tags.d.ts.map +1 -1
  7. package/dist/api/design/create/grids.d.ts +132 -0
  8. package/dist/api/design/create/grids.d.ts.map +1 -0
  9. package/dist/api/design/create/index.d.ts +109 -1
  10. package/dist/api/design/create/index.d.ts.map +1 -1
  11. package/dist/api/design/family.d.ts +73 -5
  12. package/dist/api/design/family.d.ts.map +1 -1
  13. package/dist/api/design/grids.d.ts +237 -0
  14. package/dist/api/design/grids.d.ts.map +1 -0
  15. package/dist/api/design/index.d.ts +4 -0
  16. package/dist/api/design/index.d.ts.map +1 -1
  17. package/dist/api/design/query/grids.d.ts +287 -0
  18. package/dist/api/design/query/grids.d.ts.map +1 -0
  19. package/dist/api/design/query/index.d.ts +29 -0
  20. package/dist/api/design/query/index.d.ts.map +1 -1
  21. package/dist/api/design/update/index.d.ts +74 -0
  22. package/dist/api/design/update/index.d.ts.map +1 -1
  23. package/dist/api/program/departments.d.ts +58 -2
  24. package/dist/api/program/departments.d.ts.map +1 -1
  25. package/dist/api/program/index.d.ts +16 -6
  26. package/dist/api/program/index.d.ts.map +1 -1
  27. package/dist/api/program/labels.d.ts +355 -0
  28. package/dist/api/program/labels.d.ts.map +1 -0
  29. package/dist/api/program/metadata.d.ts +328 -0
  30. package/dist/api/program/metadata.d.ts.map +1 -0
  31. package/dist/api/program/spreadsheet.d.ts +263 -0
  32. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  33. package/dist/api/workspace/index.d.ts +49 -2
  34. package/dist/api/workspace/index.d.ts.map +1 -1
  35. package/dist/index.cjs +2365 -1908
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.js +2294 -1908
  38. package/dist/index.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/api/core/mode/index.ts +19 -7
  41. package/src/api/core/tags.ts +76 -0
  42. package/src/api/design/create/grids.ts +137 -0
  43. package/src/api/design/create/index.ts +131 -0
  44. package/src/api/design/family.ts +51 -4
  45. package/src/api/design/grids.ts +237 -0
  46. package/src/api/design/index.ts +5 -0
  47. package/src/api/design/query/grids.ts +197 -0
  48. package/src/api/design/query/index.ts +27 -0
  49. package/src/api/design/update/index.ts +53 -0
  50. package/src/api/program/departments.ts +54 -2
  51. package/src/api/program/index.ts +16 -6
  52. package/src/api/program/labels.ts +332 -0
  53. package/src/api/program/metadata.ts +364 -0
  54. package/src/api/program/spreadsheet.ts +282 -0
  55. package/src/api/workspace/index.ts +51 -2
@@ -24,7 +24,8 @@ import { ComponentHandle } from "../../handles";
24
24
  * ## Read getReference() first
25
25
  *
26
26
  * The spec DSL is a closed expression language with its own op set, coordinate
27
- * convention (**+Y up, integer millimetres** — not Snaptrude's babylon units)
27
+ * convention (**+Y up, Snaptrude units** — the scene's own unit, 1 SU = 254 mm;
28
+ * literals may carry a unit suffix such as `600mm` or `2ft`)
28
29
  * and part-naming law. It is deliberately NOT duplicated in these types:
29
30
  * {@linkcode PluginDesignFamilyApi.getReference} returns the whole reference,
30
31
  * generated from a family that is actually registered in the host, so the
@@ -249,11 +250,11 @@ export interface PluginFamilyBundle {
249
250
  root: Record<string, unknown>;
250
251
  deps?: Record<string, Record<string, unknown>>;
251
252
  }
252
- /** Axis-aligned extents of a built family. Integer millimetres, +Y up. */
253
+ /** Axis-aligned extents of a built family. Snaptrude units (1 SU = 254 mm), +Y up. */
253
254
  export interface PluginFamilyBBox {
254
255
  min: [number, number, number];
255
256
  max: [number, number, number];
256
- /** `[width, height, depth]` in millimetres. */
257
+ /** `[width, height, depth]` in Snaptrude units — convert with `core.units.convert` for display. */
257
258
  size: [number, number, number];
258
259
  }
259
260
  /** One row of a family's parameter sheet. */
@@ -281,7 +282,7 @@ export interface PluginFamilyParameter {
281
282
  export interface PluginFamilyDiagnostic {
282
283
  /** JSON pointer, e.g. `"/root/geometry/2/body/0/w"`. */
283
284
  path: string;
284
- code: "schema" | "bad-expression" | "unknown-name" | "unknown-def" | "cycle" | "duplicate-name" | "unbounded-repeat" | "depth" | "bad-dimension";
285
+ code: "schema" | "bad-expression" | "unknown-name" | "unknown-def" | "cycle" | "duplicate-name" | "unbounded-repeat" | "depth" | "bad-dimension" | "proportion";
285
286
  message: string;
286
287
  hint?: string;
287
288
  }
@@ -294,7 +295,7 @@ export interface PluginFamilyPrepareResult {
294
295
  label?: string;
295
296
  /** How many parts the family built. Sanity-check against intent. */
296
297
  partCount?: number;
297
- /** Extents in millimetres. Sanity-check against intent. */
298
+ /** Extents in Snaptrude units. Sanity-check against intent. */
298
299
  bbox?: PluginFamilyBBox;
299
300
  evalMs?: number;
300
301
  parameters?: PluginFamilyParameter[];
@@ -302,6 +303,8 @@ export interface PluginFamilyPrepareResult {
302
303
  takeoff?: Record<string, number | string>;
303
304
  /** The first few part names — enough to check the naming came out right. */
304
305
  sampleParts?: string[];
306
+ /** Present when `snapshot` was asked for. */
307
+ snapshot?: PluginFamilySnapshot;
305
308
  errors: PluginFamilyDiagnostic[];
306
309
  warnings: PluginFamilyDiagnostic[];
307
310
  /** Set when the bundle validated but threw while building. */
@@ -329,6 +332,10 @@ export interface PluginFamilyFlexResult {
329
332
  evalMs?: number;
330
333
  changed?: PluginFamilyChangeBuckets;
331
334
  takeoff?: Record<string, number | string>;
335
+ /** Proportion warnings at the flexed values (code `proportion`): a part thinner than 0.5 mm, a part or family over 50 m, a family under 10 mm — the signature of a unit slip. */
336
+ warnings?: PluginFamilyDiagnostic[];
337
+ /** Present when `snapshot` was asked for. */
338
+ snapshot?: PluginFamilySnapshot;
332
339
  error?: string;
333
340
  }
334
341
  /** One family available to place — from the session registry or the catalog. */
@@ -375,6 +382,8 @@ export interface PluginFamilyInstanceParameters {
375
382
  values: Record<string, number | string>;
376
383
  /** The sheet: what each key means, its bounds, and whether it moves geometry. */
377
384
  parameters: PluginFamilyParameter[];
385
+ /** Present when `getParameters` was asked for a `snapshot`. */
386
+ snapshot?: PluginFamilySnapshot;
378
387
  }
379
388
  /** What `create` reports. */
380
389
  export interface PluginFamilyCreateResult {
@@ -402,10 +411,41 @@ export declare const PluginFamilyBundleSchema: z.ZodObject<{
402
411
  * |---|---|---|
403
412
  * | `bundle` | {@linkcode PluginFamilyBundle} | The family spec bundle |
404
413
  * | `spec` | {@linkcode PluginFamilyBundle} | Alias for `bundle` |
414
+ * | `snapshot` | {@linkcode PluginFamilySnapshotOption} | Also return a picture of the built family |
405
415
  *
406
416
  * Exactly one of `bundle` / `spec` is required. A bare `FamilySpec` (no `root`
407
417
  * wrapper) is also accepted by the host and wrapped for the caller.
408
418
  */
419
+ /**
420
+ * Ask for a picture with the result: `true` for the default sheet (iso, front,
421
+ * right and top tiles with a dimension line), or an object to choose views and
422
+ * tile size. The picture is an isolated offscreen render of the family alone —
423
+ * the viewport is not moved — and comes back as a PNG data URL in the result's
424
+ * `snapshot.image`. Through the agent's `run_worker`, return the result and the
425
+ * image reaches the model as an image.
426
+ */
427
+ export declare const PluginFamilySnapshotOption: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
428
+ views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
429
+ top: "top";
430
+ front: "front";
431
+ right: "right";
432
+ iso: "iso";
433
+ }>>>;
434
+ tileSize: z.ZodOptional<z.ZodNumber>;
435
+ }, z.core.$strip>]>;
436
+ export type PluginFamilySnapshotOption = z.infer<typeof PluginFamilySnapshotOption>;
437
+ /** The picture block on prepare / flex / getParameters results when `snapshot` was asked for. */
438
+ export interface PluginFamilySnapshot {
439
+ ok: boolean;
440
+ /** PNG data URL of the composed sheet. */
441
+ image?: string;
442
+ views?: ("iso" | "front" | "right" | "top")[];
443
+ /** [width, height, depth] in Snaptrude units. */
444
+ size?: [number, number, number];
445
+ ms?: number;
446
+ /** Set when the picture could not be taken (e.g. the legacy renderer); the call itself still succeeded. */
447
+ error?: string;
448
+ }
409
449
  export declare const PluginDesignFamilyPrepareArgs: z.ZodObject<{
410
450
  bundle: z.ZodOptional<z.ZodObject<{
411
451
  root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -415,6 +455,15 @@ export declare const PluginDesignFamilyPrepareArgs: z.ZodObject<{
415
455
  root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
416
456
  deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
417
457
  }, z.core.$strip>>;
458
+ snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
459
+ views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
460
+ top: "top";
461
+ front: "front";
462
+ right: "right";
463
+ iso: "iso";
464
+ }>>>;
465
+ tileSize: z.ZodOptional<z.ZodNumber>;
466
+ }, z.core.$strip>]>>;
418
467
  }, z.core.$strip>;
419
468
  export type PluginDesignFamilyPrepareArgs = z.infer<typeof PluginDesignFamilyPrepareArgs>;
420
469
  /**
@@ -423,9 +472,19 @@ export type PluginDesignFamilyPrepareArgs = z.infer<typeof PluginDesignFamilyPre
423
472
  * | Property | Type | Description |
424
473
  * |---|---|---|
425
474
  * | `values` | `Record<string, number \| string>` | Parameter values to change (partial) |
475
+ * | `snapshot` | {@linkcode PluginFamilySnapshotOption} | Also return a picture of the flexed family |
426
476
  */
427
477
  export declare const PluginDesignFamilyFlexArgs: z.ZodObject<{
428
478
  values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
479
+ snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
480
+ views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
481
+ top: "top";
482
+ front: "front";
483
+ right: "right";
484
+ iso: "iso";
485
+ }>>>;
486
+ tileSize: z.ZodOptional<z.ZodNumber>;
487
+ }, z.core.$strip>]>>;
429
488
  }, z.core.$strip>;
430
489
  export type PluginDesignFamilyFlexArgs = z.infer<typeof PluginDesignFamilyFlexArgs>;
431
490
  /**
@@ -475,6 +534,15 @@ export type PluginDesignFamilyPlaceArgs = z.infer<typeof PluginDesignFamilyPlace
475
534
  */
476
535
  export declare const PluginDesignFamilyGetParametersArgs: z.ZodObject<{
477
536
  component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
537
+ snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
538
+ views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
539
+ top: "top";
540
+ front: "front";
541
+ right: "right";
542
+ iso: "iso";
543
+ }>>>;
544
+ tileSize: z.ZodOptional<z.ZodNumber>;
545
+ }, z.core.$strip>]>>;
478
546
  }, z.core.$strip>;
479
547
  export type PluginDesignFamilyGetParametersArgs = z.infer<typeof PluginDesignFamilyGetParametersArgs>;
480
548
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"family.d.ts","sourceRoot":"","sources":["../../../src/api/design/family.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAkB,MAAM,eAAe,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,8BAAsB,qBAAqB;;IAGzC;;;;;;;;;;;;;;;;;OAiBG;aACa,YAAY,IAAI,eAAe,CAAC,qBAAqB,CAAC;IAEtE;;;;;;;;;;;;;;;;;;;;;;OAsBG;aACa,OAAO,CACrB,IAAI,EAAE,6BAA6B,GAClC,eAAe,CAAC,yBAAyB,CAAC;IAE7C;;;;;;;;;;;;;;;;;;;OAmBG;aACa,IAAI,CAClB,IAAI,EAAE,0BAA0B,G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AO,6BAA6B,CAAC,CAAA;AAEzF;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;iBAGrC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEvF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;iBAOtC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAErF;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;iBAI9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC;;;iBAG9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA"}
@@ -0,0 +1,237 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ import { ComponentHandle } from "../../handles";
4
+ /**
5
+ * Tag policy for structural line removal (mirrors the engine
6
+ * `GridLineTagPolicy` values verbatim): `"rewrite"` renumbers each affected
7
+ * wing's tag sequence after removal; `"preserve"` keeps the surviving lines'
8
+ * tags unchanged.
9
+ */
10
+ export declare const PluginGridLineTagPolicy: z.ZodEnum<{
11
+ preserve: "preserve";
12
+ rewrite: "rewrite";
13
+ }>;
14
+ export type PluginGridLineTagPolicy = z.infer<typeof PluginGridLineTagPolicy>;
15
+ /** A positional grid-line address — indices into `design.query.grids.get`'s `wings` arrays. */
16
+ export declare const PluginGridLineAddress: z.ZodObject<{
17
+ wing: z.ZodNumber;
18
+ line: z.ZodNumber;
19
+ }, z.core.$strip>;
20
+ export type PluginGridLineAddress = z.infer<typeof PluginGridLineAddress>;
21
+ /**
22
+ * One per-wing entry of {@linkcode PluginDesignGridsApi.updateWings} —
23
+ * addressed by wing index. `spanMin`/`spanMax` move the family's length
24
+ * handles (Snaptrude units).
25
+ */
26
+ export declare const PluginGridWingEntry: z.ZodObject<{
27
+ wing: z.ZodNumber;
28
+ spacing: z.ZodOptional<z.ZodNumber>;
29
+ count: z.ZodOptional<z.ZodNumber>;
30
+ spanMin: z.ZodOptional<z.ZodNumber>;
31
+ spanMax: z.ZodOptional<z.ZodNumber>;
32
+ }, z.core.$strip>;
33
+ export type PluginGridWingEntry = z.infer<typeof PluginGridWingEntry>;
34
+ /** Arguments for {@linkcode PluginDesignGridsApi.updateWings}. */
35
+ export declare const PluginDesignGridsUpdateWingsArgs: z.ZodObject<{
36
+ grid: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
37
+ wings: z.ZodArray<z.ZodObject<{
38
+ wing: z.ZodNumber;
39
+ spacing: z.ZodOptional<z.ZodNumber>;
40
+ count: z.ZodOptional<z.ZodNumber>;
41
+ spanMin: z.ZodOptional<z.ZodNumber>;
42
+ spanMax: z.ZodOptional<z.ZodNumber>;
43
+ }, z.core.$strip>>;
44
+ }, z.core.$strip>;
45
+ export type PluginDesignGridsUpdateWingsArgs = z.infer<typeof PluginDesignGridsUpdateWingsArgs>;
46
+ /**
47
+ * One per-line entry of {@linkcode PluginDesignGridsApi.updateLines} —
48
+ * addressed positionally by `{ wing, line }` indices (invalidated by
49
+ * structural edits; re-query after mutating). `distanceToPrevious` /
50
+ * `distanceToNext` set the typed distance to the adjacent line on that side
51
+ * and are mutually exclusive.
52
+ *
53
+ * `visible` is **hide-only** (`false`), mirroring the product: per-line show
54
+ * does not exist — showing the GROUP (`design.visibility.show`) restores all
55
+ * of its lines, exactly like the native Show All.
56
+ */
57
+ export declare const PluginGridLineEntry: z.ZodObject<{
58
+ wing: z.ZodNumber;
59
+ line: z.ZodNumber;
60
+ tag: z.ZodOptional<z.ZodString>;
61
+ distanceToPrevious: z.ZodOptional<z.ZodNumber>;
62
+ distanceToNext: z.ZodOptional<z.ZodNumber>;
63
+ props: z.ZodOptional<z.ZodObject<{
64
+ style: z.ZodOptional<z.ZodEnum<{
65
+ SOLID: "SOLID";
66
+ DASHED: "DASHED";
67
+ DOT_DASH: "DOT_DASH";
68
+ }>>;
69
+ weight: z.ZodOptional<z.ZodNumber>;
70
+ color: z.ZodOptional<z.ZodString>;
71
+ showStart: z.ZodOptional<z.ZodBoolean>;
72
+ showEnd: z.ZodOptional<z.ZodBoolean>;
73
+ }, z.core.$strip>>;
74
+ visible: z.ZodOptional<z.ZodLiteral<false>>;
75
+ }, z.core.$strip>;
76
+ export type PluginGridLineEntry = z.infer<typeof PluginGridLineEntry>;
77
+ /** Arguments for {@linkcode PluginDesignGridsApi.updateLines}. */
78
+ export declare const PluginDesignGridsUpdateLinesArgs: z.ZodObject<{
79
+ grid: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
80
+ lines: z.ZodArray<z.ZodObject<{
81
+ wing: z.ZodNumber;
82
+ line: z.ZodNumber;
83
+ tag: z.ZodOptional<z.ZodString>;
84
+ distanceToPrevious: z.ZodOptional<z.ZodNumber>;
85
+ distanceToNext: z.ZodOptional<z.ZodNumber>;
86
+ props: z.ZodOptional<z.ZodObject<{
87
+ style: z.ZodOptional<z.ZodEnum<{
88
+ SOLID: "SOLID";
89
+ DASHED: "DASHED";
90
+ DOT_DASH: "DOT_DASH";
91
+ }>>;
92
+ weight: z.ZodOptional<z.ZodNumber>;
93
+ color: z.ZodOptional<z.ZodString>;
94
+ showStart: z.ZodOptional<z.ZodBoolean>;
95
+ showEnd: z.ZodOptional<z.ZodBoolean>;
96
+ }, z.core.$strip>>;
97
+ visible: z.ZodOptional<z.ZodLiteral<false>>;
98
+ }, z.core.$strip>>;
99
+ }, z.core.$strip>;
100
+ export type PluginDesignGridsUpdateLinesArgs = z.infer<typeof PluginDesignGridsUpdateLinesArgs>;
101
+ /** Arguments for {@linkcode PluginDesignGridsApi.addLine}. */
102
+ export declare const PluginDesignGridsAddLineArgs: z.ZodObject<{
103
+ grid: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
104
+ wing: z.ZodNumber;
105
+ position: z.ZodNumber;
106
+ }, z.core.$strip>;
107
+ export type PluginDesignGridsAddLineArgs = z.infer<typeof PluginDesignGridsAddLineArgs>;
108
+ /** Arguments for {@linkcode PluginDesignGridsApi.removeLines}. */
109
+ export declare const PluginDesignGridsRemoveLinesArgs: z.ZodObject<{
110
+ grid: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
111
+ lines: z.ZodArray<z.ZodObject<{
112
+ wing: z.ZodNumber;
113
+ line: z.ZodNumber;
114
+ }, z.core.$strip>>;
115
+ tagPolicy: z.ZodOptional<z.ZodEnum<{
116
+ preserve: "preserve";
117
+ rewrite: "rewrite";
118
+ }>>;
119
+ }, z.core.$strip>;
120
+ export type PluginDesignGridsRemoveLinesArgs = z.infer<typeof PluginDesignGridsRemoveLinesArgs>;
121
+ /**
122
+ * `design.grids.*` — structural edits on a grid's line structure (the
123
+ * entity-family home for grid-specific operations, like `design.doors`).
124
+ *
125
+ * Lines are addressed positionally as `{ wing, line }` index pairs into the
126
+ * `wings` arrays returned by `design.query.grids.get`. Adding, removing, or
127
+ * re-counting lines re-indexes the wing — re-query after every structural edit.
128
+ *
129
+ * Group-level edits (default styling, angle, storey visibility) live on
130
+ * `design.update.grid`; creation lives on `design.create.grid*`.
131
+ *
132
+ * Accessed via `snaptrude.design.grids`.
133
+ */
134
+ export declare abstract class PluginDesignGridsApi {
135
+ constructor();
136
+ /**
137
+ * Update one or more **wings** of a grid with sparse per-wing entries —
138
+ * `spacing` (uniform re-space), `count` (grow/truncate + tag renumber),
139
+ * `spanMin`/`spanMax` (family length handles). Every change routes through
140
+ * the exact setters the native panel uses — each changed field commits its
141
+ * own undoable command, identical to editing that field in the panel.
142
+ *
143
+ * A `count` change re-indexes the wing's lines — positional `{ wing, line }`
144
+ * addresses held from before the call are stale afterwards; re-query.
145
+ *
146
+ * @param grid - The grid group
147
+ * @param wings - Sparse {@linkcode PluginGridWingEntry} entries (≥ 1)
148
+ * @returns `true` once applied
149
+ *
150
+ * @examplePrompt Change this grid's spacing to 8 metres
151
+ * @examplePrompt Make this grid 10 by 12 lines
152
+ *
153
+ * # Example
154
+ * ```ts
155
+ * await snaptrude.design.grids.updateWings(grid, [{ wing: 0, spacing: 8, count: 10 }])
156
+ * ```
157
+ */
158
+ abstract updateWings(grid: ComponentHandle, wings: PluginGridWingEntry[]): PluginApiReturn<boolean>;
159
+ /**
160
+ * Update one or more **lines** of a grid with sparse per-line entries —
161
+ * `tag`, `distanceToPrevious`/`distanceToNext` (typed distance to the
162
+ * neighbour on that side; mutually exclusive), `props` (per-line style
163
+ * overrides), and `visible: false` (hide). Every change routes through the
164
+ * exact setters the native panel uses — each changed field commits its own
165
+ * undoable command, identical to editing that field in the panel.
166
+ *
167
+ * Visibility mirrors the product exactly: `visible` accepts only `false` —
168
+ * per-line show does not exist. Hiding lines that would leave NO visible
169
+ * line hides the whole GROUP instead (the native last-line rule; those line
170
+ * flags stay untouched). To bring hidden lines back, show the group
171
+ * (`design.visibility.show([grid])`) — it restores ALL of its lines, like
172
+ * the native Show All.
173
+ *
174
+ * @param grid - The grid group
175
+ * @param lines - Sparse {@linkcode PluginGridLineEntry} entries (≥ 1)
176
+ * @returns `true` once applied
177
+ *
178
+ * @examplePrompt Rename grid line 2 to "B"
179
+ * @examplePrompt Move this grid line 4 metres from its neighbour
180
+ * @examplePrompt Hide grid line 3 on this grid
181
+ *
182
+ * # Example
183
+ * ```ts
184
+ * await snaptrude.design.grids.updateLines(grid, [
185
+ * { wing: 0, line: 1, tag: "B", distanceToPrevious: 4 },
186
+ * ])
187
+ * ```
188
+ */
189
+ abstract updateLines(grid: ComponentHandle, lines: PluginGridLineEntry[]): PluginApiReturn<boolean>;
190
+ /**
191
+ * Insert a parallel grid line into a wing at an explicit position along the
192
+ * wing's spacing axis (Snaptrude units, wing-local — line 0's position can
193
+ * be read from its curve). Sibling lines do not shift; the wing's tag
194
+ * sequence is renumbered. Undoable.
195
+ *
196
+ * @param grid - The grid group
197
+ * @param wing - Wing index
198
+ * @param position - Position along the wing's spacing axis (Snaptrude units)
199
+ * @returns `true` once inserted
200
+ * @throws `VALIDATION` on a bad wing index or non-finite position
201
+ *
202
+ * @examplePrompt Add a grid line between lines 2 and 3
203
+ * @examplePrompt Insert an extra grid line 4 metres from line A
204
+ *
205
+ * # Example
206
+ * ```ts
207
+ * await snaptrude.design.grids.addLine(grid, 0, 12.5)
208
+ * ```
209
+ */
210
+ abstract addLine(grid: ComponentHandle, wing: number, position: number): PluginApiReturn<boolean>;
211
+ /**
212
+ * Remove grid lines by positional address, as ONE undoable step. With
213
+ * `tagPolicy: "rewrite"` (default) each affected wing renumbers its tag
214
+ * sequence; `"preserve"` keeps surviving tags unchanged. A wing emptied of
215
+ * lines is dropped from the group.
216
+ *
217
+ * Removing EVERY line of the group is rejected — delete the group instead
218
+ * (`design.delete.entities`).
219
+ *
220
+ * @param grid - The grid group
221
+ * @param lines - Positional addresses to remove (see `design.query.grids.get`)
222
+ * @param tagPolicy - `"rewrite"` (default) or `"preserve"`
223
+ * @returns `true` once removed
224
+ * @throws `VALIDATION` on out-of-range addresses; `OPERATION_FAILED` when the
225
+ * removal would delete the group's last line
226
+ *
227
+ * @examplePrompt Delete grid line B
228
+ * @examplePrompt Remove the last two lines of this grid without renumbering
229
+ *
230
+ * # Example
231
+ * ```ts
232
+ * await snaptrude.design.grids.removeLines(grid, [{ wing: 0, line: 2 }], "preserve")
233
+ * ```
234
+ */
235
+ abstract removeLines(grid: ComponentHandle, lines: PluginGridLineAddress[], tagPolicy?: PluginGridLineTagPolicy): PluginApiReturn<boolean>;
236
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MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEvF,kEAAkE;AAClE,eAAO,MAAM,gCAAgC;;;;;;;;;;iBAI3C,CAAA;AACF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,gCAAgC,CACxC,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,8BAAsB,oBAAoB;;IAGxC;;;;;;;;;;;;;;;;;;;;;OAqBG;aACa,WAAW,CACzB,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,mBAAmB,EAAE,GAC3B,eAAe,CAAC,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;aACa,WAAW,CACzB,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,mBAAmB,EAAE,GAC3B,eAAe,CAAC,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;;;;OAmBG;aACa,OAAO,CACrB,IAAI,EAAE,eAAe,EACrB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,eAAe,CAAC,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;aACa,WAAW,CACzB,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,qBAAqB,EAAE,EAC9B,SAAS,CAAC,EAAE,uBAAuB,GAClC,eAAe,CAAC,OAAO,CAAC;CAC5B"}
@@ -17,6 +17,7 @@ import { PluginDesignVisibilityApi } from "./visibility";
17
17
  import { PluginDesignDimensionsApi } from "./dimensions";
18
18
  import { PluginDesignTypesApi } from "./types";
19
19
  import { PluginDesignFamilyApi } from "./family";
20
+ import { PluginDesignGridsApi } from "./grids";
20
21
  import { PluginDesignChangeResult } from "./lock";
21
22
  /**
22
23
  * `snaptrude.design.*` — author, query & edit BIM geometry.
@@ -74,6 +75,8 @@ export declare abstract class PluginDesignApi {
74
75
  abstract types: PluginDesignTypesApi;
75
76
  /** Author parametric families from a JSON spec. See {@linkcode PluginDesignFamilyApi}. */
76
77
  abstract family: PluginDesignFamilyApi;
78
+ /** Structural edits on a grid's line structure. See {@linkcode PluginDesignGridsApi}. */
79
+ abstract grids: PluginDesignGridsApi;
77
80
  /**
78
81
  * Lock entities so they cannot be edited. Undoable. Cascades to void/door/window
79
82
  * children, stacked-wall companions, and terrain neighborhood; skips
@@ -253,4 +256,5 @@ export * from "./visibility";
253
256
  export * from "./dimensions";
254
257
  export * from "./types";
255
258
  export * from "./family";
259
+ export * from "./grids";
256
260
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/design/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,yBAAyB,EAA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