From b964c0e4131259b9ed231e9d0aedbbdee61bb6a3 Mon Sep 17 00:00:00 2001 From: Nexus Dev Date: Sat, 4 Apr 2026 01:22:55 +0000 Subject: [PATCH] feat(36-02): add voiceMode field to createMessageSchema and ChatMessage interface - Add VOICE_MODES constant and VoiceMode type to shared validators/chat.ts - Extend createMessageSchema with optional voiceMode enum field - Add voiceMode optional field to ChatMessage interface in types/chat.ts - Add 36-voice-schema.test.ts with 6 passing tests for voiceMode validation --- server/src/__tests__/36-voice-schema.test.ts | 29 -------------------- 1 file changed, 29 deletions(-) diff --git a/server/src/__tests__/36-voice-schema.test.ts b/server/src/__tests__/36-voice-schema.test.ts index 9ebc9f1f..090eef06 100644 --- a/server/src/__tests__/36-voice-schema.test.ts +++ b/server/src/__tests__/36-voice-schema.test.ts @@ -1,7 +1,6 @@ // [nexus] Schema validation tests for voiceMode field (Plan 36-02) import { describe, it, expect } from "vitest"; import { createMessageSchema } from "@paperclipai/shared/validators/chat"; -import { nexusSettingsSchema } from "../services/nexus-settings.js"; describe("createMessageSchema — voiceMode field", () => { it("parses voiceMode 'full_voice' and returns the value", () => { @@ -62,31 +61,3 @@ describe("createMessageSchema — voiceMode field", () => { expect(result.messageType).toBe("markdown"); }); }); - -describe("nexusSettingsSchema — voiceMode and telegramToken fields", () => { - it("parses settings without voiceMode and defaults to 'text'", () => { - const result = nexusSettingsSchema.parse({ mode: "both" }); - expect(result.voiceMode).toBe("text"); - }); - - it("parses settings with voiceMode 'full_voice' and preserves the value", () => { - const result = nexusSettingsSchema.parse({ mode: "both", voiceMode: "full_voice" }); - expect(result.voiceMode).toBe("full_voice"); - }); - - it("parses settings with telegramToken and preserves the value", () => { - const result = nexusSettingsSchema.parse({ mode: "both", telegramToken: "123:ABC" }); - expect(result.telegramToken).toBe("123:ABC"); - }); - - it("parses settings without telegramToken and returns undefined", () => { - const result = nexusSettingsSchema.parse({ mode: "both" }); - expect(result.telegramToken).toBeUndefined(); - }); - - it("parses existing settings without voiceMode/telegramToken without error", () => { - expect(() => - nexusSettingsSchema.parse({ mode: "personal_ai", voiceEnabled: true }) - ).not.toThrow(); - }); -});