@tosin2013/mcp-shrimp-task-manager
Version:
Enhanced MCP Shrimp Task Manager with comprehensive LLM integration. A task management tool built for AI Agents, emphasizing chain-of-thought, reflection, and style consistency. Features real GPT-4 ↔ MCP tools communication, comprehensive testing pipeline
123 lines (122 loc) • 4.54 kB
TypeScript
/**
* Workflow State Manager for the Idea Honing Tool
*
* This component handles the persistence and management of workflow state,
* enabling continuity across sessions and tracking progress.
*/
import { WorkflowState, Question } from '../models/workflow-state.js';
import { CodebaseAnalysisResult } from '../models/analysis-result.js';
/**
* Session information
*/
interface SessionInfo {
/** Session identifier */
id: string;
/** User identifier */
userId: string;
/** Session start timestamp */
startTime: string;
/** Session end timestamp (if completed) */
endTime?: string;
/** Associated specification ID */
specId: string;
/** Session progress (0-100) */
progress: number;
/** Session metadata */
metadata: Record<string, any>;
}
/**
* Creates or updates a workflow state
*
* @param state - Workflow state to save
* @returns Promise that resolves with the saved workflow state
*/
export declare function saveWorkflowState(state: WorkflowState): Promise<WorkflowState>;
/**
* Loads a workflow state by specification ID
*
* @param specId - Specification identifier
* @returns Promise that resolves with the loaded workflow state, or null if not found
*/
export declare function loadWorkflowState(specId: string): Promise<WorkflowState | null>;
/**
* Creates a new workflow state
*
* @param specId - Specification identifier
* @param initialPhase - Initial workflow phase
* @param analysisResults - Optional analysis results
* @returns Promise that resolves with the created workflow state
*/
export declare function createWorkflowState(specId: string, initialPhase?: 'analysis' | 'drafting' | 'review' | 'planning', analysisResults?: CodebaseAnalysisResult): Promise<WorkflowState>;
/**
* Updates the current phase of a workflow state
*
* @param specId - Specification identifier
* @param phase - New workflow phase
* @returns Promise that resolves with the updated workflow state
*/
export declare function updateWorkflowPhase(specId: string, phase: 'analysis' | 'drafting' | 'review' | 'planning'): Promise<WorkflowState>;
/**
* Marks a section as completed in a workflow state
*
* @param specId - Specification identifier
* @param sectionId - Section identifier
* @returns Promise that resolves with the updated workflow state
*/
export declare function markSectionCompleted(specId: string, sectionId: string): Promise<WorkflowState>;
/**
* Adds a question to a workflow state
*
* @param specId - Specification identifier
* @param question - Question to add
* @returns Promise that resolves with the updated workflow state
*/
export declare function addQuestion(specId: string, question: Omit<Question, 'id' | 'answered'>): Promise<WorkflowState>;
/**
* Answers a question in a workflow state
*
* @param specId - Specification identifier
* @param questionId - Question identifier
* @param answer - Answer to the question
* @returns Promise that resolves with the updated workflow state
*/
export declare function answerQuestion(specId: string, questionId: string, answer: string): Promise<WorkflowState>;
/**
* Creates a new session for a specification
*
* @param specId - Specification identifier
* @param userId - User identifier
* @param metadata - Session metadata
* @returns Promise that resolves with the created session information
*/
export declare function createSession(specId: string, userId: string, metadata?: Record<string, any>): Promise<SessionInfo>;
/**
* Updates a session's progress
*
* @param sessionId - Session identifier
* @param progress - Session progress (0-100)
* @returns Promise that resolves with the updated session information
*/
export declare function updateSessionProgress(sessionId: string, progress: number): Promise<SessionInfo>;
/**
* Ends a session
*
* @param sessionId - Session identifier
* @returns Promise that resolves with the ended session information
*/
export declare function endSession(sessionId: string): Promise<SessionInfo>;
/**
* Gets sessions for a specification
*
* @param specId - Specification identifier
* @returns Promise that resolves with an array of session information
*/
export declare function getSessionsForSpecification(specId: string): Promise<SessionInfo[]>;
/**
* Calculates the overall progress for a specification
*
* @param specId - Specification identifier
* @returns Promise that resolves with the progress percentage (0-100)
*/
export declare function calculateOverallProgress(specId: string): Promise<number>;
export {};