@kbzowski/mcp-inbox 0.1.1 → 0.2.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/dist/cache/queries.d.ts +10 -0
- package/dist/imap/search.d.ts +28 -14
- package/dist/index.js +383 -91
- package/dist/index.js.map +4 -4
- package/dist/tools/emails/delete-multiple.d.ts +6 -0
- package/dist/tools/emails/mark-read-multiple.d.ts +9 -0
- package/dist/tools/emails/move-multiple.d.ts +6 -0
- package/dist/tools/emails/search-emails.d.ts +5 -0
- package/package.json +1 -1
package/dist/cache/queries.d.ts
CHANGED
|
@@ -39,6 +39,16 @@ export declare function countEmailsInFolder(db: CacheDb, folder: string): number
|
|
|
39
39
|
* a FLAGS update.
|
|
40
40
|
*/
|
|
41
41
|
export declare function setEmailFlags(db: CacheDb, folder: string, uid: number, flags: string[]): void;
|
|
42
|
+
/**
|
|
43
|
+
* Apply a flag-set mutation to each of the given UIDs. `mutate` receives
|
|
44
|
+
* the current flags and returns the new flags. Can't be a single SQL
|
|
45
|
+
* UPDATE because existing flags vary per row (we're adding/removing
|
|
46
|
+
* \Seen, not replacing). Wrapped in a transaction so either all rows
|
|
47
|
+
* update or none do.
|
|
48
|
+
*
|
|
49
|
+
* No-ops on empty UID list.
|
|
50
|
+
*/
|
|
51
|
+
export declare function mutateEmailFlagsForUids(db: CacheDb, folder: string, uids: number[], mutate: (current: string[]) => string[]): void;
|
|
42
52
|
/**
|
|
43
53
|
* Wipe every cached message in a folder. Invoked when UIDVALIDITY changes
|
|
44
54
|
* on the server - all our UIDs have been invalidated at once.
|
package/dist/imap/search.d.ts
CHANGED
|
@@ -2,27 +2,41 @@ import type { SearchObject } from 'imapflow';
|
|
|
2
2
|
/**
|
|
3
3
|
* Typed IMAP search criteria, produced by our Zod-validated tool inputs.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* Recursive via `or` and `not`: tools can build `{subject, or: [{from}, {from}]}`
|
|
6
|
+
* which maps to `subject=X AND (from=a OR from=b)` at the IMAP layer.
|
|
7
|
+
*
|
|
8
|
+
* The type stays narrower than ImapFlow's full `SearchObject` - we don't
|
|
9
|
+
* expose modseq, Gmail extensions, or custom keywords yet.
|
|
9
10
|
*/
|
|
10
11
|
export interface EmailSearchCriteria {
|
|
11
|
-
subject?: string;
|
|
12
|
-
from?: string;
|
|
13
|
-
to?: string;
|
|
14
|
-
body?: string;
|
|
12
|
+
subject?: string | undefined;
|
|
13
|
+
from?: string | undefined;
|
|
14
|
+
to?: string | undefined;
|
|
15
|
+
body?: string | undefined;
|
|
15
16
|
/** If true, only messages without `\Seen`. If undefined/false, no filter. */
|
|
16
|
-
unseen?: boolean;
|
|
17
|
-
/** Only messages received on/after this date
|
|
18
|
-
since?: Date;
|
|
17
|
+
unseen?: boolean | undefined;
|
|
18
|
+
/** Only messages received on/after this date. */
|
|
19
|
+
since?: Date | undefined;
|
|
19
20
|
/** Only messages received before this date. */
|
|
20
|
-
before?: Date;
|
|
21
|
+
before?: Date | undefined;
|
|
22
|
+
/** Only messages larger than this many bytes. */
|
|
23
|
+
larger_than_bytes?: number | undefined;
|
|
24
|
+
/** Only messages smaller than this many bytes. */
|
|
25
|
+
smaller_than_bytes?: number | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Array of sub-criteria (>=2); at least one must match. Maps to IMAP OR.
|
|
28
|
+
* IMAP OR is strictly binary on the wire but ImapFlow unrolls arrays
|
|
29
|
+
* for us, so `or: [a, b, c]` works as (a OR b OR c).
|
|
30
|
+
*/
|
|
31
|
+
or?: EmailSearchCriteria[] | undefined;
|
|
32
|
+
/** Sub-criteria that must NOT match. Maps to IMAP NOT. */
|
|
33
|
+
not?: EmailSearchCriteria | undefined;
|
|
21
34
|
}
|
|
22
35
|
/**
|
|
23
36
|
* Convert our typed criteria into ImapFlow's `SearchObject`.
|
|
24
37
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
38
|
+
* Recurses into `or` and `not` so full boolean trees survive the
|
|
39
|
+
* translation. Empty criteria objects yield `{ all: true }`, matching
|
|
40
|
+
* every message - preserves the old behavior when no filters are set.
|
|
27
41
|
*/
|
|
28
42
|
export declare function buildImapSearch(c: EmailSearchCriteria): SearchObject;
|