TaskTracker.d.ts•2.56 kB
/**
* TaskTracker
*
* Analyzes and tracks task context including:
* - Task type inference from prompts
* - Focus area detection
* - Working files tracking
* - Recent actions history
*/
export declare enum TaskType {
CREATION = "creation",
DEBUGGING = "debugging",
REFACTORING = "refactoring",
STYLING = "styling",
TESTING = "testing",
DOCUMENTATION = "documentation",
ANALYSIS = "analysis",
API = "api",
GENERAL = "general"
}
export declare enum FocusArea {
FRONTEND = "frontend",
BACKEND = "backend",
DATABASE = "database",
AUTHENTICATION = "authentication",
COMPONENTS = "components",
STATE = "state",
ROUTING = "routing",
STYLING = "styling",
TESTING = "testing",
DEPLOYMENT = "deployment",
GENERAL = "general"
}
export interface TaskAction {
timestamp: number;
action: string;
files?: string[];
description: string;
}
export interface TaskContext {
taskType: TaskType;
focusArea: FocusArea;
relevantFiles: string[];
currentPrompt: string;
recentActions: TaskAction[];
taskStartTime: number;
}
export declare class TaskTracker {
private currentTask;
private log;
private maxRecentActions;
constructor(initialTaskType?: TaskType);
/**
* Get current task context
*/
getTaskContext(): TaskContext;
/**
* Reset task context with a new task
*/
resetTask(taskType?: TaskType, prompt?: string): void;
/**
* Update task context based on a new prompt
*/
updateFromPrompt(prompt: string): TaskContext;
/**
* Infer the type of task from a prompt
*/
inferTaskType(prompt: string): TaskType;
/**
* Infer the focus area from a prompt
*/
inferFocusArea(prompt: string): FocusArea;
/**
* Extract file references from a prompt
*/
private extractFileReferences;
/**
* Record a new action in the task history
*/
recordAction(action: string, files?: string[], description?: string): void;
/**
* Add relevant files to the task context
*/
addRelevantFiles(files: string[]): void;
/**
* Explicitly set the task type
*/
setTaskType(taskType: TaskType): void;
/**
* Explicitly set the focus area
*/
setFocusArea(focusArea: FocusArea): void;
/**
* Get task duration in seconds
*/
getTaskDuration(): number;
/**
* Generate a summary of the current task context
*/
generateTaskSummary(): string;
}
export default TaskTracker;