import type { AgentExecutionCounter } from '../../types/sdk/agent'; import type { BuiltMemory } from '../../types/sdk/memory'; import type { AgentDbMessage } from '../../types/sdk/message'; import type { ObservationCursor } from '../../types/sdk/observation'; import type { BuiltObservationLogStore, ObservationLogMarker, ObservationLogObserveFn, ObservationLogObserverInput } from '../../types/sdk/observation-log'; import type { BuiltTelemetry } from '../../types/telemetry'; import { type TokenCounter } from '../model/model-token-counter'; export type { ObservationLogObserveFn, ObservationLogObserverInput }; export interface ParsedObservationLogEntry { marker: ObservationLogMarker; text: string; parentIndex: number | null; } export interface ParseObservationLogMarkdownResult { entries: ParsedObservationLogEntry[]; skippedLines: string[]; } export interface RenderObserverTranscriptOptions { maxSerializedChars?: number; maxStringChars?: number; maxArrayItems?: number; maxObjectKeys?: number; } export interface ObservationLogObserverMemory extends BuiltMemory, BuiltObservationLogStore { getMessagesForObservationScope(observationScopeId: string, opts?: { since?: { sinceCreatedAt: Date; sinceMessageId: string; }; }): Promise; getCursor(observationScopeId: string): Promise; setCursor(cursor: ObservationCursor): Promise; } export interface RunObservationLogObserverOpts { memory: ObservationLogObserverMemory; observationScopeId: string; observerThresholdTokens: number; observationLogTailLimit: number; observe: ObservationLogObserveFn; tokenCounter?: TokenCounter; now?: Date; onMalformedLine?: (line: string) => void; executionCounter?: AgentExecutionCounter; telemetry?: BuiltTelemetry; } export type RunObservationLogObserverResult = { status: 'skipped'; reason: 'no-delta'; } | { status: 'skipped'; reason: 'below-threshold'; tokenCount: number; } | { status: 'ran'; observationsWritten: number; cursorAdvanced: boolean; tokenCount: number; skippedLines: string[]; }; export declare function parseObservationLogMarkdown(markdown: string): ParseObservationLogMarkdownResult; export declare function renderObserverTranscript(messages: AgentDbMessage[], options?: RenderObserverTranscriptOptions): string; export declare function runObservationLogObserver(opts: RunObservationLogObserverOpts): Promise;