UNPKG

mcp-ai-agent-guidelines

Version:

A comprehensive Model Context Protocol server providing professional tools, resources, and prompts for implementing AI agent best practices

413 lines 13.4 kB
import { z } from "zod"; import type { ConstraintRule, DesignSessionConfig, DesignSessionState } from "./types/index.js"; declare const ConstraintConfigSchema: z.ZodObject<{ meta: z.ZodObject<{ version: z.ZodString; updated: z.ZodString; source: z.ZodString; coverage_threshold: z.ZodNumber; }, "strip", z.ZodTypeAny, { source: string; version: string; updated: string; coverage_threshold: number; }, { source: string; version: string; updated: string; coverage_threshold: number; }>; phases: z.ZodRecord<z.ZodString, z.ZodObject<{ name: z.ZodString; description: z.ZodString; min_coverage: z.ZodNumber; required_outputs: z.ZodArray<z.ZodString, "many">; criteria: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { description: string; name: string; min_coverage: number; required_outputs: string[]; criteria: string[]; }, { description: string; name: string; min_coverage: number; required_outputs: string[]; criteria: string[]; }>>; constraints: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{ name: z.ZodString; description: z.ZodString; keywords: z.ZodArray<z.ZodString, "many">; weight: z.ZodNumber; mandatory: z.ZodBoolean; validation: z.ZodObject<{ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; minCoverage: z.ZodOptional<z.ZodNumber>; customValidator: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { schema?: Record<string, unknown> | undefined; keywords?: string[] | undefined; minCoverage?: number | undefined; customValidator?: string | undefined; }, { schema?: Record<string, unknown> | undefined; keywords?: string[] | undefined; minCoverage?: number | undefined; customValidator?: string | undefined; }>; source: z.ZodString; }, "strip", z.ZodTypeAny, { validation: { schema?: Record<string, unknown> | undefined; keywords?: string[] | undefined; minCoverage?: number | undefined; customValidator?: string | undefined; }; description: string; name: string; weight: number; keywords: string[]; mandatory: boolean; source: string; }, { validation: { schema?: Record<string, unknown> | undefined; keywords?: string[] | undefined; minCoverage?: number | undefined; customValidator?: string | undefined; }; description: string; name: string; weight: number; keywords: string[]; mandatory: boolean; source: string; }>>>; coverage_rules: z.ZodObject<{ overall_minimum: z.ZodNumber; phase_minimum: z.ZodNumber; constraint_minimum: z.ZodNumber; documentation_minimum: z.ZodNumber; test_minimum: z.ZodNumber; pivot_thresholds: z.ZodObject<{ complexity_threshold: z.ZodNumber; entropy_threshold: z.ZodNumber; coverage_drop_threshold: z.ZodNumber; }, "strip", z.ZodTypeAny, { complexity_threshold: number; entropy_threshold: number; coverage_drop_threshold: number; }, { complexity_threshold: number; entropy_threshold: number; coverage_drop_threshold: number; }>; }, "strip", z.ZodTypeAny, { overall_minimum: number; phase_minimum: number; constraint_minimum: number; documentation_minimum: number; test_minimum: number; pivot_thresholds: { complexity_threshold: number; entropy_threshold: number; coverage_drop_threshold: number; }; }, { overall_minimum: number; phase_minimum: number; constraint_minimum: number; documentation_minimum: number; test_minimum: number; pivot_thresholds: { complexity_threshold: number; entropy_threshold: number; coverage_drop_threshold: number; }; }>; template_references: z.ZodRecord<z.ZodString, z.ZodString>; micro_methods: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>; output_formats: z.ZodRecord<z.ZodString, z.ZodObject<{ format: z.ZodString; template: z.ZodOptional<z.ZodString>; sections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { format: string; template?: string | undefined; sections?: string[] | undefined; types?: string[] | undefined; }, { format: string; template?: string | undefined; sections?: string[] | undefined; types?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { constraints: Record<string, Record<string, { validation: { schema?: Record<string, unknown> | undefined; keywords?: string[] | undefined; minCoverage?: number | undefined; customValidator?: string | undefined; }; description: string; name: string; weight: number; keywords: string[]; mandatory: boolean; source: string; }>>; meta: { source: string; version: string; updated: string; coverage_threshold: number; }; phases: Record<string, { description: string; name: string; min_coverage: number; required_outputs: string[]; criteria: string[]; }>; coverage_rules: { overall_minimum: number; phase_minimum: number; constraint_minimum: number; documentation_minimum: number; test_minimum: number; pivot_thresholds: { complexity_threshold: number; entropy_threshold: number; coverage_drop_threshold: number; }; }; template_references: Record<string, string>; micro_methods: Record<string, string[]>; output_formats: Record<string, { format: string; template?: string | undefined; sections?: string[] | undefined; types?: string[] | undefined; }>; }, { constraints: Record<string, Record<string, { validation: { schema?: Record<string, unknown> | undefined; keywords?: string[] | undefined; minCoverage?: number | undefined; customValidator?: string | undefined; }; description: string; name: string; weight: number; keywords: string[]; mandatory: boolean; source: string; }>>; meta: { source: string; version: string; updated: string; coverage_threshold: number; }; phases: Record<string, { description: string; name: string; min_coverage: number; required_outputs: string[]; criteria: string[]; }>; coverage_rules: { overall_minimum: number; phase_minimum: number; constraint_minimum: number; documentation_minimum: number; test_minimum: number; pivot_thresholds: { complexity_threshold: number; entropy_threshold: number; coverage_drop_threshold: number; }; }; template_references: Record<string, string>; micro_methods: Record<string, string[]>; output_formats: Record<string, { format: string; template?: string | undefined; sections?: string[] | undefined; types?: string[] | undefined; }>; }>; export type ConstraintConfig = z.infer<typeof ConstraintConfigSchema>; export interface ConstraintValidationResult { passed: boolean; coverage: number; violations: ConstraintViolation[]; warnings?: number; recommendations: string[]; } export interface ConstraintViolation { constraintId: string; severity: "error" | "warning" | "info"; message: string; suggestion: string; } declare class ConstraintManagerImpl { private config; private loadedConstraints; initialize(): Promise<void>; loadConstraintsFromConfig(configData: unknown): Promise<void>; getConstraints(category?: string): ConstraintRule[]; getConstraint(id: string): ConstraintRule | undefined; getMandatoryConstraints(): ConstraintRule[]; getPhaseRequirements(phaseId: string): { description: string; name: string; min_coverage: number; required_outputs: string[]; criteria: string[]; } | null; getCoverageThresholds(): { overall_minimum: number; phase_minimum: number; constraint_minimum: number; documentation_minimum: number; test_minimum: number; pivot_thresholds: { complexity_threshold: number; entropy_threshold: number; coverage_drop_threshold: number; }; }; getMicroMethods(category: string): string[]; getTemplateReferences(): Record<string, string>; getOutputFormatSpec(type: string): { format: string; template?: string | undefined; sections?: string[] | undefined; types?: string[] | undefined; } | null; validateConstraints(contentOrSessionState: string | DesignSessionState | ConstraintRule[], selectedConstraints?: string[]): ConstraintValidationResult; private calculateConstraintCoverage; generateCoverageReport(sessionConfig: DesignSessionConfig, content: string): { overall: number; phases: Record<string, number>; constraints: Record<string, number>; details: ConstraintValidationResult; }; private calculatePhaseCoverage; private calculateBasicContentCoverage; validateConstraint(constraintOrSessionState: ConstraintRule | DesignSessionState, contentOrSessionState?: string | DesignSessionState): Promise<{ constraint: ConstraintRule; satisfied: boolean; score: number; }>; addConstraint(sessionState: DesignSessionState, constraint: ConstraintRule): Promise<{ config: { constraints: ConstraintRule[]; }; }>; removeConstraint(sessionState: DesignSessionState, constraintId: string): Promise<{ config: { constraints: ConstraintRule[]; }; }>; updateConstraint(sessionState: DesignSessionState, constraintId: string, updates: Partial<ConstraintRule>): Promise<{ config: { constraints: ConstraintRule[]; }; }>; getComplianceReport(sessionState: DesignSessionState): Promise<{ overall: boolean; byCategory: Record<string, { passed: boolean; coverage: number; }>; violations: string[]; recommendations: string[]; }>; } export declare const constraintManager: ConstraintManagerImpl; export declare const DEFAULT_CONSTRAINT_CONFIG: { meta: { version: string; updated: string; source: string; coverage_threshold: number; }; phases: { discovery: { name: string; description: string; min_coverage: number; required_outputs: string[]; criteria: string[]; }; requirements: { name: string; description: string; min_coverage: number; required_outputs: string[]; criteria: string[]; }; architecture: { name: string; description: string; min_coverage: number; required_outputs: string[]; criteria: string[]; }; }; constraints: { technical: { documentation: { name: string; description: string; keywords: string[]; weight: number; mandatory: boolean; validation: { min_coverage: number; keywords: string[]; }; source: string; }; }; }; coverage_rules: { overall_minimum: number; phase_minimum: number; constraint_minimum: number; documentation_minimum: number; test_minimum: number; pivot_thresholds: { complexity_threshold: number; entropy_threshold: number; coverage_drop_threshold: number; }; }; template_references: {}; micro_methods: { confirmation: string[]; pivot: string[]; coverage: string[]; }; output_formats: { markdown: { format: string; sections: string[]; }; mermaid: { format: string; types: string[]; }; }; }; export declare const IMPLEMENTATION_STATUS: "IMPLEMENTED"; export {}; //# sourceMappingURL=constraint-manager.d.ts.map