gps-plus-slam-app-framework 1.7.0 → 1.9.0

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 (238) hide show
  1. package/dist/{accuracy-circles-BtqOP_v1.d.ts → accuracy-circles-DkWBkF5g.d.ts} +16 -6
  2. package/dist/{app-selectors-ikTUQZpe.d.ts → app-selectors-BbAiCRUT.d.ts} +1 -1
  3. package/dist/ar/bresenham3d.d.ts +1 -1
  4. package/dist/ar/camera-blit-capture.d.ts +1 -1
  5. package/dist/ar/capability-checker.d.ts +1 -1
  6. package/dist/ar/capture-failure-tracker.d.ts +1 -1
  7. package/dist/ar/chromium-camera-access-workaround.d.ts +1 -1
  8. package/dist/ar/depth-grid-lookup.d.ts +1 -1
  9. package/dist/ar/depth-occluder.d.ts +127 -0
  10. package/dist/ar/depth-occluder.js +299 -0
  11. package/dist/ar/depth-sampler.d.ts +2 -2
  12. package/dist/ar/depth-sampler.js +24 -4
  13. package/dist/ar/depth-unprojection.d.ts +1 -1
  14. package/dist/ar/depth-unprojection.js +52 -21
  15. package/dist/ar/enable-gps-ar.d.ts +1 -1
  16. package/dist/ar/enable-gps-ar.js +1 -1
  17. package/dist/ar/frame-loop.d.ts +1 -1
  18. package/dist/ar/frame-loop.js +12 -2
  19. package/dist/ar/image-capture.d.ts +1 -1
  20. package/dist/ar/image-capture.js +1 -1
  21. package/dist/ar/image-quality.d.ts +1 -1
  22. package/dist/ar/image-quality.js +2 -1
  23. package/dist/ar/index.d.ts +32 -31
  24. package/dist/ar/index.js +5 -4
  25. package/dist/ar/occlusion-mesh-worker.d.ts +58 -0
  26. package/dist/ar/occlusion-mesh-worker.js +129 -0
  27. package/dist/ar/occupancy-grid.d.ts +2 -2
  28. package/dist/ar/occupancy-grid.js +287 -31
  29. package/dist/ar/occupancy-mesher.d.ts +2 -0
  30. package/dist/ar/occupancy-mesher.js +638 -0
  31. package/dist/ar/planar-pnp.d.ts +1 -1
  32. package/dist/ar/qr-debug-view.d.ts +1 -1
  33. package/dist/ar/qr-derived-pose.d.ts +1 -1
  34. package/dist/ar/qr-detection-controller.d.ts +1 -1
  35. package/dist/ar/qr-frontend.d.ts +1 -1
  36. package/dist/ar/qr-pose.d.ts +1 -1
  37. package/dist/ar/qr-size-depth-context.d.ts +2 -2
  38. package/dist/ar/qr-size-measurer.d.ts +1 -1
  39. package/dist/ar/replay-scene.d.ts +1 -1
  40. package/dist/ar/replay-scene.js +1 -1
  41. package/dist/ar/scene-node-names.d.ts +1 -1
  42. package/dist/ar/webxr-nue-basis.d.ts +1 -1
  43. package/dist/ar/webxr-session.d.ts +4 -4
  44. package/dist/ar/webxr-session.js +2 -2
  45. package/dist/ar/xr-camera-texture.d.ts +1 -1
  46. package/dist/ar/xr-error-handler.d.ts +1 -1
  47. package/dist/ar/xr-frame-loop.d.ts +1 -1
  48. package/dist/ar/xr-frame-loop.js +12 -2
  49. package/dist/{ar-MFpFlV7j.js → ar-BqCudtqE.js} +3 -2
  50. package/dist/{ar-world-group-alignment-69fgnB39.d.ts → ar-world-group-alignment-Cfg0trC3.d.ts} +1 -1
  51. package/dist/{capture-motion-gate-4EscNZCw.js → capture-motion-gate-_NdTSwKi.js} +17 -5
  52. package/dist/cell-key-DIB4rOTV.js +51 -0
  53. package/dist/core/index.d.ts +2 -2
  54. package/dist/core/index.js +2 -2
  55. package/dist/{create-slam-app-store-n_VF63D5.d.ts → create-slam-app-store-D1QSMuKu.d.ts} +8 -9
  56. package/dist/{create-slam-app-store-DkCHOpvb.js → create-slam-app-store-DXiAnJwR.js} +9 -2
  57. package/dist/{depth-grid-lookup-DQ-IYhO3.d.ts → depth-grid-lookup-D5atpNZ3.d.ts} +1 -1
  58. package/dist/{depth-sampler-asc8exHt.d.ts → depth-sampler-CwObAwEA.d.ts} +33 -1
  59. package/dist/{depth-unprojection-DjsbJW9L.d.ts → depth-unprojection-DRdBU90S.d.ts} +1 -1
  60. package/dist/{enable-gps-ar-DkNhFv4Y.d.ts → enable-gps-ar-BBtRO2FJ.d.ts} +4 -4
  61. package/dist/{frame-conversions-DObhj8Wf.d.ts → frame-conversions-DDcNHkTb.d.ts} +1 -1
  62. package/dist/{fused-path-v6eOmLl3.d.ts → fused-path-C5pp0PJU.d.ts} +1 -1
  63. package/dist/geo/h3-proximity.d.ts +1 -1
  64. package/dist/geo/index.d.ts +1 -1
  65. package/dist/{gps-anchor-BeFO2RYa.d.ts → gps-anchor-CEjGqEVD.d.ts} +1 -1
  66. package/dist/{gps-ar-pose-sampler-DHMZmYAc.d.ts → gps-ar-pose-sampler-DEGNk2CI.d.ts} +1 -1
  67. package/dist/{gps-event-coordinator-CjWW636x.d.ts → gps-event-coordinator-BWpgBrHq.d.ts} +4 -4
  68. package/dist/{image-capture-CNZDrQXG.d.ts → image-capture-Bp6Pd4Md.d.ts} +3 -3
  69. package/dist/{image-capture-B2-b6tKK.js → image-capture-DVcuqMtX.js} +1 -1
  70. package/dist/{index-BODDUTvD.d.ts → index-B6iBnO_K.d.ts} +1 -1
  71. package/dist/index-DXPVzOpP.d.ts +2 -0
  72. package/dist/{index-BneSj4_5.d.ts → index-cCQWuYqy.d.ts} +3 -3
  73. package/dist/index.d.ts +82 -80
  74. package/dist/index.js +10 -8
  75. package/dist/{leaflet-map-overlay-CmIyiE8n.d.ts → leaflet-map-overlay-C8GS4cUy.d.ts} +64 -10
  76. package/dist/leaflet-map-overlay-CBWPvaX9.js +452 -0
  77. package/dist/lerp-utils-Qs8OhumS.d.ts +42 -0
  78. package/dist/map-data-1tF5gcYV.js +124 -0
  79. package/dist/map-data-CUnTzRIC.d.ts +78 -0
  80. package/dist/{map-overlay-draw-ymz1s7fG.d.ts → map-overlay-draw-6WJeq0Kg.d.ts} +1 -1
  81. package/dist/{null-storage-backend-B9rtyDfG.d.ts → null-storage-backend-B1-jlpin.d.ts} +2 -2
  82. package/dist/occlusion-mesh-kXCQ2FM1.d.ts +194 -0
  83. package/dist/occupancy-grid-BV7RhB7I.d.ts +194 -0
  84. package/dist/occupancy-mesher-C2ecWhNp.d.ts +100 -0
  85. package/dist/{opfs-storage-3VZh-qH6.d.ts → opfs-storage-CTkxvxN4.d.ts} +5 -0
  86. package/dist/{opfs-storage-backend-JJiUJo-3.d.ts → opfs-storage-backend-D6Z03fML.d.ts} +2 -2
  87. package/dist/{persistence-middleware-DAPTTwB2.d.ts → persistence-middleware-CG-t08X4.d.ts} +1 -1
  88. package/dist/{planar-pnp-my9bqULS.d.ts → planar-pnp-D7bc_rLX.d.ts} +1 -1
  89. package/dist/{qr-debug-view-Brl73HGO.d.ts → qr-debug-view-BJooqbiP.d.ts} +1 -1
  90. package/dist/{qr-derived-pose-CmxTP2m4.d.ts → qr-derived-pose-BwNWn8oV.d.ts} +2 -2
  91. package/dist/{qr-detected-slice-VQssZmQJ.d.ts → qr-detected-slice-TzVb8bij.d.ts} +4 -4
  92. package/dist/{qr-detection-controller-CDurHv8E.d.ts → qr-detection-controller-Bo4XfQTP.d.ts} +3 -3
  93. package/dist/{qr-frontend--fFX25mV.d.ts → qr-frontend-BPURlh3S.d.ts} +1 -1
  94. package/dist/{qr-pose-aggregation-B7tWJq7j.d.ts → qr-pose-aggregation-CypnmjA-.d.ts} +1 -1
  95. package/dist/{qr-size-depth-context-CeAG53fy.d.ts → qr-size-depth-context-apAOmbrZ.d.ts} +2 -2
  96. package/dist/{qr-size-measurer-DQdAsid1.d.ts → qr-size-measurer-DxiMqRUw.d.ts} +3 -3
  97. package/dist/{recording-options-BPCpMHLK.d.ts → recording-options-DYKWVI93.d.ts} +203 -24
  98. package/dist/{recording-replayer-DQKpAGyQ.d.ts → recording-replayer-BJ8Lf0QY.d.ts} +2 -2
  99. package/dist/{recording-slice-DaxHZvNu.d.ts → recording-slice-BW8SiLo1.d.ts} +2 -2
  100. package/dist/{replay-engine-CmKh_4wf.d.ts → replay-engine-DmCAc7WM.d.ts} +1 -1
  101. package/dist/{replay-scene-DBlDrV_x.d.ts → replay-scene-zJ8SFDjE.d.ts} +3 -3
  102. package/dist/sensors/absolute-orientation.d.ts +1 -1
  103. package/dist/sensors/absolute-orientation.js +23 -6
  104. package/dist/sensors/gps-error-handler.d.ts +1 -1
  105. package/dist/sensors/gps.d.ts +1 -1
  106. package/dist/sensors/index.d.ts +4 -4
  107. package/dist/sensors/permission-checker.d.ts +1 -1
  108. package/dist/state/app-selectors.d.ts +1 -1
  109. package/dist/state/combined-root-state.d.ts +1 -1
  110. package/dist/state/create-slam-app-store.d.ts +1 -1
  111. package/dist/state/create-slam-app-store.js +1 -1
  112. package/dist/state/gps-ar-pose-sampler.d.ts +3 -3
  113. package/dist/state/gps-event-coordinator.d.ts +1 -1
  114. package/dist/state/index.d.ts +19 -19
  115. package/dist/state/index.js +2 -2
  116. package/dist/state/persistence-middleware.d.ts +1 -1
  117. package/dist/state/qr-detected-slice.d.ts +3 -3
  118. package/dist/state/recording-options.d.ts +2 -2
  119. package/dist/state/recording-options.js +150 -19
  120. package/dist/state/recording-replayer.d.ts +2 -2
  121. package/dist/state/recording-replayer.js +1 -1
  122. package/dist/state/recording-slice.d.ts +1 -1
  123. package/dist/state/replay-engine.d.ts +1 -1
  124. package/dist/state/store-subscribers.d.ts +2 -2
  125. package/dist/state/store-subscribers.js +26 -12
  126. package/dist/state/subscribe-to-selector.d.ts +1 -1
  127. package/dist/state/tracking-quality.d.ts +1 -1
  128. package/dist/state/tracking-quality.js +14 -6
  129. package/dist/state/tracking-slice.d.ts +1 -1
  130. package/dist/{state-E51QT_-j.js → state-BeKvn4B-.js} +1 -1
  131. package/dist/storage/file-system-utils.d.ts +1 -1
  132. package/dist/storage/index.d.ts +8 -8
  133. package/dist/storage/null-storage-backend.d.ts +1 -1
  134. package/dist/storage/opfs-storage-backend.d.ts +1 -1
  135. package/dist/storage/opfs-storage.d.ts +1 -1
  136. package/dist/storage/opfs-storage.js +30 -1
  137. package/dist/storage/storage-backend.d.ts +1 -1
  138. package/dist/storage/zip-coverage-embed.d.ts +1 -1
  139. package/dist/storage/zip-export.d.ts +1 -1
  140. package/dist/storage/zip-reader.d.ts +2 -2
  141. package/dist/storage/zip-reader.js +20 -7
  142. package/dist/{storage-backend-BdVLD0dU.d.ts → storage-backend-sEtmM4yW.d.ts} +1 -1
  143. package/dist/{store-subscribers-CA6AJH_8.d.ts → store-subscribers-DJUErW-o.d.ts} +6 -3
  144. package/dist/{subscribe-to-selector-B6EUmQ3I.d.ts → subscribe-to-selector-dQV8SpsO.d.ts} +1 -1
  145. package/dist/test-utils/browser-mocks.d.ts +1 -1
  146. package/dist/test-utils/browser-mocks.js +2 -0
  147. package/dist/test-utils/zip-round-trip-helpers.d.ts +1 -1
  148. package/dist/{tracking-slice-BuAZxXZ5.d.ts → tracking-slice-DMkHlbny.d.ts} +1 -1
  149. package/dist/types/ar-types.d.ts +1 -1
  150. package/dist/types/geo-types.d.ts +1 -1
  151. package/dist/types/index.d.ts +2 -2
  152. package/dist/utils/concurrency.d.ts +1 -1
  153. package/dist/utils/failure-tracker.d.ts +1 -1
  154. package/dist/utils/format-file-size.d.ts +1 -1
  155. package/dist/utils/fused-path.d.ts +1 -1
  156. package/dist/utils/index.d.ts +7 -7
  157. package/dist/utils/list-formatter.d.ts +1 -1
  158. package/dist/utils/logger.d.ts +1 -1
  159. package/dist/visualization/accuracy-circles.d.ts +1 -1
  160. package/dist/visualization/accuracy-circles.js +17 -8
  161. package/dist/visualization/alignment-lerper.d.ts +1 -1
  162. package/dist/visualization/ar-world-group-alignment.d.ts +1 -1
  163. package/dist/visualization/ar-world-group-alignment.js +1 -1
  164. package/dist/visualization/camera-follower.d.ts +1 -1
  165. package/dist/visualization/css3d-renderer-manager.d.ts +1 -1
  166. package/dist/visualization/frame-conversions.d.ts +1 -1
  167. package/dist/visualization/frustum-visibility.d.ts +1 -1
  168. package/dist/visualization/gps-anchor.d.ts +1 -1
  169. package/dist/visualization/gps-compass-cubes.d.ts +1 -1
  170. package/dist/visualization/gps-event-markers.d.ts +1 -1
  171. package/dist/visualization/gps-event-markers.js +1 -1
  172. package/dist/visualization/hit-test-reticle.d.ts +1 -1
  173. package/dist/visualization/index.d.ts +20 -19
  174. package/dist/visualization/index.js +4 -3
  175. package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
  176. package/dist/visualization/leaflet-map-overlay.js +1 -282
  177. package/dist/visualization/lerp-utils.d.ts +2 -2
  178. package/dist/visualization/lerp-utils.js +27 -3
  179. package/dist/visualization/map-data.d.ts +1 -1
  180. package/dist/visualization/map-data.js +1 -32
  181. package/dist/visualization/map-overlay-draw.d.ts +1 -1
  182. package/dist/visualization/map-overlay-draw.js +24 -2
  183. package/dist/visualization/map-overlay.d.ts +1 -1
  184. package/dist/visualization/occluder-mesh-driver.d.ts +130 -0
  185. package/dist/visualization/occluder-mesh-driver.js +219 -0
  186. package/dist/visualization/occlusion-mesh.d.ts +2 -0
  187. package/dist/visualization/occlusion-mesh.js +437 -0
  188. package/dist/visualization/three-dispose.d.ts +1 -1
  189. package/dist/visualization/vis-colors.d.ts +1 -1
  190. package/dist/{webxr-session-DG-eNfny.js → webxr-session-BCP2XK7k.js} +88 -13
  191. package/dist/{webxr-session-Do5L6G3B.d.ts → webxr-session-BWCpGd-2.d.ts} +73 -10
  192. package/dist/{zip-reader-D9iPQwdQ.d.ts → zip-reader-BzENzMH6.d.ts} +36 -10
  193. package/package.json +9 -5
  194. package/dist/index-_Rhgoqkh.d.ts +0 -2
  195. package/dist/lerp-utils-BLmHhkVe.d.ts +0 -20
  196. package/dist/map-data-B4oEehUh.d.ts +0 -49
  197. package/dist/occupancy-grid-DnOc-6PU.d.ts +0 -82
  198. /package/dist/{absolute-orientation-CAEh840t.d.ts → absolute-orientation-BAxc15J6.d.ts} +0 -0
  199. /package/dist/{alignment-lerper-Bil6vbVw.d.ts → alignment-lerper-gD70k7Fq.d.ts} +0 -0
  200. /package/dist/{ar-types-BFX2r1wk.d.ts → ar-types-Cc5yvBwn.d.ts} +0 -0
  201. /package/dist/{bresenham3d-CU1Gv2W4.d.ts → bresenham3d-DGc4nIb-.d.ts} +0 -0
  202. /package/dist/{camera-blit-capture-NKT9H5-e.d.ts → camera-blit-capture-BimSdyih.d.ts} +0 -0
  203. /package/dist/{camera-follower-CqJJ7zRj.d.ts → camera-follower-DfBm2J5i.d.ts} +0 -0
  204. /package/dist/{capability-checker-DUQLg6gq.d.ts → capability-checker-BTTpygvZ.d.ts} +0 -0
  205. /package/dist/{capture-failure-tracker-gsm8q7yi.d.ts → capture-failure-tracker-_BVfhpxv.d.ts} +0 -0
  206. /package/dist/{capture-motion-gate-0Yl2NpQG.d.ts → capture-motion-gate-BGoAMkmf.d.ts} +0 -0
  207. /package/dist/{chromium-camera-access-workaround-D4K2uwwQ.d.ts → chromium-camera-access-workaround-C6yJLXz9.d.ts} +0 -0
  208. /package/dist/{concurrency-By0oOTZt.d.ts → concurrency-DPeGBH0X.d.ts} +0 -0
  209. /package/dist/{css3d-renderer-manager-B3kGNtcn.d.ts → css3d-renderer-manager-CPpVtvgs.d.ts} +0 -0
  210. /package/dist/{failure-tracker-BO7M7jF_.d.ts → failure-tracker-CeKf5HIc.d.ts} +0 -0
  211. /package/dist/{file-system-utils-DOajnMm-.d.ts → file-system-utils-DueXHxo9.d.ts} +0 -0
  212. /package/dist/{format-file-size-Dc98ulzB.d.ts → format-file-size-DxN-EBLc.d.ts} +0 -0
  213. /package/dist/{frame-loop-CpVjQ1dH.d.ts → frame-loop-7GBMBu68.d.ts} +0 -0
  214. /package/dist/{frustum-visibility-CeoCZchO.d.ts → frustum-visibility-CokkgS_i.d.ts} +0 -0
  215. /package/dist/{geo-types-3Ip1NzVR.d.ts → geo-types-DrGVu8nS.d.ts} +0 -0
  216. /package/dist/{gps-BBO3hKfT.d.ts → gps-CDKDQokE.d.ts} +0 -0
  217. /package/dist/{gps-compass-cubes-DSN87L8p.d.ts → gps-compass-cubes-1mooS3BS.d.ts} +0 -0
  218. /package/dist/{gps-error-handler-BbPsfw-_.d.ts → gps-error-handler-C34GQuTu.d.ts} +0 -0
  219. /package/dist/{gps-event-markers-Cz9RMA2k.d.ts → gps-event-markers-Di2nBzx-.d.ts} +0 -0
  220. /package/dist/{h3-proximity-C-j0pw1j.d.ts → h3-proximity-D0GTHQmr.d.ts} +0 -0
  221. /package/dist/{hit-test-reticle-DV-2TpB9.d.ts → hit-test-reticle-CaQbrhbk.d.ts} +0 -0
  222. /package/dist/{image-quality-smCBoFj1.d.ts → image-quality-BMx2ko9-.d.ts} +0 -0
  223. /package/dist/{index-BAPokxMb.d.ts → index-D74JTX4I.d.ts} +0 -0
  224. /package/dist/{list-formatter-KNMS0ay2.d.ts → list-formatter-DLFDnS70.d.ts} +0 -0
  225. /package/dist/{logger-CLnPrHiD.d.ts → logger-CqTd5Kpk.d.ts} +0 -0
  226. /package/dist/{map-overlay-Dh2B97MP.d.ts → map-overlay-BCQgvIgU.d.ts} +0 -0
  227. /package/dist/{permission-checker-CDuI8BwC.d.ts → permission-checker-B-VtjnBA.d.ts} +0 -0
  228. /package/dist/{qr-pose-D2rfu5DA.d.ts → qr-pose-y3vaEd6x.d.ts} +0 -0
  229. /package/dist/{scene-node-names-BiShOQDB.d.ts → scene-node-names-CGb-ylBd.d.ts} +0 -0
  230. /package/dist/{session-disposers-zv9OGXPB.js → session-disposers-BPrMplIC.js} +0 -0
  231. /package/dist/{three-dispose-Bt1k7WKh.d.ts → three-dispose-BMOAmPhb.d.ts} +0 -0
  232. /package/dist/{vis-colors-Obw2pLqT.d.ts → vis-colors-C7HI0u9_.d.ts} +0 -0
  233. /package/dist/{webxr-nue-basis-3nfjDJJp.d.ts → webxr-nue-basis-CaCnYxuq.d.ts} +0 -0
  234. /package/dist/{xr-camera-texture-Cva1q3Qj.d.ts → xr-camera-texture-q0eIDSRg.d.ts} +0 -0
  235. /package/dist/{xr-error-handler-CtvHpjfm.d.ts → xr-error-handler-uVGDu9IX.d.ts} +0 -0
  236. /package/dist/{xr-frame-loop-DIYtRcUa.d.ts → xr-frame-loop-DX3JPpAU.d.ts} +0 -0
  237. /package/dist/{zip-coverage-embed-DCAREVmw.d.ts → zip-coverage-embed-ncVbaZAz.d.ts} +0 -0
  238. /package/dist/{zip-export-ol0S_Ofd.d.ts → zip-export-CtiUnAlJ.d.ts} +0 -0
@@ -5,10 +5,10 @@ import { DepthSampler, wrapXRDepthInfo } from "./ar/depth-sampler.js";
5
5
  import { WEBXR_TO_NUE } from "./ar/webxr-nue-basis.js";
6
6
  import { clearFrameUpdates, runFrameUpdates } from "./ar/frame-loop.js";
7
7
  import { clearXrFrameUpdates, runXrFrameUpdates } from "./ar/xr-frame-loop.js";
8
- import { n as ImageCaptureManager, t as DEFAULT_CAPTURE_CONFIG } from "./image-capture-B2-b6tKK.js";
8
+ import { n as ImageCaptureManager, t as DEFAULT_CAPTURE_CONFIG } from "./image-capture-DVcuqMtX.js";
9
9
  import { clearLastRestartedPayload, originReset, poseLost, poseReceived, resetTracking, selectLastRestartedPayload, selectTrackingPhase } from "./state/tracking-slice.js";
10
10
  import { acquireCameraTexture } from "./ar/xr-camera-texture.js";
11
- import { n as runSessionDisposers } from "./session-disposers-zv9OGXPB.js";
11
+ import { n as runSessionDisposers } from "./session-disposers-BPrMplIC.js";
12
12
  import { DEFAULT_RECORDING_OPTIONS, validateArCrashIsolationOptions } from "./state/recording-options.js";
13
13
  import { SCENE_NODE } from "./ar/scene-node-names.js";
14
14
  import { createCss3dRendererManager } from "./visualization/css3d-renderer-manager.js";
@@ -225,6 +225,8 @@ function resetWebXRState() {
225
225
  onTrackingRestarted = null;
226
226
  onTrackingLost = null;
227
227
  onTrackingRecovered = null;
228
+ onSessionEnd = null;
229
+ endRequestedByApp = false;
228
230
  depthSampler = null;
229
231
  onDepthCaptured = null;
230
232
  onDepthUnavailable = null;
@@ -329,6 +331,20 @@ let onTrackingLost = null;
329
331
  */
330
332
  let onTrackingRecovered = null;
331
333
  /**
334
+ * Host callback fired exactly once whenever the XRSession ends — on BOTH the
335
+ * app-initiated and the system-initiated path (set via setSessionEndCallback).
336
+ * Cleared by resetWebXRState() like every other module-level callback.
337
+ */
338
+ let onSessionEnd = null;
339
+ /**
340
+ * Set by endARSession() immediately before its `xrSession.end()` so the
341
+ * shared 'end' listener can tell the two trigger paths apart (the app's own
342
+ * end() fires the same 'end' event the system path does). Consumed (reset to
343
+ * false) by handleSessionEnded(); also cleared defensively in
344
+ * resetWebXRState() in case end() rejects without the event ever firing.
345
+ */
346
+ let endRequestedByApp = false;
347
+ /**
332
348
  * Depth sampler instance (created when AR session starts with depth callbacks)
333
349
  */
334
350
  let depthSampler = null;
@@ -563,7 +579,7 @@ function getCurrentArPose() {
563
579
  * @param isolationOptions - Crash-isolation diagnostic flags (DOM overlay,
564
580
  * depth-sensing, camera-access)
565
581
  * @param sessionFeatures - Opt-in standard WebXR features that are independent
566
- * of crash isolation (currently `requestHitTest`)
582
+ * of crash isolation (`requestHitTest`, `requestDepthOcclusion`)
567
583
  * @returns XRSessionInit options
568
584
  * @throws Error if rootElement is null
569
585
  */
@@ -576,7 +592,7 @@ function buildSessionOptions(rootElement, isolationOptions = {}, sessionFeatures
576
592
  optionalFeatures.push("dom-overlay");
577
593
  sessionOptions.domOverlay = { root: rootElement };
578
594
  }
579
- if (normalizedOptions.enableDepthSensingFeature) {
595
+ if (normalizedOptions.enableDepthSensingFeature || sessionFeatures.requestDepthOcclusion) {
580
596
  optionalFeatures.push("depth-sensing");
581
597
  Object.assign(sessionOptions, { depthSensing: {
582
598
  usagePreference: ["cpu-optimized"],
@@ -600,6 +616,23 @@ async function isWebXRSupported() {
600
616
  }
601
617
  }
602
618
  /**
619
+ * AR camera frustum constants — the single source of truth for live AR and
620
+ * replay (both build their camera via {@link createSceneHierarchy}).
621
+ *
622
+ * F2 (2026-07-04 user feedback): far raised 100 → 200 m so objects in the
623
+ * reported 100–200 m range are no longer frustum-culled. The far-plane
624
+ * distance itself is essentially free at this app's object counts; the real
625
+ * constraint is depth precision — far/near = 2×10⁴ is comfortable for a
626
+ * 24-bit depth buffer. Revisit the ratio if AR_CAMERA_NEAR ever shrinks.
627
+ *
628
+ * Note: these apply to WebGL content only. The CSS3D minimap is composited by
629
+ * the browser from the camera fov alone — near/far do not clip it (F1 in the
630
+ * same feedback doc).
631
+ */
632
+ const AR_CAMERA_FOV = 70;
633
+ const AR_CAMERA_NEAR = .01;
634
+ const AR_CAMERA_FAR = 200;
635
+ /**
603
636
  * Create the scene hierarchy with proper AR/GPS frame separation.
604
637
  * This is a pure function for testability.
605
638
  *
@@ -647,7 +680,7 @@ function createSceneHierarchy() {
647
680
  const newArPose = new THREE.Object3D();
648
681
  newArPose.name = "ar-pose";
649
682
  newBasisChangeNode.add(newArPose);
650
- const newCamera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, .01, 100);
683
+ const newCamera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, AR_CAMERA_NEAR, 200);
651
684
  newArPose.add(newCamera);
652
685
  const ambientLight = new THREE.AmbientLight(16777215, .5);
653
686
  newScene.add(ambientLight);
@@ -689,10 +722,7 @@ async function initAR(container, isolationOptions = {}, sessionFeatures = {}) {
689
722
  const sessionOptions = buildSessionOptions(container, currentArCrashIsolationOptions, sessionFeatures);
690
723
  xrSession = await navigator.xr.requestSession("immersive-ar", sessionOptions);
691
724
  xrSession.addEventListener("end", () => {
692
- log.info("Session ended");
693
- if (trackingStore) trackingStore.dispatch(resetTracking());
694
- xrSession = null;
695
- latestArPose = null;
725
+ handleSessionEnded();
696
726
  });
697
727
  await renderer.xr.setSession(xrSession);
698
728
  if (onTrackingRestarted && trackingStore) {
@@ -847,8 +877,15 @@ function onXRFrame(time, frame) {
847
877
  if (currentArCrashIsolationOptions.enableCss3dRenderer && css3dManager) css3dManager.render(scene, camera);
848
878
  }
849
879
  /**
850
- * Extract depth information from an XR frame.
851
- * Returns null if depth sensing is not available.
880
+ * Extract depth information from an XR frame. Returns `null` if depth sensing is
881
+ * not available (no pose/view, no `getDepthInformation`, or the call throws).
882
+ *
883
+ * Exported so a consumer can feed the **live depth occluder** from a
884
+ * `registerXrFrameUpdate` callback — the callback has the live `frame` +
885
+ * `referenceSpace`, computes `pose = frame.getViewerPose(referenceSpace)`, and
886
+ * passes both here to obtain the per-frame {@link DepthInfo} (with the widened
887
+ * `data` / `rawValueToMeters` / `normDepthBufferFromNormView` / `projectionMatrix`
888
+ * the occluder needs). The same wrapped depth the sparse grid sampler consumes.
852
889
  */
853
890
  function getDepthInfoFromFrame(frame, pose) {
854
891
  const view = pose?.views[0];
@@ -984,6 +1021,41 @@ function nueQuaternionToWebXR$1(nue) {
984
1021
  return nueQuaternionToWebXR(nue);
985
1022
  }
986
1023
  /**
1024
+ * Register a host callback fired exactly once whenever the XRSession ends —
1025
+ * app-initiated ({@link endARSession}) AND system-initiated (e.g. the Android
1026
+ * back gesture, which ends an immersive session directly and uncancelably).
1027
+ * `info.requestedByApp` discriminates the two. Fired AFTER the full teardown,
1028
+ * so the host can immediately start a fresh session from inside the callback.
1029
+ *
1030
+ * Cleared by resetWebXRState() (i.e. after every session end) like the other
1031
+ * module-level callbacks — re-register before/with each new session.
1032
+ * Pass `null` to unregister. F3, 2026-07-04 user feedback.
1033
+ */
1034
+ function setSessionEndCallback(cb) {
1035
+ onSessionEnd = cb;
1036
+ }
1037
+ /**
1038
+ * The ONE teardown for a session that has ended, shared by both trigger
1039
+ * paths via the XRSession 'end' listener. Before F3 the system-initiated
1040
+ * path (back gesture) only nulled `xrSession`/`latestArPose`, leaving the
1041
+ * renderer compositing the 3D scene over a black camera background and the
1042
+ * host app never notified — the "haunted scene" from
1043
+ * docs/2026-02-15-lifecycle-orphans.md §1.
1044
+ */
1045
+ function handleSessionEnded() {
1046
+ log.info("Session ended");
1047
+ const callback = onSessionEnd;
1048
+ const requestedByApp = endRequestedByApp;
1049
+ endRequestedByApp = false;
1050
+ if (trackingStore) trackingStore.dispatch(resetTracking());
1051
+ resetWebXRState();
1052
+ if (callback) try {
1053
+ callback({ requestedByApp });
1054
+ } catch (err) {
1055
+ log.error("Session-end callback threw:", err);
1056
+ }
1057
+ }
1058
+ /**
987
1059
  * End the current XR session and clean up all resources.
988
1060
  *
989
1061
  * Stops the animation loop, ends the XR session, then delegates the full
@@ -996,7 +1068,10 @@ function nueQuaternionToWebXR$1(nue) {
996
1068
  async function endARSession() {
997
1069
  if (renderer) renderer.setAnimationLoop(null);
998
1070
  try {
999
- if (xrSession) await xrSession.end();
1071
+ if (xrSession) {
1072
+ endRequestedByApp = true;
1073
+ await xrSession.end();
1074
+ }
1000
1075
  } finally {
1001
1076
  resetWebXRState();
1002
1077
  }
@@ -1284,4 +1359,4 @@ function getLiveCss3dManager() {
1284
1359
  return css3dManager;
1285
1360
  }
1286
1361
  //#endregion
1287
- export { setFrameCallback as A, startDepthCapture as B, nueQuaternionToWebXR$1 as C, setCamera as D, setArWorldGroup as E, setTrackingLostCallback as F, CameraFrameSource as G, stopCameraFrameCapture as H, setTrackingRecoveredCallback as I, setTrackingStore as L, setImageQualityAnalyzer as M, setScene as N, setCameraFrameCallback as O, setTrackingCallbacks as P, shouldLogCameraAccessDiagnostic as R, nuePositionToWebXR as S, setArPose as T, stopDepthCapture as U, startImageCapture as V, stopImageCapture as W, getScene as _, endARSession as a, isWebXRSupported as b, getArPose as c, getCameraFrameCaptureSize as d, getCameraFrameCount as f, getLiveCss3dManager as g, getImageCaptureFrameCount as h, createSceneHierarchy as i, setImageCaptureCallback as j, setDepthCaptureCallback as k, getArWorldGroup as l, getDepthSampleCount as m, applyAlignmentMatrix as n, extractPoseFromViewer as o, getCurrentArPose as p, buildSessionOptions as r, extractResetTransformData as s, DEFAULT_CAMERA_FRAME_CAPTURE_SIZE as t, getCamera as u, getXrCameraFromPose as v, resetWebXRState as w, isXRCameraLike as x, initAR as y, startCameraFrameCapture as z };
1362
+ export { setArWorldGroup as A, setTrackingLostCallback as B, initAR as C, nueQuaternionToWebXR$1 as D, nuePositionToWebXR as E, setImageCaptureCallback as F, startDepthCapture as G, setTrackingStore as H, setImageQualityAnalyzer as I, stopDepthCapture as J, startImageCapture as K, setScene as L, setCameraFrameCallback as M, setDepthCaptureCallback as N, resetWebXRState as O, setFrameCallback as P, setSessionEndCallback as R, getXrCameraFromPose as S, isXRCameraLike as T, shouldLogCameraAccessDiagnostic as U, setTrackingRecoveredCallback as V, startCameraFrameCapture as W, CameraFrameSource as X, stopImageCapture as Y, getDepthInfoFromFrame as _, applyAlignmentMatrix as a, getLiveCss3dManager as b, endARSession as c, getArPose as d, getArWorldGroup as f, getCurrentArPose as g, getCameraFrameCount as h, DEFAULT_CAMERA_FRAME_CAPTURE_SIZE as i, setCamera as j, setArPose as k, extractPoseFromViewer as l, getCameraFrameCaptureSize as m, AR_CAMERA_FOV as n, buildSessionOptions as o, getCamera as p, stopCameraFrameCapture as q, AR_CAMERA_NEAR as r, createSceneHierarchy as s, AR_CAMERA_FAR as t, extractResetTransformData as u, getDepthSampleCount as v, isWebXRSupported as w, getScene as x, getImageCaptureFrameCount as y, setTrackingCallbacks as z };
@@ -1,11 +1,11 @@
1
- import { i as DepthSample, t as ARPose } from "./ar-types-BFX2r1wk.js";
2
- import { i as DepthSamplerConfig } from "./depth-sampler-asc8exHt.js";
3
- import { t as ArCrashIsolationOptions } from "./recording-options-BPCpMHLK.js";
4
- import { i as FrameQualityVerdict, n as CapturedImage, o as ImageCaptureConfig, t as CapturedFrame } from "./image-capture-CNZDrQXG.js";
5
- import { a as TrackingSliceState, r as ResetTransformData } from "./tracking-slice-BuAZxXZ5.js";
6
- import { o as RgbaImage } from "./qr-frontend--fFX25mV.js";
7
- import { t as Css3dRendererManager } from "./css3d-renderer-manager-B3kGNtcn.js";
8
- import { r as XRCameraLike } from "./xr-camera-texture-Cva1q3Qj.js";
1
+ import { i as DepthSample, t as ARPose } from "./ar-types-Cc5yvBwn.js";
2
+ import { i as DepthSamplerConfig, t as DepthInfo } from "./depth-sampler-CwObAwEA.js";
3
+ import { t as ArCrashIsolationOptions } from "./recording-options-DYKWVI93.js";
4
+ import { i as FrameQualityVerdict, n as CapturedImage, o as ImageCaptureConfig, t as CapturedFrame } from "./image-capture-Bp6Pd4Md.js";
5
+ import { a as TrackingSliceState, r as ResetTransformData } from "./tracking-slice-DMkHlbny.js";
6
+ import { o as RgbaImage } from "./qr-frontend-BPURlh3S.js";
7
+ import { t as Css3dRendererManager } from "./css3d-renderer-manager-CPpVtvgs.js";
8
+ import { r as XRCameraLike } from "./xr-camera-texture-q0eIDSRg.js";
9
9
  import * as THREE from "three";
10
10
  import { OdometryTrackingRestartedPayload } from "gps-plus-slam-js";
11
11
 
@@ -69,6 +69,16 @@ declare function shouldLogCameraAccessDiagnostic(pose: XRViewerPose | null, alre
69
69
  * @internal
70
70
  */
71
71
  declare function resetWebXRState(): void;
72
+ /**
73
+ * Info passed to the session-end callback (F3, 2026-07-04 user feedback).
74
+ * `requestedByApp` discriminates the app's own `endARSession()` from a
75
+ * system-initiated end (e.g. the Android back gesture, which ends an
76
+ * immersive XRSession directly — no popstate, no beforeunload, not
77
+ * cancelable).
78
+ */
79
+ interface SessionEndInfo {
80
+ requestedByApp: boolean;
81
+ }
72
82
  /**
73
83
  * Default longer-edge resolution (px) for the camera-frame blit the QR / CV
74
84
  * detector sees. The on-device capture-resolution sweep (2026-06-17, via the
@@ -129,6 +139,18 @@ interface SessionFeatureOptions {
129
139
  * existing recorder/anchor sessions are unaffected.
130
140
  */
131
141
  requestHitTest?: boolean;
142
+ /**
143
+ * Request `depth-sensing` (cpu-optimized) for the **live depth occluder**
144
+ * even when crash-isolation's `enableDepthSensingFeature` is off. Consumer
145
+ * apps (AnchorStarter / MinimalExample) want occlusion without the recorder's
146
+ * depth-capture wiring, so the occluder owns its own session-feature switch.
147
+ * Both flags resolve the **same** cpu-optimized usage — setting both is valid
148
+ * (no conflict, no throw): the grid sampler and the occluder are two consumers
149
+ * of one depth read. Default `false`.
150
+ *
151
+ * @see GpsPlusSlamJs_Docs/docs/2026-06-14-webxr-depth-occlusion-plan.md §6/§8
152
+ */
153
+ requestDepthOcclusion?: boolean;
132
154
  }
133
155
  /**
134
156
  * Build XR session init options.
@@ -138,7 +160,7 @@ interface SessionFeatureOptions {
138
160
  * @param isolationOptions - Crash-isolation diagnostic flags (DOM overlay,
139
161
  * depth-sensing, camera-access)
140
162
  * @param sessionFeatures - Opt-in standard WebXR features that are independent
141
- * of crash isolation (currently `requestHitTest`)
163
+ * of crash isolation (`requestHitTest`, `requestDepthOcclusion`)
142
164
  * @returns XRSessionInit options
143
165
  * @throws Error if rootElement is null
144
166
  */
@@ -147,6 +169,23 @@ declare function buildSessionOptions(rootElement: Element | null, isolationOptio
147
169
  * Check if WebXR immersive-ar is supported
148
170
  */
149
171
  declare function isWebXRSupported(): Promise<boolean>;
172
+ /**
173
+ * AR camera frustum constants — the single source of truth for live AR and
174
+ * replay (both build their camera via {@link createSceneHierarchy}).
175
+ *
176
+ * F2 (2026-07-04 user feedback): far raised 100 → 200 m so objects in the
177
+ * reported 100–200 m range are no longer frustum-culled. The far-plane
178
+ * distance itself is essentially free at this app's object counts; the real
179
+ * constraint is depth precision — far/near = 2×10⁴ is comfortable for a
180
+ * 24-bit depth buffer. Revisit the ratio if AR_CAMERA_NEAR ever shrinks.
181
+ *
182
+ * Note: these apply to WebGL content only. The CSS3D minimap is composited by
183
+ * the browser from the camera fov alone — near/far do not clip it (F1 in the
184
+ * same feedback doc).
185
+ */
186
+ declare const AR_CAMERA_FOV = 70;
187
+ declare const AR_CAMERA_NEAR = 0.01;
188
+ declare const AR_CAMERA_FAR = 200;
150
189
  /**
151
190
  * Create the scene hierarchy with proper AR/GPS frame separation.
152
191
  * This is a pure function for testability.
@@ -196,6 +235,18 @@ declare function createSceneHierarchy(): {
196
235
  * `requestHitTest`) forwarded to the session negotiation.
197
236
  */
198
237
  declare function initAR(container: HTMLElement, isolationOptions?: Partial<ArCrashIsolationOptions>, sessionFeatures?: SessionFeatureOptions): Promise<void>;
238
+ /**
239
+ * Extract depth information from an XR frame. Returns `null` if depth sensing is
240
+ * not available (no pose/view, no `getDepthInformation`, or the call throws).
241
+ *
242
+ * Exported so a consumer can feed the **live depth occluder** from a
243
+ * `registerXrFrameUpdate` callback — the callback has the live `frame` +
244
+ * `referenceSpace`, computes `pose = frame.getViewerPose(referenceSpace)`, and
245
+ * passes both here to obtain the per-frame {@link DepthInfo} (with the widened
246
+ * `data` / `rawValueToMeters` / `normDepthBufferFromNormView` / `projectionMatrix`
247
+ * the occluder needs). The same wrapped depth the sparse grid sampler consumes.
248
+ */
249
+ declare function getDepthInfoFromFrame(frame: XRFrame, pose: XRViewerPose | null): DepthInfo | null;
199
250
  /**
200
251
  * Get the current Three.js scene (for adding objects like map)
201
252
  */
@@ -284,6 +335,18 @@ declare function nuePositionToWebXR(nue: readonly number[]): readonly [number, n
284
335
  * NUE [x, y, z, w] → WebXR [z, y, -x, w]
285
336
  */
286
337
  declare function nueQuaternionToWebXR$1(nue: readonly number[]): readonly [number, number, number, number];
338
+ /**
339
+ * Register a host callback fired exactly once whenever the XRSession ends —
340
+ * app-initiated ({@link endARSession}) AND system-initiated (e.g. the Android
341
+ * back gesture, which ends an immersive session directly and uncancelably).
342
+ * `info.requestedByApp` discriminates the two. Fired AFTER the full teardown,
343
+ * so the host can immediately start a fresh session from inside the callback.
344
+ *
345
+ * Cleared by resetWebXRState() (i.e. after every session end) like the other
346
+ * module-level callbacks — re-register before/with each new session.
347
+ * Pass `null` to unregister. F3, 2026-07-04 user feedback.
348
+ */
349
+ declare function setSessionEndCallback(cb: ((info: SessionEndInfo) => void) | null): void;
287
350
  /**
288
351
  * End the current XR session and clean up all resources.
289
352
  *
@@ -464,4 +527,4 @@ declare function setFrameCallback(callback: (() => void) | null): void;
464
527
  */
465
528
  declare function getLiveCss3dManager(): Css3dRendererManager | null;
466
529
  //#endregion
467
- export { setCamera as A, setTrackingStore as B, isWebXRSupported as C, resetWebXRState as D, nueQuaternionToWebXR$1 as E, setImageQualityAnalyzer as F, stopCameraFrameCapture as G, startCameraFrameCapture as H, setScene as I, stopDepthCapture as K, setTrackingCallbacks as L, setDepthCaptureCallback as M, setFrameCallback as N, setArPose as O, setImageCaptureCallback as P, setTrackingLostCallback as R, initAR as S, nuePositionToWebXR as T, startDepthCapture as U, shouldLogCameraAccessDiagnostic as V, startImageCapture as W, getDepthSampleCount as _, applyAlignmentMatrix as a, getScene as b, endARSession as c, getArPose as d, getArWorldGroup as f, getCurrentArPose as g, getCameraFrameCount as h, TrackingSubscribableStore as i, setCameraFrameCallback as j, setArWorldGroup as k, extractPoseFromViewer as l, getCameraFrameCaptureSize as m, DEFAULT_CAMERA_FRAME_CAPTURE_SIZE as n, buildSessionOptions as o, getCamera as p, stopImageCapture as q, SessionFeatureOptions as r, createSceneHierarchy as s, CameraFrameCaptureConfig as t, extractResetTransformData as u, getImageCaptureFrameCount as v, isXRCameraLike as w, getXrCameraFromPose as x, getLiveCss3dManager as y, setTrackingRecoveredCallback as z };
530
+ export { stopImageCapture as $, nuePositionToWebXR as A, setImageQualityAnalyzer as B, getImageCaptureFrameCount as C, initAR as D, getXrCameraFromPose as E, setCamera as F, setTrackingRecoveredCallback as G, setSessionEndCallback as H, setCameraFrameCallback as I, startCameraFrameCapture as J, setTrackingStore as K, setDepthCaptureCallback as L, resetWebXRState as M, setArPose as N, isWebXRSupported as O, setArWorldGroup as P, stopDepthCapture as Q, setFrameCallback as R, getDepthSampleCount as S, getScene as T, setTrackingCallbacks as U, setScene as V, setTrackingLostCallback as W, startImageCapture as X, startDepthCapture as Y, stopCameraFrameCapture as Z, getCamera as _, DEFAULT_CAMERA_FRAME_CAPTURE_SIZE as a, getCurrentArPose as b, TrackingSubscribableStore as c, createSceneHierarchy as d, endARSession as f, getArWorldGroup as g, getArPose as h, CameraFrameCaptureConfig as i, nueQuaternionToWebXR$1 as j, isXRCameraLike as k, applyAlignmentMatrix as l, extractResetTransformData as m, AR_CAMERA_FOV as n, SessionEndInfo as o, extractPoseFromViewer as p, shouldLogCameraAccessDiagnostic as q, AR_CAMERA_NEAR as r, SessionFeatureOptions as s, AR_CAMERA_FAR as t, buildSessionOptions as u, getCameraFrameCaptureSize as v, getLiveCss3dManager as w, getDepthInfoFromFrame as x, getCameraFrameCount as y, setImageCaptureCallback as z };
@@ -1,6 +1,32 @@
1
- import { Entry, Entry as Entry$1 } from "@zip.js/zip.js";
1
+ import { Entry, Entry as Entry$1, Reader, ZipReader } from "@zip.js/zip.js";
2
2
 
3
3
  //#region ../src/storage/zip-reader.d.ts
4
+ /**
5
+ * Input accepted by the zip-reading helpers: either the full zip bytes
6
+ * (the original behavior) or any zip.js {@link Reader} — e.g. a ranged
7
+ * reader over a file descriptor — so callers scanning many large archives
8
+ * can read only the central directory + the entries they open instead of
9
+ * loading whole files into memory.
10
+ *
11
+ * Reader contract: a single Reader instance may back several helper calls
12
+ * concurrently (see `loadRecording` in gps-plus-slam-recorder, which fans
13
+ * out over three helpers via Promise.all), so `init()` must be idempotent
14
+ * and `readUint8Array(index, length)` must support interleaved ranged reads.
15
+ * The caller owns the underlying resource lifecycle (helpers close their
16
+ * ZipReader wrappers, never the Reader's resource).
17
+ */
18
+ type ZipSource = Uint8Array | Reader<unknown>;
19
+ /**
20
+ * Wrap a {@link ZipSource} in a fresh zip.js ZipReader.
21
+ *
22
+ * Exported deliberately: consumers outside this workspace resolve this
23
+ * module from the published dist at runtime and probe
24
+ * `typeof toZipReader === 'function'` as the capability marker for lazy
25
+ * Reader support before passing anything other than Uint8Array (older
26
+ * published versions accept only Uint8Array). Do not rename or remove
27
+ * without treating it as a breaking API change.
28
+ */
29
+ declare function toZipReader(source: ZipSource): ZipReader<unknown>;
4
30
  /**
5
31
  * Maximum allowed uncompressed size (in bytes) for a single action or
6
32
  * metadata JSON file inside a recording zip. Entries exceeding this limit
@@ -29,32 +55,32 @@ interface ZipActionEntry {
29
55
  /**
30
56
  * Read all entries from a zip file.
31
57
  *
32
- * @param data - The zip file content as a Uint8Array
58
+ * @param data - The zip content as a Uint8Array, or a zip.js Reader for lazy access
33
59
  * @returns Array of zip entries (directories and files)
34
60
  */
35
- declare function readZipEntries(data: Uint8Array): Promise<Entry[]>;
61
+ declare function readZipEntries(data: ZipSource): Promise<Entry[]>;
36
62
  /**
37
63
  * Load all recorded Redux actions from a zip file.
38
64
  *
39
65
  * Filters for JSON files in the actions/ directory, parses them, and returns
40
66
  * them sorted by their filename index (chronological order for replay).
41
67
  *
42
- * @param data - The zip file content as a Uint8Array
68
+ * @param data - The zip content as a Uint8Array, or a zip.js Reader for lazy access
43
69
  * @param maxFileSize - Maximum allowed uncompressed size per entry (defaults to MAX_ACTION_FILE_SIZE)
44
70
  * @returns Array of action entries sorted by index
45
71
  */
46
- declare function loadActionsFromZip(data: Uint8Array, maxFileSize?: number): Promise<ZipActionEntry[]>;
72
+ declare function loadActionsFromZip(data: ZipSource, maxFileSize?: number): Promise<ZipActionEntry[]>;
47
73
  /**
48
74
  * Load session metadata from session.json in the zip file.
49
75
  *
50
76
  * Returns null if session.json is absent (graceful degradation for
51
77
  * recordings created before the metadata writing bug was fixed).
52
78
  *
53
- * @param data - The zip file content as a Uint8Array
79
+ * @param data - The zip content as a Uint8Array, or a zip.js Reader for lazy access
54
80
  * @param maxFileSize - Maximum allowed uncompressed size per entry (defaults to MAX_ACTION_FILE_SIZE)
55
81
  * @returns Parsed session metadata, or null if not found
56
82
  */
57
- declare function loadSessionMetadata(data: Uint8Array, maxFileSize?: number): Promise<Record<string, unknown> | null>;
83
+ declare function loadSessionMetadata(data: ZipSource, maxFileSize?: number): Promise<Record<string, unknown> | null>;
58
84
  /**
59
85
  * Load session metadata from session.json in a zip file provided as a Blob.
60
86
  *
@@ -126,9 +152,9 @@ interface ZipSubdirEntry {
126
152
  * `relativePath` for deterministic iteration. Returns an empty array when
127
153
  * the subdir is absent (graceful degradation for older zips).
128
154
  *
129
- * @param data - The zip file content as a Uint8Array
155
+ * @param data - The zip content as a Uint8Array, or a zip.js Reader for lazy access
130
156
  * @param subdir - Top-level subdir to scan (no leading or trailing `/`)
131
157
  */
132
- declare function loadEntriesFromSubdir(data: Uint8Array, subdir: string): Promise<ZipSubdirEntry[]>;
158
+ declare function loadEntriesFromSubdir(data: ZipSource, subdir: string): Promise<ZipSubdirEntry[]>;
133
159
  //#endregion
134
- export { ZipActionEntry as a, loadEntriesFromSubdir as c, loadSessionMetadataFromBlob as d, readZipEntries as f, RecordedAction as i, loadGpsPathFromBlob as l, GpsPathCoord as n, ZipSubdirEntry as o, MAX_ACTION_FILE_SIZE as r, loadActionsFromZip as s, Entry$1 as t, loadSessionMetadata as u };
160
+ export { ZipActionEntry as a, loadActionsFromZip as c, loadSessionMetadata as d, loadSessionMetadataFromBlob as f, RecordedAction as i, loadEntriesFromSubdir as l, toZipReader as m, GpsPathCoord as n, ZipSource as o, readZipEntries as p, MAX_ACTION_FILE_SIZE as r, ZipSubdirEntry as s, Entry$1 as t, loadGpsPathFromBlob as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gps-plus-slam-app-framework",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "Reusable AR+GPS app framework layer — WebXR session management, Three.js visualization, GPS sensors, storage abstractions, replay engine, and store wiring for gps-plus-slam-js.",
5
5
  "type": "module",
6
6
  "files": [
@@ -31,12 +31,12 @@
31
31
  },
32
32
  "types": "./dist/index.d.ts",
33
33
  "engines": {
34
- "node": ">=20.19.0"
34
+ "node": ">=22"
35
35
  },
36
36
  "dependencies": {
37
37
  "@reduxjs/toolkit": "^2.11.2",
38
38
  "gl-matrix": "3.4.4",
39
- "gps-plus-slam-js": "^1.7.0"
39
+ "gps-plus-slam-js": "^1.9.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@sentry/browser": ">=10.0.0",
@@ -58,6 +58,7 @@
58
58
  "@sentry/browser": "^10.53.1",
59
59
  "@types/leaflet": "^1.9.21",
60
60
  "@types/node": "^25.7.0",
61
+ "@types/qrcode": "^1.5.6",
61
62
  "@types/three": "^0.184.1",
62
63
  "@vitest/coverage-v8": "^4.1.6",
63
64
  "@vitest/eslint-plugin": "^1.6.17",
@@ -71,6 +72,7 @@
71
72
  "jsdom": "^29.1.1",
72
73
  "leaflet": "^1.9.4",
73
74
  "prettier": "^3.8.3",
75
+ "qrcode": "^1.5.4",
74
76
  "three": "^0.184.0",
75
77
  "tsdown": "^0.22.0",
76
78
  "typescript": "^6.0.3",
@@ -104,11 +106,13 @@
104
106
  "build": "tsdown --config config/tsdown.config.ts",
105
107
  "verify:pack": "pnpm pack --dry-run",
106
108
  "verify:community-key-lifetime": "node scripts/verify-community-key-lifetime.mjs",
107
- "test:unit": "vitest run --coverage --config config/vitest.config.ts",
109
+ "test:unit": "node ../scripts/run-vitest-scoped.mjs run --coverage --config=config/vitest.config.ts",
108
110
  "typecheck": "tsc -p tsconfig.app.json --noEmit",
109
111
  "typecheck:tests": "tsc -p tsconfig.vitest.json --noEmit",
110
- "lint": "eslint . --config config/eslint.config.mjs",
112
+ "lint": "eslint . --config config/eslint.config.mjs --max-warnings 37",
111
113
  "test:watch": "vitest --config config/vitest.config.ts",
114
+ "bench": "vitest bench --run --config config/vitest.bench.config.ts",
115
+ "bench:watch": "vitest bench --config config/vitest.bench.config.ts",
112
116
  "check:cycles": "dpdm -T --exit-code circular:1 --no-warning --no-tree ./src/index.ts",
113
117
  "setup": "bash ./scripts/setup.sh"
114
118
  }
@@ -1,2 +0,0 @@
1
- import { ArImageCapture as ArImageCapture$1, GpsPoint as GpsPoint$1, LatLong as LatLong$1, LatLongAlt, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, RootState as LibraryRootState, RootState as RootState$1, Vector3 as Vector3$1, arNorthBearingDeg, bearingDeltaDeg, calcGpsCoords as calcGpsCoords$1, calcRelativeCoordsInMeters, createGpsSlamStore, isIdentityMatrix4, magneticHeadingFromEnuQuat, odometryTrackingRestarted, validateLicenseKey as validateLicenseKey$1, webxrToNUE } from "gps-plus-slam-js";
2
- export { odometryTrackingRestarted as _, LibraryRootState as a, RootState$1 as c, bearingDeltaDeg as d, calcGpsCoords$1 as f, magneticHeadingFromEnuQuat as g, isIdentityMatrix4 as h, LatLongAlt as i, Vector3$1 as l, createGpsSlamStore as m, GpsPoint$1 as n, Matrix4$1 as o, calcRelativeCoordsInMeters as p, LatLong$1 as r, Quaternion$1 as s, ArImageCapture$1 as t, arNorthBearingDeg as u, validateLicenseKey$1 as v, webxrToNUE as y };
@@ -1,20 +0,0 @@
1
- //#region ../src/visualization/lerp-utils.d.ts
2
- /**
3
- * Shared lerp utilities for visualization modules.
4
- *
5
- * Both alignment-lerper and camera-follower need the same smoothing
6
- * rate constant and clamped-alpha formula. Centralised here (R3) to
7
- * keep the two modules in sync.
8
- */
9
- /** Default speed multiplier — ~90 % convergence in ~0.3 s at 60 fps. */
10
- declare const DEFAULT_LERP_RATE = 8;
11
- /**
12
- * Compute a frame-rate-independent lerp/slerp factor clamped to [0, 1].
13
- *
14
- * @param lerpRate Speed multiplier (higher = faster convergence).
15
- * @param dt Delta time in seconds since last frame.
16
- * @returns The interpolation alpha, guaranteed ≤ 1.0.
17
- */
18
- declare function clampedAlpha(lerpRate: number, dt: number): number;
19
- //#endregion
20
- export { clampedAlpha as n, DEFAULT_LERP_RATE as t };
@@ -1,49 +0,0 @@
1
- import { n as RawGpsSample, t as GpsCoord } from "./geo-types-3Ip1NzVR.js";
2
- import { LatLong, Matrix4, Vector3 } from "gps-plus-slam-js";
3
-
4
- //#region ../src/visualization/map-data.d.ts
5
- /** Fully-resolved trajectory data ready to be drawn onto a Leaflet map. */
6
- interface MapData {
7
- /** Latest user GPS position (blue dot), or null when unknown. */
8
- userPosition: GpsCoord | null;
9
- /** Raw GPS samples (yellow polyline + per-event accuracy circles). */
10
- rawGpsPath: RawGpsSample[];
11
- /** Fused SLAM+GPS positions (cyan polyline), recomputed from latest matrix. */
12
- fusedPath: GpsCoord[];
13
- /** Alignment-snapshot GPS positions (red). */
14
- alignmentSnapshots: GpsCoord[];
15
- }
16
- /**
17
- * Inputs to {@link buildMapData}, all optional so callers can supply only the
18
- * slices they have. Array inputs are read-only and defensively copied.
19
- */
20
- interface MapDataInput {
21
- /** Raw GPS samples in chronological order. */
22
- rawGpsPath?: readonly RawGpsSample[];
23
- /** Odometry positions (AR-local) used to derive the fused path. */
24
- odometryPositions?: ReadonlyArray<Vector3>;
25
- /** Latest alignment matrix from the solver (null until first solve). */
26
- alignmentMatrix?: Matrix4 | null;
27
- /** GPS origin for ENU→GPS conversion (null when no GPS yet). */
28
- zeroRef?: LatLong | null;
29
- /** Alignment-snapshot GPS positions. */
30
- alignmentSnapshots?: readonly GpsCoord[];
31
- /**
32
- * Explicit user position. When omitted, defaults to the last entry of
33
- * `rawGpsPath` (or null when there is none).
34
- */
35
- userPosition?: GpsCoord | null;
36
- }
37
- /**
38
- * Build a {@link MapData} snapshot from store-derived inputs.
39
- *
40
- * Pure and free of Leaflet/Three dependencies. The fused path is always
41
- * derived via {@link computeFusedPath} (D2); when the matrix or zero reference
42
- * is missing it is an empty array.
43
- *
44
- * @param input - Optional trajectory slices (see {@link MapDataInput}).
45
- * @returns A fully-resolved {@link MapData} with all arrays defensively copied.
46
- */
47
- declare function buildMapData(input: MapDataInput): MapData;
48
- //#endregion
49
- export { MapDataInput as n, buildMapData as r, MapData as t };
@@ -1,82 +0,0 @@
1
- import { t as GridCell } from "./bresenham3d-CU1Gv2W4.js";
2
- import { a as RgbTuple, i as DepthSample } from "./ar-types-BFX2r1wk.js";
3
- import { Vector3 } from "gps-plus-slam-js";
4
-
5
- //#region ../src/ar/occupancy-grid.d.ts
6
- interface OccupancyGridOptions {
7
- /** Edge length of a cubic grid cell in meters. Default 0.15 (Unity parity). */
8
- readonly cellSizeM?: number;
9
- /**
10
- * Dominant-axis steps before a ray's endpoint at which free-space
11
- * carving stops, to respect depth noise. Default 2 (Unity parity).
12
- */
13
- readonly carveStopCells?: number;
14
- }
15
- declare class OccupancyGrid {
16
- readonly cellSizeM: number;
17
- readonly carveStopCells: number;
18
- private readonly cells;
19
- constructor(options?: OccupancyGridOptions);
20
- /** Number of occupied cells. */
21
- get size(): number;
22
- /**
23
- * Fold one depth sample into the grid: unproject each point, carve free
24
- * space from the camera cell to the point cell, then count the point's
25
- * cell as occupied. Points that cannot be unprojected (no
26
- * projectionMatrix on old recordings, invalid depth/coords) are skipped.
27
- *
28
- * Carving and incrementing run as two separate passes over the sample's
29
- * points: all rays are carved first, then every endpoint is incremented.
30
- * A single interleaved pass would be order-dependent — a deeper point's
31
- * carve could erase the endpoint a nearer point added earlier in the same
32
- * sample. Splitting the passes makes the result deterministic and lets an
33
- * endpoint observed within a sample survive other rays in that same
34
- * sample. (Deeper-carves-nearer still applies ACROSS samples: a later
35
- * sample's ray carves an earlier sample's endpoint as before.)
36
- *
37
- * @returns the number of points actually added.
38
- */
39
- addSample(sample: DepthSample): number;
40
- /** Occupied cells observed at least `minObservations` times (default 1). */
41
- getOccupiedCells(minObservations?: number): GridCell[];
42
- /** Quantize a raw-WebXR position to its grid cell (round per axis). */
43
- cellForPosition(pos: Vector3): GridCell;
44
- /** Center of a cell in raw WebXR space (round-consistent: cell · cellSizeM). */
45
- getCellCenter(cell: GridCell): Vector3;
46
- /**
47
- * Running-average of the EXACT unprojected surface points observed in this
48
- * cell (raw WebXR space), or null for an unknown cell. Unlike
49
- * {@link getCellCenter} (the geometric 15 cm-lattice center) this hugs the
50
- * real measured surface and noise-averages across viewpoints — used by the
51
- * COLMAP `points3D` export and the debug cubes (follow-up Item A). Being a
52
- * centroid of points that fell in the cell, it always lies within
53
- * `cellSizeM/2` of the cell center per axis.
54
- */
55
- getCellPoint(cell: GridCell): Vector3 | null;
56
- /**
57
- * Running-average color of the cell's colored observations (Iter 8), or
58
- * null when the cell is unknown or was only ever observed without color
59
- * (rgb option off / pre-Iter-8 recordings) — consumers fall back to
60
- * height-based coloring. Channels are rounded and clamped to 0–255.
61
- */
62
- getCellColor(cell: GridCell): RgbTuple | null;
63
- /**
64
- * Walk the grid from `startPos` to `endPos` and return the center of the
65
- * first cell occupied at least `minObservations` times, or null.
66
- * Port of Unity's `TryRaycast` (hook for cursor/floor-detection parity).
67
- */
68
- raycast(startPos: Vector3, endPos: Vector3, minObservations?: number): Vector3 | null;
69
- /** Remove all occupied cells (e.g. on store swap / new session). */
70
- clear(): void;
71
- /**
72
- * Delete occupied cells along the camera→point ray (the space was seen
73
- * through, so it must be free), stopping `carveStopCells` dominant-axis
74
- * steps before the endpoint. The endpoint cell itself is additionally
75
- * protected so a current observation is never erased (relevant for
76
- * carveStopCells = 0 and for the unconditional start-cell visit).
77
- */
78
- private carve;
79
- private increment;
80
- }
81
- //#endregion
82
- export { OccupancyGridOptions as n, OccupancyGrid as t };