/** * @fileoverview HoloLand Safety Gate — Runtime Safety Enforcement * @module @holoscript/core/runtime * * Wires the compile-time safety system into HoloLand's runtime: * - Gate: blocks unsafe packages from loading into a world * - Monitor: tracks resource usage at runtime, compares to budget * - Enforce: applies norm compliance and capability checks live * * This is the bridge between compile-time verification and * the running spatial engine. * * @version 1.0.0 */ import { SafetyReport, SafetyVerdict } from '@holoscript/core'; import { ResourceCategory } from '@holoscript/core'; import { PlatformTarget } from '@holoscript/core'; import { InstallManifest } from '@holoscript/core'; /** Gate decision */ export interface GateDecision { allowed: boolean; packageId: string; reason: string; safetyVerdict: SafetyVerdict; dangerScore: number; warnings: string[]; } /** World safety policy */ export interface WorldSafetyPolicy { /** Maximum danger score allowed (0-10) */ maxDangerScore: number; /** Allowed safety verdicts */ allowedVerdicts: SafetyVerdict[]; /** Required minimum publisher trust level */ minPublisherTrust: 'new' | 'verified' | 'trusted' | 'official'; /** Maximum total packages per world */ maxPackages: number; /** Platform this world runs on */ platform: PlatformTarget; } /** * Gate check: can this package load into this world? */ export declare function gateCheck(manifest: InstallManifest, report: SafetyReport, currentPackageCount: number, policy?: Partial): GateDecision; /** Real-time resource usage snapshot */ export interface ResourceSnapshot { timestamp: number; usage: Partial>; budgetPercent: Partial>; overBudget: boolean; violations: string[]; } /** * RuntimeMonitor — tracks live resource usage against platform budgets. */ export declare class RuntimeMonitor { private platform; private currentUsage; private history; private maxHistory; constructor(platform: PlatformTarget, maxHistory?: number); /** * Report current resource usage. */ report(usage: Partial>): ResourceSnapshot; /** * Get current usage for a resource. */ getUsage(category: ResourceCategory): number; /** * Get budget percentage for a resource. */ getBudgetPercent(category: ResourceCategory): number; /** * Check if any resource is over budget. */ isOverBudget(): boolean; /** * Get resource usage history. */ getHistory(): ResourceSnapshot[]; /** * Get frame timing info for the platform. */ getFrameBudget(): { frameBudgetMs: number; agentBudgetMs: number; }; } //# sourceMappingURL=SafetyGate.d.ts.map