@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
29 lines • 2.1 kB
TypeScript
import type { SessionInfo } from "./session-manager.ts";
import { type SessionSummaryStore } from "./session-summary-cache.ts";
export type SessionListProgress = (loaded: number, total: number,
/** Sessions loaded so far, sorted by activity, when the lister publishes a partial list. */
partialSessions?: readonly SessionInfo[]) => void;
/** Loaded-row counts between partial-list publications: one directory, and every directory. */
export declare const CURRENT_SESSION_LIST_PUBLISH_INTERVAL = 10;
export declare const ALL_SESSION_LIST_PUBLISH_INTERVAL = 100;
/** Newest activity first. */
export declare function sortSessionInfos(sessions: SessionInfo[]): SessionInfo[];
/**
* Build one picker row from a session file's exact summary.
*
* The summary is derived from every record in the file, so a row's name, first
* message, message count, and activity time are exact regardless of where those
* records sit. Repeat listings of an unchanged file are served from the
* stat-keyed summary cache (or `store` on a cache miss) and stream nothing.
*/
export declare function buildSessionInfo(filePath: string, store?: SessionSummaryStore): Promise<SessionInfo | null>;
/** Build picker rows for an explicit file list, dropping files that are not sessions. */
export declare function listSessionInfos(files: readonly string[], onLoaded: (info: SessionInfo | null) => void, store?: SessionSummaryStore, signal?: AbortSignal): Promise<SessionInfo[]>;
/**
* Build picker rows for session files that all live in `dir`, served through
* and then persisted into that directory's summary index.
*/
export declare function listSessionFilesInDir(dir: string, files: readonly string[], onLoaded: (info: SessionInfo | null) => void, signal?: AbortSignal, indexDir?: string): Promise<SessionInfo[]>;
/** Build picker rows for every `.jsonl` file in one session directory. An aborted `signal` rejects. */
export declare function listSessionsFromDir(dir: string, onProgress?: SessionListProgress, signal?: AbortSignal, indexDir?: string): Promise<SessionInfo[]>;
//# sourceMappingURL=session-discovery.d.ts.map