Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/web/app/api/google/webhook/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ async function processWebhookAsync(
} catch (error) {
await handleWebhookError(error, {
email: decodedData.emailAddress,
emailAccountId: "unknown", // TODO: add emailAccountId
url: "/api/google/webhook",
logger,
});
Expand Down
1 change: 1 addition & 0 deletions apps/web/app/api/outlook/webhook/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ async function processNotificationsAsync(
if (emailAccount?.email) {
await handleWebhookError(error, {
email: emailAccount.email,
emailAccountId: emailAccount.id,
url: "/api/outlook/webhook",
logger,
});
Expand Down
146 changes: 0 additions & 146 deletions apps/web/utils/actions/middleware.ts

This file was deleted.

2 changes: 1 addition & 1 deletion apps/web/utils/ai/assistant/process-user-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ ${stringifyEmailSimple(getEmailForLLM(originalEmail))}
const modelOptions = getModel(emailAccount.user, "chat");

const generateText = createGenerateText({
userEmail: emailAccount.email,
emailAccount,
label: "Process user request",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/calendar/availability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ${threadContent}
const modelOptions = getModel(emailAccount.user);

const generateText = createGenerateText({
userEmail: emailAccount.email,
emailAccount,
label: "Calendar availability analysis",
modelOptions,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ${formatCategoriesForPrompt(categories)}
const modelOptions = getModel(emailAccount.user, "economy");

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Categorize senders bulk",
modelOptions,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ${formatCategoriesForPrompt(categories)}
const modelOptions = getModel(emailAccount.user);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Categorize sender",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/choose-rule/ai-choose-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export async function aiGenerateArgs({

const generateObject = createGenerateObject({
label: "Args for rule",
userEmail: emailAccount.email,
emailAccount,
modelOptions,
});

Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/choose-rule/ai-choose-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async function getAiResponse(options: GetAiResponseOptions): Promise<{
const modelOptions = getModel(emailAccount.user, modelType);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Choose rule",
modelOptions,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ${getEmailListPrompt({ messages: emails, messageMaxLength: 500 })}
const modelOptions = getModel(emailAccount.user, "chat");

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Detect recurring pattern",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/clean/ai-clean-select-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ${instructions}
const modelOptions = getModel(emailAccount.user);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Clean - Select Labels",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/clean/ai-clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ The current date is ${currentDate}.
const modelOptions = getModel(emailAccount.user);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Clean",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/digest/summarize-email-for-digest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ${getUserInfoPrompt({ emailAccount })}`;
const modelOptions = getModel(emailAccount.user);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Summarize email",
modelOptions,
});
Expand Down
4 changes: 2 additions & 2 deletions apps/web/utils/ai/group/create-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Key guidelines:
const modelOptions = getModel(emailAccount.user);

const generateText = createGenerateText({
userEmail: emailAccount.email,
emailAccount,
label: "Create group",
modelOptions,
});
Expand Down Expand Up @@ -154,7 +154,7 @@ Guidelines:
const modelOptions = getModel(emailAccount.user);

const generateText = createGenerateText({
userEmail: emailAccount.email,
emailAccount,
label: "Verify group criteria",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/knowledge/extract-from-email-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export async function aiExtractFromEmailHistory({
const modelOptions = getModel(emailAccount.user, "economy");

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Email history extraction",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/knowledge/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export async function aiExtractRelevantKnowledge({
const modelOptions = getModel(emailAccount.user, "economy");

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Knowledge extraction",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/knowledge/persona.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ ${getEmailListPrompt({ messages: emails, messageMaxLength: 1000 })}
const modelOptions = getModel(emailAccount.user, "economy");

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Persona Analysis",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/knowledge/writing-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ${getUserInfoPrompt({ emailAccount })}`;
const modelOptions = getModel(emailAccount.user);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Writing Style Analysis",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/mcp/mcp-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ${getEmailListPrompt({ messages, messageMaxLength: 1000, maxMessages: 5 })}
const modelOptions = getModel(emailAccount.user, "economy");

const generateText = createGenerateText({
userEmail: emailAccount.email,
emailAccount,
label: "MCP Agent",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/reply/check-if-needs-reply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Decide if the message we are sending needs a reply. Respond with a JSON object w
const modelOptions = getModel(emailAccount.user);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Check if needs reply",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/reply/determine-thread-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Based on the full thread context above, determine the current status of this thr
const modelOptions = getModel(emailAccount.user, modelType);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Determine thread status",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/reply/draft-with-knowledge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export async function aiDraftWithKnowledge({
const modelOptions = getModel(emailAccount.user);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "Email draft with knowledge",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/reply/generate-nudge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ IMPORTANT: The person you're writing an email for is: ${messages.at(-1)?.from}.`

const generateText = createGenerateText({
label: "Reply",
userEmail: emailAccount.email,
emailAccount,
modelOptions,
});

Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/reply/reply-context-collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ ${getTodayForLLM()}`;
const modelOptions = getModel(emailAccount.user, "economy");

const generateText = createGenerateText({
userEmail: emailAccount.email,
emailAccount,
label: "Reply context collector",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/report/analyze-email-behavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Analyze the email patterns and identify:
const modelOptions = getModel(emailAccount.user, "economy");

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "email-report-email-behavior",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/report/analyze-label-optimization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Each suggestion should include the reason and expected impact.`;
const modelOptions = getModel(emailAccount.user, "economy");

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "email-report-label-analysis",
modelOptions,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/ai/report/build-user-persona.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Analyze the data and identify:
const modelOptions = getModel(emailAccount.user);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "email-report-user-persona",
modelOptions,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Focus on practical, implementable solutions that improve email organization and
const modelOptions = getModel(emailAccount.user);

const generateObject = createGenerateObject({
userEmail: emailAccount.email,
emailAccount,
label: "email-report-actionable-recommendations",
modelOptions,
});
Expand Down
Loading
Loading