@snaptrude/plugin-core 0.3.0 → 0.6.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 (302) hide show
  1. package/AGENTS.md +130 -48
  2. package/CHANGELOG.md +163 -0
  3. package/api-manifest.full.json +5600 -0
  4. package/api-manifest.json +5502 -0
  5. package/dist/api/analysis/heatmaps.d.ts +234 -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 +44 -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/sunlightHours.d.ts +208 -0
  14. package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
  15. package/dist/api/analysis/sunpath.d.ts +80 -0
  16. package/dist/api/analysis/sunpath.d.ts.map +1 -0
  17. package/dist/api/core/buildings.d.ts +427 -0
  18. package/dist/api/core/buildings.d.ts.map +1 -0
  19. package/dist/api/core/comment/index.d.ts +230 -0
  20. package/dist/api/core/comment/index.d.ts.map +1 -0
  21. package/dist/api/core/geom/create/index.d.ts +247 -0
  22. package/dist/api/core/geom/create/index.d.ts.map +1 -0
  23. package/dist/api/core/geom/delete/index.d.ts +72 -0
  24. package/dist/api/core/geom/delete/index.d.ts.map +1 -0
  25. package/dist/api/core/geom/index.d.ts +24 -23
  26. package/dist/api/core/geom/index.d.ts.map +1 -1
  27. package/dist/api/core/geom/query/arc.d.ts +169 -0
  28. package/dist/api/core/geom/query/arc.d.ts.map +1 -0
  29. package/dist/api/core/geom/query/brep.d.ts +402 -0
  30. package/dist/api/core/geom/query/brep.d.ts.map +1 -0
  31. package/dist/api/core/geom/query/circle.d.ts +378 -0
  32. package/dist/api/core/geom/query/circle.d.ts.map +1 -0
  33. package/dist/api/core/geom/query/contour.d.ts +450 -0
  34. package/dist/api/core/geom/query/contour.d.ts.map +1 -0
  35. package/dist/api/core/geom/query/curve.d.ts +918 -0
  36. package/dist/api/core/geom/query/curve.d.ts.map +1 -0
  37. package/dist/api/core/geom/query/edge.d.ts +128 -0
  38. package/dist/api/core/geom/query/edge.d.ts.map +1 -0
  39. package/dist/api/core/geom/query/face.d.ts +363 -0
  40. package/dist/api/core/geom/query/face.d.ts.map +1 -0
  41. package/dist/api/core/geom/query/halfedge.d.ts +206 -0
  42. package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
  43. package/dist/api/core/geom/query/index.d.ts +61 -0
  44. package/dist/api/core/geom/query/index.d.ts.map +1 -0
  45. package/dist/api/core/geom/query/profile.d.ts +410 -0
  46. package/dist/api/core/geom/query/profile.d.ts.map +1 -0
  47. package/dist/api/core/geom/query/vertex.d.ts +187 -0
  48. package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
  49. package/dist/api/core/geom/update/contour.d.ts +272 -0
  50. package/dist/api/core/geom/update/contour.d.ts.map +1 -0
  51. package/dist/api/core/geom/update/curve.d.ts +180 -0
  52. package/dist/api/core/geom/update/curve.d.ts.map +1 -0
  53. package/dist/api/core/geom/update/index.d.ts +27 -0
  54. package/dist/api/core/geom/update/index.d.ts.map +1 -0
  55. package/dist/api/core/geom/update/profile.d.ts +329 -0
  56. package/dist/api/core/geom/update/profile.d.ts.map +1 -0
  57. package/dist/api/core/groups.d.ts +485 -0
  58. package/dist/api/core/groups.d.ts.map +1 -0
  59. package/dist/api/core/history/index.d.ts +78 -0
  60. package/dist/api/core/history/index.d.ts.map +1 -0
  61. package/dist/api/core/index.d.ts +51 -1
  62. package/dist/api/core/index.d.ts.map +1 -1
  63. package/dist/api/core/io/import/index.d.ts +392 -0
  64. package/dist/api/core/io/import/index.d.ts.map +1 -0
  65. package/dist/api/core/io/index.d.ts +35 -0
  66. package/dist/api/core/io/index.d.ts.map +1 -0
  67. package/dist/api/core/io/job/index.d.ts +139 -0
  68. package/dist/api/core/io/job/index.d.ts.map +1 -0
  69. package/dist/api/core/io/query/index.d.ts +74 -0
  70. package/dist/api/core/io/query/index.d.ts.map +1 -0
  71. package/dist/api/core/io/terrain/index.d.ts +206 -0
  72. package/dist/api/core/io/terrain/index.d.ts.map +1 -0
  73. package/dist/api/core/io/underlay/index.d.ts +286 -0
  74. package/dist/api/core/io/underlay/index.d.ts.map +1 -0
  75. package/dist/api/core/layers.d.ts +402 -0
  76. package/dist/api/core/layers.d.ts.map +1 -0
  77. package/dist/api/core/math/quat.d.ts +111 -128
  78. package/dist/api/core/math/quat.d.ts.map +1 -1
  79. package/dist/api/core/math/vec3.d.ts +120 -102
  80. package/dist/api/core/math/vec3.d.ts.map +1 -1
  81. package/dist/api/core/project/index.d.ts +399 -0
  82. package/dist/api/core/project/index.d.ts.map +1 -0
  83. package/dist/api/core/tags.d.ts +755 -0
  84. package/dist/api/core/tags.d.ts.map +1 -0
  85. package/dist/api/core/units/index.d.ts +175 -0
  86. package/dist/api/core/units/index.d.ts.map +1 -0
  87. package/dist/api/core/zoom/index.d.ts +45 -0
  88. package/dist/api/core/zoom/index.d.ts.map +1 -0
  89. package/dist/api/design/boolean/index.d.ts +168 -0
  90. package/dist/api/design/boolean/index.d.ts.map +1 -0
  91. package/dist/api/design/create/index.d.ts +837 -0
  92. package/dist/api/design/create/index.d.ts.map +1 -0
  93. package/dist/api/design/delete/index.d.ts +63 -0
  94. package/dist/api/design/delete/index.d.ts.map +1 -0
  95. package/dist/api/design/doors/index.d.ts +268 -0
  96. package/dist/api/design/doors/index.d.ts.map +1 -0
  97. package/dist/api/design/edit/index.d.ts +49 -0
  98. package/dist/api/design/edit/index.d.ts.map +1 -0
  99. package/dist/api/design/erase/index.d.ts +160 -0
  100. package/dist/api/design/erase/index.d.ts.map +1 -0
  101. package/dist/api/design/furniture/index.d.ts +123 -0
  102. package/dist/api/design/furniture/index.d.ts.map +1 -0
  103. package/dist/api/design/index.d.ts +153 -0
  104. package/dist/api/design/index.d.ts.map +1 -0
  105. package/dist/api/design/lock.d.ts +41 -0
  106. package/dist/api/design/lock.d.ts.map +1 -0
  107. package/dist/api/design/materials/index.d.ts +297 -0
  108. package/dist/api/design/materials/index.d.ts.map +1 -0
  109. package/dist/api/design/query/geometry/index.d.ts +140 -0
  110. package/dist/api/design/query/geometry/index.d.ts.map +1 -0
  111. package/dist/api/design/query/index.d.ts +1011 -0
  112. package/dist/api/design/query/index.d.ts.map +1 -0
  113. package/dist/api/design/query/spaces.d.ts +221 -0
  114. package/dist/api/design/query/spaces.d.ts.map +1 -0
  115. package/dist/api/design/selection/index.d.ts +282 -0
  116. package/dist/api/design/selection/index.d.ts.map +1 -0
  117. package/dist/api/design/shared.d.ts +38 -0
  118. package/dist/api/design/shared.d.ts.map +1 -0
  119. package/dist/api/design/transform/index.d.ts +87 -0
  120. package/dist/api/design/transform/index.d.ts.map +1 -0
  121. package/dist/api/design/update/index.d.ts +178 -0
  122. package/dist/api/design/update/index.d.ts.map +1 -0
  123. package/dist/api/design/windows/index.d.ts +189 -0
  124. package/dist/api/design/windows/index.d.ts.map +1 -0
  125. package/dist/api/entity/buildableEnvelope.d.ts +261 -0
  126. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
  127. package/dist/api/entity/department.d.ts +0 -98
  128. package/dist/api/entity/department.d.ts.map +1 -1
  129. package/dist/api/entity/index.d.ts +9 -9
  130. package/dist/api/entity/index.d.ts.map +1 -1
  131. package/dist/api/entity/referenceLine.d.ts +49 -106
  132. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  133. package/dist/api/entity/space.d.ts +484 -251
  134. package/dist/api/entity/space.d.ts.map +1 -1
  135. package/dist/api/entity/story.d.ts +49 -39
  136. package/dist/api/entity/story.d.ts.map +1 -1
  137. package/dist/api/index.d.ts +22 -12
  138. package/dist/api/index.d.ts.map +1 -1
  139. package/dist/api/presentation/aiInspiration.d.ts +440 -0
  140. package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
  141. package/dist/api/presentation/diagrams.d.ts +81 -0
  142. package/dist/api/presentation/diagrams.d.ts.map +1 -0
  143. package/dist/api/presentation/import.d.ts +113 -0
  144. package/dist/api/presentation/import.d.ts.map +1 -0
  145. package/dist/api/presentation/index.d.ts +46 -0
  146. package/dist/api/presentation/index.d.ts.map +1 -0
  147. package/dist/api/presentation/sheets.d.ts +176 -0
  148. package/dist/api/presentation/sheets.d.ts.map +1 -0
  149. package/dist/api/presentation/views.d.ts +296 -0
  150. package/dist/api/presentation/views.d.ts.map +1 -0
  151. package/dist/api/program/adjacency.d.ts +155 -0
  152. package/dist/api/program/adjacency.d.ts.map +1 -0
  153. package/dist/api/program/areas.d.ts +360 -0
  154. package/dist/api/program/areas.d.ts.map +1 -0
  155. package/dist/api/program/classification.d.ts +135 -0
  156. package/dist/api/program/classification.d.ts.map +1 -0
  157. package/dist/api/program/cores.d.ts +174 -0
  158. package/dist/api/program/cores.d.ts.map +1 -0
  159. package/dist/api/program/departments.d.ts +431 -0
  160. package/dist/api/program/departments.d.ts.map +1 -0
  161. package/dist/api/program/index.d.ts +69 -0
  162. package/dist/api/program/index.d.ts.map +1 -0
  163. package/dist/api/program/layout.d.ts +63 -0
  164. package/dist/api/program/layout.d.ts.map +1 -0
  165. package/dist/api/program/metrics.d.ts +108 -0
  166. package/dist/api/program/metrics.d.ts.map +1 -0
  167. package/dist/api/program/site.d.ts +451 -0
  168. package/dist/api/program/site.d.ts.map +1 -0
  169. package/dist/api/program/spreadsheet.d.ts +2041 -0
  170. package/dist/api/program/spreadsheet.d.ts.map +1 -0
  171. package/dist/handles.d.ts +171 -0
  172. package/dist/handles.d.ts.map +1 -0
  173. package/dist/host-utils.d.ts +7 -5
  174. package/dist/host-utils.d.ts.map +1 -1
  175. package/dist/index.cjs +4344 -899
  176. package/dist/index.cjs.map +1 -1
  177. package/dist/index.d.ts +1 -0
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +3682 -865
  180. package/dist/index.js.map +1 -1
  181. package/package.json +6 -2
  182. package/scripts/generate-manifest.mjs +193 -0
  183. package/scripts/generate-manifest.test.mjs +215 -0
  184. package/src/api/analysis/heatmaps.ts +256 -0
  185. package/src/api/analysis/illuminance.ts +155 -0
  186. package/src/api/analysis/index.ts +46 -0
  187. package/src/api/analysis/shadows.ts +183 -0
  188. package/src/api/analysis/sunlightHours.ts +211 -0
  189. package/src/api/analysis/sunpath.ts +83 -0
  190. package/src/api/core/buildings.ts +485 -0
  191. package/src/api/core/comment/index.ts +258 -0
  192. package/src/api/core/geom/create/index.ts +293 -0
  193. package/src/api/core/geom/delete/index.ts +78 -0
  194. package/src/api/core/geom/index.ts +24 -23
  195. package/src/api/core/geom/query/arc.ts +169 -0
  196. package/src/api/core/geom/query/brep.ts +444 -0
  197. package/src/api/core/geom/query/circle.ts +404 -0
  198. package/src/api/core/geom/query/contour.ts +540 -0
  199. package/src/api/core/geom/query/curve.ts +1078 -0
  200. package/src/api/core/geom/query/edge.ts +130 -0
  201. package/src/api/core/geom/query/face.ts +403 -0
  202. package/src/api/core/geom/query/halfedge.ts +210 -0
  203. package/src/api/core/geom/query/index.ts +63 -0
  204. package/src/api/core/geom/query/profile.ts +473 -0
  205. package/src/api/core/geom/query/vertex.ts +205 -0
  206. package/src/api/core/geom/update/contour.ts +315 -0
  207. package/src/api/core/geom/update/curve.ts +209 -0
  208. package/src/api/core/geom/update/index.ts +29 -0
  209. package/src/api/core/geom/update/profile.ts +377 -0
  210. package/src/api/core/groups.ts +521 -0
  211. package/src/api/core/history/index.ts +84 -0
  212. package/src/api/core/index.ts +51 -1
  213. package/src/api/core/io/import/index.ts +432 -0
  214. package/src/api/core/io/index.ts +37 -0
  215. package/src/api/core/io/job/index.ts +140 -0
  216. package/src/api/core/io/query/index.ts +71 -0
  217. package/src/api/core/io/terrain/index.ts +214 -0
  218. package/src/api/core/io/underlay/index.ts +295 -0
  219. package/src/api/core/layers.ts +333 -0
  220. package/src/api/core/math/quat.ts +112 -235
  221. package/src/api/core/math/vec3.ts +124 -159
  222. package/src/api/core/project/index.ts +418 -0
  223. package/src/api/core/tags.ts +808 -0
  224. package/src/api/core/units/index.ts +164 -0
  225. package/src/api/core/zoom/index.ts +47 -0
  226. package/src/api/design/boolean/index.ts +179 -0
  227. package/src/api/design/create/index.ts +895 -0
  228. package/src/api/design/delete/index.ts +67 -0
  229. package/src/api/design/doors/index.ts +285 -0
  230. package/src/api/design/edit/index.ts +54 -0
  231. package/src/api/design/erase/index.ts +151 -0
  232. package/src/api/design/furniture/index.ts +130 -0
  233. package/src/api/design/index.ts +162 -0
  234. package/src/api/design/lock.ts +42 -0
  235. package/src/api/design/materials/index.ts +301 -0
  236. package/src/api/design/query/geometry/index.ts +166 -0
  237. package/src/api/design/query/index.ts +937 -0
  238. package/src/api/design/query/spaces.ts +132 -0
  239. package/src/api/design/selection/index.ts +273 -0
  240. package/src/api/design/shared.ts +40 -0
  241. package/src/api/design/transform/index.ts +93 -0
  242. package/src/api/design/update/index.ts +117 -0
  243. package/src/api/design/windows/index.ts +207 -0
  244. package/src/api/entity/buildableEnvelope.ts +318 -0
  245. package/src/api/entity/department.ts +0 -113
  246. package/src/api/entity/index.ts +9 -9
  247. package/src/api/entity/referenceLine.ts +50 -38
  248. package/src/api/entity/space.ts +285 -226
  249. package/src/api/entity/story.ts +53 -42
  250. package/src/api/index.ts +22 -12
  251. package/src/api/presentation/aiInspiration.ts +362 -0
  252. package/src/api/presentation/diagrams.ts +84 -0
  253. package/src/api/presentation/import.ts +112 -0
  254. package/src/api/presentation/index.ts +48 -0
  255. package/src/api/presentation/sheets.ts +198 -0
  256. package/src/api/presentation/views.ts +303 -0
  257. package/src/api/program/adjacency.ts +164 -0
  258. package/src/api/program/areas.ts +335 -0
  259. package/src/api/program/classification.ts +138 -0
  260. package/src/api/program/cores.ts +171 -0
  261. package/src/api/program/departments.ts +465 -0
  262. package/src/api/program/index.ts +71 -0
  263. package/src/api/program/layout.ts +68 -0
  264. package/src/api/program/metrics.ts +120 -0
  265. package/src/api/program/site.ts +419 -0
  266. package/src/api/program/spreadsheet.ts +2075 -0
  267. package/src/handles.ts +194 -0
  268. package/src/host-utils.ts +10 -6
  269. package/src/index.ts +1 -0
  270. package/dist/api/core/geom/arc.d.ts +0 -81
  271. package/dist/api/core/geom/arc.d.ts.map +0 -1
  272. package/dist/api/core/geom/curve.d.ts +0 -70
  273. package/dist/api/core/geom/curve.d.ts.map +0 -1
  274. package/dist/api/core/geom/line.d.ts +0 -56
  275. package/dist/api/core/geom/line.d.ts.map +0 -1
  276. package/dist/api/core/geom/profile.d.ts +0 -121
  277. package/dist/api/core/geom/profile.d.ts.map +0 -1
  278. package/dist/api/tools/copy.d.ts +0 -59
  279. package/dist/api/tools/copy.d.ts.map +0 -1
  280. package/dist/api/tools/index.d.ts +0 -33
  281. package/dist/api/tools/index.d.ts.map +0 -1
  282. package/dist/api/tools/material.d.ts +0 -51
  283. package/dist/api/tools/material.d.ts.map +0 -1
  284. package/dist/api/tools/offset.d.ts +0 -43
  285. package/dist/api/tools/offset.d.ts.map +0 -1
  286. package/dist/api/tools/selection.d.ts +0 -48
  287. package/dist/api/tools/selection.d.ts.map +0 -1
  288. package/dist/api/tools/transform.d.ts +0 -114
  289. package/dist/api/tools/transform.d.ts.map +0 -1
  290. package/dist/api/units/index.d.ts +0 -163
  291. package/dist/api/units/index.d.ts.map +0 -1
  292. package/src/api/core/geom/arc.ts +0 -70
  293. package/src/api/core/geom/curve.ts +0 -41
  294. package/src/api/core/geom/line.ts +0 -53
  295. package/src/api/core/geom/profile.ts +0 -94
  296. package/src/api/tools/copy.ts +0 -55
  297. package/src/api/tools/index.ts +0 -39
  298. package/src/api/tools/material.ts +0 -49
  299. package/src/api/tools/offset.ts +0 -43
  300. package/src/api/tools/selection.ts +0 -51
  301. package/src/api/tools/transform.ts +0 -117
  302. package/src/api/units/index.ts +0 -163
@@ -0,0 +1,155 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ /**
4
+ * Program adjacency — the proximity relationships between departments or
5
+ * spaces.
6
+ *
7
+ * Adjacency is stage one of the product's space-planning workflow (compute →
8
+ * arrange → pack): the AI service scores which program elements need to be
9
+ * near each other, and the geometry contributes physical contact. Cell values:
10
+ *
11
+ * | Value | Meaning |
12
+ * |---|---|
13
+ * | `2` | Direct — adjacency required |
14
+ * | `1` | Indirect — nearby preferred, or physical contact |
15
+ * | `-1` | Restricted — must NOT be adjacent |
16
+ * | `0` | No relationship — or adjacency was never computed |
17
+ *
18
+ * Zeros are ambiguous **by design** (the engine cannot distinguish "no
19
+ * relationship" from "never computed"): call
20
+ * {@linkcode PluginProgramAdjacencyApi.compute} first when you need fresh
21
+ * data. Persisted matrices auto-hydrate on scene load, so warm reads are the
22
+ * common case. The arrange/pack stages of the workflow live in
23
+ * {@linkcode PluginProgramLayoutApi} (`program.layout`).
24
+ *
25
+ * Accessed via `snaptrude.program.adjacency`.
26
+ */
27
+ export declare abstract class PluginProgramAdjacencyApi {
28
+ constructor();
29
+ /**
30
+ * Read the adjacency matrix at the department or space level.
31
+ *
32
+ * Returns a square `matrix` whose rows/columns are aligned to `ids`
33
+ * (component ids). Pass `ids` to read a sub-matrix in that order; omit it to
34
+ * get every eligible element at that level. Cell values:
35
+ *
36
+ * | Value | Meaning |
37
+ * |---|---|
38
+ * | `2` | Direct — adjacency required |
39
+ * | `1` | Indirect — nearby preferred, or physical contact |
40
+ * | `-1` | Restricted — must NOT be adjacent |
41
+ * | `0` | No relationship — or adjacency was never computed |
42
+ *
43
+ * Zeros are ambiguous by design — call
44
+ * {@linkcode PluginProgramAdjacencyApi.compute} first for fresh data
45
+ * (persisted matrices auto-hydrate on scene load, so warm reads are the
46
+ * common case). Space-level relationships are computed within a storey:
47
+ * cross-storey pairs always read `0`. At the `department` level the result
48
+ * also carries `departmentIds`, a parallel array joining each row to the
49
+ * department entity ids returned by `program.departments.list` (the row
50
+ * `ids` are department-mass component ids, not department entity ids).
51
+ *
52
+ * @param level - Read the `"department"` or `"space"` matrix.
53
+ * @param ids - Component ids to read a sub-matrix for, in this order
54
+ * (defaults to every eligible element at the level).
55
+ * @returns A {@linkcode PluginProgramAdjacencyGetMatrixResult} with `ids`,
56
+ * the square `matrix`, and (at department level) `departmentIds`.
57
+ * @throws If an id is unknown or does not match the requested level.
58
+ *
59
+ * @examplePrompt Get the space adjacency matrix
60
+ * @examplePrompt Which departments must be adjacent?
61
+ * @examplePrompt Show the adjacency relationships between departments
62
+ * @examplePrompt Read the adjacency matrix for these spaces
63
+ * @examplePrompt Which rooms are restricted from being next to each other?
64
+ *
65
+ * # Example
66
+ * ```ts
67
+ * const { ids, matrix } = await snaptrude.program.adjacency.getMatrix("department")
68
+ * ```
69
+ */
70
+ abstract getMatrix(level: PluginAdjacencyLevel, ids?: string[]): PluginApiReturn<PluginProgramAdjacencyGetMatrixResult>;
71
+ /**
72
+ * Compute (or refresh) the adjacency data for the project.
73
+ *
74
+ * Runs the AI adjacency precompute and persists the result; a no-op when
75
+ * the stored data is already fresh. A real run takes **~2s at minimum**
76
+ * (engine pacing) plus the AI service round-trip. This is a write (it
77
+ * mutates and persists project analysis data), so it is blocked when plugin
78
+ * writes are disabled.
79
+ *
80
+ * @returns A {@linkcode PluginProgramAdjacencyComputeResult} —
81
+ * `{ success: true }` when the data is fresh or the run completed;
82
+ * `{ success: false, error }` when the AI service could not be reached.
83
+ *
84
+ * @examplePrompt Refresh adjacency analysis
85
+ * @examplePrompt Compute the adjacency matrix for this project
86
+ * @examplePrompt Recalculate which departments should be adjacent
87
+ *
88
+ * # Example
89
+ * ```ts
90
+ * const { success } = await snaptrude.program.adjacency.compute()
91
+ * if (success) {
92
+ * const data = await snaptrude.program.adjacency.getMatrix("space")
93
+ * }
94
+ * ```
95
+ */
96
+ abstract compute(): PluginApiReturn<PluginProgramAdjacencyComputeResult>;
97
+ }
98
+ /**
99
+ * The level an adjacency matrix is read at.
100
+ *
101
+ * | Value | Description |
102
+ * |---|---|
103
+ * | `"department"` | One row/column per department mass |
104
+ * | `"space"` | One row/column per space (within a storey) |
105
+ */
106
+ export declare const PluginAdjacencyLevel: z.ZodEnum<{
107
+ space: "space";
108
+ department: "department";
109
+ }>;
110
+ export type PluginAdjacencyLevel = z.infer<typeof PluginAdjacencyLevel>;
111
+ /**
112
+ * Arguments for {@linkcode PluginProgramAdjacencyApi.getMatrix}.
113
+ *
114
+ * | Property | Type | Description |
115
+ * |---|---|---|
116
+ * | `level` | {@linkcode PluginAdjacencyLevel} | Read the `"department"` or `"space"` matrix |
117
+ * | `ids` | `string[] \| undefined` | Component ids to read a sub-matrix for, in this order (defaults to every eligible element at the level) |
118
+ */
119
+ export declare const PluginProgramAdjacencyGetMatrixArgs: z.ZodObject<{
120
+ level: z.ZodEnum<{
121
+ space: "space";
122
+ department: "department";
123
+ }>;
124
+ ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
125
+ }, z.core.$strip>;
126
+ export type PluginProgramAdjacencyGetMatrixArgs = z.infer<typeof PluginProgramAdjacencyGetMatrixArgs>;
127
+ /**
128
+ * Result of {@linkcode PluginProgramAdjacencyApi.getMatrix}.
129
+ *
130
+ * | Property | Type | Description |
131
+ * |---|---|---|
132
+ * | `ids` | `string[]` | Component ids, in matrix row/column order |
133
+ * | `departmentIds` | `(string \| null)[] \| undefined` | Department level only: parallel to `ids`, the department entity id each row belongs to (joinable against `program.departments.list`), `null` when unassigned |
134
+ * | `matrix` | `number[][]` | Square matrix aligned to `ids`; values in `{-1, 0, 1, 2}` |
135
+ */
136
+ export declare const PluginProgramAdjacencyGetMatrixResult: z.ZodObject<{
137
+ ids: z.ZodArray<z.ZodString>;
138
+ departmentIds: z.ZodOptional<z.ZodArray<z.ZodNullable<z.ZodString>>>;
139
+ matrix: z.ZodArray<z.ZodArray<z.ZodNumber>>;
140
+ }, z.core.$strip>;
141
+ export type PluginProgramAdjacencyGetMatrixResult = z.infer<typeof PluginProgramAdjacencyGetMatrixResult>;
142
+ /**
143
+ * Result of {@linkcode PluginProgramAdjacencyApi.compute}.
144
+ *
145
+ * | Property | Type | Description |
146
+ * |---|---|---|
147
+ * | `success` | `boolean` | `true` when the data is fresh or the run completed |
148
+ * | `error` | `string \| undefined` | Failure reason when `success` is `false` |
149
+ */
150
+ export declare const PluginProgramAdjacencyComputeResult: z.ZodObject<{
151
+ success: z.ZodBoolean;
152
+ error: z.ZodOptional<z.ZodString>;
153
+ }, z.core.$strip>;
154
+ export type PluginProgramAdjacencyComputeResult = z.infer<typeof PluginProgramAdjacencyComputeResult>;
155
+ //# sourceMappingURL=adjacency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adjacency.d.ts","sourceRoot":"","sources":["../../../src/api/program/adjacency.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,8BAAsB,yBAAyB;;IAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;aACa,SAAS,CACvB,KAAK,EAAE,oBAAoB,EAC3B,GAAG,CAAC,EAAE,MAAM,EAAE,GACb,eAAe,CAAC,qCAAqC,CAAC;IAEzD;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,OAAO,IAAI,eAAe,CAAC,mCAAmC,CAAC;CAChF;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB;;;EAAkC,CAAA;AACnE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC;;;;;;iBAG9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qCAAqC;;;;iBAIhD,CAAA;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC;;;iBAG9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA"}
@@ -0,0 +1,360 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ import { ComponentHandle } from "../../handles";
4
+ /**
5
+ * Program areas — the FAR / built-up-area rollup for the active program.
6
+ *
7
+ * This is the zoning-compliance lens on the model: carpet / built-up / excluded
8
+ * area totals, the site area, and the achieved-vs-target **FAR** (Floor Area
9
+ * Ratio). It complements {@linkcode PluginProgramMetricsApi}, which is the
10
+ * department-allocation lens (targets vs allocated area per department); this
11
+ * namespace is the whole-program area/FAR summary and its groupings.
12
+ *
13
+ * `achievedFar` is **derived and read-only** — computed from built-up area and
14
+ * site area. `targetFar` is the goal you set (via {@linkcode
15
+ * PluginProgramAreasApi.update}); the two are the same ratio, one measured and
16
+ * one intended. The surface speaks **FAR only** — there is no FSI alias.
17
+ *
18
+ * Reads return plain records and never throw. The write member typed as optional
19
+ * (`?`) is **authored ahead of the host** — declared so plugins and codegen can
20
+ * see the shape, but kept out of the discovery manifest until the host lands it
21
+ * (at which point it is promoted to a required `abstract` member).
22
+ *
23
+ * Accessed via `snaptrude.program.areas`.
24
+ */
25
+ export declare abstract class PluginProgramAreasApi {
26
+ constructor();
27
+ /**
28
+ * Get the program area summary.
29
+ *
30
+ * Returns the whole-program totals — carpet / built-up / excluded area, site
31
+ * area, and achieved vs target FAR — with the area unit they are reported in.
32
+ *
33
+ * @returns A {@linkcode PluginProgramAreaSummary}. `achievedFar` is `null` when
34
+ * the site area or target FAR is not set.
35
+ *
36
+ * @examplePrompt What's my FAR right now?
37
+ * @examplePrompt Give me the program area summary
38
+ * @examplePrompt How much built-up area have I used against the site area?
39
+ * @examplePrompt Am I within my FAR target?
40
+ *
41
+ * # Example
42
+ * ```ts
43
+ * const s = await snaptrude.program.areas.get()
44
+ * console.log(s.builtUp, s.siteArea, s.achievedFar, s.targetFar, s.areaUnit)
45
+ * ```
46
+ */
47
+ abstract get(): PluginApiReturn<PluginProgramAreasGetResult>;
48
+ /**
49
+ * List the program area rollup grouped by a facet.
50
+ *
51
+ * Breaks the program's area totals into buckets — by label, storey, building,
52
+ * department, or tag category.
53
+ *
54
+ * @param groupBy - The facet to group by (a {@linkcode PluginProgramAreaGroupBy}).
55
+ * @param categoryId - The tag category to group by (required when `groupBy` is
56
+ * `"tagCategories"`).
57
+ * @returns A {@linkcode PluginProgramAreasListResult} with a `groups` array
58
+ * (empty when the program has no spaces).
59
+ *
60
+ * @examplePrompt Break down the area by storey
61
+ * @examplePrompt Show the area rollup per department
62
+ * @examplePrompt Group the built-up area by building
63
+ *
64
+ * # Example
65
+ * ```ts
66
+ * const { groups } = await snaptrude.program.areas.list("storeys")
67
+ * for (const g of groups) console.log(g.name, g.builtUp, g.count)
68
+ * ```
69
+ */
70
+ abstract list(groupBy: PluginProgramAreaGroupBy, categoryId?: string): PluginApiReturn<PluginProgramAreasListResult>;
71
+ /**
72
+ * List the spaces that make up one area group.
73
+ *
74
+ * Drills into a single bucket returned by {@linkcode
75
+ * PluginProgramAreasApi.list} and returns its member spaces with their per-space
76
+ * area figures.
77
+ *
78
+ * @param groupBy - The same facet used to produce the group (a {@linkcode
79
+ * PluginProgramAreaGroupBy}).
80
+ * @param groupId - The id of the group to expand.
81
+ * @param categoryId - The tag category context (required when `groupBy` is
82
+ * `"tagCategories"`).
83
+ * @returns A {@linkcode PluginProgramAreasListMembersResult} with a `members`
84
+ * array (empty when the group is missing or empty).
85
+ *
86
+ * @examplePrompt List the spaces on this storey with their areas
87
+ * @examplePrompt What rooms are in the Bedrooms department bucket?
88
+ * @examplePrompt Break the storey area down into individual spaces
89
+ *
90
+ * # Example
91
+ * ```ts
92
+ * const { members } = await snaptrude.program.areas.listMembers("storeys", "st_2")
93
+ * for (const m of members) console.log(m.label, m.carpet)
94
+ * ```
95
+ */
96
+ abstract listMembers(groupBy: PluginProgramAreaGroupBy, groupId: string, categoryId?: string): PluginApiReturn<PluginProgramAreasListMembersResult>;
97
+ /**
98
+ * Update the program's FAR settings.
99
+ *
100
+ * A **sparse** update of the program-level FAR inputs — target FAR, the site
101
+ * area, and the allowed deviation. This is a **non-undoable settings write**
102
+ * (persisted with the project). `achievedFar` recomputes from these.
103
+ *
104
+ * @param options - Any of `targetFar`, `siteArea`, `deviation`; omitted fields
105
+ * are left unchanged.
106
+ * @returns The recomputed {@linkcode PluginProgramAreaSummary}.
107
+ * @throws If a value is out of range.
108
+ *
109
+ * @examplePrompt Set the target FAR to 2.5
110
+ * @examplePrompt Override the site area to 5000
111
+ * @examplePrompt Allow a 10 percent FAR deviation
112
+ *
113
+ * # Example
114
+ * ```ts
115
+ * const s = await snaptrude.program.areas.update({ targetFar: 2.5 })
116
+ * console.log(s.achievedFar, s.targetFar)
117
+ * ```
118
+ */
119
+ abstract update(options?: {
120
+ targetFar?: number;
121
+ siteArea?: number;
122
+ deviation?: number;
123
+ }): PluginApiReturn<PluginProgramAreasUpdateResult>;
124
+ }
125
+ /**
126
+ * The whole-program area / FAR summary. All area figures are in `areaUnit`;
127
+ * ratios (`achievedFar`, `targetFar`, `deviation`) are unitless.
128
+ *
129
+ * | Property | Type | Description |
130
+ * |---|---|---|
131
+ * | `count` | `number` | Number of spaces in the program (a count, not an area) |
132
+ * | `hiddenCount` | `number` | Number of those spaces that are currently hidden |
133
+ * | `carpet` | `number` | Total carpet area in `areaUnit` |
134
+ * | `builtUp` | `number` | Total built-up area in `areaUnit` |
135
+ * | `excluded` | `number` | Total excluded area in `areaUnit` |
136
+ * | `farBuiltUp` | `number` | Built-up area that counts toward FAR, in `areaUnit` |
137
+ * | `siteArea` | `number` | Site/plot area in `areaUnit` |
138
+ * | `achievedFar` | `number \| null` | Derived FAR (`farBuiltUp / siteArea`); `null` when site area or target FAR is unset |
139
+ * | `targetFar` | `number` | The target FAR goal (set via `update`) |
140
+ * | `deviation` | `number` | Allowed FAR deviation, as a percentage |
141
+ * | `areaUnit` | `"ft2" \| "m2"` | The unit every area figure above is reported in |
142
+ */
143
+ export declare const PluginProgramAreaSummary: z.ZodObject<{
144
+ count: z.ZodNumber;
145
+ hiddenCount: z.ZodNumber;
146
+ carpet: z.ZodNumber;
147
+ builtUp: z.ZodNumber;
148
+ excluded: z.ZodNumber;
149
+ farBuiltUp: z.ZodNumber;
150
+ siteArea: z.ZodNumber;
151
+ achievedFar: z.ZodNullable<z.ZodNumber>;
152
+ targetFar: z.ZodNumber;
153
+ deviation: z.ZodNumber;
154
+ areaUnit: z.ZodEnum<{
155
+ ft2: "ft2";
156
+ m2: "m2";
157
+ }>;
158
+ }, z.core.$strip>;
159
+ export type PluginProgramAreaSummary = z.infer<typeof PluginProgramAreaSummary>;
160
+ /**
161
+ * One bucket of the area rollup. Carpet / built-up / excluded figures are in the
162
+ * program's area unit (see {@linkcode PluginProgramAreaSummary.areaUnit});
163
+ * `targetArea` is in `targetUnit`.
164
+ *
165
+ * | Property | Type | Description |
166
+ * |---|---|---|
167
+ * | `groupId` | `string` | Stable id of the group (e.g. storey id, department id) |
168
+ * | `name` | `string` | Display name of the group |
169
+ * | `color` | `string` | CSS hex color string for the group |
170
+ * | `carpet` | `number` | Carpet area for this group |
171
+ * | `builtUp` | `number` | Built-up area for this group |
172
+ * | `excluded` | `number` | Excluded area for this group |
173
+ * | `count` | `number` | Number of spaces in this group |
174
+ * | `targetArea` | `number` | Target area for this group, in `targetUnit` |
175
+ * | `targetUnit` | `"ft2" \| "m2"` | The unit `targetArea` is reported in |
176
+ */
177
+ export declare const PluginProgramAreaGroup: z.ZodObject<{
178
+ groupId: z.ZodString;
179
+ name: z.ZodString;
180
+ color: z.ZodString;
181
+ carpet: z.ZodNumber;
182
+ builtUp: z.ZodNumber;
183
+ excluded: z.ZodNumber;
184
+ count: z.ZodNumber;
185
+ targetArea: z.ZodNumber;
186
+ targetUnit: z.ZodEnum<{
187
+ ft2: "ft2";
188
+ m2: "m2";
189
+ }>;
190
+ }, z.core.$strip>;
191
+ export type PluginProgramAreaGroup = z.infer<typeof PluginProgramAreaGroup>;
192
+ /**
193
+ * A single space within an area group. Area figures are in the program's area
194
+ * unit (see {@linkcode PluginProgramAreaSummary.areaUnit}).
195
+ *
196
+ * | Property | Type | Description |
197
+ * |---|---|---|
198
+ * | `id` | `ComponentHandle` | `Component.id` of the space (never a mesh handle) |
199
+ * | `label` | `string` | Display label of the space |
200
+ * | `carpet` | `number` | Carpet area of the space |
201
+ * | `builtUp` | `number` | Built-up area of the space |
202
+ * | `excluded` | `number` | Excluded area of the space |
203
+ * | `isVisible` | `boolean` | Whether the space is currently visible |
204
+ */
205
+ export declare const PluginProgramAreaMember: z.ZodObject<{
206
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
207
+ label: z.ZodString;
208
+ carpet: z.ZodNumber;
209
+ builtUp: z.ZodNumber;
210
+ excluded: z.ZodNumber;
211
+ isVisible: z.ZodBoolean;
212
+ }, z.core.$strip>;
213
+ export type PluginProgramAreaMember = z.infer<typeof PluginProgramAreaMember>;
214
+ /** The facet to group the area rollup by. */
215
+ export declare const PluginProgramAreaGroupBy: z.ZodEnum<{
216
+ buildings: "buildings";
217
+ storeys: "storeys";
218
+ departments: "departments";
219
+ labels: "labels";
220
+ tagCategories: "tagCategories";
221
+ }>;
222
+ export type PluginProgramAreaGroupBy = z.infer<typeof PluginProgramAreaGroupBy>;
223
+ /** Result of {@linkcode PluginProgramAreasApi.get} — the program area summary. */
224
+ export declare const PluginProgramAreasGetResult: z.ZodObject<{
225
+ count: z.ZodNumber;
226
+ hiddenCount: z.ZodNumber;
227
+ carpet: z.ZodNumber;
228
+ builtUp: z.ZodNumber;
229
+ excluded: z.ZodNumber;
230
+ farBuiltUp: z.ZodNumber;
231
+ siteArea: z.ZodNumber;
232
+ achievedFar: z.ZodNullable<z.ZodNumber>;
233
+ targetFar: z.ZodNumber;
234
+ deviation: z.ZodNumber;
235
+ areaUnit: z.ZodEnum<{
236
+ ft2: "ft2";
237
+ m2: "m2";
238
+ }>;
239
+ }, z.core.$strip>;
240
+ export type PluginProgramAreasGetResult = z.infer<typeof PluginProgramAreasGetResult>;
241
+ /**
242
+ * Arguments for {@linkcode PluginProgramAreasApi.list}.
243
+ *
244
+ * | Property | Type | Description |
245
+ * |---|---|---|
246
+ * | `groupBy` | {@linkcode PluginProgramAreaGroupBy} | The facet to group by |
247
+ * | `categoryId` | `string \| undefined` | Tag category to group by; required when `groupBy` is `"tagCategories"` |
248
+ */
249
+ export declare const PluginProgramAreasListArgs: z.ZodObject<{
250
+ groupBy: z.ZodEnum<{
251
+ buildings: "buildings";
252
+ storeys: "storeys";
253
+ departments: "departments";
254
+ labels: "labels";
255
+ tagCategories: "tagCategories";
256
+ }>;
257
+ categoryId: z.ZodOptional<z.ZodString>;
258
+ }, z.core.$strip>;
259
+ export type PluginProgramAreasListArgs = z.infer<typeof PluginProgramAreasListArgs>;
260
+ /**
261
+ * Result of {@linkcode PluginProgramAreasApi.list}.
262
+ *
263
+ * | Property | Type | Description |
264
+ * |---|---|---|
265
+ * | `groups` | {@linkcode PluginProgramAreaGroup}`[]` | The area buckets (empty when the program has no spaces) |
266
+ */
267
+ export declare const PluginProgramAreasListResult: z.ZodObject<{
268
+ groups: z.ZodArray<z.ZodObject<{
269
+ groupId: z.ZodString;
270
+ name: z.ZodString;
271
+ color: z.ZodString;
272
+ carpet: z.ZodNumber;
273
+ builtUp: z.ZodNumber;
274
+ excluded: z.ZodNumber;
275
+ count: z.ZodNumber;
276
+ targetArea: z.ZodNumber;
277
+ targetUnit: z.ZodEnum<{
278
+ ft2: "ft2";
279
+ m2: "m2";
280
+ }>;
281
+ }, z.core.$strip>>;
282
+ }, z.core.$strip>;
283
+ export type PluginProgramAreasListResult = z.infer<typeof PluginProgramAreasListResult>;
284
+ /**
285
+ * Arguments for {@linkcode PluginProgramAreasApi.listMembers}.
286
+ *
287
+ * | Property | Type | Description |
288
+ * |---|---|---|
289
+ * | `groupBy` | {@linkcode PluginProgramAreaGroupBy} | The facet the group came from |
290
+ * | `groupId` | `string` | The id of the group to expand |
291
+ * | `categoryId` | `string \| undefined` | Tag category context; required when `groupBy` is `"tagCategories"` |
292
+ */
293
+ export declare const PluginProgramAreasListMembersArgs: z.ZodObject<{
294
+ groupBy: z.ZodEnum<{
295
+ buildings: "buildings";
296
+ storeys: "storeys";
297
+ departments: "departments";
298
+ labels: "labels";
299
+ tagCategories: "tagCategories";
300
+ }>;
301
+ groupId: z.ZodString;
302
+ categoryId: z.ZodOptional<z.ZodString>;
303
+ }, z.core.$strip>;
304
+ export type PluginProgramAreasListMembersArgs = z.infer<typeof PluginProgramAreasListMembersArgs>;
305
+ /**
306
+ * Result of {@linkcode PluginProgramAreasApi.listMembers}.
307
+ *
308
+ * | Property | Type | Description |
309
+ * |---|---|---|
310
+ * | `members` | {@linkcode PluginProgramAreaMember}`[]` | The group's member spaces (empty when missing or empty) |
311
+ */
312
+ export declare const PluginProgramAreasListMembersResult: z.ZodObject<{
313
+ members: z.ZodArray<z.ZodObject<{
314
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
315
+ label: z.ZodString;
316
+ carpet: z.ZodNumber;
317
+ builtUp: z.ZodNumber;
318
+ excluded: z.ZodNumber;
319
+ isVisible: z.ZodBoolean;
320
+ }, z.core.$strip>>;
321
+ }, z.core.$strip>;
322
+ export type PluginProgramAreasListMembersResult = z.infer<typeof PluginProgramAreasListMembersResult>;
323
+ /**
324
+ * Arguments for {@linkcode PluginProgramAreasApi.update}. Sparse — only the
325
+ * provided fields are changed.
326
+ *
327
+ * | Property | Type | Description |
328
+ * |---|---|---|
329
+ * | `targetFar` | `number \| undefined` | New target FAR (≥ 0) |
330
+ * | `siteArea` | `number \| undefined` | Site-area override (> 0), in the program's area unit |
331
+ * | `deviation` | `number \| undefined` | Allowed FAR deviation percentage (0–100) |
332
+ */
333
+ export declare const PluginProgramAreasUpdateArgs: z.ZodObject<{
334
+ targetFar: z.ZodOptional<z.ZodNumber>;
335
+ siteArea: z.ZodOptional<z.ZodNumber>;
336
+ deviation: z.ZodOptional<z.ZodNumber>;
337
+ }, z.core.$strip>;
338
+ export type PluginProgramAreasUpdateArgs = z.infer<typeof PluginProgramAreasUpdateArgs>;
339
+ /**
340
+ * Result of {@linkcode PluginProgramAreasApi.update} — the recomputed program
341
+ * area summary.
342
+ */
343
+ export declare const PluginProgramAreasUpdateResult: z.ZodObject<{
344
+ count: z.ZodNumber;
345
+ hiddenCount: z.ZodNumber;
346
+ carpet: z.ZodNumber;
347
+ builtUp: z.ZodNumber;
348
+ excluded: z.ZodNumber;
349
+ farBuiltUp: z.ZodNumber;
350
+ siteArea: z.ZodNumber;
351
+ achievedFar: z.ZodNullable<z.ZodNumber>;
352
+ targetFar: z.ZodNumber;
353
+ deviation: z.ZodNumber;
354
+ areaUnit: z.ZodEnum<{
355
+ ft2: "ft2";
356
+ m2: "m2";
357
+ }>;
358
+ }, z.core.$strip>;
359
+ export type PluginProgramAreasUpdateResult = z.infer<typeof PluginProgramAreasUpdateResult>;
360
+ //# sourceMappingURL=areas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areas.d.ts","sourceRoot":"","sources":["../../../src/api/program/areas.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,135 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ /**
4
+ * Program classification — the catalog of space-classification options, and a
5
+ * space's display tags.
6
+ *
7
+ * Only the genuinely program-specific reads live here: the selectable
8
+ * space-type / area-class / mass-type options, and a space's tags for display.
9
+ * Reading or changing a *single space's* classification (its type, label, area
10
+ * class, or department) is done through the space reads/writes, not duplicated
11
+ * here. Tag definitions are managed elsewhere — these methods are display-only.
12
+ *
13
+ * Both methods are reads.
14
+ *
15
+ * Accessed via `snaptrude.program.classification`.
16
+ */
17
+ export declare abstract class PluginProgramClassificationApi {
18
+ constructor();
19
+ /**
20
+ * List the selectable classification options for spaces.
21
+ *
22
+ * The static catalog (project-independent) of space types, area classes, and
23
+ * mass types a space can be classified as.
24
+ *
25
+ * @returns A {@linkcode PluginProgramClassificationTypesResult} with the
26
+ * `spaceTypes`, `areaClasses`, and `massTypes` option lists.
27
+ *
28
+ * @examplePrompt What space types can I assign?
29
+ * @examplePrompt List the available area classifications
30
+ * @examplePrompt What classification options exist?
31
+ * @examplePrompt Show me the valid space-type values
32
+ *
33
+ * # Example
34
+ * ```ts
35
+ * const { spaceTypes, areaClasses } = await snaptrude.program.classification.listTypes()
36
+ * ```
37
+ */
38
+ abstract listTypes(): PluginApiReturn<PluginProgramClassificationTypesResult>;
39
+ /**
40
+ * List a space's tags for display, grouped by category.
41
+ *
42
+ * @param id - The id of the space whose tags to read.
43
+ * @returns A {@linkcode PluginProgramClassificationTagsResult} with the space's
44
+ * `tagIds` and `tagsByCategory`.
45
+ *
46
+ * @examplePrompt What tags are on this space?
47
+ * @examplePrompt Show the tags grouped by category for sp_4
48
+ * @examplePrompt List this room's display tags
49
+ * @examplePrompt Which tags does this space have?
50
+ *
51
+ * # Example
52
+ * ```ts
53
+ * const { tagsByCategory } = await snaptrude.program.classification.listTags("sp_4")
54
+ * ```
55
+ */
56
+ abstract listTags(id: string): PluginApiReturn<PluginProgramClassificationTagsResult>;
57
+ }
58
+ /**
59
+ * A selectable classification option.
60
+ *
61
+ * | Property | Type | Description |
62
+ * |---|---|---|
63
+ * | `value` | `string` | Stored value |
64
+ * | `label` | `string` | Display label |
65
+ */
66
+ export declare const PluginClassificationOption: z.ZodObject<{
67
+ value: z.ZodString;
68
+ label: z.ZodString;
69
+ }, z.core.$strip>;
70
+ export type PluginClassificationOption = z.infer<typeof PluginClassificationOption>;
71
+ /**
72
+ * Result of {@linkcode PluginProgramClassificationApi.listTypes}.
73
+ *
74
+ * | Property | Type | Description |
75
+ * |---|---|---|
76
+ * | `spaceTypes` | {@linkcode PluginClassificationOption}`[]` | Selectable space types |
77
+ * | `areaClasses` | {@linkcode PluginClassificationOption}`[]` | Selectable area classes (NET/GROSS/EXCLUDED) |
78
+ * | `massTypes` | {@linkcode PluginClassificationOption}`[]` | Selectable mass/object types |
79
+ */
80
+ export declare const PluginProgramClassificationTypesResult: z.ZodObject<{
81
+ spaceTypes: z.ZodArray<z.ZodObject<{
82
+ value: z.ZodString;
83
+ label: z.ZodString;
84
+ }, z.core.$strip>>;
85
+ areaClasses: z.ZodArray<z.ZodObject<{
86
+ value: z.ZodString;
87
+ label: z.ZodString;
88
+ }, z.core.$strip>>;
89
+ massTypes: z.ZodArray<z.ZodObject<{
90
+ value: z.ZodString;
91
+ label: z.ZodString;
92
+ }, z.core.$strip>>;
93
+ }, z.core.$strip>;
94
+ export type PluginProgramClassificationTypesResult = z.infer<typeof PluginProgramClassificationTypesResult>;
95
+ /** Arguments for {@linkcode PluginProgramClassificationApi.listTags}. */
96
+ export declare const PluginProgramClassificationListTagsArgs: z.ZodObject<{
97
+ id: z.ZodString;
98
+ }, z.core.$strip>;
99
+ export type PluginProgramClassificationListTagsArgs = z.infer<typeof PluginProgramClassificationListTagsArgs>;
100
+ /**
101
+ * A display tag on a space.
102
+ *
103
+ * | Property | Type | Description |
104
+ * |---|---|---|
105
+ * | `tagId` | `string` | Tag id |
106
+ * | `tagName` | `string` | Tag display name |
107
+ * | `color` | `string` | CSS hex color string |
108
+ * | `categoryId` | `string` | Id of the tag's category |
109
+ */
110
+ export declare const PluginSpaceTag: z.ZodObject<{
111
+ tagId: z.ZodString;
112
+ tagName: z.ZodString;
113
+ color: z.ZodString;
114
+ categoryId: z.ZodString;
115
+ }, z.core.$strip>;
116
+ export type PluginSpaceTag = z.infer<typeof PluginSpaceTag>;
117
+ /**
118
+ * Result of {@linkcode PluginProgramClassificationApi.listTags}.
119
+ *
120
+ * | Property | Type | Description |
121
+ * |---|---|---|
122
+ * | `tagIds` | `string[]` | All tag ids on the space |
123
+ * | `tagsByCategory` | `Record<string, `{@linkcode PluginSpaceTag}`>` | Tags keyed by category name |
124
+ */
125
+ export declare const PluginProgramClassificationTagsResult: z.ZodObject<{
126
+ tagIds: z.ZodArray<z.ZodString>;
127
+ tagsByCategory: z.ZodRecord<z.ZodString, z.ZodObject<{
128
+ tagId: z.ZodString;
129
+ tagName: z.ZodString;
130
+ color: z.ZodString;
131
+ categoryId: z.ZodString;
132
+ }, z.core.$strip>>;
133
+ }, z.core.$strip>;
134
+ export type PluginProgramClassificationTagsResult = z.infer<typeof PluginProgramClassificationTagsResult>;
135
+ //# sourceMappingURL=classification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classification.d.ts","sourceRoot":"","sources":["../../../src/api/program/classification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;GAaG;AACH,8BAAsB,8BAA8B;;IAGlD;;;;;;;;;;;;;;;;;;OAkBG;aACa,SAAS,IAAI,eAAe,CAAC,sCAAsC,CAAC;IAEpF;;;;;;;;;;;;;;;;OAgBG;aACa,QAAQ,CACtB,EAAE,EAAE,MAAM,GACT,eAAe,CAAC,qCAAqC,CAAC;CAC1D;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;iBAGrC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;iBAIjD,CAAA;AACF,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,sCAAsC,CAC9C,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,uCAAuC;;iBAElD,CAAA;AACF,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,uCAAuC,CAC/C,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc;;;;;iBAKzB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D;;;;;;;GAOG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;iBAGhD,CAAA;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAA"}