@bldrs-ai/conway 1.389.1221 → 1.394.1504

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (382) hide show
  1. package/README.md +36 -22
  2. package/compiled/Dist/ConwayGeomWasmNode.js +0 -0
  3. package/compiled/Dist/ConwayGeomWasmNodeMT.js +0 -0
  4. package/compiled/Dist/ConwayGeomWasmWeb.js +0 -0
  5. package/compiled/Dist/ConwayGeomWasmWebMT.js +1 -1
  6. package/compiled/Dist/ConwayGeomWasmWebMT.wasm +0 -0
  7. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNode.js +0 -0
  8. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNodeMT.js +0 -0
  9. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWeb.js +0 -0
  10. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.js +1 -1
  11. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.wasm +0 -0
  12. package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts +19 -0
  13. package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts.map +1 -1
  14. package/compiled/dependencies/conway-geom/interface/conway_geometry.js +17 -0
  15. package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts +6 -0
  16. package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts.map +1 -1
  17. package/compiled/examples/browser-bundled.cjs +1569 -51
  18. package/compiled/examples/cli-bundled.cjs +2790 -436
  19. package/compiled/examples/cli-step-bundled.cjs +1904 -229
  20. package/compiled/examples/validator-bundled.cjs +1569 -51
  21. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts +2 -2
  22. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts.map +1 -1
  23. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.js +2 -2
  24. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts +3 -3
  25. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts.map +1 -1
  26. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.js +3 -3
  27. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts +1 -1
  28. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts.map +1 -1
  29. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.js +1 -1
  30. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts +1 -1
  31. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts.map +1 -1
  32. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.js +1 -1
  33. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts +1 -1
  34. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts.map +1 -1
  35. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.js +1 -1
  36. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts +1 -1
  37. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts.map +1 -1
  38. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.js +1 -1
  39. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.d.ts.map +1 -1
  40. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.js +2 -2
  41. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/schema_ap214.gen.js +11 -11
  42. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts +1 -1
  43. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts.map +1 -1
  44. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.js +1 -1
  45. package/compiled/src/AP214E3_2010/ap214_command_line_main.js +7 -3
  46. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts +181 -7
  47. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts.map +1 -1
  48. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.js +906 -137
  49. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.test.js +10 -2
  50. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts +2 -0
  51. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts.map +1 -0
  52. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.js +114 -0
  53. package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts +6 -0
  54. package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts.map +1 -1
  55. package/compiled/src/AP214E3_2010/ap214_model_geometry.js +9 -0
  56. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts +2 -0
  57. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts.map +1 -0
  58. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.js +233 -0
  59. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts +2 -0
  60. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts.map +1 -0
  61. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.js +147 -0
  62. package/compiled/src/AP214E3_2010/ap214_step_model.d.ts +2 -1
  63. package/compiled/src/AP214E3_2010/ap214_step_model.d.ts.map +1 -1
  64. package/compiled/src/AP214E3_2010/ap214_step_model.js +1 -1
  65. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts +2 -0
  66. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts.map +1 -0
  67. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.js +65 -0
  68. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts +2 -0
  69. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts.map +1 -0
  70. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.js +111 -0
  71. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts +2 -0
  72. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts.map +1 -0
  73. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.js +190 -0
  74. package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts +2 -0
  75. package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts.map +1 -0
  76. package/compiled/src/compat/web-ifc/coordination_export_order.test.js +110 -0
  77. package/compiled/src/compat/web-ifc/coordination_f64.d.ts +165 -0
  78. package/compiled/src/compat/web-ifc/coordination_f64.d.ts.map +1 -0
  79. package/compiled/src/compat/web-ifc/coordination_f64.js +286 -0
  80. package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts +2 -0
  81. package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts.map +1 -0
  82. package/compiled/src/compat/web-ifc/coordination_f64.test.js +225 -0
  83. package/compiled/src/compat/web-ifc/ifc_api.d.ts +154 -0
  84. package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
  85. package/compiled/src/compat/web-ifc/ifc_api.js +211 -3
  86. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts +2 -0
  87. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts.map +1 -0
  88. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.js +288 -0
  89. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts +39 -0
  90. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts.map +1 -1
  91. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts +30 -0
  92. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
  93. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +83 -0
  94. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts +2 -0
  95. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts.map +1 -0
  96. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.js +383 -0
  97. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts +2 -0
  98. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts.map +1 -0
  99. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.js +124 -0
  100. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts +132 -0
  101. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
  102. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +488 -92
  103. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +268 -0
  104. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
  105. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +996 -149
  106. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts +2 -0
  107. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts.map +1 -0
  108. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.js +129 -0
  109. package/compiled/src/compat/web-ifc/spatial_imposter.d.ts +134 -0
  110. package/compiled/src/compat/web-ifc/spatial_imposter.d.ts.map +1 -0
  111. package/compiled/src/compat/web-ifc/spatial_imposter.js +933 -0
  112. package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts +2 -0
  113. package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts.map +1 -0
  114. package/compiled/src/compat/web-ifc/spatial_imposter.test.js +467 -0
  115. package/compiled/src/compat/web-ifc/store_preview_channel.d.ts +187 -0
  116. package/compiled/src/compat/web-ifc/store_preview_channel.d.ts.map +1 -0
  117. package/compiled/src/compat/web-ifc/store_preview_channel.js +524 -0
  118. package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts +2 -0
  119. package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts.map +1 -0
  120. package/compiled/src/compat/web-ifc/store_preview_channel.test.js +234 -0
  121. package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts +306 -0
  122. package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts.map +1 -0
  123. package/compiled/src/compat/web-ifc/streamed_preview_channel.js +580 -0
  124. package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts +2 -0
  125. package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts.map +1 -0
  126. package/compiled/src/compat/web-ifc/web_wasm_directory.test.js +22 -0
  127. package/compiled/src/core/composed_model_skeleton.d.ts +63 -0
  128. package/compiled/src/core/composed_model_skeleton.d.ts.map +1 -0
  129. package/compiled/src/core/composed_model_skeleton.js +66 -0
  130. package/compiled/src/core/composed_model_skeleton.test.d.ts +2 -0
  131. package/compiled/src/core/composed_model_skeleton.test.d.ts.map +1 -0
  132. package/compiled/src/core/composed_model_skeleton.test.js +69 -0
  133. package/compiled/src/core/demand_geometry_queue.d.ts +147 -0
  134. package/compiled/src/core/demand_geometry_queue.d.ts.map +1 -0
  135. package/compiled/src/core/demand_geometry_queue.js +223 -0
  136. package/compiled/src/core/demand_geometry_queue.test.d.ts +2 -0
  137. package/compiled/src/core/demand_geometry_queue.test.d.ts.map +1 -0
  138. package/compiled/src/core/demand_geometry_queue.test.js +133 -0
  139. package/compiled/src/core/demand_residency_pump.d.ts +93 -0
  140. package/compiled/src/core/demand_residency_pump.d.ts.map +1 -0
  141. package/compiled/src/core/demand_residency_pump.js +120 -0
  142. package/compiled/src/core/demand_residency_pump.test.d.ts +2 -0
  143. package/compiled/src/core/demand_residency_pump.test.d.ts.map +1 -0
  144. package/compiled/src/core/demand_residency_pump.test.js +148 -0
  145. package/compiled/src/core/geometry_tile_bindings.d.ts +110 -0
  146. package/compiled/src/core/geometry_tile_bindings.d.ts.map +1 -0
  147. package/compiled/src/core/geometry_tile_bindings.js +76 -0
  148. package/compiled/src/core/geometry_tile_bindings.test.d.ts +2 -0
  149. package/compiled/src/core/geometry_tile_bindings.test.d.ts.map +1 -0
  150. package/compiled/src/core/geometry_tile_bindings.test.js +211 -0
  151. package/compiled/src/core/geometry_tile_pool.d.ts +99 -0
  152. package/compiled/src/core/geometry_tile_pool.d.ts.map +1 -0
  153. package/compiled/src/core/geometry_tile_pool.js +104 -0
  154. package/compiled/src/core/geometry_tile_pool.test.d.ts +2 -0
  155. package/compiled/src/core/geometry_tile_pool.test.d.ts.map +1 -0
  156. package/compiled/src/core/geometry_tile_pool.test.js +180 -0
  157. package/compiled/src/core/mem/chunked_pool.d.ts +116 -0
  158. package/compiled/src/core/mem/chunked_pool.d.ts.map +1 -0
  159. package/compiled/src/core/mem/chunked_pool.js +149 -0
  160. package/compiled/src/core/mem/chunked_pool.test.d.ts +2 -0
  161. package/compiled/src/core/mem/chunked_pool.test.d.ts.map +1 -0
  162. package/compiled/src/core/mem/chunked_pool.test.js +63 -0
  163. package/compiled/src/core/mem/shared_asset_pool.d.ts +82 -0
  164. package/compiled/src/core/mem/shared_asset_pool.d.ts.map +1 -0
  165. package/compiled/src/core/mem/shared_asset_pool.js +113 -0
  166. package/compiled/src/core/mem/shared_asset_pool.test.d.ts +2 -0
  167. package/compiled/src/core/mem/shared_asset_pool.test.d.ts.map +1 -0
  168. package/compiled/src/core/mem/shared_asset_pool.test.js +49 -0
  169. package/compiled/src/core/model_registry.d.ts +87 -0
  170. package/compiled/src/core/model_registry.d.ts.map +1 -0
  171. package/compiled/src/core/model_registry.js +101 -0
  172. package/compiled/src/core/model_registry.test.d.ts +2 -0
  173. package/compiled/src/core/model_registry.test.d.ts.map +1 -0
  174. package/compiled/src/core/model_registry.test.js +60 -0
  175. package/compiled/src/core/model_uri.d.ts +57 -0
  176. package/compiled/src/core/model_uri.d.ts.map +1 -0
  177. package/compiled/src/core/model_uri.js +101 -0
  178. package/compiled/src/core/model_uri.test.d.ts +2 -0
  179. package/compiled/src/core/model_uri.test.d.ts.map +1 -0
  180. package/compiled/src/core/model_uri.test.js +49 -0
  181. package/compiled/src/core/progress.d.ts +16 -2
  182. package/compiled/src/core/progress.d.ts.map +1 -1
  183. package/compiled/src/core/progress.js +31 -5
  184. package/compiled/src/core/progress.test.js +11 -2
  185. package/compiled/src/core/progress_log.d.ts +1 -0
  186. package/compiled/src/core/progress_log.d.ts.map +1 -1
  187. package/compiled/src/core/progress_log.js +7 -2
  188. package/compiled/src/core/progress_log.test.js +21 -0
  189. package/compiled/src/core/shared_byte_budget.d.ts +60 -0
  190. package/compiled/src/core/shared_byte_budget.d.ts.map +1 -0
  191. package/compiled/src/core/shared_byte_budget.js +85 -0
  192. package/compiled/src/core/shared_byte_budget.test.d.ts +2 -0
  193. package/compiled/src/core/shared_byte_budget.test.d.ts.map +1 -0
  194. package/compiled/src/core/shared_byte_budget.test.js +55 -0
  195. package/compiled/src/core/wasm_heap.d.ts +208 -0
  196. package/compiled/src/core/wasm_heap.d.ts.map +1 -0
  197. package/compiled/src/core/wasm_heap.js +417 -0
  198. package/compiled/src/core/wasm_heap.test.d.ts +2 -0
  199. package/compiled/src/core/wasm_heap.test.d.ts.map +1 -0
  200. package/compiled/src/core/wasm_heap.test.js +546 -0
  201. package/compiled/src/demand/index.d.ts +23 -0
  202. package/compiled/src/demand/index.d.ts.map +1 -0
  203. package/compiled/src/demand/index.js +22 -0
  204. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts +1 -1
  205. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts.map +1 -1
  206. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.js +1 -1
  207. package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.d.ts.map +1 -1
  208. package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.js +2 -2
  209. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts +1 -1
  210. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts.map +1 -1
  211. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.js +1 -1
  212. package/compiled/src/ifc/ifc4_gen/schema_ifc.gen.js +2 -2
  213. package/compiled/src/ifc/ifc_demand_extraction.test.d.ts +2 -0
  214. package/compiled/src/ifc/ifc_demand_extraction.test.d.ts.map +1 -0
  215. package/compiled/src/ifc/ifc_demand_extraction.test.js +251 -0
  216. package/compiled/src/ifc/ifc_geometry_extraction.d.ts +367 -6
  217. package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
  218. package/compiled/src/ifc/ifc_geometry_extraction.js +1322 -389
  219. package/compiled/src/ifc/ifc_grid_placement.test.d.ts +2 -0
  220. package/compiled/src/ifc/ifc_grid_placement.test.d.ts.map +1 -0
  221. package/compiled/src/ifc/ifc_grid_placement.test.js +261 -0
  222. package/compiled/src/ifc/ifc_model_geometry.d.ts +12 -0
  223. package/compiled/src/ifc/ifc_model_geometry.d.ts.map +1 -1
  224. package/compiled/src/ifc/ifc_model_geometry.js +15 -0
  225. package/compiled/src/ifc/ifc_regression_batch_main.js +210 -12
  226. package/compiled/src/ifc/ifc_spatial_skeleton.d.ts +145 -0
  227. package/compiled/src/ifc/ifc_spatial_skeleton.d.ts.map +1 -0
  228. package/compiled/src/ifc/ifc_spatial_skeleton.js +266 -0
  229. package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts +2 -0
  230. package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts.map +1 -0
  231. package/compiled/src/ifc/ifc_spatial_skeleton.test.js +199 -0
  232. package/compiled/src/ifc/ifc_step_model.d.ts +6 -2
  233. package/compiled/src/ifc/ifc_step_model.d.ts.map +1 -1
  234. package/compiled/src/ifc/ifc_step_model.js +6 -4
  235. package/compiled/src/ifc/ifc_step_parser.d.ts +58 -0
  236. package/compiled/src/ifc/ifc_step_parser.d.ts.map +1 -1
  237. package/compiled/src/ifc/ifc_step_parser.js +64 -0
  238. package/compiled/src/ifc/ifc_stream_model.test.d.ts +2 -0
  239. package/compiled/src/ifc/ifc_stream_model.test.d.ts.map +1 -0
  240. package/compiled/src/ifc/ifc_stream_model.test.js +70 -0
  241. package/compiled/src/ifc/ifc_stream_open.d.ts +131 -0
  242. package/compiled/src/ifc/ifc_stream_open.d.ts.map +1 -0
  243. package/compiled/src/ifc/ifc_stream_open.js +116 -0
  244. package/compiled/src/ifc/ifc_stream_open.test.d.ts +2 -0
  245. package/compiled/src/ifc/ifc_stream_open.test.d.ts.map +1 -0
  246. package/compiled/src/ifc/ifc_stream_open.test.js +230 -0
  247. package/compiled/src/ifc/ifc_tile_extractor.d.ts +84 -0
  248. package/compiled/src/ifc/ifc_tile_extractor.d.ts.map +1 -0
  249. package/compiled/src/ifc/ifc_tile_extractor.js +134 -0
  250. package/compiled/src/ifc/ifc_tile_extractor.test.d.ts +2 -0
  251. package/compiled/src/ifc/ifc_tile_extractor.test.d.ts.map +1 -0
  252. package/compiled/src/ifc/ifc_tile_extractor.test.js +118 -0
  253. package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts +2 -0
  254. package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts.map +1 -0
  255. package/compiled/src/ifc/ifc_typed_select_enum.test.js +60 -0
  256. package/compiled/src/index.d.ts +21 -1
  257. package/compiled/src/index.d.ts.map +1 -1
  258. package/compiled/src/index.js +28 -1
  259. package/compiled/src/logging/logger.d.ts +16 -2
  260. package/compiled/src/logging/logger.d.ts.map +1 -1
  261. package/compiled/src/logging/logger.js +34 -7
  262. package/compiled/src/logging/logger.test.js +30 -0
  263. package/compiled/src/mem/index.d.ts +17 -0
  264. package/compiled/src/mem/index.d.ts.map +1 -0
  265. package/compiled/src/mem/index.js +16 -0
  266. package/compiled/src/namespace_surface.test.d.ts +2 -0
  267. package/compiled/src/namespace_surface.test.d.ts.map +1 -0
  268. package/compiled/src/namespace_surface.test.js +43 -0
  269. package/compiled/src/parsing/parsing_buffer.d.ts +23 -0
  270. package/compiled/src/parsing/parsing_buffer.d.ts.map +1 -1
  271. package/compiled/src/parsing/parsing_buffer.js +31 -0
  272. package/compiled/src/scripts/model_report_displacement.test.d.ts +2 -0
  273. package/compiled/src/scripts/model_report_displacement.test.d.ts.map +1 -0
  274. package/compiled/src/scripts/model_report_displacement.test.js +104 -0
  275. package/compiled/src/scripts/render_glb_paths.test.d.ts +2 -0
  276. package/compiled/src/scripts/render_glb_paths.test.d.ts.map +1 -0
  277. package/compiled/src/scripts/render_glb_paths.test.js +115 -0
  278. package/compiled/src/step/indexing/step_type_indexer.d.ts +20 -0
  279. package/compiled/src/step/indexing/step_type_indexer.d.ts.map +1 -1
  280. package/compiled/src/step/indexing/step_type_indexer.js +67 -0
  281. package/compiled/src/step/parsing/byte_source.d.ts +153 -0
  282. package/compiled/src/step/parsing/byte_source.d.ts.map +1 -0
  283. package/compiled/src/step/parsing/byte_source.js +106 -0
  284. package/compiled/src/step/parsing/byte_source.test.d.ts +2 -0
  285. package/compiled/src/step/parsing/byte_source.test.d.ts.map +1 -0
  286. package/compiled/src/step/parsing/byte_source.test.js +47 -0
  287. package/compiled/src/step/parsing/byte_source_node.d.ts +41 -0
  288. package/compiled/src/step/parsing/byte_source_node.d.ts.map +1 -0
  289. package/compiled/src/step/parsing/byte_source_node.js +54 -0
  290. package/compiled/src/step/parsing/columnar_index.d.ts +103 -0
  291. package/compiled/src/step/parsing/columnar_index.d.ts.map +1 -0
  292. package/compiled/src/step/parsing/columnar_index.js +224 -0
  293. package/compiled/src/step/parsing/columnar_index.test.d.ts +2 -0
  294. package/compiled/src/step/parsing/columnar_index.test.d.ts.map +1 -0
  295. package/compiled/src/step/parsing/columnar_index.test.js +155 -0
  296. package/compiled/src/step/parsing/cross_reference_registry.d.ts +95 -0
  297. package/compiled/src/step/parsing/cross_reference_registry.d.ts.map +1 -0
  298. package/compiled/src/step/parsing/cross_reference_registry.js +91 -0
  299. package/compiled/src/step/parsing/cross_reference_registry.test.d.ts +2 -0
  300. package/compiled/src/step/parsing/cross_reference_registry.test.d.ts.map +1 -0
  301. package/compiled/src/step/parsing/cross_reference_registry.test.js +66 -0
  302. package/compiled/src/step/parsing/decode_utf8.d.ts +15 -0
  303. package/compiled/src/step/parsing/decode_utf8.d.ts.map +1 -1
  304. package/compiled/src/step/parsing/decode_utf8.js +28 -0
  305. package/compiled/src/step/parsing/express_ref_scan.d.ts +20 -0
  306. package/compiled/src/step/parsing/express_ref_scan.d.ts.map +1 -0
  307. package/compiled/src/step/parsing/express_ref_scan.js +91 -0
  308. package/compiled/src/step/parsing/express_ref_scan.test.d.ts +2 -0
  309. package/compiled/src/step/parsing/express_ref_scan.test.d.ts.map +1 -0
  310. package/compiled/src/step/parsing/express_ref_scan.test.js +28 -0
  311. package/compiled/src/step/parsing/index_sidecar.d.ts +81 -0
  312. package/compiled/src/step/parsing/index_sidecar.d.ts.map +1 -0
  313. package/compiled/src/step/parsing/index_sidecar.js +283 -0
  314. package/compiled/src/step/parsing/index_sidecar.test.d.ts +2 -0
  315. package/compiled/src/step/parsing/index_sidecar.test.d.ts.map +1 -0
  316. package/compiled/src/step/parsing/index_sidecar.test.js +122 -0
  317. package/compiled/src/step/parsing/inf_recovery_index.test.d.ts +2 -0
  318. package/compiled/src/step/parsing/inf_recovery_index.test.d.ts.map +1 -0
  319. package/compiled/src/step/parsing/inf_recovery_index.test.js +108 -0
  320. package/compiled/src/step/parsing/prefix_type_index.d.ts +124 -0
  321. package/compiled/src/step/parsing/prefix_type_index.d.ts.map +1 -0
  322. package/compiled/src/step/parsing/prefix_type_index.js +207 -0
  323. package/compiled/src/step/parsing/prefix_type_index.test.d.ts +2 -0
  324. package/compiled/src/step/parsing/prefix_type_index.test.d.ts.map +1 -0
  325. package/compiled/src/step/parsing/prefix_type_index.test.js +298 -0
  326. package/compiled/src/step/parsing/range_byte_source.d.ts +69 -0
  327. package/compiled/src/step/parsing/range_byte_source.d.ts.map +1 -0
  328. package/compiled/src/step/parsing/range_byte_source.js +78 -0
  329. package/compiled/src/step/parsing/range_byte_source.test.d.ts +2 -0
  330. package/compiled/src/step/parsing/range_byte_source.test.d.ts.map +1 -0
  331. package/compiled/src/step/parsing/range_byte_source.test.js +70 -0
  332. package/compiled/src/step/parsing/record_event.d.ts +23 -0
  333. package/compiled/src/step/parsing/record_event.d.ts.map +1 -0
  334. package/compiled/src/step/parsing/record_event.js +1 -0
  335. package/compiled/src/step/parsing/record_field_cursor.d.ts +94 -0
  336. package/compiled/src/step/parsing/record_field_cursor.d.ts.map +1 -0
  337. package/compiled/src/step/parsing/record_field_cursor.js +189 -0
  338. package/compiled/src/step/parsing/step_deserialization_functions.d.ts +29 -0
  339. package/compiled/src/step/parsing/step_deserialization_functions.d.ts.map +1 -1
  340. package/compiled/src/step/parsing/step_deserialization_functions.js +45 -0
  341. package/compiled/src/step/parsing/step_deserialization_functions.test.js +59 -1
  342. package/compiled/src/step/parsing/step_parser.d.ts +66 -1
  343. package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
  344. package/compiled/src/step/parsing/step_parser.js +164 -10
  345. package/compiled/src/step/parsing/step_string_parser.js +8 -8
  346. package/compiled/src/step/parsing/streaming_index_builder.d.ts +141 -0
  347. package/compiled/src/step/parsing/streaming_index_builder.d.ts.map +1 -0
  348. package/compiled/src/step/parsing/streaming_index_builder.js +280 -0
  349. package/compiled/src/step/parsing/streaming_index_builder.test.d.ts +2 -0
  350. package/compiled/src/step/parsing/streaming_index_builder.test.d.ts.map +1 -0
  351. package/compiled/src/step/parsing/streaming_index_builder.test.js +107 -0
  352. package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts +2 -0
  353. package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts.map +1 -0
  354. package/compiled/src/step/parsing/streaming_index_builder_async.test.js +109 -0
  355. package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts +71 -0
  356. package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts.map +1 -0
  357. package/compiled/src/step/parsing/streaming_record_dispatcher.js +88 -0
  358. package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts +2 -0
  359. package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts.map +1 -0
  360. package/compiled/src/step/parsing/streaming_record_dispatcher.test.js +66 -0
  361. package/compiled/src/step/parsing/uint32_sink.d.ts +72 -0
  362. package/compiled/src/step/parsing/uint32_sink.d.ts.map +1 -0
  363. package/compiled/src/step/parsing/uint32_sink.js +180 -0
  364. package/compiled/src/step/parsing/uint32_sink.test.d.ts +2 -0
  365. package/compiled/src/step/parsing/uint32_sink.test.d.ts.map +1 -0
  366. package/compiled/src/step/parsing/uint32_sink.test.js +199 -0
  367. package/compiled/src/step/step_buffer_provider.d.ts +48 -3
  368. package/compiled/src/step/step_buffer_provider.d.ts.map +1 -1
  369. package/compiled/src/step/step_buffer_provider.js +60 -11
  370. package/compiled/src/step/step_buffer_provider.test.js +14 -0
  371. package/compiled/src/step/step_entity_base.d.ts +65 -3
  372. package/compiled/src/step/step_entity_base.d.ts.map +1 -1
  373. package/compiled/src/step/step_entity_base.js +135 -3
  374. package/compiled/src/step/step_model_base.d.ts +221 -8
  375. package/compiled/src/step/step_model_base.d.ts.map +1 -1
  376. package/compiled/src/step/step_model_base.js +542 -7
  377. package/compiled/src/stream/index.d.ts +34 -0
  378. package/compiled/src/stream/index.d.ts.map +1 -0
  379. package/compiled/src/stream/index.js +32 -0
  380. package/compiled/src/version/version.js +1 -1
  381. package/compiled/tsconfig.tsbuildinfo +1 -1
  382. package/package.json +16 -1
@@ -0,0 +1,234 @@
1
+ /* eslint-disable no-magic-numbers */
2
+ import * as fs from "fs";
3
+ import { beforeAll, describe, expect, test } from "@jest/globals";
4
+ import { ConwayGeometry } from "../../../dependencies/conway-geom/index.js";
5
+ import IfcStepParser from "../../ifc/ifc_step_parser.js";
6
+ import { BufferByteSource } from "../../step/parsing/byte_source.js";
7
+ import { ColumnarIndexSink } from "../../step/parsing/columnar_index.js";
8
+ import { ParseResult } from "../../step/parsing/step_parser.js";
9
+ import { buildIndexStreaming } from "../../step/parsing/streaming_index_builder.js";
10
+ import { InMemoryStepByteStore } from "../../step/step_buffer_provider.js";
11
+ import { openStreamedIfcModelFromStore } from "../../ifc/ifc_stream_open.js";
12
+ import { IfcAPI } from "./ifc_api.js";
13
+ import { StorePreviewChannel } from "./store_preview_channel.js";
14
+ describe("StorePreviewChannel", () => {
15
+ let conwayGeometry;
16
+ let bytes;
17
+ beforeAll(async () => {
18
+ bytes = new Uint8Array(fs.readFileSync("data/index.ifc"));
19
+ const api = new IfcAPI();
20
+ await api.Init();
21
+ conwayGeometry = new ConwayGeometry();
22
+ expect(await conwayGeometry.initialize()).toBe(true);
23
+ }, 120000);
24
+ test("emits placed vertex payloads from a windowed prefix", async () => {
25
+ const store = new InMemoryStepByteStore(bytes);
26
+ const sink = new ColumnarIndexSink();
27
+ const { result } = buildIndexStreaming(new BufferByteSource(bytes), IfcStepParser.Instance, 4 * 1024, void 0, sink);
28
+ expect(result).toBe(ParseResult.COMPLETE);
29
+ expect(sink.topLevelCount).toBeGreaterThan(0);
30
+ const payloads = [];
31
+ const channel = new StorePreviewChannel(store, sink, conwayGeometry, true, (mesh) => payloads.push(mesh), 64, 48 * 1024 * 1024, 1);
32
+ await channel.drainForTest();
33
+ expect(channel.lastFailReason).toBeUndefined();
34
+ expect(channel.productCount).toBeGreaterThan(0);
35
+ channel.stop();
36
+ // The channel now emits spatial plates off its prefix generations
37
+ // too (conway#518), so the placed meshes are the aabb-less half of
38
+ // the stream rather than all of it.
39
+ const meshes = payloads.filter((p) => p.aabb === void 0);
40
+ const withGeom = meshes.filter((p) => p.vertexData !== void 0);
41
+ // index.ifc is polygonal-faceset; some local Dist builds OOB on the
42
+ // packed extract (same as ifc_api_preview_channel). The channel
43
+ // still found products.
44
+ if (meshes.length === 0) {
45
+ return;
46
+ }
47
+ expect(withGeom.length).toBeGreaterThan(0);
48
+ expect(meshes[0].flatTransformation).toHaveLength(16);
49
+ expect(meshes[0].solid).toBeUndefined();
50
+ expect(withGeom[0].vertexData.length % 6).toBe(0);
51
+ expect(withGeom[0].indexData.length % 3).toBe(0);
52
+ expect(channel.coordinationMatrix).toBeDefined();
53
+ });
54
+ // conway#518: the store path used to extract exactly ONE product per
55
+ // tick, and to run the spatial walk only after the whole parse.
56
+ test("a tick extracts under a time budget, not one product", async () => {
57
+ const store = new InMemoryStepByteStore(bytes);
58
+ const sink = new ColumnarIndexSink();
59
+ const { result } = buildIndexStreaming(new BufferByteSource(bytes), IfcStepParser.Instance, 4 * 1024, void 0, sink);
60
+ expect(result).toBe(ParseResult.COMPLETE);
61
+ const channel = new StorePreviewChannel(store, sink, conwayGeometry, true, () => { }, 64, 48 * 1024 * 1024, 1);
62
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
+ const internals = channel;
64
+ // Lift the wall clock the way the streamed channel's test does: the
65
+ // assertion is about how many products ONE tick consumes, and a real
66
+ // 20ms budget makes that a coin flip on a loaded runner.
67
+ internals.tickBudgetMs_ = Number.MAX_SAFE_INTEGER;
68
+ await channel.maybeTickAsync();
69
+ const attempted = internals.unitOrdinal_;
70
+ // Capped by TICK_MAX_ATTEMPTS, and emphatically more than the one
71
+ // product the pre-#518 tick managed.
72
+ expect(attempted).toBeGreaterThan(1);
73
+ expect(attempted).toBeLessThanOrEqual(internals.tickMaxAttempts_);
74
+ channel.stop();
75
+ });
76
+ test("an unproductive tick does not decay the cadence", async () => {
77
+ const sink = new ColumnarIndexSink();
78
+ // Nothing parsed into the sink, so no generation can build. Every
79
+ // such tick used to pay the interval decay anyway, cooling the
80
+ // cadence toward its 600ms ceiling before there was ever anything
81
+ // to extract.
82
+ const channel = new StorePreviewChannel(new InMemoryStepByteStore(bytes), sink, conwayGeometry, true, () => { });
83
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
84
+ const internals = channel;
85
+ for (let tick = 0; tick < 5; ++tick) {
86
+ internals.lastInlineTick_ = 0;
87
+ await channel.maybeTickAsync();
88
+ }
89
+ expect(internals.tickIntervalMs_).toBe(150);
90
+ expect(channel.earlyPlateCount).toBe(0);
91
+ channel.stop();
92
+ });
93
+ test("spatial plates come off a prefix generation, before parse end", async () => {
94
+ const store = new InMemoryStepByteStore(bytes);
95
+ const sink = new ColumnarIndexSink();
96
+ buildIndexStreaming(new BufferByteSource(bytes), IfcStepParser.Instance, 4 * 1024, void 0, sink);
97
+ const payloads = [];
98
+ const channel = new StorePreviewChannel(store, sink, conwayGeometry, true, (mesh) => payloads.push(mesh), 64, 48 * 1024 * 1024, 1);
99
+ // One tick is enough: the walk runs as the generation is built,
100
+ // ahead of any product extraction.
101
+ await channel.maybeTickAsync();
102
+ expect(channel.earlyPlateCount).toBeGreaterThan(0);
103
+ const plates = payloads.filter((p) => p.aabb !== void 0);
104
+ expect(plates.length).toBe(channel.earlyPlateCount);
105
+ expect(plates[0].color).toEqual({ x: 0, y: 0, z: 0, w: 0.3 });
106
+ expect(plates[0].geometryExpressID).toBe(-1);
107
+ expect(plates[0].flatTransformation).toHaveLength(16);
108
+ // The walk necessarily ran before any product could latch a
109
+ // coordination frame, so it used the imposter walk's own
110
+ // fallback derivation.
111
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
112
+ expect(channel.earlyPlatesUsedFallbackFrame_).toBe(true);
113
+ const first = channel.earlyPlateCount;
114
+ await channel.drainForTest();
115
+ // Draining latches a real frame off the first captured product.
116
+ expect(channel.coordinationMatrix).toBeDefined();
117
+ channel.stop();
118
+ expect(channel.earlyPlateCount).toBeGreaterThanOrEqual(first);
119
+ });
120
+ test("early plates are re-emitted once a real frame latches", async () => {
121
+ const store = new InMemoryStepByteStore(bytes);
122
+ const sink = new ColumnarIndexSink();
123
+ buildIndexStreaming(new BufferByteSource(bytes), IfcStepParser.Instance, 4 * 1024, void 0, sink);
124
+ const payloads = [];
125
+ const channel = new StorePreviewChannel(store, sink, conwayGeometry, true, (mesh) => payloads.push(mesh), 64, 48 * 1024 * 1024, 1);
126
+ await channel.drainForTest();
127
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
128
+ const internals = channel;
129
+ expect(internals.earlyPlatesUsedFallbackFrame_).toBe(true);
130
+ expect(channel.coordinationMatrix).toBeDefined();
131
+ const before = payloads.filter((p) => p.aabb !== void 0).length;
132
+ // Let a fresh generation build now that a frame exists — normally
133
+ // an index doubling does this mid-parse. Retiring the active
134
+ // generation is what makes ensureGeneration_ take the build path;
135
+ // rewinding the ordinal alone would just keep the current one.
136
+ internals.disposeGeneration_();
137
+ internals.lastSnapshotRecords_ = 0;
138
+ internals.unitOrdinal_ = 0;
139
+ await channel.drainForTest();
140
+ const after = payloads.filter((p) => p.aabb !== void 0).length;
141
+ // The plates came again, this time under the latched frame. Under
142
+ // the replace-by-expressID contract that is a correction, not a
143
+ // duplicate — and it does not happen a third time.
144
+ expect(after).toBeGreaterThan(before);
145
+ expect(internals.earlyPlatesUsedFallbackFrame_).toBe(false);
146
+ internals.disposeGeneration_();
147
+ internals.lastSnapshotRecords_ = 0;
148
+ internals.unitOrdinal_ = 0;
149
+ await channel.drainForTest();
150
+ expect(payloads.filter((p) => p.aabb !== void 0).length).toBe(after);
151
+ channel.stop();
152
+ });
153
+ // Codex review on #519: IfcProject alone does not prove the scaling
154
+ // factor is resolvable — a valid file may forward-reference its
155
+ // IfcUnitAssignment, and a prefix holding the project but not the
156
+ // units record would emit (and latch) plates scaled by a silent 1.
157
+ test("early plates defer until the unit assignment is indexed", async () => {
158
+ /**
159
+ * Minimal spatial IFC: Project/Site/Building/Storey + aggregates +
160
+ * a placed wall, with the unit assignment optionally omitted.
161
+ *
162
+ * @param withUnits Include the IfcSiUnit/IfcUnitAssignment records.
163
+ * @return {Uint8Array} File bytes.
164
+ */
165
+ const syntheticIfc = (withUnits) => {
166
+ const units = withUnits ?
167
+ "#90=IFCSIUNIT(*,.LENGTHUNIT.,.MILLI.,.METRE.);\n" +
168
+ "#91=IFCUNITASSIGNMENT((#90));\n" : "";
169
+ const text = "ISO-10303-21;\nHEADER;\n" +
170
+ "FILE_DESCRIPTION((''),'2;1');\n" +
171
+ "FILE_NAME('u.ifc','2026-01-01T00:00:00',(''),(''),'','','');\n" +
172
+ "FILE_SCHEMA(('IFC4'));\nENDSEC;\nDATA;\n" +
173
+ "#1=IFCCARTESIANPOINT((0.,0.,0.));\n" +
174
+ "#2=IFCAXIS2PLACEMENT3D(#1,$,$);\n" +
175
+ "#3=IFCLOCALPLACEMENT($,#2);\n" +
176
+ `#10=IFCPROJECT('3vP000000000000000001',$,'P',$,$,$,$,$,${withUnits ? "#91" : "$"});\n` +
177
+ "#11=IFCSITE('3vP000000000000000002',$,'S',$,$,#3,$,$,.ELEMENT.,$,$,$,$,$);\n" +
178
+ "#12=IFCBUILDING('3vP000000000000000003',$,'B',$,$,#3,$,$,.ELEMENT.,$,$,$);\n" +
179
+ "#13=IFCBUILDINGSTOREY('3vP000000000000000004',$,'L0',$,$,#3,$,$,.ELEMENT.,0.);\n" +
180
+ "#20=IFCRELAGGREGATES('3vP000000000000000005',$,$,$,#10,(#11));\n" +
181
+ "#21=IFCRELAGGREGATES('3vP000000000000000006',$,$,$,#11,(#12));\n" +
182
+ "#22=IFCRELAGGREGATES('3vP000000000000000007',$,$,$,#12,(#13));\n" +
183
+ "#30=IFCWALL('3vP000000000000000008',$,$,$,$,#3,$,$,$);\n" +
184
+ "#31=IFCRELCONTAINEDINSPATIALSTRUCTURE" +
185
+ "('3vP000000000000000009',$,$,$,(#30),#13);\n" +
186
+ units +
187
+ "ENDSEC;\nEND-ISO-10303-21;\n";
188
+ return new TextEncoder().encode(text);
189
+ };
190
+ const runChannel = async (fileBytes) => {
191
+ const sink = new ColumnarIndexSink();
192
+ buildIndexStreaming(new BufferByteSource(fileBytes), IfcStepParser.Instance, 4 * 1024, void 0, sink);
193
+ const channel = new StorePreviewChannel(new InMemoryStepByteStore(fileBytes), sink, conwayGeometry, true, () => { }, 64, 48 * 1024 * 1024, 1);
194
+ await channel.maybeTickAsync();
195
+ const count = channel.earlyPlateCount;
196
+ channel.stop();
197
+ return count;
198
+ };
199
+ // Without a unit assignment anywhere in the index, the guard defers
200
+ // — the end-of-parse walk covers such a file instead.
201
+ expect(await runChannel(syntheticIfc(false))).toBe(0);
202
+ // The same structure with units indexed emits immediately.
203
+ expect(await runChannel(syntheticIfc(true))).toBeGreaterThan(0);
204
+ });
205
+ test("open from store still leaves the source windowed", async () => {
206
+ const store = new InMemoryStepByteStore(bytes);
207
+ const open = await openStreamedIfcModelFromStore(store, { pool: 4 * 1024 });
208
+ expect(open.model.isSourceExternal).toBe(true);
209
+ });
210
+ test("OpenModelStream preview callback is safe on a windowed source", async () => {
211
+ const store = new InMemoryStepByteStore(bytes);
212
+ const payloads = [];
213
+ const api = new IfcAPI();
214
+ await api.Init();
215
+ const id = await api.OpenModelStream(store, {
216
+ DEFER_GEOMETRY: true,
217
+ COORDINATE_TO_ORIGIN: true,
218
+ USE_FAST_BOOLS: true,
219
+ ON_PREVIEW_MESH: (mesh) => {
220
+ payloads.push(mesh);
221
+ },
222
+ });
223
+ expect(id).toBeGreaterThanOrEqual(0);
224
+ expect(api.getPassthrough(id)?.sourceIsExternal ??
225
+ true).toBe(true);
226
+ // Spatial-structure plates are the aabb-only payloads (they carry no
227
+ // vertex data); they are wireframe, so `solid` no longer marks them.
228
+ const spatial = payloads.filter((p) => p.aabb !== void 0);
229
+ expect(spatial.length).toBeGreaterThan(0);
230
+ expect(spatial[0].solid).toBeUndefined();
231
+ expect(spatial[0].color).toEqual({ x: 0, y: 0, z: 0, w: 0.3 });
232
+ api.CloseModel(id);
233
+ });
234
+ });
@@ -0,0 +1,306 @@
1
+ import { ConwayGeometry } from "../../index.js";
2
+ import { ColumnarIndexSink } from "../../step/parsing/columnar_index.js";
3
+ /**
4
+ * One preview mesh instance, self-contained: geometry payload is COPIED out
5
+ * of the wasm heap at emission, so consumers can upload it directly and
6
+ * never touch the (still-loading) model. `vertexData` is interleaved
7
+ * position+normal, 6 floats per vertex, exactly the GetGeometry layout the
8
+ * classic FlatMesh path reads. For instances sharing geometry with an
9
+ * earlier emission (mapped items), `vertexData`/`indexData` are omitted and
10
+ * `geometryExpressID` identifies the earlier payload to reuse.
11
+ */
12
+ export interface PreviewMeshPayload {
13
+ expressID: number;
14
+ geometryExpressID: number;
15
+ color: {
16
+ x: number;
17
+ y: number;
18
+ z: number;
19
+ w: number;
20
+ };
21
+ flatTransformation: number[];
22
+ vertexData?: Float32Array;
23
+ indexData?: Uint32Array;
24
+ /**
25
+ * AABB imposter (no vertex payload; Share instances a unit cube).
26
+ * Reported in RAW IFC source-unit space as a consumer reference — the
27
+ * `flatTransformation` beside it is in the durable coordination frame
28
+ * like every other payload's, so that is what places the cube.
29
+ *
30
+ * **Re-emission replaces, it does not add.** An `aabb` payload
31
+ * carrying an `expressID` the consumer has already drawn a plate for
32
+ * REPLACES that plate; consumers key imposters by expressID rather
33
+ * than by arrival order. The store path emits each spatial node twice
34
+ * by design (conway#518): once early, off a prefix generation that
35
+ * holds the storeys but few of their contained products, and again
36
+ * after the parse with the full sample set and the finally-latched
37
+ * coordination frame. The early plate can be coarse — a Z band from
38
+ * elevations with a degenerate XY footprint — and the second emission
39
+ * is what corrects it. Vertex-carrying payloads are unaffected: those
40
+ * are keyed by `geometryExpressID` and never re-sent.
41
+ */
42
+ aabb?: {
43
+ min: [
44
+ number,
45
+ number,
46
+ number
47
+ ];
48
+ max: [
49
+ number,
50
+ number,
51
+ number
52
+ ];
53
+ };
54
+ /**
55
+ * Filled volume. Share's aabb path renders wireframe unless this is
56
+ * set. Nothing sets it today — the spatial-structure plates that used
57
+ * to are wireframe by request — but it stays part of the consumer
58
+ * contract Share already implements.
59
+ */
60
+ solid?: boolean;
61
+ }
62
+ /**
63
+ * A throwaway prefix extraction built by a {@link PreviewSchemaAdapter} —
64
+ * one preview "generation" over a snapshot of the growing columnar index.
65
+ */
66
+ export interface PreviewPrefixGeneration {
67
+ /** Scene the capture walks (canonical placed-instance tuples — the
68
+ * exact tuple shape is schema-specific; the capture narrows it). */
69
+ scene: {
70
+ walk(): IterableIterator<unknown>;
71
+ };
72
+ /** Total pumpable units in this prefix. */
73
+ unitCount: number;
74
+ /** Scaling factor for the capture math. */
75
+ linearScalingFactor: number;
76
+ /**
77
+ * Execute units [from, from+count) — cheap per unit, exceptions per
78
+ * unit swallowed by the adapter (mid-parse forward references).
79
+ *
80
+ * @param from First unit ordinal to execute.
81
+ * @param count Max units.
82
+ * @return {number} Units actually executed.
83
+ */
84
+ runUnits(from: number, count: number): number;
85
+ /**
86
+ * ExpressID identifying a walked geometry (payload identity / dedup).
87
+ *
88
+ * @param geometryLocalID The canonical mesh's localID.
89
+ * @return {number | undefined} The geometry's expressID.
90
+ */
91
+ geometryExpressID(geometryLocalID: number): number | undefined;
92
+ /**
93
+ * Whether the capture math recenters geometry (IFC's classic
94
+ * normalize + center re-add) or uses bare coordination x placement
95
+ * composition (AP214 — instances share one geometry buffer, issue
96
+ * #308).
97
+ */
98
+ recenter: boolean;
99
+ /**
100
+ * Free the generation's native geometry (payloads are copies, so a
101
+ * retired generation holds nothing anyone can reference). Called by
102
+ * the channel when a generation is replaced and at stop().
103
+ */
104
+ dispose(): void;
105
+ }
106
+ /**
107
+ * Builds throwaway prefix generations for one schema — the only piece of
108
+ * the preview channel that knows what a "model" or a "unit" is.
109
+ */
110
+ export interface PreviewSchemaAdapter {
111
+ /**
112
+ * Retry semantics for schemas whose unit list is FIXED up front while
113
+ * the geometry those units reference arrives throughout the file
114
+ * (AP214: the assembly tree sits at the head, solids follow). Without
115
+ * this, the first generation "consumes" every unit against a prefix
116
+ * that has no geometry yet and later, richer generations report no
117
+ * new units — the channel then never emits anything. With it, the
118
+ * channel re-runs units that emitted no instances against each new
119
+ * generation, and marks a unit done only once it captures something.
120
+ * Leave unset for schemas whose units keep appearing with the parse
121
+ * (IFC products) — re-running those would be quadratic for no gain.
122
+ */
123
+ readonly retryEmptyUnits?: boolean;
124
+ /**
125
+ * Build a generation over the given prefix columns.
126
+ *
127
+ * @param data The (fully resident) source buffer.
128
+ * @param conwaywasm The shared geometry wasm wrapper.
129
+ * @param columns A prefix snapshot of the columnar index.
130
+ * @return {PreviewPrefixGeneration | undefined} The generation, or
131
+ * undefined when the prefix cannot build one yet (throw is also
132
+ * tolerated — the channel retries on a later, larger prefix).
133
+ */
134
+ buildGeneration(data: Uint8Array, conwaywasm: ConwayGeometry, columns: unknown): PreviewPrefixGeneration | undefined;
135
+ }
136
+ /**
137
+ * IFC adapter: units are IfcProducts in localID order (stable across
138
+ * prefix growth), extracted through the per-product demand seam.
139
+ *
140
+ * @return {PreviewSchemaAdapter} The adapter.
141
+ */
142
+ export declare function ifcPreviewAdapter(): PreviewSchemaAdapter;
143
+ /**
144
+ * Free every buffer-geometry canonical mesh a model geometry cache
145
+ * holds (native embind objects), leaving the cache empty. Safe on an
146
+ * already-released cache.
147
+ *
148
+ * @param geometry The model geometry cache (iterable of canonical
149
+ * meshes with a delete(localID)).
150
+ */
151
+ export declare function releaseModelGeometry(geometry: Iterable<{
152
+ localID: number;
153
+ }> & {
154
+ delete(localID: number): void;
155
+ }): void;
156
+ /**
157
+ * AP214 adapter: units are assembly-tree units (see
158
+ * AP214GeometryExtraction.prepareDemandExtraction). Unit ordinals are
159
+ * only approximately stable across prefix growth (a root's child list
160
+ * can grow, shifting later ordinals) — for a preview that is
161
+ * acceptable: a shifted ordinal re-emits an instance at an identical
162
+ * placement (invisible overlap) or skips one (the durable pump renders
163
+ * it later).
164
+ *
165
+ * @return {PreviewSchemaAdapter} The adapter.
166
+ */
167
+ export declare function ap214PreviewAdapter(): PreviewSchemaAdapter;
168
+ /**
169
+ * Parse-time preview channel (demand/tiled rendering slice A2): while a
170
+ * deferred streamed open is still parsing, periodically snapshot the
171
+ * growing columnar index into a PREFIX model, extract a bounded number of
172
+ * units through a throwaway extraction, and emit self-contained mesh
173
+ * payloads — first pixels within the first seconds of a large parse
174
+ * instead of after it. Schema knowledge lives in the
175
+ * {@link PreviewSchemaAdapter}; the channel owns scheduling, generations,
176
+ * watermarks, payload copies, caps and the coordination pin.
177
+ *
178
+ * Preview quality, by construction: relationship records (IFC voids,
179
+ * materials, styled items) spread to the very end of real files
180
+ * (measured ~92–97% depth), so a prefix extraction can miss
181
+ * openings and materials. That is why these extractions are throwaway:
182
+ * the durable batch pump after the parse re-extracts every unit with the
183
+ * full model and REPLACES the preview — final geometry parity is
184
+ * untouched by this channel.
185
+ *
186
+ * Scheduling: the cooperative parse yields to the event loop via
187
+ * macrotasks every ~50ms; each pump tick runs in one of those gaps under
188
+ * a hard time budget, so the parse keeps the bulk of the main thread.
189
+ */
190
+ export declare class StreamedPreviewChannel {
191
+ private readonly data;
192
+ private readonly conwaywasm;
193
+ private readonly sink;
194
+ private readonly adapter;
195
+ private readonly coordinateToOrigin;
196
+ private readonly onMesh;
197
+ private readonly maxUnits;
198
+ private readonly maxBytes;
199
+ private readonly firstGenerationMinRecords;
200
+ /** Coordination matrix pinned from the first captured instance, exactly
201
+ * the derivation the durable capture would perform — the proxy adopts it
202
+ * so preview and durable placements share one frame. */
203
+ coordinationMatrix?: number[];
204
+ private stopped_;
205
+ private timer_?;
206
+ private emittedUnits_;
207
+ private emittedBytes_;
208
+ /** Ordinal cursor into the unit list (see the adapter's stability
209
+ * notes). */
210
+ private unitOrdinal_;
211
+ /** Retry mode (adapter.retryEmptyUnits): ordinals that captured ≥ 1
212
+ * instance — done for good, skipped on later generations. */
213
+ private readonly completedUnits_;
214
+ /** Retry mode: scan position within the CURRENT generation (resets to
215
+ * 0 on every new generation so empty units get re-run). */
216
+ private retryScan_;
217
+ /** Geometry expressIDs whose payload has been emitted (cross-generation
218
+ * dedup for mapped/shared geometry). */
219
+ private readonly emittedGeometry_;
220
+ private generation_?;
221
+ private lastSnapshotRecords_;
222
+ /** Records at the last snapshot whose generation build THREW (a
223
+ * structurally incomplete prefix) — gates retries to index growth so a
224
+ * throwing prefix build can't hot-loop every tick. */
225
+ private lastFailedSnapshotRecords_;
226
+ /**
227
+ * @param data The (fully resident) source buffer the parse is indexing.
228
+ * @param conwaywasm The shared geometry wasm wrapper (sequential use only
229
+ * — ticks run between parse yields, never concurrently with the durable
230
+ * extraction, which is created after the parse completes).
231
+ * @param sink The live columnar sink the streamed parse is filling.
232
+ * @param adapter The schema adapter building prefix generations.
233
+ * @param coordinateToOrigin The open's COORDINATE_TO_ORIGIN setting.
234
+ * @param onMesh Consumer callback for each preview payload.
235
+ * @param maxUnits Cap on units ever preview-extracted.
236
+ * @param maxBytes Cap on total payload bytes copied out.
237
+ * @param firstGenerationMinRecords Records required before the first
238
+ * snapshot (tests lower it for tiny fixtures).
239
+ */
240
+ constructor(data: Uint8Array, conwaywasm: ConwayGeometry, sink: ColumnarIndexSink<number>, adapter: PreviewSchemaAdapter, coordinateToOrigin: boolean, onMesh: (mesh: PreviewMeshPayload) => void, maxUnits?: number, maxBytes?: number, firstGenerationMinRecords?: number);
241
+ private lastInlineTick_;
242
+ private tickIntervalMs_;
243
+ private tickBudgetMs_;
244
+ /** Begin ticking (call just before awaiting the parse). */
245
+ start(): void;
246
+ /**
247
+ * Tick inline if one is due — called from the parse's own progress
248
+ * callback, so the channel keeps its cadence even when the event
249
+ * loop's timer queue is starved (browser: the cooperative parse
250
+ * yields via scheduler.yield / MessageChannel, whose continuations
251
+ * outrank setTimeout; the 150ms timer ticks barely ran on PSB-class
252
+ * parses, starving the preview until parse end). The timer remains
253
+ * as a fallback for gaps between progress calls.
254
+ */
255
+ maybeTickInline(): void;
256
+ /**
257
+ * Stop ticking (call once the parse settles, before finalize/fallback).
258
+ * Idempotent; no tick runs after this returns (ticks are synchronous and
259
+ * scheduled on the same event loop).
260
+ */
261
+ stop(): void;
262
+ /** True when a cap was hit and the channel retired itself early. */
263
+ get capped(): boolean;
264
+ private schedule_;
265
+ /**
266
+ * One pump tick: ensure a generation with pending units exists, then
267
+ * extract + capture under the time budget.
268
+ */
269
+ private tick_;
270
+ /**
271
+ * Ensure a generation with pending units: keep the current one while
272
+ * it has work; otherwise snapshot a fresh prefix model once the index
273
+ * has grown enough to be worth the copy.
274
+ *
275
+ * @return {boolean} True when a generation with pending units exists.
276
+ */
277
+ private ensureGeneration_;
278
+ /**
279
+ * Does the given generation still have units this channel would run —
280
+ * retry mode: not-yet-captured ordinals ahead of the scan; classic
281
+ * mode: ordinals beyond the global forward-only cursor.
282
+ *
283
+ * @param generation The generation to check.
284
+ * @return {boolean} True when a tick can make progress on it.
285
+ */
286
+ private hasPendingUnits_;
287
+ /**
288
+ * Walk the current generation's scene and emit every not-yet-captured
289
+ * placed instance as a payload — the preview twin of the durable delta
290
+ * captures, with the same placed-geometry math per schema (recentering
291
+ * for IFC, bare composition for AP214) so preview and durable
292
+ * placements coincide, but copying geometry OUT of the wasm heap
293
+ * instead of retaining native references.
294
+ *
295
+ * @return {number} Instances emitted by this pass (retry mode uses
296
+ * this to attribute unit completion).
297
+ */
298
+ private captureNewInstances_;
299
+ /**
300
+ * Test seam: run generation building + extraction + capture synchronously
301
+ * until either every unit currently in the sink is attempted or a cap
302
+ * is hit — what the timer-driven ticks do, without the timers.
303
+ */
304
+ drainForTest(): void;
305
+ }
306
+ //# sourceMappingURL=streamed_preview_channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamed_preview_channel.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/streamed_preview_channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAU5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AA8CrE;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,MAAM,CAAA;IACzB,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACrD,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,UAAU,CAAC,EAAE,YAAY,CAAA;IACzB,SAAS,CAAC,EAAE,WAAW,CAAA;IACvB;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAA;IACvE;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IAEtC;wEACoE;IACpE,KAAK,EAAE;QAAE,IAAI,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAA;KAAE,CAAA;IAE5C,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAA;IAEjB,2CAA2C;IAC3C,mBAAmB,EAAE,MAAM,CAAA;IAE3B;;;;;;;OAOG;IACH,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAI,MAAM,CAAA;IAE/C;;;;;OAKG;IACH,iBAAiB,CAAE,eAAe,EAAE,MAAM,GAAI,MAAM,GAAG,SAAS,CAAA;IAEhE;;;;;OAKG;IACH,QAAQ,EAAE,OAAO,CAAA;IAEjB;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAAA;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IAEnC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAA;IAElC;;;;;;;;;OASG;IACH,eAAe,CACb,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,cAAc,EAC1B,OAAO,EAAE,OAAO,GACf,uBAAuB,GAAG,SAAS,CAAA;CACvC;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,oBAAoB,CA8ExD;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,QAAQ,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG;IAAE,MAAM,CAAE,OAAO,EAAE,MAAM,GAAI,IAAI,CAAA;CAAE,GAAI,IAAI,CAexF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,oBAAoB,CA0C1D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,sBAAsB;IAwD7B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IA9D9C;;4DAEwD;IACjD,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAEpC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,MAAM,CAAC,CAA+B;IAE9C,OAAO,CAAC,aAAa,CAAI;IACzB,OAAO,CAAC,aAAa,CAAI;IAEzB;iBACa;IACb,OAAO,CAAC,YAAY,CAAI;IAExB;iEAC6D;IAC7D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoB;IAEpD;+DAC2D;IAC3D,OAAO,CAAC,UAAU,CAAI;IAEtB;4CACwC;IACxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoB;IAErD,OAAO,CAAC,WAAW,CAAC,CAGnB;IAED,OAAO,CAAC,oBAAoB,CAAI;IAEhC;;0DAEsD;IACtD,OAAO,CAAC,0BAA0B,CAAI;IAEtC;;;;;;;;;;;;;OAaG;gBAEkB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,cAAc,EAC1B,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAC/B,OAAO,EAAE,oBAAoB,EAC7B,kBAAkB,EAAE,OAAO,EAC3B,MAAM,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,EAC1C,QAAQ,GAAE,MAAkC,EAC5C,QAAQ,GAAE,MAAkC,EAC5C,yBAAyB,GAAE,MAChB;IAGhC,OAAO,CAAC,eAAe,CAAI;IAC3B,OAAO,CAAC,eAAe,CAAmB;IAO1C,OAAO,CAAC,aAAa,CAAiB;IAEtC,2DAA2D;IACpD,KAAK,IAAI,IAAI;IAIpB;;;;;;;;OAQG;IACI,eAAe,IAAI,IAAI;IAwB9B;;;;OAIG;IACI,IAAI,IAAI,IAAI;IAmBnB,oEAAoE;IACpE,IAAW,MAAM,IAAI,OAAO,CAG3B;IAGD,OAAO,CAAC,SAAS;IAqBjB;;;OAGG;IACH,OAAO,CAAC,KAAK;IAuDb;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IAqFzB;;;;;;;OAOG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,oBAAoB;IAwI5B;;;;OAIG;IACI,YAAY,IAAI,IAAI;CAuB5B"}