@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,208 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ /**
4
+ * Analysis sunlightHours — the direct-sunlight-hours heatmap study.
5
+ *
6
+ * Computes, for every space surface (Room or Department Mass — generic
7
+ * Masses are not enough), how many hours of direct sunlight
8
+ * it receives over a date range, and renders the result as a heatmap on the
9
+ * scene. The computation is an **asynchronous backend job**:
10
+ *
11
+ * 1. {@linkcode PluginAnalysisSunlightHoursApi.compute} starts the job and
12
+ * returns immediately.
13
+ * 2. Poll {@linkcode PluginAnalysisSunlightHoursApi.get} until `status` is
14
+ * `"active"` (heatmap rendered) — a run typically takes minutes. There is
15
+ * no completion event; polling is the pattern.
16
+ * 3. {@linkcode PluginAnalysisSunlightHoursApi.cancel} aborts an in-flight
17
+ * run; {@linkcode PluginAnalysisSunlightHoursApi.reset} clears a rendered
18
+ * heatmap.
19
+ *
20
+ * Heatmaps are invalidated by scene-mutating edits — re-run the study after
21
+ * changing the model. Dates cross as ISO 8601 date strings (`"YYYY-MM-DD"`).
22
+ *
23
+ * Accessed via `snaptrude.analysis.sunlightHours`.
24
+ */
25
+ export declare abstract class PluginAnalysisSunlightHoursApi {
26
+ constructor();
27
+ /**
28
+ * Start a direct-sunlight-hours run for a date range.
29
+ *
30
+ * Starts the backend job and **returns immediately** — it does not wait
31
+ * for the heatmap. Poll {@linkcode PluginAnalysisSunlightHoursApi.get}
32
+ * until `status` is `"active"`. Starting a new run while one is in flight
33
+ * replaces it. Shadows and the heatmap analyses are mutually exclusive in
34
+ * the product: starting a run disables real-time shadows and resets/cancels
35
+ * any {@linkcode PluginAnalysisIlluminanceApi} (`analysis.illuminance`)
36
+ * study.
37
+ *
38
+ * @param startDate - Start of the study range, ISO date `"YYYY-MM-DD"`.
39
+ * @param endDate - End of the study range, ISO date `"YYYY-MM-DD"` (on or
40
+ * after `startDate`).
41
+ * @returns A {@linkcode PluginAnalysisComputeResult} — `{ success: true }`
42
+ * when the job was started. The `{ success: false, error }` arm is
43
+ * reserved — not yet emitted (start failures currently throw).
44
+ * @throws When the project has no geo-located site/terrain (no location to
45
+ * compute sun exposure for — there is no fallback location).
46
+ * @throws When the scene has no space (Room or Department Mass) to analyse
47
+ * or the editor is not in the 3D view.
48
+ * @throws When a date is not a parseable ISO date or the range is inverted.
49
+ * @throws When plugin writes are disabled.
50
+ *
51
+ * @examplePrompt Run a sunlight hours analysis for June
52
+ * @examplePrompt Compute direct sunlight hours between March and September
53
+ * @examplePrompt How much sun does my building get over the summer?
54
+ *
55
+ * # Example
56
+ * ```ts
57
+ * const { success } = await snaptrude.analysis.sunlightHours.compute(
58
+ * "2026-06-01",
59
+ * "2026-06-30",
60
+ * )
61
+ * // poll until the heatmap is rendered
62
+ * let job = await snaptrude.analysis.sunlightHours.get()
63
+ * while (job?.status === "running") {
64
+ * await new Promise((r) => setTimeout(r, 5000))
65
+ * job = await snaptrude.analysis.sunlightHours.get()
66
+ * }
67
+ * ```
68
+ */
69
+ abstract compute(startDate: string, endDate: string): PluginApiReturn<PluginAnalysisComputeResult>;
70
+ /**
71
+ * Get the state of the sunlight-hours study.
72
+ *
73
+ * The polling read for the async job started by
74
+ * {@linkcode PluginAnalysisSunlightHoursApi.compute}. `status` values:
75
+ *
76
+ * | Status | Meaning |
77
+ * |---|---|
78
+ * | `"running"` | A run is in flight — keep polling |
79
+ * | `"active"` | The heatmap is rendered on the scene |
80
+ * | `"inactive"` | A previous run exists but its heatmap is not showing |
81
+ *
82
+ * @returns A {@linkcode PluginAnalysisJobStateResult} with the `status` and
83
+ * the run's ISO `startDate`/`endDate`, or `null` when no run result is
84
+ * available (the study never ran, was cancelled, or the last run failed).
85
+ *
86
+ * @examplePrompt Is the sunlight analysis done?
87
+ * @examplePrompt Check the status of the sunlight hours run
88
+ * @examplePrompt What date range was the sunlight heatmap computed for?
89
+ *
90
+ * # Example
91
+ * ```ts
92
+ * const job = await snaptrude.analysis.sunlightHours.get()
93
+ * if (job?.status === "active") console.log(job.startDate, job.endDate)
94
+ * ```
95
+ */
96
+ abstract get(): PluginApiReturn<PluginAnalysisJobStateResult>;
97
+ /**
98
+ * Cancel the in-flight sunlight-hours run.
99
+ *
100
+ * Aborts the backend job. A no-op (returns `false`) when nothing is
101
+ * running.
102
+ *
103
+ * @returns `true` when a run was cancelled, `false` when nothing was
104
+ * running.
105
+ * @throws When plugin writes are disabled.
106
+ *
107
+ * @examplePrompt Cancel the sunlight analysis
108
+ * @examplePrompt Stop the running sunlight hours computation
109
+ * @examplePrompt Abort the sun study
110
+ *
111
+ * # Example
112
+ * ```ts
113
+ * await snaptrude.analysis.sunlightHours.cancel()
114
+ * ```
115
+ */
116
+ abstract cancel(): PluginApiReturn<boolean>;
117
+ /**
118
+ * Clear the sunlight-hours heatmap from the scene.
119
+ *
120
+ * Un-applies the rendered heatmap and restores the normal material view.
121
+ * A no-op (returns `false`) when no heatmap is showing. Does not cancel an
122
+ * in-flight run — use {@linkcode PluginAnalysisSunlightHoursApi.cancel}.
123
+ *
124
+ * @returns `true` when a heatmap was cleared, `false` when none was
125
+ * showing.
126
+ * @throws When plugin writes are disabled.
127
+ *
128
+ * @examplePrompt Clear the sunlight heatmap
129
+ * @examplePrompt Remove the sun hours colours from the model
130
+ * @examplePrompt Reset the sunlight analysis view
131
+ *
132
+ * # Example
133
+ * ```ts
134
+ * await snaptrude.analysis.sunlightHours.reset()
135
+ * ```
136
+ */
137
+ abstract reset(): PluginApiReturn<boolean>;
138
+ }
139
+ /**
140
+ * Result of starting an analysis job
141
+ * ({@linkcode PluginAnalysisSunlightHoursApi.compute} /
142
+ * {@linkcode PluginAnalysisIlluminanceApi.compute}).
143
+ *
144
+ * The `success: false` arm is **reserved — not yet emitted**: the current
145
+ * host always returns `{ success: true }` (start failures throw instead); a
146
+ * failure indicator may be added additively later.
147
+ *
148
+ * | Property | Type | Description |
149
+ * |---|---|---|
150
+ * | `success` | `boolean` | `true` when the backend job was started |
151
+ * | `error` | `string \| undefined` | Failure reason when `success` is `false` (reserved — not yet emitted) |
152
+ */
153
+ export declare const PluginAnalysisComputeResult: z.ZodObject<{
154
+ success: z.ZodBoolean;
155
+ error: z.ZodOptional<z.ZodString>;
156
+ }, z.core.$strip>;
157
+ export type PluginAnalysisComputeResult = z.infer<typeof PluginAnalysisComputeResult>;
158
+ /**
159
+ * The status of an analysis heatmap job.
160
+ *
161
+ * | Value | Meaning |
162
+ * |---|---|
163
+ * | `"running"` | A run is in flight — keep polling |
164
+ * | `"active"` | The heatmap is rendered on the scene |
165
+ * | `"inactive"` | A previous run exists but its heatmap is not showing |
166
+ */
167
+ export declare const PluginAnalysisJobStatus: z.ZodEnum<{
168
+ running: "running";
169
+ active: "active";
170
+ inactive: "inactive";
171
+ }>;
172
+ export type PluginAnalysisJobStatus = z.infer<typeof PluginAnalysisJobStatus>;
173
+ /**
174
+ * The state of an analysis heatmap job.
175
+ *
176
+ * | Property | Type | Description |
177
+ * |---|---|---|
178
+ * | `status` | {@linkcode PluginAnalysisJobStatus} | `"running"` \| `"active"` \| `"inactive"` |
179
+ * | `startDate` | `string` | ISO date (`"YYYY-MM-DD"`) the run was computed from |
180
+ * | `endDate` | `string` | ISO date (`"YYYY-MM-DD"`) the run was computed to |
181
+ */
182
+ export declare const PluginAnalysisJobState: z.ZodObject<{
183
+ status: z.ZodEnum<{
184
+ running: "running";
185
+ active: "active";
186
+ inactive: "inactive";
187
+ }>;
188
+ startDate: z.ZodString;
189
+ endDate: z.ZodString;
190
+ }, z.core.$strip>;
191
+ export type PluginAnalysisJobState = z.infer<typeof PluginAnalysisJobState>;
192
+ /**
193
+ * Result of {@linkcode PluginAnalysisSunlightHoursApi.get} /
194
+ * {@linkcode PluginAnalysisIlluminanceApi.get} — the job state, or `null`
195
+ * when no run result is available (the study never ran, was cancelled, or
196
+ * the last run failed).
197
+ */
198
+ export declare const PluginAnalysisJobStateResult: z.ZodNullable<z.ZodObject<{
199
+ status: z.ZodEnum<{
200
+ running: "running";
201
+ active: "active";
202
+ inactive: "inactive";
203
+ }>;
204
+ startDate: z.ZodString;
205
+ endDate: z.ZodString;
206
+ }, z.core.$strip>>;
207
+ export type PluginAnalysisJobStateResult = z.infer<typeof PluginAnalysisJobStateResult>;
208
+ //# sourceMappingURL=sunlightHours.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sunlightHours.d.ts","sourceRoot":"","sources":["../../../src/api/analysis/sunlightHours.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BAAsB,8BAA8B;;IAGlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;aACa,OAAO,CACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,eAAe,CAAC,2BAA2B,CAAC;IAE/C;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;aACa,GAAG,IAAI,eAAe,CAAC,4BAA4B,CAAC;IAEpE;;;;;;;;;;;;;;;;;;OAkBG;aACa,MAAM,IAAI,eAAe,CAAC,OAAO,CAAC;IAElD;;;;;;;;;;;;;;;;;;;OAmBG;aACa,KAAK,IAAI,eAAe,CAAC,OAAO,CAAC;CAClD;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,2BAA2B,CACnC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB;;;;EAIlC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;iBAIjC,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;kBAAoC,CAAA;AAC7E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAA"}
@@ -0,0 +1,80 @@
1
+ import { PluginApiReturn } from "../../types";
2
+ /**
3
+ * Analysis sunpath — the sun-path diagram overlay.
4
+ *
5
+ * The sun-path diagram draws the sun's annual/daily trajectory arcs over the
6
+ * scene for the project's geographic location, so daylight behaviour can be
7
+ * read directly off the model. Toggling it is an **undoable** action (it goes
8
+ * through the command stack, so `core.history.undo` reverts it).
9
+ *
10
+ * The overlay is computed for the project's geo-location. Enabling **throws**
11
+ * when the project has no geo-located site/terrain — there is no fallback
12
+ * location. Set the site location first (Import terrain / site context);
13
+ * read it via `program.site.getLocation`.
14
+ *
15
+ * Accessed via `snaptrude.analysis.sunpath`.
16
+ */
17
+ export declare abstract class PluginAnalysisSunpathApi {
18
+ constructor();
19
+ /**
20
+ * Turn the sun-path diagram overlay ON.
21
+ *
22
+ * Undoable: the toggle is committed through the command stack. A no-op
23
+ * (returns `true`) when the overlay is already active.
24
+ *
25
+ * @returns `true` — the overlay is active after the call.
26
+ * @throws When the project has no geo-located site/terrain (no location to
27
+ * compute the sun trajectory for).
28
+ * @throws When plugin writes are disabled.
29
+ *
30
+ * @examplePrompt Show the sun path diagram
31
+ * @examplePrompt Turn on the sunpath overlay
32
+ * @examplePrompt Visualize the sun's trajectory over my building
33
+ *
34
+ * # Example
35
+ * ```ts
36
+ * await snaptrude.analysis.sunpath.enable()
37
+ * const active = await snaptrude.analysis.sunpath.isActive() // true
38
+ * ```
39
+ */
40
+ abstract enable(): PluginApiReturn<boolean>;
41
+ /**
42
+ * Turn the sun-path diagram overlay OFF.
43
+ *
44
+ * Undoable: the toggle is committed through the command stack. A no-op
45
+ * (returns `false`) when the overlay is already off.
46
+ *
47
+ * @returns `false` — the overlay is inactive after the call.
48
+ * @throws When plugin writes are disabled.
49
+ *
50
+ * @examplePrompt Hide the sun path diagram
51
+ * @examplePrompt Turn off the sunpath overlay
52
+ * @examplePrompt Remove the sun trajectory arcs from the scene
53
+ *
54
+ * # Example
55
+ * ```ts
56
+ * await snaptrude.analysis.sunpath.disable()
57
+ * ```
58
+ */
59
+ abstract disable(): PluginApiReturn<boolean>;
60
+ /**
61
+ * Whether the sun-path diagram overlay is currently active.
62
+ *
63
+ * A pure read — never mutates, never throws.
64
+ *
65
+ * @returns `true` when the overlay is showing.
66
+ *
67
+ * @examplePrompt Is the sun path diagram on?
68
+ * @examplePrompt Check whether the sunpath overlay is active
69
+ * @examplePrompt Am I looking at the sun trajectory right now?
70
+ *
71
+ * # Example
72
+ * ```ts
73
+ * if (!(await snaptrude.analysis.sunpath.isActive())) {
74
+ * await snaptrude.analysis.sunpath.enable()
75
+ * }
76
+ * ```
77
+ */
78
+ abstract isActive(): PluginApiReturn<boolean>;
79
+ }
80
+ //# sourceMappingURL=sunpath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sunpath.d.ts","sourceRoot":"","sources":["../../../src/api/analysis/sunpath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;GAcG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;;;;;OAoBG;aACa,MAAM,IAAI,eAAe,CAAC,OAAO,CAAC;IAElD;;;;;;;;;;;;;;;;;OAiBG;aACa,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC;IAEnD;;;;;;;;;;;;;;;;;OAiBG;aACa,QAAQ,IAAI,eAAe,CAAC,OAAO,CAAC;CACrD"}
@@ -0,0 +1,193 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ /**
4
+ * Analysis weather — read the project site's typical-year weather series.
5
+ *
6
+ * Returns the hourly weather rows (temperature, humidity, wind, solar
7
+ * irradiance) of the EPW file the sustainability analyses compute against,
8
+ * resolved from the project's geo-located site. This is a **synchronous,
9
+ * paged read** of an already-resolved weather file — not a job: call
10
+ * {@linkcode PluginAnalysisWeatherApi.getSeries} for a date range, then follow
11
+ * `nextCursor` until it is `null`.
12
+ *
13
+ * The weather file is resolved by the **same** code path the daylight /
14
+ * sunlight-hours analyses use, so the `source.weatherFileId` here matches the
15
+ * provenance a {@linkcode PluginAnalysisDaylightApi} run echoes. Dates cross as
16
+ * ISO 8601 date strings (`"YYYY-MM-DD"`); each row's `timestamp` is a local
17
+ * ISO 8601 string **with** its UTC offset, and `utcOffsetMinutes` restates the
18
+ * offset so consumers never re-derive it.
19
+ *
20
+ * Reads never throw for "no data": when the project has no geo-located site
21
+ * (no weather file to resolve) the host surfaces that per its read contract.
22
+ *
23
+ * Accessed via `snaptrude.analysis.weather`.
24
+ */
25
+ export declare abstract class PluginAnalysisWeatherApi {
26
+ constructor();
27
+ /**
28
+ * Get the hourly weather series for a date range, paged.
29
+ *
30
+ * Returns the resolved weather file's provenance (`source`) plus the weather
31
+ * `rows` for the requested range. The page size is backend-chosen; when
32
+ * `nextCursor` is a string, pass it back as `args.cursor` to fetch the next
33
+ * page, and stop when it is `null`.
34
+ *
35
+ * @param args - {@linkcode PluginWeatherGetSeriesArgs}: the inclusive
36
+ * `startDate`/`endDate` ISO dates, an optional `interval` (`"hourly"` is
37
+ * the only v1 value), and an optional `cursor` for paging.
38
+ * @returns A {@linkcode PluginWeatherSeriesResult} — the resolved weather
39
+ * `source`, the `rows` for this page, and `nextCursor` (`null` at the end).
40
+ *
41
+ * @examplePrompt Get the weather series for June at my site
42
+ * @examplePrompt Pull the hourly temperature and irradiance for this location
43
+ * @examplePrompt What EPW weather file is my project using?
44
+ *
45
+ * # Example
46
+ * ```ts
47
+ * let cursor: string | undefined = undefined
48
+ * const rows = []
49
+ * do {
50
+ * const page = await snaptrude.analysis.weather.getSeries({
51
+ * startDate: "2026-06-01",
52
+ * endDate: "2026-06-30",
53
+ * cursor,
54
+ * })
55
+ * rows.push(...page.rows)
56
+ * cursor = page.nextCursor ?? undefined
57
+ * } while (cursor)
58
+ * ```
59
+ */
60
+ abstract getSeries(args: PluginWeatherGetSeriesArgs): PluginApiReturn<PluginWeatherSeriesResult>;
61
+ }
62
+ /**
63
+ * How the weather file was matched to the project site.
64
+ *
65
+ * | Value | Meaning |
66
+ * |---|---|
67
+ * | `"nearest-station"` | Auto-resolved to the closest weather station |
68
+ * | `"user-upload"` | A weather file the user uploaded (`core.io.import.epw`) |
69
+ * | `"project-override"` | A station pinned for the project regardless of distance |
70
+ */
71
+ export declare const PluginWeatherSelectionMethod: z.ZodEnum<{
72
+ "nearest-station": "nearest-station";
73
+ "user-upload": "user-upload";
74
+ "project-override": "project-override";
75
+ }>;
76
+ export type PluginWeatherSelectionMethod = z.infer<typeof PluginWeatherSelectionMethod>;
77
+ /**
78
+ * Provenance of the resolved weather file — where the numbers came from.
79
+ *
80
+ * | Property | Type | Description |
81
+ * |---|---|---|
82
+ * | `weatherFileId` | `string` | Catalog id (same key as `core.io.import.epw`'s `weatherFileId`) |
83
+ * | `station` | `string` | Station/file name, e.g. `"USA_IL_Chicago-OHare.Intl.AP.725300_TMY3"` |
84
+ * | `sourceId` | `string` | WMO/station identifier from the EPW header |
85
+ * | `distanceKm` | `number \| null` | Station → project site distance, km; `null` for pinned project-override files |
86
+ * | `selectionMethod` | {@linkcode PluginWeatherSelectionMethod} | How the file was matched |
87
+ * | `checksum` | `string` | sha256 of the EPW file — the provenance key |
88
+ * | `windReferenceHeightM` | `number` | Anemometer height the wind rows are valid at |
89
+ */
90
+ export declare const PluginWeatherSourceMeta: z.ZodObject<{
91
+ weatherFileId: z.ZodString;
92
+ station: z.ZodString;
93
+ sourceId: z.ZodString;
94
+ distanceKm: z.ZodNullable<z.ZodNumber>;
95
+ selectionMethod: z.ZodEnum<{
96
+ "nearest-station": "nearest-station";
97
+ "user-upload": "user-upload";
98
+ "project-override": "project-override";
99
+ }>;
100
+ checksum: z.ZodString;
101
+ windReferenceHeightM: z.ZodNumber;
102
+ }, z.core.$strip>;
103
+ export type PluginWeatherSourceMeta = z.infer<typeof PluginWeatherSourceMeta>;
104
+ /**
105
+ * One hourly weather reading.
106
+ *
107
+ * `flags` is empty for a clean measured/typical value; known flag strings are
108
+ * `"missing"`, `"substituted"`, and `"interpolated"` (kept as `string[]` so the
109
+ * backend can add flag kinds without a contract break).
110
+ *
111
+ * | Property | Type | Description |
112
+ * |---|---|---|
113
+ * | `timestamp` | `string` | Local ISO 8601 with offset, e.g. `"2026-06-21T14:00:00+05:30"` |
114
+ * | `utcOffsetMinutes` | `number` | UTC offset in minutes (restates the timestamp's offset) |
115
+ * | `dryBulbC` | `number` | Dry-bulb temperature, °C |
116
+ * | `relativeHumidityPercent` | `number` | Relative humidity, % |
117
+ * | `windSpeedMps` | `number` | Wind speed, m/s (at `source.windReferenceHeightM`) |
118
+ * | `ghiWm2` | `number` | Global horizontal irradiance, W/m² |
119
+ * | `dniWm2` | `number` | Direct normal irradiance, W/m² |
120
+ * | `dhiWm2` | `number` | Diffuse horizontal irradiance, W/m² |
121
+ * | `flags` | `string[]` | Quality flags; `[]` = clean value |
122
+ */
123
+ export declare const PluginWeatherRow: z.ZodObject<{
124
+ timestamp: z.ZodString;
125
+ utcOffsetMinutes: z.ZodNumber;
126
+ dryBulbC: z.ZodNumber;
127
+ relativeHumidityPercent: z.ZodNumber;
128
+ windSpeedMps: z.ZodNumber;
129
+ ghiWm2: z.ZodNumber;
130
+ dniWm2: z.ZodNumber;
131
+ dhiWm2: z.ZodNumber;
132
+ flags: z.ZodArray<z.ZodString>;
133
+ }, z.core.$strip>;
134
+ export type PluginWeatherRow = z.infer<typeof PluginWeatherRow>;
135
+ /**
136
+ * Arguments for {@linkcode PluginAnalysisWeatherApi.getSeries}.
137
+ *
138
+ * | Property | Type | Description |
139
+ * |---|---|---|
140
+ * | `startDate` | `string` | Inclusive range start, ISO `"YYYY-MM-DD"` |
141
+ * | `endDate` | `string` | Inclusive range end, ISO `"YYYY-MM-DD"` |
142
+ * | `interval` | `"hourly"`? | Sampling interval; `"hourly"` is the only v1 value |
143
+ * | `cursor` | `string`? | Paging cursor from a prior page's `nextCursor` |
144
+ */
145
+ export declare const PluginWeatherGetSeriesArgs: z.ZodObject<{
146
+ startDate: z.ZodString;
147
+ endDate: z.ZodString;
148
+ interval: z.ZodOptional<z.ZodEnum<{
149
+ hourly: "hourly";
150
+ }>>;
151
+ cursor: z.ZodOptional<z.ZodString>;
152
+ }, z.core.$strip>;
153
+ export type PluginWeatherGetSeriesArgs = z.infer<typeof PluginWeatherGetSeriesArgs>;
154
+ /**
155
+ * Result of {@linkcode PluginAnalysisWeatherApi.getSeries} — one page.
156
+ *
157
+ * | Property | Type | Description |
158
+ * |---|---|---|
159
+ * | `source` | {@linkcode PluginWeatherSourceMeta} | The resolved weather file's provenance |
160
+ * | `rows` | {@linkcode PluginWeatherRow}`[]` | Weather rows for this page |
161
+ * | `nextCursor` | `string \| null` | Pass back as `args.cursor`; `null` = last page |
162
+ * | `warnings` | `string[]`? | Degradation notices (e.g. `"override lookup failed; served nearest-station"`); omitted when the page is clean |
163
+ */
164
+ export declare const PluginWeatherSeriesResult: z.ZodObject<{
165
+ source: z.ZodObject<{
166
+ weatherFileId: z.ZodString;
167
+ station: z.ZodString;
168
+ sourceId: z.ZodString;
169
+ distanceKm: z.ZodNullable<z.ZodNumber>;
170
+ selectionMethod: z.ZodEnum<{
171
+ "nearest-station": "nearest-station";
172
+ "user-upload": "user-upload";
173
+ "project-override": "project-override";
174
+ }>;
175
+ checksum: z.ZodString;
176
+ windReferenceHeightM: z.ZodNumber;
177
+ }, z.core.$strip>;
178
+ rows: z.ZodArray<z.ZodObject<{
179
+ timestamp: z.ZodString;
180
+ utcOffsetMinutes: z.ZodNumber;
181
+ dryBulbC: z.ZodNumber;
182
+ relativeHumidityPercent: z.ZodNumber;
183
+ windSpeedMps: z.ZodNumber;
184
+ ghiWm2: z.ZodNumber;
185
+ dniWm2: z.ZodNumber;
186
+ dhiWm2: z.ZodNumber;
187
+ flags: z.ZodArray<z.ZodString>;
188
+ }, z.core.$strip>>;
189
+ nextCursor: z.ZodNullable<z.ZodString>;
190
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
191
+ }, z.core.$strip>;
192
+ export type PluginWeatherSeriesResult = z.infer<typeof PluginWeatherSeriesResult>;
193
+ //# sourceMappingURL=weather.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../../src/api/analysis/weather.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;aACa,SAAS,CACvB,IAAI,EAAE,0BAA0B,GAC/B,eAAe,CAAC,yBAAyB,CAAC;CAC9C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B;;;;EAIvC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAQlC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;iBAU3B,CAAA;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B;;;;;;;iBAKrC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKpC,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,yBAAyB,CACjC,CAAA"}