@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
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A unique identifier for a component in the Snaptrude scene.
|
|
3
|
+
*
|
|
4
|
+
* Component IDs are returned by entity creation methods (e.g.
|
|
5
|
+
* {@linkcode PluginSpaceApi.createRectangular}) and can be used with
|
|
6
|
+
* query and transform methods throughout the API.
|
|
7
|
+
*/
|
|
8
|
+
export type ComponentId = string;
|
|
9
|
+
/**
|
|
10
|
+
* Return type for a plugin API method.
|
|
11
|
+
*
|
|
12
|
+
* Methods that require a host round-trip return `Promise<T>`,
|
|
13
|
+
* while pure local computations may return `T` directly.
|
|
14
|
+
*/
|
|
15
|
+
export type PluginApiReturn<T> = Promise<T> | T;
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAEhC;;;;;GAKG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@snaptrude/plugin-core",
|
|
3
|
+
"version": "0.0.0-bimsvg-20260928124803",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"require": "./dist/index.cjs",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"ts-morph": "^28.0.0",
|
|
21
|
+
"tsup": "^8.5.1",
|
|
22
|
+
"typescript": "^5.5.4"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"zod": "^4.3.6"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"zod": "^3.25.0 || ^4.0.0"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"check-types": "tsc --noEmit",
|
|
32
|
+
"build": "tsup --clean",
|
|
33
|
+
"dev": "tsup --watch",
|
|
34
|
+
"clean-dist": "rm -rf dist",
|
|
35
|
+
"test": "node --test test/*.test.mjs",
|
|
36
|
+
"generate:manifest": "node scripts/generate-manifest.mjs",
|
|
37
|
+
"generate:manifest:check": "node scripts/generate-manifest.mjs --check",
|
|
38
|
+
"generate:manifest:all": "node scripts/generate-manifest.mjs --all",
|
|
39
|
+
"generate:manifest:all:check": "node scripts/generate-manifest.mjs --all --check"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// Discovery-manifest generator.
|
|
2
|
+
//
|
|
3
|
+
// The plugin API surface is a tree of abstract `Plugin*Api` classes; the wire
|
|
4
|
+
// method map (`PluginApiMethodMap`) is TYPE-LEVEL ONLY and cannot be enumerated
|
|
5
|
+
// at runtime. This script statically walks the abstract+Zod source with ts-morph
|
|
6
|
+
// and emits a flat, machine-readable manifest of every leaf method:
|
|
7
|
+
//
|
|
8
|
+
// { path, namespace, summary, examplePrompts[], argsType, resultType }
|
|
9
|
+
//
|
|
10
|
+
// The manifest is the substrate the discovery server (plugin-mcp-server) and the
|
|
11
|
+
// retrieval-accuracy eval harness key on. Authors only ever write the abstract
|
|
12
|
+
// class + Zod schemas + JSDoc + `@examplePrompt` lines — this regenerates the rest.
|
|
13
|
+
//
|
|
14
|
+
// Run: `pnpm --filter @snaptrude/plugin-core generate:manifest`
|
|
15
|
+
// add `--check` to assert the on-disk manifest is up-to-date (CI gate);
|
|
16
|
+
// exits non-zero without writing if regeneration would change it.
|
|
17
|
+
import { Project } from "ts-morph"
|
|
18
|
+
import { fileURLToPath } from "node:url"
|
|
19
|
+
import { dirname, resolve } from "node:path"
|
|
20
|
+
import { writeFileSync, readFileSync, existsSync } from "node:fs"
|
|
21
|
+
|
|
22
|
+
const here = dirname(fileURLToPath(import.meta.url))
|
|
23
|
+
const pkgRoot = resolve(here, "..")
|
|
24
|
+
const apiGlob = resolve(pkgRoot, "src/api/**/*.ts")
|
|
25
|
+
const outFile = resolve(pkgRoot, "api-manifest.json")
|
|
26
|
+
|
|
27
|
+
const ROOT_CLASS = "PluginApi"
|
|
28
|
+
const RETURN_WRAPPER = "PluginApiReturn"
|
|
29
|
+
|
|
30
|
+
/** First paragraph of a JSDoc description, whitespace-collapsed. */
|
|
31
|
+
function summaryOf(jsDoc) {
|
|
32
|
+
if (!jsDoc) return ""
|
|
33
|
+
const desc = (jsDoc.getDescription() ?? "").trim()
|
|
34
|
+
const firstPara = desc.split(/\n\s*\n/)[0] ?? ""
|
|
35
|
+
return firstPara.replace(/\s+/g, " ").trim()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** All `@examplePrompt` comment strings on a method's JSDoc. */
|
|
39
|
+
function examplePromptsOf(jsDoc) {
|
|
40
|
+
if (!jsDoc) return []
|
|
41
|
+
return jsDoc
|
|
42
|
+
.getTags()
|
|
43
|
+
.filter((t) => t.getTagName() === "examplePrompt")
|
|
44
|
+
.map((t) => (t.getCommentText() ?? "").trim())
|
|
45
|
+
.filter(Boolean)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The single `@performance` note on a method's JSDoc, if any.
|
|
50
|
+
*
|
|
51
|
+
* A short throughput hint the discovery layer surfaces so a code generator picks
|
|
52
|
+
* the bulk/array API over a per-item loop (each API call is one host round-trip).
|
|
53
|
+
* Authored on the plural/array methods; absent on everything else (the field is
|
|
54
|
+
* omitted from the manifest entry entirely when there is no tag, to keep the diff
|
|
55
|
+
* — and the LLM's attention — on the methods where it matters).
|
|
56
|
+
*/
|
|
57
|
+
function performanceOf(jsDoc) {
|
|
58
|
+
if (!jsDoc) return ""
|
|
59
|
+
const tag = jsDoc.getTags().find((t) => t.getTagName() === "performance")
|
|
60
|
+
return (tag?.getCommentText() ?? "").replace(/\s+/g, " ").trim()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The `@deprecated` marker for a method, or "" when the method is not deprecated.
|
|
65
|
+
*
|
|
66
|
+
* When the tag text names a replacement API as a dotted path — conventionally in
|
|
67
|
+
* backticks, e.g. `` `core.handles.release([profile])` `` — we surface just that
|
|
68
|
+
* path (call/array suffix stripped) so the discovery layer can point callers
|
|
69
|
+
* straight at the successor. Otherwise we fall back to the tag's prose, or `true`
|
|
70
|
+
* when the tag carries no comment. Methods with no `@deprecated` tag return "" and
|
|
71
|
+
* get NO key in the manifest (the spread of "" is dropped), keeping the diff lean.
|
|
72
|
+
*/
|
|
73
|
+
function deprecatedOf(jsDoc) {
|
|
74
|
+
if (!jsDoc) return ""
|
|
75
|
+
const tag = jsDoc.getTags().find((t) => t.getTagName() === "deprecated")
|
|
76
|
+
if (!tag) return ""
|
|
77
|
+
const text = (tag.getCommentText() ?? "").replace(/\s+/g, " ").trim()
|
|
78
|
+
for (const span of text.match(/`[^`]+`/g) ?? []) {
|
|
79
|
+
const path = span.match(/[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+/)
|
|
80
|
+
if (path) return path[0]
|
|
81
|
+
}
|
|
82
|
+
return text || true
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Strip the `PluginApiReturn<...>` wrapper to the inner result type text. */
|
|
86
|
+
function unwrapReturn(text) {
|
|
87
|
+
if (!text) return "void"
|
|
88
|
+
const m = text.match(new RegExp(`^${RETURN_WRAPPER}<([\\s\\S]*)>$`))
|
|
89
|
+
return (m ? m[1] : text).trim()
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Statically walk the abstract `PluginApi` class tree and return one flat,
|
|
94
|
+
* sorted manifest entry per leaf method. Pure (no side effects) so it is unit
|
|
95
|
+
* testable; the CLI below adds the write + report.
|
|
96
|
+
*/
|
|
97
|
+
export function buildManifest({ includeOptional = false } = {}) {
|
|
98
|
+
const project = new Project({ skipAddingFilesFromTsConfig: true })
|
|
99
|
+
project.addSourceFilesAtPaths(apiGlob)
|
|
100
|
+
|
|
101
|
+
// className -> ClassDeclaration, for every abstract Plugin*Api class.
|
|
102
|
+
const classes = new Map()
|
|
103
|
+
for (const sf of project.getSourceFiles()) {
|
|
104
|
+
for (const cls of sf.getClasses()) {
|
|
105
|
+
const name = cls.getName()
|
|
106
|
+
if (name && name.startsWith("Plugin") && name.endsWith("Api")) {
|
|
107
|
+
classes.set(name, cls)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const leaves = []
|
|
113
|
+
|
|
114
|
+
function walk(className, pathPrefix) {
|
|
115
|
+
const cls = classes.get(className)
|
|
116
|
+
if (!cls) return
|
|
117
|
+
|
|
118
|
+
// Leaf methods on this namespace.
|
|
119
|
+
for (const method of cls.getMethods()) {
|
|
120
|
+
const name = method.getName()
|
|
121
|
+
const jsDoc = method.getJsDocs().at(-1) ?? null
|
|
122
|
+
const param = method.getParameters()[0]
|
|
123
|
+
const performance = performanceOf(jsDoc)
|
|
124
|
+
const deprecated = deprecatedOf(jsDoc)
|
|
125
|
+
leaves.push({
|
|
126
|
+
path: `${pathPrefix}${name}`,
|
|
127
|
+
namespace: pathPrefix.replace(/\.$/, ""),
|
|
128
|
+
summary: summaryOf(jsDoc),
|
|
129
|
+
examplePrompts: examplePromptsOf(jsDoc),
|
|
130
|
+
argsType: param?.getTypeNode()?.getText() ?? null,
|
|
131
|
+
resultType: unwrapReturn(method.getReturnTypeNode()?.getText()),
|
|
132
|
+
...(performance ? { performance } : {}),
|
|
133
|
+
...(deprecated ? { deprecated } : {}),
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Sub-namespaces are abstract properties typed as another Plugin*Api class.
|
|
138
|
+
//
|
|
139
|
+
// Author-ahead discipline: a member declared optional (`?`) is authored
|
|
140
|
+
// BEFORE the host implements it — present in the type tree (so plugins and
|
|
141
|
+
// codegen see the shape) but kept OUT of the discovery manifest until it is
|
|
142
|
+
// promoted to a required `abstract` member in the wave the host lands it.
|
|
143
|
+
// The default (discovery) build skips optional members; the authored-surface
|
|
144
|
+
// build (`includeOptional`, used by the retrieval eval) includes them — both
|
|
145
|
+
// the optional sub-namespaces and the optional function-property leaves.
|
|
146
|
+
for (const prop of cls.getProperties()) {
|
|
147
|
+
const optional = prop.hasQuestionToken()
|
|
148
|
+
if (optional && !includeOptional) continue
|
|
149
|
+
const typeNode = prop.getTypeNode()
|
|
150
|
+
const childType = typeNode?.getText()
|
|
151
|
+
if (childType && classes.has(childType)) {
|
|
152
|
+
walk(childType, `${pathPrefix}${prop.getName()}.`)
|
|
153
|
+
} else if (
|
|
154
|
+
includeOptional &&
|
|
155
|
+
typeNode &&
|
|
156
|
+
typeNode.getKindName() === "FunctionType"
|
|
157
|
+
) {
|
|
158
|
+
// An optional author-ahead leaf, written as a function-property.
|
|
159
|
+
const jsDoc = prop.getJsDocs().at(-1) ?? null
|
|
160
|
+
const param = typeNode.getParameters()[0]
|
|
161
|
+
const performance = performanceOf(jsDoc)
|
|
162
|
+
const deprecated = deprecatedOf(jsDoc)
|
|
163
|
+
leaves.push({
|
|
164
|
+
path: `${pathPrefix}${prop.getName()}`,
|
|
165
|
+
namespace: pathPrefix.replace(/\.$/, ""),
|
|
166
|
+
summary: summaryOf(jsDoc),
|
|
167
|
+
examplePrompts: examplePromptsOf(jsDoc),
|
|
168
|
+
argsType: param?.getTypeNode()?.getText() ?? null,
|
|
169
|
+
resultType: unwrapReturn(typeNode.getReturnTypeNode()?.getText()),
|
|
170
|
+
...(performance ? { performance } : {}),
|
|
171
|
+
...(deprecated ? { deprecated } : {}),
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
walk(ROOT_CLASS, "")
|
|
178
|
+
leaves.sort((a, b) => a.path.localeCompare(b.path))
|
|
179
|
+
return leaves
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// --- CLI: write + report (skipped when imported, e.g. by tests) ------------
|
|
183
|
+
if (
|
|
184
|
+
process.argv[1] &&
|
|
185
|
+
resolve(process.argv[1]) === fileURLToPath(import.meta.url)
|
|
186
|
+
) {
|
|
187
|
+
// `--all` builds the AUTHORED-surface manifest (includes optional author-ahead
|
|
188
|
+
// members) to a separate file, for the retrieval eval. Default builds the
|
|
189
|
+
// discovery manifest (required/host-landed members only).
|
|
190
|
+
const all = process.argv.includes("--all")
|
|
191
|
+
const check = process.argv.includes("--check")
|
|
192
|
+
const target = all ? resolve(pkgRoot, "api-manifest.full.json") : outFile
|
|
193
|
+
const leaves = buildManifest({ includeOptional: all })
|
|
194
|
+
const json = JSON.stringify(leaves, null, 2) + "\n"
|
|
195
|
+
|
|
196
|
+
if (check) {
|
|
197
|
+
// Determinism / staleness gate: regenerate and compare, never write.
|
|
198
|
+
const current = existsSync(target) ? readFileSync(target, "utf8") : ""
|
|
199
|
+
if (current !== json) {
|
|
200
|
+
console.error(
|
|
201
|
+
`${target} is STALE or non-deterministic — run \`generate:manifest${all ? " --all" : ""}\` and commit the result.`,
|
|
202
|
+
)
|
|
203
|
+
process.exit(1)
|
|
204
|
+
}
|
|
205
|
+
console.log(
|
|
206
|
+
`manifest up-to-date & deterministic (${leaves.length} methods)`,
|
|
207
|
+
)
|
|
208
|
+
process.exit(0)
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
writeFileSync(target, json)
|
|
212
|
+
|
|
213
|
+
const missingPrompts = leaves.filter((l) => l.examplePrompts.length === 0)
|
|
214
|
+
console.log(
|
|
215
|
+
`manifest${all ? " (authored surface)" : ""}: ${leaves.length} methods -> ${target}`,
|
|
216
|
+
)
|
|
217
|
+
console.log(
|
|
218
|
+
`coverage: ${leaves.length - missingPrompts.length}/${leaves.length} methods have @examplePrompt lines`,
|
|
219
|
+
)
|
|
220
|
+
if (missingPrompts.length) {
|
|
221
|
+
console.log(
|
|
222
|
+
` (no @examplePrompt yet: ${missingPrompts.map((l) => l.path).join(", ")})`,
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
const slice = [
|
|
226
|
+
"program.departments.list",
|
|
227
|
+
"program.departments.get",
|
|
228
|
+
"program.metrics.get",
|
|
229
|
+
"presentation.views.list",
|
|
230
|
+
]
|
|
231
|
+
console.log("slice methods present:")
|
|
232
|
+
for (const p of slice) {
|
|
233
|
+
const hit = leaves.find((l) => l.path === p)
|
|
234
|
+
console.log(
|
|
235
|
+
` ${hit ? "OK " : "MISS"} ${p}${hit ? ` (${hit.examplePrompts.length} prompts)` : ""}`,
|
|
236
|
+
)
|
|
237
|
+
}
|
|
238
|
+
}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
// Unit tests for the discovery-manifest generator (pure codegen logic).
|
|
2
|
+
// Run: `node --test scripts/generate-manifest.test.mjs` (from packages/plugin-core)
|
|
3
|
+
import { test } from "node:test"
|
|
4
|
+
import assert from "node:assert/strict"
|
|
5
|
+
import { buildManifest } from "./generate-manifest.mjs"
|
|
6
|
+
|
|
7
|
+
const manifest = buildManifest()
|
|
8
|
+
const byPath = new Map(manifest.map((m) => [m.path, m]))
|
|
9
|
+
|
|
10
|
+
test("every entry has a dotted path and a namespace", () => {
|
|
11
|
+
for (const m of manifest) {
|
|
12
|
+
assert.match(m.path, /^[a-z][a-zA-Z0-9.]*$/, `bad path: ${m.path}`)
|
|
13
|
+
assert.equal(typeof m.namespace, "string")
|
|
14
|
+
assert.ok(
|
|
15
|
+
Array.isArray(m.examplePrompts),
|
|
16
|
+
`${m.path} examplePrompts not array`,
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
test("output is sorted and unique by path", () => {
|
|
22
|
+
const paths = manifest.map((m) => m.path)
|
|
23
|
+
assert.deepEqual(
|
|
24
|
+
paths,
|
|
25
|
+
[...paths].sort((a, b) => a.localeCompare(b)),
|
|
26
|
+
"not sorted",
|
|
27
|
+
)
|
|
28
|
+
assert.equal(new Set(paths).size, paths.length, "duplicate paths")
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
test("all 4 Phase-1 slice methods are present with intent + prompts", () => {
|
|
32
|
+
const slice = [
|
|
33
|
+
"program.departments.list",
|
|
34
|
+
"program.departments.get",
|
|
35
|
+
"program.metrics.get",
|
|
36
|
+
"presentation.views.list",
|
|
37
|
+
]
|
|
38
|
+
for (const p of slice) {
|
|
39
|
+
const m = byPath.get(p)
|
|
40
|
+
assert.ok(m, `missing slice method: ${p}`)
|
|
41
|
+
assert.ok(m.summary.length > 0, `${p} has no intent summary`)
|
|
42
|
+
assert.ok(m.examplePrompts.length >= 3, `${p} has < 3 example prompts`)
|
|
43
|
+
assert.ok(
|
|
44
|
+
m.resultType && m.resultType !== "void",
|
|
45
|
+
`${p} has no result type`,
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
test("departments.get carries its args type; list takes no args", () => {
|
|
51
|
+
assert.equal(byPath.get("program.departments.get").argsType, "string")
|
|
52
|
+
assert.equal(byPath.get("program.departments.list").argsType, null)
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
test("return-type wrapper PluginApiReturn<...> is unwrapped", () => {
|
|
56
|
+
for (const m of manifest) {
|
|
57
|
+
assert.ok(
|
|
58
|
+
!/^PluginApiReturn</.test(m.resultType ?? ""),
|
|
59
|
+
`${m.path} not unwrapped`,
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
test("author-ahead (optional) members are kept OUT of the manifest", () => {
|
|
65
|
+
// Optional sub-namespaces (`aiInspiration?`) and optional leaf methods
|
|
66
|
+
// (`departments.delete?`, `cores.create?`) are authored ahead of the host and
|
|
67
|
+
// must not appear in the discovery manifest until promoted to required
|
|
68
|
+
// `abstract` members. (See the discipline note in generate-manifest.mjs.)
|
|
69
|
+
const authoredAhead = [
|
|
70
|
+
"presentation.aiInspiration.listModels",
|
|
71
|
+
"program.departments.delete",
|
|
72
|
+
"program.cores.create",
|
|
73
|
+
]
|
|
74
|
+
for (const p of authoredAhead) {
|
|
75
|
+
assert.ok(
|
|
76
|
+
!byPath.has(p),
|
|
77
|
+
`optional author-ahead member leaked into manifest: ${p}`,
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
test("promoted methods are present in the manifest", () => {
|
|
83
|
+
// Methods whose react host bodies have landed and been verified, flipped from
|
|
84
|
+
// optional author-ahead to required `abstract`.
|
|
85
|
+
const promoted = [
|
|
86
|
+
"program.departments.create",
|
|
87
|
+
"program.departments.setTargetArea",
|
|
88
|
+
"program.site.get",
|
|
89
|
+
"program.site.getContext",
|
|
90
|
+
"presentation.import.image",
|
|
91
|
+
"presentation.import.pdf",
|
|
92
|
+
"presentation.sheets.list",
|
|
93
|
+
"presentation.sheets.place",
|
|
94
|
+
"presentation.diagrams.place",
|
|
95
|
+
// 2026-07-02 promotions — react hosts landed and verified:
|
|
96
|
+
"program.spreadsheet.render",
|
|
97
|
+
"program.adjacency.getMatrix",
|
|
98
|
+
"program.adjacency.compute",
|
|
99
|
+
"program.spreadsheet.getTakeoff",
|
|
100
|
+
"program.spreadsheet.runScript",
|
|
101
|
+
"presentation.views.get",
|
|
102
|
+
"presentation.views.getActive",
|
|
103
|
+
"presentation.views.capture",
|
|
104
|
+
"presentation.views.setActive",
|
|
105
|
+
"presentation.views.create",
|
|
106
|
+
"core.layers.setActive",
|
|
107
|
+
"core.layers.update",
|
|
108
|
+
"program.areas.update",
|
|
109
|
+
// 2026-07-06 promotions — analysis namespace + program.site geo reads,
|
|
110
|
+
// react hosts landed:
|
|
111
|
+
"analysis.sunpath.enable",
|
|
112
|
+
"analysis.sunpath.disable",
|
|
113
|
+
"analysis.sunpath.isActive",
|
|
114
|
+
"analysis.shadows.enable",
|
|
115
|
+
"analysis.shadows.disable",
|
|
116
|
+
"analysis.shadows.isEnabled",
|
|
117
|
+
"analysis.shadows.setDateTime",
|
|
118
|
+
"analysis.shadows.getDateTime",
|
|
119
|
+
"analysis.sunlightHours.compute",
|
|
120
|
+
"analysis.sunlightHours.get",
|
|
121
|
+
"analysis.sunlightHours.cancel",
|
|
122
|
+
"analysis.sunlightHours.reset",
|
|
123
|
+
"analysis.illuminance.compute",
|
|
124
|
+
"analysis.illuminance.get",
|
|
125
|
+
"analysis.illuminance.cancel",
|
|
126
|
+
"analysis.illuminance.reset",
|
|
127
|
+
"program.site.getLocation",
|
|
128
|
+
"program.site.getNorthAngle",
|
|
129
|
+
// 2026-07-07 promotion — analysis.heatmaps, react host landed:
|
|
130
|
+
"analysis.heatmaps.renderSpaces",
|
|
131
|
+
"analysis.heatmaps.renderGrid",
|
|
132
|
+
"analysis.heatmaps.reset",
|
|
133
|
+
"analysis.heatmaps.isActive",
|
|
134
|
+
// 2026-07-09 promotion — program.layout became an async-job family (was
|
|
135
|
+
// author-ahead optional `arrange`/`pack`; now required + getState/cancel):
|
|
136
|
+
"program.layout.arrange",
|
|
137
|
+
"program.layout.pack",
|
|
138
|
+
"program.layout.getState",
|
|
139
|
+
"program.layout.cancel",
|
|
140
|
+
]
|
|
141
|
+
for (const p of promoted) {
|
|
142
|
+
assert.ok(
|
|
143
|
+
byPath.has(p),
|
|
144
|
+
`expected promoted method missing from manifest: ${p}`,
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
test("v2 family reads (all 5 families) are present with intent + prompts", () => {
|
|
150
|
+
// All 22 reads of the five landed families. Every sub-api mount is now required
|
|
151
|
+
// `abstract` (the react hosts have landed), so each read is in the discovery
|
|
152
|
+
// manifest with a summary, >= 3 example prompts, and a result type.
|
|
153
|
+
const reads = [
|
|
154
|
+
"core.groups.list",
|
|
155
|
+
"core.groups.get",
|
|
156
|
+
"core.groups.getForComponent",
|
|
157
|
+
"core.groups.listMembers",
|
|
158
|
+
"core.groups.isLocked",
|
|
159
|
+
"core.groups.getBounds",
|
|
160
|
+
"core.buildings.list",
|
|
161
|
+
"core.buildings.get",
|
|
162
|
+
"core.buildings.listStoreys",
|
|
163
|
+
"core.buildings.getActive",
|
|
164
|
+
"core.layers.list",
|
|
165
|
+
"core.layers.get",
|
|
166
|
+
"core.layers.getActive",
|
|
167
|
+
"core.tags.listCategories",
|
|
168
|
+
"core.tags.getCategory",
|
|
169
|
+
"core.tags.list",
|
|
170
|
+
"core.tags.get",
|
|
171
|
+
"core.tags.getTagsForComponent",
|
|
172
|
+
"core.tags.listComponents",
|
|
173
|
+
"program.areas.get",
|
|
174
|
+
"program.areas.list",
|
|
175
|
+
"program.areas.listMembers",
|
|
176
|
+
]
|
|
177
|
+
for (const p of reads) {
|
|
178
|
+
const m = byPath.get(p)
|
|
179
|
+
assert.ok(m, `missing v2 family read: ${p}`)
|
|
180
|
+
assert.ok(m.summary.length > 0, `${p} has no intent summary`)
|
|
181
|
+
assert.ok(m.examplePrompts.length >= 3, `${p} has < 3 example prompts`)
|
|
182
|
+
assert.ok(
|
|
183
|
+
m.resultType && m.resultType !== "void",
|
|
184
|
+
`${p} has no result type`,
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
test("v2 family writes are IN the discovery manifest (hosts landed, promoted)", () => {
|
|
190
|
+
// 2026-07-02: every v2 family write's react host body has landed, so the
|
|
191
|
+
// contract members were promoted from optional `foo?: (args) => ...`
|
|
192
|
+
// fn-properties to required `abstract` methods — they now appear in the
|
|
193
|
+
// discovery build.
|
|
194
|
+
const promotedWrites = [
|
|
195
|
+
"core.groups.create",
|
|
196
|
+
"core.groups.update",
|
|
197
|
+
"core.groups.delete",
|
|
198
|
+
"core.buildings.setActive",
|
|
199
|
+
"core.buildings.create",
|
|
200
|
+
"core.buildings.update",
|
|
201
|
+
"core.buildings.copy",
|
|
202
|
+
"core.buildings.delete",
|
|
203
|
+
"core.layers.setActive",
|
|
204
|
+
"core.layers.update",
|
|
205
|
+
"core.tags.createCategory",
|
|
206
|
+
"core.tags.updateCategory",
|
|
207
|
+
"core.tags.deleteCategory",
|
|
208
|
+
"core.tags.create",
|
|
209
|
+
"core.tags.update",
|
|
210
|
+
"core.tags.delete",
|
|
211
|
+
"core.tags.assign",
|
|
212
|
+
"core.tags.unassign",
|
|
213
|
+
"program.areas.update",
|
|
214
|
+
]
|
|
215
|
+
for (const p of promotedWrites) {
|
|
216
|
+
assert.ok(
|
|
217
|
+
byPath.has(p),
|
|
218
|
+
`promoted v2 family write missing from manifest: ${p}`,
|
|
219
|
+
)
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
test("0.7.0 batch — new families & methods present with intent + prompts", () => {
|
|
224
|
+
// The 0.7.0 wave: core.proposals, the program.layout async-job family,
|
|
225
|
+
// door/window catalogs + placement, furniture categories, smart layout,
|
|
226
|
+
// align, per-face materials, staircase read/write, footprint-area lock,
|
|
227
|
+
// storey duplicate, SVG import, and view display settings. Every entry is a
|
|
228
|
+
// required `abstract` member (react hosts landed), so each must be in the
|
|
229
|
+
// discovery manifest with a summary, >= 3 example prompts, and a result type.
|
|
230
|
+
const batch = [
|
|
231
|
+
// core.proposals — design-option infrastructure
|
|
232
|
+
"core.proposals.list",
|
|
233
|
+
"core.proposals.get",
|
|
234
|
+
"core.proposals.getActive",
|
|
235
|
+
"core.proposals.listForComponent",
|
|
236
|
+
"core.proposals.isActive",
|
|
237
|
+
"core.proposals.create",
|
|
238
|
+
"core.proposals.rename",
|
|
239
|
+
"core.proposals.setActive",
|
|
240
|
+
"core.proposals.delete",
|
|
241
|
+
// program.layout — async space-solver job family
|
|
242
|
+
"program.layout.arrange",
|
|
243
|
+
"program.layout.pack",
|
|
244
|
+
"program.layout.getState",
|
|
245
|
+
"program.layout.cancel",
|
|
246
|
+
// door / window catalogs (shared DTOs) + placement creators
|
|
247
|
+
"design.doors.listCatalogGroups",
|
|
248
|
+
"design.doors.listCatalog",
|
|
249
|
+
"design.doors.getCatalogItem",
|
|
250
|
+
"design.doors.exists",
|
|
251
|
+
"design.windows.listCatalogGroups",
|
|
252
|
+
"design.windows.listCatalog",
|
|
253
|
+
"design.windows.getCatalogItem",
|
|
254
|
+
"design.windows.exists",
|
|
255
|
+
"design.create.door",
|
|
256
|
+
"design.create.window",
|
|
257
|
+
// furniture categories + smart layout
|
|
258
|
+
"design.furniture.listCategories",
|
|
259
|
+
"design.create.smartLayout",
|
|
260
|
+
// align
|
|
261
|
+
"design.transform.align",
|
|
262
|
+
// per-face materials
|
|
263
|
+
"design.materials.applyToFaces",
|
|
264
|
+
"design.materials.resetFaces",
|
|
265
|
+
"design.materials.getByFace",
|
|
266
|
+
"design.materials.listByFace",
|
|
267
|
+
// staircase read/write
|
|
268
|
+
"design.query.getStaircaseParams",
|
|
269
|
+
"design.update.staircase",
|
|
270
|
+
// footprint-area lock
|
|
271
|
+
"design.lockArea",
|
|
272
|
+
"design.unlockArea",
|
|
273
|
+
"design.isAreaLocked",
|
|
274
|
+
"design.listAreaLocked",
|
|
275
|
+
// storey duplicate
|
|
276
|
+
"entity.story.duplicate",
|
|
277
|
+
// present-canvas SVG import + view display settings
|
|
278
|
+
"presentation.import.svg",
|
|
279
|
+
"presentation.views.getSettings",
|
|
280
|
+
"presentation.views.updateSettings",
|
|
281
|
+
]
|
|
282
|
+
for (const p of batch) {
|
|
283
|
+
const m = byPath.get(p)
|
|
284
|
+
assert.ok(m, `missing 0.7.0 batch method: ${p}`)
|
|
285
|
+
assert.ok(m.summary.length > 0, `${p} has no intent summary`)
|
|
286
|
+
assert.ok(m.examplePrompts.length >= 3, `${p} has < 3 example prompts`)
|
|
287
|
+
assert.ok(
|
|
288
|
+
m.resultType && m.resultType !== "void",
|
|
289
|
+
`${p} has no result type`,
|
|
290
|
+
)
|
|
291
|
+
}
|
|
292
|
+
})
|