@bldrs-ai/conway 1.389.1221 → 1.394.1504

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (382) hide show
  1. package/README.md +36 -22
  2. package/compiled/Dist/ConwayGeomWasmNode.js +0 -0
  3. package/compiled/Dist/ConwayGeomWasmNodeMT.js +0 -0
  4. package/compiled/Dist/ConwayGeomWasmWeb.js +0 -0
  5. package/compiled/Dist/ConwayGeomWasmWebMT.js +1 -1
  6. package/compiled/Dist/ConwayGeomWasmWebMT.wasm +0 -0
  7. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNode.js +0 -0
  8. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNodeMT.js +0 -0
  9. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWeb.js +0 -0
  10. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.js +1 -1
  11. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.wasm +0 -0
  12. package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts +19 -0
  13. package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts.map +1 -1
  14. package/compiled/dependencies/conway-geom/interface/conway_geometry.js +17 -0
  15. package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts +6 -0
  16. package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts.map +1 -1
  17. package/compiled/examples/browser-bundled.cjs +1569 -51
  18. package/compiled/examples/cli-bundled.cjs +2790 -436
  19. package/compiled/examples/cli-step-bundled.cjs +1904 -229
  20. package/compiled/examples/validator-bundled.cjs +1569 -51
  21. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts +2 -2
  22. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts.map +1 -1
  23. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.js +2 -2
  24. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts +3 -3
  25. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts.map +1 -1
  26. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.js +3 -3
  27. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts +1 -1
  28. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts.map +1 -1
  29. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.js +1 -1
  30. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts +1 -1
  31. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts.map +1 -1
  32. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.js +1 -1
  33. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts +1 -1
  34. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts.map +1 -1
  35. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.js +1 -1
  36. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts +1 -1
  37. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts.map +1 -1
  38. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.js +1 -1
  39. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.d.ts.map +1 -1
  40. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.js +2 -2
  41. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/schema_ap214.gen.js +11 -11
  42. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts +1 -1
  43. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts.map +1 -1
  44. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.js +1 -1
  45. package/compiled/src/AP214E3_2010/ap214_command_line_main.js +7 -3
  46. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts +181 -7
  47. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts.map +1 -1
  48. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.js +906 -137
  49. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.test.js +10 -2
  50. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts +2 -0
  51. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts.map +1 -0
  52. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.js +114 -0
  53. package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts +6 -0
  54. package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts.map +1 -1
  55. package/compiled/src/AP214E3_2010/ap214_model_geometry.js +9 -0
  56. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts +2 -0
  57. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts.map +1 -0
  58. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.js +233 -0
  59. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts +2 -0
  60. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts.map +1 -0
  61. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.js +147 -0
  62. package/compiled/src/AP214E3_2010/ap214_step_model.d.ts +2 -1
  63. package/compiled/src/AP214E3_2010/ap214_step_model.d.ts.map +1 -1
  64. package/compiled/src/AP214E3_2010/ap214_step_model.js +1 -1
  65. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts +2 -0
  66. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts.map +1 -0
  67. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.js +65 -0
  68. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts +2 -0
  69. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts.map +1 -0
  70. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.js +111 -0
  71. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts +2 -0
  72. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts.map +1 -0
  73. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.js +190 -0
  74. package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts +2 -0
  75. package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts.map +1 -0
  76. package/compiled/src/compat/web-ifc/coordination_export_order.test.js +110 -0
  77. package/compiled/src/compat/web-ifc/coordination_f64.d.ts +165 -0
  78. package/compiled/src/compat/web-ifc/coordination_f64.d.ts.map +1 -0
  79. package/compiled/src/compat/web-ifc/coordination_f64.js +286 -0
  80. package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts +2 -0
  81. package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts.map +1 -0
  82. package/compiled/src/compat/web-ifc/coordination_f64.test.js +225 -0
  83. package/compiled/src/compat/web-ifc/ifc_api.d.ts +154 -0
  84. package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
  85. package/compiled/src/compat/web-ifc/ifc_api.js +211 -3
  86. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts +2 -0
  87. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts.map +1 -0
  88. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.js +288 -0
  89. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts +39 -0
  90. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts.map +1 -1
  91. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts +30 -0
  92. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
  93. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +83 -0
  94. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts +2 -0
  95. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts.map +1 -0
  96. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.js +383 -0
  97. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts +2 -0
  98. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts.map +1 -0
  99. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.js +124 -0
  100. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts +132 -0
  101. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
  102. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +488 -92
  103. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +268 -0
  104. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
  105. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +996 -149
  106. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts +2 -0
  107. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts.map +1 -0
  108. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.js +129 -0
  109. package/compiled/src/compat/web-ifc/spatial_imposter.d.ts +134 -0
  110. package/compiled/src/compat/web-ifc/spatial_imposter.d.ts.map +1 -0
  111. package/compiled/src/compat/web-ifc/spatial_imposter.js +933 -0
  112. package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts +2 -0
  113. package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts.map +1 -0
  114. package/compiled/src/compat/web-ifc/spatial_imposter.test.js +467 -0
  115. package/compiled/src/compat/web-ifc/store_preview_channel.d.ts +187 -0
  116. package/compiled/src/compat/web-ifc/store_preview_channel.d.ts.map +1 -0
  117. package/compiled/src/compat/web-ifc/store_preview_channel.js +524 -0
  118. package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts +2 -0
  119. package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts.map +1 -0
  120. package/compiled/src/compat/web-ifc/store_preview_channel.test.js +234 -0
  121. package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts +306 -0
  122. package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts.map +1 -0
  123. package/compiled/src/compat/web-ifc/streamed_preview_channel.js +580 -0
  124. package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts +2 -0
  125. package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts.map +1 -0
  126. package/compiled/src/compat/web-ifc/web_wasm_directory.test.js +22 -0
  127. package/compiled/src/core/composed_model_skeleton.d.ts +63 -0
  128. package/compiled/src/core/composed_model_skeleton.d.ts.map +1 -0
  129. package/compiled/src/core/composed_model_skeleton.js +66 -0
  130. package/compiled/src/core/composed_model_skeleton.test.d.ts +2 -0
  131. package/compiled/src/core/composed_model_skeleton.test.d.ts.map +1 -0
  132. package/compiled/src/core/composed_model_skeleton.test.js +69 -0
  133. package/compiled/src/core/demand_geometry_queue.d.ts +147 -0
  134. package/compiled/src/core/demand_geometry_queue.d.ts.map +1 -0
  135. package/compiled/src/core/demand_geometry_queue.js +223 -0
  136. package/compiled/src/core/demand_geometry_queue.test.d.ts +2 -0
  137. package/compiled/src/core/demand_geometry_queue.test.d.ts.map +1 -0
  138. package/compiled/src/core/demand_geometry_queue.test.js +133 -0
  139. package/compiled/src/core/demand_residency_pump.d.ts +93 -0
  140. package/compiled/src/core/demand_residency_pump.d.ts.map +1 -0
  141. package/compiled/src/core/demand_residency_pump.js +120 -0
  142. package/compiled/src/core/demand_residency_pump.test.d.ts +2 -0
  143. package/compiled/src/core/demand_residency_pump.test.d.ts.map +1 -0
  144. package/compiled/src/core/demand_residency_pump.test.js +148 -0
  145. package/compiled/src/core/geometry_tile_bindings.d.ts +110 -0
  146. package/compiled/src/core/geometry_tile_bindings.d.ts.map +1 -0
  147. package/compiled/src/core/geometry_tile_bindings.js +76 -0
  148. package/compiled/src/core/geometry_tile_bindings.test.d.ts +2 -0
  149. package/compiled/src/core/geometry_tile_bindings.test.d.ts.map +1 -0
  150. package/compiled/src/core/geometry_tile_bindings.test.js +211 -0
  151. package/compiled/src/core/geometry_tile_pool.d.ts +99 -0
  152. package/compiled/src/core/geometry_tile_pool.d.ts.map +1 -0
  153. package/compiled/src/core/geometry_tile_pool.js +104 -0
  154. package/compiled/src/core/geometry_tile_pool.test.d.ts +2 -0
  155. package/compiled/src/core/geometry_tile_pool.test.d.ts.map +1 -0
  156. package/compiled/src/core/geometry_tile_pool.test.js +180 -0
  157. package/compiled/src/core/mem/chunked_pool.d.ts +116 -0
  158. package/compiled/src/core/mem/chunked_pool.d.ts.map +1 -0
  159. package/compiled/src/core/mem/chunked_pool.js +149 -0
  160. package/compiled/src/core/mem/chunked_pool.test.d.ts +2 -0
  161. package/compiled/src/core/mem/chunked_pool.test.d.ts.map +1 -0
  162. package/compiled/src/core/mem/chunked_pool.test.js +63 -0
  163. package/compiled/src/core/mem/shared_asset_pool.d.ts +82 -0
  164. package/compiled/src/core/mem/shared_asset_pool.d.ts.map +1 -0
  165. package/compiled/src/core/mem/shared_asset_pool.js +113 -0
  166. package/compiled/src/core/mem/shared_asset_pool.test.d.ts +2 -0
  167. package/compiled/src/core/mem/shared_asset_pool.test.d.ts.map +1 -0
  168. package/compiled/src/core/mem/shared_asset_pool.test.js +49 -0
  169. package/compiled/src/core/model_registry.d.ts +87 -0
  170. package/compiled/src/core/model_registry.d.ts.map +1 -0
  171. package/compiled/src/core/model_registry.js +101 -0
  172. package/compiled/src/core/model_registry.test.d.ts +2 -0
  173. package/compiled/src/core/model_registry.test.d.ts.map +1 -0
  174. package/compiled/src/core/model_registry.test.js +60 -0
  175. package/compiled/src/core/model_uri.d.ts +57 -0
  176. package/compiled/src/core/model_uri.d.ts.map +1 -0
  177. package/compiled/src/core/model_uri.js +101 -0
  178. package/compiled/src/core/model_uri.test.d.ts +2 -0
  179. package/compiled/src/core/model_uri.test.d.ts.map +1 -0
  180. package/compiled/src/core/model_uri.test.js +49 -0
  181. package/compiled/src/core/progress.d.ts +16 -2
  182. package/compiled/src/core/progress.d.ts.map +1 -1
  183. package/compiled/src/core/progress.js +31 -5
  184. package/compiled/src/core/progress.test.js +11 -2
  185. package/compiled/src/core/progress_log.d.ts +1 -0
  186. package/compiled/src/core/progress_log.d.ts.map +1 -1
  187. package/compiled/src/core/progress_log.js +7 -2
  188. package/compiled/src/core/progress_log.test.js +21 -0
  189. package/compiled/src/core/shared_byte_budget.d.ts +60 -0
  190. package/compiled/src/core/shared_byte_budget.d.ts.map +1 -0
  191. package/compiled/src/core/shared_byte_budget.js +85 -0
  192. package/compiled/src/core/shared_byte_budget.test.d.ts +2 -0
  193. package/compiled/src/core/shared_byte_budget.test.d.ts.map +1 -0
  194. package/compiled/src/core/shared_byte_budget.test.js +55 -0
  195. package/compiled/src/core/wasm_heap.d.ts +208 -0
  196. package/compiled/src/core/wasm_heap.d.ts.map +1 -0
  197. package/compiled/src/core/wasm_heap.js +417 -0
  198. package/compiled/src/core/wasm_heap.test.d.ts +2 -0
  199. package/compiled/src/core/wasm_heap.test.d.ts.map +1 -0
  200. package/compiled/src/core/wasm_heap.test.js +546 -0
  201. package/compiled/src/demand/index.d.ts +23 -0
  202. package/compiled/src/demand/index.d.ts.map +1 -0
  203. package/compiled/src/demand/index.js +22 -0
  204. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts +1 -1
  205. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts.map +1 -1
  206. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.js +1 -1
  207. package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.d.ts.map +1 -1
  208. package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.js +2 -2
  209. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts +1 -1
  210. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts.map +1 -1
  211. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.js +1 -1
  212. package/compiled/src/ifc/ifc4_gen/schema_ifc.gen.js +2 -2
  213. package/compiled/src/ifc/ifc_demand_extraction.test.d.ts +2 -0
  214. package/compiled/src/ifc/ifc_demand_extraction.test.d.ts.map +1 -0
  215. package/compiled/src/ifc/ifc_demand_extraction.test.js +251 -0
  216. package/compiled/src/ifc/ifc_geometry_extraction.d.ts +367 -6
  217. package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
  218. package/compiled/src/ifc/ifc_geometry_extraction.js +1322 -389
  219. package/compiled/src/ifc/ifc_grid_placement.test.d.ts +2 -0
  220. package/compiled/src/ifc/ifc_grid_placement.test.d.ts.map +1 -0
  221. package/compiled/src/ifc/ifc_grid_placement.test.js +261 -0
  222. package/compiled/src/ifc/ifc_model_geometry.d.ts +12 -0
  223. package/compiled/src/ifc/ifc_model_geometry.d.ts.map +1 -1
  224. package/compiled/src/ifc/ifc_model_geometry.js +15 -0
  225. package/compiled/src/ifc/ifc_regression_batch_main.js +210 -12
  226. package/compiled/src/ifc/ifc_spatial_skeleton.d.ts +145 -0
  227. package/compiled/src/ifc/ifc_spatial_skeleton.d.ts.map +1 -0
  228. package/compiled/src/ifc/ifc_spatial_skeleton.js +266 -0
  229. package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts +2 -0
  230. package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts.map +1 -0
  231. package/compiled/src/ifc/ifc_spatial_skeleton.test.js +199 -0
  232. package/compiled/src/ifc/ifc_step_model.d.ts +6 -2
  233. package/compiled/src/ifc/ifc_step_model.d.ts.map +1 -1
  234. package/compiled/src/ifc/ifc_step_model.js +6 -4
  235. package/compiled/src/ifc/ifc_step_parser.d.ts +58 -0
  236. package/compiled/src/ifc/ifc_step_parser.d.ts.map +1 -1
  237. package/compiled/src/ifc/ifc_step_parser.js +64 -0
  238. package/compiled/src/ifc/ifc_stream_model.test.d.ts +2 -0
  239. package/compiled/src/ifc/ifc_stream_model.test.d.ts.map +1 -0
  240. package/compiled/src/ifc/ifc_stream_model.test.js +70 -0
  241. package/compiled/src/ifc/ifc_stream_open.d.ts +131 -0
  242. package/compiled/src/ifc/ifc_stream_open.d.ts.map +1 -0
  243. package/compiled/src/ifc/ifc_stream_open.js +116 -0
  244. package/compiled/src/ifc/ifc_stream_open.test.d.ts +2 -0
  245. package/compiled/src/ifc/ifc_stream_open.test.d.ts.map +1 -0
  246. package/compiled/src/ifc/ifc_stream_open.test.js +230 -0
  247. package/compiled/src/ifc/ifc_tile_extractor.d.ts +84 -0
  248. package/compiled/src/ifc/ifc_tile_extractor.d.ts.map +1 -0
  249. package/compiled/src/ifc/ifc_tile_extractor.js +134 -0
  250. package/compiled/src/ifc/ifc_tile_extractor.test.d.ts +2 -0
  251. package/compiled/src/ifc/ifc_tile_extractor.test.d.ts.map +1 -0
  252. package/compiled/src/ifc/ifc_tile_extractor.test.js +118 -0
  253. package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts +2 -0
  254. package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts.map +1 -0
  255. package/compiled/src/ifc/ifc_typed_select_enum.test.js +60 -0
  256. package/compiled/src/index.d.ts +21 -1
  257. package/compiled/src/index.d.ts.map +1 -1
  258. package/compiled/src/index.js +28 -1
  259. package/compiled/src/logging/logger.d.ts +16 -2
  260. package/compiled/src/logging/logger.d.ts.map +1 -1
  261. package/compiled/src/logging/logger.js +34 -7
  262. package/compiled/src/logging/logger.test.js +30 -0
  263. package/compiled/src/mem/index.d.ts +17 -0
  264. package/compiled/src/mem/index.d.ts.map +1 -0
  265. package/compiled/src/mem/index.js +16 -0
  266. package/compiled/src/namespace_surface.test.d.ts +2 -0
  267. package/compiled/src/namespace_surface.test.d.ts.map +1 -0
  268. package/compiled/src/namespace_surface.test.js +43 -0
  269. package/compiled/src/parsing/parsing_buffer.d.ts +23 -0
  270. package/compiled/src/parsing/parsing_buffer.d.ts.map +1 -1
  271. package/compiled/src/parsing/parsing_buffer.js +31 -0
  272. package/compiled/src/scripts/model_report_displacement.test.d.ts +2 -0
  273. package/compiled/src/scripts/model_report_displacement.test.d.ts.map +1 -0
  274. package/compiled/src/scripts/model_report_displacement.test.js +104 -0
  275. package/compiled/src/scripts/render_glb_paths.test.d.ts +2 -0
  276. package/compiled/src/scripts/render_glb_paths.test.d.ts.map +1 -0
  277. package/compiled/src/scripts/render_glb_paths.test.js +115 -0
  278. package/compiled/src/step/indexing/step_type_indexer.d.ts +20 -0
  279. package/compiled/src/step/indexing/step_type_indexer.d.ts.map +1 -1
  280. package/compiled/src/step/indexing/step_type_indexer.js +67 -0
  281. package/compiled/src/step/parsing/byte_source.d.ts +153 -0
  282. package/compiled/src/step/parsing/byte_source.d.ts.map +1 -0
  283. package/compiled/src/step/parsing/byte_source.js +106 -0
  284. package/compiled/src/step/parsing/byte_source.test.d.ts +2 -0
  285. package/compiled/src/step/parsing/byte_source.test.d.ts.map +1 -0
  286. package/compiled/src/step/parsing/byte_source.test.js +47 -0
  287. package/compiled/src/step/parsing/byte_source_node.d.ts +41 -0
  288. package/compiled/src/step/parsing/byte_source_node.d.ts.map +1 -0
  289. package/compiled/src/step/parsing/byte_source_node.js +54 -0
  290. package/compiled/src/step/parsing/columnar_index.d.ts +103 -0
  291. package/compiled/src/step/parsing/columnar_index.d.ts.map +1 -0
  292. package/compiled/src/step/parsing/columnar_index.js +224 -0
  293. package/compiled/src/step/parsing/columnar_index.test.d.ts +2 -0
  294. package/compiled/src/step/parsing/columnar_index.test.d.ts.map +1 -0
  295. package/compiled/src/step/parsing/columnar_index.test.js +155 -0
  296. package/compiled/src/step/parsing/cross_reference_registry.d.ts +95 -0
  297. package/compiled/src/step/parsing/cross_reference_registry.d.ts.map +1 -0
  298. package/compiled/src/step/parsing/cross_reference_registry.js +91 -0
  299. package/compiled/src/step/parsing/cross_reference_registry.test.d.ts +2 -0
  300. package/compiled/src/step/parsing/cross_reference_registry.test.d.ts.map +1 -0
  301. package/compiled/src/step/parsing/cross_reference_registry.test.js +66 -0
  302. package/compiled/src/step/parsing/decode_utf8.d.ts +15 -0
  303. package/compiled/src/step/parsing/decode_utf8.d.ts.map +1 -1
  304. package/compiled/src/step/parsing/decode_utf8.js +28 -0
  305. package/compiled/src/step/parsing/express_ref_scan.d.ts +20 -0
  306. package/compiled/src/step/parsing/express_ref_scan.d.ts.map +1 -0
  307. package/compiled/src/step/parsing/express_ref_scan.js +91 -0
  308. package/compiled/src/step/parsing/express_ref_scan.test.d.ts +2 -0
  309. package/compiled/src/step/parsing/express_ref_scan.test.d.ts.map +1 -0
  310. package/compiled/src/step/parsing/express_ref_scan.test.js +28 -0
  311. package/compiled/src/step/parsing/index_sidecar.d.ts +81 -0
  312. package/compiled/src/step/parsing/index_sidecar.d.ts.map +1 -0
  313. package/compiled/src/step/parsing/index_sidecar.js +283 -0
  314. package/compiled/src/step/parsing/index_sidecar.test.d.ts +2 -0
  315. package/compiled/src/step/parsing/index_sidecar.test.d.ts.map +1 -0
  316. package/compiled/src/step/parsing/index_sidecar.test.js +122 -0
  317. package/compiled/src/step/parsing/inf_recovery_index.test.d.ts +2 -0
  318. package/compiled/src/step/parsing/inf_recovery_index.test.d.ts.map +1 -0
  319. package/compiled/src/step/parsing/inf_recovery_index.test.js +108 -0
  320. package/compiled/src/step/parsing/prefix_type_index.d.ts +124 -0
  321. package/compiled/src/step/parsing/prefix_type_index.d.ts.map +1 -0
  322. package/compiled/src/step/parsing/prefix_type_index.js +207 -0
  323. package/compiled/src/step/parsing/prefix_type_index.test.d.ts +2 -0
  324. package/compiled/src/step/parsing/prefix_type_index.test.d.ts.map +1 -0
  325. package/compiled/src/step/parsing/prefix_type_index.test.js +298 -0
  326. package/compiled/src/step/parsing/range_byte_source.d.ts +69 -0
  327. package/compiled/src/step/parsing/range_byte_source.d.ts.map +1 -0
  328. package/compiled/src/step/parsing/range_byte_source.js +78 -0
  329. package/compiled/src/step/parsing/range_byte_source.test.d.ts +2 -0
  330. package/compiled/src/step/parsing/range_byte_source.test.d.ts.map +1 -0
  331. package/compiled/src/step/parsing/range_byte_source.test.js +70 -0
  332. package/compiled/src/step/parsing/record_event.d.ts +23 -0
  333. package/compiled/src/step/parsing/record_event.d.ts.map +1 -0
  334. package/compiled/src/step/parsing/record_event.js +1 -0
  335. package/compiled/src/step/parsing/record_field_cursor.d.ts +94 -0
  336. package/compiled/src/step/parsing/record_field_cursor.d.ts.map +1 -0
  337. package/compiled/src/step/parsing/record_field_cursor.js +189 -0
  338. package/compiled/src/step/parsing/step_deserialization_functions.d.ts +29 -0
  339. package/compiled/src/step/parsing/step_deserialization_functions.d.ts.map +1 -1
  340. package/compiled/src/step/parsing/step_deserialization_functions.js +45 -0
  341. package/compiled/src/step/parsing/step_deserialization_functions.test.js +59 -1
  342. package/compiled/src/step/parsing/step_parser.d.ts +66 -1
  343. package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
  344. package/compiled/src/step/parsing/step_parser.js +164 -10
  345. package/compiled/src/step/parsing/step_string_parser.js +8 -8
  346. package/compiled/src/step/parsing/streaming_index_builder.d.ts +141 -0
  347. package/compiled/src/step/parsing/streaming_index_builder.d.ts.map +1 -0
  348. package/compiled/src/step/parsing/streaming_index_builder.js +280 -0
  349. package/compiled/src/step/parsing/streaming_index_builder.test.d.ts +2 -0
  350. package/compiled/src/step/parsing/streaming_index_builder.test.d.ts.map +1 -0
  351. package/compiled/src/step/parsing/streaming_index_builder.test.js +107 -0
  352. package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts +2 -0
  353. package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts.map +1 -0
  354. package/compiled/src/step/parsing/streaming_index_builder_async.test.js +109 -0
  355. package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts +71 -0
  356. package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts.map +1 -0
  357. package/compiled/src/step/parsing/streaming_record_dispatcher.js +88 -0
  358. package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts +2 -0
  359. package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts.map +1 -0
  360. package/compiled/src/step/parsing/streaming_record_dispatcher.test.js +66 -0
  361. package/compiled/src/step/parsing/uint32_sink.d.ts +72 -0
  362. package/compiled/src/step/parsing/uint32_sink.d.ts.map +1 -0
  363. package/compiled/src/step/parsing/uint32_sink.js +180 -0
  364. package/compiled/src/step/parsing/uint32_sink.test.d.ts +2 -0
  365. package/compiled/src/step/parsing/uint32_sink.test.d.ts.map +1 -0
  366. package/compiled/src/step/parsing/uint32_sink.test.js +199 -0
  367. package/compiled/src/step/step_buffer_provider.d.ts +48 -3
  368. package/compiled/src/step/step_buffer_provider.d.ts.map +1 -1
  369. package/compiled/src/step/step_buffer_provider.js +60 -11
  370. package/compiled/src/step/step_buffer_provider.test.js +14 -0
  371. package/compiled/src/step/step_entity_base.d.ts +65 -3
  372. package/compiled/src/step/step_entity_base.d.ts.map +1 -1
  373. package/compiled/src/step/step_entity_base.js +135 -3
  374. package/compiled/src/step/step_model_base.d.ts +221 -8
  375. package/compiled/src/step/step_model_base.d.ts.map +1 -1
  376. package/compiled/src/step/step_model_base.js +542 -7
  377. package/compiled/src/stream/index.d.ts +34 -0
  378. package/compiled/src/stream/index.d.ts.map +1 -0
  379. package/compiled/src/stream/index.js +32 -0
  380. package/compiled/src/version/version.js +1 -1
  381. package/compiled/tsconfig.tsbuildinfo +1 -1
  382. package/package.json +16 -1
@@ -0,0 +1,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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=byte_source.test.d.ts.map
@@ -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"}