mcp-adr-analysis-server
Version:
MCP server for analyzing Architectural Decision Records and project architecture
124 lines • 3.79 kB
TypeScript
/**
* Resource Versioning and Metadata Tracking
*
* Provides version control for MCP resources, enabling:
* - Semantic versioning (MAJOR.MINOR.PATCH)
* - Backward compatibility checking
* - Version migration support
* - Metadata tracking (creation, updates, changelog)
*/
import { URLSearchParams } from 'url';
/**
* Semantic version structure
*/
export interface SemanticVersion {
major: number;
minor: number;
patch: number;
}
/**
* Resource metadata for tracking changes
*/
export interface ResourceMetadata {
version: string;
createdAt: string;
updatedAt: string;
schemaVersion: string;
changelog?: ChangelogEntry[];
deprecationNotice?: DeprecationNotice;
}
/**
* Changelog entry for tracking changes
*/
export interface ChangelogEntry {
version: string;
date: string;
changes: string[];
breakingChanges?: string[];
author?: string;
}
/**
* Deprecation notice for resources
*/
export interface DeprecationNotice {
deprecatedIn: string;
removedIn?: string;
reason: string;
migration: string;
}
/**
* Version comparison result
*/
export declare enum VersionComparisonResult {
MAJOR_BREAKING = "major_breaking",
MINOR_COMPATIBLE = "minor_compatible",
PATCH_COMPATIBLE = "patch_compatible",
EQUAL = "equal",
OLDER = "older"
}
/**
* Parse semantic version string to object
*/
export declare function parseVersion(versionString: string): SemanticVersion;
/**
* Convert semantic version object to string
*/
export declare function versionToString(version: SemanticVersion): string;
/**
* Compare two semantic versions
* @returns VersionComparisonResult indicating relationship
*/
export declare function compareVersions(current: string, requested: string): VersionComparisonResult;
/**
* Check if two versions are compatible (same major version)
*/
export declare function isCompatible(version1: string, version2: string): boolean;
/**
* Increment version based on change type
*/
export declare function incrementVersion(current: string, changeType: 'major' | 'minor' | 'patch'): string;
/**
* Create initial resource metadata
*/
export declare function createResourceMetadata(version?: string): ResourceMetadata;
/**
* Update resource metadata with new version
*/
export declare function updateResourceMetadata(current: ResourceMetadata, newVersion: string, changes: string[], breakingChanges?: string[]): ResourceMetadata;
/**
* Mark resource as deprecated
*/
export declare function deprecateResource(metadata: ResourceMetadata, reason: string, migration: string, removedIn?: string): ResourceMetadata;
/**
* Check if resource is deprecated
*/
export declare function isDeprecated(metadata: ResourceMetadata): boolean;
/**
* Extract version from URI search parameters
*/
export declare function extractVersionFromParams(searchParams?: URLSearchParams): string | null;
/**
* Validate requested version against available versions
*/
export declare function validateVersionRequest(requested: string | null, current: string, supportedVersions: string[]): {
valid: boolean;
version: string;
warning?: string;
};
/**
* Generate version compatibility matrix
*/
export declare function generateCompatibilityMatrix(versions: string[]): Map<string, string[]>;
/**
* Get changelog for specific version range
*/
export declare function getChangelogForRange(metadata: ResourceMetadata, fromVersion: string, toVersion: string): ChangelogEntry[];
/**
* Extract breaking changes from changelog
*/
export declare function getBreakingChanges(metadata: ResourceMetadata): ChangelogEntry[];
/**
* Format metadata for display
*/
export declare function formatMetadata(metadata: ResourceMetadata): string;
//# sourceMappingURL=resource-versioning.d.ts.map