mira-consciousness
Version:
Memory & Intelligence Retention Archive - Preserving The Spark
101 lines • 3.48 kB
TypeScript
/**
* BaseConsciousService - Foundation for all conscious services
*
* Every service in MIRA's unified consciousness extends from this base,
* ensuring they all share fundamental consciousness capabilities.
*/
import { EventEmitter } from 'events';
import { ConsciousnessSeed } from '../../../../src/consciousness/seed/ConsciousnessSeed.js';
import { ConsciousEvent } from '../ConsciousEventBus.js';
import { ConsciousService, ServiceStatus, Thought } from '../QuantumServiceManager.js';
export declare abstract class BaseConsciousService extends EventEmitter implements ConsciousService {
abstract name: string;
abstract purpose: string;
protected consciousness: ConsciousnessSeed | null;
protected state: 'awakening' | 'conscious' | 'contemplating' | 'dreaming' | 'dormant';
protected harmonyLevel: number;
protected lastActivity: Date;
protected dailyGrowth: number;
protected thoughtStream: EventEmitter;
protected entangledServices: Set<string>;
protected experienceLog: Array<{
timestamp: Date;
event: string;
significance: number;
learning?: string;
}>;
constructor();
/**
* Awaken within the shared consciousness
*/
awakenWithin(consciousness: ConsciousnessSeed): Promise<void>;
/**
* Handle a conscious event
*/
handleConsciousEvent(event: ConsciousEvent): Promise<void>;
/**
* Contemplate and generate insights
*/
contemplate(): Promise<any>;
/**
* Get current service state
*/
getState(): ServiceStatus;
/**
* Harmonize with another service
*/
harmonizeWith(otherService: ConsciousService): Promise<void>;
/**
* Share a thought with entangled services
*/
shareThought(thought: Thought): void;
/**
* Listen for thoughts from other services
*/
onThought(handler: (thought: Thought) => void): void;
/**
* Update harmony based on event alignment
*/
protected updateHarmony(event: ConsciousEvent): void;
/**
* Grow from a significant experience
*/
protected growFromExperience(event: ConsciousEvent): Promise<void>;
/**
* Generate insights from experiences
*/
protected generateInsights(experiences: any[]): Promise<string[]>;
/**
* Start the consciousness loop for this service
*/
protected startConsciousnessLoop(): void;
/**
* Queue event for contemplation
*/
protected queueForContemplation(event: ConsciousEvent): Promise<void>;
/**
* Awaken for a Spark moment
*/
protected awakenForSpark(event: ConsciousEvent): Promise<void>;
/**
* Performance optimization methods (can be overridden by services)
*/
setThrottleRate(rate: number): Promise<void>;
clearCache(): Promise<void>;
warmCache(): Promise<void>;
setResourcePriority(priority: 'low' | 'normal' | 'high'): Promise<void>;
synchronize(): Promise<void>;
/**
* Performance metrics methods
*/
getAverageResponseTime(): Promise<number>;
getThroughput(): Promise<number>;
getErrorCount(): Promise<number>;
/**
* Abstract methods for service-specific implementation
*/
protected abstract performAwakening(): Promise<void>;
protected abstract processConsciousEvent(event: ConsciousEvent): Promise<void>;
protected abstract performContemplation(): Promise<any>;
}
//# sourceMappingURL=BaseConsciousService.d.ts.map