gps-plus-slam-app-framework 1.0.0 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app-selectors-DyMzxCEC.d.ts → app-selectors-CHt7DLuq.d.ts} +9 -8
- package/dist/ar/depth-sampler.js +1 -1
- package/dist/ar/tracking-state.js +1 -1
- package/dist/ar/webxr-session.js +1 -1
- package/dist/combined-root-state-B3SvPNjU.d.ts +6 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/create-slam-app-store-DBm7g2Zd.d.ts +85 -0
- package/dist/file-system-DD5TczSO.d.ts +84 -0
- package/dist/geo/h3-proximity.d.ts +2 -0
- package/dist/{ref-points/h3-ref-point.js → geo/h3-proximity.js} +16 -12
- package/dist/geo/index.d.ts +2 -0
- package/dist/geo/index.js +2 -0
- package/dist/gps-anchored-mesh-manager-CovAFK4g.d.ts +56 -0
- package/dist/gps-ar-pose-sampler-D_Zso40V.d.ts +43 -0
- package/dist/{recording-coordinator-DzflP07_.d.ts → gps-event-coordinator-fwvmVfku.d.ts} +6 -5
- package/dist/{h3-ref-point-CFhayNSZ.d.ts → h3-proximity-GwesPTFT.d.ts} +16 -12
- package/dist/index.d.ts +31 -34
- package/dist/index.js +14 -19
- package/dist/{leaflet-map-overlay-CvfQXTye.d.ts → leaflet-map-overlay-CQZcnxbc.d.ts} +10 -6
- package/dist/licensing/index.d.ts +1 -1
- package/dist/licensing/index.js +1 -1
- package/dist/{null-storage-backend-CsWvQwN8.d.ts → null-storage-backend-C0TiwwzQ.d.ts} +4 -2
- package/dist/{opfs-storage-ChOzF_Wp.d.ts → opfs-storage-Dlq1I_Gb.d.ts} +54 -51
- package/dist/opfs-storage-backend-Gt3rd76D.d.ts +13 -0
- package/dist/{persistence-middleware-DrptY02i.d.ts → persistence-middleware-z-75iisb.d.ts} +4 -4
- package/dist/{recording-replayer-oOzPITrd.d.ts → recording-replayer-BFhFs7Mc.d.ts} +2 -2
- package/dist/recording-slice-BiktUIWF.d.ts +28 -0
- package/dist/{replay-engine-DuX316ae.d.ts → replay-engine-B88Va62x.d.ts} +4 -1
- package/dist/sensors/gps-error-handler.d.ts +1 -1
- package/dist/sensors/gps.d.ts +1 -1
- package/dist/sensors/index.d.ts +3 -3
- package/dist/sensors/index.js +1 -1
- package/dist/sensors/permission-checker.d.ts +1 -1
- package/dist/state/app-selectors.d.ts +1 -1
- package/dist/state/create-slam-app-store.d.ts +2 -0
- package/dist/state/create-slam-app-store.js +61 -0
- package/dist/state/gps-ar-pose-sampler.d.ts +4 -0
- package/dist/state/gps-ar-pose-sampler.js +19 -0
- package/dist/state/{recording-coordinator.d.ts → gps-event-coordinator.d.ts} +1 -1
- package/dist/state/{recording-coordinator.js → gps-event-coordinator.js} +3 -4
- package/dist/state/index.d.ts +15 -16
- package/dist/state/index.js +7 -7
- package/dist/state/persistence-middleware.d.ts +1 -1
- package/dist/state/persistence-middleware.js +8 -8
- package/dist/state/recording-replayer.d.ts +3 -2
- package/dist/state/recording-replayer.js +2 -2
- package/dist/state/recording-slice.d.ts +2 -0
- package/dist/state/{recorder-slice.js → recording-slice.js} +7 -15
- package/dist/state/replay-engine.d.ts +1 -1
- package/dist/state/replay-engine.js +3 -3
- package/dist/state/store-subscribers.d.ts +2 -2
- package/dist/state/store-subscribers.js +1 -9
- package/dist/state/subscribe-to-selector.d.ts +1 -1
- package/dist/storage/file-system-utils.d.ts +1 -1
- package/dist/storage/file-system.d.ts +2 -2
- package/dist/storage/file-system.js +103 -94
- package/dist/storage/index.d.ts +9 -11
- package/dist/storage/index.js +5 -7
- package/dist/storage/null-storage-backend.d.ts +1 -1
- package/dist/storage/null-storage-backend.js +7 -0
- package/dist/storage/opfs-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage-backend.js +7 -1
- package/dist/storage/opfs-storage.d.ts +2 -2
- package/dist/storage/opfs-storage.js +69 -85
- package/dist/storage/storage-backend.d.ts +2 -2
- package/dist/storage/zip-export.d.ts +2 -2
- package/dist/storage/zip-export.js +55 -62
- package/dist/storage/zip-reader.d.ts +2 -2
- package/dist/storage/zip-reader.js +24 -1
- package/dist/storage-backend-yVnuWGTr.d.ts +28 -0
- package/dist/{store-subscribers-CuoIzB5T.d.ts → store-subscribers-DKKHld49.d.ts} +1 -2
- package/dist/{subscribe-to-selector-UTZ0KkAc.d.ts → subscribe-to-selector-ghDKYtap.d.ts} +1 -1
- package/dist/test-utils/zip-round-trip-helpers.d.ts +1 -1
- package/dist/test-utils/zip-round-trip-helpers.js +4 -4
- package/dist/visualization/gps-anchored-mesh-manager.d.ts +2 -0
- package/dist/visualization/gps-anchored-mesh-manager.js +128 -0
- package/dist/visualization/gps-compass-cubes.d.ts +1 -1
- package/dist/visualization/gps-event-markers.d.ts +1 -1
- package/dist/visualization/index.d.ts +9 -9
- package/dist/visualization/index.js +2 -2
- package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
- package/dist/visualization/leaflet-map-overlay.js +23 -19
- package/dist/visualization/lerp-utils.d.ts +1 -1
- package/dist/visualization/map-overlay.d.ts +1 -1
- package/dist/visualization/three-dispose.d.ts +1 -1
- package/dist/visualization/vis-colors.d.ts +1 -1
- package/dist/{zip-export-Rtpi75JJ.d.ts → zip-export-BjrQPv0X.d.ts} +58 -7
- package/dist/{zip-reader-D7pkpX8K.d.ts → zip-reader-KgJEXbca.d.ts} +33 -1
- package/package.json +15 -4
- package/dist/community-license-key-ChZLCJyO.d.ts +0 -21
- package/dist/file-system-BsQgYCU3.d.ts +0 -128
- package/dist/licensing/community-license-key.d.ts +0 -2
- package/dist/licensing/community-license-key.js +0 -21
- package/dist/opfs-storage-backend-CVcmfJHN.d.ts +0 -11
- package/dist/recorder-slice-fcwAXrsh.d.ts +0 -35
- package/dist/ref-point-importer-B_wn5ABk.d.ts +0 -62
- package/dist/ref-point-loader-Pt1smgHS.d.ts +0 -117
- package/dist/ref-points/h3-ref-point.d.ts +0 -2
- package/dist/ref-points/index.d.ts +0 -2
- package/dist/ref-points/index.js +0 -2
- package/dist/ref-points-slice-tC-Wd6XJ.d.ts +0 -48
- package/dist/reference-points-CFWy8_wj.d.ts +0 -68
- package/dist/routing-slice-BlHTM8eh.d.ts +0 -23
- package/dist/state/recorder-slice.d.ts +0 -2
- package/dist/state/ref-points-slice.d.ts +0 -2
- package/dist/state/ref-points-slice.js +0 -44
- package/dist/state/routing-slice.d.ts +0 -2
- package/dist/state/routing-slice.js +0 -13
- package/dist/state/store.d.ts +0 -9
- package/dist/state/store.js +0 -71
- package/dist/storage/ref-point-importer.d.ts +0 -2
- package/dist/storage/ref-point-importer.js +0 -163
- package/dist/storage/ref-point-loader.d.ts +0 -2
- package/dist/storage/ref-point-loader.js +0 -248
- package/dist/storage/ref-point-recovery.d.ts +0 -28
- package/dist/storage/ref-point-recovery.js +0 -159
- package/dist/storage-backend-BcEItnFr.d.ts +0 -20
- package/dist/store-C7PKOj8S.d.ts +0 -96
- package/dist/visualization/reference-points.d.ts +0 -2
- package/dist/visualization/reference-points.js +0 -160
- /package/dist/{file-system-utils-5cWO8Xyv.d.ts → file-system-utils-BH8FdyIu.d.ts} +0 -0
- /package/dist/{gps-Ddzr2KlX.d.ts → gps-GKc6_Cly.d.ts} +0 -0
- /package/dist/{gps-compass-cubes-C-6JEnpR.d.ts → gps-compass-cubes-jRIJMOuh.d.ts} +0 -0
- /package/dist/{gps-error-handler-VPuNOuf8.d.ts → gps-error-handler-CH1S528z.d.ts} +0 -0
- /package/dist/{gps-event-markers-DpEy2qRd.d.ts → gps-event-markers-sVyO9utS.d.ts} +0 -0
- /package/dist/{lerp-utils-87NWjUOD.d.ts → lerp-utils-CZgQlrmu.d.ts} +0 -0
- /package/dist/{map-overlay-DuiZuCTx.d.ts → map-overlay-C9ifl_4-.d.ts} +0 -0
- /package/dist/{permission-checker-jO2ziCWC.d.ts → permission-checker-Cu3nbH1S.d.ts} +0 -0
- /package/dist/{three-dispose-CCBHjE_a.d.ts → three-dispose-qt_r5wR1.d.ts} +0 -0
- /package/dist/{vis-colors-Qi2vlRGt.d.ts → vis-colors-BKkdTIKb.d.ts} +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { recordingReducer } from "./recording-slice.js";
|
|
2
|
+
import { createPersistenceMiddleware } from "./persistence-middleware.js";
|
|
3
|
+
import { arElementsReducer, gpsDataReducer, gpsElementsReducer, sanitizeForDevTools, validateLicenseKey } from "gps-plus-slam-js";
|
|
4
|
+
import { configureStore } from "@reduxjs/toolkit";
|
|
5
|
+
import { COMMUNITY_LICENSE_KEY } from "gps-plus-slam-js/community-license-key";
|
|
6
|
+
//#region ../src/state/create-slam-app-store.ts
|
|
7
|
+
/**
|
|
8
|
+
* `createSlamAppStore` — composable Redux store factory for AR+GPS apps.
|
|
9
|
+
*
|
|
10
|
+
* Introduced in Iter 1 of the AppFramework/RecorderApp boundary migration.
|
|
11
|
+
* Wires the three library reducers (`gpsData`, `gpsElements`, `arElements`),
|
|
12
|
+
* the framework's recording lifecycle slice, and the persistence middleware.
|
|
13
|
+
*
|
|
14
|
+
* Recorder-only state (routing screen, ref-points, scenario) is plugged in
|
|
15
|
+
* by the consumer via `extraReducers` / `extraMiddleware`. The factory itself
|
|
16
|
+
* never references those concepts so apps that don't need them (POI viewers,
|
|
17
|
+
* navigation arrows, …) compose freely.
|
|
18
|
+
*
|
|
19
|
+
* The legacy `createRecorderStore` from `store.ts` is built on top of this
|
|
20
|
+
* factory and will move out of the framework in Iter 1D.
|
|
21
|
+
*
|
|
22
|
+
* @see docs/2026-05-03-appframework-vs-recorderapp-boundary-analysis.md — Iter 1
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Build a Redux store wired with library + recording slices, persistence
|
|
26
|
+
* middleware, and any caller-supplied extras. See module docstring for the
|
|
27
|
+
* design rationale.
|
|
28
|
+
*/
|
|
29
|
+
function createSlamAppStore(options) {
|
|
30
|
+
const { storageBackend, extraReducers, extraMiddleware, onWriteFailure, enableDevChecks = true, licenseKey = COMMUNITY_LICENSE_KEY } = options;
|
|
31
|
+
validateLicenseKey(licenseKey);
|
|
32
|
+
const store = configureStore({
|
|
33
|
+
reducer: {
|
|
34
|
+
gpsData: gpsDataReducer,
|
|
35
|
+
gpsElements: gpsElementsReducer,
|
|
36
|
+
arElements: arElementsReducer,
|
|
37
|
+
recording: recordingReducer,
|
|
38
|
+
...extraReducers ?? {}
|
|
39
|
+
},
|
|
40
|
+
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
41
|
+
serializableCheck: enableDevChecks,
|
|
42
|
+
immutableCheck: enableDevChecks
|
|
43
|
+
}).concat(createPersistenceMiddleware({
|
|
44
|
+
storageBackend,
|
|
45
|
+
onWriteFailure
|
|
46
|
+
}), ...extraMiddleware ?? []),
|
|
47
|
+
devTools: {
|
|
48
|
+
actionSanitizer: sanitizeForDevTools,
|
|
49
|
+
stateSanitizer: sanitizeForDevTools
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
getState: () => store.getState(),
|
|
54
|
+
dispatch: store.dispatch,
|
|
55
|
+
subscribe: (listener) => store.subscribe(listener),
|
|
56
|
+
writeFrame: (blob, index) => storageBackend.writeFrame(blob, index),
|
|
57
|
+
writeSessionMetadata: (metadata) => storageBackend.writeSessionMetadata(metadata)
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { createSlamAppStore };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { t as ARPose } from "../ar-types-B-ORgk6Z.js";
|
|
2
|
+
import { o as extractOdomPosition, s as extractOdomRotation } from "../gps-event-coordinator-fwvmVfku.js";
|
|
3
|
+
import { i as captureGpsAnchorSample, n as GpsAnchorSample, r as GpsAnchorSampleGpsPoint, t as CaptureGpsAnchorSampleOptions } from "../gps-ar-pose-sampler-D_Zso40V.js";
|
|
4
|
+
export { ARPose, CaptureGpsAnchorSampleOptions, GpsAnchorSample, GpsAnchorSampleGpsPoint, captureGpsAnchorSample, extractOdomPosition, extractOdomRotation };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { extractOdomPosition, extractOdomRotation } from "./gps-event-coordinator.js";
|
|
2
|
+
//#region ../src/state/gps-ar-pose-sampler.ts
|
|
3
|
+
/**
|
|
4
|
+
* Capture a GPS-AR pose snapshot. Extracts `odomPosition`/`odomRotation`
|
|
5
|
+
* from the supplied `arPose`. The supplied `gpsPoint` and optional
|
|
6
|
+
* `fusedGpsPoint` are stored verbatim.
|
|
7
|
+
*/
|
|
8
|
+
function captureGpsAnchorSample(arPose, gpsPoint, options = {}) {
|
|
9
|
+
return {
|
|
10
|
+
gpsPoint,
|
|
11
|
+
fusedGpsPoint: options.fusedGpsPoint,
|
|
12
|
+
arPose,
|
|
13
|
+
odomPosition: extractOdomPosition(arPose),
|
|
14
|
+
odomRotation: extractOdomRotation(arPose),
|
|
15
|
+
timestamp: options.timestamp ?? Date.now()
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { captureGpsAnchorSample, extractOdomPosition, extractOdomRotation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as eulerToQuaternion, c as getLastDeviceOrientation, i as createGpsPositionHandler, l as resetCoordinatorState, n as buildRawGpsPoint, o as extractOdomPosition, r as buildRecordGpsEventPayload, s as extractOdomRotation, t as RecordingCoordinatorConfig, u as updateDeviceOrientation } from "../
|
|
1
|
+
import { a as eulerToQuaternion, c as getLastDeviceOrientation, i as createGpsPositionHandler, l as resetCoordinatorState, n as buildRawGpsPoint, o as extractOdomPosition, r as buildRecordGpsEventPayload, s as extractOdomRotation, t as RecordingCoordinatorConfig, u as updateDeviceOrientation } from "../gps-event-coordinator-fwvmVfku.js";
|
|
2
2
|
export { RecordingCoordinatorConfig, buildRawGpsPoint, buildRecordGpsEventPayload, createGpsPositionHandler, eulerToQuaternion, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, resetCoordinatorState, updateDeviceOrientation };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger.js";
|
|
2
|
-
import { recordGpsEvent, setZeroPos } from "
|
|
3
|
-
|
|
4
|
-
//#region ../src/state/recording-coordinator.ts
|
|
2
|
+
import { eulerToQuaternion, getOdometryPositions, getZeroReference, recordGpsEvent, setZeroPos } from "gps-plus-slam-js";
|
|
3
|
+
//#region ../src/state/gps-event-coordinator.ts
|
|
5
4
|
const log = createLogger("RecordingCoordinator");
|
|
6
5
|
/** Counter for generating unique GPS point IDs */
|
|
7
6
|
let gpsEventCounter = 0;
|
|
@@ -122,7 +121,7 @@ function buildRecordGpsEventPayload(gpsPosition, arPose, deviceOrientation) {
|
|
|
122
121
|
function createGpsPositionHandler(config) {
|
|
123
122
|
const { store, getArPose } = config;
|
|
124
123
|
return (position) => {
|
|
125
|
-
if (!store.getState().
|
|
124
|
+
if (!store.getState().recording.isRecording) return;
|
|
126
125
|
const arPose = getArPose();
|
|
127
126
|
if (!arPose) {
|
|
128
127
|
log.warn("GPS arrived but no AR pose available");
|
package/dist/state/index.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { i as DepthSample, r as DepthPoint } from "../ar-types-B-ORgk6Z.js";
|
|
2
|
-
import { _ as validateRecordingOptions, a as IMAGE_CONSTRAINTS, c as RecordingOptionsInput, d as loadRecordingOptions, f as resetRecordingOptions, g as validateImageOptions, h as validateDepthOptions, i as DepthCaptureOptions, l as STORAGE_KEY, n as DEFAULT_RECORDING_OPTIONS, o as ImageCaptureOptions, p as saveRecordingOptions, r as DEPTH_CONSTRAINTS,
|
|
3
|
-
import { n as SessionMetadata } from "../
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
import { i as
|
|
8
|
-
import { n as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { n as
|
|
12
|
-
import { n as
|
|
13
|
-
import {
|
|
14
|
-
import { n as
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
export { type AppDispatch, type AppScreen, type CombinedRootState, type CompleteCallback, DEFAULT_MAX_DELAY_MS, DEFAULT_RECORDING_OPTIONS, DEPTH_CONSTRAINTS, type DepthCaptureOptions, type DepthPoint, type DepthSample, type ErrorCallback, type GpsPoint, IMAGE_CONSTRAINTS, type ImageCaptureOptions, type LatLong, type MarkReferencePointPayload, type SessionMetadata as OpfsSessionMetadata, type PersistenceMiddlewareOptions, type ProgressCallback, type RawDeviceOrientation, type RawGpsPoint, type RecordGpsEventPayload, type RecorderState, type RecorderStore, type RecorderStoreOptions, type RecordingCoordinatorConfig, type RecordingOptions, type RecordingOptionsInput, type RefPointMark, type RefPointsState, type ReplayAction, ReplayEngine, type ReplayRecordingOptions, type ReplayState, type RootState, type RoutingState, STORAGE_KEY, type SessionMetadata$1 as SessionMetadata, type StorageBackend, type StoreSubscriberDeps, type SubscribableStore, add2dImage, buildRawGpsPoint, buildRecordGpsEventPayload, calcRelativeCoordsInMeters, clearSessionRefPointUsage, cloneRecordingOptions, computeInterActionDelay, createGpsPositionHandler, createPersistenceMiddleware, createRecorderStore, endSession, eulerToQuaternion, extractActionTimestamp, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, incrementRefPointUsage, loadRecordingOptions, markReferencePoint, navigateTo, recordDepthSample, recordGpsEvent, recordWriteFailure, recorderReducer, refPointsReducer, replayRecording, resetCoordinatorState, resetRecordingOptions, resetRefPointsState, routingReducer, saveRecordingOptions, selectAlignmentMatrix, selectCachedKnownRefPoints, selectGpsPositions, selectOdometryPositions, selectOdometryRotations, selectReferencePoints, selectZeroReference, setCurrentScenarioName, setImportedRefPoints, setZeroPos, startSession, subscribeToSelector, updateDeviceOrientation, validateDepthOptions, validateImageOptions, validateRecordingOptions, wireStoreSubscribers };
|
|
2
|
+
import { _ as validateRecordingOptions, a as IMAGE_CONSTRAINTS, c as RecordingOptionsInput, d as loadRecordingOptions, f as resetRecordingOptions, g as validateImageOptions, h as validateDepthOptions, i as DepthCaptureOptions, l as STORAGE_KEY, n as DEFAULT_RECORDING_OPTIONS, o as ImageCaptureOptions, p as saveRecordingOptions, r as DEPTH_CONSTRAINTS, u as cloneRecordingOptions } from "../recording-options-BYUFX8iU.js";
|
|
3
|
+
import { a as recordWriteFailure, i as recordDepthSample, n as SessionMetadata$1, o as recordingReducer, r as endSession, s as startSession, t as RecordingState } from "../recording-slice-BiktUIWF.js";
|
|
4
|
+
import { n as SessionMetadata } from "../opfs-storage-Dlq1I_Gb.js";
|
|
5
|
+
import { n as StorageBackend } from "../storage-backend-yVnuWGTr.js";
|
|
6
|
+
import { a as SlamAppStoreOptions, i as SlamAppStore, n as SlamAppMiddleware, o as createSlamAppStore, r as SlamAppRootState, t as SlamAppCombinedState } from "../create-slam-app-store-DBm7g2Zd.js";
|
|
7
|
+
import { a as eulerToQuaternion, c as getLastDeviceOrientation, i as createGpsPositionHandler, l as resetCoordinatorState, n as buildRawGpsPoint, o as extractOdomPosition, r as buildRecordGpsEventPayload, s as extractOdomRotation, t as RecordingCoordinatorConfig, u as updateDeviceOrientation } from "../gps-event-coordinator-fwvmVfku.js";
|
|
8
|
+
import { i as captureGpsAnchorSample, n as GpsAnchorSample, r as GpsAnchorSampleGpsPoint, t as CaptureGpsAnchorSampleOptions } from "../gps-ar-pose-sampler-D_Zso40V.js";
|
|
9
|
+
import { n as replayRecording, t as ReplayRecordingOptions } from "../recording-replayer-BFhFs7Mc.js";
|
|
10
|
+
import { n as createPersistenceMiddleware, t as PersistenceMiddlewareOptions } from "../persistence-middleware-z-75iisb.js";
|
|
11
|
+
import { a as ReplayAction, c as computeInterActionDelay, i as ProgressCallback, l as extractActionTimestamp, n as DEFAULT_MAX_DELAY_MS, o as ReplayEngine, r as ErrorCallback, s as ReplayState, t as CompleteCallback } from "../replay-engine-B88Va62x.js";
|
|
12
|
+
import { n as subscribeToSelector, t as SubscribableStore } from "../subscribe-to-selector-ghDKYtap.js";
|
|
13
|
+
import { n as wireStoreSubscribers, t as StoreSubscriberDeps } from "../store-subscribers-DKKHld49.js";
|
|
14
|
+
import { a as selectReferencePoints, i as selectOdometryRotations, n as selectGpsPositions, o as selectZeroReference, r as selectOdometryPositions, t as selectAlignmentMatrix } from "../app-selectors-CHt7DLuq.js";
|
|
15
|
+
import { GpsPoint, LatLong, MarkReferencePointPayload, RawDeviceOrientation, RawGpsPoint, RecordGpsEventPayload, add2dImage, calcRelativeCoordsInMeters, markReferencePoint, recordGpsEvent, setZeroPos } from "gps-plus-slam-js";
|
|
16
|
+
export { type CaptureGpsAnchorSampleOptions, type CompleteCallback, DEFAULT_MAX_DELAY_MS, DEFAULT_RECORDING_OPTIONS, DEPTH_CONSTRAINTS, type DepthCaptureOptions, type DepthPoint, type DepthSample, type ErrorCallback, type GpsAnchorSample, type GpsAnchorSampleGpsPoint, type GpsPoint, IMAGE_CONSTRAINTS, type ImageCaptureOptions, type LatLong, type MarkReferencePointPayload, type SessionMetadata as OpfsSessionMetadata, type PersistenceMiddlewareOptions, type ProgressCallback, type RawDeviceOrientation, type RawGpsPoint, type RecordGpsEventPayload, type RecordingCoordinatorConfig, type RecordingOptionsInput, type RecordingState, type ReplayAction, ReplayEngine, type ReplayRecordingOptions, type ReplayState, STORAGE_KEY, type SessionMetadata$1 as SessionMetadata, type SlamAppCombinedState, type SlamAppMiddleware, type SlamAppRootState, type SlamAppStore, type SlamAppStoreOptions, type StorageBackend, type StoreSubscriberDeps, type SubscribableStore, add2dImage, buildRawGpsPoint, buildRecordGpsEventPayload, calcRelativeCoordsInMeters, captureGpsAnchorSample, cloneRecordingOptions, computeInterActionDelay, createGpsPositionHandler, createPersistenceMiddleware, createSlamAppStore, endSession, eulerToQuaternion, extractActionTimestamp, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, loadRecordingOptions, markReferencePoint, recordDepthSample, recordGpsEvent, recordWriteFailure, recordingReducer, replayRecording, resetCoordinatorState, resetRecordingOptions, saveRecordingOptions, selectAlignmentMatrix, selectGpsPositions, selectOdometryPositions, selectOdometryRotations, selectReferencePoints, selectZeroReference, setZeroPos, startSession, subscribeToSelector, updateDeviceOrientation, validateDepthOptions, validateImageOptions, validateRecordingOptions, wireStoreSubscribers };
|
package/dist/state/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { clearSessionRefPointUsage, incrementRefPointUsage, refPointsReducer, resetRefPointsState, selectCachedKnownRefPoints, setImportedRefPoints } from "./ref-points-slice.js";
|
|
3
|
-
import { navigateTo, routingReducer } from "./routing-slice.js";
|
|
4
|
-
import { createPersistenceMiddleware } from "./persistence-middleware.js";
|
|
5
|
-
import { add2dImage, calcRelativeCoordsInMeters, createRecorderStore, markReferencePoint, recordGpsEvent, setZeroPos } from "./store.js";
|
|
6
|
-
import { buildRawGpsPoint, buildRecordGpsEventPayload, createGpsPositionHandler, eulerToQuaternion, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, resetCoordinatorState, updateDeviceOrientation } from "./recording-coordinator.js";
|
|
1
|
+
import { buildRawGpsPoint, buildRecordGpsEventPayload, createGpsPositionHandler, eulerToQuaternion, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, resetCoordinatorState, updateDeviceOrientation } from "./gps-event-coordinator.js";
|
|
7
2
|
import { DEFAULT_RECORDING_OPTIONS, DEPTH_CONSTRAINTS, IMAGE_CONSTRAINTS, STORAGE_KEY, cloneRecordingOptions, loadRecordingOptions, resetRecordingOptions, saveRecordingOptions, validateDepthOptions, validateImageOptions, validateRecordingOptions } from "./recording-options.js";
|
|
3
|
+
import { endSession, recordDepthSample, recordWriteFailure, recordingReducer, startSession } from "./recording-slice.js";
|
|
4
|
+
import { captureGpsAnchorSample } from "./gps-ar-pose-sampler.js";
|
|
5
|
+
import { createPersistenceMiddleware } from "./persistence-middleware.js";
|
|
6
|
+
import { createSlamAppStore } from "./create-slam-app-store.js";
|
|
8
7
|
import { replayRecording } from "./recording-replayer.js";
|
|
9
8
|
import { DEFAULT_MAX_DELAY_MS, ReplayEngine, computeInterActionDelay, extractActionTimestamp } from "./replay-engine.js";
|
|
10
9
|
import { subscribeToSelector } from "./subscribe-to-selector.js";
|
|
11
10
|
import { selectAlignmentMatrix, selectGpsPositions, selectOdometryPositions, selectOdometryRotations, selectReferencePoints, selectZeroReference } from "./app-selectors.js";
|
|
12
11
|
import { wireStoreSubscribers } from "./store-subscribers.js";
|
|
13
|
-
|
|
12
|
+
import { add2dImage, calcRelativeCoordsInMeters, markReferencePoint, recordGpsEvent, setZeroPos } from "gps-plus-slam-js";
|
|
13
|
+
export { DEFAULT_MAX_DELAY_MS, DEFAULT_RECORDING_OPTIONS, DEPTH_CONSTRAINTS, IMAGE_CONSTRAINTS, ReplayEngine, STORAGE_KEY, add2dImage, buildRawGpsPoint, buildRecordGpsEventPayload, calcRelativeCoordsInMeters, captureGpsAnchorSample, cloneRecordingOptions, computeInterActionDelay, createGpsPositionHandler, createPersistenceMiddleware, createSlamAppStore, endSession, eulerToQuaternion, extractActionTimestamp, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, loadRecordingOptions, markReferencePoint, recordDepthSample, recordGpsEvent, recordWriteFailure, recordingReducer, replayRecording, resetCoordinatorState, resetRecordingOptions, saveRecordingOptions, selectAlignmentMatrix, selectGpsPositions, selectOdometryPositions, selectOdometryRotations, selectReferencePoints, selectZeroReference, setZeroPos, startSession, subscribeToSelector, updateDeviceOrientation, validateDepthOptions, validateImageOptions, validateRecordingOptions, wireStoreSubscribers };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createPersistenceMiddleware, t as PersistenceMiddlewareOptions } from "../persistence-middleware-
|
|
1
|
+
import { n as createPersistenceMiddleware, t as PersistenceMiddlewareOptions } from "../persistence-middleware-z-75iisb.js";
|
|
2
2
|
export { PersistenceMiddlewareOptions, createPersistenceMiddleware };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger.js";
|
|
2
|
-
import { recordWriteFailure } from "./
|
|
2
|
+
import { recordWriteFailure } from "./recording-slice.js";
|
|
3
3
|
//#region ../src/state/persistence-middleware.ts
|
|
4
4
|
const log = createLogger("PersistenceMiddleware");
|
|
5
5
|
/** Maximum number of concurrent OPFS write operations. */
|
|
@@ -31,10 +31,10 @@ var WriteQueue = class {
|
|
|
31
31
|
* during active recording sessions.
|
|
32
32
|
*
|
|
33
33
|
* Persistence rules:
|
|
34
|
-
* - Only persists when `state.
|
|
34
|
+
* - Only persists when `state.recording.isRecording` is true (checked AFTER
|
|
35
35
|
* the action is reduced, so `startSession` itself is included).
|
|
36
|
-
* - Persists `gpsData/*` and `
|
|
37
|
-
* - Excludes `
|
|
36
|
+
* - Persists `gpsData/*` and `recording/*` actions.
|
|
37
|
+
* - Excludes `recording/recordWriteFailure` to prevent recursive persistence.
|
|
38
38
|
* - Excludes `routing/*`, `refPoints/*`, and any other non-recording actions.
|
|
39
39
|
* - Uses 1-based indexing for action files (000001.json, 000002.json, …).
|
|
40
40
|
* - Each middleware instance maintains its own action index (Bug 10 fix).
|
|
@@ -46,12 +46,12 @@ function createPersistenceMiddleware(options) {
|
|
|
46
46
|
const middleware = (store) => (next) => (action) => {
|
|
47
47
|
const typedAction = action;
|
|
48
48
|
const actionType = typeof typedAction.type === "string" ? typedAction.type : null;
|
|
49
|
-
const wasRecording = store.getState().
|
|
49
|
+
const wasRecording = store.getState().recording?.isRecording ?? false;
|
|
50
50
|
const result = next(action);
|
|
51
51
|
if (!actionType) return result;
|
|
52
|
-
if (actionType === "
|
|
53
|
-
if (!((store.getState().
|
|
54
|
-
if (!(actionType.startsWith("gpsData/") || actionType.startsWith("
|
|
52
|
+
if (actionType === "recording/startSession") actionIndex = 0;
|
|
53
|
+
if (!((store.getState().recording?.isRecording ?? false) || wasRecording && actionType === "recording/endSession")) return result;
|
|
54
|
+
if (!(actionType.startsWith("gpsData/") || actionType.startsWith("recording/") && actionType !== "recording/recordWriteFailure")) return result;
|
|
55
55
|
const index = ++actionIndex;
|
|
56
56
|
writeQueue.enqueue(async () => {
|
|
57
57
|
try {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as CombinedRootState } from "../combined-root-state-B3SvPNjU.js";
|
|
2
|
+
import { n as replayRecording, t as ReplayRecordingOptions } from "../recording-replayer-BFhFs7Mc.js";
|
|
3
|
+
export { CombinedRootState, ReplayRecordingOptions, replayRecording };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createRecorderStore } from "./store.js";
|
|
2
1
|
import { loadActionsFromZip } from "../storage/zip-reader.js";
|
|
3
2
|
import { NullStorageBackend } from "../storage/null-storage-backend.js";
|
|
3
|
+
import { createSlamAppStore } from "./create-slam-app-store.js";
|
|
4
4
|
//#region ../src/state/recording-replayer.ts
|
|
5
5
|
/**
|
|
6
6
|
* Recording Replayer
|
|
@@ -29,7 +29,7 @@ import { NullStorageBackend } from "../storage/null-storage-backend.js";
|
|
|
29
29
|
* @throws If the zip cannot be parsed or contains invalid data
|
|
30
30
|
*/
|
|
31
31
|
async function replayRecording(zipData, options) {
|
|
32
|
-
const store =
|
|
32
|
+
const store = createSlamAppStore({ storageBackend: new NullStorageBackend() });
|
|
33
33
|
let actions = (await loadActionsFromZip(zipData)).map((e) => e.action);
|
|
34
34
|
if (options?.migrateActions) actions = options.migrateActions(actions);
|
|
35
35
|
for (const action of actions) store.dispatch(action);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as recordWriteFailure, i as recordDepthSample, n as SessionMetadata, o as recordingReducer, r as endSession, s as startSession, t as RecordingState } from "../recording-slice-BiktUIWF.js";
|
|
2
|
+
export { RecordingState, SessionMetadata, endSession, recordDepthSample, recordWriteFailure, recordingReducer, startSession };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { createSlice } from "@reduxjs/toolkit";
|
|
2
|
-
//#region ../src/state/
|
|
3
|
-
const
|
|
4
|
-
name: "
|
|
2
|
+
//#region ../src/state/recording-slice.ts
|
|
3
|
+
const recordingSlice = createSlice({
|
|
4
|
+
name: "recording",
|
|
5
5
|
initialState: {
|
|
6
6
|
isRecording: false,
|
|
7
7
|
sessionMetadata: null,
|
|
8
8
|
actionCount: 0,
|
|
9
|
-
failedWriteCount: 0
|
|
10
|
-
currentScenarioName: ""
|
|
9
|
+
failedWriteCount: 0
|
|
11
10
|
},
|
|
12
11
|
reducers: {
|
|
13
12
|
startSession(state, action) {
|
|
@@ -31,17 +30,10 @@ const recorderSlice = createSlice({
|
|
|
31
30
|
*/
|
|
32
31
|
recordWriteFailure(state, _action) {
|
|
33
32
|
state.failedWriteCount += 1;
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* Set the currently selected scenario name.
|
|
37
|
-
* Replaces the closure variable threading through folder-manager deps.
|
|
38
|
-
*/
|
|
39
|
-
setCurrentScenarioName(state, action) {
|
|
40
|
-
state.currentScenarioName = action.payload;
|
|
41
33
|
}
|
|
42
34
|
}
|
|
43
35
|
});
|
|
44
|
-
const { startSession, endSession, recordDepthSample, recordWriteFailure
|
|
45
|
-
const
|
|
36
|
+
const { startSession, endSession, recordDepthSample, recordWriteFailure } = recordingSlice.actions;
|
|
37
|
+
const recordingReducer = recordingSlice.reducer;
|
|
46
38
|
//#endregion
|
|
47
|
-
export { endSession, recordDepthSample, recordWriteFailure,
|
|
39
|
+
export { endSession, recordDepthSample, recordWriteFailure, recordingReducer, startSession };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ReplayAction, c as computeInterActionDelay, i as ProgressCallback, l as extractActionTimestamp, n as DEFAULT_MAX_DELAY_MS, o as ReplayEngine, r as ErrorCallback, s as ReplayState, t as CompleteCallback } from "../replay-engine-
|
|
1
|
+
import { a as ReplayAction, c as computeInterActionDelay, i as ProgressCallback, l as extractActionTimestamp, n as DEFAULT_MAX_DELAY_MS, o as ReplayEngine, r as ErrorCallback, s as ReplayState, t as CompleteCallback } from "../replay-engine-B88Va62x.js";
|
|
2
2
|
export { CompleteCallback, DEFAULT_MAX_DELAY_MS, ErrorCallback, ProgressCallback, ReplayAction, ReplayEngine, ReplayState, computeInterActionDelay, extractActionTimestamp };
|
|
@@ -25,7 +25,7 @@ function extractActionTimestamp(action) {
|
|
|
25
25
|
if (gpsPoint && typeof gpsPoint.timestamp === "number") return gpsPoint.timestamp;
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
|
-
case "
|
|
28
|
+
case "recording/startSession":
|
|
29
29
|
if (typeof payload.startTime === "number") return payload.startTime;
|
|
30
30
|
return null;
|
|
31
31
|
case "gpsData/markReferencePoint": {
|
|
@@ -36,8 +36,8 @@ function extractActionTimestamp(action) {
|
|
|
36
36
|
if (gpsPoint && typeof gpsPoint.timestamp === "number") return gpsPoint.timestamp;
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
|
-
case "
|
|
40
|
-
case "
|
|
39
|
+
case "recording/recordDepthSample": return null;
|
|
40
|
+
case "recording/endSession": return null;
|
|
41
41
|
default: return null;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as SubscribableStore } from "../subscribe-to-selector-
|
|
2
|
-
import { n as wireStoreSubscribers, t as StoreSubscriberDeps } from "../store-subscribers-
|
|
1
|
+
import { t as SubscribableStore } from "../subscribe-to-selector-ghDKYtap.js";
|
|
2
|
+
import { n as wireStoreSubscribers, t as StoreSubscriberDeps } from "../store-subscribers-DKKHld49.js";
|
|
3
3
|
export { StoreSubscriberDeps, SubscribableStore, wireStoreSubscribers };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fusedGpsFromOdom } from "../utils/fused-path.js";
|
|
2
2
|
import { subscribeToSelector } from "./subscribe-to-selector.js";
|
|
3
|
-
import { selectAlignmentMatrix, selectGpsPositions, selectOdometryPositions, selectOdometryRotations,
|
|
3
|
+
import { selectAlignmentMatrix, selectGpsPositions, selectOdometryPositions, selectOdometryRotations, selectZeroReference } from "./app-selectors.js";
|
|
4
4
|
import { calcGpsCoords } from "gps-plus-slam-js";
|
|
5
5
|
import { mat4, vec3 } from "gl-matrix";
|
|
6
6
|
//#region ../src/state/store-subscribers.ts
|
|
@@ -81,14 +81,6 @@ function wireStoreSubscribers(store, deps) {
|
|
|
81
81
|
deps.mapOverlay.setGpsPosition(lastGpsPoint.latitude, lastGpsPoint.longitude);
|
|
82
82
|
}
|
|
83
83
|
}));
|
|
84
|
-
unsubs.push(subscribeToSelector(store, selectReferencePoints, (refPoints, prevPoints) => {
|
|
85
|
-
const prevCount = prevPoints?.length ?? 0;
|
|
86
|
-
if (!deps.mapOverlay?.addRefPoint || refPoints.length <= prevCount) return;
|
|
87
|
-
for (let i = prevCount; i < refPoints.length; i++) {
|
|
88
|
-
const rp = refPoints[i];
|
|
89
|
-
deps.mapOverlay.addRefPoint(rp.gpsPoint.latitude, rp.gpsPoint.longitude, rp.id);
|
|
90
|
-
}
|
|
91
|
-
}));
|
|
92
84
|
return () => {
|
|
93
85
|
for (const unsub of unsubs) unsub();
|
|
94
86
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as subscribeToSelector, t as SubscribableStore } from "../subscribe-to-selector-
|
|
1
|
+
import { n as subscribeToSelector, t as SubscribableStore } from "../subscribe-to-selector-ghDKYtap.js";
|
|
2
2
|
export { SubscribableStore, subscribeToSelector };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as formatFrameFilename, r as formatTimestamp, t as formatActionFilename } from "../file-system-utils-
|
|
1
|
+
import { n as formatFrameFilename, r as formatTimestamp, t as formatActionFilename } from "../file-system-utils-BH8FdyIu.js";
|
|
2
2
|
export { formatActionFilename, formatFrameFilename, formatTimestamp };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export {
|
|
1
|
+
import { a as listSessions, c as setCurrentScenario, d as writeAction, f as writeFrame, i as initStorage, l as startSession, n as ensureScenarioDirectory, o as resetForNewSession, p as writeSessionMetadata, r as getCurrentScenarioHandle, s as resetStorageState, t as WriteAccessResult, u as verifyWriteAccess } from "../file-system-DD5TczSO.js";
|
|
2
|
+
export { WriteAccessResult, ensureScenarioDirectory, getCurrentScenarioHandle, initStorage, listSessions, resetForNewSession, resetStorageState, setCurrentScenario, startSession, verifyWriteAccess, writeAction, writeFrame, writeSessionMetadata };
|