A tool for parsing traffic on the jetstream and applying a moderation workstream based on regexp based rules

$(cat <<'EOF' feat(language-detection): restore franc implementation

- Replace lande with franc for language detection
- Simplify API from probability map to single detection
- Handle "und" (undetermined) response by defaulting to "eng"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)

+5 -9
+5 -9
src/utils.ts
··· 79 79 return "eng"; 80 80 } 81 81 82 - const lande = (await import("lande")).default; 83 - let langsProbabilityMap = lande(profileText); 84 - 85 - // Sort by probability in descending order 86 - langsProbabilityMap.sort( 87 - (a: [string, number], b: [string, number]) => b[1] - a[1], 88 - ); 82 + const { franc } = await import("franc"); 83 + const detectedLang = franc(profileText); 89 84 90 - // Return the language code with the highest probability 91 - return langsProbabilityMap[0][0]; 85 + // franc returns "und" (undetermined) if it can't detect the language 86 + // Default to "eng" in such cases 87 + return detectedLang === "und" ? "eng" : detectedLang; 92 88 }