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
-11
View File
@@ -2388,15 +2388,6 @@ export const WSHelloMessageSchema = z.object({
.optional(),
})
export const WSWelcomeMessageSchema = z.object({
type: z.literal('welcome'),
serverId: z.string(),
hostname: z.string().nullable(),
version: z.string().nullable(),
resumed: z.boolean(),
capabilities: ServerCapabilitiesSchema.optional(),
})
export const WSRecordingStateMessageSchema = z.object({
type: z.literal('recording_state'),
isRecording: z.boolean(),
@@ -2423,14 +2414,12 @@ export const WSInboundMessageSchema = z.discriminatedUnion('type', [
export const WSOutboundMessageSchema = z.discriminatedUnion('type', [
WSPongMessageSchema,
WSWelcomeMessageSchema,
WSSessionOutboundSchema,
])
export type WSInboundMessage = z.infer<typeof WSInboundMessageSchema>
export type WSOutboundMessage = z.infer<typeof WSOutboundMessageSchema>
export type WSHelloMessage = z.infer<typeof WSHelloMessageSchema>
export type WSWelcomeMessage = z.infer<typeof WSWelcomeMessageSchema>
// ============================================================================
// Helper functions for message conversion