Commit Graph

167 Commits

Author SHA1 Message Date
stevenlee87
6c19aefc71 feat(roles): sort user list by role rank and username
优化 GET /api/roles/users 用户列表的排序:
- 主排序:按角色等级 皇帝 → 公爵 → 骑士 → 平民(无角色用户排最后)
- 次排序:用户名长度(短者优先)
- 末排序:用户名字母序(大小写不敏感)
- 查询由 db.query.users.findMany(relational)改为显式 select + leftJoin,
  以支持基于角色名的 CASE 排序

Sort the user list returned by GET /api/roles/users:
- Primary: by role rank Emperor -> Duke -> Knight -> Civilian (users
  without a role sort last)
- Secondary: username length (shorter first)
- Tertiary: username alphabetical order (case-insensitive)
- Switch the query from db.query.users.findMany (relational) to an explicit
  select + leftJoin to enable CASE-based ordering on role name
2026-07-30 22:09:33 +08:00
stevenlee87
4960395777 refactor: favicon 移回 app/ + 删除用户改为 RESTful DELETE /api/users/[id]
- favicon: 从 public/favicon.ico 移回 app/favicon.ico(next-on-pages 1.13.16 下生产验证 /favicon.ico 正常返回)
- 删除用户: POST /api/roles/delete 改为 DELETE /api/users/[id],符合 RESTful 语义(资源 users + 标准 DELETE 方法)
2026-07-30 22:09:33 +08:00
stevenlee87
d34bb3d474 feat(roles): add delete user functionality to role management
Add ability for Emperor to delete users from the role management panel:
- New POST /api/roles/delete endpoint with PROMOTE_USER permission guard,
  blocks deleting self or other emperors, cascades user data cleanup
- Trash button on each non-emperor row with confirmation dialog
- Auto-navigate to previous page when deleting the last user on a page
- i18n strings added for all 5 locales
2026-07-30 22:09:33 +08:00
lidong-sal
6fc9686be9 feat(roles): enhance role management panel with user list and inline editing
Redesign the Emperor's Role Management panel from a single-user
search-and-assign form into a full user management dashboard with
browsable user list and inline role editing.
2026-07-30 22:09:33 +08:00
ty
2c97914ac2 ci: add Publish MCP workflow
Mirror publish-cli.yml for @moemail/mcp: trigger on mcp-v* tags or manual
dispatch, install + bun build, then npm publish --access public using
secrets.NPM_TOKEN.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cli-v1.0.0 mcp-v1.0.0
2026-06-16 00:04:13 +08:00
ty
be917e6865 chore(packages): add/update pnpm lockfiles for cli, core, mcp
CI publishes with `pnpm install` per package; commit pnpm-lock.yaml for
core and mcp (previously missing) and refresh cli's after the @moemail/core
dependency was added, so installs are reproducible.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 00:03:20 +08:00
ty
b99b872791 feat(cli,mcp): extract @moemail/core and add MCP server; release 1.0.0
Extract the HTTP client and config into a new @moemail/core package shared
by the CLI and a new @moemail/mcp server, so both frontends talk to the same
MoeMail API through one code path.

- core: api client (now throws typed ConfigError/AuthError/PermissionError/
  QuotaError instead of process.exit), config, msToIso, and a transport-
  agnostic pollForNewMessage helper.
- cli: consume @moemail/core; route command errors through a shared fail()
  that preserves exit codes (config/auth = 2, else = 1). Bump to 1.0.0.
- mcp: new stdio MCP server exposing 8 tools (create/list/read/wait/send/
  delete); wait_for_email is bounded and returns a timeout status to retry.
  Configured via MOEMAIL_API_KEY / MOEMAIL_API_URL env. Release 1.0.0.

Docs:
- Fix packages/cli/README.md (config set, send --content not --body, full
  flag table).
- Add MCP section to both root READMEs; complete the CLI command list
  (send, list, message-level delete).
- SKILL.md: --json works before or after the subcommand.
- Ignore bun.lock in package gitignores.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 23:52:35 +08:00
ty
bf51e843ee fix(sharing): allowlist /api/shared in middleware
Anonymous callers to the shared mailbox API got 401 because the
middleware matcher's broad page pattern catches /api paths but the
inner allowlist only carved out /api/auth. SSR rendered the mailbox
listing, but every client-side fetch (message detail, polling,
pagination) was rejected, so opening a shared mailbox showed the list
without being able to read any message body.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 18:07:06 +08:00
azerl7
faf68d0836 Update Node.js version in deploy workflow
修改 node.js 版本,构建的时候要求 22,之前是 20 会导致创建 workers 失败
2026-05-23 15:27:26 +08:00
ty
20be2b5b36 chore(cli): bump release to 0.1.2 cli-v0.1.2 2026-03-30 17:12:10 +08:00
ty
61f47626e7 feat(cli): add MoeMail AI agent skills 2026-03-30 17:08:50 +08:00
ty
adec4a50df fix(ci): exclude packages dir from Next.js TypeScript compilation
The tsconfig include pattern `**/*.ts` was picking up CLI package sources
during Next.js build, causing missing `commander` module errors in CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 23:17:37 +08:00
ty
b93b3bcf4a chore(cli): bump version to 0.1.1
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cli-v0.1.1
2026-03-22 16:15:43 +08:00
ty
033125eebf feat(cli): default api-url to https://moemail.app
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cli-v0.1.0
2026-03-22 16:11:39 +08:00
ty
f66c3e83a9 docs: add CLI section to READMEs and restore @moemail/cli package name
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 16:05:57 +08:00
ty
cb266a03dd fix(ci): install CLI dependencies separately in publish workflow
The CLI package is not part of a pnpm workspace, so its dependencies
need to be installed from within packages/cli/ directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 15:46:28 +08:00
ty
55c5418979 Merge branch 'feat/cli' 2026-03-22 15:42:11 +08:00
ty
b010ac5760 ci: support manual trigger for CLI publish workflow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 15:40:14 +08:00
BeilunYang
10257db179 Rename package from 'moemail-cli' to '@moemail/cli' 2026-03-22 15:32:31 +08:00
ty
0ac027f392 ci: add CLI publish workflow triggered by cli-v* tags 2026-03-22 15:22:29 +08:00
ty
8979649484 feat: add llms.txt for AI agent discoverability 2026-03-22 15:22:29 +08:00
ty
152059ca3d docs(cli): add README with usage guide and agent workflow 2026-03-22 15:22:29 +08:00
ty
3c238e25e6 fix(api): support API Key auth for send endpoint 2026-03-22 15:22:29 +08:00
ty
b09cc28496 feat(cli): add send command 2026-03-22 15:22:29 +08:00
ty
f29565c90d feat(cli): add delete command 2026-03-22 15:22:29 +08:00
ty
1c7cf2e5fd feat(cli): add read command 2026-03-22 15:22:29 +08:00
ty
8f4f605094 feat(cli): add wait command with client-side polling 2026-03-22 15:22:29 +08:00
ty
b891ee4655 feat(cli): add list command for mailboxes and messages 2026-03-22 15:22:29 +08:00
ty
12b5f4afeb feat(cli): add create command 2026-03-22 15:22:29 +08:00
ty
542f6ec2f8 feat(cli): add API client module 2026-03-22 15:22:29 +08:00
ty
1b9bd76b82 feat(cli): add config module and config command
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 15:22:29 +08:00
ty
6795719750 feat(cli): add output formatting helpers 2026-03-22 15:22:29 +08:00
ty
5b7ba3e924 feat(cli): scaffold CLI package with commander
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 15:22:29 +08:00
ty
0c096f6c9f docs: add MoeMail CLI implementation plan
15 tasks covering scaffolding, core modules, all 7 commands,
server-side send auth fix, README, llms.txt, and CI/CD workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 15:22:29 +08:00
ty
f7f9e2af36 docs: add CI/CD publishing, agent discoverability, rename to packages/cli
- Add publish-cli.yml workflow triggered by cli-v* tags
- Add agent discoverability section (help, README, llms.txt)
- Rename packages/moemail-cli to packages/cli

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 15:22:29 +08:00
ty
2168fd519a docs: fix spec issues from review — expiry mapping, send auth, JSON output shapes
- Remove 7d expiry option (not supported by API)
- Document send endpoint needs API Key auth support (server change)
- Add JSON output examples for all commands
- Add list-messages subcommand (list --email-id)
- Specify wait detection algorithm (ID-based, not count-based)
- Document field naming convention (camelCase) and timestamp format
- Add version command

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 15:22:29 +08:00
ty
1ce4f3e9fa docs: add MoeMail CLI design spec for agent-first CLI tool
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 15:22:29 +08:00
ty
10f6fd0065 docs: add MoeMail CLI implementation plan
15 tasks covering scaffolding, core modules, all 7 commands,
server-side send auth fix, README, llms.txt, and CI/CD workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 14:29:47 +08:00
ty
3d5bfad416 docs: add CI/CD publishing, agent discoverability, rename to packages/cli
- Add publish-cli.yml workflow triggered by cli-v* tags
- Add agent discoverability section (help, README, llms.txt)
- Rename packages/moemail-cli to packages/cli

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 14:21:29 +08:00
ty
00393e0443 docs: fix spec issues from review — expiry mapping, send auth, JSON output shapes
- Remove 7d expiry option (not supported by API)
- Document send endpoint needs API Key auth support (server change)
- Add JSON output examples for all commands
- Add list-messages subcommand (list --email-id)
- Specify wait detection algorithm (ID-based, not count-based)
- Document field naming convention (camelCase) and timestamp format
- Add version command

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 13:48:12 +08:00
ty
1f6b3a3b32 docs: add MoeMail CLI design spec for agent-first CLI tool
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 13:44:46 +08:00
ty
070b620c18 docs: change the default readme file language 2026-02-13 14:37:26 +08:00
BeilunYang
cef0ee0f0c Merge pull request #89 from sjcuhd/master 2026-01-18 14:24:58 +08:00
beilunyang
0d6670ebd5 feat(d1): add index for lowercased email addresses to improve query performance 2025-12-31 01:21:51 +08:00
beilunyang
71614333cc feat(d1): add indexes for improved query performance 2025-12-31 01:00:53 +08:00
sjcuhd
9736d19a46 Update index.ts
修复pushPagesSecre为json
2025-12-25 21:01:30 +08:00
beilunyang
98393c8a43 fix(deploy): add Google OAuth credentials to deployment workflow 2025-12-07 21:58:35 +08:00
beilunyang
9c303e4730 refactor(deploy): runtime environment variable checks in pushPagesSecret function 2025-12-07 21:46:37 +08:00
beilunyang
d2c8d9278b refactor(deploy): enhance environment variable handling in deployment scripts 2025-12-07 18:43:05 +08:00
beilunyang
834d3421ea docs(readme): fix v0.15.0 2025-12-07 18:08:26 +08:00