Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d3ef9c2
CONTRACT: feat(ui-server): register several live services and resolve…
schlessera Nov 10, 2026
7cfd3b7
feat(ui-kit): Live service group for Settings › Voice (#3616)
schlessera Nov 10, 2026
a54b0c9
CONTRACT: feat(ui-react): choose the live service in Settings › Voice…
schlessera Nov 10, 2026
c636411
docs: document the live-service default, its precedence and activatio…
schlessera Nov 10, 2026
1aca3ae
Merge remote-tracking branch 'origin/main' into feat/3616-live-provid…
schlessera Nov 10, 2026
63c9a48
test(ui-react): re-audit the connection handler map for live_settings…
schlessera Nov 10, 2026
91eacd3
Merge origin/main into feat/3616-live-provider-default
schlessera Nov 11, 2026
5453e00
test(ui-sdk): type the live roster hello comparison (#3616)
schlessera Nov 11, 2026
7b87d76
Merge remote-tracking branch 'origin/main' into feat/3616-live-provid…
schlessera Nov 11, 2026
6662c53
Merge origin/main (#3955 personas) into feat/3616-live-provider-default
schlessera Nov 11, 2026
3a9e976
CONTRACT: docs: the live-service default shares /api/settings/voice w…
schlessera Nov 11, 2026
5006da6
Merge remote-tracking branch 'origin/main' into feat/3616-live-provid…
schlessera Nov 11, 2026
233872b
test: inventory the live service runtime proof (#3616)
schlessera Nov 11, 2026
d3939af
Merge remote-tracking branch 'origin/main' into feat/3616-live-provid…
schlessera Nov 11, 2026
2b2d459
CONTRACT: feat(ui-react,ui-kit): wire the Start card for service, per…
schlessera Nov 11, 2026
3b729f9
Merge remote-tracking branch 'origin/feat/3616-live-provider-default'…
schlessera Nov 11, 2026
1e79c94
test: inventory the Start card runtime proof (#3698)
schlessera Nov 11, 2026
4767ee0
Merge origin/main (#3956 squash) into feat/3698-wire-start-card
schlessera Nov 11, 2026
f56603e
Merge origin/main into feat/3698-wire-start-card
schlessera Nov 11, 2026
e078362
test(ui-react): pin the edited-persona refusal to the card's own pick…
schlessera Nov 11, 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
11 changes: 11 additions & 0 deletions .changeset/3698-start-card.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@schlessera/brain-ui-react": minor
"@schlessera/brain-ui-kit": patch
---

Live conversation opens on the Start card (#3698) instead of the pre-Start disclosure sheet.

- **Card.** The kit `StartCard` names the service Start would open, lists the full former disclosure behind "What's shared", and holds the Service row and the persona list. Change appears only when two or more services are usable, applies to this conversation only and is never saved; an unavailable saved service needs an explicit Choose. Picking a persona also saves it as the default.
- **Recovery.** A persona with no voice on the service names the default voice; a saved voice the service no longer offers blocks Start until "Use the default voice this time"; instructions over the service's byte cap block Start; an unusable persona file offers "Use Standard this time". The one-time choices go into the Start's `personaRef` and are not saved.
- **Client.** `choosePersona(ref | null)` records the persona this entry's Start sends, and `personaChoice` is in the client state. A refused first Start lets the card pick a service or persona again.
- **Kit.** The Service row's key and Change/Choose link no longer break mid-word at 320px.
2 changes: 2 additions & 0 deletions api-report/ui-react.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ signatures (every public export and the types it is made of)
conversationProfiles: ConversationProfile[];
liveDefault: LiveDefault | null;
serviceChoice: string | null;
personaChoice: ConversationPersonaRef | null;
livePersona: LivePersonaStatus | null;
durableAvailable: boolean;
sessionId: string | null;
Expand Down Expand Up @@ -1395,6 +1396,7 @@ signatures (every public export and the types it is made of)
connect: () => () => void;
conversation: {
attachControls(): () => void;
choosePersona(ref: import("@schlessera/brain-ui-sdk").ConversationPersonaRef | null): void;
chooseService(providerId: null | string): void;
commit: (own: number) => boolean;
details(): void;
Expand Down
14 changes: 14 additions & 0 deletions docs/integration-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ same-commit update of the index or relevant authoritative component. How they ar

The reasoning is in [decisions/contract-versioning.md](decisions/contract-versioning.md).

## The Start card's persona choice (additive, 0.45.0, #3698)

In `@schlessera/brain-ui-react`, the conversation client's state adds
`personaChoice: ConversationPersonaRef | null`, and the client adds
`choosePersona(ref | null)`: the persona this entry's Start sends as
`personaRef` instead of the saved one, including the one-time
`{ id: "standard", revision: "builtin" }` and `voice: "default"` choices.
It saves nothing and is cleared on Enter and Leave. A first Start the host
refused, which opened nothing, may choose a service or persona again; a
`CONVERSATION_PERSONA_CHANGED` refusal clears the choice. No wire or HTTP
shape changes. See
[the package API](integration-contract/package-api.md#start-card-persona-choice-3698).
This ships in a minor.

## Host-owned web tools for Pi (additive, 0.45.0, #3685)

Pi's ordinary governed and strict interactive sessions gain four
Expand Down
17 changes: 17 additions & 0 deletions docs/integration-contract/package-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4866,6 +4866,23 @@ 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.

<a id="start-card-persona-choice-3698"></a>

### Start-card persona choice (#3698)

Additive. The conversation client's state carries `personaChoice`, the
`ConversationPersonaRef` this entry's Start sends instead of the saved persona's
`personaRef`; `null` sends the saved one. `choosePersona(ref | null)` sets it
before Start: a persona picked on the Start card, `{ id: "standard", revision:
"builtin" }` for "Use Standard this time", or a ref with `voice: "default"` for
"Use the default voice this time". It is ignored once Start was agreed, saves
nothing, and is cleared on Enter and Leave. The host still refuses a revision
that is no longer current. When the host refuses a first Start that opened
nothing, the entry may choose its service (`chooseService`) or persona again
before the next explicit Start; a `CONVERSATION_PERSONA_CHANGED` refusal also
clears `personaChoice`. Neither call opens a microphone, reads history or
contacts a provider.

### Retained dialogue data (#3177)

The SDK protocol exports `DialogueEvidence`, `DialogueRecord`, `DialoguePage`,
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-kit/src/tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -2878,9 +2878,9 @@ html:has(dialog.bk-overlay[open]:modal) { overflow: hidden; }
.bk-voice-close > span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bk-color-raised); box-shadow: inset 0 0 0 1px var(--bk-color-edge); }
.bk-voice-service { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px 0 12px; border-radius: 12px; background: var(--bk-color-surface); box-shadow: inset 0 0 0 1px var(--bk-color-edge); }
.bk-voice-service[data-required="true"] { box-shadow: inset 0 0 0 1.5px var(--bk-amber-ink); }
.bk-voice-service-key { font: 600 10px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--bk-color-ink-mute); }
.bk-voice-service-key { flex: none; white-space: nowrap; font: 600 10px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--bk-color-ink-mute); }
.bk-voice-service-name { flex: 1 1 auto; min-width: 0; font: 600 13px/18px "Plus Jakarta Sans", sans-serif; color: var(--bk-color-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-voice-link { appearance: none; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--bk-teal-ink); font: 600 12.5px/1 "Plus Jakarta Sans", sans-serif; cursor: pointer; }
.bk-voice-link { appearance: none; flex: none; white-space: nowrap; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--bk-teal-ink); font: 600 12.5px/1 "Plus Jakarta Sans", sans-serif; cursor: pointer; }
.bk-voice-personas { display: flex; flex-direction: column; margin: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--bk-color-surface); box-shadow: inset 0 0 0 1px var(--bk-color-edge); }
.bk-voice-persona { appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin: 0; padding: 7px 12px; border: 0; border-top: 1px solid var(--bk-color-line); background: transparent; color: var(--bk-color-ink); text-align: left; font: inherit; cursor: pointer; }
.bk-voice-persona:first-child { border-top: 0; }
Expand Down
28 changes: 26 additions & 2 deletions packages/ui-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ Before Start, the conversation client exposes the pick through
`chooseService(providerId | null)`, which applies to that Start only and is
never saved, and `conversationProfile` is the service Start would disclose and
open: the pick, else the effective service, else `null` when a pick is required.
The disclosure sheet offers that pick when several services are usable or the
saved default is unavailable; the Start card (#3698) replaces it.
The Start card draws that pick as its Service row (below).

### Live-conversation personas

Expand All @@ -174,6 +173,31 @@ it per service (voice, default or stale voice, over-limit), and Start echoes
its `personaRef`. A persona shapes speech only; it cannot change what brain may
do, see or approve. The pane never opens the microphone or a provider.

### The Start card

Entering live conversation opens the kit `StartCard` in place of the composer
(#3698), with focus on its Start. Its first line names the service Start would
open; **What's shared** lists the full disclosure: the service's own words and
destinations, the host relay, the agent backend, task and retention notes and
history coverage. The Service row shows **Change** only when two or more
services are usable; each press moves to the next one for this conversation
only and never saves the default. When the saved service is unavailable, the
row asks to **Choose** a service and Start stays unavailable until one is
picked; the host default is never substituted. The persona list preselects the
saved persona, and picking one also saves it as the default.

One notice above Start says what changes it: a persona with no voice on this
service names the default voice it will use; a saved voice the service no
longer offers blocks Start until **Use the default voice this time**; persona
instructions over the service's byte cap block Start (**Edit persona** opens
Settings › Voice, or change the service); a persona file that can't be used
offers **Use Standard this time**. Those one-time choices go into the Start's
`personaRef` and are not saved. Change, a persona pick and every notice
action open no microphone, read no history and contact no provider; Start is
the only way out that does, and it sends exactly the service, persona and
voice the card shows. × or Escape leaves. A refused Start is drawn as the
stopped notice, whose **Start again** reopens the card.

### Recording on the device

Set `localCapture: true` and a stable `storagePrefix` on a persistent root to
Expand Down
49 changes: 6 additions & 43 deletions packages/ui-react/src/components/voice/conversation-field.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useEffect, useRef, useState } from "react";
import { useStore } from "zustand";
import { Button, Overlay, VoiceControlButton, VoiceField, VoiceNotice, VoiceText, type IconName } from "@schlessera/brain-ui-kit";
import { VoiceControlButton, VoiceField, VoiceNotice, VoiceText, type IconName } from "@schlessera/brain-ui-kit";
import { useBrainUiRoot } from "../../root-context.js";
import { conversationService, MUTED_NOTICE, READINESS_NOTICES, REVIEW_BOUNDED_NOTICE, REVIEW_TRIMMED_NOTICE, UNCLEAR_NOTICE, type ConversationClientState } from "../../voice/conversation-client.js";
import { PERMISSION_PENDING_LINE } from "../../voice/conversation-permissions.js";
import { liveServiceView } from "../../voice/live-service.js";
import { ConversationStartCard } from "./start-card.js";

/** The live states the tall voice field draws (#3690); S5 is the Start sequence's Connecting. */
type LiveFieldState = "S5" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "L7" | "L8" | "L9";
Expand All @@ -13,7 +13,7 @@ type LiveFieldState = "S5" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "L7" | "L
* Maps the client's own state onto one live state. Every input is something
* the client knows: its connection, capture intent, the playing reply, host
* work and a pending approval card. `null` draws no field (before Start, or
* while the disclosure sheet asks for one).
* while the Start card asks for one).
*/
function liveFieldState(s: Pick<ConversationClientState, "active" | "disclosureOpen" | "capture" | "connection" | "micOn" | "interaction" | "outputRecovery">,
o: { speaking: boolean; hostWork: boolean; approval: boolean }): LiveFieldState | null {
Expand Down Expand Up @@ -87,7 +87,6 @@ export function ConversationField({ backend, onLeave }: { backend: string; onLea
const client = root.connection.conversation;
const s = useStore(client.state);
const permission = useStore(client.permissions.state);
const chat = useStore(root.stores.connection, (state) => state.wsStatus);
const streaming = useStore(root.stores.chat, (state) => !!(s.sessionId === null ? state.draft : state.buffers[s.sessionId])?.isStreaming);
// A pending approval is the tool card's to answer, by tap only (L6).
const approval = useStore(root.stores.chat, (state) => !!(s.sessionId === null ? state.draft : state.buffers[s.sessionId])?.messages.some(m => m.toolCalls.some(t => t.status === "pending_approval")));
Expand Down Expand Up @@ -121,15 +120,8 @@ export function ConversationField({ backend, onLeave }: { backend: string; onLea
if (!s.active) return null;
const profile = s.profile;
const disclosed = s.conversationProfile;
const coverage = s.connection === "Connected" ? profile?.historyCoverage : undefined;
const button = { minHeight: 44, minWidth: 44, flex: "1 1 0", width: "auto", padding: "0 6px", fontSize: 12 };
const leave = () => { client.leave(); onLeave(); };
const service = profile ? conversationService(profile.providerId) : disclosed ? conversationService(disclosed.providerId) : null;
// #3616: the one-time pick before Start. A minimal stand-in until the Start
// card (#3698) draws it as the Service row and S3d.
const live = liveServiceView(s);
// It stays once picked, so the pick can be seen and changed before Start.
const pickable = !profile && live.services.length > 0 && (live.canChange || live.pickRequired || live.savedUnavailable !== null || s.serviceChoice !== null);
const muted = s.capture === "muted";
const draft = !!s.text;
const outputMuted = s.outputRecovery === "muted";
Expand All @@ -151,9 +143,9 @@ export function ConversationField({ backend, onLeave }: { backend: string; onLea
: null;
const meta = draft ? DRAFT_META : outputMuted ? "Reply audio off" : readiness ? "mic off"
: [service, state === "S5" ? null : clock(seconds)].filter(Boolean).join(" · ") || undefined;
return <div ref={frame} data-conversation-field="" data-live-state={state ?? undefined} data-voice-refusal-window={permission.line ? "" : undefined} className="mx-auto max-w-3xl bg-background text-foreground" style={{ overflowWrap: "anywhere" }}>
return <div ref={frame} data-conversation-field="" data-live-state={s.disclosureOpen ? undefined : state ?? undefined} data-voice-refusal-window={permission.line ? "" : undefined} className="mx-auto max-w-3xl bg-background text-foreground" style={{ overflowWrap: "anywhere" }}>
<div className="sr-only" aria-live="polite" aria-atomic="true">{s.announcement}</div>
{state === "L9"
{s.disclosureOpen ? null : state === "L9"
? <div className="pb-2"><VoiceNotice tone="fail" icon="attention" title="Live conversation stopped" body={s.notice || undefined}
actions={[{ label: "Close", onClick: leave }, { label: "Start again", tone: "brain", onClick: client.details }]} /></div>
: state && <div className="pb-2">
Expand All @@ -176,35 +168,6 @@ export function ConversationField({ backend, onLeave }: { backend: string; onLea
{body}
</VoiceField>
</div>}
<Overlay open={s.disclosureOpen} variant="sheet" title="Live conversation" onClose={leave} data-overlay-site="conversation-disclosure">
<div className="space-y-3 p-4 text-sm">
{pickable && <fieldset data-live-service-pick="" className="space-y-2">
<legend className="text-[13px] font-semibold">Live service for this conversation</legend>
{live.savedUnavailable
? <p data-live-service-unavailable="">Your saved default, {conversationService(live.savedUnavailable)}, isn{"'"}t available on this host. Choose a service for this conversation.</p>
: live.pickRequired && <p>Choose a live service for this conversation.</p>}
{live.services.map((option) => <label key={option.providerId} className="flex min-h-[44px] cursor-pointer items-center gap-3 rounded-lg border border-border-subtle px-3">
<input type="radio" name="live-service-pick" value={option.providerId} checked={live.selected?.providerId === option.providerId}
onChange={() => client.chooseService(option.providerId)} className="h-5 w-5 shrink-0" />
<span>{conversationService(option.providerId)}</span>
</label>)}
<p className="text-xs text-muted-foreground">Applies to this conversation only. Settings › Voice keeps the default.</p>
</fieldset>}
<p>{disclosed?.disclosure.voiceService ?? (pickable ? "No live service chosen yet." : "Connecting to the configured voice service…")}</p>
{disclosed?.disclosure.destinations.map((destination) => <p key={destination}>{destination}</p>)}
<p>Host relay: {typeof window === "undefined" ? root.apiBase() || "this application’s host" : new URL(root.apiBase() || "/", window.location.href).origin}</p>
<p>Independently selected agent backend: {backend}. API destination and retention: unknown unless documented by the host.</p>
{disclosed?.capabilities.contextualTasks === "supported"
? <p>Brain can start permitted background tasks from the conversation and share results while you keep talking. Actions that need confirmation use the same screen cards as typed requests. Recognition may be uncertain; speech cannot approve an action.</p>
: disclosed?.capabilities.finalTranscript !== "supported" && <p>Automatic tasks aren't available with this service. Review recognized text and use Send now.</p>}
<p>{s.durableAvailable || client.historyOwnerFor(s.sessionId ?? "") ? "Recognized speech and generated voice replies are saved as text with this chat. This feature does not save audio. Reopening text does not replay audio or prove the voice service received this history." : "Live recognition is temporary and may be unavailable after reload."}</p>
<p>Starting voice sends bounded prior chat text and completed results to this voice service, including when you switch services. Raw audio is not retained by this feature.</p>
{coverage && <p>{coverage.state === "complete" ? "Available prior text was included in startup context." : coverage.state === "bounded" ? "Some prior text was omitted to fit startup context." : coverage.state === "partial" ? "Some prior discussion evidence or its original order is unavailable." : "Prior discussion evidence is unavailable."} {coverage.tailOmitted && (coverage.state === "partial" ? "The newest prior item may be missing." : "The newest prior item was not included.")} This does not prove the service understood or recalled it.</p>}
<p>Spoken refusal is unavailable with the current voice services. Use Deny on screen.</p>
{profile?.capabilities.exactPermissionSpeech !== "supported" && <p>Permission decisions remain on screen; spoken announcements are unavailable.</p>}
{s.notice && <p>{s.notice}</p>}
<div className="flex gap-2"><Button label="Start" style={button} disabled={!disclosed || chat !== "connected"} onClick={client.start} /><Button label="Cancel" style={button} tone="ghost" onClick={leave} /></div>
</div>
</Overlay>
{s.disclosureOpen && <div className="pb-2"><ConversationStartCard backend={backend} onLeave={onLeave} /></div>}
</div>;
}
Loading
Loading