/** Browser object layer for the runtime log stream plus disk history paging. */ import type { HostObservable } from '@deepseek-ai/dsh-client-ui-slots'; import type { LogRecord, LogStreamStatus } from '../log-protocol.ts'; /** Reactive browser view of the Host log stream and loaded history. */ export interface LogView { /** EventSource lifecycle state. */ phase: 'connecting' | 'live' | 'reconnecting'; /** Loaded history followed by the live window, both in time order. */ records: readonly LogRecord[]; /** Number of records at the tail that come from the live stream. */ liveCount: number; /** Latest Host retention and persistence status. */ status?: LogStreamStatus; /** Disk-history paging state. */ history: { /** A history page is being fetched. */ loading: boolean; /** Stable failure text of the last page fetch. */ error?: string; /** Older records may still exist on disk. */ hasMore: boolean; }; } /** Owns EventSource parsing, reconnection, and disk-history paging. */ export declare class LogController implements HostObservable { private readonly warn; private readonly listeners; private readonly source; private readonly fetcher; private history; private live; private historyCursor; private historyHasMore; private historyLoading; private historyError; private abort; private disposed; private phase; private status; private snapshot; constructor(warn: (message: string) => void, fetcher?: (url: string, init: RequestInit) => Promise); /** Fetch the next older page from the JSONL files and prepend it. */ loadOlder: () => void; getSnapshot: () => LogView; subscribe: (listener: () => void) => (() => void); /** Close the browser connection and cancel any in-flight history fetch. */ dispose(): void; /** * Fold a snapshot into the live window, keeping loaded history intact. * Records the snapshot re-delivers that are already in history are dropped, * and snapshot records older than the loaded history are folded into it. */ private mergeSnapshot; private publish; }