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.
Files changed (131) hide show
  1. package/dist/{app-selectors-DyMzxCEC.d.ts → app-selectors-CHt7DLuq.d.ts} +9 -8
  2. package/dist/ar/depth-sampler.js +1 -1
  3. package/dist/ar/tracking-state.js +1 -1
  4. package/dist/ar/webxr-session.js +1 -1
  5. package/dist/combined-root-state-B3SvPNjU.d.ts +6 -0
  6. package/dist/core/index.d.ts +2 -0
  7. package/dist/core/index.js +2 -0
  8. package/dist/create-slam-app-store-DBm7g2Zd.d.ts +85 -0
  9. package/dist/file-system-DD5TczSO.d.ts +84 -0
  10. package/dist/geo/h3-proximity.d.ts +2 -0
  11. package/dist/{ref-points/h3-ref-point.js → geo/h3-proximity.js} +16 -12
  12. package/dist/geo/index.d.ts +2 -0
  13. package/dist/geo/index.js +2 -0
  14. package/dist/gps-anchored-mesh-manager-CovAFK4g.d.ts +56 -0
  15. package/dist/gps-ar-pose-sampler-D_Zso40V.d.ts +43 -0
  16. package/dist/{recording-coordinator-DzflP07_.d.ts → gps-event-coordinator-fwvmVfku.d.ts} +6 -5
  17. package/dist/{h3-ref-point-CFhayNSZ.d.ts → h3-proximity-GwesPTFT.d.ts} +16 -12
  18. package/dist/index.d.ts +31 -34
  19. package/dist/index.js +14 -19
  20. package/dist/{leaflet-map-overlay-CvfQXTye.d.ts → leaflet-map-overlay-CQZcnxbc.d.ts} +10 -6
  21. package/dist/licensing/index.d.ts +1 -1
  22. package/dist/licensing/index.js +1 -1
  23. package/dist/{null-storage-backend-CsWvQwN8.d.ts → null-storage-backend-C0TiwwzQ.d.ts} +4 -2
  24. package/dist/{opfs-storage-ChOzF_Wp.d.ts → opfs-storage-Dlq1I_Gb.d.ts} +54 -51
  25. package/dist/opfs-storage-backend-Gt3rd76D.d.ts +13 -0
  26. package/dist/{persistence-middleware-DrptY02i.d.ts → persistence-middleware-z-75iisb.d.ts} +4 -4
  27. package/dist/{recording-replayer-oOzPITrd.d.ts → recording-replayer-BFhFs7Mc.d.ts} +2 -2
  28. package/dist/recording-slice-BiktUIWF.d.ts +28 -0
  29. package/dist/{replay-engine-DuX316ae.d.ts → replay-engine-B88Va62x.d.ts} +4 -1
  30. package/dist/sensors/gps-error-handler.d.ts +1 -1
  31. package/dist/sensors/gps.d.ts +1 -1
  32. package/dist/sensors/index.d.ts +3 -3
  33. package/dist/sensors/index.js +1 -1
  34. package/dist/sensors/permission-checker.d.ts +1 -1
  35. package/dist/state/app-selectors.d.ts +1 -1
  36. package/dist/state/create-slam-app-store.d.ts +2 -0
  37. package/dist/state/create-slam-app-store.js +61 -0
  38. package/dist/state/gps-ar-pose-sampler.d.ts +4 -0
  39. package/dist/state/gps-ar-pose-sampler.js +19 -0
  40. package/dist/state/{recording-coordinator.d.ts → gps-event-coordinator.d.ts} +1 -1
  41. package/dist/state/{recording-coordinator.js → gps-event-coordinator.js} +3 -4
  42. package/dist/state/index.d.ts +15 -16
  43. package/dist/state/index.js +7 -7
  44. package/dist/state/persistence-middleware.d.ts +1 -1
  45. package/dist/state/persistence-middleware.js +8 -8
  46. package/dist/state/recording-replayer.d.ts +3 -2
  47. package/dist/state/recording-replayer.js +2 -2
  48. package/dist/state/recording-slice.d.ts +2 -0
  49. package/dist/state/{recorder-slice.js → recording-slice.js} +7 -15
  50. package/dist/state/replay-engine.d.ts +1 -1
  51. package/dist/state/replay-engine.js +3 -3
  52. package/dist/state/store-subscribers.d.ts +2 -2
  53. package/dist/state/store-subscribers.js +1 -9
  54. package/dist/state/subscribe-to-selector.d.ts +1 -1
  55. package/dist/storage/file-system-utils.d.ts +1 -1
  56. package/dist/storage/file-system.d.ts +2 -2
  57. package/dist/storage/file-system.js +103 -94
  58. package/dist/storage/index.d.ts +9 -11
  59. package/dist/storage/index.js +5 -7
  60. package/dist/storage/null-storage-backend.d.ts +1 -1
  61. package/dist/storage/null-storage-backend.js +7 -0
  62. package/dist/storage/opfs-storage-backend.d.ts +1 -1
  63. package/dist/storage/opfs-storage-backend.js +7 -1
  64. package/dist/storage/opfs-storage.d.ts +2 -2
  65. package/dist/storage/opfs-storage.js +69 -85
  66. package/dist/storage/storage-backend.d.ts +2 -2
  67. package/dist/storage/zip-export.d.ts +2 -2
  68. package/dist/storage/zip-export.js +55 -62
  69. package/dist/storage/zip-reader.d.ts +2 -2
  70. package/dist/storage/zip-reader.js +24 -1
  71. package/dist/storage-backend-yVnuWGTr.d.ts +28 -0
  72. package/dist/{store-subscribers-CuoIzB5T.d.ts → store-subscribers-DKKHld49.d.ts} +1 -2
  73. package/dist/{subscribe-to-selector-UTZ0KkAc.d.ts → subscribe-to-selector-ghDKYtap.d.ts} +1 -1
  74. package/dist/test-utils/zip-round-trip-helpers.d.ts +1 -1
  75. package/dist/test-utils/zip-round-trip-helpers.js +4 -4
  76. package/dist/visualization/gps-anchored-mesh-manager.d.ts +2 -0
  77. package/dist/visualization/gps-anchored-mesh-manager.js +128 -0
  78. package/dist/visualization/gps-compass-cubes.d.ts +1 -1
  79. package/dist/visualization/gps-event-markers.d.ts +1 -1
  80. package/dist/visualization/index.d.ts +9 -9
  81. package/dist/visualization/index.js +2 -2
  82. package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
  83. package/dist/visualization/leaflet-map-overlay.js +23 -19
  84. package/dist/visualization/lerp-utils.d.ts +1 -1
  85. package/dist/visualization/map-overlay.d.ts +1 -1
  86. package/dist/visualization/three-dispose.d.ts +1 -1
  87. package/dist/visualization/vis-colors.d.ts +1 -1
  88. package/dist/{zip-export-Rtpi75JJ.d.ts → zip-export-BjrQPv0X.d.ts} +58 -7
  89. package/dist/{zip-reader-D7pkpX8K.d.ts → zip-reader-KgJEXbca.d.ts} +33 -1
  90. package/package.json +15 -4
  91. package/dist/community-license-key-ChZLCJyO.d.ts +0 -21
  92. package/dist/file-system-BsQgYCU3.d.ts +0 -128
  93. package/dist/licensing/community-license-key.d.ts +0 -2
  94. package/dist/licensing/community-license-key.js +0 -21
  95. package/dist/opfs-storage-backend-CVcmfJHN.d.ts +0 -11
  96. package/dist/recorder-slice-fcwAXrsh.d.ts +0 -35
  97. package/dist/ref-point-importer-B_wn5ABk.d.ts +0 -62
  98. package/dist/ref-point-loader-Pt1smgHS.d.ts +0 -117
  99. package/dist/ref-points/h3-ref-point.d.ts +0 -2
  100. package/dist/ref-points/index.d.ts +0 -2
  101. package/dist/ref-points/index.js +0 -2
  102. package/dist/ref-points-slice-tC-Wd6XJ.d.ts +0 -48
  103. package/dist/reference-points-CFWy8_wj.d.ts +0 -68
  104. package/dist/routing-slice-BlHTM8eh.d.ts +0 -23
  105. package/dist/state/recorder-slice.d.ts +0 -2
  106. package/dist/state/ref-points-slice.d.ts +0 -2
  107. package/dist/state/ref-points-slice.js +0 -44
  108. package/dist/state/routing-slice.d.ts +0 -2
  109. package/dist/state/routing-slice.js +0 -13
  110. package/dist/state/store.d.ts +0 -9
  111. package/dist/state/store.js +0 -71
  112. package/dist/storage/ref-point-importer.d.ts +0 -2
  113. package/dist/storage/ref-point-importer.js +0 -163
  114. package/dist/storage/ref-point-loader.d.ts +0 -2
  115. package/dist/storage/ref-point-loader.js +0 -248
  116. package/dist/storage/ref-point-recovery.d.ts +0 -28
  117. package/dist/storage/ref-point-recovery.js +0 -159
  118. package/dist/storage-backend-BcEItnFr.d.ts +0 -20
  119. package/dist/store-C7PKOj8S.d.ts +0 -96
  120. package/dist/visualization/reference-points.d.ts +0 -2
  121. package/dist/visualization/reference-points.js +0 -160
  122. /package/dist/{file-system-utils-5cWO8Xyv.d.ts → file-system-utils-BH8FdyIu.d.ts} +0 -0
  123. /package/dist/{gps-Ddzr2KlX.d.ts → gps-GKc6_Cly.d.ts} +0 -0
  124. /package/dist/{gps-compass-cubes-C-6JEnpR.d.ts → gps-compass-cubes-jRIJMOuh.d.ts} +0 -0
  125. /package/dist/{gps-error-handler-VPuNOuf8.d.ts → gps-error-handler-CH1S528z.d.ts} +0 -0
  126. /package/dist/{gps-event-markers-DpEy2qRd.d.ts → gps-event-markers-sVyO9utS.d.ts} +0 -0
  127. /package/dist/{lerp-utils-87NWjUOD.d.ts → lerp-utils-CZgQlrmu.d.ts} +0 -0
  128. /package/dist/{map-overlay-DuiZuCTx.d.ts → map-overlay-C9ifl_4-.d.ts} +0 -0
  129. /package/dist/{permission-checker-jO2ziCWC.d.ts → permission-checker-Cu3nbH1S.d.ts} +0 -0
  130. /package/dist/{three-dispose-CCBHjE_a.d.ts → three-dispose-qt_r5wR1.d.ts} +0 -0
  131. /package/dist/{vis-colors-Qi2vlRGt.d.ts → vis-colors-BKkdTIKb.d.ts} +0 -0
@@ -28,6 +28,55 @@ interface ZipExportResult {
28
28
  /** Number of files packaged in the ZIP */
29
29
  readonly fileCount: number;
30
30
  }
31
+ /**
32
+ * Helper passed to a {@link ZipExportContributor.contribute} callback for
33
+ * appending blobs to the ZIP under a stable, contributor-owned subdirectory.
34
+ *
35
+ * The framework prepends the contributor's `subdir` to the supplied
36
+ * `relativePath` automatically, so contributors only think in terms of paths
37
+ * relative to their own subdir (e.g. `'42.json'`, not `'refPoints/42.json'`).
38
+ */
39
+ type ZipContributorAddFile = (relativePath: string, blob: Blob) => Promise<void>;
40
+ /**
41
+ * Extension contributor that lets a consumer (typically the recorder)
42
+ * append app-specific files to a session ZIP without forking the
43
+ * framework's ZIP writer.
44
+ *
45
+ * Each contributor declares a top-level subdirectory it owns inside the
46
+ * ZIP (e.g. the recorder uses `refPoints/`). The framework calls
47
+ * {@link contribute} after writing all framework-owned sections.
48
+ *
49
+ * Contributors must:
50
+ * - Only write files under their declared `subdir` (the framework enforces
51
+ * this by routing every `addFile` call through the prefix).
52
+ * - Tolerate an empty source (e.g. a session with no ref points) by
53
+ * returning `0` instead of throwing.
54
+ *
55
+ * @see 2026-05-03-appframework-vs-recorderapp-boundary-analysis.md — Iter 2.
56
+ */
57
+ interface ZipExportContributor {
58
+ /** Top-level subdirectory inside the ZIP (no leading or trailing `/`). */
59
+ readonly subdir: string;
60
+ /**
61
+ * Append files for this contributor. Implementations call `addFile`
62
+ * once per file with a path relative to {@link subdir}.
63
+ *
64
+ * @returns Number of files added so the framework's `fileCount` total
65
+ * stays accurate for download summaries.
66
+ */
67
+ contribute(addFile: ZipContributorAddFile): Promise<number>;
68
+ }
69
+ /**
70
+ * Options for {@link exportSessionAsZip}.
71
+ */
72
+ interface ExportSessionAsZipOptions {
73
+ /**
74
+ * Optional list of {@link ZipExportContributor}s. Each is invoked after
75
+ * framework-owned sections have been written. Order is preserved in the
76
+ * resulting ZIP central directory but has no semantic effect.
77
+ */
78
+ readonly contributors?: readonly ZipExportContributor[];
79
+ }
31
80
  /**
32
81
  * Export a session from OPFS as a ZIP blob.
33
82
  *
@@ -35,16 +84,18 @@ interface ZipExportResult {
35
84
  * - session.json (at root)
36
85
  * - actions/000001.json, actions/000002.json, ...
37
86
  * - frames/frame-000001.jpg, frames/frame-000002.jpg, ...
38
- * - refPoints/{h3}.json (only observations from this session)
87
+ * - refPoints/{h3}.json (only observations from this session, scenario layout only)
39
88
  *
40
89
  * Uses "store" mode (compression level 0) for fast packaging.
41
90
  *
42
- * @param scenarioName - Name of the scenario
43
- * @param sessionName - Name of the session folder
91
+ * Supports both flat and scenario-based layouts:
92
+ * - `exportSessionAsZip(sessionName)` flat layout (sessions/)
93
+ * - `exportSessionAsZip(scenarioName, sessionName)` — scenario layout (scenarios/{name}/)
94
+ *
44
95
  * @returns ZIP export result with blob and file count
45
- * @throws Error if scenario or session not found
96
+ * @throws Error if session not found
46
97
  */
47
- declare function exportSessionAsZip(scenarioName: string, sessionName: string): Promise<ZipExportResult>;
98
+ declare function exportSessionAsZip(scenarioNameOrSessionName: string, sessionName?: string, options?: ExportSessionAsZipOptions): Promise<ZipExportResult>;
48
99
  /**
49
100
  * Sync current OPFS session data to an external file handle.
50
101
  *
@@ -63,7 +114,7 @@ declare function exportSessionAsZip(scenarioName: string, sessionName: string):
63
114
  * @returns ZIP export result with blob and file count
64
115
  * @throws Error if scenario or session not found
65
116
  */
66
- declare function syncToExternalZip(fileHandle: FileSystemFileHandle, scenarioName: string, sessionName: string): Promise<ZipExportResult>;
117
+ declare function syncToExternalZip(fileHandle: FileSystemFileHandle, scenarioName: string, sessionName: string, options?: ExportSessionAsZipOptions): Promise<ZipExportResult>;
67
118
  /**
68
119
  * Trigger a file download in the browser.
69
120
  *
@@ -84,4 +135,4 @@ declare function downloadZip(blob: Blob, filename: string): Promise<void>;
84
135
  */
85
136
  declare function exportAndDownloadSession(scenarioName: string, sessionName: string): Promise<void>;
86
137
  //#endregion
87
- export { syncToExternalZip as a, exportSessionAsZip as i, downloadZip as n, exportAndDownloadSession as r, ZipExportResult as t };
138
+ export { downloadZip as a, syncToExternalZip as c, ZipExportResult as i, ZipContributorAddFile as n, exportAndDownloadSession as o, ZipExportContributor as r, exportSessionAsZip as s, ExportSessionAsZipOptions as t };
@@ -93,5 +93,37 @@ interface GpsPathCoord {
93
93
  * @returns Array of GPS coordinates in chronological order
94
94
  */
95
95
  declare function loadGpsPathFromBlob(blob: Blob, maxFileSize?: number): Promise<GpsPathCoord[]>;
96
+ /**
97
+ * A single file pulled out of a contributor-owned subdirectory inside a
98
+ * recording zip. Returned by {@link loadEntriesFromSubdir}.
99
+ *
100
+ * `getText()` is lazy: callers pay the decompression cost only for files they
101
+ * actually open, so iterating an entire `refPoints/` subdir to harvest a few
102
+ * entries stays cheap.
103
+ */
104
+ interface ZipSubdirEntry {
105
+ /** Filename relative to the subdir (e.g. `'42.json'`, not `'refPoints/42.json'`). */
106
+ readonly relativePath: string;
107
+ /** Original full filename inside the ZIP (`'refPoints/42.json'`). */
108
+ readonly fullPath: string;
109
+ /** Uncompressed size in bytes. */
110
+ readonly uncompressedSize: number;
111
+ /** Lazily decode the entry as UTF-8 text. */
112
+ getText(): Promise<string>;
113
+ }
114
+ /**
115
+ * Enumerate every file under a single top-level subdirectory of a recording
116
+ * zip. Mirrors the writer-side {@link ZipExportContributor} seam so consumers
117
+ * (typically the recorder) can read back what they wrote without
118
+ * re-implementing zip enumeration.
119
+ *
120
+ * Skips directory entries and files outside `subdir`. Sorts entries by
121
+ * `relativePath` for deterministic iteration. Returns an empty array when
122
+ * the subdir is absent (graceful degradation for older zips).
123
+ *
124
+ * @param data - The zip file content as a Uint8Array
125
+ * @param subdir - Top-level subdir to scan (no leading or trailing `/`)
126
+ */
127
+ declare function loadEntriesFromSubdir(data: Uint8Array, subdir: string): Promise<ZipSubdirEntry[]>;
96
128
  //#endregion
97
- export { ZipActionEntry as a, loadSessionMetadata as c, RecordedAction as i, loadSessionMetadataFromBlob as l, GpsPathCoord as n, loadActionsFromZip as o, MAX_ACTION_FILE_SIZE as r, loadGpsPathFromBlob as s, Entry$1 as t, readZipEntries as u };
129
+ export { ZipActionEntry as a, loadEntriesFromSubdir as c, loadSessionMetadataFromBlob as d, readZipEntries as f, RecordedAction as i, loadGpsPathFromBlob as l, GpsPathCoord as n, ZipSubdirEntry as o, MAX_ACTION_FILE_SIZE as r, loadActionsFromZip as s, Entry$1 as t, loadSessionMetadata as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gps-plus-slam-app-framework",
3
- "version": "1.0.0",
3
+ "version": "1.0.6",
4
4
  "description": "Reusable AR+GPS app framework layer — WebXR session management, Three.js visualization, GPS sensors, storage abstractions, replay engine, and store wiring for gps-plus-slam-js.",
5
5
  "type": "module",
6
6
  "files": [
@@ -10,14 +10,15 @@
10
10
  ".": "./dist/index.js",
11
11
  "./ar": "./dist/ar/index.js",
12
12
  "./ar/*": "./dist/ar/*.js",
13
+ "./core": "./dist/core/index.js",
13
14
  "./sensors": "./dist/sensors/index.js",
14
15
  "./sensors/*": "./dist/sensors/*.js",
15
16
  "./state": "./dist/state/index.js",
16
17
  "./state/*": "./dist/state/*.js",
17
18
  "./storage": "./dist/storage/index.js",
18
19
  "./storage/*": "./dist/storage/*.js",
19
- "./ref-points": "./dist/ref-points/index.js",
20
- "./ref-points/*": "./dist/ref-points/*.js",
20
+ "./geo": "./dist/geo/index.js",
21
+ "./geo/*": "./dist/geo/*.js",
21
22
  "./visualization": "./dist/visualization/index.js",
22
23
  "./visualization/*": "./dist/visualization/*.js",
23
24
  "./utils": "./dist/utils/index.js",
@@ -35,7 +36,7 @@
35
36
  "dependencies": {
36
37
  "@reduxjs/toolkit": "^2.11.2",
37
38
  "gl-matrix": "3.4.4",
38
- "gps-plus-slam-js": "^1.0.0"
39
+ "gps-plus-slam-js": "^1.0.6"
39
40
  },
40
41
  "peerDependencies": {
41
42
  "@sentry/browser": ">=10.0.0",
@@ -86,6 +87,15 @@
86
87
  ],
87
88
  "author": "cs-util-com",
88
89
  "license": "Apache-2.0",
90
+ "repository": {
91
+ "type": "git",
92
+ "url": "https://github.com/cs-util-com/location-based-webxr.git",
93
+ "directory": "GpsPlusSlamJs_AppFramework"
94
+ },
95
+ "homepage": "https://github.com/cs-util-com/location-based-webxr#readme",
96
+ "bugs": {
97
+ "url": "https://github.com/cs-util-com/location-based-webxr/issues"
98
+ },
89
99
  "scripts": {
90
100
  "test": "pnpm run test:core",
91
101
  "test:core": "pnpm run format && pnpm run lint && pnpm run typecheck && pnpm run typecheck:tests && pnpm run test:unit",
@@ -93,6 +103,7 @@
93
103
  "format:check": "prettier --check --ignore-unknown .",
94
104
  "build": "tsdown --config config/tsdown.config.ts",
95
105
  "verify:pack": "pnpm pack --dry-run",
106
+ "verify:community-key-lifetime": "node scripts/verify-community-key-lifetime.mjs",
96
107
  "test:unit": "vitest run --coverage --config config/vitest.config.ts",
97
108
  "typecheck": "tsc -p tsconfig.json --noEmit",
98
109
  "typecheck:tests": "tsc -p tsconfig.vitest.json --noEmit",
@@ -1,21 +0,0 @@
1
- //#region ../src/licensing/community-license-key.d.ts
2
- /**
3
- * Community license key for the gps-plus-slam-js core library.
4
- *
5
- * Generated by the core library maintainers and bundled with the open-source
6
- * `gps-plus-slam-app-framework` package so that every example app (and any
7
- * downstream app built on the framework) automatically uses a valid license
8
- * without per-developer registration.
9
- *
10
- * The key has a rolling expiration of 12 months. Each release of the
11
- * open-source packages renews it. Active users who regularly update their
12
- * dependencies will never be affected by the expiration.
13
- *
14
- * For licenses with extended validity beyond the community key's scope,
15
- * contact support@csutil.com.
16
- *
17
- * @see GpsPlusSlamJs/EULA.md §3 — License Key
18
- */
19
- declare const COMMUNITY_LICENSE_KEY = "eyJ0eXBlIjoiY29tbXVuaXR5IiwiZXhwIjoxODA4NzcyNDI3fQ.YYNf0IdqniZdMzRXCuvewxsQQ01XNywrKsfL5IpiJotfFJfqtrGg4u9z0QFhXeszPtUhnvgC8_oOnbOkbXPuAw";
20
- //#endregion
21
- export { COMMUNITY_LICENSE_KEY as t };
@@ -1,128 +0,0 @@
1
- import { n as ArPoseTuples } from "./ar-types-B-ORgk6Z.js";
2
- import { n as SessionMetadata } from "./opfs-storage-ChOzF_Wp.js";
3
- import { LatLongAlt } from "gps-plus-slam-js";
4
-
5
- //#region ../src/storage/file-system.d.ts
6
- /**
7
- * Reset module state - exported for testing only
8
- * @internal
9
- */
10
- declare function resetStorageState(): void;
11
- /**
12
- * Reset session-level state for a new recording.
13
- *
14
- * Clears scenario/session names and OPFS session handles, but preserves
15
- * `storageInitialized` and the OPFS root so `initStorage()` doesn't need
16
- * to be called again.
17
- *
18
- * Used during soft reset for new recordings (Issue 4, 2026-02-06 user feedback).
19
- */
20
- declare function resetForNewSession(): void;
21
- /**
22
- * Result of write access verification.
23
- */
24
- interface WriteAccessResult {
25
- /** Whether write access was successfully verified */
26
- success: boolean;
27
- /** Error message if write verification failed */
28
- error?: string;
29
- }
30
- /**
31
- * Verify that we have actual write access to a directory.
32
- *
33
- * This probes the directory by creating a test file, writing content,
34
- * and cleaning up. This catches cases where showDirectoryPicker grants
35
- * a handle but the underlying file system is read-only.
36
- *
37
- * User Feedback Issue #1: Even with mode: 'readwrite', Android can
38
- * return a handle where getFileHandle({create: true}) succeeds but
39
- * createWritable() fails with NoModificationAllowedError.
40
- *
41
- * @param dirHandle - Directory handle to verify
42
- * @returns Success status and optional error message
43
- */
44
- declare function verifyWriteAccess(dirHandle: FileSystemDirectoryHandle): Promise<WriteAccessResult>;
45
- /**
46
- * Initialize storage using OPFS.
47
- *
48
- * This replaces the old showDirectoryPicker approach which failed on Android Chrome.
49
- * OPFS is automatically available and doesn't require user folder selection.
50
- *
51
- * @returns List of existing scenario folder names
52
- * @throws Error if OPFS is not supported
53
- */
54
- declare function initStorage(): Promise<string[]>;
55
- /**
56
- * Create or open a scenario folder, then create a new session folder.
57
- *
58
- * Now uses OPFS backend instead of showDirectoryPicker.
59
- *
60
- * @param scenarioName - Name of the scenario
61
- */
62
- declare function startSession(scenarioName: string): Promise<{
63
- scenarioPath: string;
64
- sessionPath: string;
65
- }>;
66
- /**
67
- * Write a Redux action to OPFS as a JSON file.
68
- */
69
- declare function writeAction(action: unknown, index: number): Promise<void>;
70
- /**
71
- * Write a captured frame image to OPFS.
72
- */
73
- declare function writeFrame(blob: Blob, index: number): Promise<void>;
74
- /**
75
- * Write session metadata (session.json) to OPFS.
76
- * Contains timing, counts, and user agent for the recording session.
77
- */
78
- declare function writeSessionMetadata(metadata: SessionMetadata): Promise<void>;
79
- /**
80
- * Shape of a parsed action file for type safety
81
- */
82
- interface ParsedRefPointAction {
83
- type: string;
84
- payload: {
85
- id: string;
86
- gpsPosition?: LatLongAlt;
87
- arPose?: ArPoseTuples;
88
- };
89
- }
90
- /**
91
- * Type guard for reference point actions
92
- * Exported for testing
93
- */
94
- declare function isRefPointAction(action: unknown): action is ParsedRefPointAction;
95
- /**
96
- * Load existing reference points from a scenario (across all sessions).
97
- * Now uses OPFS storage backend.
98
- */
99
- declare function loadScenarioRefPoints(scenarioName: string): Promise<RefPointRecord[]>;
100
- /**
101
- * Get the current scenario handle (for loading prior sessions).
102
- * Now delegates to OPFS storage backend.
103
- */
104
- declare function getCurrentScenarioHandle(): FileSystemDirectoryHandle | null;
105
- /**
106
- * Set the current scenario handle (when user selects a scenario).
107
- * With OPFS, we just store the name - the actual handle is retrieved when needed.
108
- */
109
- declare function setCurrentScenario(scenarioName: string): Promise<FileSystemDirectoryHandle | null>;
110
- /**
111
- * Ensure a scenario directory exists in OPFS, creating it if necessary.
112
- * Used during OPFS recovery when the scenario directory was lost but ZIP
113
- * data is available for restoration.
114
- *
115
- * Unlike setCurrentScenario() which only reads, this creates on demand.
116
- */
117
- declare function ensureScenarioDirectory(scenarioName: string): Promise<FileSystemDirectoryHandle | null>;
118
- /**
119
- * Reference point record from prior sessions
120
- */
121
- interface RefPointRecord {
122
- id: string;
123
- sessionName: string;
124
- gpsPosition?: LatLongAlt;
125
- arPose?: ArPoseTuples;
126
- }
127
- //#endregion
128
- export { initStorage as a, resetForNewSession as c, startSession as d, verifyWriteAccess as f, writeSessionMetadata as h, getCurrentScenarioHandle as i, resetStorageState as l, writeFrame as m, WriteAccessResult as n, isRefPointAction as o, writeAction as p, ensureScenarioDirectory as r, loadScenarioRefPoints as s, RefPointRecord as t, setCurrentScenario as u };
@@ -1,2 +0,0 @@
1
- import { t as COMMUNITY_LICENSE_KEY } from "../community-license-key-ChZLCJyO.js";
2
- export { COMMUNITY_LICENSE_KEY };
@@ -1,21 +0,0 @@
1
- //#region ../src/licensing/community-license-key.ts
2
- /**
3
- * Community license key for the gps-plus-slam-js core library.
4
- *
5
- * Generated by the core library maintainers and bundled with the open-source
6
- * `gps-plus-slam-app-framework` package so that every example app (and any
7
- * downstream app built on the framework) automatically uses a valid license
8
- * without per-developer registration.
9
- *
10
- * The key has a rolling expiration of 12 months. Each release of the
11
- * open-source packages renews it. Active users who regularly update their
12
- * dependencies will never be affected by the expiration.
13
- *
14
- * For licenses with extended validity beyond the community key's scope,
15
- * contact support@csutil.com.
16
- *
17
- * @see GpsPlusSlamJs/EULA.md §3 — License Key
18
- */
19
- const COMMUNITY_LICENSE_KEY = "eyJ0eXBlIjoiY29tbXVuaXR5IiwiZXhwIjoxODA4NzcyNDI3fQ.YYNf0IdqniZdMzRXCuvewxsQQ01XNywrKsfL5IpiJotfFJfqtrGg4u9z0QFhXeszPtUhnvgC8_oOnbOkbXPuAw";
20
- //#endregion
21
- export { COMMUNITY_LICENSE_KEY };
@@ -1,11 +0,0 @@
1
- import { n as SessionMetadata } from "./opfs-storage-ChOzF_Wp.js";
2
- import { t as StorageBackend } from "./storage-backend-BcEItnFr.js";
3
-
4
- //#region ../src/storage/opfs-storage-backend.d.ts
5
- declare class OpfsStorageBackend implements StorageBackend {
6
- writeAction(action: unknown, index: number): Promise<void>;
7
- writeFrame(blob: Blob, index: number): Promise<void>;
8
- writeSessionMetadata(metadata: SessionMetadata): Promise<void>;
9
- }
10
- //#endregion
11
- export { OpfsStorageBackend as t };
@@ -1,35 +0,0 @@
1
- import { i as DepthSample } from "./ar-types-B-ORgk6Z.js";
2
- import { s as RecordingOptions } from "./recording-options-BYUFX8iU.js";
3
- import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
4
-
5
- //#region ../src/state/recorder-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 RecorderState {
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
- * Currently selected scenario name.
26
- * Replaces the closure variable in folder-manager.ts so any module
27
- * can read it via store.getState().recorder.currentScenarioName.
28
- * @see docs/2026-03-26-state-management-audit.md §9.4 Priority 2
29
- */
30
- currentScenarioName: string;
31
- }
32
- declare const startSession: _$_reduxjs_toolkit0.ActionCreatorWithPayload<SessionMetadata, "recorder/startSession">, endSession: _$_reduxjs_toolkit0.ActionCreatorWithoutPayload<"recorder/endSession">, recordDepthSample: _$_reduxjs_toolkit0.ActionCreatorWithPayload<DepthSample, "recorder/recordDepthSample">, recordWriteFailure: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "recorder/recordWriteFailure">, setCurrentScenarioName: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "recorder/setCurrentScenarioName">;
33
- declare const recorderReducer: _$_reduxjs_toolkit0.Reducer<RecorderState>;
34
- //#endregion
35
- export { recordWriteFailure as a, startSession as c, recordDepthSample as i, SessionMetadata as n, recorderReducer as o, endSession as r, setCurrentScenarioName as s, RecorderState as t };
@@ -1,62 +0,0 @@
1
- //#region ../src/storage/ref-point-importer.d.ts
2
- /**
3
- * Reference Point Importer Module
4
- *
5
- * Extracts reference points from ZIP files in a folder, enabling reuse of
6
- * ref points from previous recording sessions.
7
- *
8
- * This module:
9
- * 1. Enumerates all *.zip files in a folder
10
- * 2. Opens each ZIP and looks for refPoints/*.json files
11
- * 3. Parses and validates each ref point definition
12
- * 4. Merges and deduplicates ref points by ID
13
- *
14
- * Uses @zip.js/zip.js for ZIP reading (same library as zip-export.ts).
15
- */
16
- /**
17
- * Simplified reference point for import/suggestion purposes.
18
- * Contains only the essential data needed for ref point suggestions and display.
19
- * The `lat`/`lon` are kept for "nearby ref point" proximity suggestions.
20
- */
21
- interface ImportedRefPoint {
22
- /** Unique identifier — H3 hex index since the March 2026 H3 migration */
23
- readonly id: string;
24
- /** Human-readable display name entered by the user (e.g., "Bench Corner") */
25
- readonly name: string;
26
- /** Latitude from first observation (for future proximity-based suggestions) */
27
- readonly lat: number;
28
- /** Longitude from first observation */
29
- readonly lon: number;
30
- /** Optional altitude */
31
- readonly alt?: number;
32
- /** Source ZIP file name for debugging/tracking */
33
- readonly sourceZipName: string;
34
- }
35
- /**
36
- * Result from importing reference points from a folder.
37
- */
38
- interface RefPointImportResult {
39
- /** Whether the import completed (even with some errors) */
40
- readonly success: boolean;
41
- /** Merged, deduplicated reference points from all ZIPs */
42
- readonly refPoints: ImportedRefPoint[];
43
- /** Number of ZIP files successfully scanned */
44
- readonly zipFilesScanned: number;
45
- /** Error messages from failed ZIPs or malformed ref points */
46
- readonly errors: string[];
47
- }
48
- /**
49
- * Import reference points from all ZIP files in a folder.
50
- *
51
- * Enumerates all *.zip files in the folder, extracts refPoints/*.json from each,
52
- * and merges them into a deduplicated list.
53
- *
54
- * Deduplication: If the same ref point ID appears in multiple ZIPs, the first
55
- * occurrence is kept (based on iteration order).
56
- *
57
- * @param folderHandle - Read-only directory handle from showDirectoryPicker
58
- * @returns Result containing merged ref points, scan count, and errors
59
- */
60
- declare function importRefPointsFromFolder(folderHandle: FileSystemDirectoryHandle): Promise<RefPointImportResult>;
61
- //#endregion
62
- export { RefPointImportResult as n, importRefPointsFromFolder as r, ImportedRefPoint as t };
@@ -1,117 +0,0 @@
1
- import { n as ArPoseTuples } from "./ar-types-B-ORgk6Z.js";
2
- import { GpsPoint, LatLongAlt, Quaternion, Vector3 } from "gps-plus-slam-js";
3
-
4
- //#region ../src/storage/ref-point-loader.d.ts
5
- /**
6
- * A single observation of a reference point in one session.
7
- */
8
- interface RefPointObservation {
9
- /** Session ID (e.g., "recording-2025-02-28_14-30-11utc") */
10
- readonly sessionId: string;
11
- /** When this observation was made */
12
- readonly timestamp: number;
13
- /** AR pose at the moment of marking */
14
- readonly arPose: ArPoseTuples;
15
- /** Full GPS point from library (includes lat/lon, accuracy, etc.) */
16
- readonly gpsPoint: GpsPoint;
17
- /** Fused GPS from aligned VIO path at mark time (absent in legacy data) */
18
- readonly fusedGpsPoint?: {
19
- latitude: number;
20
- longitude: number;
21
- altitude?: number;
22
- };
23
- }
24
- /**
25
- * Complete definition of a reference point with all observations.
26
- */
27
- interface RefPointDefinition {
28
- /** Unique identifier (e.g., "pointA", "benchCorner") */
29
- id: string;
30
- /** Human-readable name */
31
- name: string;
32
- /** Timestamp of first observation */
33
- createdAt: number;
34
- /** All observations across sessions */
35
- observations: RefPointObservation[];
36
- }
37
- /**
38
- * Load all reference point definitions from the scenario's refPoints/ directory.
39
- *
40
- * @param scenarioHandle - File system handle for the scenario folder
41
- * @returns Array of all reference point definitions
42
- */
43
- declare function loadAllRefPoints(scenarioHandle: FileSystemDirectoryHandle): Promise<RefPointDefinition[]>;
44
- /**
45
- * Load a specific reference point by ID.
46
- *
47
- * @param scenarioHandle - File system handle for the scenario folder
48
- * @param pointId - Reference point ID
49
- * @returns Reference point definition or null if not found
50
- */
51
- declare function loadRefPoint(scenarioHandle: FileSystemDirectoryHandle, pointId: string): Promise<RefPointDefinition | null>;
52
- /**
53
- * Save or update a reference point observation.
54
- * Creates the refPoints/ directory if it doesn't exist.
55
- * If the reference point exists, appends the new observation.
56
- * If it doesn't exist, creates a new reference point file.
57
- *
58
- * @param scenarioHandle - File system handle for the scenario folder
59
- * @param pointId - Reference point ID
60
- * @param pointName - Human-readable name for the reference point
61
- * @param observation - New observation to add
62
- */
63
- declare function saveRefPointObservation(scenarioHandle: FileSystemDirectoryHandle, pointId: string, pointName: string, observation: RefPointObservation): Promise<void>;
64
- /**
65
- * Write a complete RefPointDefinition to OPFS.
66
- * Creates the refPoints/ directory if it doesn't exist.
67
- * Used by the recovery flow to restore definitions extracted from ZIPs.
68
- *
69
- * @param scenarioHandle - File system handle for the scenario folder
70
- * @param definition - Complete ref point definition to write
71
- */
72
- declare function writeRefPointDefinition(scenarioHandle: FileSystemDirectoryHandle, definition: RefPointDefinition): Promise<void>;
73
- /**
74
- * Get list of all reference point IDs in the scenario.
75
- * Useful for autocomplete/suggestions.
76
- *
77
- * @param scenarioHandle - File system handle for the scenario folder
78
- * @returns Array of reference point IDs
79
- */
80
- declare function listRefPointIds(scenarioHandle: FileSystemDirectoryHandle): Promise<string[]>;
81
- /**
82
- * Marker type representing a single observation suitable for visualization.
83
- * Position/rotation use odometry frame; gpsPosition provides world coordinates.
84
- */
85
- interface RefPointMark {
86
- id: string;
87
- /** Odometry position at the moment of marking */
88
- odomPosition: Vector3;
89
- /** Odometry rotation at the moment of marking */
90
- odomRotation: Quaternion;
91
- /** GPS position if available */
92
- gpsPosition?: LatLongAlt;
93
- timestamp: number;
94
- }
95
- /**
96
- * Flatten an array of RefPointDefinition objects into individual RefPointMark
97
- * observations suitable for visualization.
98
- *
99
- * @param refPointDefs - Array of reference point definitions with observations
100
- * @returns Flat array of individual marks (one per observation)
101
- */
102
- declare function flattenRefPointsToMarks(refPointDefs: RefPointDefinition[]): RefPointMark[];
103
- /**
104
- * Compute one averaged GPS position per reference point ID.
105
- * For each observation, prefers `fusedGpsPoint` (sub-meter accuracy) when
106
- * available, falling back to raw `gpsPoint`. Returns the centroid (mean
107
- * lat/lon) across all observations.
108
- */
109
- declare function averageGpsPerRefPoint(refPointDefs: RefPointDefinition[]): Array<{
110
- id: string;
111
- name: string;
112
- lat: number;
113
- lon: number;
114
- alt?: number;
115
- }>;
116
- //#endregion
117
- export { flattenRefPointsToMarks as a, loadRefPoint as c, averageGpsPerRefPoint as i, saveRefPointObservation as l, RefPointMark as n, listRefPointIds as o, RefPointObservation as r, loadAllRefPoints as s, RefPointDefinition as t, writeRefPointDefinition as u };
@@ -1,2 +0,0 @@
1
- import { a as gpsToH3, i as findNearbyRefPoint, n as KnownRefPoint, o as h3RefsMatch, r as approxDistanceMetres, s as isH3Index, t as H3_RESOLUTION } from "../h3-ref-point-CFhayNSZ.js";
2
- export { H3_RESOLUTION, KnownRefPoint, approxDistanceMetres, findNearbyRefPoint, gpsToH3, h3RefsMatch, isH3Index };
@@ -1,2 +0,0 @@
1
- import { a as gpsToH3, i as findNearbyRefPoint, n as KnownRefPoint, o as h3RefsMatch, r as approxDistanceMetres, s as isH3Index, t as H3_RESOLUTION } from "../h3-ref-point-CFhayNSZ.js";
2
- export { H3_RESOLUTION, type KnownRefPoint, approxDistanceMetres, findNearbyRefPoint, gpsToH3, h3RefsMatch, isH3Index };
@@ -1,2 +0,0 @@
1
- import { H3_RESOLUTION, approxDistanceMetres, findNearbyRefPoint, gpsToH3, h3RefsMatch, isH3Index } from "./h3-ref-point.js";
2
- export { H3_RESOLUTION, approxDistanceMetres, findNearbyRefPoint, gpsToH3, h3RefsMatch, isH3Index };
@@ -1,48 +0,0 @@
1
- import { n as KnownRefPoint } from "./h3-ref-point-CFhayNSZ.js";
2
- import { t as ImportedRefPoint } from "./ref-point-importer-B_wn5ABk.js";
3
- import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
4
-
5
- //#region ../src/state/ref-points-slice.d.ts
6
- interface RefPointsState {
7
- /** Prior ref points loaded from previous session ZIPs. */
8
- importedRefPoints: ImportedRefPoint[];
9
- /**
10
- * Tracks how many times each ref point was marked in the current session.
11
- * Keyed by ref-point ID (H3 index). Plain object for Redux serializability
12
- * (replaces the Map<string, number> that lived in the closure).
13
- */
14
- sessionRefPointUsage: Record<string, number>;
15
- }
16
- declare const setImportedRefPoints: _$_reduxjs_toolkit0.ActionCreatorWithPayload<ImportedRefPoint[], "refPoints/setImportedRefPoints">, incrementRefPointUsage: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "refPoints/incrementRefPointUsage">, clearSessionRefPointUsage: _$_reduxjs_toolkit0.ActionCreatorWithoutPayload<"refPoints/clearSessionRefPointUsage">, resetRefPointsState: _$_reduxjs_toolkit0.ActionCreatorWithoutPayload<"refPoints/resetRefPointsState">;
17
- declare const refPointsReducer: _$_reduxjs_toolkit0.Reducer<RefPointsState>;
18
- /**
19
- * Memoized selector that derives KnownRefPoint[] (with H3 indices) from
20
- * importedRefPoints. Replaces the closure-based `recomputeKnownRefPoints()`
21
- * in ref-point-handlers.ts.
22
- *
23
- * Uses createSelector (reselect) for standard RTK memoization — recomputes
24
- * only when the importedRefPoints array reference changes.
25
- */
26
- declare const selectCachedKnownRefPoints: ((state: RefPointsState) => KnownRefPoint[]) & {
27
- clearCache: () => void;
28
- resultsCount: () => number;
29
- resetResultsCount: () => void;
30
- } & {
31
- resultFunc: (resultFuncArgs_0: ImportedRefPoint[]) => KnownRefPoint[];
32
- memoizedResultFunc: ((resultFuncArgs_0: ImportedRefPoint[]) => KnownRefPoint[]) & {
33
- clearCache: () => void;
34
- resultsCount: () => number;
35
- resetResultsCount: () => void;
36
- };
37
- lastResult: () => KnownRefPoint[];
38
- dependencies: [(state: RefPointsState) => ImportedRefPoint[]];
39
- recomputations: () => number;
40
- resetRecomputations: () => void;
41
- dependencyRecomputations: () => number;
42
- resetDependencyRecomputations: () => void;
43
- } & {
44
- memoize: typeof _$_reduxjs_toolkit0.weakMapMemoize;
45
- argsMemoize: typeof _$_reduxjs_toolkit0.weakMapMemoize;
46
- };
47
- //#endregion
48
- export { resetRefPointsState as a, refPointsReducer as i, clearSessionRefPointUsage as n, selectCachedKnownRefPoints as o, incrementRefPointUsage as r, setImportedRefPoints as s, RefPointsState as t };