@belonguniverseai/react-sdk 0.4.3 → 0.5.0

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 (58) hide show
  1. package/dist/api/client.d.ts +7 -0
  2. package/dist/component/{arc-ByLm_58u.js → arc-CtyXH_sw.js} +2 -2
  3. package/dist/component/{architectureDiagram-3BPJPVTR-DcYT4v9Q.js → architectureDiagram-3BPJPVTR-C6NZifN6.js} +3 -3
  4. package/dist/component/{blockDiagram-GPEHLZMM-CHk-YSun.js → blockDiagram-GPEHLZMM-_-K66LP4.js} +4 -4
  5. package/dist/component/{c4Diagram-AAUBKEIU-CEV2fwh-.js → c4Diagram-AAUBKEIU-DL-K-sZW.js} +3 -3
  6. package/dist/component/{channel-D67v09ii.js → channel-scCA9sxi.js} +2 -2
  7. package/dist/component/{chunk-2J33WTMH-Bsl2GBCp.js → chunk-2J33WTMH-Dkd9OyM1.js} +2 -2
  8. package/dist/component/{chunk-4BX2VUAB-BKmdmdRY.js → chunk-4BX2VUAB-JbEXcQ3q.js} +2 -2
  9. package/dist/component/{chunk-55IACEB6-DnliqOsL.js → chunk-55IACEB6-Dg96dHvQ.js} +2 -2
  10. package/dist/component/{chunk-727SXJPM-O0BgSnK_.js → chunk-727SXJPM-Cu3-awqi.js} +6 -6
  11. package/dist/component/{chunk-AQP2D5EJ-CwBA3VVY.js → chunk-AQP2D5EJ-DLX62MPh.js} +4 -4
  12. package/dist/component/{chunk-FMBD7UC4-CG5DaKp9.js → chunk-FMBD7UC4-BxU0KQRK.js} +2 -2
  13. package/dist/component/{chunk-ND2GUHAM-COsoTCa0.js → chunk-ND2GUHAM-CEQj3so6.js} +2 -2
  14. package/dist/component/{chunk-QZHKN3VN-9FjIin4_.js → chunk-QZHKN3VN-BWgwT04-.js} +2 -2
  15. package/dist/component/{classDiagram-4FO5ZUOK-DyQO35S9.js → classDiagram-4FO5ZUOK-Ton6m2pw.js} +3 -3
  16. package/dist/component/{classDiagram-v2-Q7XG4LA2-DyQO35S9.js → classDiagram-v2-Q7XG4LA2-Ton6m2pw.js} +3 -3
  17. package/dist/component/{cose-bilkent-S5V4N54A-BTN6Bz9E.js → cose-bilkent-S5V4N54A-Dja09hp6.js} +2 -2
  18. package/dist/component/{dagre-BM42HDAG-COU3yvtF.js → dagre-BM42HDAG-Ch6fODe-.js} +2 -2
  19. package/dist/component/{diagram-2AECGRRQ-r4LO_uyu.js → diagram-2AECGRRQ-DdDr6tHi.js} +3 -3
  20. package/dist/component/{diagram-5GNKFQAL-CraSe8h_.js → diagram-5GNKFQAL-BT2qfjUH.js} +4 -4
  21. package/dist/component/{diagram-KO2AKTUF-Dh-L6_aX.js → diagram-KO2AKTUF-UcWrBVNK.js} +3 -3
  22. package/dist/component/{diagram-LMA3HP47-Bv8QREaH.js → diagram-LMA3HP47-D-BCOeIt.js} +3 -3
  23. package/dist/component/{diagram-OG6HWLK6-Jf-6CDV4.js → diagram-OG6HWLK6-CJDJgfQO.js} +4 -4
  24. package/dist/component/{erDiagram-TEJ5UH35-CN8X2drH.js → erDiagram-TEJ5UH35-kY5sdKqg.js} +5 -5
  25. package/dist/component/{flowDiagram-I6XJVG4X-CloAsK8k.js → flowDiagram-I6XJVG4X-9OddgRiE.js} +7 -7
  26. package/dist/component/{ganttDiagram-6RSMTGT7-DAlRM4jt.js → ganttDiagram-6RSMTGT7-Dc9t8llA.js} +3 -3
  27. package/dist/component/{gitGraphDiagram-PVQCEYII-BPVdEwuf.js → gitGraphDiagram-PVQCEYII-DYjn9Ff5.js} +4 -4
  28. package/dist/component/{highlighted-body-OFNGDK62-BEd7ynwt.js → highlighted-body-OFNGDK62-D_TDzrFY.js} +2 -2
  29. package/dist/component/index.js +1 -1
  30. package/dist/component/{infoDiagram-5YYISTIA-CyJi6c7l.js → infoDiagram-5YYISTIA-CBPoKi7E.js} +2 -2
  31. package/dist/component/{ishikawaDiagram-YF4QCWOH-CNKCQHOP.js → ishikawaDiagram-YF4QCWOH-C3rChBg5.js} +2 -2
  32. package/dist/component/{journeyDiagram-JHISSGLW-DFN0WY5F.js → journeyDiagram-JHISSGLW-DVTybrGG.js} +5 -5
  33. package/dist/component/{kanban-definition-UN3LZRKU-BT6YDPZA.js → kanban-definition-UN3LZRKU-DNMLC4NQ.js} +3 -3
  34. package/dist/component/{linear-BcyQd0z0.js → linear-B_oPUR6_.js} +2 -2
  35. package/dist/component/{mermaid-GHXKKRXX-DiPCfS1n.js → mermaid-GHXKKRXX-CjZr9GWr.js} +23673 -23265
  36. package/dist/component/{mindmap-definition-RKZ34NQL-BND7KvId.js → mindmap-definition-RKZ34NQL-CErhrdm3.js} +4 -4
  37. package/dist/component/{pieDiagram-4H26LBE5-CvDdRFnN.js → pieDiagram-4H26LBE5-Cno02n3_.js} +4 -4
  38. package/dist/component/{quadrantDiagram-W4KKPZXB-DMHCLEev.js → quadrantDiagram-W4KKPZXB-DQV7ytCz.js} +3 -3
  39. package/dist/component/{requirementDiagram-4Y6WPE33-BomcVKb4.js → requirementDiagram-4Y6WPE33-DBORDX5u.js} +4 -4
  40. package/dist/component/{sankeyDiagram-5OEKKPKP-D4rmtFCn.js → sankeyDiagram-5OEKKPKP-gNBaVNW1.js} +2 -2
  41. package/dist/component/{sequenceDiagram-3UESZ5HK-C0iEDbuE.js → sequenceDiagram-3UESZ5HK-BlxJztMa.js} +4 -4
  42. package/dist/component/{stateDiagram-AJRCARHV-x0PonbWT.js → stateDiagram-AJRCARHV-2ziF_Zes.js} +3 -3
  43. package/dist/component/{stateDiagram-v2-BHNVJYJU-6Lq1LlSV.js → stateDiagram-v2-BHNVJYJU-BWmzKTMS.js} +3 -3
  44. package/dist/component/{timeline-definition-PNZ67QCA-CIx8lwoQ.js → timeline-definition-PNZ67QCA-OcHhxXWM.js} +3 -3
  45. package/dist/component/{vennDiagram-CIIHVFJN-B27Ya-3D.js → vennDiagram-CIIHVFJN-Fl9VlPVe.js} +2 -2
  46. package/dist/component/{wardleyDiagram-YWT4CUSO-efmvFwPj.js → wardleyDiagram-YWT4CUSO-BNHUW0Ex.js} +3 -3
  47. package/dist/component/{xychartDiagram-2RQKCTM6-DNJmorKa.js → xychartDiagram-2RQKCTM6-Bog3Ddue.js} +3 -3
  48. package/dist/embed/approval-bus.d.ts +5 -0
  49. package/dist/embed/voice/agent-queue.d.ts +106 -0
  50. package/dist/embed/voice/call-roster-store.d.ts +110 -0
  51. package/dist/embed/voice/line-dispatch.d.ts +6 -2
  52. package/dist/embed/voice/line-run-reader.d.ts +3 -1
  53. package/dist/embed/voice-call-lines.d.ts +20 -0
  54. package/dist/embed/voice-call-pacing.d.ts +47 -9
  55. package/dist/embed/voice-call.d.ts +70 -14
  56. package/dist/i18n/messages/en.d.ts +14 -15
  57. package/dist/types/public.d.ts +1 -1
  58. package/package.json +1 -1
@@ -12,8 +12,12 @@ export type CallTimelineEntry = {
12
12
  readonly atMs: number;
13
13
  readonly kind: "user" | "agent" | "step" | "success" | "error" | "skill" | "schedule";
14
14
  readonly text: string;
15
- /** Agent tag for Operator-mode rows (e.g. "A2"); absent for foreground rows. */
16
- readonly lineTag?: string;
15
+ /** The switchboard line this row concerns; `null` for a foreground (line 1)
16
+ * row. CallScreen's `labelFor` resolves `line ?? 1` to look up the agent's
17
+ * short board label for `step`/`success`/`error` rows (X2b) — the label
18
+ * column names the agent, so `text` itself never repeats a title prefix or
19
+ * an "A2"-style tag. */
20
+ readonly line: number | null;
17
21
  };
18
22
  export type CallState = {
19
23
  readonly status: CallStatus;
@@ -112,14 +116,55 @@ declare let lineDispatcher: ((req: {
112
116
  readonly isNewLine: boolean;
113
117
  }) => void) | null;
114
118
  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);
115
157
  export declare const registerCallLineViewSwitcher: (switcher: (sessionId: string) => void) => (() => void);
116
158
  export declare const registerCallClearNotifier: (notifier: (sessionId: string) => void) => (() => void);
117
159
  /**
118
160
  * ChatRoute calls this when a tool-approval card appears while a call is
119
161
  * live: the ask lands on the timeline and the voice model asks the user to
120
- * approve or reject out loud.
162
+ * approve or reject out loud. `reason` is the approval part's own `reason`
163
+ * field (via the approval bus's `PendingApproval.reason`) — on a phone call
164
+ * the user cannot see the card, so WHAT it wants to do has to travel in the
165
+ * prompt, not stay something only "open the chat view" could answer.
121
166
  */
122
- export declare const notifyCallApprovalRequired: (timelineText: string) => void;
167
+ export declare const notifyCallApprovalRequired: (timelineText: string, reason: string) => void;
123
168
  /** Live speech level, 0..1 (max of agent voice + user mic). */
124
169
  export declare const peekCallAudioLevel: () => number;
125
170
  /** ChatRoute reports a tool-phase change on the delegated run — the strongest
@@ -129,7 +174,7 @@ export declare const notifyCallProgress: (hint: string) => void;
129
174
  * small work badge while the agent is busy. */
130
175
  export declare const setCallWorkPhase: (phase: CallState["workPhase"]) => void;
131
176
  /**
132
- * Click-path twin of `show_agent_line`: the lines strip chip on CallScreen
177
+ * Click-path twin of `show_agent`: the lines strip chip on CallScreen
133
178
  * calls this directly (no tool-call round trip, no ack). No-op when the line
134
179
  * is unknown, never bound to a session, or no view switcher is registered
135
180
  * (e.g. ChatRoute hasn't mounted).
@@ -173,7 +218,8 @@ export declare const deliverAgentReply: (text: string) => void;
173
218
  * must tell the user something went wrong and offer to retry.
174
219
  */
175
220
  export declare const deliverAgentFailure: (message: string) => void;
176
- /** A background line finished: relay its final text, naming the line. */
221
+ /** A background line finished: relay its final text, naming the agent by
222
+ * role. */
177
223
  export declare const deliverLineReply: (line: number, text: string) => void;
178
224
  /**
179
225
  * A background line published an artifact: OPEN it on screen, mirroring
@@ -188,16 +234,26 @@ export declare const deliverLineArtifact: (line: number, artifact: {
188
234
  readonly title: string;
189
235
  readonly mimeType: string;
190
236
  }) => void;
191
- /** A background line failed: tell the user, naming the agent. */
237
+ /** A background line failed: tell the user, naming the agent by role. */
192
238
  export declare const deliverLineFailure: (line: number, message: string) => void;
193
- /** A background line is blocked on a tool approval — steer the user to it. */
194
- export declare const notifyLineApprovalNeeded: (line: number, timelineText: string) => void;
239
+ /** A background line is blocked on a tool approval — steer the user to it,
240
+ * by role, and tell the model WHAT it wants to do. W3: the old text asked
241
+ * the user to say a magic phrase ("show <title>") and never said what was
242
+ * being approved — unanswerable on a phone call, where there is no screen to
243
+ * "go look at". `reason` is the approval part's own `reason` field, threaded
244
+ * from the run stream via `onApprovalNeeded` (line-run-reader.ts). */
245
+ export declare const notifyLineApprovalNeeded: (line: number, timelineText: string, reason: string) => void;
195
246
  /** A background line advanced a phase — record it as the line's live step
196
- * (CallScreen's agent board), land a tagged timeline row, and nudge a spoken
197
- * update. The registry write is unconditional (line-dispatch's own `isStale`
247
+ * (CallScreen's agent board reads `currentStepLabel`/`currentPhase` off the
248
+ * registry) and nudge a spoken update. X2a: deliberately NO timeline row per
249
+ * phase change any more — the board's own card already shows the identical
250
+ * string live, and a 12-step run used to write 12 near-identical Activity
251
+ * rows that buried the actual results; the durable Activity-log row for a
252
+ * background line's work is the ONE `dispatchToBackgroundLine` appends up
253
+ * front. The registry write is unconditional (line-dispatch's own `isStale`
198
254
  * guard already keeps a stale-call phase from ever reaching here); the
199
- * timeline/spoken half stays guarded like its delivery siblings so a phase
200
- * that DOES arrive with no live call just updates the board silently. */
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. */
201
257
  export declare const notifyLinePhase: (line: number, phaseLabel: string, phase?: WorkPhase | null) => void;
202
258
  /** True while a call holds the audio path — ChatRoute gates TTS autoplay on it. */
203
259
  export declare const isCallActive: () => boolean;
@@ -209,7 +265,7 @@ export declare const isCallActive: () => boolean;
209
265
  */
210
266
  export declare const __forceCallState: (patch: Partial<CallState>) => void;
211
267
  /** TEST-ONLY companion: append a timeline row while in a forced state. */
212
- export declare const __forceCallTimelineEntry: (kind: CallTimelineEntry["kind"], text: string, lineTag?: string) => void;
268
+ export declare const __forceCallTimelineEntry: (kind: CallTimelineEntry["kind"], text: string, line?: number | null) => void;
213
269
  /** TEST-ONLY companion: drive the orb's audio level without Web Audio. */
214
270
  export declare const __forceCallAudioLevel: (level: number) => void;
215
271
  /**
@@ -480,9 +480,6 @@ export declare const en: {
480
480
  readonly muted: "Mic muted";
481
481
  readonly youSaid: "You said";
482
482
  readonly agentSaid: "Agent";
483
- readonly step: "Working";
484
- readonly done: "Done";
485
- readonly failed: "Failed";
486
483
  readonly speakHint: "Speak to the agent…";
487
484
  readonly readyHint: "I'm listening — speak when you're ready.";
488
485
  readonly thinkingHint: "Thinking…";
@@ -501,22 +498,24 @@ export declare const en: {
501
498
  readonly skillNotFound: "No exact skill match for “{{query}}”";
502
499
  readonly skillCatalogUnavailable: "Skill catalog unavailable — retrying";
503
500
  readonly noSkillsConfigured: "No skills configured in this workspace";
504
- readonly phaseCoding: "Writing code";
505
- readonly phaseFiles: "Working with files";
506
- readonly phaseActions: "Taking actions";
501
+ readonly phaseCoding: "Putting the steps together";
502
+ readonly phaseFiles: "Going through your data";
503
+ readonly phaseActions: "Running the steps";
507
504
  readonly lines: "Agents";
508
505
  readonly lineLabel: "Agent {{line}}";
509
506
  readonly mainAgentLabel: "Main agent";
510
- readonly lineNeedsApproval: "needs approval";
511
- readonly lineWorking: "working";
512
- readonly lineReady: "ready";
513
- readonly lineFailed: "failed";
514
- readonly lineIdle: "idle";
515
- readonly lineNotStarted: "not started";
516
- readonly lineNoChat: "no chat yet";
507
+ readonly roleLabelMain: "Main agent";
508
+ readonly roleLabelData: "{{product}} data agent";
509
+ readonly roleLabelDataGeneric: "Data agent";
510
+ readonly roleLabelAnalyst: "Analyst";
511
+ readonly lineNeedsApproval: "Needs your OK";
512
+ readonly lineWorking: "Working…";
513
+ readonly lineReady: "Done";
514
+ readonly lineFailed: "Couldn't finish";
515
+ readonly lineIdle: "Ready";
517
516
  readonly activity: "Activity";
518
- readonly showConversationLog: "Show conversation log";
519
- readonly hideConversationLog: "Hide conversation log";
517
+ readonly showConversationLog: "Show what was said";
518
+ readonly hideConversationLog: "Hide what was said";
520
519
  readonly ambientTypingCode: "Typing code…";
521
520
  readonly ambientReviewingDiff: "Reviewing the diff…";
522
521
  readonly ambientRunningChecks: "Running checks…";
@@ -252,7 +252,7 @@ export type BelongGlobal = {
252
252
  errorMessage?: string;
253
253
  }) => void;
254
254
  /** TEST-ONLY: append a live-call timeline row. */
255
- readonly __forceCallTimelineEntry?: (kind: "user" | "agent" | "step" | "success" | "error" | "skill" | "schedule", text: string, lineTag?: string) => void;
255
+ readonly __forceCallTimelineEntry?: (kind: "user" | "agent" | "step" | "success" | "error" | "skill" | "schedule", text: string, line?: number | null) => void;
256
256
  /** TEST-ONLY: drive the call orb's audio level (0..1) without Web Audio. */
257
257
  readonly __forceCallAudioLevel?: (level: number) => void;
258
258
  /** TEST-ONLY: force the agent-lines switchboard state without HTTP dispatch. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@belonguniverseai/react-sdk",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
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",