@belonguniverseai/react-sdk 0.6.21 → 0.6.23

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 (226) hide show
  1. package/README.md +69 -0
  2. package/dist/api/account-connectors.d.ts +2 -2
  3. package/dist/api/api-keys.d.ts +22 -0
  4. package/dist/api/client-identity.d.ts +12 -0
  5. package/dist/api/client.d.ts +2453 -92
  6. package/dist/api/goals.d.ts +179 -0
  7. package/dist/api/issue-reports.d.ts +13 -0
  8. package/dist/api/query-keys.d.ts +19 -0
  9. package/dist/api/report-client-error.d.ts +3 -0
  10. package/dist/api/retry-fetch.d.ts +19 -0
  11. package/dist/api/session-end.d.ts +2 -0
  12. package/dist/api/skill-library.d.ts +100 -0
  13. package/dist/api/skills.d.ts +3 -1
  14. package/dist/api/task-schedule-sharing.d.ts +166 -0
  15. package/dist/api/task-schedules.d.ts +23 -1
  16. package/dist/app/BelongDock.d.ts +0 -28
  17. package/dist/app/dock-demo-features.d.ts +13 -0
  18. package/dist/app/dock-demo-transport.d.ts +37 -0
  19. package/dist/app/dock-outlet.d.ts +15 -5
  20. package/dist/app/dock-story-data.d.ts +116 -0
  21. package/dist/browser/allowed-ops.d.ts +18 -0
  22. package/dist/browser/host-mcp.d.ts +31 -0
  23. package/dist/component/THIRD_PARTY_NOTICES.txt +24 -0
  24. package/dist/component/{abnfDiagram-N423BO3Z-DZRUOUZQ.js → abnfDiagram-N423BO3Z-bM1BoI0O.js} +4 -4
  25. package/dist/component/{arc-B4biduil.js → arc-DaSgre52.js} +2 -2
  26. package/dist/component/{architectureDiagram-T3A2C74G-q8voStNN.js → architectureDiagram-T3A2C74G-avMCXzQw.js} +3 -3
  27. package/dist/component/{blockDiagram-VBNYF7ZC-C0TDyTgw.js → blockDiagram-VBNYF7ZC-Cg6EDrdt.js} +4 -4
  28. package/dist/component/{c4Diagram-5PPSVZJV-rxRyd6rh.js → c4Diagram-5PPSVZJV-DhUs6wdK.js} +3 -3
  29. package/dist/component/{channel-CUruDJSx.js → channel-DlmuDpcv.js} +2 -2
  30. package/dist/component/{chunk-2GRJ4B5K-Kff5Fvbi.js → chunk-2GRJ4B5K-Drdf-9Az.js} +2 -2
  31. package/dist/component/{chunk-2Q5K7J3B-BT3ZD31a.js → chunk-2Q5K7J3B-CG6mCJjr.js} +2 -2
  32. package/dist/component/{chunk-5RXB4S5H-CYZ36tQD.js → chunk-5RXB4S5H-DYJwqjr4.js} +5 -5
  33. package/dist/component/{chunk-5VM5RSS4-BweQRk7u.js → chunk-5VM5RSS4-B21XfkBj.js} +2 -2
  34. package/dist/component/{chunk-6Q2QTUOP-DHcoXRhe.js → chunk-6Q2QTUOP-DZkWqf90.js} +2 -2
  35. package/dist/component/{chunk-GF5L2VYU-DtE5ljCc.js → chunk-GF5L2VYU-5hBEo1f5.js} +6 -6
  36. package/dist/component/{chunk-JWPE2WC7-ClHq4gN2.js → chunk-JWPE2WC7-DAn-TcDC.js} +2 -2
  37. package/dist/component/{chunk-KBJHAD2P-BeCfHf5W.js → chunk-KBJHAD2P-CEMDhN2A.js} +2 -2
  38. package/dist/component/{chunk-RYQCIY6F-CuAngwHt.js → chunk-RYQCIY6F-BWL1otLK.js} +2 -2
  39. package/dist/component/{chunk-XXDRQBXY-D9c0CJyR.js → chunk-XXDRQBXY-D0TWnqlD.js} +2 -2
  40. package/dist/component/{classDiagram-JCYQIIEL-DdzIbKj1.js → classDiagram-JCYQIIEL-CjU-7xK0.js} +3 -3
  41. package/dist/component/{classDiagram-v2-OCEON4UE-DdzIbKj1.js → classDiagram-v2-OCEON4UE-CjU-7xK0.js} +3 -3
  42. package/dist/component/{cose-bilkent-JH36ORCC-hME9BYGm.js → cose-bilkent-JH36ORCC-MkPQhZKJ.js} +2 -2
  43. package/dist/component/{cynefinDiagram-MW4NZA55-BiceKBPh.js → cynefinDiagram-MW4NZA55-Wf-Eh_MR.js} +3 -3
  44. package/dist/component/{dagre-VZM6K2ZE-DiPOLAUX.js → dagre-VZM6K2ZE-D1ND11ws.js} +3 -3
  45. package/dist/component/{diagram-7IWD3JNH-BSDWgxjs.js → diagram-7IWD3JNH-ChO63Ikp.js} +4 -4
  46. package/dist/component/{diagram-B4RE2ZJO-BdpGOPaT.js → diagram-B4RE2ZJO-CFVIZBxd.js} +3 -3
  47. package/dist/component/{diagram-LBJQPF4R-B0V6_5ih.js → diagram-LBJQPF4R-BFErKt-H.js} +3 -3
  48. package/dist/component/{diagram-Q27KOJAE-CYDb40TJ.js → diagram-Q27KOJAE-3EA2fDKz.js} +4 -4
  49. package/dist/component/{diagram-UB23O5K3-DgwjRdl5.js → diagram-UB23O5K3-D914yr1r.js} +3 -3
  50. package/dist/component/{ebnfDiagram-BXEA7PRR-D-C7SWec.js → ebnfDiagram-BXEA7PRR-BlRDglJm.js} +4 -4
  51. package/dist/component/{erDiagram-JOGREHBK-DLJCjcXM.js → erDiagram-JOGREHBK-BgHUzm41.js} +5 -5
  52. package/dist/component/{flowDiagram-UKHOOZJN-BZfBucKB.js → flowDiagram-UKHOOZJN-Cf42sXVK.js} +7 -7
  53. package/dist/component/{ganttDiagram-PKOTCBZU-CxTHmusv.js → ganttDiagram-PKOTCBZU-Bqai8Nqw.js} +3 -3
  54. package/dist/component/{gitGraphDiagram-DS77QQ5N-B_dWXxMf.js → gitGraphDiagram-DS77QQ5N-M6yX_E4b.js} +4 -4
  55. package/dist/component/{highlighted-body-OFNGDK62-CQ1ZdhQ-.js → highlighted-body-OFNGDK62-C2rmuXAs.js} +2 -2
  56. package/dist/component/index.js +2 -2
  57. package/dist/component/{infoDiagram-6WML65LV-P4GO-aVw.js → infoDiagram-6WML65LV-Bk4qDfY4.js} +2 -2
  58. package/dist/component/{ishikawaDiagram-WSZJBQD7-BMXMrxKI.js → ishikawaDiagram-WSZJBQD7-CQ0-i0XP.js} +2 -2
  59. package/dist/component/{journeyDiagram-NVQOT4AX-DPdTmxkF.js → journeyDiagram-NVQOT4AX-CK9lX22d.js} +5 -5
  60. package/dist/component/{kanban-definition-27J2QSJJ-sYw64NrE.js → kanban-definition-27J2QSJJ-CrIKfzfe.js} +3 -3
  61. package/dist/component/{linear-DYjDg3gl.js → linear-CzN3Xd3g.js} +2 -2
  62. package/dist/component/{mermaid-GHXKKRXX-DfdCmrs3.js → mermaid-GHXKKRXX-B-ea5OKA.js} +116618 -105206
  63. package/dist/component/{mindmap-definition-FAOFIHXS-UkAbrucA.js → mindmap-definition-FAOFIHXS-DUDsEObz.js} +4 -4
  64. package/dist/component/{pegDiagram-VL7TDLO6-BGab1it6.js → pegDiagram-VL7TDLO6-DFJ-rOLH.js} +4 -4
  65. package/dist/component/{pieDiagram-7S7Q4E2Y-BnY70Pr-.js → pieDiagram-7S7Q4E2Y-OwliOUdN.js} +4 -4
  66. package/dist/component/{quadrantDiagram-CIZ2JOQS-Cv1bjdQb.js → quadrantDiagram-CIZ2JOQS-CLKxzqPi.js} +3 -3
  67. package/dist/component/{railroadDiagram-AXF67PYL-DJhLbGB_.js → railroadDiagram-AXF67PYL-_jBOX7-D.js} +4 -4
  68. package/dist/component/{requirementDiagram-LRYGKXZP-CLW3CgbU.js → requirementDiagram-LRYGKXZP-CxfMaDPH.js} +4 -4
  69. package/dist/component/{sankeyDiagram-W5VNT64P-vnapx0yf.js → sankeyDiagram-W5VNT64P-D-qOUzh7.js} +2 -2
  70. package/dist/component/{sequenceDiagram-SI44F4Z6-I43iQsY0.js → sequenceDiagram-SI44F4Z6-B57h29Ae.js} +4 -4
  71. package/dist/component/{sizeCapture-X5ZJPWSS-D9LGwwwC.js → sizeCapture-X5ZJPWSS-DlIoKfk1.js} +2 -2
  72. package/dist/component/snapdom-DkzCA8S0.js +7061 -0
  73. package/dist/component/{stateDiagram-OKZ733FA-BXejMYGk.js → stateDiagram-OKZ733FA-CNNoDNwB.js} +3 -3
  74. package/dist/component/{stateDiagram-v2-UEYNNEHI-BP05TJSl.js → stateDiagram-v2-UEYNNEHI-xYjW9R-s.js} +3 -3
  75. package/dist/component/{swimlanes-SLNWSIFB-CfmDVYhs.js → swimlanes-SLNWSIFB-Chjr6NCU.js} +4 -4
  76. package/dist/component/{swimlanesDiagram-ULZ7WXOC-DfjQBUfV.js → swimlanesDiagram-ULZ7WXOC-A9mWwnCX.js} +3 -3
  77. package/dist/component/{timeline-definition-Z64GVDOM-C0BwzTs3.js → timeline-definition-Z64GVDOM-DldyCd1l.js} +3 -3
  78. package/dist/component/{vennDiagram-T6HMQDX7-CRf8sGBL.js → vennDiagram-T6HMQDX7-BGfiPWG2.js} +2 -2
  79. package/dist/component/{wardleyDiagram-T6FBY63Y-C2h7TQ4a.js → wardleyDiagram-T6FBY63Y-Bzn9DJ27.js} +3 -3
  80. package/dist/component/{xychartDiagram-ELKLHX3M-CBcAwmdF.js → xychartDiagram-ELKLHX3M-nMaNgT12.js} +3 -3
  81. package/dist/components/ai-elements/message.d.ts +2 -2
  82. package/dist/components/ai-elements/prompt-input.d.ts +3 -1
  83. package/dist/components/ai-elements/task.d.ts +2 -1
  84. package/dist/components/ai-elements/terminal-task.d.ts +2 -1
  85. package/dist/components/connectors/portal-theme.d.ts +2 -8
  86. package/dist/components/embed/AgentChatIcon.d.ts +1 -1
  87. package/dist/components/embed/AgentPhaseIcon.d.ts +16 -14
  88. package/dist/components/embed/ApiKeysSettings.d.ts +1 -0
  89. package/dist/components/embed/BetaBadge.d.ts +8 -10
  90. package/dist/components/embed/ComposerContext.d.ts +9 -0
  91. package/dist/components/embed/EmbedAvatar.d.ts +19 -18
  92. package/dist/components/embed/EmbedComposer.d.ts +13 -1
  93. package/dist/components/embed/EmbedHeader.d.ts +13 -30
  94. package/dist/components/embed/EmbedRail.d.ts +29 -10
  95. package/dist/components/embed/EmbedSessions.d.ts +10 -12
  96. package/dist/components/embed/GoalActions.d.ts +15 -0
  97. package/dist/components/embed/GoalBadge.d.ts +17 -0
  98. package/dist/components/embed/GoalClearDialog.d.ts +6 -0
  99. package/dist/components/embed/GoalClearedLine.d.ts +3 -0
  100. package/dist/components/embed/GoalCompletionCard.d.ts +12 -0
  101. package/dist/components/embed/GoalComposeSheet.d.ts +20 -0
  102. package/dist/components/embed/GoalProposalCard.d.ts +29 -0
  103. package/dist/components/embed/GoalRailView.d.ts +15 -0
  104. package/dist/components/embed/GoalRefusalCard.d.ts +22 -0
  105. package/dist/components/embed/GoalSetCard.d.ts +5 -0
  106. package/dist/components/embed/GoalSnoozeMenu.d.ts +14 -0
  107. package/dist/components/embed/GoalStatusRow.d.ts +6 -0
  108. package/dist/components/embed/GoalTimeline.d.ts +6 -0
  109. package/dist/components/embed/LegalShortDisclaimer.d.ts +6 -8
  110. package/dist/components/embed/MentionInput.d.ts +9 -3
  111. package/dist/components/embed/MobileNavBar.d.ts +16 -10
  112. package/dist/components/embed/OnboardingOverlay.d.ts +3 -1
  113. package/dist/components/embed/OnboardingTour.d.ts +1 -10
  114. package/dist/components/embed/OnboardingWelcome.d.ts +1 -11
  115. package/dist/components/embed/PlanPanel.d.ts +3 -1
  116. package/dist/components/embed/PreviewPanel.d.ts +3 -1
  117. package/dist/components/embed/QuestionCard.d.ts +12 -1
  118. package/dist/components/embed/ScheduleNotices.d.ts +23 -0
  119. package/dist/components/embed/SentAsGoalTag.d.ts +1 -0
  120. package/dist/components/embed/SessionSwitcher.d.ts +12 -0
  121. package/dist/components/embed/SubagentAvatar.d.ts +8 -0
  122. package/dist/components/embed/SubagentsPaneBody.d.ts +3 -0
  123. package/dist/components/embed/WorkspacePane.d.ts +3 -1
  124. package/dist/components/embed/navigation-layout.d.ts +7 -0
  125. package/dist/components/embed/rail-flags.d.ts +6 -0
  126. package/dist/components/embed/use-prompt-invocations.d.ts +6 -1
  127. package/dist/components/feedback/IssueReportController.d.ts +1 -0
  128. package/dist/components/feedback/IssueReportDialog.d.ts +6 -0
  129. package/dist/components/prompts/PromptPreviewDialog.d.ts +10 -0
  130. package/dist/components/prompts/PromptsListSurface.d.ts +4 -4
  131. package/dist/components/scheduled/ConfirmDeleteScheduleDialog.d.ts +1 -0
  132. package/dist/components/scheduled/ScheduleDialog.d.ts +4 -0
  133. package/dist/components/scheduled/ScheduledDetailSurface.d.ts +1 -0
  134. package/dist/components/scheduled/ScheduledHeader.d.ts +3 -0
  135. package/dist/components/scheduled/ScheduledListSurface.d.ts +1 -1
  136. package/dist/components/scheduled/ShareScheduleDialog.d.ts +10 -0
  137. package/dist/components/scheduled/SharedSchedulesSurface.d.ts +1 -0
  138. package/dist/components/scheduled/schedule-dialog-model.d.ts +5 -2
  139. package/dist/components/skills/ConfirmDeleteSkillDialog.d.ts +9 -0
  140. package/dist/components/skills/SkillDiscover.d.ts +1 -0
  141. package/dist/components/skills/SkillLibraryToolSync.d.ts +4 -0
  142. package/dist/components/skills/SkillsListSurface.d.ts +29 -0
  143. package/dist/components/skills/UploadSkillDialog.d.ts +32 -0
  144. package/dist/components/skills/skill-archive-file.d.ts +15 -0
  145. package/dist/components/ui/card.d.ts +1 -1
  146. package/dist/components/ui/dialog.d.ts +1 -1
  147. package/dist/components/ui/dropdown-menu.d.ts +2 -2
  148. package/dist/components/ui/hover-card.d.ts +1 -1
  149. package/dist/components/ui/popover.d.ts +1 -1
  150. package/dist/components/ui/select.d.ts +1 -1
  151. package/dist/components/ui/shadow-dialog-focus.d.ts +5 -0
  152. package/dist/components/ui/tooltip.d.ts +1 -1
  153. package/dist/embed/brand-marks.d.ts +3 -3
  154. package/dist/embed/client-error-log.d.ts +72 -0
  155. package/dist/embed/copy.d.ts +8 -2
  156. package/dist/embed/dock-open-request.d.ts +32 -0
  157. package/dist/embed/dock-state.d.ts +1 -1
  158. package/dist/embed/goal-actions-model.d.ts +9 -0
  159. package/dist/embed/goal-cap-notice.d.ts +36 -0
  160. package/dist/embed/goal-deep-link.d.ts +24 -0
  161. package/dist/embed/goal-edit-command.d.ts +25 -0
  162. package/dist/embed/goal-journal.d.ts +53 -0
  163. package/dist/embed/goal-live-status.d.ts +2 -0
  164. package/dist/embed/goal-plain-units.d.ts +35 -0
  165. package/dist/embed/goal-progress.d.ts +15 -0
  166. package/dist/embed/goal-proposal-dismissal.d.ts +11 -0
  167. package/dist/embed/goal-resume-time.d.ts +22 -0
  168. package/dist/embed/goal-row-model.d.ts +27 -0
  169. package/dist/embed/goal-runway.d.ts +5 -0
  170. package/dist/embed/goal-schedule-handoff.d.ts +12 -0
  171. package/dist/embed/goal-status-label.d.ts +3 -0
  172. package/dist/embed/goal-time-usage.d.ts +19 -0
  173. package/dist/embed/issue-report-bus.d.ts +14 -0
  174. package/dist/embed/issue-report-open.d.ts +8 -0
  175. package/dist/embed/issue-report.d.ts +41 -0
  176. package/dist/embed/legal-disclaimer.d.ts +5 -1
  177. package/dist/embed/library-composer.d.ts +24 -0
  178. package/dist/embed/library-navigation.d.ts +6 -0
  179. package/dist/embed/portal-container.d.ts +17 -16
  180. package/dist/embed/presets.d.ts +2 -2
  181. package/dist/embed/schedule-invitation.d.ts +5 -0
  182. package/dist/embed/screen-capture.d.ts +74 -0
  183. package/dist/embed/slash-commands.d.ts +24 -0
  184. package/dist/embed/task-schedule-command.d.ts +7 -0
  185. package/dist/embed/use-session-draft.d.ts +11 -0
  186. package/dist/i18n/messages/en.d.ts +599 -4
  187. package/dist/i18n/messages/surfaces/feedback.d.ts +84 -0
  188. package/dist/i18n/messages/surfaces/files.d.ts +4 -0
  189. package/dist/i18n/messages/surfaces/header.d.ts +20 -0
  190. package/dist/i18n/messages/surfaces/navigation.d.ts +149 -0
  191. package/dist/i18n/messages/surfaces/prompts.d.ts +56 -5
  192. package/dist/i18n/messages/surfaces/scheduled.d.ts +233 -1
  193. package/dist/i18n/messages/surfaces/sessions.d.ts +16 -0
  194. package/dist/i18n/messages/surfaces/settings.d.ts +229 -0
  195. package/dist/i18n/messages/surfaces/skills.d.ts +299 -0
  196. package/dist/i18n/messages/surfaces/stream.d.ts +232 -0
  197. package/dist/i18n/messages/surfaces/usage.d.ts +56 -0
  198. package/dist/i18n/messages/surfaces/workspace.d.ts +20 -0
  199. package/dist/public-api.d.ts +1 -1
  200. package/dist/routes/chat/part-renderer-extra-props.d.ts +43 -0
  201. package/dist/routes/chat/use-goal-receipt.d.ts +37 -0
  202. package/dist/routes/chat/use-host-draft-request.d.ts +2 -0
  203. package/dist/routes/chat/use-session-goal.d.ts +227 -0
  204. package/dist/routes/chat.d.ts +11 -1
  205. package/dist/routes/goal.d.ts +1 -0
  206. package/dist/routes/library.d.ts +4 -0
  207. package/dist/routes/skills.d.ts +2 -0
  208. package/dist/stream/activity-items.d.ts +25 -0
  209. package/dist/stream/ai-sdk-part-renderers.d.ts +67 -32
  210. package/dist/stream/belong-chat-transport.d.ts +157 -2
  211. package/dist/stream/belong-data-parts.d.ts +56 -6
  212. package/dist/stream/goal-store.d.ts +43 -0
  213. package/dist/stream/message-metadata.d.ts +1 -0
  214. package/dist/stream/message-parts.d.ts +42 -0
  215. package/dist/stream/select-goal-set-part-id.d.ts +2 -0
  216. package/dist/stream/select-latest-goal.d.ts +13 -0
  217. package/dist/stream/subagent-controls-store.d.ts +20 -0
  218. package/dist/stream/subagent-lanes-model.d.ts +175 -0
  219. package/dist/stream/subagent-lanes.d.ts +90 -0
  220. package/dist/stream/use-publish-subagent-controls.d.ts +11 -0
  221. package/dist/stream/workspace-focus-store.d.ts +7 -1
  222. package/dist/test/render.d.ts +18 -1
  223. package/dist/test/subagent-fixtures.d.ts +24 -0
  224. package/dist/types/public.d.ts +54 -1
  225. package/package.json +1 -1
  226. package/dist/components/ai-elements/reasoning.d.ts +0 -26
@@ -0,0 +1,90 @@
1
+ import { ReactNode } from 'react';
2
+ import { TFunction } from 'i18next';
3
+ import { ActivityItem, ToolActivityItem } from './activity-items.ts';
4
+ import { SubagentData } from './belong-data-parts.ts';
5
+ import { SubagentControlsState } from './subagent-controls-store.ts';
6
+ import { SubagentLane, SubagentLaneStatus, SubagentMessageIndex, SubagentWaveCounts, SubagentWaveLabel } from './subagent-lanes-model.ts';
7
+ type RenderToolItem = (item: ToolActivityItem) => ReactNode;
8
+ /**
9
+ * §3.6 — the wave label, worded. An unlabelled wave says how many are running
10
+ * only while any lane still is: "3 running" beside counts of "3 done" would be
11
+ * a false state claim on the surface §42 exists to keep honest. Once none runs,
12
+ * it reads the progress the collapsed line already words. BY NAME: that key is
13
+ * "{{done}} of {{count}} done" — a swapped pass renders "3 of 2 done".
14
+ */
15
+ export declare const waveLabelText: (t: TFunction, label: SubagentWaveLabel) => string;
16
+ /** §3.6 — non-zero counts, in order: done, running, waiting, need a look, stopped. */
17
+ export declare const waveCountsText: (t: TFunction, counts: SubagentWaveCounts) => string;
18
+ /**
19
+ * The elapsed-time LEAF (§3.4). It owns the only interval, so a tick re-renders
20
+ * this span and nothing else, and it runs only while the group is live and the
21
+ * lane is running — the group's content is force-mounted while collapsed, so an
22
+ * unconditional interval would tick for every group in the transcript. This
23
+ * leaf is the wall-clock adapter; the model takes `nowMs` (§25).
24
+ */
25
+ export declare const SubagentElapsed: ({ data, status, live, }: {
26
+ readonly data: SubagentData;
27
+ readonly status: SubagentLaneStatus;
28
+ readonly live: boolean;
29
+ }) => import("react").JSX.Element | null;
30
+ /** Stable role identity, with motion only while the lane is actually live. */
31
+ export declare const SubagentGlyph: ({ status, live, name, }: {
32
+ readonly status: SubagentLaneStatus;
33
+ readonly live: boolean;
34
+ readonly name?: string;
35
+ }) => import("react").JSX.Element;
36
+ /**
37
+ * §3.3 subline: orange for the ended-badly outcomes, muted otherwise — including
38
+ * §4a's "Waiting for you" on a running lane whose approval is pending (waiting
39
+ * on a person is not a failure).
40
+ */
41
+ export declare const SubagentOutcomeLine: ({ status, waiting, }: {
42
+ readonly status: SubagentLaneStatus;
43
+ readonly waiting: boolean;
44
+ }) => import("react").JSX.Element | null;
45
+ /** §3.5 — the subagent's own written report, as PLAIN text (never HTML). */
46
+ export declare const SubagentReport: ({ summary }: {
47
+ readonly summary: string;
48
+ }) => import("react").JSX.Element;
49
+ /**
50
+ * §3.5 — the Stop handler for a lane, or null when Stop must not render: the
51
+ * lane is stoppable (own loop only) and still running or queued, its group is
52
+ * live, and the chat has an active run.
53
+ */
54
+ export declare const stopHandlerFor: (controls: SubagentControlsState | null, live: boolean, lane: SubagentLane) => SubagentControlsState["stop"] | null;
55
+ /**
56
+ * Stop ONE subagent. Disables after the click and shows nothing optimistic:
57
+ * the lane changes only when its `subagent_finished` part arrives (§3.5).
58
+ * `outline`, never `destructive` (§42) — a stop is an ordinary thing to ask
59
+ * for, and it is best-effort besides.
60
+ */
61
+ export declare const SubagentStopButton: ({ subagentId, onStop, }: {
62
+ readonly subagentId: string;
63
+ readonly onStop: SubagentControlsState["stop"];
64
+ }) => import("react").JSX.Element;
65
+ /**
66
+ * Decision 9 — Stop all confirms INLINE, in two steps: the first click turns
67
+ * the button into "Stop N?" for 4 s; a second click inside that window stops.
68
+ * No modal. Once it stops, it stays disabled until the lanes finish and the
69
+ * button unmounts (nothing optimistic).
70
+ */
71
+ export declare const SubagentStopAll: ({ count, onStopAll, }: {
72
+ readonly count: number;
73
+ readonly onStopAll: () => Promise<void>;
74
+ }) => import("react").JSX.Element;
75
+ /** A report worth a toggle: present and not blank. */
76
+ export declare const reportOf: (data: SubagentData) => string | null;
77
+ /**
78
+ * The expanded group's body: main-loop items in place, lanes with their nested
79
+ * steps, and waves. Keys are the model's (`item-<i>`, `lane-<id>`,
80
+ * `wave-<id>`), never a render index, so a re-sort never remounts a lane.
81
+ * `index` is the group's MESSAGE (§4a): a lane nests its calls, and a wave its
82
+ * lanes, from every group of it. Absent, the items are their own message.
83
+ */
84
+ export declare const SubagentLanes: ({ items, live, renderToolItem, index, }: {
85
+ readonly items: readonly ActivityItem[];
86
+ readonly live: boolean;
87
+ readonly renderToolItem: RenderToolItem;
88
+ readonly index?: SubagentMessageIndex | undefined;
89
+ }) => import("react").JSX.Element;
90
+ export {};
@@ -0,0 +1,11 @@
1
+ import { BelongChatTransport } from './belong-chat-transport.ts';
2
+ import { BelongUIMessage } from './belong-data-parts.ts';
3
+ import { PublishedSubagentWave } from './subagent-controls-store.ts';
4
+ /**
5
+ * Every wave in the conversation, in message order — each message grouped and
6
+ * indexed exactly as `MessageParts` draws it (§4a, deviation 16: the same
7
+ * `indexableMessageParts` filter, so the pane's lanes and the chat's lanes are
8
+ * the same lanes down to their step keys), `waiting` included.
9
+ */
10
+ export declare const collectSubagentWaves: (messages: readonly BelongUIMessage[], runActive: boolean) => readonly PublishedSubagentWave[];
11
+ export declare const usePublishSubagentControls: (transport: Pick<BelongChatTransport, "stopSubagent">, messages: readonly BelongUIMessage[]) => void;
@@ -1,6 +1,11 @@
1
1
  import { PreviewTarget } from './preview-panel-store.ts';
2
2
  export type WorkspaceFocusTarget = PreviewTarget | {
3
3
  readonly kind: "plan";
4
+ }
5
+ /** Spec 2026-09-16 §3.5 — one wave's full subagent list ("Show all" in fullscreen). */
6
+ | {
7
+ readonly kind: "subagents";
8
+ readonly waveId: string;
4
9
  };
5
10
  export type WorkspaceFocusState = {
6
11
  readonly target: WorkspaceFocusTarget | null;
@@ -9,7 +14,8 @@ export type WorkspaceFocusState = {
9
14
  /** The agent wants this shown, but the user holds the pane. */
10
15
  readonly pending: WorkspaceFocusTarget | null;
11
16
  };
12
- /** Same thing on screen? Artifacts by id, workspace files by pinned scope + path, plans by kind. */
17
+ /** Same thing on screen? Artifacts by id, workspace files by pinned scope + path,
18
+ * plans by kind, subagent views by wave. */
13
19
  export declare const isSameFocusTarget: (a: WorkspaceFocusTarget, b: WorkspaceFocusTarget) => boolean;
14
20
  export declare const peekWorkspaceFocus: () => WorkspaceFocusState;
15
21
  export declare const subscribeWorkspaceFocus: (listener: () => void) => (() => void);
@@ -16,8 +16,25 @@ export declare function setValue(el: HTMLInputElement | HTMLTextAreaElement, val
16
16
  * it holds or `timeoutMs` elapses. The repo's render harness serves React's
17
17
  * prod build (no `React.act`), so async state — react-query settling, a $post
18
18
  * resolving — is observed by polling rather than awaiting `act`.
19
+ *
20
+ * `predicate` keeps its ORIGINAL truthy contract — a falsy return (`false`,
21
+ * `null`, `0`, `""`, a `querySelector` miss, …) means "not yet, keep
22
+ * polling" — with exactly two additions, both needed for the
23
+ * `waitFor(() => expect(x).toBe(y))` idiom: `undefined` counts as
24
+ * "satisfied" (a PASSING `expect(...)` call returns nothing, so treating
25
+ * `undefined` as falsy would spin every such predicate to the timeout), and
26
+ * a THROW (a FAILING `expect(...)` call) means "not yet, keep polling"
27
+ * rather than an immediate hard stop. Without the second part, the very
28
+ * FIRST call to a throwing predicate always races an async continuation
29
+ * that hasn't had a microtask turn yet, so it would fail on that first race
30
+ * almost every time, no matter how the component under test is implemented
31
+ * — see IssueReportDialog.test.tsx's failed-send case for a concrete
32
+ * instance. Every existing boolean/element-returning predicate in this repo
33
+ * is unaffected: `true`/a found element still short-circuits immediately,
34
+ * `false`/`null` still retries. On timeout the LAST assertion error (if any)
35
+ * is re-thrown, which is more actionable than the generic message below.
19
36
  */
20
- export declare function waitFor(predicate: () => boolean, { timeoutMs, stepMs }?: {
37
+ export declare function waitFor(predicate: () => unknown, { timeoutMs, stepMs }?: {
21
38
  timeoutMs?: number;
22
39
  stepMs?: number;
23
40
  }): Promise<void>;
@@ -0,0 +1,24 @@
1
+ import { ActivityItem, ToolActivityItem } from '../stream/activity-items.ts';
2
+ import { SubagentLane } from '../stream/subagent-lanes-model.ts';
3
+ import { ApprovalState, BelongUIMessage, SubagentData, ToolCallData } from '../stream/belong-data-parts.ts';
4
+ /** A subagent activity item; `data` overrides the running defaults. */
5
+ export declare const subagentItem: (subagentId: string, data?: Partial<SubagentData>) => ActivityItem;
6
+ /**
7
+ * A tool activity item, completed unless `state` says otherwise; `subagentId`
8
+ * nests it under that lane.
9
+ */
10
+ export declare const toolItem: (toolName: string, subagentId?: string, state?: ToolCallData["state"]) => ToolActivityItem;
11
+ /** An approval card part; `subagentId` undefined = the main agent raised it. */
12
+ export declare const approvalPart: (subagentId: string | undefined, state?: ApprovalState) => BelongUIMessage["parts"][number];
13
+ /**
14
+ * A `data-subagent` message part; `data` overrides the running defaults. Lives
15
+ * here (not in one suite) because the whole-message suite and the controls
16
+ * suite must build the SAME part — they assert the two index it identically.
17
+ */
18
+ export declare const subagentPart: (id: string, data?: Partial<SubagentData>) => BelongUIMessage["parts"][number];
19
+ /**
20
+ * A resolved lane with no steps and no pending approval — what the pure model
21
+ * and the fullscreen pane both start from. `status` is derived, never passed,
22
+ * so a fixture can never claim a state its data does not imply.
23
+ */
24
+ export declare const subagentLane: (subagentId: string, data?: Partial<SubagentData>) => SubagentLane;
@@ -218,6 +218,53 @@ export type BelongInitInput = {
218
218
  */
219
219
  readonly scopeUrlParam?: string;
220
220
  };
221
+ /**
222
+ * Host-bridged MCP (opt-in). Same-origin paths of MCP endpoints the host app
223
+ * lets the agent call THROUGH THIS PAGE, with the signed-in viewer's own
224
+ * session (cookies), e.g. `{ allowedPaths: ["/mcp"] }`. The agent reaches
225
+ * them only via tools its tenant published with `transport: "host"`; a path
226
+ * not listed here is refused in the page, whatever the tenant publishes.
227
+ * Omitted = no host MCP at all.
228
+ */
229
+ readonly hostMcp?: BelongHostMcpConfig;
230
+ /**
231
+ * Which browser-control ops the agent may run on THIS page (opt-in
232
+ * restriction). Omitted = every op (reading, clicking, typing, navigating,
233
+ * running JS, host MCP), exactly as before. A host that only bridges MCP
234
+ * should pass `{ allowedOps: ["mcp_call"] }`, so the agent cannot drive or
235
+ * script the page with the viewer's session. `allowedOps: []` = none. A
236
+ * value that is present but invalid allows NOTHING (with a console warning).
237
+ * Restated on every `init`: omitting it on a re-init lifts the restriction.
238
+ */
239
+ readonly browserControl?: BelongBrowserControlConfig;
240
+ };
241
+ export type BelongHostMcpConfig = {
242
+ /**
243
+ * Root-relative paths (`/mcp`, `/api/mcp?x=1`) on this page's origin, each at
244
+ * most 512 URL path/query characters (no whitespace, `\`, `#` or `..`
245
+ * segment). At most 8.
246
+ */
247
+ readonly allowedPaths: readonly string[];
248
+ };
249
+ /** A browser-control op the dock can run on the host page. */
250
+ export type BelongBrowserOpName = "snapshot" | "read" | "click" | "type" | "select" | "press" | "navigate" | "eval" | "mcp_call";
251
+ export type BelongBrowserControlConfig = {
252
+ /** The ops this page runs; every other op is refused in the page. */
253
+ readonly allowedOps: readonly BelongBrowserOpName[];
254
+ };
255
+ /** `window.belong.open(options)` — what the host asks the dock to show. */
256
+ export type BelongOpenOptions = {
257
+ /**
258
+ * The size to open at. `fullscreen` covers the viewport on desktop (mobile
259
+ * resolves it to the open sheet, as the rail toggle does). The user can
260
+ * still leave it. Omitted = the dock's current size, expanded if collapsed.
261
+ */
262
+ readonly size?: "expanded" | "fullscreen";
263
+ /**
264
+ * Prefill (never send) the composer — only when it is empty — and focus it.
265
+ * At most 4,000 characters.
266
+ */
267
+ readonly draft?: string;
221
268
  };
222
269
  export type RouteHandlerResult = {
223
270
  readonly ok: true;
@@ -272,7 +319,13 @@ export type BelongGlobal = {
272
319
  readonly setPageContext: (label: string | null) => void;
273
320
  readonly setTheme: (theme: PartialBelongTheme) => void;
274
321
  readonly applyPreset: (name: PresetName) => void;
275
- readonly open: () => void;
322
+ /**
323
+ * Show the dock: switch to the chat view at the requested size (and
324
+ * optionally prefill the composer). Safe to call BEFORE `init` resolves — a
325
+ * request made before the dock mounts is applied at mount, with no flash of
326
+ * the docked size.
327
+ */
328
+ readonly open: (options?: BelongOpenOptions) => void;
276
329
  readonly close: () => void;
277
330
  readonly registerRouteHandler: (routeName: string, handler: RouteHandler) => void;
278
331
  readonly registerUiAction: <I, O>(name: string, handler: UiActionHandler<I, O>) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@belonguniverseai/react-sdk",
3
- "version": "0.6.21",
3
+ "version": "0.6.23",
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",
@@ -1,26 +0,0 @@
1
- import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../ui/collapsible';
2
- import { ComponentProps, ReactNode } from 'react';
3
- interface ReasoningContextValue {
4
- isStreaming: boolean;
5
- isOpen: boolean;
6
- setIsOpen: (open: boolean) => void;
7
- duration: number | undefined;
8
- }
9
- export declare const useReasoning: () => ReasoningContextValue;
10
- export type ReasoningProps = ComponentProps<typeof Collapsible> & {
11
- isStreaming?: boolean;
12
- open?: boolean;
13
- defaultOpen?: boolean;
14
- onOpenChange?: (open: boolean) => void;
15
- duration?: number;
16
- };
17
- export declare const Reasoning: import('react').MemoExoticComponent<({ className, isStreaming, open, defaultOpen, onOpenChange, duration: durationProp, children, ...props }: ReasoningProps) => import("react").JSX.Element>;
18
- export type ReasoningTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
19
- getThinkingMessage?: (isStreaming: boolean, duration?: number) => ReactNode;
20
- };
21
- export declare const ReasoningTrigger: import('react').MemoExoticComponent<({ className, children, getThinkingMessage, ...props }: ReasoningTriggerProps) => import("react").JSX.Element>;
22
- export type ReasoningContentProps = ComponentProps<typeof CollapsibleContent> & {
23
- children: string;
24
- };
25
- export declare const ReasoningContent: import('react').MemoExoticComponent<({ className, children, ...props }: ReasoningContentProps) => import("react").JSX.Element>;
26
- export {};