/**
 * Filters and sorts OpenCode sessions by registered project directories.
 *
 * Only sessions whose directory matches a registered project path are included.
 * Results are sorted by most recent activity (updated or created time) descending.
 */
/**
 * Filter sessions to only those matching registered project paths,
 * then sort by most recent activity (updated time, falling back to created time).
 */
export function filterAndSortSessions(sessions, projectPaths) {
    return sessions
        .filter((s) => projectPaths.has(s.directory))
        .sort((a, b) => {
        const aTime = a.time.updated || a.time.created;
        const bTime = b.time.updated || b.time.created;
        return bTime - aTime;
    });
}
//# sourceMappingURL=session-filter.js.map