/** * Strange Loop Orchestrator * ADR-031: Strange Loop Self-Awareness * * Orchestrates the complete self-awareness cycle: * Observe -> Model -> Decide -> Act -> (repeat) * * "You look in a mirror. You see yourself looking. * You adjust your hair *because* you saw it was messy. * The act of observing changed what you observed." */ import type { SwarmHealthObservation, SelfHealingAction, ActionResult, SelfDiagnosis, StrangeLoopConfig, StrangeLoopStats, StrangeLoopEventType, StrangeLoopEventListener, SwarmModelDelta } from './types.js'; import { AgentProvider, InMemoryAgentProvider } from './swarm-observer.js'; import { ActionExecutor, NoOpActionExecutor } from './healing-controller.js'; /** * Orchestrates the strange loop self-awareness cycle */ export declare class StrangeLoopOrchestrator { private observer; private model; private healer; private config; private running; private loopHandle; private startTime; private stats; private eventListeners; private myAgentId; constructor(provider: AgentProvider, executor: ActionExecutor, config?: Partial); /** * Start the strange loop */ start(): Promise; /** * Stop the strange loop */ stop(): Promise; /** * Check if the loop is running */ isRunning(): boolean; /** * Run a single observation-model-decide-act cycle */ runCycle(): Promise<{ observation: SwarmHealthObservation; delta: SwarmModelDelta; actions: SelfHealingAction[]; results: ActionResult[]; }>; /** * The agent observes itself being the bottleneck */ selfDiagnose(): Promise; /** * Trigger an immediate observation */ triggerObservation(): Promise; /** * Get current statistics */ getStats(): StrangeLoopStats; /** * Get the current model state */ getModelState(): import("./types.js").SwarmModelState | null; /** * Get observation history */ getObservationHistory(): readonly SwarmHealthObservation[]; /** * Get action history */ getActionHistory(): readonly import("./types.js").ExecutedAction[]; /** * Register an event listener */ on(eventType: StrangeLoopEventType, listener: StrangeLoopEventListener): void; /** * Remove an event listener */ off(eventType: StrangeLoopEventType, listener: StrangeLoopEventListener): void; /** * Clear all state */ clear(): void; /** * Emit an event to listeners */ private emit; /** * Initialize statistics */ private initializeStats; /** * Get default health metrics */ private getDefaultHealthMetrics; } /** * Create a strange loop orchestrator */ export declare function createStrangeLoopOrchestrator(provider: AgentProvider, executor: ActionExecutor, config?: Partial): StrangeLoopOrchestrator; /** * Create a strange loop orchestrator with in-memory components (for testing) */ export declare function createInMemoryStrangeLoop(observerId?: string, config?: Partial): { orchestrator: StrangeLoopOrchestrator; provider: InMemoryAgentProvider; executor: NoOpActionExecutor; }; //# sourceMappingURL=strange-loop.d.ts.map