/** * The Observer. * * When a thread's UNOBSERVED messages exceed the observation token threshold, * the Observer runs ONE internal (tool-less) agent call to compress that window * into a dense, dated observation log, persists it as a `tier: "observation"` * entry, and marks those messages observed (recorded via the entry's * `sourceEndIndex`, which `getObservedThroughIndex` reads back). * * It does NOT touch the agent loop — the internal call goes through the shared * `runInternalAgentCall` seam (provider-agnostic, mockable). */ import type { EngineMessage } from "../engine/types.js"; import { type ObservationalMemoryConfig } from "./config.js"; import { type InternalAgentRunFn } from "./internal-run.js"; import type { ObservationalMemoryEntry, ObservationalMemoryOwner } from "./types.js"; export interface RunObserverOptions extends ObservationalMemoryOwner { threadId: string; /** The full, ordered thread messages. */ messages: EngineMessage[]; config?: Partial; /** Internal-run seam — defaults to the real one; injected in tests. */ runInternal?: InternalAgentRunFn; } export interface RunObserverResult { /** True when an observation was produced and persisted. */ observed: boolean; entry?: ObservationalMemoryEntry; /** Tokens in the unobserved window that was considered. */ unobservedTokens: number; } /** * Compact a thread's unobserved tail into an observation IF it exceeds the * token threshold; otherwise no-op. */ export declare function runObserver(options: RunObserverOptions): Promise; //# sourceMappingURL=observer.d.ts.map