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:
36
src/types.ts
36
src/types.ts
@@ -787,3 +787,39 @@ export interface Message<T> {
|
||||
ack(): 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[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user