File size: 6,637 Bytes
65d68f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import type { ElementType } from "react";
import {
  BookOpen,
  ClipboardList,
  FileQuestion,
  FileText,
  Folder,
  GraduationCap,
  Layers3,
  Link as LinkIcon,
  Mic,
  Moon,
  Upload,
  Video,
} from "lucide-react";
import type { StudyIntent } from "@/lib/study-intents";
import type { UploadMenuAction } from "./types";

export type PrimaryStudyAction = {
  label: string;
  intent: StudyIntent;
  prompt: string;
  icon: ElementType;
};

export type UploadMenuItem = {
  label: string;
  description: string;
  icon: ElementType;
  action: UploadMenuAction;
  enabled: boolean;
};

export const primaryChips: PrimaryStudyAction[] = [
  {
    label: "Teach chapter",
    intent: "teach_topic",
    prompt:
      "Teach the most important chapter from {context}. Start from basics, then give scoring keywords, examples, common mistakes, and one practice question.",
    icon: BookOpen,
  },
  {
    label: "Analyze uploaded PYQ",
    intent: "analyze_pyq",
    prompt:
      "Analyze repeated questions and paper signals from {context}. Base every pattern only on the papers I have uploaded, and if there is not enough evidence yet, say exactly what is missing.",
    icon: GraduationCap,
  },
  {
    label: "Make quiz",
    intent: "generate_quiz",
    prompt:
      "Make an exam-focused quiz from {context}. Include answers, traps, and what each question helps me score.",
    icon: FileQuestion,
  },
  {
    label: "Flashcards",
    intent: "generate_flashcards",
    prompt:
      "Make high-yield flashcards from {context}. Focus on definitions, formulas, diagrams, and common mistakes.",
    icon: Layers3,
  },
  {
    label: "Study video",
    intent: "create_video_plan",
    prompt:
      "Create a 10-minute exam-focused study video plan from {context}. Break it into scenes, narration, on-screen text, and revision keywords.",
    icon: Video,
  },
  {
    label: "Last night revision",
    intent: "create_revision_plan",
    prompt:
      "I have one night left. Make a last-night revision plan for {context}. Tell me what to study, skim, skip, and self-test. If the topic is missing, ask me one friendly question first.",
    icon: Moon,
  },
  {
    label: "Study plan",
    intent: "continue_learning",
    prompt:
      "Build my study plan for {context}. Rank what scores, what to do first, weak areas, quick wins, and the next best action. If I did not give a topic yet, ask the smallest useful question.",
    icon: ClipboardList,
  },
];

export const loadingMessages: Partial<Record<StudyIntent, string>> = {
  teach_topic: "Retrieving concepts and shaping an exam-focused explanation...",
  explain_source: "Searching your source and building a grounded answer...",
  generate_notes: "Extracting scoring points, traps, and revision hooks from your material...",
  generate_quiz: "Building practice questions with traps and mark-wise explanations...",
  generate_flashcards: "Creating active-recall cards with memory hooks...",
  generate_exam_answer: "Structuring mark-wise board answers and underline keywords...",
  create_revision_plan: "Ranking what to study, skim, and self-test before the exam...",
  create_video_plan: "Planning scenes, narration beats, and revision moments...",
  render_video: "Preparing a render-ready lesson plan from your material...",
  continue_learning: "Building a study path ranked by scoring impact...",
  analyze_pyq: "Fetching verified previous-year papers and pattern signals...",
  summarize_source: "Summarizing retrieved chunks from your selected source...",
};

/**
 * Ordered "thinking" beats per intent — shown one at a time while the answer
 * is generating, so the wait reads like real work (StudyFetch's staged
 * loader) instead of one frozen spinner line. The last beat lingers until the
 * response actually lands. Falls back to loadingMessages for any intent not
 * listed here.
 */
export const loadingStages: Partial<Record<StudyIntent, string[]>> = {
  teach_topic: ["Reading your topic", "Pulling the core concepts", "Structuring the lesson", "Writing clear examples"],
  explain_source: ["Opening your source", "Finding the relevant passages", "Grounding the answer", "Writing it plainly"],
  generate_notes: ["Reading the material", "Extracting scoring points", "Marking traps and keywords", "Laying out the notes"],
  generate_quiz: ["Reading the topic", "Choosing what to test", "Writing questions and traps", "Adding mark-wise answers"],
  generate_flashcards: ["Reading the topic", "Picking the key ideas", "Writing fronts and backs", "Adding memory hooks"],
  generate_exam_answer: ["Reading the question", "Planning the mark scheme", "Writing the board answer", "Underlining keywords"],
  create_revision_plan: ["Checking time left", "Ranking by scoring impact", "Sequencing study and skim", "Adding self-test checkpoints"],
  create_video_plan: ["Reading the topic", "Blocking out scenes", "Writing narration beats", "Placing revision moments"],
  render_video: ["Reading your material", "Planning the lesson", "Preparing the render", "Finalizing scenes"],
  continue_learning: ["Reading your context", "Ranking by scoring impact", "Choosing the next move", "Writing the path"],
  analyze_pyq: ["Fetching verified papers", "Scanning for patterns", "Weighing repeated topics", "Summarizing honest signals"],
  summarize_source: ["Opening your source", "Reading the chunks", "Distilling the core", "Writing the summary"],
  predict_questions: ["Reading available papers", "Weighing question styles", "Avoiding false certainty", "Writing likely patterns"],
  show_formulas: ["Reading the chapter", "Collecting the formulas", "Noting when to use each", "Laying them out"],
  simplify_answer: ["Reading what's confusing", "Finding a simpler angle", "Rewriting in plain words"],
};

export const uploadMenuItems: UploadMenuItem[] = [
  { label: "Upload material", description: "Selectable-text PDF or TXT", icon: Upload, action: "material", enabled: true },
  { label: "Question paper", description: "Selectable-text PDF for the PYQ pipeline", icon: FileQuestion, action: "paper", enabled: true },
  { label: "Syllabus", description: "Paste syllabus text", icon: BookOpen, action: "syllabus", enabled: true },
  { label: "Paste link", description: "Save a link source", icon: LinkIcon, action: "link", enabled: true },
  { label: "Add text", description: "Paste syllabus or notes", icon: FileText, action: "text", enabled: true },
  { label: "Record audio", description: "Coming soon", icon: Mic, action: "audio", enabled: false },
  { label: "Import document", description: "Coming soon", icon: Folder, action: "import", enabled: false },
];