@belonguniverseai/react-sdk 0.6.33 → 0.6.35

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 (120) hide show
  1. package/dist/api/account-connectors.d.ts +1 -1
  2. package/dist/api/agent-computer.d.ts +9 -0
  3. package/dist/api/client.d.ts +948 -91
  4. package/dist/api/computer.d.ts +60 -0
  5. package/dist/api/goals.d.ts +4 -4
  6. package/dist/api/guide.d.ts +11 -4
  7. package/dist/api/proactive.d.ts +47 -0
  8. package/dist/api/query-keys.d.ts +22 -1
  9. package/dist/api/quota-refusal.d.ts +1 -1
  10. package/dist/api/task-schedule-folders.d.ts +4 -4
  11. package/dist/api/task-schedule-projects.d.ts +7 -7
  12. package/dist/api/task-schedules.d.ts +125 -18
  13. package/dist/app/dock-story-data.d.ts +5 -5
  14. package/dist/component/{abnfDiagram-N423BO3Z-CK4wvzwz.js → abnfDiagram-N423BO3Z-CRZoFiVH.js} +4 -4
  15. package/dist/component/{architectureDiagram-T3A2C74G-DoljsqqO.js → architectureDiagram-T3A2C74G-CaRtqw4X.js} +6 -6
  16. package/dist/component/{blockDiagram-VBNYF7ZC-Ie7SErpH.js → blockDiagram-VBNYF7ZC-BK04msnb.js} +8 -8
  17. package/dist/component/{c4Diagram-5PPSVZJV-rfEof5mj.js → c4Diagram-5PPSVZJV-BMDcb-rm.js} +4 -4
  18. package/dist/component/{channel-C5ABP6lE.js → channel-Da7DEnT8.js} +2 -2
  19. package/dist/component/{chunk-2GRJ4B5K-CWOCv67u.js → chunk-2GRJ4B5K-CxwwCtK7.js} +2 -2
  20. package/dist/component/{chunk-3NCLNEKW-BJYANBvv.js → chunk-3NCLNEKW-C6R8qHlR.js} +2 -2
  21. package/dist/component/{chunk-4I5QYGJK-C29OfER5.js → chunk-4I5QYGJK-Ccf8L2Bk.js} +2 -2
  22. package/dist/component/{chunk-5RXB4S5H-D__NH4Op.js → chunk-5RXB4S5H-V2z-LyAY.js} +6 -6
  23. package/dist/component/{chunk-6Q2QTUOP-BgSQgII8.js → chunk-6Q2QTUOP-C6GL9-4r.js} +3 -3
  24. package/dist/component/{chunk-7Z6QIM7H-vNexNF_V.js → chunk-7Z6QIM7H-BV6R4sWE.js} +8 -8
  25. package/dist/component/{chunk-GF5L2VYU-D3vxqomE.js → chunk-GF5L2VYU-DAD1p6ak.js} +6 -6
  26. package/dist/component/{chunk-I66GZJ75-Dkw1ISGd.js → chunk-I66GZJ75-DEykrnbu.js} +2 -2
  27. package/dist/component/{chunk-J7OUQ5F2-dC67pJWg.js → chunk-J7OUQ5F2-CEWcOukY.js} +7 -7
  28. package/dist/component/{chunk-JQJVKLGR-Djj9TdhH.js → chunk-JQJVKLGR-DCAX80x3.js} +8 -8
  29. package/dist/component/{chunk-KBJHAD2P-dwIA6Vmi.js → chunk-KBJHAD2P-Bk8hJC_U.js} +2 -2
  30. package/dist/component/{chunk-NSK5VX7P-thQxjtNK.js → chunk-NSK5VX7P-D-saWvpt.js} +2 -2
  31. package/dist/component/{chunk-QR6OTTB3-OMd-rgNj.js → chunk-QR6OTTB3-CMv_Vw9A.js} +7 -7
  32. package/dist/component/{chunk-UBXNYLIW-D26S6zO6.js → chunk-UBXNYLIW-BfXPFCA1.js} +3 -3
  33. package/dist/component/{chunk-W5SLKNZC-DLV7M8by.js → chunk-W5SLKNZC-BL-VPYuH.js} +2 -2
  34. package/dist/component/{chunk-WRU74C26-13bvIAgD.js → chunk-WRU74C26-BXxIvhYq.js} +4 -4
  35. package/dist/component/{classDiagram-JCYQIIEL-BFQ72AZA.js → classDiagram-JCYQIIEL-CRKRQjr4.js} +13 -13
  36. package/dist/component/{classDiagram-v2-OCEON4UE-UFfArXpP.js → classDiagram-v2-OCEON4UE-ltwXlVlU.js} +13 -13
  37. package/dist/component/{component-Bhs6PFPY.js → component-BNq6d1iV.js} +23787 -20816
  38. package/dist/component/{cynefinDiagram-MW4NZA55-Bgfw8c41.js → cynefinDiagram-MW4NZA55-Bju0bDR1.js} +4 -4
  39. package/dist/component/{dagre-VZM6K2ZE-CQoUcF3S.js → dagre-VZM6K2ZE-fMS2g5Lt.js} +9 -9
  40. package/dist/component/{diagram-7IWD3JNH-C8-mvAEv.js → diagram-7IWD3JNH-CoDJAyv-.js} +5 -5
  41. package/dist/component/{diagram-B4RE2ZJO-BATqCIx3.js → diagram-B4RE2ZJO-nioVFGn5.js} +3 -3
  42. package/dist/component/{diagram-LBJQPF4R-DwRMRXWz.js → diagram-LBJQPF4R-BuBX2Dz0.js} +4 -4
  43. package/dist/component/{diagram-Q27KOJAE-D6gO0LTm.js → diagram-Q27KOJAE-D6amwUDE.js} +6 -6
  44. package/dist/component/{diagram-UB23O5K3-4nOrWHql.js → diagram-UB23O5K3-BfBhBu7Y.js} +4 -4
  45. package/dist/component/{ebnfDiagram-BXEA7PRR-DCO-Nj3k.js → ebnfDiagram-BXEA7PRR-Cy3CaiTX.js} +4 -4
  46. package/dist/component/{erDiagram-JOGREHBK-hWtImhPN.js → erDiagram-JOGREHBK-BUomkKWY.js} +12 -12
  47. package/dist/component/flowDiagram-UKHOOZJN-C0aiK5kF.js +19 -0
  48. package/dist/component/{ganttDiagram-PKOTCBZU-BE8Mqoej.js → ganttDiagram-PKOTCBZU-BWWeGylo.js} +3 -3
  49. package/dist/component/{gitGraphDiagram-DS77QQ5N-DURS7rAN.js → gitGraphDiagram-DS77QQ5N-BFNi8KrJ.js} +3 -3
  50. package/dist/component/index.js +2 -2
  51. package/dist/component/{infoDiagram-6WML65LV-BqBxR6YB.js → infoDiagram-6WML65LV-Ba4nVdwJ.js} +3 -3
  52. package/dist/component/{ishikawaDiagram-WSZJBQD7-CnYZd1Dq.js → ishikawaDiagram-WSZJBQD7-JBSR3acP.js} +4 -4
  53. package/dist/component/{journeyDiagram-NVQOT4AX-Cgkpx4Qx.js → journeyDiagram-NVQOT4AX-BAGUQhvd.js} +3 -3
  54. package/dist/component/{kanban-definition-27J2QSJJ-CJSdhT0i.js → kanban-definition-27J2QSJJ-CIBw8XVT.js} +9 -9
  55. package/dist/component/{line-BBEHlpsV.js → line-BPXxX2mb.js} +2 -2
  56. package/dist/component/{mindmap-definition-FAOFIHXS-DgHouLA-.js → mindmap-definition-FAOFIHXS-ZwmeO9Ju.js} +11 -11
  57. package/dist/component/{pegDiagram-VL7TDLO6-B_iGQ6sI.js → pegDiagram-VL7TDLO6-g6cHkKXH.js} +4 -4
  58. package/dist/component/{pieDiagram-7S7Q4E2Y-g7GxM0JA.js → pieDiagram-7S7Q4E2Y-6if4UZeA.js} +4 -4
  59. package/dist/component/{quadrantDiagram-CIZ2JOQS-Bp7z4raq.js → quadrantDiagram-CIZ2JOQS-DW9Wi1_3.js} +2 -2
  60. package/dist/component/{railroadDiagram-AXF67PYL-CYx3PP5o.js → railroadDiagram-AXF67PYL-DRKsvNWu.js} +4 -4
  61. package/dist/component/{requirementDiagram-LRYGKXZP-BJNRJceo.js → requirementDiagram-LRYGKXZP-CKtakT6g.js} +11 -11
  62. package/dist/component/{sankeyDiagram-W5VNT64P-Cf0tVHbW.js → sankeyDiagram-W5VNT64P-B-oejkos.js} +2 -2
  63. package/dist/component/{sequenceDiagram-SI44F4Z6-BsAsKMRH.js → sequenceDiagram-SI44F4Z6-3RmdhrrK.js} +4 -4
  64. package/dist/component/{stateDiagram-OKZ733FA-Bpk0vtTK.js → stateDiagram-OKZ733FA-ChwQeLFK.js} +14 -14
  65. package/dist/component/{stateDiagram-v2-UEYNNEHI-CJFoUvD2.js → stateDiagram-v2-UEYNNEHI-Cu0mGIbX.js} +13 -13
  66. package/dist/component/{swimlanes-SLNWSIFB-Be5A0lwq.js → swimlanes-SLNWSIFB-B1f2ZxW_.js} +9 -9
  67. package/dist/component/{swimlanesDiagram-ULZ7WXOC-J8VNaPhM.js → swimlanesDiagram-ULZ7WXOC-CspwK4RG.js} +13 -13
  68. package/dist/component/{timeline-definition-Z64GVDOM-CU9PEkPY.js → timeline-definition-Z64GVDOM-Bg9gKcBJ.js} +4 -4
  69. package/dist/component/{vennDiagram-T6HMQDX7-Cno78tFK.js → vennDiagram-T6HMQDX7-BS7jr5XD.js} +4 -4
  70. package/dist/component/{wardleyDiagram-T6FBY63Y-BEb1Rn5J.js → wardleyDiagram-T6FBY63Y-DVm3XZBO.js} +4 -4
  71. package/dist/component/{xychartDiagram-ELKLHX3M-BwjMczCl.js → xychartDiagram-ELKLHX3M-Cg8qYbc9.js} +7 -7
  72. package/dist/components/ai-elements/chat-link.d.ts +15 -0
  73. package/dist/components/connectors/ConnectorBrandLogo.d.ts +4 -0
  74. package/dist/components/embed/ComputerSettings.d.ts +7 -0
  75. package/dist/components/embed/EmbedConversation.d.ts +4 -1
  76. package/dist/components/embed/EmbedRail.d.ts +8 -2
  77. package/dist/components/embed/EmbedSessions.d.ts +22 -2
  78. package/dist/components/embed/MobileNavBar.d.ts +4 -2
  79. package/dist/components/embed/ProactiveChecksSetting.d.ts +8 -0
  80. package/dist/components/embed/use-settings-owner-key.d.ts +15 -0
  81. package/dist/components/pinned/AgentComputerSheet.d.ts +5 -0
  82. package/dist/components/pinned/AgentMessageNote.d.ts +12 -0
  83. package/dist/components/pinned/PinnedChatHeader.d.ts +15 -0
  84. package/dist/components/pinned/SentByAgentTag.d.ts +1 -0
  85. package/dist/components/pinned/agent-computer-open-state.d.ts +9 -0
  86. package/dist/components/pinned/character/AgentCharacter.d.ts +8 -0
  87. package/dist/components/pinned/character/agent-character-art.d.ts +12 -0
  88. package/dist/components/pinned/personal-agent.d.ts +43 -0
  89. package/dist/components/pinned/profile/AgentProfileSheet.d.ts +14 -0
  90. package/dist/components/pinned/profile/ProfileAboutTab.d.ts +4 -0
  91. package/dist/components/pinned/profile/ProfileActivityTab.d.ts +9 -0
  92. package/dist/components/pinned/profile/ProfileSourcesTab.d.ts +8 -0
  93. package/dist/components/pinned/profile/profile-activity.d.ts +52 -0
  94. package/dist/components/pinned/use-agent-name.d.ts +2 -0
  95. package/dist/components/scheduled/ScheduleFolderDialogs.d.ts +14 -0
  96. package/dist/components/scheduled/ScheduleFolderTree.d.ts +2 -1
  97. package/dist/components/scheduled/ScheduledListSurface.d.ts +7 -0
  98. package/dist/embed/goal-cap-notice.d.ts +0 -9
  99. package/dist/embed/pinned-chat.d.ts +52 -0
  100. package/dist/embed/voice/line-run-reader.d.ts +1 -1
  101. package/dist/embed/voice-call.d.ts +6 -0
  102. package/dist/i18n/messages/en.d.ts +168 -9
  103. package/dist/i18n/messages/surfaces/embedMisc.d.ts +4 -0
  104. package/dist/i18n/messages/surfaces/pinned.d.ts +328 -0
  105. package/dist/i18n/messages/surfaces/scheduled.d.ts +113 -5
  106. package/dist/i18n/messages/surfaces/sessions.d.ts +4 -0
  107. package/dist/i18n/messages/surfaces/settings.d.ts +152 -0
  108. package/dist/i18n/messages/surfaces/stream.d.ts +52 -4
  109. package/dist/i18n/messages/surfaces/vault.d.ts +1 -1
  110. package/dist/routes/chat/history-merge.d.ts +4 -1
  111. package/dist/routes/chat/session-api.d.ts +1 -1
  112. package/dist/routes/chat/use-next-step-suggestion.d.ts +4 -0
  113. package/dist/stream/belong-chat-transport.d.ts +19 -22
  114. package/dist/stream/message-metadata.d.ts +57 -0
  115. package/dist/stream/pause-notice-copy.d.ts +3 -0
  116. package/dist/stream/reconnect-backoff.d.ts +39 -0
  117. package/dist/stream/run-error-copy.d.ts +25 -0
  118. package/dist/stream/stream-notice.d.ts +9 -0
  119. package/package.json +1 -1
  120. package/dist/component/flowDiagram-UKHOOZJN-8qLgX2Wv.js +0 -19
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { RECONNECT_MAX_CONSECUTIVE_FAILURES } from './reconnect-backoff.ts';
2
3
  import { ChatTransport, UIMessageChunk } from 'ai';
3
4
  import { FirstResponseObservation, FirstResponseSample } from '../infrastructure/telemetry/first-response-timing.ts';
4
5
  import { AUTH_EXPIRED_ERROR_PREFIX } from '../api/auth-errors.ts';
@@ -22,8 +23,8 @@ export declare const choiceAnswerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
22
23
  kind: z.ZodLiteral<"skipped">;
23
24
  }, z.core.$strip>], "kind">;
24
25
  export declare const choiceStateSchema: z.ZodEnum<{
25
- cancelled: "cancelled";
26
26
  pending: "pending";
27
+ cancelled: "cancelled";
27
28
  dismissed: "dismissed";
28
29
  answered: "answered";
29
30
  detached: "detached";
@@ -64,9 +65,9 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
64
65
  title: z.ZodString;
65
66
  kind: z.ZodString;
66
67
  status: z.ZodOptional<z.ZodEnum<{
67
- failed: "failed";
68
- completed: "completed";
69
68
  pending: "pending";
69
+ completed: "completed";
70
+ failed: "failed";
70
71
  in_progress: "in_progress";
71
72
  }>>;
72
73
  }, z.core.$strip>>;
@@ -91,8 +92,8 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
91
92
  label: z.ZodString;
92
93
  value: z.ZodString;
93
94
  emphasis: z.ZodOptional<z.ZodEnum<{
94
- normal: "normal";
95
95
  warning: "warning";
96
+ normal: "normal";
96
97
  }>>;
97
98
  }, z.core.$strip>>;
98
99
  body: z.ZodNullable<z.ZodObject<{
@@ -109,8 +110,8 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
109
110
  data: z.ZodObject<{
110
111
  toolName: z.ZodString;
111
112
  state: z.ZodEnum<{
112
- failed: "failed";
113
113
  completed: "completed";
114
+ failed: "failed";
114
115
  started: "started";
115
116
  }>;
116
117
  input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -133,8 +134,8 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
133
134
  name: z.ZodString;
134
135
  description: z.ZodString;
135
136
  state: z.ZodEnum<{
136
- failed: "failed";
137
137
  running: "running";
138
+ failed: "failed";
138
139
  finished: "finished";
139
140
  }>;
140
141
  stepsUsed: z.ZodOptional<z.ZodNumber>;
@@ -163,8 +164,8 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
163
164
  data: z.ZodObject<{
164
165
  state: z.ZodEnum<{
165
166
  output: "output";
166
- failed: "failed";
167
167
  completed: "completed";
168
+ failed: "failed";
168
169
  started: "started";
169
170
  }>;
170
171
  stream: z.ZodOptional<z.ZodEnum<{
@@ -184,8 +185,8 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
184
185
  uiActionRequestId: z.ZodString;
185
186
  actionName: z.ZodString;
186
187
  state: z.ZodEnum<{
187
- failed: "failed";
188
188
  completed: "completed";
189
+ failed: "failed";
189
190
  requested: "requested";
190
191
  }>;
191
192
  args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -229,8 +230,8 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
229
230
  id: z.ZodString;
230
231
  data: z.ZodObject<{
231
232
  status: z.ZodEnum<{
232
- failed: "failed";
233
233
  completed: "completed";
234
+ failed: "failed";
234
235
  cancelled: "cancelled";
235
236
  continuing: "continuing";
236
237
  throttled: "throttled";
@@ -272,8 +273,8 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
272
273
  data: z.ZodObject<{
273
274
  questionRequestId: z.ZodString;
274
275
  state: z.ZodEnum<{
275
- cancelled: "cancelled";
276
276
  pending: "pending";
277
+ cancelled: "cancelled";
277
278
  dismissed: "dismissed";
278
279
  answered: "answered";
279
280
  detached: "detached";
@@ -307,10 +308,10 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
307
308
  data: z.ZodObject<{
308
309
  goalId: z.ZodString;
309
310
  status: z.ZodEnum<{
310
- waiting_for_approval: "waiting_for_approval";
311
311
  active: "active";
312
312
  paused: "paused";
313
313
  blocked: "blocked";
314
+ waiting_for_approval: "waiting_for_approval";
314
315
  clarifying: "clarifying";
315
316
  completion_claimed: "completion_claimed";
316
317
  deferred: "deferred";
@@ -352,10 +353,10 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
352
353
  kind: z.ZodString;
353
354
  actor: z.ZodString;
354
355
  toStatus: z.ZodNullable<z.ZodEnum<{
355
- waiting_for_approval: "waiting_for_approval";
356
356
  active: "active";
357
357
  paused: "paused";
358
358
  blocked: "blocked";
359
+ waiting_for_approval: "waiting_for_approval";
359
360
  clarifying: "clarifying";
360
361
  completion_claimed: "completion_claimed";
361
362
  deferred: "deferred";
@@ -393,8 +394,8 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
393
394
  data: z.ZodObject<{
394
395
  kind: z.ZodLiteral<"quota_exceeded">;
395
396
  reason: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
396
- exhausted: "exhausted";
397
397
  blocked: "blocked";
398
+ exhausted: "exhausted";
398
399
  }>>>;
399
400
  productName: z.ZodCatch<z.ZodOptional<z.ZodString>>;
400
401
  resetsAt: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -426,13 +427,8 @@ export declare class PostMessageError extends Error {
426
427
  readonly body: string;
427
428
  constructor(status: number, body: string);
428
429
  }
429
- /** First reconnect delay — identical to the historic fixed delay, so the
430
- * BEL-48 mid-run clean-EOF reconnect regains the stream just as fast. */
431
- export declare const RECONNECT_BASE_DELAY_MS = 1000;
432
- /** Exponential backoff ceiling. */
433
- export declare const RECONNECT_MAX_DELAY_MS = 30000;
434
- /** Consecutive connection attempts that deliver no event before we give up. */
435
- export declare const RECONNECT_MAX_CONSECUTIVE_FAILURES = 10;
430
+ /** The reconnect policy lives with every other reader of a run's stream. */
431
+ export { RECONNECT_MAX_CONSECUTIVE_FAILURES };
436
432
  /**
437
433
  * Liveness watchdog: the server emits a `: keepalive` comment every 15s
438
434
  * (run-stream.routes.ts), so a healthy connection delivers a chunk at least
@@ -473,9 +469,10 @@ export type BelongChatTransportOptions = {
473
469
  readonly apiBaseUrl: string;
474
470
  /**
475
471
  * Reconnect delay seam (§25 — do not hide time). Tests inject an instant
476
- * recorder; production uses a real setTimeout sleep.
472
+ * recorder; production uses a real setTimeout sleep that `signal` (a stop
473
+ * or a supersede) ends at once.
477
474
  */
478
- readonly sleepMs?: (ms: number) => Promise<void>;
475
+ readonly sleepMs?: (ms: number, signal: AbortSignal) => Promise<void>;
479
476
  /**
480
477
  * Stall-watchdog window override (§25). Tests shrink it to tens of ms;
481
478
  * production uses `STALL_TIMEOUT_MS`.
@@ -1,4 +1,33 @@
1
1
  import { z } from 'zod';
2
+ /** Mirrors belong-cloud's `ProactiveTurnNote` (`proactive-turn-note.ts`). */
3
+ declare const proactiveTurnNoteSchema: z.ZodObject<{
4
+ tag: z.ZodEnum<{
5
+ needs_you: "needs_you";
6
+ heads_up: "heads_up";
7
+ done_on_my_own: "done_on_my_own";
8
+ }>;
9
+ source: z.ZodNullable<z.ZodObject<{
10
+ origin: z.ZodDiscriminatedUnion<[z.ZodObject<{
11
+ kind: z.ZodLiteral<"scheduled_task">;
12
+ }, z.core.$strip>, z.ZodObject<{
13
+ kind: z.ZodLiteral<"simetrik">;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ kind: z.ZodLiteral<"app">;
16
+ app: z.ZodEnum<{
17
+ gmail: "gmail";
18
+ slack: "slack";
19
+ calendar: "calendar";
20
+ }>;
21
+ place: z.ZodNullable<z.ZodString>;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ kind: z.ZodLiteral<"connector">;
24
+ name: z.ZodString;
25
+ }, z.core.$strip>], "kind">;
26
+ moreCount: z.ZodNumber;
27
+ }, z.core.$strip>>;
28
+ }, z.core.$strip>;
29
+ export type ProactiveTurnNote = z.infer<typeof proactiveTurnNoteSchema>;
30
+ export type ProactiveTurnSource = NonNullable<ProactiveTurnNote["source"]>;
2
31
  export declare const belongMessageMetadataSchema: z.ZodObject<{
3
32
  taskId: z.ZodOptional<z.ZodString>;
4
33
  feedback: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -12,5 +41,33 @@ export declare const belongMessageMetadataSchema: z.ZodObject<{
12
41
  skill: z.ZodOptional<z.ZodString>;
13
42
  fromHistory: z.ZodOptional<z.ZodBoolean>;
14
43
  clientMessageId: z.ZodOptional<z.ZodString>;
44
+ proactive: z.ZodCatch<z.ZodOptional<z.ZodObject<{
45
+ tag: z.ZodEnum<{
46
+ needs_you: "needs_you";
47
+ heads_up: "heads_up";
48
+ done_on_my_own: "done_on_my_own";
49
+ }>;
50
+ source: z.ZodNullable<z.ZodObject<{
51
+ origin: z.ZodDiscriminatedUnion<[z.ZodObject<{
52
+ kind: z.ZodLiteral<"scheduled_task">;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ kind: z.ZodLiteral<"simetrik">;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ kind: z.ZodLiteral<"app">;
57
+ app: z.ZodEnum<{
58
+ gmail: "gmail";
59
+ slack: "slack";
60
+ calendar: "calendar";
61
+ }>;
62
+ place: z.ZodNullable<z.ZodString>;
63
+ }, z.core.$strip>, z.ZodObject<{
64
+ kind: z.ZodLiteral<"connector">;
65
+ name: z.ZodString;
66
+ }, z.core.$strip>], "kind">;
67
+ moreCount: z.ZodNumber;
68
+ }, z.core.$strip>>;
69
+ }, z.core.$strip>>>;
70
+ sentBy: z.ZodOptional<z.ZodLiteral<"personal_agent">>;
15
71
  }, z.core.$strip>;
16
72
  export type BelongMessageMetadata = z.infer<typeof belongMessageMetadataSchema>;
73
+ export {};
@@ -0,0 +1,3 @@
1
+ import { TFunction } from 'i18next';
2
+ /** The localized line for a paused task's termination reason: its own, or the generic one. */
3
+ export declare const pauseNoticeText: (t: TFunction, terminationReason: string | undefined) => string;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * How a reader of `GET /v1/runs/:runId/stream` waits between reconnects, and
3
+ * when it gives up (plan 007 §C4). One policy for every reader of a run's
4
+ * stream, so none of them can hammer the server harder than the chat does.
5
+ */
6
+ /** Consecutive connection attempts that deliver no event before we give up. */
7
+ export declare const RECONNECT_MAX_CONSECUTIVE_FAILURES = 10;
8
+ /**
9
+ * Whether an event's `id:` moves a reader past its cursor. Only that counts as
10
+ * progress for the failure streak: an id-less part, or an id the reader has
11
+ * already seen (a server repeating itself), proves nothing, so a stream that
12
+ * only ever gives those still runs out of attempts. Ids that are not
13
+ * `<ms>-<seq>` count as progress when they differ from the cursor.
14
+ */
15
+ export declare const advancesCursor: (eventId: string, cursor: string | null) => boolean;
16
+ /**
17
+ * The wait before the next attempt, after `consecutiveFailuresCount` attempts
18
+ * in a row delivered no event: 1 s → 2 s → 4 s … capped at 30 s. A reader also
19
+ * passes its streak of attempts that ended on the run stream's failure notice
20
+ * (#1063), whichever is larger, so a server that brings one new event and then
21
+ * breaks, on every attempt, is polled at up to 30 s rather than every second.
22
+ */
23
+ export declare const reconnectDelayMs: (consecutiveFailuresCount: number) => number;
24
+ /**
25
+ * The notice streak after an attempt that ended on the run stream's failure
26
+ * notice. An attempt that brought many new events first was a healthy stream
27
+ * that broke once, so its break starts the streak over at 1 (a 1 s wait), and
28
+ * the sixth such break in a long run never freezes the answer for 30 s. A
29
+ * trickle of fewer new events keeps climbing toward the 30 s ceiling.
30
+ */
31
+ export declare const nextNoticeStreakCount: (noticeStreakCount: number, attemptNewEventsCount: number) => number;
32
+ /**
33
+ * The default wait before a reconnect: `ms`, or less. An abort of `signal`
34
+ * ends it at once and clears its timer and listener, so a reader torn down
35
+ * mid-backoff holds no timer for up to 30 s (review 1063.6 S3). It resolves
36
+ * either way: the caller re-checks its own abort state after the wait, so a
37
+ * live reader waits exactly as long as before.
38
+ */
39
+ export declare const abortableSleepMs: (ms: number, signal: AbortSignal) => Promise<void>;
@@ -0,0 +1,25 @@
1
+ import { TFunction } from 'i18next';
2
+ import { BelongUIMessage } from './belong-data-parts.ts';
3
+ /** The localized line for a failed run's code: its own, or the generic one. */
4
+ export declare const runErrorText: (t: TFunction, code: string | undefined) => string;
5
+ /** The `error` chunk text for a failed run: its code behind the marker, never its message. */
6
+ export declare const runErrorErrorText: (code: string | undefined) => string;
7
+ /** The localized line for a failed run's error text, or `null` for any other error. */
8
+ export declare const runErrorTextFromError: (t: TFunction, errorMessage: string) => string | null;
9
+ /** What a live call offers after a failure: the same as the dock's line says. */
10
+ type RunErrorNextStep = "try_again" | "new_conversation";
11
+ /**
12
+ * The call's next step for a failed run's error text. A line that says to
13
+ * start a new chat (a conversation grown too long, a blocked answer) must not
14
+ * be followed by an offer to try again; everything else may try again.
15
+ */
16
+ export declare const runErrorNextStepFromError: (errorMessage: string) => RunErrorNextStep;
17
+ /**
18
+ * Whether a turn already shows its failure: its LAST status part is a failed
19
+ * run that is neither paused nor resuming. Then the turn's own notice (the
20
+ * same live and from history, §41) says it, and the chat's error row must
21
+ * not repeat it. A turn still showing "picking it back up" whose resume
22
+ * never came does not, so the row says it there.
23
+ */
24
+ export declare const turnShowsRunFailure: (message: BelongUIMessage) => boolean;
25
+ export {};
@@ -0,0 +1,9 @@
1
+ import { TFunction } from 'i18next';
2
+ /** Whether a wire `data-status` part is the run stream's failure notice. */
3
+ export declare const isStreamNoticePart: (part: {
4
+ readonly id?: string | undefined;
5
+ }) => boolean;
6
+ /** The give-up `error` chunk text for a stream notice: its code behind the marker, never its message. */
7
+ export declare const streamNoticeErrorText: (code: string | undefined) => string;
8
+ /** The localized line for a stream notice's error text, or `null` for any other error. */
9
+ export declare const streamNoticeText: (t: TFunction, errorMessage: string) => string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@belonguniverseai/react-sdk",
3
- "version": "0.6.33",
3
+ "version": "0.6.35",
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,19 +0,0 @@
1
- globalThis.process = globalThis.process || { env: {} }, globalThis.global = globalThis.global || globalThis;
2
- import "./chunk-Y2CYZVJY-CiUSrfaV.js";
3
- import "./src-CKo8cHWB.js";
4
- import "./chunk-I66GZJ75-Dkw1ISGd.js";
5
- import "./chunk-NSK5VX7P-thQxjtNK.js";
6
- import "./chunk-ZIRB5QZD-DmX0SXRC.js";
7
- import "./chunk-W5SLKNZC-DLV7M8by.js";
8
- import "./chunk-UBXNYLIW-D26S6zO6.js";
9
- import "./chunk-4I5QYGJK-C29OfER5.js";
10
- import "./chunk-WRU74C26-13bvIAgD.js";
11
- import "./chunk-QR6OTTB3-OMd-rgNj.js";
12
- import "./chunk-7BUUIJ7U-DJJ8ycYS.js";
13
- import "./chunk-7Z6QIM7H-vNexNF_V.js";
14
- import "./chunk-J7OUQ5F2-dC67pJWg.js";
15
- import "./chunk-5VM5RSS4-BuOiQaWo.js";
16
- import "./chunk-2GRJ4B5K-CWOCv67u.js";
17
- import "./chunk-XXDRQBXY-BP7ld7ls.js";
18
- import "./chunk-KBJHAD2P-dwIA6Vmi.js";
19
- export { n as diagram } from "./chunk-JQJVKLGR-Djj9TdhH.js";