/** Shared awareness contributor and invalidation contracts. */ import type { IAgentRuntime } from "./types/runtime.js"; export declare const SELF_STATUS_SCHEMA_VERSION = 1; /** Default cache TTL in ms (1 minute). */ export declare const DEFAULT_CACHE_TTL_MS = 60000; export type AwarenessInvalidationEvent = "permission-changed" | "plugin-changed" | "wallet-updated" | "provider-changed" | "config-changed" | "runtime-restarted" | "opinion-updated"; export interface AwarenessContributor { /** Unique identifier, e.g. "wallet", "permissions". */ id: string; /** Sort priority (lower = higher in output). * 10=runtime, 20=permissions, 30=wallet, 40=provider, * 50=pluginHealth, 60=connectors, 70=cloud, 80=features */ position: number; /** Layer 1 summary — injected every LLM turn. * MUST return plain text, never secrets/keys/tokens. * Return "" if nothing should be shown. */ summary: (runtime: IAgentRuntime) => Promise; /** Layer 2 detail — called via RUNTIME action with op=self_status. * "brief" ~= 200 tokens, "full" ~= 2000 tokens. */ detail?: (runtime: IAgentRuntime, level: "brief" | "full") => Promise; /** Cache TTL in ms. Default DEFAULT_CACHE_TTL_MS. */ cacheTtl?: number; /** Events that proactively clear the cache (don't wait for TTL). */ invalidateOn?: AwarenessInvalidationEvent[]; /** Only built-in contributors set trusted=true. * Untrusted contributor output is sanitized before injection. */ trusted?: boolean; } /** * AwarenessRegistry — core orchestration layer for the Self-Awareness System. * * Manages contributor registration, summary composition (Layer 1), * detail retrieval (Layer 2), caching, sanitization, and invalidation. * * @architecture All public methods are fault-tolerant: individual contributor * errors are captured and surfaced as `[{id}: unavailable]` markers — the * registry itself NEVER throws from composeSummary / getDetail. */ export declare class AwarenessRegistry { private readonly contributors; private readonly contributorIds; private readonly cache; register(contributor: AwarenessContributor): void; composeSummary(runtime: IAgentRuntime): Promise; getDetail(runtime: IAgentRuntime, module: string, level: "brief" | "full"): Promise; invalidate(event: AwarenessInvalidationEvent): void; private getCachedSummary; private readDetail; private composeAllDetails; }