/** One ranked recent-session entry surfaced to the picker. */ export interface RecentSessionEntry { /** Session id from the validated managed candidate header. */ sessionId: string; /** Validated workspace path recorded by the managed candidate. */ path?: string; /** Branch, when recoverable from the header. */ branch?: string; /** A short title (first user message), when recoverable. */ title?: string; /** Absolute path of the session history (state) file. */ sessionStateFile: string; /** Last-activity epoch-millis (history file mtime). */ mtimeMs: number; /** True when a terminal breadcrumb points at this session file. */ currentTerminal?: boolean; /** True when this history is an internal helper/sub-agent session. */ internal?: boolean; } export interface RecentActivityDeps { /** Workspace whose managed sessions will be listed readonly. */ cwd: string; /** Agent directory used to resolve the managed session scope. */ agentDir?: string; /** Explicit managed root for isolated tests. */ sessionsRoot?: string; /** Optional breadcrumb session-file paths (current terminals). */ breadcrumbPaths?: string[]; /** Max entries to return (default 20). */ limit?: number; /** Include internal helper/sub-agent sessions (default true). */ includeInternal?: boolean; /** Search every validated v2 workspace scope below the session root (default false). */ allWorkspaces?: boolean; /** Injection seam for tests. */ readInitialLines?: (file: string, maxLines: number) => string[]; } /** Lists readonly managed candidates, optionally across every validated v2 workspace scope, ranked by history-file mtime. */ export type ListRecentSessionsResult = { kind: "complete"; entries: RecentSessionEntry[]; warnings: readonly string[]; } | { kind: "error"; code: "scope_unavailable" | "managed_scan_failed"; message: string; }; export declare function listRecentSessions(deps: RecentActivityDeps): Promise;