wyuc 0d20abfed9 Initial commit: OpenMAIC AI classroom platform
Next.js 16 App Router application with:
- AI-powered interactive classroom generation from PDF/text requirements
- Multi-agent discussion system (teacher, students, assistant roles)
- Provider abstraction for LLM, TTS, ASR, image, video, web search
- Local-first data architecture (IndexedDB/Dexie)
- i18n support (zh-CN/en-US)
- Structured logger, SSRF guard, lint/build passing (0 errors)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:41:07 +08:00

63 lines
1.9 KiB
TypeScript

/**
* Playback Types - Types for lecture playback and live discussion engine
*/
import type { PlaybackSnapshot } from '@/lib/utils/playback-storage';
export type { PlaybackSnapshot };
/** Visual effects (for onEffectFire callback) */
export type Effect =
| { kind: 'spotlight'; targetId: string; dimOpacity?: number }
| { kind: 'laser'; targetId: string; color?: string };
/** Engine mode state machine */
export type EngineMode = 'idle' | 'playing' | 'paused' | 'live';
/** Discussion topic state */
export type TopicState = 'active' | 'pending' | 'closed';
/** Trigger event (for proactive discussion card) */
export interface TriggerEvent {
id: string;
question: string;
prompt?: string;
agentId?: string;
}
/** Playback engine callbacks */
export interface PlaybackEngineCallbacks {
onModeChange?: (mode: EngineMode) => void;
onSceneChange?: (sceneId: string) => void;
onSpeechStart?: (text: string) => void;
onSpeechEnd?: () => void;
onTextDelta?: (content: string) => void;
onSpeakerChange?: (role: string) => void;
onEffectFire?: (effect: Effect) => void;
// Proactive discussion
onProactiveShow?: (trigger: TriggerEvent) => void;
onProactiveHide?: () => void;
// Discussion lifecycle
onDiscussionConfirmed?: (topic: string, prompt?: string, agentId?: string) => void;
onDiscussionEnd?: () => void;
onUserInterrupt?: (text: string) => void;
// Topic / Transcript
onTopicStart?: (type: 'lecture' | 'discussion', title: string) => void;
onTopicAppend?: (role: string, text: string) => void;
onTopicEnd?: () => void;
// Progress tracking (for persistence)
onProgress?: (snapshot: PlaybackSnapshot) => void;
/** Check if a given agent is in the user's selected list (for skipping discussion actions) */
isAgentSelected?: (agentId: string) => boolean;
/** Get current playback speed multiplier (e.g. 1, 1.5, 2) */
getPlaybackSpeed?: () => number;
onComplete?: () => void;
}