/** * @fileoverview HoloLand Culture Runtime — Live Norm + Memory Engine * @module @holoscript/core/runtime * * Wires the CulturalMemory and NormEngine into HoloLand's tick loop. * Manages the full lifecycle of emergent culture within a running world: * * - Agent registration and norm adoption on join * - Per-tick memory decay and trace evaporation * - Effect-based norm compliance evaluation (real-time) * - SOP consolidation on tick intervals * - Cultural health monitoring for world operators * - Event bus for culture-related notifications * * @version 1.0.0 */ import { CulturalMemory, type EpisodicMemory, type StigmergicTrace, type SemanticSOP, NormEngine, type NormViolation, type NormProposal } from '@holoscript/framework/agents'; import type { CulturalNorm } from '@holoscript/core'; import { VREffect } from '@holoscript/core'; /** A culture event emitted by the runtime */ export interface CultureEvent { type: 'violation' | 'norm_adopted' | 'norm_proposed' | 'sop_formed' | 'cultural_shift' | 'trace_reinforced'; agentId: string; normId?: string; details: string; timestamp: number; severity: 'info' | 'warning' | 'critical'; } /** Culture runtime configuration */ export interface CultureRuntimeConfig { /** Ticks between SOP consolidation runs */ consolidationInterval: number; /** Ticks between adoption curve snapshots */ snapshotInterval: number; /** Default norms all agents must adopt */ defaultNorms: string[]; /** Cultural health warning threshold (0-1) */ healthWarningThreshold: number; /** Max events to retain */ maxEventHistory: number; /** Enable auto-enforcement (block hard violations) */ autoEnforce: boolean; } /** * CultureRuntime — manages emergent culture within a HoloLand world. */ export declare class CultureRuntime { private config; private memory; private norms; private events; private tickCount; private agents; private lastHealthScore; constructor(config?: Partial); /** * Agent joins the world. */ agentJoin(agentId: string, adoptNorms?: string[]): void; /** * Agent leaves the world (consolidate their knowledge first). */ agentLeave(agentId: string): SemanticSOP[]; /** * Main tick: advance the culture simulation. * Call this once per world tick. */ tick(): { decayed: ReturnType; events: CultureEvent[]; }; /** * Evaluate an agent's intended effects against active norms. * Called before allowing the agent to execute an action. * * @returns Whether the action is allowed (true) or blocked (false) */ evaluateAction(agentId: string, effects: VREffect[], zoneId?: string): { allowed: boolean; violations: NormViolation[]; blocked: VREffect[]; }; /** * Record an experience for an agent. */ recordExperience(agentId: string, event: string, opts?: { normId?: string; valence?: number; importance?: number; participants?: string[]; tags?: string[]; }): EpisodicMemory; /** * Leave a trace in the world. */ leaveTrace(agentId: string, zoneId: string, label: string, position: [number, number, number]): StigmergicTrace; /** * Perceive nearby traces. */ perceiveTraces(zoneId: string, position: [number, number, number]): StigmergicTrace[]; /** * Propose a new norm. */ proposeNorm(agentId: string, norm: CulturalNorm): NormProposal; /** * Get cultural dashboard data. */ dashboard(): { health: number; agents: number; normStats: ReturnType; memoryStats: ReturnType; recentEvents: CultureEvent[]; tickCount: number; }; /** * Get event history. */ getEvents(filter?: { type?: CultureEvent['type']; agentId?: string; }): CultureEvent[]; /** * Export full culture state (for world save). */ exportState(): { memory: ReturnType; tickCount: number; }; private emit; } //# sourceMappingURL=CultureRuntime.d.ts.map