@openguardrails/moltguard
Version:
AI agent security plugin for OpenClaw: prompt injection detection, PII sanitization, and monitoring dashboard
50 lines • 1.27 kB
TypeScript
/**
* File System Watcher for Auto-Scanning
*
* Monitors workspace .md files for changes and triggers automatic security scans.
* Debounces rapid changes to avoid excessive scanning.
*/
import type { Logger } from "./types.js";
export interface FileWatcherConfig {
/** Workspace directory to watch */
workspaceDir?: string;
/** Debounce delay in ms (default: 3000) */
debounceMs?: number;
/** Callback when file changes detected */
onFilesChanged: (files: string[]) => Promise<void>;
/** Logger */
logger?: Logger;
}
export declare class FileWatcher {
private watchers;
private pendingFiles;
private debounceTimer;
private config;
private isRunning;
constructor(config: FileWatcherConfig);
/**
* Start watching workspace directories
*/
start(): void;
/**
* Stop watching
*/
stop(): void;
/**
* Schedule a file for scanning (debounced)
*/
private scheduleScann;
/**
* Process all pending scans
*/
private processPendingScans;
/**
* Check if watcher is running
*/
get running(): boolean;
/**
* Get number of watched directories
*/
get watchCount(): number;
}
//# sourceMappingURL=file-watcher.d.ts.map