UNPKG

@z-test/memory-bank-mcp

Version:
88 lines (87 loc) 2.48 kB
import { EventEmitter } from 'events'; import { ClineruleBase } from '../types/rules.js'; import { MemoryBankConfig } from '../types/rules.js'; /** * Events emitted by ModeManager */ export declare enum ModeManagerEvent { MODE_CHANGED = "modeChanged", MODE_TRIGGER_DETECTED = "modeTriggerDetected", UMB_TRIGGERED = "umbTriggered", UMB_COMPLETED = "umbCompleted" } /** * Interface to represent the current mode state */ export interface ModeState { name: string; rules: ClineruleBase | null; isUmbActive: boolean; memoryBankStatus: 'ACTIVE' | 'INACTIVE'; } /** * Class responsible for managing modes based on loaded rules */ export declare class ModeManager extends EventEmitter { private rulesLoader; private currentMode; private isUmbActive; private memoryBankStatus; constructor(config: MemoryBankConfig | string); /** * Initializes the mode manager * @param initialMode Initial mode (optional) */ initialize(initialMode?: string): Promise<void>; /** * Gets the current mode state * @returns Current mode state */ getCurrentModeState(): ModeState; /** * Switches to a specific mode * @param mode Mode name * @returns true if the switch was successful, false otherwise */ switchMode(mode: string): boolean; /** * Checks if a text matches the UMB trigger * @param text Text to check * @returns true if the text matches the UMB trigger, false otherwise */ checkUmbTrigger(text: string): boolean; /** * Activates the UMB mode * @returns true if the activation was successful, false otherwise */ activateUmb(): boolean; /** * Deactivates the UMB mode */ deactivateUmb(): void; /** * Checks if a text matches any mode trigger * @param text Text to check * @returns Array with the modes corresponding to the found triggers */ checkModeTriggers(text: string): string[]; /** * Sets the Memory Bank status * @param status New status */ setMemoryBankStatus(status: 'ACTIVE' | 'INACTIVE'): void; /** * Gets the status prefix for responses * @returns Status prefix */ getStatusPrefix(): string; /** * Checks if the UMB mode is active * @returns true if the UMB mode is active, false otherwise */ isUmbModeActive(): boolean; /** * Cleans up all resources */ dispose(): void; }