Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
5c3dc59
CONTRACT: feat(ui-react): draw live conversation in the tall voice field
schlessera Nov 8, 2026
0985eee
CONTRACT: chore(api-report): record the conversation client's capture…
schlessera Nov 8, 2026
bbaa892
Merge remote-tracking branch 'origin/main' into feat/3699-live-voice-…
schlessera Nov 9, 2026
43ec097
CONTRACT: feat(ui-react): place the live overlay's functions in the t…
schlessera Nov 9, 2026
3715ca5
CONTRACT: feat(ui-sdk,ui-server,ui-react): name the live startup cont…
schlessera Nov 9, 2026
15980ad
test(ui-react): regenerate the live field's app baselines in the pinn…
schlessera Nov 9, 2026
74fdb96
Merge remote-tracking branch 'origin/main' into feat/3699-live-voice-…
schlessera Nov 9, 2026
df868a4
fix(ui-react): draw the live field's messages as VoiceText children (…
schlessera Nov 9, 2026
a65461d
Merge remote-tracking branch 'origin/main' into feat/3699-live-voice-…
schlessera Nov 9, 2026
4f3ff39
test(ui-react): restore strict 2× containment in the live field audit…
schlessera Nov 9, 2026
8c5ee33
test(ui-react): regenerate live field baselines over #3779 in the pin…
schlessera Nov 9, 2026
768b7d5
Merge remote-tracking branch 'origin/main' into feat/3699-live-voice-…
schlessera Nov 10, 2026
ddf70a2
feat(ui-react): Discard draft uses the backspace key (#3699, #3762)
schlessera Nov 10, 2026
8c7d6c1
Merge branch 'main' into feat/3699-live-voice-field
schlessera Nov 10, 2026
3e67303
Merge branch 'main' into feat/3699-live-voice-field
schlessera Nov 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/live-coverage-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@schlessera/brain-ui-sdk": minor
"@schlessera/brain-ui-server": minor
"@schlessera/brain-ui-react": minor
---

`historyCoverage` on `conversation_opened` and `LiveConversationSession` gains an optional `includedMessages`: how many prior chat and spoken messages the live startup context actually carried (completed results and gap markers are not counted). The server reports it for both built-in engines, and the live conversation's inline chat notice now reads "Started with the last {n} messages · Details", keeping the coverage-state wording for older hosts that omit the count. The count is host-only display data and never reaches the voice provider (#3699).
5 changes: 5 additions & 0 deletions .changeset/live-voice-field.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@schlessera/brain-ui-react": minor
---

Live conversation now draws its state in the tall voice field from `@schlessera/brain-ui-kit` (#3699). The field's colour, meter, icon and one word say who has the floor (Connecting, Listening, Thinking, Working, Speaking, Needs your tap, Muted, Reconnecting), with the service and the connected time beside it, and Mute, Interrupt and End sit on its raised controls. Interrupt is enabled only while a reply plays. A failure that withdraws capture shows "Live conversation stopped" with the client's reason, and Start again reopens the disclosure. Nothing stacks above the field any more: its body shows one message at a time (a held draft, then the tap-only refusal line, then reply audio off, then the client's notice), a held draft reads "Draft · not sent yet" with Send now and Discard draft in the controls row (taking Interrupt's place unless brain is speaking), Recover reply audio stays in the row while reply audio is off, and waiting for voice readiness reads "mic off". Incomplete startup-context coverage is an inline notice in the chat at the start of the live section, and background tasks leave the field for the chat. A blocked microphone now says to allow it, then Start again. The two diagnostic status lines ("● Listening · mic on", "Connected · chat: ok"), the provider-code details button and the Mute mic, Stop reply and Leave voice buttons are gone. The conversation client exposes its capture intent (`capture`: `idle`, `listening`, `muted` or `stopped`) and display-only meter readings (`levels()`); neither changes capture, recovery or permission behaviour.
5 changes: 5 additions & 0 deletions api-report/ui-react.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ signatures (every public export and the types it is made of)
token: number;
connection: "Connecting" | "Connected" | "Reconnecting" | "Speech lost";
micOn: boolean;
capture: "idle" | "listening" | "muted" | "stopped";
interaction: "Listening" | "Sending soon" | "Review before sending" | "Working" | "Speaking" | "Checking whether the reply stopped" | "Answering question";
disclosureOpen: boolean;
profile: ServerConversationOpened | null;
Expand Down Expand Up @@ -1389,6 +1390,10 @@ signatures (every public export and the types it is made of)
frame: (message: import("@schlessera/brain-ui-sdk").ServerMessage) => import("@schlessera/brain-ui-sdk").ServerMessage | null;
historyOwnerFor: (key: string) => string | undefined;
leave: () => void;
levels: () => {
input: number;
output: number;
};
loadDialogue: (key: string, older?: boolean) => void;
mute(): void;
permissions: {
Expand Down
4 changes: 4 additions & 0 deletions api-report/ui-sdk.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8563,6 +8563,7 @@ signatures (every public export and the types it is made of)
historyCoverage?: {
state: "complete" | "bounded" | "partial" | "unavailable";
tailOmitted: boolean;
includedMessages?: number;
};
events: AsyncIterable<LiveConversationEvent>;
appendAudio(chunk: LiveConversationAudioChunk): void;
Expand Down Expand Up @@ -11097,6 +11098,7 @@ signatures (every public export and the types it is made of)
historyCoverage?: {
state: "complete" | "bounded" | "partial" | "unavailable";
tailOmitted: boolean;
includedMessages?: number;
};
historyGeneration?: number;
historyOwnerId?: string;
Expand Down Expand Up @@ -19868,6 +19870,7 @@ signatures (every public export and the types it is made of)
}, z.core.$loose>;
epoch: z.ZodNumber;
historyCoverage: z.ZodOptional<z.ZodObject<{
includedMessages: z.ZodOptional<z.ZodNumber>;
state: z.ZodEnum<{
bounded: "bounded";
complete: "complete";
Expand Down Expand Up @@ -23954,6 +23957,7 @@ signatures (every public export and the types it is made of)
}, z.core.$loose>;
epoch: z.ZodNumber;
historyCoverage: z.ZodOptional<z.ZodObject<{
includedMessages: z.ZodOptional<z.ZodNumber>;
state: z.ZodEnum<{
bounded: "bounded";
complete: "complete";
Expand Down
2 changes: 1 addition & 1 deletion docs/decisions/design-kit/components-and-interactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ implements them with the session store:
| `settings/modules-tab.tsx` complete source values | `<details>` | Evidence: `Complete source values · {n} keys`. |
| `settings/module-settings-fields.tsx` collapsible lists | `Surface` and `<details>` | Editable item: `ItemCard`. |
| `voice/conversation-unassigned.tsx` | `<details>` "Optional voice review" | Optional control: `Callout` and "Review in composer". |
| `voice/conversation-strip.tsx` background tasks | `<details>` | Evidence: `Background tasks · {n} contextual requests`. |
| `voice/conversation-field.tsx` background tasks | `<details>` | Removed from the live field (#3699); each task is a `VoiceToolChip` in the chat (#3700). |
| `voice/recordings-tray.tsx` header | raw `aria-expanded` button | Panel: `Tray`, `On this device · {n} recordings · {size}`. |
| `graph/graph-maintenance.tsx` finding groups | `TextButton` and dot | Panel: `Tray` with the lens swatch; the label keeps the kind's name. |
| `graph/graph-scene.tsx` `ClusterLegend` | raw `aria-expanded` row | Panel: `Tray`, `Topics · {n}`. |
Expand Down
18 changes: 15 additions & 3 deletions docs/extending/speech.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,21 @@ capability limits, then select **Start**. With either built-in service, use
**Send now** to commit recognized text. The ordinary transcript, tools and
question/permission controls remain available while host work runs asynchronously.

Mute ends microphone capture until Unmute; Leave returns to the composer with
retained review text in its original draft. Stop reply cuts local audio while
capture and host work continue. Ordinary interruption retains initiating PCM and
While the conversation runs, the composer becomes the tall voice field. Its
colour, meter, icon and one word say who has the floor (Listening, Thinking,
Working, Speaking, Needs your tap, Muted, Reconnecting), with the service and
the connected time beside it. Mute ends microphone capture until Unmute; brain
may finish its current sentence. End returns to the composer with retained
review text in its original draft. Interrupt, enabled only while a reply
plays, cuts local audio while capture and host work continue. A failure that
withdraws capture shows "Live conversation stopped" with its reason; Start
again reopens the disclosure. Nothing stacks above the field: its body holds
one message at a time, in the order draft, refusal ("Tap Allow or Deny on the
card"), reply audio off, then the client's notice. A held draft reads "Draft ·
not sent yet" with **Send now** and **Discard draft** in the controls row, where
it takes Interrupt's place unless brain is speaking. Incomplete startup context
is an inline notice in the chat at the start of the live section, with Details.
Ordinary interruption retains initiating PCM and
uses bounded local output recovery; timeout exposes Recover reply audio without
muting the microphone. Delayed old audio can occasionally play after recovery.
Recoverable hide/disconnect/resync retain consent in the same disclosed scope and
Expand Down
3 changes: 2 additions & 1 deletion docs/integration-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,8 @@ carry an optional authorized, frozen chat snapshot, separately from native
same-conversation resync. `LiveConversationSession.historyCoverage` and
`conversation_opened.historyCoverage` optionally report the actual startup
selection's `state` (`complete`, `bounded`, `partial`, `unavailable`) and
`tailOmitted`. This is data receipt/selection evidence, never a guarantee of
`tailOmitted`, plus, additively (#3699), `includedMessages`: the number of
prior chat and spoken messages actually sent. This is data receipt/selection evidence, never a guarantee of
semantic recall. See the [package API](integration-contract/package-api.md#existing-chat-live-context-3178)
and [wire behavior](integration-contract/wire.md#existing-chat-live-context-3178).

Expand Down
18 changes: 17 additions & 1 deletion docs/integration-contract/package-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4824,6 +4824,18 @@ retires the reviewed input identities; late recognition cannot restore them.
These actions and Mute cancel pending automatic review timers, while output recovery
remains independent of microphone consent.

### Conversation capture intent and meter readings (#3699)

Additive. The conversation client's state carries `capture`, the intent behind
`micOn`: `idle` before Start in an entry, `listening` while consent stands
(recoverable transitions restore capture on their own), `muted` after a manual
Mute until Unmute, and `stopped` when a genuine failure withdrew consent and only
a new Start resumes capture. Manual Mute stays `muted` across teardown and
reconnects. `levels()` returns display-only 0–1 readings, `{ input, output }`:
the newest microphone block while capture is open, and the 10 ms window of the
reply sounding now. Neither value gates capture, endpointing, output recovery or
permission routing.

### Retained dialogue data (#3177)

The SDK protocol exports `DialogueEvidence`, `DialogueRecord`, `DialoguePage`,
Expand Down Expand Up @@ -4893,7 +4905,11 @@ recency is unknown. Partial coverage uses “may be missing” copy rather than
claim about the exact newest item. These bounds never delete the display archive.

`LiveConversationSession.historyCoverage?` exposes the adapter's actual bounded
historical selection as `{state, tailOmitted}`. Third-party providers may ignore
historical selection as `{state, tailOmitted, includedMessages?}`. The optional
`includedMessages` (additive, #3699) is the number of prior chat and spoken
messages the startup context actually carried; completed results and gap markers
are not counted, and it is 0 when no history block was sent. It is host-only
display data: it is never part of any provider-facing text. Third-party providers may ignore
the additive history input but cannot thereby claim existing-chat continuity.
The frozen provider prefix/tools/instructions are never rewritten within an epoch.

Expand Down
12 changes: 9 additions & 3 deletions docs/integration-contract/wire.md
Original file line number Diff line number Diff line change
Expand Up @@ -2418,7 +2418,7 @@ request. Host terminal state reconciles unanswered requests without depending on

Neither built-in adapter has a proven deterministic exact-copy permission audio
path. The approved fallback therefore uses a local earcon, the existing card and
a 40px strip line. Permission scripts and confirmed outcome wording are visual
the live field's refusal line. Permission scripts and confirmed outcome wording are visual
only: they are never submitted as model commentary or to a separate TTS service.
Labels come only from bounded static registry labels (four words at most), with
`An action` as the generic fallback. Payloads and unproven effect descriptions
Expand Down Expand Up @@ -2850,8 +2850,14 @@ stops capture and exposes the unavailable tail honestly.

## Existing-chat live context (#3178)

`conversation_opened` optionally carries `historyCoverage: {state, tailOmitted}`,
with state `complete`, `bounded`, `partial` or `unavailable`. It describes selected
`conversation_opened` optionally carries `historyCoverage: {state, tailOmitted,
includedMessages?}`, with state `complete`, `bounded`, `partial` or `unavailable`.
`includedMessages` (additive, #3699) is a non-negative integer: exactly how many
prior chat and spoken messages the startup context carried, excluding completed
results and gap markers. The shipped client names it in the chat's coverage
notice ("Started with the last {n} messages") and falls back to the coverage
state when an older host omits it. It is display data for the client and never
enters the provider-facing conversation. It describes selected
historical text at startup, independently of retained display history, generated
speech and playback. Details disclose partial sources/order, context omissions
and an omitted newest item without claiming the model understood the text.
Expand Down
3 changes: 2 additions & 1 deletion packages/ui-react/src/components/chat/chat-page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { transcriptMessage, transcriptTimelineFor, transcriptRange } from "../../lib/transcript-timeline.js";
import { useStore } from "zustand";
import { ConversationOutput, ConversationRecognitionRow, ConversationPermissionOutcomes, ConversationTaskContext, conversationEndLabel } from "../voice/conversation-outputs.js";
import { ConversationCoverageNotice, ConversationOutput, ConversationRecognitionRow, ConversationPermissionOutcomes, ConversationTaskContext, conversationEndLabel } from "../voice/conversation-outputs.js";
import { replyToToolApproval } from "../../lib/tool-approval.js";
import type { AskUserFormAnswers } from "@schlessera/brain-ui-sdk/protocol";
import { useBrainUiRoot } from "../../root-context.js";
Expand Down Expand Up @@ -760,6 +760,7 @@ export function ChatPage() {
<TranscriptReadingScope onRead={beginReading} returnFocus={readingFallback}>
{visibleEntries.map((entry) => {
if (entry.kind === "history-notice") return <p key={entry.key} className="py-3 text-sm">{entry.label}</p>;
if (entry.kind === "voice-coverage") return <div key={entry.key} data-arrival-key={entry.key} tabIndex={-1} className="py-3"><ConversationCoverageNotice conversationId={entry.conversationId} coverage={entry.coverage} /></div>;
if (entry.kind === "speech") return <ConversationOutput key={entry.key} arrivalKey={entry.key} output={entry.output} restored={entry.restored} cutOff={entry.cutOff} />;
if (entry.kind === "voice-boundary") return entry.label === "Voice ended"
? <div key={entry.key} data-arrival-key={entry.key} tabIndex={-1} className="py-3"><ConversationEndDivider label={conversationEndLabel(entry.durationMs)} /></div>
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-react/src/components/chat/composer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useStore } from "zustand";
import { ConversationUnassigned } from "../voice/conversation-unassigned.js";
import { ConversationStrip } from "../voice/conversation-strip.js";
import { ConversationField } from "../voice/conversation-field.js";
import { Button, Callout, InlineToast } from "@schlessera/brain-ui-kit";
import { useBrainUiRoot, useRootStore } from "../../root-context.js";
import { useState, useRef, useEffect, useLayoutEffect, useImperativeHandle, useReducer, type Ref } from "react";
Expand Down Expand Up @@ -946,7 +946,7 @@ export function Composer({ send, handle }: { send: (msg: ClientMessage) => void

return (
<>
{conversation.active ? <div className="px-2 md:px-6"><ConversationStrip backend={[displayProviderLabel, displayProvider?.backendId, displayProvider?.vendor].filter(Boolean).join(" · ")} onLeave={() => queueMicrotask(focusField)} /></div> : <div className="px-4 pt-2 pb-4 md:px-6 md:pb-6">
{conversation.active ? <div className="px-2 md:px-6"><ConversationField backend={[displayProviderLabel, displayProvider?.backendId, displayProvider?.vendor].filter(Boolean).join(" · ")} onLeave={() => queueMicrotask(focusField)} /></div> : <div className="px-4 pt-2 pb-4 md:px-6 md:pb-6">
{/* Says where a taken suggestion went, since focus moves with it. */}
<div className="sr-only" aria-live="polite" data-composer-notice="">
{insertNotice}
Expand Down
Loading
Loading