-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
153 lines (134 loc) · 3.45 KB
/
types.ts
File metadata and controls
153 lines (134 loc) · 3.45 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
143
144
145
146
147
148
149
150
151
152
153
export enum Role {
USER = 'user',
MODEL = 'model'
}
export interface Attachment {
name: string;
mimeType: string;
data: string; // Base64 for binary, raw text for text/plain
size?: number;
originalFileType?: string; // e.g. 'docx', 'pdf'
}
export interface Message {
id: string;
role: Role;
text: string;
attachments?: Attachment[];
timestamp: number;
isStreaming?: boolean;
isError?: boolean;
errorMessage?: string;
groundingMetadata?: any; // For Google Search Grounding results
plan?: string; // Extracted plan content
}
export interface ChatSession {
id: string;
title: string;
messages: Message[];
updatedAt: number;
}
export interface Task {
id: string;
text: string;
completed: boolean;
}
export interface Note {
id: string;
title: string;
content: string;
createdAt: number;
updatedAt: number;
tags?: string[];
theme?: 'blue' | 'yellow' | 'green' | 'purple' | 'default';
}
export interface ApiKeys {
deepseek?: string;
kimi?: string;
qwen?: string;
}
export interface UserProfile {
nickname: string;
profession: string;
about: string;
customInstructions: string;
}
// --- Study Module Types ---
export interface StudyTopic {
id: string;
title: { zh: string; en: string }; // Bilingual titles
description: { zh: string; en: string };
promptKey: string; // Key to help AI understand context
}
export interface StudyStage {
id: string;
title: { zh: string; en: string };
description: { zh: string; en: string };
topics: StudyTopic[];
}
export interface Course {
id: string;
name: string; // e.g. "Grade 3 Math"
subject: string;
grade: string;
stages: StudyStage[];
createdAt: number;
}
export interface Badge {
id: string;
name: { zh: string; en: string };
description: { zh: string; en: string };
icon: string; // Emoji or icon name
unlocked: boolean;
condition: { zh: string; en: string };
}
export interface StudyActivity {
id: string;
timestamp: number;
topicId: string;
topicTitle: string;
type: 'quiz' | 'concept' | 'visual';
score?: number; // For quizzes
content?: string; // Saved generated content
quizData?: any; // Saved quiz JSON
userAnswerIndex?: number; // Saved user answer
}
export interface SchoolNote {
id: string;
timestamp: number;
subject: 'math' | 'chinese' | 'english' | 'science' | 'other';
content: string;
images: string[]; // Base64 strings
aiAnalysis?: string; // Saved AI interpretation
aiPractice?: string; // Saved generated questions
}
export interface TopicReviewData {
topicId: string;
lastReviewed: number; // timestamp
nextReview: number; // timestamp
interval: number; // current interval in days
easeFactor: number; // SM-2 ease factor (default 2.5)
streak: number; // consecutive correct answers
}
export interface StudyState {
xp: number;
level: number;
badges: Badge[];
activityLog: StudyActivity[]; // Generated learning history
schoolNotes: SchoolNote[]; // Daily teacher notes
courses: Course[]; // Custom generated curriculums
activeCourseId: string; // Currently selected course
reviewData: Record<string, TopicReviewData>; // Map of topicId to review status
}
// --- Academic Module Types ---
export interface Paper {
id: string;
title: string;
summary: string;
authors: string[];
published: string;
link: string;
pdfLink: string;
category: string;
}
export type AppView = 'chat' | 'notes' | 'painting' | 'study' | 'academic';
export type Language = 'en' | 'zh';