@belonguniverseai/react-sdk 0.6.32 → 0.6.34

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 (129) hide show
  1. package/dist/api/account-connectors.d.ts +2 -2
  2. package/dist/api/client.d.ts +1722 -125
  3. package/dist/api/computer.d.ts +60 -0
  4. package/dist/api/goals.d.ts +4 -4
  5. package/dist/api/proactive.d.ts +36 -0
  6. package/dist/api/query-keys.d.ts +3 -0
  7. package/dist/api/quota-refusal.d.ts +49 -0
  8. package/dist/api/secret-paste.d.ts +5 -0
  9. package/dist/api/suggestions.d.ts +18 -0
  10. package/dist/api/task-schedule-folders.d.ts +3 -3
  11. package/dist/api/task-schedule-projects.d.ts +5 -5
  12. package/dist/api/task-schedule-sharing.d.ts +13 -1
  13. package/dist/api/task-schedules.d.ts +60 -8
  14. package/dist/api/vault.d.ts +49 -0
  15. package/dist/app/dock-story-data.d.ts +7 -1
  16. package/dist/component/{abnfDiagram-N423BO3Z-Cs6vuzym.js → abnfDiagram-N423BO3Z-K52-wOfg.js} +4 -4
  17. package/dist/component/{architectureDiagram-T3A2C74G-BdBpK2d_.js → architectureDiagram-T3A2C74G-B64SrMLF.js} +6 -6
  18. package/dist/component/{blockDiagram-VBNYF7ZC-Cf6dsn1j.js → blockDiagram-VBNYF7ZC-B7Di5R1s.js} +8 -8
  19. package/dist/component/{c4Diagram-5PPSVZJV-Cxt2hfnn.js → c4Diagram-5PPSVZJV-ClDtA2m4.js} +4 -4
  20. package/dist/component/{channel-COtJQ6CP.js → channel-C6_lLEWW.js} +2 -2
  21. package/dist/component/{chunk-2GRJ4B5K-C14K2lKj.js → chunk-2GRJ4B5K-B07moQal.js} +2 -2
  22. package/dist/component/{chunk-3NCLNEKW-oHacP_OI.js → chunk-3NCLNEKW-TUF1Wrf6.js} +2 -2
  23. package/dist/component/{chunk-4I5QYGJK-CGOVqmKQ.js → chunk-4I5QYGJK-qY-_sgVE.js} +2 -2
  24. package/dist/component/{chunk-5RXB4S5H-CMJnmUzX.js → chunk-5RXB4S5H-BU0H_zl3.js} +6 -6
  25. package/dist/component/{chunk-6Q2QTUOP-B5ACmZa2.js → chunk-6Q2QTUOP-nIHNEMhm.js} +3 -3
  26. package/dist/component/{chunk-7Z6QIM7H-CSfSb_Xc.js → chunk-7Z6QIM7H-D7mHGFzt.js} +8 -8
  27. package/dist/component/{chunk-GF5L2VYU-xi_oDTd2.js → chunk-GF5L2VYU-uM1RliIa.js} +6 -6
  28. package/dist/component/{chunk-I66GZJ75-DB1sFGc-.js → chunk-I66GZJ75-oDyTlx3R.js} +2 -2
  29. package/dist/component/{chunk-J7OUQ5F2-DB9d7Gt_.js → chunk-J7OUQ5F2-c7iD4Gpa.js} +7 -7
  30. package/dist/component/{chunk-JQJVKLGR-De7zUJDv.js → chunk-JQJVKLGR-JeqFPv2A.js} +8 -8
  31. package/dist/component/{chunk-KBJHAD2P-CVoxmRa8.js → chunk-KBJHAD2P-DjQd-FIs.js} +2 -2
  32. package/dist/component/{chunk-NSK5VX7P-ur_ZGcVX.js → chunk-NSK5VX7P-Bq0sOWgd.js} +2 -2
  33. package/dist/component/{chunk-QR6OTTB3-Bl3Z_jKC.js → chunk-QR6OTTB3-DctDLVWm.js} +7 -7
  34. package/dist/component/{chunk-UBXNYLIW-CDKeQUnO.js → chunk-UBXNYLIW-Ka1R3omP.js} +3 -3
  35. package/dist/component/{chunk-W5SLKNZC-Dq8uD14N.js → chunk-W5SLKNZC-CI_OqVnD.js} +2 -2
  36. package/dist/component/{chunk-WRU74C26-BwQb4DnE.js → chunk-WRU74C26-BMkh1mHN.js} +4 -4
  37. package/dist/component/{classDiagram-JCYQIIEL-yl7JabGO.js → classDiagram-JCYQIIEL-C1E0BQye.js} +13 -13
  38. package/dist/component/{classDiagram-v2-OCEON4UE-ozBAEvyC.js → classDiagram-v2-OCEON4UE-hQKKIbDF.js} +13 -13
  39. package/dist/component/{component-DnTvWVQQ.js → component-B44aZ-1Z.js} +24455 -21767
  40. package/dist/component/{cynefinDiagram-MW4NZA55-fdKo3DVx.js → cynefinDiagram-MW4NZA55-0yefvDKM.js} +4 -4
  41. package/dist/component/{dagre-VZM6K2ZE-C7nAehQV.js → dagre-VZM6K2ZE-CBlt7UUF.js} +9 -9
  42. package/dist/component/{diagram-7IWD3JNH-DRM3Hv3P.js → diagram-7IWD3JNH-D0zEzayZ.js} +5 -5
  43. package/dist/component/{diagram-B4RE2ZJO-DXqATSZd.js → diagram-B4RE2ZJO-Dm2FX5kh.js} +3 -3
  44. package/dist/component/{diagram-LBJQPF4R-DJRJfBnF.js → diagram-LBJQPF4R-nQGWQGIp.js} +4 -4
  45. package/dist/component/{diagram-Q27KOJAE-B4cTzsYZ.js → diagram-Q27KOJAE-Co-Dq4kd.js} +6 -6
  46. package/dist/component/{diagram-UB23O5K3-CyUjYCbX.js → diagram-UB23O5K3-ClWS8vTp.js} +4 -4
  47. package/dist/component/{ebnfDiagram-BXEA7PRR-C6GS4eTe.js → ebnfDiagram-BXEA7PRR-Cq6K_q0O.js} +4 -4
  48. package/dist/component/{erDiagram-JOGREHBK-D8qt0_mW.js → erDiagram-JOGREHBK-DvPI-BqP.js} +12 -12
  49. package/dist/component/flowDiagram-UKHOOZJN-2MBQiA4G.js +19 -0
  50. package/dist/component/{ganttDiagram-PKOTCBZU-D6o-gloU.js → ganttDiagram-PKOTCBZU-DXzfT7Q5.js} +3 -3
  51. package/dist/component/{gitGraphDiagram-DS77QQ5N-Cz3kf7xj.js → gitGraphDiagram-DS77QQ5N-CMKpJJJ_.js} +3 -3
  52. package/dist/component/index.js +2 -2
  53. package/dist/component/{infoDiagram-6WML65LV-sdz8qoTE.js → infoDiagram-6WML65LV-Ck5rB_GF.js} +3 -3
  54. package/dist/component/{ishikawaDiagram-WSZJBQD7--tUiPVAr.js → ishikawaDiagram-WSZJBQD7-CHQxwGjK.js} +4 -4
  55. package/dist/component/{journeyDiagram-NVQOT4AX-_-TjqBid.js → journeyDiagram-NVQOT4AX-CnPVgyHk.js} +3 -3
  56. package/dist/component/{kanban-definition-27J2QSJJ-BXBySx2U.js → kanban-definition-27J2QSJJ-CC8oOHrI.js} +9 -9
  57. package/dist/component/{line-C2WkjBlg.js → line-AtEledwJ.js} +2 -2
  58. package/dist/component/{mindmap-definition-FAOFIHXS-CbpSDN_k.js → mindmap-definition-FAOFIHXS-WWI6yyUJ.js} +11 -11
  59. package/dist/component/{pegDiagram-VL7TDLO6-Cp_Wn0PS.js → pegDiagram-VL7TDLO6-D5NeC_IJ.js} +4 -4
  60. package/dist/component/{pieDiagram-7S7Q4E2Y-D6KGBWSF.js → pieDiagram-7S7Q4E2Y-M4MUAitH.js} +4 -4
  61. package/dist/component/{quadrantDiagram-CIZ2JOQS-BWjdUg-z.js → quadrantDiagram-CIZ2JOQS-viErJFsV.js} +2 -2
  62. package/dist/component/{railroadDiagram-AXF67PYL-B5iYZXm-.js → railroadDiagram-AXF67PYL-C8IhZ-59.js} +4 -4
  63. package/dist/component/{requirementDiagram-LRYGKXZP-CewRkYfE.js → requirementDiagram-LRYGKXZP-D1vdZzCs.js} +11 -11
  64. package/dist/component/{sankeyDiagram-W5VNT64P-D3Zb5dQ6.js → sankeyDiagram-W5VNT64P-Bl52MqzW.js} +2 -2
  65. package/dist/component/{sequenceDiagram-SI44F4Z6-BfxhjyrN.js → sequenceDiagram-SI44F4Z6-Cx-Aio7P.js} +4 -4
  66. package/dist/component/{stateDiagram-OKZ733FA-DLd9YI1A.js → stateDiagram-OKZ733FA-CHqMp3xm.js} +14 -14
  67. package/dist/component/{stateDiagram-v2-UEYNNEHI-Dd_FaBaY.js → stateDiagram-v2-UEYNNEHI-DqTLHDUB.js} +13 -13
  68. package/dist/component/{swimlanes-SLNWSIFB-C56sHJuV.js → swimlanes-SLNWSIFB-BkaXpBe5.js} +9 -9
  69. package/dist/component/{swimlanesDiagram-ULZ7WXOC-nHtka4qn.js → swimlanesDiagram-ULZ7WXOC-DyMFUKdr.js} +13 -13
  70. package/dist/component/{timeline-definition-Z64GVDOM-JYR_6zGi.js → timeline-definition-Z64GVDOM-Ba3A3s-L.js} +4 -4
  71. package/dist/component/{vennDiagram-T6HMQDX7-CEGGwXxv.js → vennDiagram-T6HMQDX7-4W_JJhIz.js} +4 -4
  72. package/dist/component/{wardleyDiagram-T6FBY63Y-zZGm618Q.js → wardleyDiagram-T6FBY63Y-CllyyQYm.js} +4 -4
  73. package/dist/component/{xychartDiagram-ELKLHX3M-BYbnWmqD.js → xychartDiagram-ELKLHX3M-DS3MPPul.js} +7 -7
  74. package/dist/components/embed/ComputerSettings.d.ts +7 -0
  75. package/dist/components/embed/EmbedRail.d.ts +15 -2
  76. package/dist/components/embed/EmbedSessions.d.ts +15 -2
  77. package/dist/components/embed/MobileNavBar.d.ts +4 -2
  78. package/dist/components/embed/NextStepCard.d.ts +6 -0
  79. package/dist/components/embed/ProactiveChecksSetting.d.ts +7 -0
  80. package/dist/components/embed/QuotaNoticeCard.d.ts +4 -0
  81. package/dist/components/embed/SessionSwitcher.d.ts +6 -1
  82. package/dist/components/embed/quota-notice-copy.d.ts +3 -0
  83. package/dist/components/embed/use-settings-owner-key.d.ts +15 -0
  84. package/dist/components/pinned/PinnedChatHeader.d.ts +9 -0
  85. package/dist/components/pinned/use-agent-name.d.ts +2 -0
  86. package/dist/components/scheduled/schedule-dialog-model.d.ts +2 -1
  87. package/dist/components/scheduled/schedule-format.d.ts +4 -1
  88. package/dist/components/vault/SecretPasteFeedback.d.ts +6 -0
  89. package/dist/components/vault/SecretsPanel.d.ts +23 -0
  90. package/dist/components/vault/vault-open.d.ts +3 -0
  91. package/dist/embed/goal-cap-notice.d.ts +0 -9
  92. package/dist/embed/goal-edit-command.d.ts +6 -1
  93. package/dist/embed/pinned-chat.d.ts +34 -0
  94. package/dist/embed/quota-notice.d.ts +9 -0
  95. package/dist/embed/theme.d.ts +10 -0
  96. package/dist/embed/voice/agent-spawn.d.ts +12 -2
  97. package/dist/embed/voice/line-run-reader.d.ts +1 -1
  98. package/dist/embed/voice-call.d.ts +10 -1
  99. package/dist/i18n/messages/en.d.ts +135 -8
  100. package/dist/i18n/messages/surfaces/pinned.d.ts +76 -0
  101. package/dist/i18n/messages/surfaces/quota.d.ts +69 -0
  102. package/dist/i18n/messages/surfaces/scheduled.d.ts +69 -5
  103. package/dist/i18n/messages/surfaces/settings.d.ts +148 -0
  104. package/dist/i18n/messages/surfaces/stream.d.ts +56 -4
  105. package/dist/i18n/messages/surfaces/vault.d.ts +120 -0
  106. package/dist/lib/use-tab-leadership.d.ts +1 -0
  107. package/dist/routes/chat/history-cache.d.ts +5 -0
  108. package/dist/routes/chat/history-merge.d.ts +4 -1
  109. package/dist/routes/chat/question-parts.d.ts +26 -0
  110. package/dist/routes/chat/queued-delivery.d.ts +20 -0
  111. package/dist/routes/chat/queued-messages.d.ts +15 -0
  112. package/dist/routes/chat/session-api.d.ts +52 -0
  113. package/dist/routes/chat/session-history-api.d.ts +9 -0
  114. package/dist/routes/chat/transcript-update.d.ts +45 -0
  115. package/dist/routes/chat/use-catch-up-on-return.d.ts +7 -0
  116. package/dist/routes/chat/use-next-step-suggestion.d.ts +38 -0
  117. package/dist/routes/chat/use-quota-notice.d.ts +29 -0
  118. package/dist/routes/chat/use-quota-stop-refresh.d.ts +27 -0
  119. package/dist/routes/chat/use-session-goal.d.ts +6 -0
  120. package/dist/routes/chat.d.ts +9 -15
  121. package/dist/stream/belong-chat-transport.d.ts +23 -11
  122. package/dist/stream/belong-data-parts.d.ts +31 -1
  123. package/dist/stream/pause-notice-copy.d.ts +3 -0
  124. package/dist/stream/provider-blocked.d.ts +16 -0
  125. package/dist/stream/reconnect-backoff.d.ts +39 -0
  126. package/dist/stream/run-error-copy.d.ts +25 -0
  127. package/dist/stream/stream-notice.d.ts +9 -0
  128. package/package.json +1 -1
  129. package/dist/component/flowDiagram-UKHOOZJN-U55NEBew.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';
@@ -239,6 +240,7 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
239
240
  outcome: z.ZodOptional<z.ZodString>;
240
241
  terminationReason: z.ZodOptional<z.ZodString>;
241
242
  retryable: z.ZodOptional<z.ZodBoolean>;
243
+ code: z.ZodOptional<z.ZodString>;
242
244
  }, z.core.$strip>;
243
245
  }, z.core.$strip>, z.ZodObject<{
244
246
  type: z.ZodLiteral<"data-usage">;
@@ -309,12 +311,12 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
309
311
  waiting_for_approval: "waiting_for_approval";
310
312
  active: "active";
311
313
  paused: "paused";
314
+ blocked: "blocked";
312
315
  clarifying: "clarifying";
313
316
  completion_claimed: "completion_claimed";
314
317
  deferred: "deferred";
315
318
  waiting_for_user: "waiting_for_user";
316
319
  waiting_for_ui_action: "waiting_for_ui_action";
317
- blocked: "blocked";
318
320
  budget_limited: "budget_limited";
319
321
  complete: "complete";
320
322
  cleared: "cleared";
@@ -354,12 +356,12 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
354
356
  waiting_for_approval: "waiting_for_approval";
355
357
  active: "active";
356
358
  paused: "paused";
359
+ blocked: "blocked";
357
360
  clarifying: "clarifying";
358
361
  completion_claimed: "completion_claimed";
359
362
  deferred: "deferred";
360
363
  waiting_for_user: "waiting_for_user";
361
364
  waiting_for_ui_action: "waiting_for_ui_action";
362
- blocked: "blocked";
363
365
  budget_limited: "budget_limited";
364
366
  complete: "complete";
365
367
  cleared: "cleared";
@@ -386,6 +388,20 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
386
388
  normal: "normal";
387
389
  }>>;
388
390
  }, z.core.$strip>;
391
+ }, z.core.$strip>, z.ZodObject<{
392
+ type: z.ZodLiteral<"data-quota-notice">;
393
+ id: z.ZodString;
394
+ data: z.ZodObject<{
395
+ kind: z.ZodLiteral<"quota_exceeded">;
396
+ reason: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
397
+ exhausted: "exhausted";
398
+ blocked: "blocked";
399
+ }>>>;
400
+ productName: z.ZodCatch<z.ZodOptional<z.ZodString>>;
401
+ resetsAt: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
402
+ limitWeightedTokens: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
403
+ usedWeightedTokens: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
404
+ }, z.core.$loose>;
389
405
  }, z.core.$strip>], "type">;
390
406
  /** A request was 401'd twice (once with a freshly re-read token), or no usable
391
407
  * token could be had at all (`BelongAuthUnavailableError`): the host session is
@@ -411,13 +427,8 @@ export declare class PostMessageError extends Error {
411
427
  readonly body: string;
412
428
  constructor(status: number, body: string);
413
429
  }
414
- /** First reconnect delay — identical to the historic fixed delay, so the
415
- * BEL-48 mid-run clean-EOF reconnect regains the stream just as fast. */
416
- export declare const RECONNECT_BASE_DELAY_MS = 1000;
417
- /** Exponential backoff ceiling. */
418
- export declare const RECONNECT_MAX_DELAY_MS = 30000;
419
- /** Consecutive connection attempts that deliver no event before we give up. */
420
- 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 };
421
432
  /**
422
433
  * Liveness watchdog: the server emits a `: keepalive` comment every 15s
423
434
  * (run-stream.routes.ts), so a healthy connection delivers a chunk at least
@@ -458,9 +469,10 @@ export type BelongChatTransportOptions = {
458
469
  readonly apiBaseUrl: string;
459
470
  /**
460
471
  * Reconnect delay seam (§25 — do not hide time). Tests inject an instant
461
- * 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.
462
474
  */
463
- readonly sleepMs?: (ms: number) => Promise<void>;
475
+ readonly sleepMs?: (ms: number, signal: AbortSignal) => Promise<void>;
464
476
  /**
465
477
  * Stall-watchdog window override (§25). Tests shrink it to tens of ms;
466
478
  * production uses `STALL_TIMEOUT_MS`.
@@ -268,6 +268,12 @@ export type StatusData = {
268
268
  * up" pill instead of a scary failure badge.
269
269
  */
270
270
  readonly retryable?: boolean | undefined;
271
+ /**
272
+ * #974 — a failed run's cause: the server's `run_error` code (e.g.
273
+ * `provider_content_filter`). The dock picks its copy by this, never by the
274
+ * English `message`. Absent from an older cloud and from other statuses.
275
+ */
276
+ readonly code?: string | undefined;
271
277
  };
272
278
  /**
273
279
  * One slice of the context-window breakdown. `key` is an open string on the
@@ -334,6 +340,28 @@ export type GoalProposalData = {
334
340
  readonly criteria?: readonly string[] | undefined;
335
341
  readonly runway?: GoalRunwayPreset | undefined;
336
342
  };
343
+ /**
344
+ * Console P1 (TS-DOCK-02, DE-QTA-09) — a persisted monthly-quota refusal.
345
+ * The cell writes it as the assistant row answering a refused message; the
346
+ * history route returns it beside a fallback `text` part, which a dock that
347
+ * renders this card suppresses (SAD §9). The live 429 builds the same part
348
+ * from the response body (`routes/chat/use-quota-notice.ts`), so a reload
349
+ * renders what the user saw (§41).
350
+ *
351
+ * Every field but `kind` is optional on the wire (SAD §9): a newer dock must
352
+ * render a notice an older or partial writer left fields out of. The two
353
+ * figures are carried, never shown (the card has no number in it).
354
+ */
355
+ export type QuotaRefusalReason = "exhausted" | "blocked";
356
+ export type QuotaNoticeData = {
357
+ readonly kind: "quota_exceeded";
358
+ readonly reason?: QuotaRefusalReason | undefined;
359
+ readonly productName?: string | undefined;
360
+ /** ISO instant the month's tokens reset; `null` when there is none (blocked). */
361
+ readonly resetsAt?: string | null | undefined;
362
+ readonly limitWeightedTokens?: number | undefined;
363
+ readonly usedWeightedTokens?: number | undefined;
364
+ };
337
365
  /**
338
366
  * Single source of truth for Belong's custom data parts. The record
339
367
  * keys (`reasoning`, `plan`, …) become the part-type suffix:
@@ -361,6 +389,8 @@ export type BelongDataParts = {
361
389
  goal: GoalView;
362
390
  /** Goal Mode M6 — a goal the agent offered via `propose_goal`. */
363
391
  "goal-proposal": GoalProposalData;
392
+ /** Console P1 — a persisted monthly-quota refusal (TS-DOCK-02). */
393
+ "quota-notice": QuotaNoticeData;
364
394
  };
365
395
  /**
366
396
  * The concrete `UIMessage` shape the chat surface and transport speak.
@@ -390,5 +420,5 @@ export type WireDataPart<NAME extends keyof BelongDataParts> = {
390
420
  readonly id: string;
391
421
  readonly data: BelongDataParts[NAME];
392
422
  };
393
- export type WireStreamPart = WireTextPart | WireDataPart<"model-activity"> | WireDataPart<"reasoning"> | WireDataPart<"plan"> | WireDataPart<"approval-request"> | WireDataPart<"choice-request"> | WireDataPart<"tool-call"> | WireDataPart<"subagent"> | WireDataPart<"sandbox-command"> | WireDataPart<"ui-action"> | WireDataPart<"cli-reconnect"> | WireDataPart<"navigation"> | WireDataPart<"artifact"> | WireDataPart<"status"> | WireDataPart<"usage"> | WireDataPart<"goal"> | WireDataPart<"goal-proposal">;
423
+ export type WireStreamPart = WireTextPart | WireDataPart<"model-activity"> | WireDataPart<"reasoning"> | WireDataPart<"plan"> | WireDataPart<"approval-request"> | WireDataPart<"choice-request"> | WireDataPart<"tool-call"> | WireDataPart<"subagent"> | WireDataPart<"sandbox-command"> | WireDataPart<"ui-action"> | WireDataPart<"cli-reconnect"> | WireDataPart<"navigation"> | WireDataPart<"artifact"> | WireDataPart<"status"> | WireDataPart<"usage"> | WireDataPart<"goal"> | WireDataPart<"goal-proposal"> | WireDataPart<"quota-notice">;
394
424
  export type WireStreamPartType = WireStreamPart["type"];
@@ -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,16 @@
1
+ import { BelongUIMessage, StatusData } from './belong-data-parts.ts';
2
+ /**
3
+ * A run the provider refused to finish. It ends on one localized notice in
4
+ * the turn (`stream.answerBlocked`), not on a stream error: nothing was lost
5
+ * in transit. Keyed on the run's cause code, never on the server's English
6
+ * prose.
7
+ */
8
+ export declare const isProviderBlockedStatus: (data: StatusData) => boolean;
9
+ /**
10
+ * Whether an assistant turn ended on a provider refusal. Such a run settles
11
+ * `ready` like a finished one (no stream error), so whatever reports a run's
12
+ * outcome reads this to tell the two apart. Only the turn's LAST status
13
+ * counts: a resumed run streams into the same message, so an earlier run's
14
+ * refusal can sit in front of a later run's answer.
15
+ */
16
+ export declare const endedProviderBlocked: (message: BelongUIMessage) => boolean;
@@ -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.32",
3
+ "version": "0.6.34",
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-DB1sFGc-.js";
5
- import "./chunk-NSK5VX7P-ur_ZGcVX.js";
6
- import "./chunk-ZIRB5QZD-DmX0SXRC.js";
7
- import "./chunk-W5SLKNZC-Dq8uD14N.js";
8
- import "./chunk-UBXNYLIW-CDKeQUnO.js";
9
- import "./chunk-4I5QYGJK-CGOVqmKQ.js";
10
- import "./chunk-WRU74C26-BwQb4DnE.js";
11
- import "./chunk-QR6OTTB3-Bl3Z_jKC.js";
12
- import "./chunk-7BUUIJ7U-DJJ8ycYS.js";
13
- import "./chunk-7Z6QIM7H-CSfSb_Xc.js";
14
- import "./chunk-J7OUQ5F2-DB9d7Gt_.js";
15
- import "./chunk-5VM5RSS4-BuOiQaWo.js";
16
- import "./chunk-2GRJ4B5K-C14K2lKj.js";
17
- import "./chunk-XXDRQBXY-BP7ld7ls.js";
18
- import "./chunk-KBJHAD2P-CVoxmRa8.js";
19
- export { n as diagram } from "./chunk-JQJVKLGR-De7zUJDv.js";