@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.
- package/README.md +36 -22
- package/compiled/Dist/ConwayGeomWasmNode.js +0 -0
- package/compiled/Dist/ConwayGeomWasmNodeMT.js +0 -0
- package/compiled/Dist/ConwayGeomWasmWeb.js +0 -0
- package/compiled/Dist/ConwayGeomWasmWebMT.js +1 -1
- package/compiled/Dist/ConwayGeomWasmWebMT.wasm +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNode.js +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNodeMT.js +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWeb.js +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.js +1 -1
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.wasm +0 -0
- package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts +19 -0
- package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts.map +1 -1
- package/compiled/dependencies/conway-geom/interface/conway_geometry.js +17 -0
- package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts +6 -0
- package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts.map +1 -1
- package/compiled/examples/browser-bundled.cjs +1569 -51
- package/compiled/examples/cli-bundled.cjs +2790 -436
- package/compiled/examples/cli-step-bundled.cjs +1904 -229
- package/compiled/examples/validator-bundled.cjs +1569 -51
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts +2 -2
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.js +2 -2
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts +3 -3
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.js +3 -3
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.js +2 -2
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/schema_ap214.gen.js +11 -11
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.js +1 -1
- package/compiled/src/AP214E3_2010/ap214_command_line_main.js +7 -3
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts +181 -7
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.js +906 -137
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.test.js +10 -2
- package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.js +114 -0
- package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts +6 -0
- package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_model_geometry.js +9 -0
- package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.js +233 -0
- package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.js +147 -0
- package/compiled/src/AP214E3_2010/ap214_step_model.d.ts +2 -1
- package/compiled/src/AP214E3_2010/ap214_step_model.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_step_model.js +1 -1
- package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.js +65 -0
- package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_unit_scale.test.js +111 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.js +190 -0
- package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/coordination_export_order.test.js +110 -0
- package/compiled/src/compat/web-ifc/coordination_f64.d.ts +165 -0
- package/compiled/src/compat/web-ifc/coordination_f64.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/coordination_f64.js +286 -0
- package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/coordination_f64.test.js +225 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts +154 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api.js +211 -3
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.js +288 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts +39 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts +30 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +83 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.js +383 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.js +124 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts +132 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +488 -92
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +268 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +996 -149
- package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.js +129 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.d.ts +134 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.js +933 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.js +467 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.d.ts +187 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.js +524 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.js +234 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts +306 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.js +580 -0
- package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/web_wasm_directory.test.js +22 -0
- package/compiled/src/core/composed_model_skeleton.d.ts +63 -0
- package/compiled/src/core/composed_model_skeleton.d.ts.map +1 -0
- package/compiled/src/core/composed_model_skeleton.js +66 -0
- package/compiled/src/core/composed_model_skeleton.test.d.ts +2 -0
- package/compiled/src/core/composed_model_skeleton.test.d.ts.map +1 -0
- package/compiled/src/core/composed_model_skeleton.test.js +69 -0
- package/compiled/src/core/demand_geometry_queue.d.ts +147 -0
- package/compiled/src/core/demand_geometry_queue.d.ts.map +1 -0
- package/compiled/src/core/demand_geometry_queue.js +223 -0
- package/compiled/src/core/demand_geometry_queue.test.d.ts +2 -0
- package/compiled/src/core/demand_geometry_queue.test.d.ts.map +1 -0
- package/compiled/src/core/demand_geometry_queue.test.js +133 -0
- package/compiled/src/core/demand_residency_pump.d.ts +93 -0
- package/compiled/src/core/demand_residency_pump.d.ts.map +1 -0
- package/compiled/src/core/demand_residency_pump.js +120 -0
- package/compiled/src/core/demand_residency_pump.test.d.ts +2 -0
- package/compiled/src/core/demand_residency_pump.test.d.ts.map +1 -0
- package/compiled/src/core/demand_residency_pump.test.js +148 -0
- package/compiled/src/core/geometry_tile_bindings.d.ts +110 -0
- package/compiled/src/core/geometry_tile_bindings.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_bindings.js +76 -0
- package/compiled/src/core/geometry_tile_bindings.test.d.ts +2 -0
- package/compiled/src/core/geometry_tile_bindings.test.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_bindings.test.js +211 -0
- package/compiled/src/core/geometry_tile_pool.d.ts +99 -0
- package/compiled/src/core/geometry_tile_pool.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_pool.js +104 -0
- package/compiled/src/core/geometry_tile_pool.test.d.ts +2 -0
- package/compiled/src/core/geometry_tile_pool.test.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_pool.test.js +180 -0
- package/compiled/src/core/mem/chunked_pool.d.ts +116 -0
- package/compiled/src/core/mem/chunked_pool.d.ts.map +1 -0
- package/compiled/src/core/mem/chunked_pool.js +149 -0
- package/compiled/src/core/mem/chunked_pool.test.d.ts +2 -0
- package/compiled/src/core/mem/chunked_pool.test.d.ts.map +1 -0
- package/compiled/src/core/mem/chunked_pool.test.js +63 -0
- package/compiled/src/core/mem/shared_asset_pool.d.ts +82 -0
- package/compiled/src/core/mem/shared_asset_pool.d.ts.map +1 -0
- package/compiled/src/core/mem/shared_asset_pool.js +113 -0
- package/compiled/src/core/mem/shared_asset_pool.test.d.ts +2 -0
- package/compiled/src/core/mem/shared_asset_pool.test.d.ts.map +1 -0
- package/compiled/src/core/mem/shared_asset_pool.test.js +49 -0
- package/compiled/src/core/model_registry.d.ts +87 -0
- package/compiled/src/core/model_registry.d.ts.map +1 -0
- package/compiled/src/core/model_registry.js +101 -0
- package/compiled/src/core/model_registry.test.d.ts +2 -0
- package/compiled/src/core/model_registry.test.d.ts.map +1 -0
- package/compiled/src/core/model_registry.test.js +60 -0
- package/compiled/src/core/model_uri.d.ts +57 -0
- package/compiled/src/core/model_uri.d.ts.map +1 -0
- package/compiled/src/core/model_uri.js +101 -0
- package/compiled/src/core/model_uri.test.d.ts +2 -0
- package/compiled/src/core/model_uri.test.d.ts.map +1 -0
- package/compiled/src/core/model_uri.test.js +49 -0
- package/compiled/src/core/progress.d.ts +16 -2
- package/compiled/src/core/progress.d.ts.map +1 -1
- package/compiled/src/core/progress.js +31 -5
- package/compiled/src/core/progress.test.js +11 -2
- package/compiled/src/core/progress_log.d.ts +1 -0
- package/compiled/src/core/progress_log.d.ts.map +1 -1
- package/compiled/src/core/progress_log.js +7 -2
- package/compiled/src/core/progress_log.test.js +21 -0
- package/compiled/src/core/shared_byte_budget.d.ts +60 -0
- package/compiled/src/core/shared_byte_budget.d.ts.map +1 -0
- package/compiled/src/core/shared_byte_budget.js +85 -0
- package/compiled/src/core/shared_byte_budget.test.d.ts +2 -0
- package/compiled/src/core/shared_byte_budget.test.d.ts.map +1 -0
- package/compiled/src/core/shared_byte_budget.test.js +55 -0
- package/compiled/src/core/wasm_heap.d.ts +208 -0
- package/compiled/src/core/wasm_heap.d.ts.map +1 -0
- package/compiled/src/core/wasm_heap.js +417 -0
- package/compiled/src/core/wasm_heap.test.d.ts +2 -0
- package/compiled/src/core/wasm_heap.test.d.ts.map +1 -0
- package/compiled/src/core/wasm_heap.test.js +546 -0
- package/compiled/src/demand/index.d.ts +23 -0
- package/compiled/src/demand/index.d.ts.map +1 -0
- package/compiled/src/demand/index.js +22 -0
- package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts.map +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.js +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.d.ts.map +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.js +2 -2
- package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts.map +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.js +1 -1
- package/compiled/src/ifc/ifc4_gen/schema_ifc.gen.js +2 -2
- package/compiled/src/ifc/ifc_demand_extraction.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_demand_extraction.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_demand_extraction.test.js +251 -0
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts +367 -6
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_geometry_extraction.js +1322 -389
- package/compiled/src/ifc/ifc_grid_placement.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_grid_placement.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_grid_placement.test.js +261 -0
- package/compiled/src/ifc/ifc_model_geometry.d.ts +12 -0
- package/compiled/src/ifc/ifc_model_geometry.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_model_geometry.js +15 -0
- package/compiled/src/ifc/ifc_regression_batch_main.js +210 -12
- package/compiled/src/ifc/ifc_spatial_skeleton.d.ts +145 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.js +266 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.test.js +199 -0
- package/compiled/src/ifc/ifc_step_model.d.ts +6 -2
- package/compiled/src/ifc/ifc_step_model.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_step_model.js +6 -4
- package/compiled/src/ifc/ifc_step_parser.d.ts +58 -0
- package/compiled/src/ifc/ifc_step_parser.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_step_parser.js +64 -0
- package/compiled/src/ifc/ifc_stream_model.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_stream_model.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_stream_model.test.js +70 -0
- package/compiled/src/ifc/ifc_stream_open.d.ts +131 -0
- package/compiled/src/ifc/ifc_stream_open.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_stream_open.js +116 -0
- package/compiled/src/ifc/ifc_stream_open.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_stream_open.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_stream_open.test.js +230 -0
- package/compiled/src/ifc/ifc_tile_extractor.d.ts +84 -0
- package/compiled/src/ifc/ifc_tile_extractor.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_tile_extractor.js +134 -0
- package/compiled/src/ifc/ifc_tile_extractor.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_tile_extractor.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_tile_extractor.test.js +118 -0
- package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_typed_select_enum.test.js +60 -0
- package/compiled/src/index.d.ts +21 -1
- package/compiled/src/index.d.ts.map +1 -1
- package/compiled/src/index.js +28 -1
- package/compiled/src/logging/logger.d.ts +16 -2
- package/compiled/src/logging/logger.d.ts.map +1 -1
- package/compiled/src/logging/logger.js +34 -7
- package/compiled/src/logging/logger.test.js +30 -0
- package/compiled/src/mem/index.d.ts +17 -0
- package/compiled/src/mem/index.d.ts.map +1 -0
- package/compiled/src/mem/index.js +16 -0
- package/compiled/src/namespace_surface.test.d.ts +2 -0
- package/compiled/src/namespace_surface.test.d.ts.map +1 -0
- package/compiled/src/namespace_surface.test.js +43 -0
- package/compiled/src/parsing/parsing_buffer.d.ts +23 -0
- package/compiled/src/parsing/parsing_buffer.d.ts.map +1 -1
- package/compiled/src/parsing/parsing_buffer.js +31 -0
- package/compiled/src/scripts/model_report_displacement.test.d.ts +2 -0
- package/compiled/src/scripts/model_report_displacement.test.d.ts.map +1 -0
- package/compiled/src/scripts/model_report_displacement.test.js +104 -0
- package/compiled/src/scripts/render_glb_paths.test.d.ts +2 -0
- package/compiled/src/scripts/render_glb_paths.test.d.ts.map +1 -0
- package/compiled/src/scripts/render_glb_paths.test.js +115 -0
- package/compiled/src/step/indexing/step_type_indexer.d.ts +20 -0
- package/compiled/src/step/indexing/step_type_indexer.d.ts.map +1 -1
- package/compiled/src/step/indexing/step_type_indexer.js +67 -0
- package/compiled/src/step/parsing/byte_source.d.ts +153 -0
- package/compiled/src/step/parsing/byte_source.d.ts.map +1 -0
- package/compiled/src/step/parsing/byte_source.js +106 -0
- package/compiled/src/step/parsing/byte_source.test.d.ts +2 -0
- package/compiled/src/step/parsing/byte_source.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/byte_source.test.js +47 -0
- package/compiled/src/step/parsing/byte_source_node.d.ts +41 -0
- package/compiled/src/step/parsing/byte_source_node.d.ts.map +1 -0
- package/compiled/src/step/parsing/byte_source_node.js +54 -0
- package/compiled/src/step/parsing/columnar_index.d.ts +103 -0
- package/compiled/src/step/parsing/columnar_index.d.ts.map +1 -0
- package/compiled/src/step/parsing/columnar_index.js +224 -0
- package/compiled/src/step/parsing/columnar_index.test.d.ts +2 -0
- package/compiled/src/step/parsing/columnar_index.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/columnar_index.test.js +155 -0
- package/compiled/src/step/parsing/cross_reference_registry.d.ts +95 -0
- package/compiled/src/step/parsing/cross_reference_registry.d.ts.map +1 -0
- package/compiled/src/step/parsing/cross_reference_registry.js +91 -0
- package/compiled/src/step/parsing/cross_reference_registry.test.d.ts +2 -0
- package/compiled/src/step/parsing/cross_reference_registry.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/cross_reference_registry.test.js +66 -0
- package/compiled/src/step/parsing/decode_utf8.d.ts +15 -0
- package/compiled/src/step/parsing/decode_utf8.d.ts.map +1 -1
- package/compiled/src/step/parsing/decode_utf8.js +28 -0
- package/compiled/src/step/parsing/express_ref_scan.d.ts +20 -0
- package/compiled/src/step/parsing/express_ref_scan.d.ts.map +1 -0
- package/compiled/src/step/parsing/express_ref_scan.js +91 -0
- package/compiled/src/step/parsing/express_ref_scan.test.d.ts +2 -0
- package/compiled/src/step/parsing/express_ref_scan.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/express_ref_scan.test.js +28 -0
- package/compiled/src/step/parsing/index_sidecar.d.ts +81 -0
- package/compiled/src/step/parsing/index_sidecar.d.ts.map +1 -0
- package/compiled/src/step/parsing/index_sidecar.js +283 -0
- package/compiled/src/step/parsing/index_sidecar.test.d.ts +2 -0
- package/compiled/src/step/parsing/index_sidecar.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/index_sidecar.test.js +122 -0
- package/compiled/src/step/parsing/inf_recovery_index.test.d.ts +2 -0
- package/compiled/src/step/parsing/inf_recovery_index.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/inf_recovery_index.test.js +108 -0
- package/compiled/src/step/parsing/prefix_type_index.d.ts +124 -0
- package/compiled/src/step/parsing/prefix_type_index.d.ts.map +1 -0
- package/compiled/src/step/parsing/prefix_type_index.js +207 -0
- package/compiled/src/step/parsing/prefix_type_index.test.d.ts +2 -0
- package/compiled/src/step/parsing/prefix_type_index.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/prefix_type_index.test.js +298 -0
- package/compiled/src/step/parsing/range_byte_source.d.ts +69 -0
- package/compiled/src/step/parsing/range_byte_source.d.ts.map +1 -0
- package/compiled/src/step/parsing/range_byte_source.js +78 -0
- package/compiled/src/step/parsing/range_byte_source.test.d.ts +2 -0
- package/compiled/src/step/parsing/range_byte_source.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/range_byte_source.test.js +70 -0
- package/compiled/src/step/parsing/record_event.d.ts +23 -0
- package/compiled/src/step/parsing/record_event.d.ts.map +1 -0
- package/compiled/src/step/parsing/record_event.js +1 -0
- package/compiled/src/step/parsing/record_field_cursor.d.ts +94 -0
- package/compiled/src/step/parsing/record_field_cursor.d.ts.map +1 -0
- package/compiled/src/step/parsing/record_field_cursor.js +189 -0
- package/compiled/src/step/parsing/step_deserialization_functions.d.ts +29 -0
- package/compiled/src/step/parsing/step_deserialization_functions.d.ts.map +1 -1
- package/compiled/src/step/parsing/step_deserialization_functions.js +45 -0
- package/compiled/src/step/parsing/step_deserialization_functions.test.js +59 -1
- package/compiled/src/step/parsing/step_parser.d.ts +66 -1
- package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
- package/compiled/src/step/parsing/step_parser.js +164 -10
- package/compiled/src/step/parsing/step_string_parser.js +8 -8
- package/compiled/src/step/parsing/streaming_index_builder.d.ts +141 -0
- package/compiled/src/step/parsing/streaming_index_builder.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_index_builder.js +280 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.d.ts +2 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.js +107 -0
- package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts +2 -0
- package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_index_builder_async.test.js +109 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts +71 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.js +88 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts +2 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.test.js +66 -0
- package/compiled/src/step/parsing/uint32_sink.d.ts +72 -0
- package/compiled/src/step/parsing/uint32_sink.d.ts.map +1 -0
- package/compiled/src/step/parsing/uint32_sink.js +180 -0
- package/compiled/src/step/parsing/uint32_sink.test.d.ts +2 -0
- package/compiled/src/step/parsing/uint32_sink.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/uint32_sink.test.js +199 -0
- package/compiled/src/step/step_buffer_provider.d.ts +48 -3
- package/compiled/src/step/step_buffer_provider.d.ts.map +1 -1
- package/compiled/src/step/step_buffer_provider.js +60 -11
- package/compiled/src/step/step_buffer_provider.test.js +14 -0
- package/compiled/src/step/step_entity_base.d.ts +65 -3
- package/compiled/src/step/step_entity_base.d.ts.map +1 -1
- package/compiled/src/step/step_entity_base.js +135 -3
- package/compiled/src/step/step_model_base.d.ts +221 -8
- package/compiled/src/step/step_model_base.d.ts.map +1 -1
- package/compiled/src/step/step_model_base.js +542 -7
- package/compiled/src/stream/index.d.ts +34 -0
- package/compiled/src/stream/index.d.ts.map +1 -0
- package/compiled/src/stream/index.js +32 -0
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -1
|
@@ -307,9 +307,88 @@ export default class StepParser extends StepHeaderParser {
|
|
|
307
307
|
if (next.done === true) {
|
|
308
308
|
return next.value;
|
|
309
309
|
}
|
|
310
|
+
if (typeof next.value === "number") {
|
|
311
|
+
onProgress?.(next.value);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Streaming driver over parseDataBlockIncremental: identical parse (same
|
|
317
|
+
* generator body) but invokes `onRecordBoundary` at every top-level record
|
|
318
|
+
* boundary so a caller feeding the parser from a moving window can slide
|
|
319
|
+
* that window forward while the rewind stack is empty. See
|
|
320
|
+
* streaming_index_builder.ts for the coordinator that owns the window.
|
|
321
|
+
*
|
|
322
|
+
* @param input The input parsing buffer, positioned at the data section.
|
|
323
|
+
* @param onRecordBoundary Called at each top-level record boundary with the
|
|
324
|
+
* buffer; the callback may rebase the buffer's window in place. Must be
|
|
325
|
+
* synchronous on this driver — a returned Promise is a caller bug.
|
|
326
|
+
* @param onRecordIndexed Called as each top-level record is indexed, with
|
|
327
|
+
* its localID, expressID, typeID (0 for external-mapping records) and the
|
|
328
|
+
* record's bytes as an un-materialised `(buffer, byteOffset, byteLength)`
|
|
329
|
+
* window view — the seam for incremental semantic consumers (type index,
|
|
330
|
+
* roots registry, names skeleton). See {@link RecordEventHandler} for the
|
|
331
|
+
* window-lifetime rule. Must be synchronous and cheap; expensive work
|
|
332
|
+
* belongs on a demand queue, not the parse path.
|
|
333
|
+
* @param onProgress Optional byte-cursor progress callback.
|
|
334
|
+
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
335
|
+
*/
|
|
336
|
+
parseDataBlockStreamed(input, onRecordBoundary, onRecordIndexed, onProgress, sink) {
|
|
337
|
+
const parser = this.parseDataBlockIncremental(input, onRecordBoundary, onRecordIndexed, sink);
|
|
338
|
+
while (true) {
|
|
339
|
+
const next = parser.next();
|
|
340
|
+
if (next.done === true) {
|
|
341
|
+
return next.value;
|
|
342
|
+
}
|
|
343
|
+
if (typeof next.value !== "number") {
|
|
344
|
+
throw new Error("parseDataBlockStreamed: async window slide requires parseDataBlockStreamedAsync");
|
|
345
|
+
}
|
|
310
346
|
onProgress?.(next.value);
|
|
311
347
|
}
|
|
312
348
|
}
|
|
349
|
+
/**
|
|
350
|
+
* Cooperative variant of parseDataBlockStreamed: identical parse and
|
|
351
|
+
* window-slide behaviour (same generator body, same boundary callback),
|
|
352
|
+
* but periodically awaits a macrotask so the event loop can run —
|
|
353
|
+
* browsers repaint progress UI during a large streamed parse instead of
|
|
354
|
+
* flagging the tab as stalled. Issue #301 §2 for the streamed path.
|
|
355
|
+
*
|
|
356
|
+
* @param input The input parsing buffer, positioned at the data section.
|
|
357
|
+
* @param onRecordBoundary Called at each top-level record boundary with the
|
|
358
|
+
* buffer; the callback may rebase the buffer's window in place. May return
|
|
359
|
+
* a Promise when the slide itself is I/O (an async ByteSource); this
|
|
360
|
+
* driver awaits it before the next record is lexed.
|
|
361
|
+
* @param onRecordIndexed Called as each top-level record is indexed — see
|
|
362
|
+
* parseDataBlockStreamed.
|
|
363
|
+
* @param onProgress Optional byte-cursor progress callback.
|
|
364
|
+
* @param sink Optional index sink (columnar builds).
|
|
365
|
+
* @param yieldIntervalMs Minimum ms between event-loop yields.
|
|
366
|
+
* @return {Promise<BlockParseResult>} The parsing result, including the
|
|
367
|
+
* index and result enum.
|
|
368
|
+
*/
|
|
369
|
+
async parseDataBlockStreamedAsync(input, onRecordBoundary, onRecordIndexed, onProgress, sink, yieldIntervalMs = DEFAULT_PARSE_YIELD_INTERVAL_MS) {
|
|
370
|
+
const parser = this.parseDataBlockIncremental(input, onRecordBoundary, onRecordIndexed, sink);
|
|
371
|
+
let lastYield = Date.now();
|
|
372
|
+
while (true) {
|
|
373
|
+
const next = parser.next();
|
|
374
|
+
if (next.done === true) {
|
|
375
|
+
return next.value;
|
|
376
|
+
}
|
|
377
|
+
if (typeof next.value !== "number") {
|
|
378
|
+
await next.value;
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
const progressed = onProgress?.(next.value);
|
|
382
|
+
if (progressed !== void 0 &&
|
|
383
|
+
typeof progressed.then === "function") {
|
|
384
|
+
await progressed;
|
|
385
|
+
}
|
|
386
|
+
if (Date.now() - lastYield >= yieldIntervalMs) {
|
|
387
|
+
await yieldToEventLoop();
|
|
388
|
+
lastYield = Date.now();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
313
392
|
/**
|
|
314
393
|
* Cooperative variant of parseDataBlock: identical parse (same generator
|
|
315
394
|
* body), but periodically awaits a macrotask so the event loop can run —
|
|
@@ -330,7 +409,9 @@ export default class StepParser extends StepHeaderParser {
|
|
|
330
409
|
if (next.done === true) {
|
|
331
410
|
return next.value;
|
|
332
411
|
}
|
|
333
|
-
|
|
412
|
+
if (typeof next.value === "number") {
|
|
413
|
+
onProgress?.(next.value);
|
|
414
|
+
}
|
|
334
415
|
if (Date.now() - lastYield >= yieldIntervalMs) {
|
|
335
416
|
await yieldToEventLoop();
|
|
336
417
|
lastYield = Date.now();
|
|
@@ -347,8 +428,18 @@ export default class StepParser extends StepHeaderParser {
|
|
|
347
428
|
* @yields {number} The current byte cursor within the input buffer.
|
|
348
429
|
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
349
430
|
*/
|
|
350
|
-
*parseDataBlockIncremental(input) {
|
|
431
|
+
*parseDataBlockIncremental(input, onRecordBoundary, onRecordIndexed, sink) {
|
|
351
432
|
const indexResult = { elements: [] };
|
|
433
|
+
// With a sink, completed top-level entries are diverted instead of
|
|
434
|
+
// accumulated — the object index never materialises (columnar path).
|
|
435
|
+
let topLevelCount = 0;
|
|
436
|
+
const pushEntry = sink !== void 0 ?
|
|
437
|
+
(entry) => {
|
|
438
|
+
sink.pushTopLevel(entry);
|
|
439
|
+
} :
|
|
440
|
+
(entry) => {
|
|
441
|
+
indexResult.elements.push(entry);
|
|
442
|
+
};
|
|
352
443
|
const match = input.match;
|
|
353
444
|
const comment = () => match(commentParser);
|
|
354
445
|
const whitespace = () => {
|
|
@@ -394,7 +485,10 @@ export default class StepParser extends StepHeaderParser {
|
|
|
394
485
|
return syntaxError();
|
|
395
486
|
}
|
|
396
487
|
whitespace();
|
|
397
|
-
|
|
488
|
+
// File-absolute (== input.cursor when initialOffset is 0, i.e. every
|
|
489
|
+
// resident parse; file-absolute under a streaming moving window so the
|
|
490
|
+
// recorded address/length stay stable as the window slides).
|
|
491
|
+
const startElement = input.address;
|
|
398
492
|
let stackDepth = 1;
|
|
399
493
|
const savedInlineElements = inlineElements;
|
|
400
494
|
inlineElements = void 0;
|
|
@@ -492,6 +586,16 @@ export default class StepParser extends StepHeaderParser {
|
|
|
492
586
|
if ((++parsedElementCount & PARSE_PROGRESS_ELEMENT_MASK) === 0) {
|
|
493
587
|
yield input.cursor;
|
|
494
588
|
}
|
|
589
|
+
// Top-level record boundary: the rewind stack is empty and the cursor
|
|
590
|
+
// sits at the next record's leading whitespace/`#`. A streaming driver
|
|
591
|
+
// uses this to slide its moving window forward (see
|
|
592
|
+
// streaming_index_builder.ts). No-op on the resident path. An async
|
|
593
|
+
// slide (OPFS File.slice / HTTP range) is yielded so the async
|
|
594
|
+
// driver can await it before the next record is lexed.
|
|
595
|
+
const slide = onRecordBoundary?.(input);
|
|
596
|
+
if (slide !== void 0 && typeof slide.then === "function") {
|
|
597
|
+
yield slide;
|
|
598
|
+
}
|
|
495
599
|
if (!charws(HASH)) {
|
|
496
600
|
if (tokenws(END_SECTION)) {
|
|
497
601
|
return parseResult(ParseResult.COMPLETE);
|
|
@@ -516,7 +620,10 @@ export default class StepParser extends StepHeaderParser {
|
|
|
516
620
|
}
|
|
517
621
|
whitespace();
|
|
518
622
|
inlineElements = void 0;
|
|
519
|
-
|
|
623
|
+
// File-absolute (== input.cursor when initialOffset is 0, i.e. every
|
|
624
|
+
// resident parse; file-absolute under a streaming moving window so the
|
|
625
|
+
// recorded address/length stay stable as the window slides).
|
|
626
|
+
const startElement = input.address;
|
|
520
627
|
// todo, loop and read inline then add them to a special "External Mapping" node.
|
|
521
628
|
while (!charws(CLOSE_PAREN)) {
|
|
522
629
|
input.begin();
|
|
@@ -530,7 +637,7 @@ export default class StepParser extends StepHeaderParser {
|
|
|
530
637
|
if (!charws(SEMICOLON)) {
|
|
531
638
|
return syntaxError();
|
|
532
639
|
}
|
|
533
|
-
|
|
640
|
+
pushEntry({
|
|
534
641
|
address: startElement,
|
|
535
642
|
length: input.address - startElement,
|
|
536
643
|
typeID: 0, // external mapping special case.
|
|
@@ -538,6 +645,15 @@ export default class StepParser extends StepHeaderParser {
|
|
|
538
645
|
inlineEntities: inlineElements,
|
|
539
646
|
multiMapping: multiElements
|
|
540
647
|
});
|
|
648
|
+
// AFTER the entry is indexed, so a consumer that queries the index
|
|
649
|
+
// from this event sees the record the event is about — the columns
|
|
650
|
+
// are the source of truth a prefix-derived consumer reads. Still
|
|
651
|
+
// before the window can slide, so the record bytes stay valid.
|
|
652
|
+
{
|
|
653
|
+
const recordLen = input.address - startElement;
|
|
654
|
+
onRecordIndexed?.(topLevelCount, expressID, 0, input.buffer, input.cursor - recordLen, recordLen);
|
|
655
|
+
}
|
|
656
|
+
++topLevelCount;
|
|
541
657
|
multiElements = void 0;
|
|
542
658
|
continue;
|
|
543
659
|
}
|
|
@@ -547,7 +663,10 @@ export default class StepParser extends StepHeaderParser {
|
|
|
547
663
|
return syntaxError();
|
|
548
664
|
}
|
|
549
665
|
whitespace();
|
|
550
|
-
|
|
666
|
+
// File-absolute (== input.cursor when initialOffset is 0, i.e. every
|
|
667
|
+
// resident parse; file-absolute under a streaming moving window so the
|
|
668
|
+
// recorded address/length stay stable as the window slides).
|
|
669
|
+
const startElement = input.address;
|
|
551
670
|
let stackDepth = 1;
|
|
552
671
|
inlineElements = void 0;
|
|
553
672
|
while (stackDepth > 0) {
|
|
@@ -574,9 +693,38 @@ export default class StepParser extends StepHeaderParser {
|
|
|
574
693
|
input.begin();
|
|
575
694
|
const elementResult = parseInlineElement();
|
|
576
695
|
if (elementResult !== (void 0)) {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
696
|
+
// No stamping here. This used to run
|
|
697
|
+
//
|
|
698
|
+
// for ( const element of elementResult[0].elements ) {
|
|
699
|
+
// element.expressID = expressID
|
|
700
|
+
// }
|
|
701
|
+
//
|
|
702
|
+
// and elementResult[0] is `indexResult` - syntaxError() returns
|
|
703
|
+
// it wholesale - so that wrote THIS record's express ID over
|
|
704
|
+
// every top-level entry indexed so far in the block.
|
|
705
|
+
//
|
|
706
|
+
// It cannot have been doing anything useful. Both pushEntry
|
|
707
|
+
// sites already set `expressID` at construction, so every entry
|
|
708
|
+
// arrives correct and the loop could only overwrite correct
|
|
709
|
+
// values with one wrong one. The same recovery inside the nested
|
|
710
|
+
// parseInlineElement - begin, parse, rollback, tokenws(INF) - has
|
|
711
|
+
// never had the loop and works.
|
|
712
|
+
//
|
|
713
|
+
// Note it ran BEFORE the rollback and the INF check, so it was
|
|
714
|
+
// never specific to INF: any top-level inline-instance parse
|
|
715
|
+
// failure poisoned the index the same way. And the index is not
|
|
716
|
+
// discarded on a syntax error - parseDataToModel builds the
|
|
717
|
+
// model from itemIndex.elements whatever the ParseResult, and
|
|
718
|
+
// the loaders only log and continue - so a poisoned index does
|
|
719
|
+
// reach consumers.
|
|
720
|
+
//
|
|
721
|
+
// What kept it hidden is narrower than that: no public corpus
|
|
722
|
+
// model reaches this recovery at all. A private one does, via an
|
|
723
|
+
// exporter writing `IFCQUANTITYLENGTH(...,INF,$)` for an
|
|
724
|
+
// unbounded quantity - not valid ISO 10303-21, but what the tool
|
|
725
|
+
// emits - where it cost 3,116 entities and produced 630
|
|
726
|
+
// relationship failures all naming the same record.
|
|
727
|
+
// See #412, #481, #482.
|
|
580
728
|
input.rollback();
|
|
581
729
|
if (tokenws(INF)) {
|
|
582
730
|
break;
|
|
@@ -620,13 +768,19 @@ export default class StepParser extends StepHeaderParser {
|
|
|
620
768
|
if (!charws(SEMICOLON)) {
|
|
621
769
|
return syntaxError();
|
|
622
770
|
}
|
|
623
|
-
|
|
771
|
+
pushEntry({
|
|
624
772
|
address: startElement,
|
|
625
773
|
length: input.address - startElement,
|
|
626
774
|
typeID: foundItem,
|
|
627
775
|
expressID: expressID,
|
|
628
776
|
inlineEntities: inlineElements,
|
|
629
777
|
});
|
|
778
|
+
// See the external-mapping site above: indexed first, then announced.
|
|
779
|
+
{
|
|
780
|
+
const recordLen = input.address - startElement;
|
|
781
|
+
onRecordIndexed?.(topLevelCount, expressID, foundItem, input.buffer, input.cursor - recordLen, recordLen);
|
|
782
|
+
}
|
|
783
|
+
++topLevelCount;
|
|
630
784
|
}
|
|
631
785
|
// Got here without finding an end of the section.
|
|
632
786
|
return parseResult(ParseResult.INCOMPLETE);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ParsingConstants from "../../parsing/parsing_constants.js";
|
|
2
2
|
import ParsingDfa16Table from "../../parsing/parsing_dfa_16table.js";
|
|
3
|
-
import {
|
|
3
|
+
import { decodeStepString, installResizableTextDecoderShim } from "./decode_utf8.js";
|
|
4
4
|
// Emscripten 6's browser wasm heap is a resizable ArrayBuffer, on which strict
|
|
5
5
|
// browsers' TextDecoder.decode() throws — including the glue's own UTF8ToString
|
|
6
6
|
// during geometry extraction. Install the global copy-first shim as the STEP
|
|
@@ -76,7 +76,7 @@ class StepStringParser extends ParsingDfa16Table {
|
|
|
76
76
|
if (nextCursor < endCursor && input[nextCursor] === QUOTE) {
|
|
77
77
|
result ??= "";
|
|
78
78
|
if (cursor > reificationIndex) {
|
|
79
|
-
result +=
|
|
79
|
+
result += decodeStepString(input.subarray(reificationIndex, cursor - 1));
|
|
80
80
|
}
|
|
81
81
|
result += "'";
|
|
82
82
|
cursor = nextCursor + 1;
|
|
@@ -84,7 +84,7 @@ class StepStringParser extends ParsingDfa16Table {
|
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
86
86
|
result ??= "";
|
|
87
|
-
result +=
|
|
87
|
+
result += decodeStepString(input.subarray(reificationIndex, cursor));
|
|
88
88
|
return result;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -111,7 +111,7 @@ class StepStringParser extends ParsingDfa16Table {
|
|
|
111
111
|
const nextChar2 = input[nextCursor2];
|
|
112
112
|
if (nextChar2 !== BSLASH) {
|
|
113
113
|
result ??= "";
|
|
114
|
-
result +=
|
|
114
|
+
result += decodeStepString(input.subarray(reificationIndex, cursor));
|
|
115
115
|
cursor = nextCursor2 + 1;
|
|
116
116
|
break;
|
|
117
117
|
}
|
|
@@ -124,7 +124,7 @@ class StepStringParser extends ParsingDfa16Table {
|
|
|
124
124
|
return result;
|
|
125
125
|
}
|
|
126
126
|
result ??= "";
|
|
127
|
-
result +=
|
|
127
|
+
result += decodeStepString(input.subarray(reificationIndex, cursor));
|
|
128
128
|
codePage = nextChar3 - A;
|
|
129
129
|
cursor = nextCursor3 + 1;
|
|
130
130
|
reificationIndex = cursor;
|
|
@@ -138,7 +138,7 @@ class StepStringParser extends ParsingDfa16Table {
|
|
|
138
138
|
const nextChar2 = input[nextCursor2];
|
|
139
139
|
if (nextChar2 !== BSLASH) {
|
|
140
140
|
result ??= "";
|
|
141
|
-
result +=
|
|
141
|
+
result += decodeStepString(input.subarray(reificationIndex, cursor));
|
|
142
142
|
cursor = nextCursor2 + 1;
|
|
143
143
|
break;
|
|
144
144
|
}
|
|
@@ -148,7 +148,7 @@ class StepStringParser extends ParsingDfa16Table {
|
|
|
148
148
|
}
|
|
149
149
|
const nextChar3 = input[nextCursor3];
|
|
150
150
|
result ??= "";
|
|
151
|
-
result +=
|
|
151
|
+
result += decodeStepString(input.subarray(reificationIndex, cursor));
|
|
152
152
|
/* eslint-disable no-magic-numbers */
|
|
153
153
|
if (nextChar3 < 127) {
|
|
154
154
|
result += String.fromCharCode(nextChar3);
|
|
@@ -171,7 +171,7 @@ class StepStringParser extends ParsingDfa16Table {
|
|
|
171
171
|
}
|
|
172
172
|
const nextChar2 = input[nextCursor2];
|
|
173
173
|
result ??= "";
|
|
174
|
-
result +=
|
|
174
|
+
result += decodeStepString(input.subarray(reificationIndex, cursor));
|
|
175
175
|
const hexParserTil0 = (count) => {
|
|
176
176
|
if (nextCursor2 + 1 >= endCursor || input[nextCursor2 + 1] !== BSLASH) {
|
|
177
177
|
return false;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ByteSource, ReadableByteSource } from "./byte_source.js";
|
|
2
|
+
import { ColumnarIndexSink, StepIndexColumns } from "./columnar_index.js";
|
|
3
|
+
import { RecordEventHandler } from "./record_event.js";
|
|
4
|
+
import StepParser, { ParseResult, StepHeader, StepIndexEntry, StepIndexSink } from "./step_parser.js";
|
|
5
|
+
/**
|
|
6
|
+
* Diagnostics from a streaming index build — how hard the moving window had
|
|
7
|
+
* to work, so a pool-size sweep can compare cost against a resident parse.
|
|
8
|
+
*/
|
|
9
|
+
export interface StreamingIndexStats {
|
|
10
|
+
/** Target window size in bytes (the pool). */
|
|
11
|
+
pool: number;
|
|
12
|
+
/** Physical window buffer size actually used (grows past `pool` only if a
|
|
13
|
+
* single record exceeds the pool). */
|
|
14
|
+
windowBytes: number;
|
|
15
|
+
/** Number of times the window slid forward. */
|
|
16
|
+
slides: number;
|
|
17
|
+
/** Largest single top-level record observed, in bytes. */
|
|
18
|
+
maxRecordLen: number;
|
|
19
|
+
/** Total bytes read from the source (≈ file size + re-reads on growth). */
|
|
20
|
+
bytesRead: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The output of a streaming index build: the same element index a resident
|
|
24
|
+
* `parseDataBlock` produces, plus the header and window diagnostics.
|
|
25
|
+
*/
|
|
26
|
+
export interface StreamingIndexResult<TypeIDType> {
|
|
27
|
+
header: StepHeader;
|
|
28
|
+
elements: StepIndexEntry<TypeIDType>[];
|
|
29
|
+
result: ParseResult;
|
|
30
|
+
stats: StreamingIndexStats;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Build the entity index by streaming a `ByteSource` through a fixed-size
|
|
34
|
+
* moving window, instead of parsing one resident buffer. The parse loop is
|
|
35
|
+
* byte-for-byte the resident one (`StepParser.parseDataBlockStreamed` drives
|
|
36
|
+
* the same generator); this coordinator only owns the window: it fills it,
|
|
37
|
+
* parses the header from the first fill, then slides the window forward at
|
|
38
|
+
* top-level record boundaries as the parser advances.
|
|
39
|
+
*
|
|
40
|
+
* Because the parser records file-absolute addresses and its rewind stack is
|
|
41
|
+
* empty at every top-level boundary, sliding there is transparent: the
|
|
42
|
+
* unconsumed tail is copied to the front, fresh bytes are appended, and the
|
|
43
|
+
* buffer is rebased so `address` keeps its file-absolute value. Peak JS heap
|
|
44
|
+
* for the index build is therefore `window + index columns`, independent of
|
|
45
|
+
* file size.
|
|
46
|
+
*
|
|
47
|
+
* The window slides only once the cursor passes `pool / 2`, bounding the
|
|
48
|
+
* memmove frequency; a record up to `pool / 2` bytes always fits after a
|
|
49
|
+
* slide. If a single record exceeds that (never on the current corpus, whose
|
|
50
|
+
* largest STEP record is ~25 KB), the whole parse restarts from the
|
|
51
|
+
* beginning with the window doubled, and repeats until every record fits —
|
|
52
|
+
* correctness over the pathological case, at the cost of a re-scan. (M1's
|
|
53
|
+
* production path will instead grow in place / restart from the last
|
|
54
|
+
* boundary; from-scratch keeps the spike simple.)
|
|
55
|
+
*
|
|
56
|
+
* @param source The byte source.
|
|
57
|
+
* @param parser The STEP parser (typed to the schema).
|
|
58
|
+
* @param pool Target window size in bytes.
|
|
59
|
+
* @param onRecordIndexed Optional per-record event, invoked live as each
|
|
60
|
+
* top-level record is indexed with its (localID, expressID, typeID) — the
|
|
61
|
+
* seam for incremental semantic consumers (M2). localIDs are dense and
|
|
62
|
+
* assigned in parse order from 0. On the rare grow-and-restart (a single
|
|
63
|
+
* record larger than the window — never on real files, whose largest STEP
|
|
64
|
+
* record is ~25 KB), the parse re-runs from the start and records re-fire
|
|
65
|
+
* from localID 0; consumers must therefore be idempotent by localID /
|
|
66
|
+
* expressID (the standard consumers — type index keyed by localID, roots
|
|
67
|
+
* registry keyed by expressID — are). Must be synchronous and cheap;
|
|
68
|
+
* expensive work belongs on a demand queue, not the parse path.
|
|
69
|
+
* @return {StreamingIndexResult} The index, header, result and diagnostics.
|
|
70
|
+
*/
|
|
71
|
+
export declare function buildIndexStreaming<TypeIDType>(source: ByteSource, parser: StepParser<TypeIDType>, pool: number, onRecordIndexed?: RecordEventHandler<TypeIDType>, sink?: StepIndexSink<TypeIDType>): StreamingIndexResult<TypeIDType>;
|
|
72
|
+
/**
|
|
73
|
+
* Cooperative twin of {@link buildIndexStreaming}: identical parse, window
|
|
74
|
+
* and grow-and-restart behaviour (mirrored the same way the parser mirrors
|
|
75
|
+
* parseDataBlock/parseDataBlockAsync), but the parse periodically yields to
|
|
76
|
+
* the event loop so browsers repaint progress UI mid-parse instead of
|
|
77
|
+
* flagging the tab as stalled (issue #301 §2 for the streamed path).
|
|
78
|
+
*
|
|
79
|
+
* @param source The byte source.
|
|
80
|
+
* @param parser The STEP parser (typed to the schema).
|
|
81
|
+
* @param pool Target window size in bytes.
|
|
82
|
+
* @param onRecordIndexed Optional per-record event (see buildIndexStreaming).
|
|
83
|
+
* @param sink Optional index sink (columnar builds).
|
|
84
|
+
* @param onProgress Optional progress callback with the ABSOLUTE source byte
|
|
85
|
+
* cursor (unlike the parser's window-relative cursor), so callers can report
|
|
86
|
+
* `cursor / source.byteLength` directly.
|
|
87
|
+
* @param yieldIntervalMs Minimum ms between event-loop yields.
|
|
88
|
+
* @return {Promise<StreamingIndexResult>} The index, header, result and
|
|
89
|
+
* diagnostics.
|
|
90
|
+
*/
|
|
91
|
+
export declare function buildIndexStreamingAsync<TypeIDType>(source: ReadableByteSource, parser: StepParser<TypeIDType>, pool: number, onRecordIndexed?: RecordEventHandler<TypeIDType>, sink?: StepIndexSink<TypeIDType>, onProgress?: (absoluteByteCursor: number) => unknown, yieldIntervalMs?: number): Promise<StreamingIndexResult<TypeIDType>>;
|
|
92
|
+
/**
|
|
93
|
+
* The output of a columnar streaming index build: the index in its SoA
|
|
94
|
+
* column form (no object phase — see columnar_index.ts), plus the header and
|
|
95
|
+
* window diagnostics.
|
|
96
|
+
*/
|
|
97
|
+
export interface StreamingColumnarIndexResult<TypeIDType> {
|
|
98
|
+
header: StepHeader;
|
|
99
|
+
columns: StepIndexColumns<TypeIDType>;
|
|
100
|
+
result: ParseResult;
|
|
101
|
+
stats: StreamingIndexStats;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Build the entity index by streaming, **directly into typed-array columns**
|
|
105
|
+
* (M7): identical parse and window behaviour to {@link buildIndexStreaming},
|
|
106
|
+
* but completed records are encoded straight into a {@link ColumnarIndexSink}
|
|
107
|
+
* so the per-record object index never materialises. Peak JS heap for the
|
|
108
|
+
* index build becomes `window + columns` — the object phase (the dominant
|
|
109
|
+
* heap cost on large models) is gone.
|
|
110
|
+
*
|
|
111
|
+
* @param source The byte source.
|
|
112
|
+
* @param parser The STEP parser (typed to the schema).
|
|
113
|
+
* @param pool Target window size in bytes.
|
|
114
|
+
* @param onRecordIndexed Optional per-record event (see buildIndexStreaming).
|
|
115
|
+
* @param sink Optional caller-owned sink. Pass one to hold the *live* columns
|
|
116
|
+
* while the parse runs — that is what a prefix-derived consumer
|
|
117
|
+
* ({@link import('./prefix_type_index').PrefixTypeIndex}) reads. Omit it and
|
|
118
|
+
* the columns only exist once this returns.
|
|
119
|
+
* @return {StreamingColumnarIndexResult} Columns, header, result, stats.
|
|
120
|
+
*/
|
|
121
|
+
export declare function buildColumnarIndexStreaming<TypeIDType extends number>(source: ByteSource, parser: StepParser<TypeIDType>, pool: number, onRecordIndexed?: RecordEventHandler<TypeIDType>, sink?: ColumnarIndexSink<TypeIDType>): StreamingColumnarIndexResult<TypeIDType>;
|
|
122
|
+
/**
|
|
123
|
+
* Cooperative twin of {@link buildColumnarIndexStreaming}: identical
|
|
124
|
+
* columnar build, but the parse periodically yields to the event loop (see
|
|
125
|
+
* {@link buildIndexStreamingAsync}) and reports absolute byte-cursor
|
|
126
|
+
* progress — the browser-facing variant for large models.
|
|
127
|
+
*
|
|
128
|
+
* @param source The byte source.
|
|
129
|
+
* @param parser The STEP parser (typed to the schema).
|
|
130
|
+
* @param pool Target window size in bytes.
|
|
131
|
+
* @param onRecordIndexed Optional per-record event (see buildIndexStreaming).
|
|
132
|
+
* @param onProgress Optional absolute byte-cursor progress callback.
|
|
133
|
+
* @param yieldIntervalMs Minimum ms between event-loop yields.
|
|
134
|
+
* @param sink Optional caller-owned sink (see
|
|
135
|
+
* {@link buildColumnarIndexStreaming}) — the seam for reading the columns
|
|
136
|
+
* while the parse is still running.
|
|
137
|
+
* @return {Promise<StreamingColumnarIndexResult>} Columns, header, result,
|
|
138
|
+
* stats.
|
|
139
|
+
*/
|
|
140
|
+
export declare function buildColumnarIndexStreamingAsync<TypeIDType extends number>(source: ReadableByteSource, parser: StepParser<TypeIDType>, pool: number, onRecordIndexed?: RecordEventHandler<TypeIDType>, onProgress?: (absoluteByteCursor: number) => unknown, yieldIntervalMs?: number, sink?: ColumnarIndexSink<TypeIDType>): Promise<StreamingColumnarIndexResult<TypeIDType>>;
|
|
141
|
+
//# sourceMappingURL=streaming_index_builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streaming_index_builder.d.ts","sourceRoot":"","sources":["../../../../src/step/parsing/streaming_index_builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,UAAU,EAAE,EACjB,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EACd,MAAM,eAAe,CAAA;AAGtB;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAElC,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IAEZ;0CACsC;IACtC,WAAW,EAAE,MAAM,CAAA;IAEnB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAA;IAEd,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAA;IAEpB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAA;CAClB;AAGD;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,UAAU;IAC9C,MAAM,EAAE,UAAU,CAAA;IAClB,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,EAAE,CAAA;IACtC,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,mBAAmB,CAAA;CAC3B;AAGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAC1C,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,EAC9B,IAAI,EAAE,MAAM,EACZ,eAAe,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,EAChD,IAAI,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,GAChC,oBAAoB,CAAC,UAAU,CAAC,CA8GnC;AAgCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,wBAAwB,CAAC,UAAU,EACrD,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,EAC9B,IAAI,EAAE,MAAM,EACZ,eAAe,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,EAChD,IAAI,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,EAChC,UAAU,CAAC,EAAE,CAAE,kBAAkB,EAAE,MAAM,KAAM,OAAO,EACtD,eAAe,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CA0G5C;AAGD;;;;GAIG;AACH,MAAM,WAAW,4BAA4B,CAAC,UAAU;IACtD,MAAM,EAAE,UAAU,CAAA;IAClB,OAAO,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAA;IACrC,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,mBAAmB,CAAA;CAC3B;AAGD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,SAAS,MAAM,EACjE,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,EAC9B,IAAI,EAAE,MAAM,EACZ,eAAe,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,EAChD,IAAI,GAAE,iBAAiB,CAAC,UAAU,CAAuC,GACzE,4BAA4B,CAAC,UAAU,CAAC,CAM3C;AAGD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,gCAAgC,CAAC,UAAU,SAAS,MAAM,EAC5E,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,EAC9B,IAAI,EAAE,MAAM,EACZ,eAAe,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,EAChD,UAAU,CAAC,EAAE,CAAE,kBAAkB,EAAE,MAAM,KAAM,OAAO,EACtD,eAAe,CAAC,EAAE,MAAM,EACxB,IAAI,GAAE,iBAAiB,CAAC,UAAU,CAAuC,GACzE,OAAO,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC,CAMpD"}
|