feat: add conversation storage types

Add type definitions for the new conversation storage system:
- ConversationMessage: Individual message structure with tool calls/results
- ConversationTableMeta: Metadata for per-user conversation tables
- ConversationStats: Aggregated statistics per user
- ArchiveResult: Results from archiving operations

These types will be used by the upcoming conversation storage implementation
that replaces the message_buffer + summaries system with dynamic per-user
tables and automatic archiving.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
kappa
2026-02-05 12:16:16 +09:00
parent 02b18301a1
commit 123b145bf9

View File

@@ -787,3 +787,39 @@ export interface Message<T> {
ack(): void; ack(): void;
retry(): void; retry(): void;
} }
// ============================================
// Conversation Storage Types
// ============================================
export interface ConversationMessage {
id?: number;
role: 'user' | 'assistant';
content: string;
tool_calls?: string; // JSON: [{name, arguments, id}]
tool_results?: string; // JSON: [{tool_call_id, result}]
created_at?: string;
}
export interface ConversationTableMeta {
telegram_id: string;
table_name: string;
message_count: number;
last_message_at: string | null;
created_at: string;
}
export interface ConversationStats {
telegram_id: string;
message_count: number;
first_message_at: string | null;
last_message_at: string | null;
archived_summaries: number;
}
export interface ArchiveResult {
processed_users: number;
archived_messages: number;
created_summaries: number;
errors: string[];
}