@lovelybunch/core 1.0.75-alpha.9 → 1.0.76-alpha.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.
Files changed (46) hide show
  1. package/dist/events.d.ts +4 -4
  2. package/dist/index.d.ts +3 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +3 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/knowledge.d.ts +112 -112
  7. package/dist/logging/index.d.ts +5 -5
  8. package/dist/logging/index.d.ts.map +1 -1
  9. package/dist/logging/index.js +5 -5
  10. package/dist/logging/index.js.map +1 -1
  11. package/dist/logging/kinds.d.ts +71 -25
  12. package/dist/logging/kinds.d.ts.map +1 -1
  13. package/dist/logging/kinds.js +65 -24
  14. package/dist/logging/kinds.js.map +1 -1
  15. package/dist/mail.d.ts +430 -0
  16. package/dist/mail.d.ts.map +1 -0
  17. package/dist/mail.js +414 -0
  18. package/dist/mail.js.map +1 -0
  19. package/dist/markdown-storage.d.ts +6 -6
  20. package/dist/markdown-storage.d.ts.map +1 -1
  21. package/dist/markdown-storage.js +77 -120
  22. package/dist/markdown-storage.js.map +1 -1
  23. package/dist/skill-instructions.d.ts +5 -5
  24. package/dist/skill-instructions.d.ts.map +1 -1
  25. package/dist/skill-instructions.js +21 -27
  26. package/dist/skill-instructions.js.map +1 -1
  27. package/dist/slack.d.ts +102 -0
  28. package/dist/slack.d.ts.map +1 -0
  29. package/dist/slack.js +548 -0
  30. package/dist/slack.js.map +1 -0
  31. package/dist/storage.d.ts +10 -10
  32. package/dist/storage.d.ts.map +1 -1
  33. package/dist/storage.js +30 -58
  34. package/dist/storage.js.map +1 -1
  35. package/dist/system-prompts/coconut-assistant.md +4 -4
  36. package/dist/system-prompts/mail-processor.md +36 -0
  37. package/dist/system-prompts/schema/agent.schema.md +1 -1
  38. package/dist/system-prompts/schema/knowledge.schema.md +2 -2
  39. package/dist/system-prompts/schema/skill.schema.md +1 -1
  40. package/dist/system-prompts/schema/task.schema.md +65 -0
  41. package/dist/tasks.d.ts +850 -0
  42. package/dist/tasks.d.ts.map +1 -0
  43. package/dist/tasks.js +544 -0
  44. package/dist/tasks.js.map +1 -0
  45. package/package.json +3 -2
  46. package/dist/system-prompts/schema/proposal.schema.md +0 -179
package/dist/mail.d.ts ADDED
@@ -0,0 +1,430 @@
1
+ import { z } from 'zod';
2
+ import type { MailFolder, MailMessage } from '@lovelybunch/types';
3
+ export declare const MailFolderSchema: z.ZodEnum<["inbox", "read", "sent"]>;
4
+ export declare const MailAttachmentSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ filename: z.ZodString;
7
+ contentType: z.ZodString;
8
+ contentDisposition: z.ZodOptional<z.ZodString>;
9
+ contentId: z.ZodOptional<z.ZodString>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ id: string;
12
+ filename: string;
13
+ contentType: string;
14
+ contentDisposition?: string | undefined;
15
+ contentId?: string | undefined;
16
+ }, {
17
+ id: string;
18
+ filename: string;
19
+ contentType: string;
20
+ contentDisposition?: string | undefined;
21
+ contentId?: string | undefined;
22
+ }>;
23
+ export declare const MailMessageSchema: z.ZodObject<{
24
+ id: z.ZodString;
25
+ emailId: z.ZodString;
26
+ from: z.ZodString;
27
+ to: z.ZodArray<z.ZodString, "many">;
28
+ cc: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
29
+ bcc: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
30
+ subject: z.ZodString;
31
+ messageId: z.ZodString;
32
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
33
+ id: z.ZodString;
34
+ filename: z.ZodString;
35
+ contentType: z.ZodString;
36
+ contentDisposition: z.ZodOptional<z.ZodString>;
37
+ contentId: z.ZodOptional<z.ZodString>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ id: string;
40
+ filename: string;
41
+ contentType: string;
42
+ contentDisposition?: string | undefined;
43
+ contentId?: string | undefined;
44
+ }, {
45
+ id: string;
46
+ filename: string;
47
+ contentType: string;
48
+ contentDisposition?: string | undefined;
49
+ contentId?: string | undefined;
50
+ }>, "many">>;
51
+ receivedAt: z.ZodString;
52
+ content: z.ZodDefault<z.ZodString>;
53
+ folder: z.ZodEnum<["inbox", "read", "sent"]>;
54
+ action: z.ZodOptional<z.ZodString>;
55
+ processing: z.ZodOptional<z.ZodBoolean>;
56
+ processingStartedAt: z.ZodOptional<z.ZodString>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ id: string;
59
+ content: string;
60
+ emailId: string;
61
+ from: string;
62
+ to: string[];
63
+ cc: string[];
64
+ bcc: string[];
65
+ subject: string;
66
+ messageId: string;
67
+ attachments: {
68
+ id: string;
69
+ filename: string;
70
+ contentType: string;
71
+ contentDisposition?: string | undefined;
72
+ contentId?: string | undefined;
73
+ }[];
74
+ receivedAt: string;
75
+ folder: "inbox" | "read" | "sent";
76
+ action?: string | undefined;
77
+ processing?: boolean | undefined;
78
+ processingStartedAt?: string | undefined;
79
+ }, {
80
+ id: string;
81
+ emailId: string;
82
+ from: string;
83
+ to: string[];
84
+ subject: string;
85
+ messageId: string;
86
+ receivedAt: string;
87
+ folder: "inbox" | "read" | "sent";
88
+ content?: string | undefined;
89
+ action?: string | undefined;
90
+ cc?: string[] | undefined;
91
+ bcc?: string[] | undefined;
92
+ attachments?: {
93
+ id: string;
94
+ filename: string;
95
+ contentType: string;
96
+ contentDisposition?: string | undefined;
97
+ contentId?: string | undefined;
98
+ }[] | undefined;
99
+ processing?: boolean | undefined;
100
+ processingStartedAt?: string | undefined;
101
+ }>;
102
+ export declare const SaveMailInputSchema: z.ZodObject<{
103
+ emailId: z.ZodString;
104
+ from: z.ZodString;
105
+ to: z.ZodArray<z.ZodString, "many">;
106
+ cc: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
107
+ bcc: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
108
+ subject: z.ZodDefault<z.ZodString>;
109
+ messageId: z.ZodDefault<z.ZodString>;
110
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
111
+ id: z.ZodString;
112
+ filename: z.ZodString;
113
+ contentType: z.ZodString;
114
+ contentDisposition: z.ZodOptional<z.ZodString>;
115
+ contentId: z.ZodOptional<z.ZodString>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ id: string;
118
+ filename: string;
119
+ contentType: string;
120
+ contentDisposition?: string | undefined;
121
+ contentId?: string | undefined;
122
+ }, {
123
+ id: string;
124
+ filename: string;
125
+ contentType: string;
126
+ contentDisposition?: string | undefined;
127
+ contentId?: string | undefined;
128
+ }>, "many">>;
129
+ receivedAt: z.ZodOptional<z.ZodString>;
130
+ content: z.ZodDefault<z.ZodString>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ content: string;
133
+ emailId: string;
134
+ from: string;
135
+ to: string[];
136
+ cc: string[];
137
+ bcc: string[];
138
+ subject: string;
139
+ messageId: string;
140
+ attachments: {
141
+ id: string;
142
+ filename: string;
143
+ contentType: string;
144
+ contentDisposition?: string | undefined;
145
+ contentId?: string | undefined;
146
+ }[];
147
+ receivedAt?: string | undefined;
148
+ }, {
149
+ emailId: string;
150
+ from: string;
151
+ to: string[];
152
+ content?: string | undefined;
153
+ cc?: string[] | undefined;
154
+ bcc?: string[] | undefined;
155
+ subject?: string | undefined;
156
+ messageId?: string | undefined;
157
+ attachments?: {
158
+ id: string;
159
+ filename: string;
160
+ contentType: string;
161
+ contentDisposition?: string | undefined;
162
+ contentId?: string | undefined;
163
+ }[] | undefined;
164
+ receivedAt?: string | undefined;
165
+ }>;
166
+ export type SaveMailInput = z.infer<typeof SaveMailInputSchema>;
167
+ export declare const SetMailStatusInputSchema: z.ZodObject<{
168
+ status: z.ZodEnum<["read", "unread"]>;
169
+ }, "strip", z.ZodTypeAny, {
170
+ status: "read" | "unread";
171
+ }, {
172
+ status: "read" | "unread";
173
+ }>;
174
+ export type SetMailStatusInput = z.infer<typeof SetMailStatusInputSchema>;
175
+ export declare const ReplyMailInputSchema: z.ZodObject<{
176
+ content: z.ZodString;
177
+ }, "strip", z.ZodTypeAny, {
178
+ content: string;
179
+ }, {
180
+ content: string;
181
+ }>;
182
+ export type ReplyMailInput = z.infer<typeof ReplyMailInputSchema>;
183
+ export declare const AddMailActionInputSchema: z.ZodObject<{
184
+ id: z.ZodString;
185
+ action: z.ZodString;
186
+ }, "strip", z.ZodTypeAny, {
187
+ id: string;
188
+ action: string;
189
+ }, {
190
+ id: string;
191
+ action: string;
192
+ }>;
193
+ export type AddMailActionInput = z.infer<typeof AddMailActionInputSchema>;
194
+ /**
195
+ * List all emails in a given folder
196
+ */
197
+ export declare function listMail(folder: MailFolder): Promise<MailMessage[]>;
198
+ /**
199
+ * Get a single email by ID, searching across all folders or in a specific folder
200
+ */
201
+ export declare function getMail(id: string, folder?: MailFolder): Promise<MailMessage | null>;
202
+ /**
203
+ * Save a new email to a folder (used by webhook handler and send)
204
+ */
205
+ export declare function saveMail(folder: MailFolder, input: SaveMailInput): Promise<MailMessage>;
206
+ /**
207
+ * Set an email's read/unread status by moving between inbox and read folders
208
+ */
209
+ export declare function setMailStatus(id: string, status: 'read' | 'unread'): Promise<MailMessage>;
210
+ /**
211
+ * Delete an email from any folder
212
+ */
213
+ export declare function deleteMail(id: string, folder?: MailFolder): Promise<boolean>;
214
+ /**
215
+ * Reply to an email (stores reply in sent folder)
216
+ */
217
+ export declare function replyToMail(id: string, input: ReplyMailInput): Promise<MailMessage>;
218
+ /**
219
+ * Set the processing state on an email's frontmatter.
220
+ * When processing=true, the frontend shows a spinner.
221
+ * When processing=false, the flag is removed from frontmatter.
222
+ */
223
+ export declare function setMailProcessing(id: string, processing: boolean): Promise<void>;
224
+ /**
225
+ * Add an agent action summary to an email's frontmatter
226
+ */
227
+ export declare function addMailAction(id: string, actionText: string): Promise<MailMessage>;
228
+ /**
229
+ * Initialize mail directories
230
+ */
231
+ export declare function initMailDirs(): Promise<void>;
232
+ export declare const mailSchemas: {
233
+ MailFolderSchema: z.ZodEnum<["inbox", "read", "sent"]>;
234
+ MailAttachmentSchema: z.ZodObject<{
235
+ id: z.ZodString;
236
+ filename: z.ZodString;
237
+ contentType: z.ZodString;
238
+ contentDisposition: z.ZodOptional<z.ZodString>;
239
+ contentId: z.ZodOptional<z.ZodString>;
240
+ }, "strip", z.ZodTypeAny, {
241
+ id: string;
242
+ filename: string;
243
+ contentType: string;
244
+ contentDisposition?: string | undefined;
245
+ contentId?: string | undefined;
246
+ }, {
247
+ id: string;
248
+ filename: string;
249
+ contentType: string;
250
+ contentDisposition?: string | undefined;
251
+ contentId?: string | undefined;
252
+ }>;
253
+ MailMessageSchema: z.ZodObject<{
254
+ id: z.ZodString;
255
+ emailId: z.ZodString;
256
+ from: z.ZodString;
257
+ to: z.ZodArray<z.ZodString, "many">;
258
+ cc: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
259
+ bcc: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
260
+ subject: z.ZodString;
261
+ messageId: z.ZodString;
262
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
263
+ id: z.ZodString;
264
+ filename: z.ZodString;
265
+ contentType: z.ZodString;
266
+ contentDisposition: z.ZodOptional<z.ZodString>;
267
+ contentId: z.ZodOptional<z.ZodString>;
268
+ }, "strip", z.ZodTypeAny, {
269
+ id: string;
270
+ filename: string;
271
+ contentType: string;
272
+ contentDisposition?: string | undefined;
273
+ contentId?: string | undefined;
274
+ }, {
275
+ id: string;
276
+ filename: string;
277
+ contentType: string;
278
+ contentDisposition?: string | undefined;
279
+ contentId?: string | undefined;
280
+ }>, "many">>;
281
+ receivedAt: z.ZodString;
282
+ content: z.ZodDefault<z.ZodString>;
283
+ folder: z.ZodEnum<["inbox", "read", "sent"]>;
284
+ action: z.ZodOptional<z.ZodString>;
285
+ processing: z.ZodOptional<z.ZodBoolean>;
286
+ processingStartedAt: z.ZodOptional<z.ZodString>;
287
+ }, "strip", z.ZodTypeAny, {
288
+ id: string;
289
+ content: string;
290
+ emailId: string;
291
+ from: string;
292
+ to: string[];
293
+ cc: string[];
294
+ bcc: string[];
295
+ subject: string;
296
+ messageId: string;
297
+ attachments: {
298
+ id: string;
299
+ filename: string;
300
+ contentType: string;
301
+ contentDisposition?: string | undefined;
302
+ contentId?: string | undefined;
303
+ }[];
304
+ receivedAt: string;
305
+ folder: "inbox" | "read" | "sent";
306
+ action?: string | undefined;
307
+ processing?: boolean | undefined;
308
+ processingStartedAt?: string | undefined;
309
+ }, {
310
+ id: string;
311
+ emailId: string;
312
+ from: string;
313
+ to: string[];
314
+ subject: string;
315
+ messageId: string;
316
+ receivedAt: string;
317
+ folder: "inbox" | "read" | "sent";
318
+ content?: string | undefined;
319
+ action?: string | undefined;
320
+ cc?: string[] | undefined;
321
+ bcc?: string[] | undefined;
322
+ attachments?: {
323
+ id: string;
324
+ filename: string;
325
+ contentType: string;
326
+ contentDisposition?: string | undefined;
327
+ contentId?: string | undefined;
328
+ }[] | undefined;
329
+ processing?: boolean | undefined;
330
+ processingStartedAt?: string | undefined;
331
+ }>;
332
+ SaveMailInputSchema: z.ZodObject<{
333
+ emailId: z.ZodString;
334
+ from: z.ZodString;
335
+ to: z.ZodArray<z.ZodString, "many">;
336
+ cc: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
337
+ bcc: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
338
+ subject: z.ZodDefault<z.ZodString>;
339
+ messageId: z.ZodDefault<z.ZodString>;
340
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
341
+ id: z.ZodString;
342
+ filename: z.ZodString;
343
+ contentType: z.ZodString;
344
+ contentDisposition: z.ZodOptional<z.ZodString>;
345
+ contentId: z.ZodOptional<z.ZodString>;
346
+ }, "strip", z.ZodTypeAny, {
347
+ id: string;
348
+ filename: string;
349
+ contentType: string;
350
+ contentDisposition?: string | undefined;
351
+ contentId?: string | undefined;
352
+ }, {
353
+ id: string;
354
+ filename: string;
355
+ contentType: string;
356
+ contentDisposition?: string | undefined;
357
+ contentId?: string | undefined;
358
+ }>, "many">>;
359
+ receivedAt: z.ZodOptional<z.ZodString>;
360
+ content: z.ZodDefault<z.ZodString>;
361
+ }, "strip", z.ZodTypeAny, {
362
+ content: string;
363
+ emailId: string;
364
+ from: string;
365
+ to: string[];
366
+ cc: string[];
367
+ bcc: string[];
368
+ subject: string;
369
+ messageId: string;
370
+ attachments: {
371
+ id: string;
372
+ filename: string;
373
+ contentType: string;
374
+ contentDisposition?: string | undefined;
375
+ contentId?: string | undefined;
376
+ }[];
377
+ receivedAt?: string | undefined;
378
+ }, {
379
+ emailId: string;
380
+ from: string;
381
+ to: string[];
382
+ content?: string | undefined;
383
+ cc?: string[] | undefined;
384
+ bcc?: string[] | undefined;
385
+ subject?: string | undefined;
386
+ messageId?: string | undefined;
387
+ attachments?: {
388
+ id: string;
389
+ filename: string;
390
+ contentType: string;
391
+ contentDisposition?: string | undefined;
392
+ contentId?: string | undefined;
393
+ }[] | undefined;
394
+ receivedAt?: string | undefined;
395
+ }>;
396
+ SetMailStatusInputSchema: z.ZodObject<{
397
+ status: z.ZodEnum<["read", "unread"]>;
398
+ }, "strip", z.ZodTypeAny, {
399
+ status: "read" | "unread";
400
+ }, {
401
+ status: "read" | "unread";
402
+ }>;
403
+ ReplyMailInputSchema: z.ZodObject<{
404
+ content: z.ZodString;
405
+ }, "strip", z.ZodTypeAny, {
406
+ content: string;
407
+ }, {
408
+ content: string;
409
+ }>;
410
+ AddMailActionInputSchema: z.ZodObject<{
411
+ id: z.ZodString;
412
+ action: z.ZodString;
413
+ }, "strip", z.ZodTypeAny, {
414
+ id: string;
415
+ action: string;
416
+ }, {
417
+ id: string;
418
+ action: string;
419
+ }>;
420
+ };
421
+ export declare const mailJsonSchemas: {
422
+ list: Record<string, unknown>;
423
+ get: Record<string, unknown>;
424
+ save: Record<string, unknown>;
425
+ setStatus: Record<string, unknown>;
426
+ reply: Record<string, unknown>;
427
+ delete: Record<string, unknown>;
428
+ addAction: Record<string, unknown>;
429
+ };
430
+ //# sourceMappingURL=mail.d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