feat(vela): retire mocked.turn.trigger from shared contract

This commit is contained in:
2026-04-08 22:05:13 +02:00
parent 8e14eaeed0
commit 742e84e40f
7 changed files with 23 additions and 5 deletions

View File

@@ -206,6 +206,14 @@ function validateClientMessage(message) {
return 'message must match the shared envelope shape';
}
if (message.type === 'mocked.turn.trigger') {
if (!message.payload || typeof message.payload !== 'object' || Array.isArray(message.payload)) {
return 'message payload must be an object';
}
return null;
}
if (!isClientEventType(message.type)) {
return `unsupported client event type: ${message.type}`;
}

View File

@@ -256,6 +256,15 @@ test('http routes stay available and preserve the root response contract', async
}
});
test('shared protocol only exposes currently supported client event types', () => {
assert.deepEqual(CLIENT_EVENT_TYPES, [
'session.start',
'input_audio.append',
'input_audio.commit',
'response.cancel'
]);
});
test('websocket connect creates and cleans up an ephemeral session', async () => {
const server = await startServer();

View File

@@ -4,7 +4,6 @@ const SESSION_STATES = Object.freeze(['idle', 'listening', 'thinking', 'speaking
const CLIENT_EVENT_TYPES = Object.freeze([
'session.start',
'mocked.turn.trigger',
'input_audio.append',
'input_audio.commit',
'response.cancel'

View File

@@ -7,7 +7,6 @@ export type MessageEnvelope<TType extends string, TPayload> = {
export type ClientEventPayloads = {
'session.start': Record<string, never>;
'mocked.turn.trigger': Record<string, never>;
'input_audio.append': {
chunk: string;
};

View File

@@ -4,7 +4,6 @@ export const SESSION_STATES = Object.freeze(['idle', 'listening', 'thinking', 's
export const CLIENT_EVENT_TYPES = Object.freeze([
'session.start',
'mocked.turn.trigger',
'input_audio.append',
'input_audio.commit',
'response.cancel'