chore: fix formatting issues
This commit is contained in:
committed by
Ralph Khreish
parent
2063dc4b7d
commit
a2de49dd90
@@ -2,20 +2,20 @@ import { z } from 'zod';
|
||||
|
||||
// Schema that matches the inline AiTaskDataSchema from add-task.js
|
||||
export const AddTaskResponseSchema = z.object({
|
||||
title: z.string().describe('Clear, concise title for the task'),
|
||||
description: z
|
||||
.string()
|
||||
.describe('A one or two sentence description of the task'),
|
||||
details: z
|
||||
.string()
|
||||
.describe('In-depth implementation details, considerations, and guidance'),
|
||||
testStrategy: z
|
||||
.string()
|
||||
.describe('Detailed approach for verifying task completion'),
|
||||
dependencies: z
|
||||
.array(z.number())
|
||||
.nullable()
|
||||
.describe(
|
||||
'Array of task IDs that this task depends on (must be completed before this task can start)'
|
||||
)
|
||||
});
|
||||
title: z.string().describe('Clear, concise title for the task'),
|
||||
description: z
|
||||
.string()
|
||||
.describe('A one or two sentence description of the task'),
|
||||
details: z
|
||||
.string()
|
||||
.describe('In-depth implementation details, considerations, and guidance'),
|
||||
testStrategy: z
|
||||
.string()
|
||||
.describe('Detailed approach for verifying task completion'),
|
||||
dependencies: z
|
||||
.array(z.number())
|
||||
.nullable()
|
||||
.describe(
|
||||
'Array of task IDs that this task depends on (must be completed before this task can start)'
|
||||
)
|
||||
});
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const ComplexityAnalysisItemSchema = z.object({
|
||||
taskId: z.number().int().positive(),
|
||||
taskTitle: z.string(),
|
||||
complexityScore: z.number().min(1).max(10),
|
||||
recommendedSubtasks: z.number().int().positive(),
|
||||
expansionPrompt: z.string(),
|
||||
reasoning: z.string()
|
||||
taskId: z.number().int().positive(),
|
||||
taskTitle: z.string(),
|
||||
complexityScore: z.number().min(1).max(10),
|
||||
recommendedSubtasks: z.number().int().positive(),
|
||||
expansionPrompt: z.string(),
|
||||
reasoning: z.string()
|
||||
});
|
||||
|
||||
export const ComplexityAnalysisResponseSchema = z.object({
|
||||
complexityAnalysis: z.array(ComplexityAnalysisItemSchema)
|
||||
});
|
||||
complexityAnalysis: z.array(ComplexityAnalysisItemSchema)
|
||||
});
|
||||
|
||||
@@ -1,25 +1,35 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
// Base schemas that will be reused across commands
|
||||
export const TaskStatusSchema = z.enum(['pending', 'in-progress', 'blocked', 'done', 'cancelled', 'deferred']);
|
||||
export const TaskStatusSchema = z.enum([
|
||||
'pending',
|
||||
'in-progress',
|
||||
'blocked',
|
||||
'done',
|
||||
'cancelled',
|
||||
'deferred'
|
||||
]);
|
||||
|
||||
export const BaseTaskSchema = z.object({
|
||||
id: z.number().int().positive(),
|
||||
title: z.string().min(1).max(200),
|
||||
description: z.string().min(1),
|
||||
status: TaskStatusSchema,
|
||||
dependencies: z.array(z.union([z.number().int(), z.string()])).default([]),
|
||||
priority: z.enum(['low', 'medium', 'high', 'critical']).nullable().default(null),
|
||||
details: z.string().nullable().default(null),
|
||||
testStrategy: z.string().nullable().default(null)
|
||||
id: z.number().int().positive(),
|
||||
title: z.string().min(1).max(200),
|
||||
description: z.string().min(1),
|
||||
status: TaskStatusSchema,
|
||||
dependencies: z.array(z.union([z.number().int(), z.string()])).default([]),
|
||||
priority: z
|
||||
.enum(['low', 'medium', 'high', 'critical'])
|
||||
.nullable()
|
||||
.default(null),
|
||||
details: z.string().nullable().default(null),
|
||||
testStrategy: z.string().nullable().default(null)
|
||||
});
|
||||
|
||||
export const SubtaskSchema = z.object({
|
||||
id: z.number().int().positive(),
|
||||
title: z.string().min(5).max(200),
|
||||
description: z.string().min(10),
|
||||
dependencies: z.array(z.number().int()).default([]),
|
||||
details: z.string().min(20),
|
||||
status: z.enum(['pending', 'done', 'completed']).default('pending'),
|
||||
testStrategy: z.string().nullable().default(null)
|
||||
});
|
||||
id: z.number().int().positive(),
|
||||
title: z.string().min(5).max(200),
|
||||
description: z.string().min(10),
|
||||
dependencies: z.array(z.number().int()).default([]),
|
||||
details: z.string().min(20),
|
||||
status: z.enum(['pending', 'done', 'completed']).default('pending'),
|
||||
testStrategy: z.string().nullable().default(null)
|
||||
});
|
||||
|
||||
@@ -2,5 +2,5 @@ import { z } from 'zod';
|
||||
import { SubtaskSchema } from './base-schemas.js';
|
||||
|
||||
export const ExpandTaskResponseSchema = z.object({
|
||||
subtasks: z.array(SubtaskSchema)
|
||||
});
|
||||
subtasks: z.array(SubtaskSchema)
|
||||
});
|
||||
|
||||
@@ -2,17 +2,17 @@ import { z } from 'zod';
|
||||
|
||||
// Schema for a single task from PRD parsing
|
||||
const PRDSingleTaskSchema = z.object({
|
||||
id: z.number().int().positive(),
|
||||
title: z.string().min(1),
|
||||
description: z.string().min(1),
|
||||
details: z.string().nullable(),
|
||||
testStrategy: z.string().nullable(),
|
||||
priority: z.enum(['high', 'medium', 'low']).nullable(),
|
||||
dependencies: z.array(z.number().int().positive()).nullable(),
|
||||
status: z.string().nullable()
|
||||
id: z.number().int().positive(),
|
||||
title: z.string().min(1),
|
||||
description: z.string().min(1),
|
||||
details: z.string().nullable(),
|
||||
testStrategy: z.string().nullable(),
|
||||
priority: z.enum(['high', 'medium', 'low']).nullable(),
|
||||
dependencies: z.array(z.number().int().positive()).nullable(),
|
||||
status: z.string().nullable()
|
||||
});
|
||||
|
||||
// Schema for the AI response - only expects tasks array since metadata is generated by the code
|
||||
export const ParsePRDResponseSchema = z.object({
|
||||
tasks: z.array(PRDSingleTaskSchema)
|
||||
});
|
||||
tasks: z.array(PRDSingleTaskSchema)
|
||||
});
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import { UpdateTasksResponseSchema } from './update-tasks.js';
|
||||
import { ExpandTaskResponseSchema } from './expand-task.js';
|
||||
import { AddTaskResponseSchema } from './add-task.js';
|
||||
import { ComplexityAnalysisResponseSchema } from './analyze-complexity.js';
|
||||
import { ExpandTaskResponseSchema } from './expand-task.js';
|
||||
import { ParsePRDResponseSchema } from './parse-prd.js';
|
||||
import { UpdateSubtaskResponseSchema } from './update-subtask.js';
|
||||
import { UpdateTaskResponseSchema } from './update-task.js';
|
||||
import { AddTaskResponseSchema } from './add-task.js';
|
||||
import { ParsePRDResponseSchema } from './parse-prd.js';
|
||||
import { UpdateTasksResponseSchema } from './update-tasks.js';
|
||||
|
||||
export const COMMAND_SCHEMAS = {
|
||||
'update-tasks': UpdateTasksResponseSchema,
|
||||
'expand-task': ExpandTaskResponseSchema,
|
||||
'analyze-complexity': ComplexityAnalysisResponseSchema,
|
||||
'update-subtask-by-id': UpdateSubtaskResponseSchema,
|
||||
'update-task-by-id': UpdateTaskResponseSchema,
|
||||
'add-task': AddTaskResponseSchema,
|
||||
'parse-prd': ParsePRDResponseSchema
|
||||
'update-tasks': UpdateTasksResponseSchema,
|
||||
'expand-task': ExpandTaskResponseSchema,
|
||||
'analyze-complexity': ComplexityAnalysisResponseSchema,
|
||||
'update-subtask-by-id': UpdateSubtaskResponseSchema,
|
||||
'update-task-by-id': UpdateTaskResponseSchema,
|
||||
'add-task': AddTaskResponseSchema,
|
||||
'parse-prd': ParsePRDResponseSchema
|
||||
};
|
||||
|
||||
// Export individual schemas for direct access
|
||||
@@ -24,4 +24,4 @@ export * from './update-subtask.js';
|
||||
export * from './update-task.js';
|
||||
export * from './add-task.js';
|
||||
export * from './parse-prd.js';
|
||||
export * from './base-schemas.js';
|
||||
export * from './base-schemas.js';
|
||||
|
||||
Reference in New Issue
Block a user