export type ProjectSource = "ggcoder" | "claude-code" | "codex" | "folder"; export interface DiscoverProjectsOptions { /** The user's configured projects folder; always scanned when set. */ projectsRoot?: string; /** * Extra folders the user has explicitly added as project roots. Scanned like * `projectsRoot`; an explicit list beats inference, which stays as the * zero-config default for people who never open Settings. */ extraRoots?: readonly string[]; /** Project paths the user dismissed from the picker. */ hiddenPaths?: readonly string[]; } export interface DiscoveredProject { name: string; path: string; lastActiveMs: number; lastActiveDisplay: string; /** Sorted, deduped list of stores this project showed up in. */ sources: ProjectSource[]; } /** * Scan ggcoder + Claude Code + Codex session stores AND the user's project * folders, returning one row per project sorted most-recent first. Duplicates * (same cwd) are collapsed; the `sources` field lists every store the project * appeared in so the picker can show a combined badge. * * Session stores alone only ever surface projects you have *already opened with * an agent*, so a folder full of real projects stayed invisible until each one * had been opened by some other route. The filesystem pass fixes that: it lists * the direct children of every known project root, tagged `folder`. */ export declare function discoverProjects(options?: DiscoverProjectsOptions): Promise; /** * Is `value` an absolute path on ANY platform? * * `path.isAbsolute` is platform-bound, but a session store is portable: read on * Windows it carries `C:\Users\…` / `\\server\share\…`, on POSIX `/Users/…`. * The old POSIX-only `startsWith("/")` check silently rejected every Windows * cwd header, so discovery fell back to the lossy directory-name decode and * every project/session vanished from the picker on Windows. */ export declare function isAbsoluteCwd(value: string): boolean; export interface RecentSession { /** Session id. */ id: string; /** Absolute resumable path to a plain or gzip GG Coder session. */ path: string; /** Legacy saved label, falling back to the first real user prompt. */ preview: string; /** Relative "3h ago" string from last activity. */ lastActiveDisplay: string; messageCount: number; /** * Which store this row came from. Absent means `ggcoder` — a session that is * already resumable as-is. A foreign value means `path` points at that tool's * own transcript, which the host imports before opening. */ source?: ProjectSource; } /** * List the most recent ggcoder conversations for a project cwd. Compaction * checkpoints share a conversation id, so only the newest resumable checkpoint * is shown. Legacy labels win; otherwise the first real user prompt is used. */ export declare function listRecentSessions(cwd: string, limit?: number, sessionsDir?: string): Promise; /** * List the most recent Claude Code and Codex conversations for a project cwd. * * The project picker has always surfaced these stores (`discoverProjects`), so a * project can appear *because* it has Claude Code history — and then show an * empty session list, because that only read GG Coder's own directory. These * rows close that gap: each one points at the foreign transcript, tagged with * its `source`, and the host imports it on click. * * Cheap by construction: a transcript is only opened if its cwd matches, and * both the per-store file walk and the preview read are line-capped. */ export declare function listForeignSessions(cwd: string, limit?: number, homeDir?: string): Promise; //# sourceMappingURL=project-discovery.d.ts.map