@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,69 @@
1
+ import type { PluginErrorCategory, PluginErrorCode, WirePluginErrorCode } from "./codes";
2
+ import type { ErrorEnvelope } from "./envelope";
3
+ /**
4
+ * Typed error every failed plugin API call rejects with.
5
+ *
6
+ * Rehydrated client-side from the wire `ErrorEnvelope` (`fromEnvelope`) — the
7
+ * class itself never crosses the worker boundary. Branch on the stable string
8
+ * `code`; use `PluginError.is()` rather than `instanceof` (a bundled duplicate
9
+ * SDK copy breaks `instanceof`, never the brand).
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * try {
14
+ * await snaptrude.design.boolean.union(handles)
15
+ * } catch (e) {
16
+ * if (PluginError.is(e) && e.code === "RATE_LIMITED") {
17
+ * await sleep(e.details?.retryAfterMs as number)
18
+ * } else {
19
+ * throw e
20
+ * }
21
+ * }
22
+ * ```
23
+ */
24
+ export declare class PluginError extends Error {
25
+ readonly code: WirePluginErrorCode;
26
+ readonly errorId: string;
27
+ readonly details?: Record<string, unknown>;
28
+ readonly handle?: string;
29
+ readonly methodPath?: string;
30
+ readonly hint?: string;
31
+ constructor(envelope: ErrorEnvelope);
32
+ /** Canonical check — survives bundled duplicate SDK copies where `instanceof` fails. */
33
+ static is(value: unknown): value is PluginError;
34
+ /** Derived (not wire-carried) family of the code; unknown codes map to "internal". */
35
+ get category(): PluginErrorCategory;
36
+ }
37
+ export declare class PluginValidationError extends PluginError {
38
+ }
39
+ export declare class PluginNotFoundError extends PluginError {
40
+ }
41
+ export declare class PluginPermissionError extends PluginError {
42
+ }
43
+ export declare class PluginHandleError extends PluginError {
44
+ }
45
+ export declare class PluginQuotaError extends PluginError {
46
+ }
47
+ export declare class PluginTimeoutError extends PluginError {
48
+ }
49
+ export declare class PluginTransportError extends PluginError {
50
+ }
51
+ export declare class PluginLifecycleError extends PluginError {
52
+ }
53
+ export declare class PluginExecutionError extends PluginError {
54
+ }
55
+ export declare class PluginInternalError extends PluginError {
56
+ }
57
+ /**
58
+ * Rehydrate a wire envelope into the typed error the plugin catches.
59
+ * A code outside the known union (newer host) constructs the base
60
+ * `PluginError` with the code preserved verbatim.
61
+ */
62
+ export declare function fromEnvelope(envelope: ErrorEnvelope): PluginError;
63
+ /**
64
+ * Build an envelope for a CLIENT-detected failure (transport rejection,
65
+ * legacy host without `errorInfo`). Host-originated envelopes are built by
66
+ * the host's `toErrorEnvelope` mapper, never by this.
67
+ */
68
+ export declare function makeClientEnvelope(code: PluginErrorCode, message: string, extra?: Partial<Pick<ErrorEnvelope, "details" | "handle" | "methodPath" | "hint">>): ErrorEnvelope;
69
+ //# sourceMappingURL=plugin-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-error.d.ts","sourceRoot":"","sources":["../../src/errors/plugin-error.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAExF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAc/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;gBAEV,QAAQ,EAAE,aAAa;IAYnC,wFAAwF;IACxF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW;IAQ/C,sFAAsF;IACtF,IAAI,QAAQ,IAAI,mBAAmB,CAElC;CACF;AAID,qBAAa,qBAAsB,SAAQ,WAAW;CAAG;AACzD,qBAAa,mBAAoB,SAAQ,WAAW;CAAG;AACvD,qBAAa,qBAAsB,SAAQ,WAAW;CAAG;AACzD,qBAAa,iBAAkB,SAAQ,WAAW;CAAG;AACrD,qBAAa,gBAAiB,SAAQ,WAAW;CAAG;AACpD,qBAAa,kBAAmB,SAAQ,WAAW;CAAG;AACtD,qBAAa,oBAAqB,SAAQ,WAAW;CAAG;AACxD,qBAAa,oBAAqB,SAAQ,WAAW;CAAG;AACxD,qBAAa,oBAAqB,SAAQ,WAAW;CAAG;AACxD,qBAAa,mBAAoB,SAAQ,WAAW;CAAG;AAqBvD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,WAAW,CAIjE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC,GACjF,aAAa,CAQf"}
package/dist/handles.d.ts CHANGED
@@ -1,22 +1,57 @@
1
1
  import * as z from "zod";
2
+ import type { ArenaKind } from "./api/core/handles";
2
3
  /**
3
4
  * An opaque, kind-tagged reference to a host-side object that crosses the RPC
4
5
  * boundary by IDENTITY rather than by value. See `PLUGIN_API_EXPOSURE_HLD.md` §9.
5
6
  *
6
- * The phantom `__handle` brand makes a `Handle<"profile">` incompatible with a
7
- * `Handle<"mass">` at compile time. At runtime a handle is just a string of the
8
- * form `"<kind>_<token>"` (e.g. `"profile_k3f9a2x"`), so it is structured-clone
9
- * safe and engine-free plugin-core never imports the engine type it points at.
7
+ * A handle is a small CLASS instance wrapping the wire id. The phantom
8
+ * `__handle` brand makes a `Handle<"profile">` incompatible with a
9
+ * `Handle<"vec3">` at compile time. On the wire the id string is all that
10
+ * travels: the client SDK unwraps `Handle` arguments to `.id` before the RPC
11
+ * call, and the host tags returned handles as `{ __h: "<id>" }` (via
12
+ * {@linkcode Handle.toJSON}) for the client to re-wrap.
13
+ *
14
+ * Plugin-side lifecycle: the client SDK interns one live instance per id and
15
+ * registers it with a FinalizationRegistry — dropping every reference to a
16
+ * handle eventually releases its host registry entry. Deterministic release is
17
+ * still preferred: `core.handles.release/releaseAll` or scopes.
18
+ *
19
+ * Crossing non-RPC boundaries (UI postMessage, persistence, logging):
20
+ * send {@linkcode Handle.id} — structured clone strips the class prototype.
10
21
  */
11
- export type Handle<K extends string> = string & {
22
+ export declare class Handle<K extends string> {
23
+ readonly id: string;
24
+ /** Phantom brand — keeps `Handle<"vec3">` ≠ `Handle<"mass">` at compile time. */
12
25
  readonly __handle: K;
13
- };
26
+ constructor(id: string);
27
+ /** Wire tag — the host's result serialization (JSON round-trip) calls this. */
28
+ toJSON(): {
29
+ __h: string;
30
+ };
31
+ /** Template-string / logging form stays the bare id. */
32
+ toString(): string;
33
+ /** Identity comparison by id — safe across re-wraps. */
34
+ equals(other: Handle<string>): boolean;
35
+ /**
36
+ * Explicit-resource-management hook (`await using`). A no-op here; the
37
+ * plugin-client runtime installs the real enqueue-release behavior on the
38
+ * interned instance.
39
+ */
40
+ [Symbol.asyncDispose](): Promise<void>;
41
+ }
42
+ /** Union of all releasable (arena-backed) handle kinds. */
43
+ export type AnyArenaHandle = Handle<ArenaKind>;
14
44
  /**
15
45
  * A scene-entity handle. Backed by the host `Component.id` and resolved live via
16
46
  * the host scene index (StructureCollection) — never stored in the resource
17
47
  * registry. Stable across undo/redo and persistable across sessions (§9.2).
48
+ * Entity handles remain raw branded STRINGS (not {@linkcode Handle} instances):
49
+ * they have no arena entry, no lifecycle, and are equality-matched against
50
+ * plain ids embedded in result records.
18
51
  */
19
- export type EntityId<K extends string = string> = Handle<K>;
52
+ export type EntityId<K extends string = string> = string & {
53
+ readonly __handle: K;
54
+ };
20
55
  /** Resource handle: a host-resident, session-ephemeral geometry object (§9.2). */
21
56
  export type ProfileHandle = Handle<"profile">;
22
57
  /** Resource handle: a host-resident contour (outer profile + hole profiles). */
@@ -40,6 +75,31 @@ export type ComponentHandle = EntityId<"component">;
40
75
  * Project-scoped, not a scene entity.
41
76
  */
42
77
  export type MaterialHandle = EntityId<"material">;
78
+ /**
79
+ * A placed **scene underlay** — an imported reference plane the user traces over:
80
+ * an image `FloorPlan`, a `PDF` overlay, or a `CAD` sketch. Entity-style: the token
81
+ * IS the raw `Component.id` (`fp_…` / a pdf id / `cad_…`). Resolved live host-side
82
+ * via the import-order layer walk (`collectStoreyImportItems`) — NOT via
83
+ * `ComponentUtility.FindComponentById`, which does not index underlays. No arena, no
84
+ * quota, stable across undo/redo. Returned by `core.io.import.{image,pdf,cadJson}`
85
+ * and consumed by every `core.io.underlay.*` method.
86
+ */
87
+ export type UnderlayHandle = EntityId<"underlay">;
88
+ /**
89
+ * The project's **site terrain** — a Mapbox-derived topography mesh. Entity-style
90
+ * and a project **singleton** (one terrain per project): the token is the terrain
91
+ * `Component.id` (`terrain-…`), resolved live via `TerrainOperations.getTerrain()`
92
+ * (absent from the level component collections, so NOT `FindComponentById`).
93
+ * Returned by `core.io.import.terrain`.
94
+ */
95
+ export type TerrainHandle = EntityId<"terrain">;
96
+ /**
97
+ * A handle to an **asynchronous import job** (today: a DWG → Forge conversion, which
98
+ * can take minutes). Returned immediately by `core.io.import.dwg`; poll it via
99
+ * `core.io.job.*` (`getStatus` / `isComplete` / `getResult` / `getError`). The token
100
+ * is the engine's import request id; job state lives in a host-side registry.
101
+ */
102
+ export type ImportJobHandle = EntityId<"importJob">;
43
103
  export type Vec3Handle = Handle<"vec3">;
44
104
  export type QuatHandle = Handle<"quat">;
45
105
  export type LineHandle = Handle<"line">;
@@ -83,14 +143,18 @@ export type BBoxComponents = {
83
143
  };
84
144
  /**
85
145
  * Build a Zod schema validating a handle of the given `kind` at the trust
86
- * boundary. It checks only the `"<kind>_"` prefix shape; existence, kind, and
87
- * ownership are enforced host-side by the HandleRegistry (§9.7). Keeping it to
88
- * the prefix is engine-free and avoids an existence oracle.
146
+ * boundary and emitting a {@linkcode Handle} instance for impl code. Inbound
147
+ * forms accepted:
148
+ * - the bare id string (the wire form the client unwraps args to ids)
149
+ * - a live `Handle` instance (host-internal re-parse, direct host callers)
150
+ * - `{ __h: string }` (the tagged result form, echoed back as an arg)
151
+ * - `{ id: string }` (a Handle stripped by structured clone at the UI boundary)
152
+ * Shape checking stays prefix-only; existence, kind, and ownership are enforced
153
+ * host-side by the HandleRegistry (§9.7) — no existence oracle.
89
154
  */
90
- export declare const handleSchema: <K extends string>(kind: K) => z.ZodPipe<z.ZodString, z.ZodTransform<Handle<K>, string>>;
91
- export declare const ProfileHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"profile">, string>>;
92
- export declare const ContourHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"contour">, string>>;
93
- export declare const MassHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"mass">, string>>;
155
+ export declare const handleSchema: <K extends string>(kind: K) => z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<K>, string>>;
156
+ export declare const ProfileHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"profile">, string>>;
157
+ export declare const ContourHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"contour">, string>>;
94
158
  /**
95
159
  * Entity handles are raw `Component.id` strings (no `"<kind>_"` prefix) — validated
96
160
  * only as a non-empty string, resolved live via the scene index host-side.
@@ -101,17 +165,25 @@ export declare const ComponentHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Comp
101
165
  * prefix) — validated only as non-empty, resolved live via `scene.getMaterialByName`.
102
166
  */
103
167
  export declare const MaterialHandle: z.ZodPipe<z.ZodString, z.ZodTransform<MaterialHandle, string>>;
104
- export declare const Vec3Handle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"vec3">, string>>;
105
- export declare const QuatHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"quat">, string>>;
106
- export declare const LineHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"line">, string>>;
107
- export declare const ArcHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"arc">, string>>;
108
- export declare const CurveHandle: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"line">, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"arc">, string>>]>;
109
- export declare const CircleHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"circle">, string>>;
110
- export declare const BrepHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"brep">, string>>;
111
- export declare const FaceHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"face">, string>>;
112
- export declare const EdgeHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"edge">, string>>;
113
- export declare const HalfEdgeHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"halfedge">, string>>;
114
- export declare const VertexHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"vertex">, string>>;
168
+ /**
169
+ * {@linkcode UnderlayHandle} / {@linkcode TerrainHandle} / {@linkcode ImportJobHandle}
170
+ * are entity-style handles — raw host ids, validated only as a non-empty string
171
+ * (no `"<kind>_"` prefix), resolved live host-side (existence enforced there).
172
+ */
173
+ export declare const UnderlayHandle: z.ZodPipe<z.ZodString, z.ZodTransform<UnderlayHandle, string>>;
174
+ export declare const TerrainHandle: z.ZodPipe<z.ZodString, z.ZodTransform<TerrainHandle, string>>;
175
+ export declare const ImportJobHandle: z.ZodPipe<z.ZodString, z.ZodTransform<ImportJobHandle, string>>;
176
+ export declare const Vec3Handle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"vec3">, string>>;
177
+ export declare const QuatHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"quat">, string>>;
178
+ export declare const LineHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"line">, string>>;
179
+ export declare const ArcHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"arc">, string>>;
180
+ export declare const CurveHandle: z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"arc">, string>>]>;
181
+ export declare const CircleHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"circle">, string>>;
182
+ export declare const BrepHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"brep">, string>>;
183
+ export declare const FaceHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"face">, string>>;
184
+ export declare const EdgeHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"edge">, string>>;
185
+ export declare const HalfEdgeHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"halfedge">, string>>;
186
+ export declare const VertexHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"vertex">, string>>;
115
187
  export declare const Vec3Components: z.ZodObject<{
116
188
  x: z.ZodNumber;
117
189
  y: z.ZodNumber;
@@ -1 +1 @@
1
- {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB;;;;;;;;GAQG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,IAAI,MAAM,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAA;CAAE,CAAA;AAExE;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,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4
  * UnionToIntersection is a type utility that converts a union type to an intersection type.
4
5
  */
@@ -37,7 +38,10 @@ export type PluginApiCallResult<M extends PluginApiMethod> = PluginApiMethodMap[
37
38
  export type PluginApiCallWrappedResult<M extends PluginApiMethod> = {
38
39
  success: boolean;
39
40
  data?: PluginApiCallResult<M>;
41
+ /** Legacy failure message — kept verbatim for already-published plugins. */
40
42
  error?: string;
43
+ /** Structured failure (hosts ≥ error-envelope rollout). Present iff `success` is false. */
44
+ errorInfo?: ErrorEnvelope;
41
45
  };
42
46
  export {};
43
47
  //# sourceMappingURL=host-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"host-utils.d.ts","sourceRoot":"","sources":["../src/host-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC;;GAEG;AACH,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,SAAS,CAC7E,CAAC,EAAE,MAAM,CAAC,KACP,IAAI,GACL,CAAC,GACD,KAAK,CAAA;AAET,KAAK,OAAO,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAA;AAE1C;;;GAGG;AACH,KAAK,UAAU,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAA;AAElE,KAAK,YAAY,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;AAE7E;;;GAGG;AACH,KAAK,kBAAkB,CAAC,CAAC,EAAE,MAAM,SAAS,MAAM,GAAG,EAAE,IAAI;KACtD,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,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