@agenticmail/enterprise 0.5.151 → 0.5.153
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/agenticmail-E4JLFCFR.js +19 -0
- package/dist/chunk-VEPWCYAL.js +1131 -0
- package/dist/cli-agent-7TWEYMAP.js +837 -0
- package/dist/cli-agent-F75N6PFL.js +836 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/agenticmail/providers/google.ts +6 -1
- package/src/cli-agent.ts +14 -5
package/dist/cli.js
CHANGED
|
@@ -50,7 +50,7 @@ Skill Development:
|
|
|
50
50
|
import("./cli-serve-DHVSPFW5.js").then((m) => m.runServe(args.slice(1))).catch(fatal);
|
|
51
51
|
break;
|
|
52
52
|
case "agent":
|
|
53
|
-
import("./cli-agent-
|
|
53
|
+
import("./cli-agent-7TWEYMAP.js").then((m) => m.runAgent(args.slice(1))).catch(fatal);
|
|
54
54
|
break;
|
|
55
55
|
case "setup":
|
|
56
56
|
default:
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -72,12 +72,17 @@ export class GoogleEmailProvider implements IEmailProvider {
|
|
|
72
72
|
|
|
73
73
|
// Batch fetch message metadata
|
|
74
74
|
const envelopes: EmailEnvelope[] = [];
|
|
75
|
+
let skipped = 0;
|
|
75
76
|
for (const msg of data.messages) {
|
|
76
77
|
try {
|
|
77
78
|
const detail = await this.gmailFetch(`/messages/${msg.id}?format=metadata&metadataHeaders=From&metadataHeaders=To&metadataHeaders=Subject&metadataHeaders=Date`);
|
|
78
79
|
envelopes.push(this.metadataToEnvelope(detail));
|
|
79
|
-
} catch
|
|
80
|
+
} catch (e: any) {
|
|
81
|
+
skipped++;
|
|
82
|
+
console.error(`[gmail] Failed to fetch metadata for ${msg.id}: ${e.message?.slice(0, 100)}`);
|
|
83
|
+
}
|
|
80
84
|
}
|
|
85
|
+
if (skipped > 0) console.warn(`[gmail] Skipped ${skipped}/${data.messages.length} messages due to errors`);
|
|
81
86
|
return envelopes;
|
|
82
87
|
}
|
|
83
88
|
|
package/src/cli-agent.ts
CHANGED
|
@@ -596,12 +596,21 @@ async function startEmailPolling(
|
|
|
596
596
|
|
|
597
597
|
async function pollOnce() {
|
|
598
598
|
try {
|
|
599
|
-
|
|
600
|
-
const
|
|
599
|
+
// Search for recent emails using after: filter (Gmail API can have eventual consistency delays)
|
|
600
|
+
const today = new Date().toISOString().split('T')[0]; // YYYY-MM-DD
|
|
601
|
+
const recentSearch = await emailProvider.searchMessages({ since: today }).catch(() => [] as any[]);
|
|
602
|
+
const inboxList = await emailProvider.listMessages('INBOX', { limit: 50 });
|
|
603
|
+
// Combine and deduplicate
|
|
604
|
+
const seenUids = new Set<string>();
|
|
605
|
+
const msgs: typeof inboxList = [];
|
|
606
|
+
for (const m of [...(recentSearch || []), ...inboxList]) {
|
|
607
|
+
if (!seenUids.has(m.uid)) { seenUids.add(m.uid); msgs.push(m); }
|
|
608
|
+
}
|
|
609
|
+
const newMessages = msgs.filter(m => !processedIds.has(m.uid));
|
|
601
610
|
if (newMessages.length > 0) {
|
|
602
|
-
console.log(`[email-poll] Found ${newMessages.length} new messages`);
|
|
603
|
-
} else {
|
|
604
|
-
console.log(`[email-poll] No new (${
|
|
611
|
+
console.log(`[email-poll] Found ${newMessages.length} new messages (${msgs.length} total, ${processedIds.size} known)`);
|
|
612
|
+
} else if (msgs.length < processedIds.size) {
|
|
613
|
+
console.log(`[email-poll] No new (${msgs.length} fetched < ${processedIds.size} known — possible API gap)`);
|
|
605
614
|
}
|
|
606
615
|
|
|
607
616
|
for (const envelope of newMessages) {
|