@skyvexsoftware/stratos-sdk 0.1.1
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/LICENSE +21 -0
- package/README.md +201 -0
- package/dist/helpers/createPlugin.d.ts +22 -0
- package/dist/helpers/createPlugin.js +32 -0
- package/dist/helpers/index.d.ts +4 -0
- package/dist/helpers/index.js +3 -0
- package/dist/helpers/units.d.ts +36 -0
- package/dist/helpers/units.js +101 -0
- package/dist/hooks/context.d.ts +12 -0
- package/dist/hooks/context.js +18 -0
- package/dist/hooks/index.d.ts +16 -0
- package/dist/hooks/index.js +16 -0
- package/dist/hooks/useFlightEvents.d.ts +37 -0
- package/dist/hooks/useFlightEvents.js +152 -0
- package/dist/hooks/useFlightManager.d.ts +20 -0
- package/dist/hooks/useFlightManager.js +90 -0
- package/dist/hooks/useFlightPhase.d.ts +31 -0
- package/dist/hooks/useFlightPhase.js +67 -0
- package/dist/hooks/useLandingAnalysis.d.ts +37 -0
- package/dist/hooks/useLandingAnalysis.js +87 -0
- package/dist/hooks/usePluginLogger.d.ts +13 -0
- package/dist/hooks/usePluginLogger.js +16 -0
- package/dist/hooks/useShellAuth.d.ts +14 -0
- package/dist/hooks/useShellAuth.js +13 -0
- package/dist/hooks/useShellConfig.d.ts +14 -0
- package/dist/hooks/useShellConfig.js +14 -0
- package/dist/hooks/useShellNavigation.d.ts +12 -0
- package/dist/hooks/useShellNavigation.js +15 -0
- package/dist/hooks/useShellToast.d.ts +12 -0
- package/dist/hooks/useShellToast.js +15 -0
- package/dist/hooks/useSimData.d.ts +70 -0
- package/dist/hooks/useSimData.js +135 -0
- package/dist/hooks/useSimulatorData.d.ts +57 -0
- package/dist/hooks/useSimulatorData.js +258 -0
- package/dist/hooks/useTrackingSession.d.ts +40 -0
- package/dist/hooks/useTrackingSession.js +152 -0
- package/dist/icons.d.ts +13 -0
- package/dist/icons.js +13 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +28 -0
- package/dist/shared-types/flight-manager.d.ts +112 -0
- package/dist/shared-types/flight-manager.js +2 -0
- package/dist/shared-types/index.d.ts +7 -0
- package/dist/shared-types/index.js +4 -0
- package/dist/shared-types/simulator.d.ts +386 -0
- package/dist/shared-types/simulator.js +48 -0
- package/dist/shared-types/socket-events.d.ts +171 -0
- package/dist/shared-types/socket-events.js +79 -0
- package/dist/shared-types/theme.d.ts +3 -0
- package/dist/shared-types/theme.js +2 -0
- package/dist/types/context.d.ts +206 -0
- package/dist/types/context.js +8 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +2 -0
- package/dist/types/manifest.d.ts +42 -0
- package/dist/types/manifest.js +12 -0
- package/dist/types/module.d.ts +31 -0
- package/dist/types/module.js +7 -0
- package/dist/ui/alert-dialog.d.ts +21 -0
- package/dist/ui/alert-dialog.js +27 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/badge.js +21 -0
- package/dist/ui/button.d.ts +17 -0
- package/dist/ui/button.js +39 -0
- package/dist/ui/card.d.ts +10 -0
- package/dist/ui/card.js +25 -0
- package/dist/ui/dialog.d.ts +14 -0
- package/dist/ui/dialog.js +25 -0
- package/dist/ui/index.d.ts +18 -0
- package/dist/ui/index.js +16 -0
- package/dist/ui/input.d.ts +4 -0
- package/dist/ui/input.js +7 -0
- package/dist/ui/label.d.ts +5 -0
- package/dist/ui/label.js +8 -0
- package/dist/ui/radio-group.d.ts +6 -0
- package/dist/ui/radio-group.js +11 -0
- package/dist/ui/select.d.ts +14 -0
- package/dist/ui/select.js +27 -0
- package/dist/ui/separator.d.ts +5 -0
- package/dist/ui/separator.js +8 -0
- package/dist/ui/slider.d.ts +5 -0
- package/dist/ui/slider.js +8 -0
- package/dist/ui/switch.d.ts +13 -0
- package/dist/ui/switch.js +9 -0
- package/dist/ui/tabs.d.ts +8 -0
- package/dist/ui/tabs.js +13 -0
- package/dist/ui/textarea.d.ts +4 -0
- package/dist/ui/textarea.js +7 -0
- package/dist/ui/tooltip.d.ts +8 -0
- package/dist/ui/tooltip.js +11 -0
- package/dist/utils/cn.d.ts +3 -0
- package/dist/utils/cn.js +6 -0
- package/dist/vite/externals.d.ts +9 -0
- package/dist/vite/externals.js +19 -0
- package/dist/vite/plugin-config.d.ts +49 -0
- package/dist/vite/plugin-config.js +236 -0
- package/dist/vite/serve-externals.d.ts +9 -0
- package/dist/vite/serve-externals.js +78 -0
- package/dist/vite/stratos-dev-server.d.ts +21 -0
- package/dist/vite/stratos-dev-server.js +188 -0
- package/package.json +96 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared flight simulation types for use by plugins.
|
|
3
|
+
*
|
|
4
|
+
* These are the canonical definitions of flight data structures.
|
|
5
|
+
* Comprehensive flight data variables for VA platform compatibility.
|
|
6
|
+
*/
|
|
7
|
+
/** Supported simulator types */
|
|
8
|
+
export declare enum SimulatorType {
|
|
9
|
+
XPLANE = "xplane",
|
|
10
|
+
MSFS = "msfs",
|
|
11
|
+
FSX = "fsx",
|
|
12
|
+
P3D = "p3d",
|
|
13
|
+
UNKNOWN = "unknown"
|
|
14
|
+
}
|
|
15
|
+
/** Flight phase detection states */
|
|
16
|
+
export declare enum FlightPhase {
|
|
17
|
+
UNKNOWN = "unknown",
|
|
18
|
+
BOARDING = "boarding",
|
|
19
|
+
PUSH_BACK = "push_back",
|
|
20
|
+
TAXI = "taxi",
|
|
21
|
+
TAKE_OFF = "take_off",
|
|
22
|
+
REJECTED_TAKE_OFF = "rejected_take_off",
|
|
23
|
+
CLIMB = "climb",
|
|
24
|
+
CRUISE = "cruise",
|
|
25
|
+
DESCENT = "descent",
|
|
26
|
+
APPROACH = "approach",
|
|
27
|
+
FINAL = "final",
|
|
28
|
+
LANDED = "landed",
|
|
29
|
+
GO_AROUND = "go_around",
|
|
30
|
+
TAXI_IN = "taxi_in",
|
|
31
|
+
ARRIVED = "arrived",
|
|
32
|
+
DEBOARDING = "deboarding"
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Core flight data — standardized across all simulators.
|
|
36
|
+
* Comprehensive flight data variables for VA platform compatibility.
|
|
37
|
+
*/
|
|
38
|
+
export type FlightData = {
|
|
39
|
+
latitude: number;
|
|
40
|
+
longitude: number;
|
|
41
|
+
altitude: number;
|
|
42
|
+
altitudeAgl: number;
|
|
43
|
+
altitudeAglGear: number;
|
|
44
|
+
groundSpeed: number;
|
|
45
|
+
indicatedAirspeed: number;
|
|
46
|
+
trueAirspeed: number;
|
|
47
|
+
verticalSpeed: number;
|
|
48
|
+
heading: number;
|
|
49
|
+
pitch: number;
|
|
50
|
+
bank: number;
|
|
51
|
+
gearControl: boolean;
|
|
52
|
+
flapsControl: number;
|
|
53
|
+
flapsLeftPosition: number;
|
|
54
|
+
flapsRightPosition: number;
|
|
55
|
+
planeOnground: boolean;
|
|
56
|
+
enginesCount: number;
|
|
57
|
+
engine1Firing: boolean;
|
|
58
|
+
engine2Firing: boolean;
|
|
59
|
+
engine3Firing: boolean;
|
|
60
|
+
engine4Firing: boolean;
|
|
61
|
+
engine1N1: number;
|
|
62
|
+
engine2N1: number;
|
|
63
|
+
engine3N1: number;
|
|
64
|
+
engine4N1: number;
|
|
65
|
+
engine1N2: number;
|
|
66
|
+
engine2N2: number;
|
|
67
|
+
engine3N2: number;
|
|
68
|
+
engine4N2: number;
|
|
69
|
+
engine1PctRpm: number;
|
|
70
|
+
engine2PctRpm: number;
|
|
71
|
+
engine3PctRpm: number;
|
|
72
|
+
engine4PctRpm: number;
|
|
73
|
+
fuelTotalQuantityWeight: number;
|
|
74
|
+
fuelUsed: number;
|
|
75
|
+
windDirection: number;
|
|
76
|
+
windSpeed: number;
|
|
77
|
+
pressureQNH: number;
|
|
78
|
+
altimeterSettings: number;
|
|
79
|
+
clockHour: number;
|
|
80
|
+
clockMin: number;
|
|
81
|
+
clockSec: number;
|
|
82
|
+
zuluHour: number;
|
|
83
|
+
zuluMin: number;
|
|
84
|
+
zuluDayOfMonth: number;
|
|
85
|
+
zuluMonthOfYear: number;
|
|
86
|
+
zuluYear: number;
|
|
87
|
+
localDayOfMonth: number;
|
|
88
|
+
localMonthOfYear: number;
|
|
89
|
+
localYear: number;
|
|
90
|
+
aircraftType: string;
|
|
91
|
+
aircraftIcao: string;
|
|
92
|
+
aircraftLivery: string;
|
|
93
|
+
aircraftEmptyWeight: number;
|
|
94
|
+
zeroWeightPlusPayload: number;
|
|
95
|
+
simulatorVersion: string;
|
|
96
|
+
pauseFlag: boolean;
|
|
97
|
+
slewMode: boolean;
|
|
98
|
+
simulationRate: number;
|
|
99
|
+
isInMenu: boolean;
|
|
100
|
+
isXPlane: boolean;
|
|
101
|
+
stallWarning: boolean;
|
|
102
|
+
overspeedWarning: boolean;
|
|
103
|
+
crashed: boolean;
|
|
104
|
+
gForceTouchDown: number;
|
|
105
|
+
landingRate: number;
|
|
106
|
+
touchdownNormalVelocity: number;
|
|
107
|
+
touchdownLatitude: number;
|
|
108
|
+
touchdownLongitude: number;
|
|
109
|
+
landingDistance: number;
|
|
110
|
+
glideslopeDeviation?: number;
|
|
111
|
+
localizerDeviation?: number;
|
|
112
|
+
hasGlideslope?: boolean;
|
|
113
|
+
reverser1Deployed?: boolean;
|
|
114
|
+
reverser2Deployed?: boolean;
|
|
115
|
+
autobrakePosition?: number;
|
|
116
|
+
speedbrakePosition?: number;
|
|
117
|
+
transponderFreq: string;
|
|
118
|
+
com1Freq: string;
|
|
119
|
+
com2Freq: string;
|
|
120
|
+
nav1Freq: string;
|
|
121
|
+
nav2Freq: string;
|
|
122
|
+
milesToGo: number;
|
|
123
|
+
cruiseAltitude: number;
|
|
124
|
+
phase: FlightPhase;
|
|
125
|
+
phaseString: string;
|
|
126
|
+
timestamp: number;
|
|
127
|
+
updateCounter?: number;
|
|
128
|
+
_debug?: FlightStateDebugInfo;
|
|
129
|
+
};
|
|
130
|
+
/** A snapshot of flight data at a point in time, used by FlightDataSampler */
|
|
131
|
+
export type FlightDataSnapshot = {
|
|
132
|
+
timestamp: number;
|
|
133
|
+
altitude: number;
|
|
134
|
+
altitudeAgl: number;
|
|
135
|
+
groundSpeed: number;
|
|
136
|
+
verticalSpeed: number;
|
|
137
|
+
heading: number;
|
|
138
|
+
latitude: number;
|
|
139
|
+
longitude: number;
|
|
140
|
+
planeOnground: boolean;
|
|
141
|
+
pitch: number;
|
|
142
|
+
engine1N1: number;
|
|
143
|
+
engine2N1: number;
|
|
144
|
+
engine3N1: number;
|
|
145
|
+
engine4N1: number;
|
|
146
|
+
};
|
|
147
|
+
/** Calculated trend data from multiple flight data samples */
|
|
148
|
+
export type FlightTrends = {
|
|
149
|
+
/** Average vertical speed over sample window (fpm) */
|
|
150
|
+
avgVerticalSpeed: number;
|
|
151
|
+
/** Average ground speed over sample window (knots) */
|
|
152
|
+
avgGroundSpeed: number;
|
|
153
|
+
/** Altitude change rate calculated from actual altitude difference (fpm) */
|
|
154
|
+
altitudeChangeRate: number;
|
|
155
|
+
/** True if consistently climbing (positive altitude trend) */
|
|
156
|
+
isClimbing: boolean;
|
|
157
|
+
/** True if consistently descending (negative altitude trend) */
|
|
158
|
+
isDescending: boolean;
|
|
159
|
+
/** True if relatively level flight */
|
|
160
|
+
isLevel: boolean;
|
|
161
|
+
/** True if accelerating on ground (potential takeoff roll) */
|
|
162
|
+
isAccelerating: boolean;
|
|
163
|
+
/** True if decelerating on ground (potential landing rollout) */
|
|
164
|
+
isDecelerating: boolean;
|
|
165
|
+
/** Highest N1 across all engines */
|
|
166
|
+
highestN1: number;
|
|
167
|
+
/** True if any engine has significant thrust */
|
|
168
|
+
hasThrust: boolean;
|
|
169
|
+
/** Number of samples in the window */
|
|
170
|
+
sampleCount: number;
|
|
171
|
+
/** Time span of samples in ms */
|
|
172
|
+
timeSpanMs: number;
|
|
173
|
+
/** True if we have enough samples for reliable trend detection */
|
|
174
|
+
hasReliableData: boolean;
|
|
175
|
+
};
|
|
176
|
+
/** Pending phase transition info (from FlightStateManager) */
|
|
177
|
+
export type PendingPhaseTransition = {
|
|
178
|
+
phase: FlightPhase;
|
|
179
|
+
elapsed: number;
|
|
180
|
+
required: number;
|
|
181
|
+
};
|
|
182
|
+
/** Payload for the flight:phase Socket.io event */
|
|
183
|
+
export type FlightPhasePayload = {
|
|
184
|
+
previousPhase: FlightPhase;
|
|
185
|
+
currentPhase: FlightPhase;
|
|
186
|
+
timestamp: number;
|
|
187
|
+
pendingTransition?: PendingPhaseTransition;
|
|
188
|
+
};
|
|
189
|
+
/** Simulator connection status */
|
|
190
|
+
export type SimulatorStatus = "disconnected" | "connecting" | "connected" | "error";
|
|
191
|
+
/** Event categories for filtering/display */
|
|
192
|
+
export declare enum EventCategory {
|
|
193
|
+
SYSTEM = "system",
|
|
194
|
+
PHASE = "phase",
|
|
195
|
+
CONTROLS = "controls",
|
|
196
|
+
ENGINE = "engine",
|
|
197
|
+
WARNING = "warning",
|
|
198
|
+
POSITION = "position",
|
|
199
|
+
COMMENT = "comment"
|
|
200
|
+
}
|
|
201
|
+
/** Flight log event entry */
|
|
202
|
+
export type FlightLogEvent = {
|
|
203
|
+
eventId: string;
|
|
204
|
+
eventTimestamp: string;
|
|
205
|
+
eventElapsedTime: number;
|
|
206
|
+
eventCondition: string;
|
|
207
|
+
category: EventCategory;
|
|
208
|
+
message: string;
|
|
209
|
+
data?: Record<string, unknown>;
|
|
210
|
+
};
|
|
211
|
+
/** History report entry (position sample) */
|
|
212
|
+
export type HistoryReportEntry = {
|
|
213
|
+
timestamp: number;
|
|
214
|
+
elapsedTime: number;
|
|
215
|
+
latitude: number;
|
|
216
|
+
longitude: number;
|
|
217
|
+
altitude: number;
|
|
218
|
+
altitudeAgl: number;
|
|
219
|
+
heading: number;
|
|
220
|
+
groundSpeed: number;
|
|
221
|
+
indicatedAirspeed: number;
|
|
222
|
+
verticalSpeed: number;
|
|
223
|
+
pitch: number;
|
|
224
|
+
bank: number;
|
|
225
|
+
phase: FlightPhase;
|
|
226
|
+
planeOnground: boolean;
|
|
227
|
+
landingRate: number | null;
|
|
228
|
+
};
|
|
229
|
+
/** Payload for the flight:event Socket.io event */
|
|
230
|
+
export type FlightEventPayload = {
|
|
231
|
+
event: FlightLogEvent;
|
|
232
|
+
timestamp: number;
|
|
233
|
+
};
|
|
234
|
+
/** Capture point for landing analysis */
|
|
235
|
+
export type CapturePoint = {
|
|
236
|
+
timestamp: number;
|
|
237
|
+
altitude: number;
|
|
238
|
+
altitudeAgl: number;
|
|
239
|
+
verticalSpeed: number;
|
|
240
|
+
groundSpeed: number;
|
|
241
|
+
indicatedAirspeed: number;
|
|
242
|
+
latitude: number;
|
|
243
|
+
longitude: number;
|
|
244
|
+
pitch: number;
|
|
245
|
+
bank: number;
|
|
246
|
+
gForce: number;
|
|
247
|
+
heading: number;
|
|
248
|
+
glideslopeDeviation: number | null;
|
|
249
|
+
localizerDeviation: number | null;
|
|
250
|
+
flapsControl: number;
|
|
251
|
+
windDirection: number;
|
|
252
|
+
windSpeed: number;
|
|
253
|
+
totalFuelLbs: number;
|
|
254
|
+
};
|
|
255
|
+
/** Bounce data — captured when aircraft becomes airborne after touchdown */
|
|
256
|
+
export type BounceData = {
|
|
257
|
+
bounceNumber: number;
|
|
258
|
+
timestamp: number;
|
|
259
|
+
maxAltitudeAgl: number;
|
|
260
|
+
touchdownVerticalSpeed: number;
|
|
261
|
+
touchdownGForce: number;
|
|
262
|
+
durationMs: number;
|
|
263
|
+
};
|
|
264
|
+
/** Complete landing analysis result */
|
|
265
|
+
export type LandingAnalysis = {
|
|
266
|
+
landingRateFpm: number;
|
|
267
|
+
simulatorVsAtTouchdown: number;
|
|
268
|
+
touchdownTimestamp: number;
|
|
269
|
+
touchdownLatitude: number;
|
|
270
|
+
touchdownLongitude: number;
|
|
271
|
+
touchdownHeading: number;
|
|
272
|
+
touchdownGroundSpeed: number;
|
|
273
|
+
touchdownPitch: number;
|
|
274
|
+
touchdownBank: number;
|
|
275
|
+
touchdownGForce: number;
|
|
276
|
+
approachAltitude: number;
|
|
277
|
+
approachIas: number;
|
|
278
|
+
approachVs: number;
|
|
279
|
+
approachTimestamp: number;
|
|
280
|
+
descentTimeSeconds: number;
|
|
281
|
+
averageDescentRateFpm: number;
|
|
282
|
+
bounceCount: number;
|
|
283
|
+
bounces: BounceData[];
|
|
284
|
+
landingDistanceFt: number;
|
|
285
|
+
captureQuality: "excellent" | "good" | "fair" | "poor";
|
|
286
|
+
captureNotes: string[];
|
|
287
|
+
};
|
|
288
|
+
/** Debug state for the landing analyzer */
|
|
289
|
+
export type LandingAnalyzerDebugState = {
|
|
290
|
+
isArmed: boolean;
|
|
291
|
+
hasCapturedApproach: boolean;
|
|
292
|
+
hasLanded: boolean;
|
|
293
|
+
isLandingSettled: boolean;
|
|
294
|
+
isBouncing: boolean;
|
|
295
|
+
bounceCount: number;
|
|
296
|
+
approachCapture: CapturePoint | null;
|
|
297
|
+
touchdownCapture: CapturePoint | null;
|
|
298
|
+
lastAirborneVs: number;
|
|
299
|
+
sampleCount: number;
|
|
300
|
+
samples: {
|
|
301
|
+
timestamp: number;
|
|
302
|
+
vs: number;
|
|
303
|
+
agl: number;
|
|
304
|
+
aglGear: number;
|
|
305
|
+
}[];
|
|
306
|
+
calculatedLandingRate: number | null;
|
|
307
|
+
landingAnalysis: LandingAnalysis | null;
|
|
308
|
+
};
|
|
309
|
+
/** High-frequency landing frame sample from the LandingFrameBuffer */
|
|
310
|
+
export type LandingSample = {
|
|
311
|
+
timestamp: number;
|
|
312
|
+
onGround: boolean;
|
|
313
|
+
verticalSpeed: number;
|
|
314
|
+
altitudeAgl: number;
|
|
315
|
+
altitudeAglGear: number;
|
|
316
|
+
gForce: number;
|
|
317
|
+
pitch: number;
|
|
318
|
+
bank: number;
|
|
319
|
+
groundSpeed: number;
|
|
320
|
+
latitude: number;
|
|
321
|
+
longitude: number;
|
|
322
|
+
glideslopeDeviation: number | null;
|
|
323
|
+
localizerDeviation: number | null;
|
|
324
|
+
};
|
|
325
|
+
/** Payload for the flight:landing Socket.io event */
|
|
326
|
+
export type FlightLandingPayload = {
|
|
327
|
+
type: "touchdown" | "bounce" | "settled";
|
|
328
|
+
timestamp: number;
|
|
329
|
+
landingAnalysis?: LandingAnalysis;
|
|
330
|
+
bounceData?: BounceData;
|
|
331
|
+
};
|
|
332
|
+
/** Snapshot returned by GET /api/simulator/snapshot for useSimData hydration */
|
|
333
|
+
export type SimDataSnapshot = {
|
|
334
|
+
data: FlightData | null;
|
|
335
|
+
isConnected: boolean;
|
|
336
|
+
simulatorType: string | null;
|
|
337
|
+
};
|
|
338
|
+
/** Snapshot returned by GET /api/flight-phase/snapshot for useFlightPhase hydration */
|
|
339
|
+
export type FlightPhaseSnapshot = {
|
|
340
|
+
currentPhase: FlightPhase;
|
|
341
|
+
previousPhase: FlightPhase | null;
|
|
342
|
+
pendingTransition: PendingPhaseTransition | null;
|
|
343
|
+
trends: FlightTrends | null;
|
|
344
|
+
isTracking: boolean;
|
|
345
|
+
};
|
|
346
|
+
/** Snapshot returned by GET /api/flight-events for useFlightEvents hydration */
|
|
347
|
+
export type FlightEventsSnapshot = {
|
|
348
|
+
events: FlightLogEvent[];
|
|
349
|
+
isTracking: boolean;
|
|
350
|
+
elapsedTime: number;
|
|
351
|
+
};
|
|
352
|
+
/** Snapshot returned by GET /api/simulator/landing-analysis/snapshot for useLandingAnalysis hydration */
|
|
353
|
+
export type LandingAnalysisSnapshot = {
|
|
354
|
+
landingRate: number | null;
|
|
355
|
+
bounceCount: number;
|
|
356
|
+
touchdowns: BounceData[];
|
|
357
|
+
isOnGround: boolean;
|
|
358
|
+
approachData: CapturePoint | null;
|
|
359
|
+
landingAnalysis: LandingAnalysis | null;
|
|
360
|
+
};
|
|
361
|
+
/** Debug info from the main process FlightStateManager */
|
|
362
|
+
export type FlightStateDebugInfo = {
|
|
363
|
+
trends: FlightTrends;
|
|
364
|
+
pendingTransition: {
|
|
365
|
+
phase: string;
|
|
366
|
+
startTime: number;
|
|
367
|
+
elapsedSeconds: number;
|
|
368
|
+
requiredDelay: number;
|
|
369
|
+
altDelta?: number;
|
|
370
|
+
altGate?: number;
|
|
371
|
+
} | null;
|
|
372
|
+
levelFlight: {
|
|
373
|
+
beganAt: number | null;
|
|
374
|
+
durationSeconds: number | null;
|
|
375
|
+
startAlt: number | null;
|
|
376
|
+
altDelta: number | null;
|
|
377
|
+
};
|
|
378
|
+
samples: {
|
|
379
|
+
timestamp: number;
|
|
380
|
+
altitude: number;
|
|
381
|
+
verticalSpeed: number;
|
|
382
|
+
groundSpeed: number;
|
|
383
|
+
}[];
|
|
384
|
+
detectedCruiseAlt: number;
|
|
385
|
+
};
|
|
386
|
+
//# sourceMappingURL=simulator.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared flight simulation types for use by plugins.
|
|
3
|
+
*
|
|
4
|
+
* These are the canonical definitions of flight data structures.
|
|
5
|
+
* Comprehensive flight data variables for VA platform compatibility.
|
|
6
|
+
*/
|
|
7
|
+
/** Supported simulator types */
|
|
8
|
+
export var SimulatorType;
|
|
9
|
+
(function (SimulatorType) {
|
|
10
|
+
SimulatorType["XPLANE"] = "xplane";
|
|
11
|
+
SimulatorType["MSFS"] = "msfs";
|
|
12
|
+
SimulatorType["FSX"] = "fsx";
|
|
13
|
+
SimulatorType["P3D"] = "p3d";
|
|
14
|
+
SimulatorType["UNKNOWN"] = "unknown";
|
|
15
|
+
})(SimulatorType || (SimulatorType = {}));
|
|
16
|
+
/** Flight phase detection states */
|
|
17
|
+
export var FlightPhase;
|
|
18
|
+
(function (FlightPhase) {
|
|
19
|
+
FlightPhase["UNKNOWN"] = "unknown";
|
|
20
|
+
FlightPhase["BOARDING"] = "boarding";
|
|
21
|
+
FlightPhase["PUSH_BACK"] = "push_back";
|
|
22
|
+
FlightPhase["TAXI"] = "taxi";
|
|
23
|
+
FlightPhase["TAKE_OFF"] = "take_off";
|
|
24
|
+
FlightPhase["REJECTED_TAKE_OFF"] = "rejected_take_off";
|
|
25
|
+
FlightPhase["CLIMB"] = "climb";
|
|
26
|
+
FlightPhase["CRUISE"] = "cruise";
|
|
27
|
+
FlightPhase["DESCENT"] = "descent";
|
|
28
|
+
FlightPhase["APPROACH"] = "approach";
|
|
29
|
+
FlightPhase["FINAL"] = "final";
|
|
30
|
+
FlightPhase["LANDED"] = "landed";
|
|
31
|
+
FlightPhase["GO_AROUND"] = "go_around";
|
|
32
|
+
FlightPhase["TAXI_IN"] = "taxi_in";
|
|
33
|
+
FlightPhase["ARRIVED"] = "arrived";
|
|
34
|
+
FlightPhase["DEBOARDING"] = "deboarding";
|
|
35
|
+
})(FlightPhase || (FlightPhase = {}));
|
|
36
|
+
// ── Flight Event Types ─────────────────────────────────────────────────
|
|
37
|
+
/** Event categories for filtering/display */
|
|
38
|
+
export var EventCategory;
|
|
39
|
+
(function (EventCategory) {
|
|
40
|
+
EventCategory["SYSTEM"] = "system";
|
|
41
|
+
EventCategory["PHASE"] = "phase";
|
|
42
|
+
EventCategory["CONTROLS"] = "controls";
|
|
43
|
+
EventCategory["ENGINE"] = "engine";
|
|
44
|
+
EventCategory["WARNING"] = "warning";
|
|
45
|
+
EventCategory["POSITION"] = "position";
|
|
46
|
+
EventCategory["COMMENT"] = "comment";
|
|
47
|
+
})(EventCategory || (EventCategory = {}));
|
|
48
|
+
//# sourceMappingURL=simulator.js.map
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Socket.io Event Catalog — canonical event names and payload types.
|
|
3
|
+
*
|
|
4
|
+
* This file is the single source of truth for all Socket.io event schemas
|
|
5
|
+
* used across the Stratos platform. Both the shell (emitter) and SDK hooks
|
|
6
|
+
* (consumers) import from here so payloads are always in sync.
|
|
7
|
+
*
|
|
8
|
+
* ┌──────────────────────┬──────────────────────────────────────────────┐
|
|
9
|
+
* │ Event │ Payload Type │
|
|
10
|
+
* ├──────────────────────┼──────────────────────────────────────────────┤
|
|
11
|
+
* │ simulator:data │ SimulatorDataPayload │
|
|
12
|
+
* │ simulator:status │ SimulatorStatusPayload │
|
|
13
|
+
* │ flight:phase │ FlightPhasePayload │
|
|
14
|
+
* │ flight:event │ FlightEventPayload │
|
|
15
|
+
* │ flight:landing │ FlightLandingPayload │
|
|
16
|
+
* │ flight:manager │ FlightManagerPayload │
|
|
17
|
+
* │ flight:state │ (reserved for future use) │
|
|
18
|
+
* │ protocol-url │ ProtocolUrlPayload │
|
|
19
|
+
* │ notification │ NotificationPayload │
|
|
20
|
+
* │ system:metrics │ SystemMetricsPayload │
|
|
21
|
+
* │ window:focus │ {} │
|
|
22
|
+
* │ window:blur │ {} │
|
|
23
|
+
* │ window:maximize │ {} │
|
|
24
|
+
* │ window:unmaximize │ {} │
|
|
25
|
+
* │ plugin:loaded │ (plugin-defined) │
|
|
26
|
+
* │ plugin:unloaded │ (plugin-defined) │
|
|
27
|
+
* │ plugin:event │ (plugin-defined) │
|
|
28
|
+
* └──────────────────────┴──────────────────────────────────────────────┘
|
|
29
|
+
*
|
|
30
|
+
* All flight-related events include a `timestamp` field (epoch ms).
|
|
31
|
+
*/
|
|
32
|
+
import type { FlightData, FlightTrends, SimulatorStatus } from "./simulator";
|
|
33
|
+
/** Canonical Socket.io event names shared by shell and SDK. */
|
|
34
|
+
export declare const SOCKET_EVENTS: {
|
|
35
|
+
/** Real-time flight data broadcast (~10-20 Hz). Payload: SimulatorDataPayload */
|
|
36
|
+
readonly SIMULATOR_DATA: "simulator:data";
|
|
37
|
+
/** Simulator connection status change. Payload: SimulatorStatusPayload */
|
|
38
|
+
readonly SIMULATOR_STATUS: "simulator:status";
|
|
39
|
+
/** Generic flight state update (reserved). */
|
|
40
|
+
readonly FLIGHT_STATE: "flight:state";
|
|
41
|
+
/** Discrete phase transition. Payload: FlightPhasePayload */
|
|
42
|
+
readonly FLIGHT_PHASE: "flight:phase";
|
|
43
|
+
/** Single flight event as it occurs. Payload: FlightEventPayload */
|
|
44
|
+
readonly FLIGHT_EVENT: "flight:event";
|
|
45
|
+
/** Landing touchdown / bounce / settled. Payload: FlightLandingPayload */
|
|
46
|
+
readonly FLIGHT_LANDING: "flight:landing";
|
|
47
|
+
/** Deep link received via stratos:// protocol. Payload: ProtocolUrlPayload */
|
|
48
|
+
readonly PROTOCOL_URL: "protocol-url";
|
|
49
|
+
readonly WINDOW_FOCUS: "window:focus";
|
|
50
|
+
readonly WINDOW_BLUR: "window:blur";
|
|
51
|
+
readonly WINDOW_MAXIMIZE: "window:maximize";
|
|
52
|
+
readonly WINDOW_UNMAXIMIZE: "window:unmaximize";
|
|
53
|
+
/** Periodic system metrics (CPU / memory). Payload: SystemMetricsPayload */
|
|
54
|
+
readonly SYSTEM_METRICS: "system:metrics";
|
|
55
|
+
/** Toast / notification push. Payload: NotificationPayload */
|
|
56
|
+
readonly NOTIFICATION: "notification";
|
|
57
|
+
/** Play a sound in the renderer. Payload: { name: string } */
|
|
58
|
+
readonly SOUND: "sound";
|
|
59
|
+
/** Flight lifecycle state change. Payload: FlightManagerPayload */
|
|
60
|
+
readonly FLIGHT_MANAGER: "flight:manager";
|
|
61
|
+
/** Real-time log entry from main process logger. Payload: LogEntryPayload */
|
|
62
|
+
readonly LOG_ENTRY: "log:entry";
|
|
63
|
+
/** VA session expired (401 from upstream VA API). No payload. */
|
|
64
|
+
readonly AUTH_SESSION_EXPIRED: "auth:session-expired";
|
|
65
|
+
readonly PLUGIN_LOADED: "plugin:loaded";
|
|
66
|
+
readonly PLUGIN_UNLOADED: "plugin:unloaded";
|
|
67
|
+
readonly PLUGIN_EVENT: "plugin:event";
|
|
68
|
+
};
|
|
69
|
+
/** Union of all event name strings. */
|
|
70
|
+
export type SocketEventName = (typeof SOCKET_EVENTS)[keyof typeof SOCKET_EVENTS];
|
|
71
|
+
/**
|
|
72
|
+
* Payload for `simulator:data` events.
|
|
73
|
+
*
|
|
74
|
+
* Broadcast at ~10-20 Hz with the latest flight data, enriched
|
|
75
|
+
* trend analysis, and a wall-clock timestamp.
|
|
76
|
+
*/
|
|
77
|
+
export type SimulatorDataPayload = {
|
|
78
|
+
/** Identifier of the connected simulator (e.g. "xplane", "msfs"). */
|
|
79
|
+
simulatorType: string;
|
|
80
|
+
/** Full flight data snapshot from the simulator. */
|
|
81
|
+
data: FlightData;
|
|
82
|
+
/** Wall-clock timestamp (epoch ms) when the data was emitted. */
|
|
83
|
+
timestamp: number;
|
|
84
|
+
/** Computed trend analysis from the rolling sample window. */
|
|
85
|
+
trends: FlightTrends;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Payload for `simulator:status` events.
|
|
89
|
+
*
|
|
90
|
+
* Emitted when the simulator connection status changes
|
|
91
|
+
* (disconnected → connecting → connected, or → error).
|
|
92
|
+
*/
|
|
93
|
+
export type SimulatorStatusPayload = {
|
|
94
|
+
/** Identifier of the simulator. */
|
|
95
|
+
simulatorType: string;
|
|
96
|
+
/** New connection status. */
|
|
97
|
+
status: SimulatorStatus;
|
|
98
|
+
/** Optional human-readable message (e.g. error details). */
|
|
99
|
+
message?: string;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Payload for `protocol-url` events (stratos:// deep links).
|
|
103
|
+
*
|
|
104
|
+
* Emitted when the app receives a deep link and forwards the parsed
|
|
105
|
+
* action + params to the renderer.
|
|
106
|
+
*/
|
|
107
|
+
export type ProtocolUrlPayload = {
|
|
108
|
+
/** The action segment of the URL (e.g. "connect", "open"). */
|
|
109
|
+
action: string;
|
|
110
|
+
/** Parsed query / path parameters. */
|
|
111
|
+
params: Record<string, string>;
|
|
112
|
+
/** The original full URL string. */
|
|
113
|
+
fullUrl: string;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Payload for `notification` events.
|
|
117
|
+
*
|
|
118
|
+
* Pushed from main process to show toast notifications in the renderer.
|
|
119
|
+
*/
|
|
120
|
+
export type NotificationPayload = {
|
|
121
|
+
type: "info" | "success" | "warning" | "error";
|
|
122
|
+
title: string;
|
|
123
|
+
message: string;
|
|
124
|
+
/** Auto-dismiss duration in ms. */
|
|
125
|
+
duration?: number;
|
|
126
|
+
/** Stable ID for deduplication — toasts with the same ID replace each other. */
|
|
127
|
+
id?: string;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Payload for `system:metrics` events.
|
|
131
|
+
*
|
|
132
|
+
* Streamed every ~2 s with CPU and memory metrics for the
|
|
133
|
+
* system monitor panel.
|
|
134
|
+
*/
|
|
135
|
+
export type SystemMetricsPayload = {
|
|
136
|
+
cpu: {
|
|
137
|
+
/** System-wide CPU percentage. */
|
|
138
|
+
percentage: number;
|
|
139
|
+
/** This process's CPU percentage. */
|
|
140
|
+
process: number;
|
|
141
|
+
};
|
|
142
|
+
memory: {
|
|
143
|
+
/** System used memory (bytes). */
|
|
144
|
+
used: number;
|
|
145
|
+
/** System total memory (bytes). */
|
|
146
|
+
total: number;
|
|
147
|
+
/** Process RSS (bytes). */
|
|
148
|
+
process: number;
|
|
149
|
+
/** Process heap used (bytes). */
|
|
150
|
+
processHeap: number;
|
|
151
|
+
};
|
|
152
|
+
/** Wall-clock timestamp (epoch ms). */
|
|
153
|
+
timestamp: number;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Payload for `log:entry` events.
|
|
157
|
+
*
|
|
158
|
+
* Streamed in real-time from the main process logger for the
|
|
159
|
+
* dev tools log viewer.
|
|
160
|
+
*/
|
|
161
|
+
export type LogEntryPayload = {
|
|
162
|
+
id: number;
|
|
163
|
+
timestamp: string;
|
|
164
|
+
level: "debug" | "info" | "warn" | "error";
|
|
165
|
+
category: string;
|
|
166
|
+
message: string;
|
|
167
|
+
data?: string;
|
|
168
|
+
};
|
|
169
|
+
/** Socket.io connection state as observed by the client. */
|
|
170
|
+
export type ConnectionState = "connecting" | "connected" | "disconnected" | "error";
|
|
171
|
+
//# sourceMappingURL=socket-events.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Socket.io Event Catalog — canonical event names and payload types.
|
|
3
|
+
*
|
|
4
|
+
* This file is the single source of truth for all Socket.io event schemas
|
|
5
|
+
* used across the Stratos platform. Both the shell (emitter) and SDK hooks
|
|
6
|
+
* (consumers) import from here so payloads are always in sync.
|
|
7
|
+
*
|
|
8
|
+
* ┌──────────────────────┬──────────────────────────────────────────────┐
|
|
9
|
+
* │ Event │ Payload Type │
|
|
10
|
+
* ├──────────────────────┼──────────────────────────────────────────────┤
|
|
11
|
+
* │ simulator:data │ SimulatorDataPayload │
|
|
12
|
+
* │ simulator:status │ SimulatorStatusPayload │
|
|
13
|
+
* │ flight:phase │ FlightPhasePayload │
|
|
14
|
+
* │ flight:event │ FlightEventPayload │
|
|
15
|
+
* │ flight:landing │ FlightLandingPayload │
|
|
16
|
+
* │ flight:manager │ FlightManagerPayload │
|
|
17
|
+
* │ flight:state │ (reserved for future use) │
|
|
18
|
+
* │ protocol-url │ ProtocolUrlPayload │
|
|
19
|
+
* │ notification │ NotificationPayload │
|
|
20
|
+
* │ system:metrics │ SystemMetricsPayload │
|
|
21
|
+
* │ window:focus │ {} │
|
|
22
|
+
* │ window:blur │ {} │
|
|
23
|
+
* │ window:maximize │ {} │
|
|
24
|
+
* │ window:unmaximize │ {} │
|
|
25
|
+
* │ plugin:loaded │ (plugin-defined) │
|
|
26
|
+
* │ plugin:unloaded │ (plugin-defined) │
|
|
27
|
+
* │ plugin:event │ (plugin-defined) │
|
|
28
|
+
* └──────────────────────┴──────────────────────────────────────────────┘
|
|
29
|
+
*
|
|
30
|
+
* All flight-related events include a `timestamp` field (epoch ms).
|
|
31
|
+
*/
|
|
32
|
+
// ── Event Names ──────────────────────────────────────────────────────────
|
|
33
|
+
/** Canonical Socket.io event names shared by shell and SDK. */
|
|
34
|
+
export const SOCKET_EVENTS = {
|
|
35
|
+
// Simulator events
|
|
36
|
+
/** Real-time flight data broadcast (~10-20 Hz). Payload: SimulatorDataPayload */
|
|
37
|
+
SIMULATOR_DATA: "simulator:data",
|
|
38
|
+
/** Simulator connection status change. Payload: SimulatorStatusPayload */
|
|
39
|
+
SIMULATOR_STATUS: "simulator:status",
|
|
40
|
+
// Flight state events
|
|
41
|
+
/** Generic flight state update (reserved). */
|
|
42
|
+
FLIGHT_STATE: "flight:state",
|
|
43
|
+
/** Discrete phase transition. Payload: FlightPhasePayload */
|
|
44
|
+
FLIGHT_PHASE: "flight:phase",
|
|
45
|
+
/** Single flight event as it occurs. Payload: FlightEventPayload */
|
|
46
|
+
FLIGHT_EVENT: "flight:event",
|
|
47
|
+
/** Landing touchdown / bounce / settled. Payload: FlightLandingPayload */
|
|
48
|
+
FLIGHT_LANDING: "flight:landing",
|
|
49
|
+
// Protocol URL events
|
|
50
|
+
/** Deep link received via stratos:// protocol. Payload: ProtocolUrlPayload */
|
|
51
|
+
PROTOCOL_URL: "protocol-url",
|
|
52
|
+
// Window events
|
|
53
|
+
WINDOW_FOCUS: "window:focus",
|
|
54
|
+
WINDOW_BLUR: "window:blur",
|
|
55
|
+
WINDOW_MAXIMIZE: "window:maximize",
|
|
56
|
+
WINDOW_UNMAXIMIZE: "window:unmaximize",
|
|
57
|
+
// System events
|
|
58
|
+
/** Periodic system metrics (CPU / memory). Payload: SystemMetricsPayload */
|
|
59
|
+
SYSTEM_METRICS: "system:metrics",
|
|
60
|
+
// Notification events
|
|
61
|
+
/** Toast / notification push. Payload: NotificationPayload */
|
|
62
|
+
NOTIFICATION: "notification",
|
|
63
|
+
/** Play a sound in the renderer. Payload: { name: string } */
|
|
64
|
+
SOUND: "sound",
|
|
65
|
+
// Flight manager events
|
|
66
|
+
/** Flight lifecycle state change. Payload: FlightManagerPayload */
|
|
67
|
+
FLIGHT_MANAGER: "flight:manager",
|
|
68
|
+
// Log events
|
|
69
|
+
/** Real-time log entry from main process logger. Payload: LogEntryPayload */
|
|
70
|
+
LOG_ENTRY: "log:entry",
|
|
71
|
+
// Auth events
|
|
72
|
+
/** VA session expired (401 from upstream VA API). No payload. */
|
|
73
|
+
AUTH_SESSION_EXPIRED: "auth:session-expired",
|
|
74
|
+
// Plugin events
|
|
75
|
+
PLUGIN_LOADED: "plugin:loaded",
|
|
76
|
+
PLUGIN_UNLOADED: "plugin:unloaded",
|
|
77
|
+
PLUGIN_EVENT: "plugin:event",
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=socket-events.js.map
|