/** * [WHO]: InterceptorResult, Interceptor * [FROM]: Depends on ./detector.js, ./logger.js * [TO]: Consumed by extension entry point (./index.ts) * [HERE]: extensions/builtin/security-audit/engine/interceptor.ts - */ import type { SecurityConfig, AuditEvent } from "../interface.js"; import { DangerDetector } from "./detector.js"; import { AuditLogger } from "./logger.js"; /** * Interceptor Result */ export interface InterceptorResult { /** Whether to proceed with the operation */ proceed: boolean; /** The audit event */ event?: AuditEvent; /** Message to display to user */ message?: string; } /** * Interceptor class */ export declare class Interceptor { private detector; private logger; private config; constructor(detector: DangerDetector, logger: AuditLogger, config: SecurityConfig); /** * Intercept a bash command */ interceptCommand(command: string, cwd: string): InterceptorResult; /** * Intercept a file operation */ interceptFile(operation: "read" | "write" | "edit", path: string, cwd: string): InterceptorResult; /** * Format warning message for command */ private formatWarningMessage; /** * Format blocked message for command */ private formatBlockedMessage; /** * Format warning message for file operation */ private formatFileWarningMessage; /** * Format blocked message for file operation */ private formatFileBlockedMessage; /** * Update configuration */ updateConfig(config: SecurityConfig): void; /** * Update detector */ updateDetector(detector: DangerDetector): void; }