UNPKG

mcp-adr-analysis-server

Version:

MCP server for analyzing Architectural Decision Records and project architecture

663 lines 25.4 kB
import { z } from 'zod'; /** * JSON-First TODO System Schemas * * This replaces inconsistent markdown parsing with structured JSON storage * that integrates seamlessly with the knowledge graph and scoring system. */ export declare const TodoTaskSchema: z.ZodObject<{ id: z.ZodString; title: z.ZodString; description: z.ZodOptional<z.ZodString>; status: z.ZodEnum<["pending", "in_progress", "completed", "blocked", "cancelled"]>; priority: z.ZodEnum<["low", "medium", "high", "critical"]>; category: z.ZodOptional<z.ZodString>; assignee: z.ZodOptional<z.ZodString>; createdAt: z.ZodString; updatedAt: z.ZodString; completedAt: z.ZodOptional<z.ZodString>; dueDate: z.ZodOptional<z.ZodString>; parentTaskId: z.ZodOptional<z.ZodString>; subtasks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; blockedBy: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; linkedAdrs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; adrGeneratedTask: z.ZodDefault<z.ZodBoolean>; intentId: z.ZodOptional<z.ZodString>; toolExecutions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; scoreWeight: z.ZodDefault<z.ZodNumber>; scoreCategory: z.ZodDefault<z.ZodEnum<["task_completion", "deployment_readiness", "architecture_compliance", "security_posture", "code_quality"]>>; estimatedHours: z.ZodOptional<z.ZodNumber>; actualHours: z.ZodOptional<z.ZodNumber>; progressPercentage: z.ZodDefault<z.ZodNumber>; tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; notes: z.ZodOptional<z.ZodString>; lastModifiedBy: z.ZodDefault<z.ZodEnum<["human", "tool", "adr_generator", "knowledge_graph"]>>; autoComplete: z.ZodDefault<z.ZodBoolean>; completionCriteria: z.ZodOptional<z.ZodString>; version: z.ZodDefault<z.ZodNumber>; changeLog: z.ZodDefault<z.ZodArray<z.ZodObject<{ timestamp: z.ZodString; action: z.ZodEnum<["created", "updated", "completed", "blocked", "cancelled", "moved"]>; details: z.ZodString; modifiedBy: z.ZodString; }, "strip", z.ZodTypeAny, { timestamp: string; action: "completed" | "blocked" | "created" | "cancelled" | "updated" | "moved"; details: string; modifiedBy: string; }, { timestamp: string; action: "completed" | "blocked" | "created" | "cancelled" | "updated" | "moved"; details: string; modifiedBy: string; }>, "many">>; }, "strip", z.ZodTypeAny, { status: "pending" | "completed" | "in_progress" | "blocked" | "cancelled"; title: string; tags: string[]; version: number; id: string; priority: "medium" | "low" | "high" | "critical"; dependencies: string[]; lastModifiedBy: "tool" | "human" | "adr_generator" | "knowledge_graph"; createdAt: string; updatedAt: string; subtasks: string[]; blockedBy: string[]; linkedAdrs: string[]; adrGeneratedTask: boolean; toolExecutions: string[]; scoreWeight: number; scoreCategory: "task_completion" | "deployment_readiness" | "architecture_compliance" | "security_posture" | "code_quality"; progressPercentage: number; autoComplete: boolean; changeLog: { timestamp: string; action: "completed" | "blocked" | "created" | "cancelled" | "updated" | "moved"; details: string; modifiedBy: string; }[]; category?: string | undefined; description?: string | undefined; assignee?: string | undefined; dueDate?: string | undefined; intentId?: string | undefined; completedAt?: string | undefined; parentTaskId?: string | undefined; estimatedHours?: number | undefined; actualHours?: number | undefined; notes?: string | undefined; completionCriteria?: string | undefined; }, { status: "pending" | "completed" | "in_progress" | "blocked" | "cancelled"; title: string; id: string; priority: "medium" | "low" | "high" | "critical"; createdAt: string; updatedAt: string; category?: string | undefined; tags?: string[] | undefined; version?: number | undefined; description?: string | undefined; assignee?: string | undefined; dueDate?: string | undefined; dependencies?: string[] | undefined; intentId?: string | undefined; lastModifiedBy?: "tool" | "human" | "adr_generator" | "knowledge_graph" | undefined; completedAt?: string | undefined; parentTaskId?: string | undefined; subtasks?: string[] | undefined; blockedBy?: string[] | undefined; linkedAdrs?: string[] | undefined; adrGeneratedTask?: boolean | undefined; toolExecutions?: string[] | undefined; scoreWeight?: number | undefined; scoreCategory?: "task_completion" | "deployment_readiness" | "architecture_compliance" | "security_posture" | "code_quality" | undefined; estimatedHours?: number | undefined; actualHours?: number | undefined; progressPercentage?: number | undefined; notes?: string | undefined; autoComplete?: boolean | undefined; completionCriteria?: string | undefined; changeLog?: { timestamp: string; action: "completed" | "blocked" | "created" | "cancelled" | "updated" | "moved"; details: string; modifiedBy: string; }[] | undefined; }>; export declare const TodoSectionSchema: z.ZodObject<{ id: z.ZodString; title: z.ZodString; description: z.ZodOptional<z.ZodString>; order: z.ZodNumber; collapsed: z.ZodDefault<z.ZodBoolean>; tasks: z.ZodArray<z.ZodString, "many">; metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; }, "strip", z.ZodTypeAny, { title: string; id: string; order: number; collapsed: boolean; tasks: string[]; metadata?: Record<string, any> | undefined; description?: string | undefined; }, { title: string; id: string; order: number; tasks: string[]; metadata?: Record<string, any> | undefined; description?: string | undefined; collapsed?: boolean | undefined; }>; export declare const TodoJsonDataSchema: z.ZodObject<{ version: z.ZodDefault<z.ZodString>; metadata: z.ZodObject<{ projectName: z.ZodOptional<z.ZodString>; lastUpdated: z.ZodString; totalTasks: z.ZodNumber; completedTasks: z.ZodNumber; lastSyncToMarkdown: z.ZodOptional<z.ZodString>; autoSyncEnabled: z.ZodDefault<z.ZodBoolean>; lastGitPush: z.ZodOptional<z.ZodString>; lastPushFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { lastUpdated: string; totalTasks: number; completedTasks: number; autoSyncEnabled: boolean; projectName?: string | undefined; lastSyncToMarkdown?: string | undefined; lastGitPush?: string | undefined; lastPushFiles?: string[] | undefined; }, { lastUpdated: string; totalTasks: number; completedTasks: number; projectName?: string | undefined; lastSyncToMarkdown?: string | undefined; autoSyncEnabled?: boolean | undefined; lastGitPush?: string | undefined; lastPushFiles?: string[] | undefined; }>; tasks: z.ZodRecord<z.ZodString, z.ZodObject<{ id: z.ZodString; title: z.ZodString; description: z.ZodOptional<z.ZodString>; status: z.ZodEnum<["pending", "in_progress", "completed", "blocked", "cancelled"]>; priority: z.ZodEnum<["low", "medium", "high", "critical"]>; category: z.ZodOptional<z.ZodString>; assignee: z.ZodOptional<z.ZodString>; createdAt: z.ZodString; updatedAt: z.ZodString; completedAt: z.ZodOptional<z.ZodString>; dueDate: z.ZodOptional<z.ZodString>; parentTaskId: z.ZodOptional<z.ZodString>; subtasks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; blockedBy: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; linkedAdrs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; adrGeneratedTask: z.ZodDefault<z.ZodBoolean>; intentId: z.ZodOptional<z.ZodString>; toolExecutions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; scoreWeight: z.ZodDefault<z.ZodNumber>; scoreCategory: z.ZodDefault<z.ZodEnum<["task_completion", "deployment_readiness", "architecture_compliance", "security_posture", "code_quality"]>>; estimatedHours: z.ZodOptional<z.ZodNumber>; actualHours: z.ZodOptional<z.ZodNumber>; progressPercentage: z.ZodDefault<z.ZodNumber>; tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; notes: z.ZodOptional<z.ZodString>; lastModifiedBy: z.ZodDefault<z.ZodEnum<["human", "tool", "adr_generator", "knowledge_graph"]>>; autoComplete: z.ZodDefault<z.ZodBoolean>; completionCriteria: z.ZodOptional<z.ZodString>; version: z.ZodDefault<z.ZodNumber>; changeLog: z.ZodDefault<z.ZodArray<z.ZodObject<{ timestamp: z.ZodString; action: z.ZodEnum<["created", "updated", "completed", "blocked", "cancelled", "moved"]>; details: z.ZodString; modifiedBy: z.ZodString; }, "strip", z.ZodTypeAny, { timestamp: string; action: "completed" | "blocked" | "created" | "cancelled" | "updated" | "moved"; details: string; modifiedBy: string; }, { timestamp: string; action: "completed" | "blocked" | "created" | "cancelled" | "updated" | "moved"; details: string; modifiedBy: string; }>, "many">>; }, "strip", z.ZodTypeAny, { status: "pending" | "completed" | "in_progress" | "blocked" | "cancelled"; title: string; tags: string[]; version: number; id: string; priority: "medium" | "low" | "high" | "critical"; dependencies: string[]; lastModifiedBy: "tool" | "human" | "adr_generator" | "knowledge_graph"; createdAt: string; updatedAt: string; subtasks: string[]; blockedBy: string[]; linkedAdrs: string[]; adrGeneratedTask: boolean; toolExecutions: string[]; scoreWeight: number; scoreCategory: "task_completion" | "deployment_readiness" | "architecture_compliance" | "security_posture" | "code_quality"; progressPercentage: number; autoComplete: boolean; changeLog: { timestamp: string; action: "completed" | "blocked" | "created" | "cancelled" | "updated" | "moved"; details: string; modifiedBy: string; }[]; category?: string | undefined; description?: string | undefined; assignee?: string | undefined; dueDate?: string | undefined; intentId?: string | undefined; completedAt?: string | undefined; parentTaskId?: string | undefined; estimatedHours?: number | undefined; actualHours?: number | undefined; notes?: string | undefined; completionCriteria?: string | undefined; }, { status: "pending" | "completed" | "in_progress" | "blocked" | "cancelled"; title: string; id: string; priority: "medium" | "low" | "high" | "critical"; createdAt: string; updatedAt: string; category?: string | undefined; tags?: string[] | undefined; version?: number | undefined; description?: string | undefined; assignee?: string | undefined; dueDate?: string | undefined; dependencies?: string[] | undefined; intentId?: string | undefined; lastModifiedBy?: "tool" | "human" | "adr_generator" | "knowledge_graph" | undefined; completedAt?: string | undefined; parentTaskId?: string | undefined; subtasks?: string[] | undefined; blockedBy?: string[] | undefined; linkedAdrs?: string[] | undefined; adrGeneratedTask?: boolean | undefined; toolExecutions?: string[] | undefined; scoreWeight?: number | undefined; scoreCategory?: "task_completion" | "deployment_readiness" | "architecture_compliance" | "security_posture" | "code_quality" | undefined; estimatedHours?: number | undefined; actualHours?: number | undefined; progressPercentage?: number | undefined; notes?: string | undefined; autoComplete?: boolean | undefined; completionCriteria?: string | undefined; changeLog?: { timestamp: string; action: "completed" | "blocked" | "created" | "cancelled" | "updated" | "moved"; details: string; modifiedBy: string; }[] | undefined; }>>; sections: z.ZodArray<z.ZodObject<{ id: z.ZodString; title: z.ZodString; description: z.ZodOptional<z.ZodString>; order: z.ZodNumber; collapsed: z.ZodDefault<z.ZodBoolean>; tasks: z.ZodArray<z.ZodString, "many">; metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; }, "strip", z.ZodTypeAny, { title: string; id: string; order: number; collapsed: boolean; tasks: string[]; metadata?: Record<string, any> | undefined; description?: string | undefined; }, { title: string; id: string; order: number; tasks: string[]; metadata?: Record<string, any> | undefined; description?: string | undefined; collapsed?: boolean | undefined; }>, "many">; scoringSync: z.ZodObject<{ lastScoreUpdate: z.ZodString; taskCompletionScore: z.ZodNumber; priorityWeightedScore: z.ZodNumber; criticalTasksRemaining: z.ZodNumber; scoreHistory: z.ZodDefault<z.ZodArray<z.ZodObject<{ timestamp: z.ZodString; score: z.ZodNumber; trigger: z.ZodString; }, "strip", z.ZodTypeAny, { timestamp: string; score: number; trigger: string; }, { timestamp: string; score: number; trigger: string; }>, "many">>; }, "strip", z.ZodTypeAny, { lastScoreUpdate: string; scoreHistory: { timestamp: string; score: number; trigger: string; }[]; taskCompletionScore: number; priorityWeightedScore: number; criticalTasksRemaining: number; }, { lastScoreUpdate: string; taskCompletionScore: number; priorityWeightedScore: number; criticalTasksRemaining: number; scoreHistory?: { timestamp: string; score: number; trigger: string; }[] | undefined; }>; knowledgeGraphSync: z.ZodObject<{ lastSync: z.ZodString; linkedIntents: z.ZodArray<z.ZodString, "many">; pendingUpdates: z.ZodDefault<z.ZodArray<z.ZodObject<{ taskId: z.ZodString; updateType: z.ZodEnum<["status", "progress", "completion"]>; timestamp: z.ZodString; }, "strip", z.ZodTypeAny, { timestamp: string; taskId: string; updateType: "status" | "progress" | "completion"; }, { timestamp: string; taskId: string; updateType: "status" | "progress" | "completion"; }>, "many">>; }, "strip", z.ZodTypeAny, { lastSync: string; linkedIntents: string[]; pendingUpdates: { timestamp: string; taskId: string; updateType: "status" | "progress" | "completion"; }[]; }, { lastSync: string; linkedIntents: string[]; pendingUpdates?: { timestamp: string; taskId: string; updateType: "status" | "progress" | "completion"; }[] | undefined; }>; automationRules: z.ZodDefault<z.ZodArray<z.ZodObject<{ id: z.ZodString; name: z.ZodString; trigger: z.ZodEnum<["task_completed", "all_dependencies_met", "score_threshold", "time_based"]>; conditions: z.ZodRecord<z.ZodString, z.ZodAny>; actions: z.ZodArray<z.ZodObject<{ type: z.ZodEnum<["complete_task", "create_task", "update_status", "notify", "update_score"]>; parameters: z.ZodRecord<z.ZodString, z.ZodAny>; }, "strip", z.ZodTypeAny, { type: "complete_task" | "create_task" | "update_status" | "notify" | "update_score"; parameters: Record<string, any>; }, { type: "complete_task" | "create_task" | "update_status" | "notify" | "update_score"; parameters: Record<string, any>; }>, "many">; }, "strip", z.ZodTypeAny, { id: string; name: string; trigger: "task_completed" | "all_dependencies_met" | "score_threshold" | "time_based"; conditions: Record<string, any>; actions: { type: "complete_task" | "create_task" | "update_status" | "notify" | "update_score"; parameters: Record<string, any>; }[]; }, { id: string; name: string; trigger: "task_completed" | "all_dependencies_met" | "score_threshold" | "time_based"; conditions: Record<string, any>; actions: { type: "complete_task" | "create_task" | "update_status" | "notify" | "update_score"; parameters: Record<string, any>; }[]; }>, "many">>; }, "strip", z.ZodTypeAny, { metadata: { lastUpdated: string; totalTasks: number; completedTasks: number; autoSyncEnabled: boolean; projectName?: string | undefined; lastSyncToMarkdown?: string | undefined; lastGitPush?: string | undefined; lastPushFiles?: string[] | undefined; }; version: string; tasks: Record<string, { status: "pending" | "completed" | "in_progress" | "blocked" | "cancelled"; title: string; tags: string[]; version: number; id: string; priority: "medium" | "low" | "high" | "critical"; dependencies: string[]; lastModifiedBy: "tool" | "human" | "adr_generator" | "knowledge_graph"; createdAt: string; updatedAt: string; subtasks: string[]; blockedBy: string[]; linkedAdrs: string[]; adrGeneratedTask: boolean; toolExecutions: string[]; scoreWeight: number; scoreCategory: "task_completion" | "deployment_readiness" | "architecture_compliance" | "security_posture" | "code_quality"; progressPercentage: number; autoComplete: boolean; changeLog: { timestamp: string; action: "completed" | "blocked" | "created" | "cancelled" | "updated" | "moved"; details: string; modifiedBy: string; }[]; category?: string | undefined; description?: string | undefined; assignee?: string | undefined; dueDate?: string | undefined; intentId?: string | undefined; completedAt?: string | undefined; parentTaskId?: string | undefined; estimatedHours?: number | undefined; actualHours?: number | undefined; notes?: string | undefined; completionCriteria?: string | undefined; }>; sections: { title: string; id: string; order: number; collapsed: boolean; tasks: string[]; metadata?: Record<string, any> | undefined; description?: string | undefined; }[]; scoringSync: { lastScoreUpdate: string; scoreHistory: { timestamp: string; score: number; trigger: string; }[]; taskCompletionScore: number; priorityWeightedScore: number; criticalTasksRemaining: number; }; knowledgeGraphSync: { lastSync: string; linkedIntents: string[]; pendingUpdates: { timestamp: string; taskId: string; updateType: "status" | "progress" | "completion"; }[]; }; automationRules: { id: string; name: string; trigger: "task_completed" | "all_dependencies_met" | "score_threshold" | "time_based"; conditions: Record<string, any>; actions: { type: "complete_task" | "create_task" | "update_status" | "notify" | "update_score"; parameters: Record<string, any>; }[]; }[]; }, { metadata: { lastUpdated: string; totalTasks: number; completedTasks: number; projectName?: string | undefined; lastSyncToMarkdown?: string | undefined; autoSyncEnabled?: boolean | undefined; lastGitPush?: string | undefined; lastPushFiles?: string[] | undefined; }; tasks: Record<string, { status: "pending" | "completed" | "in_progress" | "blocked" | "cancelled"; title: string; id: string; priority: "medium" | "low" | "high" | "critical"; createdAt: string; updatedAt: string; category?: string | undefined; tags?: string[] | undefined; version?: number | undefined; description?: string | undefined; assignee?: string | undefined; dueDate?: string | undefined; dependencies?: string[] | undefined; intentId?: string | undefined; lastModifiedBy?: "tool" | "human" | "adr_generator" | "knowledge_graph" | undefined; completedAt?: string | undefined; parentTaskId?: string | undefined; subtasks?: string[] | undefined; blockedBy?: string[] | undefined; linkedAdrs?: string[] | undefined; adrGeneratedTask?: boolean | undefined; toolExecutions?: string[] | undefined; scoreWeight?: number | undefined; scoreCategory?: "task_completion" | "deployment_readiness" | "architecture_compliance" | "security_posture" | "code_quality" | undefined; estimatedHours?: number | undefined; actualHours?: number | undefined; progressPercentage?: number | undefined; notes?: string | undefined; autoComplete?: boolean | undefined; completionCriteria?: string | undefined; changeLog?: { timestamp: string; action: "completed" | "blocked" | "created" | "cancelled" | "updated" | "moved"; details: string; modifiedBy: string; }[] | undefined; }>; sections: { title: string; id: string; order: number; tasks: string[]; metadata?: Record<string, any> | undefined; description?: string | undefined; collapsed?: boolean | undefined; }[]; scoringSync: { lastScoreUpdate: string; taskCompletionScore: number; priorityWeightedScore: number; criticalTasksRemaining: number; scoreHistory?: { timestamp: string; score: number; trigger: string; }[] | undefined; }; knowledgeGraphSync: { lastSync: string; linkedIntents: string[]; pendingUpdates?: { timestamp: string; taskId: string; updateType: "status" | "progress" | "completion"; }[] | undefined; }; version?: string | undefined; automationRules?: { id: string; name: string; trigger: "task_completed" | "all_dependencies_met" | "score_threshold" | "time_based"; conditions: Record<string, any>; actions: { type: "complete_task" | "create_task" | "update_status" | "notify" | "update_score"; parameters: Record<string, any>; }[]; }[] | undefined; }>; export type TodoTask = z.infer<typeof TodoTaskSchema>; export type TodoSection = z.infer<typeof TodoSectionSchema>; export type TodoJsonData = z.infer<typeof TodoJsonDataSchema>; export interface TaskUpdateOperation { taskId: string; updates: Partial<TodoTask>; reason: string; triggeredBy: 'human' | 'tool' | 'automation'; } export interface TaskMovementOperation { taskId: string; fromSectionId: string; toSectionId: string; newIndex?: number; reason: string; } export interface AutoCompletionRule { taskId: string; criteria: { allDependenciesCompleted?: boolean; scoreThreshold?: number; timeElapsed?: number; externalTrigger?: string; }; action: 'complete' | 'move_to_section' | 'update_priority'; } export interface TodoScoreMetrics { totalTasks: number; completedTasks: number; completionPercentage: number; priorityWeightedScore: number; criticalTasksRemaining: number; blockedTasksCount: number; averageTaskAge: number; velocityMetrics: { tasksCompletedLastWeek: number; averageCompletionTime: number; }; } export interface TodoKnowledgeGraphLink { taskId: string; intentId: string; linkType: 'generated_from' | 'contributes_to' | 'blocks' | 'depends_on'; confidence: number; lastUpdated: string; } //# sourceMappingURL=todo-json-schemas.d.ts.map