this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 4e2e1998a4d99cb7c857981cb6e80ca1dab55d5e 142 lines 3.1 kB view raw
1// Raw JSONL entry from Claude Code session files 2export interface RawSessionEntry { 3 type: 'user' | 'assistant'; 4 timestamp: string; 5 uuid: string; 6 parentUuid: string | null; 7 sessionId: string; 8 cwd?: string; 9 gitBranch?: string; 10 slug?: string; 11 version?: string; 12 message: { 13 role: 'user' | 'assistant'; 14 content: MessageContent[]; 15 model?: string; 16 id?: string; 17 usage?: TokenUsage; 18 }; 19 requestId?: string; 20} 21 22export interface TokenUsage { 23 input_tokens: number; 24 output_tokens: number; 25 cache_creation_input_tokens?: number; 26 cache_read_input_tokens?: number; 27} 28 29export type MessageContent = 30 | { type: 'text'; text: string } 31 | { type: 'text'; content: string } 32 | { type: 'tool_use'; id: string; name: string; input: Record<string, unknown> } 33 | { type: 'tool_result'; tool_use_id: string; content: string; is_error?: boolean }; 34 35// Parsed session with extracted info 36export interface ParsedSession { 37 sessionId: string; 38 filePath: string; 39 projectPath: string; 40 projectName: string; 41 gitBranch: string; 42 startTime: string; 43 endTime: string; 44 date: string; // YYYY-MM-DD 45 messages: ParsedMessage[]; 46 stats: SessionStats; 47} 48 49export interface ParsedMessage { 50 type: 'user' | 'assistant'; 51 timestamp: string; 52 text: string; 53 toolUses: ToolUse[]; 54} 55 56export interface ToolUse { 57 name: string; 58 input: string; // Truncated/summarized 59} 60 61export interface SessionStats { 62 userMessages: number; 63 assistantMessages: number; 64 toolCalls: Record<string, number>; 65 totalInputTokens: number; 66 totalOutputTokens: number; 67} 68 69// LLM-generated summary 70export interface SessionSummary { 71 shortSummary: string; 72 accomplishments: string[]; 73 filesChanged: string[]; 74 toolsUsed: string[]; 75} 76 77// Database models 78export interface DBSessionSummary { 79 id: number; 80 session_id: string; 81 project_path: string; 82 project_name: string; 83 git_branch: string; 84 start_time: string; 85 end_time: string; 86 date: string; 87 short_summary: string; 88 accomplishments: string; // JSON array 89 tools_used: string; // JSON array 90 files_changed: string; // JSON array 91 stats: string; // JSON object 92 processed_at: string; 93} 94 95export interface DBDailySummary { 96 date: string; 97 brag_summary: string; 98 projects_worked: string; // JSON array 99 total_sessions: number; 100 generated_at: string; 101} 102 103export interface DBProcessedFile { 104 file_path: string; 105 file_hash: string; 106 processed_at: string; 107} 108 109// API response types 110export interface DayListItem { 111 date: string; 112 projectCount: number; 113 sessionCount: number; 114 bragSummary?: string; 115} 116 117export interface DayDetail { 118 date: string; 119 bragSummary?: string; 120 projects: ProjectDetail[]; 121 stats: { 122 totalSessions: number; 123 totalTokens: number; 124 }; 125} 126 127export interface ProjectDetail { 128 name: string; 129 path: string; 130 sessions: SessionDetail[]; 131} 132 133export interface SessionDetail { 134 sessionId: string; 135 startTime: string; 136 endTime: string; 137 shortSummary: string; 138 accomplishments: string[]; 139 filesChanged: string[]; 140 toolsUsed: string[]; 141 stats: SessionStats; 142}