refactor: replace welcome message with server_info status payload

Unify the initial connection handshake and capability update paths.
The server now sends a server_info status message on connect and
whenever capabilities change, enabling the onboarding flow where
voice becomes available after models are configured.
This commit is contained in:
Mohamed Boudra
2026-03-12 20:38:03 +07:00
parent 554017b0b8
commit b09a731d85
16 changed files with 177 additions and 162 deletions
@@ -29,7 +29,7 @@ function createMockTransport() {
let onOpen: () => void = () => {}
let onClose: (_event?: unknown) => void = () => {}
let onError: (_event?: unknown) => void = () => {}
let welcomeOrdinal = 1
let serverInfoOrdinal = 1
const transport: DaemonTransport = {
send: (data) => sent.push(data),
@@ -61,11 +61,16 @@ function createMockTransport() {
sent.length = 0
onMessage(
JSON.stringify({
type: 'welcome',
serverId: `srv_test_${welcomeOrdinal++}`,
hostname: null,
version: null,
resumed: false,
type: 'session',
message: {
type: 'status',
payload: {
status: 'server_info',
serverId: `srv_test_${serverInfoOrdinal++}`,
hostname: null,
version: null,
},
},
})
)
},