@nivaro/react 0.2.54 → 0.2.55

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 (150) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +339 -2
  4. package/dist/index.js +644 -618
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/ItemEditForm.js +4066 -3832
  10. package/dist/shared/components/JobsTray.js +100 -55
  11. package/dist/shared/components/MyWorkView.js +91 -89
  12. package/dist/shared/components/NotificationBell.js +80 -79
  13. package/dist/shared/components/ProfileView.js +568 -520
  14. package/dist/shared/components/RecordCompare.js +254 -0
  15. package/dist/shared/components/RecordReadView.js +599 -552
  16. package/dist/shared/components/ReportView.js +578 -543
  17. package/dist/shared/components/RowPresence.js +91 -0
  18. package/dist/shared/components/WidgetSlot.js +474 -458
  19. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  20. package/dist/shared/components/ai/AskPanel.js +139 -119
  21. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  22. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  23. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  24. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  25. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  26. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  27. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  28. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  29. package/dist/shared/components/chat/Composer.js +357 -303
  30. package/dist/shared/components/chat/MessageActions.js +92 -0
  31. package/dist/shared/components/chat/MessageFormat.js +290 -264
  32. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  33. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  34. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  35. package/dist/shared/components/chat/RoomParts.js +213 -274
  36. package/dist/shared/components/chat/ScreenClip.js +184 -0
  37. package/dist/shared/components/chat/chat-core.js +402 -483
  38. package/dist/shared/components/chat/chat-drafts.js +59 -0
  39. package/dist/shared/components/chat/chat-emoji.js +348 -0
  40. package/dist/shared/components/chat/chat-local-time.js +41 -0
  41. package/dist/shared/components/chat/chat-outbox.js +303 -0
  42. package/dist/shared/components/chat/chat-window.js +163 -0
  43. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  44. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  45. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  46. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  47. package/dist/shared/components/help-videos/api.js +76 -73
  48. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  49. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  50. package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
  51. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  52. package/dist/shared/components/item-edit/FieldRow.js +292 -279
  53. package/dist/shared/components/item-edit/GroupSection.js +698 -574
  54. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  55. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  56. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  57. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  58. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  59. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  60. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  61. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  62. package/dist/shared/components/item-edit/lock-why.js +39 -32
  63. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  64. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  65. package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
  66. package/dist/shared/components/layout-editor/AddPanel.js +134 -117
  67. package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
  68. package/dist/shared/components/layout-editor/CollabParts.js +80 -75
  69. package/dist/shared/components/layout-editor/DesignNode.js +126 -120
  70. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
  71. package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
  72. package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
  73. package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
  74. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  75. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  76. package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
  77. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
  78. package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
  79. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
  80. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  81. package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
  82. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  83. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  84. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  85. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  86. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  87. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  88. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  89. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
  90. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
  91. package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
  92. package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
  93. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  94. package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
  95. package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
  96. package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
  97. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  98. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  99. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  100. package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
  101. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  102. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  103. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  104. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  105. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  106. package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
  107. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  108. package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
  109. package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
  110. package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
  111. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  112. package/dist/shared/components/layout-editor/structure-ops.js +81 -77
  113. package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
  114. package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
  115. package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
  116. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  117. package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
  118. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  119. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  120. package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
  121. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  122. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  123. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  124. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  125. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  126. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  127. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  128. package/dist/shared/components/support/SupportView.js +75 -73
  129. package/dist/shared/lib/background-runs.js +150 -0
  130. package/dist/shared/lib/delivery-ack.js +9 -0
  131. package/dist/shared/lib/entry-badge-style.js +13 -0
  132. package/dist/shared/lib/entry-config.js +71 -0
  133. package/dist/shared/lib/form-sections.js +64 -0
  134. package/dist/shared/lib/form-structure.js +99 -0
  135. package/dist/shared/lib/form-usage-beacon.js +101 -52
  136. package/dist/shared/lib/jobs-tray.js +25 -23
  137. package/dist/shared/lib/keyset-pager.js +37 -0
  138. package/dist/shared/lib/layout-ops.js +84 -82
  139. package/dist/shared/lib/layout-resolve.js +113 -0
  140. package/dist/shared/lib/placement-behaviour.js +144 -0
  141. package/dist/shared/lib/prefetch.js +149 -0
  142. package/dist/shared/lib/presence-hooks.js +199 -0
  143. package/dist/shared/lib/record-outbox.js +82 -81
  144. package/dist/shared/lib/replay-socket.js +93 -0
  145. package/dist/shared/lib/request-gate.js +51 -50
  146. package/dist/shared/lib/room-gaps.js +96 -0
  147. package/dist/shared/lib/search-log.js +27 -0
  148. package/dist/shared/lib/socket-realtime.js +101 -80
  149. package/dist/shared/lib/worker-socket.js +200 -0
  150. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -575,6 +575,50 @@ declare interface AvailableBulkAction {
575
575
  guard?: GuardRule[] | null;
576
576
  }
577
577
 
578
+ declare type BackgroundPhase = 'idle' | 'offer' | 'starting' | 'running' | 'done' | 'error';
579
+
580
+ /**
581
+ * "Run in background" for slow reads (#2759) — the client half of /api/background-runs.
582
+ *
583
+ * A custom query, report widget, page widget or dashboard widget that is still loading after a
584
+ * moment asks the server how long it usually takes. Known-slow (or still loading after
585
+ * OFFER_ANYWAY_MS) → the page offers to hand it to the server. The server replays the SAME
586
+ * request as the signed-in person on its background pool; the page shows elapsed time against
587
+ * the usual time, the Jobs tray carries the run if they leave, and when it is ready the result
588
+ * drops into the page's own query cache — the normal refetch replaces it as usual.
589
+ *
590
+ * A run is remembered per request in sessionStorage, so coming back to the page (or a remount)
591
+ * picks it up instead of offering again.
592
+ */
593
+ export declare interface BackgroundRequest {
594
+ method: 'GET' | 'POST';
595
+ /** API path without the /api prefix, e.g. `/custom-queries/pub-health/execute`. */
596
+ url: string;
597
+ body?: unknown;
598
+ }
599
+
600
+ /**
601
+ * The "Run in background" strip for a slow read (#2759). Render it inside the loading state of
602
+ * a custom query, report widget, page widget or dashboard widget; it stays empty until the read
603
+ * has been loading for a moment AND is known to be slow (or has simply been loading a long time),
604
+ * then offers to hand the read to the server. While the server runs it, the strip shows elapsed
605
+ * time against the usual time; when the result is ready it fills the page's own query and the
606
+ * strip goes away. Every state is inline — no dialog.
607
+ */
608
+ export declare function BackgroundRunOffer({ className, ...opts }: UseBackgroundRunOptions & {
609
+ className?: string;
610
+ }): JSX.Element | null;
611
+
612
+ declare interface BackgroundRunView {
613
+ id: string;
614
+ status: 'running' | 'completed' | 'error';
615
+ started_at: string;
616
+ finished_at: string | null;
617
+ expected_ms: number | null;
618
+ error: string | null;
619
+ result_kept: boolean;
620
+ }
621
+
578
622
  export declare interface BannerLine {
579
623
  api: string;
580
624
  tone: 'danger' | 'warning' | 'neutral' | 'positive';
@@ -882,6 +926,8 @@ export declare interface ChangeReasonChallenge {
882
926
  field: string;
883
927
  value: unknown;
884
928
  }>;
929
+ /** #2705: asked by the layout ("Are you sure?") rather than the collection. */
930
+ confirm?: boolean;
885
931
  }
886
932
 
887
933
  /**
@@ -931,6 +977,10 @@ declare interface ChannelMeta {
931
977
  }>;
932
978
  welcome_note?: string | null;
933
979
  default_roles?: string[];
980
+ /** Who may use @channel / @here (#2483); null = the owner and admins. */
981
+ mention_policy?: 'owner' | 'members' | 'admins' | null;
982
+ /** Set while the owner has an unanswered idle-archive suggestion (#2485). */
983
+ archive_suggested_at?: string | null;
934
984
  }
935
985
 
936
986
  declare interface Chapter {
@@ -1048,6 +1098,8 @@ export declare interface ChatMessage {
1048
1098
  reactions?: ChatReaction[];
1049
1099
  /** The admin who was masquerading as the sender when it was sent. */
1050
1100
  masquerade_admin_name?: string | null;
1101
+ /** The connected app (an AI assistant over MCP) that posted it for the sender (#2492). */
1102
+ via_app?: string | null;
1051
1103
  /** Thread reply (#927): the root it answers. Null on the timeline. */
1052
1104
  parent_id?: number | null;
1053
1105
  /** Quoted message (#928). */
@@ -1728,6 +1780,8 @@ export declare function createLiveQueryBridge(qc: QueryClient, realtime: Realtim
1728
1780
 
1729
1781
  export declare function createSocketRealtime(opts: SocketRealtimeOptions): SocketRealtime;
1730
1782
 
1783
+ export declare function createWorkerSocket(opts: WorkerSocketOptions): WorkerSocket;
1784
+
1731
1785
  export declare function CronBuilder({ value, onChange, disabled }: {
1732
1786
  value: string;
1733
1787
  onChange: (cron: string) => void;
@@ -2523,6 +2577,12 @@ export declare function extractExpressionTokens(src: string): string[];
2523
2577
  /** Extract the slot key from an assignment field name, or null. */
2524
2578
  export declare function extSlotKey(field: string): string | null;
2525
2579
 
2580
+ declare interface FallbackSocket extends SocketLike {
2581
+ once?(event: string, cb: Listener): unknown;
2582
+ connect?(): unknown;
2583
+ disconnect?(): unknown;
2584
+ }
2585
+
2526
2586
  declare type FetchCfg = {
2527
2587
  apiBase: string;
2528
2588
  authHeaders: Record<string, string>;
@@ -2572,6 +2632,24 @@ export declare function fieldDrilldownConfig(field: {
2572
2632
  _overrides?: Record<string, unknown> | null;
2573
2633
  }): FieldDrilldownConfig | null;
2574
2634
 
2635
+ export declare interface FieldFocus {
2636
+ /** field name (or `row:<collection>:<id>` / `cell:<collection>:<row>:<field>`) → who is in it. */
2637
+ editing: Record<string, SignalPerson>;
2638
+ /** Tell the record's other viewers you are in this field. */
2639
+ focus: (field: string) => void;
2640
+ /** …and that you left it. */
2641
+ blur: (field: string) => void;
2642
+ }
2643
+
2644
+ export declare interface FieldFocusOptions {
2645
+ /**
2646
+ * Watch the document for focus moving between `[data-field]` wrappers (what the shared
2647
+ * form renders around every field) and send focus/blur yourself. Off by default: a host
2648
+ * that already relays focus (the admin) must not send it twice.
2649
+ */
2650
+ capture?: boolean;
2651
+ }
2652
+
2575
2653
  declare interface FieldGroup {
2576
2654
  /** Content block (#53): type 'content' renders this text instead of fields. */
2577
2655
  content?: string | null;
@@ -4094,6 +4172,12 @@ declare interface InputBinding {
4094
4172
  binding_value: string;
4095
4173
  }
4096
4174
 
4175
+ /**
4176
+ * Document-level intent listener: resting on (or keyboard-focusing) a same-origin link
4177
+ * preloads its screen's code, and a record link also warms the record. Returns the uninstaller.
4178
+ */
4179
+ export declare function installIntentPrefetch(opts: IntentPrefetchOptions): () => void;
4180
+
4097
4181
  /** Idempotent; a no-op outside a browser. Watches for the rest of the page's life. */
4098
4182
  export declare function installReplayTail(): void;
4099
4183
 
@@ -4431,6 +4515,17 @@ export declare interface IntegrationSignalView {
4431
4515
  shown: number;
4432
4516
  }
4433
4517
 
4518
+ declare interface IntentPrefetchOptions {
4519
+ qc: QueryClient;
4520
+ client: NivaroClient | null;
4521
+ /** A link's same-origin path → the record it opens, or null. */
4522
+ matchRecord?: (path: string) => RecordTarget | null;
4523
+ /** Load the code for the screen a same-origin path opens. */
4524
+ preloadRoute?: (path: string) => void;
4525
+ /** Only links inside this element (default: the whole document). */
4526
+ root?: HTMLElement | Document;
4527
+ }
4528
+
4434
4529
  /** A title card before the recording (real extra edited time). Blank
4435
4530
  * `title` / `subtitle` mean the video's title and the first line of its
4436
4531
  * description. */
@@ -4743,6 +4838,8 @@ declare interface LayoutDesign {
4743
4838
  lastChange?(t: DesignTarget): LastChange | null;
4744
4839
  /** A new record's starting value for the field, as grey placeholder text (#2633). */
4745
4840
  ghost?(field: string): string | null;
4841
+ /** #2701: the width handle on a selected field set its width (12, 6, 4 or 3 columns). */
4842
+ resizeWidth?(t: DesignTarget, span: number): void;
4746
4843
  }
4747
4844
 
4748
4845
  /**
@@ -4830,6 +4927,8 @@ declare interface LayoutGroup {
4830
4927
  visibility_mode?: string | null;
4831
4928
  /** Migration 311 — read-board width: full | half | third | null (auto). */
4832
4929
  read_width?: string | null;
4930
+ /** Rows of fields and the empty-section text ride here (lib/form-structure.ts). */
4931
+ swap_config?: string | null;
4833
4932
  }
4834
4933
 
4835
4934
  export declare type LayoutItem = FormGroupDescriptor | '__ungrouped__';
@@ -4858,6 +4957,8 @@ declare interface LayoutMeta {
4858
4957
  default_values?: Record<string, unknown> | null;
4859
4958
  /** Quick picker: relation fields walked one step at a time on create. */
4860
4959
  quick_picker?: string[] | null;
4960
+ /** Entry ergonomics (#2702-#2728): keyboard, tab order, mode, badge — see lib/entry-config. */
4961
+ entry_config?: Record<string, unknown> | null;
4861
4962
  }
4862
4963
 
4863
4964
  declare interface LayoutSlotHandle {
@@ -4932,6 +5033,8 @@ export declare function LearningPathCard({ className }: {
4932
5033
  className?: string;
4933
5034
  }): JSX.Element;
4934
5035
 
5036
+ declare type Listener = (...args: any[]) => void;
5037
+
4935
5038
  export declare function listFieldInterfaces(): string[];
4936
5039
 
4937
5040
  /**
@@ -6368,6 +6471,13 @@ declare interface PersonRef {
6368
6471
  ooo_end?: string | null;
6369
6472
  }
6370
6473
 
6474
+ /** Where a picker sits on a record form: enough for the server to count a miss per placement. */
6475
+ declare interface PickerMissPlacement {
6476
+ layoutId: number;
6477
+ collection: string;
6478
+ field: string;
6479
+ }
6480
+
6371
6481
  declare type PinnedCfg = {
6372
6482
  when?: {
6373
6483
  field: string;
@@ -6399,7 +6509,7 @@ declare type PipelineBinding = {
6399
6509
  dimensions?: PipelineOwnerDimension[];
6400
6510
  };
6401
6511
 
6402
- export declare type PipelineEditorSection = 'states' | 'transitions' | 'branches' | 'bindings' | 'matrix' | 'simulator' | 'canvas' | 'flow-map' | 'replay' | 'migration' | 'coverage' | 'lint' | 'skip-report' | 'ai-review' | 'versions' | 'matrix-versions';
6512
+ export declare type PipelineEditorSection = 'states' | 'transitions' | 'branches' | 'bindings' | 'matrix' | 'simulator' | 'canvas' | 'flow-map' | 'replay' | 'cumulative-flow' | 'migration' | 'coverage' | 'lint' | 'skip-report' | 'ai-review' | 'versions' | 'matrix-versions';
6403
6513
 
6404
6514
  export declare function PipelineEditorView({ templateId, onBack, onExport, hidden }: {
6405
6515
  templateId: string;
@@ -6564,6 +6674,17 @@ declare function pollProposal(opts: {
6564
6674
  */
6565
6675
  export declare function precisionOf(options: unknown, fallback?: number): number;
6566
6676
 
6677
+ /** API prefetches one tab may make in any rolling minute. */
6678
+ export declare const PREFETCH_PER_MINUTE = 30;
6679
+
6680
+ /**
6681
+ * Warm a record page: its readOne and the layout it will open with. Returns how many requests
6682
+ * went out (0 when both were fresh or the budget was spent).
6683
+ */
6684
+ export declare function prefetchRecord(qc: QueryClient, client: NivaroClient, collection: string, id: string | number, opts?: {
6685
+ layout?: boolean;
6686
+ }): number;
6687
+
6567
6688
  export declare interface PreparedReplayClip {
6568
6689
  /** Upload what was taken at prepare time; null when nothing is recording. */
6569
6690
  commit(timeoutMs?: number): Promise<ReplayLink | null>;
@@ -7512,6 +7633,36 @@ export declare function RecordOutboxHost({ userId, onOpenRecord }: {
7512
7633
  onOpenRecord?: (collection: string, itemId: string) => void;
7513
7634
  }): null;
7514
7635
 
7636
+ /**
7637
+ * Presence hooks for headless frontends (#2487, #2486), over the host's realtime adapter —
7638
+ * the socket the host already holds (`createSocketRealtime`, or the shared worker's facade).
7639
+ * Without an adapter every hook is inert and returns nothing, like the live hooks.
7640
+ *
7641
+ * usePresence('orders', id) → { viewers } who else has this record open
7642
+ * useFieldFocus('orders', id) → { editing, focus, blur } the field (or grid cell) each
7643
+ * person is in, and your own
7644
+ * useTyping('orders', id) → { typing, setTyping } "Beth is writing a note"
7645
+ * useRowPresence('orders', ids) → { [id]: { ids, count } } who has each list row open
7646
+ *
7647
+ * All of it is names-only and server-gated: the record room admits only people who may open
7648
+ * the record (the read gate), `presence:rows` carries user ids and the names come from
7649
+ * `GET /presence/people`, which answers only with people the viewer may see.
7650
+ *
7651
+ * The admin's own record page keeps `useRecordPresence` (its record room rides a tab-local
7652
+ * socket when the shared worker is off); these hooks need an adapter whose `emit` reaches a
7653
+ * socket this tab owns, which `createSocketRealtime` and the worker facade both give.
7654
+ */
7655
+ export declare interface RecordPresence {
7656
+ /** The OTHER people with this record open right now. */
7657
+ viewers: SignalPerson[];
7658
+ }
7659
+
7660
+ /** The query keys the record page reads (ItemEditForm / admin ItemEdit share them). */
7661
+ export declare function recordQueryKeys(collection: string, id: string | number): {
7662
+ item: QueryKey;
7663
+ layout: QueryKey;
7664
+ };
7665
+
7515
7666
  /**
7516
7667
  * Read-only record presentation. With `design` (the layout editor's canvas)
7517
7668
  * the whole view — its own hooks included — runs inside DesignCanvas: a
@@ -7614,6 +7765,11 @@ export declare function RecordSubscribeButton({ collection, itemId, recordLabel,
7614
7765
  compact?: boolean;
7615
7766
  }): JSX.Element;
7616
7767
 
7768
+ declare interface RecordTarget {
7769
+ collection: string;
7770
+ id: string;
7771
+ }
7772
+
7617
7773
  declare type Rect = {
7618
7774
  x: number;
7619
7775
  y: number;
@@ -7657,8 +7813,11 @@ export declare function RelatedRecordsPanel({ collection, itemId, title, default
7657
7813
  defaultExpanded?: boolean;
7658
7814
  }): JSX.Element;
7659
7815
 
7660
- export declare function RelationCombobox({ collection, value, onChange, disabled, placeholder, extraFilter, autoSelectSingle, optionSort, requiredParent, facets, fieldKey, narrowedBy, pinned }: {
7816
+ export declare function RelationCombobox({ collection, value, onChange, disabled, placeholder, extraFilter, autoSelectSingle, optionSort, requiredParent, facets, fieldKey, narrowedBy, pinned, missPlacement }: {
7661
7817
  collection: string;
7818
+ /** The record-form placement this picker sits on: searches that find
7819
+ * nothing are counted there (#2726). Absent = not reported. */
7820
+ missPlacement?: PickerMissPlacement | null;
7662
7821
  value: unknown;
7663
7822
  onChange: (v: unknown) => void;
7664
7823
  /** A "floating" option shown FIRST regardless of search or sort — the
@@ -8173,6 +8332,35 @@ declare interface RowMatchPanelConfig {
8173
8332
  };
8174
8333
  }
8175
8334
 
8335
+ /**
8336
+ * "Who has this row open" on a list row (#2486): up to three 16px avatar discs, overlapping,
8337
+ * then "+N" when more people are there; the names in the instant tooltip. People the viewer
8338
+ * may not see (the presence visibility rule) count but show no face — a neutral disc with
8339
+ * the number stands for them. Nothing renders when nobody else has the row open.
8340
+ *
8341
+ * Small on purpose: it sits in the row's 16px mark slot (next to the lock / new / unseen
8342
+ * marks) or inline after a label, and must never move the text beside it.
8343
+ */
8344
+ export declare function RowPresence({ viewers, size, dataAttr, max }: {
8345
+ viewers: RowViewers | null | undefined;
8346
+ size?: number;
8347
+ dataAttr?: string;
8348
+ max?: number;
8349
+ }): JSX.Element | null;
8350
+
8351
+ export declare function rowPresenceKey(collection: string, item: string | number): string;
8352
+
8353
+ export declare interface RowPresenceOptions {
8354
+ enabled?: boolean;
8355
+ /** Without a realtime adapter, poll counts this often (0 = never). Default 30 000. */
8356
+ pollMs?: number;
8357
+ }
8358
+
8359
+ export declare interface RowRef {
8360
+ collection: string;
8361
+ item: string | number;
8362
+ }
8363
+
8176
8364
  declare interface RowRule {
8177
8365
  trigger_field?: string | null;
8178
8366
  /** Additional trigger fields — any of them changing fires the rule. */
@@ -8197,6 +8385,13 @@ declare interface RowSnooze {
8197
8385
  note: string | null;
8198
8386
  }
8199
8387
 
8388
+ export declare interface RowViewers {
8389
+ /** The OTHER people with the row open whom the viewer may see (names resolvable). */
8390
+ ids: string[];
8391
+ /** Everyone else with it open, visible or not (the count the chip shows). */
8392
+ count: number;
8393
+ }
8394
+
8200
8395
  /** Route-change timing: from the navigation to a settled double-rAF frame. */
8201
8396
  export declare function rumRouteChange(pathname: string): void;
8202
8397
 
@@ -8351,6 +8546,9 @@ export declare function setServerClockOffset(ms: number): void;
8351
8546
 
8352
8547
  export declare function setTimeDisplay(mode: string | null | undefined): void;
8353
8548
 
8549
+ /** True when this browser can share a socket between tabs. */
8550
+ export declare function sharedWorkerSupported(): boolean;
8551
+
8354
8552
  /**
8355
8553
  * The pure part of opening a query sheet: which tabs it has, which tab opens
8356
8554
  * first, and the optional header strip (a query of its own, rendered above
@@ -8380,6 +8578,12 @@ declare interface SheetItem {
8380
8578
  url: string;
8381
8579
  }
8382
8580
 
8581
+ /**
8582
+ * Whether a host should try the worker: supported, not switched off for this browser, and the
8583
+ * worker URL on this page's origin (a SharedWorker script must be same-origin).
8584
+ */
8585
+ export declare function shouldUseWorkerSocket(url: string): boolean;
8586
+
8383
8587
  export declare function SignalCard({ signal, expanded, onToggle, onOpenRecord, onExplain, canExplain }: SignalCardProps): JSX.Element;
8384
8588
 
8385
8589
  export declare interface SignalCardProps {
@@ -8568,6 +8772,9 @@ export declare function SnoozeMenu({ signal, signalLabel, rowKey, group, default
8568
8772
  * `nvr:config-update`; `client:force-refresh` → `nvr:force-refresh` (the window events admin's
8569
8773
  * socket raises, so shared banners and forms behave the same in every host).
8570
8774
  * - Connection state for the reconnect banner and stale marks (`status` / `onStatus`).
8775
+ * - Missed events while connected (#2462): a room whose own counter (`_rseq`) skips is caught up
8776
+ * alone (`catchup:room`); `realtime:stale` (#2460 — the server held this socket's broadcasts
8777
+ * while it was too far behind) refetches the rooms it names and raises `nvr:realtime-stale`.
8571
8778
  *
8572
8779
  * The socket is duck-typed (socket.io-client's `Socket` fits), so this package takes no
8573
8780
  * dependency on socket.io-client. It never decides what a viewer may see: every room is gated by
@@ -8590,6 +8797,16 @@ export declare interface SocketLike {
8590
8797
  };
8591
8798
  }
8592
8799
 
8800
+ declare interface SocketLike_2 {
8801
+ on(ev: string, fn: (...a: any[]) => void): unknown;
8802
+ onAny?(fn: (ev: string, ...a: any[]) => void): unknown;
8803
+ offAny?(fn: (ev: string, ...a: any[]) => void): unknown;
8804
+ off?(ev: string, fn: (...a: any[]) => void): unknown;
8805
+ io?: {
8806
+ on?(ev: string, fn: (...a: any[]) => void): unknown;
8807
+ };
8808
+ }
8809
+
8593
8810
  export declare interface SocketRealtime extends RealtimeAdapter {
8594
8811
  status(): RealtimeStatus;
8595
8812
  onStatus(cb: (s: RealtimeStatus) => void): () => void;
@@ -8929,6 +9146,9 @@ declare interface TailRequest {
8929
9146
  ms: number;
8930
9147
  }
8931
9148
 
9149
+ /** Feed the bus from a socket.io-style client. Returns the undo. */
9150
+ export declare function tapReplaySocket(socket: SocketLike_2): () => void;
9151
+
8932
9152
  export declare function TaskPanel({ collection, item, title, defaultExpanded, queuedTasks, onQueueTask, onRemoveQueuedTask }: {
8933
9153
  collection: string;
8934
9154
  item: string;
@@ -9140,6 +9360,13 @@ export declare interface TuningSummary {
9140
9360
  }>;
9141
9361
  }
9142
9362
 
9363
+ export declare interface Typing {
9364
+ /** Names of the other people writing a note on this record right now. */
9365
+ typing: string[];
9366
+ /** Call with true while the person types (it repeats the heartbeat), false when they stop. */
9367
+ setTyping: (active: boolean) => void;
9368
+ }
9369
+
9143
9370
  /** What is unsaved right now — the leave-page prompt, the changes tray and
9144
9371
  * the host's own dirty indicator all read this one breakdown. */
9145
9372
  declare interface UnsavedSummary {
@@ -9247,6 +9474,34 @@ export declare function useAutoRecord(opts?: {
9247
9474
  /** Available actions per collection, for the viewer. */
9248
9475
  export declare function useAvailableBulkActions(collections: string[]): UseQueryResult<NoInfer<Record<string, AvailableBulkAction[]>>, Error>;
9249
9476
 
9477
+ declare interface UseBackgroundRun {
9478
+ phase: BackgroundPhase;
9479
+ /** The usual duration the server knows, ms. */
9480
+ typicalMs: number | null;
9481
+ run: BackgroundRunView | null;
9482
+ error: string | null;
9483
+ start: () => void;
9484
+ }
9485
+
9486
+ export declare function useBackgroundRun(opts: UseBackgroundRunOptions): UseBackgroundRun;
9487
+
9488
+ declare interface UseBackgroundRunOptions {
9489
+ /** True while the page's own read is still loading. */
9490
+ pending: boolean;
9491
+ /** The read the page is making; null = nothing to offer. */
9492
+ request: BackgroundRequest | null;
9493
+ /** What the person will see in the Jobs tray. */
9494
+ label: string;
9495
+ /** The page's query to fill when the run is ready (setQueryData with `select(body)`). */
9496
+ queryKey?: QueryKey;
9497
+ /** Response body → the query's data. Default: the body itself. */
9498
+ select?: (body: unknown) => unknown;
9499
+ /** For pages that keep the read in their own state: the finished response body. */
9500
+ onResult?: (body: unknown) => void;
9501
+ /** The result was not kept (too big / expired): read again — the route's cache answers. */
9502
+ onGone?: () => void;
9503
+ }
9504
+
9250
9505
  export declare function useChannelAdmin(channelId: number | null): {
9251
9506
  update: UseMutationResult<unknown, Error, {
9252
9507
  name?: string;
@@ -9264,6 +9519,7 @@ export declare function useChannelAdmin(channelId: number | null): {
9264
9519
  }>;
9265
9520
  welcome_note?: string | null;
9266
9521
  default_roles?: string[];
9522
+ mention_policy?: "owner" | "members" | "admins" | null;
9267
9523
  }, unknown>;
9268
9524
  addMember: UseMutationResult<unknown, Error, string, unknown>;
9269
9525
  removeMember: UseMutationResult<unknown, Error, string, unknown>;
@@ -9403,6 +9659,9 @@ export declare function useFeatureFlags(): {
9403
9659
 
9404
9660
  export declare function useFieldArray(form: UseNivaroFormReturn, field: string): FieldArrayReturn;
9405
9661
 
9662
+ /** Which field or grid cell each co-viewer is editing, and a way to announce your own. */
9663
+ export declare function useFieldFocus(collection: string | null | undefined, item: string | number | null | undefined, opts?: FieldFocusOptions): FieldFocus;
9664
+
9406
9665
  export declare function useFieldState(form: UseNivaroFormReturn, field: string): FieldState;
9407
9666
 
9408
9667
  /**
@@ -9474,8 +9733,24 @@ version_id: string | null;
9474
9733
  steps: WalkStep[];
9475
9734
  }>, Error>;
9476
9735
 
9736
+ /**
9737
+ * Idle next page: once a list page has loaded and more pages exist, fetch the next one into its
9738
+ * own key while the browser has nothing better to do.
9739
+ */
9740
+ export declare function useIdleNextPage(opts: {
9741
+ enabled: boolean;
9742
+ queryKey: QueryKey;
9743
+ queryFn: () => Promise<unknown>;
9744
+ qc: QueryClient;
9745
+ }): void;
9746
+
9477
9747
  export declare function useImportHealth(): UseQueryResult<NoInfer<ImportHealth>, Error>;
9478
9748
 
9749
+ /** Mount once in an app shell (inside the QueryClientProvider). */
9750
+ export declare function useIntentPrefetch(opts: IntentPrefetchOptions & {
9751
+ enabled?: boolean;
9752
+ }): void;
9753
+
9479
9754
  /** True when clean mode runs AND `userId` is the signed-in person (the host's
9480
9755
  * setRecordingSelf, else the record form's auth context). */
9481
9756
  export declare function useIsRecordingSelf(userId: string | number | null | undefined): boolean;
@@ -9703,6 +9978,9 @@ export declare function usePersonProfile(userId: string | null | undefined): Use
9703
9978
 
9704
9979
  export declare function usePlanGridHost(): PlanGridHost | null;
9705
9980
 
9981
+ /** Who else is viewing one record (joins its room; names only). */
9982
+ export declare function usePresence(collection: string | null | undefined, item: string | number | null | undefined): RecordPresence;
9983
+
9706
9984
  /**
9707
9985
  * Publish what this page shows. Re-publishes only when the context's content
9708
9986
  * changes (compared as JSON), and withdraws it when the page unmounts.
@@ -9849,6 +10127,13 @@ export declare function userOptionFilter(isAdmin: boolean): {
9849
10127
  })[];
9850
10128
  };
9851
10129
 
10130
+ /**
10131
+ * Who has each of these rows open, keyed `collection:item`: live through the presence room
10132
+ * (`presence:watch` → `presence:rows`), a 30 s count poll when the host has no realtime
10133
+ * adapter. The viewer's own tabs are left out. Rows may span collections (a queue).
10134
+ */
10135
+ export declare function useRowPresence(rows: RowRef[], opts?: RowPresenceOptions): Record<string, RowViewers>;
10136
+
9852
10137
  /** Stacked avatar cluster (+N) with a hover/pinnable portal roster whose rows
9853
10138
  * are UserChips — the single user-display primitive for owners/user lists.
9854
10139
  * Reused by the item-header Owners chip and the collection browser. */
@@ -9929,6 +10214,9 @@ emoji: string;
9929
10214
  */
9930
10215
  export declare function useTopicPresence(topic: string | null | undefined, selfId?: string | null): TopicPresence;
9931
10216
 
10217
+ /** "Beth is writing a note" on a record's comment thread, both directions. */
10218
+ export declare function useTyping(collection: string | null | undefined, item: string | number | null | undefined): Typing;
10219
+
9932
10220
  export declare function useTypingIndicator(room: string | null): {
9933
10221
  onType: () => void;
9934
10222
  clearTyping: () => void;
@@ -10142,6 +10430,55 @@ export declare function withClipKind<T extends {
10142
10430
 
10143
10431
  export declare function withGetCoalescing(client: NivaroClient, opts?: CoalescingOptions): NivaroClient;
10144
10432
 
10433
+ export declare interface WorkerSocket extends FallbackSocket {
10434
+ once(event: string, cb: Listener): unknown;
10435
+ onAny(cb: (event: string, ...args: any[]) => void): unknown;
10436
+ offAny(cb: (event: string, ...args: any[]) => void): unknown;
10437
+ listeners(event: string): Listener[];
10438
+ connect(): void;
10439
+ disconnect(): void;
10440
+ /** 'pending' until the worker greets or the fallback is taken. */
10441
+ mode(): 'pending' | 'worker' | 'fallback';
10442
+ /** The transport the worker's socket uses (for status displays). */
10443
+ io: {
10444
+ engine: {
10445
+ transport: {
10446
+ name?: string;
10447
+ };
10448
+ once(ev: string, cb: () => void): void;
10449
+ };
10450
+ };
10451
+ }
10452
+
10453
+ export declare interface WorkerSocketOptions {
10454
+ /** Same-origin URL of the worker script. */
10455
+ url: string;
10456
+ /** SharedWorker name: one worker per app on an origin (`admin`, `efp-new`). */
10457
+ name?: string;
10458
+ /** `client:hello` app label. */
10459
+ app: string;
10460
+ /** Extra `client:hello` features (the worker always adds `coalesce`). */
10461
+ features?: string[];
10462
+ /** Build fields for `client:hello` (client-version.ts `clientVersion()`). */
10463
+ version?: Record<string, unknown>;
10464
+ /** Mint a `/auth/ws-token` for the worker's socket (the worker asks one tab per connect). */
10465
+ authToken: () => Promise<string | null>;
10466
+ /** The host's own socket, created only when the worker cannot serve this tab. */
10467
+ fallback: () => FallbackSocket;
10468
+ /** Told once when the mode settles, and again if the worker is abandoned later. */
10469
+ onMode?: (mode: 'worker' | 'fallback', reason: string) => void;
10470
+ /**
10471
+ * How long to wait for the worker's greeting before falling back (default 15000: a cold
10472
+ * worker fetches its script and socket.io's client first, slow on a dev proxy).
10473
+ */
10474
+ readyTimeoutMs?: number;
10475
+ /** No ping from the worker for this long = it is gone (default 20000). */
10476
+ silentMs?: number;
10477
+ }
10478
+
10479
+ /** The person's override for this browser, when they set one (a support step). */
10480
+ export declare function workerSocketPreference(): 'on' | 'off' | null;
10481
+
10145
10482
  export declare function WorkflowPanel({ collection, item }: {
10146
10483
  collection: string;
10147
10484
  item: string;