@snaptrude/plugin-core 0.0.0-dev-20260708130115 → 0.0.0-dev-20260827135706

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 (261) hide show
  1. package/CHANGELOG.md +152 -1
  2. package/api-manifest.json +3620 -276
  3. package/dist/api/analysis/daylight.d.ts +603 -0
  4. package/dist/api/analysis/daylight.d.ts.map +1 -0
  5. package/dist/api/analysis/heatmaps.d.ts +658 -0
  6. package/dist/api/analysis/heatmaps.d.ts.map +1 -0
  7. package/dist/api/analysis/illuminance.d.ts +145 -0
  8. package/dist/api/analysis/illuminance.d.ts.map +1 -0
  9. package/dist/api/analysis/index.d.ts +59 -0
  10. package/dist/api/analysis/index.d.ts.map +1 -0
  11. package/dist/api/analysis/shadows.d.ts +165 -0
  12. package/dist/api/analysis/shadows.d.ts.map +1 -0
  13. package/dist/api/analysis/solar.d.ts +249 -0
  14. package/dist/api/analysis/solar.d.ts.map +1 -0
  15. package/dist/api/analysis/sunlightHours.d.ts +208 -0
  16. package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
  17. package/dist/api/analysis/sunpath.d.ts +80 -0
  18. package/dist/api/analysis/sunpath.d.ts.map +1 -0
  19. package/dist/api/analysis/weather.d.ts +193 -0
  20. package/dist/api/analysis/weather.d.ts.map +1 -0
  21. package/dist/api/core/camera/index.d.ts +261 -0
  22. package/dist/api/core/camera/index.d.ts.map +1 -0
  23. package/dist/api/core/comment/index.d.ts +105 -2
  24. package/dist/api/core/comment/index.d.ts.map +1 -1
  25. package/dist/api/core/geom/create/index.d.ts +840 -14
  26. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  27. package/dist/api/core/geom/delete/index.d.ts +8 -2
  28. package/dist/api/core/geom/delete/index.d.ts.map +1 -1
  29. package/dist/api/core/geom/query/arc.d.ts +5 -5
  30. package/dist/api/core/geom/query/brep.d.ts +130 -18
  31. package/dist/api/core/geom/query/brep.d.ts.map +1 -1
  32. package/dist/api/core/geom/query/circle.d.ts +18 -18
  33. package/dist/api/core/geom/query/contour.d.ts +20 -20
  34. package/dist/api/core/geom/query/curve.d.ts +49 -49
  35. package/dist/api/core/geom/query/edge.d.ts +5 -5
  36. package/dist/api/core/geom/query/face.d.ts +16 -16
  37. package/dist/api/core/geom/query/halfedge.d.ts +8 -8
  38. package/dist/api/core/geom/query/profile.d.ts +19 -19
  39. package/dist/api/core/geom/query/vertex.d.ts +8 -8
  40. package/dist/api/core/geom/update/contour.d.ts +14 -14
  41. package/dist/api/core/geom/update/curve.d.ts +7 -7
  42. package/dist/api/core/geom/update/profile.d.ts +16 -16
  43. package/dist/api/core/handles/index.d.ts +210 -0
  44. package/dist/api/core/handles/index.d.ts.map +1 -0
  45. package/dist/api/core/index.d.ts +34 -0
  46. package/dist/api/core/index.d.ts.map +1 -1
  47. package/dist/api/core/io/export/index.d.ts +134 -0
  48. package/dist/api/core/io/export/index.d.ts.map +1 -0
  49. package/dist/api/core/io/import/index.d.ts +453 -0
  50. package/dist/api/core/io/import/index.d.ts.map +1 -0
  51. package/dist/api/core/io/index.d.ts +40 -0
  52. package/dist/api/core/io/index.d.ts.map +1 -0
  53. package/dist/api/core/io/job/index.d.ts +139 -0
  54. package/dist/api/core/io/job/index.d.ts.map +1 -0
  55. package/dist/api/core/io/query/index.d.ts +74 -0
  56. package/dist/api/core/io/query/index.d.ts.map +1 -0
  57. package/dist/api/core/io/terrain/index.d.ts +341 -0
  58. package/dist/api/core/io/terrain/index.d.ts.map +1 -0
  59. package/dist/api/core/io/underlay/index.d.ts +805 -0
  60. package/dist/api/core/io/underlay/index.d.ts.map +1 -0
  61. package/dist/api/core/layers.d.ts +7 -7
  62. package/dist/api/core/mode/index.d.ts +99 -0
  63. package/dist/api/core/mode/index.d.ts.map +1 -0
  64. package/dist/api/core/project/index.d.ts +68 -1
  65. package/dist/api/core/project/index.d.ts.map +1 -1
  66. package/dist/api/core/proposals/index.d.ts +531 -0
  67. package/dist/api/core/proposals/index.d.ts.map +1 -0
  68. package/dist/api/core/storeys/index.d.ts +265 -0
  69. package/dist/api/core/storeys/index.d.ts.map +1 -0
  70. package/dist/api/core/tags.d.ts +24 -0
  71. package/dist/api/core/tags.d.ts.map +1 -1
  72. package/dist/api/core/user.d.ts +44 -0
  73. package/dist/api/core/user.d.ts.map +1 -0
  74. package/dist/api/core/zoom/index.d.ts +4 -0
  75. package/dist/api/core/zoom/index.d.ts.map +1 -1
  76. package/dist/api/design/boolean/index.d.ts +4 -4
  77. package/dist/api/design/create/index.d.ts +568 -45
  78. package/dist/api/design/create/index.d.ts.map +1 -1
  79. package/dist/api/design/delete/index.d.ts +3 -0
  80. package/dist/api/design/delete/index.d.ts.map +1 -1
  81. package/dist/api/design/doors/index.d.ts +195 -0
  82. package/dist/api/design/doors/index.d.ts.map +1 -1
  83. package/dist/api/design/edit/index.d.ts +1 -1
  84. package/dist/api/design/erase/index.d.ts +2 -2
  85. package/dist/api/design/family.d.ts +349 -0
  86. package/dist/api/design/family.d.ts.map +1 -0
  87. package/dist/api/design/furniture/index.d.ts +181 -8
  88. package/dist/api/design/furniture/index.d.ts.map +1 -1
  89. package/dist/api/design/index.d.ts +98 -0
  90. package/dist/api/design/index.d.ts.map +1 -1
  91. package/dist/api/design/lock.d.ts +26 -0
  92. package/dist/api/design/lock.d.ts.map +1 -1
  93. package/dist/api/design/materials/index.d.ts +270 -16
  94. package/dist/api/design/materials/index.d.ts.map +1 -1
  95. package/dist/api/design/query/geometry/index.d.ts +112 -0
  96. package/dist/api/design/query/geometry/index.d.ts.map +1 -1
  97. package/dist/api/design/query/index.d.ts +282 -11
  98. package/dist/api/design/query/index.d.ts.map +1 -1
  99. package/dist/api/design/query/referenceLines.d.ts +45 -0
  100. package/dist/api/design/query/referenceLines.d.ts.map +1 -0
  101. package/dist/api/design/query/spaces.d.ts +181 -8
  102. package/dist/api/design/query/spaces.d.ts.map +1 -1
  103. package/dist/api/design/selection/index.d.ts +144 -0
  104. package/dist/api/design/selection/index.d.ts.map +1 -1
  105. package/dist/api/design/transform/index.d.ts +172 -10
  106. package/dist/api/design/transform/index.d.ts.map +1 -1
  107. package/dist/api/design/types/index.d.ts +181 -0
  108. package/dist/api/design/types/index.d.ts.map +1 -0
  109. package/dist/api/design/update/index.d.ts +553 -2
  110. package/dist/api/design/update/index.d.ts.map +1 -1
  111. package/dist/api/design/visibility.d.ts +126 -0
  112. package/dist/api/design/visibility.d.ts.map +1 -0
  113. package/dist/api/design/windows/index.d.ts +113 -2
  114. package/dist/api/design/windows/index.d.ts.map +1 -1
  115. package/dist/api/entity/buildableEnvelope.d.ts +4 -0
  116. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
  117. package/dist/api/entity/referenceLine.d.ts +10 -2
  118. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  119. package/dist/api/entity/space.d.ts +21 -21
  120. package/dist/api/entity/story.d.ts +242 -15
  121. package/dist/api/entity/story.d.ts.map +1 -1
  122. package/dist/api/index.d.ts +10 -0
  123. package/dist/api/index.d.ts.map +1 -1
  124. package/dist/api/presentation/aiInspiration.d.ts +25 -25
  125. package/dist/api/presentation/annotate.d.ts +467 -0
  126. package/dist/api/presentation/annotate.d.ts.map +1 -0
  127. package/dist/api/presentation/diagrams.d.ts +111 -8
  128. package/dist/api/presentation/diagrams.d.ts.map +1 -1
  129. package/dist/api/presentation/export.d.ts +108 -0
  130. package/dist/api/presentation/export.d.ts.map +1 -0
  131. package/dist/api/presentation/import.d.ts +55 -4
  132. package/dist/api/presentation/import.d.ts.map +1 -1
  133. package/dist/api/presentation/index.d.ts +58 -1
  134. package/dist/api/presentation/index.d.ts.map +1 -1
  135. package/dist/api/presentation/placedViews.d.ts +1139 -0
  136. package/dist/api/presentation/placedViews.d.ts.map +1 -0
  137. package/dist/api/presentation/shapes.d.ts +481 -0
  138. package/dist/api/presentation/shapes.d.ts.map +1 -0
  139. package/dist/api/presentation/sheets.d.ts +452 -13
  140. package/dist/api/presentation/sheets.d.ts.map +1 -1
  141. package/dist/api/presentation/slideshow.d.ts +125 -0
  142. package/dist/api/presentation/slideshow.d.ts.map +1 -0
  143. package/dist/api/presentation/tables.d.ts +81 -0
  144. package/dist/api/presentation/tables.d.ts.map +1 -0
  145. package/dist/api/presentation/views.d.ts +367 -7
  146. package/dist/api/presentation/views.d.ts.map +1 -1
  147. package/dist/api/program/areas.d.ts +102 -12
  148. package/dist/api/program/areas.d.ts.map +1 -1
  149. package/dist/api/program/cores.d.ts +3 -99
  150. package/dist/api/program/cores.d.ts.map +1 -1
  151. package/dist/api/program/index.d.ts +7 -15
  152. package/dist/api/program/index.d.ts.map +1 -1
  153. package/dist/api/program/layout.d.ts +346 -11
  154. package/dist/api/program/layout.d.ts.map +1 -1
  155. package/dist/api/program/site.d.ts +469 -13
  156. package/dist/api/program/site.d.ts.map +1 -1
  157. package/dist/api/program/spreadsheet.d.ts +365 -41
  158. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  159. package/dist/api/workspace/index.d.ts +505 -0
  160. package/dist/api/workspace/index.d.ts.map +1 -0
  161. package/dist/errors/codes.d.ts +34 -0
  162. package/dist/errors/codes.d.ts.map +1 -0
  163. package/dist/errors/envelope.d.ts +56 -0
  164. package/dist/errors/envelope.d.ts.map +1 -0
  165. package/dist/errors/index.d.ts +6 -0
  166. package/dist/errors/index.d.ts.map +1 -0
  167. package/dist/errors/plugin-error.d.ts +69 -0
  168. package/dist/errors/plugin-error.d.ts.map +1 -0
  169. package/dist/handles.d.ts +97 -25
  170. package/dist/handles.d.ts.map +1 -1
  171. package/dist/host-utils.d.ts +4 -0
  172. package/dist/host-utils.d.ts.map +1 -1
  173. package/dist/index.cjs +4582 -1422
  174. package/dist/index.cjs.map +1 -1
  175. package/dist/index.d.ts +1 -0
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.js +4171 -1411
  178. package/dist/index.js.map +1 -1
  179. package/package.json +4 -2
  180. package/scripts/generate-manifest.mjs +45 -0
  181. package/scripts/generate-manifest.test.mjs +103 -4
  182. package/src/api/analysis/daylight.ts +470 -0
  183. package/src/api/analysis/heatmaps.ts +683 -0
  184. package/src/api/analysis/illuminance.ts +155 -0
  185. package/src/api/analysis/index.ts +61 -0
  186. package/src/api/analysis/shadows.ts +183 -0
  187. package/src/api/analysis/solar.ts +237 -0
  188. package/src/api/analysis/sunlightHours.ts +211 -0
  189. package/src/api/analysis/sunpath.ts +83 -0
  190. package/src/api/analysis/weather.ts +179 -0
  191. package/src/api/core/camera/index.ts +268 -0
  192. package/src/api/core/comment/index.ts +120 -2
  193. package/src/api/core/geom/create/index.ts +912 -1
  194. package/src/api/core/geom/delete/index.ts +6 -0
  195. package/src/api/core/geom/query/brep.ts +119 -0
  196. package/src/api/core/handles/index.ts +233 -0
  197. package/src/api/core/index.ts +34 -0
  198. package/src/api/core/io/export/index.ts +126 -0
  199. package/src/api/core/io/import/index.ts +496 -0
  200. package/src/api/core/io/index.ts +42 -0
  201. package/src/api/core/io/job/index.ts +140 -0
  202. package/src/api/core/io/query/index.ts +71 -0
  203. package/src/api/core/io/terrain/index.ts +360 -0
  204. package/src/api/core/io/underlay/index.ts +705 -0
  205. package/src/api/core/mode/index.ts +96 -0
  206. package/src/api/core/project/index.ts +62 -1
  207. package/src/api/core/proposals/index.ts +569 -0
  208. package/src/api/core/storeys/index.ts +294 -0
  209. package/src/api/core/tags.ts +27 -0
  210. package/src/api/core/user.ts +46 -0
  211. package/src/api/core/zoom/index.ts +4 -0
  212. package/src/api/design/create/index.ts +670 -30
  213. package/src/api/design/delete/index.ts +3 -0
  214. package/src/api/design/doors/index.ts +208 -0
  215. package/src/api/design/erase/index.ts +1 -1
  216. package/src/api/design/family.ts +388 -0
  217. package/src/api/design/furniture/index.ts +197 -8
  218. package/src/api/design/index.ts +102 -0
  219. package/src/api/design/lock.ts +27 -0
  220. package/src/api/design/materials/index.ts +334 -27
  221. package/src/api/design/query/geometry/index.ts +125 -3
  222. package/src/api/design/query/index.ts +217 -7
  223. package/src/api/design/query/referenceLines.ts +52 -0
  224. package/src/api/design/query/spaces.ts +143 -0
  225. package/src/api/design/selection/index.ts +129 -0
  226. package/src/api/design/transform/index.ts +170 -9
  227. package/src/api/design/types/index.ts +156 -0
  228. package/src/api/design/update/index.ts +631 -3
  229. package/src/api/design/visibility.ts +143 -0
  230. package/src/api/design/windows/index.ts +128 -2
  231. package/src/api/entity/buildableEnvelope.ts +4 -0
  232. package/src/api/entity/referenceLine.ts +8 -0
  233. package/src/api/entity/story.ts +259 -15
  234. package/src/api/index.ts +10 -0
  235. package/src/api/presentation/annotate.ts +385 -0
  236. package/src/api/presentation/diagrams.ts +118 -8
  237. package/src/api/presentation/export.ts +108 -0
  238. package/src/api/presentation/import.ts +51 -4
  239. package/src/api/presentation/index.ts +66 -1
  240. package/src/api/presentation/placedViews.ts +1120 -0
  241. package/src/api/presentation/shapes.ts +274 -0
  242. package/src/api/presentation/sheets.ts +400 -13
  243. package/src/api/presentation/slideshow.ts +134 -0
  244. package/src/api/presentation/tables.ts +84 -0
  245. package/src/api/presentation/views.ts +376 -8
  246. package/src/api/program/areas.ts +88 -15
  247. package/src/api/program/cores.ts +3 -91
  248. package/src/api/program/index.ts +7 -15
  249. package/src/api/program/layout.ts +365 -11
  250. package/src/api/program/site.ts +435 -13
  251. package/src/api/program/spreadsheet.ts +376 -35
  252. package/src/api/workspace/index.ts +563 -0
  253. package/src/errors/codes.ts +136 -0
  254. package/src/errors/envelope.ts +75 -0
  255. package/src/errors/index.ts +21 -0
  256. package/src/errors/plugin-error.ts +134 -0
  257. package/src/handles.ts +123 -13
  258. package/src/host-utils.ts +4 -0
  259. package/src/index.ts +1 -0
  260. package/test/errors.test.mjs +184 -0
  261. 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;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B;;;;;;;;;;;GAWG;AACH,8BAAsB,oBAAoB;;IAGxC;;;;;;;;;;;;;;OAcG;aACa,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC;IAEtF;;;;;;;;;;;;;;OAcG;aACa,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC;IAEnE;;;;;;;;;;;;;;;;;;;;;OAqBG;aACa,UAAU,IAAI,eAAe,CAAC,UAAU,CAAC;IAEzD;;;;;;;;;;;;;;;;;;;OAmBG;aACa,QAAQ,CACtB,KAAK,EAAE,UAAU,EACjB,MAAM,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,GACrC,eAAe,CAAC,IAAI,CAAC;IAExB;;;;;;;;;;;;;;OAcG;aACa,KAAK,IAAI,eAAe,CAAC,wBAAwB,CAAC;CACnE;AAoBD;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;;iBAEnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;iBAEtC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAErF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB;;;iBAGpC,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAEjF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB;;;;;;;iBAOnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
@@ -9,6 +9,13 @@ import { PluginCoreGroupsApi } from "./groups";
9
9
  import { PluginCoreBuildingsApi } from "./buildings";
10
10
  import { PluginCoreLayersApi } from "./layers";
11
11
  import { PluginCoreTagsApi } from "./tags";
12
+ import { PluginCoreIoApi } from "./io";
13
+ import { PluginCoreHandlesApi } from "./handles";
14
+ import { PluginCoreProposalsApi } from "./proposals";
15
+ import { PluginCameraApi } from "./camera";
16
+ import { PluginCoreStoreysApi } from "./storeys";
17
+ import { PluginCoreModeApi } from "./mode";
18
+ import { PluginUserApi } from "./user";
12
19
  /**
13
20
  * Core primitives and infrastructure used across the plugin API.
14
21
  *
@@ -17,12 +24,18 @@ import { PluginCoreTagsApi } from "./tags";
17
24
  * - {@linkcode PluginCoreApi.history} — Undo / redo of committed history entries
18
25
  * - {@linkcode PluginCoreApi.units} — Unit-type queries and conversion
19
26
  * - {@linkcode PluginCoreApi.zoom} — Camera zoom controls (extents / selection)
27
+ * - {@linkcode PluginCoreApi.camera} — Camera controls — position, standard views, 2D/3D mode
28
+ * - {@linkcode PluginCoreApi.user} — User locale — timezone & language
20
29
  * - {@linkcode PluginCoreApi.project} — Project-level settings and info
21
30
  * - {@linkcode PluginCoreApi.comment} — Comments: create, edit, resolve, tag, list
22
31
  * - {@linkcode PluginCoreApi.groups} — Read & edit the group hierarchy
23
32
  * - {@linkcode PluginCoreApi.buildings} — Read & edit buildings and their storeys
33
+ * - {@linkcode PluginCoreApi.storeys} — Create, read & edit storeys (floors)
24
34
  * - {@linkcode PluginCoreApi.layers} — Read & toggle storey drawing/reference layers
25
35
  * - {@linkcode PluginCoreApi.tags} — Tag catalog + assignment
36
+ * - {@linkcode PluginCoreApi.io} — Import files (image/pdf/cad/model/terrain), poll jobs, manage underlays
37
+ * - {@linkcode PluginCoreApi.handles} — Handle lifecycle: release, releaseAll, scopes
38
+ * - {@linkcode PluginCoreApi.proposals} — Design options: read, create, rename, switch, delete
26
39
  */
27
40
  export declare abstract class PluginCoreApi {
28
41
  /** Vector and quaternion math utilities. See {@linkcode PluginMathApi}. */
@@ -35,6 +48,10 @@ export declare abstract class PluginCoreApi {
35
48
  abstract units: PluginUnitsApi;
36
49
  /** Camera zoom controls. See {@linkcode PluginZoomApi}. */
37
50
  abstract zoom: PluginZoomApi;
51
+ /** Camera controls — position, standard views, 2D/3D mode. See {@linkcode PluginCameraApi}. */
52
+ abstract camera: PluginCameraApi;
53
+ /** User locale — timezone & language. See {@linkcode PluginUserApi}. */
54
+ abstract user: PluginUserApi;
38
55
  /** Project-level settings and info. See {@linkcode PluginProjectApi}. */
39
56
  abstract project: PluginProjectApi;
40
57
  /** Comments — create, edit, resolve, tag, list. See {@linkcode PluginCommentApi}. */
@@ -43,10 +60,20 @@ export declare abstract class PluginCoreApi {
43
60
  abstract groups: PluginCoreGroupsApi;
44
61
  /** Buildings — read & edit buildings and their storeys. See {@linkcode PluginCoreBuildingsApi}. */
45
62
  abstract buildings: PluginCoreBuildingsApi;
63
+ /** Storeys — create, read & edit storeys (floors). See {@linkcode PluginCoreStoreysApi}. */
64
+ abstract storeys: PluginCoreStoreysApi;
65
+ /** Application mode — read & switch the editor's top-bar mode. See {@linkcode PluginCoreModeApi}. */
66
+ abstract mode: PluginCoreModeApi;
46
67
  /** Layers — read & toggle storey drawing/reference layers. See {@linkcode PluginCoreLayersApi}. */
47
68
  abstract layers: PluginCoreLayersApi;
48
69
  /** Tags — tag catalog + assignment. See {@linkcode PluginCoreTagsApi}. */
49
70
  abstract tags: PluginCoreTagsApi;
71
+ /** I/O — file import, import jobs, and underlay management. See {@linkcode PluginCoreIoApi}. */
72
+ abstract io: PluginCoreIoApi;
73
+ /** Handle lifecycle — release, releaseAll, and mint-recording scopes. See {@linkcode PluginCoreHandlesApi}. */
74
+ abstract handles: PluginCoreHandlesApi;
75
+ /** Proposals — design options: read, create, rename, switch, delete. See {@linkcode PluginCoreProposalsApi}. */
76
+ abstract proposals: PluginCoreProposalsApi;
50
77
  constructor();
51
78
  }
52
79
  export * from "./math";
@@ -54,10 +81,17 @@ export * from "./geom";
54
81
  export * from "./history";
55
82
  export * from "./units";
56
83
  export * from "./zoom";
84
+ export * from "./camera";
85
+ export * from "./user";
57
86
  export * from "./project";
58
87
  export * from "./comment";
59
88
  export * from "./groups";
60
89
  export * from "./buildings";
90
+ export * from "./storeys";
91
+ export * from "./mode";
61
92
  export * from "./layers";
62
93
  export * from "./tags";
94
+ export * from "./io";
95
+ export * from "./handles";
96
+ export * from "./proposals";
63
97
  //# 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,gBAAgB,EAAE,MAAM,W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luginApiReturn } 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). For a different export intent, see `presentation.export`
47
+ * (Present-mode layout sheets to PDF/PNG/JPG) and `program.spreadsheet.export`
48
+ * (the area-program / takeoff workbook). Four formats:
49
+ *
50
+ * - `"glb"` — binary glTF (`model/gltf-binary`); geometry + materials,
51
+ * serialized in the browser (nothing is uploaded).
52
+ * - `"obj"` — Wavefront OBJ text (`text/plain`); geometry only, serialized in
53
+ * the browser.
54
+ * - `"fbx"` / `"3ds"` — Autodesk FBX / 3D Studio; the scene is uploaded to the
55
+ * same `/exportmodel/` conversion service the app's Export dialog uses, and
56
+ * the call resolves once the converted artifact is fetched back — a **zip**
57
+ * (`application/zip`) containing the `.fbx`/`.3ds` file. Whole-scene only
58
+ * (`scope: "selection"` is rejected). Conversion runs on the server and is
59
+ * bounded by the per-call plugin timeout (60 s) — very large models may
60
+ * exceed it and reject with `TIMEOUT`.
61
+ *
62
+ * For the browser formats, only real model geometry is exported (walls, slabs,
63
+ * roofs, floors, doors, windows, furniture, staircases, masses, ceilings,
64
+ * mullions, beams, columns, terrain); UI helpers, hidden objects, and
65
+ * hidden-bucket objects are excluded — matching the app's GLB export. The
66
+ * server formats convert the full serialized scene (hidden-bucket objects
67
+ * excluded), exactly like the Export dialog. This is a **read**: it never
68
+ * mutates the model.
69
+ *
70
+ * > Server-backed BIM exports (RVT / IFC / DWG) are **not** exposed here — those
71
+ * > run as fire-and-forget Forge jobs that stream a browser download and return
72
+ * > no retrievable bytes. Use the app's Export menu for those.
73
+ *
74
+ * Accessed via `snaptrude.core.io.export`.
75
+ */
76
+ export declare abstract class PluginCoreIoExportApi {
77
+ constructor();
78
+ /**
79
+ * Export the model to a 3D file and return its bytes as base64.
80
+ *
81
+ * @param format - `"glb"` (binary glTF, geometry + materials), `"obj"`
82
+ * (Wavefront OBJ text, geometry only) — both serialized in the browser —
83
+ * or `"fbx"` / `"3ds"`, converted by the app's export service and returned
84
+ * as a zip containing the converted file.
85
+ * @param scope - `"scene"` (default) for the whole model, or `"selection"` for
86
+ * only the currently selected objects (browser formats only — `"fbx"`/`"3ds"`
87
+ * reject it). An empty selection yields an empty file.
88
+ * @returns an {@linkcode ExportedFile} — `{ fileName, mimeType, dataBase64 }`.
89
+ * @throws if the format is unsupported, `scope: "selection"` is combined with a
90
+ * server format, or the serialization/conversion fails.
91
+ *
92
+ * @examplePrompt Export the model as a GLB
93
+ * @examplePrompt Give me the whole scene as an OBJ file
94
+ * @examplePrompt Export just my selection to GLB
95
+ * @examplePrompt Download the model as an FBX file
96
+ * @examplePrompt Export the scene to 3DS for 3ds Max
97
+ *
98
+ * # Example
99
+ * ```ts
100
+ * const file = await snaptrude.core.io.export.model("glb")
101
+ * // decode base64 → bytes and save/download in the plugin UI
102
+ * const bytes = Uint8Array.from(atob(file.dataBase64), (c) => c.charCodeAt(0))
103
+ * const blob = new Blob([bytes], { type: file.mimeType })
104
+ * // ...offer blob for download as file.fileName
105
+ *
106
+ * // Only the current selection, as OBJ text:
107
+ * const obj = await snaptrude.core.io.export.model("obj", "selection")
108
+ * const text = atob(obj.dataBase64)
109
+ * ```
110
+ */
111
+ abstract model(format: ExportModelFormat, scope?: ExportScope): PluginApiReturn<ExportedFile>;
112
+ }
113
+ /**
114
+ * Arguments for {@link PluginCoreIoExportApi.model}.
115
+ *
116
+ * | Property | Type | Description |
117
+ * |---|---|---|
118
+ * | `format` | {@link ExportModelFormat} | `"glb"`, `"obj"`, `"fbx"`, or `"3ds"` |
119
+ * | `scope` | {@link ExportScope} | `"scene"` (default) or `"selection"` (browser formats only) |
120
+ */
121
+ export declare const PluginExportModelArgs: z.ZodObject<{
122
+ format: z.ZodEnum<{
123
+ fbx: "fbx";
124
+ obj: "obj";
125
+ "3ds": "3ds";
126
+ glb: "glb";
127
+ }>;
128
+ scope: z.ZodOptional<z.ZodEnum<{
129
+ scene: "scene";
130
+ selection: "selection";
131
+ }>>;
132
+ }, z.core.$strip>;
133
+ export type PluginExportModelArgs = z.infer<typeof PluginExportModelArgs>;
134
+ //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;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"}