/** * Lia's Internal Task Queue * * This manages Lia's own todo list - separate from user /todos. * Allows async message processing where users can keep sending * while Lia works through her queue. */ export type TaskPriority = 'urgent' | 'high' | 'normal' | 'low'; export type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'cancelled'; export interface LiaTask { id: string; type: 'user_message' | 'follow_up' | 'scheduled' | 'background'; content: string; priority: TaskPriority; status: TaskStatus; createdAt: Date; startedAt?: Date; completedAt?: Date; result?: string; error?: string; metadata?: { userId?: string; messageId?: string; parentTaskId?: string; context?: 'personal' | 'team'; orgId?: string; }; } export interface LiaPlan { id: string; goal: string; steps: LiaPlanStep[]; status: 'planning' | 'executing' | 'completed' | 'failed'; createdAt: Date; completedAt?: Date; } export interface LiaPlanStep { id: string; description: string; status: TaskStatus; taskId?: string; notes?: string; } export type TaskQueueCallback = (task: LiaTask) => void; export type PlanCallback = (plan: LiaPlan) => void; /** * Lia's task queue - manages her internal todo list */ export declare class LiaTaskQueue { private tasks; private plans; private queue; private currentTask; private isProcessing; private onTaskUpdate?; private onPlanUpdate?; private processTask?; constructor(options?: { onTaskUpdate?: TaskQueueCallback; onPlanUpdate?: PlanCallback; processTask?: (task: LiaTask) => Promise; }); /** * Add a new task to the queue */ addTask(task: Omit): LiaTask; /** * Insert task ID into queue based on priority */ private insertByPriority; /** * Start processing the queue */ startProcessing(): Promise; /** * Get the current task being processed */ getCurrentTask(): LiaTask | null; /** * Get all pending tasks */ getPendingTasks(): LiaTask[]; /** * Get recent tasks (last N) */ getRecentTasks(limit?: number): LiaTask[]; /** * Get task by ID */ getTask(taskId: string): LiaTask | null; /** * Cancel a pending task */ cancelTask(taskId: string): boolean; /** * Create a plan (breaks down a goal into steps) */ createPlan(goal: string, steps: string[]): LiaPlan; /** * Update a plan step */ updatePlanStep(planId: string, stepId: string, update: Partial): boolean; /** * Get current plan */ getCurrentPlan(): LiaPlan | null; /** * Get all plans */ getPlans(): LiaPlan[]; /** * Get queue status for display */ getStatus(): { isProcessing: boolean; currentTask: LiaTask | null; pendingCount: number; queuePreview: string[]; }; /** * Format tasks as readable todo list (for LLM context) */ formatAsTodoList(): string; }