Files
Zero/apps/server/package.json
Adam a48775d42d refactor pipelines (#1696)
# Refactor Email Processing Pipeline to Use Effect Library

This PR refactors the email processing workflow from using Cloudflare Workers' Workflow API to using the Effect library for better error handling and functional programming patterns. The main changes include:

1. Replaced workflow-based implementation with Effect-based implementation
2. Added queue-based processing for thread notifications
3. Improved CORS handling with more robust origin validation
4. Fixed Google service account validation to properly handle empty JSON
5. Changed UI label from "Labels" to "Categories" in the mail component
6. Added selective query persistence in the query provider
7. Improved error handling throughout the notification pipeline

## Type of Change

-  New feature (non-breaking change which adds functionality)
-  Performance improvement

## Areas Affected

- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] Data Storage/Management
- [x] API Endpoints

## Testing Done

- [x] Manual testing performed

## Security Considerations

- [x] No sensitive data is exposed
- [x] Authentication checks are in place
- [x] Input validation is implemented

## Checklist

- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in complex areas
- [x] My changes generate no new warnings

## Additional Notes

The Effect library provides better error handling and composability compared to the previous workflow implementation. This change should improve reliability and maintainability of the email processing pipeline.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
  * Enhanced email processing with new effect-based workflows for email data handling, summarization, and vectorization.
  * Improved thread and message history retrieval capabilities with retry logic.

* **Bug Fixes**
  * Fixed label text in the mail UI from "Labels" to "Categories".
  * Improved error handling and validation for environment variables.

* **Refactor**
  * Major restructuring of workflow logic to use effect-based functions for better reliability and maintainability.
  * Simplified query cache invalidation and persistence logic.
  * Updated server workflow imports and exports to use new pipeline functions.
  * Streamlined server route logic for thread synchronization and authorization.
  * Replaced local prompt name helper with centralized implementation.

* **Chores**
  * Updated server dependencies.
  * Cleaned up configuration files by removing unused workflow bindings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-09 13:42:03 -07:00

91 lines
2.6 KiB
JSON

{
"name": "@zero/server",
"type": "module",
"private": true,
"scripts": {
"dev": "wrangler dev --show-interactive-dev-session=false --experimental-vectorize-bind-to-prod --env local",
"deploy": "wrangler deploy",
"types": "wrangler types --env local",
"lint": "eslint .",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio"
},
"exports": {
"./trpc": "./src/trpc/index.ts",
"./auth": "./src/lib/auth.ts",
"./auth-providers": "./src/lib/auth-providers.ts",
"./schemas": "./src/lib/schemas.ts"
},
"dependencies": {
"@ai-sdk/google": "^1.2.18",
"@ai-sdk/groq": "1.2.9",
"@ai-sdk/openai": "^1.3.21",
"@ai-sdk/perplexity": "1.1.9",
"@ai-sdk/ui-utils": "1.2.11",
"@arcadeai/arcadejs": "1.8.1",
"@coinbase/cookie-manager": "1.1.8",
"@googleapis/gmail": "12.0.0",
"@googleapis/people": "3.0.9",
"@hono/trpc-server": "^0.3.4",
"@microsoft/microsoft-graph-client": "^3.0.7",
"@microsoft/microsoft-graph-types": "^2.40.0",
"@modelcontextprotocol/sdk": "1.12.0",
"@react-email/components": "^0.0.41",
"@react-email/render": "1.1.0",
"@trpc/client": "catalog:",
"@trpc/server": "catalog:",
"@tsndr/cloudflare-worker-jwt": "3.2.0",
"@upstash/ratelimit": "^2.0.5",
"@upstash/redis": "^1.34.9",
"agents": "0.0.93",
"ai": "^4.3.13",
"autumn-js": "catalog:",
"base64-js": "1.5.1",
"better-auth": "catalog:",
"cheerio": "1.1.0",
"date-fns": "^4.1.0",
"dedent": "^1.6.0",
"drizzle-orm": "catalog:",
"effect": "3.16.12",
"elevenlabs": "1.59.0",
"email-addresses": "^5.0.0",
"google-auth-library": "9.15.1",
"he": "^1.2.0",
"hono": "^4.7.8",
"hono-agents": "0.0.83",
"hono-party": "^0.0.12",
"jose": "6.0.11",
"jsonrepair": "^3.12.0",
"mime-types": "3.0.1",
"mimetext": "^3.0.27",
"p-retry": "6.2.1",
"partyserver": "^0.0.71",
"postgres": "3.4.5",
"react": "catalog:",
"remeda": "2.21.3",
"resend": "^4.5.1",
"sanitize-html": "^2.16.0",
"string-strip-html": "^13.4.12",
"superjson": "catalog:",
"twilio": "5.7.0",
"uuid": "11.1.0",
"wrangler": "catalog:",
"zod": "catalog:"
},
"devDependencies": {
"@types/he": "1.2.3",
"@types/node": "^22.9.0",
"@types/react": "19.1.6",
"@types/sanitize-html": "2.13.0",
"@types/uuid": "10.0.0",
"@zero/eslint-config": "workspace:*",
"@zero/tsconfig": "workspace:*",
"drizzle-kit": "catalog:",
"eslint": "^9.27.0",
"jiti": "2.4.2",
"typescript": "catalog:"
}
}