UNPKG

@ever_cheng/memory-task-mcp

Version:

Memory and task management MCP Server

111 lines (110 loc) 3.09 kB
import { Goal, CreateGoalArgs, UpdateGoalArgs, GetGoalArgs, ListGoalsArgs, DeleteGoalArgs } from './types'; import { CacheService } from './cache'; /** * Goal Manager Class * * Manages Goal operations with local file storage and caching. */ export declare class GoalManager { private storagePath; private cache; private taskManager?; private memoryManager?; /** * Constructor * @param storagePath Storage path for goals * @param cacheService Unified cache service instance */ constructor(storagePath: string, cacheService: CacheService<string, Goal>); /** * Set manager references for event logging * @param taskManager TaskManager instance * @param memoryManager MemoryManager instance */ setManagerReferences(taskManager: any, memoryManager: any): void; /** * Initialize goal storage */ initialize(): Promise<void>; /** * Get next sequential goal ID */ private getNextGoalId; /** * Create a new goal * @param args Create goal parameters */ createGoal(args: CreateGoalArgs): Promise<Goal>; /** * Get a goal by ID * @param args Get goal parameters */ getGoal(args: GetGoalArgs): Promise<Goal | null>; /** * Update an existing goal * @param args Update goal parameters */ updateGoal(args: UpdateGoalArgs): Promise<Goal | null>; /** * Update goal's linked tasks by adding a new task ID * @param goalId Goal ID to update * @param taskId Task ID to add to linked_tasks */ updateGoalLinkedTasks(goalId: string, taskId: string): Promise<void>; /** * List goals with optional filtering * @param args List goals parameters */ listGoals(args?: ListGoalsArgs): Promise<Goal[]>; /** * Delete a goal * @param args Delete goal parameters */ deleteGoal(args: DeleteGoalArgs): Promise<boolean>; /** * Get goals by linked task * @param taskId Task ID */ getGoalsByLinkedTask(taskId: string): Promise<Goal[]>; /** * Update goal's linked memories (convenience method) * @param goalId Goal ID * @param memoryId Memory ID to link */ updateGoalLinkedMemories(goalId: string, memoryId: string): Promise<void>; /** * Add progress note to goal * @param goalId Goal ID * @param note Progress note to add */ addGoalProgressNote(goalId: string, note: string): Promise<void>; /** * Get goals by linked memory * @param memoryId Memory ID */ getGoalsByLinkedMemory(memoryId: string): Promise<Goal[]>; /** * Get cache statistics */ getCacheStats(): import("./types").CacheStats; /** * Save goal to storage * @param id Goal ID * @param goal Goal object */ private save; /** * Load goal from storage * @param id Goal ID */ private load; /** * Delete goal from storage * @param id Goal ID */ private delete; /** * List all goals from storage */ private list; }