@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
@@ -1,6 +1,7 @@
1
1
  import * as z from "zod"
2
2
  import { PluginApiReturn } from "../../types"
3
3
  import { PluginAreaUnit } from "./metrics"
4
+ import { PluginAreaClass } from "../entity/space"
4
5
  import { ComponentHandle } from "../../handles"
5
6
 
6
7
  /**
@@ -12,15 +13,30 @@ import { ComponentHandle } from "../../handles"
12
13
  * department-allocation lens (targets vs allocated area per department); this
13
14
  * namespace is the whole-program area/FAR summary and its groupings.
14
15
  *
16
+ * **Net vs gross:** the `carpet` / `builtUp` / `excluded` figures are the three
17
+ * area *classes* — every space's whole footprint lands in exactly one, chosen
18
+ * by its `areaClass` (see {@linkcode PluginProgramAreaMember.areaClass}). In UI
19
+ * terms `carpet` is the **Net Internal Area** (Σ of `NET`-classed spaces), and
20
+ * `builtUp` is the **Gross External Area** (Σ of `GROSS`-classed spaces) — so
21
+ * "net" and "gross" are the plain-English synonyms for `carpet` and `builtUp`.
22
+ * These are not wall-thickness carpet-vs-super-built-up; there is no common-area
23
+ * math. Note the summary also folds in non-mass elements (floors count as NET,
24
+ * slabs as GROSS), so **summing `listMembers` spaces does not reconcile to the
25
+ * summary totals**.
26
+ *
15
27
  * `achievedFar` is **derived and read-only** — computed from built-up area and
16
28
  * site area. `targetFar` is the goal you set (via {@linkcode
17
29
  * PluginProgramAreasApi.update}); the two are the same ratio, one measured and
18
30
  * one intended. The surface speaks **FAR only** — there is no FSI alias.
19
31
  *
20
- * Reads return plain records and never throw. The write member typed as optional
21
- * (`?`) is **authored ahead of the host** declared so plugins and codegen can
22
- * see the shape, but kept out of the discovery manifest until the host lands it
23
- * (at which point it is promoted to a required `abstract` member).
32
+ * Reads return plain records and never throw. Because the engine only recomputes
33
+ * the breakdown live while the Area sidebar is open, a headless plugin should call
34
+ * {@linkcode PluginProgramAreasApi.refresh} first to guarantee the reads are fresh.
35
+ * The only write {@linkcode PluginProgramAreasApi.update} is a non-undoable
36
+ * settings write for the FAR inputs. With an active design option (proposal),
37
+ * those inputs are per-option: `update` writes and the reads report the active
38
+ * option's own target FAR / site area / deviation, matching the product's Area
39
+ * settings dialog.
24
40
  *
25
41
  * Accessed via `snaptrude.program.areas`.
26
42
  */
@@ -38,6 +54,8 @@ export abstract class PluginProgramAreasApi {
38
54
  *
39
55
  * @examplePrompt What's my FAR right now?
40
56
  * @examplePrompt Give me the program area summary
57
+ * @examplePrompt What is my net internal area vs gross external area?
58
+ * @examplePrompt How much net and gross area do I have?
41
59
  * @examplePrompt How much built-up area have I used against the site area?
42
60
  * @examplePrompt Am I within my FAR target?
43
61
  *
@@ -62,6 +80,7 @@ export abstract class PluginProgramAreasApi {
62
80
  * (empty when the program has no spaces).
63
81
  *
64
82
  * @examplePrompt Break down the area by storey
83
+ * @examplePrompt Break down net vs gross area by storey
65
84
  * @examplePrompt Show the area rollup per department
66
85
  * @examplePrompt Group the built-up area by building
67
86
  *
@@ -92,6 +111,7 @@ export abstract class PluginProgramAreasApi {
92
111
  * array (empty when the group is missing or empty).
93
112
  *
94
113
  * @examplePrompt List the spaces on this storey with their areas
114
+ * @examplePrompt Which spaces are net and which are gross on this storey?
95
115
  * @examplePrompt What rooms are in the Bedrooms department bucket?
96
116
  * @examplePrompt Break the storey area down into individual spaces
97
117
  *
@@ -114,6 +134,13 @@ export abstract class PluginProgramAreasApi {
114
134
  * area, and the allowed deviation. This is a **non-undoable settings write**
115
135
  * (persisted with the project). `achievedFar` recomputes from these.
116
136
  *
137
+ * **Design options:** when a design option (proposal) is active, the FAR
138
+ * inputs are **scoped to that design option** — exactly like the product's
139
+ * Area settings dialog. `update` writes the active option's settings (each
140
+ * option keeps its own target FAR / site area / deviation) and the reads
141
+ * ({@linkcode PluginProgramAreasApi.get} etc.) report that same scope.
142
+ * Without design options there is a single project-wide set of FAR inputs.
143
+ *
117
144
  * @param options - Any of `targetFar`, `siteArea`, `deviation`; omitted fields
118
145
  * are left unchanged.
119
146
  * @returns The recomputed {@linkcode PluginProgramAreaSummary}.
@@ -129,9 +156,39 @@ export abstract class PluginProgramAreasApi {
129
156
  * console.log(s.achievedFar, s.targetFar)
130
157
  * ```
131
158
  */
132
- public abstract update(
133
- options?: { targetFar?: number; siteArea?: number; deviation?: number },
134
- ): PluginApiReturn<PluginProgramAreasUpdateResult>
159
+ public abstract update(options?: {
160
+ targetFar?: number
161
+ siteArea?: number
162
+ deviation?: number
163
+ }): PluginApiReturn<PluginProgramAreasUpdateResult>
164
+
165
+ /**
166
+ * Force the area breakdown to recompute, then return the fresh summary.
167
+ *
168
+ * The engine recomputes the carpet / built-up / FAR totals live **only while the
169
+ * Area sidebar is open**. A plugin running with the sidebar closed can therefore
170
+ * read a stale — or never-computed — snapshot from {@linkcode
171
+ * PluginProgramAreasApi.get} / {@linkcode PluginProgramAreasApi.list}. Call
172
+ * `refresh` first to guarantee those reads reflect the current model. It is a
173
+ * read (no write gate) — it recomputes derived totals, it does not change the model.
174
+ *
175
+ * **Cost:** a full pass over every space, floor and mass in the active structure.
176
+ * Not free on large models — call it once before a batch of reads, not per read.
177
+ *
178
+ * @returns The freshly-recomputed {@linkcode PluginProgramAreaSummary}.
179
+ *
180
+ * @examplePrompt Recompute the area totals before I read them
181
+ * @examplePrompt Refresh the FAR numbers
182
+ * @examplePrompt Make sure the area breakdown is up to date
183
+ *
184
+ * # Example
185
+ * ```ts
186
+ * const s = await snaptrude.program.areas.refresh()
187
+ * const { groups } = await snaptrude.program.areas.list("storeys") // now fresh
188
+ * console.log(s.builtUp, groups.length)
189
+ * ```
190
+ */
191
+ public abstract refresh(): PluginApiReturn<PluginProgramAreasRefreshResult>
135
192
  }
136
193
 
137
194
  /**
@@ -142,9 +199,9 @@ export abstract class PluginProgramAreasApi {
142
199
  * |---|---|---|
143
200
  * | `count` | `number` | Number of spaces in the program (a count, not an area) |
144
201
  * | `hiddenCount` | `number` | Number of those spaces that are currently hidden |
145
- * | `carpet` | `number` | Total carpet area in `areaUnit` |
146
- * | `builtUp` | `number` | Total built-up area in `areaUnit` |
147
- * | `excluded` | `number` | Total excluded area in `areaUnit` |
202
+ * | `carpet` | `number` | Total **Net Internal Area** ("net") — Σ `NET`-classed spaces + floors — in `areaUnit` |
203
+ * | `builtUp` | `number` | Total **Gross External Area** ("gross") — Σ `GROSS`-classed spaces + slabs — in `areaUnit` |
204
+ * | `excluded` | `number` | Total **Excluded Area** — Σ `EXCLUDED`-classed spaces — in `areaUnit` |
148
205
  * | `farBuiltUp` | `number` | Built-up area that counts toward FAR, in `areaUnit` |
149
206
  * | `siteArea` | `number` | Site/plot area in `areaUnit` |
150
207
  * | `achievedFar` | `number \| null` | Derived FAR (`farBuiltUp / siteArea`); `null` when site area or target FAR is unset |
@@ -177,8 +234,8 @@ export type PluginProgramAreaSummary = z.infer<typeof PluginProgramAreaSummary>
177
234
  * | `groupId` | `string` | Stable id of the group (e.g. storey id, department id) |
178
235
  * | `name` | `string` | Display name of the group |
179
236
  * | `color` | `string` | CSS hex color string for the group |
180
- * | `carpet` | `number` | Carpet area for this group |
181
- * | `builtUp` | `number` | Built-up area for this group |
237
+ * | `carpet` | `number` | Net Internal Area ("net") for this group |
238
+ * | `builtUp` | `number` | Gross External Area ("gross") for this group |
182
239
  * | `excluded` | `number` | Excluded area for this group |
183
240
  * | `count` | `number` | Number of spaces in this group |
184
241
  * | `targetArea` | `number` | Target area for this group, in `targetUnit` |
@@ -201,18 +258,25 @@ export type PluginProgramAreaGroup = z.infer<typeof PluginProgramAreaGroup>
201
258
  * A single space within an area group. Area figures are in the program's area
202
259
  * unit (see {@linkcode PluginProgramAreaSummary.areaUnit}).
203
260
  *
261
+ * `areaClass` is the space's effective classification — it decides which of the
262
+ * three buckets the space's whole footprint lands in: `NET` → `carpet` ("net"),
263
+ * `GROSS` → `builtUp` ("gross"), `EXCLUDED` → `excluded`. So for any one member
264
+ * exactly one of `carpet` / `builtUp` / `excluded` is non-zero.
265
+ *
204
266
  * | Property | Type | Description |
205
267
  * |---|---|---|
206
268
  * | `id` | `ComponentHandle` | `Component.id` of the space (never a mesh handle) |
207
269
  * | `label` | `string` | Display label of the space |
208
- * | `carpet` | `number` | Carpet area of the space |
209
- * | `builtUp` | `number` | Built-up area of the space |
210
- * | `excluded` | `number` | Excluded area of the space |
270
+ * | `areaClass` | {@linkcode PluginAreaClass} | Effective area class `"NET"` (→ `carpet`), `"GROSS"` (→ `builtUp`), or `"EXCLUDED"` |
271
+ * | `carpet` | `number` | Net area of the space (non-zero when `areaClass` is `"NET"`) |
272
+ * | `builtUp` | `number` | Gross area of the space (non-zero when `areaClass` is `"GROSS"`) |
273
+ * | `excluded` | `number` | Excluded area of the space (non-zero when `areaClass` is `"EXCLUDED"`) |
211
274
  * | `isVisible` | `boolean` | Whether the space is currently visible |
212
275
  */
213
276
  export const PluginProgramAreaMember = z.object({
214
277
  id: ComponentHandle,
215
278
  label: z.string(),
279
+ areaClass: PluginAreaClass,
216
280
  carpet: z.number(),
217
281
  builtUp: z.number(),
218
282
  excluded: z.number(),
@@ -333,3 +397,12 @@ export const PluginProgramAreasUpdateResult = PluginProgramAreaSummary
333
397
  export type PluginProgramAreasUpdateResult = z.infer<
334
398
  typeof PluginProgramAreasUpdateResult
335
399
  >
400
+
401
+ /**
402
+ * Result of {@linkcode PluginProgramAreasApi.refresh} — the freshly-recomputed
403
+ * program area summary.
404
+ */
405
+ export const PluginProgramAreasRefreshResult = PluginProgramAreaSummary
406
+ export type PluginProgramAreasRefreshResult = z.infer<
407
+ typeof PluginProgramAreasRefreshResult
408
+ >
@@ -5,13 +5,9 @@ import { PluginApiReturn } from "../../types"
5
5
  * Program cores — the building's vertical-circulation cores (lift / stair / shaft
6
6
  * shells).
7
7
  *
8
- * Read the cores in the scene, test whether a space is a core, and trigger core
9
- * generation from a layout. `create` is a **thin trigger**: the program hands a
10
- * core layout to the core-generation engine, which authors the geometry — the
11
- * core geometry itself is owned by the geometry layer, not here (the exact
12
- * layout ↔ engine payload is coordinated with the geometry owner).
13
- *
14
- * `list`/`isCore` are reads; `create` triggers generation.
8
+ * Read the cores in the scene and test whether a space is a core. Both are reads;
9
+ * there is no core-generation trigger on this surface (core geometry is owned by
10
+ * the geometry layer, not here).
15
11
  *
16
12
  * Accessed via `snaptrude.program.cores`.
17
13
  */
@@ -52,37 +48,6 @@ export abstract class PluginProgramCoresApi {
52
48
  * ```
53
49
  */
54
50
  public abstract isCore(id: string): PluginApiReturn<boolean>
55
-
56
- /**
57
- * Generate core geometry from a layout (thin trigger).
58
- *
59
- * Hands the core layout to the core-generation engine and returns how many core
60
- * elements were created. The geometry is authored by the engine, not here.
61
- * _(Authored ahead — optional until the host's geometry adapter lands; the
62
- * reads {@linkcode PluginProgramCoresApi.list}/{@linkcode PluginProgramCoresApi.isCore}
63
- * are live.)_
64
- *
65
- * @param cores - The {@linkcode PluginProgramCoreSpec} layout of cores to
66
- * generate.
67
- * @param lengthUnit - Unit of the spec dimensions (default project unit).
68
- * @returns A {@linkcode PluginProgramCoresCreateResult} with the created count.
69
- * @throws If the layout could not be realized.
70
- *
71
- * @examplePrompt Generate the building cores from this layout
72
- * @examplePrompt Place the elevator and stair cores
73
- * @examplePrompt Create the service core shells
74
- *
75
- * # Example
76
- * ```ts
77
- * await snaptrude.program.cores.create([
78
- * { type: "lift", position: { x: 0, y: 0, z: 0 }, width: 3, depth: 4 },
79
- * ])
80
- * ```
81
- */
82
- public create?: (
83
- cores: PluginProgramCoreSpec[],
84
- lengthUnit?: "mm" | "m" | "ft",
85
- ) => PluginApiReturn<PluginProgramCoresCreateResult>
86
51
  }
87
52
 
88
53
  /**
@@ -116,56 +81,3 @@ export const PluginProgramCoresIsCoreArgs = z.object({
116
81
  export type PluginProgramCoresIsCoreArgs = z.infer<
117
82
  typeof PluginProgramCoresIsCoreArgs
118
83
  >
119
-
120
- /**
121
- * One core to generate. The geometry layer interprets this layout (the exact
122
- * fields are coordinated with the geometry owner).
123
- *
124
- * | Property | Type | Description |
125
- * |---|---|---|
126
- * | `type` | `string \| undefined` | Core kind (e.g. `"lift"`, `"stair"`, `"shaft"`) |
127
- * | `position` | `{ x; y; z }` | Base position of the core |
128
- * | `width` | `number` | Core width, in `lengthUnit` |
129
- * | `depth` | `number` | Core depth, in `lengthUnit` |
130
- * | `fromStorey` | `number \| undefined` | First storey the core spans |
131
- * | `toStorey` | `number \| undefined` | Last storey the core spans |
132
- */
133
- export const PluginProgramCoreSpec = z.object({
134
- type: z.string().optional(),
135
- position: z.object({ x: z.number(), y: z.number(), z: z.number() }),
136
- width: z.number(),
137
- depth: z.number(),
138
- fromStorey: z.number().optional(),
139
- toStorey: z.number().optional(),
140
- })
141
- export type PluginProgramCoreSpec = z.infer<typeof PluginProgramCoreSpec>
142
-
143
- /**
144
- * Arguments for {@linkcode PluginProgramCoresApi.create}.
145
- *
146
- * | Property | Type | Description |
147
- * |---|---|---|
148
- * | `cores` | {@linkcode PluginProgramCoreSpec}`[]` | The cores to generate |
149
- * | `lengthUnit` | `"mm" \| "m" \| "ft" \| undefined` | Unit of the spec dimensions (default project unit) |
150
- */
151
- export const PluginProgramCoresCreateArgs = z.object({
152
- cores: z.array(PluginProgramCoreSpec),
153
- lengthUnit: z.enum(["mm", "m", "ft"]).optional(),
154
- })
155
- export type PluginProgramCoresCreateArgs = z.infer<
156
- typeof PluginProgramCoresCreateArgs
157
- >
158
-
159
- /**
160
- * Result of {@linkcode PluginProgramCoresApi.create}.
161
- *
162
- * | Property | Type | Description |
163
- * |---|---|---|
164
- * | `createdCount` | `number` | Number of core elements created |
165
- */
166
- export const PluginProgramCoresCreateResult = z.object({
167
- createdCount: z.number(),
168
- })
169
- export type PluginProgramCoresCreateResult = z.infer<
170
- typeof PluginProgramCoresCreateResult
171
- >
@@ -19,19 +19,14 @@ import { PluginProgramAreasApi } from "./areas"
19
19
  *
20
20
  * - {@linkcode PluginProgramApi.departments} — Read & edit program departments (groupings + targets)
21
21
  * - {@linkcode PluginProgramApi.adjacency} — Read & compute the department/space adjacency matrix
22
- * - {@linkcode PluginProgramApi.layout} — Arrange/pack spaces in the envelope (authored ahead)
22
+ * - {@linkcode PluginProgramApi.layout} — Arrange/pack spaces in the envelope
23
23
  * - {@linkcode PluginProgramApi.metrics} — Read the area-program summary
24
24
  * - {@linkcode PluginProgramApi.areas} — FAR / built-up-area rollup and groupings
25
25
  * - {@linkcode PluginProgramApi.spreadsheet} — Render program data to sheets and read it back
26
- * - {@linkcode PluginProgramApi.site} — Read the site/plot planning context
27
- * - {@linkcode PluginProgramApi.cores} — Read & trigger vertical-circulation cores
26
+ * - {@linkcode PluginProgramApi.site} — Read site/plot context and read/update Site Analysis
27
+ * - {@linkcode PluginProgramApi.cores} — Read & predicate vertical-circulation cores (reads only)
28
28
  * - {@linkcode PluginProgramApi.classification} — Classification catalog + display tags
29
29
  *
30
- * Sub-namespaces typed as optional (`?`) are **authored ahead of the host** —
31
- * declared so plugins and codegen can see the shape, but not required of host
32
- * implementations and kept out of the discovery manifest until the host lands
33
- * them (at which point they are promoted to required `abstract` members).
34
- *
35
30
  * Accessed via `snaptrude.program`.
36
31
  */
37
32
  export abstract class PluginProgramApi {
@@ -39,20 +34,17 @@ export abstract class PluginProgramApi {
39
34
  public abstract departments: PluginProgramDepartmentsApi
40
35
  /** Adjacency matrix — read & compute proximity relationships. See {@linkcode PluginProgramAdjacencyApi}. */
41
36
  public abstract adjacency: PluginProgramAdjacencyApi
42
- /**
43
- * Arrange/pack spaces in the envelope. See {@linkcode PluginProgramLayoutApi}.
44
- * _(authored ahead — optional until the host lands it next increment.)_
45
- */
46
- public layout?: PluginProgramLayoutApi
37
+ /** Arrange/pack spaces in the envelope (async job family). See {@linkcode PluginProgramLayoutApi}. */
38
+ public abstract layout: PluginProgramLayoutApi
47
39
  /** Area-program summary — targets vs allocated area. See {@linkcode PluginProgramMetricsApi}. */
48
40
  public abstract metrics: PluginProgramMetricsApi
49
41
  /** FAR / built-up-area rollup and groupings. See {@linkcode PluginProgramAreasApi}. */
50
42
  public abstract areas: PluginProgramAreasApi
51
43
  /** Spreadsheet reports — render tables to sheets, export, list, read back. See {@linkcode PluginProgramSpreadsheetApi}. */
52
44
  public abstract spreadsheet: PluginProgramSpreadsheetApi
53
- /** Site/plot planning context total area, parcel footprints, geo rings. See {@linkcode PluginProgramSiteApi}. */
45
+ /** Site/plot context and persisted Site Analysis. See {@linkcode PluginProgramSiteApi}. */
54
46
  public abstract site: PluginProgramSiteApi
55
- /** Vertical-circulation cores — read & predicate (live); generation trigger is optional. See {@linkcode PluginProgramCoresApi}. */
47
+ /** Vertical-circulation cores — read & predicate (reads only). See {@linkcode PluginProgramCoresApi}. */
56
48
  public abstract cores: PluginProgramCoresApi
57
49
  /** Classification catalog (space/area/mass types) + display tags. See {@linkcode PluginProgramClassificationApi}. */
58
50
  public abstract classification: PluginProgramClassificationApi