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:
ekko
2026-04-16 08:38:18 +08:00
parent 4917242dca
commit 351c861777
106 changed files with 1409 additions and 317 deletions
+140
View File
@@ -0,0 +1,140 @@
@use 'variables' as *;
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--vh: 1vh;
}
// Fix mobile viewport height (address bar)
@supports (height: 100dvh) {
:root {
--vh: 1dvh;
}
}
html, body, #app {
height: 100%;
width: 100%;
overflow: hidden;
}
body {
font-family: $font-ui;
background-color: $bg-primary;
color: $text-primary;
font-size: 14px;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code, pre, .mono {
font-family: $font-code;
}
a {
color: $accent-primary;
text-decoration: none;
&:hover {
color: $accent-hover;
}
}
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: $border-color;
border-radius: 3px;
&:hover {
background: $text-muted;
}
}
::selection {
background: rgba($accent-primary, 0.3);
}
// Shared page header
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 21px 20px;
border-bottom: 1px solid $border-color;
flex-shrink: 0;
}
.header-title {
font-size: 16px;
font-weight: 600;
color: $text-primary;
}
// Responsive utility classes for inline width replacement
.input-sm { width: 90px; }
.input-md { width: 200px; }
.input-lg { width: 300px; }
// Mobile drawer backdrop
.mobile-backdrop {
display: none;
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.4);
z-index: 999;
}
// Hamburger button (mobile only)
.hamburger-btn {
display: none;
position: fixed;
top: 16px;
left: 12px;
z-index: 1001;
width: 36px;
height: 36px;
border: none;
background: $bg-card;
border-radius: $radius-sm;
cursor: pointer;
align-items: center;
justify-content: center;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
// Mobile responsive
@media (max-width: $breakpoint-mobile) {
.mobile-backdrop {
display: block;
}
.hamburger-btn {
display: flex;
}
.page-header {
padding: 16px 12px 16px 52px;
}
.input-sm,
.input-md,
.input-lg {
width: 100%;
}
}
+71
View File
@@ -0,0 +1,71 @@
import type { GlobalThemeOverrides } from 'naive-ui'
export const themeOverrides: GlobalThemeOverrides = {
common: {
primaryColor: '#333333',
primaryColorHover: '#1a1a1a',
primaryColorPressed: '#000000',
primaryColorSuppl: '#333333',
bodyColor: '#fafafa',
cardColor: '#ffffff',
modalColor: '#ffffff',
popoverColor: '#ffffff',
tableColor: '#ffffff',
inputColor: '#ffffff',
actionColor: '#f0f0f0',
textColorBase: '#1a1a1a',
textColor1: '#1a1a1a',
textColor2: '#666666',
textColor3: '#999999',
dividerColor: '#e0e0e0',
borderColor: '#e0e0e0',
hoverColor: 'rgba(0, 0, 0, 0.04)',
borderRadius: '8px',
borderRadiusSmall: '6px',
fontSize: '14px',
fontSizeMedium: '14px',
heightMedium: '36px',
fontFamily: 'Inter, system-ui, -apple-system, sans-serif',
fontFamilyMono: 'JetBrains Mono, Fira Code, Consolas, monospace',
},
Layout: {
color: '#fafafa',
siderColor: '#f5f5f5',
headerColor: '#fafafa',
},
Menu: {
itemTextColorActive: '#1a1a1a',
itemTextColorActiveHover: '#1a1a1a',
itemTextColorChildActive: '#1a1a1a',
itemIconColorActive: '#1a1a1a',
itemIconColorActiveHover: '#000000',
itemColorActive: 'rgba(0, 0, 0, 0.06)',
itemColorActiveHover: 'rgba(0, 0, 0, 0.1)',
arrowColorActive: '#1a1a1a',
},
Button: {
textColorPrimary: '#ffffff',
colorPrimary: '#333333',
colorHoverPrimary: '#1a1a1a',
colorPressedPrimary: '#000000',
},
Input: {
color: '#ffffff',
colorFocus: '#ffffff',
border: '1px solid #e0e0e0',
borderHover: '1px solid #999999',
borderFocus: '1px solid #333333',
placeholderColor: '#999999',
caretColor: '#1a1a1a',
},
Card: {
color: '#ffffff',
borderColor: '#e0e0e0',
},
Modal: {
color: '#ffffff',
},
Tag: {
borderRadius: '6px',
},
}
+57
View File
@@ -0,0 +1,57 @@
// 黑白水墨 — Pure Ink
// 纯黑白灰,无彩色
// Backgrounds
$bg-primary: #fafafa;
$bg-secondary: #f0f0f0;
$bg-sidebar: #f5f5f5;
$bg-card: #ffffff;
$bg-card-hover: #fafafa;
$bg-input: #ffffff;
// Borders
$border-color: #e0e0e0;
$border-light: #ebebeb;
// Accent
$accent-primary: #333333;
$accent-hover: #1a1a1a;
$accent-muted: #888888;
// Text
$text-primary: #1a1a1a;
$text-secondary: #666666;
$text-muted: #999999;
// Status
$success: #2e7d32;
$error: #c62828;
$warning: #f57f17;
$info: $accent-primary;
// Message bubbles
$msg-user-bg: #e8e8e8;
$msg-assistant-bg: #f5f5f5;
$msg-system-border: #bdbdbd;
// Code
$code-bg: #f4f4f4;
// Typography
$font-ui: 'Inter', system-ui, -apple-system, sans-serif;
$font-code: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
// Layout
$sidebar-width: 240px;
$sidebar-collapsed-width: 64px;
$header-height: 60px;
$breakpoint-mobile: 768px;
// Radius
$radius-sm: 6px;
$radius-md: 10px;
$radius-lg: 14px;
// Transition
$transition-fast: 0.15s ease;
$transition-normal: 0.25s ease;