@rndmjoker/proton-mcp 0.4.4
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 +20 -0
- package/README.md +405 -0
- package/dist/activity.d.ts +49 -0
- package/dist/activity.js +72 -0
- package/dist/activity.js.map +1 -0
- package/dist/bridge/certificate.d.ts +75 -0
- package/dist/bridge/certificate.js +176 -0
- package/dist/bridge/certificate.js.map +1 -0
- package/dist/bridge/connection.d.ts +99 -0
- package/dist/bridge/connection.js +244 -0
- package/dist/bridge/connection.js.map +1 -0
- package/dist/bridge/errors.d.ts +35 -0
- package/dist/bridge/errors.js +56 -0
- package/dist/bridge/errors.js.map +1 -0
- package/dist/config.d.ts +92 -0
- package/dist/config.js +142 -0
- package/dist/config.js.map +1 -0
- package/dist/credentials/availability.d.ts +62 -0
- package/dist/credentials/availability.js +107 -0
- package/dist/credentials/availability.js.map +1 -0
- package/dist/credentials/encrypted-file.d.ts +50 -0
- package/dist/credentials/encrypted-file.js +156 -0
- package/dist/credentials/encrypted-file.js.map +1 -0
- package/dist/credentials/keyring.d.ts +48 -0
- package/dist/credentials/keyring.js +97 -0
- package/dist/credentials/keyring.js.map +1 -0
- package/dist/credentials/plain-file.d.ts +24 -0
- package/dist/credentials/plain-file.js +78 -0
- package/dist/credentials/plain-file.js.map +1 -0
- package/dist/credentials/probe-keyring.d.ts +11 -0
- package/dist/credentials/probe-keyring.js +57 -0
- package/dist/credentials/probe-keyring.js.map +1 -0
- package/dist/credentials/session.d.ts +15 -0
- package/dist/credentials/session.js +21 -0
- package/dist/credentials/session.js.map +1 -0
- package/dist/credentials/store.d.ts +80 -0
- package/dist/credentials/store.js +94 -0
- package/dist/credentials/store.js.map +1 -0
- package/dist/in-flight.d.ts +33 -0
- package/dist/in-flight.js +78 -0
- package/dist/in-flight.js.map +1 -0
- package/dist/mail/actions.d.ts +116 -0
- package/dist/mail/actions.js +265 -0
- package/dist/mail/actions.js.map +1 -0
- package/dist/mail/attachments.d.ts +39 -0
- package/dist/mail/attachments.js +86 -0
- package/dist/mail/attachments.js.map +1 -0
- package/dist/mail/compose.d.ts +264 -0
- package/dist/mail/compose.js +395 -0
- package/dist/mail/compose.js.map +1 -0
- package/dist/mail/drafts.d.ts +138 -0
- package/dist/mail/drafts.js +449 -0
- package/dist/mail/drafts.js.map +1 -0
- package/dist/mail/ids.d.ts +78 -0
- package/dist/mail/ids.js +135 -0
- package/dist/mail/ids.js.map +1 -0
- package/dist/mail/labels.d.ts +61 -0
- package/dist/mail/labels.js +139 -0
- package/dist/mail/labels.js.map +1 -0
- package/dist/mail/markup.d.ts +91 -0
- package/dist/mail/markup.js +265 -0
- package/dist/mail/markup.js.map +1 -0
- package/dist/mail/messages.d.ts +147 -0
- package/dist/mail/messages.js +219 -0
- package/dist/mail/messages.js.map +1 -0
- package/dist/mail/quote.d.ts +65 -0
- package/dist/mail/quote.js +157 -0
- package/dist/mail/quote.js.map +1 -0
- package/dist/mail/search.d.ts +66 -0
- package/dist/mail/search.js +107 -0
- package/dist/mail/search.js.map +1 -0
- package/dist/mail/send.d.ts +61 -0
- package/dist/mail/send.js +132 -0
- package/dist/mail/send.js.map +1 -0
- package/dist/mime/parse.d.ts +110 -0
- package/dist/mime/parse.js +194 -0
- package/dist/mime/parse.js.map +1 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.js +387 -0
- package/dist/server.js.map +1 -0
- package/dist/session.d.ts +86 -0
- package/dist/session.js +220 -0
- package/dist/session.js.map +1 -0
- package/dist/settings.d.ts +52 -0
- package/dist/settings.js +80 -0
- package/dist/settings.js.map +1 -0
- package/dist/tools/actions.d.ts +21 -0
- package/dist/tools/actions.js +133 -0
- package/dist/tools/actions.js.map +1 -0
- package/dist/tools/capabilities.d.ts +52 -0
- package/dist/tools/capabilities.js +96 -0
- package/dist/tools/capabilities.js.map +1 -0
- package/dist/tools/confirm.d.ts +84 -0
- package/dist/tools/confirm.js +212 -0
- package/dist/tools/confirm.js.map +1 -0
- package/dist/tools/drafts.d.ts +21 -0
- package/dist/tools/drafts.js +199 -0
- package/dist/tools/drafts.js.map +1 -0
- package/dist/tools/failures.d.ts +46 -0
- package/dist/tools/failures.js +157 -0
- package/dist/tools/failures.js.map +1 -0
- package/dist/tools/format.d.ts +55 -0
- package/dist/tools/format.js +220 -0
- package/dist/tools/format.js.map +1 -0
- package/dist/tools/guidance.d.ts +38 -0
- package/dist/tools/guidance.js +226 -0
- package/dist/tools/guidance.js.map +1 -0
- package/dist/tools/interface.d.ts +28 -0
- package/dist/tools/interface.js +63 -0
- package/dist/tools/interface.js.map +1 -0
- package/dist/tools/labels.d.ts +21 -0
- package/dist/tools/labels.js +92 -0
- package/dist/tools/labels.js.map +1 -0
- package/dist/tools/list-folders.d.ts +14 -0
- package/dist/tools/list-folders.js +70 -0
- package/dist/tools/list-folders.js.map +1 -0
- package/dist/tools/messages.d.ts +9 -0
- package/dist/tools/messages.js +221 -0
- package/dist/tools/messages.js.map +1 -0
- package/dist/tools/send.d.ts +29 -0
- package/dist/tools/send.js +236 -0
- package/dist/tools/send.js.map +1 -0
- package/dist/tools/sign-in-required.d.ts +94 -0
- package/dist/tools/sign-in-required.js +168 -0
- package/dist/tools/sign-in-required.js.map +1 -0
- package/dist/web/layout.d.ts +75 -0
- package/dist/web/layout.js +590 -0
- package/dist/web/layout.js.map +1 -0
- package/dist/web/pages.d.ts +79 -0
- package/dist/web/pages.js +284 -0
- package/dist/web/pages.js.map +1 -0
- package/dist/web/sections.d.ts +105 -0
- package/dist/web/sections.js +207 -0
- package/dist/web/sections.js.map +1 -0
- package/dist/web/security.d.ts +122 -0
- package/dist/web/security.js +180 -0
- package/dist/web/security.js.map +1 -0
- package/dist/web/server.d.ts +153 -0
- package/dist/web/server.js +622 -0
- package/dist/web/server.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning raw messages into something a language model can read.
|
|
3
|
+
*
|
|
4
|
+
* Three facts measured against the Bridge drive this module:
|
|
5
|
+
*
|
|
6
|
+
* 1. A message with three sentences of content costs around 2782 tokens raw as
|
|
7
|
+
* HTML, while the content itself is about 30. In a real mailbox the median
|
|
8
|
+
* message is roughly 16200 tokens raw. Twenty of those exceed a full context
|
|
9
|
+
* window, so raw content is never passed on.
|
|
10
|
+
* 2. HTML messages lose their plain text part on the way through Proton. There
|
|
11
|
+
* is no fallback, so converting HTML to text is mandatory rather than
|
|
12
|
+
* optional.
|
|
13
|
+
* 3. Proton attaches its own PGP public key to every message sent through the
|
|
14
|
+
* Bridge. It is not a real attachment and has to be filtered out of every
|
|
15
|
+
* attachment list.
|
|
16
|
+
*/
|
|
17
|
+
export interface Address {
|
|
18
|
+
name?: string;
|
|
19
|
+
address: string;
|
|
20
|
+
}
|
|
21
|
+
export interface Attachment {
|
|
22
|
+
/** Index within the message, used to fetch the content later. */
|
|
23
|
+
index: number;
|
|
24
|
+
filename: string;
|
|
25
|
+
contentType: string;
|
|
26
|
+
size: number;
|
|
27
|
+
/** Content-ID, set for images referenced from the HTML body. */
|
|
28
|
+
contentId?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ParsedMessage {
|
|
31
|
+
/** Stable across mailboxes, unlike a UID, which changes on every move. */
|
|
32
|
+
messageId: string;
|
|
33
|
+
subject: string;
|
|
34
|
+
from: Address[];
|
|
35
|
+
to: Address[];
|
|
36
|
+
cc: Address[];
|
|
37
|
+
/**
|
|
38
|
+
* Only ever filled for a draft we wrote ourselves. A delivered message never
|
|
39
|
+
* carries the blind copies, which is the point of them.
|
|
40
|
+
*/
|
|
41
|
+
bcc: Address[];
|
|
42
|
+
replyTo: Address[];
|
|
43
|
+
date: Date | undefined;
|
|
44
|
+
/** Readable text. Always filled when the message has any body at all. */
|
|
45
|
+
text: string;
|
|
46
|
+
/** Where the text came from. "html" means it was converted. */
|
|
47
|
+
textSource: 'plain' | 'html' | 'none';
|
|
48
|
+
/**
|
|
49
|
+
* The markup itself, when the message had any.
|
|
50
|
+
*
|
|
51
|
+
* Kept alongside the converted text rather than instead of it. A draft that
|
|
52
|
+
* was written as markup has to be sendable again as the markup it was, and
|
|
53
|
+
* converting it to text and back would deliver something the author never
|
|
54
|
+
* wrote.
|
|
55
|
+
*/
|
|
56
|
+
html?: string;
|
|
57
|
+
/** True when the text was shortened to stay within the budget. */
|
|
58
|
+
truncated: boolean;
|
|
59
|
+
/** Where to continue reading, or undefined when the end was reached. */
|
|
60
|
+
nextTextOffset?: number;
|
|
61
|
+
/** Total length of the body text, whether shown or not. */
|
|
62
|
+
totalTextChars: number;
|
|
63
|
+
/** Real attachments. Proton's own public key is not among them. */
|
|
64
|
+
attachments: Attachment[];
|
|
65
|
+
/** True when Proton's public key was filtered out. */
|
|
66
|
+
protonKeyFiltered: boolean;
|
|
67
|
+
/** Size of the raw message in bytes, for diagnostics. */
|
|
68
|
+
rawSize: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Recognises the public key Proton attaches to every outgoing message.
|
|
72
|
+
*
|
|
73
|
+
* Measured shape: content type `application/pgp-keys`, file name
|
|
74
|
+
* `publickey - <address> - 0x<id>.asc`. The content type alone is not enough,
|
|
75
|
+
* because a genuinely attached key would look the same. The name pattern is
|
|
76
|
+
* what Proton generates.
|
|
77
|
+
*/
|
|
78
|
+
export declare function isProtonPublicKey(contentType: string, filename: string): boolean;
|
|
79
|
+
/** Converts HTML into readable text without ever fetching anything. */
|
|
80
|
+
export declare function htmlToText(html: string): string;
|
|
81
|
+
/** Rough token estimate from a character count. Four characters per token is close enough to budget with. */
|
|
82
|
+
export declare function estimateTokensForChars(chars: number): number;
|
|
83
|
+
/** Rough token estimate for a piece of text. */
|
|
84
|
+
export declare function estimateTokens(text: string): number;
|
|
85
|
+
export interface Excerpt {
|
|
86
|
+
text: string;
|
|
87
|
+
truncated: boolean;
|
|
88
|
+
/** Where to continue reading, or undefined when the end was reached. */
|
|
89
|
+
nextOffset?: number;
|
|
90
|
+
/** Total length of the untruncated text. */
|
|
91
|
+
totalChars: number;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Returns a window of the text and says exactly where it ends.
|
|
95
|
+
*
|
|
96
|
+
* Cutting silently would be worse than cutting visibly: the model would treat a
|
|
97
|
+
* truncated message as complete and draw conclusions from something that is not
|
|
98
|
+
* there. And a note saying "ask for the rest" is only honest if there is a way
|
|
99
|
+
* to ask, hence nextOffset. Long messages are read the way long listings are
|
|
100
|
+
* paged, not by raising a limit until it fits.
|
|
101
|
+
*/
|
|
102
|
+
export declare function truncate(text: string, maxChars: number, offset?: number): Excerpt;
|
|
103
|
+
export interface ParseOptions {
|
|
104
|
+
/** Upper bound for the body text in characters. 0 means no limit. */
|
|
105
|
+
maxTextChars?: number;
|
|
106
|
+
/** Where to start reading the body, for continuing a long message. */
|
|
107
|
+
textOffset?: number;
|
|
108
|
+
}
|
|
109
|
+
/** Parses a raw message. */
|
|
110
|
+
export declare function parseMessage(source: Buffer | string, options?: ParseOptions): Promise<ParsedMessage>;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning raw messages into something a language model can read.
|
|
3
|
+
*
|
|
4
|
+
* Three facts measured against the Bridge drive this module:
|
|
5
|
+
*
|
|
6
|
+
* 1. A message with three sentences of content costs around 2782 tokens raw as
|
|
7
|
+
* HTML, while the content itself is about 30. In a real mailbox the median
|
|
8
|
+
* message is roughly 16200 tokens raw. Twenty of those exceed a full context
|
|
9
|
+
* window, so raw content is never passed on.
|
|
10
|
+
* 2. HTML messages lose their plain text part on the way through Proton. There
|
|
11
|
+
* is no fallback, so converting HTML to text is mandatory rather than
|
|
12
|
+
* optional.
|
|
13
|
+
* 3. Proton attaches its own PGP public key to every message sent through the
|
|
14
|
+
* Bridge. It is not a real attachment and has to be filtered out of every
|
|
15
|
+
* attachment list.
|
|
16
|
+
*/
|
|
17
|
+
import { simpleParser } from 'mailparser';
|
|
18
|
+
import { convert } from 'html-to-text';
|
|
19
|
+
/**
|
|
20
|
+
* Recognises the public key Proton attaches to every outgoing message.
|
|
21
|
+
*
|
|
22
|
+
* Measured shape: content type `application/pgp-keys`, file name
|
|
23
|
+
* `publickey - <address> - 0x<id>.asc`. The content type alone is not enough,
|
|
24
|
+
* because a genuinely attached key would look the same. The name pattern is
|
|
25
|
+
* what Proton generates.
|
|
26
|
+
*/
|
|
27
|
+
export function isProtonPublicKey(contentType, filename) {
|
|
28
|
+
if (contentType.toLowerCase() !== 'application/pgp-keys')
|
|
29
|
+
return false;
|
|
30
|
+
return /^publickey - .+ - 0x[0-9a-f]+\.asc$/i.test(filename);
|
|
31
|
+
}
|
|
32
|
+
/** Converts HTML into readable text without ever fetching anything. */
|
|
33
|
+
export function htmlToText(html) {
|
|
34
|
+
return convert(html, {
|
|
35
|
+
wordwrap: false,
|
|
36
|
+
selectors: [
|
|
37
|
+
// Images are dropped. Their URLs are worthless without fetching them,
|
|
38
|
+
// and fetching would confirm to the sender that the message was read.
|
|
39
|
+
{ selector: 'img', format: 'skip' },
|
|
40
|
+
// Links keep their target. A recipient has to be able to see where a
|
|
41
|
+
// link actually goes, that is the whole point when judging a phishing
|
|
42
|
+
// attempt.
|
|
43
|
+
{ selector: 'a', options: { hideLinkHrefIfSameAsText: true } },
|
|
44
|
+
// Tracking pixels and layout tables carry no content.
|
|
45
|
+
{ selector: 'table', format: 'dataTable' },
|
|
46
|
+
// By default headings are upper-cased, which changes the wording of the
|
|
47
|
+
// message. A model should see what was written, not a shouted version.
|
|
48
|
+
{ selector: 'h1', options: { uppercase: false } },
|
|
49
|
+
{ selector: 'h2', options: { uppercase: false } },
|
|
50
|
+
{ selector: 'h3', options: { uppercase: false } },
|
|
51
|
+
{ selector: 'h4', options: { uppercase: false } },
|
|
52
|
+
{ selector: 'h5', options: { uppercase: false } },
|
|
53
|
+
{ selector: 'h6', options: { uppercase: false } },
|
|
54
|
+
],
|
|
55
|
+
})
|
|
56
|
+
.replace(/\n{3,}/g, '\n\n')
|
|
57
|
+
.trim();
|
|
58
|
+
}
|
|
59
|
+
function addresses(field) {
|
|
60
|
+
if (!field)
|
|
61
|
+
return [];
|
|
62
|
+
const list = Array.isArray(field) ? field : [field];
|
|
63
|
+
const out = [];
|
|
64
|
+
for (const group of list) {
|
|
65
|
+
for (const entry of group.value ?? []) {
|
|
66
|
+
if (!entry.address)
|
|
67
|
+
continue;
|
|
68
|
+
const item = { address: entry.address };
|
|
69
|
+
if (entry.name)
|
|
70
|
+
item.name = entry.name;
|
|
71
|
+
out.push(item);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return out;
|
|
75
|
+
}
|
|
76
|
+
/** Rough token estimate from a character count. Four characters per token is close enough to budget with. */
|
|
77
|
+
export function estimateTokensForChars(chars) {
|
|
78
|
+
return Math.ceil(chars / 4);
|
|
79
|
+
}
|
|
80
|
+
/** Rough token estimate for a piece of text. */
|
|
81
|
+
export function estimateTokens(text) {
|
|
82
|
+
return estimateTokensForChars(text.length);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Returns a window of the text and says exactly where it ends.
|
|
86
|
+
*
|
|
87
|
+
* Cutting silently would be worse than cutting visibly: the model would treat a
|
|
88
|
+
* truncated message as complete and draw conclusions from something that is not
|
|
89
|
+
* there. And a note saying "ask for the rest" is only honest if there is a way
|
|
90
|
+
* to ask, hence nextOffset. Long messages are read the way long listings are
|
|
91
|
+
* paged, not by raising a limit until it fits.
|
|
92
|
+
*/
|
|
93
|
+
export function truncate(text, maxChars, offset = 0) {
|
|
94
|
+
const totalChars = text.length;
|
|
95
|
+
const from = Math.max(0, Math.min(offset, totalChars));
|
|
96
|
+
const window = text.slice(from, from + maxChars);
|
|
97
|
+
const isStart = from === 0;
|
|
98
|
+
const reachesEnd = from + window.length >= totalChars;
|
|
99
|
+
if (isStart && reachesEnd) {
|
|
100
|
+
return { text, truncated: false, totalChars };
|
|
101
|
+
}
|
|
102
|
+
// Prefer to cut at a paragraph or line break, so no sentence is severed
|
|
103
|
+
// mid-word. Only when that does not throw away half the window.
|
|
104
|
+
let cut = window;
|
|
105
|
+
if (!reachesEnd) {
|
|
106
|
+
const lastBreak = Math.max(window.lastIndexOf('\n\n'), window.lastIndexOf('\n'));
|
|
107
|
+
if (lastBreak > maxChars * 0.5)
|
|
108
|
+
cut = window.slice(0, lastBreak);
|
|
109
|
+
}
|
|
110
|
+
const end = from + cut.length;
|
|
111
|
+
const parts = [];
|
|
112
|
+
if (!isStart) {
|
|
113
|
+
parts.push(`[... continuing at character ${from} of ${totalChars} ...]`, '');
|
|
114
|
+
}
|
|
115
|
+
parts.push(cut);
|
|
116
|
+
if (end < totalChars) {
|
|
117
|
+
const remaining = totalChars - end;
|
|
118
|
+
parts.push('', `[... ${remaining} of ${totalChars} characters not shown, roughly ` +
|
|
119
|
+
`${estimateTokensForChars(remaining)} tokens. Pass textOffset=${end} to continue reading.]`);
|
|
120
|
+
}
|
|
121
|
+
const result = {
|
|
122
|
+
text: parts.join('\n'),
|
|
123
|
+
truncated: true,
|
|
124
|
+
totalChars,
|
|
125
|
+
};
|
|
126
|
+
if (end < totalChars)
|
|
127
|
+
result.nextOffset = end;
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
/** Parses a raw message. */
|
|
131
|
+
export async function parseMessage(source, options = {}) {
|
|
132
|
+
const parsed = await simpleParser(source, {
|
|
133
|
+
// We never render HTML, so there is no reason to have mailparser build a
|
|
134
|
+
// second HTML representation of the plain text part.
|
|
135
|
+
skipTextToHtml: true,
|
|
136
|
+
skipTextLinks: true,
|
|
137
|
+
});
|
|
138
|
+
let text = '';
|
|
139
|
+
let textSource = 'none';
|
|
140
|
+
if (parsed.text && parsed.text.trim()) {
|
|
141
|
+
text = parsed.text.trim();
|
|
142
|
+
textSource = 'plain';
|
|
143
|
+
}
|
|
144
|
+
else if (parsed.html) {
|
|
145
|
+
text = htmlToText(parsed.html);
|
|
146
|
+
textSource = 'html';
|
|
147
|
+
}
|
|
148
|
+
const limit = options.maxTextChars ?? 0;
|
|
149
|
+
const offset = options.textOffset ?? 0;
|
|
150
|
+
const excerpt = limit > 0
|
|
151
|
+
? truncate(text, limit, offset)
|
|
152
|
+
: { text, truncated: false, totalChars: text.length };
|
|
153
|
+
const attachments = [];
|
|
154
|
+
let protonKeyFiltered = false;
|
|
155
|
+
let index = 0;
|
|
156
|
+
for (const a of parsed.attachments ?? []) {
|
|
157
|
+
const filename = a.filename ?? '';
|
|
158
|
+
const contentType = a.contentType ?? 'application/octet-stream';
|
|
159
|
+
if (isProtonPublicKey(contentType, filename)) {
|
|
160
|
+
protonKeyFiltered = true;
|
|
161
|
+
// Deliberately not counted: the index has to match what a caller sees.
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
const item = {
|
|
165
|
+
index: index++,
|
|
166
|
+
filename: filename || `attachment-${index}`,
|
|
167
|
+
contentType,
|
|
168
|
+
size: a.size ?? 0,
|
|
169
|
+
};
|
|
170
|
+
if (a.cid)
|
|
171
|
+
item.contentId = a.cid;
|
|
172
|
+
attachments.push(item);
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
messageId: parsed.messageId ?? '',
|
|
176
|
+
subject: parsed.subject ?? '',
|
|
177
|
+
from: addresses(parsed.from),
|
|
178
|
+
to: addresses(parsed.to),
|
|
179
|
+
cc: addresses(parsed.cc),
|
|
180
|
+
bcc: addresses(parsed.bcc),
|
|
181
|
+
replyTo: addresses(parsed.replyTo),
|
|
182
|
+
date: parsed.date,
|
|
183
|
+
text: excerpt.text,
|
|
184
|
+
textSource,
|
|
185
|
+
...(typeof parsed.html === 'string' && parsed.html ? { html: parsed.html } : {}),
|
|
186
|
+
truncated: excerpt.truncated,
|
|
187
|
+
...(excerpt.nextOffset !== undefined ? { nextTextOffset: excerpt.nextOffset } : {}),
|
|
188
|
+
totalTextChars: excerpt.totalChars,
|
|
189
|
+
attachments,
|
|
190
|
+
protonKeyFiltered,
|
|
191
|
+
rawSize: typeof source === 'string' ? Buffer.byteLength(source) : source.length,
|
|
192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,EAAE,CAAC;QACxB,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC;QAC1B,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;QAClC,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,UAAU;QACV,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,GAAG,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnF,cAAc,EAAE,OAAO,CAAC,UAAU;QAClC,WAAW;QACX,iBAAiB;QACjB,OAAO,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM;KAChF,CAAA;AACH,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Entry point of the MCP server.
|
|
4
|
+
*
|
|
5
|
+
* The server speaks over stdio, so the client starts it as a child process.
|
|
6
|
+
* That is not a workaround: the Bridge only listens on 127.0.0.1, so a server
|
|
7
|
+
* running in the cloud could not reach it at all.
|
|
8
|
+
*
|
|
9
|
+
* The local web interface runs for as long as this process does. It is not
|
|
10
|
+
* started on demand: it is where configuration and state live, and it is meant
|
|
11
|
+
* to be opened again and again rather than summoned for one sign-in.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|