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:
@@ -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,
|
||||
},
|
||||
},
|
||||
})
|
||||
)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user