From b263c031b85ae3caa96ff8f6d0a9170f00cc5100 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Mon, 26 Jan 2026 22:39:54 +1300 Subject: [PATCH] feat(31-02): create chat types for conversation interface - ChatRole, ChatMessage, ConversationState types - ChatRequest for /api/chat endpoint - Minimal types (Vercel AI SDK provides its own) --- src/types/chat.ts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/types/chat.ts diff --git a/src/types/chat.ts b/src/types/chat.ts new file mode 100644 index 00000000..182969e9 --- /dev/null +++ b/src/types/chat.ts @@ -0,0 +1,39 @@ +/** + * Chat Types + * + * Types for the conversational workflow planning interface. + */ + +/** Role in conversation */ +export type ChatRole = 'user' | 'assistant' | 'system'; + +/** Single message in conversation */ +export interface ChatMessage { + /** Unique message ID */ + id: string; + /** Who sent the message */ + role: ChatRole; + /** Message content (markdown supported) */ + content: string; + /** When message was created */ + createdAt: Date; +} + +/** State of the chat conversation */ +export interface ConversationState { + /** All messages in the conversation */ + messages: ChatMessage[]; + /** Whether AI is currently responding */ + isLoading: boolean; + /** Current error if any */ + error: string | null; +} + +/** Request body for /api/chat */ +export interface ChatRequest { + /** Message history */ + messages: Array<{ + role: ChatRole; + content: string; + }>; +}