@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.
- package/AGENTS.md +231 -0
- package/CHANGELOG.md +341 -0
- package/CLAUDE.md +11 -0
- package/api-manifest.json +9120 -0
- package/dist/api/analysis/daylight.d.ts +603 -0
- package/dist/api/analysis/daylight.d.ts.map +1 -0
- package/dist/api/analysis/heatmaps.d.ts +658 -0
- package/dist/api/analysis/heatmaps.d.ts.map +1 -0
- package/dist/api/analysis/illuminance.d.ts +145 -0
- package/dist/api/analysis/illuminance.d.ts.map +1 -0
- package/dist/api/analysis/index.d.ts +59 -0
- package/dist/api/analysis/index.d.ts.map +1 -0
- package/dist/api/analysis/shadows.d.ts +165 -0
- package/dist/api/analysis/shadows.d.ts.map +1 -0
- package/dist/api/analysis/solar.d.ts +249 -0
- package/dist/api/analysis/solar.d.ts.map +1 -0
- package/dist/api/analysis/sunlightHours.d.ts +208 -0
- package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
- package/dist/api/analysis/sunpath.d.ts +80 -0
- package/dist/api/analysis/sunpath.d.ts.map +1 -0
- package/dist/api/analysis/weather.d.ts +193 -0
- package/dist/api/analysis/weather.d.ts.map +1 -0
- package/dist/api/core/buildings.d.ts +427 -0
- package/dist/api/core/buildings.d.ts.map +1 -0
- package/dist/api/core/camera/index.d.ts +261 -0
- package/dist/api/core/camera/index.d.ts.map +1 -0
- package/dist/api/core/comment/index.d.ts +333 -0
- package/dist/api/core/comment/index.d.ts.map +1 -0
- package/dist/api/core/geom/create/index.d.ts +1073 -0
- package/dist/api/core/geom/create/index.d.ts.map +1 -0
- package/dist/api/core/geom/delete/index.d.ts +78 -0
- package/dist/api/core/geom/delete/index.d.ts.map +1 -0
- package/dist/api/core/geom/index.d.ts +33 -0
- package/dist/api/core/geom/index.d.ts.map +1 -0
- package/dist/api/core/geom/query/arc.d.ts +169 -0
- package/dist/api/core/geom/query/arc.d.ts.map +1 -0
- package/dist/api/core/geom/query/brep.d.ts +514 -0
- package/dist/api/core/geom/query/brep.d.ts.map +1 -0
- package/dist/api/core/geom/query/circle.d.ts +378 -0
- package/dist/api/core/geom/query/circle.d.ts.map +1 -0
- package/dist/api/core/geom/query/contour.d.ts +450 -0
- package/dist/api/core/geom/query/contour.d.ts.map +1 -0
- package/dist/api/core/geom/query/curve.d.ts +918 -0
- package/dist/api/core/geom/query/curve.d.ts.map +1 -0
- package/dist/api/core/geom/query/edge.d.ts +128 -0
- package/dist/api/core/geom/query/edge.d.ts.map +1 -0
- package/dist/api/core/geom/query/face.d.ts +363 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -0
- package/dist/api/core/geom/query/halfedge.d.ts +206 -0
- package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
- package/dist/api/core/geom/query/index.d.ts +61 -0
- package/dist/api/core/geom/query/index.d.ts.map +1 -0
- package/dist/api/core/geom/query/profile.d.ts +410 -0
- package/dist/api/core/geom/query/profile.d.ts.map +1 -0
- package/dist/api/core/geom/query/vertex.d.ts +187 -0
- package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
- package/dist/api/core/geom/update/contour.d.ts +272 -0
- package/dist/api/core/geom/update/contour.d.ts.map +1 -0
- package/dist/api/core/geom/update/curve.d.ts +180 -0
- package/dist/api/core/geom/update/curve.d.ts.map +1 -0
- package/dist/api/core/geom/update/index.d.ts +27 -0
- package/dist/api/core/geom/update/index.d.ts.map +1 -0
- package/dist/api/core/geom/update/profile.d.ts +329 -0
- package/dist/api/core/geom/update/profile.d.ts.map +1 -0
- package/dist/api/core/groups.d.ts +485 -0
- package/dist/api/core/groups.d.ts.map +1 -0
- package/dist/api/core/handles/index.d.ts +210 -0
- package/dist/api/core/handles/index.d.ts.map +1 -0
- package/dist/api/core/history/index.d.ts +78 -0
- package/dist/api/core/history/index.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +97 -0
- package/dist/api/core/index.d.ts.map +1 -0
- package/dist/api/core/io/export/index.d.ts +134 -0
- package/dist/api/core/io/export/index.d.ts.map +1 -0
- package/dist/api/core/io/import/index.d.ts +455 -0
- package/dist/api/core/io/import/index.d.ts.map +1 -0
- package/dist/api/core/io/index.d.ts +40 -0
- package/dist/api/core/io/index.d.ts.map +1 -0
- package/dist/api/core/io/job/index.d.ts +139 -0
- package/dist/api/core/io/job/index.d.ts.map +1 -0
- package/dist/api/core/io/query/index.d.ts +74 -0
- package/dist/api/core/io/query/index.d.ts.map +1 -0
- package/dist/api/core/io/terrain/index.d.ts +341 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -0
- package/dist/api/core/io/underlay/index.d.ts +805 -0
- package/dist/api/core/io/underlay/index.d.ts.map +1 -0
- package/dist/api/core/layers.d.ts +402 -0
- package/dist/api/core/layers.d.ts.map +1 -0
- package/dist/api/core/math/index.d.ts +18 -0
- package/dist/api/core/math/index.d.ts.map +1 -0
- package/dist/api/core/math/quat.d.ts +170 -0
- package/dist/api/core/math/quat.d.ts.map +1 -0
- package/dist/api/core/math/vec3.d.ts +174 -0
- package/dist/api/core/math/vec3.d.ts.map +1 -0
- package/dist/api/core/mode/index.d.ts +111 -0
- package/dist/api/core/mode/index.d.ts.map +1 -0
- package/dist/api/core/project/index.d.ts +466 -0
- package/dist/api/core/project/index.d.ts.map +1 -0
- package/dist/api/core/proposals/index.d.ts +531 -0
- package/dist/api/core/proposals/index.d.ts.map +1 -0
- package/dist/api/core/storeys/index.d.ts +265 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +860 -0
- package/dist/api/core/tags.d.ts.map +1 -0
- package/dist/api/core/units/index.d.ts +175 -0
- package/dist/api/core/units/index.d.ts.map +1 -0
- package/dist/api/core/user.d.ts +44 -0
- package/dist/api/core/user.d.ts.map +1 -0
- package/dist/api/core/zoom/index.d.ts +49 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +168 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -0
- package/dist/api/design/create/bulk-items.d.ts +185 -0
- package/dist/api/design/create/bulk-items.d.ts.map +1 -0
- package/dist/api/design/create/grids.d.ts +132 -0
- package/dist/api/design/create/grids.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +1747 -0
- package/dist/api/design/create/index.d.ts.map +1 -0
- package/dist/api/design/create/opening-fields.d.ts +37 -0
- package/dist/api/design/create/opening-fields.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +70 -0
- package/dist/api/design/delete/index.d.ts.map +1 -0
- package/dist/api/design/dimensions.d.ts +427 -0
- package/dist/api/design/dimensions.d.ts.map +1 -0
- package/dist/api/design/doors/index.d.ts +470 -0
- package/dist/api/design/doors/index.d.ts.map +1 -0
- package/dist/api/design/edit/index.d.ts +49 -0
- package/dist/api/design/edit/index.d.ts.map +1 -0
- package/dist/api/design/erase/index.d.ts +160 -0
- package/dist/api/design/erase/index.d.ts.map +1 -0
- package/dist/api/design/family.d.ts +611 -0
- package/dist/api/design/family.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +296 -0
- package/dist/api/design/furniture/index.d.ts.map +1 -0
- package/dist/api/design/grids.d.ts +237 -0
- package/dist/api/design/grids.d.ts.map +1 -0
- package/dist/api/design/index.d.ts +260 -0
- package/dist/api/design/index.d.ts.map +1 -0
- package/dist/api/design/lock.d.ts +67 -0
- package/dist/api/design/lock.d.ts.map +1 -0
- package/dist/api/design/materials/index.d.ts +551 -0
- package/dist/api/design/materials/index.d.ts.map +1 -0
- package/dist/api/design/query/geometry/index.d.ts +252 -0
- package/dist/api/design/query/geometry/index.d.ts.map +1 -0
- package/dist/api/design/query/grids.d.ts +287 -0
- package/dist/api/design/query/grids.d.ts.map +1 -0
- package/dist/api/design/query/index.d.ts +1318 -0
- package/dist/api/design/query/index.d.ts.map +1 -0
- package/dist/api/design/query/referenceLines.d.ts +45 -0
- package/dist/api/design/query/referenceLines.d.ts.map +1 -0
- package/dist/api/design/query/spaces.d.ts +394 -0
- package/dist/api/design/query/spaces.d.ts.map +1 -0
- package/dist/api/design/selection/index.d.ts +282 -0
- package/dist/api/design/selection/index.d.ts.map +1 -0
- package/dist/api/design/shared.d.ts +38 -0
- package/dist/api/design/shared.d.ts.map +1 -0
- package/dist/api/design/transform/index.d.ts +249 -0
- package/dist/api/design/transform/index.d.ts.map +1 -0
- package/dist/api/design/types/index.d.ts +181 -0
- package/dist/api/design/types/index.d.ts.map +1 -0
- package/dist/api/design/update/index.d.ts +803 -0
- package/dist/api/design/update/index.d.ts.map +1 -0
- package/dist/api/design/visibility.d.ts +126 -0
- package/dist/api/design/visibility.d.ts.map +1 -0
- package/dist/api/design/windows/index.d.ts +300 -0
- package/dist/api/design/windows/index.d.ts.map +1 -0
- package/dist/api/entity/buildableEnvelope.d.ts +265 -0
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
- package/dist/api/entity/department.d.ts +1 -0
- package/dist/api/entity/department.d.ts.map +1 -0
- package/dist/api/entity/index.d.ts +28 -0
- package/dist/api/entity/index.d.ts.map +1 -0
- package/dist/api/entity/referenceLine.d.ts +210 -0
- package/dist/api/entity/referenceLine.d.ts.map +1 -0
- package/dist/api/entity/space.d.ts +846 -0
- package/dist/api/entity/space.d.ts.map +1 -0
- package/dist/api/entity/story.d.ts +476 -0
- package/dist/api/entity/story.d.ts.map +1 -0
- package/dist/api/index.d.ts +45 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/presentation/aiInspiration.d.ts +2400 -0
- package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
- package/dist/api/presentation/annotate.d.ts +483 -0
- package/dist/api/presentation/annotate.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +184 -0
- package/dist/api/presentation/diagrams.d.ts.map +1 -0
- package/dist/api/presentation/drawings.d.ts +2900 -0
- package/dist/api/presentation/drawings.d.ts.map +1 -0
- package/dist/api/presentation/export.d.ts +126 -0
- package/dist/api/presentation/export.d.ts.map +1 -0
- package/dist/api/presentation/import.d.ts +164 -0
- package/dist/api/presentation/import.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +114 -0
- package/dist/api/presentation/index.d.ts.map +1 -0
- package/dist/api/presentation/placedViews.d.ts +1232 -0
- package/dist/api/presentation/placedViews.d.ts.map +1 -0
- package/dist/api/presentation/shapes.d.ts +481 -0
- package/dist/api/presentation/shapes.d.ts.map +1 -0
- package/dist/api/presentation/sheets.d.ts +643 -0
- package/dist/api/presentation/sheets.d.ts.map +1 -0
- package/dist/api/presentation/slideshow.d.ts +125 -0
- package/dist/api/presentation/slideshow.d.ts.map +1 -0
- package/dist/api/presentation/tables.d.ts +81 -0
- package/dist/api/presentation/tables.d.ts.map +1 -0
- package/dist/api/presentation/viewPresets.d.ts +70 -0
- package/dist/api/presentation/viewPresets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +741 -0
- package/dist/api/presentation/views.d.ts.map +1 -0
- package/dist/api/program/adjacency.d.ts +155 -0
- package/dist/api/program/adjacency.d.ts.map +1 -0
- package/dist/api/program/areas.d.ts +450 -0
- package/dist/api/program/areas.d.ts.map +1 -0
- package/dist/api/program/classification.d.ts +135 -0
- package/dist/api/program/classification.d.ts.map +1 -0
- package/dist/api/program/cores.d.ts +78 -0
- package/dist/api/program/cores.d.ts.map +1 -0
- package/dist/api/program/departments.d.ts +487 -0
- package/dist/api/program/departments.d.ts.map +1 -0
- package/dist/api/program/index.d.ts +71 -0
- package/dist/api/program/index.d.ts.map +1 -0
- package/dist/api/program/labels.d.ts +355 -0
- package/dist/api/program/labels.d.ts.map +1 -0
- package/dist/api/program/layout.d.ts +398 -0
- package/dist/api/program/layout.d.ts.map +1 -0
- package/dist/api/program/metadata.d.ts +328 -0
- package/dist/api/program/metadata.d.ts.map +1 -0
- package/dist/api/program/metrics.d.ts +108 -0
- package/dist/api/program/metrics.d.ts.map +1 -0
- package/dist/api/program/site.d.ts +823 -0
- package/dist/api/program/site.d.ts.map +1 -0
- package/dist/api/program/spreadsheet.d.ts +2628 -0
- package/dist/api/program/spreadsheet.d.ts.map +1 -0
- package/dist/api/workspace/index.d.ts +552 -0
- package/dist/api/workspace/index.d.ts.map +1 -0
- package/dist/errors/codes.d.ts +34 -0
- package/dist/errors/codes.d.ts.map +1 -0
- package/dist/errors/envelope.d.ts +56 -0
- package/dist/errors/envelope.d.ts.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/plugin-error.d.ts +69 -0
- package/dist/errors/plugin-error.d.ts.map +1 -0
- package/dist/handles.d.ts +229 -0
- package/dist/handles.d.ts.map +1 -0
- package/dist/host-utils.d.ts +47 -0
- package/dist/host-utils.d.ts.map +1 -0
- package/dist/index.cjs +8836 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7568 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +16 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +41 -0
- package/scripts/generate-manifest.mjs +238 -0
- package/scripts/generate-manifest.test.mjs +292 -0
- package/src/api/analysis/daylight.ts +470 -0
- package/src/api/analysis/heatmaps.ts +683 -0
- package/src/api/analysis/illuminance.ts +155 -0
- package/src/api/analysis/index.ts +61 -0
- package/src/api/analysis/shadows.ts +183 -0
- package/src/api/analysis/solar.ts +237 -0
- package/src/api/analysis/sunlightHours.ts +211 -0
- package/src/api/analysis/sunpath.ts +83 -0
- package/src/api/analysis/weather.ts +179 -0
- package/src/api/core/buildings.ts +485 -0
- package/src/api/core/camera/index.ts +268 -0
- package/src/api/core/comment/index.ts +376 -0
- package/src/api/core/geom/create/index.ts +1204 -0
- package/src/api/core/geom/delete/index.ts +84 -0
- package/src/api/core/geom/index.ts +35 -0
- package/src/api/core/geom/query/arc.ts +169 -0
- package/src/api/core/geom/query/brep.ts +563 -0
- package/src/api/core/geom/query/circle.ts +404 -0
- package/src/api/core/geom/query/contour.ts +540 -0
- package/src/api/core/geom/query/curve.ts +1078 -0
- package/src/api/core/geom/query/edge.ts +130 -0
- package/src/api/core/geom/query/face.ts +403 -0
- package/src/api/core/geom/query/halfedge.ts +210 -0
- package/src/api/core/geom/query/index.ts +63 -0
- package/src/api/core/geom/query/profile.ts +473 -0
- package/src/api/core/geom/query/vertex.ts +205 -0
- package/src/api/core/geom/update/contour.ts +315 -0
- package/src/api/core/geom/update/curve.ts +209 -0
- package/src/api/core/geom/update/index.ts +29 -0
- package/src/api/core/geom/update/profile.ts +377 -0
- package/src/api/core/groups.ts +521 -0
- package/src/api/core/handles/index.ts +233 -0
- package/src/api/core/history/index.ts +84 -0
- package/src/api/core/index.ts +99 -0
- package/src/api/core/io/export/index.ts +126 -0
- package/src/api/core/io/import/index.ts +504 -0
- package/src/api/core/io/index.ts +42 -0
- package/src/api/core/io/job/index.ts +140 -0
- package/src/api/core/io/query/index.ts +71 -0
- package/src/api/core/io/terrain/index.ts +360 -0
- package/src/api/core/io/underlay/index.ts +705 -0
- package/src/api/core/layers.ts +333 -0
- package/src/api/core/math/index.ts +20 -0
- package/src/api/core/math/quat.ts +172 -0
- package/src/api/core/math/vec3.ts +179 -0
- package/src/api/core/mode/index.ts +108 -0
- package/src/api/core/project/index.ts +479 -0
- package/src/api/core/proposals/index.ts +569 -0
- package/src/api/core/storeys/index.ts +294 -0
- package/src/api/core/tags.ts +911 -0
- package/src/api/core/units/index.ts +164 -0
- package/src/api/core/user.ts +46 -0
- package/src/api/core/zoom/index.ts +51 -0
- package/src/api/design/boolean/index.ts +179 -0
- package/src/api/design/create/bulk-items.ts +186 -0
- package/src/api/design/create/grids.ts +137 -0
- package/src/api/design/create/index.ts +1954 -0
- package/src/api/design/create/opening-fields.ts +37 -0
- package/src/api/design/delete/index.ts +74 -0
- package/src/api/design/dimensions.ts +453 -0
- package/src/api/design/doors/index.ts +500 -0
- package/src/api/design/edit/index.ts +54 -0
- package/src/api/design/erase/index.ts +151 -0
- package/src/api/design/family.ts +646 -0
- package/src/api/design/furniture/index.ts +319 -0
- package/src/api/design/grids.ts +237 -0
- package/src/api/design/index.ts +274 -0
- package/src/api/design/lock.ts +69 -0
- package/src/api/design/materials/index.ts +608 -0
- package/src/api/design/query/geometry/index.ts +288 -0
- package/src/api/design/query/grids.ts +197 -0
- package/src/api/design/query/index.ts +1176 -0
- package/src/api/design/query/referenceLines.ts +52 -0
- package/src/api/design/query/spaces.ts +275 -0
- package/src/api/design/selection/index.ts +273 -0
- package/src/api/design/shared.ts +40 -0
- package/src/api/design/transform/index.ts +254 -0
- package/src/api/design/types/index.ts +156 -0
- package/src/api/design/update/index.ts +798 -0
- package/src/api/design/visibility.ts +143 -0
- package/src/api/design/windows/index.ts +333 -0
- package/src/api/entity/buildableEnvelope.ts +322 -0
- package/src/api/entity/department.ts +0 -0
- package/src/api/entity/index.ts +30 -0
- package/src/api/entity/referenceLine.ts +235 -0
- package/src/api/entity/space.ts +612 -0
- package/src/api/entity/story.ts +517 -0
- package/src/api/index.ts +47 -0
- package/src/api/presentation/aiInspiration.ts +1116 -0
- package/src/api/presentation/annotate.ts +417 -0
- package/src/api/presentation/diagrams.ts +194 -0
- package/src/api/presentation/drawings.ts +529 -0
- package/src/api/presentation/export.ts +133 -0
- package/src/api/presentation/import.ts +159 -0
- package/src/api/presentation/index.ts +129 -0
- package/src/api/presentation/placedViews.ts +1203 -0
- package/src/api/presentation/shapes.ts +274 -0
- package/src/api/presentation/sheets.ts +616 -0
- package/src/api/presentation/slideshow.ts +134 -0
- package/src/api/presentation/tables.ts +84 -0
- package/src/api/presentation/viewPresets.ts +83 -0
- package/src/api/presentation/views.ts +698 -0
- package/src/api/program/adjacency.ts +164 -0
- package/src/api/program/areas.ts +408 -0
- package/src/api/program/classification.ts +138 -0
- package/src/api/program/cores.ts +83 -0
- package/src/api/program/departments.ts +517 -0
- package/src/api/program/index.ts +73 -0
- package/src/api/program/labels.ts +332 -0
- package/src/api/program/layout.ts +422 -0
- package/src/api/program/metadata.ts +364 -0
- package/src/api/program/metrics.ts +120 -0
- package/src/api/program/site.ts +748 -0
- package/src/api/program/spreadsheet.ts +2698 -0
- package/src/api/workspace/index.ts +612 -0
- package/src/errors/codes.ts +136 -0
- package/src/errors/envelope.ts +75 -0
- package/src/errors/index.ts +21 -0
- package/src/errors/plugin-error.ts +134 -0
- package/src/handles.ts +282 -0
- package/src/host-utils.ts +68 -0
- package/src/index.ts +5 -0
- package/src/types.ts +16 -0
- package/test/errors.test.mjs +184 -0
- package/tsconfig.json +22 -0
- package/tsup.config.ts +12 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { WirePluginErrorCode } from "./codes";
|
|
2
|
+
/**
|
|
3
|
+
* Structured error payload carried on the `{success: false}` branch of the RPC
|
|
4
|
+
* wire result, next to the legacy `error: string` field (additive — old
|
|
5
|
+
* clients ignore it, old hosts never set it).
|
|
6
|
+
*
|
|
7
|
+
* Errors cross the worker boundary as THIS plain object, never as a thrown
|
|
8
|
+
* class: Comlink's throw transfer strips subclasses and custom fields and
|
|
9
|
+
* leaks host stacks. plugin-client reconstructs a typed `PluginError` from it
|
|
10
|
+
* (`fromEnvelope`).
|
|
11
|
+
*/
|
|
12
|
+
export declare const ERROR_ENVELOPE_VERSION: 1;
|
|
13
|
+
export interface ErrorEnvelope {
|
|
14
|
+
envelopeVersion: typeof ERROR_ENVELOPE_VERSION;
|
|
15
|
+
code: WirePluginErrorCode;
|
|
16
|
+
/**
|
|
17
|
+
* Human-readable failure description. For INTERNAL/UNKNOWN this is a GENERIC
|
|
18
|
+
* message — the real message and stack stay host-side, logged under
|
|
19
|
+
* `errorId` (the worker is untrusted; internals must not leak).
|
|
20
|
+
*/
|
|
21
|
+
message: string;
|
|
22
|
+
/**
|
|
23
|
+
* Per-occurrence id. For INTERNAL the host logs the real message and stack
|
|
24
|
+
* under this id (the sanitized message would otherwise be an undebuggable
|
|
25
|
+
* dead end). Other codes carry the id only to identify the occurrence in
|
|
26
|
+
* bug reports — the host does not log them. Client-minted ids carry a `c-`
|
|
27
|
+
* prefix.
|
|
28
|
+
*/
|
|
29
|
+
errorId: string;
|
|
30
|
+
/** Structured, JSON-safe, code-specific data (issues / retryAfterMs / didYouMean / handles…). */
|
|
31
|
+
details?: Record<string, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Wire id of the single primary offending handle, when the failure is
|
|
34
|
+
* handle-scoped. Multiple offenders go in `details.handles: string[]`.
|
|
35
|
+
* May echo ONLY ids the caller itself supplied (anti-oracle rule).
|
|
36
|
+
*/
|
|
37
|
+
handle?: string;
|
|
38
|
+
/** Dotted method path of the failed call (e.g. "design.boolean.union"). */
|
|
39
|
+
methodPath?: string;
|
|
40
|
+
/** Machine-actionable fix suggestion (written for LLM plugin authors). */
|
|
41
|
+
hint?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Structural guard for a wire value claiming to be an `ErrorEnvelope`.
|
|
45
|
+
*
|
|
46
|
+
* Checks shape only — deliberately does NOT reject codes outside the known
|
|
47
|
+
* union, so envelopes from a newer host still pass (forward compatibility).
|
|
48
|
+
*/
|
|
49
|
+
export declare function isErrorEnvelope(value: unknown): value is ErrorEnvelope;
|
|
50
|
+
/**
|
|
51
|
+
* Mint a per-occurrence error id. Uses `crypto.randomUUID` when available
|
|
52
|
+
* (browser main thread and workers both have it); falls back to a
|
|
53
|
+
* counter+random suffix — uniqueness within a session is all that is needed.
|
|
54
|
+
*/
|
|
55
|
+
export declare function newErrorId(prefix?: string): string;
|
|
56
|
+
//# sourceMappingURL=envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../src/errors/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,EAAG,CAAU,CAAA;AAEhD,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,OAAO,sBAAsB,CAAA;IAC9C,IAAI,EAAE,mBAAmB,CAAA;IACzB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,iGAAiG;IACjG,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAStE;AAID;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,SAAK,GAAG,MAAM,CAK9C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { PLUGIN_ERROR_CODES, CODE_META, isPluginErrorCode } from "./codes";
|
|
2
|
+
export type { PluginErrorCode, WirePluginErrorCode, PluginErrorCategory, CodeMeta } from "./codes";
|
|
3
|
+
export { ERROR_ENVELOPE_VERSION, isErrorEnvelope, newErrorId } from "./envelope";
|
|
4
|
+
export type { ErrorEnvelope } from "./envelope";
|
|
5
|
+
export { PluginError, PluginValidationError, PluginNotFoundError, PluginPermissionError, PluginHandleError, PluginQuotaError, PluginTimeoutError, PluginTransportError, PluginLifecycleError, PluginExecutionError, PluginInternalError, fromEnvelope, makeClientEnvelope, } from "./plugin-error";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC1E,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElG,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAChF,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,GACnB,MAAM,gBAAgB,CAAA"}
|
|
@@ -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
|
+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Q,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"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import type { ArenaKind } from "./api/core/handles";
|
|
3
|
+
/**
|
|
4
|
+
* An opaque, kind-tagged reference to a host-side object that crosses the RPC
|
|
5
|
+
* boundary by IDENTITY rather than by value. See `PLUGIN_API_EXPOSURE_HLD.md` §9.
|
|
6
|
+
*
|
|
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.
|
|
21
|
+
*/
|
|
22
|
+
export declare class Handle<K extends string> {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
/** Phantom brand — keeps `Handle<"vec3">` ≠ `Handle<"mass">` at compile time. */
|
|
25
|
+
readonly __handle: K;
|
|
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>;
|
|
44
|
+
/**
|
|
45
|
+
* A scene-entity handle. Backed by the host `Component.id` and resolved live via
|
|
46
|
+
* the host scene index (StructureCollection) — never stored in the resource
|
|
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.
|
|
51
|
+
*/
|
|
52
|
+
export type EntityId<K extends string = string> = string & {
|
|
53
|
+
readonly __handle: K;
|
|
54
|
+
};
|
|
55
|
+
/** Resource handle: a host-resident, session-ephemeral geometry object (§9.2). */
|
|
56
|
+
export type ProfileHandle = Handle<"profile">;
|
|
57
|
+
/** Resource handle: a host-resident contour (outer profile + hole profiles). */
|
|
58
|
+
export type ContourHandle = Handle<"contour">;
|
|
59
|
+
/** Entity-handle example: a Mass / space scene object (Component.id). */
|
|
60
|
+
export type MassHandle = EntityId<"mass">;
|
|
61
|
+
/**
|
|
62
|
+
* A scene BIM entity (wall, space, slab, floor, …). Backed by `Component.id` and
|
|
63
|
+
* resolved live via the host scene index (StructureCollection) — never stored in
|
|
64
|
+
* the resource registry. Stable across undo/redo and persistable (§9.2). This is
|
|
65
|
+
* the canonical return handle for every `design.create.*` creator. The token is
|
|
66
|
+
* the raw `Component.id` — NO `"component_"` prefix, so it round-trips with the
|
|
67
|
+
* ids the host already hands out.
|
|
68
|
+
*/
|
|
69
|
+
export type ComponentHandle = EntityId<"component">;
|
|
70
|
+
/**
|
|
71
|
+
* A material handle. Like {@linkcode ComponentHandle}/`CommentHandle` this is an
|
|
72
|
+
* arena-free **entity-style** handle: the token IS the material's stable engine
|
|
73
|
+
* name (`Material.name`/`.id`), resolved live via `scene.getMaterialByName`
|
|
74
|
+
* host-side — no registry arena, no quota, no dispose, stable across undo/redo.
|
|
75
|
+
* Project-scoped, not a scene entity.
|
|
76
|
+
*/
|
|
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 **dimension line** — one measurement annotation left behind by the Measuring
|
|
98
|
+
* Tape tool (NOT a width/height/depth property; see `design.dimensions`).
|
|
99
|
+
* Entity-style: the token IS the raw engine dimension id (`dim_…`), resolved live
|
|
100
|
+
* host-side from the dimension-line registry (`getDimensionLineMap()`) — not via
|
|
101
|
+
* `ComponentUtility.FindComponentById`, which does not index dimension lines (a
|
|
102
|
+
* dimension line is not a Component). No arena, no quota, stable across
|
|
103
|
+
* undo/redo and across reloads (the record persists with the project). Returned
|
|
104
|
+
* by `design.dimensions.create` and consumed by every other
|
|
105
|
+
* `design.dimensions.*` method.
|
|
106
|
+
*/
|
|
107
|
+
export type DimensionHandle = EntityId<"dimension">;
|
|
108
|
+
/**
|
|
109
|
+
* A handle to an **asynchronous import job** (today: a DWG → Forge conversion, which
|
|
110
|
+
* can take minutes). Returned immediately by `core.io.import.dwg`; poll it via
|
|
111
|
+
* `core.io.job.*` (`getStatus` / `isComplete` / `getResult` / `getError`). The token
|
|
112
|
+
* is the engine's import request id; job state lives in a host-side registry.
|
|
113
|
+
*/
|
|
114
|
+
export type ImportJobHandle = EntityId<"importJob">;
|
|
115
|
+
export type Vec3Handle = Handle<"vec3">;
|
|
116
|
+
export type QuatHandle = Handle<"quat">;
|
|
117
|
+
export type LineHandle = Handle<"line">;
|
|
118
|
+
export type ArcHandle = Handle<"arc">;
|
|
119
|
+
/** A curve is a line or an arc — its handle is one of those kinds. */
|
|
120
|
+
export type CurveHandle = LineHandle | ArcHandle;
|
|
121
|
+
/**
|
|
122
|
+
* A circle value handle. A circle is a CLOSED curve — it deliberately does NOT
|
|
123
|
+
* join {@linkcode CurveHandle} (it has no stable start/end and would break the
|
|
124
|
+
* shared curve read contract), so it carries its own kind and its own
|
|
125
|
+
* `core.geom.query.circle` namespace (mirroring `query.arc`).
|
|
126
|
+
*/
|
|
127
|
+
export type CircleHandle = Handle<"circle">;
|
|
128
|
+
export type BrepHandle = Handle<"brep">;
|
|
129
|
+
export type FaceHandle = Handle<"face">;
|
|
130
|
+
export type EdgeHandle = Handle<"edge">;
|
|
131
|
+
/** Half-edge kind token is all-lowercase `"halfedge"` per §6.1 (no camelCase namespaces). */
|
|
132
|
+
export type HalfEdgeHandle = Handle<"halfedge">;
|
|
133
|
+
export type VertexHandle = Handle<"vertex">;
|
|
134
|
+
/**
|
|
135
|
+
* Bare primitive records — how value-handle reads return their components
|
|
136
|
+
* (§11.4). Curves have **no** by-value record: a curve crosses the boundary as a
|
|
137
|
+
* {@linkcode CurveHandle} (line/arc), and its coordinates are read via the
|
|
138
|
+
* `core.geom.query.curve` API. There is no `CurveData` under the all-handle model.
|
|
139
|
+
*/
|
|
140
|
+
export type Vec3Components = {
|
|
141
|
+
x: number;
|
|
142
|
+
y: number;
|
|
143
|
+
z: number;
|
|
144
|
+
};
|
|
145
|
+
export type QuatComponents = {
|
|
146
|
+
x: number;
|
|
147
|
+
y: number;
|
|
148
|
+
z: number;
|
|
149
|
+
w: number;
|
|
150
|
+
};
|
|
151
|
+
/** Axis-aligned bounding box, read as two primitive corner records. */
|
|
152
|
+
export type BBoxComponents = {
|
|
153
|
+
min: Vec3Components;
|
|
154
|
+
max: Vec3Components;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Build a Zod schema validating a handle of the given `kind` at the trust
|
|
158
|
+
* boundary and emitting a {@linkcode Handle} instance for impl code. Inbound
|
|
159
|
+
* forms accepted:
|
|
160
|
+
* - the bare id string (the wire form — the client unwraps args to ids)
|
|
161
|
+
* - a live `Handle` instance (host-internal re-parse, direct host callers)
|
|
162
|
+
* - `{ __h: string }` (the tagged result form, echoed back as an arg)
|
|
163
|
+
* - `{ id: string }` (a Handle stripped by structured clone at the UI boundary)
|
|
164
|
+
* Shape checking stays prefix-only; existence, kind, and ownership are enforced
|
|
165
|
+
* host-side by the HandleRegistry (§9.7) — no existence oracle.
|
|
166
|
+
*/
|
|
167
|
+
export declare const handleSchema: <K extends string>(kind: K) => z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<K>, string>>;
|
|
168
|
+
export declare const ProfileHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"profile">, string>>;
|
|
169
|
+
export declare const ContourHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"contour">, string>>;
|
|
170
|
+
/**
|
|
171
|
+
* Entity handles are raw `Component.id` strings (no `"<kind>_"` prefix) — validated
|
|
172
|
+
* only as a non-empty string, resolved live via the scene index host-side.
|
|
173
|
+
*/
|
|
174
|
+
export declare const ComponentHandle: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
175
|
+
/**
|
|
176
|
+
* Material handles are the raw `Material.name` string (entity-style, no `"<kind>_"`
|
|
177
|
+
* prefix) — validated only as non-empty, resolved live via `scene.getMaterialByName`.
|
|
178
|
+
*/
|
|
179
|
+
export declare const MaterialHandle: z.ZodPipe<z.ZodString, z.ZodTransform<MaterialHandle, string>>;
|
|
180
|
+
/**
|
|
181
|
+
* {@linkcode UnderlayHandle} / {@linkcode TerrainHandle} / {@linkcode ImportJobHandle}
|
|
182
|
+
* are entity-style handles — raw host ids, validated only as a non-empty string
|
|
183
|
+
* (no `"<kind>_"` prefix), resolved live host-side (existence enforced there).
|
|
184
|
+
*/
|
|
185
|
+
export declare const UnderlayHandle: z.ZodPipe<z.ZodString, z.ZodTransform<UnderlayHandle, string>>;
|
|
186
|
+
export declare const TerrainHandle: z.ZodPipe<z.ZodString, z.ZodTransform<TerrainHandle, string>>;
|
|
187
|
+
export declare const ImportJobHandle: z.ZodPipe<z.ZodString, z.ZodTransform<ImportJobHandle, string>>;
|
|
188
|
+
/**
|
|
189
|
+
* {@linkcode DimensionHandle} is an entity-style handle — the raw `dim_…` engine
|
|
190
|
+
* id, validated only as a non-empty string (no `"<kind>_"` prefix enforcement),
|
|
191
|
+
* resolved live host-side against the dimension-line registry (existence
|
|
192
|
+
* enforced there, as `HANDLE_INVALID`).
|
|
193
|
+
*/
|
|
194
|
+
export declare const DimensionHandle: z.ZodPipe<z.ZodString, z.ZodTransform<DimensionHandle, string>>;
|
|
195
|
+
export declare const Vec3Handle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"vec3">, string>>;
|
|
196
|
+
export declare const QuatHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"quat">, string>>;
|
|
197
|
+
export declare const LineHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"line">, string>>;
|
|
198
|
+
export declare const ArcHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"arc">, string>>;
|
|
199
|
+
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>>]>;
|
|
200
|
+
export declare const CircleHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"circle">, string>>;
|
|
201
|
+
export declare const BrepHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"brep">, string>>;
|
|
202
|
+
export declare const FaceHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"face">, string>>;
|
|
203
|
+
export declare const EdgeHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"edge">, string>>;
|
|
204
|
+
export declare const HalfEdgeHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"halfedge">, string>>;
|
|
205
|
+
export declare const VertexHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"vertex">, string>>;
|
|
206
|
+
export declare const Vec3Components: z.ZodObject<{
|
|
207
|
+
x: z.ZodNumber;
|
|
208
|
+
y: z.ZodNumber;
|
|
209
|
+
z: z.ZodNumber;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
export declare const QuatComponents: z.ZodObject<{
|
|
212
|
+
x: z.ZodNumber;
|
|
213
|
+
y: z.ZodNumber;
|
|
214
|
+
z: z.ZodNumber;
|
|
215
|
+
w: z.ZodNumber;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
export declare const BBoxComponents: z.ZodObject<{
|
|
218
|
+
min: z.ZodObject<{
|
|
219
|
+
x: z.ZodNumber;
|
|
220
|
+
y: z.ZodNumber;
|
|
221
|
+
z: z.ZodNumber;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
max: z.ZodObject<{
|
|
224
|
+
x: z.ZodNumber;
|
|
225
|
+
y: z.ZodNumber;
|
|
226
|
+
z: z.ZodNumber;
|
|
227
|
+
}, z.core.$strip>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
//# sourceMappingURL=handles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAKlD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,MAAM,CAAC,CAAC,SAAS,MAAM;IAItB,QAA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AAA;AAEzE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,MAAM,EAAE,MAAM,CAAC,2GAef,CAAA;AAEvC,eAAO,MAAM,aAAa,gHAA0B,CAAA;AACpD,eAAO,MAAM,aAAa,gHAA0B,CAAA;AAEpD;;;GAGG;AACH,eAAO,MAAM,eAAe,iEAGa,CAAA;AAEzC;;;GAGG;AACH,eAAO,MAAM,cAAc,gEAGa,CAAA;AAExC;;;;GAIG;AACH,eAAO,MAAM,cAAc,gEAGa,CAAA;AACxC,eAAO,MAAM,aAAa,+DAGa,CAAA;AACvC,eAAO,MAAM,eAAe,iEAGa,CAAA;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,iEAGa,CAAA;AAGzC,eAAO,MAAM,UAAU,6GAAuB,CAAA;AAC9C,eAAO,MAAM,UAAU,6GAAuB,CAAA;AAC9C,eAAO,MAAM,UAAU,6GAAuB,CAAA;AAC9C,eAAO,MAAM,SAAS,4GAAsB,CAAA;AAC5C,eAAO,MAAM,WAAW,gPAAmC,CAAA;AAC3D,eAAO,MAAM,YAAY,+GAAyB,CAAA;AAIlD,eAAO,MAAM,UAAU,6GAAuB,CAAA;AAC9C,eAAO,MAAM,UAAU,6GAAuB,CAAA;AAC9C,eAAO,MAAM,UAAU,6GAAuB,CAAA;AAC9C,eAAO,MAAM,cAAc,iHAA2B,CAAA;AACtD,eAAO,MAAM,YAAY,+GAAyB,CAAA;AAClD,eAAO,MAAM,cAAc;;;;iBAA4D,CAAA;AACvF,eAAO,MAAM,cAAc;;;;;iBAKzB,CAAA;AACF,eAAO,MAAM,cAAc;;;;;;;;;;;iBAAyD,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { PluginApi } from "./api";
|
|
2
|
+
import type { ErrorEnvelope } from "./errors";
|
|
3
|
+
/**
|
|
4
|
+
* UnionToIntersection is a type utility that converts a union type to an intersection type.
|
|
5
|
+
*/
|
|
6
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
7
|
+
type Flatten<T> = {
|
|
8
|
+
[K in keyof T]: T[K];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The full parameter tuple of a method — the positional-args transport forwards
|
|
12
|
+
* the whole argument list (`[]` for no-arg methods).
|
|
13
|
+
*/
|
|
14
|
+
type MethodArgs<F extends (...args: any[]) => any> = Parameters<F>;
|
|
15
|
+
type MethodReturn<F extends (...args: any[]) => any> = Awaited<ReturnType<F>>;
|
|
16
|
+
/**
|
|
17
|
+
* Recursively walks a type tree and produces a union of single-key Records
|
|
18
|
+
* for every leaf method, using dot-separated paths as keys.
|
|
19
|
+
*/
|
|
20
|
+
type ExtractMethodPaths<T, Prefix extends string = ""> = {
|
|
21
|
+
[K in keyof T & string]: T[K] extends (...args: any[]) => any ? Record<`${Prefix}${K}`, {
|
|
22
|
+
args: MethodArgs<T[K]>;
|
|
23
|
+
return: MethodReturn<T[K]>;
|
|
24
|
+
}> : T[K] extends object ? ExtractMethodPaths<T[K], `${Prefix}${K}.`> : never;
|
|
25
|
+
}[keyof T & string];
|
|
26
|
+
/**
|
|
27
|
+
* Maps every plugin API method path to its argument and return types.
|
|
28
|
+
* Automatically inferred from the PluginApi abstract class hierarchy.
|
|
29
|
+
*/
|
|
30
|
+
export type PluginApiMethodMap = Flatten<UnionToIntersection<ExtractMethodPaths<PluginApi>>>;
|
|
31
|
+
export type PluginApiMethod = keyof PluginApiMethodMap;
|
|
32
|
+
export type PluginApiCallPayload<M extends PluginApiMethod = PluginApiMethod> = {
|
|
33
|
+
method: M;
|
|
34
|
+
/** Positional argument tuple, spread back into the method host-side. */
|
|
35
|
+
args: PluginApiMethodMap[M]["args"];
|
|
36
|
+
};
|
|
37
|
+
export type PluginApiCallResult<M extends PluginApiMethod> = PluginApiMethodMap[M]["return"];
|
|
38
|
+
export type PluginApiCallWrappedResult<M extends PluginApiMethod> = {
|
|
39
|
+
success: boolean;
|
|
40
|
+
data?: PluginApiCallResult<M>;
|
|
41
|
+
/** Legacy failure message — kept verbatim for already-published plugins. */
|
|
42
|
+
error?: string;
|
|
43
|
+
/** Structured failure (hosts ≥ error-envelope rollout). Present iff `success` is false. */
|
|
44
|
+
errorInfo?: ErrorEnvelope;
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=host-utils.d.ts.map
|
|
@@ -0,0 +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;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAI7C;;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,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,G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