import { ensureDir, readJsonFile, writeJsonFile } from './json-store.js';
import path from 'node:path';
import { getDataDir } from './json-store.js';
function favoritesFile(workspaceId) {
    return path.join(getDataDir(), 'workspaces', workspaceId, 'code-favorites.json');
}
export function listFavorites(workspaceId) {
    return readJsonFile(favoritesFile(workspaceId)) ?? [];
}
export function saveFavorites(workspaceId, favorites) {
    const file = favoritesFile(workspaceId);
    ensureDir(path.dirname(file));
    writeJsonFile(file, favorites);
}
//# sourceMappingURL=code-favorites-store.js.map