/**
 * Sticky Note Listing
 *
 * Lists sticky notes with optional filtering.
 *
 * @task T5280
 * @epic T5267
 */
import { getBrainAccessor } from '../store/brain-accessor.js';
/**
 * Convert database row to StickyNote interface.
 */
function rowToStickyNote(row) {
    return {
        id: row.id,
        content: row.content,
        createdAt: row.createdAt,
        updatedAt: row.updatedAt ?? undefined,
        tags: row.tagsJson ? JSON.parse(row.tagsJson) : [],
        status: row.status,
        convertedTo: row.convertedToJson ? JSON.parse(row.convertedToJson) : undefined,
        color: row.color ?? undefined,
        priority: row.priority ?? undefined,
        sourceType: row.sourceType ?? 'sticky-note',
    };
}
/**
 * List sticky notes with optional filters.
 *
 * @param params - Filter parameters
 * @param projectRoot - Project root path
 * @returns Array of sticky notes
 */
export async function listStickies(params, projectRoot) {
    const accessor = await getBrainAccessor(projectRoot);
    const rows = await accessor.findStickyNotes({
        status: params.status,
        color: params.color,
        priority: params.priority,
        limit: params.limit,
    });
    return rows.map(rowToStickyNote);
}
//# sourceMappingURL=list.js.map