/** * Start tracking a roundtrip * * **Poka-yoke**: Validates operation type and checks if roundtrip can start without violating SLA * * @param {string} operationType - Operation type (emit_event, register_hook, process_intent, execute_beam) * @param {string} [operationId] - Optional operation ID (generated if not provided) * @returns {string} Operation ID for this roundtrip * @throws {Error} If operation type is invalid or SLA would be violated */ export function startRoundtrip(operationType: string, operationId?: string): string; /** * End tracking a roundtrip * * **Poka-yoke**: Validates operation ID and records metrics * * @param {string} operationId - Operation ID from startRoundtrip * @param {boolean} success - Whether the roundtrip succeeded * @param {string} [errorMessage] - Error message if failed * @returns {Object} Roundtrip result with latency and SLA compliance * @throws {Error} If operation ID is invalid */ export function endRoundtrip(operationId: string, success: boolean, errorMessage?: string): any; /** * Get SLA statistics for an operation type * * @param {string} operationType - Operation type * @returns {Object} SLA statistics */ export function getSLAStats(operationType: string): any; /** * Check if a roundtrip can start without violating SLA (poka-yoke) * * **Poka-yoke**: Prevents operations that would violate error rate threshold * * @param {string} operationType - Operation type * @returns {boolean} True if roundtrip can start * @throws {Error} If error rate would exceed threshold */ export function canStartRoundtrip(operationType: string): boolean; /** * Validate roundtrip latency meets SLA * * @param {number} latency - Latency in milliseconds * @returns {boolean} True if latency meets SLA */ export function validateRoundtripLatency(latency: number): boolean; /** * Validate error rate meets SLA * * @param {number} errorRate - Error rate (0-1) * @returns {boolean} True if error rate meets SLA */ export function validateErrorRate(errorRate: number): boolean; /** * Get SLA compliance report * * @returns {Object} SLA compliance report */ export function getSLAReport(): any; /** * Get list of SLA violations * * @returns {Array} List of violations */ export function getViolations(): any[]; /** * Reset SLA statistics (for testing) * * @param {string} [operationType] - Optional operation type to reset (resets all if not provided) */ export function resetSLAStats(operationType?: string): void; /** * Get active roundtrips count * * @returns {number} Number of active roundtrips */ export function getActiveRoundtripsCount(): number; export namespace OPERATION_TYPES { let EMIT_EVENT: string; let REGISTER_HOOK: string; let PROCESS_INTENT: string; let EXECUTE_BEAM: string; }