@realtimex/email-automator 2.23.5 → 2.23.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/src/services/defaultRules/development.ts +123 -79
- package/api/src/services/defaultRules/emailOrg.ts +80 -93
- package/api/src/services/defaultRules/operations.ts +60 -88
- package/api/src/services/defaultRules/priority.ts +48 -76
- package/api/src/services/defaultRules/salesBusiness.ts +148 -34
- package/api/src/services/defaultRules/types.ts +1 -0
- package/dist/api/src/services/defaultRules/development.js +118 -79
- package/dist/api/src/services/defaultRules/emailOrg.js +75 -93
- package/dist/api/src/services/defaultRules/operations.js +57 -88
- package/dist/api/src/services/defaultRules/priority.js +46 -76
- package/dist/api/src/services/defaultRules/salesBusiness.js +142 -34
- package/dist/assets/{es-C53Z9pEQ.js → es-CUs1SbHI.js} +1 -1
- package/dist/assets/{fr-CTksqdvo.js → fr-BPxHcEwt.js} +1 -1
- package/dist/assets/{index-C1_s4TFc.js → index-DZQnqMV-.js} +20 -20
- package/dist/assets/index-DmS7wnaU.css +1 -0
- package/dist/assets/{ja-Dvm0bRM4.js → ja-DmCVk5Xs.js} +1 -1
- package/dist/assets/{ko-CgJQAwfF.js → ko-Hn7rPT_g.js} +1 -1
- package/dist/assets/{vi-mg0Gxysw.js → vi-DZcpqfWU.js} +1 -1
- package/dist/index.html +2 -2
- package/docs/FRESH_DEPLOYMENT_FIX.md +200 -0
- package/docs/MIGRATION_FIX_20260206.md +349 -0
- package/package.json +1 -1
- package/supabase/migrations/20260206000000_restore_rule_templates.sql +295 -0
- package/supabase/migrations/20260206000010_fix_trigger_naming_conflict.sql +214 -0
- package/supabase/migrations/20260206000011_add_rules_unique_constraint.sql +35 -0
- package/dist/assets/index-D4JdJS8Y.css +0 -1
|
@@ -2,134 +2,178 @@
|
|
|
2
2
|
* Development Rules
|
|
3
3
|
*
|
|
4
4
|
* Rules for software engineers and technical teams:
|
|
5
|
-
* -
|
|
6
|
-
* - CI/CD
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
5
|
+
* - GitHub mentions and assignments
|
|
6
|
+
* - CI/CD failure alerts
|
|
7
|
+
* - Dependabot cleanup
|
|
8
|
+
* - Code review tracking with draft automation
|
|
9
|
+
* - Monitoring alert cleanup
|
|
10
|
+
* - Weekly reports cleanup
|
|
9
11
|
*/
|
|
10
12
|
|
|
11
13
|
import { DefaultRule } from './types.js';
|
|
12
14
|
|
|
13
15
|
export const DEVELOPMENT_RULES: DefaultRule[] = [
|
|
16
|
+
// Rule 11: GitHub Mentions
|
|
14
17
|
{
|
|
15
|
-
id: '
|
|
18
|
+
id: 'dev-github-mentions',
|
|
16
19
|
category: 'development',
|
|
17
|
-
name: '
|
|
18
|
-
intent: '
|
|
19
|
-
description: '
|
|
20
|
+
name: '👤 GitHub Mentions',
|
|
21
|
+
intent: 'Keep mention and assignment notifications discoverable',
|
|
22
|
+
description: 'Labels GitHub mentions and assignments for tracking',
|
|
20
23
|
condition: {
|
|
21
|
-
|
|
24
|
+
and: [
|
|
22
25
|
{
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
or: [
|
|
27
|
+
{ category: 'notification' },
|
|
28
|
+
{ category: 'internal' }
|
|
29
|
+
]
|
|
25
30
|
},
|
|
31
|
+
{ contains_keywords: ['@', 'mentioned you', 'assigned you', 'requested your review'] },
|
|
26
32
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
sender_domain: 'sentry.io',
|
|
32
|
-
contains_keywords: ['new issue', 'regression', 'error']
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
sender_domain: 'pagerduty.com',
|
|
36
|
-
contains_keywords: ['triggered', 'incident']
|
|
33
|
+
or: [
|
|
34
|
+
{ sender_domain: 'github.com' },
|
|
35
|
+
{ sender_domain: 'gitlab.com' }
|
|
36
|
+
]
|
|
37
37
|
}
|
|
38
38
|
]
|
|
39
39
|
},
|
|
40
|
-
actions: ['
|
|
41
|
-
priority:
|
|
40
|
+
actions: ['label:GitHub/Mentions'],
|
|
41
|
+
priority: 80,
|
|
42
42
|
is_enabled_by_default: true
|
|
43
43
|
},
|
|
44
|
+
|
|
45
|
+
// Rule 12: CI/CD Failures
|
|
44
46
|
{
|
|
45
|
-
id: '
|
|
47
|
+
id: 'dev-ci-failures',
|
|
46
48
|
category: 'development',
|
|
47
|
-
name: '
|
|
48
|
-
intent: '
|
|
49
|
-
description: '
|
|
49
|
+
name: '❌ CI/CD Failures',
|
|
50
|
+
intent: 'Escalate build/deploy failures for faster recovery',
|
|
51
|
+
description: 'Stars CI/CD failure notifications for immediate attention',
|
|
50
52
|
condition: {
|
|
51
|
-
|
|
53
|
+
and: [
|
|
54
|
+
{ category: 'notification' },
|
|
55
|
+
{ contains_keywords: ['failed', 'failure', 'error', 'broken', 'build failed'] },
|
|
52
56
|
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
or: [
|
|
58
|
+
{ sender_domain: 'circleci.com' },
|
|
59
|
+
{ sender_domain: 'github.com' },
|
|
60
|
+
{ sender_domain: 'gitlab.com' },
|
|
61
|
+
{ sender_domain: 'travis-ci.com' }
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
actions: ['star', 'label:CI/Failures'],
|
|
67
|
+
priority: 90,
|
|
68
|
+
is_enabled_by_default: true
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
// Rule 13: Dependabot Noise
|
|
72
|
+
{
|
|
73
|
+
id: 'dev-dependabot',
|
|
74
|
+
category: 'development',
|
|
75
|
+
name: '🤖 Dependabot Noise',
|
|
76
|
+
intent: 'Reduce low-priority dependency update noise',
|
|
77
|
+
description: 'Deletes non-security Dependabot notifications older than 14 days',
|
|
78
|
+
condition: {
|
|
79
|
+
and: [
|
|
58
80
|
{
|
|
59
|
-
|
|
60
|
-
|
|
81
|
+
or: [
|
|
82
|
+
{ category: 'notification' },
|
|
83
|
+
{ category: 'newsletter' }
|
|
84
|
+
]
|
|
61
85
|
},
|
|
86
|
+
{ contains_keywords: ['dependabot', 'dependency', 'package update'] },
|
|
62
87
|
{
|
|
63
|
-
|
|
88
|
+
not: { contains_keywords: ['security', 'vulnerability', 'CVE'] }
|
|
64
89
|
},
|
|
65
|
-
{
|
|
66
|
-
sender_domain: 'github.com',
|
|
67
|
-
contains_keywords: ['build', 'workflow']
|
|
68
|
-
}
|
|
90
|
+
{ older_than_days: 14 }
|
|
69
91
|
]
|
|
70
92
|
},
|
|
71
|
-
actions: ['
|
|
72
|
-
priority:
|
|
93
|
+
actions: ['delete'],
|
|
94
|
+
priority: 15,
|
|
73
95
|
is_enabled_by_default: true
|
|
74
96
|
},
|
|
97
|
+
|
|
98
|
+
// Rule 14: Code Review Requests
|
|
75
99
|
{
|
|
76
|
-
id: '
|
|
100
|
+
id: 'dev-code-review',
|
|
77
101
|
category: 'development',
|
|
78
|
-
name: '
|
|
79
|
-
intent: '
|
|
80
|
-
description: '
|
|
102
|
+
name: '👀 Code Review Requests',
|
|
103
|
+
intent: 'Track review requests and draft quick acknowledgments',
|
|
104
|
+
description: 'Labels code review requests and drafts acknowledgment',
|
|
81
105
|
condition: {
|
|
82
|
-
|
|
106
|
+
and: [
|
|
83
107
|
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
108
|
+
or: [
|
|
109
|
+
{ category: 'internal' },
|
|
110
|
+
{ category: 'notification' }
|
|
111
|
+
]
|
|
88
112
|
},
|
|
113
|
+
{ contains_keywords: ['review requested', 'pull request', 'merge request', 'PR'] },
|
|
114
|
+
{ confidence_gt: 0.70 }
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
actions: ['label:GitHub/Review Requests', 'draft'],
|
|
118
|
+
instructions: 'Acknowledge review request. Provide estimated review timeline. Ask for context if needed.',
|
|
119
|
+
priority: 80,
|
|
120
|
+
is_enabled_by_default: true
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
// Rule 15: Monitoring Alerts
|
|
124
|
+
{
|
|
125
|
+
id: 'dev-monitoring',
|
|
126
|
+
category: 'development',
|
|
127
|
+
name: '⚠️ Monitoring Alerts',
|
|
128
|
+
intent: 'Tidy non-urgent monitoring alerts while keeping labels',
|
|
129
|
+
description: 'Labels and deletes non-urgent monitoring alerts older than 14 days',
|
|
130
|
+
condition: {
|
|
131
|
+
and: [
|
|
89
132
|
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
133
|
+
or: [
|
|
134
|
+
{ category: 'notification' },
|
|
135
|
+
{ category: 'support' }
|
|
136
|
+
]
|
|
94
137
|
},
|
|
95
138
|
{
|
|
96
|
-
|
|
97
|
-
not: {
|
|
98
|
-
contains_keywords: ['assigned to you']
|
|
99
|
-
}
|
|
139
|
+
not: { contains_keywords: ['critical', 'urgent', 'down', 'outage'] }
|
|
100
140
|
},
|
|
101
141
|
{
|
|
102
|
-
|
|
142
|
+
or: [
|
|
143
|
+
{ sender_domain: 'datadog.com' },
|
|
144
|
+
{ sender_domain: 'pingdom.com' },
|
|
145
|
+
{ sender_domain: 'sentry.io' }
|
|
146
|
+
]
|
|
103
147
|
},
|
|
104
|
-
{
|
|
105
|
-
sender_domain: 'monday.com'
|
|
106
|
-
}
|
|
148
|
+
{ older_than_days: 14 }
|
|
107
149
|
]
|
|
108
150
|
},
|
|
109
|
-
actions: ['label:
|
|
110
|
-
priority:
|
|
151
|
+
actions: ['label:Monitoring', 'delete'],
|
|
152
|
+
priority: 20,
|
|
111
153
|
is_enabled_by_default: true
|
|
112
154
|
},
|
|
155
|
+
|
|
156
|
+
// Rule 7: Weekly Reports
|
|
113
157
|
{
|
|
114
|
-
id: '
|
|
158
|
+
id: 'exec-reports',
|
|
115
159
|
category: 'development',
|
|
116
|
-
name: '
|
|
117
|
-
intent: '
|
|
118
|
-
description: '
|
|
160
|
+
name: '📊 Weekly Reports',
|
|
161
|
+
intent: 'Keep reports structured and remove stale report traffic',
|
|
162
|
+
description: 'Labels reports and deletes them after 30 days',
|
|
119
163
|
condition: {
|
|
120
|
-
|
|
164
|
+
and: [
|
|
121
165
|
{
|
|
122
|
-
|
|
123
|
-
|
|
166
|
+
or: [
|
|
167
|
+
{ category: 'internal' },
|
|
168
|
+
{ category: 'client' }
|
|
169
|
+
]
|
|
124
170
|
},
|
|
125
|
-
{
|
|
126
|
-
|
|
127
|
-
contains_keywords: ['review', 'merge request']
|
|
128
|
-
}
|
|
171
|
+
{ contains_keywords: ['weekly report', 'status report', 'metrics', 'dashboard'] },
|
|
172
|
+
{ older_than_days: 30 }
|
|
129
173
|
]
|
|
130
174
|
},
|
|
131
|
-
actions: ['
|
|
132
|
-
priority:
|
|
133
|
-
is_enabled_by_default:
|
|
175
|
+
actions: ['label:Reports', 'delete'],
|
|
176
|
+
priority: 10,
|
|
177
|
+
is_enabled_by_default: false
|
|
134
178
|
}
|
|
135
179
|
];
|
|
@@ -2,153 +2,140 @@
|
|
|
2
2
|
* Email Organization Rules
|
|
3
3
|
*
|
|
4
4
|
* Rules for keeping inbox clean through automated organization:
|
|
5
|
-
* - Newsletter
|
|
6
|
-
* - Cold outreach filtering
|
|
7
|
-
* - CC
|
|
5
|
+
* - Newsletter cleanup with age-based deletion
|
|
6
|
+
* - Cold outreach filtering with draft automation
|
|
7
|
+
* - CC organization
|
|
8
8
|
* - Receipt labeling
|
|
9
|
+
* - Social media noise reduction
|
|
10
|
+
* - Stack Overflow digest cleanup
|
|
9
11
|
*/
|
|
10
12
|
|
|
11
13
|
import { DefaultRule } from './types.js';
|
|
12
14
|
|
|
13
15
|
export const EMAIL_ORG_RULES: DefaultRule[] = [
|
|
16
|
+
// Rule 1: Newsletter Sweeper
|
|
14
17
|
{
|
|
15
|
-
id: 'newsletters
|
|
18
|
+
id: 'universal-newsletters',
|
|
16
19
|
category: 'email_organization',
|
|
17
20
|
name: '📚 Newsletter Sweeper',
|
|
18
|
-
intent: '
|
|
19
|
-
description: '
|
|
21
|
+
intent: 'Remove low-value newsletters/news updates from inbox after short retention',
|
|
22
|
+
description: 'Deletes newsletters and news digests older than 7 days to keep inbox clean',
|
|
20
23
|
condition: {
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
and: [
|
|
25
|
+
{
|
|
26
|
+
or: [
|
|
27
|
+
{ category: 'newsletter' },
|
|
28
|
+
{ category: 'news' }
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{ confidence_gt: 0.81 },
|
|
32
|
+
{ older_than_days: 7 }
|
|
33
|
+
]
|
|
23
34
|
},
|
|
24
|
-
actions: ['
|
|
35
|
+
actions: ['delete'],
|
|
25
36
|
priority: 10,
|
|
26
37
|
is_enabled_by_default: true
|
|
27
38
|
},
|
|
39
|
+
|
|
40
|
+
// Rule 2: Cold Outreach Filter
|
|
28
41
|
{
|
|
29
|
-
id: 'cold-outreach
|
|
42
|
+
id: 'universal-cold-outreach',
|
|
30
43
|
category: 'email_organization',
|
|
31
44
|
name: '❄️ Cold Outreach Filter',
|
|
32
|
-
intent: '
|
|
33
|
-
description: '
|
|
45
|
+
intent: 'Route cold outreach and prepare a polite response draft',
|
|
46
|
+
description: 'Labels cold outreach and generates polite decline/interest draft responses',
|
|
34
47
|
condition: {
|
|
35
|
-
|
|
48
|
+
and: [
|
|
36
49
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
or: [
|
|
51
|
+
{ category: 'promotional' },
|
|
52
|
+
{ category: 'client' }
|
|
53
|
+
]
|
|
41
54
|
},
|
|
42
|
-
{
|
|
43
|
-
|
|
44
|
-
category: 'spam',
|
|
45
|
-
confidence_gt: 0.9
|
|
46
|
-
}
|
|
55
|
+
{ recipient_type: 'bcc' },
|
|
56
|
+
{ confidence_gt: 0.70 }
|
|
47
57
|
]
|
|
48
58
|
},
|
|
49
|
-
actions: ['
|
|
59
|
+
actions: ['label:Sales/Cold Outreach', 'draft'],
|
|
60
|
+
instructions: 'Politely acknowledge the outreach. If not interested, thank them and decline. If potentially interested, ask for more details.',
|
|
50
61
|
priority: 20,
|
|
51
62
|
is_enabled_by_default: true
|
|
52
63
|
},
|
|
64
|
+
|
|
65
|
+
// Rule 3: CC Organizer
|
|
53
66
|
{
|
|
54
|
-
id: 'cc-
|
|
67
|
+
id: 'universal-cc-organizer',
|
|
55
68
|
category: 'email_organization',
|
|
56
|
-
name: '👀 CC
|
|
57
|
-
intent: '
|
|
58
|
-
description: '
|
|
69
|
+
name: '👀 CC Organizer',
|
|
70
|
+
intent: 'Label CC traffic for quick triage',
|
|
71
|
+
description: 'Labels emails where you are CC\'d for easier filtering and batch review',
|
|
59
72
|
condition: {
|
|
60
|
-
recipient_type: 'cc'
|
|
61
|
-
recipient_count_gt: 3 // Group emails (more than 3 recipients)
|
|
73
|
+
recipient_type: 'cc'
|
|
62
74
|
},
|
|
63
|
-
actions: ['
|
|
75
|
+
actions: ['label:CC'],
|
|
64
76
|
priority: 5,
|
|
65
77
|
is_enabled_by_default: true
|
|
66
78
|
},
|
|
79
|
+
|
|
80
|
+
// Rule 4: Receipt Organizer
|
|
67
81
|
{
|
|
68
|
-
id: 'receipts
|
|
82
|
+
id: 'universal-receipts',
|
|
69
83
|
category: 'email_organization',
|
|
70
84
|
name: '🧾 Receipt Organizer',
|
|
71
|
-
intent: '
|
|
72
|
-
description: 'Labels transactional emails (receipts, invoices
|
|
85
|
+
intent: 'Preserve receipts for tracing, audit, and tax filing',
|
|
86
|
+
description: 'Labels transactional emails (receipts, invoices) for easy searching and tax filing',
|
|
73
87
|
condition: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
88
|
+
and: [
|
|
89
|
+
{ category: 'transactional' },
|
|
90
|
+
{ confidence_gt: 0.90 },
|
|
91
|
+
{ contains_keywords: ['receipt', 'invoice', 'payment', 'order confirmation', 'purchase'] }
|
|
92
|
+
]
|
|
77
93
|
},
|
|
78
|
-
actions: ['label:
|
|
94
|
+
actions: ['label:Receipts'],
|
|
79
95
|
priority: 15,
|
|
80
96
|
is_enabled_by_default: true
|
|
81
97
|
},
|
|
98
|
+
|
|
99
|
+
// Rule 8: Social Noise
|
|
82
100
|
{
|
|
83
|
-
id: 'social
|
|
84
|
-
category: 'email_organization',
|
|
85
|
-
name: '🔔 Social Media Archiver',
|
|
86
|
-
intent: 'Archive social media notifications',
|
|
87
|
-
description: 'Automatically archives LinkedIn, Twitter, and other social notifications',
|
|
88
|
-
condition: {
|
|
89
|
-
category: 'social',
|
|
90
|
-
confidence_gt: 0.8
|
|
91
|
-
},
|
|
92
|
-
actions: ['archive'],
|
|
93
|
-
priority: 5,
|
|
94
|
-
is_enabled_by_default: true
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
id: 'calendar-responses-cleaner',
|
|
101
|
+
id: 'exec-social',
|
|
98
102
|
category: 'email_organization',
|
|
99
|
-
name: '
|
|
100
|
-
intent: '
|
|
101
|
-
description: 'Deletes
|
|
103
|
+
name: '🔔 Social Noise',
|
|
104
|
+
intent: 'Reduce social updates that do not require action',
|
|
105
|
+
description: 'Deletes social media notifications older than 7 days (LinkedIn, Twitter, etc.)',
|
|
102
106
|
condition: {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
and: [
|
|
108
|
+
{ category: 'social' },
|
|
109
|
+
{ confidence_gt: 0.81 },
|
|
110
|
+
{ older_than_days: 7 }
|
|
111
|
+
]
|
|
107
112
|
},
|
|
108
113
|
actions: ['delete'],
|
|
109
|
-
priority: 10,
|
|
110
|
-
is_enabled_by_default: false // Disabled by default - deletion is aggressive
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
id: 'drive-shares-organizer',
|
|
114
|
-
category: 'email_organization',
|
|
115
|
-
name: '📂 Drive Share Organizer',
|
|
116
|
-
intent: 'Archive Google Drive/Docs share notifications',
|
|
117
|
-
description: 'Archives notifications about shared documents (usually redundant)',
|
|
118
|
-
condition: {
|
|
119
|
-
sender_domain: 'google.com',
|
|
120
|
-
contains_keywords: ['shared', 'document', 'commented on', 'mentioned you in']
|
|
121
|
-
},
|
|
122
|
-
actions: ['label:Drive', 'archive'],
|
|
123
114
|
priority: 5,
|
|
124
115
|
is_enabled_by_default: true
|
|
125
116
|
},
|
|
117
|
+
|
|
118
|
+
// Rule 16: Stack Overflow Digests
|
|
126
119
|
{
|
|
127
|
-
id: '
|
|
120
|
+
id: 'dev-stack-overflow',
|
|
128
121
|
category: 'email_organization',
|
|
129
|
-
name: '
|
|
130
|
-
intent: '
|
|
131
|
-
description: '
|
|
122
|
+
name: '💻 Stack Overflow Digests',
|
|
123
|
+
intent: 'Remove stale Stack Overflow digests from inbox',
|
|
124
|
+
description: 'Deletes Stack Overflow digest emails older than 7 days',
|
|
132
125
|
condition: {
|
|
133
|
-
|
|
126
|
+
and: [
|
|
134
127
|
{
|
|
135
|
-
|
|
136
|
-
|
|
128
|
+
or: [
|
|
129
|
+
{ category: 'newsletter' },
|
|
130
|
+
{ category: 'news' }
|
|
131
|
+
]
|
|
137
132
|
},
|
|
138
|
-
{
|
|
139
|
-
|
|
140
|
-
contains_keywords: ['recording', 'teams recording']
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
sender_domain: 'fireflies.ai'
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
sender_domain: 'otter.ai'
|
|
147
|
-
}
|
|
133
|
+
{ contains_keywords: ['stack overflow', 'stackoverflow'] },
|
|
134
|
+
{ older_than_days: 7 }
|
|
148
135
|
]
|
|
149
136
|
},
|
|
150
|
-
actions: ['
|
|
151
|
-
priority:
|
|
152
|
-
is_enabled_by_default:
|
|
137
|
+
actions: ['delete'],
|
|
138
|
+
priority: 5,
|
|
139
|
+
is_enabled_by_default: false
|
|
153
140
|
}
|
|
154
141
|
];
|