-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
142 lines (126 loc) · 3.09 KB
/
types.ts
File metadata and controls
142 lines (126 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
export interface User {
id?: string;
username: string;
email: string;
joinedAt: string;
}
export type SessionDuration = 15 | 30 | 45 | 60;
export type TopicStatus = 'strong' | 'weak' | 'revisit' | 'untested';
export interface ExtractedTopic {
id: string;
name: string;
concepts: string[];
noteSection?: string;
}
export interface ExtractedImage {
id: string;
pageNumber: number;
dataUrl: string; // in-memory only — never persisted to DB
maskedDataUrl?: string; // text labels painted over — shown to student in chat
}
export interface DiagramQuestion {
id: string;
pageNumber: number;
question: string;
used: boolean;
imageDataUrl?: string; // in-memory only — stripped before DB save
}
export interface QAMessage {
id: string;
role: 'ai' | 'user';
content: string;
topicId?: string;
tag?: 'question' | 'followup' | 'diagram';
imageId?: string; // links to a DiagramQuestion
timestamp: number;
}
export interface TopicPerformance {
topicId: string;
topicName: string;
status: TopicStatus;
evidence: string;
noteSection?: string;
concepts: string[];
}
export interface RevisitItem {
concept: string;
topicName: string;
noteSection?: string;
}
export interface KnowledgeReport {
sessionId: string;
date: string;
uploadTitle: string;
durationMinutes: number;
actualDurationMinutes: number;
topics: TopicPerformance[];
revisitList: RevisitItem[];
overtimeUsed: boolean;
}
export interface CheckSession {
id: string;
uploadTitle: string;
noteContent: string;
topics: ExtractedTopic[];
messages: QAMessage[];
duration: SessionDuration;
startTime: number;
endTime?: number;
isOvertimeActive: boolean;
topicPerformances: Record<string, TopicPerformance>;
report?: KnowledgeReport;
status: 'setup' | 'active' | 'overtime' | 'complete';
extractedImages: ExtractedImage[]; // in-memory only
diagramQuestions: DiagramQuestion[]; // persisted without imageDataUrl
diagramQuestionsEnabled: boolean;
}
export interface SessionTurnResponse {
message: string;
isFollowUp: boolean;
currentTopicId: string;
topicUpdate?: {
topicId: string;
status: 'strong' | 'weak' | 'revisit';
evidence: string;
};
sessionShouldEnd: boolean;
overtimeNeeded: boolean;
}
export interface PersonalityStyle {
rawDescription: string;
phrases: string[];
emojiUsage: 'none' | 'rare' | 'moderate' | 'frequent';
humor: string;
encouragement: string;
corrections: string;
}
export interface PersonalityProfile {
id: string;
name: string;
pfpDataUrl: string;
pin: string;
authorizedEmail: string;
style: PersonalityStyle;
createdAt: string;
}
export enum AppState {
AUTH = 'AUTH',
IDLE = 'IDLE',
UPLOADING = 'UPLOADING',
PROCESSING = 'PROCESSING',
SESSION_SETUP = 'SESSION_SETUP',
SESSION_ACTIVE = 'SESSION_ACTIVE',
REPORT = 'REPORT',
ERROR = 'ERROR'
}
export type ThemeColor = 'light' | 'dark' | 'pink' | 'ocean' | 'emerald';
export interface ThemeConfig {
id: ThemeColor;
name: string;
icon: string;
preview: {
primary: string;
secondary: string;
accent: string;
};
}