UNPKG

@pimzino/agentic-tools-mcp

Version:

A comprehensive MCP server for task management and agent memories with JSON file storage

75 lines (74 loc) 3.01 kB
import { Storage } from './storage.js'; import { Project } from '../models/project.js'; import { Task, TaskHierarchy } from '../models/task.js'; import { Subtask } from '../models/subtask.js'; /** * File-based storage implementation using JSON with project-specific directories * Version 2.0: Updated for unified task model with migration support */ export declare class FileStorage implements Storage { private workingDirectory; private storageDir; private dataFile; private data; constructor(workingDirectory: string); /** * Initialize storage by validating working directory and loading data from file */ initialize(): Promise<void>; /** * Save data to file */ private save; /** * Calculate task level in hierarchy */ private calculateTaskLevel; /** * Update task levels for all tasks */ private updateTaskLevels; getProjects(): Promise<Project[]>; getProject(id: string): Promise<Project | null>; createProject(project: Project): Promise<Project>; updateProject(id: string, updates: Partial<Project>): Promise<Project | null>; deleteProject(id: string): Promise<boolean>; getTasks(projectId?: string, parentId?: string): Promise<Task[]>; getTask(id: string): Promise<Task | null>; createTask(task: Task): Promise<Task>; updateTask(id: string, updates: Partial<Task>): Promise<Task | null>; deleteTask(id: string): Promise<boolean>; deleteTasksByProject(projectId: string): Promise<number>; deleteTasksByParent(parentId: string): Promise<number>; getTaskHierarchy(projectId?: string, parentId?: string): Promise<TaskHierarchy[]>; getTaskChildren(taskId: string): Promise<Task[]>; getTaskAncestors(taskId: string): Promise<Task[]>; moveTask(taskId: string, newParentId?: string): Promise<Task | null>; /** * Check if moving a task would create a circular reference */ private wouldCreateCircularReference; migrateToUnifiedModel(): Promise<{ migratedSubtasks: number; errors: string[]; }>; getMigrationStatus(): Promise<{ needsMigration: boolean; subtaskCount: number; version: string; }>; /** @deprecated Use getTasks with parentId instead */ getSubtasks(taskId?: string, projectId?: string): Promise<Subtask[]>; /** @deprecated Use getTask instead */ getSubtask(id: string): Promise<Subtask | null>; /** @deprecated Use createTask instead */ createSubtask(subtask: Subtask): Promise<Subtask>; /** @deprecated Use updateTask instead */ updateSubtask(id: string, updates: Partial<Subtask>): Promise<Subtask | null>; /** @deprecated Use deleteTask instead */ deleteSubtask(id: string): Promise<boolean>; /** @deprecated Use deleteTasksByParent instead */ deleteSubtasksByTask(taskId: string): Promise<number>; /** @deprecated Use deleteTasksByProject instead */ deleteSubtasksByProject(projectId: string): Promise<number>; }