@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
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A random-access, forward-readable byte source for the streaming parser.
|
|
3
|
+
*
|
|
4
|
+
* The streaming index builder (see streaming_index_builder.ts) reads the
|
|
5
|
+
* source sequentially into a small moving window, so a `ByteSource` only has
|
|
6
|
+
* to satisfy positioned reads — it never needs the whole file resident. The
|
|
7
|
+
* in-memory `BufferByteSource` here is for tests and the resident case; a
|
|
8
|
+
* file-descriptor source (node) or an HTTP-Range source (M4) implements the
|
|
9
|
+
* same shape without holding the file in the JS heap.
|
|
10
|
+
*
|
|
11
|
+
* M0 keeps reads synchronous to reuse the existing synchronous parse loop
|
|
12
|
+
* unchanged. The asynchronous variant (network pull-parser) is M4.
|
|
13
|
+
*/
|
|
14
|
+
export interface ByteSource {
|
|
15
|
+
/** Total length of the source in bytes. */
|
|
16
|
+
readonly byteLength: number;
|
|
17
|
+
/**
|
|
18
|
+
* Read up to `length` bytes starting at `offset` into `into` at
|
|
19
|
+
* `intoOffset`, returning the number of bytes actually copied (fewer than
|
|
20
|
+
* `length` only at end of source).
|
|
21
|
+
*
|
|
22
|
+
* @param offset Absolute source offset to read from.
|
|
23
|
+
* @param length Maximum number of bytes to read.
|
|
24
|
+
* @param into Destination buffer.
|
|
25
|
+
* @param intoOffset Offset within `into` to write at.
|
|
26
|
+
* @return {number} The number of bytes copied.
|
|
27
|
+
*/
|
|
28
|
+
read(offset: number, length: number, into: Uint8Array, intoOffset: number): number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A `ByteSource` backed by an in-memory `Uint8Array`. Reads are `subarray`
|
|
32
|
+
* copies into the destination window. Used by tests and the resident path;
|
|
33
|
+
* note it does hold the whole buffer (that residency is the source's, not the
|
|
34
|
+
* parser's — the parser still only touches a window).
|
|
35
|
+
*/
|
|
36
|
+
export declare class BufferByteSource implements ByteSource {
|
|
37
|
+
private readonly buffer;
|
|
38
|
+
/**
|
|
39
|
+
* @param buffer The backing bytes.
|
|
40
|
+
*/
|
|
41
|
+
constructor(buffer: Uint8Array);
|
|
42
|
+
/**
|
|
43
|
+
* @return {number} The buffer length.
|
|
44
|
+
*/
|
|
45
|
+
get byteLength(): number;
|
|
46
|
+
/**
|
|
47
|
+
* @param offset Absolute source offset to read from.
|
|
48
|
+
* @param length Maximum number of bytes to read.
|
|
49
|
+
* @param into Destination buffer.
|
|
50
|
+
* @param intoOffset Offset within `into` to write at.
|
|
51
|
+
* @return {number} The number of bytes copied.
|
|
52
|
+
*/
|
|
53
|
+
read(offset: number, length: number, into: Uint8Array, intoOffset: number): number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A `ByteSource` whose `read` is asynchronous — a `StepExternalByteStore`
|
|
57
|
+
* (OPFS `File.slice()`), or any other store that cannot serve bytes
|
|
58
|
+
* synchronously on this thread. `buildIndexStreamingAsync` accepts either
|
|
59
|
+
* this or a sync {@link ByteSource}; the sync builder does not.
|
|
60
|
+
*/
|
|
61
|
+
export interface AsyncByteSource {
|
|
62
|
+
/** Total length of the source in bytes. */
|
|
63
|
+
readonly byteLength: number;
|
|
64
|
+
/**
|
|
65
|
+
* Read up to `length` bytes starting at `offset` into `into` at
|
|
66
|
+
* `intoOffset`. Same contract as {@link ByteSource.read}, but async.
|
|
67
|
+
*
|
|
68
|
+
* @param offset Absolute source offset to read from.
|
|
69
|
+
* @param length Maximum number of bytes to read.
|
|
70
|
+
* @param into Destination buffer.
|
|
71
|
+
* @param intoOffset Offset within `into` to write at.
|
|
72
|
+
* @return {Promise<number>} The number of bytes copied.
|
|
73
|
+
*/
|
|
74
|
+
read(offset: number, length: number, into: Uint8Array, intoOffset: number): Promise<number>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Either a sync or async positioned byte source. The cooperative index
|
|
78
|
+
* builder awaits each fill; a sync source just resolves immediately.
|
|
79
|
+
*/
|
|
80
|
+
export type ReadableByteSource = ByteSource | AsyncByteSource;
|
|
81
|
+
/**
|
|
82
|
+
* Minimal sync-access handle (OPFS `FileSystemSyncAccessHandle` in a
|
|
83
|
+
* worker). Defined here so the source has no DOM lib dependency.
|
|
84
|
+
*/
|
|
85
|
+
export interface SyncAccessHandleLike {
|
|
86
|
+
/**
|
|
87
|
+
* Read into `buffer` starting at file offset `options.at`.
|
|
88
|
+
*
|
|
89
|
+
* @param buffer Destination view.
|
|
90
|
+
* @param options `{ at }` file offset (default 0).
|
|
91
|
+
* @return {number} Bytes copied.
|
|
92
|
+
*/
|
|
93
|
+
read(buffer: Uint8Array, options?: {
|
|
94
|
+
at?: number;
|
|
95
|
+
}): number;
|
|
96
|
+
/**
|
|
97
|
+
* @return {number} File size in bytes.
|
|
98
|
+
*/
|
|
99
|
+
getSize(): number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A `ByteSource` over an OPFS (or similar) synchronous access handle —
|
|
103
|
+
* the worker-side parse feed for M1b write-through. Reads never
|
|
104
|
+
* materialise the file as one `ArrayBuffer`.
|
|
105
|
+
*/
|
|
106
|
+
export declare class SyncAccessHandleByteSource implements ByteSource {
|
|
107
|
+
private readonly handle_;
|
|
108
|
+
/**
|
|
109
|
+
* @param handle_ A sync-access handle already opened on the file.
|
|
110
|
+
*/
|
|
111
|
+
constructor(handle_: SyncAccessHandleLike);
|
|
112
|
+
/**
|
|
113
|
+
* @return {number} The file length.
|
|
114
|
+
*/
|
|
115
|
+
get byteLength(): number;
|
|
116
|
+
/**
|
|
117
|
+
* @param offset Absolute source offset to read from.
|
|
118
|
+
* @param length Maximum number of bytes to read.
|
|
119
|
+
* @param into Destination buffer.
|
|
120
|
+
* @param intoOffset Offset within `into` to write at.
|
|
121
|
+
* @return {number} The number of bytes copied.
|
|
122
|
+
*/
|
|
123
|
+
read(offset: number, length: number, into: Uint8Array, intoOffset: number): number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* An {@link AsyncByteSource} over a {@link StepExternalByteStore} — the
|
|
127
|
+
* main-thread parse feed for a file that is already in OPFS (or any
|
|
128
|
+
* store whose `read` is async). Peak parse scratch is one window, not
|
|
129
|
+
* the whole file.
|
|
130
|
+
*/
|
|
131
|
+
export declare class StoreByteSource implements AsyncByteSource {
|
|
132
|
+
private readonly store_;
|
|
133
|
+
/**
|
|
134
|
+
* @param store_ The external store (same bytes the model will page).
|
|
135
|
+
*/
|
|
136
|
+
constructor(store_: {
|
|
137
|
+
readonly byteLength: number;
|
|
138
|
+
read(offset: number, length: number): Promise<Uint8Array>;
|
|
139
|
+
});
|
|
140
|
+
/**
|
|
141
|
+
* @return {number} The store length.
|
|
142
|
+
*/
|
|
143
|
+
get byteLength(): number;
|
|
144
|
+
/**
|
|
145
|
+
* @param offset Absolute source offset to read from.
|
|
146
|
+
* @param length Maximum number of bytes to read.
|
|
147
|
+
* @param into Destination buffer.
|
|
148
|
+
* @param intoOffset Offset within `into` to write at.
|
|
149
|
+
* @return {Promise<number>} The number of bytes copied.
|
|
150
|
+
*/
|
|
151
|
+
read(offset: number, length: number, into: Uint8Array, intoOffset: number): Promise<number>;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=byte_source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"byte_source.d.ts","sourceRoot":"","sources":["../../../../src/step/parsing/byte_source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,UAAU;IAEzB,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAE3B;;;;;;;;;;OAUG;IACH,IAAI,CAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAI,MAAM,CAAA;CACrF;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,YAAW,UAAU;IAKpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHpC;;OAEG;gBAC2B,MAAM,EAAE,UAAU;IAEhD;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED;;;;;;OAMG;IACI,IAAI,CACP,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAI,MAAM;CAYnF;AAGD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAE9B,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAE3B;;;;;;;;;OASG;IACH,IAAI,CACA,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,CAAC,CAAA;CAC5F;AAGD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,eAAe,CAAA;AAG7D;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IAEnC;;;;;;OAMG;IACH,IAAI,CAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,GAAI,MAAM,CAAA;IAE7D;;OAEG;IACH,OAAO,IAAI,MAAM,CAAA;CAClB;AAGD;;;;GAIG;AACH,qBAAa,0BAA2B,YAAW,UAAU;IAK9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHrC;;OAEG;gBAC2B,OAAO,EAAE,oBAAoB;IAE3D;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED;;;;;;OAMG;IACI,IAAI,CACP,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAI,MAAM;CAYnF;AAGD;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,eAAe;IAKxC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHpC;;OAEG;gBAC2B,MAAM,EAAE;QACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;QAC3B,IAAI,CAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,OAAO,CAAC,UAAU,CAAC,CAAA;KAC5D;IAED;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED;;;;;;OAMG;IACU,IAAI,CACb,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,CAAC;CAe5F"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `ByteSource` backed by an in-memory `Uint8Array`. Reads are `subarray`
|
|
3
|
+
* copies into the destination window. Used by tests and the resident path;
|
|
4
|
+
* note it does hold the whole buffer (that residency is the source's, not the
|
|
5
|
+
* parser's — the parser still only touches a window).
|
|
6
|
+
*/
|
|
7
|
+
export class BufferByteSource {
|
|
8
|
+
/**
|
|
9
|
+
* @param buffer The backing bytes.
|
|
10
|
+
*/
|
|
11
|
+
constructor(buffer) {
|
|
12
|
+
this.buffer = buffer;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @return {number} The buffer length.
|
|
16
|
+
*/
|
|
17
|
+
get byteLength() {
|
|
18
|
+
return this.buffer.length;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @param offset Absolute source offset to read from.
|
|
22
|
+
* @param length Maximum number of bytes to read.
|
|
23
|
+
* @param into Destination buffer.
|
|
24
|
+
* @param intoOffset Offset within `into` to write at.
|
|
25
|
+
* @return {number} The number of bytes copied.
|
|
26
|
+
*/
|
|
27
|
+
read(offset, length, into, intoOffset) {
|
|
28
|
+
const end = Math.min(offset + length, this.buffer.length);
|
|
29
|
+
if (end <= offset) {
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
into.set(this.buffer.subarray(offset, end), intoOffset);
|
|
33
|
+
return end - offset;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A `ByteSource` over an OPFS (or similar) synchronous access handle —
|
|
38
|
+
* the worker-side parse feed for M1b write-through. Reads never
|
|
39
|
+
* materialise the file as one `ArrayBuffer`.
|
|
40
|
+
*/
|
|
41
|
+
export class SyncAccessHandleByteSource {
|
|
42
|
+
/**
|
|
43
|
+
* @param handle_ A sync-access handle already opened on the file.
|
|
44
|
+
*/
|
|
45
|
+
constructor(handle_) {
|
|
46
|
+
this.handle_ = handle_;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @return {number} The file length.
|
|
50
|
+
*/
|
|
51
|
+
get byteLength() {
|
|
52
|
+
return this.handle_.getSize();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @param offset Absolute source offset to read from.
|
|
56
|
+
* @param length Maximum number of bytes to read.
|
|
57
|
+
* @param into Destination buffer.
|
|
58
|
+
* @param intoOffset Offset within `into` to write at.
|
|
59
|
+
* @return {number} The number of bytes copied.
|
|
60
|
+
*/
|
|
61
|
+
read(offset, length, into, intoOffset) {
|
|
62
|
+
const end = Math.min(offset + length, this.byteLength);
|
|
63
|
+
if (end <= offset) {
|
|
64
|
+
return 0;
|
|
65
|
+
}
|
|
66
|
+
const want = end - offset;
|
|
67
|
+
return this.handle_.read(into.subarray(intoOffset, intoOffset + want), { at: offset });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* An {@link AsyncByteSource} over a {@link StepExternalByteStore} — the
|
|
72
|
+
* main-thread parse feed for a file that is already in OPFS (or any
|
|
73
|
+
* store whose `read` is async). Peak parse scratch is one window, not
|
|
74
|
+
* the whole file.
|
|
75
|
+
*/
|
|
76
|
+
export class StoreByteSource {
|
|
77
|
+
/**
|
|
78
|
+
* @param store_ The external store (same bytes the model will page).
|
|
79
|
+
*/
|
|
80
|
+
constructor(store_) {
|
|
81
|
+
this.store_ = store_;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @return {number} The store length.
|
|
85
|
+
*/
|
|
86
|
+
get byteLength() {
|
|
87
|
+
return this.store_.byteLength;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @param offset Absolute source offset to read from.
|
|
91
|
+
* @param length Maximum number of bytes to read.
|
|
92
|
+
* @param into Destination buffer.
|
|
93
|
+
* @param intoOffset Offset within `into` to write at.
|
|
94
|
+
* @return {Promise<number>} The number of bytes copied.
|
|
95
|
+
*/
|
|
96
|
+
async read(offset, length, into, intoOffset) {
|
|
97
|
+
const end = Math.min(offset + length, this.store_.byteLength);
|
|
98
|
+
if (end <= offset) {
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
const want = end - offset;
|
|
102
|
+
const bytes = await this.store_.read(offset, want);
|
|
103
|
+
into.set(bytes.subarray(0, want), intoOffset);
|
|
104
|
+
return Math.min(bytes.byteLength, want);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"byte_source.test.d.ts","sourceRoot":"","sources":["../../../../src/step/parsing/byte_source.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* eslint-disable no-magic-numbers */
|
|
2
|
+
import { describe, expect, test } from "@jest/globals";
|
|
3
|
+
import { BufferByteSource, StoreByteSource, SyncAccessHandleByteSource, } from "./byte_source.js";
|
|
4
|
+
import { InMemoryStepByteStore } from "../step_buffer_provider.js";
|
|
5
|
+
import { FileDescriptorByteSource } from "./byte_source_node.js";
|
|
6
|
+
describe("ByteSource implementations", () => {
|
|
7
|
+
const bytes = new Uint8Array([10, 20, 30, 40, 50]);
|
|
8
|
+
test("BufferByteSource copies a range", () => {
|
|
9
|
+
const source = new BufferByteSource(bytes);
|
|
10
|
+
const into = new Uint8Array(4);
|
|
11
|
+
expect(source.read(1, 3, into, 1)).toBe(3);
|
|
12
|
+
expect([...into]).toEqual([0, 20, 30, 40]);
|
|
13
|
+
});
|
|
14
|
+
test("StoreByteSource matches BufferByteSource over the same bytes", async () => {
|
|
15
|
+
const source = new StoreByteSource(new InMemoryStepByteStore(bytes));
|
|
16
|
+
const into = new Uint8Array(3);
|
|
17
|
+
expect(await source.read(2, 10, into, 0)).toBe(3);
|
|
18
|
+
expect([...into]).toEqual([30, 40, 50]);
|
|
19
|
+
});
|
|
20
|
+
test("SyncAccessHandleByteSource reads through the handle contract", () => {
|
|
21
|
+
const handle = {
|
|
22
|
+
getSize: () => bytes.length,
|
|
23
|
+
read(buffer, options) {
|
|
24
|
+
const at = options?.at ?? 0;
|
|
25
|
+
const want = Math.min(buffer.length, bytes.length - at);
|
|
26
|
+
buffer.set(bytes.subarray(at, at + want));
|
|
27
|
+
return want;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
const source = new SyncAccessHandleByteSource(handle);
|
|
31
|
+
const into = new Uint8Array(2);
|
|
32
|
+
expect(source.read(3, 2, into, 0)).toBe(2);
|
|
33
|
+
expect([...into]).toEqual([40, 50]);
|
|
34
|
+
});
|
|
35
|
+
test("FileDescriptorByteSource reads index.ifc without holding it", () => {
|
|
36
|
+
const source = FileDescriptorByteSource.open("data/index.ifc");
|
|
37
|
+
try {
|
|
38
|
+
const head = new Uint8Array(15);
|
|
39
|
+
const got = source.read(0, 15, head, 0);
|
|
40
|
+
expect(got).toBe(15);
|
|
41
|
+
expect(new TextDecoder().decode(head).startsWith("ISO-10303-21;")).toBe(true);
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
source.close();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ByteSource } from "./byte_source.js";
|
|
2
|
+
/**
|
|
3
|
+
* A `ByteSource` over a Node file descriptor — the node/test twin of
|
|
4
|
+
* `SyncAccessHandleByteSource`. The file is never held as one JS
|
|
5
|
+
* buffer; each `read` is `fs.readSync` into the caller's window.
|
|
6
|
+
*
|
|
7
|
+
* The caller owns the fd (open + close). This class does not close it.
|
|
8
|
+
*/
|
|
9
|
+
export declare class FileDescriptorByteSource implements ByteSource {
|
|
10
|
+
private readonly fd_;
|
|
11
|
+
private readonly byteLength_;
|
|
12
|
+
/**
|
|
13
|
+
* @param fd_ An fd open for reading.
|
|
14
|
+
* @param byteLength_ File size in bytes (`fstat.size`).
|
|
15
|
+
*/
|
|
16
|
+
constructor(fd_: number, byteLength_: number);
|
|
17
|
+
/**
|
|
18
|
+
* Open `path` read-only and wrap it. Caller must {@link close}.
|
|
19
|
+
*
|
|
20
|
+
* @param path Filesystem path.
|
|
21
|
+
* @return {FileDescriptorByteSource} The source.
|
|
22
|
+
*/
|
|
23
|
+
static open(path: string): FileDescriptorByteSource;
|
|
24
|
+
/**
|
|
25
|
+
* @return {number} The file length.
|
|
26
|
+
*/
|
|
27
|
+
get byteLength(): number;
|
|
28
|
+
/**
|
|
29
|
+
* Close the underlying fd. Further reads throw.
|
|
30
|
+
*/
|
|
31
|
+
close(): void;
|
|
32
|
+
/**
|
|
33
|
+
* @param offset Absolute source offset to read from.
|
|
34
|
+
* @param length Maximum number of bytes to read.
|
|
35
|
+
* @param into Destination buffer.
|
|
36
|
+
* @param intoOffset Offset within `into` to write at.
|
|
37
|
+
* @return {number} The number of bytes copied.
|
|
38
|
+
*/
|
|
39
|
+
read(offset: number, length: number, into: Uint8Array, intoOffset: number): number;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=byte_source_node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"byte_source_node.d.ts","sourceRoot":"","sources":["../../../../src/step/parsing/byte_source_node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C;;;;;;GAMG;AACH,qBAAa,wBAAyB,YAAW,UAAU;IAOrD,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,WAAW;IANhC;;;OAGG;gBAEkB,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM;IAExC;;;;;OAKG;WACW,IAAI,CAAE,IAAI,EAAE,MAAM,GAAI,wBAAwB;IAO5D;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;;;;;OAMG;IACI,IAAI,CACP,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAI,MAAM;CAUnF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
/**
|
|
3
|
+
* A `ByteSource` over a Node file descriptor — the node/test twin of
|
|
4
|
+
* `SyncAccessHandleByteSource`. The file is never held as one JS
|
|
5
|
+
* buffer; each `read` is `fs.readSync` into the caller's window.
|
|
6
|
+
*
|
|
7
|
+
* The caller owns the fd (open + close). This class does not close it.
|
|
8
|
+
*/
|
|
9
|
+
export class FileDescriptorByteSource {
|
|
10
|
+
/**
|
|
11
|
+
* @param fd_ An fd open for reading.
|
|
12
|
+
* @param byteLength_ File size in bytes (`fstat.size`).
|
|
13
|
+
*/
|
|
14
|
+
constructor(fd_, byteLength_) {
|
|
15
|
+
this.fd_ = fd_;
|
|
16
|
+
this.byteLength_ = byteLength_;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Open `path` read-only and wrap it. Caller must {@link close}.
|
|
20
|
+
*
|
|
21
|
+
* @param path Filesystem path.
|
|
22
|
+
* @return {FileDescriptorByteSource} The source.
|
|
23
|
+
*/
|
|
24
|
+
static open(path) {
|
|
25
|
+
const fd = fs.openSync(path, 'r');
|
|
26
|
+
return new FileDescriptorByteSource(fd, fs.fstatSync(fd).size);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @return {number} The file length.
|
|
30
|
+
*/
|
|
31
|
+
get byteLength() {
|
|
32
|
+
return this.byteLength_;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Close the underlying fd. Further reads throw.
|
|
36
|
+
*/
|
|
37
|
+
close() {
|
|
38
|
+
fs.closeSync(this.fd_);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @param offset Absolute source offset to read from.
|
|
42
|
+
* @param length Maximum number of bytes to read.
|
|
43
|
+
* @param into Destination buffer.
|
|
44
|
+
* @param intoOffset Offset within `into` to write at.
|
|
45
|
+
* @return {number} The number of bytes copied.
|
|
46
|
+
*/
|
|
47
|
+
read(offset, length, into, intoOffset) {
|
|
48
|
+
const end = Math.min(offset + length, this.byteLength_);
|
|
49
|
+
if (end <= offset) {
|
|
50
|
+
return 0;
|
|
51
|
+
}
|
|
52
|
+
return fs.readSync(this.fd_, into, intoOffset, end - offset, offset);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { StepIndexEntry, StepIndexSink } from "./step_parser.js";
|
|
2
|
+
/**
|
|
3
|
+
* The entity index in its **columnar (SoA) form** — the same packed typed-array
|
|
4
|
+
* columns `StepModelBase` compacts the object index into at construction, but
|
|
5
|
+
* produced *directly by the parse* so the per-record object phase never exists
|
|
6
|
+
* (M7; "Structural memory" in the design doc).
|
|
7
|
+
*
|
|
8
|
+
* Layout mirrors the model's internal columns exactly:
|
|
9
|
+
*
|
|
10
|
+
* [0, firstInlineElement) top-level records, in parse order (localID)
|
|
11
|
+
* [firstInlineElement, count) inline entities, in the model's unfold order
|
|
12
|
+
*
|
|
13
|
+
* `expressID` covers only the top-level range (inline entities have none).
|
|
14
|
+
* `typeID` uses −1 for "no concrete type" (matching the sidecar sentinel);
|
|
15
|
+
* 0 is a valid type (external mapping). The rare records with children —
|
|
16
|
+
* inline entities or a multi-mapping — are additionally retained as objects
|
|
17
|
+
* in `complexEntries` / consumed during the unfold, exactly the set the model
|
|
18
|
+
* keeps today; everything else is scalars only.
|
|
19
|
+
*/
|
|
20
|
+
export interface StepIndexColumns<TypeIDType> {
|
|
21
|
+
address: Uint32Array;
|
|
22
|
+
length: Uint32Array;
|
|
23
|
+
typeID: Int32Array;
|
|
24
|
+
expressID: Uint32Array;
|
|
25
|
+
/** Total rows (top-level + inline). */
|
|
26
|
+
count: number;
|
|
27
|
+
/** Top-level record count == start of the inline range. */
|
|
28
|
+
firstInlineElement: number;
|
|
29
|
+
/** Records with a multiMapping, keyed by localID (rare; retained). */
|
|
30
|
+
complexEntries?: Map<number, StepIndexEntry<TypeIDType>>;
|
|
31
|
+
/** True if top-level express IDs arrived in non-decreasing order. */
|
|
32
|
+
expressIdsSorted: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Type sentinel for "no concrete type" in the typeID column. */
|
|
35
|
+
export declare const COLUMN_UNDEFINED_TYPE = -1;
|
|
36
|
+
/**
|
|
37
|
+
* A {@link StepIndexSink} that encodes top-level records straight into
|
|
38
|
+
* chunked-segment typed-array columns, so the parse holds **no per-record
|
|
39
|
+
* objects** for the (overwhelmingly common) simple records. Records with
|
|
40
|
+
* children keep their object form — inline entities are unfolded into the
|
|
41
|
+
* inline column range at {@link finalize}, and multi-mapping holders are
|
|
42
|
+
* retained for the model's `complexEntries`, matching the object path's
|
|
43
|
+
* behaviour entry-for-entry.
|
|
44
|
+
*
|
|
45
|
+
* `reset` supports the streaming builder's rare grow-and-restart: columns
|
|
46
|
+
* rewind to empty without reallocating the first segment.
|
|
47
|
+
*/
|
|
48
|
+
export declare class ColumnarIndexSink<TypeIDType extends number> implements StepIndexSink<TypeIDType> {
|
|
49
|
+
private segments_;
|
|
50
|
+
private count_;
|
|
51
|
+
/** Entries with inlineEntities and/or multiMapping, keyed by localID. */
|
|
52
|
+
private retained_;
|
|
53
|
+
private expressIdsSorted_;
|
|
54
|
+
private previousExpressID_;
|
|
55
|
+
/**
|
|
56
|
+
* @return {number} Top-level records pushed so far.
|
|
57
|
+
*/
|
|
58
|
+
get topLevelCount(): number;
|
|
59
|
+
/**
|
|
60
|
+
* Encode one completed top-level record into the columns. The entry object
|
|
61
|
+
* is not kept unless it carries children (inline entities / multi-mapping).
|
|
62
|
+
*
|
|
63
|
+
* @param entry The completed top-level index entry.
|
|
64
|
+
*/
|
|
65
|
+
pushTopLevel(entry: StepIndexEntry<TypeIDType>): void;
|
|
66
|
+
/**
|
|
67
|
+
* Rewind to empty (the streaming builder's grow-and-restart). The first
|
|
68
|
+
* segment is kept for reuse.
|
|
69
|
+
*/
|
|
70
|
+
reset(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Snapshot the columns pushed SO FAR into a self-contained prefix index,
|
|
73
|
+
* without disturbing the sink — the parse can keep pushing afterwards and
|
|
74
|
+
* a later snapshot/finalize sees the full data. Safe to call between the
|
|
75
|
+
* cooperative parse's yields (the parser only suspends at top-level
|
|
76
|
+
* record boundaries, where the sink is consistent). Top-level localIDs
|
|
77
|
+
* are stable across snapshots (dense parse order), so consumers can carry
|
|
78
|
+
* per-localID cursors from one snapshot to the next; inline-range
|
|
79
|
+
* localIDs are NOT stable (the inline tail re-packs after the growing
|
|
80
|
+
* top-level range) and must not be carried across snapshots.
|
|
81
|
+
*
|
|
82
|
+
* @return {StepIndexColumns} A prefix columnar index over the records
|
|
83
|
+
* pushed so far.
|
|
84
|
+
*/
|
|
85
|
+
snapshot(): StepIndexColumns<TypeIDType>;
|
|
86
|
+
/**
|
|
87
|
+
* Assemble the final columns: concatenate the top-level segments (one
|
|
88
|
+
* column at a time, bounding transient overhead to a single column's
|
|
89
|
+
* segments) and unfold retained inline entities into the inline range in
|
|
90
|
+
* the model's exact unfold order.
|
|
91
|
+
*
|
|
92
|
+
* @return {StepIndexColumns} The finished columnar index.
|
|
93
|
+
*/
|
|
94
|
+
finalize(): StepIndexColumns<TypeIDType>;
|
|
95
|
+
/**
|
|
96
|
+
* Shared assembly behind {@link snapshot} and {@link finalize} — pure
|
|
97
|
+
* over the sink's current state.
|
|
98
|
+
*
|
|
99
|
+
* @return {StepIndexColumns} The assembled columnar index.
|
|
100
|
+
*/
|
|
101
|
+
private assemble_;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=columnar_index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnar_index.d.ts","sourceRoot":"","sources":["../../../../src/step/parsing/columnar_index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAEd,aAAa,EACd,MAAM,eAAe,CAAA;AAGtB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,gBAAgB,CAAC,UAAU;IAE1C,OAAO,EAAE,WAAW,CAAA;IACpB,MAAM,EAAE,WAAW,CAAA;IACnB,MAAM,EAAE,UAAU,CAAA;IAClB,SAAS,EAAE,WAAW,CAAA;IAEtB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;IAEb,2DAA2D;IAC3D,kBAAkB,EAAE,MAAM,CAAA;IAE1B,sEAAsE;IACtE,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC,CAAA;IAExD,qEAAqE;IACrE,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAGD,iEAAiE;AACjE,eAAO,MAAM,qBAAqB,KAAK,CAAA;AAmBvC;;;;;;;;;;;GAWG;AACH,qBAAa,iBAAiB,CAAC,UAAU,SAAS,MAAM,CACxD,YAAW,aAAa,CAAC,UAAU,CAAC;IAElC,OAAO,CAAC,SAAS,CAAsB;IAEvC,OAAO,CAAC,MAAM,CAAI;IAElB,yEAAyE;IACzE,OAAO,CAAC,SAAS,CAAgD;IAEjE,OAAO,CAAC,iBAAiB,CAAO;IAEhC,OAAO,CAAC,kBAAkB,CAAI;IAE9B;;OAEG;IACH,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED;;;;;OAKG;IACI,YAAY,CAAE,KAAK,EAAE,cAAc,CAAC,UAAU,CAAC,GAAI,IAAI;IAkC9D;;;OAGG;IACI,KAAK,IAAI,IAAI;IAQpB;;;;;;;;;;;;;OAaG;IACI,QAAQ,IAAI,gBAAgB,CAAC,UAAU,CAAC;IAI/C;;;;;;;OAOG;IACI,QAAQ,IAAI,gBAAgB,CAAC,UAAU,CAAC;IAI/C;;;;;OAKG;IACH,OAAO,CAAC,SAAS;CAyElB"}
|