@burdenoff/fe-libs 2026.1023.6 → 2026.1023.8

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/gatewayClient.js +23 -19
  2. package/dist/shared/assistant/index.d.ts +1 -0
  3. package/dist/shared/assistant/productContext.d.ts +16 -0
  4. package/dist/shared/assistant/productContext.js +16 -0
  5. package/dist/shared/graphql/client.d.ts +9 -0
  6. package/dist/shared/graphql/client.js +241 -201
  7. package/dist/shared/graphql/fetch.js +135 -123
  8. package/dist/shared/graphql/index.d.ts +1 -0
  9. package/dist/shared/graphql/workspaceOperationGuard.d.ts +70 -0
  10. package/dist/shared/graphql/workspaceOperationGuard.js +62 -0
  11. package/dist/shared/providers/AppShellProvider.d.ts +16 -0
  12. package/dist/shared/providers/AppShellProvider.js +258 -251
  13. package/dist/shared/providers/shell/AuthProvider.d.ts +14 -1
  14. package/dist/shared/providers/shell/AuthProvider.js +105 -94
  15. package/dist/shared/providers/shell/MultiGatewayProvider.d.ts +8 -1
  16. package/dist/shared/providers/shell/MultiGatewayProvider.js +115 -119
  17. package/dist/shared/providers/shell/ProfileStorageManager.js +1 -1
  18. package/dist/shared/providers/shell/WorkspaceWriteRefusedToastListener.d.ts +4 -0
  19. package/dist/shared/providers/shell/WorkspaceWriteRefusedToastListener.js +23 -0
  20. package/dist/shared/providers/shell/authProvider/identityChange.d.ts +26 -0
  21. package/dist/shared/providers/shell/authProvider/identityChange.js +11 -0
  22. package/dist/shared/providers/shell/authProvider/useAuthActions.d.ts +4 -1
  23. package/dist/shared/providers/shell/authProvider/useAuthActions.js +105 -92
  24. package/dist/shared/providers/shell/authProvider/useBridgeInitialization.d.ts +27 -1
  25. package/dist/shared/providers/shell/authProvider/useBridgeInitialization.js +82 -62
  26. package/dist/shared/providers/shell/authProvider/useRemoteSLO.d.ts +4 -1
  27. package/dist/shared/providers/shell/authProvider/useRemoteSLO.js +16 -14
  28. package/dist/shared/providers/shell/authProvider/useStorageSync.d.ts +4 -1
  29. package/dist/shared/providers/shell/authProvider/useStorageSync.js +19 -14
  30. package/dist/shared/providers/shell/contextSwitchCache.d.ts +4 -0
  31. package/dist/shared/providers/shell/contextSwitchCache.js +17 -0
  32. package/dist/shared/providers/shell/identityQueryReset.d.ts +17 -0
  33. package/dist/shared/providers/shell/identityQueryReset.js +21 -0
  34. package/dist/shared/providers/shell/identityScopedQueryReset.d.ts +16 -0
  35. package/dist/shared/providers/shell/identityScopedQueryReset.js +30 -0
  36. package/dist/shared/providers/shell/index.d.ts +1 -1
  37. package/dist/shared-assistant.js +306 -305
  38. package/dist/shared-graphql.js +11 -10
  39. package/dist/shared.js +129 -128
  40. package/package.json +2 -2
@@ -1,45 +1,49 @@
1
1
  import { graphqlFetch as e } from "../graphql/fetch.js";
2
2
  import "../../shared-graphql.js";
3
3
  import "./quota.js";
4
+ import { assistantProductHeaders as t } from "./productContext.js";
4
5
  //#region src/shared/assistant/gatewayClient.ts
5
- function t() {
6
+ function n() {
6
7
  try {
7
8
  return `bf-assistant-${crypto.randomUUID()}`;
8
9
  } catch {
9
10
  return `bf-assistant-${Date.now()}-${Math.random().toString(36).slice(2)}`;
10
11
  }
11
12
  }
12
- function n(e, t) {
13
+ function r(e, t) {
13
14
  return {
14
15
  workspaceId: e,
15
16
  ...t?.organizationId ? { custom: { organizationId: t.organizationId } } : {}
16
17
  };
17
18
  }
18
- async function r(n) {
19
- let r = await e({
19
+ async function i(r) {
20
+ let i = await e({
20
21
  gateway: "workspace",
21
- query: n.query,
22
- operationName: n.operationName,
23
- variables: n.variables,
24
- ...n.signal ? { signal: n.signal } : {},
25
- authToken: n.authContext?.accessToken ?? void 0,
22
+ query: r.query,
23
+ operationName: r.operationName,
24
+ variables: r.variables,
25
+ ...r.signal ? { signal: r.signal } : {},
26
+ authToken: r.authContext?.accessToken ?? void 0,
26
27
  workspaceToken: !0,
27
- workspaceId: n.workspaceId,
28
- organizationId: n.authContext?.organizationId ?? !0,
28
+ workspaceId: r.workspaceId,
29
+ organizationId: r.authContext?.organizationId ?? !0,
29
30
  suppressGlobalErrorEvent: !0,
30
- extraHeaders: { "x-request-id": t() }
31
+ extraHeaders: {
32
+ "x-request-id": n(),
33
+ ...t()
34
+ }
31
35
  });
32
- if (r.errors?.length) {
33
- let e = r.errors[0], t = Error(e.message);
36
+ if (i.errors?.length) {
37
+ let e = i.errors[0], t = Error(e.message);
34
38
  throw t.extensions = e.extensions, t;
35
39
  }
36
- if (r.data == null) throw Error("Sandbox GraphQL returned no data");
37
- return r.data;
40
+ if (i.data == null) throw Error("Sandbox GraphQL returned no data");
41
+ return i.data;
38
42
  }
39
- async function i(e) {
43
+ async function a(e) {
40
44
  let t;
41
45
  for (let n = 0; n < 3; n++) try {
42
- return await r(e);
46
+ return await i(e);
43
47
  } catch (e) {
44
48
  t = e;
45
49
  let r = e instanceof Error ? e.message.toLowerCase() : String(e).toLowerCase();
@@ -49,4 +53,4 @@ async function i(e) {
49
53
  throw t;
50
54
  }
51
55
  //#endregion
52
- export { n as buildSandboxContextInput, r as executeAssistantGraphQLOnce, i as executeSandboxGraphQL };
56
+ export { r as buildSandboxContextInput, i as executeAssistantGraphQLOnce, a as executeSandboxGraphQL };
@@ -33,6 +33,7 @@ export * from './useSandboxAssistantTransport';
33
33
  export * from './createSandboxAssistantTransport';
34
34
  export * from './runtime';
35
35
  export * from './gatewayClient';
36
+ export * from './productContext';
36
37
  export * from './progress';
37
38
  export * from './streamBudget';
38
39
  export * from './api';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The product the assistant runs in, sent as `x-product-id` on every
3
+ * assistant gateway call.
4
+ *
5
+ * The session relay re-sends the assistant's reads to the gateway with this
6
+ * product, and product-scoped services (wspace-workflow-svc) answer a read only
7
+ * when it names one: without it every FluidGrids read came back
8
+ * BAD_USER_INPUT. The shell registers its product while it is mounted
9
+ * (AppShellProvider), so the assistant code itself never names a product.
10
+ */
11
+ /** Register the shell's product; returns a disposer that clears it if it is still the one set. */
12
+ export declare function setAssistantProductId(productId: string | null | undefined): () => void;
13
+ /** The registered product, or null outside a shell (an MFE in isolation, a test). */
14
+ export declare function getAssistantProductId(): string | null;
15
+ /** The headers that carry the product, when one is registered. */
16
+ export declare function assistantProductHeaders(): Record<string, string>;
@@ -0,0 +1,16 @@
1
+ //#region src/shared/assistant/productContext.ts
2
+ var e = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/, t = null;
3
+ function n(n) {
4
+ let r = typeof n == "string" && e.test(n) ? n : null;
5
+ return t = r, () => {
6
+ t === r && (t = null);
7
+ };
8
+ }
9
+ function r() {
10
+ return t;
11
+ }
12
+ function i() {
13
+ return t ? { "x-product-id": t } : {};
14
+ }
15
+ //#endregion
16
+ export { i as assistantProductHeaders, r as getAssistantProductId, n as setAssistantProductId };
@@ -2,6 +2,7 @@ import { ApolloClient, InMemoryCache } from '@apollo/client/core';
2
2
  import { RetryLink } from '@apollo/client/link/retry';
3
3
  import { Gateway } from '../config';
4
4
  import { RetryPolicyOperation } from './retryPolicy';
5
+ import { WorkspaceOperationGuardMode } from './workspaceOperationGuard';
5
6
  /**
6
7
  * Decide whether the transport may retry a failed operation. Pure so it can be
7
8
  * unit-tested without a client. Mutations are never retried (an ambiguous
@@ -92,6 +93,14 @@ export interface CreateClientOptions {
92
93
  batchInterval?: number;
93
94
  /** Enable debug logging */
94
95
  debug?: boolean;
96
+ /**
97
+ * BOFF-8106: what to do with an operation whose ContextInput names a
98
+ * workspace other than the active one (workspace gateway only). `'off'`
99
+ * (default) sends it as before; `'report'` sends it and dispatches
100
+ * `burdenoff:workspace-context-mismatch`; `'enforce'` does not send it and
101
+ * ends it with a `WorkspaceContextChangedError`. See workspaceOperationGuard.ts.
102
+ */
103
+ workspaceOperationGuard?: WorkspaceOperationGuardMode;
95
104
  }
96
105
  export interface MutationSuccessEvent {
97
106
  gateway: Gateway;