@belonguniverseai/react-sdk 0.6.31 → 0.6.33
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.
- package/dist/api/account-connectors.d.ts +2 -2
- package/dist/api/client.d.ts +1126 -63
- package/dist/api/goals.d.ts +4 -4
- package/dist/api/guide.d.ts +15 -0
- package/dist/api/query-keys.d.ts +6 -5
- package/dist/api/quota-refusal.d.ts +49 -0
- package/dist/api/secret-paste.d.ts +5 -0
- package/dist/api/suggestions.d.ts +18 -0
- package/dist/api/task-schedule-sharing.d.ts +13 -1
- package/dist/api/task-schedules.d.ts +33 -4
- package/dist/api/vault.d.ts +49 -0
- package/dist/app/dock-story-data.d.ts +6 -0
- package/dist/component/{abnfDiagram-N423BO3Z-C_vMQSL0.js → abnfDiagram-N423BO3Z-CK4wvzwz.js} +4 -4
- package/dist/component/{architectureDiagram-T3A2C74G-dvNbgSIj.js → architectureDiagram-T3A2C74G-DoljsqqO.js} +6 -6
- package/dist/component/{blockDiagram-VBNYF7ZC-CRm9PRRf.js → blockDiagram-VBNYF7ZC-Ie7SErpH.js} +8 -8
- package/dist/component/{c4Diagram-5PPSVZJV-B1PMAZEg.js → c4Diagram-5PPSVZJV-rfEof5mj.js} +4 -4
- package/dist/component/{channel-Boj1wmAa.js → channel-C5ABP6lE.js} +2 -2
- package/dist/component/{chunk-2GRJ4B5K-CBAw5kla.js → chunk-2GRJ4B5K-CWOCv67u.js} +2 -2
- package/dist/component/{chunk-3NCLNEKW-BuxgmuBS.js → chunk-3NCLNEKW-BJYANBvv.js} +2 -2
- package/dist/component/{chunk-4I5QYGJK-CDPqoPOq.js → chunk-4I5QYGJK-C29OfER5.js} +2 -2
- package/dist/component/{chunk-5RXB4S5H-fv_mFlec.js → chunk-5RXB4S5H-D__NH4Op.js} +6 -6
- package/dist/component/{chunk-6Q2QTUOP-RU5jVXsd.js → chunk-6Q2QTUOP-BgSQgII8.js} +3 -3
- package/dist/component/{chunk-7Z6QIM7H-BgV4nQ80.js → chunk-7Z6QIM7H-vNexNF_V.js} +8 -8
- package/dist/component/{chunk-GF5L2VYU-CSROQiBr.js → chunk-GF5L2VYU-D3vxqomE.js} +6 -6
- package/dist/component/{chunk-I66GZJ75-CGsmSAKB.js → chunk-I66GZJ75-Dkw1ISGd.js} +2 -2
- package/dist/component/{chunk-J7OUQ5F2-D0GPh9LA.js → chunk-J7OUQ5F2-dC67pJWg.js} +7 -7
- package/dist/component/{chunk-JQJVKLGR-D4zeU7rQ.js → chunk-JQJVKLGR-Djj9TdhH.js} +8 -8
- package/dist/component/{chunk-KBJHAD2P-_EJQ1rNN.js → chunk-KBJHAD2P-dwIA6Vmi.js} +2 -2
- package/dist/component/{chunk-NSK5VX7P-dusZw8pp.js → chunk-NSK5VX7P-thQxjtNK.js} +2 -2
- package/dist/component/{chunk-QR6OTTB3-Bb0pFQ-m.js → chunk-QR6OTTB3-OMd-rgNj.js} +7 -7
- package/dist/component/{chunk-UBXNYLIW-CJHU4Dfa.js → chunk-UBXNYLIW-D26S6zO6.js} +3 -3
- package/dist/component/{chunk-W5SLKNZC-CRG_NQXu.js → chunk-W5SLKNZC-DLV7M8by.js} +2 -2
- package/dist/component/{chunk-WRU74C26-D8hrtupL.js → chunk-WRU74C26-13bvIAgD.js} +4 -4
- package/dist/component/{classDiagram-JCYQIIEL-CIgvdG3B.js → classDiagram-JCYQIIEL-BFQ72AZA.js} +13 -13
- package/dist/component/{classDiagram-v2-OCEON4UE-CyMNFCrX.js → classDiagram-v2-OCEON4UE-UFfArXpP.js} +13 -13
- package/dist/component/{component-CtEw7QuU.js → component-Bhs6PFPY.js} +42587 -40222
- package/dist/component/{cynefinDiagram-MW4NZA55-M_mUz7fS.js → cynefinDiagram-MW4NZA55-Bgfw8c41.js} +4 -4
- package/dist/component/{dagre-VZM6K2ZE-Co5UZ6ZI.js → dagre-VZM6K2ZE-CQoUcF3S.js} +9 -9
- package/dist/component/{diagram-7IWD3JNH-Bfgrgw1x.js → diagram-7IWD3JNH-C8-mvAEv.js} +5 -5
- package/dist/component/{diagram-B4RE2ZJO-On8y3Dsu.js → diagram-B4RE2ZJO-BATqCIx3.js} +3 -3
- package/dist/component/{diagram-LBJQPF4R-CzDYf7jJ.js → diagram-LBJQPF4R-DwRMRXWz.js} +4 -4
- package/dist/component/{diagram-Q27KOJAE-D2MlvnqP.js → diagram-Q27KOJAE-D6gO0LTm.js} +6 -6
- package/dist/component/{diagram-UB23O5K3-Bl3kdzTb.js → diagram-UB23O5K3-4nOrWHql.js} +4 -4
- package/dist/component/{ebnfDiagram-BXEA7PRR-CyKWxoNI.js → ebnfDiagram-BXEA7PRR-DCO-Nj3k.js} +4 -4
- package/dist/component/{erDiagram-JOGREHBK-B2DjPQI6.js → erDiagram-JOGREHBK-hWtImhPN.js} +12 -12
- package/dist/component/flowDiagram-UKHOOZJN-8qLgX2Wv.js +19 -0
- package/dist/component/{ganttDiagram-PKOTCBZU-Do3-h4U7.js → ganttDiagram-PKOTCBZU-BE8Mqoej.js} +3 -3
- package/dist/component/{gitGraphDiagram-DS77QQ5N-CRyn9FyP.js → gitGraphDiagram-DS77QQ5N-DURS7rAN.js} +3 -3
- package/dist/component/index.js +2 -2
- package/dist/component/{infoDiagram-6WML65LV-BvRo6Umd.js → infoDiagram-6WML65LV-BqBxR6YB.js} +3 -3
- package/dist/component/{ishikawaDiagram-WSZJBQD7-DNxrL1bn.js → ishikawaDiagram-WSZJBQD7-CnYZd1Dq.js} +4 -4
- package/dist/component/{journeyDiagram-NVQOT4AX-Cvzr6jFA.js → journeyDiagram-NVQOT4AX-Cgkpx4Qx.js} +3 -3
- package/dist/component/{kanban-definition-27J2QSJJ-CWjHCc6Q.js → kanban-definition-27J2QSJJ-CJSdhT0i.js} +9 -9
- package/dist/component/{line-qLTHZib7.js → line-BBEHlpsV.js} +2 -2
- package/dist/component/{mindmap-definition-FAOFIHXS-CTrxLLMf.js → mindmap-definition-FAOFIHXS-DgHouLA-.js} +11 -11
- package/dist/component/{pegDiagram-VL7TDLO6-DKquwTLr.js → pegDiagram-VL7TDLO6-B_iGQ6sI.js} +4 -4
- package/dist/component/{pieDiagram-7S7Q4E2Y-B9mrWWER.js → pieDiagram-7S7Q4E2Y-g7GxM0JA.js} +4 -4
- package/dist/component/{quadrantDiagram-CIZ2JOQS-CLMlPfFg.js → quadrantDiagram-CIZ2JOQS-Bp7z4raq.js} +2 -2
- package/dist/component/{railroadDiagram-AXF67PYL-DBRxaZy0.js → railroadDiagram-AXF67PYL-CYx3PP5o.js} +4 -4
- package/dist/component/{requirementDiagram-LRYGKXZP-DFbNp-NQ.js → requirementDiagram-LRYGKXZP-BJNRJceo.js} +11 -11
- package/dist/component/{sankeyDiagram-W5VNT64P-Ba10c9Ya.js → sankeyDiagram-W5VNT64P-Cf0tVHbW.js} +2 -2
- package/dist/component/{sequenceDiagram-SI44F4Z6-CakxF9z5.js → sequenceDiagram-SI44F4Z6-BsAsKMRH.js} +4 -4
- package/dist/component/{stateDiagram-OKZ733FA-DpwaZHAD.js → stateDiagram-OKZ733FA-Bpk0vtTK.js} +14 -14
- package/dist/component/{stateDiagram-v2-UEYNNEHI-CXLHj_sq.js → stateDiagram-v2-UEYNNEHI-CJFoUvD2.js} +13 -13
- package/dist/component/{swimlanes-SLNWSIFB-CLLLQ7CI.js → swimlanes-SLNWSIFB-Be5A0lwq.js} +9 -9
- package/dist/component/{swimlanesDiagram-ULZ7WXOC-B1LbGSCS.js → swimlanesDiagram-ULZ7WXOC-J8VNaPhM.js} +13 -13
- package/dist/component/{timeline-definition-Z64GVDOM-BsifI4rA.js → timeline-definition-Z64GVDOM-CU9PEkPY.js} +4 -4
- package/dist/component/{vennDiagram-T6HMQDX7-zuVcjY9p.js → vennDiagram-T6HMQDX7-Cno78tFK.js} +4 -4
- package/dist/component/{wardleyDiagram-T6FBY63Y-B9DV6RwN.js → wardleyDiagram-T6FBY63Y-BEb1Rn5J.js} +4 -4
- package/dist/component/{xychartDiagram-ELKLHX3M-FyZaGaUV.js → xychartDiagram-ELKLHX3M-BwjMczCl.js} +7 -7
- package/dist/components/ai-elements/dock-link.d.ts +14 -1
- package/dist/components/ai-elements/message.d.ts +8 -1
- package/dist/components/embed/EmbedRail.d.ts +8 -1
- package/dist/components/embed/NextStepCard.d.ts +6 -0
- package/dist/components/embed/QuotaNoticeCard.d.ts +4 -0
- package/dist/components/embed/SessionSwitcher.d.ts +6 -1
- package/dist/components/embed/quota-notice-copy.d.ts +3 -0
- package/dist/components/guide/GuideArticleView.d.ts +7 -0
- package/dist/components/guide/GuideHub.d.ts +9 -0
- package/dist/components/guide/GuideSettings.d.ts +23 -0
- package/dist/components/guide/figures/ComposerIndicatorsFigure.d.ts +16 -0
- package/dist/components/guide/figures/SharedTaskCopiesFigure.d.ts +12 -0
- package/dist/components/guide/figures/index.d.ts +3 -0
- package/dist/components/guide/guide-fixtures.d.ts +3 -0
- package/dist/components/guide/guide-icons.d.ts +3 -0
- package/dist/components/guide/guide-link.d.ts +12 -0
- package/dist/components/guide/guide-search.d.ts +15 -0
- package/dist/components/scheduled/schedule-dialog-model.d.ts +2 -1
- package/dist/components/scheduled/schedule-format.d.ts +4 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/vault/SecretPasteFeedback.d.ts +6 -0
- package/dist/components/vault/SecretsPanel.d.ts +23 -0
- package/dist/components/vault/vault-open.d.ts +3 -0
- package/dist/embed/goal-edit-command.d.ts +6 -1
- package/dist/embed/quota-notice.d.ts +9 -0
- package/dist/embed/theme.d.ts +10 -0
- package/dist/embed/voice/agent-spawn.d.ts +12 -2
- package/dist/embed/voice-call.d.ts +4 -1
- package/dist/i18n/messages/en.d.ts +85 -0
- package/dist/i18n/messages/surfaces/guide.d.ts +131 -0
- package/dist/i18n/messages/surfaces/quota.d.ts +69 -0
- package/dist/i18n/messages/surfaces/scheduled.d.ts +32 -0
- package/dist/i18n/messages/surfaces/settings.d.ts +16 -0
- package/dist/i18n/messages/surfaces/stream.d.ts +4 -0
- package/dist/i18n/messages/surfaces/vault.d.ts +120 -0
- package/dist/lib/use-tab-leadership.d.ts +1 -0
- package/dist/routes/chat/history-cache.d.ts +5 -0
- package/dist/routes/chat/question-parts.d.ts +26 -0
- package/dist/routes/chat/queued-delivery.d.ts +20 -0
- package/dist/routes/chat/queued-messages.d.ts +15 -0
- package/dist/routes/chat/session-api.d.ts +52 -0
- package/dist/routes/chat/session-history-api.d.ts +9 -0
- package/dist/routes/chat/transcript-update.d.ts +45 -0
- package/dist/routes/chat/use-catch-up-on-return.d.ts +7 -0
- package/dist/routes/chat/use-next-step-suggestion.d.ts +38 -0
- package/dist/routes/chat/use-quota-notice.d.ts +29 -0
- package/dist/routes/chat/use-quota-stop-refresh.d.ts +27 -0
- package/dist/routes/chat/use-session-goal.d.ts +6 -0
- package/dist/routes/chat.d.ts +9 -15
- package/dist/stream/belong-chat-transport.d.ts +17 -2
- package/dist/stream/belong-data-parts.d.ts +31 -1
- package/dist/stream/provider-blocked.d.ts +16 -0
- package/package.json +1 -1
- package/dist/component/flowDiagram-UKHOOZJN-CjSeviPw.js +0 -19
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { UseChatHelpers } from '@ai-sdk/react';
|
|
2
|
+
import { NextStepSuggestion } from '../../api/suggestions.ts';
|
|
3
|
+
import { GoalStatus } from '../../api/goals.ts';
|
|
4
|
+
import { BelongUIMessage } from '../../stream/belong-data-parts.ts';
|
|
5
|
+
type ChatStatus = UseChatHelpers<BelongUIMessage>["status"];
|
|
6
|
+
export type UseNextStepSuggestionInput = {
|
|
7
|
+
readonly apiBaseUrl: string;
|
|
8
|
+
readonly sessionId: string | null;
|
|
9
|
+
readonly locale: string;
|
|
10
|
+
readonly status: ChatStatus;
|
|
11
|
+
readonly lastMessage: {
|
|
12
|
+
readonly role: string;
|
|
13
|
+
} | null;
|
|
14
|
+
readonly draftEmpty: boolean;
|
|
15
|
+
/** False when this tab cannot act on the session (follower tab, read-only run). */
|
|
16
|
+
readonly enabled: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type UseNextStepSuggestion = {
|
|
19
|
+
readonly suggestion: NextStepSuggestion | null;
|
|
20
|
+
readonly dismiss: () => void;
|
|
21
|
+
/** Call before Stop: the turn about to end was cut short, so nothing is suggested for it. */
|
|
22
|
+
readonly suppressNextFinish: () => void;
|
|
23
|
+
};
|
|
24
|
+
export declare const useNextStepSuggestion: (input: UseNextStepSuggestionInput) => UseNextStepSuggestion;
|
|
25
|
+
/**
|
|
26
|
+
* The suggestion as the screen shows it: the card and the composer ghost read
|
|
27
|
+
* this one value, so they always agree. It yields to the two rows that already
|
|
28
|
+
* sit above the composer — an open question card is the agent's own ask, and a
|
|
29
|
+
* live goal's row is where the hand already is. A finished or cleared goal has
|
|
30
|
+
* no row, so it hides nothing.
|
|
31
|
+
*/
|
|
32
|
+
export declare const nextStepOnScreen: (suggestion: NextStepSuggestion | null, context: {
|
|
33
|
+
readonly questionOpen: boolean;
|
|
34
|
+
readonly goalStatus: GoalStatus | null;
|
|
35
|
+
}) => NextStepSuggestion | null;
|
|
36
|
+
/** The composer's ghost: the welcome question on a new chat, else the recommended reply. */
|
|
37
|
+
export declare const composerGhost: (welcome: string | null, nextStep: NextStepSuggestion | null) => string | null;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TFunction } from 'i18next';
|
|
2
|
+
import { QuotaRefusal } from '../../api/quota-refusal.ts';
|
|
3
|
+
import { BelongUIMessage } from '../../stream/belong-data-parts.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Re-key the refused message's optimistic bubble to the server's id and
|
|
6
|
+
* append the notice. Pure and idempotent: a second application (a duplicate
|
|
7
|
+
* `onError`, a replayed refusal) changes nothing further.
|
|
8
|
+
*/
|
|
9
|
+
export declare const applyQuotaRefusal: (messages: readonly BelongUIMessage[], refusal: QuotaRefusal) => BelongUIMessage[];
|
|
10
|
+
/**
|
|
11
|
+
* What a finished assistant message says out loud (the live call and the
|
|
12
|
+
* speaker's batch TTS). A quota notice says the card's words: live it has no
|
|
13
|
+
* text part, and its history row's fallback text is never shown, so both
|
|
14
|
+
* renders speak the same sentence under the same id — spoken once, on time.
|
|
15
|
+
*/
|
|
16
|
+
export declare const assistantSpokenText: (message: BelongUIMessage, t: TFunction, locale: string) => string;
|
|
17
|
+
/**
|
|
18
|
+
* `handleQuotaError(error)` answers a quota refusal and reports `true`, or
|
|
19
|
+
* reports `false` and leaves the error to the caller's other paths. The
|
|
20
|
+
* chat's error state is cleared on a microtask: `useChat` calls `onError`
|
|
21
|
+
* BEFORE it parks `status: "error"`, and `clearError` is a no-op until then
|
|
22
|
+
* (the same deferral the goal refusal uses).
|
|
23
|
+
*/
|
|
24
|
+
export declare const useQuotaNotice: ({ setMessages, clearError, }: {
|
|
25
|
+
readonly setMessages: (update: (messages: BelongUIMessage[]) => BelongUIMessage[]) => void;
|
|
26
|
+
readonly clearError: () => void;
|
|
27
|
+
}) => {
|
|
28
|
+
readonly handleQuotaError: (error: unknown) => boolean;
|
|
29
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BelongUIMessage } from '../../stream/belong-data-parts.ts';
|
|
2
|
+
import { HistoryPageResult } from './history-cache.ts';
|
|
3
|
+
export declare const signalQuotaStop: (sessionId: string) => void;
|
|
4
|
+
/**
|
|
5
|
+
* The newest quota-stop signal of the turn on screen, as a stable key, or
|
|
6
|
+
* `null`. Restored history is never a signal (it already carries its card),
|
|
7
|
+
* and the scan stops at the turn's user message.
|
|
8
|
+
*/
|
|
9
|
+
export declare const quotaStopSignalKey: (messages: readonly BelongUIMessage[]) => string | null;
|
|
10
|
+
export declare const useQuotaStopRefresh: ({ messages, idle, isBusy, resolveSessionId, refreshNewestHistory, applyHistoryPage, sleepMs, }: {
|
|
11
|
+
readonly messages: readonly BelongUIMessage[];
|
|
12
|
+
/** No turn is streaming into the chat right now (reactive; re-runs the hook). */
|
|
13
|
+
readonly idle: boolean;
|
|
14
|
+
/** Read at apply time: a turn is in flight or the transport holds a live stream. */
|
|
15
|
+
readonly isBusy: () => boolean;
|
|
16
|
+
/** The chat's session, read when a refresh starts and between attempts. */
|
|
17
|
+
readonly resolveSessionId: () => string | null;
|
|
18
|
+
readonly refreshNewestHistory: (sessionId: string) => Promise<HistoryPageResult>;
|
|
19
|
+
/** Merge the page into the conversation (the `/compact` merge). */
|
|
20
|
+
readonly applyHistoryPage: (page: Extract<HistoryPageResult, {
|
|
21
|
+
ok: true;
|
|
22
|
+
}>) => void;
|
|
23
|
+
/** Injectable delay (§25). */
|
|
24
|
+
readonly sleepMs?: (ms: number) => Promise<void>;
|
|
25
|
+
}) => {
|
|
26
|
+
readonly refreshForQuotaStop: () => void;
|
|
27
|
+
};
|
|
@@ -227,6 +227,12 @@ export type SessionGoalInput = {
|
|
|
227
227
|
* objective back to the composer through the SAME door
|
|
228
228
|
* `useGoalReceipt`'s follow-ups already use. */
|
|
229
229
|
readonly setDraft: (value: string) => void;
|
|
230
|
+
/**
|
|
231
|
+
* Console P1 — a resume or edit answered `budget_limited`: the monthly
|
|
232
|
+
* token quota may have stopped it, and the cell persisted an orange notice
|
|
233
|
+
* the chat reads from history (`use-quota-stop-refresh.ts`).
|
|
234
|
+
*/
|
|
235
|
+
readonly onGoalQuotaStop?: (() => void) | undefined;
|
|
230
236
|
};
|
|
231
237
|
export declare const useSessionGoal: (input: SessionGoalInput) => SessionGoalApi;
|
|
232
238
|
export {};
|
package/dist/routes/chat.d.ts
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import { HistoryScope } from './chat/history-cache.ts';
|
|
3
|
-
export type QueuedMessage = {
|
|
4
|
-
readonly clientId: string;
|
|
5
|
-
readonly text: string;
|
|
6
|
-
readonly submittedAt: number;
|
|
7
|
-
readonly state: "queued" | "failed";
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Read a chat's newest page ahead of opening it (the Chats list's
|
|
11
|
-
* `SessionIntentContext`), so it opens painted from the cache. A chat kept
|
|
12
|
-
* live needs no read; a page read in the last 30 s is not read again.
|
|
13
|
-
*/
|
|
14
|
-
export declare const prefetchChatHistory: (queryClient: QueryClient, apiBaseUrl: string, scope: HistoryScope) => void;
|
|
15
|
-
export declare const ChatRoute: ({ sessionId, draftId, reconcileBackgroundRun, onOpenGoalView, onOpenFilesView, projectRunReadOnly, }?: {
|
|
1
|
+
export declare const ChatRoute: ({ sessionId, draftId, reconcileBackgroundRun, sessionPending, justCreated, onOpenGoalView, onOpenFilesView, projectRunReadOnly, }?: {
|
|
16
2
|
readonly sessionId?: string;
|
|
17
3
|
readonly draftId?: string;
|
|
18
4
|
readonly reconcileBackgroundRun?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* The rail's "+" shows this new chat while its session is still being created
|
|
7
|
+
* (BelongDock remounts onto that session when it exists). Nothing may be
|
|
8
|
+
* written here until then: it would land outside the new agent.
|
|
9
|
+
*/
|
|
10
|
+
readonly sessionPending?: boolean;
|
|
11
|
+
/** This tab created the session a moment ago: it opens with nothing to catch up on. */
|
|
12
|
+
readonly justCreated?: boolean;
|
|
19
13
|
/** Put the Goal view on screen (the dock owns navigation — same path the
|
|
20
14
|
* header pill takes). Omitted in tests and stories, where the row's
|
|
21
15
|
* Details simply does nothing. */
|
|
@@ -239,6 +239,7 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
239
239
|
outcome: z.ZodOptional<z.ZodString>;
|
|
240
240
|
terminationReason: z.ZodOptional<z.ZodString>;
|
|
241
241
|
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
242
|
+
code: z.ZodOptional<z.ZodString>;
|
|
242
243
|
}, z.core.$strip>;
|
|
243
244
|
}, z.core.$strip>, z.ZodObject<{
|
|
244
245
|
type: z.ZodLiteral<"data-usage">;
|
|
@@ -309,12 +310,12 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
309
310
|
waiting_for_approval: "waiting_for_approval";
|
|
310
311
|
active: "active";
|
|
311
312
|
paused: "paused";
|
|
313
|
+
blocked: "blocked";
|
|
312
314
|
clarifying: "clarifying";
|
|
313
315
|
completion_claimed: "completion_claimed";
|
|
314
316
|
deferred: "deferred";
|
|
315
317
|
waiting_for_user: "waiting_for_user";
|
|
316
318
|
waiting_for_ui_action: "waiting_for_ui_action";
|
|
317
|
-
blocked: "blocked";
|
|
318
319
|
budget_limited: "budget_limited";
|
|
319
320
|
complete: "complete";
|
|
320
321
|
cleared: "cleared";
|
|
@@ -354,12 +355,12 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
354
355
|
waiting_for_approval: "waiting_for_approval";
|
|
355
356
|
active: "active";
|
|
356
357
|
paused: "paused";
|
|
358
|
+
blocked: "blocked";
|
|
357
359
|
clarifying: "clarifying";
|
|
358
360
|
completion_claimed: "completion_claimed";
|
|
359
361
|
deferred: "deferred";
|
|
360
362
|
waiting_for_user: "waiting_for_user";
|
|
361
363
|
waiting_for_ui_action: "waiting_for_ui_action";
|
|
362
|
-
blocked: "blocked";
|
|
363
364
|
budget_limited: "budget_limited";
|
|
364
365
|
complete: "complete";
|
|
365
366
|
cleared: "cleared";
|
|
@@ -386,6 +387,20 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
386
387
|
normal: "normal";
|
|
387
388
|
}>>;
|
|
388
389
|
}, z.core.$strip>;
|
|
390
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
391
|
+
type: z.ZodLiteral<"data-quota-notice">;
|
|
392
|
+
id: z.ZodString;
|
|
393
|
+
data: z.ZodObject<{
|
|
394
|
+
kind: z.ZodLiteral<"quota_exceeded">;
|
|
395
|
+
reason: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
396
|
+
exhausted: "exhausted";
|
|
397
|
+
blocked: "blocked";
|
|
398
|
+
}>>>;
|
|
399
|
+
productName: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
400
|
+
resetsAt: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
401
|
+
limitWeightedTokens: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
402
|
+
usedWeightedTokens: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
403
|
+
}, z.core.$loose>;
|
|
389
404
|
}, z.core.$strip>], "type">;
|
|
390
405
|
/** A request was 401'd twice (once with a freshly re-read token), or no usable
|
|
391
406
|
* token could be had at all (`BelongAuthUnavailableError`): the host session is
|
|
@@ -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,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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@belonguniverseai/react-sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.33",
|
|
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-CGsmSAKB.js";
|
|
5
|
-
import "./chunk-NSK5VX7P-dusZw8pp.js";
|
|
6
|
-
import "./chunk-ZIRB5QZD-DmX0SXRC.js";
|
|
7
|
-
import "./chunk-W5SLKNZC-CRG_NQXu.js";
|
|
8
|
-
import "./chunk-UBXNYLIW-CJHU4Dfa.js";
|
|
9
|
-
import "./chunk-4I5QYGJK-CDPqoPOq.js";
|
|
10
|
-
import "./chunk-WRU74C26-D8hrtupL.js";
|
|
11
|
-
import "./chunk-QR6OTTB3-Bb0pFQ-m.js";
|
|
12
|
-
import "./chunk-7BUUIJ7U-DJJ8ycYS.js";
|
|
13
|
-
import "./chunk-7Z6QIM7H-BgV4nQ80.js";
|
|
14
|
-
import "./chunk-J7OUQ5F2-D0GPh9LA.js";
|
|
15
|
-
import "./chunk-5VM5RSS4-BuOiQaWo.js";
|
|
16
|
-
import "./chunk-2GRJ4B5K-CBAw5kla.js";
|
|
17
|
-
import "./chunk-XXDRQBXY-BP7ld7ls.js";
|
|
18
|
-
import "./chunk-KBJHAD2P-_EJQ1rNN.js";
|
|
19
|
-
export { n as diagram } from "./chunk-JQJVKLGR-D4zeU7rQ.js";
|