@elizaos/plugin-inbox 2.0.3-beta.6 → 2.0.3-beta.7
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/actions/inbox.d.ts +69 -0
- package/dist/actions/inbox.d.ts.map +1 -0
- package/dist/actions/inbox.js +345 -0
- package/dist/actions/inbox.js.map +1 -0
- package/dist/components/inbox/InboxSpatialView.d.ts +54 -0
- package/dist/components/inbox/InboxSpatialView.d.ts.map +1 -0
- package/dist/components/inbox/InboxSpatialView.js +171 -0
- package/dist/components/inbox/InboxSpatialView.js.map +1 -0
- package/dist/components/inbox/InboxView.d.ts +64 -0
- package/dist/components/inbox/InboxView.d.ts.map +1 -0
- package/dist/components/inbox/InboxView.js +169 -0
- package/dist/components/inbox/InboxView.js.map +1 -0
- package/dist/components/inbox/inbox-view-bundle.d.ts +2 -0
- package/dist/components/inbox/inbox-view-bundle.d.ts.map +1 -0
- package/dist/components/inbox/inbox-view-bundle.js +5 -0
- package/dist/components/inbox/inbox-view-bundle.js.map +1 -0
- package/dist/db/index.d.ts +3 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +3 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/schema.d.ts +1729 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +79 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/db/sql.d.ts +32 -0
- package/dist/db/sql.d.ts.map +1 -0
- package/dist/db/sql.js +130 -0
- package/dist/db/sql.js.map +1 -0
- package/dist/inbox/channel-deep-links.d.ts +7 -0
- package/dist/inbox/channel-deep-links.d.ts.map +1 -0
- package/dist/inbox/channel-deep-links.js +97 -0
- package/dist/inbox/channel-deep-links.js.map +1 -0
- package/dist/inbox/config.d.ts +7 -0
- package/dist/inbox/config.d.ts.map +1 -0
- package/dist/inbox/config.js +61 -0
- package/dist/inbox/config.js.map +1 -0
- package/dist/inbox/email-curation.d.ts +174 -0
- package/dist/inbox/email-curation.d.ts.map +1 -0
- package/dist/inbox/email-curation.js +1056 -0
- package/dist/inbox/email-curation.js.map +1 -0
- package/dist/inbox/email-unsubscribe-types.d.ts +71 -0
- package/dist/inbox/email-unsubscribe-types.d.ts.map +1 -0
- package/dist/inbox/email-unsubscribe-types.js +1 -0
- package/dist/inbox/email-unsubscribe-types.js.map +1 -0
- package/dist/inbox/gmail-normalize.d.ts +99 -0
- package/dist/inbox/gmail-normalize.d.ts.map +1 -0
- package/dist/inbox/gmail-normalize.js +937 -0
- package/dist/inbox/gmail-normalize.js.map +1 -0
- package/dist/inbox/google-gmail-seam.d.ts +52 -0
- package/dist/inbox/google-gmail-seam.d.ts.map +1 -0
- package/dist/inbox/google-gmail-seam.js +263 -0
- package/dist/inbox/google-gmail-seam.js.map +1 -0
- package/dist/inbox/message-fetcher.d.ts +47 -0
- package/dist/inbox/message-fetcher.d.ts.map +1 -0
- package/dist/inbox/message-fetcher.js +461 -0
- package/dist/inbox/message-fetcher.js.map +1 -0
- package/dist/inbox/migration.d.ts +46 -0
- package/dist/inbox/migration.d.ts.map +1 -0
- package/dist/inbox/migration.js +114 -0
- package/dist/inbox/migration.js.map +1 -0
- package/dist/inbox/reflection.d.ts +40 -0
- package/dist/inbox/reflection.d.ts.map +1 -0
- package/dist/inbox/reflection.js +142 -0
- package/dist/inbox/reflection.js.map +1 -0
- package/dist/inbox/repository.d.ts +58 -0
- package/dist/inbox/repository.d.ts.map +1 -0
- package/dist/inbox/repository.js +376 -0
- package/dist/inbox/repository.js.map +1 -0
- package/dist/inbox/service.d.ts +149 -0
- package/dist/inbox/service.d.ts.map +1 -0
- package/dist/inbox/service.js +247 -0
- package/dist/inbox/service.js.map +1 -0
- package/dist/inbox/triage-classifier.d.ts +28 -0
- package/dist/inbox/triage-classifier.d.ts.map +1 -0
- package/dist/inbox/triage-classifier.js +306 -0
- package/dist/inbox/triage-classifier.js.map +1 -0
- package/dist/inbox/types.d.ts +124 -0
- package/dist/inbox/types.d.ts.map +1 -0
- package/dist/inbox/types.js +1 -0
- package/dist/inbox/types.js.map +1 -0
- package/dist/inbox/unsubscribe-repository.d.ts +14 -0
- package/dist/inbox/unsubscribe-repository.d.ts.map +1 -0
- package/dist/inbox/unsubscribe-repository.js +112 -0
- package/dist/inbox/unsubscribe-repository.js.map +1 -0
- package/dist/inbox/unsubscribe-service.d.ts +41 -0
- package/dist/inbox/unsubscribe-service.d.ts.map +1 -0
- package/dist/inbox/unsubscribe-service.js +351 -0
- package/dist/inbox/unsubscribe-service.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +4 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +38 -0
- package/dist/plugin.js.map +1 -0
- package/dist/providers/cross-channel-context.d.ts +21 -0
- package/dist/providers/cross-channel-context.d.ts.map +1 -0
- package/dist/providers/cross-channel-context.js +96 -0
- package/dist/providers/cross-channel-context.js.map +1 -0
- package/dist/providers/inbox-triage.d.ts +12 -0
- package/dist/providers/inbox-triage.d.ts.map +1 -0
- package/dist/providers/inbox-triage.js +98 -0
- package/dist/providers/inbox-triage.js.map +1 -0
- package/dist/register-terminal-view.d.ts +15 -0
- package/dist/register-terminal-view.d.ts.map +1 -0
- package/dist/register-terminal-view.js +21 -0
- package/dist/register-terminal-view.js.map +1 -0
- package/dist/register.d.ts +9 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +5 -0
- package/dist/register.js.map +1 -0
- package/dist/types.d.ts +42 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +25 -0
- package/dist/types.js.map +1 -0
- package/dist/views/bundle.js +315 -0
- package/dist/views/bundle.js.map +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/inbox/triage-classifier.ts"],"sourcesContent":["import type { IAgentRuntime } from \"@elizaos/core\";\nimport {\n logger,\n ModelType,\n parseJsonModelRecord,\n resolveOptimizedPromptForRuntime,\n runWithTrajectoryContext,\n} from \"@elizaos/core\";\nimport type {\n InboundMessage,\n InboxTriageConfig,\n TriageClassification,\n TriageExample,\n TriageResult,\n} from \"./types.js\";\n\n// ---------------------------------------------------------------------------\n// LLM-based classification\n// ---------------------------------------------------------------------------\n\nexport class InboxTriageClassificationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"InboxTriageClassificationError\";\n }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction formatPromptScalar(value: unknown, maxLength = 600): string {\n if (value === null || value === undefined) {\n return \"\";\n }\n return String(value).replace(/\\s+/g, \" \").trim().slice(0, maxLength);\n}\n\n/**\n * Classify a batch of messages using the LLM. Returns one TriageResult per\n * input message, in the same order.\n */\nexport async function classifyMessages(\n runtime: IAgentRuntime,\n messages: InboundMessage[],\n opts: {\n config?: InboxTriageConfig;\n examples?: TriageExample[];\n ownerContext?: string;\n },\n): Promise<TriageResult[]> {\n if (messages.length === 0) return [];\n\n const results: TriageResult[] = [];\n\n // Process in batches of 10 to avoid prompt length issues\n const batchSize = 10;\n for (let i = 0; i < messages.length; i += batchSize) {\n const batch = messages.slice(i, i + batchSize);\n const batchResults = await classifyBatch(runtime, batch, opts);\n results.push(...batchResults);\n }\n\n return results;\n}\n\nasync function classifyBatch(\n runtime: IAgentRuntime,\n messages: InboundMessage[],\n opts: {\n config?: InboxTriageConfig;\n examples?: TriageExample[];\n ownerContext?: string;\n },\n): Promise<TriageResult[]> {\n const prompt = buildTriagePrompt(messages, { ...opts, runtime });\n\n let rawResponse = \"\";\n try {\n const result = await runWithTrajectoryContext(\n { purpose: \"inbox_triage\" },\n () => runtime.useModel(ModelType.TEXT_SMALL, { prompt }),\n );\n rawResponse = typeof result === \"string\" ? result : \"\";\n } catch (error) {\n logger.warn(\n {\n src: \"inbox-classifier\",\n error: error instanceof Error ? error.message : String(error),\n },\n \"[InboxTriageClassifier] LLM classification failed\",\n );\n throw new InboxTriageClassificationError(\n \"Inbox classification model call failed.\",\n );\n }\n\n return parseTriageResults(rawResponse, messages.length);\n}\n\n/**\n * Static classification instructions for the inbox-triage task. Exposed as the\n * optimizable baseline so {@link resolveOptimizedPromptForRuntime} can swap in a\n * GEPA-optimized `inbox_triage` artifact when one is registered (#8795). The\n * dynamic owner context / examples / messages are scaffolded around it below.\n */\nexport const INBOX_TRIAGE_INSTRUCTIONS = [\n \"Classify each message into one of these categories:\",\n \"\",\n \"- ignore: spam, irrelevant, automated notifications, bot messages, or general chat that needs no attention\",\n \"- info: informational updates the owner might want to see but doesn't need to act on\",\n \"- notify: important information the owner should see, but no response is needed\",\n \"- needs_reply: someone is asking a question or expects a response from the owner\",\n \"- urgent: time-sensitive, critical, or from a priority contact — needs immediate attention\",\n \"\",\n \"For each message, also provide:\",\n \"- urgency: low / medium / high\",\n \"- confidence: 0.0 to 1.0 (how sure you are about this classification)\",\n \"- reasoning: brief explanation\",\n \"- suggestedResponse: (optional) a brief draft response if classification is needs_reply or urgent\",\n].join(\"\\n\");\n\nexport function buildTriagePrompt(\n messages: InboundMessage[],\n opts: {\n config?: InboxTriageConfig;\n examples?: TriageExample[];\n ownerContext?: string;\n runtime?: IAgentRuntime;\n },\n): string {\n const sections: string[] = [];\n\n const instructions = opts.runtime\n ? resolveOptimizedPromptForRuntime(\n opts.runtime,\n \"inbox_triage\",\n INBOX_TRIAGE_INSTRUCTIONS,\n )\n : INBOX_TRIAGE_INSTRUCTIONS;\n sections.push(instructions);\n\n // Owner context\n if (opts.ownerContext) {\n sections.push(\"\", \"Owner context:\", opts.ownerContext);\n }\n\n // Priority senders/channels\n const config = opts.config;\n if (config?.prioritySenders?.length) {\n sections.push(\"\", \"Priority senders (treat as higher urgency):\");\n for (const [index, sender] of config.prioritySenders.entries()) {\n sections.push(`prioritySenders[${index}]: ${formatPromptScalar(sender)}`);\n }\n }\n if (config?.priorityChannels?.length) {\n sections.push(\"\", \"Priority channels:\");\n for (const [index, channel] of config.priorityChannels.entries()) {\n sections.push(\n `priorityChannels[${index}]: ${formatPromptScalar(channel)}`,\n );\n }\n }\n\n // Few-shot examples\n if (opts.examples && opts.examples.length > 0) {\n sections.push(\"\", \"Examples from past triage decisions:\");\n for (const [index, ex] of opts.examples.slice(0, 5).entries()) {\n sections.push(\n `examples[${index}]:`,\n ` source: ${formatPromptScalar(ex.source, 120)}`,\n ` snippet: ${formatPromptScalar(ex.snippet, 160)}`,\n ` classification: ${ex.classification}`,\n ` ownerClassification: ${ex.ownerClassification ?? \"\"}`,\n );\n }\n }\n\n // Messages to classify\n sections.push(\"\", \"Messages to classify:\", \"\");\n for (const [index, msg] of messages.entries()) {\n const gmailHints: string[] = [];\n if (msg.gmailIsImportant) gmailHints.push(\"Gmail-marked-important\");\n if (msg.gmailLikelyReplyNeeded)\n gmailHints.push(\"Gmail-likely-reply-needed\");\n\n sections.push(\n `messages[${index}]:`,\n ` source: ${formatPromptScalar(msg.source, 120)}`,\n ` channelName: ${formatPromptScalar(msg.channelName, 160)}`,\n ` channelType: ${msg.channelType}`,\n ` senderName: ${formatPromptScalar(msg.senderName, 160)}`,\n );\n for (const [hintIndex, hint] of gmailHints.entries()) {\n sections.push(` hints[${hintIndex}]: ${hint}`);\n }\n sections.push(` text: ${formatPromptScalar(msg.text, 500)}`);\n if (msg.threadMessages && msg.threadMessages.length > 0) {\n for (const [threadIndex, threadMessage] of msg.threadMessages\n .slice(-5)\n .entries()) {\n sections.push(\n ` threadMessages[${threadIndex}]: ${formatPromptScalar(threadMessage, 240)}`,\n );\n }\n }\n sections.push(\"\");\n }\n\n sections.push(\n \"Return JSON only as a single object with one results array entry per message in the same order.\",\n \"Use this exact shape:\",\n '{\"results\":[{\"classification\":\"ignore|info|notify|needs_reply|urgent\",\"urgency\":\"low|medium|high\",\"confidence\":0.0,\"reasoning\":\"brief explanation\",\"suggestedResponse\":null}]}',\n // The `a|b|c` placeholders above list the allowed values — they are NOT\n // literal output. Smaller/local models otherwise echo the pipe string\n // (\"urgent|ignore\"), which fails strict validation. Be explicit.\n 'For \"classification\" output exactly one of: ignore, info, notify, needs_reply, urgent.',\n 'For \"urgency\" output exactly one of: low, medium, high.',\n 'Choose a single value per field — never output the \"|\" character or more than one option.',\n \"suggestedResponse may be a brief draft response when useful, otherwise null.\",\n \"\",\n \"No prose, markdown, code fences, or <think>.\",\n );\n\n return sections.join(\"\\n\");\n}\n\n// Legacy JSON fallback: strip a surrounding markdown code fence from older\n// model output, e.g. ```json\\n[...]\\n``` or ```\\n[...]\\n```.\nconst TRIAGE_CODE_FENCE_PATTERN =\n /^\\s*```(?:json|json5)?\\s*\\r?\\n?([\\s\\S]*?)\\r?\\n?```\\s*$/i;\n\n// Parse a legacy JSON array returned by older classifier prompts. We tolerate\n// code fences and leading <think> blocks, but we do NOT regex-slice an array\n// out of arbitrary prose because that silently accepts malformed output.\nfunction parseTriageJsonArray(raw: string): unknown[] {\n let candidate = raw.trim();\n if (candidate.length === 0) {\n throw new InboxTriageClassificationError(\n \"Inbox classification returned an empty response.\",\n );\n }\n // Strip a leading <think>...</think> block (some reasoning models emit one).\n const thinkEnd = candidate.indexOf(\"</think>\");\n if (candidate.startsWith(\"<think>\") && thinkEnd !== -1) {\n candidate = candidate.slice(thinkEnd + \"</think>\".length).trim();\n }\n const fenced = candidate.match(TRIAGE_CODE_FENCE_PATTERN);\n if (fenced) {\n candidate = (fenced[1] ?? \"\").trim();\n }\n if (!candidate.startsWith(\"[\")) {\n throw new InboxTriageClassificationError(\n \"Inbox classification did not return a JSON array.\",\n );\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(candidate) as unknown;\n } catch (error) {\n logger.warn(\n { src: \"inbox-classifier\", error: String(error) },\n \"[InboxTriageClassifier] failed to parse LLM classification JSON\",\n );\n throw new InboxTriageClassificationError(\n \"Inbox classification JSON parsing failed.\",\n );\n }\n if (!Array.isArray(parsed)) {\n throw new InboxTriageClassificationError(\n \"Inbox classification did not return a JSON array.\",\n );\n }\n return parsed;\n}\n\nfunction asStructuredArray(value: unknown): unknown[] | null {\n return Array.isArray(value) ? value : null;\n}\n\nfunction parseTriageJsonObjectArray(raw: string): unknown[] | null {\n const parsed = parseJsonModelRecord<Record<string, unknown>>(raw);\n if (!parsed) {\n return null;\n }\n\n const directArray =\n asStructuredArray(parsed.results) ??\n asStructuredArray(parsed.messages) ??\n asStructuredArray(parsed.items) ??\n asStructuredArray(parsed.classifications);\n if (directArray) {\n return directArray;\n }\n\n const classifications = asStructuredArray(parsed.classification);\n if (!classifications) {\n return null;\n }\n\n const urgencies = asStructuredArray(parsed.urgency) ?? [];\n const confidences = asStructuredArray(parsed.confidence) ?? [];\n const reasonings = asStructuredArray(parsed.reasoning) ?? [];\n const suggestedResponses =\n asStructuredArray(parsed.suggestedResponse) ??\n asStructuredArray(parsed.suggested_response) ??\n [];\n\n return classifications.map((classification, index) => ({\n classification,\n urgency: urgencies[index],\n confidence: confidences[index],\n reasoning: reasonings[index],\n suggestedResponse: suggestedResponses[index],\n }));\n}\n\nfunction parseTriageStructuredArray(raw: string): unknown[] {\n const jsonParsed = parseTriageJsonObjectArray(raw);\n if (jsonParsed) {\n return jsonParsed;\n }\n return parseTriageJsonArray(raw);\n}\n\nfunction normalizeOptionalString(value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n const trimmed = value.trim();\n if (!trimmed || trimmed.toLowerCase() === \"null\") {\n return undefined;\n }\n return trimmed;\n}\n\nfunction parseTriageResults(\n raw: string,\n expectedCount: number,\n): TriageResult[] {\n const parsed = parseTriageStructuredArray(raw);\n\n const results: TriageResult[] = [];\n for (let i = 0; i < expectedCount; i++) {\n const item = parsed[i];\n if (!isRecord(item)) {\n throw new InboxTriageClassificationError(\n \"Inbox classification omitted one or more messages.\",\n );\n }\n const classification = validClassification(item.classification);\n const urgency = validUrgency(item.urgency);\n const confidence = validConfidence(item.confidence);\n if (!classification || !urgency || confidence === null) {\n throw new InboxTriageClassificationError(\n \"Inbox classification returned invalid structured fields.\",\n );\n }\n results.push({\n classification,\n urgency,\n confidence,\n reasoning: normalizeOptionalString(item.reasoning) ?? \"\",\n suggestedResponse: normalizeOptionalString(\n item.suggestedResponse ?? item.suggested_response,\n ),\n });\n }\n return results;\n}\n\n// ---------------------------------------------------------------------------\n// Validation helpers\n// ---------------------------------------------------------------------------\n\nconst VALID_CLASSIFICATIONS = new Set<TriageClassification>([\n \"ignore\",\n \"info\",\n \"notify\",\n \"needs_reply\",\n \"urgent\",\n]);\n\nconst VALID_URGENCIES = new Set([\"low\", \"medium\", \"high\"]);\n\nfunction validClassification(v: unknown): TriageClassification | null {\n if (typeof v === \"string\") {\n const normalized = v.trim().toLowerCase();\n if (VALID_CLASSIFICATIONS.has(normalized as TriageClassification)) {\n return normalized as TriageClassification;\n }\n }\n return null;\n}\n\nfunction validUrgency(v: unknown): \"low\" | \"medium\" | \"high\" | null {\n if (typeof v === \"string\") {\n const normalized = v.trim().toLowerCase();\n if (VALID_URGENCIES.has(normalized)) {\n return normalized as \"low\" | \"medium\" | \"high\";\n }\n }\n return null;\n}\n\nfunction validConfidence(v: unknown): number | null {\n const numeric =\n typeof v === \"string\" && v.trim().length > 0 ? Number(v.trim()) : v;\n if (\n typeof numeric === \"number\" &&\n Number.isFinite(numeric) &&\n numeric >= 0 &&\n numeric <= 1\n ) {\n return numeric;\n }\n return null;\n}\n"],"mappings":"AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAaA,MAAM,uCAAuC,MAAM;AAAA,EACxD,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;AAEA,SAAS,SAAS,OAAkD;AAClE,SAAO,QAAQ,KAAK,KAAK,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,mBAAmB,OAAgB,YAAY,KAAa;AACnE,MAAI,UAAU,QAAQ,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BAAI,IAA0B;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,kBAAkB,oBAAI,IAAI,CAAC,OAAO,UAAU,MAAM,CAAC;AAEzD,SAAS,oBAAoB,GAAyC;AACpE,MAAI,OAAO,MAAM,UAAU;AACzB,UAAM,aAAa,EAAE,KAAK,EAAE,YAAY;AACxC,QAAI,sBAAsB,IAAI,UAAkC,GAAG;AACjE,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,aAAa,GAA8C;AAClE,MAAI,OAAO,MAAM,UAAU;AACzB,UAAM,aAAa,EAAE,KAAK,EAAE,YAAY;AACxC,QAAI,gBAAgB,IAAI,UAAU,GAAG;AACnC,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,gBAAgB,GAA2B;AAClD,QAAM,UACJ,OAAO,MAAM,YAAY,EAAE,KAAK,EAAE,SAAS,IAAI,OAAO,EAAE,KAAK,CAAC,IAAI;AACpE,MACE,OAAO,YAAY,YACnB,OAAO,SAAS,OAAO,KACvB,WAAW,KACX,WAAW,GACX;AACA,WAAO;AAAA,EACT;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { UUID } from "@elizaos/core";
|
|
2
|
+
export type TriageClassification = "ignore" | "info" | "notify" | "needs_reply" | "urgent";
|
|
3
|
+
export type TriageUrgency = "low" | "medium" | "high";
|
|
4
|
+
export type OwnerAction = "confirmed" | "reclassified" | "edited_draft" | "ignored";
|
|
5
|
+
export interface InboundMessage {
|
|
6
|
+
/** Memory UUID (chat) or Gmail message ID (email). */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Connector source tag: "discord", "telegram", "gmail", etc. */
|
|
9
|
+
source: string;
|
|
10
|
+
/** elizaOS room UUID (chat channels only). */
|
|
11
|
+
roomId?: string;
|
|
12
|
+
/** Sender entity UUID. */
|
|
13
|
+
entityId?: string;
|
|
14
|
+
/** X DM conversation id when the source is x_dm. */
|
|
15
|
+
xConversationId?: string;
|
|
16
|
+
/** X user id to use for direct replies when the source is x_dm. */
|
|
17
|
+
xParticipantId?: string;
|
|
18
|
+
/** Human-readable sender name. */
|
|
19
|
+
senderName: string;
|
|
20
|
+
/** Sender email when the source provides one. */
|
|
21
|
+
senderEmail?: string;
|
|
22
|
+
/** Human-readable channel/conversation name. */
|
|
23
|
+
channelName: string;
|
|
24
|
+
/** Whether this is a DM or a group chat. */
|
|
25
|
+
channelType: "dm" | "group";
|
|
26
|
+
/** Full message text. */
|
|
27
|
+
text: string;
|
|
28
|
+
/** Short preview of the message. */
|
|
29
|
+
snippet: string;
|
|
30
|
+
/** Message timestamp (epoch ms). */
|
|
31
|
+
timestamp: number;
|
|
32
|
+
/** Platform deep link URL (if available). */
|
|
33
|
+
deepLink?: string;
|
|
34
|
+
/** Recent messages in the same thread (for context). */
|
|
35
|
+
threadMessages?: string[];
|
|
36
|
+
gmailMessageId?: string;
|
|
37
|
+
gmailIsImportant?: boolean;
|
|
38
|
+
gmailLikelyReplyNeeded?: boolean;
|
|
39
|
+
/** Stable per-conversation key. For chat: roomId. For Gmail: thread id. */
|
|
40
|
+
threadId?: string;
|
|
41
|
+
/** Identifies which Google grant the message came from when multiple Gmail accounts exist. */
|
|
42
|
+
gmailAccountId?: string;
|
|
43
|
+
/** Display label for the Gmail account (e.g., `work@example.com`). */
|
|
44
|
+
gmailAccountEmail?: string;
|
|
45
|
+
/** Local phone/iMessage identity that handled the message, when known. */
|
|
46
|
+
phoneAccountId?: string;
|
|
47
|
+
/** Human-readable label for the local phone identity. */
|
|
48
|
+
phoneAccountLabel?: string;
|
|
49
|
+
/** Local phone number that handled the message, when known. */
|
|
50
|
+
phoneNumber?: string;
|
|
51
|
+
/** ISO timestamp of when the user last viewed this thread. */
|
|
52
|
+
lastSeenAt?: string;
|
|
53
|
+
/** ISO timestamp if the user has replied since this message arrived. */
|
|
54
|
+
repliedAt?: string;
|
|
55
|
+
/** 0–100 score; higher = more important. */
|
|
56
|
+
priorityScore?: number;
|
|
57
|
+
/**
|
|
58
|
+
* DM, small/medium group chat, or public channel/broadcast.
|
|
59
|
+
* Mirrors the existing `channelType` field but with broader coverage; downstream
|
|
60
|
+
* code will migrate from `channelType` to `chatType` over time.
|
|
61
|
+
*/
|
|
62
|
+
chatType?: "dm" | "group" | "channel";
|
|
63
|
+
/** For groups, number of participants. */
|
|
64
|
+
participantCount?: number;
|
|
65
|
+
}
|
|
66
|
+
export interface TriageEntry {
|
|
67
|
+
id: string;
|
|
68
|
+
agentId: string;
|
|
69
|
+
source: string;
|
|
70
|
+
sourceRoomId: string | null;
|
|
71
|
+
sourceEntityId: string | null;
|
|
72
|
+
sourceMessageId: string | null;
|
|
73
|
+
channelName: string;
|
|
74
|
+
channelType: string;
|
|
75
|
+
deepLink: string | null;
|
|
76
|
+
classification: TriageClassification;
|
|
77
|
+
urgency: TriageUrgency;
|
|
78
|
+
confidence: number;
|
|
79
|
+
snippet: string;
|
|
80
|
+
senderName: string | null;
|
|
81
|
+
threadContext: string[] | null;
|
|
82
|
+
triageReasoning: string | null;
|
|
83
|
+
suggestedResponse: string | null;
|
|
84
|
+
draftResponse: string | null;
|
|
85
|
+
autoReplied: boolean;
|
|
86
|
+
resolved: boolean;
|
|
87
|
+
resolvedAt: string | null;
|
|
88
|
+
createdAt: string;
|
|
89
|
+
updatedAt: string;
|
|
90
|
+
}
|
|
91
|
+
export interface TriageExample {
|
|
92
|
+
id: string;
|
|
93
|
+
agentId: string;
|
|
94
|
+
source: string;
|
|
95
|
+
snippet: string;
|
|
96
|
+
classification: TriageClassification;
|
|
97
|
+
ownerAction: OwnerAction;
|
|
98
|
+
ownerClassification: TriageClassification | null;
|
|
99
|
+
contextJson: Record<string, unknown>;
|
|
100
|
+
createdAt: string;
|
|
101
|
+
}
|
|
102
|
+
export interface TriageResult {
|
|
103
|
+
classification: TriageClassification;
|
|
104
|
+
urgency: TriageUrgency;
|
|
105
|
+
confidence: number;
|
|
106
|
+
reasoning: string;
|
|
107
|
+
suggestedResponse?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface DeferredInboxDraft {
|
|
110
|
+
triageEntryId: string;
|
|
111
|
+
source: string;
|
|
112
|
+
targetRoomId?: UUID;
|
|
113
|
+
targetEntityId?: UUID;
|
|
114
|
+
gmailMessageId?: string;
|
|
115
|
+
xConversationId?: string;
|
|
116
|
+
xParticipantId?: string;
|
|
117
|
+
approvalRequestId?: string;
|
|
118
|
+
draftText: string;
|
|
119
|
+
deepLink: string | null;
|
|
120
|
+
channelName: string;
|
|
121
|
+
senderName: string;
|
|
122
|
+
}
|
|
123
|
+
export type { InboxAutoReplyConfig, InboxTriageConfig, InboxTriageRules, } from "@elizaos/shared";
|
|
124
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/inbox/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAM1C,MAAM,MAAM,oBAAoB,GAC5B,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,aAAa,GACb,QAAQ,CAAC;AAEb,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEtD,MAAM,MAAM,WAAW,GACnB,WAAW,GACX,cAAc,GACd,cAAc,GACd,SAAS,CAAC;AAMd,MAAM,WAAW,cAAc;IAC7B,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB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B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAMD,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IAgentRuntime } from "@elizaos/core";
|
|
2
|
+
import type { EmailUnsubscribeRecord } from "./email-unsubscribe-types.js";
|
|
3
|
+
export declare class InboxUnsubscribeRepository {
|
|
4
|
+
private readonly runtime;
|
|
5
|
+
constructor(runtime: IAgentRuntime);
|
|
6
|
+
private get agentId();
|
|
7
|
+
createEmailUnsubscribe(record: EmailUnsubscribeRecord): Promise<void>;
|
|
8
|
+
listEmailUnsubscribes(args?: {
|
|
9
|
+
limit?: number;
|
|
10
|
+
}): Promise<EmailUnsubscribeRecord[]>;
|
|
11
|
+
getEmailUnsubscribe(id: string): Promise<EmailUnsubscribeRecord | null>;
|
|
12
|
+
findEmailUnsubscribeBySender(senderEmail: string): Promise<EmailUnsubscribeRecord | null>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=unsubscribe-repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsubscribe-repository.d.ts","sourceRoot":"","sources":["../../src/inbox/unsubscribe-repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAanD,OAAO,KAAK,EAEV,sBAAsB,EAEvB,MAAM,8BAA8B,CAAC;AAsCtC,qBAAa,0BAA0B;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAEnD,OAAO,KAAK,OAAO,GAElB;IAEK,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BrE,qBAAqB,CACzB,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAC5B,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAa9B,mBAAmB,CACvB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAanC,4BAA4B,CAChC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;CAa1C"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import {
|
|
2
|
+
executeRawSql,
|
|
3
|
+
parseJsonRecord,
|
|
4
|
+
sqlBoolean,
|
|
5
|
+
sqlInteger,
|
|
6
|
+
sqlJson,
|
|
7
|
+
sqlQuote,
|
|
8
|
+
sqlText,
|
|
9
|
+
toBoolean,
|
|
10
|
+
toNumber,
|
|
11
|
+
toText
|
|
12
|
+
} from "../db/sql.js";
|
|
13
|
+
function parseEmailUnsubscribe(row) {
|
|
14
|
+
return {
|
|
15
|
+
id: toText(row.id),
|
|
16
|
+
agentId: toText(row.agent_id),
|
|
17
|
+
senderEmail: toText(row.sender_email),
|
|
18
|
+
senderDisplay: toText(row.sender_display),
|
|
19
|
+
senderDomain: row.sender_domain ? toText(row.sender_domain) : null,
|
|
20
|
+
listId: row.list_id ? toText(row.list_id) : null,
|
|
21
|
+
method: toText(row.method, "manual_only"),
|
|
22
|
+
status: toText(row.status, "failed"),
|
|
23
|
+
httpStatusCode: row.http_status_code === null || row.http_status_code === void 0 ? null : toNumber(row.http_status_code, 0),
|
|
24
|
+
httpFinalUrl: row.http_final_url ? toText(row.http_final_url) : null,
|
|
25
|
+
filterCreated: toBoolean(row.filter_created),
|
|
26
|
+
filterId: row.filter_id ? toText(row.filter_id) : null,
|
|
27
|
+
threadsTrashed: toNumber(row.threads_trashed, 0),
|
|
28
|
+
errorMessage: row.error_message ? toText(row.error_message) : null,
|
|
29
|
+
metadata: parseJsonRecord(row.metadata_json),
|
|
30
|
+
createdAt: toText(row.created_at),
|
|
31
|
+
updatedAt: toText(row.updated_at)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
class InboxUnsubscribeRepository {
|
|
35
|
+
constructor(runtime) {
|
|
36
|
+
this.runtime = runtime;
|
|
37
|
+
}
|
|
38
|
+
runtime;
|
|
39
|
+
get agentId() {
|
|
40
|
+
return this.runtime.agentId;
|
|
41
|
+
}
|
|
42
|
+
async createEmailUnsubscribe(record) {
|
|
43
|
+
await executeRawSql(
|
|
44
|
+
this.runtime,
|
|
45
|
+
`INSERT INTO app_inbox.life_email_unsubscribes (
|
|
46
|
+
id, agent_id, sender_email, sender_display, sender_domain, list_id,
|
|
47
|
+
method, status, http_status_code, http_final_url, filter_created,
|
|
48
|
+
filter_id, threads_trashed, error_message, metadata_json,
|
|
49
|
+
created_at, updated_at
|
|
50
|
+
) VALUES (
|
|
51
|
+
${sqlQuote(record.id)},
|
|
52
|
+
${sqlQuote(record.agentId)},
|
|
53
|
+
${sqlQuote(record.senderEmail)},
|
|
54
|
+
${sqlQuote(record.senderDisplay)},
|
|
55
|
+
${sqlText(record.senderDomain)},
|
|
56
|
+
${sqlText(record.listId)},
|
|
57
|
+
${sqlQuote(record.method)},
|
|
58
|
+
${sqlQuote(record.status)},
|
|
59
|
+
${record.httpStatusCode === null ? "NULL" : sqlInteger(record.httpStatusCode)},
|
|
60
|
+
${sqlText(record.httpFinalUrl)},
|
|
61
|
+
${sqlBoolean(record.filterCreated)},
|
|
62
|
+
${sqlText(record.filterId)},
|
|
63
|
+
${sqlInteger(record.threadsTrashed)},
|
|
64
|
+
${sqlText(record.errorMessage)},
|
|
65
|
+
${sqlJson(record.metadata)},
|
|
66
|
+
${sqlQuote(record.createdAt)},
|
|
67
|
+
${sqlQuote(record.updatedAt)}
|
|
68
|
+
)`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
async listEmailUnsubscribes(args = {}) {
|
|
72
|
+
const limit = Math.max(1, Math.min(500, Math.trunc(args.limit ?? 100)));
|
|
73
|
+
const rows = await executeRawSql(
|
|
74
|
+
this.runtime,
|
|
75
|
+
`SELECT *
|
|
76
|
+
FROM app_inbox.life_email_unsubscribes
|
|
77
|
+
WHERE agent_id = ${sqlQuote(this.agentId)}
|
|
78
|
+
ORDER BY created_at DESC
|
|
79
|
+
LIMIT ${limit}`
|
|
80
|
+
);
|
|
81
|
+
return rows.map(parseEmailUnsubscribe);
|
|
82
|
+
}
|
|
83
|
+
async getEmailUnsubscribe(id) {
|
|
84
|
+
const rows = await executeRawSql(
|
|
85
|
+
this.runtime,
|
|
86
|
+
`SELECT *
|
|
87
|
+
FROM app_inbox.life_email_unsubscribes
|
|
88
|
+
WHERE agent_id = ${sqlQuote(this.agentId)}
|
|
89
|
+
AND id = ${sqlQuote(id)}
|
|
90
|
+
LIMIT 1`
|
|
91
|
+
);
|
|
92
|
+
const row = rows[0];
|
|
93
|
+
return row ? parseEmailUnsubscribe(row) : null;
|
|
94
|
+
}
|
|
95
|
+
async findEmailUnsubscribeBySender(senderEmail) {
|
|
96
|
+
const rows = await executeRawSql(
|
|
97
|
+
this.runtime,
|
|
98
|
+
`SELECT *
|
|
99
|
+
FROM app_inbox.life_email_unsubscribes
|
|
100
|
+
WHERE agent_id = ${sqlQuote(this.agentId)}
|
|
101
|
+
AND sender_email = ${sqlQuote(senderEmail.trim().toLowerCase())}
|
|
102
|
+
ORDER BY created_at DESC
|
|
103
|
+
LIMIT 1`
|
|
104
|
+
);
|
|
105
|
+
const row = rows[0];
|
|
106
|
+
return row ? parseEmailUnsubscribe(row) : null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
InboxUnsubscribeRepository
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=unsubscribe-repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/inbox/unsubscribe-repository.ts"],"sourcesContent":["import type { IAgentRuntime } from \"@elizaos/core\";\nimport {\n executeRawSql,\n parseJsonRecord,\n sqlBoolean,\n sqlInteger,\n sqlJson,\n sqlQuote,\n sqlText,\n toBoolean,\n toNumber,\n toText,\n} from \"../db/sql.js\";\nimport type {\n EmailUnsubscribeMethod,\n EmailUnsubscribeRecord,\n EmailUnsubscribeStatus,\n} from \"./email-unsubscribe-types.js\";\n\n/**\n * Raw-SQL repository for the email-unsubscribe history.\n *\n * Reads/writes `app_inbox.life_email_unsubscribes`, the table PA still\n * registers + migrates (no data migration — the table name is preserved). Same\n * pattern as {@link InboxRepository}: a thin raw-SQL wrapper over the runtime DB\n * handle so this plugin carries no `@elizaos/plugin-personal-assistant`\n * dependency.\n */\nfunction parseEmailUnsubscribe(\n row: Record<string, unknown>,\n): EmailUnsubscribeRecord {\n return {\n id: toText(row.id),\n agentId: toText(row.agent_id),\n senderEmail: toText(row.sender_email),\n senderDisplay: toText(row.sender_display),\n senderDomain: row.sender_domain ? toText(row.sender_domain) : null,\n listId: row.list_id ? toText(row.list_id) : null,\n method: toText(row.method, \"manual_only\") as EmailUnsubscribeMethod,\n status: toText(row.status, \"failed\") as EmailUnsubscribeStatus,\n httpStatusCode:\n row.http_status_code === null || row.http_status_code === undefined\n ? null\n : toNumber(row.http_status_code, 0),\n httpFinalUrl: row.http_final_url ? toText(row.http_final_url) : null,\n filterCreated: toBoolean(row.filter_created),\n filterId: row.filter_id ? toText(row.filter_id) : null,\n threadsTrashed: toNumber(row.threads_trashed, 0),\n errorMessage: row.error_message ? toText(row.error_message) : null,\n metadata: parseJsonRecord(row.metadata_json),\n createdAt: toText(row.created_at),\n updatedAt: toText(row.updated_at),\n };\n}\n\nexport class InboxUnsubscribeRepository {\n constructor(private readonly runtime: IAgentRuntime) {}\n\n private get agentId(): string {\n return this.runtime.agentId;\n }\n\n async createEmailUnsubscribe(record: EmailUnsubscribeRecord): Promise<void> {\n await executeRawSql(\n this.runtime,\n `INSERT INTO app_inbox.life_email_unsubscribes (\n id, agent_id, sender_email, sender_display, sender_domain, list_id,\n method, status, http_status_code, http_final_url, filter_created,\n filter_id, threads_trashed, error_message, metadata_json,\n created_at, updated_at\n ) VALUES (\n ${sqlQuote(record.id)},\n ${sqlQuote(record.agentId)},\n ${sqlQuote(record.senderEmail)},\n ${sqlQuote(record.senderDisplay)},\n ${sqlText(record.senderDomain)},\n ${sqlText(record.listId)},\n ${sqlQuote(record.method)},\n ${sqlQuote(record.status)},\n ${record.httpStatusCode === null ? \"NULL\" : sqlInteger(record.httpStatusCode)},\n ${sqlText(record.httpFinalUrl)},\n ${sqlBoolean(record.filterCreated)},\n ${sqlText(record.filterId)},\n ${sqlInteger(record.threadsTrashed)},\n ${sqlText(record.errorMessage)},\n ${sqlJson(record.metadata)},\n ${sqlQuote(record.createdAt)},\n ${sqlQuote(record.updatedAt)}\n )`,\n );\n }\n\n async listEmailUnsubscribes(\n args: { limit?: number } = {},\n ): Promise<EmailUnsubscribeRecord[]> {\n const limit = Math.max(1, Math.min(500, Math.trunc(args.limit ?? 100)));\n const rows = await executeRawSql(\n this.runtime,\n `SELECT *\n FROM app_inbox.life_email_unsubscribes\n WHERE agent_id = ${sqlQuote(this.agentId)}\n ORDER BY created_at DESC\n LIMIT ${limit}`,\n );\n return rows.map(parseEmailUnsubscribe);\n }\n\n async getEmailUnsubscribe(\n id: string,\n ): Promise<EmailUnsubscribeRecord | null> {\n const rows = await executeRawSql(\n this.runtime,\n `SELECT *\n FROM app_inbox.life_email_unsubscribes\n WHERE agent_id = ${sqlQuote(this.agentId)}\n AND id = ${sqlQuote(id)}\n LIMIT 1`,\n );\n const row = rows[0];\n return row ? parseEmailUnsubscribe(row) : null;\n }\n\n async findEmailUnsubscribeBySender(\n senderEmail: string,\n ): Promise<EmailUnsubscribeRecord | null> {\n const rows = await executeRawSql(\n this.runtime,\n `SELECT *\n FROM app_inbox.life_email_unsubscribes\n WHERE agent_id = ${sqlQuote(this.agentId)}\n AND sender_email = ${sqlQuote(senderEmail.trim().toLowerCase())}\n ORDER BY created_at DESC\n LIMIT 1`,\n );\n const row = rows[0];\n return row ? parseEmailUnsubscribe(row) : null;\n }\n}\n"],"mappings":"AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAgBP,SAAS,sBACP,KACwB;AACxB,SAAO;AAAA,IACL,IAAI,OAAO,IAAI,EAAE;AAAA,IACjB,SAAS,OAAO,IAAI,QAAQ;AAAA,IAC5B,aAAa,OAAO,IAAI,YAAY;AAAA,IACpC,eAAe,OAAO,IAAI,cAAc;AAAA,IACxC,cAAc,IAAI,gBAAgB,OAAO,IAAI,aAAa,IAAI;AAAA,IAC9D,QAAQ,IAAI,UAAU,OAAO,IAAI,OAAO,IAAI;AAAA,IAC5C,QAAQ,OAAO,IAAI,QAAQ,aAAa;AAAA,IACxC,QAAQ,OAAO,IAAI,QAAQ,QAAQ;AAAA,IACnC,gBACE,IAAI,qBAAqB,QAAQ,IAAI,qBAAqB,SACtD,OACA,SAAS,IAAI,kBAAkB,CAAC;AAAA,IACtC,cAAc,IAAI,iBAAiB,OAAO,IAAI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AAO,SAAS,CAAC;AAAA;AAAA,IAEhC;AAAA,EACF;AAAA,EAEA,MAAM,sBACJ,OAA2B,CAAC,GACO;AACnC,UAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,MAAM,KAAK,SAAS,GAAG,CAAC,CAAC;AACtE,UAAM,OAAO,MAAM;AAAA,MACjB,KAAK;AAAA,MACL;AAAA;AAAA,2BAEqB,SAAS,KAAK,OAAO,CAAC;AAAA;AAAA,gBAEjC,KAAK;AAAA,IACjB;AACA,WAAO,KAAK,IAAI,qBAAqB;AAAA,EACvC;AAAA,EAEA,MAAM,oBACJ,IACwC;AACxC,UAAM,OAAO,MAAM;AAAA,MACjB,KAAK;AAAA,MACL;AAAA;AAAA,2BAEqB,SAAS,KAAK,OAAO,CAAC;AAAA,qBAC5B,SAAS,EAAE,CAAC;AAAA;AAAA,IAE7B;AACA,UAAM,MAAM,KAAK,CAAC;AAClB,WAAO,MAAM,sBAAsB,GAAG,IAAI;AAAA,EAC5C;AAAA,EAEA,MAAM,6BACJ,aACwC;AACxC,UAAM,OAAO,MAAM;AAAA,MACjB,KAAK;AAAA,MACL;AAAA;AAAA,2BAEqB,SAAS,KAAK,OAAO,CAAC;AAAA,+BAClB,SAAS,YAAY,KAAK,EAAE,YAAY,CAAC,CAAC;AAAA;AAAA;AAAA,IAGrE;AACA,UAAM,MAAM,KAAK,CAAC;AAClB,WAAO,MAAM,sBAAsB,GAAG,IAAI;AAAA,EAC5C;AACF;","names":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InboxUnsubscribeService — the email-unsubscribe back-end.
|
|
3
|
+
*
|
|
4
|
+
* Standalone successor to PA's `service-mixin-email-unsubscribe.ts` (a
|
|
5
|
+
* `this.`-bound `LifeOpsService` mixin). It scans Gmail for promotional senders,
|
|
6
|
+
* performs the List-Unsubscribe flow (HTTP one-click / GET / mailto), optionally
|
|
7
|
+
* creates a block filter and trashes existing threads, and records the outcome.
|
|
8
|
+
*
|
|
9
|
+
* Dependencies are resolved through seams so this plugin carries no
|
|
10
|
+
* `@elizaos/plugin-personal-assistant` dependency:
|
|
11
|
+
* - Gmail access via {@link createInboxGmailGateway} (the `@elizaos/plugin-google`
|
|
12
|
+
* runtime service).
|
|
13
|
+
* - Persistence via {@link InboxUnsubscribeRepository} (raw SQL over the
|
|
14
|
+
* `app_inbox.life_email_unsubscribes` table PA registers).
|
|
15
|
+
*
|
|
16
|
+
* Authorization: `unsubscribeEmailSender` requires `userAuthorization === true`.
|
|
17
|
+
* The two-phase confirmation gate (`requireConfirmation`) lives in the PA route
|
|
18
|
+
* layer that owns the HTTP surface; this service trusts the pre-confirmed flag.
|
|
19
|
+
*/
|
|
20
|
+
import type { IAgentRuntime } from "@elizaos/core";
|
|
21
|
+
import type { EmailSubscriptionScanResult, EmailUnsubscribeRecord, EmailUnsubscribeRequest, EmailUnsubscribeResult, EmailUnsubscribeScanRequest } from "./email-unsubscribe-types.js";
|
|
22
|
+
import { type InboxGmailGateway } from "./google-gmail-seam.js";
|
|
23
|
+
import { InboxUnsubscribeRepository } from "./unsubscribe-repository.js";
|
|
24
|
+
export interface InboxUnsubscribeServiceDeps {
|
|
25
|
+
/** Override the Gmail gateway (tests inject a mock; default resolves plugin-google). */
|
|
26
|
+
gmail?: InboxGmailGateway;
|
|
27
|
+
/** Override the persistence repository (tests inject a fake or PGlite-backed one). */
|
|
28
|
+
repository?: InboxUnsubscribeRepository;
|
|
29
|
+
}
|
|
30
|
+
export declare class InboxUnsubscribeService {
|
|
31
|
+
private readonly runtime;
|
|
32
|
+
private readonly gmail;
|
|
33
|
+
private readonly repository;
|
|
34
|
+
constructor(runtime: IAgentRuntime, deps?: InboxUnsubscribeServiceDeps);
|
|
35
|
+
private get agentId();
|
|
36
|
+
scanEmailSubscriptions(request?: EmailUnsubscribeScanRequest): Promise<EmailSubscriptionScanResult>;
|
|
37
|
+
unsubscribeEmailSender(request: EmailUnsubscribeRequest): Promise<EmailUnsubscribeResult>;
|
|
38
|
+
listEmailUnsubscribes(limit?: number): Promise<EmailUnsubscribeRecord[]>;
|
|
39
|
+
summarizeEmailUnsubscribeScan(result: EmailSubscriptionScanResult): string;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=unsubscribe-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsubscribe-service.d.ts","sourceRoot":"","sources":["../../src/inbox/unsubscribe-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAOnD,OAAO,KAAK,EACV,2BAA2B,EAG3B,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAE5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAqIzE,MAAM,WAAW,2BAA2B;IAC1C,wFAAwF;IACxF,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,sFAAsF;IACtF,UAAU,CAAC,EAAE,0BAA0B,CAAC;CACzC;AAED,qBAAa,uBAAuB;IAKhC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;gBAGrC,OAAO,EAAE,aAAa,EACvC,IAAI,GAAE,2BAAgC;IAQxC,OAAO,KAAK,OAAO,GAElB;IAEK,sBAAsB,CAC1B,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,2BAA2B,CAAC;IAyFjC,sBAAsB,CAC1B,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC;IA6J5B,qBAAqB,CAAC,KAAK,SAAM,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAM3E,6BAA6B,CAAC,MAAM,EAAE,2BAA2B,GAAG,MAAM;CAY3E"}
|