@ingissa/navcore-core 1.0.3 → 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.
@@ -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;
@@ -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;
package/dist/core.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Coordinate, g as NavCoreState } from './NavCore.d-BuXR5DO7.mjs';
2
- export { F as FEATURES, a as FeatureKey, L as LicenseManager, b as LicensePayload, c as LicenseStatus, o as destinationPoint, p as geoGetBearing, q as haversineDistance } from './NavCore.d-BuXR5DO7.mjs';
1
+ import { C as Coordinate, g as NavCoreState } from './NavCore-qf5_0qsR.mjs';
2
+ export { F as FEATURES, a as FeatureKey, L as LicenseManager, b as LicensePayload, c as LicenseStatus, o as destinationPoint, p as geoGetBearing, q as haversineDistance } from './NavCore-qf5_0qsR.mjs';
3
3
 
4
4
  /**
5
5
  * Bearing and angular math utilities.
@@ -430,6 +430,8 @@ declare const BASE_CORRIDOR_METERS = 25;
430
430
  declare const MAX_CORRIDOR_METERS = 60;
431
431
  declare const SPEED_CORRIDOR_FACTOR = 1.2;
432
432
  declare const GPS_ACCURACY_FACTOR = 0.5;
433
+ declare const TURN_LOOKAHEAD_DISTANCE_METERS = 40;
434
+ declare const TURN_CORRIDOR_MULTIPLIER = 1.4;
433
435
  declare const MAX_SNAP_DISTANCE = 80;
434
436
  declare const BEARING_MISMATCH_THRESHOLD = 90;
435
437
  declare const BEARING_MISMATCH_PENALTY = 500;
@@ -454,35 +456,37 @@ declare const MIN_LOOK_AHEAD_METERS = 20;
454
456
  declare const MAX_LOOK_AHEAD_METERS = 100;
455
457
  declare const ARRIVAL_THRESHOLD_METERS = 30;
456
458
 
457
- declare const constants_d_ARRIVAL_THRESHOLD_METERS: typeof ARRIVAL_THRESHOLD_METERS;
458
- declare const constants_d_BASE_CORRIDOR_METERS: typeof BASE_CORRIDOR_METERS;
459
- declare const constants_d_BEARING_ALIGNMENT_THRESHOLD: typeof BEARING_ALIGNMENT_THRESHOLD;
460
- declare const constants_d_BEARING_MIN_SPEED_MPS: typeof BEARING_MIN_SPEED_MPS;
461
- declare const constants_d_BEARING_MISMATCH_PENALTY: typeof BEARING_MISMATCH_PENALTY;
462
- declare const constants_d_BEARING_MISMATCH_THRESHOLD: typeof BEARING_MISMATCH_THRESHOLD;
463
- declare const constants_d_BEARING_SMOOTHING_ALPHA: typeof BEARING_SMOOTHING_ALPHA;
464
- declare const constants_d_BETA_CORRECTION: typeof BETA_CORRECTION;
465
- declare const constants_d_DETOUR_COMMIT_MS: typeof DETOUR_COMMIT_MS;
466
- declare const constants_d_DR_MAX_AGE_MS: typeof DR_MAX_AGE_MS;
467
- declare const constants_d_GPS_ACCURACY_FACTOR: typeof GPS_ACCURACY_FACTOR;
468
- declare const constants_d_GPS_AGE_CAP_SECONDS: typeof GPS_AGE_CAP_SECONDS;
469
- declare const constants_d_GPS_STALE_MS: typeof GPS_STALE_MS;
470
- declare const constants_d_INERTIA_PENALTY: typeof INERTIA_PENALTY;
471
- declare const constants_d_INERTIA_SEGMENT_DIST: typeof INERTIA_SEGMENT_DIST;
472
- declare const constants_d_LOOK_AHEAD_SECONDS: typeof LOOK_AHEAD_SECONDS;
473
- declare const constants_d_MANEUVER_TRIGGER_DIST: typeof MANEUVER_TRIGGER_DIST;
474
- declare const constants_d_MAX_CORRIDOR_METERS: typeof MAX_CORRIDOR_METERS;
475
- declare const constants_d_MAX_LOOK_AHEAD_METERS: typeof MAX_LOOK_AHEAD_METERS;
476
- declare const constants_d_MAX_SNAP_DISTANCE: typeof MAX_SNAP_DISTANCE;
477
- declare const constants_d_MIN_LOOK_AHEAD_METERS: typeof MIN_LOOK_AHEAD_METERS;
478
- declare const constants_d_OFF_ROUTE_CONFIRM_MS: typeof OFF_ROUTE_CONFIRM_MS;
479
- declare const constants_d_REJOIN_CONFIRM_MS: typeof REJOIN_CONFIRM_MS;
480
- declare const constants_d_REJOIN_COOLDOWN_MS: typeof REJOIN_COOLDOWN_MS;
481
- declare const constants_d_SNAP_WINDOW_SIZE: typeof SNAP_WINDOW_SIZE;
482
- declare const constants_d_SPEED_CORRIDOR_FACTOR: typeof SPEED_CORRIDOR_FACTOR;
483
- declare const constants_d_STARTUP_GRACE_MS: typeof STARTUP_GRACE_MS;
484
- declare namespace constants_d {
485
- export { constants_d_ARRIVAL_THRESHOLD_METERS as ARRIVAL_THRESHOLD_METERS, constants_d_BASE_CORRIDOR_METERS as BASE_CORRIDOR_METERS, constants_d_BEARING_ALIGNMENT_THRESHOLD as BEARING_ALIGNMENT_THRESHOLD, constants_d_BEARING_MIN_SPEED_MPS as BEARING_MIN_SPEED_MPS, constants_d_BEARING_MISMATCH_PENALTY as BEARING_MISMATCH_PENALTY, constants_d_BEARING_MISMATCH_THRESHOLD as BEARING_MISMATCH_THRESHOLD, constants_d_BEARING_SMOOTHING_ALPHA as BEARING_SMOOTHING_ALPHA, constants_d_BETA_CORRECTION as BETA_CORRECTION, constants_d_DETOUR_COMMIT_MS as DETOUR_COMMIT_MS, constants_d_DR_MAX_AGE_MS as DR_MAX_AGE_MS, constants_d_GPS_ACCURACY_FACTOR as GPS_ACCURACY_FACTOR, constants_d_GPS_AGE_CAP_SECONDS as GPS_AGE_CAP_SECONDS, constants_d_GPS_STALE_MS as GPS_STALE_MS, constants_d_INERTIA_PENALTY as INERTIA_PENALTY, constants_d_INERTIA_SEGMENT_DIST as INERTIA_SEGMENT_DIST, constants_d_LOOK_AHEAD_SECONDS as LOOK_AHEAD_SECONDS, constants_d_MANEUVER_TRIGGER_DIST as MANEUVER_TRIGGER_DIST, constants_d_MAX_CORRIDOR_METERS as MAX_CORRIDOR_METERS, constants_d_MAX_LOOK_AHEAD_METERS as MAX_LOOK_AHEAD_METERS, constants_d_MAX_SNAP_DISTANCE as MAX_SNAP_DISTANCE, constants_d_MIN_LOOK_AHEAD_METERS as MIN_LOOK_AHEAD_METERS, constants_d_OFF_ROUTE_CONFIRM_MS as OFF_ROUTE_CONFIRM_MS, constants_d_REJOIN_CONFIRM_MS as REJOIN_CONFIRM_MS, constants_d_REJOIN_COOLDOWN_MS as REJOIN_COOLDOWN_MS, constants_d_SNAP_WINDOW_SIZE as SNAP_WINDOW_SIZE, constants_d_SPEED_CORRIDOR_FACTOR as SPEED_CORRIDOR_FACTOR, constants_d_STARTUP_GRACE_MS as STARTUP_GRACE_MS };
459
+ declare const constants_ARRIVAL_THRESHOLD_METERS: typeof ARRIVAL_THRESHOLD_METERS;
460
+ declare const constants_BASE_CORRIDOR_METERS: typeof BASE_CORRIDOR_METERS;
461
+ declare const constants_BEARING_ALIGNMENT_THRESHOLD: typeof BEARING_ALIGNMENT_THRESHOLD;
462
+ declare const constants_BEARING_MIN_SPEED_MPS: typeof BEARING_MIN_SPEED_MPS;
463
+ declare const constants_BEARING_MISMATCH_PENALTY: typeof BEARING_MISMATCH_PENALTY;
464
+ declare const constants_BEARING_MISMATCH_THRESHOLD: typeof BEARING_MISMATCH_THRESHOLD;
465
+ declare const constants_BEARING_SMOOTHING_ALPHA: typeof BEARING_SMOOTHING_ALPHA;
466
+ declare const constants_BETA_CORRECTION: typeof BETA_CORRECTION;
467
+ declare const constants_DETOUR_COMMIT_MS: typeof DETOUR_COMMIT_MS;
468
+ declare const constants_DR_MAX_AGE_MS: typeof DR_MAX_AGE_MS;
469
+ declare const constants_GPS_ACCURACY_FACTOR: typeof GPS_ACCURACY_FACTOR;
470
+ declare const constants_GPS_AGE_CAP_SECONDS: typeof GPS_AGE_CAP_SECONDS;
471
+ declare const constants_GPS_STALE_MS: typeof GPS_STALE_MS;
472
+ declare const constants_INERTIA_PENALTY: typeof INERTIA_PENALTY;
473
+ declare const constants_INERTIA_SEGMENT_DIST: typeof INERTIA_SEGMENT_DIST;
474
+ declare const constants_LOOK_AHEAD_SECONDS: typeof LOOK_AHEAD_SECONDS;
475
+ declare const constants_MANEUVER_TRIGGER_DIST: typeof MANEUVER_TRIGGER_DIST;
476
+ declare const constants_MAX_CORRIDOR_METERS: typeof MAX_CORRIDOR_METERS;
477
+ declare const constants_MAX_LOOK_AHEAD_METERS: typeof MAX_LOOK_AHEAD_METERS;
478
+ declare const constants_MAX_SNAP_DISTANCE: typeof MAX_SNAP_DISTANCE;
479
+ declare const constants_MIN_LOOK_AHEAD_METERS: typeof MIN_LOOK_AHEAD_METERS;
480
+ declare const constants_OFF_ROUTE_CONFIRM_MS: typeof OFF_ROUTE_CONFIRM_MS;
481
+ declare const constants_REJOIN_CONFIRM_MS: typeof REJOIN_CONFIRM_MS;
482
+ declare const constants_REJOIN_COOLDOWN_MS: typeof REJOIN_COOLDOWN_MS;
483
+ declare const constants_SNAP_WINDOW_SIZE: typeof SNAP_WINDOW_SIZE;
484
+ declare const constants_SPEED_CORRIDOR_FACTOR: typeof SPEED_CORRIDOR_FACTOR;
485
+ declare const constants_STARTUP_GRACE_MS: typeof STARTUP_GRACE_MS;
486
+ declare const constants_TURN_CORRIDOR_MULTIPLIER: typeof TURN_CORRIDOR_MULTIPLIER;
487
+ declare const constants_TURN_LOOKAHEAD_DISTANCE_METERS: typeof TURN_LOOKAHEAD_DISTANCE_METERS;
488
+ declare namespace constants {
489
+ export { constants_ARRIVAL_THRESHOLD_METERS as ARRIVAL_THRESHOLD_METERS, constants_BASE_CORRIDOR_METERS as BASE_CORRIDOR_METERS, constants_BEARING_ALIGNMENT_THRESHOLD as BEARING_ALIGNMENT_THRESHOLD, constants_BEARING_MIN_SPEED_MPS as BEARING_MIN_SPEED_MPS, constants_BEARING_MISMATCH_PENALTY as BEARING_MISMATCH_PENALTY, constants_BEARING_MISMATCH_THRESHOLD as BEARING_MISMATCH_THRESHOLD, constants_BEARING_SMOOTHING_ALPHA as BEARING_SMOOTHING_ALPHA, constants_BETA_CORRECTION as BETA_CORRECTION, constants_DETOUR_COMMIT_MS as DETOUR_COMMIT_MS, constants_DR_MAX_AGE_MS as DR_MAX_AGE_MS, constants_GPS_ACCURACY_FACTOR as GPS_ACCURACY_FACTOR, constants_GPS_AGE_CAP_SECONDS as GPS_AGE_CAP_SECONDS, constants_GPS_STALE_MS as GPS_STALE_MS, constants_INERTIA_PENALTY as INERTIA_PENALTY, constants_INERTIA_SEGMENT_DIST as INERTIA_SEGMENT_DIST, constants_LOOK_AHEAD_SECONDS as LOOK_AHEAD_SECONDS, constants_MANEUVER_TRIGGER_DIST as MANEUVER_TRIGGER_DIST, constants_MAX_CORRIDOR_METERS as MAX_CORRIDOR_METERS, constants_MAX_LOOK_AHEAD_METERS as MAX_LOOK_AHEAD_METERS, constants_MAX_SNAP_DISTANCE as MAX_SNAP_DISTANCE, constants_MIN_LOOK_AHEAD_METERS as MIN_LOOK_AHEAD_METERS, constants_OFF_ROUTE_CONFIRM_MS as OFF_ROUTE_CONFIRM_MS, constants_REJOIN_CONFIRM_MS as REJOIN_CONFIRM_MS, constants_REJOIN_COOLDOWN_MS as REJOIN_COOLDOWN_MS, constants_SNAP_WINDOW_SIZE as SNAP_WINDOW_SIZE, constants_SPEED_CORRIDOR_FACTOR as SPEED_CORRIDOR_FACTOR, constants_STARTUP_GRACE_MS as STARTUP_GRACE_MS, constants_TURN_CORRIDOR_MULTIPLIER as TURN_CORRIDOR_MULTIPLIER, constants_TURN_LOOKAHEAD_DISTANCE_METERS as TURN_LOOKAHEAD_DISTANCE_METERS };
486
490
  }
487
491
 
488
- export { type BuildOptions, type CameraOptions, constants_d as Constants, Coordinate, CustomRouteBuilder, type CustomWaypoint, type DirectionsLeg, type DirectionsManeuver, type DirectionsOptions, type DirectionsProvider, type DirectionsResult, type DirectionsStep, type Kalman2DState, KalmanFilter2D, type MapRendererAdapter, type ORSConfig, type ORSProfile, type OSRMConfig, OSRMDirectionsProvider, OpenRouteServiceProvider, RouteSnapper, type RouteStyle, type SnapResult, type SnapperOptions, type ValhallaConfig, type ValhallaCostingModel, ValhallaDirectionsProvider, type VehicleStyle, type WaypointOptions, buildForwardCumulativeDistances, buildReverseCumulativeDistances, getBearingBetweenPoints, interpolatePoint, kalmanUpdate2D, normalizeAngle, projectPointOnSegment };
492
+ export { type BuildOptions, type CameraOptions, constants as Constants, Coordinate, CustomRouteBuilder, type CustomWaypoint, type DirectionsLeg, type DirectionsManeuver, type DirectionsOptions, type DirectionsProvider, type DirectionsResult, type DirectionsStep, type Kalman2DState, KalmanFilter2D, type MapRendererAdapter, type ORSConfig, type ORSProfile, type OSRMConfig, OSRMDirectionsProvider, OpenRouteServiceProvider, RouteSnapper, type RouteStyle, type SnapResult, type SnapperOptions, type ValhallaConfig, type ValhallaCostingModel, ValhallaDirectionsProvider, type VehicleStyle, type WaypointOptions, buildForwardCumulativeDistances, buildReverseCumulativeDistances, getBearingBetweenPoints, interpolatePoint, kalmanUpdate2D, normalizeAngle, projectPointOnSegment };
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Coordinate, g as NavCoreState } from './NavCore.d-BuXR5DO7.js';
2
- export { F as FEATURES, a as FeatureKey, L as LicenseManager, b as LicensePayload, c as LicenseStatus, o as destinationPoint, p as geoGetBearing, q as haversineDistance } from './NavCore.d-BuXR5DO7.js';
1
+ import { C as Coordinate, g as NavCoreState } from './NavCore-qf5_0qsR.js';
2
+ export { F as FEATURES, a as FeatureKey, L as LicenseManager, b as LicensePayload, c as LicenseStatus, o as destinationPoint, p as geoGetBearing, q as haversineDistance } from './NavCore-qf5_0qsR.js';
3
3
 
4
4
  /**
5
5
  * Bearing and angular math utilities.
@@ -430,6 +430,8 @@ declare const BASE_CORRIDOR_METERS = 25;
430
430
  declare const MAX_CORRIDOR_METERS = 60;
431
431
  declare const SPEED_CORRIDOR_FACTOR = 1.2;
432
432
  declare const GPS_ACCURACY_FACTOR = 0.5;
433
+ declare const TURN_LOOKAHEAD_DISTANCE_METERS = 40;
434
+ declare const TURN_CORRIDOR_MULTIPLIER = 1.4;
433
435
  declare const MAX_SNAP_DISTANCE = 80;
434
436
  declare const BEARING_MISMATCH_THRESHOLD = 90;
435
437
  declare const BEARING_MISMATCH_PENALTY = 500;
@@ -454,35 +456,37 @@ declare const MIN_LOOK_AHEAD_METERS = 20;
454
456
  declare const MAX_LOOK_AHEAD_METERS = 100;
455
457
  declare const ARRIVAL_THRESHOLD_METERS = 30;
456
458
 
457
- declare const constants_d_ARRIVAL_THRESHOLD_METERS: typeof ARRIVAL_THRESHOLD_METERS;
458
- declare const constants_d_BASE_CORRIDOR_METERS: typeof BASE_CORRIDOR_METERS;
459
- declare const constants_d_BEARING_ALIGNMENT_THRESHOLD: typeof BEARING_ALIGNMENT_THRESHOLD;
460
- declare const constants_d_BEARING_MIN_SPEED_MPS: typeof BEARING_MIN_SPEED_MPS;
461
- declare const constants_d_BEARING_MISMATCH_PENALTY: typeof BEARING_MISMATCH_PENALTY;
462
- declare const constants_d_BEARING_MISMATCH_THRESHOLD: typeof BEARING_MISMATCH_THRESHOLD;
463
- declare const constants_d_BEARING_SMOOTHING_ALPHA: typeof BEARING_SMOOTHING_ALPHA;
464
- declare const constants_d_BETA_CORRECTION: typeof BETA_CORRECTION;
465
- declare const constants_d_DETOUR_COMMIT_MS: typeof DETOUR_COMMIT_MS;
466
- declare const constants_d_DR_MAX_AGE_MS: typeof DR_MAX_AGE_MS;
467
- declare const constants_d_GPS_ACCURACY_FACTOR: typeof GPS_ACCURACY_FACTOR;
468
- declare const constants_d_GPS_AGE_CAP_SECONDS: typeof GPS_AGE_CAP_SECONDS;
469
- declare const constants_d_GPS_STALE_MS: typeof GPS_STALE_MS;
470
- declare const constants_d_INERTIA_PENALTY: typeof INERTIA_PENALTY;
471
- declare const constants_d_INERTIA_SEGMENT_DIST: typeof INERTIA_SEGMENT_DIST;
472
- declare const constants_d_LOOK_AHEAD_SECONDS: typeof LOOK_AHEAD_SECONDS;
473
- declare const constants_d_MANEUVER_TRIGGER_DIST: typeof MANEUVER_TRIGGER_DIST;
474
- declare const constants_d_MAX_CORRIDOR_METERS: typeof MAX_CORRIDOR_METERS;
475
- declare const constants_d_MAX_LOOK_AHEAD_METERS: typeof MAX_LOOK_AHEAD_METERS;
476
- declare const constants_d_MAX_SNAP_DISTANCE: typeof MAX_SNAP_DISTANCE;
477
- declare const constants_d_MIN_LOOK_AHEAD_METERS: typeof MIN_LOOK_AHEAD_METERS;
478
- declare const constants_d_OFF_ROUTE_CONFIRM_MS: typeof OFF_ROUTE_CONFIRM_MS;
479
- declare const constants_d_REJOIN_CONFIRM_MS: typeof REJOIN_CONFIRM_MS;
480
- declare const constants_d_REJOIN_COOLDOWN_MS: typeof REJOIN_COOLDOWN_MS;
481
- declare const constants_d_SNAP_WINDOW_SIZE: typeof SNAP_WINDOW_SIZE;
482
- declare const constants_d_SPEED_CORRIDOR_FACTOR: typeof SPEED_CORRIDOR_FACTOR;
483
- declare const constants_d_STARTUP_GRACE_MS: typeof STARTUP_GRACE_MS;
484
- declare namespace constants_d {
485
- export { constants_d_ARRIVAL_THRESHOLD_METERS as ARRIVAL_THRESHOLD_METERS, constants_d_BASE_CORRIDOR_METERS as BASE_CORRIDOR_METERS, constants_d_BEARING_ALIGNMENT_THRESHOLD as BEARING_ALIGNMENT_THRESHOLD, constants_d_BEARING_MIN_SPEED_MPS as BEARING_MIN_SPEED_MPS, constants_d_BEARING_MISMATCH_PENALTY as BEARING_MISMATCH_PENALTY, constants_d_BEARING_MISMATCH_THRESHOLD as BEARING_MISMATCH_THRESHOLD, constants_d_BEARING_SMOOTHING_ALPHA as BEARING_SMOOTHING_ALPHA, constants_d_BETA_CORRECTION as BETA_CORRECTION, constants_d_DETOUR_COMMIT_MS as DETOUR_COMMIT_MS, constants_d_DR_MAX_AGE_MS as DR_MAX_AGE_MS, constants_d_GPS_ACCURACY_FACTOR as GPS_ACCURACY_FACTOR, constants_d_GPS_AGE_CAP_SECONDS as GPS_AGE_CAP_SECONDS, constants_d_GPS_STALE_MS as GPS_STALE_MS, constants_d_INERTIA_PENALTY as INERTIA_PENALTY, constants_d_INERTIA_SEGMENT_DIST as INERTIA_SEGMENT_DIST, constants_d_LOOK_AHEAD_SECONDS as LOOK_AHEAD_SECONDS, constants_d_MANEUVER_TRIGGER_DIST as MANEUVER_TRIGGER_DIST, constants_d_MAX_CORRIDOR_METERS as MAX_CORRIDOR_METERS, constants_d_MAX_LOOK_AHEAD_METERS as MAX_LOOK_AHEAD_METERS, constants_d_MAX_SNAP_DISTANCE as MAX_SNAP_DISTANCE, constants_d_MIN_LOOK_AHEAD_METERS as MIN_LOOK_AHEAD_METERS, constants_d_OFF_ROUTE_CONFIRM_MS as OFF_ROUTE_CONFIRM_MS, constants_d_REJOIN_CONFIRM_MS as REJOIN_CONFIRM_MS, constants_d_REJOIN_COOLDOWN_MS as REJOIN_COOLDOWN_MS, constants_d_SNAP_WINDOW_SIZE as SNAP_WINDOW_SIZE, constants_d_SPEED_CORRIDOR_FACTOR as SPEED_CORRIDOR_FACTOR, constants_d_STARTUP_GRACE_MS as STARTUP_GRACE_MS };
459
+ declare const constants_ARRIVAL_THRESHOLD_METERS: typeof ARRIVAL_THRESHOLD_METERS;
460
+ declare const constants_BASE_CORRIDOR_METERS: typeof BASE_CORRIDOR_METERS;
461
+ declare const constants_BEARING_ALIGNMENT_THRESHOLD: typeof BEARING_ALIGNMENT_THRESHOLD;
462
+ declare const constants_BEARING_MIN_SPEED_MPS: typeof BEARING_MIN_SPEED_MPS;
463
+ declare const constants_BEARING_MISMATCH_PENALTY: typeof BEARING_MISMATCH_PENALTY;
464
+ declare const constants_BEARING_MISMATCH_THRESHOLD: typeof BEARING_MISMATCH_THRESHOLD;
465
+ declare const constants_BEARING_SMOOTHING_ALPHA: typeof BEARING_SMOOTHING_ALPHA;
466
+ declare const constants_BETA_CORRECTION: typeof BETA_CORRECTION;
467
+ declare const constants_DETOUR_COMMIT_MS: typeof DETOUR_COMMIT_MS;
468
+ declare const constants_DR_MAX_AGE_MS: typeof DR_MAX_AGE_MS;
469
+ declare const constants_GPS_ACCURACY_FACTOR: typeof GPS_ACCURACY_FACTOR;
470
+ declare const constants_GPS_AGE_CAP_SECONDS: typeof GPS_AGE_CAP_SECONDS;
471
+ declare const constants_GPS_STALE_MS: typeof GPS_STALE_MS;
472
+ declare const constants_INERTIA_PENALTY: typeof INERTIA_PENALTY;
473
+ declare const constants_INERTIA_SEGMENT_DIST: typeof INERTIA_SEGMENT_DIST;
474
+ declare const constants_LOOK_AHEAD_SECONDS: typeof LOOK_AHEAD_SECONDS;
475
+ declare const constants_MANEUVER_TRIGGER_DIST: typeof MANEUVER_TRIGGER_DIST;
476
+ declare const constants_MAX_CORRIDOR_METERS: typeof MAX_CORRIDOR_METERS;
477
+ declare const constants_MAX_LOOK_AHEAD_METERS: typeof MAX_LOOK_AHEAD_METERS;
478
+ declare const constants_MAX_SNAP_DISTANCE: typeof MAX_SNAP_DISTANCE;
479
+ declare const constants_MIN_LOOK_AHEAD_METERS: typeof MIN_LOOK_AHEAD_METERS;
480
+ declare const constants_OFF_ROUTE_CONFIRM_MS: typeof OFF_ROUTE_CONFIRM_MS;
481
+ declare const constants_REJOIN_CONFIRM_MS: typeof REJOIN_CONFIRM_MS;
482
+ declare const constants_REJOIN_COOLDOWN_MS: typeof REJOIN_COOLDOWN_MS;
483
+ declare const constants_SNAP_WINDOW_SIZE: typeof SNAP_WINDOW_SIZE;
484
+ declare const constants_SPEED_CORRIDOR_FACTOR: typeof SPEED_CORRIDOR_FACTOR;
485
+ declare const constants_STARTUP_GRACE_MS: typeof STARTUP_GRACE_MS;
486
+ declare const constants_TURN_CORRIDOR_MULTIPLIER: typeof TURN_CORRIDOR_MULTIPLIER;
487
+ declare const constants_TURN_LOOKAHEAD_DISTANCE_METERS: typeof TURN_LOOKAHEAD_DISTANCE_METERS;
488
+ declare namespace constants {
489
+ export { constants_ARRIVAL_THRESHOLD_METERS as ARRIVAL_THRESHOLD_METERS, constants_BASE_CORRIDOR_METERS as BASE_CORRIDOR_METERS, constants_BEARING_ALIGNMENT_THRESHOLD as BEARING_ALIGNMENT_THRESHOLD, constants_BEARING_MIN_SPEED_MPS as BEARING_MIN_SPEED_MPS, constants_BEARING_MISMATCH_PENALTY as BEARING_MISMATCH_PENALTY, constants_BEARING_MISMATCH_THRESHOLD as BEARING_MISMATCH_THRESHOLD, constants_BEARING_SMOOTHING_ALPHA as BEARING_SMOOTHING_ALPHA, constants_BETA_CORRECTION as BETA_CORRECTION, constants_DETOUR_COMMIT_MS as DETOUR_COMMIT_MS, constants_DR_MAX_AGE_MS as DR_MAX_AGE_MS, constants_GPS_ACCURACY_FACTOR as GPS_ACCURACY_FACTOR, constants_GPS_AGE_CAP_SECONDS as GPS_AGE_CAP_SECONDS, constants_GPS_STALE_MS as GPS_STALE_MS, constants_INERTIA_PENALTY as INERTIA_PENALTY, constants_INERTIA_SEGMENT_DIST as INERTIA_SEGMENT_DIST, constants_LOOK_AHEAD_SECONDS as LOOK_AHEAD_SECONDS, constants_MANEUVER_TRIGGER_DIST as MANEUVER_TRIGGER_DIST, constants_MAX_CORRIDOR_METERS as MAX_CORRIDOR_METERS, constants_MAX_LOOK_AHEAD_METERS as MAX_LOOK_AHEAD_METERS, constants_MAX_SNAP_DISTANCE as MAX_SNAP_DISTANCE, constants_MIN_LOOK_AHEAD_METERS as MIN_LOOK_AHEAD_METERS, constants_OFF_ROUTE_CONFIRM_MS as OFF_ROUTE_CONFIRM_MS, constants_REJOIN_CONFIRM_MS as REJOIN_CONFIRM_MS, constants_REJOIN_COOLDOWN_MS as REJOIN_COOLDOWN_MS, constants_SNAP_WINDOW_SIZE as SNAP_WINDOW_SIZE, constants_SPEED_CORRIDOR_FACTOR as SPEED_CORRIDOR_FACTOR, constants_STARTUP_GRACE_MS as STARTUP_GRACE_MS, constants_TURN_CORRIDOR_MULTIPLIER as TURN_CORRIDOR_MULTIPLIER, constants_TURN_LOOKAHEAD_DISTANCE_METERS as TURN_LOOKAHEAD_DISTANCE_METERS };
486
490
  }
487
491
 
488
- export { type BuildOptions, type CameraOptions, constants_d as Constants, Coordinate, CustomRouteBuilder, type CustomWaypoint, type DirectionsLeg, type DirectionsManeuver, type DirectionsOptions, type DirectionsProvider, type DirectionsResult, type DirectionsStep, type Kalman2DState, KalmanFilter2D, type MapRendererAdapter, type ORSConfig, type ORSProfile, type OSRMConfig, OSRMDirectionsProvider, OpenRouteServiceProvider, RouteSnapper, type RouteStyle, type SnapResult, type SnapperOptions, type ValhallaConfig, type ValhallaCostingModel, ValhallaDirectionsProvider, type VehicleStyle, type WaypointOptions, buildForwardCumulativeDistances, buildReverseCumulativeDistances, getBearingBetweenPoints, interpolatePoint, kalmanUpdate2D, normalizeAngle, projectPointOnSegment };
492
+ export { type BuildOptions, type CameraOptions, constants as Constants, Coordinate, CustomRouteBuilder, type CustomWaypoint, type DirectionsLeg, type DirectionsManeuver, type DirectionsOptions, type DirectionsProvider, type DirectionsResult, type DirectionsStep, type Kalman2DState, KalmanFilter2D, type MapRendererAdapter, type ORSConfig, type ORSProfile, type OSRMConfig, OSRMDirectionsProvider, OpenRouteServiceProvider, RouteSnapper, type RouteStyle, type SnapResult, type SnapperOptions, type ValhallaConfig, type ValhallaCostingModel, ValhallaDirectionsProvider, type VehicleStyle, type WaypointOptions, buildForwardCumulativeDistances, buildReverseCumulativeDistances, getBearingBetweenPoints, interpolatePoint, kalmanUpdate2D, normalizeAngle, projectPointOnSegment };