refactor: restructure project for multi-agent extensibility
- Migrate source to packages/client and packages/server directories - Namespace all Hermes-specific code under hermes/ subdirectories (api/hermes/, components/hermes/, views/hermes/, stores/hermes/) - Add hermes.* route names and /hermes/* path prefixes - Upgrade @koa/router to v15, adapt path-to-regexp v8 syntax - Fix proxy path rewriting: /api/hermes/v1/* → /v1/*, /api/hermes/* → /api/* - Fix frontend API paths to match backend /api/hermes/* routes - Fix WebSocket terminal path to /api/hermes/terminal - Add proxyMiddleware for reliable unmatched route proxying - Add profiles route module and hermes-cli profile commands - Update CLAUDE.md development guide with new architecture - Add Chinese README (README_zh.md) - Add Web Terminal feature to README Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+213
@@ -0,0 +1,213 @@
|
||||
<p align="center">
|
||||
<strong>Hermes Web UI</strong>
|
||||
<a href="./README.md">English</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/NousResearch/hermes-agent">Hermes Agent</a> 的全功能 Web 管理面板。<br/>
|
||||
管理 AI 聊天会话、监控用量与成本、配置平台渠道、<br/>
|
||||
管理定时任务、浏览技能 —— 全部在一个简洁响应式的 Web 界面中完成。
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<code>npm install -g hermes-web-ui && hermes-web-ui start</code>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://github.com/EKKOLearnAI/hermes-web-ui/blob/main/packages/client/src/assets/output.gif" alt="Hermes Web UI 演示" width="680"/>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<strong>移动端</strong>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<video src="https://github.com/EKKOLearnAI/hermes-web-ui/blob/main/packages/client/src/assets/video.mp4?raw=true" width="360" controls></video>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/hermes-web-ui"><img src="https://img.shields.io/npm/v/hermes-web-ui?style=flat-square&color=blue" alt="npm 版本"/></a>
|
||||
<a href="https://github.com/EKKOLearnAI/hermes-web-ui/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/hermes-web-ui?style=flat-square" alt="许可证"/></a>
|
||||
<a href="https://github.com/EKKOLearnAI/hermes-web-ui/stargazers"><img src="https://img.shields.io/github/stars/EKKOLearnAI/hermes-web-ui?style=flat-square" alt="Star"/></a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## 功能特性
|
||||
|
||||
### AI 聊天
|
||||
|
||||
- 通过 SSE 实时流式输出,支持异步 Run
|
||||
- 多会话管理 — 创建、重命名、删除、切换会话
|
||||
- 按来源分组会话(Telegram、Discord、Slack 等),可折叠手风琴面板
|
||||
- Markdown 渲染,支持语法高亮和代码复制
|
||||
- 工具调用详情展开(参数 / 结果)
|
||||
- 文件上传支持
|
||||
- 全局模型选择器 — 自动从 `~/.hermes/auth.json` 凭证池发现可用模型
|
||||
- 每个会话显示模型标签和上下文 Token 用量
|
||||
|
||||
### 平台渠道
|
||||
|
||||
在一个页面统一配置 **8 个平台**:
|
||||
|
||||
| 平台 | 功能 |
|
||||
|---|---|
|
||||
| Telegram | Bot Token、提及控制、表情回应、自由回复聊天 |
|
||||
| Discord | Bot Token、提及、自动线程、表情回应、频道白名单/黑名单 |
|
||||
| Slack | Bot Token、提及控制、Bot 消息处理 |
|
||||
| WhatsApp | 启用/禁用、提及控制、提及模式 |
|
||||
| Matrix | Access Token、Homeserver、自动线程、私信提及线程 |
|
||||
| 飞书 | App ID / Secret、提及控制 |
|
||||
| 微信 | 扫码登录(浏览器扫码,自动保存凭证) |
|
||||
| 企业微信 | Bot ID / Secret |
|
||||
|
||||
- 凭证管理写入 `~/.hermes/.env`
|
||||
- 渠道行为设置写入 `~/.hermes/config.yaml`
|
||||
- 配置变更后自动重启网关
|
||||
- 每个平台已配置/未配置状态检测
|
||||
|
||||
### 用量分析
|
||||
|
||||
- Token 总用量明细(输入 / 输出)
|
||||
- 会话数及日均统计
|
||||
- 预估费用追踪及缓存命中率
|
||||
- 模型使用分布图
|
||||
- 30 天每日趋势(柱状图 + 数据表格)
|
||||
|
||||
### 定时任务
|
||||
|
||||
- 创建、编辑、暂停、恢复、删除 Cron 任务
|
||||
- 立即触发执行
|
||||
- Cron 表达式快捷预设
|
||||
|
||||
### 模型管理
|
||||
|
||||
- 从凭证池自动发现模型(`~/.hermes/auth.json`)
|
||||
- 从每个 Provider 端点获取可用模型(`/v1/models`)
|
||||
- 添加自定义 OpenAI 兼容 Provider
|
||||
- Provider 级别模型分组
|
||||
|
||||
### 技能与记忆
|
||||
|
||||
- 浏览和搜索已安装的技能
|
||||
- 查看技能详情和附件
|
||||
- 用户笔记和档案管理
|
||||
|
||||
### 日志
|
||||
|
||||
- 查看 Agent / Gateway / Error 日志
|
||||
- 按日志级别、日志文件和关键词过滤
|
||||
- 结构化日志解析,HTTP 访问日志高亮
|
||||
|
||||
### 设置
|
||||
|
||||
- 显示(流式输出、紧凑模式、推理过程、费用显示)
|
||||
- Agent(最大轮次、超时时间、工具强制执行)
|
||||
- 记忆(启用/禁用、字符限制)
|
||||
- 会话重置(空闲超时、定时重置)
|
||||
- 隐私(PII 脱敏)
|
||||
- API 服务器配置
|
||||
|
||||
### Web 终端
|
||||
|
||||
- 集成终端,基于 node-pty 和 @xterm/xterm
|
||||
- 多会话支持 — 创建、切换、关闭终端会话
|
||||
- 通过 WebSocket 实时传输键盘输入和 PTY 输出
|
||||
- 支持窗口大小调整
|
||||
|
||||
---
|
||||
|
||||
## 快速开始
|
||||
|
||||
### npm 安装(推荐)
|
||||
|
||||
```bash
|
||||
npm install -g hermes-web-ui
|
||||
hermes-web-ui start
|
||||
```
|
||||
|
||||
打开 **http://localhost:8648**
|
||||
|
||||
### 一键安装(自动检测系统)
|
||||
|
||||
自动安装 Node.js(如未安装)和 hermes-web-ui,支持 Debian/Ubuntu/macOS:
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://cdn.jsdelivr.net/gh/EKKOLearnAI/hermes-web-ui@main/scripts/setup.sh)
|
||||
```
|
||||
|
||||
### WSL
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://cdn.jsdelivr.net/gh/EKKOLearnAI/hermes-web-ui@main/scripts/setup.sh)
|
||||
hermes-web-ui start
|
||||
```
|
||||
|
||||
> WSL 会自动检测并使用 `hermes gateway run` 进行后台启动(无需 launchd/systemd)。
|
||||
|
||||
### CLI 命令
|
||||
|
||||
| 命令 | 说明 |
|
||||
|---|---|
|
||||
| `hermes-web-ui start` | 后台启动(守护进程模式) |
|
||||
| `hermes-web-ui start --port 9000` | 自定义端口启动 |
|
||||
| `hermes-web-ui stop` | 停止后台进程 |
|
||||
| `hermes-web-ui restart` | 重启后台进程 |
|
||||
| `hermes-web-ui status` | 查看运行状态 |
|
||||
| `hermes-web-ui update` | 更新到最新版本并重启 |
|
||||
| `hermes-web-ui -v` | 显示版本号 |
|
||||
| `hermes-web-ui -h` | 显示帮助信息 |
|
||||
|
||||
### 自动配置
|
||||
|
||||
启动时 BFF 服务器会自动:
|
||||
|
||||
- 校验 `~/.hermes/config.yaml` 并补全缺失的 `api_server` 字段
|
||||
- 修改时备份原配置到 `config.yaml.bak`
|
||||
- 检测并启动网关(如未运行)
|
||||
- 解决端口冲突(清理残留进程)
|
||||
- 启动成功后自动打开浏览器
|
||||
|
||||
---
|
||||
|
||||
## 开发
|
||||
|
||||
```bash
|
||||
git clone https://github.com/EKKOLearnAI/hermes-web-ui.git
|
||||
cd hermes-web-ui
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
- 前端:http://localhost:5173
|
||||
- BFF 服务器:http://localhost:8648(代理到 Hermes 网关 8642)
|
||||
|
||||
```bash
|
||||
npm run build # 构建输出到 dist/
|
||||
```
|
||||
|
||||
## 架构
|
||||
|
||||
```
|
||||
浏览器 → BFF (Koa, :8648) → Hermes 网关 (:8642)
|
||||
↓
|
||||
Hermes CLI (会话、日志、版本)
|
||||
↓
|
||||
~/.hermes/config.yaml (渠道行为配置)
|
||||
~/.hermes/auth.json (凭证池)
|
||||
腾讯 iLink API (微信扫码登录)
|
||||
```
|
||||
|
||||
前端采用 **多 Agent 可扩展架构** — 所有 Hermes 相关代码都按命名空间组织在 `hermes/` 目录下(API、组件、视图、Store),可以方便地并行接入新的 Agent。
|
||||
|
||||
BFF 层负责:API 代理(含路径重写)、SSE 流式推送、文件上传、通过 CLI 管理会话 CRUD、配置/凭证管理、微信扫码登录、模型发现、技能/记忆管理、日志读取和静态文件服务。
|
||||
|
||||
## 技术栈
|
||||
|
||||
**前端:** Vue 3 + TypeScript + Vite + Naive UI + Pinia + Vue Router + vue-i18n + SCSS + markdown-it + highlight.js
|
||||
|
||||
**后端:** Koa 2(BFF 服务器)+ node-pty(Web 终端)
|
||||
|
||||
## 许可证
|
||||
|
||||
[MIT](./LICENSE)
|
||||
Reference in New Issue
Block a user