@burdenoff/fe-libs 2026.1112.4 → 2026.1112.6

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 (40) hide show
  1. package/dist/shared/assistant/api.d.ts +7 -0
  2. package/dist/shared/assistant/api.js +47 -45
  3. package/dist/shared/assistant/createSandboxAssistantTransport.js +2 -1
  4. package/dist/shared/assistant/gatewayClient.js +1 -0
  5. package/dist/shared/assistant/index.d.ts +4 -0
  6. package/dist/shared/assistant/keepAlive.d.ts +74 -0
  7. package/dist/shared/assistant/keepAlive.js +77 -0
  8. package/dist/shared/assistant/prewarm.d.ts +20 -0
  9. package/dist/shared/assistant/prewarm.js +25 -4
  10. package/dist/shared/assistant/runtime.d.ts +7 -2
  11. package/dist/shared/assistant/runtime.js +23 -22
  12. package/dist/shared/assistant/signInWarm.d.ts +60 -0
  13. package/dist/shared/assistant/signInWarm.js +111 -0
  14. package/dist/shared/assistant/snapshotPoller.d.ts +16 -0
  15. package/dist/shared/assistant/snapshotPoller.js +29 -22
  16. package/dist/shared/assistant/staleSession.d.ts +27 -0
  17. package/dist/shared/assistant/staleSession.js +15 -0
  18. package/dist/shared/assistant/turnProgress.d.ts +16 -0
  19. package/dist/shared/assistant/turnProgress.js +30 -4
  20. package/dist/shared/assistant/ui/AssistantChatArea.js +1286 -1271
  21. package/dist/shared/assistant/ui/AssistantOverlay.d.ts +7 -0
  22. package/dist/shared/assistant/ui/AssistantOverlay.js +256 -248
  23. package/dist/shared/assistant/usageReporting.d.ts +18 -0
  24. package/dist/shared/assistant/usageReporting.js +17 -5
  25. package/dist/shared/assistant/useAssistantHeartbeat.d.ts +24 -4
  26. package/dist/shared/assistant/useAssistantHeartbeat.js +43 -24
  27. package/dist/shared/assistant/useAssistantSignInWarm.d.ts +19 -0
  28. package/dist/shared/assistant/useAssistantSignInWarm.js +55 -0
  29. package/dist/shared/assistant/writeProposals.d.ts +9 -0
  30. package/dist/shared/components/assistantWidget/AssistantWidget.d.ts +7 -0
  31. package/dist/shared/components/assistantWidget/AssistantWidget.js +289 -285
  32. package/dist/shared/graphql/fetch.d.ts +2 -1
  33. package/dist/shared/graphql/fetch.js +14 -11
  34. package/dist/shared/providers/shell/AuthTokenProvider.d.ts +6 -0
  35. package/dist/shared/providers/shell/AuthTokenProvider.js +4 -1
  36. package/dist/shared/providers/shell/index.d.ts +1 -1
  37. package/dist/shared/utils/gatewayFetchRewrite.js +1 -1
  38. package/dist/shared-assistant.js +374 -370
  39. package/dist/shared-providers-shell.js +12 -12
  40. package/package.json +1 -1
@@ -7,7 +7,8 @@ import { Gateway } from '../config';
7
7
  * response nor joins an identical in-flight read, and its fresh result is
8
8
  * stored, so later cacheable reads of the same operation see the new data.
9
9
  * Apollo `network-only` / `no-cache` reads and `refetch()` use this
10
- * (BOFF-7932).
10
+ * (BOFF-7932). The browser fetch runs with `cache: 'reload'`, which also
11
+ * keeps the gateway rewrite's page-load cache from answering it (BOFF-10386).
11
12
  * - `'no-store'`: always send the read to the network and keep it out of the
12
13
  * cache entirely (no replay, no join, no store); the browser fetch also runs
13
14
  * with `cache: 'no-store'`. For authoritative reconciliation reads whose
@@ -291,7 +291,10 @@ async function Z(e) {
291
291
  return t;
292
292
  }
293
293
  }
294
- async function Q(e, t, n) {
294
+ function Q(e) {
295
+ return e.some((e) => e.responseCache === "no-store") ? { cache: "no-store" } : e.some((e) => e.responseCache === "reload") ? { cache: "reload" } : {};
296
+ }
297
+ async function he(e, t, n) {
295
298
  if (n.length === 1) {
296
299
  let r = n[0];
297
300
  try {
@@ -301,7 +304,7 @@ async function Q(e, t, n) {
301
304
  credentials: "include",
302
305
  body: JSON.stringify(r.body),
303
306
  signal: r.signal,
304
- ...r.responseCache === "no-store" ? { cache: "no-store" } : {},
307
+ ...Q([r]),
305
308
  ...r.keepalive ? { keepalive: !0 } : {}
306
309
  }), i = await Z(n);
307
310
  if (!n.ok && !J(i)) throw Error(Y(n));
@@ -318,7 +321,7 @@ async function Q(e, t, n) {
318
321
  headers: q(t),
319
322
  credentials: "include",
320
323
  body: JSON.stringify(r),
321
- ...n.some((e) => e.responseCache === "no-store") ? { cache: "no-store" } : {}
324
+ ...Q(n)
322
325
  }), a = await Z(i);
323
326
  if (!i.ok && !me(a, n) && !J(a)) throw Error(Y(i));
324
327
  if (Array.isArray(a)) a.forEach((e, t) => {
@@ -333,7 +336,7 @@ async function Q(e, t, n) {
333
336
  n.forEach((t) => t.reject(e));
334
337
  }
335
338
  }
336
- function he(e, t, n, r, i) {
339
+ function ge(e, t, n, r, i) {
337
340
  let a = pe(t), o = i?.keepalive === !0, s = o ? 1 : Math.max(1, i?.batchMax ?? ae), c = Math.max(0, i?.batchInterval ?? ue()), l = `${e}|${JSON.stringify(a)}`, u = i?.responseCache !== "no-store" && de(n) ? `${l}|${JSON.stringify(fe(n))}` : void 0;
338
341
  if (r?.aborted) return Promise.reject(I(r));
339
342
  if (u && i?.responseCache !== "reload") {
@@ -350,7 +353,7 @@ function he(e, t, n, r, i) {
350
353
  }
351
354
  let d = new Promise((t, d) => {
352
355
  if (s <= 1) {
353
- Q(e, a, [{
356
+ he(e, a, [{
354
357
  body: n,
355
358
  resolve: t,
356
359
  reject: d,
@@ -379,7 +382,7 @@ function he(e, t, n, r, i) {
379
382
  p.requests.push(m), r && r.addEventListener("abort", () => {
380
383
  let e = z().get(l), t = e ? e.requests.indexOf(m) : -1;
381
384
  e && t >= 0 && (e.requests.splice(t, 1), e.requests.length === 0 && (e.timer && clearTimeout(e.timer), z().delete(l))), d(I(r));
382
- }, { once: !0 }), p.requests.length >= p.batchMax ? ge(e, a, l) : p.timer || (p.timer = setTimeout(() => ge(e, a, l), p.batchInterval));
385
+ }, { once: !0 }), p.requests.length >= p.batchMax ? _e(e, a, l) : p.timer || (p.timer = setTimeout(() => _e(e, a, l), p.batchInterval));
383
386
  });
384
387
  if (u && !r) {
385
388
  let e = V();
@@ -389,9 +392,9 @@ function he(e, t, n, r, i) {
389
392
  }
390
393
  return d;
391
394
  }
392
- function ge(e, t, n) {
395
+ function _e(e, t, n) {
393
396
  let r = z(), i = r.get(n);
394
- i && (r.delete(n), i.timer &&= (clearTimeout(i.timer), null), Q(e, t, i.requests));
397
+ i && (r.delete(n), i.timer &&= (clearTimeout(i.timer), null), he(e, t, i.requests));
395
398
  }
396
399
  async function $(e) {
397
400
  let { gateway: n, query: r, variables: i, operationName: a, authToken: o, workspaceToken: c, workspaceId: d, organizationId: f, tenantId: h, projectId: g, locale: v, baseUrl: y, extraHeaders: S, signal: C, suppressGlobalErrorEvent: E, keepalive: D, batch: k } = e;
@@ -480,7 +483,7 @@ async function $(e) {
480
483
  }), null) : null;
481
484
  };
482
485
  try {
483
- let t = he(A, R, V, C, {
486
+ let t = ge(A, R, V, C, {
484
487
  ...D ? { keepalive: !0 } : {},
485
488
  ...k === !1 ? { batchMax: 1 } : {},
486
489
  responseCache: e.responseCache
@@ -503,10 +506,10 @@ async function $(e) {
503
506
  }), e;
504
507
  }
505
508
  }
506
- function _e(e) {
509
+ function ve(e) {
507
510
  return $({
508
511
  ...e,
509
512
  authTokenMode: "pinned"
510
513
  });
511
514
  }
512
- export { g as SESSION_EXPIRED_EVENT, re as clearGraphqlFetchResponseCache, he as enqueueGraphQLFetch, P as ensureWorkspaceToken, ie as evictGraphqlFetchResponses, b as getStoredAuthToken, te as getStoredGeography, T as getStoredLocale, D as getStoredOrganizationId, k as getStoredProjectId, O as getStoredTenantId, E as getStoredWorkspaceId, x as getStoredWorkspaceToken, $ as graphqlFetch, _e as graphqlFetchPinned, U as isGraphqlFetchCacheHit, F as resolveGatewayUrl };
515
+ export { g as SESSION_EXPIRED_EVENT, re as clearGraphqlFetchResponseCache, ge as enqueueGraphQLFetch, P as ensureWorkspaceToken, ie as evictGraphqlFetchResponses, b as getStoredAuthToken, te as getStoredGeography, T as getStoredLocale, D as getStoredOrganizationId, k as getStoredProjectId, O as getStoredTenantId, E as getStoredWorkspaceId, x as getStoredWorkspaceToken, $ as graphqlFetch, ve as graphqlFetchPinned, U as isGraphqlFetchCacheHit, F as resolveGatewayUrl };
@@ -27,3 +27,9 @@ export interface AuthTokenProviderProps {
27
27
  }
28
28
  export declare function AuthTokenProvider({ children, debug, onTokenChange, onWorkspaceChange, }: AuthTokenProviderProps): import('react').JSX.Element;
29
29
  export declare function useAuthToken(): AuthTokenContextValue;
30
+ /**
31
+ * `useAuthToken` for code that is optional without a session — the assistant's
32
+ * sign-in warm, which must never take down the overlay it rides in (BOFF-12187).
33
+ * Null outside an `AuthTokenProvider`.
34
+ */
35
+ export declare function useAuthTokenOrNull(): AuthTokenContextValue | null;
@@ -116,4 +116,7 @@ function C() {
116
116
  if (!e) throw Error("useAuthToken must be used within AuthTokenProvider");
117
117
  return e;
118
118
  }
119
- export { S as AuthTokenProvider, C as useAuthToken };
119
+ function w() {
120
+ return o(g);
121
+ }
122
+ export { S as AuthTokenProvider, C as useAuthToken, w as useAuthTokenOrNull };
@@ -29,7 +29,7 @@ export { PermissionProvider, usePermissions, useSafePermissions, usePermission,
29
29
  export type { EffectivePermissions, EffectiveResourcePermission, MyRolesResult, RoleInfo, PermissionCheckOptions, PermissionContextValue, PermissionProviderProps, } from './PermissionProvider';
30
30
  export { PersonaSurfaceProvider, usePersonaSurface, useSafePersonaSurface, resolveSurfaceForRoles, synthesizeSimulatedPermissionStrings, EVERYTHING_SURFACE_ID, } from './PersonaSurfaceProvider';
31
31
  export type { PersonaSurfaceDefinition, PersonaSurfaceContextValue, PersonaSurfaceProviderProps, PersonaCustomView, NavItemOverrideState, SimulatableRole, SimulationState, } from './PersonaSurfaceProvider';
32
- export { AuthTokenProvider, useAuthToken } from './AuthTokenProvider';
32
+ export { AuthTokenProvider, useAuthToken, useAuthTokenOrNull } from './AuthTokenProvider';
33
33
  export type { AuthTokenContextValue, AuthTokenProviderProps } from './AuthTokenProvider';
34
34
  export { MultiGatewayProvider } from './MultiGatewayProvider';
35
35
  export type { MultiGatewayProviderProps } from './MultiGatewayProvider';
@@ -217,7 +217,7 @@ function W(e, t) {
217
217
  let r = await e.clone().text(), o = H(e.clone()), s = z(r);
218
218
  if (!s?.length) return a(e);
219
219
  let c = r.trimStart().startsWith("["), u = s.map((e) => R(o, e));
220
- if (V() && u.every(Boolean)) {
220
+ if (e.cache !== "reload" && e.cache !== "no-cache" && V() && u.every(Boolean)) {
221
221
  let e = b(), t = u.map((t) => e.get(t)), n = Date.now();
222
222
  if (t.every((e) => e && e.expiresAt > n)) return B(t.map((e) => e.value), c);
223
223
  }