@wrongstack/tui 0.299.0 → 0.300.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.
@@ -648,6 +648,20 @@ export type Action = {
648
648
  | {
649
649
  type: 'escConfirmClose';
650
650
  }
651
+ /** Open the fallback model overlay (provider.fallback_pending received). */
652
+ | {
653
+ type: 'fallbackOverlayOpen';
654
+ info: NonNullable<State['fallbackOverlay']>;
655
+ }
656
+ /** Move the fallback overlay selection (wraps). */
657
+ | {
658
+ type: 'fallbackOverlayMove';
659
+ delta: number;
660
+ }
661
+ /** Close the fallback overlay (choice made or auto-switched). */
662
+ | {
663
+ type: 'fallbackOverlayClose';
664
+ }
651
665
  /** Open the mid-run send-mode picker with the resolved message + resolver. */
652
666
  | {
653
667
  type: 'sendModePickerOpen';
@@ -527,6 +527,26 @@ export type State = {
527
527
  escConfirm: {
528
528
  snapshot: NonNullable<State['steerSnapshot']>;
529
529
  } | null;
530
+ /**
531
+ * Fallback model overlay — shown when `provider.fallback_pending` fires.
532
+ * The overlay displays a countdown and the candidate model list, letting
533
+ * the user manually pick a model or wait for auto-switch. Null when no
534
+ * fallback gate is pending.
535
+ */
536
+ fallbackOverlay: {
537
+ requestId: string;
538
+ from: {
539
+ providerId: string;
540
+ model: string;
541
+ };
542
+ status: number;
543
+ candidates: Array<{
544
+ providerId: string;
545
+ model: string;
546
+ }>;
547
+ autoSwitchSeconds: number;
548
+ selected: number;
549
+ } | null;
530
550
  /**
531
551
  * Mid-run send-mode picker. Set when the user submits a plain message while
532
552
  * the agent is busy and `midRunSendPicker` is enabled — the picker asks how
@@ -0,0 +1,38 @@
1
+ import type React from 'react';
2
+ export interface FallbackCandidate {
3
+ providerId: string;
4
+ model: string;
5
+ }
6
+ export interface FallbackOverlayProps {
7
+ requestId: string;
8
+ from: {
9
+ providerId: string;
10
+ model: string;
11
+ };
12
+ status: number;
13
+ candidates: FallbackCandidate[];
14
+ autoSwitchSeconds: number;
15
+ selected: number;
16
+ /** Called when the user manually picks a model (Enter or countdown expiry on selected). */
17
+ onChoose: (choice: {
18
+ providerId: string;
19
+ model: string;
20
+ } | null) => void;
21
+ /** Called when the selection should move (up/down arrows). */
22
+ onMove: (delta: number) => void;
23
+ }
24
+ /**
25
+ * Fallback model overlay — shown when `provider.fallback_pending` fires.
26
+ *
27
+ * Displays the failed model, a list of fallback candidates, and a countdown.
28
+ * The user can:
29
+ * - Use ↑/↓ to highlight a candidate and press Enter to pick it.
30
+ * - Press Esc to accept the auto-switch (null → chain head).
31
+ * - Wait for the countdown to expire → auto-switch to the highlighted entry.
32
+ *
33
+ * The overlay always appears on top of whatever else is rendered, ensuring
34
+ * the user is notified on every model switch — even when a fallback list
35
+ * is already visible elsewhere.
36
+ */
37
+ export declare function FallbackOverlay({ from, status, candidates, autoSwitchSeconds, selected, onChoose, onMove, }: FallbackOverlayProps): React.ReactElement;
38
+ //# sourceMappingURL=fallback-overlay.d.ts.map