import { toExceededTaskItem, toFailedTaskItem, toPendingTaskItem, toTaskInfo, toTaskListItem } from './mapper.js';
export class TaskQueryService {
    projectDir;
    tasksFile;
    store;
    constructor(projectDir, tasksFile, store) {
        this.projectDir = projectDir;
        this.tasksFile = tasksFile;
        this.store = store;
    }
    listTasks() {
        const state = this.store.read();
        return state.tasks
            .filter((task) => task.status === 'pending')
            .map((task) => toTaskInfo(this.projectDir, this.tasksFile, task));
    }
    listPendingTaskItems() {
        const state = this.store.read();
        return state.tasks
            .filter((task) => task.status === 'pending')
            .map((task) => toPendingTaskItem(this.projectDir, this.tasksFile, task));
    }
    listAllTaskItems() {
        const state = this.store.read();
        return state.tasks.map((task) => toTaskListItem(this.projectDir, this.tasksFile, task));
    }
    listFailedTasks() {
        const state = this.store.read();
        return state.tasks
            .filter((task) => task.status === 'failed')
            .map((task) => toFailedTaskItem(this.projectDir, this.tasksFile, task));
    }
    listExceededTasks() {
        const state = this.store.read();
        return state.tasks
            .filter((task) => task.status === 'exceeded')
            .map((task) => toExceededTaskItem(this.projectDir, this.tasksFile, task));
    }
}
//# sourceMappingURL=taskQueryService.js.map