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

Add example config files for CI tests

Skywatch 64aed413 52f2ebbf

+67
+7
.github/workflows/ci.yml
··· 21 21 - name: Install dependencies 22 22 run: bun install 23 23 24 + - name: Setup example config files for CI 25 + run: | 26 + cp src/constants.example.ts src/constants.ts 27 + cp src/rules/handles/constants.example.ts src/rules/handles/constants.ts 28 + cp src/rules/posts/constants.example.ts src/rules/posts/constants.ts 29 + cp src/rules/profiles/constants.example.ts src/rules/profiles/constants.ts 30 + 24 31 # - name: Run linter 25 32 # run: npm run lint 26 33
+4
src/constants.example.ts
··· 1 + /** 2 + * Global allowlist of DIDs that should never be moderated 3 + */ 4 + export const GLOBAL_ALLOW: string[] = [];
+1
src/rules/posts/constants.example.ts
··· 1 + import type { Checks } from "../../types.js";
+55
src/rules/profiles/constants.example.ts
··· 1 + import type { Checks } from "../../types.js"; 2 + 3 + /** 4 + * Example profile check configurations 5 + * 6 + * This file demonstrates how to configure profile moderation rules. 7 + * Copy this file to constants.ts and customize for your labeler's needs. 8 + * 9 + * Profile checks can match against display names and/or descriptions. 10 + */ 11 + 12 + export const PROFILE_CHECKS: Checks[] = [ 13 + // Example 1: Suspicious bio patterns 14 + { 15 + label: "suspicious-bio", 16 + comment: "Profile contains suspicious patterns", 17 + description: true, 18 + displayName: false, 19 + reportAcct: false, 20 + commentAcct: false, 21 + toLabel: true, 22 + check: new RegExp( 23 + "dm.*?for.*?promo|follow.*?for.*?follow|gain.*?followers", 24 + "i", 25 + ), 26 + }, 27 + 28 + // Example 2: Display name checks 29 + { 30 + label: "impersonation-risk", 31 + comment: "Display name may indicate impersonation", 32 + description: false, 33 + displayName: true, 34 + reportAcct: false, 35 + commentAcct: false, 36 + toLabel: true, 37 + check: new RegExp("official|verified|admin|support", "i"), 38 + whitelist: new RegExp("unofficial|parody|fan", "i"), 39 + ignoredDIDs: [ 40 + "did:plc:example123", // Actual official account 41 + ], 42 + }, 43 + 44 + // Example 3: Both display name and description 45 + { 46 + label: "crypto-spam", 47 + comment: "Profile suggests crypto spam activity", 48 + description: true, 49 + displayName: true, 50 + reportAcct: false, 51 + commentAcct: false, 52 + toLabel: true, 53 + check: new RegExp("crypto.*?giveaway|nft.*?drop|airdrop", "i"), 54 + }, 55 + ];