@kbzowski/mcp-inbox 0.1.0
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/LICENSE +21 -0
- package/README.md +396 -0
- package/dist/cache/db.d.ts +34 -0
- package/dist/cache/idle.d.ts +32 -0
- package/dist/cache/queries.d.ts +66 -0
- package/dist/cache/schema.d.ts +456 -0
- package/dist/cache/sync.d.ts +38 -0
- package/dist/config/env.d.ts +103 -0
- package/dist/errors/mapper.d.ts +10 -0
- package/dist/errors/types.d.ts +25 -0
- package/dist/formatters/markdown.d.ts +13 -0
- package/dist/imap/client.d.ts +37 -0
- package/dist/imap/folders.d.ts +19 -0
- package/dist/imap/mime-builder.d.ts +32 -0
- package/dist/imap/search.d.ts +28 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2572 -0
- package/dist/index.js.map +7 -0
- package/dist/migrations/0000_mean_the_santerians.sql +49 -0
- package/dist/migrations/0001_wooden_doomsday.sql +2 -0
- package/dist/migrations/meta/0000_snapshot.json +337 -0
- package/dist/migrations/meta/0001_snapshot.json +224 -0
- package/dist/migrations/meta/_journal.json +20 -0
- package/dist/server.d.ts +8 -0
- package/dist/smtp/client.d.ts +28 -0
- package/dist/tools/attachments/get-attachment.d.ts +43 -0
- package/dist/tools/define-tool.d.ts +61 -0
- package/dist/tools/drafts/create-draft.d.ts +11 -0
- package/dist/tools/drafts/get-draft.d.ts +10 -0
- package/dist/tools/drafts/list-drafts.d.ts +11 -0
- package/dist/tools/drafts/update-draft.d.ts +12 -0
- package/dist/tools/emails/delete-email.d.ts +6 -0
- package/dist/tools/emails/get-email.d.ts +10 -0
- package/dist/tools/emails/list-emails.d.ts +14 -0
- package/dist/tools/emails/mark-read.d.ts +9 -0
- package/dist/tools/emails/move-to-folder.d.ts +6 -0
- package/dist/tools/emails/search-emails.d.ts +17 -0
- package/dist/tools/emails/shared.d.ts +74 -0
- package/dist/tools/folders/list-folders.d.ts +7 -0
- package/dist/tools/registry.d.ts +21 -0
- package/dist/tools/send/forward.d.ts +11 -0
- package/dist/tools/send/reply.d.ts +12 -0
- package/dist/tools/send/send-draft.d.ts +5 -0
- package/dist/tools/send/send-email.d.ts +10 -0
- package/dist/tools/send/shared.d.ts +40 -0
- package/dist/utils/logger.d.ts +40 -0
- package/package.json +90 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"id": "6d8be2d7-0b69-4e1e-ad65-d6b70945ccdc",
|
|
5
|
+
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
6
|
+
"tables": {
|
|
7
|
+
"attachments": {
|
|
8
|
+
"name": "attachments",
|
|
9
|
+
"columns": {
|
|
10
|
+
"sha256": {
|
|
11
|
+
"name": "sha256",
|
|
12
|
+
"type": "text",
|
|
13
|
+
"primaryKey": true,
|
|
14
|
+
"notNull": true,
|
|
15
|
+
"autoincrement": false
|
|
16
|
+
},
|
|
17
|
+
"filename": {
|
|
18
|
+
"name": "filename",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true,
|
|
22
|
+
"autoincrement": false
|
|
23
|
+
},
|
|
24
|
+
"content_type": {
|
|
25
|
+
"name": "content_type",
|
|
26
|
+
"type": "text",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": false,
|
|
29
|
+
"autoincrement": false
|
|
30
|
+
},
|
|
31
|
+
"size_bytes": {
|
|
32
|
+
"name": "size_bytes",
|
|
33
|
+
"type": "integer",
|
|
34
|
+
"primaryKey": false,
|
|
35
|
+
"notNull": true,
|
|
36
|
+
"autoincrement": false
|
|
37
|
+
},
|
|
38
|
+
"file_path": {
|
|
39
|
+
"name": "file_path",
|
|
40
|
+
"type": "text",
|
|
41
|
+
"primaryKey": false,
|
|
42
|
+
"notNull": true,
|
|
43
|
+
"autoincrement": false
|
|
44
|
+
},
|
|
45
|
+
"first_seen_at": {
|
|
46
|
+
"name": "first_seen_at",
|
|
47
|
+
"type": "integer",
|
|
48
|
+
"primaryKey": false,
|
|
49
|
+
"notNull": true,
|
|
50
|
+
"autoincrement": false
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"indexes": {},
|
|
54
|
+
"foreignKeys": {},
|
|
55
|
+
"compositePrimaryKeys": {},
|
|
56
|
+
"uniqueConstraints": {},
|
|
57
|
+
"checkConstraints": {}
|
|
58
|
+
},
|
|
59
|
+
"email_attachments": {
|
|
60
|
+
"name": "email_attachments",
|
|
61
|
+
"columns": {
|
|
62
|
+
"folder": {
|
|
63
|
+
"name": "folder",
|
|
64
|
+
"type": "text",
|
|
65
|
+
"primaryKey": false,
|
|
66
|
+
"notNull": true,
|
|
67
|
+
"autoincrement": false
|
|
68
|
+
},
|
|
69
|
+
"uid": {
|
|
70
|
+
"name": "uid",
|
|
71
|
+
"type": "integer",
|
|
72
|
+
"primaryKey": false,
|
|
73
|
+
"notNull": true,
|
|
74
|
+
"autoincrement": false
|
|
75
|
+
},
|
|
76
|
+
"part_id": {
|
|
77
|
+
"name": "part_id",
|
|
78
|
+
"type": "text",
|
|
79
|
+
"primaryKey": false,
|
|
80
|
+
"notNull": true,
|
|
81
|
+
"autoincrement": false
|
|
82
|
+
},
|
|
83
|
+
"sha256": {
|
|
84
|
+
"name": "sha256",
|
|
85
|
+
"type": "text",
|
|
86
|
+
"primaryKey": false,
|
|
87
|
+
"notNull": true,
|
|
88
|
+
"autoincrement": false
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"indexes": {},
|
|
92
|
+
"foreignKeys": {
|
|
93
|
+
"email_attachments_sha256_attachments_sha256_fk": {
|
|
94
|
+
"name": "email_attachments_sha256_attachments_sha256_fk",
|
|
95
|
+
"tableFrom": "email_attachments",
|
|
96
|
+
"tableTo": "attachments",
|
|
97
|
+
"columnsFrom": [
|
|
98
|
+
"sha256"
|
|
99
|
+
],
|
|
100
|
+
"columnsTo": [
|
|
101
|
+
"sha256"
|
|
102
|
+
],
|
|
103
|
+
"onDelete": "no action",
|
|
104
|
+
"onUpdate": "no action"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"compositePrimaryKeys": {
|
|
108
|
+
"email_attachments_folder_uid_part_id_pk": {
|
|
109
|
+
"columns": [
|
|
110
|
+
"folder",
|
|
111
|
+
"uid",
|
|
112
|
+
"part_id"
|
|
113
|
+
],
|
|
114
|
+
"name": "email_attachments_folder_uid_part_id_pk"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"uniqueConstraints": {},
|
|
118
|
+
"checkConstraints": {}
|
|
119
|
+
},
|
|
120
|
+
"emails": {
|
|
121
|
+
"name": "emails",
|
|
122
|
+
"columns": {
|
|
123
|
+
"folder": {
|
|
124
|
+
"name": "folder",
|
|
125
|
+
"type": "text",
|
|
126
|
+
"primaryKey": false,
|
|
127
|
+
"notNull": true,
|
|
128
|
+
"autoincrement": false
|
|
129
|
+
},
|
|
130
|
+
"uid": {
|
|
131
|
+
"name": "uid",
|
|
132
|
+
"type": "integer",
|
|
133
|
+
"primaryKey": false,
|
|
134
|
+
"notNull": true,
|
|
135
|
+
"autoincrement": false
|
|
136
|
+
},
|
|
137
|
+
"message_id": {
|
|
138
|
+
"name": "message_id",
|
|
139
|
+
"type": "text",
|
|
140
|
+
"primaryKey": false,
|
|
141
|
+
"notNull": false,
|
|
142
|
+
"autoincrement": false
|
|
143
|
+
},
|
|
144
|
+
"subject": {
|
|
145
|
+
"name": "subject",
|
|
146
|
+
"type": "text",
|
|
147
|
+
"primaryKey": false,
|
|
148
|
+
"notNull": false,
|
|
149
|
+
"autoincrement": false
|
|
150
|
+
},
|
|
151
|
+
"from_addr": {
|
|
152
|
+
"name": "from_addr",
|
|
153
|
+
"type": "text",
|
|
154
|
+
"primaryKey": false,
|
|
155
|
+
"notNull": false,
|
|
156
|
+
"autoincrement": false
|
|
157
|
+
},
|
|
158
|
+
"to_addrs": {
|
|
159
|
+
"name": "to_addrs",
|
|
160
|
+
"type": "text",
|
|
161
|
+
"primaryKey": false,
|
|
162
|
+
"notNull": false,
|
|
163
|
+
"autoincrement": false
|
|
164
|
+
},
|
|
165
|
+
"cc_addrs": {
|
|
166
|
+
"name": "cc_addrs",
|
|
167
|
+
"type": "text",
|
|
168
|
+
"primaryKey": false,
|
|
169
|
+
"notNull": false,
|
|
170
|
+
"autoincrement": false
|
|
171
|
+
},
|
|
172
|
+
"date": {
|
|
173
|
+
"name": "date",
|
|
174
|
+
"type": "integer",
|
|
175
|
+
"primaryKey": false,
|
|
176
|
+
"notNull": false,
|
|
177
|
+
"autoincrement": false
|
|
178
|
+
},
|
|
179
|
+
"flags": {
|
|
180
|
+
"name": "flags",
|
|
181
|
+
"type": "text",
|
|
182
|
+
"primaryKey": false,
|
|
183
|
+
"notNull": true,
|
|
184
|
+
"autoincrement": false
|
|
185
|
+
},
|
|
186
|
+
"has_attachments": {
|
|
187
|
+
"name": "has_attachments",
|
|
188
|
+
"type": "integer",
|
|
189
|
+
"primaryKey": false,
|
|
190
|
+
"notNull": true,
|
|
191
|
+
"autoincrement": false,
|
|
192
|
+
"default": false
|
|
193
|
+
},
|
|
194
|
+
"envelope_json": {
|
|
195
|
+
"name": "envelope_json",
|
|
196
|
+
"type": "text",
|
|
197
|
+
"primaryKey": false,
|
|
198
|
+
"notNull": true,
|
|
199
|
+
"autoincrement": false
|
|
200
|
+
},
|
|
201
|
+
"body_text": {
|
|
202
|
+
"name": "body_text",
|
|
203
|
+
"type": "text",
|
|
204
|
+
"primaryKey": false,
|
|
205
|
+
"notNull": false,
|
|
206
|
+
"autoincrement": false
|
|
207
|
+
},
|
|
208
|
+
"body_html": {
|
|
209
|
+
"name": "body_html",
|
|
210
|
+
"type": "text",
|
|
211
|
+
"primaryKey": false,
|
|
212
|
+
"notNull": false,
|
|
213
|
+
"autoincrement": false
|
|
214
|
+
},
|
|
215
|
+
"modseq": {
|
|
216
|
+
"name": "modseq",
|
|
217
|
+
"type": "integer",
|
|
218
|
+
"primaryKey": false,
|
|
219
|
+
"notNull": false,
|
|
220
|
+
"autoincrement": false
|
|
221
|
+
},
|
|
222
|
+
"cached_at": {
|
|
223
|
+
"name": "cached_at",
|
|
224
|
+
"type": "integer",
|
|
225
|
+
"primaryKey": false,
|
|
226
|
+
"notNull": true,
|
|
227
|
+
"autoincrement": false
|
|
228
|
+
},
|
|
229
|
+
"body_cached_at": {
|
|
230
|
+
"name": "body_cached_at",
|
|
231
|
+
"type": "integer",
|
|
232
|
+
"primaryKey": false,
|
|
233
|
+
"notNull": false,
|
|
234
|
+
"autoincrement": false
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"indexes": {
|
|
238
|
+
"idx_emails_date": {
|
|
239
|
+
"name": "idx_emails_date",
|
|
240
|
+
"columns": [
|
|
241
|
+
"folder",
|
|
242
|
+
"date"
|
|
243
|
+
],
|
|
244
|
+
"isUnique": false
|
|
245
|
+
},
|
|
246
|
+
"idx_emails_message_id": {
|
|
247
|
+
"name": "idx_emails_message_id",
|
|
248
|
+
"columns": [
|
|
249
|
+
"message_id"
|
|
250
|
+
],
|
|
251
|
+
"isUnique": false
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"foreignKeys": {},
|
|
255
|
+
"compositePrimaryKeys": {
|
|
256
|
+
"emails_folder_uid_pk": {
|
|
257
|
+
"columns": [
|
|
258
|
+
"folder",
|
|
259
|
+
"uid"
|
|
260
|
+
],
|
|
261
|
+
"name": "emails_folder_uid_pk"
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"uniqueConstraints": {},
|
|
265
|
+
"checkConstraints": {}
|
|
266
|
+
},
|
|
267
|
+
"folders": {
|
|
268
|
+
"name": "folders",
|
|
269
|
+
"columns": {
|
|
270
|
+
"name": {
|
|
271
|
+
"name": "name",
|
|
272
|
+
"type": "text",
|
|
273
|
+
"primaryKey": true,
|
|
274
|
+
"notNull": true,
|
|
275
|
+
"autoincrement": false
|
|
276
|
+
},
|
|
277
|
+
"delimiter": {
|
|
278
|
+
"name": "delimiter",
|
|
279
|
+
"type": "text",
|
|
280
|
+
"primaryKey": false,
|
|
281
|
+
"notNull": true,
|
|
282
|
+
"autoincrement": false
|
|
283
|
+
},
|
|
284
|
+
"special_use": {
|
|
285
|
+
"name": "special_use",
|
|
286
|
+
"type": "text",
|
|
287
|
+
"primaryKey": false,
|
|
288
|
+
"notNull": false,
|
|
289
|
+
"autoincrement": false
|
|
290
|
+
},
|
|
291
|
+
"uid_validity": {
|
|
292
|
+
"name": "uid_validity",
|
|
293
|
+
"type": "integer",
|
|
294
|
+
"primaryKey": false,
|
|
295
|
+
"notNull": true,
|
|
296
|
+
"autoincrement": false
|
|
297
|
+
},
|
|
298
|
+
"uid_next": {
|
|
299
|
+
"name": "uid_next",
|
|
300
|
+
"type": "integer",
|
|
301
|
+
"primaryKey": false,
|
|
302
|
+
"notNull": false,
|
|
303
|
+
"autoincrement": false
|
|
304
|
+
},
|
|
305
|
+
"highest_modseq": {
|
|
306
|
+
"name": "highest_modseq",
|
|
307
|
+
"type": "integer",
|
|
308
|
+
"primaryKey": false,
|
|
309
|
+
"notNull": false,
|
|
310
|
+
"autoincrement": false
|
|
311
|
+
},
|
|
312
|
+
"last_synced_at": {
|
|
313
|
+
"name": "last_synced_at",
|
|
314
|
+
"type": "integer",
|
|
315
|
+
"primaryKey": false,
|
|
316
|
+
"notNull": true,
|
|
317
|
+
"autoincrement": false
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"indexes": {},
|
|
321
|
+
"foreignKeys": {},
|
|
322
|
+
"compositePrimaryKeys": {},
|
|
323
|
+
"uniqueConstraints": {},
|
|
324
|
+
"checkConstraints": {}
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"views": {},
|
|
328
|
+
"enums": {},
|
|
329
|
+
"_meta": {
|
|
330
|
+
"schemas": {},
|
|
331
|
+
"tables": {},
|
|
332
|
+
"columns": {}
|
|
333
|
+
},
|
|
334
|
+
"internal": {
|
|
335
|
+
"indexes": {}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"id": "8f93160d-d573-4bb8-b00f-fbf58511619e",
|
|
5
|
+
"prevId": "6d8be2d7-0b69-4e1e-ad65-d6b70945ccdc",
|
|
6
|
+
"tables": {
|
|
7
|
+
"emails": {
|
|
8
|
+
"name": "emails",
|
|
9
|
+
"columns": {
|
|
10
|
+
"folder": {
|
|
11
|
+
"name": "folder",
|
|
12
|
+
"type": "text",
|
|
13
|
+
"primaryKey": false,
|
|
14
|
+
"notNull": true,
|
|
15
|
+
"autoincrement": false
|
|
16
|
+
},
|
|
17
|
+
"uid": {
|
|
18
|
+
"name": "uid",
|
|
19
|
+
"type": "integer",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true,
|
|
22
|
+
"autoincrement": false
|
|
23
|
+
},
|
|
24
|
+
"message_id": {
|
|
25
|
+
"name": "message_id",
|
|
26
|
+
"type": "text",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": false,
|
|
29
|
+
"autoincrement": false
|
|
30
|
+
},
|
|
31
|
+
"subject": {
|
|
32
|
+
"name": "subject",
|
|
33
|
+
"type": "text",
|
|
34
|
+
"primaryKey": false,
|
|
35
|
+
"notNull": false,
|
|
36
|
+
"autoincrement": false
|
|
37
|
+
},
|
|
38
|
+
"from_addr": {
|
|
39
|
+
"name": "from_addr",
|
|
40
|
+
"type": "text",
|
|
41
|
+
"primaryKey": false,
|
|
42
|
+
"notNull": false,
|
|
43
|
+
"autoincrement": false
|
|
44
|
+
},
|
|
45
|
+
"to_addrs": {
|
|
46
|
+
"name": "to_addrs",
|
|
47
|
+
"type": "text",
|
|
48
|
+
"primaryKey": false,
|
|
49
|
+
"notNull": false,
|
|
50
|
+
"autoincrement": false
|
|
51
|
+
},
|
|
52
|
+
"cc_addrs": {
|
|
53
|
+
"name": "cc_addrs",
|
|
54
|
+
"type": "text",
|
|
55
|
+
"primaryKey": false,
|
|
56
|
+
"notNull": false,
|
|
57
|
+
"autoincrement": false
|
|
58
|
+
},
|
|
59
|
+
"date": {
|
|
60
|
+
"name": "date",
|
|
61
|
+
"type": "integer",
|
|
62
|
+
"primaryKey": false,
|
|
63
|
+
"notNull": false,
|
|
64
|
+
"autoincrement": false
|
|
65
|
+
},
|
|
66
|
+
"flags": {
|
|
67
|
+
"name": "flags",
|
|
68
|
+
"type": "text",
|
|
69
|
+
"primaryKey": false,
|
|
70
|
+
"notNull": true,
|
|
71
|
+
"autoincrement": false
|
|
72
|
+
},
|
|
73
|
+
"has_attachments": {
|
|
74
|
+
"name": "has_attachments",
|
|
75
|
+
"type": "integer",
|
|
76
|
+
"primaryKey": false,
|
|
77
|
+
"notNull": true,
|
|
78
|
+
"autoincrement": false,
|
|
79
|
+
"default": false
|
|
80
|
+
},
|
|
81
|
+
"envelope_json": {
|
|
82
|
+
"name": "envelope_json",
|
|
83
|
+
"type": "text",
|
|
84
|
+
"primaryKey": false,
|
|
85
|
+
"notNull": true,
|
|
86
|
+
"autoincrement": false
|
|
87
|
+
},
|
|
88
|
+
"body_text": {
|
|
89
|
+
"name": "body_text",
|
|
90
|
+
"type": "text",
|
|
91
|
+
"primaryKey": false,
|
|
92
|
+
"notNull": false,
|
|
93
|
+
"autoincrement": false
|
|
94
|
+
},
|
|
95
|
+
"body_html": {
|
|
96
|
+
"name": "body_html",
|
|
97
|
+
"type": "text",
|
|
98
|
+
"primaryKey": false,
|
|
99
|
+
"notNull": false,
|
|
100
|
+
"autoincrement": false
|
|
101
|
+
},
|
|
102
|
+
"modseq": {
|
|
103
|
+
"name": "modseq",
|
|
104
|
+
"type": "integer",
|
|
105
|
+
"primaryKey": false,
|
|
106
|
+
"notNull": false,
|
|
107
|
+
"autoincrement": false
|
|
108
|
+
},
|
|
109
|
+
"cached_at": {
|
|
110
|
+
"name": "cached_at",
|
|
111
|
+
"type": "integer",
|
|
112
|
+
"primaryKey": false,
|
|
113
|
+
"notNull": true,
|
|
114
|
+
"autoincrement": false
|
|
115
|
+
},
|
|
116
|
+
"body_cached_at": {
|
|
117
|
+
"name": "body_cached_at",
|
|
118
|
+
"type": "integer",
|
|
119
|
+
"primaryKey": false,
|
|
120
|
+
"notNull": false,
|
|
121
|
+
"autoincrement": false
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"indexes": {
|
|
125
|
+
"idx_emails_date": {
|
|
126
|
+
"name": "idx_emails_date",
|
|
127
|
+
"columns": [
|
|
128
|
+
"folder",
|
|
129
|
+
"date"
|
|
130
|
+
],
|
|
131
|
+
"isUnique": false
|
|
132
|
+
},
|
|
133
|
+
"idx_emails_message_id": {
|
|
134
|
+
"name": "idx_emails_message_id",
|
|
135
|
+
"columns": [
|
|
136
|
+
"message_id"
|
|
137
|
+
],
|
|
138
|
+
"isUnique": false
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"foreignKeys": {},
|
|
142
|
+
"compositePrimaryKeys": {
|
|
143
|
+
"emails_folder_uid_pk": {
|
|
144
|
+
"columns": [
|
|
145
|
+
"folder",
|
|
146
|
+
"uid"
|
|
147
|
+
],
|
|
148
|
+
"name": "emails_folder_uid_pk"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"uniqueConstraints": {},
|
|
152
|
+
"checkConstraints": {}
|
|
153
|
+
},
|
|
154
|
+
"folders": {
|
|
155
|
+
"name": "folders",
|
|
156
|
+
"columns": {
|
|
157
|
+
"name": {
|
|
158
|
+
"name": "name",
|
|
159
|
+
"type": "text",
|
|
160
|
+
"primaryKey": true,
|
|
161
|
+
"notNull": true,
|
|
162
|
+
"autoincrement": false
|
|
163
|
+
},
|
|
164
|
+
"delimiter": {
|
|
165
|
+
"name": "delimiter",
|
|
166
|
+
"type": "text",
|
|
167
|
+
"primaryKey": false,
|
|
168
|
+
"notNull": true,
|
|
169
|
+
"autoincrement": false
|
|
170
|
+
},
|
|
171
|
+
"special_use": {
|
|
172
|
+
"name": "special_use",
|
|
173
|
+
"type": "text",
|
|
174
|
+
"primaryKey": false,
|
|
175
|
+
"notNull": false,
|
|
176
|
+
"autoincrement": false
|
|
177
|
+
},
|
|
178
|
+
"uid_validity": {
|
|
179
|
+
"name": "uid_validity",
|
|
180
|
+
"type": "integer",
|
|
181
|
+
"primaryKey": false,
|
|
182
|
+
"notNull": true,
|
|
183
|
+
"autoincrement": false
|
|
184
|
+
},
|
|
185
|
+
"uid_next": {
|
|
186
|
+
"name": "uid_next",
|
|
187
|
+
"type": "integer",
|
|
188
|
+
"primaryKey": false,
|
|
189
|
+
"notNull": false,
|
|
190
|
+
"autoincrement": false
|
|
191
|
+
},
|
|
192
|
+
"highest_modseq": {
|
|
193
|
+
"name": "highest_modseq",
|
|
194
|
+
"type": "integer",
|
|
195
|
+
"primaryKey": false,
|
|
196
|
+
"notNull": false,
|
|
197
|
+
"autoincrement": false
|
|
198
|
+
},
|
|
199
|
+
"last_synced_at": {
|
|
200
|
+
"name": "last_synced_at",
|
|
201
|
+
"type": "integer",
|
|
202
|
+
"primaryKey": false,
|
|
203
|
+
"notNull": true,
|
|
204
|
+
"autoincrement": false
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"indexes": {},
|
|
208
|
+
"foreignKeys": {},
|
|
209
|
+
"compositePrimaryKeys": {},
|
|
210
|
+
"uniqueConstraints": {},
|
|
211
|
+
"checkConstraints": {}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"views": {},
|
|
215
|
+
"enums": {},
|
|
216
|
+
"_meta": {
|
|
217
|
+
"schemas": {},
|
|
218
|
+
"tables": {},
|
|
219
|
+
"columns": {}
|
|
220
|
+
},
|
|
221
|
+
"internal": {
|
|
222
|
+
"indexes": {}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "7",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"entries": [
|
|
5
|
+
{
|
|
6
|
+
"idx": 0,
|
|
7
|
+
"version": "6",
|
|
8
|
+
"when": 1776412498344,
|
|
9
|
+
"tag": "0000_mean_the_santerians",
|
|
10
|
+
"breakpoints": true
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"idx": 1,
|
|
14
|
+
"version": "6",
|
|
15
|
+
"when": 1776420972250,
|
|
16
|
+
"tag": "0001_wooden_doomsday",
|
|
17
|
+
"breakpoints": true
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import type { ToolContext } from './tools/define-tool';
|
|
3
|
+
/**
|
|
4
|
+
* Create the MCP Server instance and wire its request handlers to the
|
|
5
|
+
* tool registry. The `ctx` is captured in a closure so handlers can
|
|
6
|
+
* resolve the live DB / IMAP / config without a hidden singleton.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createMcpServer(ctx: ToolContext): Server;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Transporter } from 'nodemailer';
|
|
2
|
+
import type { AppConfig } from '../config/env';
|
|
3
|
+
/**
|
|
4
|
+
* Thin SMTP client that lazily creates a nodemailer transporter on first
|
|
5
|
+
* use. Reusing one transporter across calls saves the TLS handshake on
|
|
6
|
+
* every message - same optimization as ImapClient does for IMAP.
|
|
7
|
+
*
|
|
8
|
+
* Kept deliberately minimal: no send queue, no retry logic. Failures
|
|
9
|
+
* surface as SmtpError via the error mapper; callers decide what to do.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SmtpClient {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(config: AppConfig['smtp']);
|
|
14
|
+
transporter(): Transporter;
|
|
15
|
+
/**
|
|
16
|
+
* Send a pre-built raw RFC 2822 message. Uses the explicit envelope
|
|
17
|
+
* to avoid relying on header parsing - the envelope from/to are
|
|
18
|
+
* what actually drive SMTP delivery.
|
|
19
|
+
*/
|
|
20
|
+
sendRaw(raw: Buffer, envelope: {
|
|
21
|
+
from: string;
|
|
22
|
+
to: string[];
|
|
23
|
+
}): Promise<{
|
|
24
|
+
messageId: string | null;
|
|
25
|
+
response: string;
|
|
26
|
+
}>;
|
|
27
|
+
close(): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { MessageStructureObject } from 'imapflow';
|
|
3
|
+
/**
|
|
4
|
+
* Transient attachment download.
|
|
5
|
+
*
|
|
6
|
+
* Explicit non-goals:
|
|
7
|
+
* - No persistent on-disk cache. Bytes live in memory for the
|
|
8
|
+
* duration of the response and nowhere else.
|
|
9
|
+
* - No reuse across calls. Re-requesting the same attachment refetches
|
|
10
|
+
* from the server. This is the honest tradeoff for privacy; the
|
|
11
|
+
* cost is one IMAP round-trip per access, which is fine for the
|
|
12
|
+
* actual use case (agent processes the attachment once, done).
|
|
13
|
+
*
|
|
14
|
+
* Implementation note: we fetch the whole raw source and let mailparser
|
|
15
|
+
* walk the MIME tree. Part-by-part IMAP fetches (BODY[n]) sound cheaper
|
|
16
|
+
* but are flakier in practice - different servers number multipart
|
|
17
|
+
* containers differently, and some (including GreenMail) return empty
|
|
18
|
+
* downloads for certain part shapes. One round-trip + trusted parser
|
|
19
|
+
* beats two round-trips and server-specific edge cases.
|
|
20
|
+
*/
|
|
21
|
+
export declare const getAttachmentTool: import("../define-tool").ToolDefinition<z.ZodObject<{
|
|
22
|
+
folder: z.ZodString;
|
|
23
|
+
uid: z.ZodNumber;
|
|
24
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
25
|
+
part_id: z.ZodOptional<z.ZodString>;
|
|
26
|
+
max_inline_mb: z.ZodDefault<z.ZodNumber>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
interface AttachmentMatch {
|
|
29
|
+
partId: string;
|
|
30
|
+
filename: string | undefined;
|
|
31
|
+
contentType: string | undefined;
|
|
32
|
+
size: number | undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Walk a MessageStructureObject tree to find the first part matching
|
|
36
|
+
* the caller's selector. Used to decide whether to even bother with
|
|
37
|
+
* the download, based on the server-reported size.
|
|
38
|
+
*/
|
|
39
|
+
export declare function findAttachmentPart(structure: MessageStructureObject, selector: {
|
|
40
|
+
filename?: string;
|
|
41
|
+
part_id?: string;
|
|
42
|
+
}): AttachmentMatch | null;
|
|
43
|
+
export {};
|