auto-lms / src /lib /types.ts
akashdahad's picture
Deploy auto-lms (Next.js + worker + embedded Postgres)
6d6eaef verified
Raw History Blame Contribute Delete
2.02 kB
// Domain vocabulary for auto-lms. Single source of truth for the string unions
// used across the DB schema, pipeline, and UI. Kept dependency-free so both the
// Next app and the standalone worker can import it.
export const DEPTHS = ['overview', 'standard', 'deep'] as const;
export type Depth = (typeof DEPTHS)[number];
export const DIFFICULTIES = ['beginner', 'intermediate', 'advanced'] as const;
export type Difficulty = (typeof DIFFICULTIES)[number];
export const SOURCE_TYPES = ['file', 'video', 'link', 'text'] as const;
export type SourceType = (typeof SOURCE_TYPES)[number];
export const SOURCE_STATUSES = ['pending', 'processing', 'ready', 'failed'] as const;
export type SourceStatus = (typeof SOURCE_STATUSES)[number];
export const COURSE_STATUSES = [
'draft',
'ingesting',
'structuring',
'awaiting_review',
'generating',
'ready',
'failed',
] as const;
export type CourseStatus = (typeof COURSE_STATUSES)[number];
export const SEGMENT_STATUSES = ['pending', 'scripted', 'narrated', 'rendered', 'failed'] as const;
export type SegmentStatus = (typeof SEGMENT_STATUSES)[number];
export const JOB_STATUSES = ['queued', 'running', 'awaiting_review', 'completed', 'failed'] as const;
export type JobStatus = (typeof JOB_STATUSES)[number];
// Ordered pipeline stages. The orchestrator walks these in sequence.
export const STAGES = [
'ingest',
'structure',
'script',
'narrate',
'render',
'assess',
'assemble',
] as const;
export type Stage = (typeof STAGES)[number];
// On-screen content for a single ~1-minute video segment.
export interface VisualCue {
heading?: string;
bullets: string[];
note?: string;
}
export type QuestionType = 'mcq' | 'short_answer';
export interface QuestionOption {
id: string;
text: string;
}
export interface Question {
id: string;
type: QuestionType;
prompt: string;
options?: QuestionOption[]; // mcq only
correctOptionId?: string; // mcq only
sampleAnswer?: string; // short_answer only
explanation?: string;
}