gps-plus-slam-app-framework 1.10.0 → 1.11.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 (203) hide show
  1. package/README.md +14 -14
  2. package/dist/{absolute-orientation-C_IxDR_j.d.ts → absolute-orientation-Dj1One3y.d.ts} +1 -1
  3. package/dist/{accuracy-circles-BE7tbvYV.d.ts → accuracy-circles-BHz7yVIL.d.ts} +1 -1
  4. package/dist/{app-selectors-CV7ggGoo.d.ts → app-selectors-DG0ZqaeI.d.ts} +1 -1
  5. package/dist/ar/ar-crash-isolation.d.ts +2 -0
  6. package/dist/ar/ar-crash-isolation.js +40 -0
  7. package/dist/ar/capability-checker.d.ts +1 -1
  8. package/dist/ar/capture-motion-gate.d.ts +2 -0
  9. package/dist/{capture-motion-gate-D1eyGC_o.js → ar/capture-motion-gate.js} +25 -2
  10. package/dist/ar/chromium-camera-access-workaround.d.ts +1 -1
  11. package/dist/ar/chromium-camera-access-workaround.js +1 -1
  12. package/dist/ar/depth-grid-lookup.d.ts +1 -1
  13. package/dist/ar/depth-occluder.d.ts +1 -1
  14. package/dist/ar/depth-occluder.js +1 -1
  15. package/dist/ar/depth-sampler.d.ts +2 -2
  16. package/dist/ar/depth-unprojection.d.ts +1 -1
  17. package/dist/ar/enable-gps-ar.d.ts +1 -1
  18. package/dist/ar/enable-gps-ar.js +2 -2
  19. package/dist/ar/frame-loop.d.ts +1 -1
  20. package/dist/ar/image-capture.d.ts +1 -1
  21. package/dist/ar/image-capture.js +1 -1
  22. package/dist/ar/image-quality.d.ts +2 -2
  23. package/dist/ar/image-quality.js +136 -4
  24. package/dist/ar/index.d.ts +28 -26
  25. package/dist/ar/index.js +15 -14
  26. package/dist/ar/occlusion-mesh-worker.d.ts +1 -1
  27. package/dist/ar/occupancy-grid.d.ts +1 -1
  28. package/dist/ar/occupancy-grid.js +1 -1
  29. package/dist/ar/occupancy-mesher.d.ts +1 -1
  30. package/dist/ar/occupancy-mesher.js +1 -1
  31. package/dist/ar/qr/index.d.ts +11 -0
  32. package/dist/ar/qr/index.js +11 -0
  33. package/dist/ar/{planar-pnp.d.ts → qr/planar-pnp.d.ts} +1 -1
  34. package/dist/ar/{planar-pnp.js → qr/planar-pnp.js} +1 -1
  35. package/dist/ar/qr/qr-debug-view.d.ts +2 -0
  36. package/dist/ar/{qr-debug-view.js → qr/qr-debug-view.js} +2 -2
  37. package/dist/ar/{qr-derived-pose.d.ts → qr/qr-derived-pose.d.ts} +1 -1
  38. package/dist/ar/{qr-derived-pose.js → qr/qr-derived-pose.js} +2 -2
  39. package/dist/ar/{qr-detection-controller.d.ts → qr/qr-detection-controller.d.ts} +1 -1
  40. package/dist/ar/qr/qr-detection-controller.js +2 -0
  41. package/dist/ar/{qr-frontend.d.ts → qr/qr-frontend.d.ts} +1 -1
  42. package/dist/ar/{qr-frontend.js → qr/qr-frontend.js} +1 -1
  43. package/dist/ar/{qr-pose.d.ts → qr/qr-pose.d.ts} +1 -1
  44. package/dist/ar/{qr-pose.js → qr/qr-pose.js} +1 -1
  45. package/dist/ar/qr/qr-size-depth-context.d.ts +3 -0
  46. package/dist/ar/{qr-size-depth-context.js → qr/qr-size-depth-context.js} +4 -4
  47. package/dist/ar/{qr-size-measurer.d.ts → qr/qr-size-measurer.d.ts} +1 -1
  48. package/dist/ar/qr/qr-size-measurer.js +2 -0
  49. package/dist/ar/replay-scene.d.ts +1 -1
  50. package/dist/ar/replay-scene.js +15 -13
  51. package/dist/ar/webxr-session.d.ts +4 -4
  52. package/dist/ar/webxr-session.js +2 -2
  53. package/dist/ar/xr-camera-texture.d.ts +1 -1
  54. package/dist/ar/xr-frame-loop.d.ts +1 -1
  55. package/dist/ar/xr-frame-loop.js +1 -1
  56. package/dist/ar-crash-isolation-DlXCGzMf.d.ts +52 -0
  57. package/dist/{ar-world-group-alignment-B6XiA1cT.d.ts → ar-world-group-alignment-BdS_h8Nf.d.ts} +2 -2
  58. package/dist/{capability-checker-DEo-ktWI.d.ts → capability-checker-BZ3_x1YL.d.ts} +1 -1
  59. package/dist/capture-motion-gate-CPwLekNf.d.ts +120 -0
  60. package/dist/{chromium-camera-access-workaround-DCd8SP2N.d.ts → chromium-camera-access-workaround-BHR4clTE.d.ts} +1 -1
  61. package/dist/{create-slam-app-store-CH31erpP.d.ts → create-slam-app-store-DFm5K9Ob.d.ts} +13 -4
  62. package/dist/{create-slam-app-store-DLv5ZwqU.js → create-slam-app-store-oK9bnqyI.js} +8 -6
  63. package/dist/{depth-grid-lookup-DY6zYTLx.d.ts → depth-grid-lookup-CCuzlqUo.d.ts} +1 -1
  64. package/dist/{depth-sampler-txG8evgQ.d.ts → depth-sampler-CS2jAFw4.d.ts} +2 -2
  65. package/dist/{depth-unprojection-JKkeqJrV.d.ts → depth-unprojection-ET3Gwedf.d.ts} +1 -1
  66. package/dist/{enable-gps-ar-BbNWyqp5.d.ts → enable-gps-ar-D_xEHzh5.d.ts} +10 -5
  67. package/dist/{file-system-utils-CfLTj5Ra.d.ts → file-system-utils-BHI0rXr9.d.ts} +1 -1
  68. package/dist/geo/h3-proximity.d.ts +1 -1
  69. package/dist/geo/h3-proximity.js +1 -1
  70. package/dist/geo/index.d.ts +1 -1
  71. package/dist/{geodesic-angle-HXBWiXiI.js → geodesic-angle-CZ_Ow90I.js} +2 -2
  72. package/dist/{gps-ar-pose-sampler-BOOV0jJk.d.ts → gps-ar-pose-sampler-BuuUuK-D.d.ts} +1 -1
  73. package/dist/{gps-event-coordinator-03rVh_us.d.ts → gps-event-coordinator-Cruoe5I-.d.ts} +4 -4
  74. package/dist/{gps-event-markers-BsC2Ynlh.d.ts → gps-event-markers-y2b2aVl6.d.ts} +35 -1
  75. package/dist/{h3-proximity-pFluGfwL.d.ts → h3-proximity-BaAulrnM.d.ts} +1 -1
  76. package/dist/{image-capture-Cr_rljeV.d.ts → image-capture-BevgKpoO.d.ts} +6 -6
  77. package/dist/{image-capture-BUqqsOi3.js → image-capture-C4DwxC10.js} +3 -3
  78. package/dist/{image-quality-BjBLoTec.d.ts → image-quality--HLuyJ2r.d.ts} +44 -2
  79. package/dist/{index-C2Bo0buN.d.ts → index-BWVwd9Zw.d.ts} +9 -71
  80. package/dist/{index-CuHaGY0F.d.ts → index-ClmnNJ6-.d.ts} +1 -1
  81. package/dist/index-Dxb6ATNK.d.ts +64 -0
  82. package/dist/index.d.ts +55 -55
  83. package/dist/index.js +23 -23
  84. package/dist/{leaflet-map-overlay-BRkUhZMD.js → leaflet-map-overlay-CTcTVmL1.js} +1 -1
  85. package/dist/{leaflet-map-overlay-QhF199BW.d.ts → leaflet-map-overlay-CksetpTt.d.ts} +1 -1
  86. package/dist/{map-data-D8sSxpOr.d.ts → map-data-D8cCqpOM.d.ts} +2 -2
  87. package/dist/{map-data-D3oE8AQP.js → map-data-DkhsYDGM.js} +1 -1
  88. package/dist/{map-overlay-draw-1E61FLKs.d.ts → map-overlay-draw-Cy-klqoA.d.ts} +1 -1
  89. package/dist/{median-Bla_W50f.js → median-DDBrZGP0.js} +2 -2
  90. package/dist/{occlusion-mesh-CZ4i_SW2.d.ts → occlusion-mesh-BWe2PrVi.d.ts} +22 -3
  91. package/dist/{occupancy-grid-f0I07UxI.d.ts → occupancy-grid-CYBdmMOo.d.ts} +2 -2
  92. package/dist/{persistence-middleware-CI4Cetnl.d.ts → persistence-middleware-Cun4aF5M.d.ts} +12 -2
  93. package/dist/{planar-pnp-CPLhg5MX.d.ts → planar-pnp-ByxwDEyM.d.ts} +2 -2
  94. package/dist/{ar-D-03Kso-.js → qr-CTp5xI83.js} +11 -25
  95. package/dist/{qr-debug-view-BmbWo06j.d.ts → qr-debug-view-CGlITU09.d.ts} +2 -2
  96. package/dist/{qr-derived-pose-DEYT85ul.d.ts → qr-derived-pose-DZPxZd9C.d.ts} +3 -3
  97. package/dist/{qr-detected-slice-CPEkGbxh.d.ts → qr-detected-slice-mfyxD2-M.d.ts} +9 -8
  98. package/dist/{qr-detection-controller-IcMRpTjV.d.ts → qr-detection-controller-C5NII-vs.d.ts} +4 -4
  99. package/dist/{qr-detection-controller-bRTJXC6G.js → qr-detection-controller-DXc1yHRf.js} +3 -3
  100. package/dist/{qr-frontend-61SKPSyU.d.ts → qr-frontend-QzKZSqB-.d.ts} +2 -2
  101. package/dist/{qr-pose-CCTF1PP0.d.ts → qr-pose-21fRDcFO.d.ts} +1 -1
  102. package/dist/{qr-pose-aggregation-H-O_Jjz9.js → qr-pose-aggregation-Cp0Mtg_j.js} +4 -4
  103. package/dist/{qr-pose-aggregation-BL6gfl0s.d.ts → qr-pose-aggregation-mABSN0AW.d.ts} +2 -2
  104. package/dist/{qr-size-depth-context-DJsYqbqY.d.ts → qr-size-depth-context-CMDv6T29.d.ts} +3 -3
  105. package/dist/{qr-size-measurer-Bl_i-umk.d.ts → qr-size-measurer-rVFf4AdM.d.ts} +5 -5
  106. package/dist/{qr-size-measurer-BVOIg-He.js → qr-size-measurer-zZB9S1va.js} +4 -4
  107. package/dist/{recording-replayer-DyIN13nG.d.ts → recording-replayer-qT2EM1Qs.d.ts} +1 -1
  108. package/dist/{recording-slice-DziOl7P5.d.ts → recording-slice-DXw5-UvO.d.ts} +10 -5
  109. package/dist/{replay-engine-DAymjsd1.d.ts → replay-engine-B1H_kLhK.d.ts} +1 -1
  110. package/dist/{replay-scene-CZdWgcpc.d.ts → replay-scene-BJeO36YT.d.ts} +12 -5
  111. package/dist/sensors/absolute-orientation.d.ts +1 -1
  112. package/dist/sensors/absolute-orientation.js +1 -1
  113. package/dist/sensors/gps.d.ts +1 -1
  114. package/dist/sensors/index.d.ts +3 -3
  115. package/dist/sensors/permission-checker.d.ts +1 -1
  116. package/dist/{session-disposers-BZS-hi8u.js → session-disposers-B7hUN90w.js} +1 -1
  117. package/dist/state/app-selectors.d.ts +1 -1
  118. package/dist/state/combined-root-state.d.ts +1 -1
  119. package/dist/state/create-slam-app-store.d.ts +1 -1
  120. package/dist/state/create-slam-app-store.js +1 -1
  121. package/dist/state/gps-ar-pose-sampler.d.ts +2 -2
  122. package/dist/state/gps-event-coordinator.d.ts +2 -2
  123. package/dist/state/gps-event-coordinator.js +1 -1
  124. package/dist/state/index.d.ts +17 -18
  125. package/dist/state/index.js +4 -5
  126. package/dist/state/persistence-middleware.d.ts +2 -2
  127. package/dist/state/persistence-middleware.js +24 -15
  128. package/dist/state/qr-detected-slice.d.ts +3 -3
  129. package/dist/state/qr-detected-slice.js +8 -8
  130. package/dist/state/recording-replayer.d.ts +2 -2
  131. package/dist/state/recording-replayer.js +1 -1
  132. package/dist/state/recording-slice.d.ts +1 -1
  133. package/dist/state/replay-engine.d.ts +1 -1
  134. package/dist/state/store-subscribers.d.ts +2 -2
  135. package/dist/state/store-subscribers.js +1 -1
  136. package/dist/state/subscribe-to-selector.d.ts +1 -1
  137. package/dist/state/tracking-quality.d.ts +1 -1
  138. package/dist/state/tracking-quality.js +2 -2
  139. package/dist/state/tracking-slice.d.ts +1 -1
  140. package/dist/{state-U45ioVyB.js → state-CDF5LvsO.js} +1 -2
  141. package/dist/storage/file-system-utils.d.ts +1 -1
  142. package/dist/storage/file-system-utils.js +1 -1
  143. package/dist/storage/index.d.ts +2 -2
  144. package/dist/storage/zip-coverage-embed.d.ts +1 -1
  145. package/dist/storage/zip-coverage-embed.js +1 -1
  146. package/dist/{store-subscribers-DtwakLrQ.d.ts → store-subscribers-CWHToX6N.d.ts} +2 -2
  147. package/dist/{subscribe-to-selector-Cgo9JTfS.d.ts → subscribe-to-selector-j-eOYybQ.d.ts} +1 -1
  148. package/dist/test-utils/browser-mocks.d.ts +1 -1
  149. package/dist/{tracking-slice-Bt2OEQhA.d.ts → tracking-slice-BAbcZK-Y.d.ts} +3 -2
  150. package/dist/types/ar-types.d.ts +1 -1
  151. package/dist/types/index.d.ts +1 -1
  152. package/dist/utils/index.js +1 -1
  153. package/dist/visualization/accuracy-circles.d.ts +1 -1
  154. package/dist/visualization/accuracy-circles.js +1 -1
  155. package/dist/visualization/alignment-lerper.d.ts +1 -1
  156. package/dist/visualization/ar-world-group-alignment.d.ts +1 -1
  157. package/dist/visualization/ar-world-group-alignment.js +2 -2
  158. package/dist/visualization/camera-follower.d.ts +1 -1
  159. package/dist/visualization/css3d-renderer-manager.d.ts +1 -1
  160. package/dist/visualization/gps-anchor.js +2 -2
  161. package/dist/visualization/gps-event-markers.d.ts +2 -2
  162. package/dist/visualization/gps-event-markers.js +27 -6
  163. package/dist/visualization/index.d.ts +13 -14
  164. package/dist/visualization/index.js +4 -5
  165. package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
  166. package/dist/visualization/leaflet-map-overlay.js +1 -1
  167. package/dist/visualization/map-data.d.ts +1 -1
  168. package/dist/visualization/map-data.js +1 -1
  169. package/dist/visualization/map-overlay-draw.d.ts +1 -1
  170. package/dist/visualization/occluder-mesh-driver.d.ts +1 -1
  171. package/dist/visualization/occluder-mesh-driver.js +1 -1
  172. package/dist/visualization/occlusion-mesh.d.ts +2 -2
  173. package/dist/visualization/occlusion-mesh.js +28 -3
  174. package/dist/visualization/three-dispose.d.ts +1 -1
  175. package/dist/visualization/vis-colors.d.ts +1 -1
  176. package/dist/{webxr-session-CGFZ429B.d.ts → webxr-session-DefwObIu.d.ts} +144 -194
  177. package/dist/{webxr-session-DWKUsCN9.js → webxr-session-OyR3YbTq.js} +151 -281
  178. package/dist/{xr-frame-loop-25gM4B0K.d.ts → xr-frame-loop-BiZvgqP7.d.ts} +1 -1
  179. package/dist/{zip-coverage-embed-BrodRLq0.d.ts → zip-coverage-embed-CyoX7XL7.d.ts} +1 -1
  180. package/package.json +4 -2
  181. package/dist/ar/qr-debug-view.d.ts +0 -2
  182. package/dist/ar/qr-detection-controller.js +0 -2
  183. package/dist/ar/qr-size-depth-context.d.ts +0 -3
  184. package/dist/ar/qr-size-measurer.js +0 -2
  185. package/dist/capture-motion-gate-BmjiWUJv.d.ts +0 -24
  186. package/dist/map-overlay-0yJOcEVO.d.ts +0 -153
  187. package/dist/recording-options-Cai9D14V.d.ts +0 -700
  188. package/dist/state/recording-options.d.ts +0 -2
  189. package/dist/state/recording-options.js +0 -620
  190. package/dist/visualization/map-overlay.d.ts +0 -2
  191. package/dist/visualization/map-overlay.js +0 -241
  192. /package/dist/{alignment-lerper-B4COh_0p.d.ts → alignment-lerper-DAHicRON.d.ts} +0 -0
  193. /package/dist/{ar-types-CBafnxhE.d.ts → ar-types-D6PYS4bc.d.ts} +0 -0
  194. /package/dist/{camera-follower-B6zA3dy9.d.ts → camera-follower-CO_ibF2o.d.ts} +0 -0
  195. /package/dist/{css3d-renderer-manager-DbrSY7Mh.d.ts → css3d-renderer-manager-CJjHtCMT.d.ts} +0 -0
  196. /package/dist/{device-orientation-cache-BjEaEAmh.js → device-orientation-cache-j-kLP8he.js} +0 -0
  197. /package/dist/{frame-loop-7HigCj7m.d.ts → frame-loop-7GBMBu68.d.ts} +0 -0
  198. /package/dist/{gps-CX5b9g3s.d.ts → gps-CnhYrJCa.d.ts} +0 -0
  199. /package/dist/{occupancy-mesher-BqnRd10x.d.ts → occupancy-mesher-B4Bv4BTk.d.ts} +0 -0
  200. /package/dist/{permission-checker-D1C5zvo-.d.ts → permission-checker-B-VtjnBA.d.ts} +0 -0
  201. /package/dist/{three-dispose-C9mdpSRX.d.ts → three-dispose-C3mnKQR5.d.ts} +0 -0
  202. /package/dist/{vis-colors-DjStl_tD.d.ts → vis-colors-CoSpbZEO.d.ts} +0 -0
  203. /package/dist/{xr-camera-texture-C6Z4d7RR.d.ts → xr-camera-texture-q0eIDSRg.d.ts} +0 -0
@@ -1,11 +1,10 @@
1
- import { i as DepthSample, t as ARPose } from "./ar-types-CBafnxhE.js";
2
- import { i as DepthSamplerConfig, t as DepthInfo } from "./depth-sampler-txG8evgQ.js";
3
- import { t as ArCrashIsolationOptions } from "./recording-options-Cai9D14V.js";
4
- import { i as FrameQualityVerdict, n as CapturedImage, o as ImageCaptureConfig, t as CapturedFrame } from "./image-capture-Cr_rljeV.js";
5
- import { a as TrackingSliceState, r as ResetTransformData } from "./tracking-slice-Bt2OEQhA.js";
6
- import { o as RgbaImage } from "./qr-frontend-61SKPSyU.js";
7
- import { t as Css3dRendererManager } from "./css3d-renderer-manager-DbrSY7Mh.js";
8
- import { r as XRCameraLike } from "./xr-camera-texture-C6Z4d7RR.js";
1
+ import { t as ArCrashIsolationOptions } from "./ar-crash-isolation-DlXCGzMf.js";
2
+ import { i as DepthSample, t as ARPose } from "./ar-types-D6PYS4bc.js";
3
+ import { i as DepthSamplerConfig, t as DepthInfo } from "./depth-sampler-CS2jAFw4.js";
4
+ import { i as FrameQualityVerdict, n as CapturedImage, o as ImageCaptureConfig, t as CapturedFrame } from "./image-capture-BevgKpoO.js";
5
+ import { a as TrackingSliceState, r as ResetTransformData } from "./tracking-slice-BAbcZK-Y.js";
6
+ import { o as RgbaImage } from "./qr-frontend-QzKZSqB-.js";
7
+ import { r as XRCameraLike } from "./xr-camera-texture-q0eIDSRg.js";
9
8
  import * as THREE from "three";
10
9
  import { OdometryTrackingRestartedPayload } from "gps-plus-slam-js";
11
10
 
@@ -27,6 +26,7 @@ interface TrackingSubscribableStore {
27
26
  };
28
27
  subscribe: (listener: () => void) => () => void;
29
28
  }
29
+ /** Runtime guard for `XRView.camera` candidates (finite, positive dimensions). */
30
30
  declare function isXRCameraLike(value: unknown): value is XRCameraLike;
31
31
  /**
32
32
  * Extract a validated XRCameraLike from an XRViewerPose.
@@ -64,6 +64,30 @@ declare function getXrCameraFromPose(pose: XRViewerPose | null): XRCameraLike |
64
64
  * "first frame has no pose" false-negative regression is directly testable.
65
65
  */
66
66
  declare function shouldLogCameraAccessDiagnostic(pose: XRViewerPose | null, alreadyLogged: boolean, captureActive: boolean): boolean;
67
+ /**
68
+ * Extract the reset transform from an XRReferenceSpaceEvent-like object.
69
+ *
70
+ * Distinguishes three cases per OdometryTrackingRestartedPayload semantics:
71
+ * - Transform property missing (older browsers) → returns `undefined`
72
+ * - Transform property present but null (runtime can't determine delta) → returns `null`
73
+ * - Transform property present with data → returns `ResetTransformData`
74
+ *
75
+ * This is a pure function extracted for testability.
76
+ *
77
+ * @param event - The event object, cast to a record with an optional transform property
78
+ * @returns ResetTransformData, null, or undefined
79
+ */
80
+ declare function extractResetTransformData(event: Record<string, unknown>): ResetTransformData | null | undefined;
81
+ /**
82
+ * Extract pose data from an XRViewerPose.
83
+ * Returns null if pose or views are unavailable.
84
+ *
85
+ * This is a pure function extracted for testability.
86
+ *
87
+ * @param pose - The XRViewerPose from frame.getViewerPose()
88
+ * @returns ARPose with position and orientation, or null
89
+ */
90
+ declare function extractPoseFromViewer(pose: XRViewerPose | null): ARPose | null;
67
91
  /**
68
92
  * Reset WebXR module state - exported for testing only.
69
93
  * @internal
@@ -88,33 +112,9 @@ interface SessionEndInfo {
88
112
  * so 1024 is the safe default. Raise per-consumer via
89
113
  * `startCameraFrameCapture({ captureSize })`.
90
114
  *
91
- * @see GpsPlusSlamJs_Docs/docs/2026-06-17-qr-size-accuracy-and-thin-demo-plan.md (WS-C)
115
+ * @see GpsPlusSlamJs_Docs/docs/2026-06-17-1020-qr-size-accuracy-and-thin-demo-plan.md (WS-C)
92
116
  */
93
117
  declare const DEFAULT_CAMERA_FRAME_CAPTURE_SIZE = 1024;
94
- /**
95
- * Extract the reset transform from an XRReferenceSpaceEvent-like object.
96
- *
97
- * Distinguishes three cases per OdometryTrackingRestartedPayload semantics:
98
- * - Transform property missing (older browsers) → returns `undefined`
99
- * - Transform property present but null (runtime can't determine delta) → returns `null`
100
- * - Transform property present with data → returns `ResetTransformData`
101
- *
102
- * This is a pure function extracted for testability.
103
- *
104
- * @param event - The event object, cast to a record with an optional transform property
105
- * @returns ResetTransformData, null, or undefined
106
- */
107
- declare function extractResetTransformData(event: Record<string, unknown>): ResetTransformData | null | undefined;
108
- /**
109
- * Extract pose data from an XRViewerPose.
110
- * Returns null if pose or views are unavailable.
111
- *
112
- * This is a pure function extracted for testability.
113
- *
114
- * @param pose - The XRViewerPose from frame.getViewerPose()
115
- * @returns ARPose with position and orientation, or null
116
- */
117
- declare function extractPoseFromViewer(pose: XRViewerPose | null): ARPose | null;
118
118
  /**
119
119
  * Get the current raw AR pose from the latest XR frame.
120
120
  * This is updated every frame and should be called when GPS arrives
@@ -148,7 +148,7 @@ interface SessionFeatureOptions {
148
148
  * (no conflict, no throw): the grid sampler and the occluder are two consumers
149
149
  * of one depth read. Default `false`.
150
150
  *
151
- * @see GpsPlusSlamJs_Docs/docs/2026-06-14-webxr-depth-occlusion-plan.md §6/§8
151
+ * @see GpsPlusSlamJs_Docs/docs/2026-06-14-0009-webxr-depth-occlusion-plan.md §6/§8
152
152
  */
153
153
  requestDepthOcclusion?: boolean;
154
154
  }
@@ -156,6 +156,12 @@ interface SessionFeatureOptions {
156
156
  * Build XR session init options.
157
157
  * Extracted as a pure function for testability.
158
158
  *
159
+ * Exported for unit testing only (surface-reduction step 3, B-5 precedent):
160
+ * production code reaches this exclusively through {@link initAR}; the export
161
+ * exists so `webxr-session.test.ts` can pin the full session-negotiation
162
+ * matrix (isolation flags × session features) without mocking a renderer and
163
+ * `navigator.xr` for every combination. Not re-exported by the ar/ barrel.
164
+ *
159
165
  * @param rootElement - The DOM element for DOM overlay
160
166
  * @param isolationOptions - Crash-isolation diagnostic flags (DOM overlay,
161
167
  * depth-sensing, camera-access)
@@ -169,23 +175,6 @@ declare function buildSessionOptions(rootElement: Element | null, isolationOptio
169
175
  * Check if WebXR immersive-ar is supported
170
176
  */
171
177
  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;
189
178
  /**
190
179
  * Create the scene hierarchy with proper AR/GPS frame separation.
191
180
  * This is a pure function for testability.
@@ -227,14 +216,89 @@ declare function createSceneHierarchy(): {
227
216
  arpose: THREE.Object3D;
228
217
  camera: THREE.PerspectiveCamera;
229
218
  };
219
+ /**
220
+ * Host callbacks for one AR session, passed to {@link initAR} as a single
221
+ * struct (2026-07-11 surface-reduction step 1 — replaces the 13 pre-init
222
+ * setter exports, which forced every consumer to know a call order and
223
+ * allowed half-wired states like a tracking store without its callbacks).
224
+ *
225
+ * Everything here is INIT-TIME wiring: initAR unpacks the struct once into
226
+ * the module-level slots the frame path reads directly (no per-frame
227
+ * indirection), and `resetWebXRState()` clears every slot at session end —
228
+ * re-pass the struct with each `initAR`. The single mid-session mutation the
229
+ * apps need (the recorder swapping its Redux store per recording) has its own
230
+ * narrow function, {@link rebindTrackingStore}.
231
+ */
232
+ interface ArSessionCallbacks {
233
+ /**
234
+ * Periodic JPEG image capture (recording). Presence wires the capture
235
+ * slots; `startImageCapture()` is what begins capturing.
236
+ */
237
+ imageCapture?: {
238
+ /** Called when an image is successfully captured. */onCaptured: (image: CapturedImage) => void; /** Returns current device screen rotation (0, 90, 180, 270). */
239
+ getScreenRotation: () => number; /** Called when image capture fails (e.g. low memory). */
240
+ onFailed?: () => void; /** Called when a captured image appears black/empty. */
241
+ onSuspicious?: (blobSize: number, frameIndex: number) => void;
242
+ /**
243
+ * Off-thread blur/blackness analyzer for the drop+retry quality gate
244
+ * (a Web Worker in the recorder — the host owns its lifecycle). Only
245
+ * invoked when the capture config's `qualityFilter.enabled` is true.
246
+ * Absent ⇒ the legacy save-immediately path.
247
+ */
248
+ qualityAnalyzer?: (frame: CapturedFrame) => Promise<FrameQualityVerdict>;
249
+ };
250
+ /**
251
+ * Tracking-state pipeline. Store and callbacks arrive TOGETHER — the
252
+ * half-wired store/callbacks split of the old two-setter API is
253
+ * structurally impossible. Presence of this group activates per-frame
254
+ * `poseReceived`/`poseLost` dispatches and the phase→callback translation.
255
+ */
256
+ tracking?: {
257
+ /** The host store carrying the tracking slice. */store: TrackingSubscribableStore; /** Tracking restarted after loss with an origin reset (Case 2). */
258
+ onRestarted?: (payload: OdometryTrackingRestartedPayload) => void; /** Tracking lost (pose became null). */
259
+ onLost?: () => void; /** Tracking recovered seamlessly, same coordinate frame (Case 1). */
260
+ onRecovered?: () => void;
261
+ };
262
+ /**
263
+ * Depth sampling. Presence creates the DepthSampler at init;
264
+ * `startDepthCapture()` is what begins sampling.
265
+ */
266
+ depth?: {
267
+ /** Called for each captured depth sample. */onCaptured: (sample: DepthSample) => void; /** Called once if depth was requested but is unavailable. */
268
+ onUnavailable?: () => void;
269
+ };
270
+ /**
271
+ * Throttled camera RGBA frames for CV (QR detection today). Presence
272
+ * creates the CameraFrameSource at init; `startCameraFrameCapture()` is
273
+ * what begins delivering frames.
274
+ */
275
+ cameraFrame?: {
276
+ /** Called with each throttled top-left-origin RGBA frame. */onFrame: (image: RgbaImage) => void;
277
+ };
278
+ /**
279
+ * Per-frame callback, invoked every XR frame after pose updates but before
280
+ * render (e.g. map overlay position updates).
281
+ */
282
+ onFrame?: () => void;
283
+ /**
284
+ * Fired exactly once whenever the XRSession ends — app-initiated
285
+ * ({@link endARSession}) AND system-initiated (e.g. the Android back
286
+ * gesture). `info.requestedByApp` discriminates the two. Fired AFTER the
287
+ * full teardown, so the host can start a fresh session from inside it.
288
+ */
289
+ onSessionEnd?: (info: SessionEndInfo) => void;
290
+ }
230
291
  /**
231
292
  * Initialize the AR session and Three.js renderer.
232
293
  * @param container - DOM element to host the AR canvas and CSS3D overlay.
233
294
  * @param isolationOptions - Crash-isolation diagnostic flags.
234
295
  * @param sessionFeatures - Opt-in standard WebXR features (e.g.
235
296
  * `requestHitTest`) forwarded to the session negotiation.
297
+ * @param callbacks - Host callbacks for this session (see
298
+ * {@link ArSessionCallbacks}); unpacked once into module slots that
299
+ * `resetWebXRState()` clears at session end.
236
300
  */
237
- declare function initAR(container: HTMLElement, isolationOptions?: Partial<ArCrashIsolationOptions>, sessionFeatures?: SessionFeatureOptions): Promise<void>;
301
+ declare function initAR(container: HTMLElement, isolationOptions?: Partial<ArCrashIsolationOptions>, sessionFeatures?: SessionFeatureOptions, callbacks?: ArSessionCallbacks): Promise<void>;
238
302
  /**
239
303
  * Extract depth information from an XR frame. Returns `null` if depth sensing is
240
304
  * not available (no pose/view, no `getDepthInformation`, or the call throws).
@@ -260,38 +324,6 @@ declare function getArWorldGroup(): THREE.Group | null;
260
324
  * Get the current camera
261
325
  */
262
326
  declare function getCamera(): THREE.PerspectiveCamera | null;
263
- /**
264
- * Set the scene externally (for replay mode).
265
- * Allows non-WebXR code paths to register a scene so that modules
266
- * calling getScene() receive it.
267
- * @see docs/2026-02-19-replay-mode.md Risk R1
268
- */
269
- declare function setScene(s: THREE.Scene | null): void;
270
- /**
271
- * Set the AR world group externally (for replay mode).
272
- * Allows non-WebXR code paths to register an arWorldGroup so that
273
- * applyAlignmentMatrix() and visualizers work correctly.
274
- * @see docs/2026-02-19-replay-mode.md Risk R1
275
- */
276
- declare function setArWorldGroup(g: THREE.Group | null): void;
277
- /**
278
- * Set the camera externally (for replay mode).
279
- * Allows non-WebXR code paths to register a camera so that modules
280
- * calling getCamera() receive it.
281
- * @see docs/2026-02-19-replay-mode.md Risk R1
282
- */
283
- declare function setCamera(c: THREE.PerspectiveCamera | null): void;
284
- /**
285
- * Get the arpose Object3D (intermediate node between arWorldGroup and camera).
286
- * Returns null before scene initialization.
287
- */
288
- declare function getArPose(): THREE.Object3D | null;
289
- /**
290
- * Set the arpose Object3D externally (for replay mode).
291
- * Allows non-WebXR code paths to register an arpose so that
292
- * store subscribers can update it with recorded odom data.
293
- */
294
- declare function setArPose(a: THREE.Object3D | null): void;
295
327
  /**
296
328
  * Apply an alignment matrix to the AR world group.
297
329
  *
@@ -335,18 +367,6 @@ declare function nuePositionToWebXR(nue: readonly number[]): readonly [number, n
335
367
  * NUE [x, y, z, w] → WebXR [z, y, -x, w]
336
368
  */
337
369
  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;
350
370
  /**
351
371
  * End the current XR session and clean up all resources.
352
372
  *
@@ -358,35 +378,15 @@ declare function setSessionEndCallback(cb: ((info: SessionEndInfo) => void) | nu
358
378
  * finished.
359
379
  */
360
380
  declare function endARSession(): Promise<void>;
361
- /**
362
- * Set up image capture callbacks.
363
- * Call this before starting image capture to wire up the callback handlers.
364
- *
365
- * @param onCaptured - Called when an image is successfully captured
366
- * @param screenRotationGetter - Returns current device screen rotation (0, 90, 180, 270)
367
- * @param onFailed - Optional callback for when image capture fails (e.g., low memory)
368
- * @param onSuspicious - Optional callback for when a captured image appears black/empty
369
- */
370
- declare function setImageCaptureCallback(onCaptured: (image: CapturedImage) => void, screenRotationGetter: () => number, onFailed?: () => void, onSuspicious?: (blobSize: number, frameIndex: number) => void): void;
371
- /**
372
- * Inject (or clear) the off-thread image-quality analyzer used by the blur/
373
- * blackness drop+retry gate. Pass the recorder's Web Worker-backed analyzer to
374
- * enable the gate, or `null` to clear it (legacy save-immediately path). Must be
375
- * set BEFORE {@link startImageCapture} for the active recording — the manager
376
- * reads it once when constructed. The analyzer only runs when the capture
377
- * config's `qualityFilter.enabled` is true, so injecting it is harmless when the
378
- * gate is off. Ownership/disposal of the worker is the caller's responsibility.
379
- */
380
- declare function setImageQualityAnalyzer(analyzer: ((frame: CapturedFrame) => Promise<FrameQualityVerdict>) | null): void;
381
381
  /**
382
382
  * Start capturing images during recording.
383
- * Must call setImageCaptureCallback first.
383
+ * Requires the `imageCapture` callbacks group to have been passed to initAR.
384
384
  *
385
385
  * @param config - Optional capture configuration. Accepts the whole user
386
386
  * image-options section (`intervalMs`, `quality`, `resolutionDivisor`; any
387
387
  * extra keys such as `enabled` are ignored). Passing the section as one
388
388
  * object means a newly-added option flows through without editing this seam
389
- * — see `2026-06-12-payload-rebuild-field-drop-audit.md` (F3).
389
+ * — see `2026-06-12-1130-payload-rebuild-field-drop-audit.md` (F3).
390
390
  */
391
391
  declare function startImageCapture(config?: Partial<ImageCaptureConfig>): void;
392
392
  /**
@@ -398,49 +398,31 @@ declare function stopImageCapture(): void;
398
398
  */
399
399
  declare function getImageCaptureFrameCount(): number;
400
400
  /**
401
- * Inject the Redux store used by the tracking-state slice pipeline.
402
- *
403
- * MUST be called before `initAR()` whenever the host also wires tracking
404
- * callbacks via `setTrackingCallbacks`. Without a store the tracking
405
- * pipeline silently no-ops.
406
- *
407
- * @param store — any store satisfying {@link TrackingSubscribableStore}.
408
- * `null` clears the binding (useful for teardown in tests).
409
- */
410
- declare function setTrackingStore(store: TrackingSubscribableStore | null): void;
411
- /**
412
- * Set up tracking state callbacks.
413
- * Call this BEFORE initAR() to enable tracking restart detection.
401
+ * Re-point the tracking pipeline at a NEW store mid-session.
414
402
  *
415
- * @param onRestarted - Called when tracking restarts after being lost
416
- */
417
- declare function setTrackingCallbacks(onRestarted: (payload: OdometryTrackingRestartedPayload) => void): void;
418
- /**
419
- * Set a callback for when AR tracking is lost.
420
- * Call this BEFORE initAR() to enable tracking loss notifications.
421
- * Field Test Readiness Issue #3: Provide user feedback when tracking is lost.
422
- *
423
- * @param callback - Called when tracking is lost (pose becomes null)
424
- */
425
- declare function setTrackingLostCallback(callback: () => void): void;
426
- /**
427
- * Set a callback for when AR tracking recovers seamlessly (Case 1: same coordinate frame).
428
- * Call this BEFORE initAR() to enable seamless recovery notifications.
403
+ * This is the ONE mutation that deliberately survived the fold of the
404
+ * pre-init setters into initAR's `callbacks` (surface-reduction step 1):
405
+ * it is a genuine RUNTIME need, not init-time wiring — the recorder swaps
406
+ * its Redux store for every recording started inside a single AR session,
407
+ * and without re-pointing, every per-frame `poseReceived` dispatch would
408
+ * keep flowing into the orphaned previous store, pinning the new store's
409
+ * `tracking.phase` at 'initializing' (Finding #1, 2026-05-23 user
410
+ * feedback). Everything else about a session's callbacks stays fixed from
411
+ * `initAR` until `resetWebXRState()`.
429
412
  *
430
- * @param callback - Called when tracking recovers without origin reset
431
- */
432
- declare function setTrackingRecoveredCallback(callback: () => void): void;
433
- /**
434
- * Set up depth capture callback.
435
- * Call this BEFORE initAR() to enable depth sampling.
413
+ * Matches the old `setTrackingStore` semantics exactly: an active phase
414
+ * subscription to the previous store is torn down before swapping (the
415
+ * phase subscription itself is only (re)established inside `initAR`).
416
+ * No-op pipeline when tracking was not wired at init (the host callbacks
417
+ * stay whatever `initAR` set).
436
418
  *
437
- * @param onCaptured - Called when a depth sample is captured
438
- * @param onUnavailable - Called once if depth is unavailable after threshold
419
+ * @param store any store satisfying {@link TrackingSubscribableStore}.
439
420
  */
440
- declare function setDepthCaptureCallback(onCaptured: (sample: DepthSample) => void, onUnavailable?: () => void): void;
421
+ declare function rebindTrackingStore(store: TrackingSubscribableStore): void;
441
422
  /**
442
423
  * Start depth sampling during recording.
443
- * Must call setDepthCaptureCallback before initAR.
424
+ * Requires the `depth` callbacks group to have been passed to initAR
425
+ * (the sampler is created there).
444
426
  *
445
427
  * @param config - optional sampler overrides (typically the user's
446
428
  * `depth.intervalMs`/`depth.gridSize` recording options); applied via
@@ -472,22 +454,12 @@ interface CameraFrameCaptureConfig {
472
454
  captureSize?: number;
473
455
  }
474
456
  /**
475
- * Set the per-frame camera RGBA callback (B2) the generic CV frame feed (QR
476
- * detection today, object detection / OpenCV later). Call this BEFORE initAR to
477
- * enable in-session camera frame capture; `startCameraFrameCapture` then begins
478
- * delivering frames.
479
- *
480
- * The callback receives a **top-left-origin** RGBA image (no JPEG round-trip),
481
- * captured at the throttled detection cadence — feed it straight to a
482
- * `BarcodeDetector` / OpenCV front-end. Mirrors `setDepthCaptureCallback`.
483
- *
484
- * @param onFrame - Called with each throttled camera frame, or `null` to clear.
485
- */
486
- declare function setCameraFrameCallback(onFrame: ((image: RgbaImage) => void) | null): void;
487
- /**
488
- * Start camera frame capture during an AR session. Must call
489
- * setCameraFrameCallback before initAR (the source is created there). No-op if
490
- * the source was not initialized (callback not set before initAR).
457
+ * Start camera frame capture during an AR session. Requires the
458
+ * `cameraFrame` callbacks group to have been passed to initAR (the source is
459
+ * created there); the callback receives **top-left-origin** RGBA images (no
460
+ * JPEG round-trip) at the throttled detection cadence — feed them straight to
461
+ * a `BarcodeDetector` / OpenCV front-end (B2). No-op if the source was not
462
+ * initialized (group not passed to initAR).
491
463
  *
492
464
  * The source is the single cadence owner: drive your detection scheduler from
493
465
  * the delivered frames with its own `minIntervalMs: 0` (Option A).
@@ -504,27 +476,5 @@ declare function stopCameraFrameCapture(): void;
504
476
  * `startCameraFrameCapture`.
505
477
  */
506
478
  declare function getCameraFrameCount(): number;
507
- /**
508
- * The current longer-edge resolution (px) of the camera-frame blit — the
509
- * {@link DEFAULT_CAMERA_FRAME_CAPTURE_SIZE} default unless overridden via
510
- * `startCameraFrameCapture({ captureSize })`. Exposed for diagnostics and to
511
- * let tests assert the on-device-tuned default without reaching into module
512
- * state.
513
- */
514
- declare function getCameraFrameCaptureSize(): number;
515
- /**
516
- * Set a per-frame callback for custom updates.
517
- * The callback is invoked every XR frame after pose updates but before render.
518
- * Useful for updating elements that need to follow the camera smoothly
519
- * (e.g., map overlay position).
520
- *
521
- * @param callback - Function to call each frame, or null to clear
522
- */
523
- declare function setFrameCallback(callback: (() => void) | null): void;
524
- /**
525
- * Get the CSS3D renderer manager for live AR mode.
526
- * Returns null if no AR session is active or CSS3D was not created.
527
- */
528
- declare function getLiveCss3dManager(): Css3dRendererManager | null;
529
479
  //#endregion
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 };
480
+ export { startCameraFrameCapture as A, isWebXRSupported as C, rebindTrackingStore as D, nueQuaternionToWebXR$1 as E, stopImageCapture as F, startImageCapture as M, stopCameraFrameCapture as N, resetWebXRState as O, stopDepthCapture as P, initAR as S, nuePositionToWebXR as T, getDepthInfoFromFrame as _, SessionFeatureOptions as a, getScene as b, buildSessionOptions as c, extractPoseFromViewer as d, extractResetTransformData as f, getCurrentArPose as g, getCameraFrameCount as h, SessionEndInfo as i, startDepthCapture as j, shouldLogCameraAccessDiagnostic as k, createSceneHierarchy as l, getCamera as m, CameraFrameCaptureConfig as n, TrackingSubscribableStore as o, getArWorldGroup as p, DEFAULT_CAMERA_FRAME_CAPTURE_SIZE as r, applyAlignmentMatrix as s, ArSessionCallbacks as t, endARSession as u, getDepthSampleCount as v, isXRCameraLike as w, getXrCameraFromPose as x, getImageCaptureFrameCount as y };