@snaptrude/plugin-core 0.0.0-bimsvg-20260928124803

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 (383) hide show
  1. package/AGENTS.md +231 -0
  2. package/CHANGELOG.md +341 -0
  3. package/CLAUDE.md +11 -0
  4. package/api-manifest.json +9120 -0
  5. package/dist/api/analysis/daylight.d.ts +603 -0
  6. package/dist/api/analysis/daylight.d.ts.map +1 -0
  7. package/dist/api/analysis/heatmaps.d.ts +658 -0
  8. package/dist/api/analysis/heatmaps.d.ts.map +1 -0
  9. package/dist/api/analysis/illuminance.d.ts +145 -0
  10. package/dist/api/analysis/illuminance.d.ts.map +1 -0
  11. package/dist/api/analysis/index.d.ts +59 -0
  12. package/dist/api/analysis/index.d.ts.map +1 -0
  13. package/dist/api/analysis/shadows.d.ts +165 -0
  14. package/dist/api/analysis/shadows.d.ts.map +1 -0
  15. package/dist/api/analysis/solar.d.ts +249 -0
  16. package/dist/api/analysis/solar.d.ts.map +1 -0
  17. package/dist/api/analysis/sunlightHours.d.ts +208 -0
  18. package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
  19. package/dist/api/analysis/sunpath.d.ts +80 -0
  20. package/dist/api/analysis/sunpath.d.ts.map +1 -0
  21. package/dist/api/analysis/weather.d.ts +193 -0
  22. package/dist/api/analysis/weather.d.ts.map +1 -0
  23. package/dist/api/core/buildings.d.ts +427 -0
  24. package/dist/api/core/buildings.d.ts.map +1 -0
  25. package/dist/api/core/camera/index.d.ts +261 -0
  26. package/dist/api/core/camera/index.d.ts.map +1 -0
  27. package/dist/api/core/comment/index.d.ts +333 -0
  28. package/dist/api/core/comment/index.d.ts.map +1 -0
  29. package/dist/api/core/geom/create/index.d.ts +1073 -0
  30. package/dist/api/core/geom/create/index.d.ts.map +1 -0
  31. package/dist/api/core/geom/delete/index.d.ts +78 -0
  32. package/dist/api/core/geom/delete/index.d.ts.map +1 -0
  33. package/dist/api/core/geom/index.d.ts +33 -0
  34. package/dist/api/core/geom/index.d.ts.map +1 -0
  35. package/dist/api/core/geom/query/arc.d.ts +169 -0
  36. package/dist/api/core/geom/query/arc.d.ts.map +1 -0
  37. package/dist/api/core/geom/query/brep.d.ts +514 -0
  38. package/dist/api/core/geom/query/brep.d.ts.map +1 -0
  39. package/dist/api/core/geom/query/circle.d.ts +378 -0
  40. package/dist/api/core/geom/query/circle.d.ts.map +1 -0
  41. package/dist/api/core/geom/query/contour.d.ts +450 -0
  42. package/dist/api/core/geom/query/contour.d.ts.map +1 -0
  43. package/dist/api/core/geom/query/curve.d.ts +918 -0
  44. package/dist/api/core/geom/query/curve.d.ts.map +1 -0
  45. package/dist/api/core/geom/query/edge.d.ts +128 -0
  46. package/dist/api/core/geom/query/edge.d.ts.map +1 -0
  47. package/dist/api/core/geom/query/face.d.ts +363 -0
  48. package/dist/api/core/geom/query/face.d.ts.map +1 -0
  49. package/dist/api/core/geom/query/halfedge.d.ts +206 -0
  50. package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
  51. package/dist/api/core/geom/query/index.d.ts +61 -0
  52. package/dist/api/core/geom/query/index.d.ts.map +1 -0
  53. package/dist/api/core/geom/query/profile.d.ts +410 -0
  54. package/dist/api/core/geom/query/profile.d.ts.map +1 -0
  55. package/dist/api/core/geom/query/vertex.d.ts +187 -0
  56. package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
  57. package/dist/api/core/geom/update/contour.d.ts +272 -0
  58. package/dist/api/core/geom/update/contour.d.ts.map +1 -0
  59. package/dist/api/core/geom/update/curve.d.ts +180 -0
  60. package/dist/api/core/geom/update/curve.d.ts.map +1 -0
  61. package/dist/api/core/geom/update/index.d.ts +27 -0
  62. package/dist/api/core/geom/update/index.d.ts.map +1 -0
  63. package/dist/api/core/geom/update/profile.d.ts +329 -0
  64. package/dist/api/core/geom/update/profile.d.ts.map +1 -0
  65. package/dist/api/core/groups.d.ts +485 -0
  66. package/dist/api/core/groups.d.ts.map +1 -0
  67. package/dist/api/core/handles/index.d.ts +210 -0
  68. package/dist/api/core/handles/index.d.ts.map +1 -0
  69. package/dist/api/core/history/index.d.ts +78 -0
  70. package/dist/api/core/history/index.d.ts.map +1 -0
  71. package/dist/api/core/index.d.ts +97 -0
  72. package/dist/api/core/index.d.ts.map +1 -0
  73. package/dist/api/core/io/export/index.d.ts +134 -0
  74. package/dist/api/core/io/export/index.d.ts.map +1 -0
  75. package/dist/api/core/io/import/index.d.ts +455 -0
  76. package/dist/api/core/io/import/index.d.ts.map +1 -0
  77. package/dist/api/core/io/index.d.ts +40 -0
  78. package/dist/api/core/io/index.d.ts.map +1 -0
  79. package/dist/api/core/io/job/index.d.ts +139 -0
  80. package/dist/api/core/io/job/index.d.ts.map +1 -0
  81. package/dist/api/core/io/query/index.d.ts +74 -0
  82. package/dist/api/core/io/query/index.d.ts.map +1 -0
  83. package/dist/api/core/io/terrain/index.d.ts +341 -0
  84. package/dist/api/core/io/terrain/index.d.ts.map +1 -0
  85. package/dist/api/core/io/underlay/index.d.ts +805 -0
  86. package/dist/api/core/io/underlay/index.d.ts.map +1 -0
  87. package/dist/api/core/layers.d.ts +402 -0
  88. package/dist/api/core/layers.d.ts.map +1 -0
  89. package/dist/api/core/math/index.d.ts +18 -0
  90. package/dist/api/core/math/index.d.ts.map +1 -0
  91. package/dist/api/core/math/quat.d.ts +170 -0
  92. package/dist/api/core/math/quat.d.ts.map +1 -0
  93. package/dist/api/core/math/vec3.d.ts +174 -0
  94. package/dist/api/core/math/vec3.d.ts.map +1 -0
  95. package/dist/api/core/mode/index.d.ts +111 -0
  96. package/dist/api/core/mode/index.d.ts.map +1 -0
  97. package/dist/api/core/project/index.d.ts +466 -0
  98. package/dist/api/core/project/index.d.ts.map +1 -0
  99. package/dist/api/core/proposals/index.d.ts +531 -0
  100. package/dist/api/core/proposals/index.d.ts.map +1 -0
  101. package/dist/api/core/storeys/index.d.ts +265 -0
  102. package/dist/api/core/storeys/index.d.ts.map +1 -0
  103. package/dist/api/core/tags.d.ts +860 -0
  104. package/dist/api/core/tags.d.ts.map +1 -0
  105. package/dist/api/core/units/index.d.ts +175 -0
  106. package/dist/api/core/units/index.d.ts.map +1 -0
  107. package/dist/api/core/user.d.ts +44 -0
  108. package/dist/api/core/user.d.ts.map +1 -0
  109. package/dist/api/core/zoom/index.d.ts +49 -0
  110. package/dist/api/core/zoom/index.d.ts.map +1 -0
  111. package/dist/api/design/boolean/index.d.ts +168 -0
  112. package/dist/api/design/boolean/index.d.ts.map +1 -0
  113. package/dist/api/design/create/bulk-items.d.ts +185 -0
  114. package/dist/api/design/create/bulk-items.d.ts.map +1 -0
  115. package/dist/api/design/create/grids.d.ts +132 -0
  116. package/dist/api/design/create/grids.d.ts.map +1 -0
  117. package/dist/api/design/create/index.d.ts +1747 -0
  118. package/dist/api/design/create/index.d.ts.map +1 -0
  119. package/dist/api/design/create/opening-fields.d.ts +37 -0
  120. package/dist/api/design/create/opening-fields.d.ts.map +1 -0
  121. package/dist/api/design/delete/index.d.ts +70 -0
  122. package/dist/api/design/delete/index.d.ts.map +1 -0
  123. package/dist/api/design/dimensions.d.ts +427 -0
  124. package/dist/api/design/dimensions.d.ts.map +1 -0
  125. package/dist/api/design/doors/index.d.ts +470 -0
  126. package/dist/api/design/doors/index.d.ts.map +1 -0
  127. package/dist/api/design/edit/index.d.ts +49 -0
  128. package/dist/api/design/edit/index.d.ts.map +1 -0
  129. package/dist/api/design/erase/index.d.ts +160 -0
  130. package/dist/api/design/erase/index.d.ts.map +1 -0
  131. package/dist/api/design/family.d.ts +611 -0
  132. package/dist/api/design/family.d.ts.map +1 -0
  133. package/dist/api/design/furniture/index.d.ts +296 -0
  134. package/dist/api/design/furniture/index.d.ts.map +1 -0
  135. package/dist/api/design/grids.d.ts +237 -0
  136. package/dist/api/design/grids.d.ts.map +1 -0
  137. package/dist/api/design/index.d.ts +260 -0
  138. package/dist/api/design/index.d.ts.map +1 -0
  139. package/dist/api/design/lock.d.ts +67 -0
  140. package/dist/api/design/lock.d.ts.map +1 -0
  141. package/dist/api/design/materials/index.d.ts +551 -0
  142. package/dist/api/design/materials/index.d.ts.map +1 -0
  143. package/dist/api/design/query/geometry/index.d.ts +252 -0
  144. package/dist/api/design/query/geometry/index.d.ts.map +1 -0
  145. package/dist/api/design/query/grids.d.ts +287 -0
  146. package/dist/api/design/query/grids.d.ts.map +1 -0
  147. package/dist/api/design/query/index.d.ts +1318 -0
  148. package/dist/api/design/query/index.d.ts.map +1 -0
  149. package/dist/api/design/query/referenceLines.d.ts +45 -0
  150. package/dist/api/design/query/referenceLines.d.ts.map +1 -0
  151. package/dist/api/design/query/spaces.d.ts +394 -0
  152. package/dist/api/design/query/spaces.d.ts.map +1 -0
  153. package/dist/api/design/selection/index.d.ts +282 -0
  154. package/dist/api/design/selection/index.d.ts.map +1 -0
  155. package/dist/api/design/shared.d.ts +38 -0
  156. package/dist/api/design/shared.d.ts.map +1 -0
  157. package/dist/api/design/transform/index.d.ts +249 -0
  158. package/dist/api/design/transform/index.d.ts.map +1 -0
  159. package/dist/api/design/types/index.d.ts +181 -0
  160. package/dist/api/design/types/index.d.ts.map +1 -0
  161. package/dist/api/design/update/index.d.ts +803 -0
  162. package/dist/api/design/update/index.d.ts.map +1 -0
  163. package/dist/api/design/visibility.d.ts +126 -0
  164. package/dist/api/design/visibility.d.ts.map +1 -0
  165. package/dist/api/design/windows/index.d.ts +300 -0
  166. package/dist/api/design/windows/index.d.ts.map +1 -0
  167. package/dist/api/entity/buildableEnvelope.d.ts +265 -0
  168. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
  169. package/dist/api/entity/department.d.ts +1 -0
  170. package/dist/api/entity/department.d.ts.map +1 -0
  171. package/dist/api/entity/index.d.ts +28 -0
  172. package/dist/api/entity/index.d.ts.map +1 -0
  173. package/dist/api/entity/referenceLine.d.ts +210 -0
  174. package/dist/api/entity/referenceLine.d.ts.map +1 -0
  175. package/dist/api/entity/space.d.ts +846 -0
  176. package/dist/api/entity/space.d.ts.map +1 -0
  177. package/dist/api/entity/story.d.ts +476 -0
  178. package/dist/api/entity/story.d.ts.map +1 -0
  179. package/dist/api/index.d.ts +45 -0
  180. package/dist/api/index.d.ts.map +1 -0
  181. package/dist/api/presentation/aiInspiration.d.ts +2400 -0
  182. package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
  183. package/dist/api/presentation/annotate.d.ts +483 -0
  184. package/dist/api/presentation/annotate.d.ts.map +1 -0
  185. package/dist/api/presentation/diagrams.d.ts +184 -0
  186. package/dist/api/presentation/diagrams.d.ts.map +1 -0
  187. package/dist/api/presentation/drawings.d.ts +2900 -0
  188. package/dist/api/presentation/drawings.d.ts.map +1 -0
  189. package/dist/api/presentation/export.d.ts +126 -0
  190. package/dist/api/presentation/export.d.ts.map +1 -0
  191. package/dist/api/presentation/import.d.ts +164 -0
  192. package/dist/api/presentation/import.d.ts.map +1 -0
  193. package/dist/api/presentation/index.d.ts +114 -0
  194. package/dist/api/presentation/index.d.ts.map +1 -0
  195. package/dist/api/presentation/placedViews.d.ts +1232 -0
  196. package/dist/api/presentation/placedViews.d.ts.map +1 -0
  197. package/dist/api/presentation/shapes.d.ts +481 -0
  198. package/dist/api/presentation/shapes.d.ts.map +1 -0
  199. package/dist/api/presentation/sheets.d.ts +643 -0
  200. package/dist/api/presentation/sheets.d.ts.map +1 -0
  201. package/dist/api/presentation/slideshow.d.ts +125 -0
  202. package/dist/api/presentation/slideshow.d.ts.map +1 -0
  203. package/dist/api/presentation/tables.d.ts +81 -0
  204. package/dist/api/presentation/tables.d.ts.map +1 -0
  205. package/dist/api/presentation/viewPresets.d.ts +70 -0
  206. package/dist/api/presentation/viewPresets.d.ts.map +1 -0
  207. package/dist/api/presentation/views.d.ts +741 -0
  208. package/dist/api/presentation/views.d.ts.map +1 -0
  209. package/dist/api/program/adjacency.d.ts +155 -0
  210. package/dist/api/program/adjacency.d.ts.map +1 -0
  211. package/dist/api/program/areas.d.ts +450 -0
  212. package/dist/api/program/areas.d.ts.map +1 -0
  213. package/dist/api/program/classification.d.ts +135 -0
  214. package/dist/api/program/classification.d.ts.map +1 -0
  215. package/dist/api/program/cores.d.ts +78 -0
  216. package/dist/api/program/cores.d.ts.map +1 -0
  217. package/dist/api/program/departments.d.ts +487 -0
  218. package/dist/api/program/departments.d.ts.map +1 -0
  219. package/dist/api/program/index.d.ts +71 -0
  220. package/dist/api/program/index.d.ts.map +1 -0
  221. package/dist/api/program/labels.d.ts +355 -0
  222. package/dist/api/program/labels.d.ts.map +1 -0
  223. package/dist/api/program/layout.d.ts +398 -0
  224. package/dist/api/program/layout.d.ts.map +1 -0
  225. package/dist/api/program/metadata.d.ts +328 -0
  226. package/dist/api/program/metadata.d.ts.map +1 -0
  227. package/dist/api/program/metrics.d.ts +108 -0
  228. package/dist/api/program/metrics.d.ts.map +1 -0
  229. package/dist/api/program/site.d.ts +823 -0
  230. package/dist/api/program/site.d.ts.map +1 -0
  231. package/dist/api/program/spreadsheet.d.ts +2628 -0
  232. package/dist/api/program/spreadsheet.d.ts.map +1 -0
  233. package/dist/api/workspace/index.d.ts +552 -0
  234. package/dist/api/workspace/index.d.ts.map +1 -0
  235. package/dist/errors/codes.d.ts +34 -0
  236. package/dist/errors/codes.d.ts.map +1 -0
  237. package/dist/errors/envelope.d.ts +56 -0
  238. package/dist/errors/envelope.d.ts.map +1 -0
  239. package/dist/errors/index.d.ts +6 -0
  240. package/dist/errors/index.d.ts.map +1 -0
  241. package/dist/errors/plugin-error.d.ts +69 -0
  242. package/dist/errors/plugin-error.d.ts.map +1 -0
  243. package/dist/handles.d.ts +229 -0
  244. package/dist/handles.d.ts.map +1 -0
  245. package/dist/host-utils.d.ts +47 -0
  246. package/dist/host-utils.d.ts.map +1 -0
  247. package/dist/index.cjs +8836 -0
  248. package/dist/index.cjs.map +1 -0
  249. package/dist/index.d.ts +6 -0
  250. package/dist/index.d.ts.map +1 -0
  251. package/dist/index.js +7568 -0
  252. package/dist/index.js.map +1 -0
  253. package/dist/types.d.ts +16 -0
  254. package/dist/types.d.ts.map +1 -0
  255. package/package.json +41 -0
  256. package/scripts/generate-manifest.mjs +238 -0
  257. package/scripts/generate-manifest.test.mjs +292 -0
  258. package/src/api/analysis/daylight.ts +470 -0
  259. package/src/api/analysis/heatmaps.ts +683 -0
  260. package/src/api/analysis/illuminance.ts +155 -0
  261. package/src/api/analysis/index.ts +61 -0
  262. package/src/api/analysis/shadows.ts +183 -0
  263. package/src/api/analysis/solar.ts +237 -0
  264. package/src/api/analysis/sunlightHours.ts +211 -0
  265. package/src/api/analysis/sunpath.ts +83 -0
  266. package/src/api/analysis/weather.ts +179 -0
  267. package/src/api/core/buildings.ts +485 -0
  268. package/src/api/core/camera/index.ts +268 -0
  269. package/src/api/core/comment/index.ts +376 -0
  270. package/src/api/core/geom/create/index.ts +1204 -0
  271. package/src/api/core/geom/delete/index.ts +84 -0
  272. package/src/api/core/geom/index.ts +35 -0
  273. package/src/api/core/geom/query/arc.ts +169 -0
  274. package/src/api/core/geom/query/brep.ts +563 -0
  275. package/src/api/core/geom/query/circle.ts +404 -0
  276. package/src/api/core/geom/query/contour.ts +540 -0
  277. package/src/api/core/geom/query/curve.ts +1078 -0
  278. package/src/api/core/geom/query/edge.ts +130 -0
  279. package/src/api/core/geom/query/face.ts +403 -0
  280. package/src/api/core/geom/query/halfedge.ts +210 -0
  281. package/src/api/core/geom/query/index.ts +63 -0
  282. package/src/api/core/geom/query/profile.ts +473 -0
  283. package/src/api/core/geom/query/vertex.ts +205 -0
  284. package/src/api/core/geom/update/contour.ts +315 -0
  285. package/src/api/core/geom/update/curve.ts +209 -0
  286. package/src/api/core/geom/update/index.ts +29 -0
  287. package/src/api/core/geom/update/profile.ts +377 -0
  288. package/src/api/core/groups.ts +521 -0
  289. package/src/api/core/handles/index.ts +233 -0
  290. package/src/api/core/history/index.ts +84 -0
  291. package/src/api/core/index.ts +99 -0
  292. package/src/api/core/io/export/index.ts +126 -0
  293. package/src/api/core/io/import/index.ts +504 -0
  294. package/src/api/core/io/index.ts +42 -0
  295. package/src/api/core/io/job/index.ts +140 -0
  296. package/src/api/core/io/query/index.ts +71 -0
  297. package/src/api/core/io/terrain/index.ts +360 -0
  298. package/src/api/core/io/underlay/index.ts +705 -0
  299. package/src/api/core/layers.ts +333 -0
  300. package/src/api/core/math/index.ts +20 -0
  301. package/src/api/core/math/quat.ts +172 -0
  302. package/src/api/core/math/vec3.ts +179 -0
  303. package/src/api/core/mode/index.ts +108 -0
  304. package/src/api/core/project/index.ts +479 -0
  305. package/src/api/core/proposals/index.ts +569 -0
  306. package/src/api/core/storeys/index.ts +294 -0
  307. package/src/api/core/tags.ts +911 -0
  308. package/src/api/core/units/index.ts +164 -0
  309. package/src/api/core/user.ts +46 -0
  310. package/src/api/core/zoom/index.ts +51 -0
  311. package/src/api/design/boolean/index.ts +179 -0
  312. package/src/api/design/create/bulk-items.ts +186 -0
  313. package/src/api/design/create/grids.ts +137 -0
  314. package/src/api/design/create/index.ts +1954 -0
  315. package/src/api/design/create/opening-fields.ts +37 -0
  316. package/src/api/design/delete/index.ts +74 -0
  317. package/src/api/design/dimensions.ts +453 -0
  318. package/src/api/design/doors/index.ts +500 -0
  319. package/src/api/design/edit/index.ts +54 -0
  320. package/src/api/design/erase/index.ts +151 -0
  321. package/src/api/design/family.ts +646 -0
  322. package/src/api/design/furniture/index.ts +319 -0
  323. package/src/api/design/grids.ts +237 -0
  324. package/src/api/design/index.ts +274 -0
  325. package/src/api/design/lock.ts +69 -0
  326. package/src/api/design/materials/index.ts +608 -0
  327. package/src/api/design/query/geometry/index.ts +288 -0
  328. package/src/api/design/query/grids.ts +197 -0
  329. package/src/api/design/query/index.ts +1176 -0
  330. package/src/api/design/query/referenceLines.ts +52 -0
  331. package/src/api/design/query/spaces.ts +275 -0
  332. package/src/api/design/selection/index.ts +273 -0
  333. package/src/api/design/shared.ts +40 -0
  334. package/src/api/design/transform/index.ts +254 -0
  335. package/src/api/design/types/index.ts +156 -0
  336. package/src/api/design/update/index.ts +798 -0
  337. package/src/api/design/visibility.ts +143 -0
  338. package/src/api/design/windows/index.ts +333 -0
  339. package/src/api/entity/buildableEnvelope.ts +322 -0
  340. package/src/api/entity/department.ts +0 -0
  341. package/src/api/entity/index.ts +30 -0
  342. package/src/api/entity/referenceLine.ts +235 -0
  343. package/src/api/entity/space.ts +612 -0
  344. package/src/api/entity/story.ts +517 -0
  345. package/src/api/index.ts +47 -0
  346. package/src/api/presentation/aiInspiration.ts +1116 -0
  347. package/src/api/presentation/annotate.ts +417 -0
  348. package/src/api/presentation/diagrams.ts +194 -0
  349. package/src/api/presentation/drawings.ts +529 -0
  350. package/src/api/presentation/export.ts +133 -0
  351. package/src/api/presentation/import.ts +159 -0
  352. package/src/api/presentation/index.ts +129 -0
  353. package/src/api/presentation/placedViews.ts +1203 -0
  354. package/src/api/presentation/shapes.ts +274 -0
  355. package/src/api/presentation/sheets.ts +616 -0
  356. package/src/api/presentation/slideshow.ts +134 -0
  357. package/src/api/presentation/tables.ts +84 -0
  358. package/src/api/presentation/viewPresets.ts +83 -0
  359. package/src/api/presentation/views.ts +698 -0
  360. package/src/api/program/adjacency.ts +164 -0
  361. package/src/api/program/areas.ts +408 -0
  362. package/src/api/program/classification.ts +138 -0
  363. package/src/api/program/cores.ts +83 -0
  364. package/src/api/program/departments.ts +517 -0
  365. package/src/api/program/index.ts +73 -0
  366. package/src/api/program/labels.ts +332 -0
  367. package/src/api/program/layout.ts +422 -0
  368. package/src/api/program/metadata.ts +364 -0
  369. package/src/api/program/metrics.ts +120 -0
  370. package/src/api/program/site.ts +748 -0
  371. package/src/api/program/spreadsheet.ts +2698 -0
  372. package/src/api/workspace/index.ts +612 -0
  373. package/src/errors/codes.ts +136 -0
  374. package/src/errors/envelope.ts +75 -0
  375. package/src/errors/index.ts +21 -0
  376. package/src/errors/plugin-error.ts +134 -0
  377. package/src/handles.ts +282 -0
  378. package/src/host-utils.ts +68 -0
  379. package/src/index.ts +5 -0
  380. package/src/types.ts +16 -0
  381. package/test/errors.test.mjs +184 -0
  382. package/tsconfig.json +22 -0
  383. package/tsup.config.ts +12 -0
@@ -0,0 +1,911 @@
1
+ import * as z from "zod"
2
+ import { PluginApiReturn } from "../../types"
3
+ import { ComponentHandle } from "../../handles"
4
+
5
+ /**
6
+ * Tags — read and edit the tag catalog and its assignments.
7
+ *
8
+ * A **tag** is a colored label that lives in a **category**; a space carries at
9
+ * most one tag per category. This namespace is the catalog + assignment surface:
10
+ * the categories and tags themselves, which components carry which tags, and the
11
+ * assign/unassign operations. Tags attach to **Mass and Floor spaces only**.
12
+ *
13
+ * **Reserved sentinels.** The built-in **`DEPARTMENT`** category is owned by the
14
+ * program layer — it and the tags inside it are read-only here; create/update/
15
+ * delete reject it and direct you to {@linkcode PluginProgramApi}`.departments`.
16
+ * Every category also has a built-in **`DEFAULT`** tag that cannot be deleted;
17
+ * unassigning resets a component's category slot back to `DEFAULT` (a component
18
+ * is never left with a blank slot).
19
+ *
20
+ * Reads return plain records and never throw for a miss (`get*` return `null`,
21
+ * `list*` return `[]`). Ids are stable public strings.
22
+ *
23
+ * Sub-namespace members typed as optional (`?`) are **authored ahead of the
24
+ * host** — declared so plugins and codegen can see the shape, but kept out of the
25
+ * discovery manifest until the host lands them (at which point they are promoted
26
+ * to required `abstract` members).
27
+ *
28
+ * Accessed via `snaptrude.core.tags`.
29
+ */
30
+ export abstract class PluginCoreTagsApi {
31
+ constructor() {}
32
+
33
+ /**
34
+ * List the tag categories.
35
+ *
36
+ * @returns A {@linkcode PluginCoreTagsListCategoriesResult} with a `categories`
37
+ * array (empty when there are none), including the reserved `DEPARTMENT`
38
+ * category.
39
+ *
40
+ * @examplePrompt List all the tag categories
41
+ * @examplePrompt What tag categories do I have?
42
+ * @examplePrompt Show every category and its tags
43
+ *
44
+ * # Example
45
+ * ```ts
46
+ * const { categories } = await snaptrude.core.tags.listCategories()
47
+ * for (const c of categories) console.log(c.name, c.tagIds.length)
48
+ * ```
49
+ */
50
+ public abstract listCategories(): PluginApiReturn<PluginCoreTagsListCategoriesResult>
51
+
52
+ /**
53
+ * Get a single tag category by id.
54
+ *
55
+ * @param categoryId - The id of the category to read.
56
+ * @returns The matching {@linkcode PluginCoreTagCategory}, or `null` if no
57
+ * category has that id.
58
+ *
59
+ * @examplePrompt Get the tag category with id cat_3
60
+ * @examplePrompt Look up a category by its id
61
+ * @examplePrompt Which tags are in this category?
62
+ *
63
+ * # Example
64
+ * ```ts
65
+ * const category = await snaptrude.core.tags.getCategory("cat_3")
66
+ * if (category) console.log(category.name, category.tagIds)
67
+ * ```
68
+ */
69
+ public abstract getCategory(
70
+ categoryId: string,
71
+ ): PluginApiReturn<PluginCoreTagsGetCategoryResult>
72
+
73
+ /**
74
+ * List tags, optionally within one category.
75
+ *
76
+ * @param categoryId - Optional category filter; omit to list every tag.
77
+ * @returns A {@linkcode PluginCoreTagsListResult} with a `tags` array (empty
78
+ * when there are none).
79
+ *
80
+ * @examplePrompt List every tag in the project
81
+ * @examplePrompt Show the tags in category cat_3
82
+ * @examplePrompt What tags are available?
83
+ *
84
+ * # Example
85
+ * ```ts
86
+ * const { tags } = await snaptrude.core.tags.list("cat_3")
87
+ * for (const t of tags) console.log(t.name, t.color)
88
+ * ```
89
+ */
90
+ public abstract list(
91
+ categoryId?: string,
92
+ ): PluginApiReturn<PluginCoreTagsListResult>
93
+
94
+ /**
95
+ * Get a single tag by id.
96
+ *
97
+ * @param tagId - The id of the tag to read.
98
+ * @returns The matching {@linkcode PluginCoreTag}, or `null` if no tag has that
99
+ * id.
100
+ *
101
+ * @examplePrompt Get the tag with id tag_9
102
+ * @examplePrompt Look up a single tag by its id
103
+ * @examplePrompt What color is this tag?
104
+ *
105
+ * # Example
106
+ * ```ts
107
+ * const tag = await snaptrude.core.tags.get("tag_9")
108
+ * if (tag) console.log(tag.name, tag.color)
109
+ * ```
110
+ */
111
+ public abstract get(
112
+ tagId: string,
113
+ ): PluginApiReturn<PluginCoreTagsGetResult>
114
+
115
+ /**
116
+ * List the tags carried by a component.
117
+ *
118
+ * Returns one entry per category the component is tagged in, each carrying the
119
+ * category and tag names and the tag color.
120
+ *
121
+ * @param componentId - The `Component.id` to read.
122
+ * @returns A {@linkcode PluginCoreTagsGetTagsForComponentResult} with a `tags`
123
+ * array (empty when the component has none or does not exist).
124
+ *
125
+ * @examplePrompt What tags does this space have?
126
+ * @examplePrompt List the tags on component cmp_42
127
+ * @examplePrompt Show the labels applied to this room
128
+ *
129
+ * # Example
130
+ * ```ts
131
+ * const { tags } = await snaptrude.core.tags.getTagsForComponent("cmp_42")
132
+ * for (const t of tags) console.log(t.categoryName, t.tagName)
133
+ * ```
134
+ *
135
+ * @deprecated Use `core.tags.listForComponent`
136
+ */
137
+ public abstract getTagsForComponent(
138
+ componentId: ComponentHandle,
139
+ ): PluginApiReturn<PluginCoreTagsGetTagsForComponentResult>
140
+
141
+ /**
142
+ * List the tags carried by a component.
143
+ *
144
+ * Returns one entry per category the component is tagged in, each carrying the
145
+ * category and tag names and the tag color. Canonical home of the read formerly
146
+ * at `getTagsForComponent` (now deprecated).
147
+ *
148
+ * @param componentId - The `Component.id` to read.
149
+ * @returns A {@linkcode PluginCoreTagsGetTagsForComponentResult} with a `tags`
150
+ * array (empty when the component has none or does not exist).
151
+ *
152
+ * @examplePrompt What tags does this space have?
153
+ * @examplePrompt List the tags on component cmp_42
154
+ * @examplePrompt Show the labels applied to this room
155
+ *
156
+ * # Example
157
+ * ```ts
158
+ * const { tags } = await snaptrude.core.tags.listForComponent("cmp_42")
159
+ * for (const t of tags) console.log(t.categoryName, t.tagName)
160
+ * ```
161
+ */
162
+ public abstract listForComponent(
163
+ componentId: ComponentHandle,
164
+ ): PluginApiReturn<PluginCoreTagsGetTagsForComponentResult>
165
+
166
+ /**
167
+ * List the tags carried by many components in one call.
168
+ *
169
+ * The plural of {@linkcode PluginCoreTagsApi.listForComponent}: pass
170
+ * `componentIds` to read specific components (unknown ids are skipped), or
171
+ * omit it to read **every** taggable component (Mass/Floor space) in the
172
+ * project. Each entry carries the component id and its tags — one per tagged
173
+ * category, with the tag's `color` — so a plugin can color every space by a
174
+ * chosen category's tag in a single round-trip.
175
+ *
176
+ * @param componentIds - Optional `Component.id`s to read; omit for all spaces.
177
+ * @returns A {@linkcode PluginCoreTagsListForComponentsResult} with a
178
+ * `components` array, one entry per component (in input order when
179
+ * `componentIds` is given).
180
+ *
181
+ * @performance One round-trip for any number of components — use this instead of a `listForComponent` loop.
182
+ *
183
+ * @examplePrompt Get the tags of every space with their colors
184
+ * @examplePrompt List the tags on all rooms so I can color them by Occupancy
185
+ * @examplePrompt Which tag does each selected space carry?
186
+ *
187
+ * # Example
188
+ * ```ts
189
+ * const { components } = await snaptrude.core.tags.listForComponents()
190
+ * for (const c of components) {
191
+ * const occupancy = c.tags.find((t) => t.categoryName === "Occupancy")
192
+ * if (occupancy) paint(c.componentId, occupancy.color)
193
+ * }
194
+ * ```
195
+ */
196
+ public abstract listForComponents(
197
+ componentIds?: ComponentHandle[],
198
+ ): PluginApiReturn<PluginCoreTagsListForComponentsResult>
199
+
200
+ /**
201
+ * List the components carrying a given tag or category.
202
+ *
203
+ * Provide **exactly one** of `tagId` (components with that specific tag) or
204
+ * `categoryId` (components carrying any non-default tag in that category). With
205
+ * `categoryId`, pass `untagged: true` to instead return the components that have
206
+ * **no** non-default tag in that category. `untagged` is valid only alongside
207
+ * `categoryId`.
208
+ *
209
+ * @param filter - A {@linkcode PluginCoreTagsListComponentsArgs} filter with
210
+ * exactly one of `tagId`, `categoryId`, plus optional `untagged` (with
211
+ * `categoryId`).
212
+ * @returns A {@linkcode PluginCoreTagsListComponentsResult} with a
213
+ * `componentIds` array (empty when none match).
214
+ *
215
+ * @examplePrompt Which spaces have the tag tag_9?
216
+ * @examplePrompt List every component tagged in category cat_3
217
+ * @examplePrompt Which spaces are untagged in the Occupancy category?
218
+ *
219
+ * # Example
220
+ * ```ts
221
+ * const { componentIds } = await snaptrude.core.tags.listComponents({ tagId: "tag_9" })
222
+ * console.log(`${componentIds.length} components`)
223
+ * ```
224
+ */
225
+ public abstract listComponents(
226
+ filter: { tagId?: string; categoryId?: string; untagged?: boolean },
227
+ ): PluginApiReturn<PluginCoreTagsListComponentsResult>
228
+
229
+ /**
230
+ * Create a new tag category.
231
+ *
232
+ * @param name - Display name of the new category.
233
+ * @returns The new {@linkcode PluginCoreTagCategory}.
234
+ * @throws If the name collides with the reserved `DEPARTMENT` category, or the
235
+ * category could not be created.
236
+ *
237
+ * @examplePrompt Create a tag category called Fire Rating
238
+ * @examplePrompt Add a new category named Zone
239
+ * @examplePrompt Make a category for occupancy type
240
+ *
241
+ * # Example
242
+ * ```ts
243
+ * const category = await snaptrude.core.tags.createCategory("Fire Rating")
244
+ * ```
245
+ */
246
+ public abstract createCategory(
247
+ name: string,
248
+ ): PluginApiReturn<PluginCoreTagsCreateCategoryResult>
249
+
250
+ /**
251
+ * Rename a tag category.
252
+ *
253
+ * @param categoryId - The id of the category to rename.
254
+ * @param name - The category's new display name.
255
+ * @returns The updated {@linkcode PluginCoreTagCategory}.
256
+ * @throws If no category has the given id, or it is the reserved `DEPARTMENT`
257
+ * category.
258
+ *
259
+ * @examplePrompt Rename category cat_3 to Occupancy
260
+ * @examplePrompt Change the name of this tag category
261
+ * @examplePrompt Update the Zone category's name
262
+ *
263
+ * # Example
264
+ * ```ts
265
+ * const category = await snaptrude.core.tags.updateCategory("cat_3", "Occupancy")
266
+ * ```
267
+ */
268
+ public abstract updateCategory(
269
+ categoryId: string,
270
+ name: string,
271
+ ): PluginApiReturn<PluginCoreTagsUpdateCategoryResult>
272
+
273
+ /**
274
+ * Delete a tag category and all its tags.
275
+ *
276
+ * **Non-undoable.** Every component tagged in this category is reset to the
277
+ * category's `DEFAULT`; the result reports how many tags were removed and how
278
+ * many components were reset.
279
+ *
280
+ * @param categoryId - The id of the category to delete.
281
+ * @returns The impact counts (`deletedTagCount`, `resetComponentCount`).
282
+ * @throws If no category has the given id, or it is the reserved `DEPARTMENT`
283
+ * category.
284
+ *
285
+ * @examplePrompt Delete the Zone tag category
286
+ * @examplePrompt Remove category cat_3 and all its tags
287
+ * @examplePrompt Delete this category
288
+ *
289
+ * # Example
290
+ * ```ts
291
+ * const { deletedTagCount } = await snaptrude.core.tags.deleteCategory("cat_3")
292
+ * ```
293
+ */
294
+ public abstract deleteCategory(
295
+ categoryId: string,
296
+ ): PluginApiReturn<PluginCoreTagsDeleteCategoryResult>
297
+
298
+ /**
299
+ * Create a new tag in a category.
300
+ *
301
+ * @param categoryId - The category the new tag belongs to.
302
+ * @param name - Display name of the new tag.
303
+ * @param color - Optional CSS hex color string (auto-assigned if omitted).
304
+ * @returns The new {@linkcode PluginCoreTag}.
305
+ * @throws If no category has the given id, or it is the reserved `DEPARTMENT`
306
+ * category.
307
+ *
308
+ * @examplePrompt Add a tag called 2-hour to the Fire Rating category
309
+ * @examplePrompt Create a red High Priority tag in category cat_3
310
+ * @examplePrompt Make a new tag named Retail
311
+ *
312
+ * # Example
313
+ * ```ts
314
+ * const tag = await snaptrude.core.tags.create("cat_3", "Retail", "#b5e1dc")
315
+ * ```
316
+ */
317
+ public abstract create(
318
+ categoryId: string,
319
+ name: string,
320
+ color?: string,
321
+ ): PluginApiReturn<PluginCoreTagsCreateResult>
322
+
323
+ /**
324
+ * Update a tag's name and/or color.
325
+ *
326
+ * A **sparse** update: omitted fields are left unchanged.
327
+ *
328
+ * @param tagId - The id of the tag to update.
329
+ * @param options - Any of `name`, `color`; omitted fields are left unchanged.
330
+ * @returns The updated {@linkcode PluginCoreTag}.
331
+ * @throws If no tag has the given id, or it belongs to the reserved
332
+ * `DEPARTMENT` category.
333
+ *
334
+ * @examplePrompt Rename tag tag_9 to Retail
335
+ * @examplePrompt Change this tag's color to #ff8800
336
+ * @examplePrompt Recolor the High Priority tag
337
+ *
338
+ * # Example
339
+ * ```ts
340
+ * const tag = await snaptrude.core.tags.update("tag_9", { name: "Retail" })
341
+ * ```
342
+ */
343
+ public abstract update(
344
+ tagId: string,
345
+ options?: { name?: string; color?: string },
346
+ ): PluginApiReturn<PluginCoreTagsUpdateResult>
347
+
348
+ /**
349
+ * Delete a tag.
350
+ *
351
+ * **Non-undoable.** Every component carrying this tag is reset to its
352
+ * category's `DEFAULT`; the result reports how many components were reset. The
353
+ * built-in `DEFAULT` tag of a category cannot be deleted.
354
+ *
355
+ * @param tagId - The id of the tag to delete.
356
+ * @returns The impact count (`resetComponentCount`).
357
+ * @throws If no tag has the given id, it is a `DEFAULT` tag, or it belongs to
358
+ * the reserved `DEPARTMENT` category.
359
+ *
360
+ * @examplePrompt Delete the Retail tag
361
+ * @examplePrompt Remove tag tag_9
362
+ * @examplePrompt Delete this label
363
+ *
364
+ * # Example
365
+ * ```ts
366
+ * const { resetComponentCount } = await snaptrude.core.tags.delete("tag_9")
367
+ * ```
368
+ */
369
+ public abstract delete(
370
+ tagId: string,
371
+ ): PluginApiReturn<PluginCoreTagsDeleteResult>
372
+
373
+ /**
374
+ * Assign a tag to components, creating the category and tag if needed.
375
+ *
376
+ * Resolves `tagName` within the category named `categoryName`: if the category
377
+ * or the tag does not exist yet it is created, otherwise the existing one is
378
+ * reused. The resolved tag is then applied to each taggable component (Mass/Floor
379
+ * spaces) — resolve-or-create and assign are **one atomic, undoable action**.
380
+ * Because a component carries one tag per category, this replaces any existing
381
+ * tag from that category. Components that are locked, not taggable, or not found
382
+ * are returned in `skipped` with a reason — never silently dropped. Rejects the
383
+ * reserved `DEPARTMENT` category.
384
+ *
385
+ * @param componentIds - The components to tag (at least one).
386
+ * @param categoryName - The tag category; created if it does not exist (not
387
+ * `DEPARTMENT`).
388
+ * @param tagName - The tag within the category; created if it does not exist,
389
+ * else reused.
390
+ * @returns A {@linkcode PluginCoreTagsAssignResult} — the resolved
391
+ * `categoryId`/`tagId`, whether each was created, and the `assigned`/`skipped`
392
+ * split.
393
+ * @throws If `categoryName` is the reserved `DEPARTMENT` category.
394
+ *
395
+ * @examplePrompt Tag the selected spaces as Retail in the Zone category
396
+ * @examplePrompt Tag these rooms High Priority, creating the tag if it doesn't exist
397
+ * @examplePrompt Put cmp_1 and cmp_2 in Zone / Retail
398
+ *
399
+ * # Example
400
+ * ```ts
401
+ * const { tagId, tagCreated, assigned } = await snaptrude.core.tags.assign(
402
+ * ["cmp_1", "cmp_2"],
403
+ * "Zone",
404
+ * "Retail",
405
+ * )
406
+ * ```
407
+ */
408
+ public abstract assign(
409
+ componentIds: ComponentHandle[],
410
+ categoryName: string,
411
+ tagName: string,
412
+ ): PluginApiReturn<PluginCoreTagsAssignResult>
413
+
414
+ /**
415
+ * Clear a category's tag from components.
416
+ *
417
+ * Resets each component's slot for the given category back to `DEFAULT` (a
418
+ * component always has a `DEFAULT` — the field is never blanked). Components
419
+ * that are locked, not taggable, or not found are returned in `skipped`.
420
+ *
421
+ * @param categoryId - The category slot to reset to default.
422
+ * @param componentIds - The components to clear (at least one).
423
+ * @returns A {@linkcode PluginCoreAssignOutcome} splitting `assigned` (reset to
424
+ * default) from `skipped`.
425
+ * @throws If no category has the given id.
426
+ *
427
+ * @examplePrompt Remove the Occupancy tag from the selected spaces
428
+ * @examplePrompt Clear category cat_3 on components cmp_1 and cmp_2
429
+ * @examplePrompt Untag these rooms in the Zone category
430
+ *
431
+ * # Example
432
+ * ```ts
433
+ * await snaptrude.core.tags.unassign("cat_3", ["cmp_1", "cmp_2"])
434
+ * ```
435
+ */
436
+ public abstract unassign(
437
+ categoryId: string,
438
+ componentIds: ComponentHandle[],
439
+ ): PluginApiReturn<PluginCoreTagsUnassignResult>
440
+ }
441
+
442
+ /**
443
+ * A tag category — a named slot that holds a set of mutually-exclusive tags.
444
+ *
445
+ * | Property | Type | Description |
446
+ * |---|---|---|
447
+ * | `id` | `string` | Stable public category id |
448
+ * | `name` | `string` | Display name |
449
+ * | `tagIds` | `string[]` | Ids of the tags in this category |
450
+ */
451
+ export const PluginCoreTagCategory = z.object({
452
+ id: z.string(),
453
+ name: z.string(),
454
+ tagIds: z.array(z.string()),
455
+ })
456
+ export type PluginCoreTagCategory = z.infer<typeof PluginCoreTagCategory>
457
+
458
+ /**
459
+ * A tag — a colored label within a category.
460
+ *
461
+ * | Property | Type | Description |
462
+ * |---|---|---|
463
+ * | `id` | `string` | Stable public tag id |
464
+ * | `categoryId` | `string` | The id of the category this tag belongs to |
465
+ * | `name` | `string` | Display name |
466
+ * | `color` | `string` | CSS hex color string (e.g. `"#b5e1dc"`) |
467
+ */
468
+ export const PluginCoreTag = z.object({
469
+ id: z.string(),
470
+ categoryId: z.string(),
471
+ name: z.string(),
472
+ color: z.string(),
473
+ })
474
+ export type PluginCoreTag = z.infer<typeof PluginCoreTag>
475
+
476
+ /**
477
+ * A tag as carried by a component — the category and tag names resolved for
478
+ * display.
479
+ *
480
+ * | Property | Type | Description |
481
+ * |---|---|---|
482
+ * | `categoryId` | `string` | The category's id |
483
+ * | `categoryName` | `string` | The category's display name |
484
+ * | `tagId` | `string` | The tag's id |
485
+ * | `tagName` | `string` | The tag's display name |
486
+ * | `color` | `string` | The tag's CSS hex color string |
487
+ */
488
+ export const PluginCoreComponentTag = z.object({
489
+ categoryId: z.string(),
490
+ categoryName: z.string(),
491
+ tagId: z.string(),
492
+ tagName: z.string(),
493
+ color: z.string(),
494
+ })
495
+ export type PluginCoreComponentTag = z.infer<typeof PluginCoreComponentTag>
496
+
497
+ /**
498
+ * The outcome of an assign/unassign — which components changed and which were
499
+ * skipped (with a reason).
500
+ *
501
+ * | Property | Type | Description |
502
+ * |---|---|---|
503
+ * | `assigned` | `string[]` | Ids of the components that were changed |
504
+ * | `skipped` | `{ id: string; reason: "locked" \| "not-taggable" \| "not-found" }[]` | Components that were not changed, each with a reason |
505
+ */
506
+ export const PluginCoreAssignOutcome = z.object({
507
+ assigned: z.array(z.string()),
508
+ skipped: z.array(
509
+ z.object({
510
+ id: z.string(),
511
+ reason: z.enum(["locked", "not-taggable", "not-found"]),
512
+ }),
513
+ ),
514
+ })
515
+ export type PluginCoreAssignOutcome = z.infer<typeof PluginCoreAssignOutcome>
516
+
517
+ /**
518
+ * Result of {@linkcode PluginCoreTagsApi.listCategories}.
519
+ *
520
+ * | Property | Type | Description |
521
+ * |---|---|---|
522
+ * | `categories` | {@linkcode PluginCoreTagCategory}`[]` | Every tag category (including the reserved `DEPARTMENT`) |
523
+ */
524
+ export const PluginCoreTagsListCategoriesResult = z.object({
525
+ categories: z.array(PluginCoreTagCategory),
526
+ })
527
+ export type PluginCoreTagsListCategoriesResult = z.infer<
528
+ typeof PluginCoreTagsListCategoriesResult
529
+ >
530
+
531
+ /**
532
+ * Arguments for {@linkcode PluginCoreTagsApi.getCategory}.
533
+ *
534
+ * | Property | Type | Description |
535
+ * |---|---|---|
536
+ * | `categoryId` | `string` | The id of the category to read |
537
+ */
538
+ export const PluginCoreTagsGetCategoryArgs = z.object({
539
+ categoryId: z.string(),
540
+ })
541
+ export type PluginCoreTagsGetCategoryArgs = z.infer<
542
+ typeof PluginCoreTagsGetCategoryArgs
543
+ >
544
+
545
+ /**
546
+ * Result of {@linkcode PluginCoreTagsApi.getCategory} — the category, or `null`
547
+ * when no category has the given id.
548
+ */
549
+ export const PluginCoreTagsGetCategoryResult = PluginCoreTagCategory.nullable()
550
+ export type PluginCoreTagsGetCategoryResult = z.infer<
551
+ typeof PluginCoreTagsGetCategoryResult
552
+ >
553
+
554
+ /**
555
+ * Arguments for {@linkcode PluginCoreTagsApi.list}.
556
+ *
557
+ * | Property | Type | Description |
558
+ * |---|---|---|
559
+ * | `categoryId` | `string \| undefined` | Optional category filter; omit to list every tag |
560
+ */
561
+ export const PluginCoreTagsListArgs = z.object({
562
+ categoryId: z.string().optional(),
563
+ })
564
+ export type PluginCoreTagsListArgs = z.infer<typeof PluginCoreTagsListArgs>
565
+
566
+ /**
567
+ * Result of {@linkcode PluginCoreTagsApi.list}.
568
+ *
569
+ * | Property | Type | Description |
570
+ * |---|---|---|
571
+ * | `tags` | {@linkcode PluginCoreTag}`[]` | The matching tags (empty when none) |
572
+ */
573
+ export const PluginCoreTagsListResult = z.object({
574
+ tags: z.array(PluginCoreTag),
575
+ })
576
+ export type PluginCoreTagsListResult = z.infer<typeof PluginCoreTagsListResult>
577
+
578
+ /**
579
+ * Arguments for {@linkcode PluginCoreTagsApi.get}.
580
+ *
581
+ * | Property | Type | Description |
582
+ * |---|---|---|
583
+ * | `tagId` | `string` | The id of the tag to read |
584
+ */
585
+ export const PluginCoreTagsGetArgs = z.object({
586
+ tagId: z.string(),
587
+ })
588
+ export type PluginCoreTagsGetArgs = z.infer<typeof PluginCoreTagsGetArgs>
589
+
590
+ /**
591
+ * Result of {@linkcode PluginCoreTagsApi.get} — the tag, or `null` when no tag
592
+ * has the given id.
593
+ */
594
+ export const PluginCoreTagsGetResult = PluginCoreTag.nullable()
595
+ export type PluginCoreTagsGetResult = z.infer<typeof PluginCoreTagsGetResult>
596
+
597
+ /**
598
+ * Arguments for {@linkcode PluginCoreTagsApi.getTagsForComponent}.
599
+ *
600
+ * | Property | Type | Description |
601
+ * |---|---|---|
602
+ * | `componentId` | `ComponentHandle` | The `Component.id` to read |
603
+ */
604
+ export const PluginCoreTagsGetTagsForComponentArgs = z.object({
605
+ componentId: ComponentHandle,
606
+ })
607
+ export type PluginCoreTagsGetTagsForComponentArgs = z.infer<
608
+ typeof PluginCoreTagsGetTagsForComponentArgs
609
+ >
610
+
611
+ /**
612
+ * Result of {@linkcode PluginCoreTagsApi.getTagsForComponent}.
613
+ *
614
+ * | Property | Type | Description |
615
+ * |---|---|---|
616
+ * | `tags` | {@linkcode PluginCoreComponentTag}`[]` | The component's tags, one per tagged category (empty when none) |
617
+ */
618
+ export const PluginCoreTagsGetTagsForComponentResult = z.object({
619
+ tags: z.array(PluginCoreComponentTag),
620
+ })
621
+ export type PluginCoreTagsGetTagsForComponentResult = z.infer<
622
+ typeof PluginCoreTagsGetTagsForComponentResult
623
+ >
624
+
625
+ /**
626
+ * Arguments for {@linkcode PluginCoreTagsApi.listForComponents}.
627
+ *
628
+ * | Property | Type | Description |
629
+ * |---|---|---|
630
+ * | `componentIds` | `ComponentHandle[]?` | Components to read; omit for every taggable component |
631
+ */
632
+ export const PluginCoreTagsListForComponentsArgs = z.object({
633
+ componentIds: z.array(ComponentHandle).optional(),
634
+ })
635
+ export type PluginCoreTagsListForComponentsArgs = z.infer<
636
+ typeof PluginCoreTagsListForComponentsArgs
637
+ >
638
+
639
+ /**
640
+ * One component's tags, for {@linkcode PluginCoreTagsApi.listForComponents}.
641
+ *
642
+ * | Property | Type | Description |
643
+ * |---|---|---|
644
+ * | `componentId` | `ComponentHandle` | The component's id |
645
+ * | `tags` | {@linkcode PluginCoreComponentTag}`[]` | Its tags, one per tagged category (empty when none) |
646
+ */
647
+ export const PluginCoreComponentTags = z.object({
648
+ componentId: ComponentHandle,
649
+ tags: z.array(PluginCoreComponentTag),
650
+ })
651
+ export type PluginCoreComponentTags = z.infer<typeof PluginCoreComponentTags>
652
+
653
+ /**
654
+ * Result of {@linkcode PluginCoreTagsApi.listForComponents}.
655
+ *
656
+ * | Property | Type | Description |
657
+ * |---|---|---|
658
+ * | `components` | {@linkcode PluginCoreComponentTags}`[]` | One entry per component |
659
+ */
660
+ export const PluginCoreTagsListForComponentsResult = z.object({
661
+ components: z.array(PluginCoreComponentTags),
662
+ })
663
+ export type PluginCoreTagsListForComponentsResult = z.infer<
664
+ typeof PluginCoreTagsListForComponentsResult
665
+ >
666
+
667
+ /**
668
+ * Arguments for {@linkcode PluginCoreTagsApi.listComponents}. Provide exactly one
669
+ * of `tagId`, `categoryId`. `untagged` is valid only with `categoryId`.
670
+ *
671
+ * | Property | Type | Description |
672
+ * |---|---|---|
673
+ * | `tagId` | `string \| undefined` | Components carrying this specific tag |
674
+ * | `categoryId` | `string \| undefined` | Components carrying any non-default tag in this category |
675
+ * | `untagged` | `boolean \| undefined` | With `categoryId`, return components with **no** non-default tag in that category instead |
676
+ */
677
+ export const PluginCoreTagsListComponentsArgs = z
678
+ .object({
679
+ tagId: z.string().optional(),
680
+ categoryId: z.string().optional(),
681
+ untagged: z.boolean().optional(),
682
+ })
683
+ .refine((v) => (v.tagId == null) !== (v.categoryId == null), {
684
+ message: "Provide exactly one of tagId or categoryId",
685
+ })
686
+ .refine((v) => v.untagged == null || v.categoryId != null, {
687
+ message: "untagged is valid only together with categoryId",
688
+ })
689
+ export type PluginCoreTagsListComponentsArgs = z.infer<
690
+ typeof PluginCoreTagsListComponentsArgs
691
+ >
692
+
693
+ /**
694
+ * Result of {@linkcode PluginCoreTagsApi.listComponents}.
695
+ *
696
+ * | Property | Type | Description |
697
+ * |---|---|---|
698
+ * | `componentIds` | `ComponentHandle[]` | Ids of the matching components (empty when none) |
699
+ */
700
+ export const PluginCoreTagsListComponentsResult = z.object({
701
+ componentIds: z.array(ComponentHandle),
702
+ })
703
+ export type PluginCoreTagsListComponentsResult = z.infer<
704
+ typeof PluginCoreTagsListComponentsResult
705
+ >
706
+
707
+ /**
708
+ * Arguments for {@linkcode PluginCoreTagsApi.createCategory}.
709
+ *
710
+ * | Property | Type | Description |
711
+ * |---|---|---|
712
+ * | `name` | `string` | Display name of the new category |
713
+ */
714
+ export const PluginCoreTagsCreateCategoryArgs = z.object({
715
+ name: z.string(),
716
+ })
717
+ export type PluginCoreTagsCreateCategoryArgs = z.infer<
718
+ typeof PluginCoreTagsCreateCategoryArgs
719
+ >
720
+
721
+ /** Result of {@linkcode PluginCoreTagsApi.createCategory} — the new category. */
722
+ export const PluginCoreTagsCreateCategoryResult = PluginCoreTagCategory
723
+ export type PluginCoreTagsCreateCategoryResult = z.infer<
724
+ typeof PluginCoreTagsCreateCategoryResult
725
+ >
726
+
727
+ /**
728
+ * Arguments for {@linkcode PluginCoreTagsApi.updateCategory}.
729
+ *
730
+ * | Property | Type | Description |
731
+ * |---|---|---|
732
+ * | `categoryId` | `string` | The id of the category to rename |
733
+ * | `name` | `string` | The category's new display name |
734
+ */
735
+ export const PluginCoreTagsUpdateCategoryArgs = z.object({
736
+ categoryId: z.string(),
737
+ name: z.string(),
738
+ })
739
+ export type PluginCoreTagsUpdateCategoryArgs = z.infer<
740
+ typeof PluginCoreTagsUpdateCategoryArgs
741
+ >
742
+
743
+ /** Result of {@linkcode PluginCoreTagsApi.updateCategory} — the updated category. */
744
+ export const PluginCoreTagsUpdateCategoryResult = PluginCoreTagCategory
745
+ export type PluginCoreTagsUpdateCategoryResult = z.infer<
746
+ typeof PluginCoreTagsUpdateCategoryResult
747
+ >
748
+
749
+ /**
750
+ * Arguments for {@linkcode PluginCoreTagsApi.deleteCategory}.
751
+ *
752
+ * | Property | Type | Description |
753
+ * |---|---|---|
754
+ * | `categoryId` | `string` | The id of the category to delete |
755
+ */
756
+ export const PluginCoreTagsDeleteCategoryArgs = z.object({
757
+ categoryId: z.string(),
758
+ })
759
+ export type PluginCoreTagsDeleteCategoryArgs = z.infer<
760
+ typeof PluginCoreTagsDeleteCategoryArgs
761
+ >
762
+
763
+ /**
764
+ * Result of {@linkcode PluginCoreTagsApi.deleteCategory} — the impact of the
765
+ * (non-undoable) delete.
766
+ *
767
+ * | Property | Type | Description |
768
+ * |---|---|---|
769
+ * | `deletedTagCount` | `number` | Number of tags removed with the category |
770
+ * | `resetComponentCount` | `number` | Number of components reset to their default |
771
+ */
772
+ export const PluginCoreTagsDeleteCategoryResult = z.object({
773
+ deletedTagCount: z.number().int(),
774
+ resetComponentCount: z.number().int(),
775
+ })
776
+ export type PluginCoreTagsDeleteCategoryResult = z.infer<
777
+ typeof PluginCoreTagsDeleteCategoryResult
778
+ >
779
+
780
+ /**
781
+ * Arguments for {@linkcode PluginCoreTagsApi.create}.
782
+ *
783
+ * | Property | Type | Description |
784
+ * |---|---|---|
785
+ * | `categoryId` | `string` | The category the new tag belongs to |
786
+ * | `name` | `string` | Display name of the new tag |
787
+ * | `color` | `string \| undefined` | CSS hex color string (auto-assigned if omitted) |
788
+ */
789
+ export const PluginCoreTagsCreateArgs = z.object({
790
+ categoryId: z.string(),
791
+ name: z.string(),
792
+ color: z.string().optional(),
793
+ })
794
+ export type PluginCoreTagsCreateArgs = z.infer<typeof PluginCoreTagsCreateArgs>
795
+
796
+ /** Result of {@linkcode PluginCoreTagsApi.create} — the new tag. */
797
+ export const PluginCoreTagsCreateResult = PluginCoreTag
798
+ export type PluginCoreTagsCreateResult = z.infer<
799
+ typeof PluginCoreTagsCreateResult
800
+ >
801
+
802
+ /**
803
+ * Arguments for {@linkcode PluginCoreTagsApi.update}. Sparse — only the provided
804
+ * fields are changed.
805
+ *
806
+ * | Property | Type | Description |
807
+ * |---|---|---|
808
+ * | `tagId` | `string` | The id of the tag to update |
809
+ * | `name` | `string \| undefined` | New display name (unchanged if omitted) |
810
+ * | `color` | `string \| undefined` | New CSS hex color (unchanged if omitted) |
811
+ */
812
+ export const PluginCoreTagsUpdateArgs = z.object({
813
+ tagId: z.string(),
814
+ name: z.string().optional(),
815
+ color: z.string().optional(),
816
+ })
817
+ export type PluginCoreTagsUpdateArgs = z.infer<typeof PluginCoreTagsUpdateArgs>
818
+
819
+ /** Result of {@linkcode PluginCoreTagsApi.update} — the updated tag. */
820
+ export const PluginCoreTagsUpdateResult = PluginCoreTag
821
+ export type PluginCoreTagsUpdateResult = z.infer<
822
+ typeof PluginCoreTagsUpdateResult
823
+ >
824
+
825
+ /**
826
+ * Arguments for {@linkcode PluginCoreTagsApi.delete}.
827
+ *
828
+ * | Property | Type | Description |
829
+ * |---|---|---|
830
+ * | `tagId` | `string` | The id of the tag to delete |
831
+ */
832
+ export const PluginCoreTagsDeleteArgs = z.object({
833
+ tagId: z.string(),
834
+ })
835
+ export type PluginCoreTagsDeleteArgs = z.infer<typeof PluginCoreTagsDeleteArgs>
836
+
837
+ /**
838
+ * Result of {@linkcode PluginCoreTagsApi.delete} — the impact of the
839
+ * (non-undoable) delete.
840
+ *
841
+ * | Property | Type | Description |
842
+ * |---|---|---|
843
+ * | `resetComponentCount` | `number` | Number of components reset to their category default |
844
+ */
845
+ export const PluginCoreTagsDeleteResult = z.object({
846
+ resetComponentCount: z.number().int(),
847
+ })
848
+ export type PluginCoreTagsDeleteResult = z.infer<
849
+ typeof PluginCoreTagsDeleteResult
850
+ >
851
+
852
+ /**
853
+ * Arguments for {@linkcode PluginCoreTagsApi.assign}.
854
+ *
855
+ * | Property | Type | Description |
856
+ * |---|---|---|
857
+ * | `componentIds` | `ComponentHandle[]` | The components to tag (at least one) |
858
+ * | `categoryName` | `string` | The tag category; created if it does not exist (not `DEPARTMENT`) |
859
+ * | `tagName` | `string` | The tag within the category; created if it does not exist, else reused |
860
+ */
861
+ export const PluginCoreTagsAssignArgs = z.object({
862
+ componentIds: z.array(ComponentHandle).min(1),
863
+ categoryName: z.string(),
864
+ tagName: z.string(),
865
+ })
866
+ export type PluginCoreTagsAssignArgs = z.infer<typeof PluginCoreTagsAssignArgs>
867
+
868
+ /**
869
+ * Result of {@linkcode PluginCoreTagsApi.assign} — the resolved category/tag, what
870
+ * was created, and the assign outcome.
871
+ *
872
+ * | Property | Type | Description |
873
+ * |---|---|---|
874
+ * | `categoryId` | `string` | Id of the resolved (or newly created) category |
875
+ * | `tagId` | `string` | Id of the resolved (or newly created) tag |
876
+ * | `categoryCreated` | `boolean` | Whether the category was created by this call |
877
+ * | `tagCreated` | `boolean` | Whether the tag was created by this call |
878
+ * | `assigned` | `string[]` | Ids of the components that were tagged |
879
+ * | `skipped` | `{ id: string; reason: "locked" \| "not-taggable" \| "not-found" }[]` | Components not tagged, each with a reason |
880
+ */
881
+ export const PluginCoreTagsAssignResult = PluginCoreAssignOutcome.extend({
882
+ categoryId: z.string(),
883
+ tagId: z.string(),
884
+ categoryCreated: z.boolean(),
885
+ tagCreated: z.boolean(),
886
+ })
887
+ export type PluginCoreTagsAssignResult = z.infer<
888
+ typeof PluginCoreTagsAssignResult
889
+ >
890
+
891
+ /**
892
+ * Arguments for {@linkcode PluginCoreTagsApi.unassign}.
893
+ *
894
+ * | Property | Type | Description |
895
+ * |---|---|---|
896
+ * | `categoryId` | `string` | The category slot to reset to default |
897
+ * | `componentIds` | `ComponentHandle[]` | The components to clear (at least one) |
898
+ */
899
+ export const PluginCoreTagsUnassignArgs = z.object({
900
+ categoryId: z.string(),
901
+ componentIds: z.array(ComponentHandle).min(1),
902
+ })
903
+ export type PluginCoreTagsUnassignArgs = z.infer<
904
+ typeof PluginCoreTagsUnassignArgs
905
+ >
906
+
907
+ /** Result of {@linkcode PluginCoreTagsApi.unassign} — the unassign outcome. */
908
+ export const PluginCoreTagsUnassignResult = PluginCoreAssignOutcome
909
+ export type PluginCoreTagsUnassignResult = z.infer<
910
+ typeof PluginCoreTagsUnassignResult
911
+ >