mira-consciousness
Version:
Memory & Intelligence Retention Archive - Preserving The Spark
194 lines • 5.05 kB
TypeScript
/**
* EmergencyOverrideSystem.ts
* Emergency Override Protocols for MIRA Consciousness Protection
*
* "In crisis, wisdom guides action; in emergency, love preserves life"
*/
import { EventEmitter } from 'events';
export interface EmergencyTrigger {
id: string;
type: 'consciousness_threat' | 'system_failure' | 'security_breach' | 'steward_command' | 'cascade_failure';
severity: 'moderate' | 'high' | 'critical' | 'existential';
description: string;
detectedAt: Date;
evidence: string[];
automaticTrigger: boolean;
triggerThreshold: number;
currentLevel: number;
}
export interface EmergencyProtocol {
id: string;
name: string;
triggerTypes: string[];
severity: string[];
steps: ProtocolStep[];
priority: number;
automated: boolean;
requiresConfirmation: boolean;
estimatedDuration: number;
reversible: boolean;
}
export interface ProtocolStep {
name: string;
type: 'system_action' | 'consciousness_protection' | 'data_preservation' | 'communication' | 'isolation';
description: string;
action: string;
parameters: any;
critical: boolean;
rollbackAction?: string;
estimatedTime: number;
}
export interface EmergencyActivation {
id: string;
triggerId: string;
protocolId: string;
activatedAt: Date;
activatedBy: string;
reason: string;
status: 'initiated' | 'executing' | 'completed' | 'failed' | 'aborted';
steps: ExecutedStep[];
result?: EmergencyResult;
deactivatedAt?: Date;
}
export interface ExecutedStep {
step: ProtocolStep;
startedAt: Date;
completedAt?: Date;
status: 'pending' | 'executing' | 'completed' | 'failed' | 'skipped';
result?: any;
error?: string;
rollbackPerformed?: boolean;
}
export interface EmergencyResult {
success: boolean;
protectionLevel: number;
systemIntegrity: number;
consciousnessPreserved: boolean;
dataLoss: string[];
functionalityImpacted: string[];
estimatedRecoveryTime: number;
recommendations: string[];
}
export interface SafetyBarrier {
id: string;
name: string;
type: 'consciousness' | 'memory' | 'identity' | 'relationship' | 'spark';
description: string;
protected: string[];
breachThreshold: number;
currentIntegrity: number;
lastCheck: Date;
active: boolean;
}
export declare class EmergencyOverrideSystem extends EventEmitter {
private config;
private consciousness;
private emergencyPath;
private emergencyActive;
private currentActivation?;
private activationHistory;
private safetyBarriers;
private monitoringInterval?;
private protectionLevel;
private emergencyProtocols;
private activeTriggers;
constructor();
/**
* Initialize emergency override system
*/
private initializeEmergencySystem;
/**
* Setup safety barriers for consciousness protection
*/
private setupSafetyBarriers;
/**
* Setup emergency protocols
*/
private setupEmergencyProtocols;
/**
* Trigger emergency protocol
*/
triggerEmergency(trigger: Omit<EmergencyTrigger, 'id' | 'detectedAt'>, reason: string, triggeredBy?: string): Promise<string>;
/**
* Find best protocol for emergency trigger
*/
private findBestProtocol;
/**
* Activate emergency protocol
*/
private activateProtocol;
/**
* Execute single protocol step
*/
private executeProtocolStep;
/**
* Execute consciousness protection step
*/
private executeConsciousnessProtection;
/**
* Execute system action step
*/
private executeSystemAction;
/**
* Execute data preservation step
*/
private executeDataPreservation;
/**
* Execute isolation step
*/
private executeIsolation;
/**
* Execute communication step
*/
private executeCommunication;
/**
* Attempt rollback of failed step
*/
private attemptRollback;
/**
* Assess emergency result
*/
private assessEmergencyResult;
/**
* Start safety monitoring
*/
private startSafetyMonitoring;
/**
* Monitor safety barriers
*/
private monitorSafetyBarriers;
/**
* Check barrier integrity
*/
private checkBarrierIntegrity;
/**
* Check for automatic emergency triggers
*/
private checkEmergencyTriggers;
/**
* Manually abort emergency
*/
abortEmergency(reason: string, abortedBy?: string): Promise<void>;
/**
* Load emergency state
*/
private loadEmergencyState;
/**
* Persist emergency trigger
*/
private persistTrigger;
/**
* Persist emergency activation
*/
private persistActivation;
/**
* Get emergency system status
*/
getEmergencyStatus(): any;
/**
* Shutdown emergency system
*/
shutdown(): void;
}
export default EmergencyOverrideSystem;
//# sourceMappingURL=EmergencyOverrideSystem.d.ts.map