@skyvexsoftware/stratos-sdk 0.12.0 → 0.13.0
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/index.d.ts +2 -1
- package/dist/shared-types/index.d.ts +1 -0
- package/dist/shared-types/plugin-dialogs.d.ts +49 -0
- package/dist/shared-types/plugin-dialogs.js +9 -0
- package/dist/shared-types/socket-events.d.ts +4 -0
- package/dist/shared-types/socket-events.js +4 -0
- package/dist/types/context.d.ts +93 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { PluginAuthor, PluginManifest } from "./types/manifest";
|
|
2
|
-
export type { PluginAirline, PluginAirlineAccessor, PluginAuthAccessor, PluginVaApiClient, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginNavigationHelper, PluginPilotUser, PluginServerRegistrar, PluginToastAPI, PluginUIContext, PluginFlightAccessor, PluginFlightLogWriter, PluginFlightLogInput, PluginFlightLogPatch, PluginStartGuard, PluginStartContext, PluginStartDecision, PluginNotifier, PluginToastInput, PluginAlertSound, PluginSettingType, PluginSettingOption, PluginSettingDefinition, PluginAvailableSettings, BooleanSettingDef, TextSettingDef, LongtextSettingDef, NumberSettingDef, RangeSettingDef, ListSettingDef, RadioSettingDef, DateSettingDef, JsonSettingDef, } from "./types/context";
|
|
2
|
+
export type { PluginAirline, PluginAirlineAccessor, PluginAuthAccessor, PluginVaApiClient, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginNavigationHelper, PluginPilotUser, PluginServerRegistrar, PluginToastAPI, PluginUIContext, PluginFlightAccessor, PluginFlightLogWriter, PluginFlightLogInput, PluginFlightLogPatch, PluginStartGuard, PluginStartContext, PluginStartDecision, PluginNotifier, PluginToastInput, PluginAlertSound, PluginDialogApi, PluginPromptApi, PluginDialogAlertInput, PluginDialogConfirmInput, PluginPromptTextInput, PluginPromptNumberInput, PluginPromptSelectInput, PluginSettingType, PluginSettingOption, PluginSettingDefinition, PluginAvailableSettings, BooleanSettingDef, TextSettingDef, LongtextSettingDef, NumberSettingDef, RangeSettingDef, ListSettingDef, RadioSettingDef, DateSettingDef, JsonSettingDef, } from "./types/context";
|
|
3
3
|
export type { PluginBackgroundModule, PluginRouteComponent, PluginUIModule, } from "./types/module";
|
|
4
4
|
export { FlightPhase, SimulatorType, EventCategory, } from "./shared-types/simulator";
|
|
5
5
|
export type { BounceData, CapturePoint, FlightData, FlightDataSnapshot, FlightEventPayload, FlightEventsSnapshot, FlightLandingPayload, FlightLogEvent, FlightPhasePayload, FlightPhaseSnapshot, FlightStateDebugInfo, FlightTrends, GateCapture, HistoryReportEntry, LandingAnalysis, LandingAnalysisSnapshot, LandingAnalyzerDebugState, LandingSample, PendingPhaseTransition, SimDataSnapshot, SimulatorStatus, } from "./shared-types/simulator";
|
|
@@ -30,6 +30,7 @@ export { useShellToast } from "./hooks/useShellToast";
|
|
|
30
30
|
export { useSocket, useSimulatorData, useProtocolUrl, useNotifications, useSystemMetrics, } from "./hooks/useSimulatorData";
|
|
31
31
|
export { SOCKET_EVENTS } from "./shared-types/socket-events";
|
|
32
32
|
export type { AutoStartConfirmPayload, ConnectionState, LogEntryPayload, NotificationPayload, ProtocolUrlPayload, SimulatorDataPayload, SimulatorStatusPayload, SocketEventName, SystemMetricsPayload, } from "./shared-types/socket-events";
|
|
33
|
+
export type { PluginDialogKind, PluginDialogSelectOption, PluginDialogSpec, PluginDialogResult, PluginDialogClosePayload, } from "./shared-types/plugin-dialogs";
|
|
33
34
|
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, Badge, badgeVariants, Button, buttonVariants, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Combobox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, 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";
|
|
34
35
|
export type { BadgeProps, ButtonProps, ComboboxOption, ComboboxProps, } from "./ui";
|
|
35
36
|
export { STRATOS_ICONS, STRATOS_ICON_NAMES } from "./icons";
|
|
@@ -6,4 +6,5 @@ export type { AdditionalFieldsConfig, FieldDelivery, } from "./additional-fields
|
|
|
6
6
|
export type { FlightPlan, FlightStatus, CurrentFlight, FlightComment, PreflightCheck, PreflightCheckResult, StartFlightOptions, FlightManagerPayload, StartFlightResult, RecoverableFlight, } from "./flight-manager";
|
|
7
7
|
export { SOCKET_EVENTS } from "./socket-events";
|
|
8
8
|
export type { ConnectionState, LogEntryPayload, NotificationPayload, ProtocolUrlPayload, SimulatorDataPayload, SimulatorStatusPayload, SocketEventName, SystemMetricsPayload, } from "./socket-events";
|
|
9
|
+
export type { PluginDialogKind, PluginDialogSelectOption, PluginDialogSpec, PluginDialogResult, PluginDialogClosePayload, } from "./plugin-dialogs";
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire types for the background-plugin dialog/prompt surface.
|
|
3
|
+
*
|
|
4
|
+
* A `PluginDialogSpec` is broadcast to the renderer (SOCKET_EVENTS.DIALOG_OPEN)
|
|
5
|
+
* and also served by GET /api/plugin-dialogs for hydrate. The renderer posts a
|
|
6
|
+
* `PluginDialogResult` back. The wire value is always a string (or absent) — the
|
|
7
|
+
* typed coercion to boolean/number/null lives in the loader wrappers.
|
|
8
|
+
*/
|
|
9
|
+
export type PluginDialogKind = "alert" | "confirm" | "text" | "number" | "select";
|
|
10
|
+
export type PluginDialogSelectOption = {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
/** Fully-resolved spec for one open dialog. */
|
|
15
|
+
export type PluginDialogSpec = {
|
|
16
|
+
requestId: string;
|
|
17
|
+
pluginId: string;
|
|
18
|
+
pluginName: string;
|
|
19
|
+
kind: PluginDialogKind;
|
|
20
|
+
title: string;
|
|
21
|
+
/** Body text (dialogs) or helper text above the field (prompts). */
|
|
22
|
+
message?: string;
|
|
23
|
+
/** Field label (prompts only). */
|
|
24
|
+
label?: string;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
/** Pre-filled value (always a string on the wire; number prompts stringify it). */
|
|
27
|
+
defaultValue?: string;
|
|
28
|
+
required?: boolean;
|
|
29
|
+
maxLength?: number;
|
|
30
|
+
min?: number;
|
|
31
|
+
max?: number;
|
|
32
|
+
step?: number;
|
|
33
|
+
options?: PluginDialogSelectOption[];
|
|
34
|
+
okLabel?: string;
|
|
35
|
+
confirmLabel?: string;
|
|
36
|
+
cancelLabel?: string;
|
|
37
|
+
submitLabel?: string;
|
|
38
|
+
timeoutMs?: number;
|
|
39
|
+
};
|
|
40
|
+
/** Result posted back from the renderer / used to settle the pending promise. */
|
|
41
|
+
export type PluginDialogResult = {
|
|
42
|
+
submitted: boolean;
|
|
43
|
+
value?: string;
|
|
44
|
+
};
|
|
45
|
+
/** Payload for SOCKET_EVENTS.DIALOG_CLOSE. */
|
|
46
|
+
export type PluginDialogClosePayload = {
|
|
47
|
+
requestId: string;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=plugin-dialogs.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire types for the background-plugin dialog/prompt surface.
|
|
3
|
+
*
|
|
4
|
+
* A `PluginDialogSpec` is broadcast to the renderer (SOCKET_EVENTS.DIALOG_OPEN)
|
|
5
|
+
* and also served by GET /api/plugin-dialogs for hydrate. The renderer posts a
|
|
6
|
+
* `PluginDialogResult` back. The wire value is always a string (or absent) — the
|
|
7
|
+
* typed coercion to boolean/number/null lives in the loader wrappers.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -68,6 +68,10 @@ export declare const SOCKET_EVENTS: {
|
|
|
68
68
|
readonly PLUGIN_LOADED: "plugin:loaded";
|
|
69
69
|
readonly PLUGIN_UNLOADED: "plugin:unloaded";
|
|
70
70
|
readonly PLUGIN_EVENT: "plugin:event";
|
|
71
|
+
/** A background plugin opened a dialog/prompt. Payload: PluginDialogSpec */
|
|
72
|
+
readonly DIALOG_OPEN: "plugin:dialog:open";
|
|
73
|
+
/** A dialog/prompt was settled (answered/cancelled/timed out/unloaded). Payload: PluginDialogClosePayload */
|
|
74
|
+
readonly DIALOG_CLOSE: "plugin:dialog:close";
|
|
71
75
|
};
|
|
72
76
|
/** Union of all event name strings. */
|
|
73
77
|
export type SocketEventName = (typeof SOCKET_EVENTS)[keyof typeof SOCKET_EVENTS];
|
|
@@ -78,4 +78,8 @@ export const SOCKET_EVENTS = {
|
|
|
78
78
|
PLUGIN_LOADED: "plugin:loaded",
|
|
79
79
|
PLUGIN_UNLOADED: "plugin:unloaded",
|
|
80
80
|
PLUGIN_EVENT: "plugin:event",
|
|
81
|
+
/** A background plugin opened a dialog/prompt. Payload: PluginDialogSpec */
|
|
82
|
+
DIALOG_OPEN: "plugin:dialog:open",
|
|
83
|
+
/** A dialog/prompt was settled (answered/cancelled/timed out/unloaded). Payload: PluginDialogClosePayload */
|
|
84
|
+
DIALOG_CLOSE: "plugin:dialog:close",
|
|
81
85
|
};
|
package/dist/types/context.d.ts
CHANGED
|
@@ -272,6 +272,95 @@ export type PluginToastInput = {
|
|
|
272
272
|
};
|
|
273
273
|
/** Fixed shell-bundled sound catalogue. No plugin-supplied audio. */
|
|
274
274
|
export type PluginAlertSound = "alert" | "warning" | "error" | "success" | "chime";
|
|
275
|
+
/** Input for `ctx.dialog.alert`. */
|
|
276
|
+
export type PluginDialogAlertInput = {
|
|
277
|
+
title: string;
|
|
278
|
+
message: string;
|
|
279
|
+
/** Acknowledge-button label. Default "OK". */
|
|
280
|
+
okLabel?: string;
|
|
281
|
+
/** Optional auto-cancel; on expiry the call resolves (void). */
|
|
282
|
+
timeoutMs?: number;
|
|
283
|
+
};
|
|
284
|
+
/** Input for `ctx.dialog.confirm`. */
|
|
285
|
+
export type PluginDialogConfirmInput = {
|
|
286
|
+
title: string;
|
|
287
|
+
message: string;
|
|
288
|
+
/** Confirm-button label. Default "Confirm". */
|
|
289
|
+
confirmLabel?: string;
|
|
290
|
+
/** Cancel-button label. Default "Cancel". */
|
|
291
|
+
cancelLabel?: string;
|
|
292
|
+
/** Optional auto-cancel; on expiry the call resolves false. */
|
|
293
|
+
timeoutMs?: number;
|
|
294
|
+
};
|
|
295
|
+
/** Input for `ctx.prompt.text`. */
|
|
296
|
+
export type PluginPromptTextInput = {
|
|
297
|
+
title: string;
|
|
298
|
+
/** Field label, e.g. "What gate are you departing from?". */
|
|
299
|
+
label: string;
|
|
300
|
+
/** Optional helper/body text shown above the field. */
|
|
301
|
+
message?: string;
|
|
302
|
+
placeholder?: string;
|
|
303
|
+
defaultValue?: string;
|
|
304
|
+
/** When true, Submit is disabled until the field is non-empty. */
|
|
305
|
+
required?: boolean;
|
|
306
|
+
maxLength?: number;
|
|
307
|
+
submitLabel?: string;
|
|
308
|
+
cancelLabel?: string;
|
|
309
|
+
timeoutMs?: number;
|
|
310
|
+
};
|
|
311
|
+
/** Input for `ctx.prompt.number`. */
|
|
312
|
+
export type PluginPromptNumberInput = {
|
|
313
|
+
title: string;
|
|
314
|
+
label: string;
|
|
315
|
+
message?: string;
|
|
316
|
+
placeholder?: string;
|
|
317
|
+
defaultValue?: number;
|
|
318
|
+
required?: boolean;
|
|
319
|
+
min?: number;
|
|
320
|
+
max?: number;
|
|
321
|
+
step?: number;
|
|
322
|
+
submitLabel?: string;
|
|
323
|
+
cancelLabel?: string;
|
|
324
|
+
timeoutMs?: number;
|
|
325
|
+
};
|
|
326
|
+
/** Input for `ctx.prompt.select`. */
|
|
327
|
+
export type PluginPromptSelectInput = {
|
|
328
|
+
title: string;
|
|
329
|
+
label: string;
|
|
330
|
+
message?: string;
|
|
331
|
+
options: {
|
|
332
|
+
value: string;
|
|
333
|
+
label: string;
|
|
334
|
+
}[];
|
|
335
|
+
/** Pre-selected option value. */
|
|
336
|
+
defaultValue?: string;
|
|
337
|
+
required?: boolean;
|
|
338
|
+
submitLabel?: string;
|
|
339
|
+
cancelLabel?: string;
|
|
340
|
+
timeoutMs?: number;
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* Message-centric dialogs. The pilot reads a message and clicks a button.
|
|
344
|
+
* Backs `ctx.dialog`.
|
|
345
|
+
*/
|
|
346
|
+
export type PluginDialogApi = {
|
|
347
|
+
/** Show a blocking message with a single acknowledge button. */
|
|
348
|
+
alert(input: PluginDialogAlertInput): Promise<void>;
|
|
349
|
+
/** Ask a yes/no question. Resolves false on cancel/dismiss/timeout. */
|
|
350
|
+
confirm(input: PluginDialogConfirmInput): Promise<boolean>;
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* Input-centric prompts. The pilot provides a value. Backs `ctx.prompt`.
|
|
354
|
+
* All resolve null on cancel/dismiss/timeout.
|
|
355
|
+
*/
|
|
356
|
+
export type PluginPromptApi = {
|
|
357
|
+
/** Ask for free text. */
|
|
358
|
+
text(input: PluginPromptTextInput): Promise<string | null>;
|
|
359
|
+
/** Ask for a number. A non-numeric/blank submit resolves null. */
|
|
360
|
+
number(input: PluginPromptNumberInput): Promise<number | null>;
|
|
361
|
+
/** Ask the pilot to pick one of the supplied options. Returns the value. */
|
|
362
|
+
select(input: PluginPromptSelectInput): Promise<string | null>;
|
|
363
|
+
};
|
|
275
364
|
/**
|
|
276
365
|
* Context passed to a plugin's background onStart() function.
|
|
277
366
|
* Provides scoped access to shell infrastructure.
|
|
@@ -298,6 +387,10 @@ export type PluginContext = {
|
|
|
298
387
|
flight: PluginFlightAccessor;
|
|
299
388
|
/** Toast + sound surface. */
|
|
300
389
|
notify: PluginNotifier;
|
|
390
|
+
/** Blocking, awaited message dialogs (alert/confirm). */
|
|
391
|
+
dialog: PluginDialogApi;
|
|
392
|
+
/** Blocking, awaited input prompts (text/number/select). */
|
|
393
|
+
prompt: PluginPromptApi;
|
|
301
394
|
};
|
|
302
395
|
/** Pilot user profile provided by the shell's auth system */
|
|
303
396
|
export type PluginPilotUser = {
|