feat(HAI-002): add status field to Task type and store

This commit is contained in:
Dustin Byrne
2026-03-25 19:23:07 -04:00
parent 8e84832505
commit dc36ad1d57
2 changed files with 8 additions and 1 deletions

View File

@@ -168,7 +168,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
async updateTask(
id: string,
updates: { title?: string; description?: string; prompt?: string; worktree?: string },
updates: { title?: string; description?: string; prompt?: string; worktree?: string; status?: string | null },
): Promise<Task> {
const dir = this.taskDir(id);
const data = await readFile(join(dir, "task.json"), "utf-8");
@@ -177,6 +177,11 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
if (updates.title !== undefined) task.title = updates.title;
if (updates.description !== undefined) task.description = updates.description;
if (updates.worktree !== undefined) task.worktree = updates.worktree;
if (updates.status === null) {
task.status = undefined;
} else if (updates.status !== undefined) {
task.status = updates.status;
}
task.updatedAt = new Date().toISOString();
const taskJsonPath = join(dir, "task.json");
@@ -318,6 +323,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
private async moveToDone(task: Task, dir: string): Promise<void> {
task.column = "done";
task.worktree = undefined;
task.status = undefined;
task.updatedAt = new Date().toISOString();
const taskJsonPath = join(dir, "task.json");

View File

@@ -8,6 +8,7 @@ export interface Task {
column: Column;
dependencies: string[];
worktree?: string;
status?: string;
createdAt: string;
updatedAt: string;
}