feat: add smart pattern detection for emails, names, usernames, phones

Instead of requiring explicit mappings for every variation, users
now configure their identity once (Identity tab) and Silent Send
auto-catches:
- Emails: any address @gmail, @yahoo, @outlook, etc.
- Names: first/last, full name, reversed, possessives, case variants
- Usernames: user@host, ~user, /home/user, C:\Users\user
- Phones: all common formats ((555) 123-4567, 555.123.4567, etc.)

Smart patterns run before explicit mappings, so explicit rules
can override smart catches when needed.

https://claude.ai/code/session_01Dvgwe7XMoSxnWXkih8p1Cw
This commit is contained in:
Claude
2026-03-25 23:52:37 +00:00
parent 7fe110d8fc
commit 387b22530b
7 changed files with 879 additions and 60 deletions
+20
View File
@@ -9,6 +9,7 @@ import api from './browser-polyfill.js';
const KEYS = {
MAPPINGS: 'ss_mappings',
IDENTITY: 'ss_identity',
LOG: 'ss_activity_log',
SETTINGS: 'ss_settings',
};
@@ -64,6 +65,25 @@ const Storage = {
await this.saveMappings(filtered);
},
// --- Identity (Smart Patterns) ---
async getIdentity() {
const result = await api.storage.local.get(KEYS.IDENTITY);
return result[KEYS.IDENTITY] || {
emails: [],
names: [],
usernames: [],
phones: [],
catchAllEmail: '',
emailDomains: [],
enabled: { emails: true, names: true, usernames: true, phones: true, paths: true },
};
},
async saveIdentity(identity) {
await api.storage.local.set({ [KEYS.IDENTITY]: identity });
},
// --- Activity Log ---
async getLog() {