@snaptrude/plugin-core 0.8.0 → 0.9.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 (111) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/api-manifest.full.json +1350 -89
  3. package/api-manifest.json +826 -40
  4. package/dist/api/analysis/daylight.d.ts +603 -0
  5. package/dist/api/analysis/daylight.d.ts.map +1 -0
  6. package/dist/api/analysis/heatmaps.d.ts +438 -14
  7. package/dist/api/analysis/heatmaps.d.ts.map +1 -1
  8. package/dist/api/analysis/index.d.ts +15 -0
  9. package/dist/api/analysis/index.d.ts.map +1 -1
  10. package/dist/api/analysis/solar.d.ts +249 -0
  11. package/dist/api/analysis/solar.d.ts.map +1 -0
  12. package/dist/api/analysis/weather.d.ts +193 -0
  13. package/dist/api/analysis/weather.d.ts.map +1 -0
  14. package/dist/api/core/camera/index.d.ts +37 -0
  15. package/dist/api/core/camera/index.d.ts.map +1 -1
  16. package/dist/api/core/geom/create/index.d.ts +318 -1
  17. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  18. package/dist/api/core/index.d.ts +9 -0
  19. package/dist/api/core/index.d.ts.map +1 -1
  20. package/dist/api/core/io/export/index.d.ts +3 -1
  21. package/dist/api/core/io/export/index.d.ts.map +1 -1
  22. package/dist/api/core/io/import/index.d.ts +61 -0
  23. package/dist/api/core/io/import/index.d.ts.map +1 -1
  24. package/dist/api/core/mode/index.d.ts +99 -0
  25. package/dist/api/core/mode/index.d.ts.map +1 -0
  26. package/dist/api/core/storeys/index.d.ts +251 -0
  27. package/dist/api/core/storeys/index.d.ts.map +1 -0
  28. package/dist/api/core/tags.d.ts +24 -0
  29. package/dist/api/core/tags.d.ts.map +1 -1
  30. package/dist/api/core/zoom/index.d.ts +4 -0
  31. package/dist/api/core/zoom/index.d.ts.map +1 -1
  32. package/dist/api/design/create/index.d.ts +115 -4
  33. package/dist/api/design/create/index.d.ts.map +1 -1
  34. package/dist/api/design/delete/index.d.ts +3 -0
  35. package/dist/api/design/delete/index.d.ts.map +1 -1
  36. package/dist/api/design/query/geometry/index.d.ts +112 -0
  37. package/dist/api/design/query/geometry/index.d.ts.map +1 -1
  38. package/dist/api/design/query/index.d.ts +4 -0
  39. package/dist/api/design/query/index.d.ts.map +1 -1
  40. package/dist/api/design/query/referenceLines.d.ts +45 -0
  41. package/dist/api/design/query/referenceLines.d.ts.map +1 -0
  42. package/dist/api/design/query/spaces.d.ts +173 -0
  43. package/dist/api/design/query/spaces.d.ts.map +1 -1
  44. package/dist/api/design/transform/index.d.ts +12 -0
  45. package/dist/api/design/transform/index.d.ts.map +1 -1
  46. package/dist/api/design/update/index.d.ts +51 -1
  47. package/dist/api/design/update/index.d.ts.map +1 -1
  48. package/dist/api/entity/buildableEnvelope.d.ts +4 -0
  49. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
  50. package/dist/api/entity/referenceLine.d.ts +8 -0
  51. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  52. package/dist/api/entity/story.d.ts +20 -0
  53. package/dist/api/entity/story.d.ts.map +1 -1
  54. package/dist/api/index.d.ts +5 -0
  55. package/dist/api/index.d.ts.map +1 -1
  56. package/dist/api/presentation/export.d.ts +4 -0
  57. package/dist/api/presentation/export.d.ts.map +1 -1
  58. package/dist/api/presentation/import.d.ts +6 -0
  59. package/dist/api/presentation/import.d.ts.map +1 -1
  60. package/dist/api/presentation/index.d.ts +9 -0
  61. package/dist/api/presentation/index.d.ts.map +1 -1
  62. package/dist/api/presentation/placedViews.d.ts +370 -0
  63. package/dist/api/presentation/placedViews.d.ts.map +1 -0
  64. package/dist/api/presentation/shapes.d.ts +481 -0
  65. package/dist/api/presentation/shapes.d.ts.map +1 -0
  66. package/dist/api/program/site.d.ts +94 -0
  67. package/dist/api/program/site.d.ts.map +1 -1
  68. package/dist/api/program/spreadsheet.d.ts +260 -28
  69. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  70. package/dist/api/workspace/index.d.ts +460 -0
  71. package/dist/api/workspace/index.d.ts.map +1 -0
  72. package/dist/index.cjs +2625 -1758
  73. package/dist/index.cjs.map +1 -1
  74. package/dist/index.js +2515 -1758
  75. package/dist/index.js.map +1 -1
  76. package/package.json +3 -2
  77. package/scripts/generate-manifest.mjs +45 -0
  78. package/src/api/analysis/daylight.ts +470 -0
  79. package/src/api/analysis/heatmaps.ts +444 -17
  80. package/src/api/analysis/index.ts +15 -0
  81. package/src/api/analysis/solar.ts +237 -0
  82. package/src/api/analysis/weather.ts +179 -0
  83. package/src/api/core/camera/index.ts +39 -0
  84. package/src/api/core/geom/create/index.ts +344 -1
  85. package/src/api/core/index.ts +9 -0
  86. package/src/api/core/io/export/index.ts +3 -1
  87. package/src/api/core/io/import/index.ts +64 -0
  88. package/src/api/core/mode/index.ts +96 -0
  89. package/src/api/core/storeys/index.ts +279 -0
  90. package/src/api/core/tags.ts +27 -0
  91. package/src/api/core/zoom/index.ts +4 -0
  92. package/src/api/design/create/index.ts +138 -1
  93. package/src/api/design/delete/index.ts +3 -0
  94. package/src/api/design/query/geometry/index.ts +125 -3
  95. package/src/api/design/query/index.ts +4 -0
  96. package/src/api/design/query/referenceLines.ts +52 -0
  97. package/src/api/design/query/spaces.ts +143 -0
  98. package/src/api/design/transform/index.ts +12 -0
  99. package/src/api/design/update/index.ts +66 -1
  100. package/src/api/entity/buildableEnvelope.ts +4 -0
  101. package/src/api/entity/referenceLine.ts +8 -0
  102. package/src/api/entity/story.ts +20 -0
  103. package/src/api/index.ts +5 -0
  104. package/src/api/presentation/export.ts +4 -0
  105. package/src/api/presentation/import.ts +6 -0
  106. package/src/api/presentation/index.ts +9 -0
  107. package/src/api/presentation/placedViews.ts +363 -0
  108. package/src/api/presentation/shapes.ts +274 -0
  109. package/src/api/program/site.ts +95 -0
  110. package/src/api/program/spreadsheet.ts +251 -6
  111. package/src/api/workspace/index.ts +516 -0
@@ -0,0 +1,249 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ /**
4
+ * Analysis solar — sample solar exposure at caller-chosen points.
5
+ *
6
+ * Unlike the heatmap studies (which raster the model's own surfaces), this
7
+ * samples solar exposure at **points you supply** — an instant (sun visible? /
8
+ * irradiance now) or aggregated over a date range (shaded fraction / cumulative
9
+ * irradiance). Positions are **world plan-space** coordinates, the same units
10
+ * and frame as plugin geometry reads; the backend echoes them verbatim and
11
+ * never re-projects.
12
+ *
13
+ * Raw numbers only: this renders no heatmap, mutates no geometry, and writes no
14
+ * save commands — visualization is the plugin's job. Large grids run as a job
15
+ * (`status: "running"` until complete); every result carries `modelRevision` +
16
+ * `inputHash` so the caller can mark it stale after a geometry change.
17
+ *
18
+ * Accessed via `snaptrude.analysis.solar`.
19
+ */
20
+ export declare abstract class PluginAnalysisSolarApi {
21
+ constructor();
22
+ /**
23
+ * Sample solar exposure at a set of points.
24
+ *
25
+ * Provide **exactly one** timing mode: `dateTime` (a single instant →
26
+ * `mode: "instant"`, results in `W/m²`), or `startDate` + `endDate` (a range
27
+ * → `mode: "range"`, results aggregated in `kWh/m²`). `results` is paged —
28
+ * follow `nextCursor` until it is `null`. Each point's optional `normal`
29
+ * gives plane-of-array irradiance; omit it for a horizontal sample.
30
+ *
31
+ * @param args - {@linkcode PluginSolarSampleGridArgs}: the `points`, exactly
32
+ * one timing mode (`dateTime` XOR `startDate`+`endDate`), and an optional
33
+ * `includeHourlyArtifact` to attach a downloadable per-hour series.
34
+ * @returns A {@linkcode PluginSolarSampleGridResult} — the run `status`,
35
+ * `mode`/`units`, provenance (`weather`, `modelRevision`, `inputHash`),
36
+ * this page of `results`, an optional `hourlyArtifact`, and `nextCursor`.
37
+ * @throws When the project has no geo-located site (no location to sample
38
+ * solar exposure for).
39
+ *
40
+ * @examplePrompt What's the irradiance at these facade points at noon on June 21?
41
+ * @examplePrompt How shaded are these balcony points across the summer?
42
+ * @examplePrompt Sample direct sun visibility at these roof points right now
43
+ *
44
+ * # Example
45
+ * ```ts
46
+ * const grid = await snaptrude.analysis.solar.sampleGrid({
47
+ * points: [
48
+ * { id: "a", position: [0, 3, 0] },
49
+ * { id: "b", position: [5, 3, 0], normal: [0, 0, 1] },
50
+ * ],
51
+ * dateTime: "2026-06-21T12:00:00+05:30",
52
+ * })
53
+ * for (const r of grid.results) {
54
+ * console.log(r.id, r.directSunVisible, r.totalIrradiance, grid.units)
55
+ * }
56
+ * ```
57
+ */
58
+ abstract sampleGrid(args: PluginSolarSampleGridArgs): PluginApiReturn<PluginSolarSampleGridResult>;
59
+ }
60
+ /**
61
+ * Status of a {@linkcode PluginAnalysisSolarApi.sampleGrid} run.
62
+ *
63
+ * | Value | Meaning |
64
+ * |---|---|
65
+ * | `"running"` | The job is in flight — poll again |
66
+ * | `"complete"` | Results are final |
67
+ * | `"cancelled"` | The run was cancelled |
68
+ * | `"failed"` | The run failed |
69
+ */
70
+ export declare const PluginSolarRunStatus: z.ZodEnum<{
71
+ complete: "complete";
72
+ failed: "failed";
73
+ running: "running";
74
+ cancelled: "cancelled";
75
+ }>;
76
+ export type PluginSolarRunStatus = z.infer<typeof PluginSolarRunStatus>;
77
+ /**
78
+ * Timing mode of the run — chosen by which timing args were supplied.
79
+ *
80
+ * | Value | Meaning |
81
+ * |---|---|
82
+ * | `"instant"` | Single `dateTime` — irradiance in `W/m²` |
83
+ * | `"range"` | `startDate`+`endDate` — irradiance aggregated in `kWh/m²` |
84
+ */
85
+ export declare const PluginSolarSampleMode: z.ZodEnum<{
86
+ range: "range";
87
+ instant: "instant";
88
+ }>;
89
+ export type PluginSolarSampleMode = z.infer<typeof PluginSolarSampleMode>;
90
+ /**
91
+ * Irradiance units of the results — `W/m²` (instant) or `kWh/m²` (range).
92
+ */
93
+ export declare const PluginSolarUnits: z.ZodEnum<{
94
+ "W/m2": "W/m2";
95
+ "kWh/m2": "kWh/m2";
96
+ }>;
97
+ export type PluginSolarUnits = z.infer<typeof PluginSolarUnits>;
98
+ /**
99
+ * Downloadable per-hour artifact (present only when `includeHourlyArtifact`).
100
+ *
101
+ * | Property | Type | Description |
102
+ * |---|---|---|
103
+ * | `url` | `string` | Signed download URL |
104
+ * | `format` | `"parquet" \| "csv-gz"` | File format |
105
+ * | `expiresAt` | `string` | ISO 8601 expiry of the signed URL |
106
+ */
107
+ export declare const PluginSolarHourlyArtifact: z.ZodObject<{
108
+ url: z.ZodString;
109
+ format: z.ZodEnum<{
110
+ parquet: "parquet";
111
+ "csv-gz": "csv-gz";
112
+ }>;
113
+ expiresAt: z.ZodString;
114
+ }, z.core.$strip>;
115
+ export type PluginSolarHourlyArtifact = z.infer<typeof PluginSolarHourlyArtifact>;
116
+ /**
117
+ * A caller-supplied point to sample.
118
+ *
119
+ * | Property | Type | Description |
120
+ * |---|---|---|
121
+ * | `id` | `string` | Caller-chosen id, echoed back verbatim on the result |
122
+ * | `position` | `[number, number, number]` | World plan-space `[x, y, z]` |
123
+ * | `normal` | `[number, number, number]`? | Surface normal for plane-of-array; omit = horizontal |
124
+ */
125
+ export declare const PluginSolarSamplePoint: z.ZodObject<{
126
+ id: z.ZodString;
127
+ position: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
128
+ normal: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
129
+ }, z.core.$strip>;
130
+ export type PluginSolarSamplePoint = z.infer<typeof PluginSolarSamplePoint>;
131
+ /**
132
+ * Arguments for {@linkcode PluginAnalysisSolarApi.sampleGrid}.
133
+ *
134
+ * Provide **exactly one** timing mode: `dateTime` (instant) XOR
135
+ * `startDate`+`endDate` (range).
136
+ *
137
+ * | Property | Type | Description |
138
+ * |---|---|---|
139
+ * | `points` | {@linkcode PluginSolarSamplePoint}`[]` | Points to sample |
140
+ * | `dateTime` | `string`? | Instant mode: local ISO 8601 with offset |
141
+ * | `startDate` | `string`? | Range mode: inclusive start `"YYYY-MM-DD"` |
142
+ * | `endDate` | `string`? | Range mode: inclusive end `"YYYY-MM-DD"` |
143
+ * | `includeHourlyArtifact` | `boolean`? | Attach a downloadable per-hour series |
144
+ */
145
+ export declare const PluginSolarSampleGridArgs: z.ZodObject<{
146
+ points: z.ZodArray<z.ZodObject<{
147
+ id: z.ZodString;
148
+ position: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
149
+ normal: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
150
+ }, z.core.$strip>>;
151
+ dateTime: z.ZodOptional<z.ZodString>;
152
+ startDate: z.ZodOptional<z.ZodString>;
153
+ endDate: z.ZodOptional<z.ZodString>;
154
+ includeHourlyArtifact: z.ZodOptional<z.ZodBoolean>;
155
+ }, z.core.$strip>;
156
+ export type PluginSolarSampleGridArgs = z.infer<typeof PluginSolarSampleGridArgs>;
157
+ /**
158
+ * One sampled point's result. Irradiance fields are in the enclosing result's
159
+ * `units` and are omitted when the backend did not compute them.
160
+ *
161
+ * | Property | Type | Description |
162
+ * |---|---|---|
163
+ * | `id` | `string` | The point's caller-chosen id |
164
+ * | `directSunVisible` | `boolean` | Instant mode: sun disc visible from the point |
165
+ * | `shadeFraction` | `number` | `0`..`1`; range mode: fraction of sun-up hours shaded |
166
+ * | `directIrradiance` | `number`? | Direct component, in the result's `units` |
167
+ * | `diffuseIrradiance` | `number`? | Diffuse component, in the result's `units` |
168
+ * | `totalIrradiance` | `number`? | Total (direct + diffuse), in the result's `units` |
169
+ */
170
+ export declare const PluginSolarSampleResult: z.ZodObject<{
171
+ id: z.ZodString;
172
+ directSunVisible: z.ZodBoolean;
173
+ shadeFraction: z.ZodNumber;
174
+ directIrradiance: z.ZodOptional<z.ZodNumber>;
175
+ diffuseIrradiance: z.ZodOptional<z.ZodNumber>;
176
+ totalIrradiance: z.ZodOptional<z.ZodNumber>;
177
+ }, z.core.$strip>;
178
+ export type PluginSolarSampleResult = z.infer<typeof PluginSolarSampleResult>;
179
+ /**
180
+ * Result of {@linkcode PluginAnalysisSolarApi.sampleGrid} — one page.
181
+ *
182
+ * | Property | Type | Description |
183
+ * |---|---|---|
184
+ * | `status` | {@linkcode PluginSolarRunStatus} | Run status |
185
+ * | `mode` | {@linkcode PluginSolarSampleMode} | `"instant"` or `"range"` |
186
+ * | `coordinateSystem` | `"world-plan-space"` | Echo of the input frame |
187
+ * | `modelRevision` | `string` | Geometry revision sampled against (staleness key) |
188
+ * | `inputHash` | `string` | Hash of points+dates+geometry (staleness key) |
189
+ * | `units` | {@linkcode PluginSolarUnits} | `"W/m2"` (instant) or `"kWh/m2"` (range) |
190
+ * | `sunUpHours` | `number` | Sun-up hours over the sampled window |
191
+ * | `weather` | {@linkcode PluginWeatherSourceMeta} \| `null` | Resolved weather file, or `null` |
192
+ * | `weatherQuality` | `string[]` | Deduped quality flags present in the consumed rows |
193
+ * | `results` | {@linkcode PluginSolarSampleResult}`[]` | This page of per-point results |
194
+ * | `hourlyArtifact` | {@linkcode PluginSolarHourlyArtifact} \| `null` | Per-hour download, or `null` |
195
+ * | `nextCursor` | `string \| null` | Next page cursor; `null` = last page |
196
+ */
197
+ export declare const PluginSolarSampleGridResult: z.ZodObject<{
198
+ status: z.ZodEnum<{
199
+ complete: "complete";
200
+ failed: "failed";
201
+ running: "running";
202
+ cancelled: "cancelled";
203
+ }>;
204
+ mode: z.ZodEnum<{
205
+ range: "range";
206
+ instant: "instant";
207
+ }>;
208
+ coordinateSystem: z.ZodLiteral<"world-plan-space">;
209
+ modelRevision: z.ZodString;
210
+ inputHash: z.ZodString;
211
+ units: z.ZodEnum<{
212
+ "W/m2": "W/m2";
213
+ "kWh/m2": "kWh/m2";
214
+ }>;
215
+ sunUpHours: z.ZodNumber;
216
+ weather: z.ZodNullable<z.ZodObject<{
217
+ weatherFileId: z.ZodString;
218
+ station: z.ZodString;
219
+ sourceId: z.ZodString;
220
+ distanceKm: z.ZodNullable<z.ZodNumber>;
221
+ selectionMethod: z.ZodEnum<{
222
+ "nearest-station": "nearest-station";
223
+ "user-upload": "user-upload";
224
+ "project-override": "project-override";
225
+ }>;
226
+ checksum: z.ZodString;
227
+ windReferenceHeightM: z.ZodNumber;
228
+ }, z.core.$strip>>;
229
+ weatherQuality: z.ZodArray<z.ZodString>;
230
+ results: z.ZodArray<z.ZodObject<{
231
+ id: z.ZodString;
232
+ directSunVisible: z.ZodBoolean;
233
+ shadeFraction: z.ZodNumber;
234
+ directIrradiance: z.ZodOptional<z.ZodNumber>;
235
+ diffuseIrradiance: z.ZodOptional<z.ZodNumber>;
236
+ totalIrradiance: z.ZodOptional<z.ZodNumber>;
237
+ }, z.core.$strip>>;
238
+ hourlyArtifact: z.ZodNullable<z.ZodObject<{
239
+ url: z.ZodString;
240
+ format: z.ZodEnum<{
241
+ parquet: "parquet";
242
+ "csv-gz": "csv-gz";
243
+ }>;
244
+ expiresAt: z.ZodString;
245
+ }, z.core.$strip>>;
246
+ nextCursor: z.ZodNullable<z.ZodString>;
247
+ }, z.core.$strip>;
248
+ export type PluginSolarSampleGridResult = z.infer<typeof PluginSolarSampleGridResult>;
249
+ //# sourceMappingURL=solar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solar.d.ts","sourceRoot":"","sources":["../../../src/api/analysis/solar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAG7C;;;;;;;;;;;;;;;;GAgBG;AACH,8BAAsB,sBAAsB;;IAG1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;aACa,UAAU,CACxB,IAAI,EAAE,yBAAyB,GAC9B,eAAe,CAAC,2BAA2B,CAAC;CAChD;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;;;;;EAK/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;EAA+B,CAAA;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;EAA6B,CAAA;AAC1D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB;;;;;;;iBAIpC,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,yBAAyB,CACjC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;iBA0BlC,CAAA;AACJ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,yBAAyB,CACjC,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB;;;;;;;iBAOlC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAatC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,2BAA2B,CACnC,CAAA"}
@@ -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"}
@@ -115,6 +115,43 @@ export declare abstract class PluginCameraApi {
115
115
  * ```
116
116
  */
117
117
  abstract setProjection(projection: PluginCameraProjection): PluginApiReturn<boolean>;
118
+ /**
119
+ * Zoom (fit) the camera to all geometry in the scene — the "zoom extents"
120
+ * action. View-state only — not undoable. Canonical home of the zoom-extents
121
+ * read (the deprecated `core.zoom.extents`).
122
+ *
123
+ * @returns `true` once the camera has been framed to the scene.
124
+ *
125
+ * @examplePrompt Zoom out so I can see the whole model
126
+ * @examplePrompt Fit everything in the view
127
+ * @examplePrompt Frame the entire building in the viewport
128
+ * @examplePrompt Do a zoom extents on the canvas
129
+ *
130
+ * # Example
131
+ * ```ts
132
+ * await snaptrude.core.camera.zoomExtents()
133
+ * ```
134
+ */
135
+ abstract zoomExtents(): PluginApiReturn<boolean>;
136
+ /**
137
+ * Zoom (fit) the camera to the current selection. View-state only — not
138
+ * undoable. Canonical home of the zoom-to-selection read (the deprecated
139
+ * `core.zoom.selection`).
140
+ *
141
+ * @returns `true` if there was a selection to frame; `false` if nothing is
142
+ * selected (no-op).
143
+ *
144
+ * @examplePrompt Zoom in on what I have selected
145
+ * @examplePrompt Frame the selected walls in the view
146
+ * @examplePrompt Focus the camera on my current selection
147
+ * @examplePrompt Fit the view to the selected room
148
+ *
149
+ * # Example
150
+ * ```ts
151
+ * await snaptrude.core.camera.zoomSelection()
152
+ * ```
153
+ */
154
+ abstract zoomSelection(): PluginApiReturn<boolean>;
118
155
  }
119
156
  /**
120
157
  * A standard camera view: the five orthographic elevations (`top`/`front`/
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/camera/index.ts"],"names":[],"mappings":"AAAA,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