UNPKG

@z-test/memory-bank-mcp

Version:
142 lines (141 loc) 4.49 kB
/** * Interface for progress tracking details */ export interface ProgressDetails { /** Description of the progress or action */ description: string; /** Optional filename related to the action */ filename?: string; /** Optional path related to the action */ path?: string; /** Optional status of the action (success, error, warning) */ status?: 'success' | 'error' | 'warning'; /** Optional timestamp of the action */ timestamp?: Date; /** Optional additional metadata as key-value pairs */ metadata?: Record<string, string | number | boolean>; /** Optional GitHub profile URL of who performed the action */ userId?: string; /** * Any additional properties * @deprecated Use metadata for additional properties instead */ [key: string]: unknown; } /** * Interface for decision logging */ export interface Decision { /** Title of the decision */ title: string; /** Context or background information for the decision */ context: string; /** The actual decision that was made */ decision: string; /** Alternatives that were considered (string or array of strings) */ alternatives?: string[] | string; /** Consequences of the decision (string or array of strings) */ consequences?: string[] | string; /** Optional date when the decision was made (defaults to current date) */ date?: Date; /** Optional tags to categorize the decision */ tags?: string[]; /** Optional GitHub profile URL of who made the decision */ userId?: string; } /** * Interface for active context updates */ export interface ActiveContext { /** List of ongoing tasks */ tasks?: string[]; /** List of known issues */ issues?: string[]; /** List of next steps */ nextSteps?: string[]; /** Optional project state description */ projectState?: string; /** Optional session notes */ sessionNotes?: string[]; } /** * Class for tracking progress and logging decisions * * This class handles all operations related to tracking progress, logging decisions, * and updating the active context in the Memory Bank. */ export declare class ProgressTracker { private memoryBankDir; private userId; /** * Creates a new ProgressTracker instance * * @param memoryBankDir - Directory of the Memory Bank * @param userId - GitHub profile URL for tracking changes */ constructor(memoryBankDir: string, userId?: string); /** * Formats the GitHub profile URL for display in markdown * * If the userId is a GitHub URL, it will be formatted as [@username](url) * * @param userId - The GitHub profile URL * @returns Formatted GitHub profile URL string * @private */ private formatUserId; /** * Tracks progress by adding an entry to the progress file * * Note: All progress entries are stored in English regardless of the system locale or user settings. * * @param action - Action performed (e.g., 'Implemented feature', 'Fixed bug') * @param details - Details of the progress * @returns The updated progress content */ trackProgress(action: string, details: ProgressDetails): Promise<string>; /** * Updates the progress file * * @param action - Action performed * @param details - Details of the action * @private */ private updateProgressFile; /** * Updates the active context file * * @param action - Action performed * @param details - Details of the action * @private */ private updateActiveContextFile; /** * Updates the active context * * Note: All content is stored in English regardless of the system locale or user settings. * * @param context - Context to update * @throws Error if update fails */ updateActiveContext(context: { tasks?: string[]; issues?: string[]; nextSteps?: string[]; }): Promise<void>; /** * Clears the current session notes * * @throws Error if clearing fails */ clearSessionNotes(): Promise<void>; /** * Logs a decision in the decision log * * Note: All decision entries are stored in English regardless of the system locale or user settings. * * @param decision - Decision to log * @throws Error if logging fails */ logDecision(decision: Decision): Promise<void>; }