@snaptrude/plugin-core 0.7.1 → 0.8.0

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 (130) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/api-manifest.full.json +6442 -0
  3. package/api-manifest.json +2029 -128
  4. package/dist/api/core/camera/index.d.ts +208 -0
  5. package/dist/api/core/camera/index.d.ts.map +1 -0
  6. package/dist/api/core/comment/index.d.ts +105 -2
  7. package/dist/api/core/comment/index.d.ts.map +1 -1
  8. package/dist/api/core/geom/create/index.d.ts +13 -13
  9. package/dist/api/core/geom/delete/index.d.ts +8 -2
  10. package/dist/api/core/geom/delete/index.d.ts.map +1 -1
  11. package/dist/api/core/geom/query/arc.d.ts +5 -5
  12. package/dist/api/core/geom/query/brep.d.ts +18 -18
  13. package/dist/api/core/geom/query/circle.d.ts +18 -18
  14. package/dist/api/core/geom/query/contour.d.ts +20 -20
  15. package/dist/api/core/geom/query/curve.d.ts +49 -49
  16. package/dist/api/core/geom/query/edge.d.ts +5 -5
  17. package/dist/api/core/geom/query/face.d.ts +16 -16
  18. package/dist/api/core/geom/query/halfedge.d.ts +8 -8
  19. package/dist/api/core/geom/query/profile.d.ts +19 -19
  20. package/dist/api/core/geom/query/vertex.d.ts +8 -8
  21. package/dist/api/core/geom/update/contour.d.ts +14 -14
  22. package/dist/api/core/geom/update/curve.d.ts +7 -7
  23. package/dist/api/core/geom/update/profile.d.ts +16 -16
  24. package/dist/api/core/handles/index.d.ts +210 -0
  25. package/dist/api/core/handles/index.d.ts.map +1 -0
  26. package/dist/api/core/index.d.ts +15 -0
  27. package/dist/api/core/index.d.ts.map +1 -1
  28. package/dist/api/core/io/export/index.d.ts +132 -0
  29. package/dist/api/core/io/export/index.d.ts.map +1 -0
  30. package/dist/api/core/io/import/index.d.ts +1 -1
  31. package/dist/api/core/io/index.d.ts +5 -0
  32. package/dist/api/core/io/index.d.ts.map +1 -1
  33. package/dist/api/core/layers.d.ts +7 -7
  34. package/dist/api/core/proposals/index.d.ts +65 -9
  35. package/dist/api/core/proposals/index.d.ts.map +1 -1
  36. package/dist/api/core/user.d.ts +44 -0
  37. package/dist/api/core/user.d.ts.map +1 -0
  38. package/dist/api/design/boolean/index.d.ts +4 -4
  39. package/dist/api/design/create/index.d.ts +139 -44
  40. package/dist/api/design/create/index.d.ts.map +1 -1
  41. package/dist/api/design/doors/index.d.ts +36 -0
  42. package/dist/api/design/doors/index.d.ts.map +1 -1
  43. package/dist/api/design/edit/index.d.ts +1 -1
  44. package/dist/api/design/erase/index.d.ts +2 -2
  45. package/dist/api/design/furniture/index.d.ts +114 -3
  46. package/dist/api/design/furniture/index.d.ts.map +1 -1
  47. package/dist/api/design/index.d.ts +10 -0
  48. package/dist/api/design/index.d.ts.map +1 -1
  49. package/dist/api/design/materials/index.d.ts +111 -14
  50. package/dist/api/design/materials/index.d.ts.map +1 -1
  51. package/dist/api/design/query/index.d.ts +31 -1
  52. package/dist/api/design/query/index.d.ts.map +1 -1
  53. package/dist/api/design/query/spaces.d.ts +5 -5
  54. package/dist/api/design/transform/index.d.ts +83 -14
  55. package/dist/api/design/transform/index.d.ts.map +1 -1
  56. package/dist/api/design/types/index.d.ts +181 -0
  57. package/dist/api/design/types/index.d.ts.map +1 -0
  58. package/dist/api/design/update/index.d.ts +335 -2
  59. package/dist/api/design/update/index.d.ts.map +1 -1
  60. package/dist/api/design/visibility.d.ts +98 -0
  61. package/dist/api/design/visibility.d.ts.map +1 -0
  62. package/dist/api/entity/referenceLine.d.ts +2 -2
  63. package/dist/api/entity/space.d.ts +19 -19
  64. package/dist/api/entity/story.d.ts +128 -15
  65. package/dist/api/entity/story.d.ts.map +1 -1
  66. package/dist/api/presentation/annotate.d.ts +448 -0
  67. package/dist/api/presentation/annotate.d.ts.map +1 -0
  68. package/dist/api/presentation/diagrams.d.ts +49 -8
  69. package/dist/api/presentation/diagrams.d.ts.map +1 -1
  70. package/dist/api/presentation/export.d.ts +104 -0
  71. package/dist/api/presentation/export.d.ts.map +1 -0
  72. package/dist/api/presentation/index.d.ts +38 -0
  73. package/dist/api/presentation/index.d.ts.map +1 -1
  74. package/dist/api/presentation/sheets.d.ts +410 -13
  75. package/dist/api/presentation/sheets.d.ts.map +1 -1
  76. package/dist/api/presentation/views.d.ts +165 -10
  77. package/dist/api/presentation/views.d.ts.map +1 -1
  78. package/dist/api/program/areas.d.ts +63 -3
  79. package/dist/api/program/areas.d.ts.map +1 -1
  80. package/dist/api/program/cores.d.ts +3 -99
  81. package/dist/api/program/cores.d.ts.map +1 -1
  82. package/dist/api/program/index.d.ts +2 -2
  83. package/dist/api/program/index.d.ts.map +1 -1
  84. package/dist/api/program/layout.d.ts +172 -12
  85. package/dist/api/program/layout.d.ts.map +1 -1
  86. package/dist/api/program/site.d.ts +11 -8
  87. package/dist/api/program/site.d.ts.map +1 -1
  88. package/dist/api/program/spreadsheet.d.ts +105 -13
  89. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  90. package/dist/handles.d.ts +64 -25
  91. package/dist/handles.d.ts.map +1 -1
  92. package/dist/index.cjs +2316 -1644
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/index.js +2224 -1639
  95. package/dist/index.js.map +1 -1
  96. package/package.json +1 -1
  97. package/src/api/core/camera/index.ts +212 -0
  98. package/src/api/core/comment/index.ts +120 -2
  99. package/src/api/core/geom/delete/index.ts +6 -0
  100. package/src/api/core/handles/index.ts +233 -0
  101. package/src/api/core/index.ts +15 -0
  102. package/src/api/core/io/export/index.ts +124 -0
  103. package/src/api/core/io/index.ts +5 -0
  104. package/src/api/core/proposals/index.ts +71 -11
  105. package/src/api/core/user.ts +46 -0
  106. package/src/api/design/create/index.ts +166 -36
  107. package/src/api/design/doors/index.ts +40 -0
  108. package/src/api/design/furniture/index.ts +127 -3
  109. package/src/api/design/index.ts +10 -0
  110. package/src/api/design/materials/index.ts +157 -30
  111. package/src/api/design/query/index.ts +33 -7
  112. package/src/api/design/transform/index.ts +89 -12
  113. package/src/api/design/types/index.ts +156 -0
  114. package/src/api/design/update/index.ts +402 -6
  115. package/src/api/design/visibility.ts +109 -0
  116. package/src/api/entity/story.ts +141 -15
  117. package/src/api/presentation/annotate.ts +360 -0
  118. package/src/api/presentation/diagrams.ts +53 -8
  119. package/src/api/presentation/export.ts +104 -0
  120. package/src/api/presentation/index.ts +46 -0
  121. package/src/api/presentation/sheets.ts +346 -13
  122. package/src/api/presentation/views.ts +164 -12
  123. package/src/api/program/areas.ts +57 -6
  124. package/src/api/program/cores.ts +3 -91
  125. package/src/api/program/index.ts +2 -2
  126. package/src/api/program/layout.ts +182 -12
  127. package/src/api/program/site.ts +11 -8
  128. package/src/api/program/spreadsheet.ts +125 -29
  129. package/src/handles.ts +77 -13
  130. package/tsconfig.json +7 -2
@@ -0,0 +1,210 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../../types";
3
+ import type { AnyArenaHandle } from "../../../handles";
4
+ /**
5
+ * The 12 registry-arena handle kinds — the releasable families. Entity-style
6
+ * handles (component / material / underlay / terrain / importJob / comment) are
7
+ * raw engine ids with no arena entry and therefore no lifecycle: passing one to
8
+ * `release` is a silent no-op like any other unknown id.
9
+ */
10
+ export declare const ArenaKind: z.ZodEnum<{
11
+ vec3: "vec3";
12
+ quat: "quat";
13
+ line: "line";
14
+ arc: "arc";
15
+ circle: "circle";
16
+ profile: "profile";
17
+ contour: "contour";
18
+ brep: "brep";
19
+ face: "face";
20
+ edge: "edge";
21
+ halfedge: "halfedge";
22
+ vertex: "vertex";
23
+ }>;
24
+ export type ArenaKind = z.infer<typeof ArenaKind>;
25
+ /** Max handles accepted by a single `release` / `endScope(retain)` call. */
26
+ export declare const RELEASE_BATCH_MAX = 10000;
27
+ /**
28
+ * An opaque token identifying a handle scope opened by
29
+ * {@linkcode PluginCoreHandlesApi.beginScope}. It is NOT an arena handle —
30
+ * it pins no memory, and `release(token)` is a silent no-op; only
31
+ * {@linkcode PluginCoreHandlesApi.endScope} consumes it.
32
+ */
33
+ export type ScopeToken = string;
34
+ /**
35
+ * Handle lifecycle — free host-side handle registry entries the plugin no
36
+ * longer needs, individually ({@linkcode release}), by kind
37
+ * ({@linkcode releaseAll}), or as a mint-recording region
38
+ * ({@linkcode beginScope} / {@linkcode endScope}).
39
+ *
40
+ * Releasing is a handle-lifecycle operation only: it frees the registry entry
41
+ * (host memory + quota room) and makes the handle unresolvable. It never
42
+ * deletes engine-side geometry or scene entities.
43
+ *
44
+ * Accessed via `snaptrude.core.handles`.
45
+ */
46
+ export declare abstract class PluginCoreHandlesApi {
47
+ constructor();
48
+ /**
49
+ * Free arena handles in bulk. Unknown, foreign, or already-released ids are
50
+ * silent no-ops — there is no per-id result and no count, so responses can
51
+ * never be used as an existence oracle.
52
+ *
53
+ * @param handles The handles to release (max {@linkcode RELEASE_BATCH_MAX} per call)
54
+ * @returns Nothing
55
+ *
56
+ * # Example
57
+ * ```ts
58
+ * const faces = await snaptrude.core.geom.query.brep.listFaces(brep)
59
+ * // ... read what you need ...
60
+ * await snaptrude.core.handles.release(faces)
61
+ * ```
62
+ */
63
+ abstract release(handles: ReadonlyArray<AnyArenaHandle>): PluginApiReturn<void>;
64
+ /**
65
+ * Free every live arena handle of one kind, or ALL arena handles when the
66
+ * kind is omitted. Useful at batch boundaries — e.g. a poll loop that mints
67
+ * a fresh footprint contour per tick.
68
+ *
69
+ * @param kind Optional arena kind to restrict the sweep to
70
+ * @returns Nothing
71
+ *
72
+ * # Example
73
+ * ```ts
74
+ * const footprint = await snaptrude.design.query.spaces.getFootprint(space)
75
+ * // ... measure ...
76
+ * await snaptrude.core.handles.releaseAll("contour")
77
+ * ```
78
+ */
79
+ abstract releaseAll(kind?: ArenaKind): PluginApiReturn<void>;
80
+ /**
81
+ * Open a mint-recording scope: every arena handle MINTED after this call
82
+ * (fresh mints only — identity-deduped re-registrations of pre-existing
83
+ * objects are not captured) is freed when the matching
84
+ * {@linkcode endScope} runs. Scopes nest, up to 64 deep — always pair
85
+ * begin/end in try/finally.
86
+ *
87
+ * @returns The scope token to pass to {@linkcode endScope}
88
+ *
89
+ * # Example
90
+ * ```ts
91
+ * for (const space of spaces) {
92
+ * const scope = await snaptrude.core.handles.beginScope()
93
+ * try {
94
+ * const footprint = await snaptrude.design.query.spaces.getFootprint(space)
95
+ * const area = await snaptrude.core.geom.query.contour.getArea(footprint)
96
+ * } finally {
97
+ * await snaptrude.core.handles.endScope(scope) // footprint (and intermediates) freed
98
+ * }
99
+ * }
100
+ * ```
101
+ */
102
+ abstract beginScope(): PluginApiReturn<ScopeToken>;
103
+ /**
104
+ * Close a scope by its token and free every handle it recorded, except those
105
+ * listed in `retain`. Retained handles are promoted to the enclosing scope
106
+ * (if any), so nesting composes like block scopes. Closing is
107
+ * token-addressed: an out-of-order close (interleaved async tasks) frees
108
+ * only that scope's mints and leaves other open scopes intact. Always pair
109
+ * begin/end in try/finally so a thrown body cannot leak the scope.
110
+ *
111
+ * @param scope The token returned by the matching {@linkcode beginScope}
112
+ * @param retain Handles minted inside the scope that must survive it
113
+ * @returns Nothing
114
+ *
115
+ * # Example
116
+ * ```ts
117
+ * const scope = await snaptrude.core.handles.beginScope()
118
+ * const outline = await snaptrude.design.query.spaces.getFootprint(space)
119
+ * const outer = await snaptrude.core.geom.query.contour.getOuterProfile(outline)
120
+ * await snaptrude.core.handles.endScope(scope, [outer]) // outline freed, outer survives
121
+ * ```
122
+ */
123
+ abstract endScope(scope: ScopeToken, retain?: ReadonlyArray<AnyArenaHandle>): PluginApiReturn<void>;
124
+ /**
125
+ * Live handle-registry statistics for the calling plugin, plus the host
126
+ * page's JS heap usage (when the browser exposes it). Diagnostic surface for
127
+ * verifying that releases actually shrink host memory.
128
+ *
129
+ * @returns Arena entry counts, open scope depth, and host heap bytes
130
+ *
131
+ * # Example
132
+ * ```ts
133
+ * const before = await snaptrude.core.handles.stats()
134
+ * await snaptrude.core.handles.releaseAll("vec3")
135
+ * const after = await snaptrude.core.handles.stats()
136
+ * console.log(`freed ${before.values - after.values} value entries`)
137
+ * ```
138
+ */
139
+ abstract stats(): PluginApiReturn<PluginHandlesStatsResult>;
140
+ }
141
+ /**
142
+ * Arguments for {@linkcode PluginCoreHandlesApi.release}.
143
+ *
144
+ * | Property | Type | Description |
145
+ * |---|---|---|
146
+ * | `handles` | `string[]` | Handles to release (≤ {@linkcode RELEASE_BATCH_MAX}) |
147
+ */
148
+ export declare const PluginHandlesReleaseArgs: z.ZodObject<{
149
+ handles: z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>>;
150
+ }, z.core.$strip>;
151
+ export type PluginHandlesReleaseArgs = z.infer<typeof PluginHandlesReleaseArgs>;
152
+ /**
153
+ * Arguments for {@linkcode PluginCoreHandlesApi.releaseAll}.
154
+ *
155
+ * | Property | Type | Description |
156
+ * |---|---|---|
157
+ * | `kind` | {@linkcode ArenaKind} (optional) | Restrict the sweep to one kind |
158
+ */
159
+ export declare const PluginHandlesReleaseAllArgs: z.ZodObject<{
160
+ kind: z.ZodOptional<z.ZodEnum<{
161
+ vec3: "vec3";
162
+ quat: "quat";
163
+ line: "line";
164
+ arc: "arc";
165
+ circle: "circle";
166
+ profile: "profile";
167
+ contour: "contour";
168
+ brep: "brep";
169
+ face: "face";
170
+ edge: "edge";
171
+ halfedge: "halfedge";
172
+ vertex: "vertex";
173
+ }>>;
174
+ }, z.core.$strip>;
175
+ export type PluginHandlesReleaseAllArgs = z.infer<typeof PluginHandlesReleaseAllArgs>;
176
+ /**
177
+ * Arguments for {@linkcode PluginCoreHandlesApi.endScope}.
178
+ *
179
+ * | Property | Type | Description |
180
+ * |---|---|---|
181
+ * | `scope` | {@linkcode ScopeToken} | Token from the matching `beginScope` |
182
+ * | `retain` | `string[]` (optional) | Scope-minted handles that must survive |
183
+ */
184
+ export declare const PluginHandlesEndScopeArgs: z.ZodObject<{
185
+ scope: z.ZodString;
186
+ retain: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>>>;
187
+ }, z.core.$strip>;
188
+ export type PluginHandlesEndScopeArgs = z.infer<typeof PluginHandlesEndScopeArgs>;
189
+ /**
190
+ * Result of {@linkcode PluginCoreHandlesApi.stats}.
191
+ *
192
+ * | Property | Type | Description |
193
+ * |---|---|---|
194
+ * | `resources` | `number` | Live resource-arena entries (profile/contour) |
195
+ * | `values` | `number` | Live value-arena entries (vec3/quat/line/arc/circle) |
196
+ * | `topology` | `number` | Live topology-arena entries (brep/face/edge/halfedge/vertex) |
197
+ * | `scopes` | `number` | Currently open handle scopes |
198
+ * | `hostHeapUsedBytes` | `number \| null` | Host page `usedJSHeapSize` (null where unsupported) |
199
+ * | `hostHeapTotalBytes` | `number \| null` | Host page `totalJSHeapSize` (null where unsupported) |
200
+ */
201
+ export declare const PluginHandlesStatsResult: z.ZodObject<{
202
+ resources: z.ZodNumber;
203
+ values: z.ZodNumber;
204
+ topology: z.ZodNumber;
205
+ scopes: z.ZodNumber;
206
+ hostHeapUsedBytes: z.ZodNullable<z.ZodNumber>;
207
+ hostHeapTotalBytes: z.ZodNullable<z.ZodNumber>;
208
+ }, z.core.$strip>;
209
+ export type PluginHandlesStatsResult = z.infer<typeof PluginHandlesStatsResult>;
210
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/handles/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGtD;;;;;GAKG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;EAapB,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAEjD,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,QAAS,CAAA;AAEvC;;;;;GAK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luginCoreBuildingsApi } from "./buildings";
10
10
  import { PluginCoreLayersApi } from "./layers";
11
11
  import { PluginCoreTagsApi } from "./tags";
12
12
  import { PluginCoreIoApi } from "./io";
13
+ import { PluginCoreHandlesApi } from "./handles";
13
14
  import { PluginCoreProposalsApi } from "./proposals";
15
+ import { PluginCameraApi } from "./camera";
16
+ import { PluginUserApi } from "./user";
14
17
  /**
15
18
  * Core primitives and infrastructure used across the plugin API.
16
19
  *
@@ -19,6 +22,8 @@ import { PluginCoreProposalsApi } from "./proposals";
19
22
  * - {@linkcode PluginCoreApi.history} — Undo / redo of committed history entries
20
23
  * - {@linkcode PluginCoreApi.units} — Unit-type queries and conversion
21
24
  * - {@linkcode PluginCoreApi.zoom} — Camera zoom controls (extents / selection)
25
+ * - {@linkcode PluginCoreApi.camera} — Camera controls — position, standard views, 2D/3D mode
26
+ * - {@linkcode PluginCoreApi.user} — User locale — timezone & language
22
27
  * - {@linkcode PluginCoreApi.project} — Project-level settings and info
23
28
  * - {@linkcode PluginCoreApi.comment} — Comments: create, edit, resolve, tag, list
24
29
  * - {@linkcode PluginCoreApi.groups} — Read & edit the group hierarchy
@@ -26,6 +31,7 @@ import { PluginCoreProposalsApi } from "./proposals";
26
31
  * - {@linkcode PluginCoreApi.layers} — Read & toggle storey drawing/reference layers
27
32
  * - {@linkcode PluginCoreApi.tags} — Tag catalog + assignment
28
33
  * - {@linkcode PluginCoreApi.io} — Import files (image/pdf/cad/model/terrain), poll jobs, manage underlays
34
+ * - {@linkcode PluginCoreApi.handles} — Handle lifecycle: release, releaseAll, scopes
29
35
  * - {@linkcode PluginCoreApi.proposals} — Design options: read, create, rename, switch, delete
30
36
  */
31
37
  export declare abstract class PluginCoreApi {
@@ -39,6 +45,10 @@ export declare abstract class PluginCoreApi {
39
45
  abstract units: PluginUnitsApi;
40
46
  /** Camera zoom controls. See {@linkcode PluginZoomApi}. */
41
47
  abstract zoom: PluginZoomApi;
48
+ /** Camera controls — position, standard views, 2D/3D mode. See {@linkcode PluginCameraApi}. */
49
+ abstract camera: PluginCameraApi;
50
+ /** User locale — timezone & language. See {@linkcode PluginUserApi}. */
51
+ abstract user: PluginUserApi;
42
52
  /** Project-level settings and info. See {@linkcode PluginProjectApi}. */
43
53
  abstract project: PluginProjectApi;
44
54
  /** Comments — create, edit, resolve, tag, list. See {@linkcode PluginCommentApi}. */
@@ -53,6 +63,8 @@ export declare abstract class PluginCoreApi {
53
63
  abstract tags: PluginCoreTagsApi;
54
64
  /** I/O — file import, import jobs, and underlay management. See {@linkcode PluginCoreIoApi}. */
55
65
  abstract io: PluginCoreIoApi;
66
+ /** Handle lifecycle — release, releaseAll, and mint-recording scopes. See {@linkcode PluginCoreHandlesApi}. */
67
+ abstract handles: PluginCoreHandlesApi;
56
68
  /** Proposals — design options: read, create, rename, switch, delete. See {@linkcode PluginCoreProposalsApi}. */
57
69
  abstract proposals: PluginCoreProposalsApi;
58
70
  constructor();
@@ -62,6 +74,8 @@ export * from "./geom";
62
74
  export * from "./history";
63
75
  export * from "./units";
64
76
  export * from "./zoom";
77
+ export * from "./camera";
78
+ export * from "./user";
65
79
  export * from "./project";
66
80
  export * from "./comment";
67
81
  export * from "./groups";
@@ -69,5 +83,6 @@ export * from "./buildings";
69
83
  export * from "./layers";
70
84
  export * from "./tags";
71
85
  export * from "./io";
86
+ export * from "./handles";
72
87
  export * from "./proposals";
73
88
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,gB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od";
2
+ import { PluginApiReturn } from "../../../../types";
3
+ /**
4
+ * Serialization format for {@link PluginCoreIoExportApi.model}.
5
+ *
6
+ * `glb` / `obj` serialize in the browser; `fbx` / `3ds` run the same server
7
+ * conversion the app's Export dialog uses and return a **zip** containing the
8
+ * converted file.
9
+ */
10
+ export declare const ExportModelFormat: z.ZodEnum<{
11
+ fbx: "fbx";
12
+ obj: "obj";
13
+ "3ds": "3ds";
14
+ glb: "glb";
15
+ }>;
16
+ export type ExportModelFormat = z.infer<typeof ExportModelFormat>;
17
+ /**
18
+ * What to export: the whole model (`"scene"`, default) or only the current
19
+ * selection (`"selection"`).
20
+ */
21
+ export declare const ExportScope: z.ZodEnum<{
22
+ scene: "scene";
23
+ selection: "selection";
24
+ }>;
25
+ export type ExportScope = z.infer<typeof ExportScope>;
26
+ /**
27
+ * A serialized model file returned by {@link PluginCoreIoExportApi.model}.
28
+ *
29
+ * | Property | Type | Description |
30
+ * |---|---|---|
31
+ * | `fileName` | `string` | Suggested file name incl. extension (e.g. `"model.glb"`) |
32
+ * | `mimeType` | `string` | MIME type (`"model/gltf-binary"` for glb, `"text/plain"` for obj) |
33
+ * | `dataBase64` | `string` | The file's bytes, base64-encoded (decode to save/download) |
34
+ */
35
+ export declare const ExportedFile: z.ZodObject<{
36
+ fileName: z.ZodString;
37
+ mimeType: z.ZodString;
38
+ dataBase64: z.ZodString;
39
+ }, z.core.$strip>;
40
+ export type ExportedFile = z.infer<typeof ExportedFile>;
41
+ /**
42
+ * Model export — serialize the scene (or selection) to a downloadable 3D file.
43
+ *
44
+ * `core.io.export.model` hands you the file bytes as base64 — no download
45
+ * dialog opens; the plugin decides what to do with the result (save it, POST
46
+ * it, diff it). Four formats:
47
+ *
48
+ * - `"glb"` — binary glTF (`model/gltf-binary`); geometry + materials,
49
+ * serialized in the browser (nothing is uploaded).
50
+ * - `"obj"` — Wavefront OBJ text (`text/plain`); geometry only, serialized in
51
+ * the browser.
52
+ * - `"fbx"` / `"3ds"` — Autodesk FBX / 3D Studio; the scene is uploaded to the
53
+ * same `/exportmodel/` conversion service the app's Export dialog uses, and
54
+ * the call resolves once the converted artifact is fetched back — a **zip**
55
+ * (`application/zip`) containing the `.fbx`/`.3ds` file. Whole-scene only
56
+ * (`scope: "selection"` is rejected). Conversion runs on the server and is
57
+ * bounded by the per-call plugin timeout (60 s) — very large models may
58
+ * exceed it and reject with `TIMEOUT`.
59
+ *
60
+ * For the browser formats, only real model geometry is exported (walls, slabs,
61
+ * roofs, floors, doors, windows, furniture, staircases, masses, ceilings,
62
+ * mullions, beams, columns, terrain); UI helpers, hidden objects, and
63
+ * hidden-bucket objects are excluded — matching the app's GLB export. The
64
+ * server formats convert the full serialized scene (hidden-bucket objects
65
+ * excluded), exactly like the Export dialog. This is a **read**: it never
66
+ * mutates the model.
67
+ *
68
+ * > Server-backed BIM exports (RVT / IFC / DWG) are **not** exposed here — those
69
+ * > run as fire-and-forget Forge jobs that stream a browser download and return
70
+ * > no retrievable bytes. Use the app's Export menu for those.
71
+ *
72
+ * Accessed via `snaptrude.core.io.export`.
73
+ */
74
+ export declare abstract class PluginCoreIoExportApi {
75
+ constructor();
76
+ /**
77
+ * Export the model to a 3D file and return its bytes as base64.
78
+ *
79
+ * @param format - `"glb"` (binary glTF, geometry + materials), `"obj"`
80
+ * (Wavefront OBJ text, geometry only) — both serialized in the browser —
81
+ * or `"fbx"` / `"3ds"`, converted by the app's export service and returned
82
+ * as a zip containing the converted file.
83
+ * @param scope - `"scene"` (default) for the whole model, or `"selection"` for
84
+ * only the currently selected objects (browser formats only — `"fbx"`/`"3ds"`
85
+ * reject it). An empty selection yields an empty file.
86
+ * @returns an {@linkcode ExportedFile} — `{ fileName, mimeType, dataBase64 }`.
87
+ * @throws if the format is unsupported, `scope: "selection"` is combined with a
88
+ * server format, or the serialization/conversion fails.
89
+ *
90
+ * @examplePrompt Export the model as a GLB
91
+ * @examplePrompt Give me the whole scene as an OBJ file
92
+ * @examplePrompt Export just my selection to GLB
93
+ * @examplePrompt Download the model as an FBX file
94
+ * @examplePrompt Export the scene to 3DS for 3ds Max
95
+ *
96
+ * # Example
97
+ * ```ts
98
+ * const file = await snaptrude.core.io.export.model("glb")
99
+ * // decode base64 → bytes and save/download in the plugin UI
100
+ * const bytes = Uint8Array.from(atob(file.dataBase64), (c) => c.charCodeAt(0))
101
+ * const blob = new Blob([bytes], { type: file.mimeType })
102
+ * // ...offer blob for download as file.fileName
103
+ *
104
+ * // Only the current selection, as OBJ text:
105
+ * const obj = await snaptrude.core.io.export.model("obj", "selection")
106
+ * const text = atob(obj.dataBase64)
107
+ * ```
108
+ */
109
+ abstract model(format: ExportModelFormat, scope?: ExportScope): PluginApiReturn<ExportedFile>;
110
+ }
111
+ /**
112
+ * Arguments for {@link PluginCoreIoExportApi.model}.
113
+ *
114
+ * | Property | Type | Description |
115
+ * |---|---|---|
116
+ * | `format` | {@link ExportModelFormat} | `"glb"`, `"obj"`, `"fbx"`, or `"3ds"` |
117
+ * | `scope` | {@link ExportScope} | `"scene"` (default) or `"selection"` (browser formats only) |
118
+ */
119
+ export declare const PluginExportModelArgs: z.ZodObject<{
120
+ format: z.ZodEnum<{
121
+ fbx: "fbx";
122
+ obj: "obj";
123
+ "3ds": "3ds";
124
+ glb: "glb";
125
+ }>;
126
+ scope: z.ZodOptional<z.ZodEnum<{
127
+ scene: "scene";
128
+ selection: "selection";
129
+ }>>;
130
+ }, z.core.$strip>;
131
+ export type PluginExportModelArgs = z.infer<typeof PluginExportModelArgs>;
132
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/core/io/export/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;EAAuC,CAAA;AACrE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEjE;;;GAGG;AACH,eAAO,MAAM,WAAW;;;EAAiC,CAAA;AACzD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAErD;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY;;;;iBAIvB,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,8BAAsB,qBAAqB;;IAGzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;aACa,KAAK,CACnB,MAAM,EAAE,iBAAiB,EACzB,KAAK,CAAC,EAAE,WAAW,GAClB,eAAe,CAAC,YAAY,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;iBAGhC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
@@ -360,7 +360,7 @@ export declare const PluginImportModelArgs: z.ZodObject<{
360
360
  "3ds": "3ds";
361
361
  zip: "zip";
362
362
  }>>;
363
- position: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>>;
363
+ position: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>>;
364
364
  label: z.ZodOptional<z.ZodString>;
365
365
  }, z.core.$strip>;
366
366
  export type PluginImportModelArgs = z.infer<typeof PluginImportModelArgs>;
@@ -3,6 +3,7 @@ import { PluginCoreIoJobApi } from "./job";
3
3
  import { PluginCoreIoUnderlayApi } from "./underlay";
4
4
  import { PluginCoreIoTerrainApi } from "./terrain";
5
5
  import { PluginCoreIoQueryApi } from "./query";
6
+ import { PluginCoreIoExportApi } from "./export";
6
7
  /**
7
8
  * I/O — bring external files into the project and manage what was imported.
8
9
  *
@@ -11,6 +12,7 @@ import { PluginCoreIoQueryApi } from "./query";
11
12
  * - {@linkcode PluginCoreIoApi.job} — poll long-running async imports (e.g. DWG)
12
13
  * - {@linkcode PluginCoreIoApi.underlay} — inspect/scale/opacity/delete placed underlays
13
14
  * - {@linkcode PluginCoreIoApi.terrain} — inspect/edit the site terrain (datum, layers, delete)
15
+ * - {@linkcode PluginCoreIoApi.export} — serialize the model to glb/obj (base64 bytes)
14
16
  *
15
17
  * Accessed via `snaptrude.core.io`.
16
18
  */
@@ -25,6 +27,8 @@ export declare abstract class PluginCoreIoApi {
25
27
  abstract underlay: PluginCoreIoUnderlayApi;
26
28
  /** Inspect and manage the site terrain. See {@linkcode PluginCoreIoTerrainApi}. */
27
29
  abstract terrain: PluginCoreIoTerrainApi;
30
+ /** Serialize the model to a downloadable 3D file. See {@linkcode PluginCoreIoExportApi}. */
31
+ abstract export: PluginCoreIoExportApi;
28
32
  constructor();
29
33
  }
30
34
  export * from "./import";
@@ -32,4 +36,5 @@ export * from "./job";
32
36
  export * from "./underlay";
33
37
  export * from "./terrain";
34
38
  export * from "./query";
39
+ export * from "./export";
35
40
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/io/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAE9C;;;;;;;;;;GAUG;AACH,8BAAsB,eAAe;IACnC,mFAAmF;IACnF,SAAgB,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,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
@@ -134,8 +134,8 @@ export declare abstract class PluginCoreLayersApi {
134
134
  * read-only imported underlays (`image`, `cad`, `pdf`, `terrain`, `buildings`).
135
135
  */
136
136
  export declare const PluginCoreLayerType: z.ZodEnum<{
137
- terrain: "terrain";
138
137
  default: "default";
138
+ terrain: "terrain";
139
139
  buildings: "buildings";
140
140
  floor: "floor";
141
141
  wall: "wall";
@@ -172,8 +172,8 @@ export declare const PluginCoreLayer: z.ZodObject<{
172
172
  id: z.ZodString;
173
173
  name: z.ZodString;
174
174
  layerType: z.ZodEnum<{
175
- terrain: "terrain";
176
175
  default: "default";
176
+ terrain: "terrain";
177
177
  buildings: "buildings";
178
178
  floor: "floor";
179
179
  wall: "wall";
@@ -205,8 +205,8 @@ export type PluginCoreLayer = z.infer<typeof PluginCoreLayer>;
205
205
  export declare const PluginCoreLayersListArgs: z.ZodObject<{
206
206
  storeyId: z.ZodString;
207
207
  layerType: z.ZodOptional<z.ZodEnum<{
208
- terrain: "terrain";
209
208
  default: "default";
209
+ terrain: "terrain";
210
210
  buildings: "buildings";
211
211
  floor: "floor";
212
212
  wall: "wall";
@@ -230,8 +230,8 @@ export declare const PluginCoreLayersListResult: z.ZodObject<{
230
230
  id: z.ZodString;
231
231
  name: z.ZodString;
232
232
  layerType: z.ZodEnum<{
233
- terrain: "terrain";
234
233
  default: "default";
234
+ terrain: "terrain";
235
235
  buildings: "buildings";
236
236
  floor: "floor";
237
237
  wall: "wall";
@@ -272,8 +272,8 @@ export declare const PluginCoreLayersGetResult: z.ZodNullable<z.ZodObject<{
272
272
  id: z.ZodString;
273
273
  name: z.ZodString;
274
274
  layerType: z.ZodEnum<{
275
- terrain: "terrain";
276
275
  default: "default";
276
+ terrain: "terrain";
277
277
  buildings: "buildings";
278
278
  floor: "floor";
279
279
  wall: "wall";
@@ -313,8 +313,8 @@ export declare const PluginCoreLayersGetActiveResult: z.ZodNullable<z.ZodObject<
313
313
  id: z.ZodString;
314
314
  name: z.ZodString;
315
315
  layerType: z.ZodEnum<{
316
- terrain: "terrain";
317
316
  default: "default";
317
+ terrain: "terrain";
318
318
  buildings: "buildings";
319
319
  floor: "floor";
320
320
  wall: "wall";
@@ -377,8 +377,8 @@ export declare const PluginCoreLayersUpdateResult: z.ZodObject<{
377
377
  id: z.ZodString;
378
378
  name: z.ZodString;
379
379
  layerType: z.ZodEnum<{
380
- terrain: "terrain";
381
380
  default: "default";
381
+ terrain: "terrain";
382
382
  buildings: "buildings";
383
383
  floor: "floor";
384
384
  wall: "wall";
@@ -125,29 +125,71 @@ export declare abstract class PluginCoreProposalsApi {
125
125
  */
126
126
  abstract isActive(proposalId: string): PluginApiReturn<boolean>;
127
127
  /**
128
- * Create a new design option (proposal).
128
+ * Create a new design option (proposal) — blank, or configured from a base
129
+ * proposal (the New Proposal modal's two paths).
129
130
  *
130
131
  * **Pro-gated** (creating proposals requires a Pro plan, matching the UI) and
131
- * **not undoable**. Creates a bare proposal with a single empty default
132
- * bucket — it does **not** carry forward the current proposal's layers, views,
133
- * or targets. The name is capped at 24 characters.
132
+ * **not undoable**. The name is capped at 24 characters.
133
+ *
134
+ * **Blank** (no `options`) creates a bare proposal with a single empty
135
+ * default bucket; it does **not** carry forward the current proposal's
136
+ * layers, views, or targets, and the active proposal does **not** change.
137
+ *
138
+ * **Configured** (`options.baseProposalId`) — the modal's Configure path:
139
+ * carries the base proposal's buckets (layers) forward per `options.layers`,
140
+ * where each entry names a bucket of the base proposal and an action —
141
+ * `"share"` (the new proposal references the same live bucket) or
142
+ * `"duplicate"` (an independent copy of the bucket and its contents).
143
+ * Buckets not listed are left behind. Omitting `layers` carries **every**
144
+ * base bucket forward as a `"duplicate"` (the modal's default). The base
145
+ * proposal's views and area targets are copied either way, and the new
146
+ * proposal becomes the **active** one (implicit switch — blocked with
147
+ * `PROPOSAL_SWITCH_BLOCKED` while an in-canvas agent run is in flight, like
148
+ * {@linkcode PluginCoreProposalsApi.setActive}).
134
149
  *
135
150
  * @param name - Display name of the new proposal (capped at 24 chars).
151
+ * @param options - Optional configure path: `baseProposalId` (the proposal to
152
+ * carry forward from) and `layers` (per-bucket `"share"` / `"duplicate"`
153
+ * actions; omitted buckets are excluded, omitted `layers` duplicates all).
136
154
  * @returns The new proposal's id (read the full record back with
137
155
  * {@linkcode PluginCoreProposalsApi.get}).
138
- * @throws If the caller is not on a Pro plan, or the proposal could not be
139
- * created.
156
+ * @throws If the caller is not on a Pro plan, the name is empty/duplicate,
157
+ * `layers` is passed without `baseProposalId`, the base proposal or a
158
+ * listed bucket does not exist / does not belong to the base proposal, or
159
+ * (configured only) `PROPOSAL_SWITCH_BLOCKED` while a canvas-agent run is
160
+ * in flight.
140
161
  *
141
162
  * @examplePrompt Create a design option called Scheme B
142
163
  * @examplePrompt Add a new proposal named Option 2
143
- * @examplePrompt Make a fresh design variant to explore
164
+ * @examplePrompt Duplicate the current proposal as Scheme C
165
+ * @examplePrompt Create a design option based on Proposal 1 that shares its site layer
144
166
  *
145
167
  * # Example
146
168
  * ```ts
169
+ * // blank design option
147
170
  * const { id } = await snaptrude.core.proposals.create("Scheme B")
171
+ *
172
+ * // configured from the active proposal: duplicate every layer
173
+ * const base = await snaptrude.core.proposals.getActive()
174
+ * if (base) {
175
+ * const { id: dup } = await snaptrude.core.proposals.create("Scheme C", {
176
+ * baseProposalId: base.id,
177
+ * })
178
+ * // …or share one layer and leave the rest behind
179
+ * const { id: shared } = await snaptrude.core.proposals.create("Scheme D", {
180
+ * baseProposalId: base.id,
181
+ * layers: [{ bucketId: base.defaultBucketId, action: "share" }],
182
+ * })
183
+ * }
148
184
  * ```
149
185
  */
150
- abstract create(name: string): PluginApiReturn<PluginCoreProposalsCreateResult>;
186
+ abstract create(name: string, options?: {
187
+ baseProposalId: string;
188
+ layers?: {
189
+ bucketId: string;
190
+ action: "share" | "duplicate";
191
+ }[];
192
+ }): PluginApiReturn<PluginCoreProposalsCreateResult>;
151
193
  /**
152
194
  * Rename a proposal.
153
195
  *
@@ -374,14 +416,28 @@ export declare const PluginCoreProposalsIsActiveArgs: z.ZodObject<{
374
416
  }, z.core.$strip>;
375
417
  export type PluginCoreProposalsIsActiveArgs = z.infer<typeof PluginCoreProposalsIsActiveArgs>;
376
418
  /**
377
- * Arguments for {@linkcode PluginCoreProposalsApi.create}.
419
+ * Arguments for {@linkcode PluginCoreProposalsApi.create}. A bare `name` makes
420
+ * a blank proposal; `baseProposalId` switches to the configured (carry-forward)
421
+ * path. `layers` requires `baseProposalId` — each entry names a bucket of the
422
+ * base proposal; omitted buckets are excluded, and omitting `layers` entirely
423
+ * duplicates every base bucket.
378
424
  *
379
425
  * | Property | Type | Description |
380
426
  * |---|---|---|
381
427
  * | `name` | `string` | Display name of the new proposal (capped at 24 chars) |
428
+ * | `baseProposalId` | `string \| undefined` | Proposal to carry forward from (configured path) |
429
+ * | `layers` | `{ bucketId: string; action: "share" \| "duplicate" }[] \| undefined` | Per-bucket carry-forward actions (requires `baseProposalId`) |
382
430
  */
383
431
  export declare const PluginCoreProposalsCreateArgs: z.ZodObject<{
384
432
  name: z.ZodString;
433
+ baseProposalId: z.ZodOptional<z.ZodString>;
434
+ layers: z.ZodOptional<z.ZodArray<z.ZodObject<{
435
+ bucketId: z.ZodString;
436
+ action: z.ZodEnum<{
437
+ share: "share";
438
+ duplicate: "duplicate";
439
+ }>;
440
+ }, z.core.$strip>>>;
385
441
  }, z.core.$strip>;
386
442
  export type PluginCoreProposalsCreateArgs = z.infer<typeof PluginCoreProposalsCreateArgs>;
387
443
  /**