@snaptrude/plugin-core 0.7.1 → 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 (193) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/api-manifest.full.json +7703 -0
  3. package/api-manifest.json +2946 -259
  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 +245 -0
  15. package/dist/api/core/camera/index.d.ts.map +1 -0
  16. package/dist/api/core/comment/index.d.ts +105 -2
  17. package/dist/api/core/comment/index.d.ts.map +1 -1
  18. package/dist/api/core/geom/create/index.d.ts +331 -14
  19. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  20. package/dist/api/core/geom/delete/index.d.ts +8 -2
  21. package/dist/api/core/geom/delete/index.d.ts.map +1 -1
  22. package/dist/api/core/geom/query/arc.d.ts +5 -5
  23. package/dist/api/core/geom/query/brep.d.ts +18 -18
  24. package/dist/api/core/geom/query/circle.d.ts +18 -18
  25. package/dist/api/core/geom/query/contour.d.ts +20 -20
  26. package/dist/api/core/geom/query/curve.d.ts +49 -49
  27. package/dist/api/core/geom/query/edge.d.ts +5 -5
  28. package/dist/api/core/geom/query/face.d.ts +16 -16
  29. package/dist/api/core/geom/query/halfedge.d.ts +8 -8
  30. package/dist/api/core/geom/query/profile.d.ts +19 -19
  31. package/dist/api/core/geom/query/vertex.d.ts +8 -8
  32. package/dist/api/core/geom/update/contour.d.ts +14 -14
  33. package/dist/api/core/geom/update/curve.d.ts +7 -7
  34. package/dist/api/core/geom/update/profile.d.ts +16 -16
  35. package/dist/api/core/handles/index.d.ts +210 -0
  36. package/dist/api/core/handles/index.d.ts.map +1 -0
  37. package/dist/api/core/index.d.ts +24 -0
  38. package/dist/api/core/index.d.ts.map +1 -1
  39. package/dist/api/core/io/export/index.d.ts +134 -0
  40. package/dist/api/core/io/export/index.d.ts.map +1 -0
  41. package/dist/api/core/io/import/index.d.ts +62 -1
  42. package/dist/api/core/io/import/index.d.ts.map +1 -1
  43. package/dist/api/core/io/index.d.ts +5 -0
  44. package/dist/api/core/io/index.d.ts.map +1 -1
  45. package/dist/api/core/layers.d.ts +7 -7
  46. package/dist/api/core/mode/index.d.ts +99 -0
  47. package/dist/api/core/mode/index.d.ts.map +1 -0
  48. package/dist/api/core/proposals/index.d.ts +65 -9
  49. package/dist/api/core/proposals/index.d.ts.map +1 -1
  50. package/dist/api/core/storeys/index.d.ts +251 -0
  51. package/dist/api/core/storeys/index.d.ts.map +1 -0
  52. package/dist/api/core/tags.d.ts +24 -0
  53. package/dist/api/core/tags.d.ts.map +1 -1
  54. package/dist/api/core/user.d.ts +44 -0
  55. package/dist/api/core/user.d.ts.map +1 -0
  56. package/dist/api/core/zoom/index.d.ts +4 -0
  57. package/dist/api/core/zoom/index.d.ts.map +1 -1
  58. package/dist/api/design/boolean/index.d.ts +4 -4
  59. package/dist/api/design/create/index.d.ts +253 -47
  60. package/dist/api/design/create/index.d.ts.map +1 -1
  61. package/dist/api/design/delete/index.d.ts +3 -0
  62. package/dist/api/design/delete/index.d.ts.map +1 -1
  63. package/dist/api/design/doors/index.d.ts +36 -0
  64. package/dist/api/design/doors/index.d.ts.map +1 -1
  65. package/dist/api/design/edit/index.d.ts +1 -1
  66. package/dist/api/design/erase/index.d.ts +2 -2
  67. package/dist/api/design/furniture/index.d.ts +114 -3
  68. package/dist/api/design/furniture/index.d.ts.map +1 -1
  69. package/dist/api/design/index.d.ts +10 -0
  70. package/dist/api/design/index.d.ts.map +1 -1
  71. package/dist/api/design/materials/index.d.ts +111 -14
  72. package/dist/api/design/materials/index.d.ts.map +1 -1
  73. package/dist/api/design/query/geometry/index.d.ts +112 -0
  74. package/dist/api/design/query/geometry/index.d.ts.map +1 -1
  75. package/dist/api/design/query/index.d.ts +35 -1
  76. package/dist/api/design/query/index.d.ts.map +1 -1
  77. package/dist/api/design/query/referenceLines.d.ts +45 -0
  78. package/dist/api/design/query/referenceLines.d.ts.map +1 -0
  79. package/dist/api/design/query/spaces.d.ts +178 -5
  80. package/dist/api/design/query/spaces.d.ts.map +1 -1
  81. package/dist/api/design/transform/index.d.ts +95 -14
  82. package/dist/api/design/transform/index.d.ts.map +1 -1
  83. package/dist/api/design/types/index.d.ts +181 -0
  84. package/dist/api/design/types/index.d.ts.map +1 -0
  85. package/dist/api/design/update/index.d.ts +385 -2
  86. package/dist/api/design/update/index.d.ts.map +1 -1
  87. package/dist/api/design/visibility.d.ts +98 -0
  88. package/dist/api/design/visibility.d.ts.map +1 -0
  89. package/dist/api/entity/buildableEnvelope.d.ts +4 -0
  90. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
  91. package/dist/api/entity/referenceLine.d.ts +10 -2
  92. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  93. package/dist/api/entity/space.d.ts +19 -19
  94. package/dist/api/entity/story.d.ts +148 -15
  95. package/dist/api/entity/story.d.ts.map +1 -1
  96. package/dist/api/index.d.ts +5 -0
  97. package/dist/api/index.d.ts.map +1 -1
  98. package/dist/api/presentation/annotate.d.ts +448 -0
  99. package/dist/api/presentation/annotate.d.ts.map +1 -0
  100. package/dist/api/presentation/diagrams.d.ts +49 -8
  101. package/dist/api/presentation/diagrams.d.ts.map +1 -1
  102. package/dist/api/presentation/export.d.ts +108 -0
  103. package/dist/api/presentation/export.d.ts.map +1 -0
  104. package/dist/api/presentation/import.d.ts +6 -0
  105. package/dist/api/presentation/import.d.ts.map +1 -1
  106. package/dist/api/presentation/index.d.ts +47 -0
  107. package/dist/api/presentation/index.d.ts.map +1 -1
  108. package/dist/api/presentation/placedViews.d.ts +370 -0
  109. package/dist/api/presentation/placedViews.d.ts.map +1 -0
  110. package/dist/api/presentation/shapes.d.ts +481 -0
  111. package/dist/api/presentation/shapes.d.ts.map +1 -0
  112. package/dist/api/presentation/sheets.d.ts +410 -13
  113. package/dist/api/presentation/sheets.d.ts.map +1 -1
  114. package/dist/api/presentation/views.d.ts +165 -10
  115. package/dist/api/presentation/views.d.ts.map +1 -1
  116. package/dist/api/program/areas.d.ts +63 -3
  117. package/dist/api/program/areas.d.ts.map +1 -1
  118. package/dist/api/program/cores.d.ts +3 -99
  119. package/dist/api/program/cores.d.ts.map +1 -1
  120. package/dist/api/program/index.d.ts +2 -2
  121. package/dist/api/program/index.d.ts.map +1 -1
  122. package/dist/api/program/layout.d.ts +172 -12
  123. package/dist/api/program/layout.d.ts.map +1 -1
  124. package/dist/api/program/site.d.ts +105 -8
  125. package/dist/api/program/site.d.ts.map +1 -1
  126. package/dist/api/program/spreadsheet.d.ts +365 -41
  127. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  128. package/dist/api/workspace/index.d.ts +460 -0
  129. package/dist/api/workspace/index.d.ts.map +1 -0
  130. package/dist/handles.d.ts +64 -25
  131. package/dist/handles.d.ts.map +1 -1
  132. package/dist/index.cjs +3210 -1671
  133. package/dist/index.cjs.map +1 -1
  134. package/dist/index.js +3008 -1666
  135. package/dist/index.js.map +1 -1
  136. package/package.json +3 -2
  137. package/scripts/generate-manifest.mjs +45 -0
  138. package/src/api/analysis/daylight.ts +470 -0
  139. package/src/api/analysis/heatmaps.ts +444 -17
  140. package/src/api/analysis/index.ts +15 -0
  141. package/src/api/analysis/solar.ts +237 -0
  142. package/src/api/analysis/weather.ts +179 -0
  143. package/src/api/core/camera/index.ts +251 -0
  144. package/src/api/core/comment/index.ts +120 -2
  145. package/src/api/core/geom/create/index.ts +344 -1
  146. package/src/api/core/geom/delete/index.ts +6 -0
  147. package/src/api/core/handles/index.ts +233 -0
  148. package/src/api/core/index.ts +24 -0
  149. package/src/api/core/io/export/index.ts +126 -0
  150. package/src/api/core/io/import/index.ts +64 -0
  151. package/src/api/core/io/index.ts +5 -0
  152. package/src/api/core/mode/index.ts +96 -0
  153. package/src/api/core/proposals/index.ts +71 -11
  154. package/src/api/core/storeys/index.ts +279 -0
  155. package/src/api/core/tags.ts +27 -0
  156. package/src/api/core/user.ts +46 -0
  157. package/src/api/core/zoom/index.ts +4 -0
  158. package/src/api/design/create/index.ts +303 -36
  159. package/src/api/design/delete/index.ts +3 -0
  160. package/src/api/design/doors/index.ts +40 -0
  161. package/src/api/design/furniture/index.ts +127 -3
  162. package/src/api/design/index.ts +10 -0
  163. package/src/api/design/materials/index.ts +157 -30
  164. package/src/api/design/query/geometry/index.ts +125 -3
  165. package/src/api/design/query/index.ts +37 -7
  166. package/src/api/design/query/referenceLines.ts +52 -0
  167. package/src/api/design/query/spaces.ts +143 -0
  168. package/src/api/design/transform/index.ts +101 -12
  169. package/src/api/design/types/index.ts +156 -0
  170. package/src/api/design/update/index.ts +467 -6
  171. package/src/api/design/visibility.ts +109 -0
  172. package/src/api/entity/buildableEnvelope.ts +4 -0
  173. package/src/api/entity/referenceLine.ts +8 -0
  174. package/src/api/entity/story.ts +161 -15
  175. package/src/api/index.ts +5 -0
  176. package/src/api/presentation/annotate.ts +360 -0
  177. package/src/api/presentation/diagrams.ts +53 -8
  178. package/src/api/presentation/export.ts +108 -0
  179. package/src/api/presentation/import.ts +6 -0
  180. package/src/api/presentation/index.ts +55 -0
  181. package/src/api/presentation/placedViews.ts +363 -0
  182. package/src/api/presentation/shapes.ts +274 -0
  183. package/src/api/presentation/sheets.ts +346 -13
  184. package/src/api/presentation/views.ts +164 -12
  185. package/src/api/program/areas.ts +57 -6
  186. package/src/api/program/cores.ts +3 -91
  187. package/src/api/program/index.ts +2 -2
  188. package/src/api/program/layout.ts +182 -12
  189. package/src/api/program/site.ts +106 -8
  190. package/src/api/program/spreadsheet.ts +376 -35
  191. package/src/api/workspace/index.ts +516 -0
  192. package/src/handles.ts +77 -13
  193. package/tsconfig.json +7 -2
@@ -0,0 +1,245 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../../types";
3
+ import { Vec3Handle } from "../../../handles";
4
+ /**
5
+ * Camera controls.
6
+ *
7
+ * Position the viewport camera, snap it to a standard orthographic/isometric
8
+ * view, and toggle between the 2D (plan) and 3D modelling modes — mirrors the
9
+ * canvas view menu and the 2D/3D toggle. Like {@linkcode PluginZoomApi}, these
10
+ * are transient VIEW-STATE changes: they are not model edits, so they are not
11
+ * write-gated and are not undoable. Accessed via `snaptrude.core.camera`.
12
+ */
13
+ export declare abstract class PluginCameraApi {
14
+ constructor();
15
+ /**
16
+ * Point the camera: place its eye at `eye` looking toward `target` (world
17
+ * coordinates, internal `babylon` units). View-state only — not undoable.
18
+ *
19
+ * @param eye - Camera position as a {@linkcode Vec3Handle}
20
+ * @param target - Point the camera looks at as a {@linkcode Vec3Handle}
21
+ * @returns `true` once the camera has been positioned.
22
+ *
23
+ * @examplePrompt Look at the model from above the north-east corner
24
+ * @examplePrompt Position the camera at (50, 30, 50) looking at the origin
25
+ * @examplePrompt Point the camera at the centre of the building from the side
26
+ * @examplePrompt Set the eye to this point and aim it at that point
27
+ *
28
+ * # Example
29
+ * ```ts
30
+ * const { vec3 } = snaptrude.core.math
31
+ * await snaptrude.core.camera.lookFrom(vec3.new(50, 30, 50), vec3.new(0, 0, 0))
32
+ * ```
33
+ */
34
+ abstract lookFrom(eye: Vec3Handle, target: Vec3Handle): PluginApiReturn<boolean>;
35
+ /**
36
+ * Snap the camera to a standard view — the five orthographic elevations
37
+ * (`top` / `front` / `back` / `left` / `right`) or the 3D `iso` (isometric
38
+ * perspective) view. Mirrors the canvas view menu. View-state only — not
39
+ * undoable. The orthographic presets exit 2D mode first if needed.
40
+ *
41
+ * @param view - The standard view to snap to ({@linkcode PluginStandardView})
42
+ * @returns `true` once the view has been applied.
43
+ *
44
+ * @examplePrompt Switch to the top view
45
+ * @examplePrompt Show me the front elevation
46
+ * @examplePrompt Go to the isometric view
47
+ * @examplePrompt Look at the model from the left
48
+ * @examplePrompt Give me a plan view from the top
49
+ *
50
+ * # Example
51
+ * ```ts
52
+ * await snaptrude.core.camera.setStandardView("top")
53
+ * ```
54
+ */
55
+ abstract setStandardView(view: PluginStandardView): PluginApiReturn<boolean>;
56
+ /**
57
+ * Toggle the modelling mode between `2d` (plan) and `3d`. Mirrors the canvas
58
+ * 2D/3D toggle: `3d` enters the isometric perspective view, `2d` drops to the
59
+ * orthographic plan of the active storey. View-state only — not undoable.
60
+ *
61
+ * @param mode - `"2d"` or `"3d"` ({@linkcode PluginCameraMode})
62
+ * @returns `true` once the mode switch has been requested.
63
+ *
64
+ * @examplePrompt Switch to 3D view
65
+ * @examplePrompt Drop into 2D plan mode
66
+ * @examplePrompt Go back to 3D
67
+ * @examplePrompt Show the floor plan in 2D
68
+ *
69
+ * # Example
70
+ * ```ts
71
+ * await snaptrude.core.camera.setMode("3d")
72
+ * ```
73
+ */
74
+ abstract setMode(mode: PluginCameraMode): PluginApiReturn<boolean>;
75
+ /**
76
+ * Read the camera's current projection: `"perspective"` (the default 3D
77
+ * view) or `"orthographic"`. In 2D (plan) mode this always reports
78
+ * `"orthographic"` — a plan is an orthographic projection.
79
+ *
80
+ * @returns The current {@linkcode PluginCameraProjection}.
81
+ *
82
+ * @examplePrompt Is the camera in perspective or orthographic?
83
+ * @examplePrompt What projection is the 3D view using?
84
+ * @examplePrompt Check whether perspective is on
85
+ *
86
+ * # Example
87
+ * ```ts
88
+ * const projection = await snaptrude.core.camera.getProjection()
89
+ * console.log(projection) // "perspective" | "orthographic"
90
+ * ```
91
+ */
92
+ abstract getProjection(): PluginApiReturn<PluginCameraProjection>;
93
+ /**
94
+ * Switch the 3D camera between `"perspective"` and `"orthographic"`
95
+ * projection — the Perspective/Orthographic control in the Design tab's
96
+ * View Settings panel. Like {@linkcode PluginCameraApi.setMode}, this is a
97
+ * transient view-state change: not write-gated, not undoable.
98
+ *
99
+ * In 2D (plan) mode the canvas is always an orthographic plan:
100
+ * `"orthographic"` is accepted as a no-op, while `"perspective"` is
101
+ * rejected — switch to 3D first via `setMode("3d")`.
102
+ *
103
+ * @param projection - `"perspective"` or `"orthographic"` ({@linkcode PluginCameraProjection})
104
+ * @returns `true` once the projection has been applied.
105
+ *
106
+ * @examplePrompt Switch the camera to orthographic
107
+ * @examplePrompt Turn perspective off
108
+ * @examplePrompt Give me a perspective view of the model
109
+ * @examplePrompt Make the 3D view orthographic like an axonometric drawing
110
+ *
111
+ * # Example
112
+ * ```ts
113
+ * await snaptrude.core.camera.setProjection("orthographic")
114
+ * const projection = await snaptrude.core.camera.getProjection() // "orthographic"
115
+ * ```
116
+ */
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>;
155
+ }
156
+ /**
157
+ * A standard camera view: the five orthographic elevations (`top`/`front`/
158
+ * `back`/`left`/`right`) or the 3D isometric perspective (`iso`).
159
+ */
160
+ export declare const PluginStandardView: z.ZodEnum<{
161
+ top: "top";
162
+ front: "front";
163
+ back: "back";
164
+ left: "left";
165
+ right: "right";
166
+ iso: "iso";
167
+ }>;
168
+ export type PluginStandardView = z.infer<typeof PluginStandardView>;
169
+ /**
170
+ * The modelling mode: `2d` (orthographic plan) or `3d` (isometric perspective).
171
+ */
172
+ export declare const PluginCameraMode: z.ZodEnum<{
173
+ "2d": "2d";
174
+ "3d": "3d";
175
+ }>;
176
+ export type PluginCameraMode = z.infer<typeof PluginCameraMode>;
177
+ /**
178
+ * The 3D camera projection: `perspective` (the default) or `orthographic` —
179
+ * the Perspective/Orthographic control in the Design tab's View Settings panel.
180
+ */
181
+ export declare const PluginCameraProjection: z.ZodEnum<{
182
+ perspective: "perspective";
183
+ orthographic: "orthographic";
184
+ }>;
185
+ export type PluginCameraProjection = z.infer<typeof PluginCameraProjection>;
186
+ /**
187
+ * Arguments for {@linkcode PluginCameraApi.lookFrom}.
188
+ *
189
+ * | Property | Type | Description |
190
+ * |---|---|---|
191
+ * | `eye` | {@linkcode Vec3Handle} | Camera position (world, `babylon` units) |
192
+ * | `target` | {@linkcode Vec3Handle} | Point the camera looks at |
193
+ */
194
+ export declare const PluginCameraLookFromArgs: z.ZodObject<{
195
+ eye: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
196
+ target: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
197
+ }, z.core.$strip>;
198
+ export type PluginCameraLookFromArgs = z.infer<typeof PluginCameraLookFromArgs>;
199
+ /**
200
+ * Arguments for {@linkcode PluginCameraApi.setStandardView}.
201
+ *
202
+ * | Property | Type | Description |
203
+ * |---|---|---|
204
+ * | `view` | {@linkcode PluginStandardView} | The standard view to snap to |
205
+ */
206
+ export declare const PluginCameraSetStandardViewArgs: z.ZodObject<{
207
+ view: z.ZodEnum<{
208
+ top: "top";
209
+ front: "front";
210
+ back: "back";
211
+ left: "left";
212
+ right: "right";
213
+ iso: "iso";
214
+ }>;
215
+ }, z.core.$strip>;
216
+ export type PluginCameraSetStandardViewArgs = z.infer<typeof PluginCameraSetStandardViewArgs>;
217
+ /**
218
+ * Arguments for {@linkcode PluginCameraApi.setMode}.
219
+ *
220
+ * | Property | Type | Description |
221
+ * |---|---|---|
222
+ * | `mode` | {@linkcode PluginCameraMode} | `"2d"` or `"3d"` |
223
+ */
224
+ export declare const PluginCameraSetModeArgs: z.ZodObject<{
225
+ mode: z.ZodEnum<{
226
+ "2d": "2d";
227
+ "3d": "3d";
228
+ }>;
229
+ }, z.core.$strip>;
230
+ export type PluginCameraSetModeArgs = z.infer<typeof PluginCameraSetModeArgs>;
231
+ /**
232
+ * Arguments for {@linkcode PluginCameraApi.setProjection}.
233
+ *
234
+ * | Property | Type | Description |
235
+ * |---|---|---|
236
+ * | `projection` | {@linkcode PluginCameraProjection} | `"perspective"` or `"orthographic"` |
237
+ */
238
+ export declare const PluginCameraSetProjectionArgs: z.ZodObject<{
239
+ projection: z.ZodEnum<{
240
+ perspective: "perspective";
241
+ orthographic: "orthographic";
242
+ }>;
243
+ }, z.core.$strip>;
244
+ export type PluginCameraSetProjectionArgs = z.infer<typeof PluginCameraSetProjectionArgs>;
245
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/camera/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE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O,MAAM,wBAAwB;;;iBAGnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;iBAE1C,CAAA;AACF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,+BAA+B,CACvC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB;;;;;iBAElC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B;;;;;iBAExC,CAAA;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,6BAA6B,CACrC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import * as z from "zod";
2
2
  import { PluginApiReturn } from "../../../types";
3
- import { Vec3Handle, ComponentHandle } from "../../../handles";
3
+ import { Vec3Handle, ComponentHandle, Vec3Components } from "../../../handles";
4
4
  /**
5
5
  * Comments — create, edit, resolve, tag, and list scene/project comments.
6
6
  *
@@ -158,6 +158,50 @@ export declare abstract class PluginCommentApi {
158
158
  * ```
159
159
  */
160
160
  abstract list(): PluginApiReturn<CommentHandle[]>;
161
+ /**
162
+ * Read a comment's full detail — its text, author, pin location, resolved
163
+ * state, and reply thread. Comments are otherwise write-only; this is the read
164
+ * side. Pass a top-level comment handle or a reply handle (a reply has an empty
165
+ * `thread`). Returns `null` if the handle doesn't match a live comment.
166
+ *
167
+ * @param comment - The comment (or reply) to read.
168
+ * @returns the {@link PluginCommentDetails}, or `null` if not found.
169
+ *
170
+ * @examplePrompt Read the comment on this wall and tell me what it says
171
+ * @examplePrompt Who left this comment and where is it pinned?
172
+ * @examplePrompt Show me the full thread for this comment
173
+ * @examplePrompt Get the text and author of the selected comment
174
+ *
175
+ * # Example
176
+ * ```ts
177
+ * const [first] = await snaptrude.core.comment.list()
178
+ * const details = await snaptrude.core.comment.get(first)
179
+ * console.log(details?.content, "by", details?.author?.name)
180
+ * console.log(`${details?.thread.length ?? 0} replies`)
181
+ * ```
182
+ */
183
+ abstract get(comment: CommentHandle): PluginApiReturn<PluginCommentDetails | null>;
184
+ /**
185
+ * Reply to a comment — posts a new comment threaded under `comment` (which must
186
+ * be a top-level comment, not itself a reply). Notifies the thread's
187
+ * participants, mirroring the sidebar Reply action.
188
+ *
189
+ * @param comment - The top-level comment to reply to.
190
+ * @param text - The reply text (emojis = plain unicode).
191
+ * @returns the new reply's {@link CommentHandle}.
192
+ *
193
+ * @examplePrompt Reply to this comment saying I fixed the wall height
194
+ * @examplePrompt Add a reply to the review note confirming it's done
195
+ * @examplePrompt Respond to the comment about the door with "looks good now"
196
+ * @examplePrompt Post a follow-up on the selected comment thread
197
+ *
198
+ * # Example
199
+ * ```ts
200
+ * const [thread] = await snaptrude.core.comment.list()
201
+ * const reply = await snaptrude.core.comment.reply(thread, "Fixed 👍")
202
+ * ```
203
+ */
204
+ abstract reply(comment: CommentHandle, text: string): PluginApiReturn<CommentHandle>;
161
205
  }
162
206
  /**
163
207
  * Opaque handle to a comment — its server-assigned id (entity-style: a raw,
@@ -182,7 +226,7 @@ export declare const CommentHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Commen
182
226
  */
183
227
  export declare const PluginCommentCreateArgs: z.ZodObject<{
184
228
  component: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
185
- position: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
229
+ position: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
186
230
  message: z.ZodString;
187
231
  mentions: z.ZodOptional<z.ZodArray<z.ZodString>>;
188
232
  }, z.core.$strip>;
@@ -227,4 +271,63 @@ export declare const PluginCommentTagArgs: z.ZodObject<{
227
271
  email: z.ZodString;
228
272
  }, z.core.$strip>;
229
273
  export type PluginCommentTagArgs = z.infer<typeof PluginCommentTagArgs>;
274
+ /**
275
+ * Arguments for {@link PluginCommentApi.reply}.
276
+ *
277
+ * | Property | Type | Description |
278
+ * |---|---|---|
279
+ * | `comment` | {@link CommentHandle} | The top-level comment to reply to |
280
+ * | `text` | `string` | The reply text (emojis = unicode) |
281
+ */
282
+ export declare const PluginCommentReplyArgs: z.ZodObject<{
283
+ comment: z.ZodPipe<z.ZodString, z.ZodTransform<CommentHandle, string>>;
284
+ text: z.ZodString;
285
+ }, z.core.$strip>;
286
+ export type PluginCommentReplyArgs = z.infer<typeof PluginCommentReplyArgs>;
287
+ /**
288
+ * The author of a comment or reply — the display name and email of the teammate
289
+ * who posted it. `null` on the rare comment with no recorded author.
290
+ */
291
+ export interface PluginCommentAuthor {
292
+ /** The author's display name (falls back to their email). */
293
+ name: string;
294
+ /** The author's email. */
295
+ email: string;
296
+ }
297
+ /**
298
+ * One reply in a comment's thread (returned by {@link PluginCommentApi.get}).
299
+ */
300
+ export interface PluginCommentReply {
301
+ /** The reply's own {@link CommentHandle}. */
302
+ id: CommentHandle;
303
+ /** The reply text. */
304
+ content: string;
305
+ /** Who posted the reply. */
306
+ author: PluginCommentAuthor | null;
307
+ /** ISO-8601 timestamp of when the reply was posted (empty if unknown). */
308
+ createdAt: string;
309
+ }
310
+ /**
311
+ * The read model of a comment — returned by {@link PluginCommentApi.get}. The
312
+ * inverse of {@link PluginCommentApi.create}: `content`/`component`/`position`
313
+ * echo what was posted, plus the resolved state and reply `thread`.
314
+ */
315
+ export interface PluginCommentDetails {
316
+ /** The comment's {@link CommentHandle}. */
317
+ id: CommentHandle;
318
+ /** The comment text. */
319
+ content: string;
320
+ /** Who posted the comment. */
321
+ author: PluginCommentAuthor | null;
322
+ /** The pin point (engine world coordinates), or `null` if un-anchored. */
323
+ position: Vec3Components | null;
324
+ /** The component the comment is anchored to, or `null` if un-anchored. */
325
+ component: ComponentHandle | null;
326
+ /** Whether the comment has been marked resolved. */
327
+ isResolved: boolean;
328
+ /** ISO-8601 timestamp of when the comment was posted (empty if unknown). */
329
+ createdAt: string;
330
+ /** The reply thread, oldest first. Empty for a comment with no replies. */
331
+ thread: PluginCommentReply[];
332
+ }
230
333
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/comment/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAE9D;;;;;;GAMG;AACH,8BAAsB,gBAAgB;;IAGpC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,MAAM,CACpB,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,eAAe,EAC3B,QAAQ,CAAC,EAAE,UAAU,EACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,eAAe,CAAC,aAAa,CAAC;IAEjC;;;;;;;;;;;;;;;;;OAiBG;aACa,MAAM,CACpB,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,eAAe,CAAC,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;OAeG;aACa,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC;IAEzE;;;;;;;;;;;;;;;OAeG;aACa,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC;IAExE;;;;;;;;;;;;;;;;OAgBG;aACa,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC;IAE5E;;;;;;;;;;;;;;;;OAgBG;a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