chore(core): improve ID generation and add runtime task validation

This commit is contained in:
Anjali Sridhar
2026-02-18 13:37:21 -08:00
parent b5db5d300a
commit 448af0a55c
+24 -13
View File
@@ -4,18 +4,29 @@
* SPDX-License-Identifier: Apache-2.0
*/
export type TaskType = 'epic' | 'task' | 'bug';
import { z } from 'zod';
export type TaskStatus = 'open' | 'in_progress' | 'blocked' | 'closed';
export const TaskTypeSchema = z.enum(['epic', 'task', 'bug']);
export type TaskType = z.infer<typeof TaskTypeSchema>;
export interface TrackerTask {
id: string;
title: string;
description: string;
type: TaskType;
status: TaskStatus;
parentId?: string;
dependencies: string[];
subagentSessionId?: string;
metadata?: Record<string, unknown>;
}
export const TaskStatusSchema = z.enum([
'open',
'in_progress',
'blocked',
'closed',
]);
export type TaskStatus = z.infer<typeof TaskStatusSchema>;
export const TrackerTaskSchema = z.object({
id: z.string().length(6),
title: z.string(),
description: z.string(),
type: TaskTypeSchema,
status: TaskStatusSchema,
parentId: z.string().optional(),
dependencies: z.array(z.string()),
subagentSessionId: z.string().optional(),
metadata: z.record(z.unknown()).optional(),
});
export type TrackerTask = z.infer<typeof TrackerTaskSchema>;