-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
96 lines (88 loc) · 2.33 KB
/
Copy pathtypes.ts
File metadata and controls
96 lines (88 loc) · 2.33 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
export type Stage =
| 'input'
| 'loading_options'
| 'options'
| 'generating'
| 'review'
| 'done';
export type ProblemType = 'Script' | 'Function' | 'Class' | 'Object usage';
export type ClassAssessment =
| 'Constructor — property assignment'
| 'Constructor — computed property'
| 'Instance method'
| 'Constant property'
| 'Operator overloading';
export type Difficulty = 'Easy' | 'Medium' | 'Hard';
export type ReviewTab = 'description' | 'solution' | 'template' | 'tests';
export type ModelId =
| 'claude-haiku-4-5-20251001'
| 'claude-sonnet-4-6'
| 'claude-opus-4-6';
export const MODEL_OPTIONS: { label: string; value: ModelId }[] = [
{ label: 'Claude Haiku 4.5 — fastest, lowest cost', value: 'claude-haiku-4-5-20251001' },
{ label: 'Claude Sonnet 4.6 — recommended', value: 'claude-sonnet-4-6' },
{ label: 'Claude Opus 4.6 — most capable', value: 'claude-opus-4-6' },
];
export interface ProblemOption {
id: number;
title: string;
difficulty: Difficulty;
concept_focus: string;
brief_description: string;
suggested_variable: string;
problem_type: ProblemType;
}
export interface Artifacts {
description: string;
solution: string;
template: string;
tests: string;
}
export interface GeneratedProblem {
option: ProblemOption;
artifacts: Artifacts;
}
export interface AppState {
stage: Stage;
// Stage 0 inputs
apiKey: string;
showApiKey: boolean;
model: ModelId;
objective: string;
numOptions: number;
problemType: ProblemType;
classAssessment: ClassAssessment;
disclosureAccepted: boolean;
showHints: boolean;
// Stage 1
options: ProblemOption[];
selectedIds: number[];
// Stage 2/3
generatedProblems: GeneratedProblem[];
currentProblemIdx: number;
generatingStep: number; // 0–3 active, 4 = all done
logs: string[];
error: string | null;
// Review
activeReviewTab: ReviewTab;
}
export const INITIAL_STATE: AppState = {
stage: 'input',
apiKey: '',
showApiKey: false,
model: 'claude-sonnet-4-6',
objective: '',
numOptions: 4,
problemType: 'Script',
classAssessment: 'Constructor — property assignment',
disclosureAccepted: false,
showHints: true,
options: [],
selectedIds: [],
generatedProblems: [],
currentProblemIdx: 0,
generatingStep: 0,
logs: [],
error: null,
activeReviewTab: 'description',
};