local-agent
Version:
A CLI agentic system for orchestrating tools and memory with per-folder scoping
121 lines • 3.39 kB
TypeScript
/**
* @fileoverview
* Task State Manager for handling multi-step task logic.
* Replaces complex string matching with clear state transitions.
*/
import { TaskContext } from './task-state';
/**
* Manages task state transitions and provides task context.
*/
export declare class TaskManager {
private state;
private taskDescription;
private completedSteps;
private nextSteps;
private toolsUsed;
private stepCount;
private maxSteps;
private lastResponseWithoutTools;
private maxResponsesWithoutTools;
private lastToolUsed;
private consecutiveNonToolResponses;
private continuationPatterns;
private completionPatterns;
private stoppingPatterns;
private continuationTools;
/**
* Determines if a user prompt describes a multi-step task.
*/
isMultiStepTask(prompt: string): boolean;
/**
* Starts a new task with the given description.
*/
startTask(description: string): void;
/**
* Analyzes task description to identify potential steps.
*/
private analyzeTaskRequirements;
/**
* Transitions task to in-progress state.
*/
private transitionToInProgress;
/**
* Records that a tool was used in the current task.
*/
recordToolUse(toolName: string, result: any): void;
/**
* Processes a response from the assistant and updates task state.
*/
processResponse(response: string, toolUsed?: string): void;
/**
* Updates task progress based on the assistant's response.
*/
private updateTaskProgress;
/**
* Extracts accomplishments from the response text.
*/
private extractAccomplishment;
/**
* Extracts next steps from the response text.
*/
private extractNextSteps;
/**
* Determines if task should be marked complete (more conservative).
*/
private shouldMarkComplete;
/**
* Checks for explicit completion signals.
*/
private hasExplicitCompletionSignal;
/**
* Original completion check (now used for reference but not for auto-completion).
*/
private isTaskComplete;
/**
* Checks if this is a project creation task.
*/
private isProjectCreationTask;
/**
* Checks if response has continuation indicators.
*/
private hasContinuationIndicators;
/**
* Marks the task as completed.
*/
private completeTask;
/**
* Resets the task to idle state.
*/
resetTask(): void;
/**
* Gets task completion status with details.
*/
getCompletionStatus(): {
isComplete: boolean;
reason?: string;
stepCount: number;
};
/**
* Manually marks the task as complete.
*/
forceComplete(reason?: string): void;
/**
* Determines if the task should continue automatically.
*/
shouldContinueAutomatically(response: string, toolUsed?: string): boolean;
/**
* Checks if a task is currently active.
*/
isTaskActive(): boolean;
/**
* Gets the current task context.
*/
getTaskContext(): TaskContext;
/**
* Configuration methods for adding patterns and tools.
*/
addContinuationPattern(pattern: string): void;
addCompletionPattern(pattern: string): void;
addContinuationTool(tool: string): void;
}
//# sourceMappingURL=task-manager.d.ts.map