gps-plus-slam-app-framework 1.2.0 → 1.4.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.
- package/dist/{app-selectors-CcZ5UV-8.d.ts → app-selectors-CrOucL00.d.ts} +1 -1
- package/dist/ar/bresenham3d.d.ts +1 -1
- package/dist/ar/camera-blit-capture.d.ts +2 -2
- package/dist/ar/camera-blit-capture.js +87 -9
- package/dist/ar/capability-checker.d.ts +1 -1
- package/dist/ar/capture-failure-tracker.d.ts +1 -1
- package/dist/ar/chromium-camera-access-workaround.d.ts +1 -1
- package/dist/ar/depth-grid-lookup.d.ts +2 -0
- package/dist/ar/depth-grid-lookup.js +43 -0
- package/dist/ar/depth-sampler.d.ts +2 -2
- package/dist/ar/depth-sampler.js +2 -4
- package/dist/ar/depth-unprojection.d.ts +1 -1
- package/dist/ar/enable-gps-ar.d.ts +1 -1
- package/dist/ar/enable-gps-ar.js +26 -1
- package/dist/ar/frame-loop.d.ts +1 -1
- package/dist/ar/image-capture.d.ts +2 -2
- package/dist/ar/image-capture.js +7 -5
- package/dist/ar/index.d.ts +30 -19
- package/dist/ar/index.js +15 -4
- package/dist/ar/occupancy-grid.d.ts +1 -1
- package/dist/ar/occupancy-grid.js +29 -2
- package/dist/ar/planar-pnp.d.ts +2 -0
- package/dist/ar/planar-pnp.js +425 -0
- package/dist/ar/qr-debug-view.d.ts +2 -0
- package/dist/ar/qr-debug-view.js +89 -0
- package/dist/ar/qr-derived-pose.d.ts +2 -0
- package/dist/ar/qr-derived-pose.js +114 -0
- package/dist/ar/qr-detection-controller.d.ts +2 -0
- package/dist/ar/qr-detection-controller.js +2 -0
- package/dist/ar/qr-frontend.d.ts +2 -0
- package/dist/ar/qr-frontend.js +60 -0
- package/dist/ar/qr-pose.d.ts +2 -0
- package/dist/ar/qr-pose.js +267 -0
- package/dist/ar/qr-size-depth-context.d.ts +3 -0
- package/dist/ar/qr-size-depth-context.js +42 -0
- package/dist/ar/qr-size-measurer.d.ts +2 -0
- package/dist/ar/qr-size-measurer.js +2 -0
- package/dist/ar/replay-scene.d.ts +1 -1
- package/dist/ar/replay-scene.js +1 -1
- package/dist/ar/scene-node-names.d.ts +1 -1
- package/dist/ar/webxr-nue-basis.d.ts +1 -1
- package/dist/ar/webxr-session.d.ts +4 -4
- package/dist/ar/webxr-session.js +2 -2
- package/dist/ar/xr-camera-texture.d.ts +1 -1
- package/dist/ar/xr-error-handler.d.ts +1 -1
- package/dist/ar/xr-frame-loop.d.ts +1 -1
- package/dist/ar-Dc72Ksiu.js +382 -0
- package/dist/{ar-world-group-alignment-ColHB_5A.d.ts → ar-world-group-alignment-DDLkgNf_.d.ts} +1 -1
- package/dist/{camera-blit-capture-D5_mNhla.d.ts → camera-blit-capture-CqWe1G7s.d.ts} +66 -4
- package/dist/concurrency-DqAlKX4j.d.ts +50 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/{create-slam-app-store-qNXQ-tq5.d.ts → create-slam-app-store-Ce2FMKCp.d.ts} +5 -5
- package/dist/depth-grid-lookup-vMDrGTk_.d.ts +21 -0
- package/dist/{depth-sampler-Bhanfwla.d.ts → depth-sampler-DwfPYzS7.d.ts} +1 -1
- package/dist/{depth-unprojection-Y6i_mJuT.d.ts → depth-unprojection-CK3b9htH.d.ts} +1 -1
- package/dist/{enable-gps-ar-CapmADVN.d.ts → enable-gps-ar-CjZ1nEdu.d.ts} +4 -4
- package/dist/file-system-utils-Bs7lpeVP.d.ts +40 -0
- package/dist/{frame-conversions-BfsafGWR.d.ts → frame-conversions-D_Af8Dt3.d.ts} +1 -1
- package/dist/{fused-path-DJoVu98b.d.ts → fused-path-C0FHe67t.d.ts} +1 -1
- package/dist/geo/h3-proximity.d.ts +2 -2
- package/dist/geo/h3-proximity.js +61 -2
- package/dist/geo/index.d.ts +2 -2
- package/dist/geo/index.js +2 -2
- package/dist/{gps-anchor-dYeCvvp5.d.ts → gps-anchor-C6I9NDHA.d.ts} +1 -1
- package/dist/{gps-ar-pose-sampler-DVb96iOy.d.ts → gps-ar-pose-sampler-DaHg2aPZ.d.ts} +1 -1
- package/dist/{gps-event-coordinator-BDIQde2x.d.ts → gps-event-coordinator-C7hwHyLA.d.ts} +3 -3
- package/dist/{gps-event-markers-Dc9FT-q1.d.ts → gps-event-markers-Dd0G2bD0.d.ts} +18 -0
- package/dist/{h3-proximity-I1msGPgE.d.ts → h3-proximity-B57C6rYL.d.ts} +39 -1
- package/dist/{image-capture-DZ4HFRgS.d.ts → image-capture-C2Feywet.d.ts} +30 -4
- package/dist/index-BvLo2poy.d.ts +399 -0
- package/dist/{index-KJq2amHF.d.ts → index-m_LneUSi.d.ts} +1 -1
- package/dist/index.d.ts +77 -67
- package/dist/index.js +18 -9
- package/dist/{leaflet-map-overlay-6CJC-E1l.d.ts → leaflet-map-overlay-bnb2U1NQ.d.ts} +1 -1
- package/dist/{map-data-CkloBxIl.d.ts → map-data-DdjPiSav.d.ts} +1 -1
- package/dist/{map-overlay-draw-krOKwDAq.d.ts → map-overlay-draw-CPVdAsFq.d.ts} +1 -1
- package/dist/{null-storage-backend-CxEjZHRW.d.ts → null-storage-backend-CuSdYFsM.d.ts} +2 -2
- package/dist/{occupancy-grid-BRNRaPyT.d.ts → occupancy-grid-Bvi2Gw1U.d.ts} +12 -2
- package/dist/{opfs-storage-DYm8WHq7.d.ts → opfs-storage-DMtlt57S.d.ts} +25 -6
- package/dist/{opfs-storage-backend-CjSAuqg_.d.ts → opfs-storage-backend-CeQAb0SD.d.ts} +3 -3
- package/dist/{persistence-middleware-DwyzgfWr.d.ts → persistence-middleware-5eearhSV.d.ts} +1 -1
- package/dist/planar-pnp-cjthe7Be.d.ts +67 -0
- package/dist/qr-debug-view-B8gTzjMm.d.ts +29 -0
- package/dist/qr-derived-pose-DinKE600.d.ts +122 -0
- package/dist/qr-detected-slice-Cpv-dg82.d.ts +166 -0
- package/dist/qr-detection-controller-B-tLVd-S.js +119 -0
- package/dist/qr-detection-controller-Cd2Ih4cC.d.ts +48 -0
- package/dist/qr-frontend-DufZp2xS.d.ts +58 -0
- package/dist/qr-pose-Bt2reSw7.d.ts +138 -0
- package/dist/qr-pose-aggregation-CFlmLm6w.d.ts +90 -0
- package/dist/qr-pose-aggregation-DXR9STHs.js +200 -0
- package/dist/qr-size-depth-context-onu36E9s.d.ts +13 -0
- package/dist/qr-size-measurer-D7739ZpB.d.ts +165 -0
- package/dist/qr-size-measurer-DLb33geH.js +596 -0
- package/dist/recording-options-D93kksJU.d.ts +369 -0
- package/dist/{recording-replayer-BL-x-7k0.d.ts → recording-replayer-CUEK82tM.d.ts} +2 -2
- package/dist/recording-slice-B-uCgGoh.d.ts +55 -0
- package/dist/{replay-engine-BRqszuQ9.d.ts → replay-engine-BSVd7Zzb.d.ts} +7 -4
- package/dist/{replay-scene-Bw58VL6p.d.ts → replay-scene-CPt56pps.d.ts} +3 -3
- 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/permission-checker.d.ts +1 -1
- package/dist/sensors/permission-checker.js +1 -1
- package/dist/state/app-selectors.d.ts +1 -1
- package/dist/state/app-selectors.js +3 -1
- package/dist/state/combined-root-state.d.ts +1 -1
- package/dist/state/create-slam-app-store.d.ts +1 -1
- package/dist/state/gps-ar-pose-sampler.d.ts +3 -3
- package/dist/state/gps-event-coordinator.d.ts +1 -1
- package/dist/state/index.d.ts +20 -17
- package/dist/state/index.js +3 -2
- package/dist/state/persistence-middleware.d.ts +1 -1
- package/dist/state/qr-detected-slice.d.ts +4 -0
- package/dist/state/qr-detected-slice.js +311 -0
- package/dist/state/recording-options.d.ts +2 -2
- package/dist/state/recording-options.js +128 -4
- package/dist/state/recording-replayer.d.ts +2 -2
- package/dist/state/recording-slice.d.ts +1 -1
- package/dist/state/recording-slice.js +5 -1
- package/dist/state/replay-engine.d.ts +1 -1
- package/dist/state/replay-engine.js +7 -3
- package/dist/state/store-subscribers.d.ts +2 -2
- package/dist/state/subscribe-to-selector.d.ts +1 -1
- package/dist/state/tracking-quality.d.ts +1 -1
- package/dist/state/tracking-slice.d.ts +1 -1
- package/dist/{state-BkIfpiyA.js → state-IEw0ZsBu.js} +1 -0
- package/dist/storage/file-system-utils.d.ts +2 -2
- package/dist/storage/file-system-utils.js +17 -1
- package/dist/storage/index.d.ts +9 -9
- package/dist/storage/index.js +4 -4
- package/dist/storage/null-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage-backend.js +3 -3
- package/dist/storage/opfs-storage.d.ts +1 -1
- package/dist/storage/opfs-storage.js +9 -8
- package/dist/storage/storage-backend.d.ts +1 -1
- package/dist/storage/zip-coverage-embed.d.ts +2 -0
- package/dist/storage/zip-coverage-embed.js +88 -0
- package/dist/storage/zip-export.d.ts +2 -2
- package/dist/storage/zip-export.js +38 -60
- package/dist/storage/zip-reader.d.ts +1 -1
- package/dist/storage/zip-reader.js +1 -1
- package/dist/{storage-backend-C9HLFtgz.d.ts → storage-backend-CTJHNdMp.d.ts} +1 -1
- package/dist/{store-subscribers-rrkLkFTt.d.ts → store-subscribers-BZP81hjh.d.ts} +2 -2
- package/dist/{subscribe-to-selector-CP3BKSbF.d.ts → subscribe-to-selector-Bp3sLx8L.d.ts} +1 -1
- package/dist/test-utils/browser-mocks.d.ts +7 -1
- package/dist/test-utils/browser-mocks.js +6 -0
- package/dist/test-utils/zip-round-trip-helpers.d.ts +9 -1
- package/dist/test-utils/zip-round-trip-helpers.js +8 -3
- package/dist/{tracking-slice-CdK8c-8P.d.ts → tracking-slice-DJZ9qeGg.d.ts} +1 -1
- package/dist/types/ar-types.d.ts +1 -1
- package/dist/types/geo-types.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/concurrency.d.ts +2 -2
- package/dist/utils/concurrency.js +66 -2
- package/dist/utils/failure-tracker.d.ts +1 -1
- package/dist/utils/format-file-size.d.ts +1 -1
- package/dist/utils/fused-path.d.ts +1 -1
- package/dist/utils/index.d.ts +6 -6
- package/dist/utils/list-formatter.d.ts +1 -1
- package/dist/utils/logger.d.ts +1 -1
- package/dist/visualization/accuracy-circles.d.ts +1 -1
- package/dist/visualization/alignment-lerper.d.ts +1 -1
- package/dist/visualization/ar-world-group-alignment.d.ts +1 -1
- package/dist/visualization/ar-world-group-alignment.js +1 -1
- package/dist/visualization/camera-follower.d.ts +1 -1
- package/dist/visualization/css3d-renderer-manager.d.ts +1 -1
- package/dist/visualization/frame-conversions.d.ts +1 -1
- package/dist/visualization/frustum-visibility.d.ts +1 -1
- package/dist/visualization/gps-anchor.d.ts +1 -1
- package/dist/visualization/gps-compass-cubes.d.ts +1 -1
- package/dist/visualization/gps-event-markers.d.ts +1 -1
- package/dist/visualization/gps-event-markers.js +40 -5
- package/dist/visualization/hit-test-reticle.d.ts +1 -1
- package/dist/visualization/hit-test-reticle.js +1 -0
- package/dist/visualization/index.d.ts +18 -18
- package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
- package/dist/visualization/leaflet-map-overlay.js +15 -3
- package/dist/visualization/lerp-utils.d.ts +1 -1
- package/dist/visualization/map-data.d.ts +1 -1
- package/dist/visualization/map-overlay-draw.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/{webxr-session-QhcSSub5.js → webxr-session-CJF9Nijp.js} +234 -9
- package/dist/{webxr-session-DtAG9srK.d.ts → webxr-session-COsOjJwn.d.ts} +76 -8
- package/dist/zip-coverage-embed-tFohI2J4.d.ts +41 -0
- package/dist/{zip-export-D_5HAvFz.d.ts → zip-export-DDWXInTR.d.ts} +28 -24
- package/package.json +2 -2
- package/dist/concurrency-CO1FQvs3.d.ts +0 -24
- package/dist/file-system-C_eqiEA8.d.ts +0 -114
- package/dist/file-system-utils-DyAmcuvX.d.ts +0 -24
- package/dist/recording-options-DJBXuMxV.d.ts +0 -182
- package/dist/recording-slice-89O07ebs.d.ts +0 -36
- package/dist/storage/file-system.d.ts +0 -2
- package/dist/storage/file-system.js +0 -289
- /package/dist/{accuracy-circles-BpwWAs8G.d.ts → accuracy-circles-Pi2YeCrM.d.ts} +0 -0
- /package/dist/{alignment-lerper-Dm9G7JJO.d.ts → alignment-lerper-BUTsQ2yu.d.ts} +0 -0
- /package/dist/{ar-types-Dan1MVTi.d.ts → ar-types-BckI1E-O.d.ts} +0 -0
- /package/dist/{bresenham3d-CFfd7n6B.d.ts → bresenham3d-ByjcmEgM.d.ts} +0 -0
- /package/dist/{camera-follower-C2mwEn7c.d.ts → camera-follower-BTb2Yp12.d.ts} +0 -0
- /package/dist/{capability-checker-CQXJHxXg.d.ts → capability-checker-CXqoJYtb.d.ts} +0 -0
- /package/dist/{capture-failure-tracker-CUeU3L_M.d.ts → capture-failure-tracker-BL5SoG2a.d.ts} +0 -0
- /package/dist/{chromium-camera-access-workaround-Jqbn0apH.d.ts → chromium-camera-access-workaround-BNK189P0.d.ts} +0 -0
- /package/dist/{css3d-renderer-manager-ptu_t3B3.d.ts → css3d-renderer-manager-m-ab19vp.d.ts} +0 -0
- /package/dist/{failure-tracker-Cn8Fo9D4.d.ts → failure-tracker-Cnc_xWUw.d.ts} +0 -0
- /package/dist/{format-file-size-CLCZz3lC.d.ts → format-file-size-BFUWvir1.d.ts} +0 -0
- /package/dist/{frame-loop-CMewS8cY.d.ts → frame-loop-BEO9_q3k.d.ts} +0 -0
- /package/dist/{frustum-visibility-CmI96ESS.d.ts → frustum-visibility-D_RGmH98.d.ts} +0 -0
- /package/dist/{geo-types-SaPnIEUM.d.ts → geo-types-DqiBzPO9.d.ts} +0 -0
- /package/dist/{gps-VuezJWK3.d.ts → gps-C5inWeNV.d.ts} +0 -0
- /package/dist/{gps-compass-cubes-BM1uGiYV.d.ts → gps-compass-cubes-BExxrWJ-.d.ts} +0 -0
- /package/dist/{gps-error-handler-CJl_2MVm.d.ts → gps-error-handler-C2bS69oJ.d.ts} +0 -0
- /package/dist/{hit-test-reticle-BEzEybxZ.d.ts → hit-test-reticle-Dqak9hiR.d.ts} +0 -0
- /package/dist/{index-CF05QV2m.d.ts → index-eaI1Z1KR.d.ts} +0 -0
- /package/dist/{lerp-utils-BpV-0Dtk.d.ts → lerp-utils-kLxMJ2Xj.d.ts} +0 -0
- /package/dist/{list-formatter-RRcBe8Vg.d.ts → list-formatter-ct8txwvR.d.ts} +0 -0
- /package/dist/{logger-BEHXsnnq.d.ts → logger-CzQrCe6C.d.ts} +0 -0
- /package/dist/{map-overlay-bcogY5fK.d.ts → map-overlay-Dci4yvm3.d.ts} +0 -0
- /package/dist/{permission-checker-GpAiSCwd.d.ts → permission-checker-CtPtPQRq.d.ts} +0 -0
- /package/dist/{scene-node-names-Bu0S66H1.d.ts → scene-node-names-CdNeQjOE.d.ts} +0 -0
- /package/dist/{session-disposers-M-oashRH.js → session-disposers-D8wnO-uW.js} +0 -0
- /package/dist/{three-dispose-D950t71B.d.ts → three-dispose-BCZkSJp2.d.ts} +0 -0
- /package/dist/{vis-colors-D6omC64K.d.ts → vis-colors-BZsSLI4i.d.ts} +0 -0
- /package/dist/{webxr-nue-basis-CqKQmZzT.d.ts → webxr-nue-basis-CW1wsbm6.d.ts} +0 -0
- /package/dist/{xr-camera-texture-DBwCaKTd.d.ts → xr-camera-texture-BmrP7iNZ.d.ts} +0 -0
- /package/dist/{xr-error-handler-C0AQRmxs.d.ts → xr-error-handler-BEjRgZjt.d.ts} +0 -0
- /package/dist/{xr-frame-loop-BtYytZJg.d.ts → xr-frame-loop-K8ebdjLw.d.ts} +0 -0
- /package/dist/{zip-reader-DSEXt7K6.d.ts → zip-reader-Q2ue6zlC.d.ts} +0 -0
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { n as SessionMetadata } from "./opfs-storage-DYm8WHq7.js";
|
|
2
|
-
|
|
3
|
-
//#region ../src/storage/file-system.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Reset module state - exported for testing only
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
declare function resetStorageState(): void;
|
|
9
|
-
/**
|
|
10
|
-
* Reset session-level state for a new recording.
|
|
11
|
-
*
|
|
12
|
-
* Clears scenario/session names and OPFS session handles, but preserves
|
|
13
|
-
* `storageInitialized` and the OPFS root so `initStorage()` doesn't need
|
|
14
|
-
* to be called again.
|
|
15
|
-
*/
|
|
16
|
-
declare function resetForNewSession(): void;
|
|
17
|
-
/**
|
|
18
|
-
* Result of write access verification.
|
|
19
|
-
*/
|
|
20
|
-
interface WriteAccessResult {
|
|
21
|
-
/** Whether write access was successfully verified */
|
|
22
|
-
success: boolean;
|
|
23
|
-
/** Error message if write verification failed */
|
|
24
|
-
error?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Verify that we have actual write access to a directory.
|
|
28
|
-
*/
|
|
29
|
-
declare function verifyWriteAccess(dirHandle: FileSystemDirectoryHandle): Promise<WriteAccessResult>;
|
|
30
|
-
/**
|
|
31
|
-
* Initialize storage using OPFS.
|
|
32
|
-
*
|
|
33
|
-
* @returns List of existing scenario folder names
|
|
34
|
-
* @throws Error if OPFS is not supported
|
|
35
|
-
*/
|
|
36
|
-
declare function initStorage(): Promise<string[]>;
|
|
37
|
-
/**
|
|
38
|
-
* Create a new session folder.
|
|
39
|
-
*
|
|
40
|
-
* When scenarioName is provided, creates under the scenario directory
|
|
41
|
-
* (legacy scenario layout for the recorder). When omitted, creates under
|
|
42
|
-
* the flat sessions/ directory.
|
|
43
|
-
*
|
|
44
|
-
* @param scenarioName - Optional name of the scenario (omit for flat layout)
|
|
45
|
-
*/
|
|
46
|
-
declare function startSession(scenarioName?: string): Promise<{
|
|
47
|
-
scenarioPath: string;
|
|
48
|
-
sessionPath: string;
|
|
49
|
-
}>;
|
|
50
|
-
/**
|
|
51
|
-
* List all session names.
|
|
52
|
-
* When scenarioName is provided, lists sessions under that scenario.
|
|
53
|
-
* Otherwise lists flat sessions.
|
|
54
|
-
*/
|
|
55
|
-
declare function listSessions(scenarioName?: string): Promise<string[]>;
|
|
56
|
-
/**
|
|
57
|
-
* Write a Redux action to OPFS as a JSON file.
|
|
58
|
-
*/
|
|
59
|
-
declare function writeAction(action: unknown, index: number): Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* Write a captured frame image to OPFS.
|
|
62
|
-
*/
|
|
63
|
-
declare function writeFrame(blob: Blob, index: number): Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* Write session metadata (session.json) to OPFS.
|
|
66
|
-
*/
|
|
67
|
-
declare function writeSessionMetadata(metadata: SessionMetadata): Promise<void>;
|
|
68
|
-
/**
|
|
69
|
-
* Get the current scenario handle (for loading prior sessions).
|
|
70
|
-
* Legacy: uses scenario directory layout.
|
|
71
|
-
*/
|
|
72
|
-
declare function getCurrentScenarioHandle(): FileSystemDirectoryHandle | null;
|
|
73
|
-
/**
|
|
74
|
-
* Set the current scenario handle (when user selects a scenario).
|
|
75
|
-
* Legacy: uses scenario directory layout.
|
|
76
|
-
*/
|
|
77
|
-
declare function setCurrentScenario(scenarioName: string): Promise<FileSystemDirectoryHandle | null>;
|
|
78
|
-
/**
|
|
79
|
-
* Ensure a scenario directory exists in OPFS, creating it if necessary.
|
|
80
|
-
* Legacy: used during OPFS recovery.
|
|
81
|
-
*/
|
|
82
|
-
declare function ensureScenarioDirectory(scenarioName: string): Promise<FileSystemDirectoryHandle | null>;
|
|
83
|
-
/**
|
|
84
|
-
* Result of clearing the reference-point cache across all scenarios.
|
|
85
|
-
*/
|
|
86
|
-
interface ClearRefPointsCacheResult {
|
|
87
|
-
/** Number of scenarios whose `refPoints/` directory was deleted. */
|
|
88
|
-
readonly scenariosCleared: number;
|
|
89
|
-
/** Total number of scenarios scanned (including ones with no cache). */
|
|
90
|
-
readonly scenariosScanned: number;
|
|
91
|
-
/** Names of scenarios that failed to clear, with reason. */
|
|
92
|
-
readonly errors: {
|
|
93
|
-
scenarioName: string;
|
|
94
|
-
reason: string;
|
|
95
|
-
}[];
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Clear the cached `refPoints/` directory for every scenario in OPFS.
|
|
99
|
-
*
|
|
100
|
-
* Used by the "Clear Reference Point Cache" maintenance action so that the
|
|
101
|
-
* next scenario load re-imports ref points from the read folder's `*.zip`
|
|
102
|
-
* recordings (see ref-point-recovery in the recorder app).
|
|
103
|
-
*
|
|
104
|
-
* Failures for individual scenarios are collected in `errors` rather than
|
|
105
|
-
* aborting the whole operation — partial progress is still useful.
|
|
106
|
-
*
|
|
107
|
-
* @throws Error if OPFS storage is unavailable (e.g. `initStorage()` not yet
|
|
108
|
-
* called, or browser does not support OPFS). Surfacing this loudly avoids
|
|
109
|
-
* reporting a silent "0 scenarios cleared" success that would mask the
|
|
110
|
-
* real failure to the user.
|
|
111
|
-
*/
|
|
112
|
-
declare function clearRefPointsCacheForAllScenarios(): Promise<ClearRefPointsCacheResult>;
|
|
113
|
-
//#endregion
|
|
114
|
-
export { getCurrentScenarioHandle as a, resetForNewSession as c, startSession as d, verifyWriteAccess as f, writeSessionMetadata as h, ensureScenarioDirectory as i, resetStorageState as l, writeFrame as m, WriteAccessResult as n, initStorage as o, writeAction as p, clearRefPointsCacheForAllScenarios as r, listSessions as s, ClearRefPointsCacheResult as t, setCurrentScenario as u };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//#region ../src/storage/file-system-utils.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* File System Utilities - Pure Functions
|
|
4
|
-
*
|
|
5
|
-
* These are extracted from file-system.ts so they can be tested
|
|
6
|
-
* without mocking browser APIs.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Format a Date as a timestamp string for folder names
|
|
10
|
-
* @example "2025-02-28_14-30-11utc"
|
|
11
|
-
*/
|
|
12
|
-
declare function formatTimestamp(date: Date): string;
|
|
13
|
-
/**
|
|
14
|
-
* Format an action file index as a zero-padded filename
|
|
15
|
-
* @example 42 -> "000042.json"
|
|
16
|
-
*/
|
|
17
|
-
declare function formatActionFilename(index: number): string;
|
|
18
|
-
/**
|
|
19
|
-
* Format a frame index as a zero-padded filename
|
|
20
|
-
* @example 42 -> "frame-000042.jpg"
|
|
21
|
-
*/
|
|
22
|
-
declare function formatFrameFilename(index: number): string;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { formatFrameFilename as n, formatTimestamp as r, formatActionFilename as t };
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
//#region ../src/state/recording-options.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Recording Options - User-configurable settings for data capture.
|
|
4
|
-
*
|
|
5
|
-
* Allows users to disable/configure high-frequency data streams
|
|
6
|
-
* (depth sampling, image capture) to improve performance on lower-end devices.
|
|
7
|
-
*
|
|
8
|
-
* Options persist in localStorage across sessions.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Input type for validateRecordingOptions allowing partial nested objects.
|
|
12
|
-
* This allows passing incomplete objects that will be merged with defaults.
|
|
13
|
-
*/
|
|
14
|
-
interface RecordingOptionsInput {
|
|
15
|
-
depth?: Partial<DepthCaptureOptions>;
|
|
16
|
-
images?: Partial<ImageCaptureOptions>;
|
|
17
|
-
arCrashIsolation?: Partial<ArCrashIsolationOptions>;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Diagnostic flags for isolating pre-recording AR startup crashes.
|
|
21
|
-
* These gates affect XR session negotiation and frame-loop behavior,
|
|
22
|
-
* independently of recording-time image/depth capture.
|
|
23
|
-
*/
|
|
24
|
-
interface ArCrashIsolationOptions {
|
|
25
|
-
enableDomOverlay: boolean;
|
|
26
|
-
enableCameraAccess: boolean;
|
|
27
|
-
enableDepthSensingFeature: boolean;
|
|
28
|
-
enableCss3dRenderer: boolean;
|
|
29
|
-
enableCameraTextureAcquisition: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Apply the Chromium WebXR camera-access tab-crash workaround at app
|
|
32
|
-
* bootstrap. The workaround always deletes
|
|
33
|
-
* `XRWebGLBinding.prototype.createProjectionLayer` /
|
|
34
|
-
* `XRRenderState.prototype.layers` (forcing `XRWebGLLayer`) — required on
|
|
35
|
-
* every affected Chrome build observed on-device, including Chrome 150 — and
|
|
36
|
-
* additionally persists the `baseLayer` across
|
|
37
|
-
* `XRSession.prototype.updateRenderState` only for Chrome builds inside the
|
|
38
|
-
* affected window (148.0.7778.12 up to 149.0.7821).
|
|
39
|
-
*
|
|
40
|
-
* Default `true`. Opt-out is offered because forcing `XRWebGLLayer` may break
|
|
41
|
-
* WebXR on unaffected (e.g. Quest) devices.
|
|
42
|
-
*
|
|
43
|
-
* @see GpsPlusSlamJs_AppFramework/src/ar/chromium-camera-access-workaround.ts
|
|
44
|
-
* @see https://github.com/mrdoob/three.js/issues/33404
|
|
45
|
-
*/
|
|
46
|
-
applyChromiumProjectionLayerWorkaround: boolean;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Configuration for depth sampling during recording.
|
|
50
|
-
*/
|
|
51
|
-
interface DepthCaptureOptions {
|
|
52
|
-
/** Whether to capture depth samples. Default: true */
|
|
53
|
-
enabled: boolean;
|
|
54
|
-
/** Interval between samples in milliseconds. Default: 1000 */
|
|
55
|
-
intervalMs: number;
|
|
56
|
-
/**
|
|
57
|
-
* Grid size (N×N points per sample). Default: 16 — dense enough to
|
|
58
|
-
* populate the AR-space occupancy grid (2026-06-11 port plan §1).
|
|
59
|
-
*/
|
|
60
|
-
gridSize: number;
|
|
61
|
-
/**
|
|
62
|
-
* Whether to enrich each depth point with the camera color at its view
|
|
63
|
-
* coordinates (RGB voxel coloring, occupancy-grid port plan Iter 8).
|
|
64
|
-
* Costs one small GPU blit+readback per sample (~1 Hz); when off, the
|
|
65
|
-
* occupancy cubes keep the height-based coloring. Default: true.
|
|
66
|
-
*/
|
|
67
|
-
rgb: boolean;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Configuration for image capture during recording.
|
|
71
|
-
*/
|
|
72
|
-
interface ImageCaptureOptions {
|
|
73
|
-
/** Whether to capture images. Default: true */
|
|
74
|
-
enabled: boolean;
|
|
75
|
-
/** Interval between captures in milliseconds. Default: 2000 */
|
|
76
|
-
intervalMs: number;
|
|
77
|
-
/** JPEG quality (0.0 - 1.0). Default: 0.7 */
|
|
78
|
-
quality: number;
|
|
79
|
-
/** Resolution divisor: 1 = full native resolution, 2 = half, 4 = quarter. Default: 1 */
|
|
80
|
-
resolutionDivisor: number;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* User-configurable recording options.
|
|
84
|
-
* Persisted to localStorage for cross-session consistency.
|
|
85
|
-
*/
|
|
86
|
-
interface RecordingOptions {
|
|
87
|
-
/** Depth sampling configuration */
|
|
88
|
-
depth: DepthCaptureOptions;
|
|
89
|
-
/** Image capture configuration */
|
|
90
|
-
images: ImageCaptureOptions;
|
|
91
|
-
/** Diagnostic flags for pre-recording AR crash isolation */
|
|
92
|
-
arCrashIsolation: ArCrashIsolationOptions;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* localStorage key for persisted options.
|
|
96
|
-
*
|
|
97
|
-
* **Multi-tab caveat:** All tabs/instances sharing the same origin will
|
|
98
|
-
* read and write this key. In multi-tab or embedded scenarios, concurrent
|
|
99
|
-
* saves can silently overwrite each other. Use a custom `storageKey`
|
|
100
|
-
* parameter in `loadRecordingOptions` / `saveRecordingOptions` to isolate
|
|
101
|
-
* instances when needed.
|
|
102
|
-
*/
|
|
103
|
-
declare const STORAGE_KEY = "gps-plus-slam-recorder-options";
|
|
104
|
-
/** Default recording options (all streams enabled) */
|
|
105
|
-
declare const DEFAULT_RECORDING_OPTIONS: RecordingOptions;
|
|
106
|
-
/** Validation constraints for depth options */
|
|
107
|
-
declare const DEPTH_CONSTRAINTS: {
|
|
108
|
-
readonly intervalMs: {
|
|
109
|
-
readonly min: 500;
|
|
110
|
-
readonly max: 5000;
|
|
111
|
-
readonly step: 100;
|
|
112
|
-
};
|
|
113
|
-
readonly gridSize: {
|
|
114
|
-
readonly min: 2;
|
|
115
|
-
readonly max: 32;
|
|
116
|
-
readonly step: 1;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
/** Validation constraints for image options */
|
|
120
|
-
declare const IMAGE_CONSTRAINTS: {
|
|
121
|
-
readonly intervalMs: {
|
|
122
|
-
readonly min: 1000;
|
|
123
|
-
readonly max: 10000;
|
|
124
|
-
readonly step: 500;
|
|
125
|
-
};
|
|
126
|
-
readonly quality: {
|
|
127
|
-
readonly min: 0.3;
|
|
128
|
-
readonly max: 1;
|
|
129
|
-
readonly step: 0.1;
|
|
130
|
-
};
|
|
131
|
-
readonly resolutionDivisor: {
|
|
132
|
-
readonly min: 1;
|
|
133
|
-
readonly max: 8;
|
|
134
|
-
readonly step: 1;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* Validate and normalize AR crash isolation flags.
|
|
139
|
-
* Missing or invalid values fall back to defaults.
|
|
140
|
-
*/
|
|
141
|
-
declare function validateArCrashIsolationOptions(options: Partial<ArCrashIsolationOptions>): ArCrashIsolationOptions;
|
|
142
|
-
/**
|
|
143
|
-
* Validate and normalize depth options.
|
|
144
|
-
* Invalid values are clamped to valid ranges.
|
|
145
|
-
*/
|
|
146
|
-
declare function validateDepthOptions(options: Partial<DepthCaptureOptions>): DepthCaptureOptions;
|
|
147
|
-
/**
|
|
148
|
-
* Validate and normalize image options.
|
|
149
|
-
* Invalid values are clamped to valid ranges.
|
|
150
|
-
*/
|
|
151
|
-
declare function validateImageOptions(options: Partial<ImageCaptureOptions>): ImageCaptureOptions;
|
|
152
|
-
/**
|
|
153
|
-
* Validate and normalize a full RecordingOptions object.
|
|
154
|
-
* Merges with defaults and clamps invalid values.
|
|
155
|
-
*/
|
|
156
|
-
declare function validateRecordingOptions(options: RecordingOptionsInput): RecordingOptions;
|
|
157
|
-
/**
|
|
158
|
-
* Load recording options from localStorage.
|
|
159
|
-
* Returns defaults if no saved options exist or parsing fails.
|
|
160
|
-
* Validates and merges with defaults to handle schema evolution.
|
|
161
|
-
* @param storageKey - Optional custom localStorage key (defaults to STORAGE_KEY).
|
|
162
|
-
*/
|
|
163
|
-
declare function loadRecordingOptions(storageKey?: string): RecordingOptions;
|
|
164
|
-
/**
|
|
165
|
-
* Save recording options to localStorage.
|
|
166
|
-
* Options are validated before saving.
|
|
167
|
-
* @param storageKey - Optional custom localStorage key (defaults to STORAGE_KEY).
|
|
168
|
-
*/
|
|
169
|
-
declare function saveRecordingOptions(options: RecordingOptions, storageKey?: string): void;
|
|
170
|
-
/**
|
|
171
|
-
* Reset recording options to defaults.
|
|
172
|
-
* Clears localStorage and returns default options.
|
|
173
|
-
* @param storageKey - Optional custom localStorage key (defaults to STORAGE_KEY).
|
|
174
|
-
*/
|
|
175
|
-
declare function resetRecordingOptions(storageKey?: string): RecordingOptions;
|
|
176
|
-
/**
|
|
177
|
-
* Create a deep copy of recording options.
|
|
178
|
-
* Useful for creating mutable copies of the frozen defaults.
|
|
179
|
-
*/
|
|
180
|
-
declare function cloneRecordingOptions(options: RecordingOptions): RecordingOptions;
|
|
181
|
-
//#endregion
|
|
182
|
-
export { validateRecordingOptions as _, IMAGE_CONSTRAINTS as a, RecordingOptionsInput as c, loadRecordingOptions as d, resetRecordingOptions as f, validateImageOptions as g, validateDepthOptions as h, DepthCaptureOptions as i, STORAGE_KEY as l, validateArCrashIsolationOptions as m, DEFAULT_RECORDING_OPTIONS as n, ImageCaptureOptions as o, saveRecordingOptions as p, DEPTH_CONSTRAINTS as r, RecordingOptions as s, ArCrashIsolationOptions as t, cloneRecordingOptions as u };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { i as DepthSample } from "./ar-types-Dan1MVTi.js";
|
|
2
|
-
import { s as RecordingOptions } from "./recording-options-DJBXuMxV.js";
|
|
3
|
-
import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
|
|
4
|
-
|
|
5
|
-
//#region ../src/state/recording-slice.d.ts
|
|
6
|
-
interface SessionMetadata {
|
|
7
|
-
scenarioName: string;
|
|
8
|
-
sessionName: string;
|
|
9
|
-
startTime: number;
|
|
10
|
-
deviceInfo?: string;
|
|
11
|
-
notes?: string;
|
|
12
|
-
/** Recording options used for this session (for replay context) */
|
|
13
|
-
recordingOptions?: RecordingOptions;
|
|
14
|
-
}
|
|
15
|
-
interface RecordingState {
|
|
16
|
-
isRecording: boolean;
|
|
17
|
-
sessionMetadata: SessionMetadata | null;
|
|
18
|
-
actionCount: number;
|
|
19
|
-
/**
|
|
20
|
-
* Count of failed file write operations during this session.
|
|
21
|
-
* User Feedback Issue #1 Part B: Track write failures for visibility.
|
|
22
|
-
*/
|
|
23
|
-
failedWriteCount: number;
|
|
24
|
-
/**
|
|
25
|
-
* The most recent depth sample, kept ONLY so subscribers can observe new
|
|
26
|
-
* samples via reference comparison (the AR-space occupancy grid is fed
|
|
27
|
-
* this way — see the 2026-06-11 occupancy-grid port plan). The persisted
|
|
28
|
-
* action stream remains the source of truth; no history is kept here.
|
|
29
|
-
* The payload stays in raw WebXR coordinates — conversion-free.
|
|
30
|
-
*/
|
|
31
|
-
latestDepthSample: DepthSample | null;
|
|
32
|
-
}
|
|
33
|
-
declare const startSession: _$_reduxjs_toolkit0.ActionCreatorWithPayload<SessionMetadata, "recording/startSession">, endSession: _$_reduxjs_toolkit0.ActionCreatorWithoutPayload<"recording/endSession">, recordDepthSample: _$_reduxjs_toolkit0.ActionCreatorWithPayload<DepthSample, "recording/recordDepthSample">, recordWriteFailure: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "recording/recordWriteFailure">;
|
|
34
|
-
declare const recordingReducer: _$_reduxjs_toolkit0.Reducer<RecordingState>;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { recordWriteFailure as a, recordDepthSample as i, SessionMetadata as n, recordingReducer as o, endSession as r, startSession as s, RecordingState as t };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { a as getCurrentScenarioHandle, c as resetForNewSession, d as startSession, f as verifyWriteAccess, h as writeSessionMetadata, i as ensureScenarioDirectory, l as resetStorageState, m as writeFrame, n as WriteAccessResult, o as initStorage, p as writeAction, r as clearRefPointsCacheForAllScenarios, s as listSessions, t as ClearRefPointsCacheResult, u as setCurrentScenario } from "../file-system-C_eqiEA8.js";
|
|
2
|
-
export { ClearRefPointsCacheResult, WriteAccessResult, clearRefPointsCacheForAllScenarios, ensureScenarioDirectory, getCurrentScenarioHandle, initStorage, listSessions, resetForNewSession, resetStorageState, setCurrentScenario, startSession, verifyWriteAccess, writeAction, writeFrame, writeSessionMetadata };
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import { createLogger } from "../utils/logger.js";
|
|
2
|
-
import { setFileSystemState } from "../sensors/permission-checker.js";
|
|
3
|
-
import { formatTimestamp } from "./file-system-utils.js";
|
|
4
|
-
import { createSession, getAppRootHandle, initOpfsStorage, listSessions as listSessions$1, resetOpfsStorage, resetSessionHandles, setSessionHandles, writeAction as writeAction$1, writeFrame as writeFrame$1, writeSessionMetadata as writeSessionMetadata$1 } from "./opfs-storage.js";
|
|
5
|
-
//#region ../src/storage/file-system.ts
|
|
6
|
-
/**
|
|
7
|
-
* File System Storage Module
|
|
8
|
-
*
|
|
9
|
-
* Facade over the OPFS storage module. Provides session lifecycle, write
|
|
10
|
-
* operations, and backwards-compatible scenario management for the recorder.
|
|
11
|
-
*
|
|
12
|
-
* The core OPFS module (opfs-storage.ts) is scenario-free — it manages
|
|
13
|
-
* flat sessions/{timestamp}/ directories. This module bridges the gap by
|
|
14
|
-
* managing scenario directory handles for consumers that still need them
|
|
15
|
-
* (recorder, ref-point loader, etc.) until those are migrated to
|
|
16
|
-
* ScenarioWrappingStorageBackend in later iterations.
|
|
17
|
-
*/
|
|
18
|
-
const log = createLogger("Storage");
|
|
19
|
-
let _currentScenarioName = null;
|
|
20
|
-
let storageInitialized = false;
|
|
21
|
-
let scenariosDir = null;
|
|
22
|
-
let currentScenarioHandle = null;
|
|
23
|
-
/**
|
|
24
|
-
* Reset module state - exported for testing only
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
function resetStorageState() {
|
|
28
|
-
_currentScenarioName = null;
|
|
29
|
-
storageInitialized = false;
|
|
30
|
-
scenariosDir = null;
|
|
31
|
-
currentScenarioHandle = null;
|
|
32
|
-
resetOpfsStorage();
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Reset session-level state for a new recording.
|
|
36
|
-
*
|
|
37
|
-
* Clears scenario/session names and OPFS session handles, but preserves
|
|
38
|
-
* `storageInitialized` and the OPFS root so `initStorage()` doesn't need
|
|
39
|
-
* to be called again.
|
|
40
|
-
*/
|
|
41
|
-
function resetForNewSession() {
|
|
42
|
-
_currentScenarioName = null;
|
|
43
|
-
currentScenarioHandle = null;
|
|
44
|
-
resetSessionHandles();
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Verify that we have actual write access to a directory.
|
|
48
|
-
*/
|
|
49
|
-
async function verifyWriteAccess(dirHandle) {
|
|
50
|
-
const testFilename = `.write-test-${Date.now()}`;
|
|
51
|
-
try {
|
|
52
|
-
const writable = await (await dirHandle.getFileHandle(testFilename, { create: true })).createWritable();
|
|
53
|
-
await writable.write("write-test");
|
|
54
|
-
await writable.close();
|
|
55
|
-
try {
|
|
56
|
-
await dirHandle.removeEntry(testFilename);
|
|
57
|
-
} catch (cleanupErr) {
|
|
58
|
-
log.warn("Write test cleanup failed (non-critical):", cleanupErr);
|
|
59
|
-
}
|
|
60
|
-
log.info("Write access verified for:", dirHandle.name);
|
|
61
|
-
return { success: true };
|
|
62
|
-
} catch (err) {
|
|
63
|
-
const error = err instanceof Error ? err : new Error(String(err));
|
|
64
|
-
log.error("Write verification failed:", error);
|
|
65
|
-
if (error.name === "NoModificationAllowedError") return {
|
|
66
|
-
success: false,
|
|
67
|
-
error: "Folder is read-only. Please select a different folder with write access."
|
|
68
|
-
};
|
|
69
|
-
return {
|
|
70
|
-
success: false,
|
|
71
|
-
error: `Cannot write to folder: ${error.message}`
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
async function ensureScenariosDir() {
|
|
76
|
-
if (scenariosDir) return scenariosDir;
|
|
77
|
-
const appRoot = getAppRootHandle();
|
|
78
|
-
if (!appRoot) return null;
|
|
79
|
-
scenariosDir = await appRoot.getDirectoryHandle("scenarios", { create: true });
|
|
80
|
-
return scenariosDir;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* List all scenario names in OPFS storage.
|
|
84
|
-
* Legacy: scenarios are managed by the recorder, not the framework.
|
|
85
|
-
*/
|
|
86
|
-
async function listScenarios() {
|
|
87
|
-
const dir = await ensureScenariosDir();
|
|
88
|
-
if (!dir) return [];
|
|
89
|
-
const scenarios = [];
|
|
90
|
-
for await (const entry of dir.values()) if (entry.kind === "directory") scenarios.push(entry.name);
|
|
91
|
-
return scenarios;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Initialize storage using OPFS.
|
|
95
|
-
*
|
|
96
|
-
* @returns List of existing scenario folder names
|
|
97
|
-
* @throws Error if OPFS is not supported
|
|
98
|
-
*/
|
|
99
|
-
async function initStorage() {
|
|
100
|
-
try {
|
|
101
|
-
await initOpfsStorage();
|
|
102
|
-
storageInitialized = true;
|
|
103
|
-
setFileSystemState({
|
|
104
|
-
folderSelected: true,
|
|
105
|
-
writeVerified: true
|
|
106
|
-
});
|
|
107
|
-
await ensureScenariosDir();
|
|
108
|
-
const scenarios = await listScenarios();
|
|
109
|
-
log.info("OPFS storage initialized, found scenarios:", scenarios);
|
|
110
|
-
return scenarios;
|
|
111
|
-
} catch (err) {
|
|
112
|
-
const error = err instanceof Error ? err : new Error(String(err));
|
|
113
|
-
log.error("OPFS initialization failed:", error);
|
|
114
|
-
setFileSystemState({
|
|
115
|
-
folderSelected: false,
|
|
116
|
-
writeVerified: false,
|
|
117
|
-
writeError: error.message
|
|
118
|
-
});
|
|
119
|
-
throw error;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Create a new session folder.
|
|
124
|
-
*
|
|
125
|
-
* When scenarioName is provided, creates under the scenario directory
|
|
126
|
-
* (legacy scenario layout for the recorder). When omitted, creates under
|
|
127
|
-
* the flat sessions/ directory.
|
|
128
|
-
*
|
|
129
|
-
* @param scenarioName - Optional name of the scenario (omit for flat layout)
|
|
130
|
-
*/
|
|
131
|
-
async function startSession(scenarioName) {
|
|
132
|
-
if (!storageInitialized) throw new Error("Storage not initialized. Call initStorage first.");
|
|
133
|
-
if (scenarioName) {
|
|
134
|
-
const dir = await ensureScenariosDir();
|
|
135
|
-
if (!dir) throw new Error("Failed to access scenarios directory.");
|
|
136
|
-
const scenarioHandle = await dir.getDirectoryHandle(scenarioName, { create: true });
|
|
137
|
-
currentScenarioHandle = scenarioHandle;
|
|
138
|
-
const sessionName = `recording-${formatTimestamp(/* @__PURE__ */ new Date())}`;
|
|
139
|
-
const sessionHandle = await scenarioHandle.getDirectoryHandle(sessionName, { create: true });
|
|
140
|
-
setSessionHandles(sessionHandle, await sessionHandle.getDirectoryHandle("actions", { create: true }), await sessionHandle.getDirectoryHandle("frames", { create: true }));
|
|
141
|
-
_currentScenarioName = scenarioName;
|
|
142
|
-
log.info("Session started:", `${scenarioName}/${sessionName}`);
|
|
143
|
-
return {
|
|
144
|
-
scenarioPath: scenarioName,
|
|
145
|
-
sessionPath: sessionName
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
const result = await createSession(/* @__PURE__ */ new Date());
|
|
149
|
-
_currentScenarioName = "";
|
|
150
|
-
result.sessionName;
|
|
151
|
-
log.info("Session started:", result.sessionName);
|
|
152
|
-
return {
|
|
153
|
-
scenarioPath: "",
|
|
154
|
-
sessionPath: result.sessionName
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* List all session names.
|
|
159
|
-
* When scenarioName is provided, lists sessions under that scenario.
|
|
160
|
-
* Otherwise lists flat sessions.
|
|
161
|
-
*/
|
|
162
|
-
async function listSessions(scenarioName) {
|
|
163
|
-
if (scenarioName) {
|
|
164
|
-
const dir = await ensureScenariosDir();
|
|
165
|
-
if (!dir) return [];
|
|
166
|
-
try {
|
|
167
|
-
const scenarioHandle = await dir.getDirectoryHandle(scenarioName);
|
|
168
|
-
const sessions = [];
|
|
169
|
-
for await (const entry of scenarioHandle.values()) if (entry.kind === "directory") sessions.push(entry.name);
|
|
170
|
-
return sessions;
|
|
171
|
-
} catch {
|
|
172
|
-
return [];
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
return listSessions$1();
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Write a Redux action to OPFS as a JSON file.
|
|
179
|
-
*/
|
|
180
|
-
async function writeAction(action, index) {
|
|
181
|
-
await writeAction$1(action, index);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Write a captured frame image to OPFS.
|
|
185
|
-
*/
|
|
186
|
-
async function writeFrame(blob, index) {
|
|
187
|
-
await writeFrame$1(blob, index);
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Write session metadata (session.json) to OPFS.
|
|
191
|
-
*/
|
|
192
|
-
async function writeSessionMetadata(metadata) {
|
|
193
|
-
await writeSessionMetadata$1(metadata);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Get the current scenario handle (for loading prior sessions).
|
|
197
|
-
* Legacy: uses scenario directory layout.
|
|
198
|
-
*/
|
|
199
|
-
function getCurrentScenarioHandle() {
|
|
200
|
-
if (!_currentScenarioName) return null;
|
|
201
|
-
return currentScenarioHandle;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Set the current scenario handle (when user selects a scenario).
|
|
205
|
-
* Legacy: uses scenario directory layout.
|
|
206
|
-
*/
|
|
207
|
-
async function setCurrentScenario(scenarioName) {
|
|
208
|
-
const scenRoot = await ensureScenariosDir();
|
|
209
|
-
if (!scenRoot) return null;
|
|
210
|
-
try {
|
|
211
|
-
const handle = await scenRoot.getDirectoryHandle(scenarioName);
|
|
212
|
-
_currentScenarioName = scenarioName;
|
|
213
|
-
currentScenarioHandle = handle;
|
|
214
|
-
return handle;
|
|
215
|
-
} catch {
|
|
216
|
-
log.warn("Scenario not found:", scenarioName);
|
|
217
|
-
return null;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Ensure a scenario directory exists in OPFS, creating it if necessary.
|
|
222
|
-
* Legacy: used during OPFS recovery.
|
|
223
|
-
*/
|
|
224
|
-
async function ensureScenarioDirectory(scenarioName) {
|
|
225
|
-
const scenRoot = await ensureScenariosDir();
|
|
226
|
-
if (!scenRoot) return null;
|
|
227
|
-
try {
|
|
228
|
-
const handle = await scenRoot.getDirectoryHandle(scenarioName, { create: true });
|
|
229
|
-
_currentScenarioName = scenarioName;
|
|
230
|
-
currentScenarioHandle = handle;
|
|
231
|
-
return handle;
|
|
232
|
-
} catch (err) {
|
|
233
|
-
log.error("Failed to create scenario directory:", err);
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Clear the cached `refPoints/` directory for every scenario in OPFS.
|
|
239
|
-
*
|
|
240
|
-
* Used by the "Clear Reference Point Cache" maintenance action so that the
|
|
241
|
-
* next scenario load re-imports ref points from the read folder's `*.zip`
|
|
242
|
-
* recordings (see ref-point-recovery in the recorder app).
|
|
243
|
-
*
|
|
244
|
-
* Failures for individual scenarios are collected in `errors` rather than
|
|
245
|
-
* aborting the whole operation — partial progress is still useful.
|
|
246
|
-
*
|
|
247
|
-
* @throws Error if OPFS storage is unavailable (e.g. `initStorage()` not yet
|
|
248
|
-
* called, or browser does not support OPFS). Surfacing this loudly avoids
|
|
249
|
-
* reporting a silent "0 scenarios cleared" success that would mask the
|
|
250
|
-
* real failure to the user.
|
|
251
|
-
*/
|
|
252
|
-
async function clearRefPointsCacheForAllScenarios() {
|
|
253
|
-
const dir = await ensureScenariosDir();
|
|
254
|
-
if (!dir) throw new Error("clearRefPointsCacheForAllScenarios: OPFS scenarios directory is unavailable — call initStorage() first or check OPFS support");
|
|
255
|
-
const errors = [];
|
|
256
|
-
let scenariosCleared = 0;
|
|
257
|
-
let scenariosScanned = 0;
|
|
258
|
-
const scenarios = await listScenarios();
|
|
259
|
-
for (const scenarioName of scenarios) {
|
|
260
|
-
scenariosScanned++;
|
|
261
|
-
try {
|
|
262
|
-
const handle = await dir.getDirectoryHandle(scenarioName);
|
|
263
|
-
if (!handle) continue;
|
|
264
|
-
try {
|
|
265
|
-
await handle.removeEntry("refPoints", { recursive: true });
|
|
266
|
-
scenariosCleared++;
|
|
267
|
-
} catch (err) {
|
|
268
|
-
if ((err instanceof Error ? err.name : String(err?.name)) === "NotFoundError") continue;
|
|
269
|
-
errors.push({
|
|
270
|
-
scenarioName,
|
|
271
|
-
reason: err instanceof Error ? err.message : String(err)
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
} catch (err) {
|
|
275
|
-
errors.push({
|
|
276
|
-
scenarioName,
|
|
277
|
-
reason: err instanceof Error ? err.message : String(err)
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
log.info(`Cleared ref-point cache for ${scenariosCleared}/${scenariosScanned} scenarios (${errors.length} errors)`);
|
|
282
|
-
return {
|
|
283
|
-
scenariosCleared,
|
|
284
|
-
scenariosScanned,
|
|
285
|
-
errors
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
//#endregion
|
|
289
|
-
export { clearRefPointsCacheForAllScenarios, ensureScenarioDirectory, getCurrentScenarioHandle, initStorage, listSessions, resetForNewSession, resetStorageState, setCurrentScenario, startSession, verifyWriteAccess, writeAction, writeFrame, writeSessionMetadata };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{capture-failure-tracker-CUeU3L_M.d.ts → capture-failure-tracker-BL5SoG2a.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|