INNER CODE UNIT · TypeScript
extractTags
winstonkoh87/Athena-Public · supabase/functions/sync-athena/index.ts:106
function extractTags(content: string): string[] {
const tags = content.match(/`#([a-zA-Z0-9-]+)`/g) || [];
return [...new Set(tags.map((t) => t.slice(2, -1)))].slice(0, 10);
}
// Sync sessions
async function syncSessions(supabase: ReturnType<typeof createClient>): Promise<{ synced: number; skipped: number; errors: number }> {
let synced = 0;
let skipped = 0;
let errors = 0;
try {
const files = await fetchGitHubDirectory(".context/memories/session_logs");
for (const file of files) {
if (file.type !== "file" || !file.name.endsWith(".md") || !file.download_url) {
continue;
}