dsh-email 0.10.2 → 0.10.3
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/README.en.md +5 -1
- package/README.md +5 -1
- package/lib/approval.d.ts +34 -0
- package/lib/approval.js +55 -0
- package/lib/index.d.ts +8 -12
- package/lib/index.js +17 -669
- package/lib/mail-client.d.ts +12 -10
- package/lib/mail-client.js +141 -52
- package/lib/runtime.d.ts +36 -0
- package/lib/runtime.js +92 -0
- package/lib/tool-contract.d.ts +423 -0
- package/lib/tool-contract.js +353 -0
- package/lib/tools.d.ts +13 -0
- package/lib/tools.js +191 -0
- package/package.json +1 -1
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
/** Model-facing parameters, input normalization, output schemas and text rendering. */
|
|
2
|
+
import type { EmailAttachmentResult, EmailFoldersResult, EmailListResult, EmailMarkAction, EmailMarkResult, EmailReadResult, EmailReplyMode, EmailReplyResult, EmailSearchResult, EmailSendResult, EmailWatchResult } from './types.js';
|
|
3
|
+
export type TextBlock = {
|
|
4
|
+
type: 'text';
|
|
5
|
+
text: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const MAX_LIMIT = 100;
|
|
8
|
+
export declare const ACCOUNT_HINT = "\u8D26\u53F7\u540D\uFF08\u914D\u7F6E\u4E86 accounts \u591A\u4E2A\u8D26\u53F7\u65F6\u9009\u62E9\uFF09\uFF0C\u7701\u7565\u65F6\u7528 defaultAccount\u3002\u53EF\u7528\u8D26\u53F7\u89C1 email_folders \u7684\u62A5\u9519\u6216\u63D2\u4EF6 README";
|
|
9
|
+
/** Parse date-only or ISO input; an inclusive end date maps to the next UTC day. */
|
|
10
|
+
export declare function parseEmailDay(input: string, label: string, endInclusive?: boolean): Date;
|
|
11
|
+
export declare function executionSignal(exec: unknown): AbortSignal | undefined;
|
|
12
|
+
interface ParameterProperty {
|
|
13
|
+
type?: string;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
description?: string;
|
|
16
|
+
items?: {
|
|
17
|
+
type?: string;
|
|
18
|
+
} | null;
|
|
19
|
+
}
|
|
20
|
+
export declare function compileParameters(spec: Record<string, ParameterProperty>): Record<string, unknown>;
|
|
21
|
+
export declare function normalizeAttachmentPaths(value: unknown): string[] | undefined;
|
|
22
|
+
export declare const strArray: {
|
|
23
|
+
type: string;
|
|
24
|
+
items: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const addrArray: {
|
|
29
|
+
type: string;
|
|
30
|
+
items: {
|
|
31
|
+
type: string;
|
|
32
|
+
additionalProperties: boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const messageShape: {
|
|
36
|
+
uid: {
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
date: {
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
from: {
|
|
43
|
+
type: string;
|
|
44
|
+
items: {
|
|
45
|
+
type: string;
|
|
46
|
+
additionalProperties: boolean;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
subject: {
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
seen: {
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
flagged: {
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
size: {
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
hasAttachments: {
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
export declare const listSchema: {
|
|
66
|
+
type: string;
|
|
67
|
+
properties: {
|
|
68
|
+
account: {
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
71
|
+
count: {
|
|
72
|
+
type: string;
|
|
73
|
+
};
|
|
74
|
+
folder: {
|
|
75
|
+
type: string;
|
|
76
|
+
};
|
|
77
|
+
messages: {
|
|
78
|
+
type: string;
|
|
79
|
+
items: {
|
|
80
|
+
type: string;
|
|
81
|
+
properties: {
|
|
82
|
+
uid: {
|
|
83
|
+
type: string;
|
|
84
|
+
};
|
|
85
|
+
date: {
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
from: {
|
|
89
|
+
type: string;
|
|
90
|
+
items: {
|
|
91
|
+
type: string;
|
|
92
|
+
additionalProperties: boolean;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
subject: {
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
seen: {
|
|
99
|
+
type: string;
|
|
100
|
+
};
|
|
101
|
+
flagged: {
|
|
102
|
+
type: string;
|
|
103
|
+
};
|
|
104
|
+
size: {
|
|
105
|
+
type: string;
|
|
106
|
+
};
|
|
107
|
+
hasAttachments: {
|
|
108
|
+
type: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
additionalProperties: boolean;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
additionalProperties: boolean;
|
|
116
|
+
};
|
|
117
|
+
export declare const readSchema: {
|
|
118
|
+
type: string;
|
|
119
|
+
properties: {
|
|
120
|
+
account: {
|
|
121
|
+
type: string;
|
|
122
|
+
};
|
|
123
|
+
uid: {
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
folder: {
|
|
127
|
+
type: string;
|
|
128
|
+
};
|
|
129
|
+
date: {
|
|
130
|
+
type: string;
|
|
131
|
+
};
|
|
132
|
+
from: {
|
|
133
|
+
type: string;
|
|
134
|
+
items: {
|
|
135
|
+
type: string;
|
|
136
|
+
additionalProperties: boolean;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
to: {
|
|
140
|
+
type: string;
|
|
141
|
+
items: {
|
|
142
|
+
type: string;
|
|
143
|
+
additionalProperties: boolean;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
cc: {
|
|
147
|
+
type: string;
|
|
148
|
+
items: {
|
|
149
|
+
type: string;
|
|
150
|
+
additionalProperties: boolean;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
subject: {
|
|
154
|
+
type: string;
|
|
155
|
+
};
|
|
156
|
+
text: {
|
|
157
|
+
type: string;
|
|
158
|
+
};
|
|
159
|
+
attachments: {
|
|
160
|
+
type: string;
|
|
161
|
+
items: {
|
|
162
|
+
type: string;
|
|
163
|
+
additionalProperties: boolean;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
truncated: {
|
|
167
|
+
type: string;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
additionalProperties: boolean;
|
|
171
|
+
};
|
|
172
|
+
export declare const sendSchema: {
|
|
173
|
+
type: string;
|
|
174
|
+
properties: {
|
|
175
|
+
account: {
|
|
176
|
+
type: string;
|
|
177
|
+
};
|
|
178
|
+
messageId: {
|
|
179
|
+
type: string;
|
|
180
|
+
};
|
|
181
|
+
accepted: {
|
|
182
|
+
type: string;
|
|
183
|
+
items: {
|
|
184
|
+
type: string;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
rejected: {
|
|
188
|
+
type: string;
|
|
189
|
+
items: {
|
|
190
|
+
type: string;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
response: {
|
|
194
|
+
type: string;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
additionalProperties: boolean;
|
|
198
|
+
};
|
|
199
|
+
export declare const foldersSchema: {
|
|
200
|
+
type: string;
|
|
201
|
+
properties: {
|
|
202
|
+
account: {
|
|
203
|
+
type: string;
|
|
204
|
+
};
|
|
205
|
+
folders: {
|
|
206
|
+
type: string;
|
|
207
|
+
items: {
|
|
208
|
+
type: string;
|
|
209
|
+
properties: {
|
|
210
|
+
name: {
|
|
211
|
+
type: string;
|
|
212
|
+
};
|
|
213
|
+
path: {
|
|
214
|
+
type: string;
|
|
215
|
+
};
|
|
216
|
+
specialUse: {
|
|
217
|
+
type: string;
|
|
218
|
+
};
|
|
219
|
+
subscribed: {
|
|
220
|
+
type: string;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
additionalProperties: boolean;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
additionalProperties: boolean;
|
|
228
|
+
};
|
|
229
|
+
export declare const attachmentSchema: {
|
|
230
|
+
type: string;
|
|
231
|
+
properties: {
|
|
232
|
+
account: {
|
|
233
|
+
type: string;
|
|
234
|
+
};
|
|
235
|
+
uid: {
|
|
236
|
+
type: string;
|
|
237
|
+
};
|
|
238
|
+
filename: {
|
|
239
|
+
type: string;
|
|
240
|
+
};
|
|
241
|
+
contentType: {
|
|
242
|
+
type: string;
|
|
243
|
+
};
|
|
244
|
+
size: {
|
|
245
|
+
type: string;
|
|
246
|
+
};
|
|
247
|
+
path: {
|
|
248
|
+
type: string;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
additionalProperties: boolean;
|
|
252
|
+
};
|
|
253
|
+
export declare const markSchema: {
|
|
254
|
+
type: string;
|
|
255
|
+
properties: {
|
|
256
|
+
account: {
|
|
257
|
+
type: string;
|
|
258
|
+
};
|
|
259
|
+
uid: {
|
|
260
|
+
type: string;
|
|
261
|
+
};
|
|
262
|
+
folder: {
|
|
263
|
+
type: string;
|
|
264
|
+
};
|
|
265
|
+
action: {
|
|
266
|
+
type: string;
|
|
267
|
+
};
|
|
268
|
+
seen: {
|
|
269
|
+
type: string;
|
|
270
|
+
};
|
|
271
|
+
flagged: {
|
|
272
|
+
type: string;
|
|
273
|
+
};
|
|
274
|
+
movedTo: {
|
|
275
|
+
type: string;
|
|
276
|
+
};
|
|
277
|
+
movedUid: {
|
|
278
|
+
type: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
additionalProperties: boolean;
|
|
282
|
+
};
|
|
283
|
+
export declare const MARK_ACTIONS: EmailMarkAction[];
|
|
284
|
+
export declare const REPLY_MODES: EmailReplyMode[];
|
|
285
|
+
export declare const MARK_LABELS: Record<EmailMarkAction, string>;
|
|
286
|
+
export declare const REPLY_LABELS: Record<EmailReplyMode, string>;
|
|
287
|
+
export declare function oneText(text: string): TextBlock[];
|
|
288
|
+
export declare function describeMessage(message: EmailListResult['messages'][number]): string;
|
|
289
|
+
export declare function renderList(value: EmailListResult): TextBlock[];
|
|
290
|
+
export declare function renderRead(value: EmailReadResult): TextBlock[];
|
|
291
|
+
export declare function renderSearch(value: EmailSearchResult): TextBlock[];
|
|
292
|
+
export declare function renderSend(value: EmailSendResult): TextBlock[];
|
|
293
|
+
export declare function renderFolders(value: EmailFoldersResult): TextBlock[];
|
|
294
|
+
export declare function renderAttachment(value: EmailAttachmentResult): TextBlock[];
|
|
295
|
+
export declare function renderMark(value: EmailMarkResult): TextBlock[];
|
|
296
|
+
export declare function renderReply(value: EmailReplyResult): TextBlock[];
|
|
297
|
+
export declare function renderWatch(value: EmailWatchResult): TextBlock[];
|
|
298
|
+
export declare const renderHealth: (_args: unknown, value: unknown) => TextBlock[];
|
|
299
|
+
export declare const replySchema: {
|
|
300
|
+
type: string;
|
|
301
|
+
properties: {
|
|
302
|
+
account: {
|
|
303
|
+
type: string;
|
|
304
|
+
};
|
|
305
|
+
mode: {
|
|
306
|
+
type: string;
|
|
307
|
+
};
|
|
308
|
+
originalUid: {
|
|
309
|
+
type: string;
|
|
310
|
+
};
|
|
311
|
+
messageId: {
|
|
312
|
+
type: string;
|
|
313
|
+
};
|
|
314
|
+
accepted: {
|
|
315
|
+
type: string;
|
|
316
|
+
items: {
|
|
317
|
+
type: string;
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
rejected: {
|
|
321
|
+
type: string;
|
|
322
|
+
items: {
|
|
323
|
+
type: string;
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
response: {
|
|
327
|
+
type: string;
|
|
328
|
+
};
|
|
329
|
+
to: {
|
|
330
|
+
type: string;
|
|
331
|
+
items: {
|
|
332
|
+
type: string;
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
subject: {
|
|
336
|
+
type: string;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
additionalProperties: boolean;
|
|
340
|
+
};
|
|
341
|
+
export declare const watchSchema: {
|
|
342
|
+
type: string;
|
|
343
|
+
properties: {
|
|
344
|
+
account: {
|
|
345
|
+
type: string;
|
|
346
|
+
};
|
|
347
|
+
folder: {
|
|
348
|
+
type: string;
|
|
349
|
+
};
|
|
350
|
+
firstRun: {
|
|
351
|
+
type: string;
|
|
352
|
+
};
|
|
353
|
+
newCount: {
|
|
354
|
+
type: string;
|
|
355
|
+
};
|
|
356
|
+
totalUnread: {
|
|
357
|
+
type: string;
|
|
358
|
+
};
|
|
359
|
+
messages: {
|
|
360
|
+
type: string;
|
|
361
|
+
items: {
|
|
362
|
+
type: string;
|
|
363
|
+
properties: {
|
|
364
|
+
uid: {
|
|
365
|
+
type: string;
|
|
366
|
+
};
|
|
367
|
+
date: {
|
|
368
|
+
type: string;
|
|
369
|
+
};
|
|
370
|
+
from: {
|
|
371
|
+
type: string;
|
|
372
|
+
items: {
|
|
373
|
+
type: string;
|
|
374
|
+
additionalProperties: boolean;
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
subject: {
|
|
378
|
+
type: string;
|
|
379
|
+
};
|
|
380
|
+
seen: {
|
|
381
|
+
type: string;
|
|
382
|
+
};
|
|
383
|
+
flagged: {
|
|
384
|
+
type: string;
|
|
385
|
+
};
|
|
386
|
+
size: {
|
|
387
|
+
type: string;
|
|
388
|
+
};
|
|
389
|
+
hasAttachments: {
|
|
390
|
+
type: string;
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
additionalProperties: boolean;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
additionalProperties: boolean;
|
|
398
|
+
};
|
|
399
|
+
export declare const descriptions: {
|
|
400
|
+
email_list: string;
|
|
401
|
+
email_read: string;
|
|
402
|
+
email_mark: string;
|
|
403
|
+
email_search: string;
|
|
404
|
+
email_send: string;
|
|
405
|
+
email_reply: string;
|
|
406
|
+
email_folders: string;
|
|
407
|
+
email_health: string;
|
|
408
|
+
email_attachment: string;
|
|
409
|
+
email_watch: string;
|
|
410
|
+
};
|
|
411
|
+
export declare const parameters: {
|
|
412
|
+
email_list: Record<string, unknown>;
|
|
413
|
+
email_read: Record<string, unknown>;
|
|
414
|
+
email_mark: Record<string, unknown>;
|
|
415
|
+
email_search: Record<string, unknown>;
|
|
416
|
+
email_send: Record<string, unknown>;
|
|
417
|
+
email_reply: Record<string, unknown>;
|
|
418
|
+
email_folders: Record<string, unknown>;
|
|
419
|
+
email_health: Record<string, unknown>;
|
|
420
|
+
email_attachment: Record<string, unknown>;
|
|
421
|
+
email_watch: Record<string, unknown>;
|
|
422
|
+
};
|
|
423
|
+
export {};
|