Files
wehub-resource-sync c48612c494
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:23 +08:00

65 lines
1.5 KiB
TypeScript

/**
* Type definitions for the generation pipeline.
*/
// ==================== Agent Info ====================
/** Lightweight agent info passed to the generation pipeline */
export interface AgentInfo {
id: string;
name: string;
role: string;
persona?: string;
}
// ==================== Cross-Page Context ====================
/** Cross-page context for maintaining speech coherence across scenes */
export interface SceneGenerationContext {
pageIndex: number; // Current page (1-based)
totalPages: number; // Total number of pages
allTitles: string[]; // All page titles in order
previousSpeeches: string[]; // Speech texts from the previous page only
}
// ==================== Generated Slide Data Interface ====================
/**
* AI-generated slide data structure
* Used to parse AI responses
*/
export interface GeneratedSlideData {
elements: Array<{
type: 'text' | 'image' | 'video' | 'shape' | 'chart' | 'latex' | 'line';
left: number;
top: number;
width: number;
height: number;
[key: string]: unknown;
}>;
background?: {
type: 'solid' | 'gradient';
color?: string;
gradient?: {
type: 'linear' | 'radial';
colors: Array<{ pos: number; color: string }>;
rotate: number;
};
};
remark?: string;
}
// ==================== Types ====================
export interface GenerationResult<T> {
success: boolean;
data?: T;
error?: string;
}
export type AICallFn = (
systemPrompt: string,
userPrompt: string,
images?: Array<{ id: string; src: string }>,
) => Promise<string>;