feat(vela): retire mocked.turn.trigger from shared contract
This commit is contained in:
@@ -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}`;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
1
apps/vela-protocol/src/index.d.ts
vendored
1
apps/vela-protocol/src/index.d.ts
vendored
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user