Repository navigation
Expand file tree
/
Copy pathtypes.ts
More file actions
113 lines (99 loc) · 2.82 KB
/
Copy pathtypes.ts
File metadata and controls
113 lines (99 loc) · 2.82 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
export type Category = 'work' | 'uni' | 'social' | 'personal';
export type Priority = 'high' | 'medium' | 'low';
export type ContextMode = 'balanced' | 'productive' | 'recharge' | 'restricted';
export type TaskStatus = 'unprocessed' | 'new' | 'pending' | 'completed';
export type ViewState = 'dashboard' | 'me' | 'settings' | 'calendar' | 'vitals';
export type Chronotype = 'early_bird' | 'night_owl' | 'flexible';
export type AIPersona = 'strict' | 'gentle' | 'rhymes' | 'coaching' | 'stoic';
export type VitalType = 'stress' | 'recovery' | 'sleep' | 'battery';
export interface Task {
id: string;
title: string;
category: Category;
priority: Priority;
timeEstimate: string; // e.g., "30m"
dueDate: Date;
status: TaskStatus;
isInbox: boolean;
isCalendarEvent?: boolean;
focusMode: ContextMode;
isFlexible: boolean;
completedAt?: Date;
}
export interface Goal {
id: string;
text: string;
category: Category;
completed: boolean;
}
export interface UserMetrics {
// Stress
stressLevel: number; // 0-100
currentHR: number; // BPM
currentHRV: number; // ms
// Recovery
recovery: number; // 0-100%
restingHR: number; // BPM
restingHRV: number; // ms
// Battery
bodyBattery: number; // 0-100%
batteryCharge: number; // + gain
batteryDrain: number; // - loss
// Sleep
sleep: {
score: number; // 0-100
lastNight: number; // hours (Duration)
timeInBed: number; // hours
weeklyAverage: number; // hours
};
steps: {
current: number;
goal: number;
};
}
export interface PlanningSlot {
day: string; // e.g., 'Sunday'
time: string; // e.g., '19:00'
}
export interface SleepGoal {
min: number;
max: number;
rangeStart: string; // e.g., "23:00"
rangeEnd: string; // e.g., "07:00"
}
export interface UserProfile {
name: string;
avatarUrl?: string;
onboardingCompleted: boolean;
goals: Goal[];
themePreference: 'light' | 'dark' | 'system';
integrations: { googleCalendar: boolean; appleHealth: boolean; };
// New Onboarding Fields
planningSlot: PlanningSlot;
chronotype: Chronotype;
sleepGoal: SleepGoal;
breakDuration: number; // minutes
avgSocialTime: number; // hours per week
recoveryActivities: string[];
personaModes: Record<ContextMode, AIPersona>;
}
export interface OptimizationProposal {
tasks: Task[];
reasoning: string;
}
export interface AppState {
tasks: Task[];
metrics: UserMetrics;
mode: ContextMode;
userProfile: UserProfile;
currentView: ViewState;
activeFilter: Category | 'all';
isTaskInputOpen: boolean;
isChatOpen: boolean;
isGoalsModalOpen: boolean;
isOnboardingActive: boolean;
selectedTaskId: string | null;
selectedVital: VitalType | null; // New field
optimizationProposal: OptimizationProposal | null;
chatInitialMessage?: string; // New: to pass message from dashboard to chat
}