* MCP Server 2.0 - Updated application version from 2.23.14 to 2.24.0 in package.json. - MCP Server improved with new features - Migrated functionality from Dev Tools to MCP Server - Improved getMonitoringProvider not to crash application when misconfigured
79 lines
1.6 KiB
TypeScript
79 lines
1.6 KiB
TypeScript
import 'server-only';
|
|
|
|
import { relative } from 'node:path';
|
|
|
|
import { PRDManager } from '@kit/mcp-server/prd-manager';
|
|
|
|
export interface CustomPhase {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
color: string;
|
|
order: number;
|
|
userStoryIds: string[];
|
|
}
|
|
|
|
export interface PRDData {
|
|
introduction: {
|
|
title: string;
|
|
overview: string;
|
|
lastUpdated: string;
|
|
};
|
|
problemStatement: {
|
|
problem: string;
|
|
marketOpportunity: string;
|
|
targetUsers: string[];
|
|
};
|
|
solutionOverview: {
|
|
description: string;
|
|
keyFeatures: string[];
|
|
successMetrics: string[];
|
|
};
|
|
userStories: Array<{
|
|
id: string;
|
|
title: string;
|
|
userStory: string;
|
|
businessValue: string;
|
|
acceptanceCriteria: string[];
|
|
priority: 'P0' | 'P1' | 'P2' | 'P3';
|
|
status:
|
|
| 'not_started'
|
|
| 'research'
|
|
| 'in_progress'
|
|
| 'review'
|
|
| 'completed'
|
|
| 'blocked';
|
|
notes?: string;
|
|
estimatedComplexity?: string;
|
|
dependencies?: string[];
|
|
completedAt?: string;
|
|
}>;
|
|
customPhases?: CustomPhase[];
|
|
metadata: {
|
|
version: string;
|
|
created: string;
|
|
lastUpdated: string;
|
|
approver: string;
|
|
};
|
|
progress: {
|
|
overall: number;
|
|
completed: number;
|
|
total: number;
|
|
blocked: number;
|
|
};
|
|
}
|
|
|
|
export async function loadPRDPageData(filename: string): Promise<PRDData> {
|
|
try {
|
|
PRDManager.setRootPath(relative(process.cwd(), '../..'));
|
|
|
|
const content = await PRDManager.getPRDContent(filename);
|
|
|
|
return JSON.parse(content) as PRDData;
|
|
} catch (error) {
|
|
console.error(`Failed to load PRD ${filename}:`, error);
|
|
|
|
throw new Error(`PRD not found: ${filename}`);
|
|
}
|
|
}
|