/** * Core Interceptor * @weave_protocol/hundredmen * * Intercepts MCP tool calls, analyzes them, and gates execution */ import { EventEmitter } from 'events'; import { WardPolicyManager, type WardCheckResult } from './ward.js'; import { InterceptedCall, CallStatus, IntentAnalysis, ScanResult, DriftAnalysis, HundredmenConfig, HundredmenSession } from './types.js'; export declare function analyzeIntent(tool: string, args: Record, declaredIntent?: string): IntentAnalysis; export declare function detectDrift(call: InterceptedCall, sessionContext: { declaredIntents: string[]; previousCalls: InterceptedCall[]; }): DriftAnalysis; export declare class Interceptor extends EventEmitter { private config; private sessions; private calls; private pendingApprovals; private scanner?; private reputationChecker?; private blockchainAnchor?; private wardManager?; constructor(config?: Partial); setConfig(config: Partial): void; getConfig(): HundredmenConfig; setScanner(scanner: (content: string) => Promise): void; setReputationChecker(checker: (serverId: string) => Promise): void; setBlockchainAnchor(anchor: (data: unknown) => Promise): void; setWardManager(manager: WardPolicyManager): void; getWardManager(): WardPolicyManager | null; /** * Check a proposed tool call against the loaded WARD.md policy. * Returns null if no policy is loaded. */ checkWard(tool: string, args: Record | undefined, sessionId?: string): WardCheckResult | null; createSession(agentId?: string): HundredmenSession; getSession(sessionId: string): HundredmenSession | undefined; declareIntent(sessionId: string, intent: string): void; terminateSession(sessionId: string, reason?: string): void; intercept(sessionId: string, server: string, tool: string, args: Record): Promise; private createPassthroughCall; private makeDecision; approveCall(callId: string, approvedBy?: string): InterceptedCall | null; blockCall(callId: string, blockedBy?: string, reason?: string): InterceptedCall | null; getPendingApprovals(): InterceptedCall[]; recordResult(callId: string, result: unknown): void; recordError(callId: string, error: string): void; getCall(callId: string): InterceptedCall | undefined; getSessionCalls(sessionId: string): InterceptedCall[]; getCallHistory(options?: { sessionId?: string; server?: string; status?: CallStatus; since?: Date; limit?: number; }): InterceptedCall[]; getStats(): { totalCalls: number; approvedCalls: number; blockedCalls: number; pendingCalls: number; activeSessions: number; avgDecisionTimeMs: number; }; private emitEvent; } export default Interceptor; //# sourceMappingURL=interceptor.d.ts.map