@nivaro/react 0.3.0 → 0.3.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.
Files changed (27) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +341 -0
  4. package/dist/index.js +764 -723
  5. package/dist/shared/components/ClientChaosToolbar.js +410 -0
  6. package/dist/shared/components/LoadErrorNote.js +49 -0
  7. package/dist/shared/components/PretendDown.js +258 -0
  8. package/dist/shared/components/ProfileView.js +54 -49
  9. package/dist/shared/components/QueryErrorState.js +16 -0
  10. package/dist/shared/components/ReportView.js +1351 -1338
  11. package/dist/shared/components/WidgetSlot.js +438 -418
  12. package/dist/shared/components/chaos/DeclareIncidentButton.js +72 -0
  13. package/dist/shared/components/chaos/DrillBanner.js +119 -0
  14. package/dist/shared/components/chaos/DrillTag.js +62 -0
  15. package/dist/shared/components/chaos/GameDayStrip.js +61 -0
  16. package/dist/shared/components/client-chaos-gate.js +51 -0
  17. package/dist/shared/components/integrations/console/SignalCard.js +172 -167
  18. package/dist/shared/components/layout-editor/EditorTopBar.js +108 -105
  19. package/dist/shared/components/layout-editor/LayoutEditor.js +514 -508
  20. package/dist/shared/components/notifications/NotificationAnalyticsView.js +18 -10
  21. package/dist/shared/components/pipeline/PipelineEditorView.js +495 -479
  22. package/dist/shared/components/pipeline/TeamsView.js +184 -169
  23. package/dist/shared/lib/client-chaos.js +359 -0
  24. package/dist/shared/lib/load-error.js +26 -0
  25. package/dist/shared/lib/socket-realtime.js +31 -30
  26. package/dist/shared/lib/worker-socket.js +108 -89
  27. package/package.json +1 -1
@@ -8,7 +8,7 @@ import { normalizeReplaySampling as x, replaySampleDraw as Ae, currentReplayRout
8
8
  import { emitReplayTap as Ce, setReplayRecorderMode as N, registerReplayCapture as Ie, clipEndOffset as _e, withClipKind as De } from "../shared/lib/replay-capture.js";
9
9
  import { instrumentConsole as qe, instrumentRequests as Le, redactSecrets as Te } from "../shared/lib/replay-context.js";
10
10
  import { instrumentSocket as Pe } from "../shared/lib/replay-socket.js";
11
- const Ne = "nivaro-react@0.3.0", j = 1e4, Me = 150, Oe = 3e3, Ue = 600, We = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
11
+ const Ne = "nivaro-react@0.3.1", j = 1e4, Me = 150, Oe = 3e3, Ue = 600, We = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
12
12
  function Fe(n) {
13
13
  return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
14
14
  const l = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
package/dist/index.d.ts CHANGED
@@ -37,6 +37,8 @@ export declare function AccessDeniedPanel({ collection, itemId, onBack }: {
37
37
  onBack?: () => void;
38
38
  }): JSX.Element;
39
39
 
40
+ export declare const ACTIVE_GAMEDAYS_KEY: readonly ["chaos-gamedays-active"];
41
+
40
42
  /**
41
43
  * Options filter for every nivaro_users picker: mirrors listUsers() — redacted
42
44
  * accounts never appear, and suspended users cannot be PICKED (existing values
@@ -85,6 +87,24 @@ declare interface ActiveFilter {
85
87
  not?: boolean;
86
88
  }
87
89
 
90
+ /**
91
+ * The drill banner's quiet sibling (#2854): while a game day this person takes part in is
92
+ * running, a calm strip names the day and offers "Declare incident". Participants were invited
93
+ * to the day, so naming it gives nothing away; in blind mode the faults themselves stay hidden
94
+ * (the red drill banner does not show for responders) and Declare is how detection is timed.
95
+ * Data: `GET /api/chaos/gamedays/active` (titles, roles and times only, never the injects).
96
+ */
97
+ export declare interface ActiveGameday {
98
+ id: string;
99
+ title: string;
100
+ status: 'planned' | 'running';
101
+ role: 'lead' | 'scribe' | 'responder';
102
+ starts_at: string;
103
+ started_at: string | null;
104
+ ends_at: string | null;
105
+ channel_room: string | null;
106
+ }
107
+
88
108
  declare interface ActiveLayoutData {
89
109
  layout: LayoutMeta | null;
90
110
  groups: FieldGroup[];
@@ -371,6 +391,11 @@ export declare interface ApiVersionInfo {
371
391
 
372
392
  export declare function applyValidationRule(rule: FormValidationRule_2, value: unknown, label: string, record?: Record<string, unknown>): string | null;
373
393
 
394
+ declare interface ArmedFaultsState {
395
+ allowed: boolean;
396
+ armed: PublicArmedFault[];
397
+ }
398
+
374
399
  /**
375
400
  * "As it was" (#1385): the record as it stood when the notification was sent
376
401
  * beside the record now — two columns, the fields that moved since marked
@@ -491,6 +516,12 @@ declare type AskRelationInput = {
491
516
  option_filter?: Record<string, unknown> | null;
492
517
  };
493
518
 
519
+ declare interface AssignmentLike {
520
+ field?: string | null;
521
+ widget_id?: unknown;
522
+ label?: string | null;
523
+ }
524
+
494
525
  /** Admins choose which roles may record and edit videos (admins always can). */
495
526
  export declare function AuthorRolesButton(): JSX.Element | null;
496
527
 
@@ -577,6 +608,22 @@ declare interface AvailableBulkAction {
577
608
  guard?: GuardRule[] | null;
578
609
  }
579
610
 
611
+ declare type AxiosErrorCtor = new (message?: string, code?: string, config?: any, request?: any, response?: any) => Error;
612
+
613
+ /** The slice of an axios request config the interceptor reads and writes. */
614
+ declare interface AxiosLikeConfig {
615
+ method?: string;
616
+ url?: string;
617
+ baseURL?: string;
618
+ headers?: Record<string, unknown> & {
619
+ set?: (k: string, v: string) => unknown;
620
+ };
621
+ signal?: AbortSignal | {
622
+ aborted?: boolean;
623
+ } | null;
624
+ adapter?: unknown;
625
+ }
626
+
580
627
  declare type BackgroundPhase = 'idle' | 'offer' | 'starting' | 'running' | 'done' | 'error';
581
628
 
582
629
  /**
@@ -690,6 +737,13 @@ export declare function beginRecordingScreen(): () => void;
690
737
 
691
738
  declare type BinaryOp = '+' | '-' | '*' | '/' | '==' | '!=' | '<' | '<=' | '>' | '>=' | '&&' | '||';
692
739
 
740
+ /**
741
+ * Drop this socket while "socket gone" is on (or a pretend-down dependency asks for it) and let
742
+ * it reconnect when that ends — through the host's own reconnect and catch-up paths. Idempotent
743
+ * per socket; returns an unbind.
744
+ */
745
+ export declare function bindClientChaosSocket(socket: ClientChaosSocket | null | undefined): () => void;
746
+
693
747
  declare interface Blur {
694
748
  id: string;
695
749
  start_ms: number;
@@ -790,6 +844,12 @@ export declare function canOpenDm(): boolean;
790
844
 
791
845
  export declare function canPreviewFile(type: string | null | undefined): boolean;
792
846
 
847
+ /** Who may turn browser chaos on. #2862 widens this to chaos operators. */
848
+ export declare function canUseClientChaos(user: {
849
+ is_admin?: boolean | null;
850
+ masquerade?: boolean | null;
851
+ } | null | undefined): boolean;
852
+
793
853
  export declare function canViewAs(): boolean;
794
854
 
795
855
  declare interface Caption {
@@ -1391,12 +1451,117 @@ export declare function clearFormSchemaCache(collection?: string): void;
1391
1451
  /** Sign-out: every entry on this browser goes, whoever's it was. */
1392
1452
  export declare function clearRecordOutbox(): Promise<void>;
1393
1453
 
1454
+ /**
1455
+ * Browser chaos mode (#2840) — this tab's own requests fail or slow down for a set time, so a
1456
+ * tester can watch error boundaries, retry UI, autosave and the offline outbox do their job
1457
+ * without injecting anything on the server or for anyone else.
1458
+ *
1459
+ * One engine, every request path:
1460
+ * - `installClientChaosFetch()` wraps `window.fetch` (the SDK clients, widget renderers and raw
1461
+ * fetches). Install it FIRST at boot, before any module creates an SDK client: a client keeps
1462
+ * the fetch it saw when it was created.
1463
+ * - `clientChaosAxiosInterceptor(AxiosError)` is a request interceptor for an axios instance
1464
+ * (admin's lib/api.ts); a faked failure swaps the adapter so the response interceptors run on
1465
+ * it exactly as on a real one.
1466
+ * - `bindClientChaosSocket(socket)` drops the realtime socket for "socket gone" and lets it
1467
+ * reconnect when the window ends. The SharedWorker's socket is shared by every tab, so the
1468
+ * worker is never told: the tab's own facade (worker-socket.ts `chaosPause`) goes quiet
1469
+ * instead, which is all this tab can see of the socket anyway.
1470
+ *
1471
+ * Faked failures look exactly like real ones to app code (a fetch TypeError, a proxy's 503,
1472
+ * Fastify's 500 body, axios's own AxiosError shapes). What tells them apart is the
1473
+ * `x-nivaro-client-chaos` header: on a faked Response, and on the error reporter's own requests
1474
+ * (`/issues/client`, `/rum`, `/connection-reports`) while chaos is on, so crashes it provokes are
1475
+ * not filed as real bugs.
1476
+ *
1477
+ * State lives in sessionStorage (this tab, survives a reload) with a hard expiry; every read
1478
+ * checks it, so a fault never outlives its window even if no timer fires. Never faked: sign-in
1479
+ * and sign-out, `/api/chaos/*` (the gate), and the error reporter.
1480
+ *
1481
+ * "Pretend down" (#2858) rides the same engine: a design-mode surface names the dependencies it
1482
+ * pretends are down as URL patterns (memory only, gone on reload or when the surface closes)
1483
+ * and the matching requests fail through the real error paths.
1484
+ */
1485
+ export declare const CLIENT_CHAOS_HEADER = "x-nivaro-client-chaos";
1486
+
1487
+ /** The keyboard shortcut, for menus that show it. */
1488
+ export declare const CLIENT_CHAOS_SHORTCUT = "\u2318\u21E7.";
1489
+
1394
1490
  declare interface ClientAction {
1395
1491
  type: 'open-sidebar';
1396
1492
  collection: string;
1397
1493
  itemId: string;
1398
1494
  }
1399
1495
 
1496
+ /**
1497
+ * A request interceptor for an axios instance. Pass the instance's `AxiosError` class so faked
1498
+ * failures are the same objects axios itself throws (this package does not depend on axios):
1499
+ *
1500
+ * api.interceptors.request.use(clientChaosAxiosInterceptor(AxiosError))
1501
+ */
1502
+ export declare function clientChaosAxiosInterceptor(AxiosError: AxiosErrorCtor): <C extends AxiosLikeConfig>(config: C) => Promise<C>;
1503
+
1504
+ /**
1505
+ * The chaos gate as the browser sees it (#2840): `GET /api/chaos/status` says whether chaos is
1506
+ * allowed on this instance at all (refused in cloud mode and on production by default). A server
1507
+ * without the route (404) or an unreachable answer = chaos off, and every chaos surface hides.
1508
+ */
1509
+ export declare interface ClientChaosGate {
1510
+ /** Still asking. */
1511
+ loading: boolean;
1512
+ /** The server has chaos (the route answered). False hides every chaos surface. */
1513
+ present: boolean;
1514
+ /** This person may use browser chaos here right now. */
1515
+ allowed: boolean;
1516
+ /** Why not, when the server refused (shown in the toolbar). */
1517
+ reason: string | null;
1518
+ }
1519
+
1520
+ export declare type ClientChaosPreset = 'flaky' | 'api-down' | 'slow' | 'offline' | 'socket-gone';
1521
+
1522
+ /** The socket surface chaos needs: a facade's `chaosPause`, else disconnect/connect. */
1523
+ declare interface ClientChaosSocket {
1524
+ chaosPause?: (down: boolean) => void;
1525
+ connect?: () => unknown;
1526
+ disconnect?: () => unknown;
1527
+ }
1528
+
1529
+ declare interface ClientChaosStart {
1530
+ preset: ClientChaosPreset | null;
1531
+ durationMs: number;
1532
+ strength?: number;
1533
+ failWrites?: number;
1534
+ }
1535
+
1536
+ export declare interface ClientChaosState {
1537
+ v: 1;
1538
+ /** null when only "fail my next N saves" is on. */
1539
+ preset: ClientChaosPreset | null;
1540
+ /** flaky: share of requests that fail (%); slow: added milliseconds. Ignored otherwise. */
1541
+ strength: number;
1542
+ /** Writes (POST/PATCH/PUT/DELETE that save something) still to fail. */
1543
+ failWrites: number;
1544
+ startedAt: number;
1545
+ endsAt: number;
1546
+ }
1547
+
1548
+ /** What is on, in a few words: "API down · 3 saves left". */
1549
+ export declare function clientChaosSummary(s: ClientChaosState): string;
1550
+
1551
+ export declare function ClientChaosToolbar({ user, shortcut }: ClientChaosToolbarProps): ReactPortal | null;
1552
+
1553
+ export declare interface ClientChaosToolbarProps {
1554
+ /** The signed-in person (`is_admin`, and `masquerade` in a View-as tab). */
1555
+ user: ClientChaosUser | undefined;
1556
+ /** ⌘/Ctrl + Shift + . toggles the panel (default on). */
1557
+ shortcut?: boolean;
1558
+ }
1559
+
1560
+ export declare type ClientChaosUser = {
1561
+ is_admin?: boolean | null;
1562
+ masquerade?: boolean | null;
1563
+ } | null;
1564
+
1400
1565
  /**
1401
1566
  * Report a render crash into the issue log with its replay (#1370) — the one
1402
1567
  * call a host's error boundary makes from componentDidCatch:
@@ -1664,6 +1829,12 @@ export declare function CommentPanel({ collection, item, title, defaultExpanded,
1664
1829
  onQueueComment?: (text: string) => void;
1665
1830
  }): React_2.JSX.Element;
1666
1831
 
1832
+ /** Everything every view can lean on: the AI gateway, partners and the realtime socket. */
1833
+ export declare function commonPretendDownOptions(opts?: {
1834
+ ai?: boolean;
1835
+ partners?: boolean;
1836
+ }): PretendDownOption[];
1837
+
1667
1838
  /**
1668
1839
  * Comparison series for an inline grid (`options.compare_series`).
1669
1840
  *
@@ -1855,6 +2026,19 @@ export declare function CustomStatusEditor({ status, invalidate, theme, showExpi
1855
2026
  className?: string;
1856
2027
  }): JSX.Element;
1857
2028
 
2029
+ /**
2030
+ * The dependencies a dashboard uses, grouped by source: each collection its widgets read, Ask AI
2031
+ * charts, report presets and pipeline flow widgets — every widget reads through
2032
+ * `/dashboards/widgets/<id>/data`, so each option names the widgets it feeds. Collections are
2033
+ * named by `labels` (collection key → display name) when the host has them, else title-cased.
2034
+ */
2035
+ export declare function dashboardPretendDownOptions(widgets: Array<{
2036
+ id: string;
2037
+ type: string;
2038
+ collection?: string | null;
2039
+ field?: string | null;
2040
+ }>, labels?: Record<string, string | null | undefined>): PretendDownOption[];
2041
+
1858
2042
  export declare function DataTable<T = Record<string, unknown>>({ columns, rows, rowKey, total, page, limit, isLoading, isError, errorMessage, sort, onSortChange, onPageChange, onRowClick, onRowContextMenu, searchValue, onSearchChange, searchPlaceholder, filterDefs, filterValues, onFilterChange, toolbarRight, emptyMessage, minBodyHeight, fillHeight, footer, hideFilterRow, nowrapCells, density, pinFirstColumn, columnPins, onColumnPinChange, columnFilterRow, hScrollProxy, selectedIds, onSelectionChange, rowClassName, rowDragProps, rowTitle, enterKey, rowGroups, collapsedGroups, onToggleGroup }: DataTableProps<T>): React_2.JSX.Element;
1859
2043
 
1860
2044
  export declare interface DataTableProps<T = Record<string, unknown>> {
@@ -1950,6 +2134,10 @@ export declare function DbTuningView({ onNotice }: {
1950
2134
  onNotice?: Notice;
1951
2135
  }): JSX.Element;
1952
2136
 
2137
+ export declare function DeclareIncidentButton({ className }: {
2138
+ className?: string;
2139
+ }): JSX.Element;
2140
+
1953
2141
  /** Decoder for `?prefill=` (base64 → JSON), tolerant of '+' arriving as ' '. */
1954
2142
  export declare function decodePrefill(raw: string | null | undefined): Record<string, unknown> | null;
1955
2143
 
@@ -2323,6 +2511,15 @@ declare type DrawerRelationConfig = string | {
2323
2511
  match?: MatchedDrawerConfig;
2324
2512
  };
2325
2513
 
2514
+ export declare function DrillBanner({ stopHref, canStop }: DrillBannerProps): JSX.Element;
2515
+
2516
+ export declare interface DrillBannerProps {
2517
+ /** Where Stop sends operators (the chaos console). Default `/chaos`. */
2518
+ stopHref?: string;
2519
+ /** Show the Stop link (chaos operators / administrators). */
2520
+ canStop?: boolean;
2521
+ }
2522
+
2326
2523
  export declare const DrilldownContext: React_2.Context<DrilldownContextValue | null>;
2327
2524
 
2328
2525
  export declare interface DrilldownContextValue {
@@ -3088,6 +3285,10 @@ export declare type FormVisibilityRule = {
3088
3285
  action: 'show' | 'hide';
3089
3286
  };
3090
3287
 
3288
+ export declare function GameDayStrip({ enabled }: {
3289
+ enabled?: boolean;
3290
+ }): JSX.Element | null;
3291
+
3091
3292
  export declare interface GatedClient extends NivaroClient {
3092
3293
  /** Open = pass everything through; closed = queue reads. */
3093
3294
  setOpen(open: boolean): void;
@@ -3107,6 +3308,9 @@ export declare function getApiUpdate(): ApiVersionInfo | null;
3107
3308
 
3108
3309
  export declare function getAutofillRuns(): AutofillRun[];
3109
3310
 
3311
+ /** The live window, or null. An ended window is cleared here, whoever asks first. */
3312
+ export declare function getClientChaos(now?: number): ClientChaosState | null;
3313
+
3110
3314
  export declare function getFieldInterface(name: string | null | undefined): FieldInterfacePlugin | null;
3111
3315
 
3112
3316
  export declare function getFiscalStartMonth(): number;
@@ -4199,6 +4403,12 @@ declare interface InputBinding {
4199
4403
  binding_value: string;
4200
4404
  }
4201
4405
 
4406
+ /**
4407
+ * Wrap `window.fetch` once. Call it before anything creates an SDK client (a client keeps the
4408
+ * fetch it was created with). Also keeps `navigator.onLine` honest for the offline preset.
4409
+ */
4410
+ export declare function installClientChaosFetch(): void;
4411
+
4202
4412
  /**
4203
4413
  * Document-level intent listener: resting on (or keyboard-focusing) a same-origin link
4204
4414
  * preloads its screen's code, and a record link also warms the record. Returns the uninstaller.
@@ -5006,6 +5216,15 @@ declare interface LayoutMeta {
5006
5216
  entry_config?: Record<string, unknown> | null;
5007
5217
  }
5008
5218
 
5219
+ /**
5220
+ * The dependencies a record form uses (layout editor, record-page Edit layout): its record
5221
+ * widgets (custom queries and rollups render through them), its built-in panels, then the AI
5222
+ * gateway, partners and live updates.
5223
+ */
5224
+ export declare function layoutPretendDownOptions(layout: {
5225
+ assignments?: AssignmentLike[] | null;
5226
+ } | null | undefined): PretendDownOption[];
5227
+
5009
5228
  declare interface LayoutSlotHandle {
5010
5229
  update?: (props: LayoutSlotProps) => void;
5011
5230
  destroy?: () => void;
@@ -5268,6 +5487,19 @@ export declare type LiveRecordResult<T> = UseQueryResult<T | null> & {
5268
5487
  /** Pure form of `useLiveRefetchInterval` (exported for tests). */
5269
5488
  export declare function liveRefetchInterval(live: boolean, base: number | false | undefined, safetyMs?: number): number | false | undefined;
5270
5489
 
5490
+ /**
5491
+ * The degraded state for a widget or panel whose data did not load (#2858): what happened in
5492
+ * plain words and a way to try again, instead of a blank box, "No data" or a raw error string.
5493
+ */
5494
+ export declare function LoadErrorNote({ message, onRetry, className, centered }: {
5495
+ message: string;
5496
+ onRetry?: () => void;
5497
+ className?: string;
5498
+ centered?: boolean;
5499
+ }): JSX.Element;
5500
+
5501
+ export declare function loadErrorText(err: unknown, what?: string): string;
5502
+
5271
5503
  declare interface LockHolder {
5272
5504
  locked_by: string;
5273
5505
  locked_by_name: string | null;
@@ -6039,6 +6271,9 @@ export declare function openCatalogItem(collection: string, id: string, context?
6039
6271
 
6040
6272
  export declare function openChatRoom(room: string, label?: string): void;
6041
6273
 
6274
+ /** Open the toolbar from anywhere (a user menu item, a command). */
6275
+ export declare function openClientChaosToolbar(): void;
6276
+
6042
6277
  export declare function openDmWith(userId: string, displayName?: string): void;
6043
6278
 
6044
6279
  declare interface OpenverseSearch {
@@ -6742,6 +6977,50 @@ export declare interface PreparedReplayClip {
6742
6977
  */
6743
6978
  export declare function prepareReplayClip(kind: ReplayClipKind): PreparedReplayClip;
6744
6979
 
6980
+ /**
6981
+ * A toolbar button with the list in an anchored popover. Hidden unless the chaos gate allows
6982
+ * browser chaos for this person (the same gate as the personal chaos toolbar).
6983
+ */
6984
+ export declare function PretendDownButton({ scope, options, user, className }: {
6985
+ scope: string;
6986
+ options: PretendDownOption[];
6987
+ user: ClientChaosUser | undefined;
6988
+ className?: string;
6989
+ }): JSX.Element | null;
6990
+
6991
+ /** Pretend-down layers, by the surface that set them (#2858). Memory only. */
6992
+ declare interface PretendDownDependency {
6993
+ id: string;
6994
+ label: string;
6995
+ /** Request paths (after `/api`) this dependency serves. */
6996
+ patterns: RegExp[];
6997
+ /** The status a request to it answers with while pretended down (default 503). */
6998
+ status?: number;
6999
+ /** Pretending this one down also drops the realtime socket. */
7000
+ socket?: boolean;
7001
+ }
7002
+
7003
+ declare type PretendDownKind = 'query' | 'data' | 'partner' | 'ai' | 'realtime' | 'panel';
7004
+
7005
+ /** The toggle list — inside a host's own popover, or PretendDownButton's. */
7006
+ export declare function PretendDownList({ scope, options, className }: {
7007
+ scope: string;
7008
+ options: PretendDownOption[];
7009
+ className?: string;
7010
+ }): JSX.Element;
7011
+
7012
+ export declare interface PretendDownOption extends PretendDownDependency {
7013
+ kind: PretendDownKind;
7014
+ /** One line under the label: what it feeds ("3 widgets"). */
7015
+ hint?: string;
7016
+ }
7017
+
7018
+ /** Inside the layout editor's Preview popover. */
7019
+ export declare function PretendDownSection({ scope, options }: {
7020
+ scope: string;
7021
+ options: PretendDownOption[];
7022
+ }): JSX.Element | null;
7023
+
6745
7024
  /**
6746
7025
  * Inline attachment preview — click a file, see it, without a download round
6747
7026
  * trip. Images, PDFs, video and audio render in an overlay; anything else
@@ -6812,6 +7091,26 @@ declare type ProposalPollAnswer = {
6812
7091
  json: any;
6813
7092
  };
6814
7093
 
7094
+ /**
7095
+ * "Drill running" banner (#2846): while any chaos fault is armed on this instance, every app
7096
+ * shows a striped, calm-but-unmissable strip — which fault, on what, who started it, when it
7097
+ * ends, and a Stop link for chaos operators — so nobody debugs a fake outage or files a ticket
7098
+ * about it. Data: `GET /api/chaos/armed` (labels, names and end times only) plus the
7099
+ * `chaos:armed` socket event; once the server says chaos is refused here, the banner asks
7100
+ * nothing more. Mount once per app shell inside a NivaroProvider; renders nothing when idle.
7101
+ */
7102
+ declare interface PublicArmedFault {
7103
+ id: string;
7104
+ fault_key: string;
7105
+ label: string;
7106
+ /** Wording, never an id or pattern: "everything", "10% of traffic", "one person"… */
7107
+ target: string;
7108
+ started_by_name: string | null;
7109
+ started_at: number;
7110
+ ends_at: number;
7111
+ run_id: string | null;
7112
+ }
7113
+
6815
7114
  export declare function PushReadinessChip({ collection, itemId, transitionId, itemActionId, label, compact, onJump }: {
6816
7115
  collection: string;
6817
7116
  itemId: string;
@@ -8928,6 +9227,8 @@ export declare function startAutofillRun(cfg: FetchCfg, run: {
8928
9227
  poll?: typeof pollProposal;
8929
9228
  }): AutofillRun;
8930
9229
 
9230
+ export declare function startClientChaos(opts: ClientChaosStart, now?: number): ClientChaosState;
9231
+
8931
9232
  export declare function startHelpVideoWalk(w: {
8932
9233
  videoId: string;
8933
9234
  title: string;
@@ -8972,6 +9273,9 @@ declare interface StepStyle {
8972
9273
  size: 'small' | 'medium' | 'large';
8973
9274
  }
8974
9275
 
9276
+ /** Stop: always clears this tab, whatever else is down. */
9277
+ export declare function stopClientChaos(): void;
9278
+
8975
9279
  /**
8976
9280
  * Idle or stuck (#1394). /presence/online, the people page and the team view
8977
9281
  * answer `stuck: { minutes, label }` for someone at the keyboard, on the same
@@ -9003,6 +9307,8 @@ export declare function SubmissionStatusPill({ status }: {
9003
9307
  status: string;
9004
9308
  }): JSX.Element;
9005
9309
 
9310
+ export declare function subscribeClientChaos(cb: () => void): () => void;
9311
+
9006
9312
  /**
9007
9313
  * The one subscription editor — create + edit for nivaro_notification_subscriptions,
9008
9314
  * shared by the profile's Notifications & alerts card and the My Subscriptions
@@ -9521,6 +9827,8 @@ declare type UploadRow = {
9521
9827
  error_code?: string | null;
9522
9828
  };
9523
9829
 
9830
+ export declare function useActiveGamedays(enabled?: boolean): ActiveGameday[];
9831
+
9524
9832
  /**
9525
9833
  * `useAfterIdle(ms)` — false on mount, true once the browser has had `ms` of
9526
9834
  * settle time after the first paint. Gate secondary reads on it (freshness
@@ -9546,6 +9854,14 @@ export declare function useApiFetchConfig(): {
9546
9854
 
9547
9855
  export declare function useApiUpdate(): ApiVersionInfo | null;
9548
9856
 
9857
+ /**
9858
+ * The armed faults every signed-in person may see. Polls slowly (the socket event is the
9859
+ * fast path) and stops altogether once the gate said no.
9860
+ */
9861
+ export declare function useArmedFaults(): ArmedFaultsState & {
9862
+ ready: boolean;
9863
+ };
9864
+
9549
9865
  /**
9550
9866
  * Drag props for a row or chip that can be dropped into the panel (#1886).
9551
9867
  * Only while the panel is open — rows stay text-selectable otherwise.
@@ -9682,6 +9998,11 @@ export declare function useChatSearch(q: string, filters?: ChatSearchFilters): {
9682
9998
  /** True while a clean recording runs. */
9683
9999
  export declare function useCleanRecording(): boolean;
9684
10000
 
10001
+ /** This tab's chaos window, live. */
10002
+ export declare function useClientChaos(): ClientChaosState | null;
10003
+
10004
+ export declare function useClientChaosGate(user: ClientChaosUser | undefined): ClientChaosGate;
10005
+
9685
10006
  export declare function useCreateChannel(): UseMutationResult<unknown, Error, {
9686
10007
  name: string;
9687
10008
  key?: string;
@@ -9714,6 +10035,12 @@ export declare function useDeleteMessage(room: string): UseMutationResult<unknow
9714
10035
  /** Re-render when do not disturb is due to end, so the mark and the row clear on time. */
9715
10036
  export declare function useDndActive(): boolean;
9716
10037
 
10038
+ /**
10039
+ * Whether the drill banner (or its game-day strip) is showing — both carry Declare incident, so a
10040
+ * page with its own copy (the Ops Console header) hides it meanwhile. Same reads as the banner.
10041
+ */
10042
+ export declare function useDrillBannerShowing(): boolean;
10043
+
9717
10044
  export declare function useDrilldown(): DrilldownContextValue | null;
9718
10045
 
9719
10046
  export declare function useDrilldownViews(): Record<string, DrilldownViewOverride>;
@@ -10081,6 +10408,9 @@ export declare function usePlanGridHost(): PlanGridHost | null;
10081
10408
  /** Who else is viewing one record (joins its room; names only). */
10082
10409
  export declare function usePresence(collection: string | null | undefined, item: string | number | null | undefined): RecordPresence;
10083
10410
 
10411
+ /** Clears what the scope pretends is down when the surface that owns it unmounts. */
10412
+ export declare function usePretendDownScope(scope: string): void;
10413
+
10084
10414
  /**
10085
10415
  * Publish what this page shows. Re-publishes only when the context's content
10086
10416
  * changes (compared as JSON), and withdraws it when the page unmounts.
@@ -10523,6 +10853,9 @@ declare interface WidgetSlotProps {
10523
10853
  /** Sign-out, user change, anything that must leave nothing behind. */
10524
10854
  export declare function wipeMetadataCache(s?: MetadataStore): Promise<void>;
10525
10855
 
10856
+ /** A fetch that applies this tab's chaos before handing off to `base`. */
10857
+ export declare function withClientChaos(base: typeof fetch): typeof fetch;
10858
+
10526
10859
  /** Add the clip kind to a session-recording start command (POST /start body). */
10527
10860
  export declare function withClipKind<T extends {
10528
10861
  _body?: unknown;
@@ -10539,6 +10872,14 @@ export declare interface WorkerSocket extends FallbackSocket {
10539
10872
  disconnect(): void;
10540
10873
  /** 'pending' until the worker greets or the fallback is taken. */
10541
10874
  mode(): 'pending' | 'worker' | 'fallback';
10875
+ /**
10876
+ * Browser chaos "socket gone" (#2840) for THIS tab: the worker's socket serves every tab, so
10877
+ * it is never touched — this tab hears a disconnect, gets no events and sends nothing until
10878
+ * the pause ends, then re-greets the worker (connect + auth:ok, as a new tab would) and
10879
+ * reloads what it may have missed (`nvr:catchup-full`). On the fallback socket it is a real
10880
+ * disconnect and connect.
10881
+ */
10882
+ chaosPause(down: boolean): void;
10542
10883
  /** The transport the worker's socket uses (for status displays). */
10543
10884
  io: {
10544
10885
  engine: {