@skyvexsoftware/stratos-sdk 0.5.3 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/useTrackingSession.d.ts +2 -0
- package/dist/hooks/useTrackingSession.js +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/shared-types/flight-manager.d.ts +2 -0
- package/dist/shared-types/socket-events.d.ts +20 -0
- package/dist/shared-types/socket-events.js +3 -0
- package/package.json +1 -1
|
@@ -17,6 +17,8 @@ export declare const trackingSessionKeys: {
|
|
|
17
17
|
type UseTrackingSessionReturn = {
|
|
18
18
|
isTracking: boolean;
|
|
19
19
|
isPaused: boolean;
|
|
20
|
+
/** True when the flight was paused due to simulator disconnection. */
|
|
21
|
+
simDisconnected: boolean;
|
|
20
22
|
currentFlight: CurrentFlight | null;
|
|
21
23
|
pendingRecovery: RecoverableFlight | null;
|
|
22
24
|
elapsedTime: number;
|
|
@@ -51,6 +51,7 @@ export function useTrackingSession() {
|
|
|
51
51
|
queryClient.setQueryData(trackingSessionKeys.state, {
|
|
52
52
|
flight: payload.flight,
|
|
53
53
|
pendingRecovery: payload.pendingRecovery,
|
|
54
|
+
simDisconnected: payload.simDisconnected,
|
|
54
55
|
});
|
|
55
56
|
};
|
|
56
57
|
// Refetch on socket connect — catches flights started before the UI loaded
|
|
@@ -66,6 +67,7 @@ export function useTrackingSession() {
|
|
|
66
67
|
}, [socket, queryClient, refetch]);
|
|
67
68
|
const currentFlight = stateData?.flight ?? null;
|
|
68
69
|
const pendingRecovery = stateData?.pendingRecovery ?? null;
|
|
70
|
+
const simDisconnected = stateData?.simDisconnected ?? false;
|
|
69
71
|
const startFlight = useCallback(async (plan, options) => {
|
|
70
72
|
const result = await api("/start", "POST", { flightPlan: plan, options });
|
|
71
73
|
return result.data;
|
|
@@ -140,6 +142,7 @@ export function useTrackingSession() {
|
|
|
140
142
|
return {
|
|
141
143
|
isTracking: isActive,
|
|
142
144
|
isPaused: flight?.status === "paused",
|
|
145
|
+
simDisconnected,
|
|
143
146
|
currentFlight: flight,
|
|
144
147
|
pendingRecovery,
|
|
145
148
|
elapsedTime,
|
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export { useShellNavigation } from "./hooks/useShellNavigation";
|
|
|
22
22
|
export { useShellToast } from "./hooks/useShellToast";
|
|
23
23
|
export { useSocket, useSimulatorData, useProtocolUrl, useNotifications, useSystemMetrics, } from "./hooks/useSimulatorData";
|
|
24
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";
|
|
25
|
+
export type { AutoStartConfirmPayload, ConnectionState, LogEntryPayload, NotificationPayload, ProtocolUrlPayload, SimulatorDataPayload, SimulatorStatusPayload, SocketEventName, SystemMetricsPayload, } from "./shared-types/socket-events";
|
|
26
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
27
|
export type { BadgeProps, ButtonProps } from "./ui";
|
|
28
28
|
export { STRATOS_ICONS, STRATOS_ICON_NAMES } from "./icons";
|
|
@@ -97,6 +97,8 @@ export type RecoverableFlight = {
|
|
|
97
97
|
export type FlightManagerPayload = {
|
|
98
98
|
flight: CurrentFlight | null;
|
|
99
99
|
pendingRecovery: RecoverableFlight | null;
|
|
100
|
+
/** True when the flight was paused due to simulator disconnection. */
|
|
101
|
+
simDisconnected: boolean;
|
|
100
102
|
timestamp: number;
|
|
101
103
|
};
|
|
102
104
|
/** Result returned from startFlight */
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
* All flight-related events include a `timestamp` field (epoch ms).
|
|
31
31
|
*/
|
|
32
32
|
import type { FlightData, FlightTrends, SimulatorStatus } from "./simulator";
|
|
33
|
+
import type { FlightPlan } from "./flight-manager";
|
|
33
34
|
/** Canonical Socket.io event names shared by shell and SDK. */
|
|
34
35
|
export declare const SOCKET_EVENTS: {
|
|
35
36
|
/** Real-time flight data broadcast (~10-20 Hz). Payload: SimulatorDataPayload */
|
|
@@ -62,6 +63,8 @@ export declare const SOCKET_EVENTS: {
|
|
|
62
63
|
readonly LOG_ENTRY: "log:entry";
|
|
63
64
|
/** VA session expired (401 from upstream VA API). No payload. */
|
|
64
65
|
readonly AUTH_SESSION_EXPIRED: "auth:session-expired";
|
|
66
|
+
/** Auto-start detected a VA confirmation — renderer should show dialog. */
|
|
67
|
+
readonly AUTO_START_CONFIRM: "flight:auto-start-confirm";
|
|
65
68
|
readonly PLUGIN_LOADED: "plugin:loaded";
|
|
66
69
|
readonly PLUGIN_UNLOADED: "plugin:unloaded";
|
|
67
70
|
readonly PLUGIN_EVENT: "plugin:event";
|
|
@@ -166,6 +169,23 @@ export type LogEntryPayload = {
|
|
|
166
169
|
message: string;
|
|
167
170
|
data?: string;
|
|
168
171
|
};
|
|
172
|
+
/**
|
|
173
|
+
* Payload for `flight:auto-start-confirm` events.
|
|
174
|
+
*
|
|
175
|
+
* Emitted when auto-start receives a VA confirmation that the pilot
|
|
176
|
+
* must acknowledge before tracking begins. The renderer should show
|
|
177
|
+
* the VaConfirmDialog.
|
|
178
|
+
*/
|
|
179
|
+
export type AutoStartConfirmPayload = {
|
|
180
|
+
/** VA-issued confirmation message. */
|
|
181
|
+
confirmation: string;
|
|
182
|
+
/** Current sim variables for display. */
|
|
183
|
+
simVariables: Record<string, string>;
|
|
184
|
+
/** The flight plan built from the matched booking. */
|
|
185
|
+
flightPlan: FlightPlan;
|
|
186
|
+
/** Booking bid_id so the renderer can fetch the full booking. */
|
|
187
|
+
bidId: number;
|
|
188
|
+
};
|
|
169
189
|
/** Socket.io connection state as observed by the client. */
|
|
170
190
|
export type ConnectionState = "connecting" | "connected" | "disconnected" | "error";
|
|
171
191
|
//# sourceMappingURL=socket-events.d.ts.map
|
|
@@ -71,6 +71,9 @@ export const SOCKET_EVENTS = {
|
|
|
71
71
|
// Auth events
|
|
72
72
|
/** VA session expired (401 from upstream VA API). No payload. */
|
|
73
73
|
AUTH_SESSION_EXPIRED: "auth:session-expired",
|
|
74
|
+
// Auto-start events
|
|
75
|
+
/** Auto-start detected a VA confirmation — renderer should show dialog. */
|
|
76
|
+
AUTO_START_CONFIRM: "flight:auto-start-confirm",
|
|
74
77
|
// Plugin events
|
|
75
78
|
PLUGIN_LOADED: "plugin:loaded",
|
|
76
79
|
PLUGIN_UNLOADED: "plugin:unloaded",
|