aipm-mcp
Version:
Complete AIPM integration for Cursor IDE - Get tasks, manage features, track time, and build features with AI. Supports both MCP stdio mode and HTTP server mode.
157 lines • 5.67 kB
JavaScript
import { z } from 'zod';
// AIPM API Response Types
export const TicketSchema = z.object({
id: z.string(),
key: z.string(),
title: z.string(),
description: z.string().nullable(),
aiPrompt: z.string().nullable(),
generatedCode: z.string().nullable(),
implementationDetails: z.string().nullable(), // Add implementation details field
status: z.enum(['TODO', 'IN_PROGRESS', 'REVIEW', 'COMPLETED', 'CANCELLED', 'BLOCKED']), // Fix status values
priority: z.enum(['LOW', 'MEDIUM', 'HIGH', 'URGENT']),
type: z.enum(['TASK', 'BUG', 'FEATURE_REQUEST', 'IMPROVEMENT']), // Fix type values
estimatedHours: z.number().nullable(),
actualHours: z.number().nullable(),
startedAt: z.string().nullable(),
completedAt: z.string().nullable(),
createdAt: z.string(),
updatedAt: z.string(),
assignedTo: z.object({
id: z.string(),
name: z.string(),
email: z.string()
}).nullable(),
feature: z.object({
id: z.string(),
name: z.string(),
description: z.string().nullable().optional()
}).nullable(),
product: z.object({
id: z.string(),
name: z.string(),
key: z.string().optional()
}),
timeLogs: z.array(z.object({
id: z.string(),
hours: z.number(),
date: z.string(),
description: z.string().nullable(),
isActive: z.boolean()
})).optional()
});
export const FeatureSchema = z.object({
id: z.string(),
key: z.string(),
name: z.string(),
description: z.string().nullable(),
acceptanceCriteria: z.string().nullable(),
status: z.enum(['PLANNED', 'IN_PROGRESS', 'REVIEW', 'COMPLETED', 'CANCELLED']),
priority: z.enum(['LOW', 'MEDIUM', 'HIGH', 'URGENT']),
estimatedHours: z.number().nullable(),
actualHours: z.number().nullable(),
progress: z.number(),
product: z.object({
id: z.string(),
name: z.string(),
key: z.string().optional()
}),
tickets: z.array(TicketSchema).optional()
});
export const ProductSchema = z.object({
id: z.string(),
key: z.string(),
name: z.string(),
description: z.string().nullable(),
status: z.enum(['PLANNING', 'IN_DEVELOPMENT', 'TESTING', 'LAUNCHED', 'MAINTENANCE', 'ARCHIVED']),
progress: z.number(),
targetDate: z.string().nullable()
});
export const UserSchema = z.object({
id: z.string(),
name: z.string(),
email: z.string(),
role: z.enum(['ADMIN', 'MEMBER']),
organizationId: z.string(),
avatar: z.string().nullable()
});
export const TimeLogSchema = z.object({
id: z.string(),
description: z.string().nullable(),
hours: z.number(),
date: z.string(),
startedAt: z.string().nullable(),
endedAt: z.string().nullable(),
isActive: z.boolean(),
ticket: z.object({
id: z.string(),
title: z.string(),
key: z.string().optional()
}).nullable(),
feature: z.object({
id: z.string(),
name: z.string(),
key: z.string().optional()
}).nullable()
});
// MCP Tool Arguments
export const GetTasksArgsSchema = z.object({
status: z.enum(['TODO', 'IN_PROGRESS', 'REVIEW', 'COMPLETED', 'CANCELLED', 'BLOCKED']).optional(), // Fix status values
priority: z.enum(['LOW', 'MEDIUM', 'HIGH', 'URGENT']).optional(),
productId: z.string().optional(),
featureId: z.string().optional(),
limit: z.number().min(1).max(100).default(20)
});
export const StartTaskArgsSchema = z.object({
taskId: z.string(),
notes: z.string().optional()
});
export const CompleteTaskArgsSchema = z.object({
taskId: z.string(),
completionNotes: z.string().optional(),
timeSpent: z.number().positive().optional(),
codeChanges: z.string().optional(),
implementationDetails: z.string().optional(), // Add implementation details
testResults: z.string().optional() // Add test results
});
export const CreateTaskArgsSchema = z.object({
title: z.string().min(1),
description: z.string().optional(),
featureId: z.string().optional(),
productId: z.string(),
priority: z.enum(['LOW', 'MEDIUM', 'HIGH', 'URGENT']).default('MEDIUM'),
type: z.enum(['TASK', 'BUG', 'FEATURE_REQUEST', 'IMPROVEMENT']).default('TASK'), // Fix type values
status: z.enum(['TODO', 'IN_PROGRESS', 'REVIEW', 'COMPLETED', 'CANCELLED']).default('TODO'),
estimatedHours: z.number().positive().optional(),
assignedToId: z.string().optional()
});
export const GetFeaturesArgsSchema = z.object({
productId: z.string().optional(),
status: z.enum(['PLANNED', 'IN_PROGRESS', 'REVIEW', 'COMPLETED', 'CANCELLED']).optional(),
includeTickets: z.boolean().default(false)
});
export const BreakdownFeatureArgsSchema = z.object({
featureId: z.string(),
additionalContext: z.string().optional()
});
export const LogTimeArgsSchema = z.object({
taskId: z.string().optional(),
featureId: z.string().optional(),
hours: z.number().positive(),
description: z.string().optional(),
date: z.string().optional() // ISO date string
});
// Add new schema for updating task implementation details
export const UpdateTaskImplementationArgsSchema = z.object({
taskId: z.string(),
implementationDetails: z.string(),
testResults: z.string().optional(),
codeChanges: z.string().optional()
});
// Add new schema for development guidance
export const GetDevelopmentGuidanceArgsSchema = z.object({
context: z.enum(['task_implementation', 'testing', 'code_review', 'debugging', 'general']).optional(),
taskId: z.string().optional(),
additionalContext: z.string().optional()
});
//# sourceMappingURL=types.js.map