{"owner":"dreamhunter2333","repo":"cloudflare_temp_email","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["CLAUDE.md"],"skills":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Structure\n\n- **Backend**: `worker/` — Cloudflare Workers API using Hono framework. Entry: `worker/src/worker.ts`, APIs under `worker/src/*_api/`.\n- **Frontend**: `frontend/` — Vue 3 + Naive UI app deployed to Cloudflare Pages. Routes in `frontend/src/router/`.\n- **Pages middleware**: `pages/functions/_middleware.js` — Routes API calls to Worker backend.\n- **Mail parser**: `mail-parser-wasm/` — Rust WASM email parser.\n- **SMTP/IMAP proxy**: `smtp_proxy_server/` — Python proxy server.\n- **DB schema/migrations**: `db/` — SQLite via Cloudflare D1, dated migration patches.\n- **Docs**: `vitepress-docs/` — VitePress documentation site (zh + en).\n- **E2E tests**: `e2e/` — Playwright tests in Docker Compose (API, browser, SMTP proxy).\n- **Changelogs**: `CHANGELOG.md` (中文) + `CHANGELOG_EN.md` (English).\n\n## Build & Dev Commands\n\nRun inside each subfolder with `pnpm`:\n\n| Folder | Dev | Build | Lint | Deploy |\n|--------|-----|-------|------|--------|\n| `worker/` | `pnpm dev` | `pnpm build` | `pnpm lint` | `pnpm deploy` |\n| `frontend/` | `pnpm dev` | `pnpm build` | — | `pnpm deploy` |\n| `vitepress-docs/` | `pnpm dev` | `pnpm build` | — | — |\n| `mail-parser-wasm/` | — | `wasm-pack build --release` | — | — |\n\nSMTP proxy: `pip install -r smtp_proxy_server/requirements.txt` then `python smtp_proxy_server/main.py`.\n\n## E2E Tests\n\nTests run in Docker Compose with Playwright. From `e2e/`:\n\n```bash\nnpm test              # Build, run all tests, exit\nnpm run test:down     # Clean up containers\n```\n\nTest categories: `tests/api/` (API tests), `tests/browser/` (UI tests with Chromium), `tests/smtp-proxy/` (SMTP/IMAP proxy tests).\n\nThe Docker frontend serves over **HTTPS** (self-signed cert) with Vite proxy to worker — required for WebAuthn (`navigator.credentials`) and `crypto.subtle` which need a secure context. Browser tests use `ignoreHTTPSErrors: true`.\n\nKey patterns for browser tests:\n- Frontend hashes passwords with SHA-256 (`crypto.subtle`) before sending — API test registration must use pre-hashed passwords if UI login is needed.\n- VueUse `useStorage('key', '')` with string default uses **raw string** serialization — set localStorage with raw value, not `JSON.stringify()`.\n- WebAuthn browser tests use CDP virtual authenticator (`WebAuthn.enable` + `WebAuthn.addVirtualAuthenticator`).\n\n## Architecture\n\n### Worker Auth Flow (`worker/src/worker.ts`)\n\nThree auth layers applied via Hono middleware, each using different headers:\n\n| Path prefix | Header | Purpose |\n|-------------|--------|---------|\n| `/api/*` | `Authorization: Bearer <jwt>` | Address (mailbox) credential |\n| `/user_api/*` | `x-user-token` | User account JWT |\n| `/admin/*` | `x-admin-auth` | Admin password |\n| (any) | `x-user-access-token` | User role-based access token |\n| (any) | `x-custom-auth` | Optional global access password |\n| (any) | `x-lang` | Language preference (`en`/`zh`) |\n\nPublic endpoints (no auth): `/open_api/*`, `/user_api/login`, `/user_api/register`, `/user_api/passkey/authenticate_*`, `/user_api/oauth2/*`.\n\n### Worker Email Flow (`worker/src/email/`)\n\nCloudflare Email Worker entry: `email()` in `worker/src/email/index.ts`. Processing pipeline:\n1. Parse raw email → check junk → check address exists\n2. Auto-reply if configured → forward if configured → webhook if enabled\n3. Store in D1 database\n\n### Frontend State (`frontend/src/store/index.js`, `frontend/src/api/index.js`)\n\nGlobal state via VueUse `useStorage` for persistence. The `api` module wraps axios with auto-attached auth headers and fingerprinting. API base URL comes from `VITE_API_BASE` env var (empty = same origin).\n\n## Coding Style\n\n- `worker/` uses TypeScript + ESLint; `frontend/` uses Vue SFCs.\n- Keep existing naming patterns: `*_api/` folders, `utils/`, `models/`.\n- ESM imports only (`type: module`).\n\n## Commits & PRs\n\n- Use Conventional Commits: `feat:`, `fix:`, `docs:`, `style:`, `refactor:`, `perf:`.\n- PRs should explain scope; add screenshots for UI changes.\n- Use squash merge for PRs.\n\n## Post-Task Checklist (IMPORTANT)\n\nAfter completing any feature, bug fix, or improvement, **always check**:\n\n1. **CHANGELOG.md** (中文) and **CHANGELOG_EN.md** (English) — both must be updated under the current `(main)` version section with the change entry. Follow the existing format: `- feat/fix/docs: |模块| 描述`.\n2. **Documentation** — if the change involves new environment variables, new API endpoints, or configuration changes, update the corresponding docs in `vitepress-docs/docs/zh/` and `vitepress-docs/docs/en/`. Key files:\n   - `guide/worker-vars.md` — Worker environment variables\n   - `guide/ui/` — Frontend deployment docs\n   - `guide/feature/` — Feature-specific docs\n   - `api/` — API reference docs\n3. **Both languages** — docs and changelogs exist in Chinese and English; always update both.\n\n## Config\n\n- Worker settings in `worker/wrangler.toml` (see `wrangler.toml.template` for bindings).\n- Frontend uses `VITE_*` env vars. Don't commit secrets.\n"},"files":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Structure\n\n- **Backend**: `worker/` — Cloudflare Workers API using Hono framework. Entry: `worker/src/worker.ts`, APIs under `worker/src/*_api/`.\n- **Frontend**: `frontend/` — Vue 3 + Naive UI app deployed to Cloudflare Pages. Routes in `frontend/src/router/`.\n- **Pages middleware**: `pages/functions/_middleware.js` — Routes API calls to Worker backend.\n- **Mail parser**: `mail-parser-wasm/` — Rust WASM email parser.\n- **SMTP/IMAP proxy**: `smtp_proxy_server/` — Python proxy server.\n- **DB schema/migrations**: `db/` — SQLite via Cloudflare D1, dated migration patches.\n- **Docs**: `vitepress-docs/` — VitePress documentation site (zh + en).\n- **E2E tests**: `e2e/` — Playwright tests in Docker Compose (API, browser, SMTP proxy).\n- **Changelogs**: `CHANGELOG.md` (中文) + `CHANGELOG_EN.md` (English).\n\n## Build & Dev Commands\n\nRun inside each subfolder with `pnpm`:\n\n| Folder | Dev | Build | Lint | Deploy |\n|--------|-----|-------|------|--------|\n| `worker/` | `pnpm dev` | `pnpm build` | `pnpm lint` | `pnpm deploy` |\n| `frontend/` | `pnpm dev` | `pnpm build` | — | `pnpm deploy` |\n| `vitepress-docs/` | `pnpm dev` | `pnpm build` | — | — |\n| `mail-parser-wasm/` | — | `wasm-pack build --release` | — | — |\n\nSMTP proxy: `pip install -r smtp_proxy_server/requirements.txt` then `python smtp_proxy_server/main.py`.\n\n## E2E Tests\n\nTests run in Docker Compose with Playwright. From `e2e/`:\n\n```bash\nnpm test              # Build, run all tests, exit\nnpm run test:down     # Clean up containers\n```\n\nTest categories: `tests/api/` (API tests), `tests/browser/` (UI tests with Chromium), `tests/smtp-proxy/` (SMTP/IMAP proxy tests).\n\nThe Docker frontend serves over **HTTPS** (self-signed cert) with Vite proxy to worker — required for WebAuthn (`navigator.credentials`) and `crypto.subtle` which need a secure context. Browser tests use `ignoreHTTPSErrors: true`.\n\nKey patterns for browser tests:\n- Frontend hashes passwords with SHA-256 (`crypto.subtle`) before sending — API test registration must use pre-hashed passwords if UI login is needed.\n- VueUse `useStorage('key', '')` with string default uses **raw string** serialization — set localStorage with raw value, not `JSON.stringify()`.\n- WebAuthn browser tests use CDP virtual authenticator (`WebAuthn.enable` + `WebAuthn.addVirtualAuthenticator`).\n\n## Architecture\n\n### Worker Auth Flow (`worker/src/worker.ts`)\n\nThree auth layers applied via Hono middleware, each using different headers:\n\n| Path prefix | Header | Purpose |\n|-------------|--------|---------|\n| `/api/*` | `Authorization: Bearer <jwt>` | Address (mailbox) credential |\n| `/user_api/*` | `x-user-token` | User account JWT |\n| `/admin/*` | `x-admin-auth` | Admin password |\n| (any) | `x-user-access-token` | User role-based access token |\n| (any) | `x-custom-auth` | Optional global access password |\n| (any) | `x-lang` | Language preference (`en`/`zh`) |\n\nPublic endpoints (no auth): `/open_api/*`, `/user_api/login`, `/user_api/register`, `/user_api/passkey/authenticate_*`, `/user_api/oauth2/*`.\n\n### Worker Email Flow (`worker/src/email/`)\n\nCloudflare Email Worker entry: `email()` in `worker/src/email/index.ts`. Processing pipeline:\n1. Parse raw email → check junk → check address exists\n2. Auto-reply if configured → forward if configured → webhook if enabled\n3. Store in D1 database\n\n### Frontend State (`frontend/src/store/index.js`, `frontend/src/api/index.js`)\n\nGlobal state via VueUse `useStorage` for persistence. The `api` module wraps axios with auto-attached auth headers and fingerprinting. API base URL comes from `VITE_API_BASE` env var (empty = same origin).\n\n## Coding Style\n\n- `worker/` uses TypeScript + ESLint; `frontend/` uses Vue SFCs.\n- Keep existing naming patterns: `*_api/` folders, `utils/`, `models/`.\n- ESM imports only (`type: module`).\n\n## Commits & PRs\n\n- Use Conventional Commits: `feat:`, `fix:`, `docs:`, `style:`, `refactor:`, `perf:`.\n- PRs should explain scope; add screenshots for UI changes.\n- Use squash merge for PRs.\n\n## Post-Task Checklist (IMPORTANT)\n\nAfter completing any feature, bug fix, or improvement, **always check**:\n\n1. **CHANGELOG.md** (中文) and **CHANGELOG_EN.md** (English) — both must be updated under the current `(main)` version section with the change entry. Follow the existing format: `- feat/fix/docs: |模块| 描述`.\n2. **Documentation** — if the change involves new environment variables, new API endpoints, or configuration changes, update the corresponding docs in `vitepress-docs/docs/zh/` and `vitepress-docs/docs/en/`. Key files:\n   - `guide/worker-vars.md` — Worker environment variables\n   - `guide/ui/` — Frontend deployment docs\n   - `guide/feature/` — Feature-specific docs\n   - `api/` — API reference docs\n3. **Both languages** — docs and changelogs exist in Chinese and English; always update both.\n\n## Config\n\n- Worker settings in `worker/wrangler.toml` (see `wrangler.toml.template` for bindings).\n- Frontend uses `VITE_*` env vars. Don't commit secrets.\n"},"items":[{"name":"CLAUDE.md","path":"CLAUDE.md","title":"CLAUDE.md","content":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Structure\n\n- **Backend**: `worker/` — Cloudflare Workers API using Hono framework. Entry: `worker/src/worker.ts`, APIs under `worker/src/*_api/`.\n- **Frontend**: `frontend/` — Vue 3 + Naive UI app deployed to Cloudflare Pages. Routes in `frontend/src/router/`.\n- **Pages middleware**: `pages/functions/_middleware.js` — Routes API calls to Worker backend.\n- **Mail parser**: `mail-parser-wasm/` — Rust WASM email parser.\n- **SMTP/IMAP proxy**: `smtp_proxy_server/` — Python proxy server.\n- **DB schema/migrations**: `db/` — SQLite via Cloudflare D1, dated migration patches.\n- **Docs**: `vitepress-docs/` — VitePress documentation site (zh + en).\n- **E2E tests**: `e2e/` — Playwright tests in Docker Compose (API, browser, SMTP proxy).\n- **Changelogs**: `CHANGELOG.md` (中文) + `CHANGELOG_EN.md` (English).\n\n## Build & Dev Commands\n\nRun inside each subfolder with `pnpm`:\n\n| Folder | Dev | Build | Lint | Deploy |\n|--------|-----|-------|------|--------|\n| `worker/` | `pnpm dev` | `pnpm build` | `pnpm lint` | `pnpm deploy` |\n| `frontend/` | `pnpm dev` | `pnpm build` | — | `pnpm deploy` |\n| `vitepress-docs/` | `pnpm dev` | `pnpm build` | — | — |\n| `mail-parser-wasm/` | — | `wasm-pack build --release` | — | — |\n\nSMTP proxy: `pip install -r smtp_proxy_server/requirements.txt` then `python smtp_proxy_server/main.py`.\n\n## E2E Tests\n\nTests run in Docker Compose with Playwright. From `e2e/`:\n\n```bash\nnpm test              # Build, run all tests, exit\nnpm run test:down     # Clean up containers\n```\n\nTest categories: `tests/api/` (API tests), `tests/browser/` (UI tests with Chromium), `tests/smtp-proxy/` (SMTP/IMAP proxy tests).\n\nThe Docker frontend serves over **HTTPS** (self-signed cert) with Vite proxy to worker — required for WebAuthn (`navigator.credentials`) and `crypto.subtle` which need a secure context. Browser tests use `ignoreHTTPSErrors: true`.\n\nKey patterns for browser tests:\n- Frontend hashes passwords with SHA-256 (`crypto.subtle`) before sending — API test registration must use pre-hashed passwords if UI login is needed.\n- VueUse `useStorage('key', '')` with string default uses **raw string** serialization — set localStorage with raw value, not `JSON.stringify()`.\n- WebAuthn browser tests use CDP virtual authenticator (`WebAuthn.enable` + `WebAuthn.addVirtualAuthenticator`).\n\n## Architecture\n\n### Worker Auth Flow (`worker/src/worker.ts`)\n\nThree auth layers applied via Hono middleware, each using different headers:\n\n| Path prefix | Header | Purpose |\n|-------------|--------|---------|\n| `/api/*` | `Authorization: Bearer <jwt>` | Address (mailbox) credential |\n| `/user_api/*` | `x-user-token` | User account JWT |\n| `/admin/*` | `x-admin-auth` | Admin password |\n| (any) | `x-user-access-token` | User role-based access token |\n| (any) | `x-custom-auth` | Optional global access password |\n| (any) | `x-lang` | Language preference (`en`/`zh`) |\n\nPublic endpoints (no auth): `/open_api/*`, `/user_api/login`, `/user_api/register`, `/user_api/passkey/authenticate_*`, `/user_api/oauth2/*`.\n\n### Worker Email Flow (`worker/src/email/`)\n\nCloudflare Email Worker entry: `email()` in `worker/src/email/index.ts`. Processing pipeline:\n1. Parse raw email → check junk → check address exists\n2. Auto-reply if configured → forward if configured → webhook if enabled\n3. Store in D1 database\n\n### Frontend State (`frontend/src/store/index.js`, `frontend/src/api/index.js`)\n\nGlobal state via VueUse `useStorage` for persistence. The `api` module wraps axios with auto-attached auth headers and fingerprinting. API base URL comes from `VITE_API_BASE` env var (empty = same origin).\n\n## Coding Style\n\n- `worker/` uses TypeScript + ESLint; `frontend/` uses Vue SFCs.\n- Keep existing naming patterns: `*_api/` folders, `utils/`, `models/`.\n- ESM imports only (`type: module`).\n\n## Commits & PRs\n\n- Use Conventional Commits: `feat:`, `fix:`, `docs:`, `style:`, `refactor:`, `perf:`.\n- PRs should explain scope; add screenshots for UI changes.\n- Use squash merge for PRs.\n\n## Post-Task Checklist (IMPORTANT)\n\nAfter completing any feature, bug fix, or improvement, **always check**:\n\n1. **CHANGELOG.md** (中文) and **CHANGELOG_EN.md** (English) — both must be updated under the current `(main)` version section with the change entry. Follow the existing format: `- feat/fix/docs: |模块| 描述`.\n2. **Documentation** — if the change involves new environment variables, new API endpoints, or configuration changes, update the corresponding docs in `vitepress-docs/docs/zh/` and `vitepress-docs/docs/en/`. Key files:\n   - `guide/worker-vars.md` — Worker environment variables\n   - `guide/ui/` — Frontend deployment docs\n   - `guide/feature/` — Feature-specific docs\n   - `api/` — API reference docs\n3. **Both languages** — docs and changelogs exist in Chinese and English; always update both.\n\n## Config\n\n- Worker settings in `worker/wrangler.toml` (see `wrangler.toml.template` for bindings).\n- Frontend uses `VITE_*` env vars. Don't commit secrets.\n","category":"root","tokens":1272}]}