@belonguniverseai/react-sdk 0.6.0 → 0.6.1
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/client.d.ts +0 -6
- package/dist/component/{arc-DpA4gw3l.js → arc-BziuP1aB.js} +2 -2
- package/dist/component/{architectureDiagram-3BPJPVTR-C8WjH-Q1.js → architectureDiagram-3BPJPVTR-BVwa4QrX.js} +3 -3
- package/dist/component/{blockDiagram-GPEHLZMM-O9IURu7q.js → blockDiagram-GPEHLZMM-CKNImKL2.js} +4 -4
- package/dist/component/{c4Diagram-AAUBKEIU-B4cFy6te.js → c4Diagram-AAUBKEIU-BcbjcMPA.js} +3 -3
- package/dist/component/{channel-7qPdE580.js → channel-vtwXLQ1f.js} +2 -2
- package/dist/component/{chunk-2J33WTMH-CUyqMMUN.js → chunk-2J33WTMH-C6wmoOIl.js} +2 -2
- package/dist/component/{chunk-4BX2VUAB-4MjzMD47.js → chunk-4BX2VUAB-DySNI9mv.js} +2 -2
- package/dist/component/{chunk-55IACEB6-BOiOLlJY.js → chunk-55IACEB6-C4M2cG_c.js} +2 -2
- package/dist/component/{chunk-727SXJPM-D7rQvYjL.js → chunk-727SXJPM-BTqmmKKN.js} +6 -6
- package/dist/component/{chunk-AQP2D5EJ-B4yIZLgM.js → chunk-AQP2D5EJ-DiS4043D.js} +4 -4
- package/dist/component/{chunk-FMBD7UC4-CHC657o0.js → chunk-FMBD7UC4-Bu05DXe4.js} +2 -2
- package/dist/component/{chunk-ND2GUHAM-BAq6BoPv.js → chunk-ND2GUHAM-DfbE4oOG.js} +2 -2
- package/dist/component/{chunk-QZHKN3VN-DSE2KpkL.js → chunk-QZHKN3VN-Y8mfHGtB.js} +2 -2
- package/dist/component/{classDiagram-4FO5ZUOK-Dp6GpqVA.js → classDiagram-4FO5ZUOK-ChO_m1Vd.js} +3 -3
- package/dist/component/{classDiagram-v2-Q7XG4LA2-Dp6GpqVA.js → classDiagram-v2-Q7XG4LA2-ChO_m1Vd.js} +3 -3
- package/dist/component/{cose-bilkent-S5V4N54A-D7qy0jl5.js → cose-bilkent-S5V4N54A-B1DDE26M.js} +2 -2
- package/dist/component/{dagre-BM42HDAG-Bp1xKCuc.js → dagre-BM42HDAG-BmujNepD.js} +2 -2
- package/dist/component/{diagram-2AECGRRQ-BgnTJHhy.js → diagram-2AECGRRQ-Cbck9DRQ.js} +3 -3
- package/dist/component/{diagram-5GNKFQAL-D2Sf6fvv.js → diagram-5GNKFQAL-csRK5clZ.js} +4 -4
- package/dist/component/{diagram-KO2AKTUF-B6q2Givz.js → diagram-KO2AKTUF-DD3KqnFb.js} +3 -3
- package/dist/component/{diagram-LMA3HP47-Dd-PZ9QO.js → diagram-LMA3HP47-D6-oakzD.js} +3 -3
- package/dist/component/{diagram-OG6HWLK6-v65-inn8.js → diagram-OG6HWLK6-DfxY1IE7.js} +4 -4
- package/dist/component/{erDiagram-TEJ5UH35-s5ngcfah.js → erDiagram-TEJ5UH35-BDV1C23R.js} +5 -5
- package/dist/component/{flowDiagram-I6XJVG4X-C-3l7ZN2.js → flowDiagram-I6XJVG4X-mEwMtE2U.js} +7 -7
- package/dist/component/{ganttDiagram-6RSMTGT7-AFajly3C.js → ganttDiagram-6RSMTGT7-C_dcTMQX.js} +3 -3
- package/dist/component/{gitGraphDiagram-PVQCEYII-DLcn7CA-.js → gitGraphDiagram-PVQCEYII-CIKPPQiC.js} +4 -4
- package/dist/component/{highlighted-body-OFNGDK62-C7pDeGQU.js → highlighted-body-OFNGDK62-DpP1DD9S.js} +2 -2
- package/dist/component/index.js +2 -2
- package/dist/component/{infoDiagram-5YYISTIA-BuR4-KVY.js → infoDiagram-5YYISTIA-DKTrvjCm.js} +2 -2
- package/dist/component/{ishikawaDiagram-YF4QCWOH-DlsfzgFK.js → ishikawaDiagram-YF4QCWOH-BcuncMnU.js} +2 -2
- package/dist/component/{journeyDiagram-JHISSGLW-D0rpdvR5.js → journeyDiagram-JHISSGLW-BTTgY3Of.js} +5 -5
- package/dist/component/{kanban-definition-UN3LZRKU-Cz0Dixqc.js → kanban-definition-UN3LZRKU-D9K5810E.js} +3 -3
- package/dist/component/{linear-BVVr39mA.js → linear-DondfmT2.js} +2 -2
- package/dist/component/{mermaid-GHXKKRXX-BEhqkLaB.js → mermaid-GHXKKRXX-j_0KsvYs.js} +27289 -27871
- package/dist/component/{mindmap-definition-RKZ34NQL-wo3l0Jy7.js → mindmap-definition-RKZ34NQL-DMC3vCUq.js} +4 -4
- package/dist/component/{pieDiagram-4H26LBE5-TtxT_WMN.js → pieDiagram-4H26LBE5-DmYi_D3l.js} +4 -4
- package/dist/component/{quadrantDiagram-W4KKPZXB-DK6ShvdY.js → quadrantDiagram-W4KKPZXB-DMos-d69.js} +3 -3
- package/dist/component/{requirementDiagram-4Y6WPE33-Z0IavHMQ.js → requirementDiagram-4Y6WPE33-BpgIfnhZ.js} +4 -4
- package/dist/component/{sankeyDiagram-5OEKKPKP-C408nFHk.js → sankeyDiagram-5OEKKPKP-xbJGp8Ms.js} +2 -2
- package/dist/component/{sequenceDiagram-3UESZ5HK-CMFVhmkn.js → sequenceDiagram-3UESZ5HK-Bnlm4mVO.js} +4 -4
- package/dist/component/{stateDiagram-AJRCARHV-C6Z5V-Yt.js → stateDiagram-AJRCARHV-BIooqMYf.js} +3 -3
- package/dist/component/{stateDiagram-v2-BHNVJYJU-CztCn1yf.js → stateDiagram-v2-BHNVJYJU-C6WAOCCe.js} +3 -3
- package/dist/component/{timeline-definition-PNZ67QCA-D_9a8hKa.js → timeline-definition-PNZ67QCA-lTe5jbcD.js} +3 -3
- package/dist/component/{vennDiagram-CIIHVFJN-HuWQgr4e.js → vennDiagram-CIIHVFJN-5RYbksB1.js} +2 -2
- package/dist/component/{wardleyDiagram-YWT4CUSO-CeUvdi76.js → wardleyDiagram-YWT4CUSO-BSz_UDND.js} +3 -3
- package/dist/component/{xychartDiagram-2RQKCTM6-DNmBGn_r.js → xychartDiagram-2RQKCTM6-BmzhiB0a.js} +3 -3
- package/dist/components/embed/EmbedHeader.d.ts +11 -4
- package/dist/components/embed/rail-flags.d.ts +10 -0
- package/dist/embed/voice/call-active-marker.d.ts +75 -19
- package/dist/embed/voice/line-dispatch.d.ts +22 -20
- package/dist/embed/voice/realtime-call.d.ts +12 -0
- package/dist/embed/voice/reconnect-offer.d.ts +14 -5
- package/dist/embed/voice-call-lines.d.ts +4 -25
- package/dist/embed/voice-call.d.ts +112 -73
- package/dist/i18n/messages/en.d.ts +12 -6
- package/dist/i18n/messages/surfaces/embedMisc.d.ts +0 -3
- package/dist/i18n/messages/surfaces/stream.d.ts +28 -0
- package/dist/stream/run-line-progress.d.ts +6 -5
- package/dist/stream/tool-action-label.d.ts +16 -0
- package/package.json +1 -1
- package/dist/components/embed/PoweredByBelong.d.ts +0 -7
- package/dist/embed/voice/agent-queue.d.ts +0 -106
- package/dist/embed/voice/call-roster-store.d.ts +0 -110
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AgentLineStatus } from './voice-call-lines.ts';
|
|
2
2
|
import { WorkPhase } from './voice-narration.ts';
|
|
3
|
+
import { CallDialOrigin } from './voice/call-active-marker.ts';
|
|
3
4
|
export type CallStatus = "idle" | "connecting" | "in_call" | "error";
|
|
4
5
|
/**
|
|
5
6
|
* One row of the call's execution timeline (the CallScreen activity card):
|
|
@@ -11,12 +12,15 @@ export type CallTimelineEntry = {
|
|
|
11
12
|
readonly id: number;
|
|
12
13
|
readonly atMs: number;
|
|
13
14
|
readonly kind: "user" | "agent" | "step" | "success" | "error" | "skill" | "schedule";
|
|
15
|
+
/** What the row SAYS. Empty for the two terminal kinds (`success`/`error`),
|
|
16
|
+
* whose whole meaning is the kind itself — CallScreen renders their own
|
|
17
|
+
* label and ignores this. See {@link TEXTLESS_KINDS}. */
|
|
14
18
|
readonly text: string;
|
|
15
19
|
/** The switchboard line this row concerns; `null` for a foreground (line 1)
|
|
16
|
-
* row.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
+
* row. Bookkeeping only — no surface labels a row with an agent name any
|
|
21
|
+
* more (there is one agent, and it is the chat on screen), so this exists
|
|
22
|
+
* so a marker written for a background line can be told apart from one
|
|
23
|
+
* written for the foreground. */
|
|
20
24
|
readonly line: number | null;
|
|
21
25
|
};
|
|
22
26
|
export type CallState = {
|
|
@@ -39,20 +43,63 @@ export type CallState = {
|
|
|
39
43
|
/** True between the user finishing an utterance and the model responding —
|
|
40
44
|
* the "Thinking…" window on the call screen. */
|
|
41
45
|
readonly thinking: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Why the dial currently in flight (or the call it produced) happened —
|
|
48
|
+
* `"user"` for one the user asked for, `"redial"` for a reconnect. Set on
|
|
49
|
+
* the `connecting` transition and read back by two very different consumers:
|
|
50
|
+
* the marker write below (a reconnect CONTINUES the interrupted call's
|
|
51
|
+
* redial streak) and CallScreen, which says "Reconnecting…" rather than
|
|
52
|
+
* "Connecting…" so a microphone that reopened on its own explains itself.
|
|
53
|
+
*/
|
|
54
|
+
readonly dialOrigin: CallDialOrigin;
|
|
42
55
|
/** Wall-clock start of the current call; 0 while idle. */
|
|
43
56
|
readonly callStartedAtMs: number;
|
|
44
57
|
/** Rolling execution timeline, oldest first (capped). */
|
|
45
58
|
readonly timeline: readonly CallTimelineEntry[];
|
|
59
|
+
/** The browser REFUSED to play the agent's audio (autoplay is a request,
|
|
60
|
+
* not a guarantee — an automatically redialed call after a page reload has
|
|
61
|
+
* no fresh user gesture behind it). Drives CallScreen's one-tap "Tap to
|
|
62
|
+
* hear" control; {@link resumeCallAudio} clears it. */
|
|
63
|
+
readonly audioBlocked: boolean;
|
|
46
64
|
readonly errorMessage?: string;
|
|
47
65
|
};
|
|
48
66
|
/**
|
|
49
|
-
* ChatRoute pushes
|
|
50
|
-
*
|
|
67
|
+
* ChatRoute pushes a call-relevant NOTICE onto the timeline — the sentences
|
|
68
|
+
* that explain why nothing ran (a skill lookup miss, a catalog that hasn't
|
|
69
|
+
* loaded), an artifact that opened on screen, a voice-resolved approval.
|
|
70
|
+
* No-op when no call is active.
|
|
71
|
+
*
|
|
72
|
+
* `step` is the only kind ChatRoute writes: it is the one kind whose TEXT is
|
|
73
|
+
* rendered (a `success`/`error` row is its kind label and nothing else — see
|
|
74
|
+
* {@link TEXTLESS_KINDS}), so a notice pushed as anything else would have its
|
|
75
|
+
* sentence silently dropped.
|
|
76
|
+
*
|
|
77
|
+
* Keeps the consecutive-identical-row window: these are free-form sentences
|
|
78
|
+
* written from event handlers that can fire twice on one underlying fact (the
|
|
79
|
+
* voice re-asking for the same missing skill, say), and a verbatim repeat
|
|
80
|
+
* seconds apart says nothing new. The agent's own ACTION rows are the
|
|
81
|
+
* opposite case and have their own entry point — {@link pushCallAction}.
|
|
51
82
|
*/
|
|
52
83
|
export declare const pushCallStep: (text: string) => void;
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
55
|
-
|
|
84
|
+
/**
|
|
85
|
+
* ChatRoute pushes one ACTION onto the call timeline — one line per thing the
|
|
86
|
+
* agent did ("Read a file", "Ran a command"). No-op when no call is active.
|
|
87
|
+
*
|
|
88
|
+
* Deliberately NOT {@link pushCallStep}: the action vocabulary
|
|
89
|
+
* (`tool-action-label.ts`) is a fixed ~15-string set of parameterless
|
|
90
|
+
* constants, so "read three files" is three BYTE-IDENTICAL rows and the
|
|
91
|
+
* dedupe window folded them into one — an agent that read three files logged
|
|
92
|
+
* one, and five unrecognized tools (all "Worked on it") logged one. On a
|
|
93
|
+
* surface whose whole job is "let me follow along while I listen", that is
|
|
94
|
+
* the difference between working and not.
|
|
95
|
+
*
|
|
96
|
+
* Safe to opt out because this call site is already idempotent at source:
|
|
97
|
+
* chat.tsx's `loggedActionPartIdsRef` keys on the tool-call PART id, so the
|
|
98
|
+
* same call re-arriving as started → completed writes exactly one row. Same
|
|
99
|
+
* reasoning, same opt-out, as the terminal markers in `deliverAgentReply` /
|
|
100
|
+
* `deliverAgentFailure`.
|
|
101
|
+
*/
|
|
102
|
+
export declare const pushCallAction: (text: string) => void;
|
|
56
103
|
/** Hard ceiling on the rendered digest — a compact recap, not a transcript. */
|
|
57
104
|
export declare const CONTEXT_DIGEST_MAX_CHARS = 1000;
|
|
58
105
|
/**
|
|
@@ -116,44 +163,6 @@ declare let lineDispatcher: ((req: {
|
|
|
116
163
|
readonly isNewLine: boolean;
|
|
117
164
|
}) => void) | null;
|
|
118
165
|
export declare const registerCallLineDispatcher: (dispatcher: NonNullable<typeof lineDispatcher>) => (() => void);
|
|
119
|
-
/**
|
|
120
|
-
* Last-resort delivery for `flushLineQueuesOnCallEnd` when no `lineDispatcher`
|
|
121
|
-
* is wired (the M7 gap — ChatRoute unmounted). Self-registered by
|
|
122
|
-
* line-dispatch.ts (see the bottom of that file) with the real
|
|
123
|
-
* `dispatchToLine` — deliberately NOT imported here directly. `line-dispatch.ts`
|
|
124
|
-
* already imports six functions FROM this module (buildCallContextDigest,
|
|
125
|
-
* the deliver/notify callbacks, peekCallState, subscribeCallState), so a
|
|
126
|
-
* static import the other way would close a two-way cycle between
|
|
127
|
-
* voice-call.ts and line-dispatch.ts — forbidden outright by
|
|
128
|
-
* `.dependency-cruiser.cjs`'s `no-circular` rule (severity: error, applies
|
|
129
|
-
* everywhere, not just the hexagonal backend layers). Registering FROM
|
|
130
|
-
* line-dispatch.ts, in the SAME direction its existing dependency already
|
|
131
|
-
* runs, avoids the cycle entirely; that file's own `subscribeCallState`
|
|
132
|
-
* self-subscribe (its module doc, right above `abortAllLineReaders`) is the
|
|
133
|
-
* identical idiom already established there.
|
|
134
|
-
*
|
|
135
|
-
* Investigated and confirmed SOUND as a fallback: chat.tsx's own
|
|
136
|
-
* `registerCallLineDispatcher` wrapper does nothing beyond routing line 1 to
|
|
137
|
-
* `sendCallText` and calling this exact function, unmodified, for any other
|
|
138
|
-
* line — see that effect in chat.tsx. Held/queued items only ever exist for
|
|
139
|
-
* background lines (line 1 never enqueues — see the busy-line branch above),
|
|
140
|
-
* so every item this fallback ever sees is exactly the shape ChatRoute's
|
|
141
|
-
* wrapper would have passed through unchanged. No ChatRoute-specific
|
|
142
|
-
* behavior is lost by calling it directly.
|
|
143
|
-
*
|
|
144
|
-
* Deliberately SEPARATE from `lineDispatcher` — not folded into
|
|
145
|
-
* `releaseHeldRequest` itself — so `pumpLineQueue`'s live-queue draining is
|
|
146
|
-
* UNAFFECTED: it must keep checking `lineDispatcher` and leaving an item
|
|
147
|
-
* queued (not popped) when nothing is wired, per its own doc. Only the
|
|
148
|
-
* end-of-call flush, which has nothing left to leave a drained item queued
|
|
149
|
-
* IN, reaches for this.
|
|
150
|
-
*/
|
|
151
|
-
declare let lineDispatchFallback: ((req: {
|
|
152
|
-
readonly line: number;
|
|
153
|
-
readonly request: string;
|
|
154
|
-
readonly isNewLine: boolean;
|
|
155
|
-
}) => Promise<void>) | null;
|
|
156
|
-
export declare const registerLineDispatchFallback: (dispatcher: NonNullable<typeof lineDispatchFallback>) => (() => void);
|
|
157
166
|
export declare const registerCallLineViewSwitcher: (switcher: (sessionId: string) => void) => (() => void);
|
|
158
167
|
export declare const registerCallClearNotifier: (notifier: (sessionId: string) => void) => (() => void);
|
|
159
168
|
/**
|
|
@@ -174,10 +183,11 @@ export declare const notifyCallProgress: (hint: string) => void;
|
|
|
174
183
|
* small work badge while the agent is busy. */
|
|
175
184
|
export declare const setCallWorkPhase: (phase: CallState["workPhase"]) => void;
|
|
176
185
|
/**
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
186
|
+
* The lines strip chip on CallScreen calls this directly (no tool-call round
|
|
187
|
+
* trip, no ack — there is no voice tool for it any more, which is why nothing
|
|
188
|
+
* here reports an outcome): switch the chat panel to the line's session and
|
|
189
|
+
* minimize the call screen. No-op when the line is unknown, never bound to a
|
|
190
|
+
* session, or no view switcher is registered (e.g. ChatRoute hasn't mounted).
|
|
181
191
|
*/
|
|
182
192
|
export declare const showLineOnScreen: (line: number) => void;
|
|
183
193
|
/**
|
|
@@ -198,7 +208,41 @@ export declare const showLineOnScreen: (line: number) => void;
|
|
|
198
208
|
export declare const startCall: (options?: {
|
|
199
209
|
readonly isReconnect?: boolean;
|
|
200
210
|
}) => Promise<void>;
|
|
211
|
+
/**
|
|
212
|
+
* The error panel's "Call again". Dials as a RECONNECT whenever an interrupted
|
|
213
|
+
* call's marker is still there — which, by `keepsCallActiveMarker`, is exactly
|
|
214
|
+
* the case worth reconnecting to: a redial that never became a call. Its
|
|
215
|
+
* `contextDigest` is the only surviving record of what the user was doing, so
|
|
216
|
+
* a bare `startCall()` here opened a COLD call the user had to re-explain,
|
|
217
|
+
* while the recap the failure path deliberately preserved went unread.
|
|
218
|
+
*
|
|
219
|
+
* Deliberately does NOT dismiss the error first: `dismissCallError`'s idle
|
|
220
|
+
* transition is one of the two moments allowed to keep the marker, but only
|
|
221
|
+
* because ✕ means "put the panel away" — routing a RETRY through it would
|
|
222
|
+
* still hand `startCall` a marker whose digest it had to re-read after a
|
|
223
|
+
* needless round trip. `startCall`'s own `connecting` patch replaces the error
|
|
224
|
+
* state (and its panel) synchronously, so there is nothing left to dismiss.
|
|
225
|
+
*/
|
|
226
|
+
export declare const retryCall: () => Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* Hang up. The one ending that is an explicit GIVE-UP, so it always takes the
|
|
229
|
+
* interrupted call's marker and any standing reconnect offer with it — stated
|
|
230
|
+
* here rather than left to `keepsCallActiveMarker`, whose `error → idle`
|
|
231
|
+
* branch exists for the ✕ that merely puts the error panel away. Both clears
|
|
232
|
+
* run BEFORE the transition, so that branch sees no marker and agrees.
|
|
233
|
+
*/
|
|
201
234
|
export declare const endCall: () => void;
|
|
235
|
+
/**
|
|
236
|
+
* The user tapped "Tap to hear" — ask the browser to play the agent's audio
|
|
237
|
+
* again, now that a real gesture is on the stack, and take the control down
|
|
238
|
+
* only once playback has ACTUALLY started. Clearing it optimistically would
|
|
239
|
+
* leave a silent call with nothing left to tap.
|
|
240
|
+
*
|
|
241
|
+
* Deliberately not `async`: CallScreen calls this straight from the click
|
|
242
|
+
* handler, and the transport's `play()` runs before the first await, so the
|
|
243
|
+
* gesture the browser is holding out for is still on the stack.
|
|
244
|
+
*/
|
|
245
|
+
export declare const resumeCallAudio: () => void;
|
|
202
246
|
export declare const toggleCallMuted: () => void;
|
|
203
247
|
/** Dismiss a sticky error state (the overlay's ✕). */
|
|
204
248
|
export declare const dismissCallError: () => void;
|
|
@@ -218,9 +262,9 @@ export declare const deliverAgentReply: (text: string) => void;
|
|
|
218
262
|
* must tell the user something went wrong and offer to retry.
|
|
219
263
|
*/
|
|
220
264
|
export declare const deliverAgentFailure: (message: string) => void;
|
|
221
|
-
/** A background line finished:
|
|
222
|
-
*
|
|
223
|
-
export declare const deliverLineReply: (line: number
|
|
265
|
+
/** A background line finished: converge its chip. Nothing is spoken — see
|
|
266
|
+
* this section's header. */
|
|
267
|
+
export declare const deliverLineReply: (line: number) => void;
|
|
224
268
|
/**
|
|
225
269
|
* A background line published an artifact: OPEN it on screen, mirroring
|
|
226
270
|
* chat.tsx's foreground auto-open effect exactly — ALWAYS docked (a persisted
|
|
@@ -234,26 +278,21 @@ export declare const deliverLineArtifact: (line: number, artifact: {
|
|
|
234
278
|
readonly title: string;
|
|
235
279
|
readonly mimeType: string;
|
|
236
280
|
}) => void;
|
|
237
|
-
/** A background line failed:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
|
|
245
|
-
export declare const notifyLineApprovalNeeded: (line: number, timelineText: string, reason: string) => void;
|
|
281
|
+
/** A background line failed: converge its chip. Nothing is spoken — see this
|
|
282
|
+
* section's header. */
|
|
283
|
+
export declare const deliverLineFailure: (line: number) => void;
|
|
284
|
+
/** A background line is blocked on a tool approval — paint its chip. The
|
|
285
|
+
* approval itself is resolved from the rail's typed chat, on screen, where
|
|
286
|
+
* the user can read what is being approved; the call is not told, and takes
|
|
287
|
+
* no `reason`, because it has no way to name whose approval it is. */
|
|
288
|
+
export declare const notifyLineApprovalNeeded: (line: number) => void;
|
|
246
289
|
/** A background line advanced a phase — record it as the line's live step
|
|
247
|
-
* (CallScreen's agent board
|
|
248
|
-
*
|
|
249
|
-
* phase change
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
* front. The registry write is unconditional (line-dispatch's own `isStale`
|
|
254
|
-
* guard already keeps a stale-call phase from ever reaching here); the
|
|
255
|
-
* spoken nudge stays guarded like its delivery siblings so a phase that DOES
|
|
256
|
-
* arrive with no live call just updates the board silently. */
|
|
290
|
+
* (CallScreen's agent board and the rail read `currentStepLabel`/
|
|
291
|
+
* `currentPhase` off the registry). X2a: deliberately NO timeline row per
|
|
292
|
+
* phase change — the board's own card already shows the identical string
|
|
293
|
+
* live, and a 12-step run used to write 12 near-identical Activity rows that
|
|
294
|
+
* buried the actual results. The write is unconditional: line-dispatch's own
|
|
295
|
+
* `isStale` guard already keeps a stale-call phase from ever reaching here. */
|
|
257
296
|
export declare const notifyLinePhase: (line: number, phaseLabel: string, phase?: WorkPhase | null) => void;
|
|
258
297
|
/** True while a call holds the audio path — ChatRoute gates TTS autoplay on it. */
|
|
259
298
|
export declare const isCallActive: () => boolean;
|
|
@@ -63,6 +63,15 @@ export declare const en: {
|
|
|
63
63
|
readonly browserAssertCreated: "Checked for an existing resource";
|
|
64
64
|
readonly browserRefreshView: "Refreshed the page";
|
|
65
65
|
readonly failedBadge: "failed";
|
|
66
|
+
readonly actionReadFile: "Read a file";
|
|
67
|
+
readonly actionWroteFile: "Updated a file";
|
|
68
|
+
readonly actionPublishedArtifact: "Put a report on screen";
|
|
69
|
+
readonly actionLookedUpSkill: "Looked up a skill";
|
|
70
|
+
readonly actionSubTask: "Worked through a sub-task";
|
|
71
|
+
readonly actionMadePlan: "Put a plan together";
|
|
72
|
+
readonly actionCheckedRules: "Checked the rules";
|
|
73
|
+
readonly actionScheduledTask: "Set up a scheduled task";
|
|
74
|
+
readonly actionGeneric: "Worked on it";
|
|
66
75
|
readonly executingTasks: "Working on it…";
|
|
67
76
|
readonly workedSteps_one: "Worked · {{count}} step";
|
|
68
77
|
readonly workedSteps_other: "Worked · {{count}} steps";
|
|
@@ -332,7 +341,6 @@ export declare const en: {
|
|
|
332
341
|
readonly thisFile: "this file";
|
|
333
342
|
readonly download: "Download";
|
|
334
343
|
readonly loadingPreview: "Loading preview…";
|
|
335
|
-
readonly poweredByBelong: "Powered by Belong";
|
|
336
344
|
readonly devDefault: "default";
|
|
337
345
|
readonly devModelIdPlaceholder: "model id (blank = env default)";
|
|
338
346
|
readonly devModelIdTitle: "Exact model id for the selected provider — overrides the env pin";
|
|
@@ -489,6 +497,7 @@ export declare const en: {
|
|
|
489
497
|
readonly callScreen: {
|
|
490
498
|
readonly title: "Voice call";
|
|
491
499
|
readonly connecting: "Connecting the call…";
|
|
500
|
+
readonly reconnecting: "Reconnecting the call…";
|
|
492
501
|
readonly listening: "Listening";
|
|
493
502
|
readonly speaking: "Speaking";
|
|
494
503
|
readonly working: "Working on it…";
|
|
@@ -496,6 +505,7 @@ export declare const en: {
|
|
|
496
505
|
readonly youSaid: "You said";
|
|
497
506
|
readonly agentSaid: "Agent";
|
|
498
507
|
readonly speakHint: "Speak to the agent…";
|
|
508
|
+
readonly tapToHear: "Tap to hear the call";
|
|
499
509
|
readonly readyHint: "I'm listening — speak when you're ready.";
|
|
500
510
|
readonly thinkingHint: "Thinking…";
|
|
501
511
|
readonly speakingHint: "Speaking…";
|
|
@@ -516,13 +526,9 @@ export declare const en: {
|
|
|
516
526
|
readonly phaseCoding: "Putting the steps together";
|
|
517
527
|
readonly phaseFiles: "Going through your data";
|
|
518
528
|
readonly phaseActions: "Running the steps";
|
|
519
|
-
readonly
|
|
529
|
+
readonly agentStatus: "Agent status";
|
|
520
530
|
readonly lineLabel: "Agent {{line}}";
|
|
521
531
|
readonly mainAgentLabel: "Main agent";
|
|
522
|
-
readonly roleLabelMain: "Main agent";
|
|
523
|
-
readonly roleLabelCli: "{{product}} CLI agent";
|
|
524
|
-
readonly roleLabelTerminal: "Terminal agent";
|
|
525
|
-
readonly roleLabelAnalyst: "Analyst";
|
|
526
532
|
readonly lineNeedsApproval: "Needs your OK";
|
|
527
533
|
readonly lineWorking: "Working…";
|
|
528
534
|
readonly lineReady: "Done";
|
|
@@ -31,7 +31,6 @@ export declare const embedMiscEn: {
|
|
|
31
31
|
readonly thisFile: "this file";
|
|
32
32
|
readonly download: "Download";
|
|
33
33
|
readonly loadingPreview: "Loading preview…";
|
|
34
|
-
readonly poweredByBelong: "Powered by Belong";
|
|
35
34
|
readonly devDefault: "default";
|
|
36
35
|
readonly devModelIdPlaceholder: "model id (blank = env default)";
|
|
37
36
|
readonly devModelIdTitle: "Exact model id for the selected provider — overrides the env pin";
|
|
@@ -77,7 +76,6 @@ export declare const embedMiscEs: {
|
|
|
77
76
|
thisFile: string;
|
|
78
77
|
download: string;
|
|
79
78
|
loadingPreview: string;
|
|
80
|
-
poweredByBelong: string;
|
|
81
79
|
devDefault: string;
|
|
82
80
|
devModelIdPlaceholder: string;
|
|
83
81
|
devModelIdTitle: string;
|
|
@@ -123,7 +121,6 @@ export declare const embedMiscPt: {
|
|
|
123
121
|
thisFile: string;
|
|
124
122
|
download: string;
|
|
125
123
|
loadingPreview: string;
|
|
126
|
-
poweredByBelong: string;
|
|
127
124
|
devDefault: string;
|
|
128
125
|
devModelIdPlaceholder: string;
|
|
129
126
|
devModelIdTitle: string;
|
|
@@ -63,6 +63,16 @@ export declare const streamEn: {
|
|
|
63
63
|
readonly browserAssertCreated: "Checked for an existing resource";
|
|
64
64
|
readonly browserRefreshView: "Refreshed the page";
|
|
65
65
|
readonly failedBadge: "failed";
|
|
66
|
+
readonly actionReadFile: "Read a file";
|
|
67
|
+
readonly actionWroteFile: "Updated a file";
|
|
68
|
+
readonly actionPublishedArtifact: "Put a report on screen";
|
|
69
|
+
readonly actionLookedUpSkill: "Looked up a skill";
|
|
70
|
+
readonly actionSubTask: "Worked through a sub-task";
|
|
71
|
+
readonly actionMadePlan: "Put a plan together";
|
|
72
|
+
readonly actionCheckedRules: "Checked the rules";
|
|
73
|
+
readonly actionScheduledTask: "Set up a scheduled task";
|
|
74
|
+
/** A tool this build has no copy for — a neutral line, never its name. */
|
|
75
|
+
readonly actionGeneric: "Worked on it";
|
|
66
76
|
readonly executingTasks: "Working on it…";
|
|
67
77
|
readonly workedSteps_one: "Worked · {{count}} step";
|
|
68
78
|
readonly workedSteps_other: "Worked · {{count}} steps";
|
|
@@ -144,6 +154,15 @@ export declare const streamEs: {
|
|
|
144
154
|
browserAssertCreated: string;
|
|
145
155
|
browserRefreshView: string;
|
|
146
156
|
failedBadge: string;
|
|
157
|
+
actionReadFile: string;
|
|
158
|
+
actionWroteFile: string;
|
|
159
|
+
actionPublishedArtifact: string;
|
|
160
|
+
actionLookedUpSkill: string;
|
|
161
|
+
actionSubTask: string;
|
|
162
|
+
actionMadePlan: string;
|
|
163
|
+
actionCheckedRules: string;
|
|
164
|
+
actionScheduledTask: string;
|
|
165
|
+
actionGeneric: string;
|
|
147
166
|
executingTasks: string;
|
|
148
167
|
workedSteps_one: string;
|
|
149
168
|
workedSteps_other: string;
|
|
@@ -224,6 +243,15 @@ export declare const streamPt: {
|
|
|
224
243
|
browserAssertCreated: string;
|
|
225
244
|
browserRefreshView: string;
|
|
226
245
|
failedBadge: string;
|
|
246
|
+
actionReadFile: string;
|
|
247
|
+
actionWroteFile: string;
|
|
248
|
+
actionPublishedArtifact: string;
|
|
249
|
+
actionLookedUpSkill: string;
|
|
250
|
+
actionSubTask: string;
|
|
251
|
+
actionMadePlan: string;
|
|
252
|
+
actionCheckedRules: string;
|
|
253
|
+
actionScheduledTask: string;
|
|
254
|
+
actionGeneric: string;
|
|
227
255
|
executingTasks: string;
|
|
228
256
|
workedSteps_one: string;
|
|
229
257
|
workedSteps_other: string;
|
|
@@ -6,11 +6,12 @@ import { RunStatusKind } from './belong-data-parts.ts';
|
|
|
6
6
|
* turn that only writes text calls no tools, so `tool_started` never fires and
|
|
7
7
|
* the chip would otherwise sit at "idle" through the whole answer.
|
|
8
8
|
*
|
|
9
|
-
* There is deliberately NO `text` variant. An accumulator feeding
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* answer. Re-add
|
|
9
|
+
* There is deliberately NO `text` variant. An accumulator feeding a per-line
|
|
10
|
+
* "last result text" field was specified and dropped: nothing in the dock
|
|
11
|
+
* renders such a field (the registry no longer even carries one), and because
|
|
12
|
+
* this seam no-ops while the session is on screen the accumulator could only
|
|
13
|
+
* ever have collected the post-switch TAIL of an answer. Re-add both when
|
|
14
|
+
* something renders it.
|
|
14
15
|
*
|
|
15
16
|
* `terminal` carries the run's OWN id, and it is not decoration: the durable
|
|
16
17
|
* slot runId this seam clears is shared with the voice dispatch, and a line can
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TFunction } from 'i18next';
|
|
2
|
+
export type ToolActionLabel = {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* The neutral line for a tool this build has never heard of. Exported because
|
|
7
|
+
* `browserStepMeta` branches on it: an unrecognized `browser_*` suffix keeps
|
|
8
|
+
* the chat's own sentence-cased fallback instead of this.
|
|
9
|
+
*/
|
|
10
|
+
export declare const GENERIC_ACTION_KEY = "stream.actionGeneric";
|
|
11
|
+
/**
|
|
12
|
+
* `t(...)` over a `ToolActionLabel` — the ONE way either surface renders one,
|
|
13
|
+
* so the two can't drift into two different names for the same action.
|
|
14
|
+
*/
|
|
15
|
+
export declare const translateAction: (t: TFunction, action: ToolActionLabel) => string;
|
|
16
|
+
export declare const toolActionLabel: (toolName: string) => ToolActionLabel | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@belonguniverseai/react-sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
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,7 +0,0 @@
|
|
|
1
|
-
/** Fixed footer height (px) so the terminal overlay can reserve exact space. */
|
|
2
|
-
export declare const POWERED_BY_BELONG_HEIGHT_PX = 28;
|
|
3
|
-
/**
|
|
4
|
-
* Persistent attribution strip pinned to the bottom of the dock panel when a
|
|
5
|
-
* tenant brand is active. Always the Belong mark (not the tenant BrandMark).
|
|
6
|
-
*/
|
|
7
|
-
export declare function PoweredByBelong(): import("react").JSX.Element;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-line FIFO for work an operator asks an agent to do WHILE that agent is
|
|
3
|
-
* already busy — the structure behind "queue two things on Agent 2, then
|
|
4
|
-
* drop one" (Slice 3 of the voice-operator plan). File-scope-singleton
|
|
5
|
-
* idiom, same as `line-slots.ts` / `voice-call-lines.ts` beside it: one
|
|
6
|
-
* module-level `Map<number, QueuedRequest[]>`, no class, no React.
|
|
7
|
-
*
|
|
8
|
-
* WHAT THIS REPLACES: today, sending work to a busy agent POSTs it
|
|
9
|
-
* immediately — the message lands in Postgres and the server's own drain
|
|
10
|
-
* loop (SAD §5.1 / CLAUDE.md §37) gets to it whenever the agent frees up.
|
|
11
|
-
* That queue is invisible (no way to ask "what's waiting for Agent 2?"),
|
|
12
|
-
* unorderable (no way to promote the third ask over the second), and
|
|
13
|
-
* undroppable (no way to take one back). This module is the queue moved
|
|
14
|
-
* into the browser, so a caller can read it back, drop an entry, or reorder
|
|
15
|
-
* it before anything is sent. (Wiring `dispatchToLine`'s busy-line path
|
|
16
|
-
* through this queue, and adding the voice-facing `manage_queue` tool, are
|
|
17
|
-
* later tasks — see NOT WIRED IN YET below.)
|
|
18
|
-
*
|
|
19
|
-
* WHY CALL-SCOPED AND NOT DURABLE — the trade-off, spelled out:
|
|
20
|
-
*
|
|
21
|
-
* - A held `QueuedRequest` lives ONLY in this in-memory Map. Today's
|
|
22
|
-
* behavior is strictly more durable: a queued follow-up is already
|
|
23
|
-
* POSTed and sitting in Postgres the instant the operator says it, so it
|
|
24
|
-
* survives a tab crash, a network blip, anything short of the session
|
|
25
|
-
* itself being deleted. Moving the queue into the browser gives up that
|
|
26
|
-
* durability in exchange for the operator being able to see and steer
|
|
27
|
-
* it — that is the entire point, and the trade needs to be made with
|
|
28
|
-
* open eyes, not by accident.
|
|
29
|
-
* - `drainAllQueues()` is what keeps that loss narrow. It is the hang-up
|
|
30
|
-
* flush: called as part of ending a call normally, it empties every
|
|
31
|
-
* line's queue and hands back everything that was waiting so it can be
|
|
32
|
-
* POSTed to the server exactly as if this module had never sat in front
|
|
33
|
-
* of it. A normal end-of-call therefore loses nothing — the queue is
|
|
34
|
-
* just a staging area the operator got to look inside before the same
|
|
35
|
-
* dispatch that would have happened anyway.
|
|
36
|
-
* - The durability genuinely AT RISK is narrower still than it first
|
|
37
|
-
* sounds: a live voice call is not something a page reload survives
|
|
38
|
-
* regardless of this module — there is no reload-resume contract for
|
|
39
|
-
* the call itself (unlike the §41 guarantee for an already-dispatched
|
|
40
|
-
* agent turn, which is a Postgres/Redis-backed run, not the call). So
|
|
41
|
-
* "a reload loses the queue" is not a NEW failure this module
|
|
42
|
-
* introduces; the call was already gone. What is genuinely new is the
|
|
43
|
-
* sliver between "something got queued" and "the call ends" during
|
|
44
|
-
* which the tab could crash before `drainAllQueues()` ever runs — a
|
|
45
|
-
* real but narrow window, and the one honest cost of this design.
|
|
46
|
-
*
|
|
47
|
-
* NOT WIRED IN YET: this ships as a standalone module with its own tests
|
|
48
|
-
* and no production caller. A later task connects `enqueueForLine` /
|
|
49
|
-
* `dequeueForLine` to `dispatchToLine`'s busy-line path and `drainAllQueues`
|
|
50
|
-
* to the hang-up handler; another adds the voice-facing `manage_queue` tool
|
|
51
|
-
* on top of `peekQueue` / `dropQueuedAt` / `moveQueued`.
|
|
52
|
-
*/
|
|
53
|
-
export type QueuedRequest = {
|
|
54
|
-
readonly id: string;
|
|
55
|
-
readonly request: string;
|
|
56
|
-
};
|
|
57
|
-
/** Append `request` to the back of `line`'s queue, minting a fresh id
|
|
58
|
-
* (`nanoid()`, the same generator `line-dispatch.ts` uses for
|
|
59
|
-
* `clientMessageId`). Always succeeds — there is no bound on queue depth. */
|
|
60
|
-
export declare const enqueueForLine: (line: number, request: string) => QueuedRequest;
|
|
61
|
-
/** Pop and return the FRONT of `line`'s queue, or `null` when it's empty. */
|
|
62
|
-
export declare const dequeueForLine: (line: number) => QueuedRequest | null;
|
|
63
|
-
/** A read-only snapshot of `line`'s queue, front to back. Never mutates. */
|
|
64
|
-
export declare const peekQueue: (line: number) => readonly QueuedRequest[];
|
|
65
|
-
/** How many requests are waiting on `line`. */
|
|
66
|
-
export declare const queueDepth: (line: number) => number;
|
|
67
|
-
/** Remove and return the item at `index` in `line`'s queue, or `null` when
|
|
68
|
-
* `index` is out of range — an explicit `< 0 || >= length` bound (§10: never
|
|
69
|
-
* truthiness on a length or index), so a bad index is an honest miss rather
|
|
70
|
-
* than a silent no-op that could be mistaken for success. */
|
|
71
|
-
export declare const dropQueuedAt: (line: number, index: number) => QueuedRequest | null;
|
|
72
|
-
/** Move the item at `from` to position `to` in `line`'s queue (both bounds
|
|
73
|
-
* explicit, same discipline as `dropQueuedAt`). Returns `false` — leaving
|
|
74
|
-
* the queue completely untouched — when either index is out of range;
|
|
75
|
-
* `true` on success, including the no-op case `from === to` (a valid index
|
|
76
|
-
* moved to itself: nothing changes, but the request was satisfied, not
|
|
77
|
-
* refused). `to` is a position in the queue AFTER `from` is removed — the
|
|
78
|
-
* standard "move to position N" reading: moving the last item to `to: 0`
|
|
79
|
-
* makes it the new front. */
|
|
80
|
-
export declare const moveQueued: (line: number, from: number, to: number) => boolean;
|
|
81
|
-
/** The hang-up flush: empty EVERY line's queue and return everything that
|
|
82
|
-
* was waiting, in line-then-position order (line ascending, FIFO within a
|
|
83
|
-
* line) — the order a normal end-of-call should hand work to the server in.
|
|
84
|
-
* Exhaustive by construction: every line the map holds is visited and
|
|
85
|
-
* cleared, so nothing can be left behind. See the module doc for why this
|
|
86
|
-
* is what makes the queue's in-memory-only durability trade-off safe for a
|
|
87
|
-
* normal call end. */
|
|
88
|
-
export declare const drainAllQueues: () => readonly {
|
|
89
|
-
readonly line: number;
|
|
90
|
-
readonly request: string;
|
|
91
|
-
}[];
|
|
92
|
-
/** The call-teardown clear: drop every line's queue without returning
|
|
93
|
-
* anything. Unlike `drainAllQueues`, this is for the paths that must not
|
|
94
|
-
* re-POST stale work — e.g. resetting state at the START of a fresh call. */
|
|
95
|
-
export declare const resetQueues: () => void;
|
|
96
|
-
/** Drop `line`'s held queue and report how many items were discarded — the
|
|
97
|
-
* ONE-line counterpart to `resetQueues()` (every line). For the paths that
|
|
98
|
-
* must not re-POST or re-dispatch one line's stale work without touching any
|
|
99
|
-
* other line's: `stop_agent` (voice-call.ts) clearing exactly the queue it
|
|
100
|
-
* just told the user was dropped, and `closeAgentLine` (voice-call-lines.ts)
|
|
101
|
-
* releasing a line whose held work must not resurrect onto the next
|
|
102
|
-
* occupant of the same number. An explicit `=== 0` check rather than
|
|
103
|
-
* truthiness (§10), same discipline as `dropQueuedAt`/`moveQueued`: a
|
|
104
|
-
* nothing-to-drop line reports `0` honestly instead of writing an empty
|
|
105
|
-
* array through `setQueue` for no reason. */
|
|
106
|
-
export declare const clearQueueForLine: (line: number) => number;
|