@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,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useTrackingSession — Convenience hook that combines flight manager state
|
|
3
|
+
* with derived tracking metadata (isTracking, isPaused, elapsedTime, phase).
|
|
4
|
+
*
|
|
5
|
+
* Hydrates from GET /api/flight-manager/state on mount, then subscribes to
|
|
6
|
+
* flight:manager Socket.io events for real-time updates.
|
|
7
|
+
*
|
|
8
|
+
* Acts as a higher-level wrapper — plugins can still use useFlightManager()
|
|
9
|
+
* or lower-level hooks (useSimData, useFlightPhase, etc.) for more control.
|
|
10
|
+
*/
|
|
11
|
+
import { useState, useEffect, useCallback } from "react";
|
|
12
|
+
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
13
|
+
import { useSocket } from "./useSimulatorData";
|
|
14
|
+
import { SOCKET_EVENTS } from "../shared-types/socket-events";
|
|
15
|
+
import { FlightPhase } from "../shared-types/simulator";
|
|
16
|
+
const SERVER_PORT = 2066;
|
|
17
|
+
const API_BASE = `http://127.0.0.1:${SERVER_PORT}/api/flight-manager`;
|
|
18
|
+
export const trackingSessionKeys = {
|
|
19
|
+
state: ["tracking-session", "state"],
|
|
20
|
+
pendingRecovery: ["tracking-session", "pending-recovery"],
|
|
21
|
+
};
|
|
22
|
+
async function fetchFlightManagerState() {
|
|
23
|
+
const response = await fetch(`${API_BASE}/state`, {
|
|
24
|
+
headers: { Accept: "application/json" },
|
|
25
|
+
});
|
|
26
|
+
const json = (await response.json());
|
|
27
|
+
return json.data;
|
|
28
|
+
}
|
|
29
|
+
async function api(path, method, body) {
|
|
30
|
+
const response = await fetch(`${API_BASE}${path}`, {
|
|
31
|
+
method,
|
|
32
|
+
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
|
33
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
34
|
+
});
|
|
35
|
+
return (await response.json());
|
|
36
|
+
}
|
|
37
|
+
export function useTrackingSession() {
|
|
38
|
+
const queryClient = useQueryClient();
|
|
39
|
+
const { socket } = useSocket();
|
|
40
|
+
const { data: stateData, isLoading, refetch, } = useQuery({
|
|
41
|
+
queryKey: trackingSessionKeys.state,
|
|
42
|
+
queryFn: fetchFlightManagerState,
|
|
43
|
+
staleTime: Infinity,
|
|
44
|
+
refetchOnWindowFocus: false,
|
|
45
|
+
refetchOnReconnect: false,
|
|
46
|
+
});
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!socket)
|
|
49
|
+
return;
|
|
50
|
+
const handleFlightManager = (payload) => {
|
|
51
|
+
queryClient.setQueryData(trackingSessionKeys.state, {
|
|
52
|
+
flight: payload.flight,
|
|
53
|
+
pendingRecovery: payload.pendingRecovery,
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
// Refetch on socket connect — catches flights started before the UI loaded
|
|
57
|
+
const handleConnect = () => {
|
|
58
|
+
void refetch();
|
|
59
|
+
};
|
|
60
|
+
socket.on(SOCKET_EVENTS.FLIGHT_MANAGER, handleFlightManager);
|
|
61
|
+
socket.on("connect", handleConnect);
|
|
62
|
+
return () => {
|
|
63
|
+
socket.off(SOCKET_EVENTS.FLIGHT_MANAGER, handleFlightManager);
|
|
64
|
+
socket.off("connect", handleConnect);
|
|
65
|
+
};
|
|
66
|
+
}, [socket, queryClient, refetch]);
|
|
67
|
+
const currentFlight = stateData?.flight ?? null;
|
|
68
|
+
const pendingRecovery = stateData?.pendingRecovery ?? null;
|
|
69
|
+
const startFlight = useCallback(async (plan, options) => {
|
|
70
|
+
const result = await api("/start", "POST", { flightPlan: plan, options });
|
|
71
|
+
return result.data;
|
|
72
|
+
}, []);
|
|
73
|
+
const pauseFlight = useCallback(async () => {
|
|
74
|
+
const result = await api("/pause", "POST");
|
|
75
|
+
return result.success;
|
|
76
|
+
}, []);
|
|
77
|
+
const resumeFlight = useCallback(async () => {
|
|
78
|
+
const result = await api("/resume", "POST");
|
|
79
|
+
return result.success;
|
|
80
|
+
}, []);
|
|
81
|
+
const endFlight = useCallback(async (status) => {
|
|
82
|
+
const result = await api("/end", "POST", { status });
|
|
83
|
+
return { success: result.success, error: result.error };
|
|
84
|
+
}, []);
|
|
85
|
+
const recoverFlight = useCallback(async () => {
|
|
86
|
+
const result = await api("/recover", "POST");
|
|
87
|
+
if (result.success) {
|
|
88
|
+
queryClient.setQueryData(trackingSessionKeys.state, (prev) => (prev ? { ...prev, pendingRecovery: null } : prev));
|
|
89
|
+
}
|
|
90
|
+
return result.success;
|
|
91
|
+
}, [queryClient]);
|
|
92
|
+
const dismissRecovery = useCallback(async () => {
|
|
93
|
+
const result = await api("/dismiss-recovery", "POST");
|
|
94
|
+
if (result.success) {
|
|
95
|
+
queryClient.setQueryData(trackingSessionKeys.state, (prev) => (prev ? { ...prev, pendingRecovery: null } : prev));
|
|
96
|
+
}
|
|
97
|
+
return result.success;
|
|
98
|
+
}, [queryClient]);
|
|
99
|
+
const flight = currentFlight;
|
|
100
|
+
const isActive = flight !== null &&
|
|
101
|
+
(flight.status === "active" || flight.status === "paused");
|
|
102
|
+
// Compute elapsed time locally so it ticks every second instead of
|
|
103
|
+
// only updating on 15-second server broadcasts.
|
|
104
|
+
const [elapsedTime, setElapsedTime] = useState(flight?.elapsedMs ?? 0);
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
if (!isActive) {
|
|
107
|
+
setElapsedTime(flight?.elapsedMs ?? 0);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const tick = () => {
|
|
111
|
+
const start = flight?.timeCaptureStartAt;
|
|
112
|
+
const end = flight?.timeCaptureEndAt;
|
|
113
|
+
if (!start) {
|
|
114
|
+
setElapsedTime(0);
|
|
115
|
+
}
|
|
116
|
+
else if (end) {
|
|
117
|
+
setElapsedTime(end - start);
|
|
118
|
+
}
|
|
119
|
+
else if (flight?.status === "paused" && flight.pausedAt) {
|
|
120
|
+
setElapsedTime(flight.pausedAt - start);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
setElapsedTime(Date.now() - start);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
tick();
|
|
127
|
+
const interval = setInterval(tick, 1000);
|
|
128
|
+
return () => clearInterval(interval);
|
|
129
|
+
}, [
|
|
130
|
+
flight?.timeCaptureStartAt,
|
|
131
|
+
flight?.timeCaptureEndAt,
|
|
132
|
+
flight?.status,
|
|
133
|
+
flight?.pausedAt,
|
|
134
|
+
isActive,
|
|
135
|
+
]);
|
|
136
|
+
return {
|
|
137
|
+
isTracking: isActive,
|
|
138
|
+
isPaused: flight?.status === "paused",
|
|
139
|
+
currentFlight: flight,
|
|
140
|
+
pendingRecovery,
|
|
141
|
+
elapsedTime,
|
|
142
|
+
phase: flight?.currentPhase ?? FlightPhase.BOARDING,
|
|
143
|
+
startFlight,
|
|
144
|
+
pauseFlight,
|
|
145
|
+
resumeFlight,
|
|
146
|
+
endFlight,
|
|
147
|
+
recoverFlight,
|
|
148
|
+
dismissRecovery,
|
|
149
|
+
isLoading,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=useTrackingSession.js.map
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports the full lucide-react icon set.
|
|
3
|
+
*
|
|
4
|
+
* Both Stratos and SkyVex keep lucide-react on the same version
|
|
5
|
+
* so the available icons are always in sync.
|
|
6
|
+
*
|
|
7
|
+
* - STRATOS_ICONS: Record<string, LucideIcon> — PascalCase keys (e.g. "BookOpen")
|
|
8
|
+
* - STRATOS_ICON_NAMES: string[] — sorted list of all available icon names
|
|
9
|
+
*/
|
|
10
|
+
import { icons } from "lucide-react";
|
|
11
|
+
export declare const STRATOS_ICONS: typeof icons;
|
|
12
|
+
export declare const STRATOS_ICON_NAMES: string[];
|
|
13
|
+
//# sourceMappingURL=icons.d.ts.map
|
package/dist/icons.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports the full lucide-react icon set.
|
|
3
|
+
*
|
|
4
|
+
* Both Stratos and SkyVex keep lucide-react on the same version
|
|
5
|
+
* so the available icons are always in sync.
|
|
6
|
+
*
|
|
7
|
+
* - STRATOS_ICONS: Record<string, LucideIcon> — PascalCase keys (e.g. "BookOpen")
|
|
8
|
+
* - STRATOS_ICON_NAMES: string[] — sorted list of all available icon names
|
|
9
|
+
*/
|
|
10
|
+
import { icons } from "lucide-react";
|
|
11
|
+
export const STRATOS_ICONS = icons;
|
|
12
|
+
export const STRATOS_ICON_NAMES = Object.keys(icons).sort();
|
|
13
|
+
//# sourceMappingURL=icons.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type { PluginAuthor, PluginManifest } from "./types/manifest";
|
|
2
|
+
export type { PluginAuthAccessor, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginNavigationHelper, PluginServerRegistrar, PluginToastAPI, PluginUIContext, PluginSettingType, PluginSettingOption, PluginSettingDefinition, PluginAvailableSettings, BooleanSettingDef, TextSettingDef, LongtextSettingDef, NumberSettingDef, RangeSettingDef, ListSettingDef, RadioSettingDef, DateSettingDef, JsonSettingDef, } from "./types/context";
|
|
3
|
+
export type { PluginBackgroundModule, PluginRouteComponent, PluginUIModule, } from "./types/module";
|
|
4
|
+
export { FlightPhase, SimulatorType, EventCategory, } from "./shared-types/simulator";
|
|
5
|
+
export type { BounceData, CapturePoint, FlightData, FlightDataSnapshot, FlightEventPayload, FlightEventsSnapshot, FlightLandingPayload, FlightLogEvent, FlightPhasePayload, FlightPhaseSnapshot, FlightStateDebugInfo, FlightTrends, HistoryReportEntry, LandingAnalysis, LandingAnalysisSnapshot, LandingAnalyzerDebugState, LandingSample, PendingPhaseTransition, SimDataSnapshot, SimulatorStatus, } from "./shared-types/simulator";
|
|
6
|
+
export type { ThemeMode } from "./shared-types/theme";
|
|
7
|
+
export type { FlightPlan, FlightStatus, CurrentFlight, FlightComment, PreflightCheck, PreflightCheckResult, StartFlightOptions, FlightManagerPayload, StartFlightResult, RecoverableFlight, } from "./shared-types/flight-manager";
|
|
8
|
+
export { createPlugin } from "./helpers/createPlugin";
|
|
9
|
+
export { weightToLbs, weightFromLbs, altitudeToFt, altitudeFromFt, verticalSpeedFromFpm, verticalSpeedToFpm, distanceToNm, distanceFromNm, formatWeight, formatAltitude, formatDistance, formatVerticalSpeed, } from "./helpers/units";
|
|
10
|
+
export type { WeightUnit, AltitudeUnit, DistanceUnit, UnitPreferences, } from "./helpers/units";
|
|
11
|
+
export { PluginUICtx, usePluginContext } from "./hooks/context";
|
|
12
|
+
export { useFlightEvents, flightEventsKeys } from "./hooks/useFlightEvents";
|
|
13
|
+
export { useFlightManager } from "./hooks/useFlightManager";
|
|
14
|
+
export { useFlightPhase, flightPhaseKeys } from "./hooks/useFlightPhase";
|
|
15
|
+
export { useLandingAnalysis, landingAnalysisKeys, } from "./hooks/useLandingAnalysis";
|
|
16
|
+
export { useSimData, simDataKeys } from "./hooks/useSimData";
|
|
17
|
+
export { useTrackingSession, trackingSessionKeys, } from "./hooks/useTrackingSession";
|
|
18
|
+
export { usePluginLogger } from "./hooks/usePluginLogger";
|
|
19
|
+
export { useShellAuth } from "./hooks/useShellAuth";
|
|
20
|
+
export { useShellConfig } from "./hooks/useShellConfig";
|
|
21
|
+
export { useShellNavigation } from "./hooks/useShellNavigation";
|
|
22
|
+
export { useShellToast } from "./hooks/useShellToast";
|
|
23
|
+
export { useSocket, useSimulatorData, useProtocolUrl, useNotifications, useSystemMetrics, } from "./hooks/useSimulatorData";
|
|
24
|
+
export { SOCKET_EVENTS } from "./shared-types/socket-events";
|
|
25
|
+
export type { ConnectionState, LogEntryPayload, NotificationPayload, ProtocolUrlPayload, SimulatorDataPayload, SimulatorStatusPayload, SocketEventName, SystemMetricsPayload, } from "./shared-types/socket-events";
|
|
26
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, Badge, badgeVariants, Button, buttonVariants, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Input, Label, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./ui";
|
|
27
|
+
export type { BadgeProps, ButtonProps } from "./ui";
|
|
28
|
+
export { STRATOS_ICONS, STRATOS_ICON_NAMES } from "./icons";
|
|
29
|
+
export { cn } from "./utils/cn";
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// ── Shared Types ───────────────────────────────────────────────────────
|
|
2
|
+
export { FlightPhase, SimulatorType, EventCategory, } from "./shared-types/simulator";
|
|
3
|
+
// ── Helper Functions ───────────────────────────────────────────────────
|
|
4
|
+
export { createPlugin } from "./helpers/createPlugin";
|
|
5
|
+
export { weightToLbs, weightFromLbs, altitudeToFt, altitudeFromFt, verticalSpeedFromFpm, verticalSpeedToFpm, distanceToNm, distanceFromNm, formatWeight, formatAltitude, formatDistance, formatVerticalSpeed, } from "./helpers/units";
|
|
6
|
+
// ── React Hooks ────────────────────────────────────────────────────────
|
|
7
|
+
export { PluginUICtx, usePluginContext } from "./hooks/context";
|
|
8
|
+
export { useFlightEvents, flightEventsKeys } from "./hooks/useFlightEvents";
|
|
9
|
+
export { useFlightManager } from "./hooks/useFlightManager";
|
|
10
|
+
export { useFlightPhase, flightPhaseKeys } from "./hooks/useFlightPhase";
|
|
11
|
+
export { useLandingAnalysis, landingAnalysisKeys, } from "./hooks/useLandingAnalysis";
|
|
12
|
+
export { useSimData, simDataKeys } from "./hooks/useSimData";
|
|
13
|
+
export { useTrackingSession, trackingSessionKeys, } from "./hooks/useTrackingSession";
|
|
14
|
+
export { usePluginLogger } from "./hooks/usePluginLogger";
|
|
15
|
+
export { useShellAuth } from "./hooks/useShellAuth";
|
|
16
|
+
export { useShellConfig } from "./hooks/useShellConfig";
|
|
17
|
+
export { useShellNavigation } from "./hooks/useShellNavigation";
|
|
18
|
+
export { useShellToast } from "./hooks/useShellToast";
|
|
19
|
+
export { useSocket, useSimulatorData, useProtocolUrl, useNotifications, useSystemMetrics, } from "./hooks/useSimulatorData";
|
|
20
|
+
// ── Socket.io Event Catalog ──────────────────────────────────────────────
|
|
21
|
+
export { SOCKET_EVENTS } from "./shared-types/socket-events";
|
|
22
|
+
// ── UI Primitives ──────────────────────────────────────────────────────
|
|
23
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, Badge, badgeVariants, Button, buttonVariants, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Input, Label, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./ui";
|
|
24
|
+
// ── Icons ─────────────────────────────────────────────────────────────
|
|
25
|
+
export { STRATOS_ICONS, STRATOS_ICON_NAMES } from "./icons";
|
|
26
|
+
// ── Utilities ──────────────────────────────────────────────────────────
|
|
27
|
+
export { cn } from "./utils/cn";
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { FlightPhase } from "./simulator";
|
|
2
|
+
/** VA-agnostic flight plan, produced by any plugin */
|
|
3
|
+
export type FlightPlan = {
|
|
4
|
+
source: "va" | "simbrief" | "manual";
|
|
5
|
+
sourceId?: string;
|
|
6
|
+
callsign: string;
|
|
7
|
+
flightNumber?: string;
|
|
8
|
+
airlineCode?: string;
|
|
9
|
+
departureIcao: string;
|
|
10
|
+
arrivalIcao: string;
|
|
11
|
+
route: string[];
|
|
12
|
+
aircraftIcao: string;
|
|
13
|
+
aircraftName?: string;
|
|
14
|
+
cruiseAltitude?: number;
|
|
15
|
+
plannedDistance?: number;
|
|
16
|
+
estimatedFlightTime?: number;
|
|
17
|
+
departureCoords?: {
|
|
18
|
+
lat: number;
|
|
19
|
+
lon: number;
|
|
20
|
+
};
|
|
21
|
+
arrivalCoords?: {
|
|
22
|
+
lat: number;
|
|
23
|
+
lon: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/** Flight lifecycle status */
|
|
27
|
+
export type FlightStatus = "preflight" | "starting" | "active" | "paused" | "completing" | "completed" | "failed" | "cancelled";
|
|
28
|
+
/** Active flight state broadcast via Socket.io */
|
|
29
|
+
export type CurrentFlight = {
|
|
30
|
+
flightPlan: FlightPlan;
|
|
31
|
+
status: FlightStatus;
|
|
32
|
+
vaTrackingId: string | null;
|
|
33
|
+
stratosFlightId: string | null;
|
|
34
|
+
startedAt: number | null;
|
|
35
|
+
pausedAt: number | null;
|
|
36
|
+
totalPausedMs: number;
|
|
37
|
+
elapsedMs: number;
|
|
38
|
+
timeCaptureMode: "block" | "air";
|
|
39
|
+
timeCaptureStartAt: number | null;
|
|
40
|
+
timeCaptureEndAt: number | null;
|
|
41
|
+
currentPhase: FlightPhase;
|
|
42
|
+
latitude: number;
|
|
43
|
+
longitude: number;
|
|
44
|
+
altitude: number;
|
|
45
|
+
groundSpeed: number;
|
|
46
|
+
heading: number;
|
|
47
|
+
startingFuel: number;
|
|
48
|
+
currentFuel: number;
|
|
49
|
+
lastUpdateSentAt: number | null;
|
|
50
|
+
updatesSent: number;
|
|
51
|
+
updateIntervalMs: number;
|
|
52
|
+
comments: FlightComment[];
|
|
53
|
+
lastError: string | null;
|
|
54
|
+
};
|
|
55
|
+
/** Comment attached to an active flight */
|
|
56
|
+
export type FlightComment = {
|
|
57
|
+
id: string;
|
|
58
|
+
message: string;
|
|
59
|
+
timestamp: number;
|
|
60
|
+
phase: FlightPhase;
|
|
61
|
+
};
|
|
62
|
+
/** Result of pre-flight validation checks */
|
|
63
|
+
export type PreflightCheck = {
|
|
64
|
+
name: string;
|
|
65
|
+
passed: boolean;
|
|
66
|
+
message: string;
|
|
67
|
+
severity: "error" | "warning";
|
|
68
|
+
};
|
|
69
|
+
export type PreflightCheckResult = {
|
|
70
|
+
passed: boolean;
|
|
71
|
+
checks: PreflightCheck[];
|
|
72
|
+
};
|
|
73
|
+
/** Options for startFlight */
|
|
74
|
+
export type StartFlightOptions = {
|
|
75
|
+
skipPreflightWarnings?: boolean;
|
|
76
|
+
forceStart?: boolean;
|
|
77
|
+
};
|
|
78
|
+
/** Lean subset of stored flight data for recovery prompt in the renderer */
|
|
79
|
+
export type RecoverableFlight = {
|
|
80
|
+
id: string;
|
|
81
|
+
callsign: string | null;
|
|
82
|
+
departureIcao: string | null;
|
|
83
|
+
arrivalIcao: string | null;
|
|
84
|
+
aircraftIcao: string | null;
|
|
85
|
+
latitude: number | null;
|
|
86
|
+
longitude: number | null;
|
|
87
|
+
altitude: number | null;
|
|
88
|
+
heading: number | null;
|
|
89
|
+
groundSpeed: number | null;
|
|
90
|
+
startedAt: number | null;
|
|
91
|
+
elapsedMs: number;
|
|
92
|
+
status: string;
|
|
93
|
+
phase: string | null;
|
|
94
|
+
};
|
|
95
|
+
/** Socket.io payload for flight:manager events */
|
|
96
|
+
export type FlightManagerPayload = {
|
|
97
|
+
flight: CurrentFlight | null;
|
|
98
|
+
pendingRecovery: RecoverableFlight | null;
|
|
99
|
+
timestamp: number;
|
|
100
|
+
};
|
|
101
|
+
/** Result returned from startFlight */
|
|
102
|
+
export type StartFlightResult = {
|
|
103
|
+
success: boolean;
|
|
104
|
+
flight?: CurrentFlight;
|
|
105
|
+
preflightResult?: PreflightCheckResult;
|
|
106
|
+
/** VA-issued confirmation message — pilot must acknowledge before tracking starts */
|
|
107
|
+
vaConfirmation?: string;
|
|
108
|
+
/** Sim variables sent to VA for display in confirmation dialog */
|
|
109
|
+
simVariables?: Record<string, string>;
|
|
110
|
+
error?: string;
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=flight-manager.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { FlightPhase, SimulatorType, EventCategory } from "./simulator";
|
|
2
|
+
export type { BounceData, CapturePoint, FlightData, FlightDataSnapshot, FlightEventPayload, FlightEventsSnapshot, FlightLandingPayload, FlightLogEvent, FlightPhasePayload, FlightPhaseSnapshot, FlightStateDebugInfo, FlightTrends, HistoryReportEntry, LandingAnalysis, LandingAnalysisSnapshot, LandingAnalyzerDebugState, PendingPhaseTransition, SimDataSnapshot, SimulatorStatus, } from "./simulator";
|
|
3
|
+
export type { ThemeMode } from "./theme";
|
|
4
|
+
export type { FlightPlan, FlightStatus, CurrentFlight, FlightComment, PreflightCheck, PreflightCheckResult, StartFlightOptions, FlightManagerPayload, StartFlightResult, RecoverableFlight, } from "./flight-manager";
|
|
5
|
+
export { SOCKET_EVENTS } from "./socket-events";
|
|
6
|
+
export type { ConnectionState, LogEntryPayload, NotificationPayload, ProtocolUrlPayload, SimulatorDataPayload, SimulatorStatusPayload, SocketEventName, SystemMetricsPayload, } from "./socket-events";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|