/** * Protocol enforcement tracker for the Iranti agent compliance system. * * Tracks per-agent protocol state (last handshake, last attend phase, discovery * budget, pending post-response) and checks whether a requested operation is * permitted. Violations are returned as ProtocolViolation objects; the Iranti * SDK converts them to errors or warnings depending on the enforcement mode. * * Protocol rules enforced: * - Operations gated by `handshake` require a prior iranti_handshake call. * - Operations gated by `postResponse` block if a pre-response attend is * outstanding (previous turn not closed). * - Operations gated by `attend` require a pre-response attend with budget. * - `memory_use_required` blocks rediscovery until injected memory is acknowledged. * * Key exports: * - AgentProtocolTracker — the per-agent state machine * - ProtocolViolationError — thrown in strict mode * - ProtocolViolation — structured violation object (code, message, requiredAction) * - ProtocolEnforcementMode — 'off' | 'warn' | 'strict' */ export type ProtocolEnforcementMode = 'off' | 'warn' | 'strict'; export type ProtocolOperation = 'attend' | 'observe' | 'query' | 'history' | 'queryAll' | 'search' | 'related' | 'related_deep' | 'who_knows'; export type ProtocolViolationCode = 'handshake_required' | 'attend_required' | 'post_response_required' | 'memory_use_required'; export type ProtocolViolation = { code: ProtocolViolationCode; agentId: string; operation: ProtocolOperation; message: string; requiredAction: string; }; export declare class ProtocolViolationError extends Error { readonly protocolViolation: ProtocolViolation; constructor(protocolViolation: ProtocolViolation); } export declare class AgentProtocolTracker { private readonly state; markHandshake(agentId: string): void; markAttend(agentId: string, phase?: 'pre-response' | 'post-response' | 'mid-turn'): void; markMemoryUseAcknowledgementRequired(agentId: string): void; clearMemoryUseAcknowledgementRequired(agentId: string): void; clearPendingPostResponse(agentId: string): void; notifyDiscoveryConsumed(agentId: string): void; bootstrapState(agentId: string, state: { lastHandshakeAt?: number; lastAttendAt?: number; lastAttendPhase?: 'pre-response' | 'post-response' | 'mid-turn'; discoveryBudget?: number; pendingPostResponse?: boolean; }): void; clearAgent(agentId: string): void; check(agentId: string, operation: ProtocolOperation, requirements: { handshake?: boolean; attend?: boolean; postResponse?: boolean; }): ProtocolViolation | null; } //# sourceMappingURL=protocolEnforcement.d.ts.map