@nivaro/react 0.3.7 → 0.3.9

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.
@@ -1,53 +1,52 @@
1
1
  import { endSessionRecording as $, appendSessionRecordingEvents as X, sessionRecordingEnabled as ce, startSessionRecording as T } from "@nivaro/sdk";
2
2
  import { useRef as de, useEffect as fe } from "react";
3
- import { sessionStore as pe, sharedChunkStore as me, ReplayUploader as he, clearResume as P, ORPHAN_TTL_MS as we, readResume as ge, isResumable as ve, splitBySize as Z, writeResume as ye, KEEPALIVE_CHUNK_BYTES as be, CHUNK_BYTES as Re, backoffDelay as Se } from "./replayUploadQueue.js";
4
- import { useAutoRecord as ke } from "./useAutoRecord.js";
5
- import { useOptionalNivaroClient as Ee } from "../shared/context.js";
3
+ import { sessionStore as pe, sharedChunkStore as he, ReplayUploader as me, clearResume as P, ORPHAN_TTL_MS as we, readResume as ge, isResumable as ve, splitBySize as Z, writeResume as ye, KEEPALIVE_CHUNK_BYTES as be, CHUNK_BYTES as Re, backoffDelay as Se, errorStatus as ke, clipChunkFailure as Ee } from "./replayUploadQueue.js";
4
+ import { useAutoRecord as Ae } from "./useAutoRecord.js";
5
+ import { useOptionalNivaroClient as Ce } from "../shared/context.js";
6
6
  import { normalizeReplayMasking as B, buildReplayMaskingOptions as z } from "../shared/lib/replay-masking.js";
7
- import { normalizeReplaySampling as x, replaySampleDraw as Ae, currentReplayRoute as _, isReplayRouteSampled as Y, attributeChunkRoutes as ee } from "../shared/lib/replay-sampling.js";
8
- import { emitReplayTap as Ce, setReplayRecorderMode as N, registerReplayCapture as Ie, clipEndOffset as _e, withClipKind as De } from "../shared/lib/replay-capture.js";
9
- import { instrumentConsole as qe, instrumentRequests as Le, redactSecrets as Te } from "../shared/lib/replay-context.js";
10
- import { instrumentSocket as Pe } from "../shared/lib/replay-socket.js";
11
- const Ne = "nivaro-react@0.3.7", j = 1e4, Me = 150, Oe = 3e3, Ue = 600, We = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
12
- function Fe(n) {
7
+ import { normalizeReplaySampling as x, replaySampleDraw as Ie, currentReplayRoute as _, isReplayRouteSampled as Y, attributeChunkRoutes as ee } from "../shared/lib/replay-sampling.js";
8
+ import { emitReplayTap as _e, setReplayRecorderMode as N, registerReplayCapture as De, clipEndOffset as qe, withClipKind as Le } from "../shared/lib/replay-capture.js";
9
+ import { instrumentConsole as Te, instrumentRequests as Pe, redactSecrets as Ne } from "../shared/lib/replay-context.js";
10
+ import { instrumentSocket as Me } from "../shared/lib/replay-socket.js";
11
+ const Oe = "nivaro-react@0.3.9", j = 1e4, Ue = 150, We = 3e3, Fe = 600, He = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
12
+ function Ke(n) {
13
13
  return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
14
- const l = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
15
- return l && (d.Authorization = `Bearer ${l}`), fetch(`${n.url}/api/session-recordings/${f}/events`, {
14
+ const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
15
+ return u && (d.Authorization = `Bearer ${u}`), fetch(`${n.url}/api/session-recordings/${f}/events`, {
16
16
  method: "POST",
17
17
  keepalive: !0,
18
- credentials: l ? "omit" : "include",
18
+ credentials: u ? "omit" : "include",
19
19
  headers: d,
20
20
  body: a
21
21
  });
22
22
  };
23
23
  }
24
- async function He(n, f, a, l, d) {
25
- var u;
26
- const c = Z(l), { routes: R } = ee(c, d.startRoute);
27
- for (const [e, y] of c.entries()) {
28
- const h = a();
24
+ async function $e(n, f, a, u, d) {
25
+ const l = Z(u), { routes: b } = ee(l, d.startRoute);
26
+ for (const [c, e] of l.entries()) {
27
+ const g = a();
29
28
  try {
30
29
  await n.request(
31
- X(f, h, y, {
32
- route: R[e],
30
+ X(f, g, e, {
31
+ route: b[c],
33
32
  ...d.build ? { build: d.build } : {}
34
33
  })
35
34
  );
36
35
  } catch (v) {
37
- const b = v.status ?? ((u = v.response) == null ? void 0 : u.status);
38
- if (b === 409) return "closed";
39
- b === 413 && console.warn(`[session-recorder] chunk ${h} too large — dropped`);
36
+ const y = ke(v);
37
+ if (Ee(y) === "stop") return "closed";
38
+ y === 413 && console.warn(`[session-recorder] chunk ${g} too large — dropped`);
40
39
  }
41
40
  }
42
41
  return "ok";
43
42
  }
44
- const Ke = 3e4, $e = 3e4;
45
- let J = !1, g = null, k = null;
46
- async function Be(n = "error") {
47
- if (!k) return null;
43
+ const Be = 3e4, ze = 3e4;
44
+ let J = !1, w = null, S = null;
45
+ async function xe(n = "error") {
46
+ if (!S) return null;
48
47
  try {
49
48
  return await Promise.race([
50
- k(n),
49
+ S(n),
51
50
  new Promise((f) => setTimeout(() => f(null), 4e3))
52
51
  ]);
53
52
  } catch {
@@ -64,27 +63,27 @@ async function Q() {
64
63
  }
65
64
  }
66
65
  function V(n, f) {
67
- const a = qe(n), l = Le(n), d = Pe(n), c = () => {
66
+ const a = Te(n), u = Pe(n), d = Me(n), l = () => {
68
67
  f == null || f();
69
68
  try {
70
69
  n("route", {
71
- path: Te(window.location.pathname + window.location.search)
70
+ path: Ne(window.location.pathname + window.location.search)
72
71
  });
73
72
  } catch {
74
73
  }
75
- }, R = history.pushState.bind(history), u = history.replaceState.bind(history);
74
+ }, b = history.pushState.bind(history), c = history.replaceState.bind(history);
76
75
  return history.pushState = (...e) => {
77
- R(...e), c();
76
+ b(...e), l();
78
77
  }, history.replaceState = (...e) => {
79
- u(...e), c();
80
- }, window.addEventListener("popstate", c), c(), () => {
81
- a(), l(), d(), history.pushState = R, history.replaceState = u, window.removeEventListener("popstate", c);
78
+ c(...e), l();
79
+ }, window.addEventListener("popstate", l), l(), () => {
80
+ a(), u(), d(), history.pushState = b, history.replaceState = c, window.removeEventListener("popstate", l);
82
81
  };
83
82
  }
84
- function et(n = {}) {
85
- const f = Ee(), a = n.client ?? f, l = n.app, d = n.disabled ?? !1, c = n.build ?? Ne;
86
- ke({ client: a, disabled: d });
87
- const R = de({
83
+ function nt(n = {}) {
84
+ const f = Ce(), a = n.client ?? f, u = n.app, d = n.disabled ?? !1, l = n.build ?? Oe;
85
+ Ae({ client: a, disabled: d });
86
+ const b = de({
88
87
  buffer: [],
89
88
  stop: null,
90
89
  uninstrument: null,
@@ -102,21 +101,21 @@ function et(n = {}) {
102
101
  });
103
102
  fe(() => {
104
103
  if (!a || d || typeof window > "u") return;
105
- let u = !1;
106
- const e = R.current;
104
+ let c = !1;
105
+ const e = b.current;
107
106
  e.dead = !1;
108
- const y = a, h = pe(), v = We(l), b = me(), E = Fe(y), te = async (t, r, i, m, s = {}) => {
109
- if (!m || !E) {
110
- await y.request(X(t, r, i, s));
107
+ const g = a, v = pe(), y = He(u), k = he(), E = Ke(g), te = async (t, r, i, h, s = {}) => {
108
+ if (!h || !E) {
109
+ await g.request(X(t, r, i, s));
111
110
  return;
112
111
  }
113
112
  const p = await E(t, JSON.stringify({ seq: r, events: i, ...s }));
114
113
  if (!p.ok) throw Object.assign(new Error(`HTTP ${p.status}`), { status: p.status });
115
- }, o = new he({ store: b, send: te, online: G });
116
- let S = null, A = 0;
117
- const re = () => document.readyState === "complete" && Date.now() - e.lastNavAt >= Oe;
114
+ }, o = new me({ store: k, send: te, online: G });
115
+ let R = null, A = 0;
116
+ const re = () => document.readyState === "complete" && Date.now() - e.lastNavAt >= We;
118
117
  function C() {
119
- o.recordingId && ye(h, v, {
118
+ o.recordingId && ye(v, y, {
120
119
  recordingId: o.recordingId,
121
120
  nextSeq: o.nextSeq,
122
121
  startedAt: e.startedAt,
@@ -124,71 +123,71 @@ function et(n = {}) {
124
123
  });
125
124
  }
126
125
  function I() {
127
- S && clearTimeout(S), S = null, A = 0;
126
+ R && clearTimeout(R), R = null, A = 0;
128
127
  }
129
128
  function ne() {
130
129
  I();
131
130
  const t = Se(o.attempt);
132
- A = Date.now() + t, S = setTimeout(() => {
133
- S = null, A = 0, w(!0);
131
+ A = Date.now() + t, R = setTimeout(() => {
132
+ R = null, A = 0, m(!0);
134
133
  }, t);
135
134
  }
136
135
  function M() {
137
136
  var t;
138
- e.dead = !0, (t = e.stop) == null || t.call(e), I(), o.discard(), P(h, v);
137
+ e.dead = !0, (t = e.stop) == null || t.call(e), e.stop = null, e.buffer = [], I(), o.discard(), o.stopped = !0, P(v, y);
139
138
  }
140
139
  function O(t) {
141
140
  if (e.buffer.length === 0 || !o.recordingId) return;
142
141
  const r = e.buffer;
143
142
  e.buffer = [];
144
- const i = Z(r, t ? be : Re), { routes: m } = ee(i, e.bufferRoute);
143
+ const i = Z(r, t ? be : Re), { routes: h } = ee(i, e.bufferRoute);
145
144
  for (const [s, p] of i.entries())
146
- o.enqueue(p, { route: m[s], ...c ? { build: c } : {} });
145
+ o.enqueue(p, { route: h[s], ...l ? { build: l } : {} });
147
146
  C();
148
147
  }
149
148
  async function oe(t) {
150
- if (!u) {
149
+ if (!c) {
151
150
  if (t === "retry") ne();
152
151
  else if (t === "closed" || t === "abandoned") M();
153
152
  else if (t === "stale")
154
153
  try {
155
- const r = await y.request(T(l));
156
- if (u) return;
154
+ const r = await g.request(T(u));
155
+ if (c) return;
157
156
  o.rebase(r.data.id), e.startedAt = Date.now(), C(), e.flushAfter = !0;
158
157
  } catch {
159
158
  M();
160
159
  }
161
160
  }
162
161
  }
163
- function w(t = !1, r = !1) {
164
- return e.inFlight ? (t && (e.flushAfter = !0), e.inFlight) : e.dead || !o.recordingId || !t && !re() && e.buffer.length < Ue || (O(r), !o.hasPending() || Date.now() < A) ? Promise.resolve() : (e.inFlight = o.drain(r).then(oe).catch(() => {
162
+ function m(t = !1, r = !1) {
163
+ return e.inFlight ? (t && (e.flushAfter = !0), e.inFlight) : e.dead || !o.recordingId || !t && !re() && e.buffer.length < Fe || (O(r), !o.hasPending() || Date.now() < A) ? Promise.resolve() : (e.inFlight = o.drain(r).then(oe).catch(() => {
165
164
  }).finally(() => {
166
- e.inFlight = null, e.flushAfter && (e.flushAfter = !1, w(!0));
165
+ e.inFlight = null, e.flushAfter && (e.flushAfter = !1, m(!0));
167
166
  }), e.inFlight);
168
167
  }
169
168
  function U() {
170
169
  const t = window.requestIdleCallback;
171
- t ? t(() => void w(), { timeout: j }) : w();
170
+ t ? t(() => void m(), { timeout: j }) : m();
172
171
  }
173
172
  async function ie() {
174
173
  const t = await Q();
175
- if (u || !t) return;
176
- b.prune(Date.now() - we);
177
- const r = ge(h, v);
174
+ if (c || !t) return;
175
+ k.prune(Date.now() - we);
176
+ const r = ge(v, y);
178
177
  if (r && ve(r, Date.now())) {
179
- const s = await b.list(r.recordingId);
180
- if (u) return;
178
+ const s = await k.list(r.recordingId);
179
+ if (c) return;
181
180
  o.begin(r.recordingId, r.nextSeq, { trusted: !1, restored: s }), e.startedAt = r.startedAt;
182
181
  } else {
183
- r && (b.clear(r.recordingId), P(h, v));
184
- const s = await y.request(T(l));
185
- if (u) return;
182
+ r && (k.clear(r.recordingId), P(v, y));
183
+ const s = await g.request(T(u));
184
+ if (c) return;
186
185
  o.begin(s.data.id), e.startedAt = Date.now();
187
186
  }
188
187
  C(), e.lastNavAt = Date.now();
189
- const i = Ae(h);
188
+ const i = Ie(v);
190
189
  e.route = _(), e.bufferRoute = e.route, e.sampled = Y(q, e.route, i);
191
- const m = () => {
190
+ const h = () => {
192
191
  var p;
193
192
  e.route = _();
194
193
  const s = e.sampled;
@@ -203,7 +202,7 @@ function et(n = {}) {
203
202
  };
204
203
  e.stop = t({
205
204
  emit(s) {
206
- e.sampled && (e.buffer.length === 0 && (e.bufferRoute = e.route), e.buffer.push(s), e.buffer.length >= Me && U());
205
+ e.sampled && (e.buffer.length === 0 && (e.bufferRoute = e.route), e.buffer.push(s), e.buffer.length >= Ue && U());
207
206
  },
208
207
  ...z(() => D),
209
208
  checkoutEveryNms: 6e4
@@ -213,28 +212,28 @@ function et(n = {}) {
213
212
  p
214
213
  ),
215
214
  () => {
216
- e.lastNavAt = Date.now(), m();
215
+ e.lastNavAt = Date.now(), h();
217
216
  }
218
- ), k = async () => {
217
+ ), S = async () => {
219
218
  if (!o.recordingId) return null;
220
219
  const s = Date.now() - e.startedAt;
221
- return await w(!0).catch(() => {
220
+ return await m(!0).catch(() => {
222
221
  }), o.recordingId ? { recording_id: o.recordingId, offset_ms: s } : null;
223
- }, N("full"), g = () => {
222
+ }, N("full"), w = () => {
224
223
  if (!o.recordingId) return null;
225
224
  const s = Date.now() - e.startedAt;
226
- return async () => (await w(!0).catch(() => {
225
+ return async () => (await m(!0).catch(() => {
227
226
  }), o.recordingId ? { recording_id: o.recordingId, offset_ms: s } : null);
228
227
  };
229
228
  }
230
229
  async function se() {
231
230
  const t = await Q();
232
- u || !t || (e.buffer = [], e.prevWindow = [], e.route = _(), e.bufferRoute = e.route, e.prevWindowRoute = e.route, e.stop = t({
231
+ c || !t || (e.buffer = [], e.prevWindow = [], e.route = _(), e.bufferRoute = e.route, e.prevWindowRoute = e.route, e.stop = t({
233
232
  emit(r, i) {
234
- Ce(r), i ? (e.prevWindow = e.buffer, e.prevWindowRoute = e.bufferRoute, e.buffer = [r], e.bufferRoute = e.route) : e.buffer.push(r);
233
+ _e(r), i ? (e.prevWindow = e.buffer, e.prevWindowRoute = e.bufferRoute, e.buffer = [r], e.bufferRoute = e.route) : e.buffer.push(r);
235
234
  },
236
235
  ...z(() => D),
237
- checkoutEveryNms: Ke
236
+ checkoutEveryNms: Be
238
237
  }) ?? null, e.uninstrument = V(
239
238
  (r, i) => t.addCustomEvent(
240
239
  r,
@@ -243,35 +242,38 @@ function et(n = {}) {
243
242
  () => {
244
243
  e.route = _();
245
244
  }
246
- ), N("clip"), g = (r) => {
247
- const i = [...e.prevWindow, ...e.buffer], m = e.prevWindow.length > 0 ? e.prevWindowRoute : e.bufferRoute;
245
+ ), N("clip"), w = (r) => {
246
+ const i = [...e.prevWindow, ...e.buffer], h = e.prevWindow.length > 0 ? e.prevWindowRoute : e.bufferRoute;
248
247
  if (i.length === 0 || !a) return null;
249
- const s = _e(i, r);
248
+ const s = qe(i, r);
250
249
  return async () => {
251
250
  const L = (await a.request(
252
- De(T(l ?? "error-clip", void 0, !0), r)
251
+ Le(T(u ?? "error-clip", void 0, !0), r)
253
252
  )).data.id;
254
253
  let le = 0;
255
- return await He(a, L, () => le++, i, { startRoute: m, build: c }), await a.request($(L)).catch(() => {
254
+ return await $e(a, L, () => le++, i, {
255
+ startRoute: h,
256
+ build: l
257
+ }) === "ok" && await a.request($(L)).catch(() => {
256
258
  }), { recording_id: L, offset_ms: s };
257
259
  };
258
- }, k = async (r) => {
260
+ }, S = async (r) => {
259
261
  if (r === "error") {
260
- if (e.lastClip && Date.now() - e.lastClip.at < $e)
262
+ if (e.lastClip && Date.now() - e.lastClip.at < ze)
261
263
  return e.lastClip.link;
262
264
  e.lastClip = { at: Date.now(), link: null };
263
265
  }
264
- const i = g == null ? void 0 : g(r);
266
+ const i = w == null ? void 0 : w(r);
265
267
  if (!i) return null;
266
- const m = await i();
267
- return r === "error" && (e.lastClip = { at: Date.now(), link: m }), m;
268
+ const h = await i();
269
+ return r === "error" && (e.lastClip = { at: Date.now(), link: h }), h;
268
270
  });
269
271
  }
270
272
  let W = !1, D = B(null), q = x(null);
271
273
  async function ae() {
272
274
  try {
273
275
  const t = await a.request(ce());
274
- if (u) return;
276
+ if (c) return;
275
277
  D = B(t.data.masking), q = x(t.data.sampling);
276
278
  const r = t.data.cap_reached === !0;
277
279
  W = t.data.enabled === !0 && !r;
@@ -282,7 +284,7 @@ function et(n = {}) {
282
284
  }
283
285
  ae();
284
286
  const ue = setInterval(U, j), F = () => {
285
- document.visibilityState === "hidden" && w(!0, !0);
287
+ document.visibilityState === "hidden" && m(!0, !0);
286
288
  };
287
289
  document.addEventListener("visibilitychange", F);
288
290
  const H = () => {
@@ -296,23 +298,23 @@ function et(n = {}) {
296
298
  };
297
299
  window.addEventListener("pagehide", H);
298
300
  const K = () => {
299
- I(), w(!0);
301
+ I(), m(!0);
300
302
  };
301
303
  return window.addEventListener("online", K), () => {
302
304
  var t, r;
303
- u = !0, k = null, g = null, N(null), document.removeEventListener("visibilitychange", F), window.removeEventListener("pagehide", H), window.removeEventListener("online", K), clearInterval(ue), I(), (t = e.uninstrument) == null || t.call(e), e.uninstrument = null, (r = e.stop) == null || r.call(e), e.stop = null, e.prevWindow = [], w(!0).then(() => {
305
+ c = !0, S = null, w = null, N(null), document.removeEventListener("visibilitychange", F), window.removeEventListener("pagehide", H), window.removeEventListener("online", K), clearInterval(ue), I(), (t = e.uninstrument) == null || t.call(e), e.uninstrument = null, (r = e.stop) == null || r.call(e), e.stop = null, e.prevWindow = [], m(!0).then(() => {
304
306
  const i = o.recordingId;
305
- i && (e.dead || y.request($(i)).catch(() => {
306
- }), o.discard(), o.recordingId = null, P(h, v));
307
+ i && (e.dead || g.request($(i)).catch(() => {
308
+ }), o.discard(), o.recordingId = null, P(v, y));
307
309
  });
308
310
  };
309
- }, [a, d, l, c]);
311
+ }, [a, d, u, l]);
310
312
  }
311
- Ie(
312
- (n) => Be(n),
313
- (n) => (g == null ? void 0 : g(n)) ?? null
313
+ De(
314
+ (n) => xe(n),
315
+ (n) => (w == null ? void 0 : w(n)) ?? null
314
316
  );
315
317
  export {
316
- Be as captureErrorClip,
317
- et as useSessionRecorder
318
+ xe as captureErrorClip,
319
+ nt as useSessionRecorder
318
320
  };
package/dist/index.d.ts CHANGED
@@ -2179,10 +2179,12 @@ export declare function DelegationCard({ user, onSaved, forUser, coversFor }: {
2179
2179
  }>;
2180
2180
  }): JSX.Element;
2181
2181
 
2182
- export declare function DelegationConsoleView({ className, onNotice }: DelegationConsoleViewProps): JSX.Element;
2182
+ export declare function DelegationConsoleView({ className, onNotice, compactHeader }: DelegationConsoleViewProps): JSX.Element;
2183
2183
 
2184
2184
  export declare interface DelegationConsoleViewProps {
2185
2185
  className?: string;
2186
+ /** Host already shows the title (a tab of a page): drop the icon and heading. */
2187
+ compactHeader?: boolean;
2186
2188
  /** Host toast hook. */
2187
2189
  onNotice?: (message: string) => void;
2188
2190
  }
@@ -3062,6 +3064,13 @@ export declare const FORCE_RELOAD_EVENT = "nvr:force-refresh";
3062
3064
  *
3063
3065
  * A second push while a countdown is running restarts the clock with the
3064
3066
  * newer duration — the later instruction wins.
3067
+ *
3068
+ * The countdown runs against a wall-clock deadline, not a count of timer
3069
+ * ticks: a background tab's timers wake about once a minute, so counting 15
3070
+ * ticks took 15 minutes there (staging, 2026-10-23 — idle tabs on an old
3071
+ * build never reloaded while the admin watched). A throttled tab reloads at
3072
+ * its first wake past the deadline, and a frozen one the moment it is shown
3073
+ * or focused again.
3065
3074
  */
3066
3075
  export declare function ForceReloadBanner(): JSX.Element | null;
3067
3076
 
@@ -3391,6 +3400,12 @@ declare interface GridSumCapConfig {
3391
3400
  message?: string;
3392
3401
  }
3393
3402
 
3403
+ /**
3404
+ * Run one identity call through the gate: `blocked()` answers without a request while the tab
3405
+ * is signed out (outside its probe window); a success opens the gate, a signed-out 401 closes it.
3406
+ */
3407
+ export declare function guardIdentityCall<T>(call: () => Promise<T>, blocked: () => T | Promise<T>): Promise<T>;
3408
+
3394
3409
  declare type GuardRule = {
3395
3410
  field: string;
3396
3411
  op: string;
@@ -4788,6 +4803,16 @@ export declare function isChatPanelPinned(): boolean;
4788
4803
 
4789
4804
  export declare function isCleanRecording(): boolean;
4790
4805
 
4806
+ /** True once a 401 said this tab is signed out, until a sign-in is heard. */
4807
+ export declare function isSignedOut(): boolean;
4808
+
4809
+ /**
4810
+ * Does this error say the tab is signed out? `identity` = it came from a "who am I" call, where
4811
+ * any 401 (bar View-as) counts; elsewhere only the session-gone codes do (a public form's wrong
4812
+ * password is a 401 too).
4813
+ */
4814
+ export declare function isSignedOutError(err: unknown, identity?: boolean): boolean;
4815
+
4791
4816
  /**
4792
4817
  * Stale code chunks after a deploy. Screens load lazily by hashed file names, and a new
4793
4818
  * release no longer serves the previous build's files — so a tab opened before the deploy
@@ -5921,6 +5946,21 @@ export declare function NivaroProvider({ client, children, batchReads, persistMe
5921
5946
  */
5922
5947
  export declare function normalizeFieldType(rawType: string, iface: string | null, relation: FormFieldDescriptor['relation']): FormFieldType;
5923
5948
 
5949
+ /** The host swapped credentials (a new bearer token): whatever was refused may work now. */
5950
+ export declare function noteCredentialChanged(): void;
5951
+
5952
+ /**
5953
+ * An identity call succeeded: this tab is signed in. Other tabs hear it when this tab was
5954
+ * signed out until now, or the first time this page learns it (a fresh page after sign-in).
5955
+ */
5956
+ export declare function noteSignedIn(): void;
5957
+
5958
+ /**
5959
+ * A 401 from the API: close the gate and push the next probe further out. `escalate: false`
5960
+ * (a refusal from an ordinary read) only closes an open gate — it never lengthens the wait.
5961
+ */
5962
+ export declare function noteUnauthorized(escalate?: boolean): void;
5963
+
5924
5964
  declare type Notice = (message: string, tone?: 'error' | 'success') => void;
5925
5965
 
5926
5966
  export declare function NotificationActions({ actions, notificationId, onDone, onError, size, className }: NotificationActionsProps): JSX.Element | null;
@@ -5959,8 +5999,10 @@ declare interface NotificationActionsProps {
5959
5999
  className?: string;
5960
6000
  }
5961
6001
 
5962
- export declare function NotificationAnalyticsView({ className }: {
6002
+ export declare function NotificationAnalyticsView({ className, compactHeader }: {
5963
6003
  className?: string;
6004
+ /** Host already shows the title (a tab of a page): drop the icon and heading. */
6005
+ compactHeader?: boolean;
5964
6006
  }): JSX.Element;
5965
6007
 
5966
6008
  /**
@@ -6171,8 +6213,10 @@ declare interface NotificationSourcesCardProps {
6171
6213
  * admin console page and any headless host. Needs NivaroProvider (+ an
6172
6214
  * optional NavigationContext for the "Manage →" links).
6173
6215
  */
6174
- export declare function NotificationSubscriptionsView({ title }: {
6216
+ export declare function NotificationSubscriptionsView({ title, compactHeader }: {
6175
6217
  title?: string;
6218
+ /** Host already shows the title (a tab of a page): drop the icon and heading. */
6219
+ compactHeader?: boolean;
6176
6220
  }): JSX.Element;
6177
6221
 
6178
6222
  export declare type NotificationTarget = {
@@ -6266,6 +6310,9 @@ export declare function onFieldInterfacesChange(cb: () => void): () => void;
6266
6310
  */
6267
6311
  export declare function onIdleChange(fn: (idle: boolean) => void): () => void;
6268
6312
 
6313
+ /** Called once each time the tab goes from signed out to signed in. Returns the unsubscribe. */
6314
+ export declare function onSignedIn(cb: () => void): () => void;
6315
+
6269
6316
  export declare function openAskPanel(question?: string): void;
6270
6317
 
6271
6318
  export declare function openCatalogItem(collection: string, id: string, context?: Record<string, unknown>): void;
@@ -10912,6 +10959,12 @@ export declare interface WorkerSocket extends FallbackSocket {
10912
10959
  * disconnect and connect.
10913
10960
  */
10914
10961
  chaosPause(down: boolean): void;
10962
+ /**
10963
+ * The person signed in (a host that learns it outside the signed-out gate calls this; the gate's
10964
+ * own `noteSignedIn` does it for every worker socket): the worker asks this tab for a token now
10965
+ * instead of staying parked or waiting out its backoff.
10966
+ */
10967
+ signedIn(): void;
10915
10968
  /** The transport the worker's socket uses (for status displays). */
10916
10969
  io: {
10917
10970
  engine: {
@@ -10934,7 +10987,12 @@ export declare interface WorkerSocketOptions {
10934
10987
  features?: string[];
10935
10988
  /** Build fields for `client:hello` (client-version.ts `clientVersion()`). */
10936
10989
  version?: Record<string, unknown>;
10937
- /** Mint a `/auth/ws-token` for the worker's socket (the worker asks one tab per connect). */
10990
+ /**
10991
+ * Mint a `/auth/ws-token` for the worker's socket (the worker asks one tab per connect). A
10992
+ * null answer (signed out, or no token to be had) backs this tab off: the worker's next asks
10993
+ * are answered null without calling this until the wait (1 s doubling to 5 min, jittered)
10994
+ * passes, or the tab hears a sign-in (signed-out.ts).
10995
+ */
10938
10996
  authToken: () => Promise<string | null>;
10939
10997
  /** The host's own socket, created only when the worker cannot serve this tab. */
10940
10998
  fallback: () => FallbackSocket;