@nivaro/react 0.2.56 → 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 (80) hide show
  1. package/dist/components/slots/TasksSlot.js +31 -29
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +414 -1
  5. package/dist/index.js +767 -716
  6. package/dist/shared/components/ClientChaosToolbar.js +410 -0
  7. package/dist/shared/components/ItemEditForm.js +666 -658
  8. package/dist/shared/components/LoadErrorNote.js +49 -0
  9. package/dist/shared/components/MyWorkView.js +47 -37
  10. package/dist/shared/components/PretendDown.js +258 -0
  11. package/dist/shared/components/ProfileView.js +208 -184
  12. package/dist/shared/components/QueryErrorState.js +16 -0
  13. package/dist/shared/components/ReportView.js +1351 -1338
  14. package/dist/shared/components/WidgetSlot.js +438 -418
  15. package/dist/shared/components/ai/AiPlanCard.js +427 -0
  16. package/dist/shared/components/ai/AiPlanChanges.js +117 -0
  17. package/dist/shared/components/ai/TaskDo.js +1022 -0
  18. package/dist/shared/components/chaos/DeclareIncidentButton.js +72 -0
  19. package/dist/shared/components/chaos/DrillBanner.js +119 -0
  20. package/dist/shared/components/chaos/DrillTag.js +62 -0
  21. package/dist/shared/components/chaos/GameDayStrip.js +61 -0
  22. package/dist/shared/components/chat/ChatAnalyticsView.js +19 -17
  23. package/dist/shared/components/chat/ChatPanel.js +1356 -1317
  24. package/dist/shared/components/chat/HuddleAnalyticsTab.js +198 -0
  25. package/dist/shared/components/chat/RoomHeaderMenu.js +78 -65
  26. package/dist/shared/components/chat/chat-core.js +273 -264
  27. package/dist/shared/components/chat/huddle/HuddleAudioUi.js +397 -0
  28. package/dist/shared/components/chat/huddle/HuddleCallBar.js +296 -0
  29. package/dist/shared/components/chat/huddle/HuddleCallLayer.js +180 -0
  30. package/dist/shared/components/chat/huddle/HuddleCamera.js +124 -0
  31. package/dist/shared/components/chat/huddle/HuddleCollab.js +320 -0
  32. package/dist/shared/components/chat/huddle/HuddleControls.js +82 -121
  33. package/dist/shared/components/chat/huddle/HuddleDraw.js +231 -0
  34. package/dist/shared/components/chat/huddle/HuddleLiveBadge.js +52 -0
  35. package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +143 -0
  36. package/dist/shared/components/chat/huddle/HuddleScheduleCard.js +190 -0
  37. package/dist/shared/components/chat/huddle/HuddleScheduleForm.js +188 -0
  38. package/dist/shared/components/chat/huddle/HuddleStage.js +184 -89
  39. package/dist/shared/components/chat/huddle/HuddleStageTools.js +197 -0
  40. package/dist/shared/components/chat/huddle/huddle-audio-logic.js +156 -0
  41. package/dist/shared/components/chat/huddle/huddle-audio.js +69 -0
  42. package/dist/shared/components/chat/huddle/huddle-calls.js +129 -0
  43. package/dist/shared/components/chat/huddle/huddle-camera.js +143 -0
  44. package/dist/shared/components/chat/huddle/huddle-collab-store.js +391 -0
  45. package/dist/shared/components/chat/huddle/huddle-device-prefs.js +55 -0
  46. package/dist/shared/components/chat/huddle/huddle-devices.js +99 -0
  47. package/dist/shared/components/chat/huddle/huddle-draw.js +226 -0
  48. package/dist/shared/components/chat/huddle/huddle-follow-bus.js +96 -0
  49. package/dist/shared/components/chat/huddle/huddle-hold.js +62 -0
  50. package/dist/shared/components/chat/huddle/huddle-link-quality.js +159 -0
  51. package/dist/shared/components/chat/huddle/huddle-live.js +82 -0
  52. package/dist/shared/components/chat/huddle/huddle-pip.js +343 -0
  53. package/dist/shared/components/chat/huddle/huddle-quality.js +22 -0
  54. package/dist/shared/components/chat/huddle/huddle-reactions.js +71 -0
  55. package/dist/shared/components/chat/huddle/huddle-ring-refused.js +34 -0
  56. package/dist/shared/components/chat/huddle/huddle-schedule.js +102 -0
  57. package/dist/shared/components/chat/huddle/huddle-sfu.js +176 -0
  58. package/dist/shared/components/chat/huddle/huddle-shortcuts.js +91 -0
  59. package/dist/shared/components/chat/huddle/huddle-speaking.js +100 -0
  60. package/dist/shared/components/chat/huddle/huddle-store.js +431 -157
  61. package/dist/shared/components/chat/huddle/useHuddle.js +46 -38
  62. package/dist/shared/components/chat/huddle/useHuddleAudio.js +35 -0
  63. package/dist/shared/components/client-chaos-gate.js +51 -0
  64. package/dist/shared/components/integrations/console/SignalCard.js +172 -167
  65. package/dist/shared/components/item-edit/GroupSection.js +1 -0
  66. package/dist/shared/components/item-edit/RecordChatActions.js +68 -59
  67. package/dist/shared/components/item-edit/UserChip.js +145 -142
  68. package/dist/shared/components/layout-editor/EditorTopBar.js +108 -105
  69. package/dist/shared/components/layout-editor/LayoutEditor.js +514 -508
  70. package/dist/shared/components/notifications/NotificationAnalyticsView.js +18 -10
  71. package/dist/shared/components/panels/TaskPanel.js +51 -49
  72. package/dist/shared/components/pipeline/PipelineEditorView.js +495 -479
  73. package/dist/shared/components/pipeline/TeamsView.js +184 -169
  74. package/dist/shared/components/support/TicketDetailSheet.js +57 -42
  75. package/dist/shared/lib/client-chaos.js +359 -0
  76. package/dist/shared/lib/load-error.js +26 -0
  77. package/dist/shared/lib/notification-sound.js +25 -16
  78. package/dist/shared/lib/socket-realtime.js +31 -30
  79. package/dist/shared/lib/worker-socket.js +108 -89
  80. package/package.json +2 -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.2.56", 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[];
@@ -163,6 +183,8 @@ export declare function AiMemorySuggestions({ suggestions, className }: {
163
183
  className?: string;
164
184
  }): JSX.Element | null;
165
185
 
186
+ declare type AiPlanSubscribe = (event: 'ai:plan', handler: (payload: Record<string, unknown>) => void) => () => void;
187
+
166
188
  export declare function AiReviewCard({ templateId }: {
167
189
  templateId: string;
168
190
  }): React_2.JSX.Element;
@@ -369,6 +391,11 @@ export declare interface ApiVersionInfo {
369
391
 
370
392
  export declare function applyValidationRule(rule: FormValidationRule_2, value: unknown, label: string, record?: Record<string, unknown>): string | null;
371
393
 
394
+ declare interface ArmedFaultsState {
395
+ allowed: boolean;
396
+ armed: PublicArmedFault[];
397
+ }
398
+
372
399
  /**
373
400
  * "As it was" (#1385): the record as it stood when the notification was sent
374
401
  * beside the record now — two columns, the fields that moved since marked
@@ -489,6 +516,12 @@ declare type AskRelationInput = {
489
516
  option_filter?: Record<string, unknown> | null;
490
517
  };
491
518
 
519
+ declare interface AssignmentLike {
520
+ field?: string | null;
521
+ widget_id?: unknown;
522
+ label?: string | null;
523
+ }
524
+
492
525
  /** Admins choose which roles may record and edit videos (admins always can). */
493
526
  export declare function AuthorRolesButton(): JSX.Element | null;
494
527
 
@@ -575,6 +608,22 @@ declare interface AvailableBulkAction {
575
608
  guard?: GuardRule[] | null;
576
609
  }
577
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
+
578
627
  declare type BackgroundPhase = 'idle' | 'offer' | 'starting' | 'running' | 'done' | 'error';
579
628
 
580
629
  /**
@@ -688,6 +737,13 @@ export declare function beginRecordingScreen(): () => void;
688
737
 
689
738
  declare type BinaryOp = '+' | '-' | '*' | '/' | '==' | '!=' | '<' | '<=' | '>' | '>=' | '&&' | '||';
690
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
+
691
747
  declare interface Blur {
692
748
  id: string;
693
749
  start_ms: number;
@@ -788,6 +844,12 @@ export declare function canOpenDm(): boolean;
788
844
 
789
845
  export declare function canPreviewFile(type: string | null | undefined): boolean;
790
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
+
791
853
  export declare function canViewAs(): boolean;
792
854
 
793
855
  declare interface Caption {
@@ -1165,7 +1227,7 @@ export declare function ChatPanel({ open, onClose, renderMessageBody, requestedD
1165
1227
  label?: string;
1166
1228
  nonce: number;
1167
1229
  } | null;
1168
- }): JSX.Element | null;
1230
+ }): JSX.Element;
1169
1231
 
1170
1232
  /** A poll posted into a room (#2337); counts are server-side, anonymous polls carry no voters. */
1171
1233
  declare interface ChatPoll {
@@ -1389,12 +1451,117 @@ export declare function clearFormSchemaCache(collection?: string): void;
1389
1451
  /** Sign-out: every entry on this browser goes, whoever's it was. */
1390
1452
  export declare function clearRecordOutbox(): Promise<void>;
1391
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
+
1392
1490
  declare interface ClientAction {
1393
1491
  type: 'open-sidebar';
1394
1492
  collection: string;
1395
1493
  itemId: string;
1396
1494
  }
1397
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
+
1398
1565
  /**
1399
1566
  * Report a render crash into the issue log with its replay (#1370) — the one
1400
1567
  * call a host's error boundary makes from componentDidCatch:
@@ -1662,6 +1829,12 @@ export declare function CommentPanel({ collection, item, title, defaultExpanded,
1662
1829
  onQueueComment?: (text: string) => void;
1663
1830
  }): React_2.JSX.Element;
1664
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
+
1665
1838
  /**
1666
1839
  * Comparison series for an inline grid (`options.compare_series`).
1667
1840
  *
@@ -1853,6 +2026,19 @@ export declare function CustomStatusEditor({ status, invalidate, theme, showExpi
1853
2026
  className?: string;
1854
2027
  }): JSX.Element;
1855
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
+
1856
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;
1857
2043
 
1858
2044
  export declare interface DataTableProps<T = Record<string, unknown>> {
@@ -1948,6 +2134,10 @@ export declare function DbTuningView({ onNotice }: {
1948
2134
  onNotice?: Notice;
1949
2135
  }): JSX.Element;
1950
2136
 
2137
+ export declare function DeclareIncidentButton({ className }: {
2138
+ className?: string;
2139
+ }): JSX.Element;
2140
+
1951
2141
  /** Decoder for `?prefill=` (base64 → JSON), tolerant of '+' arriving as ' '. */
1952
2142
  export declare function decodePrefill(raw: string | null | undefined): Record<string, unknown> | null;
1953
2143
 
@@ -2321,6 +2511,15 @@ declare type DrawerRelationConfig = string | {
2321
2511
  match?: MatchedDrawerConfig;
2322
2512
  };
2323
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
+
2324
2523
  export declare const DrilldownContext: React_2.Context<DrilldownContextValue | null>;
2325
2524
 
2326
2525
  export declare interface DrilldownContextValue {
@@ -3086,6 +3285,10 @@ export declare type FormVisibilityRule = {
3086
3285
  action: 'show' | 'hide';
3087
3286
  };
3088
3287
 
3288
+ export declare function GameDayStrip({ enabled }: {
3289
+ enabled?: boolean;
3290
+ }): JSX.Element | null;
3291
+
3089
3292
  export declare interface GatedClient extends NivaroClient {
3090
3293
  /** Open = pass everything through; closed = queue reads. */
3091
3294
  setOpen(open: boolean): void;
@@ -3105,6 +3308,9 @@ export declare function getApiUpdate(): ApiVersionInfo | null;
3105
3308
 
3106
3309
  export declare function getAutofillRuns(): AutofillRun[];
3107
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
+
3108
3314
  export declare function getFieldInterface(name: string | null | undefined): FieldInterfacePlugin | null;
3109
3315
 
3110
3316
  export declare function getFiscalStartMonth(): number;
@@ -3197,6 +3403,20 @@ export declare interface HeaderWidgetInfo {
3197
3403
  inputBindings: InputBinding[];
3198
3404
  }
3199
3405
 
3406
+ /**
3407
+ * Hold notifications during a huddle (#2852). While I am in a huddle (and
3408
+ * `preferences.huddle_hold_notifications` is not false) the toasts and sounds
3409
+ * for new notifications and chat messages are held: the inbox and the badges
3410
+ * still move, the stage shows a count, and on leaving the held ones are
3411
+ * released as one summary toast and one sound. Critical notifications are
3412
+ * never held (same rule as do not disturb).
3413
+ */
3414
+ declare interface HeldItem {
3415
+ kind: 'notification' | 'chat';
3416
+ title: string;
3417
+ at: number;
3418
+ }
3419
+
3200
3420
  /** GET /help-videos/:id/analytics (authors). */
3201
3421
  declare interface HelpVideoAnalytics {
3202
3422
  views: number;
@@ -3678,6 +3898,9 @@ declare interface Hold {
3678
3898
  hold_ms: number;
3679
3899
  }
3680
3900
 
3901
+ /** Queue one toast-worthy thing; returns true when it was held (caller shows nothing). */
3902
+ export declare function holdNotification(item: Omit<HeldItem, 'at'>): boolean;
3903
+
3681
3904
  /** The house style (#1551): defaults every new help video starts from.
3682
3905
  * Administrators only. */
3683
3906
  export declare function HouseStyleButton(): JSX.Element | null;
@@ -3689,6 +3912,14 @@ export declare function HScrollProxy({ scrollerRef }: {
3689
3912
  scrollerRef: React_2.RefObject<HTMLDivElement | null>;
3690
3913
  }): React_2.JSX.Element | null;
3691
3914
 
3915
+ export declare function HuddleCallLayer(): ReactPortal | null;
3916
+
3917
+ /** Hosts whose own bell toasts `notification:new` skip category `huddle` while this is mounted. */
3918
+ export declare function huddleCallLayerMounted(): boolean;
3919
+
3920
+ /** Am I in a live huddle, with holding on? Read at the moment a toast would fire. */
3921
+ export declare function huddleHolds(prefs: Record<string, unknown> | null | undefined): boolean;
3922
+
3692
3923
  /** Time without real input before someone counts as idle. */
3693
3924
  export declare const IDLE_AFTER_MS: number;
3694
3925
 
@@ -4172,6 +4403,12 @@ declare interface InputBinding {
4172
4403
  binding_value: string;
4173
4404
  }
4174
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
+
4175
4412
  /**
4176
4413
  * Document-level intent listener: resting on (or keyboard-focusing) a same-origin link
4177
4414
  * preloads its screen's code, and a record link also warms the record. Returns the uninstaller.
@@ -4979,6 +5216,15 @@ declare interface LayoutMeta {
4979
5216
  entry_config?: Record<string, unknown> | null;
4980
5217
  }
4981
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
+
4982
5228
  declare interface LayoutSlotHandle {
4983
5229
  update?: (props: LayoutSlotProps) => void;
4984
5230
  destroy?: () => void;
@@ -5241,6 +5487,19 @@ export declare type LiveRecordResult<T> = UseQueryResult<T | null> & {
5241
5487
  /** Pure form of `useLiveRefetchInterval` (exported for tests). */
5242
5488
  export declare function liveRefetchInterval(live: boolean, base: number | false | undefined, safetyMs?: number): number | false | undefined;
5243
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
+
5244
5503
  declare interface LockHolder {
5245
5504
  locked_by: string;
5246
5505
  locked_by_name: string | null;
@@ -6012,6 +6271,9 @@ export declare function openCatalogItem(collection: string, id: string, context?
6012
6271
 
6013
6272
  export declare function openChatRoom(room: string, label?: string): void;
6014
6273
 
6274
+ /** Open the toolbar from anywhere (a user menu item, a command). */
6275
+ export declare function openClientChaosToolbar(): void;
6276
+
6015
6277
  export declare function openDmWith(userId: string, displayName?: string): void;
6016
6278
 
6017
6279
  declare interface OpenverseSearch {
@@ -6715,6 +6977,50 @@ export declare interface PreparedReplayClip {
6715
6977
  */
6716
6978
  export declare function prepareReplayClip(kind: ReplayClipKind): PreparedReplayClip;
6717
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
+
6718
7024
  /**
6719
7025
  * Inline attachment preview — click a file, see it, without a download round
6720
7026
  * trip. Images, PDFs, video and audio render in an overlay; anything else
@@ -6785,6 +7091,26 @@ declare type ProposalPollAnswer = {
6785
7091
  json: any;
6786
7092
  };
6787
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
+
6788
7114
  export declare function PushReadinessChip({ collection, itemId, transitionId, itemActionId, label, compact, onJump }: {
6789
7115
  collection: string;
6790
7116
  itemId: string;
@@ -7898,6 +8224,8 @@ export declare type RelationOption = {
7898
8224
  raw: Record<string, unknown>;
7899
8225
  };
7900
8226
 
8227
+ export declare function releaseHeld(): HeldItem[];
8228
+
7901
8229
  export declare type RenderFieldProps = {
7902
8230
  field: any;
7903
8231
  value: unknown;
@@ -8899,6 +9227,8 @@ export declare function startAutofillRun(cfg: FetchCfg, run: {
8899
9227
  poll?: typeof pollProposal;
8900
9228
  }): AutofillRun;
8901
9229
 
9230
+ export declare function startClientChaos(opts: ClientChaosStart, now?: number): ClientChaosState;
9231
+
8902
9232
  export declare function startHelpVideoWalk(w: {
8903
9233
  videoId: string;
8904
9234
  title: string;
@@ -8943,6 +9273,9 @@ declare interface StepStyle {
8943
9273
  size: 'small' | 'medium' | 'large';
8944
9274
  }
8945
9275
 
9276
+ /** Stop: always clears this tab, whatever else is down. */
9277
+ export declare function stopClientChaos(): void;
9278
+
8946
9279
  /**
8947
9280
  * Idle or stuck (#1394). /presence/online, the people page and the team view
8948
9281
  * answer `stuck: { minutes, label }` for someone at the keyboard, on the same
@@ -8974,6 +9307,8 @@ export declare function SubmissionStatusPill({ status }: {
8974
9307
  status: string;
8975
9308
  }): JSX.Element;
8976
9309
 
9310
+ export declare function subscribeClientChaos(cb: () => void): () => void;
9311
+
8977
9312
  /**
8978
9313
  * The one subscription editor — create + edit for nivaro_notification_subscriptions,
8979
9314
  * shared by the profile's Notifications & alerts card and the My Subscriptions
@@ -9177,6 +9512,49 @@ declare interface TailRequest {
9177
9512
  /** Feed the bus from a socket.io-style client. Returns the undo. */
9178
9513
  export declare function tapReplaySocket(socket: SocketLike_2): () => void;
9179
9514
 
9515
+ /**
9516
+ * The button + its anchored panel. Renders nothing unless this person may
9517
+ * ask (the server re-checks everything, delegates included).
9518
+ */
9519
+ export declare function TaskDoButton({ task, isAssignee, subscribe, compact, onTaskChanged, className }: {
9520
+ task: TaskDoTask;
9521
+ /** The host already knows (My Work lists only this person's tasks). */
9522
+ isAssignee?: boolean;
9523
+ subscribe?: AiPlanSubscribe;
9524
+ /** Icon-only (list rows). */
9525
+ compact?: boolean;
9526
+ /** The task was completed / a reply was sent from the panel. */
9527
+ onTaskChanged?: () => void;
9528
+ className?: string;
9529
+ }): JSX.Element | null;
9530
+
9531
+ /** The panel body — also usable on its own (a page that already has room). */
9532
+ export declare function TaskDoPanel({ task, subscribe, onTaskChanged }: {
9533
+ task: TaskDoTask;
9534
+ subscribe?: AiPlanSubscribe;
9535
+ onTaskChanged?: () => void;
9536
+ }): JSX.Element;
9537
+
9538
+ /**
9539
+ * "Let AI do this" on a task or a support ticket (#2862–#2866). The button
9540
+ * shows for the person the work is assigned to when an administrator turned
9541
+ * the feature on for that kind; the panel beside it asks the model for a
9542
+ * plan (built and previewed as them by the plan engine), shows the review
9543
+ * figures — run time, hands-on time saved, what each step touches, the risk
9544
+ * and what cannot be rolled back — and then hands over to the plan card
9545
+ * (approve now / later, live progress, retry). After it ran: mark the task
9546
+ * done, draft a reply to the requester (tickets), or undo what AI did.
9547
+ */
9548
+ declare interface TaskDoTask {
9549
+ id: number;
9550
+ /** 'support' = a ticket; anything else = a task. */
9551
+ kind?: string | null;
9552
+ status: string;
9553
+ assignee?: string | null;
9554
+ category_id?: number | null;
9555
+ title?: string;
9556
+ }
9557
+
9180
9558
  export declare function TaskPanel({ collection, item, title, defaultExpanded, queuedTasks, onQueueTask, onRemoveQueuedTask }: {
9181
9559
  collection: string;
9182
9560
  item: string;
@@ -9449,6 +9827,8 @@ declare type UploadRow = {
9449
9827
  error_code?: string | null;
9450
9828
  };
9451
9829
 
9830
+ export declare function useActiveGamedays(enabled?: boolean): ActiveGameday[];
9831
+
9452
9832
  /**
9453
9833
  * `useAfterIdle(ms)` — false on mount, true once the browser has had `ms` of
9454
9834
  * settle time after the first paint. Gate secondary reads on it (freshness
@@ -9474,6 +9854,14 @@ export declare function useApiFetchConfig(): {
9474
9854
 
9475
9855
  export declare function useApiUpdate(): ApiVersionInfo | null;
9476
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
+
9477
9865
  /**
9478
9866
  * Drag props for a row or chip that can be dropped into the panel (#1886).
9479
9867
  * Only while the panel is open — rows stay text-selectable otherwise.
@@ -9610,6 +9998,11 @@ export declare function useChatSearch(q: string, filters?: ChatSearchFilters): {
9610
9998
  /** True while a clean recording runs. */
9611
9999
  export declare function useCleanRecording(): boolean;
9612
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
+
9613
10006
  export declare function useCreateChannel(): UseMutationResult<unknown, Error, {
9614
10007
  name: string;
9615
10008
  key?: string;
@@ -9642,6 +10035,12 @@ export declare function useDeleteMessage(room: string): UseMutationResult<unknow
9642
10035
  /** Re-render when do not disturb is due to end, so the mark and the row clear on time. */
9643
10036
  export declare function useDndActive(): boolean;
9644
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
+
9645
10044
  export declare function useDrilldown(): DrilldownContextValue | null;
9646
10045
 
9647
10046
  export declare function useDrilldownViews(): Record<string, DrilldownViewOverride>;
@@ -10009,6 +10408,9 @@ export declare function usePlanGridHost(): PlanGridHost | null;
10009
10408
  /** Who else is viewing one record (joins its room; names only). */
10010
10409
  export declare function usePresence(collection: string | null | undefined, item: string | number | null | undefined): RecordPresence;
10011
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
+
10012
10414
  /**
10013
10415
  * Publish what this page shows. Re-publishes only when the context's content
10014
10416
  * changes (compared as JSON), and withdraws it when the page unmounts.
@@ -10451,6 +10853,9 @@ declare interface WidgetSlotProps {
10451
10853
  /** Sign-out, user change, anything that must leave nothing behind. */
10452
10854
  export declare function wipeMetadataCache(s?: MetadataStore): Promise<void>;
10453
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
+
10454
10859
  /** Add the clip kind to a session-recording start command (POST /start body). */
10455
10860
  export declare function withClipKind<T extends {
10456
10861
  _body?: unknown;
@@ -10467,6 +10872,14 @@ export declare interface WorkerSocket extends FallbackSocket {
10467
10872
  disconnect(): void;
10468
10873
  /** 'pending' until the worker greets or the fallback is taken. */
10469
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;
10470
10883
  /** The transport the worker's socket uses (for status displays). */
10471
10884
  io: {
10472
10885
  engine: {