@belonguniverseai/react-sdk 0.4.1 → 0.4.3

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 (82) hide show
  1. package/dist/api/agent-grants.d.ts +33 -0
  2. package/dist/api/client.d.ts +154 -10
  3. package/dist/api/retry-fetch.d.ts +3 -1
  4. package/dist/api/task-schedules.d.ts +14 -0
  5. package/dist/browser/agent-link.d.ts +18 -0
  6. package/dist/browser/agent-touch.d.ts +105 -0
  7. package/dist/browser/spa-navigate.d.ts +24 -1
  8. package/dist/component/{arc-Du1-HUt0.js → arc-ByLm_58u.js} +2 -2
  9. package/dist/component/{architectureDiagram-3BPJPVTR-NTFoFNN-.js → architectureDiagram-3BPJPVTR-DcYT4v9Q.js} +3 -3
  10. package/dist/component/{blockDiagram-GPEHLZMM-9LBL4EUV.js → blockDiagram-GPEHLZMM-CHk-YSun.js} +4 -4
  11. package/dist/component/{c4Diagram-AAUBKEIU-C1enIoRg.js → c4Diagram-AAUBKEIU-CEV2fwh-.js} +3 -3
  12. package/dist/component/{channel-CNnOkAN_.js → channel-D67v09ii.js} +2 -2
  13. package/dist/component/{chunk-2J33WTMH-X2Iy3mMD.js → chunk-2J33WTMH-Bsl2GBCp.js} +2 -2
  14. package/dist/component/{chunk-4BX2VUAB-BLlcE09Q.js → chunk-4BX2VUAB-BKmdmdRY.js} +2 -2
  15. package/dist/component/{chunk-55IACEB6-23v_td5T.js → chunk-55IACEB6-DnliqOsL.js} +2 -2
  16. package/dist/component/{chunk-727SXJPM-BC2kAa1t.js → chunk-727SXJPM-O0BgSnK_.js} +6 -6
  17. package/dist/component/{chunk-AQP2D5EJ-CsRFVdwF.js → chunk-AQP2D5EJ-CwBA3VVY.js} +4 -4
  18. package/dist/component/{chunk-FMBD7UC4-CWrggihb.js → chunk-FMBD7UC4-CG5DaKp9.js} +2 -2
  19. package/dist/component/{chunk-ND2GUHAM-Bj78QMsn.js → chunk-ND2GUHAM-COsoTCa0.js} +2 -2
  20. package/dist/component/{chunk-QZHKN3VN-CS_FAlLS.js → chunk-QZHKN3VN-9FjIin4_.js} +2 -2
  21. package/dist/component/{classDiagram-4FO5ZUOK-ci84KOU1.js → classDiagram-4FO5ZUOK-DyQO35S9.js} +3 -3
  22. package/dist/component/{classDiagram-v2-Q7XG4LA2-ci84KOU1.js → classDiagram-v2-Q7XG4LA2-DyQO35S9.js} +3 -3
  23. package/dist/component/{cose-bilkent-S5V4N54A-QLIj0pt2.js → cose-bilkent-S5V4N54A-BTN6Bz9E.js} +2 -2
  24. package/dist/component/{dagre-BM42HDAG-D32wP-VH.js → dagre-BM42HDAG-COU3yvtF.js} +2 -2
  25. package/dist/component/{diagram-2AECGRRQ-Dn47q_hT.js → diagram-2AECGRRQ-r4LO_uyu.js} +3 -3
  26. package/dist/component/{diagram-5GNKFQAL-Df7a_ICg.js → diagram-5GNKFQAL-CraSe8h_.js} +4 -4
  27. package/dist/component/{diagram-KO2AKTUF-CNcoKufc.js → diagram-KO2AKTUF-Dh-L6_aX.js} +3 -3
  28. package/dist/component/{diagram-LMA3HP47-Dq8j6XNs.js → diagram-LMA3HP47-Bv8QREaH.js} +3 -3
  29. package/dist/component/{diagram-OG6HWLK6-CZ1WglbZ.js → diagram-OG6HWLK6-Jf-6CDV4.js} +4 -4
  30. package/dist/component/{erDiagram-TEJ5UH35-CDlHARAu.js → erDiagram-TEJ5UH35-CN8X2drH.js} +5 -5
  31. package/dist/component/{flowDiagram-I6XJVG4X-Cw1mKy8X.js → flowDiagram-I6XJVG4X-CloAsK8k.js} +7 -7
  32. package/dist/component/{ganttDiagram-6RSMTGT7-B3FUForj.js → ganttDiagram-6RSMTGT7-DAlRM4jt.js} +3 -3
  33. package/dist/component/{gitGraphDiagram-PVQCEYII-BgHuuQ27.js → gitGraphDiagram-PVQCEYII-BPVdEwuf.js} +4 -4
  34. package/dist/component/{highlighted-body-OFNGDK62-BTv_Fxf3.js → highlighted-body-OFNGDK62-BEd7ynwt.js} +2 -2
  35. package/dist/component/index.js +2 -2
  36. package/dist/component/{infoDiagram-5YYISTIA-DE9i_OcK.js → infoDiagram-5YYISTIA-CyJi6c7l.js} +2 -2
  37. package/dist/component/{ishikawaDiagram-YF4QCWOH-BDe88Hz2.js → ishikawaDiagram-YF4QCWOH-CNKCQHOP.js} +2 -2
  38. package/dist/component/{journeyDiagram-JHISSGLW-D3t45UC1.js → journeyDiagram-JHISSGLW-DFN0WY5F.js} +5 -5
  39. package/dist/component/{kanban-definition-UN3LZRKU-DfFJIuhU.js → kanban-definition-UN3LZRKU-BT6YDPZA.js} +3 -3
  40. package/dist/component/{linear-AXxuun7R.js → linear-BcyQd0z0.js} +2 -2
  41. package/dist/component/{mermaid-GHXKKRXX-D7NVqIBP.js → mermaid-GHXKKRXX-DiPCfS1n.js} +28526 -27802
  42. package/dist/component/{mindmap-definition-RKZ34NQL-cTac4kYU.js → mindmap-definition-RKZ34NQL-BND7KvId.js} +4 -4
  43. package/dist/component/{pieDiagram-4H26LBE5-B1SubLQb.js → pieDiagram-4H26LBE5-CvDdRFnN.js} +4 -4
  44. package/dist/component/{quadrantDiagram-W4KKPZXB-CzyBW8Cr.js → quadrantDiagram-W4KKPZXB-DMHCLEev.js} +3 -3
  45. package/dist/component/{requirementDiagram-4Y6WPE33-DgS33NcX.js → requirementDiagram-4Y6WPE33-BomcVKb4.js} +4 -4
  46. package/dist/component/{sankeyDiagram-5OEKKPKP-Cp4o_akq.js → sankeyDiagram-5OEKKPKP-D4rmtFCn.js} +2 -2
  47. package/dist/component/{sequenceDiagram-3UESZ5HK-2gf91-2b.js → sequenceDiagram-3UESZ5HK-C0iEDbuE.js} +4 -4
  48. package/dist/component/{stateDiagram-AJRCARHV-BByZezJw.js → stateDiagram-AJRCARHV-x0PonbWT.js} +3 -3
  49. package/dist/component/{stateDiagram-v2-BHNVJYJU-B-IObShO.js → stateDiagram-v2-BHNVJYJU-6Lq1LlSV.js} +3 -3
  50. package/dist/component/{timeline-definition-PNZ67QCA-D_2NG1sj.js → timeline-definition-PNZ67QCA-CIx8lwoQ.js} +3 -3
  51. package/dist/component/{vennDiagram-CIIHVFJN-BjrQUaEs.js → vennDiagram-CIIHVFJN-B27Ya-3D.js} +2 -2
  52. package/dist/component/{wardleyDiagram-YWT4CUSO-DYcvfAeQ.js → wardleyDiagram-YWT4CUSO-efmvFwPj.js} +3 -3
  53. package/dist/component/{xychartDiagram-2RQKCTM6-CtLaJFtQ.js → xychartDiagram-2RQKCTM6-DNJmorKa.js} +3 -3
  54. package/dist/components/ai-elements/dock-link.d.ts +27 -0
  55. package/dist/components/ai-elements/link-safety-modal.d.ts +46 -1
  56. package/dist/components/ai-elements/message.d.ts +29 -2
  57. package/dist/components/ai-elements/prompt-input.d.ts +1 -1
  58. package/dist/components/embed/file-preview-kind.d.ts +6 -1
  59. package/dist/components/embed/parse-csv.d.ts +22 -5
  60. package/dist/components/embed/rail-flags.d.ts +21 -12
  61. package/dist/components/embed/use-preview-bytes.d.ts +12 -0
  62. package/dist/components/embed/use-workspace-preview-file.d.ts +34 -0
  63. package/dist/components/scheduled/ScheduledDetailSurface.d.ts +2 -2
  64. package/dist/components/ui/input-group.d.ts +7 -4
  65. package/dist/embed/slash-commands.d.ts +41 -12
  66. package/dist/embed/use-workspace-file-download.d.ts +10 -2
  67. package/dist/embed/voice/line-dispatch.d.ts +51 -16
  68. package/dist/embed/voice/line-run-reader.d.ts +32 -54
  69. package/dist/embed/voice/line-slots.d.ts +6 -2
  70. package/dist/embed/voice-call-lines.d.ts +38 -11
  71. package/dist/i18n/messages/en.d.ts +16 -5
  72. package/dist/i18n/messages/surfaces/aiElements.d.ts +3 -0
  73. package/dist/i18n/messages/surfaces/scheduled.d.ts +9 -0
  74. package/dist/i18n/messages/surfaces/stream.d.ts +31 -16
  75. package/dist/stream/chat-upload.d.ts +29 -3
  76. package/dist/stream/preview-panel-store.d.ts +8 -0
  77. package/dist/stream/run-line-progress.d.ts +62 -0
  78. package/dist/stream/sandbox-output.d.ts +31 -3
  79. package/dist/stream/stream-state-store.d.ts +56 -0
  80. package/dist/stream/tool-error-copy.d.ts +4 -0
  81. package/dist/test/fetch-stubs.d.ts +16 -0
  82. package/package.json +1 -1
@@ -92,6 +92,62 @@ export declare const clearStreamState: (workspaceId?: string | null) => void;
92
92
  * message overwrites the cursor via {@link writeStreamState}.
93
93
  */
94
94
  export declare const readResumableStreamState: (workspaceId?: string | null) => PersistedStreamState | null;
95
+ /**
96
+ * Was a run still in flight for `sessionId` when this page last looked — the
97
+ * ONE query behind "a reload must not lie about a backgrounded agent"
98
+ * (BEL-90 / §41). The parked-cursor map already carries exactly this truth
99
+ * for every session this tab drove: it lives in `sessionStorage`, so it
100
+ * survives a genuine reload and is correctly absent in a brand-new tab, which
101
+ * owns no reader for the run.
102
+ *
103
+ * Gated on the same {@link RESUME_MAX_AGE_MS} window {@link setActiveSessionId}
104
+ * and {@link readResumableStreamState} use, so a run abandoned by a worker
105
+ * restart ages out into `null` instead of pinning a badge at "working"
106
+ * forever. Non-throwing and null-returning like its neighbours.
107
+ *
108
+ * That gate is only honest while SOMETHING re-stamps the cursor for a live but
109
+ * silent run — see {@link touchParkedRun}. The transport does it from its
110
+ * `: keepalive` handler; a reader that adopts a run WITHOUT a transport (the
111
+ * boot re-attach in `line-dispatch.ts`) must do it too, or a genuinely
112
+ * streaming run reads "idle" on the next reload.
113
+ *
114
+ * NOTE the boundary this does NOT cover: a line's DURABLE slot runId
115
+ * (`line-slots.ts`) is written by voice dispatch and is not consulted here,
116
+ * so a slot runId left behind by a reader torn down mid-flight
117
+ * (`abortAllLineReaders`) bypasses this freshness gate entirely — that path is
118
+ * `resetForCallStart`'s to clean up, not this one's.
119
+ */
120
+ export declare const peekLiveParkedRun: (sessionId: string) => string | null;
121
+ /**
122
+ * Prove `runId` is still alive: re-stamp `sessionId`'s parked cursor's
123
+ * `updatedAt` so the {@link RESUME_MAX_AGE_MS} gate in
124
+ * {@link peekLiveParkedRun} keeps returning it (BEL-90 / §41).
125
+ *
126
+ * This is the SAME job the transport's `onKeepalive` → `#persist()` does, made
127
+ * callable by the one reader that has no transport behind it: after a reload
128
+ * `line-dispatch.ts`'s progress reader is the only listener on a backgrounded
129
+ * typed run's stream, so without this a run doing 2 minutes of silent tool work
130
+ * ages out of the cursor map and the next reload paints its chip "idle" while
131
+ * it is still streaming.
132
+ *
133
+ * Deliberately touches ONLY the parked map, never the selected pointer: the
134
+ * caller attaches exclusively to sessions that are NOT on screen, and moving
135
+ * the selection would hijack the user's chat. No-op unless the cursor still
136
+ * names `runId` — a cursor that moved on belongs to a newer run, and the
137
+ * caller has no claim on it.
138
+ */
139
+ export declare const touchParkedRun: (sessionId: string, runId: string) => void;
140
+ /**
141
+ * `runId` reached a terminal state — drop `sessionId`'s parked cursor so
142
+ * nothing rehydrates the line as "working" for a run that is already done
143
+ * (BEL-90 / §41, the mirror of {@link touchParkedRun}).
144
+ *
145
+ * The transport gets this for free from `onStreamTerminal` → `#persist()` with
146
+ * a null `#runId`; the progress reader has no transport, so it calls this. Same
147
+ * ownership guard: a cursor naming a DIFFERENT run is someone else's live run
148
+ * and is left alone.
149
+ */
150
+ export declare const releaseParkedRun: (sessionId: string, runId: string) => void;
95
151
  /**
96
152
  * Select one Session (sessions menu switch / new). A Session with a live cursor
97
153
  * parked by this tab restores that cursor so the next ChatRoute mount resumes
@@ -0,0 +1,4 @@
1
+ import { TFunction } from 'i18next';
2
+ import { ToolCallData } from './belong-data-parts.ts';
3
+ /** Localised copy for a tool error, or the server's message when unmapped. */
4
+ export declare const toolErrorText: (t: TFunction, error: ToolCallData["error"]) => string | undefined;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Shared fetch-stub bodies for the preview surfaces.
3
+ *
4
+ * `usePreviewBytes` reads a text preview as BYTES (`res.arrayBuffer()`) rather
5
+ * than `res.text()`, so it can fall back to windows-1252 when a file isn't
6
+ * valid UTF-8 — a stub that only implements `text()` therefore no longer models
7
+ * a Response the hook can consume. `textResponseStub` implements both, so a
8
+ * test can stay agnostic about which one the code under test reaches for.
9
+ */
10
+ export type TextResponseStub = {
11
+ readonly ok: true;
12
+ readonly status: 200;
13
+ readonly text: () => Promise<string>;
14
+ readonly arrayBuffer: () => Promise<ArrayBuffer>;
15
+ };
16
+ export declare const textResponseStub: (text: string) => TextResponseStub;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@belonguniverseai/react-sdk",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Belong — embeddable React AI assistant dock. Mount <BelongWidget> in your app tree with getToken dependency-injection auth.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",