working companion prototype

This commit is contained in:
2025-11-24 23:32:36 +01:00
parent e7978024d7
commit e2bea9a126
175 changed files with 23227 additions and 3519 deletions

View File

@@ -0,0 +1,18 @@
/**
* Value object representing the user's authentication state with iRacing.
*
* This is used to track whether the user has a valid session for automation
* without GridPilot ever seeing or storing credentials (zero-knowledge design).
*/
export const AuthenticationState = {
/** Authentication status has not yet been checked */
UNKNOWN: 'UNKNOWN',
/** Valid session exists and is ready for automation */
AUTHENTICATED: 'AUTHENTICATED',
/** Session was valid but has expired, re-authentication required */
EXPIRED: 'EXPIRED',
/** User explicitly logged out, clearing the session */
LOGGED_OUT: 'LOGGED_OUT',
} as const;
export type AuthenticationState = typeof AuthenticationState[keyof typeof AuthenticationState];

View File

@@ -93,4 +93,6 @@ export const DEFAULT_CONFIDENCE = {
LOW: 0.8,
/** Minimum acceptable confidence */
MINIMUM: 0.7,
/** Very low confidence for testing/debugging template matching issues */
DEBUG: 0.5,
} as const;

View File

@@ -9,8 +9,8 @@ export class StepId {
if (!Number.isInteger(value)) {
throw new Error('StepId must be an integer');
}
if (value < 1 || value > 18) {
throw new Error('StepId must be between 1 and 18');
if (value < 1 || value > 17) {
throw new Error('StepId must be between 1 and 17');
}
return new StepId(value);
}
@@ -28,7 +28,7 @@ export class StepId {
}
isFinalStep(): boolean {
return this._value === 18;
return this._value === 17;
}
next(): StepId {