Manuscript Architecture & Technical Specs

TTS with word timestamps, AI text analysis, annotation system, EPUB processing, and 4 more services.

1. TTS Service (Text-to-Speech with Word Timestamps)

ProviderVoiceGender
OpenAIAlloyNeutral
OpenAIEchoMale
OpenAINovaFemale
OpenAIShimmerFemale
ElevenLabsRachelFemale
ElevenLabsDomiFemale
ElevenLabsBellaFemale
ElevenLabsAntoniMale
AzureJenny (US)Female
AzureGuy (US)Male
AzureSonia (UK)Female
AzureRyan (UK)Male
Amazon PollyJoannaFemale
Amazon PollyMatthewMale
Amazon PollySalliFemale

2. AI Service (Text Analysis & Tutoring)

Aeion Manuscript provides AI-powered text analysis, tutoring, and content generation.

Analysis Types:

typescript export interface AnalyzeTextData { text: string; bookTitle?: string; chapterTitle?: string; type?: "explain" | "translate" | "analyze" | "simplify" | "define"; }

Analysis Prompts:

Each analysis type applies a tailored approach: plain-language explanation, translation with vocabulary notes, literary analysis of theme and tone, grade-level simplification, or clear definitions of key terms — always grounded in the surrounding book/chapter context when it's available.

Q&A Tutoring with Context:

The tutor builds context from the book title, author, and current chapter (plus a chapter summary when available), so its answers stay grounded in what the reader is actually reading. Conversation history carries forward with each question, so follow-ups build naturally on earlier answers instead of starting from scratch.

Flashcard Generation:

typescript interface Flashcard { front: string; back: string; }

Flashcards are generated directly from selected text — front is the question or key term, back is the answer or definition.

// Example output: // [{"front": "What is the main theme?", "back": "The conflict between..."}, // {"front": "Who is the protagonist?", "back": "John Smith"}]

Study Guide Generation:

typescript interface StudyGuide { key_concepts: string[]; discussion_questions: string[]; important_quotes: string[]; }

Generates key concepts, discussion questions, and important quotes with chapter references across an entire book in one pass — ready for classroom discussion or exam prep.

3. Annotation Service (Highlights, Notes, Vocabulary)

TypeDescriptionUser-Scoped
highlightText selection highlight
bookmarkPosition bookmark
noteAttached note text
vocabularyWord definition entry
"bookmark""note"
"learning""familiar"
"learning""familiar"

4. EPUB Service (Import & Processing)

EPUB import handles file parsing and content extraction.

EPUB Structure:

```typescript interface ParsedEpub { title: string; author: string; chapters: ParsedChapter[]; }

interface ParsedChapter { title: string; text: string; href: string; } ```

Import Flow:

  1. Unzip the EPUB archive and read META-INF/container.xml to locate the .opf manifest.
  2. Extract title and author from the manifest, walking the spine to get the ordered list of chapter documents.
  3. Process each chapter — strip scripts/styles/tags to plain text, falling back to a numbered chapter title when the source has none.
  4. Create the Book record and one Chapter per spine document; word count and estimated read time are then calculated automatically on save.

HTML Cleaning:

Chapter content is sanitized on import — scripts, styles, and tracking code are stripped, whitespace is normalized — leaving clean, readable content ready for the reader view.

Word Count:

Word counts are calculated per chapter from the cleaned text, powering estimated reading time and progress percentages throughout the library.

5. Book Service (Library Management)

The library keeps track of reading progress and goals for every book.

Book Record:

typescript interface Book { id: string; title: string; author: string; coverImage?: string; genres?: string[]; isbn?: string; publisher?: string; language?: string; totalWords?: number; totalChapters: number; estimatedReadTime?: number; }

Per-user reading progress is tracked separately from the book catalog record, in its own reading-session entry per user/book pair:

typescript interface ReadingSession { user: string; book: string; currentChapter: number; progressPercentage: number; lastPosition?: Record<string, unknown>; // scroll position, element, chapter totalReadingTime: number; // seconds sessionCount: number; startedAt: string; lastReadAt?: string; completedAt?: string; status: string; }

Reading Goal Tracking:

Goals are set per-user (not per-book) with a cadence and a target:

typescript interface ReadingGoal { user: string; type: "daily" | "weekly" | "yearly"; targetMinutes?: number; targetBooks?: number; currentStreak: number; longestStreak: number; status: "active" | "paused" | "completed"; }

Only one active goal per type per user is allowed at a time. Reading activity updates the goal's streak automatically.

Reading Statistics:

typescript interface ReaderStats { totalBooksRead: number; totalReadingHours: number; currentStreak: number; favoriteGenre: string | null; }

6. Reader Service (Reading Experience)

ThemeBackgroundTextBest For
light#FFFFFF#1a1a1aDaytime reading
sepia#F4ECD8#5B4636Classic feel
dark#1E1E1E#E0E0E0Night reading
black#000000#FFFFFFOLED screens

Composes with the rest of the OS