@belonguniverseai/react-sdk 0.6.27 → 0.6.29

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 (143) hide show
  1. package/README.md +43 -4
  2. package/dist/api/account-scope.d.ts +75 -0
  3. package/dist/api/artifact-actions.d.ts +0 -1
  4. package/dist/api/auth-errors.d.ts +21 -0
  5. package/dist/api/client-identity.d.ts +3 -1
  6. package/dist/api/client.d.ts +1394 -162
  7. package/dist/api/goals.d.ts +19 -2
  8. package/dist/api/live-artifacts.d.ts +197 -0
  9. package/dist/api/my-usage.d.ts +28 -0
  10. package/dist/api/queries.d.ts +6 -4
  11. package/dist/api/query-keys.d.ts +44 -3
  12. package/dist/api/task-schedule-sharing.d.ts +18 -3
  13. package/dist/api/task-schedules.d.ts +76 -12
  14. package/dist/app/VoiceOverlay.d.ts +4 -3
  15. package/dist/app/dock-story-data.d.ts +19 -1
  16. package/dist/browser/control-channel.d.ts +9 -0
  17. package/dist/browser/dom-bridge.d.ts +2 -0
  18. package/dist/component/BelongWidget.d.ts +17 -4
  19. package/dist/component/{abnfDiagram-N423BO3Z-DrnjkZwk.js → abnfDiagram-N423BO3Z-BvL7baZ-.js} +4 -4
  20. package/dist/component/{arc-CLchGzOM.js → arc-DVUroP2Z.js} +2 -2
  21. package/dist/component/{architectureDiagram-T3A2C74G-Du8PLen3.js → architectureDiagram-T3A2C74G-CYt93mxs.js} +3 -3
  22. package/dist/component/{blockDiagram-VBNYF7ZC-BxmYbrlL.js → blockDiagram-VBNYF7ZC-yST7U8Pb.js} +4 -4
  23. package/dist/component/{c4Diagram-5PPSVZJV-DHiwlK7l.js → c4Diagram-5PPSVZJV-BHz6Efx3.js} +3 -3
  24. package/dist/component/{channel-C2eeNEMi.js → channel-CKTqNdN4.js} +2 -2
  25. package/dist/component/{chunk-2GRJ4B5K-D6I_U4nB.js → chunk-2GRJ4B5K-Bw2zHHAm.js} +2 -2
  26. package/dist/component/{chunk-2Q5K7J3B-BR3JSmNI.js → chunk-2Q5K7J3B-DpBuF73m.js} +2 -2
  27. package/dist/component/{chunk-5RXB4S5H-DcmzyncC.js → chunk-5RXB4S5H-dxBtwi1p.js} +5 -5
  28. package/dist/component/{chunk-5VM5RSS4-8ww1xEAz.js → chunk-5VM5RSS4-BOTqM1Rc.js} +2 -2
  29. package/dist/component/{chunk-6Q2QTUOP-Chlg3gnC.js → chunk-6Q2QTUOP-DjMXJhRD.js} +2 -2
  30. package/dist/component/{chunk-GF5L2VYU-CgKydjVC.js → chunk-GF5L2VYU-CGpnSfXM.js} +6 -6
  31. package/dist/component/{chunk-JWPE2WC7-13zVpFYT.js → chunk-JWPE2WC7-L5aYKPho.js} +2 -2
  32. package/dist/component/{chunk-KBJHAD2P-CP28c_dJ.js → chunk-KBJHAD2P-DH2RFBaF.js} +2 -2
  33. package/dist/component/{chunk-RYQCIY6F-CaHaa77d.js → chunk-RYQCIY6F-QPgRO0s7.js} +2 -2
  34. package/dist/component/{chunk-XXDRQBXY-Cd0yVkqx.js → chunk-XXDRQBXY-C1ezaFpA.js} +2 -2
  35. package/dist/component/{classDiagram-JCYQIIEL-Bn0740dK.js → classDiagram-JCYQIIEL-Dx7Qx836.js} +3 -3
  36. package/dist/component/{classDiagram-v2-OCEON4UE-Bn0740dK.js → classDiagram-v2-OCEON4UE-Dx7Qx836.js} +3 -3
  37. package/dist/component/{cose-bilkent-JH36ORCC-Y6CvxIe4.js → cose-bilkent-JH36ORCC-Bem1eaLJ.js} +2 -2
  38. package/dist/component/{cynefinDiagram-MW4NZA55-BJ_o5gyM.js → cynefinDiagram-MW4NZA55-DF15EWOu.js} +3 -3
  39. package/dist/component/{dagre-VZM6K2ZE-Ce_ZLKlj.js → dagre-VZM6K2ZE-BVzwev7l.js} +3 -3
  40. package/dist/component/{diagram-7IWD3JNH-K8E_XdII.js → diagram-7IWD3JNH-DzQhKX_v.js} +4 -4
  41. package/dist/component/{diagram-B4RE2ZJO-DZGs1RuF.js → diagram-B4RE2ZJO-DnHINfhE.js} +3 -3
  42. package/dist/component/{diagram-LBJQPF4R-CzKPOqJK.js → diagram-LBJQPF4R-CPqE_GwY.js} +3 -3
  43. package/dist/component/{diagram-Q27KOJAE-UItKj-dk.js → diagram-Q27KOJAE-BjpvfqhL.js} +4 -4
  44. package/dist/component/{diagram-UB23O5K3-ZxBLx0B9.js → diagram-UB23O5K3-BcYqFjqI.js} +3 -3
  45. package/dist/component/{ebnfDiagram-BXEA7PRR-BIS2pIB5.js → ebnfDiagram-BXEA7PRR-DoqGcWGx.js} +4 -4
  46. package/dist/component/{erDiagram-JOGREHBK-BNZB6-ZZ.js → erDiagram-JOGREHBK-DGrj5tIK.js} +5 -5
  47. package/dist/component/{flowDiagram-UKHOOZJN-B8H3ZNjd.js → flowDiagram-UKHOOZJN-B8OuOrVY.js} +7 -7
  48. package/dist/component/{ganttDiagram-PKOTCBZU-2JJJVAY-.js → ganttDiagram-PKOTCBZU-BaxSqTVY.js} +3 -3
  49. package/dist/component/{gitGraphDiagram-DS77QQ5N-BVWxsX1D.js → gitGraphDiagram-DS77QQ5N-W1Sqa3Hc.js} +4 -4
  50. package/dist/component/{highlighted-body-OFNGDK62-CmQzAJHd.js → highlighted-body-OFNGDK62-Cf1UqcGe.js} +2 -2
  51. package/dist/component/index.d.ts +1 -0
  52. package/dist/component/index.js +2 -2
  53. package/dist/component/{infoDiagram-6WML65LV-B-7B2PTM.js → infoDiagram-6WML65LV-BS0JlYPr.js} +2 -2
  54. package/dist/component/{ishikawaDiagram-WSZJBQD7-DgjY91jV.js → ishikawaDiagram-WSZJBQD7-Df_NzOQV.js} +2 -2
  55. package/dist/component/{journeyDiagram-NVQOT4AX-fkb_5H2H.js → journeyDiagram-NVQOT4AX-JWKvZ6rc.js} +5 -5
  56. package/dist/component/{kanban-definition-27J2QSJJ-ZRQERkli.js → kanban-definition-27J2QSJJ-DMvICKAB.js} +3 -3
  57. package/dist/component/{linear-DX0_iAiu.js → linear-D02U2fTS.js} +2 -2
  58. package/dist/component/{mermaid-GHXKKRXX-BhURR8Q_.js → mermaid-GHXKKRXX-B7CJJdoE.js} +51487 -47044
  59. package/dist/component/{mindmap-definition-FAOFIHXS-Duc36TEr.js → mindmap-definition-FAOFIHXS-AzTh8oju.js} +4 -4
  60. package/dist/component/{pegDiagram-VL7TDLO6-Egcz9GLB.js → pegDiagram-VL7TDLO6-DSCzZs_w.js} +4 -4
  61. package/dist/component/{pieDiagram-7S7Q4E2Y-DEe2GHp7.js → pieDiagram-7S7Q4E2Y-CEByr6BB.js} +4 -4
  62. package/dist/component/{quadrantDiagram-CIZ2JOQS-DNfio-6s.js → quadrantDiagram-CIZ2JOQS-BrWOf-GT.js} +3 -3
  63. package/dist/component/{railroadDiagram-AXF67PYL-B3lRYedY.js → railroadDiagram-AXF67PYL-DRtsV2gM.js} +4 -4
  64. package/dist/component/{requirementDiagram-LRYGKXZP-DYYxC0Cg.js → requirementDiagram-LRYGKXZP-_WwAo7AE.js} +4 -4
  65. package/dist/component/{sankeyDiagram-W5VNT64P-CKQNueMs.js → sankeyDiagram-W5VNT64P-DBxP3yyK.js} +2 -2
  66. package/dist/component/{sequenceDiagram-SI44F4Z6-ChF8pgI7.js → sequenceDiagram-SI44F4Z6-B3SNXrpC.js} +4 -4
  67. package/dist/component/{sizeCapture-X5ZJPWSS-BQyVznxb.js → sizeCapture-X5ZJPWSS-D5G8pyPC.js} +2 -2
  68. package/dist/component/{stateDiagram-OKZ733FA-CAVOTaJQ.js → stateDiagram-OKZ733FA-C4UZwsoc.js} +3 -3
  69. package/dist/component/{stateDiagram-v2-UEYNNEHI-rGNqHCbu.js → stateDiagram-v2-UEYNNEHI-DIYB5q15.js} +3 -3
  70. package/dist/component/{swimlanes-SLNWSIFB-j8tXsaid.js → swimlanes-SLNWSIFB-Cc9yJXTh.js} +4 -4
  71. package/dist/component/{swimlanesDiagram-ULZ7WXOC-CsbepRMA.js → swimlanesDiagram-ULZ7WXOC-DsGPiJ-s.js} +3 -3
  72. package/dist/component/{timeline-definition-Z64GVDOM-nCRE1AQh.js → timeline-definition-Z64GVDOM-Dr4-iAeD.js} +3 -3
  73. package/dist/component/{vennDiagram-T6HMQDX7-C3ubGm9c.js → vennDiagram-T6HMQDX7-ZiaZ9jYw.js} +2 -2
  74. package/dist/component/{wardleyDiagram-T6FBY63Y-mKT8yN1z.js → wardleyDiagram-T6FBY63Y-KdF37MT-.js} +3 -3
  75. package/dist/component/{xychartDiagram-ELKLHX3M-D5AF8jgv.js → xychartDiagram-ELKLHX3M-NH_bOKPL.js} +3 -3
  76. package/dist/components/artifacts/ArtifactDetailSurface.d.ts +37 -0
  77. package/dist/components/artifacts/ArtifactMeta.d.ts +10 -0
  78. package/dist/components/artifacts/ArtifactsListSurface.d.ts +11 -0
  79. package/dist/components/artifacts/BindScheduleDialog.d.ts +39 -0
  80. package/dist/components/artifacts/ConfirmDeleteArtifactDialog.d.ts +9 -0
  81. package/dist/components/artifacts/ConfirmReshareDialog.d.ts +24 -0
  82. package/dist/components/artifacts/artifact-format.d.ts +38 -0
  83. package/dist/components/artifacts/open-artifact-version.d.ts +16 -0
  84. package/dist/components/artifacts/use-artifact-actions.d.ts +32 -0
  85. package/dist/components/embed/ComposerContext.d.ts +11 -7
  86. package/dist/components/embed/EmbedComposer.d.ts +7 -1
  87. package/dist/components/embed/EmbedRail.d.ts +9 -2
  88. package/dist/components/embed/GoalRefusalCard.d.ts +5 -1
  89. package/dist/components/embed/MobileNavBar.d.ts +2 -1
  90. package/dist/components/embed/ResponseModeDial.d.ts +11 -0
  91. package/dist/components/embed/SessionStatsPanel.d.ts +3 -0
  92. package/dist/components/embed/UsageSettings.d.ts +11 -0
  93. package/dist/components/embed/format-compact-number.d.ts +8 -0
  94. package/dist/components/embed/use-artifact-operation-notices.d.ts +1 -0
  95. package/dist/components/scheduled/ConfirmRunPausedScheduleDialog.d.ts +18 -0
  96. package/dist/components/scheduled/EmailCopiesFields.d.ts +19 -0
  97. package/dist/components/scheduled/ScheduledDetailSurface.d.ts +2 -1
  98. package/dist/components/scheduled/use-run-now-with-confirmation.d.ts +17 -0
  99. package/dist/embed/artifact-action-bridge.d.ts +13 -3
  100. package/dist/embed/artifact-remint-budget.d.ts +5 -0
  101. package/dist/embed/copy.d.ts +13 -18
  102. package/dist/embed/dock-state.d.ts +1 -1
  103. package/dist/embed/global.d.ts +2 -0
  104. package/dist/embed/goal-edit-command.d.ts +6 -5
  105. package/dist/embed/plan-decision-text.d.ts +1 -0
  106. package/dist/embed/presets.d.ts +1 -0
  107. package/dist/embed/response-mode.d.ts +48 -0
  108. package/dist/embed/theme.d.ts +5 -0
  109. package/dist/embed/voice-config.d.ts +22 -31
  110. package/dist/embed/voice-prefs.d.ts +18 -34
  111. package/dist/i18n/messages/en.d.ts +146 -7
  112. package/dist/i18n/messages/surfaces/artifacts.d.ts +304 -0
  113. package/dist/i18n/messages/surfaces/feedback.d.ts +12 -0
  114. package/dist/i18n/messages/surfaces/header.d.ts +4 -0
  115. package/dist/i18n/messages/surfaces/myUsage.d.ts +75 -0
  116. package/dist/i18n/messages/surfaces/plan.d.ts +4 -0
  117. package/dist/i18n/messages/surfaces/scheduled.d.ts +53 -1
  118. package/dist/i18n/messages/surfaces/settings.d.ts +12 -0
  119. package/dist/i18n/messages/surfaces/stats.d.ts +4 -12
  120. package/dist/i18n/messages/surfaces/stream.d.ts +88 -0
  121. package/dist/i18n/messages/surfaces/usage.d.ts +1 -9
  122. package/dist/infrastructure/telemetry/first-response-timing.d.ts +51 -0
  123. package/dist/lib/tab-control-store.d.ts +14 -0
  124. package/dist/lib/tab-leadership.d.ts +9 -24
  125. package/dist/lib/use-now.d.ts +32 -0
  126. package/dist/lib/use-tab-leadership.d.ts +5 -7
  127. package/dist/routes/artifact-detail.d.ts +2 -0
  128. package/dist/routes/artifacts.d.ts +2 -0
  129. package/dist/routes/chat/history-merge.d.ts +53 -0
  130. package/dist/routes/chat/history-paging.d.ts +25 -6
  131. package/dist/routes/chat/transcript-row.d.ts +1 -0
  132. package/dist/routes/chat/use-catch-up-on-return.d.ts +70 -0
  133. package/dist/routes/chat/use-return-to-page.d.ts +7 -0
  134. package/dist/stream/belong-chat-transport.d.ts +38 -8
  135. package/dist/stream/belong-data-parts.d.ts +10 -0
  136. package/dist/stream/dispatch-once.d.ts +1 -1
  137. package/dist/stream/message-parts.d.ts +3 -1
  138. package/dist/stream/queued-message-outbox.d.ts +6 -0
  139. package/dist/stream/select-session-usage.d.ts +9 -0
  140. package/dist/stream/session-control-context.d.ts +7 -0
  141. package/dist/stream/session-stats-csv.d.ts +7 -9
  142. package/dist/types/public.d.ts +16 -9
  143. package/package.json +1 -1
package/README.md CHANGED
@@ -27,6 +27,7 @@ export function App() {
27
27
  return await getBelongToken();
28
28
  }}
29
29
  backend="https://your-belong-backend.example.com"
30
+ tenant="your-tenant-id-or-slug"
30
31
  />
31
32
  );
32
33
  }
@@ -38,6 +39,7 @@ export function App() {
38
39
  | ---------------- | ------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
39
40
  | `getToken` | `() => Promise<string>` | yes | Resolves a bearer token per request (DI auth; never cached). |
40
41
  | `backend` | `string` | yes | Belong backend base URL. |
42
+ | `tenant` | `string` | no | Public tenant ID or slug for branding. Required when the API hosts multiple tenants; omit on a single-tenant API. Auth still comes from the JWT. |
41
43
  | `universeOrigin` | `string` | no | **Deprecated, ignored.** Cross-origin navigation keys off `window.location`; safe to remove. |
42
44
  | `agentId` | `string` | no | Sent as `X-Belong-Agent-Id` on every request. |
43
45
  | `locale` | `BelongLocale` | no | Host/tenant default language (user choice still wins). |
@@ -48,15 +50,42 @@ export function App() {
48
50
  The dock renders into its own shadow root, so its styles never leak into (or
49
51
  inherit from) your app.
50
52
 
53
+ ### Tenant default theme
54
+
55
+ Both the React component and `window.belong.init({ apiBaseUrl, tenant })` load
56
+ `GET /v1/config/theme?tenant=<id-or-slug>` before rendering the dock. The API
57
+ resolves the active tenant and reads `tenants/<tenantId>/config/theme.json` from
58
+ its private asset store, with the existing knowledge-domain theme as a fallback.
59
+ The browser needs no bucket credentials or direct bucket access.
60
+
61
+ The published tenant theme is the default. Appearance settings offer **Company
62
+ default**, **Belong**, **Simetrik**, and **Custom**. Explicit style choices are
63
+ stored per API endpoint and tenant. Selecting Company default restores the latest
64
+ published branding; old unscoped style preferences cannot silently replace it.
65
+ The SDK refreshes the baseline on page focus or when the tab becomes visible,
66
+ while preserving an explicit style and personal color-mode/position preferences.
67
+ The script embed can also restore it with `belong.applyPreset("tenant")`.
68
+
69
+ Theme reads bypass HTTP caches. API instances refresh their tenant registry and
70
+ asset cache using the existing `assets_revision` signal, so publishing must
71
+ advance that revision. A first read also syncs revision-0 tenants added after boot.
72
+ Network failures retain the last good theme or built-in/inline fallback; initial
73
+ theme reads time out after five seconds so an unavailable API cannot block the dock.
74
+
75
+ Rollout requires releasing the API and both SDK bundles, then upgrading the SDK
76
+ installed in each host application. No admin-page change or public bucket access
77
+ is required. Configure each deployment with the intended environment/region's
78
+ tenant bucket and backend read permissions.
79
+
51
80
  ### Host context (`window.belong.init`)
52
81
 
53
82
  The script-tag embed's `init` takes two optional host-context props that
54
83
  personalise what the dock shows before the first message:
55
84
 
56
- | Prop | Type | Required | Description |
57
- | ------------- | ------------------------------------------------- | -------- | ------------------------------------------------------------------- |
58
- | `user` | `{ displayName?: string }` | no | Signed-in user; personalises the first message and the avatar menu. |
59
- | `pageContext` | `{ label?: string; fromDocumentTitle?: boolean }` | no | Page label for the first message; defaults to the tab title. |
85
+ | Prop | Type | Required | Description |
86
+ | ------------- | ------------------------------------------------- | -------- | ----------------------------------------------------------------------------------- |
87
+ | `user` | `{ displayName?: string }` | no | Signed-in user; personalises the first message and the avatar menu. |
88
+ | `pageContext` | `{ label?: string; fromDocumentTitle?: boolean }` | no | Page label shown in the dock and sent with each message; defaults to the tab title. |
60
89
 
61
90
  Both have runtime setters on `window.belong`, alongside `setLocale` and
62
91
  `setWorkspace`:
@@ -69,6 +98,16 @@ Both have runtime setters on `window.belong`, alongside `setLocale` and
69
98
  dock reads `document.title` live (SPA navigation updates it), unless the host
70
99
  passed `pageContext: { fromDocumentTitle: false }`.
71
100
 
101
+ The page label is also **sent with every message**, so the agent can resolve
102
+ "this page": the label the composer's page chip shows at send time (host label,
103
+ `init` label, or the tab title) rides the message, and the agent reads it as
104
+ host-reported context, never as something the user typed. Only the label is
105
+ sent, never the page's contents, and it is stored with the message like the
106
+ message text. A tab title can carry customer names, record ids or the
107
+ signed-in user's email: if yours does, give the dock a clean label with
108
+ `setPageContext(label)`, or pass `pageContext: { fromDocumentTitle: false }` so
109
+ nothing is sent unless you set one.
110
+
72
111
  A re-`init` states the host's context in full: omitting `user` or
73
112
  `pageContext` CLEARS what a previous `init` seeded (the config is replaced
74
113
  wholesale, not merged). A live `setUser` / `setPageContext` override outranks
@@ -0,0 +1,75 @@
1
+ import { QueryClient } from '@tanstack/react-query';
2
+ /**
3
+ * The stable identity of the account speaking to `apiBaseUrl` right now. An
4
+ * opaque string — callers put it in a query key and compare it, never parse it.
5
+ */
6
+ export declare const accountKey: (apiBaseUrl: string) => string;
7
+ /** `accountKey`, re-read whenever the identity behind the auth source moves. */
8
+ export declare const useAccountKey: () => string;
9
+ /**
10
+ * Answers whether the account that BEGAN an action is still the active one, on
11
+ * the same backend. Call it immediately before the side effect, not once at the
12
+ * top of the callback: what matters is the instant the effect happens.
13
+ */
14
+ export type StillInitiatingAccount = () => boolean;
15
+ /**
16
+ * Bind an action to the account that starts it (P1, 2026-09-28 PR #614
17
+ * follow-up audit finding A).
18
+ *
19
+ * Partitioning the CACHE was only half the hole. Cancelling and dropping a
20
+ * previous account's READS does nothing to a MUTATION's promise callback: it is
21
+ * an ordinary `.then` on a promise nobody cancelled, it still holds the
22
+ * response the previous account's bearer authenticated, and unmounting does not
23
+ * stop it either. The audit reproduced the consequence — account A shares an
24
+ * unshared report, the host swaps to B in place while the response is in
25
+ * flight, and A's private bearer share url lands on B's CLIPBOARD.
26
+ *
27
+ * So every action captures the account it started under and re-asks before it
28
+ * does anything the world can see. The identity is the SAME `accountKey` the
29
+ * cache is partitioned by, deliberately and not for tidiness: a second notion
30
+ * of "who is this" is a second thing to get out of step, and that key already
31
+ * carries both axes the audit named — the token's stable CLAIMS and the BACKEND
32
+ * (`apiBaseUrl`) they speak to, which is the "backend generation" half.
33
+ *
34
+ * It cannot rotate spuriously for a token whose claims are readable, which is
35
+ * every production shape: the key is derived from `tenant_id`+`user_id` (or
36
+ * `iss`+`sub`), so a token REFRESH of the same session produces the same key and
37
+ * the action completes normally. The one identity that does re-key on a refresh
38
+ * is an OPAQUE token, which falls back to the unreadable-identity epoch; there
39
+ * the cost
40
+ * is only that the automatic clipboard hand-off is skipped — the link was still
41
+ * minted, and the card's own copy control is right there — which is the safe
42
+ * direction of that trade and the same one the cache partition already takes.
43
+ */
44
+ export declare const useAccountBinding: () => (() => StillInitiatingAccount);
45
+ /**
46
+ * Cancel and drop every account-scoped read that does not belong to whoever is
47
+ * speaking to `apiBaseUrl` RIGHT NOW.
48
+ *
49
+ * The key is derived inside the predicate, on every evaluation, and that is
50
+ * load-bearing rather than tidy: this function awaits `cancelQueries`, and the
51
+ * account can change across that await — a component-embed mount does exactly
52
+ * that, moving off the pending partition as soon as the getter answers. A
53
+ * captured key then deletes the NEW account's freshly created read as "another
54
+ * account's", and the surface is left with no query at all: a reports list that
55
+ * silently never loads. Asking again at removal time cannot get that wrong.
56
+ */
57
+ export declare const dropOtherAccountReads: (queryClient: QueryClient, apiBaseUrl: string) => Promise<void>;
58
+ /**
59
+ * Cancel and drop EVERY cached read except the deployment probes.
60
+ *
61
+ * For a logout, not for an account switch. Most of the dock's reads are
62
+ * caller-scoped without being account-KEYED — connectors, sessions, workspace
63
+ * files, saved prompts — and enumerating them here would mean guessing at each
64
+ * feature's invalidation semantics. A logout needs no such guess: nothing
65
+ * cached belongs to nobody, so all of it goes, and whatever the next sign-in
66
+ * needs it re-reads. The probes stay because they describe the deployment.
67
+ */
68
+ export declare const dropEveryCallerScopedRead: (queryClient: QueryClient) => Promise<void>;
69
+ /**
70
+ * Keep the cache partitioned by account for the whole SDK lifetime. Mount ONCE
71
+ * at the root (`SdkProviders`), not in a surface: a logout unmounts every view,
72
+ * so a purge that lived in one of them would never run for the one transition
73
+ * where leaving the rows behind matters most.
74
+ */
75
+ export declare const useAccountCachePartition: () => void;
@@ -24,6 +24,5 @@ export type ArtifactActionApi = {
24
24
  };
25
25
  /** What the report bridge may call: everything except the parent-only stop control. */
26
26
  export type ArtifactBridgeApi = Omit<ArtifactActionApi, "settle">;
27
- export declare const ARTIFACT_API_REQUEST_TIMEOUT_MS = 20000;
28
27
  /** Parent-only authenticated adapter. Generated HTML cannot select the target or auth source. */
29
28
  export declare const createArtifactActionApi: (apiBaseUrl: string, artifactId: string, workspaceExternalId: string | null) => ArtifactActionApi;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The dock's "the host session is gone" error. A leaf module so the request
3
+ * layer (client.ts), the chat transport and the chat route share one prefix
4
+ * without importing each other.
5
+ */
6
+ /**
7
+ * The prefix the dock recognizes as "the host session is gone" — the chat
8
+ * renders `chat.authExpired` with a Retry for any error that starts with it.
9
+ */
10
+ export declare const AUTH_EXPIRED_ERROR_PREFIX = "auth_expired:";
11
+ /**
12
+ * Raised INSTEAD of sending an authenticated request when the registered auth
13
+ * source yields no usable token, even after one forced refresh and a bounded
14
+ * wait. A header-less request can only 401 (`missing_authorization_header`)
15
+ * and, from a long-lived loop, it never stops — prod 2026-10-15 saw 1,246 of
16
+ * them. Failing locally keeps the backend quiet and gives the dock a
17
+ * recognizable signed-out error (the `auth_expired:` prefix).
18
+ */
19
+ export declare class BelongAuthUnavailableError extends Error {
20
+ constructor();
21
+ }
@@ -6,7 +6,9 @@ declare const jwtIdentitySchema: z.ZodObject<{
6
6
  iss: z.ZodOptional<z.ZodString>;
7
7
  }, z.core.$strip>;
8
8
  export type ClientIdentity = z.infer<typeof jwtIdentitySchema>;
9
- /** Notified when the async getter's identity becomes known or is reset. */
9
+ /** Generation of the current effective token, when its claims cannot be read. */
10
+ export declare const readUnreadableIdentityEpoch: () => number;
11
+ /** Notified when the identity behind the SDK's auth source may have changed. */
10
12
  export declare const subscribeClientIdentity: (listener: () => void) => (() => void);
11
13
  export declare const readClientIdentity: () => ClientIdentity | null;
12
14
  export {};