@ingissa/navcore-core 1.0.4 → 1.0.5

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/README.md CHANGED
@@ -1,136 +1,279 @@
1
- # @ingissa/navcore-core
2
-
3
- Framework-agnostic TypeScript navigation engine for browser, React Native,
4
- Node.js, and CI environments.
5
-
6
- [![npm version](https://img.shields.io/npm/v/@ingissa/navcore-core)](https://www.npmjs.com/package/@ingissa/navcore-core)
7
- [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue)](https://www.typescriptlang.org/)
8
- [![Pricing](https://img.shields.io/badge/licence_key-pricing-green)](https://navcore-web.vercel.app/pricing)
9
-
10
- ## Install
11
-
12
- ```bash
13
- npm install @ingissa/navcore-core
14
- ```
15
-
16
- ## Quick Start
17
-
18
- ```typescript
19
- import { NavCore, OSRMDirectionsProvider } from '@ingissa/navcore-core';
20
-
21
- const provider = new OSRMDirectionsProvider({
22
- baseUrl: 'http://router.project-osrm.org',
23
- });
24
-
25
- const route = await provider.getRoute([
26
- [2.3522, 48.8566],
27
- [2.3400, 48.8700],
28
- ]);
29
-
30
- const engine = new NavCore({
31
- licenseKey: process.env.NAVCORE_LICENSE_KEY,
32
- });
33
-
34
- engine.setRoute(route.geometry);
35
- engine.startNavigation();
36
-
37
- const state = engine.update({
38
- coord: [2.3522, 48.8566],
39
- accuracy: 8,
40
- bearing: 90,
41
- speed: 9,
42
- timestamp: Date.now(),
43
- });
44
-
45
- console.log(state.snappedCoord, state.distanceToDestination);
46
- ```
47
-
48
- ## What Is Included
49
-
50
- Core runtime behavior works without a licence key:
51
-
52
- | Area | APIs |
53
- |---|---|
54
- | Geo utilities | `haversineDistance`, `getBearingBetweenPoints`, cumulative distance helpers |
55
- | GPS smoothing | `KalmanFilter2D` |
56
- | Route snapping | `RouteSnapper` |
57
- | Route building | `CustomRouteBuilder` |
58
- | Directions | `OSRMDirectionsProvider`, `ValhallaDirectionsProvider`, `OpenRouteServiceProvider` |
59
- | Renderer contract | `MapRendererAdapter` types |
60
- | Licence status | `LicenseManager` |
61
-
62
- Pro behavior unlocks with a signed licence key:
63
-
64
- | Area | APIs |
65
- |---|---|
66
- | Advanced route matching | `ParallelRoadResolver`, bearing and inertia scoring |
67
- | Deviation handling | `DeviationDetector`, `OffRouteFSM`, `NavigationFSM` |
68
- | Dead reckoning | `DeadReckoningEngine` |
69
- | Turn guidance | `InstructionEditor`, voice trigger helpers |
70
- | Driver UX | `ETAEngine`, `GeofencingEngine` |
71
-
72
- Get a licence key:
73
-
74
- https://navcore-web.vercel.app/pricing
75
-
76
- ## Direction Providers
77
-
78
- ```typescript
79
- import {
80
- OSRMDirectionsProvider,
81
- ValhallaDirectionsProvider,
82
- OpenRouteServiceProvider,
83
- } from '@ingissa/navcore-core';
84
- ```
85
-
86
- All providers implement:
87
-
88
- ```typescript
89
- interface DirectionsProvider {
90
- getRoute(
91
- waypoints: Coordinate[],
92
- options?: DirectionsOptions
93
- ): Promise<DirectionsResult>;
94
- }
95
- ```
96
-
97
- Provider options include:
98
-
99
- | Option | Purpose |
100
- |---|---|
101
- | `profile` | Driving, cycling, or walking route mode |
102
- | `steps` | Include maneuver data |
103
- | `language` | Instruction language when supported |
104
- | `fetchFn` | Custom fetch implementation for tests or runtimes |
105
- | `timeoutMs` | Abort slow requests |
106
-
107
- ## Public Subpaths
108
-
109
- ```typescript
110
- // Full engine and all public APIs
111
- import { NavCore } from '@ingissa/navcore-core';
112
-
113
- // Core-oriented subpath
114
- import { RouteSnapper } from '@ingissa/navcore-core/core';
115
-
116
- // Pro-oriented subpath
117
- import { DeadReckoningEngine } from '@ingissa/navcore-core/pro';
118
- ```
119
-
120
- ## Licence Model
121
-
122
- `@ingissa/navcore-core` is published publicly on npm and uses a commercial
123
- licence model.
124
-
125
- | Condition | Result |
126
- |---|---|
127
- | No licence key | Core behavior works with Core fallbacks. |
128
- | Valid licence key | Pro features unlock according to the signed key. |
129
- | Expired or invalid key | Pro features are blocked and status is reported. |
130
- | Development key | Accepted only in local development/test environments. |
131
-
132
- Pricing and licence keys:
133
-
134
- https://navcore-web.vercel.app/pricing
135
-
136
- Copyright Ingissa. All rights reserved.
1
+ # @ingissa/navcore-core
2
+
3
+ > **The navigation layer you own.** A framework-agnostic, zero-dependency navigation engine that runs everywhere — browsers, React Native, Node.js, and CI/CD.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@ingissa/navcore-core)](https://www.npmjs.com/package/@ingissa/navcore-core)
6
+ [![License](https://img.shields.io/badge/license-MIT%20%2F%20Commercial-purple)]()
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue)](https://www.typescriptlang.org/)
8
+ [![Zero deps](https://img.shields.io/badge/runtime_deps-0-brightgreen)](https://www.npmjs.com/package/@ingissa/navcore-core)
9
+
10
+ ---
11
+
12
+ ## Why NavCore?
13
+
14
+ | Feature | NavCore | Mapbox Nav SDK | Google Maps |
15
+ |---|---|---|---|
16
+ | **Framework** | Any (pure TS) | React Native only | Platform-locked |
17
+ | **Runtime deps** | 0 | 50+ | N/A |
18
+ | **Map renderer** | BYO (adapter) | Mapbox GL only | Google Maps only |
19
+ | **Directions** | BYO (adapter) | Mapbox API only | Google API only |
20
+ | **Off-route detection** | Built-in FSM | Basic | Basic |
21
+ | **U-turn protection** | ✅ Bearing penalty | ❌ | ❌ |
22
+ | **Parallel road resolver** | ✅ Built-in | ❌ | ❌ |
23
+ | **Dead reckoning** | ✅ Built-in | ❌ | ❌ |
24
+ | **Geofencing** | ✅ Built-in | ❌ | Paid API |
25
+ | **ETA** | ✅ Offline | API only | API only |
26
+ | **Voice triggers** | ✅ Built-in | SDK only | ❌ |
27
+ | **Headless testing** | ✅ Full pipeline | ❌ | ❌ |
28
+ | **Custom routes** | ✅ GPX/GeoJSON/Builder | ❌ | ❌ |
29
+ | **License** | Core MIT / Pro commercial | Commercial | Commercial |
30
+
31
+ ---
32
+
33
+ ## Tier Model
34
+
35
+ NavCore uses a two-tier model controlled by a signed license key:
36
+
37
+ | Tier | Import | License | Includes |
38
+ |---|---|---|---|
39
+ | **Core** | `@ingissa/navcore-core/core` | MIT — free forever | Geo utils, Kalman filter, route snapping, directions adapters, route builder |
40
+ | **Pro** | `@ingissa/navcore-core/pro` | Commercial key required | Dead reckoning, advanced bearing, deviation detection, FSMs, voice, ETA, geofencing |
41
+ | **Engine** | `@ingissa/navcore-core` | Gated internally at runtime | Full `NavCore` orchestrator (license key unlocks Pro features) |
42
+
43
+ ---
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ npm install @ingissa/navcore-core
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Quick Start
54
+
55
+ ### Core tier (no license needed)
56
+
57
+ ```typescript
58
+ import { NavCore } from '@ingissa/navcore-core';
59
+ import { OSRMDirectionsProvider } from '@ingissa/navcore-core/core';
60
+
61
+ // 1. Get a route from your self-hosted OSRM (free)
62
+ const provider = new OSRMDirectionsProvider({ baseUrl: 'http://router.project-osrm.org' });
63
+ const route = await provider.getRoute([[2.3522, 48.8566], [2.3400, 48.8700]]);
64
+
65
+ // 2. Create engine (Core features work without a key)
66
+ const engine = new NavCore();
67
+ engine.setRoute(route.geometry);
68
+ engine.startNavigation();
69
+
70
+ // 3. Feed GPS updates
71
+ engine.on('arrival', () => console.log('Arrived!'));
72
+
73
+ navigator.geolocation.watchPosition(({ coords }) => {
74
+ const state = engine.update({
75
+ coord: [coords.longitude, coords.latitude],
76
+ accuracy: coords.accuracy,
77
+ bearing: coords.heading,
78
+ speed: coords.speed ?? 0,
79
+ timestamp: Date.now(),
80
+ });
81
+
82
+ console.log('Distance remaining:', state.distanceToDestination, 'm');
83
+ });
84
+ ```
85
+
86
+ ### Pro tier (with license key)
87
+
88
+ ```typescript
89
+ import { NavCore } from '@ingissa/navcore-core';
90
+
91
+ // Pro features unlock automatically with a valid key
92
+ const engine = new NavCore({ licenseKey: 'your-signed-license-key' });
93
+ engine.setRoute(routeCoords, instructions);
94
+ engine.startNavigation();
95
+
96
+ engine.on('instruction', (instr) => speak(instr.text)); // voice cues (PRO)
97
+ engine.on('deviation', ({ anchorIndex }) => recalculate(anchorIndex));
98
+ engine.on('arrival', () => console.log('Arrived!'));
99
+ ```
100
+
101
+ ### Using subpath imports directly
102
+
103
+ ```typescript
104
+ // Free MIT tier
105
+ import { KalmanFilter2D } from '@ingissa/navcore-core/core';
106
+ import { OSRMDirectionsProvider } from '@ingissa/navcore-core/core';
107
+ import { CustomRouteBuilder } from '@ingissa/navcore-core/core';
108
+
109
+ // Commercial Pro tier
110
+ import { DeadReckoningEngine } from '@ingissa/navcore-core/pro';
111
+ import { VoiceTriggerEngine } from '@ingissa/navcore-core/pro';
112
+ import { ETAEngine } from '@ingissa/navcore-core/pro';
113
+ import { GeofencingEngine } from '@ingissa/navcore-core/pro';
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Directions Providers (built-in, no extra install)
119
+
120
+ ```typescript
121
+ import {
122
+ OSRMDirectionsProvider, // Self-hosted OSRM (recommended, free)
123
+ ValhallaDirectionsProvider, // Self-hosted Valhalla (free)
124
+ OpenRouteServiceProvider, // openrouteservice.org (free tier)
125
+ } from '@ingissa/navcore-core/core';
126
+
127
+ // OSRM
128
+ const osrm = new OSRMDirectionsProvider({ baseUrl: 'http://router.project-osrm.org' });
129
+ const route = await osrm.getRoute([[lng1, lat1], [lng2, lat2]]);
130
+
131
+ // Valhalla
132
+ const valhalla = new ValhallaDirectionsProvider({ baseUrl: 'https://valhalla1.openstreetmap.de' });
133
+ const route = await valhalla.getRoute([[lng1, lat1], [lng2, lat2]], { costing: 'auto' });
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Renderer Adapters (separate packages)
139
+
140
+ ```bash
141
+ npm install @ingissa/navcore-maplibre # Web + MapLibre GL
142
+ npm install @ingissa/navcore-leaflet # Web + Leaflet.js
143
+ npm install @ingissa/navcore-google-maps # Google Maps JS API
144
+ npm install @ingissa/navcore-mapbox # React Native + @rnmapbox/maps
145
+ npm install @ingissa/navcore-react-native # React Native bindings
146
+ npm install @ingissa/navcore-headless # Node.js / CI testing
147
+ ```
148
+
149
+ > ⚠️ Renderer adapter packages require a commercial license. [Get yours at Not yet available]()
150
+
151
+ ---
152
+
153
+ ## Feature Reference
154
+
155
+ ### CORE — free, MIT
156
+
157
+ | Feature | API |
158
+ |---|---|
159
+ | GPS smoothing | `KalmanFilter2D` |
160
+ | Route snapping | `RouteSnapper` |
161
+ | Haversine & bearing | `haversineDistance`, `getBearingBetweenPoints` |
162
+ | Cumulative distances | `buildForwardCumulativeDistances` |
163
+ | Route builder | `CustomRouteBuilder` |
164
+ | Directions — OSRM | `OSRMDirectionsProvider` |
165
+ | Directions — Valhalla | `ValhallaDirectionsProvider` |
166
+ | Directions — ORS | `OpenRouteServiceProvider` |
167
+ | Renderer interface | `MapRendererAdapter` |
168
+ | License verification | `LicenseManager` |
169
+
170
+ ### PRO — commercial license required
171
+
172
+ | Feature | API | FEATURES key |
173
+ |---|---|---|
174
+ | Advanced snapping (bearing + inertia) | `RouteSnapper` options | `ADVANCED_SNAPPING` |
175
+ | Parallel road resolver | `ParallelRoadResolver` | `PARALLEL_ROAD_RESOLUTION` |
176
+ | Dead reckoning | `DeadReckoningEngine` | `DEAD_RECKONING` |
177
+ | Compound deviation detection | `DeviationDetector` | `COMPOUND_DEVIATION` |
178
+ | Advanced bearing engine | `BearingEngine` | `ADVANCED_BEARING` |
179
+ | Progress anti-regression | `ProgressTracker` | `PROGRESS_TRACKING` |
180
+ | Route offset predictor | `RouteOffsetPredictor` | `ROUTE_OFFSET` |
181
+ | Navigation lifecycle FSM | `NavigationFSM` | — |
182
+ | Off-route FSM | `OffRouteFSM` | — |
183
+ | Instruction editor | `InstructionEditor` | — |
184
+ | Voice trigger engine | `VoiceTriggerEngine` | `VOICE_TRIGGERS` |
185
+ | ETA engine (offline) | `ETAEngine` | `ETA` |
186
+ | Geofencing engine | `GeofencingEngine` | `GEOFENCING` |
187
+
188
+ ---
189
+
190
+ ## License Gate Behaviour
191
+
192
+ | Condition | Result |
193
+ |---|---|
194
+ | No `licenseKey` | Core features work; Pro features blocked with `console.warn` |
195
+ | Valid Pro key | All features unlocked; `🔑 [NavCore] License validation complete. Plan: pro` logged |
196
+ | `isDev: true` | All features bypassed (development mode) |
197
+ | Expired / tampered key | Pro features blocked; status: `EXPIRED` / `INVALID` |
198
+
199
+ License keys are verified **offline** using ECDSA P-256 — no network calls, no tracking.
200
+
201
+ ---
202
+
203
+ ## NavCore Engine API
204
+
205
+ ```typescript
206
+ const engine = new NavCore(options?: NavCoreOptions);
207
+
208
+ // Setup
209
+ engine.setRoute(coords: Coordinate[], instructions?: NavInstruction[]);
210
+ engine.startNavigation();
211
+
212
+ // GPS update (returns state snapshot)
213
+ const state: NavCoreState = engine.update(gpsUpdate: NavGpsUpdate);
214
+
215
+ // Render tick (call at ~60fps between GPS updates)
216
+ engine.tick(nowMs: number);
217
+
218
+ // Events
219
+ engine.on('instruction', (instr: NavInstruction) => void);
220
+ engine.on('deviation', ({ anchorIndex, ghostCoord }) => void);
221
+ engine.on('arrival', () => void);
222
+ engine.on('routeLoaded', ({ routeLength }) => void);
223
+ engine.off(event, handler);
224
+
225
+ // State & introspection
226
+ engine.getState(): NavCoreState;
227
+ engine.getLicenseManager(): LicenseManager;
228
+ engine.getRoute(): ReadonlyArray<Coordinate>;
229
+ engine.destroy();
230
+ ```
231
+
232
+ ### NavCoreState
233
+
234
+ ```typescript
235
+ interface NavCoreState {
236
+ snappedCoord: Coordinate | null; // GPS-snapped position on route
237
+ rawGpsCoord: Coordinate | null; // Raw GPS position
238
+ bearing: number; // Smoothed heading (degrees)
239
+ routeIndex: number; // Current segment index
240
+ distanceToRoute: number; // Distance from route (metres)
241
+ corridor: number; // Dynamic off-route threshold (metres)
242
+ isOffRoute: boolean; // True when deviation confirmed
243
+ hasArrived: boolean;
244
+ distanceToDestination: number | null; // Remaining distance (metres)
245
+ distanceToNextInstruction: number | null; // Distance to next turn
246
+ nextInstructionIndex: number | null;
247
+ currentSpeed: number; // m/s
248
+ isGpsStale: boolean;
249
+ gpsAgeMs: number;
250
+ licenseStatus: string; // 'VALID' | 'INVALID' | 'EXPIRED' | 'MISSING'
251
+ }
252
+ ```
253
+
254
+ ---
255
+
256
+ ## Documentation
257
+
258
+ | Guide | Link |
259
+ |---|---|
260
+ | Architecture | [docs/architecture.md](./docs/architecture.md) |
261
+ | Getting Started | [docs/getting-started.md](./docs/getting-started.md) |
262
+ | Directions Providers | [docs/directions-providers.md](./docs/directions-providers.md) |
263
+ | Renderer Adapters | [docs/renderer-adapters.md](./docs/renderer-adapters.md) |
264
+ | API Reference | [docs/api-reference.md](./docs/api-reference.md) |
265
+ | Custom Routes | [docs/custom-routes.md](./docs/custom-routes.md) |
266
+ | Instructions & Voice | [docs/instructions.md](./docs/instructions.md) |
267
+ | Pro Features | [docs/p3-features.md](./docs/p3-features.md) |
268
+ | Testing Guide | [docs/testing.md](./docs/testing.md) |
269
+
270
+ ---
271
+
272
+ ## License
273
+
274
+ - **Core engine** (`@ingissa/navcore-core`): [MIT](./LICENSE) for open-source projects
275
+ - **Pro features & adapters**: Commercial license required — [Not yet available]()
276
+
277
+ ---
278
+
279
+ © Ingissa · [8abnav@gmail.com](mailto:8abnav@gmail.com)
@@ -34,7 +34,7 @@ interface InstructionResult {
34
34
  /**
35
35
  * Resolve which instruction is next and whether it should trigger now.
36
36
  */
37
- declare function resolveNextInstruction(currentGeometryIdx: number, instructions: NavInstruction[], currentInstrIdx: number, route: Coordinate[], currentCoord: Coordinate, vehicleBearing: number | null, vehicleDistance: number, speed?: number): InstructionResult;
37
+ declare function resolveNextInstruction(currentGeometryIdx: number, instructions: NavInstruction[], currentInstrIdx: number, route: Coordinate[], currentCoord: Coordinate, vehicleBearing: number | null, vehicleDistance: number, speed?: number, isCircuit?: boolean): InstructionResult;
38
38
 
39
39
  /**
40
40
  * Module 9a: NavigationFSM
@@ -151,12 +151,8 @@ declare class OffRouteFSM {
151
151
  /**
152
152
  * Feature flag constants for SDK consumers.
153
153
  *
154
- * CORE features: available to all users without a license key.
155
- * - GPS smoothing, basic snapping, route building, directions providers,
156
- * progress tracking, and route offset prediction are all free.
157
- *
158
- * PRO features: require a valid commercial license key.
159
- * Each PRO engine checks the license at runtime and gracefully degrades.
154
+ * CORE features: available to all users (MIT license).
155
+ * PRO features: require a valid commercial license key.
160
156
  */
161
157
  declare const FEATURES: {
162
158
  /**
@@ -165,45 +161,43 @@ declare const FEATURES: {
165
161
  */
166
162
  readonly GPS_SMOOTHING: "gps_smoothing";
167
163
  /**
168
- * Basic route snapping (nearest-point projection) with bearing and inertia
169
- * penalties to prevent U-turn snaps and oscillation.
170
- * Both basic and advanced snapping quality are available in the free tier.
164
+ * Basic route snapping (nearest-point projection).
165
+ * Snaps GPS position to the closest route segment.
171
166
  */
172
167
  readonly BASIC_SNAPPING: "basic_snapping";
173
168
  /**
174
- * Progress anti-regression: prevents route index from jumping backward.
175
- * Essential for circuit routes and motorway slip roads.
176
- * Used unconditionally inside NavCore — available in the free tier.
169
+ * Advanced route snapping with bearing penalty + inertia.
170
+ * Prevents incorrect snaps on parallel roads and U-turns.
177
171
  */
178
- readonly PROGRESS_TRACKING: "progress_tracking";
172
+ readonly ADVANCED_SNAPPING: "advanced_snapping";
173
+ /**
174
+ * Dead reckoning: continues navigation during GPS signal loss.
175
+ * Predicts position based on last known speed and bearing.
176
+ */
177
+ readonly DEAD_RECKONING: "dead_reckoning";
179
178
  /**
180
179
  * Smooth route offset predictor for jitter-free map rendering.
181
180
  * Advances render position at frame rate between GPS fixes.
182
- * Used unconditionally inside NavCore — available in the free tier.
183
181
  */
184
182
  readonly ROUTE_OFFSET: "route_offset";
185
183
  /**
186
- * Dead reckoning: continues navigation during GPS signal loss.
187
- * Predicts position based on last known speed and bearing.
188
- * DeadReckoningEngine.predict() is a no-op without a Pro license.
184
+ * Progress anti-regression: prevents route index from jumping backward.
185
+ * Essential for circuit routes and motorway slip roads.
189
186
  */
190
- readonly DEAD_RECKONING: "dead_reckoning";
187
+ readonly PROGRESS_TRACKING: "progress_tracking";
191
188
  /**
192
189
  * Advanced bearing engine with look-ahead and speed-adaptive alpha.
193
190
  * Produces stable heading for smooth map camera rotation.
194
- * Gated inside NavCore.update() via this.has(FEATURES.ADVANCED_BEARING).
195
191
  */
196
192
  readonly ADVANCED_BEARING: "advanced_bearing";
197
193
  /**
198
194
  * Compound deviation detection: combines distance, bearing, and speed signals.
199
195
  * Eliminates false off-route triggers in tunnels and urban canyons.
200
- * DeviationDetector.evaluate() returns a neutral signal without a Pro license.
201
196
  */
202
197
  readonly COMPOUND_DEVIATION: "compound_deviation";
203
198
  /**
204
199
  * Parallel road disambiguation + U-turn snap protection.
205
200
  * Prevents snapping to the wrong carriageway when bearing mismatches route direction.
206
- * ParallelRoadResolver falls back to pure distance sorting without a Pro license.
207
201
  */
208
202
  readonly PARALLEL_ROAD_RESOLUTION: "parallel_road_resolution";
209
203
  /**
@@ -213,17 +207,14 @@ declare const FEATURES: {
213
207
  readonly U_TURN_PROTECTION: "u_turn_protection";
214
208
  /**
215
209
  * Timed voice instruction cues with deduplication and priority levels.
216
- * VoiceTriggerEngine.update() returns null without a Pro license.
217
210
  */
218
211
  readonly VOICE_TRIGGERS: "voice_triggers";
219
212
  /**
220
213
  * Local ETA computation using rolling speed average — zero API calls.
221
- * ETAEngine.update() returns isReliable=false without a Pro license.
222
214
  */
223
215
  readonly ETA: "eta";
224
216
  /**
225
217
  * Circular and polygon geofencing with enter/exit/dwell events.
226
- * GeofencingEngine.update() returns [] without a Pro license.
227
218
  */
228
219
  readonly GEOFENCING: "geofencing";
229
220
  /**
@@ -256,25 +247,9 @@ declare class LicenseManager {
256
247
  private payload;
257
248
  private enabledFeatures;
258
249
  private warnedFeatures;
259
- private static activeManager;
260
- static getActive(): LicenseManager | null;
261
- /**
262
- * Clear the active manager reference.
263
- * Intended for test teardown only — not for production use.
264
- */
265
- static clearActive(): void;
266
- /**
267
- * Promote this instance to the global active manager.
268
- *
269
- * Security rule: A VALID license context cannot be overwritten by an
270
- * INVALID / MISSING / EXPIRED one. Once a valid license is registered,
271
- * it holds the slot until explicitly cleared or replaced by another
272
- * valid license.
273
- */
274
- private promoteToActive;
250
+ private isDev;
275
251
  private static PUBLIC_KEY_SPKI;
276
- constructor(licenseKey?: string);
277
- private tryValidateSync;
252
+ constructor(licenseKey?: string, isDev?: boolean);
278
253
  validate(key: string): Promise<LicenseStatus>;
279
254
  private extractFeatures;
280
255
  hasFeature(feature: FeatureKey): boolean;
@@ -311,6 +286,7 @@ interface NavGpsUpdate {
311
286
  }
312
287
  interface NavCoreOptions {
313
288
  licenseKey?: string;
289
+ isDev?: boolean;
314
290
  isCircuit?: boolean;
315
291
  kalmanQ?: number;
316
292
  kalmanRBase?: number;
@@ -321,24 +297,47 @@ interface NavCoreOptions {
321
297
  }
322
298
  interface NavCoreState {
323
299
  snappedCoord: Coordinate | null;
300
+ ghostCoord: Coordinate | null;
324
301
  rawGpsCoord: Coordinate | null;
325
302
  bearing: number;
326
303
  rawGpsBearing: number | null;
327
304
  routeIndex: number;
305
+ anchorRouteIndex: number | null;
328
306
  distanceToRoute: number;
329
307
  corridor: number;
308
+ confidence: number;
330
309
  isOffRoute: boolean;
310
+ navFsmState: string;
331
311
  progressIndex: number;
332
312
  hasArrived: boolean;
333
- offRouteState: string;
334
- lifecycleState: string;
313
+ rejoinCandidate: {
314
+ coord: Coordinate;
315
+ index: number;
316
+ } | null;
317
+ confidenceCone: {
318
+ center: Coordinate;
319
+ bearing: number;
320
+ angle: number;
321
+ length: number;
322
+ } | null;
323
+ alertState: 'NONE' | 'DEVIATING' | 'RECALCULATING' | 'REJOINING' | 'REJOINED';
324
+ detourMode: 'NONE' | 'FREE' | 'COMMITTED';
325
+ detourCommitProgress: number;
335
326
  distanceToDestination: number | null;
336
327
  distanceToNextInstruction: number | null;
328
+ nextInstrIdx: number | null;
337
329
  nextInstructionIndex: number | null;
338
330
  currentSpeed: number;
339
331
  isGpsStale: boolean;
340
332
  gpsAgeMs: number;
341
333
  licenseStatus: string;
334
+ offRouteState: string;
335
+ lifecycleState: string;
336
+ stability?: {
337
+ oscillation: number;
338
+ drift: number;
339
+ jump: number;
340
+ };
342
341
  }
343
342
  type EventHandler = (...args: unknown[]) => void;
344
343
  declare class NavCore {
@@ -354,6 +353,7 @@ declare class NavCore {
354
353
  private forwardCum;
355
354
  private reverseCum;
356
355
  private snappedCoord;
356
+ private ghostCoord;
357
357
  private rawGpsCoord;
358
358
  private bearing;
359
359
  private rawGpsBearing;
@@ -371,8 +371,11 @@ declare class NavCore {
371
371
  private readonly options;
372
372
  private listeners;
373
373
  constructor(options?: NavCoreOptions);
374
- /** Internal license check for automatic fallbacks that should not warn Core users every tick. */
375
- private canUse;
374
+ /**
375
+ * Returns true if the feature is unlocked (dev mode OR valid license).
376
+ * Emits a one-time console warning when a Pro feature is blocked.
377
+ */
378
+ private has;
376
379
  /** Load route geometry and instructions */
377
380
  setRoute(route: Coordinate[], instructions?: NavInstruction[]): void;
378
381
  /** Start navigation */