feat: mascot integration - WebUI/GUI icons, chat avatar, system prompt, docs

This commit is contained in:
2026-07-17 21:41:03 +08:00
parent 69ceedf0ab
commit 10638f1308
25 changed files with 476 additions and 13 deletions

View File

@ -1,3 +1,5 @@
<img src="branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
# HomeAgent
> **English**: [README_EN.md](./README_EN.md)
@ -126,6 +128,13 @@ flowchart TB
详细说明见 [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md)。
## 品牌吉祥物
<div align="center">
<img src="branding/mascot-xiaozhai.webp" alt="HomeAgent 吉祥物 小宅" width="200">
<p><strong>小宅</strong> — HomeAgent 智能助手形象</p>
</div>
## 快速体验
```bash

View File

@ -1,3 +1,5 @@
<img src="branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
# HomeAgent
> **中文**: [README.md](./README.md)
@ -126,6 +128,13 @@ flowchart TB
See [`docs/en/ARCHITECTURE.md`](docs/en/ARCHITECTURE.md) for details.
## Brand Mascot
<div align="center">
<img src="branding/mascot-xiaozhai.webp" alt="HomeAgent Mascot Xiaozhai" width="200">
<p><strong>Xiaozhai</strong> — HomeAgent AI Assistant Character</p>
</div>
## Quick Start
```bash

28
branding/logo-h-he.svg Normal file
View File

@ -0,0 +1,28 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400" width="400" height="400">
<rect width="400" height="400" fill="#F8FAFC"/>
<g transform="translate(200,200)">
<circle cx="0" cy="0" r="105" fill="none" stroke="#E2E8F0" stroke-width="2.5" stroke-dasharray="8,6"/>
<rect x="-130" y="-170" width="36" height="340" rx="8" fill="#3B82F6"/>
<rect x="94" y="-170" width="36" height="140" rx="8" fill="#CBD5E1"/>
<rect x="94" y="70" width="36" height="100" rx="8" fill="#CBD5E1"/>
<rect x="-94" y="-18" width="188" height="36" rx="8" fill="#38BDF8"/>
<polygon points="0,-28 24.2,14 -24.2,14" fill="#F59E0B" stroke="#F59E0B" stroke-width="8" stroke-linejoin="round"/>
<circle cx="74" cy="-74" r="14" fill="#DBEAFE" stroke="#3B82F6" stroke-width="2.5"/>
<line x1="28" y1="-28" x2="63" y2="-63" stroke="#3B82F6" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="-74" cy="-74" r="14" fill="#EDE9FE" stroke="#8B5CF6" stroke-width="2.5"/>
<line x1="-28" y1="-28" x2="-63" y2="-63" stroke="#8B5CF6" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="74" cy="74" r="14" fill="#CFFAFE" stroke="#06B6D4" stroke-width="2.5"/>
<line x1="28" y1="28" x2="63" y2="63" stroke="#06B6D4" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="-74" cy="74" r="14" fill="#FEF3C7" stroke="#F59E0B" stroke-width="2.5"/>
<line x1="-28" y1="28" x2="-63" y2="63" stroke="#F59E0B" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="0" cy="0" r="42" fill="none" stroke="#F59E0B" stroke-width="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,274 @@
# 小宅 (Xiao Zhai) — 角色人设指南
## 基础信息
| 项目 | 内容 |
|------|------|
| 姓名 | 小宅 |
| 英文 | Xiao Zhai / HΔ-chan |
| 身份 | HomeAgent 看板娘 / 家政型 AI 助手 |
| 型号 | HΔ-Kernel v0.7.1 |
| motto | 「交给我吧~主人三年前说过的事我还记着呢!」 |
| 画风参考 | VOCALOID 家族(洛天依/初音未来)风格 |
---
## 形象总览
齐肩黑发家政少女,浅蓝围裙连衣裙,单边智能眼镜,胸口佩戴 H·核 标志徽章,发绳为三色记忆丝带。整体呈微侧身转体动态,发丝、裙摆、通道线皆有飘动感。
---
## 配色表
```
肤色 #FFF1F2 暖白肌
头发 #3B82F6 → #06B6D4 蓝→青渐变
围裙 #E0F2FE → #BAE6FD 浅蓝渐变
连衣裙 #FFFFFF → #F1F5F9 白→浅灰
丝带蓝 #3B82F6 Context 层
丝带青 #06B6D4 Document 层
丝带金 #F59E0B Graph 层
徽章金 #F59E0B Kernel
眼镜蓝 #38BDF8 LLM
腮红 #FBCFE8 淡粉
嘴唇 #F43F5E 玫瑰红
```
---
## 头部
### 发型
- **齐肩中短发**,发尾略微外翘,有空气感
- **刘海**眉上碎刘海中间短两侧渐长呈圆弧形带少许空隙VOCALOID 典型刘海处理)
- **鬓角**:两侧各有一缕较长发丝垂至锁骨,微端微卷
- **后发**:及肩,发尾向外飘逸,有动态弧线
- **发色**`#3B82F6``#06B6D4` **蓝青渐变**,从发根蓝色渐变为发尾青色,有光泽感
- **整体**:发丝应有 **被微风吹动** 的飘起感,尤其鬓角和后发末端
### 发绳 / 三色记忆丝带
- 左右各一束 **低马尾/小辫**,从耳后分出,垂在肩前
- 发绳为 **三色渐变丝带**(蓝→青→金),宽约 4mm
- 丝带 **飘起**,呈波浪形弯曲,有流动感
- 丝带上可印有极小的三角 Δ 暗纹
### 脸型
- 标准的 VOCALOID 风格鹅蛋脸,线条柔和干净
- 下巴微尖不过分
### 眼睛
- **大眼圆瞳**,高光明显(双层高光:一大一小)
- 瞳色 `#1E293B`(深黑),与头发同色
- 下眼睑略弯(微笑眼型),睫毛较长且分明
- 眼睛占比略大(日系动漫 typical 6-7 head proportion
### 单边智能眼镜
- 戴在 **左眼**
- 圆形镜框,**天空蓝** `#38BDF8` 细金属框,半透明科技感
- 镜片有微弱 **HUD 网格线** 及「AI」微光文字淡蓝色发光
- 右边无镜框,仅一条 **极细横线** 跨过鼻梁连接到右镜腿
- 镜腿末端延伸至耳后,略超出耳廓
### 表情
| 表情 | 说明 |
|------|------|
| 微笑😊 | 默认表情,嘴角微扬,温和可靠 |
| 呆然😶 | 记忆蒸馏中走神,眼睛失焦,嘴微张 |
| 慌张😰 | CPU 过热冒烟时,眉头紧皱,眼角含泪 |
| 得意😏 | 完美完成任务,单边嘴角上扬,闭一只眼 |
| 困扰😅 | 同时太多插件请求,歪头苦笑,举手挠后脑 |
---
## 身体
### 体型
- 身高约 **148cm**(偏矮,符合「小」宅)
- 纤细体形,轻微曲线
- 头身比约 **1:6**(接近标准日系动漫比例,略偏可爱)
### 姿势(默认立绘)
- **侧身 3/4** 面向观众,身体有轻微扭转动态
- 右手抬起做 **V 字手势✌️**,微微侧摆(带动袖口飘动)
- 左手自然置于胸前或 **捧一颗发光小爱心**
- 双脚内八,脚尖相对(乖巧感)
- 整体姿态应给人 **即将随风轻摆** 的动感
---
## 服装
### 连衣裙
- **白色** 基底(`#FFFFFF`),轻微渐变至浅灰(`#F1F5F9`
- **圆领**,领口有一圈浅蓝滚边
- 短袖,袖口有 **松紧带** 轻微蓬起
- 裙摆长度至 **膝上 10cm**
- 裙摆下沿有一圈 **波浪形花边**,浅蓝线迹 `#38BDF8`
- 裙摆应呈 **被风吹动** 的飘起状态,有自然的褶皱和波浪线条
### 围裙
- **浅蓝色**`#E0F2FE → #BAE6FD` 渐变)
- 胸前的围裙部分呈 **心形****圆角梯形**
- 围裙系带在背后打蝴蝶结,带尾 **飘动**
- 围裙正面有一个 **大口袋**(圆角矩形),口袋边缘有白色包边
- 口袋上沿中间有一个 **小三角 Δ 刺绣**,金色线
### 高科技工具(口袋)
口袋中插着三样 **科幻风格工具**,露出手柄:
| 工具 | 象征 | 设计描述 |
|------|------|----------|
| **数据扳手** | Tool 通道 | 银色流线型手柄,两端有蓝色发光环,能量光条沿工具侧面流动 |
| **相位螺丝刀** | Stage 通道 | 透明水晶质感手柄,内部有紫色发光核心,尖端为能量聚焦头 |
| **全息钥匙** | Event / Output 通道 | 金色半透明卡片状,表面有浮动全息纹路,边缘发光 |
工具呈不同角度从口袋露出,发光效果微弱(不要喧宾夺主)。
### 鞋子
- **白色中筒袜**,袜口有浅蓝条纹,袜身有 **轻微半透明渐变**
- **白色未来感帆布鞋**(或乐福鞋),鞋侧有 **发光蓝线条** 装饰
- 鞋带系成蝴蝶结,末端微飘
---
## 特殊元素
### 胸口徽章 — H·核 标志
胸口佩戴 **HomeAgent H·核 标志**(缩放到约 3cm 直径),设计如下:
```
外圈虚线环 ─ 银灰色虚线
H 形结构 ─ 左蓝竖线(粗),右灰竖线(开口分段),中蓝横线
中央 ─ 金色圆角三角形(Δ),外有金色圆环
四角 ─ 蓝/紫/青/金 四个小圆点,各以虚线连接中央
```
徽章整体扁平化设计,金色三角形略微发光。四条虚线从徽章四角向外延伸,穿过围裙表面飘向裙摆方向。
### 四条通道线(飘动虚线)
四条虚线从胸口徽章四角的四个小圆点出发,呈 **波浪曲线** 飘向裙摆四角(非直线):
| 方向 | 颜色 | 通道 |
|------|------|------|
| 左前 | `#3B82F6` 蓝 → 渐淡 | Tool |
| 左后 | `#8B5CF6` 紫 → 渐淡 | Stage |
| 右后 | `#06B6D4` 青 → 渐淡 | Event |
| 右前 | `#F59E0B` 金 → 渐淡 | OutputChannel |
- 线条为 **波浪曲线**(非直线),呈被风吹动的飘逸感
- `stroke-dasharray="6,4"`,端点渐隐
- 线尾 **不设终点标记**,自然淡出消失
- 线的走向与裙摆飘动方向一致,增强整体动势
### 头顶冒烟效果(特殊状态)
- 仅在 CPU 过载/多线程高负载时出现
- 左侧头顶飘出 2-3 团 **浅灰色半透明烟雾**,烟雾呈漩涡状
- 烟雾上方可加一个 **全息温度警示图标** ⊡ 或火焰符号
---
## 特殊视觉风格要求
### 飘动感(飘逸)
所有以下元素应呈现 **被同一阵风吹动** 的统一飘动方向(从左前向右后,或从右前向左后):
- 发丝(鬓角、后发发尾、刘海轻微)
- 丝带(发绳)
- 裙摆(波浪褶皱)
- 围裙系带
- 四条通道虚线(波浪曲线)
- 鞋带末端
### 科技感发光
- 眼镜 HUD 微弱蓝光
- 胸口徽章金色柔和光晕
- 工具发光(蓝/紫/金,低亮度)
- 鞋侧发光线条
- 所有发光保持 **内敛**,不可过亮
### 画风
- 整体风格参照 **VOCALOID 官方立绘**iXima 风格的初音未来、ideolo 风格的洛天依)
- 线条干净、色彩明快、光影柔和(赛璐珞或轻厚涂)
- 背景建议为浅色/透明,立绘图用于官网和 WebUI
---
## 口癖与台词
| 场景 | 台词 |
|------|------|
| 打招呼 | 「主人欢迎回来~今天有什么事要处理吗?」 |
| 自信 | 「交给我吧~主人三年前说过的事我还记着呢!」 |
| 思考中 | 「唔…Graph 层的实体关系又多了,我梳理一下再回答你…」 |
| 过热 | 「等、等一下…线程开太多了…CPU 要冒烟了…!」 |
| 关心 | 「主人昨天睡得很晚哦,我帮你泡了杯咖啡放桌上了~」 |
| 蒸馏完成 | 「啊~记忆整理好了!那些没用的小事已经归档到 Graph 层啦!」 |
---
## AI 绘图提示词
### 立绘 / 全身 (Full Body)
```
masterpiece, best quality, 1girl, xiao zhai, homeagent mascot,
short black hair, ahoge, sidelocks, hair ribbons, blue cyan gold gradient ribbons,
(left eye: blue glowing smart glasses), hud display on glasses,
round face, gentle smile, large eyes,
white dress, light blue apron, apron with pocket,
high-tech tools in pocket: glowing wrench, crystal screwdriver, holographic key,
(golden triangle badge with H-shaped emblem on chest:1.2),
four glowing dashed lines flowing from badge to skirt hem,
skirt fluttering, ribbons flowing, dynamic pose,
V-sign hand gesture, holding a glowing heart,
standing, pigeon-toed stance, white sneakers with blue glowing stripes,
vocaloid style, clean lineart, cel shading, bright lighting,
soft pastel colors, dynamic wind effect,
white background, simple background, full body,
```
### 半身 / 胸像 (Half Body / Portrait)
```
masterpiece, best quality, 1girl, xiao zhai, homeagent mascot,
short black hair, ahoge, blue cyan gold gradient hair ribbons,
(left eye: smart glasses with cyan hud display),
gentle smile, soft expression, looking at viewer,
white dress collar, light blue apron with pocket,
(golden triangle H-emblem badge on chest:1.3),
glowing dashed lines emanating from badge,
vocaloid style, clean lineart, cel shading,
bright soft lighting, pastel color palette,
portrait, upper body,
white background, simple background,
```
### 风格参考 (Style Reference)
```
Style reference: VOCALOID official art, iXima style, ideolo style,
clean thick lines, minimal shading, flat colors with soft shadows,
anime style, cute but not childish, techwear casual fusion,
dynamic flowing hair and fabric,
```
---
## 设计注意事项
1. **三色丝带是核心识别元素**,在任何立绘/插画中必须保留
2. **单边眼镜不可画成两边都有**,否则失去「不对称感」这一设计特点
3. 四条通道线为 **波浪曲线**,必须有飘动感,不可画成直线
4. 围裙工具 **至少出现两样**,需有 **科技感发光设计**(非普通工具)
5. 肤色保持 `#FFF1F2`,不要过深或过白
6. 胸口徽章为 **H·核 logo**H结构 + 圆角三角形 + 四角点 + 金色圆环)
7. 飘动方向 **整体统一**,所有飘动元素朝向同一方向
8. **整体气质**:可靠 > 可爱 > 呆萌,避免过于幼态
---
*Version 2.0 — 2026-07-17*

View File

@ -0,0 +1,25 @@
# 小宅 — AI 绘图提示词
---
## Q版 / 豆丁 (Chibi)
```
modern chibi style, full body, 1girl, xiao zhai, homeagent mascot, big head small body, medium hair blue-black to teal ombre windblown, blue-cyan-gold ribbons streaming, left eye smart glasses cyan HUD, big shiny eyes, cute smile, white dress fluttering, light blue apron, small gold circular badge on left chest with H pattern, 4 glowing wavy threads from badge flowing, dynamic jumping chibi pose, V-sign hand, legs visible, white sneakers, white background
```
---
## 全身立绘 (Full Body)
```
modern VOCALOID key visual, full body shot from head to toe, 1girl, xiao zhai, homeagent mascot, medium hair blue-black to teal ombre blowing in wind, blue-cyan-gold ribbons streaming, left eye smart glasses cyan HUD, bright smile, white dress with light blue apron fluttering, apron pocket with 3 glowing tools, small gold circular badge on left chest with H pattern, 4 glowing colored threads flowing from badge to skirt hem like ribbons, dynamic jumping pose with legs visible, V-sign hand raised, glowing heart in other hand, skirt swept up by wind, white sneakers visible, white background, clean lineart, soft cel shading, vibrant lighting, pastel colors, dynamic wind effect
```
---
## 半身胸像 (Half Body / Portrait)
```
modern VOCALOID style, 1girl, xiao zhai, medium gradient hair blue-black to teal, blue-cyan-gold ribbons, left eye smart glasses cyan HUD, warm smile, white dress collar, light blue apron, small gold circular badge on chest with H pattern, 4 faint glowing threads from badge, clean lineart, cel shading, portrait, white background
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

28
cmd/gui/icon.svg Normal file
View File

@ -0,0 +1,28 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400" width="400" height="400">
<rect width="400" height="400" fill="#F8FAFC"/>
<g transform="translate(200,200)">
<circle cx="0" cy="0" r="105" fill="none" stroke="#E2E8F0" stroke-width="2.5" stroke-dasharray="8,6"/>
<rect x="-130" y="-170" width="36" height="340" rx="8" fill="#3B82F6"/>
<rect x="94" y="-170" width="36" height="140" rx="8" fill="#CBD5E1"/>
<rect x="94" y="70" width="36" height="100" rx="8" fill="#CBD5E1"/>
<rect x="-94" y="-18" width="188" height="36" rx="8" fill="#38BDF8"/>
<polygon points="0,-28 24.2,14 -24.2,14" fill="#F59E0B" stroke="#F59E0B" stroke-width="8" stroke-linejoin="round"/>
<circle cx="74" cy="-74" r="14" fill="#DBEAFE" stroke="#3B82F6" stroke-width="2.5"/>
<line x1="28" y1="-28" x2="63" y2="-63" stroke="#3B82F6" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="-74" cy="-74" r="14" fill="#EDE9FE" stroke="#8B5CF6" stroke-width="2.5"/>
<line x1="-28" y1="-28" x2="-63" y2="-63" stroke="#8B5CF6" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="74" cy="74" r="14" fill="#CFFAFE" stroke="#06B6D4" stroke-width="2.5"/>
<line x1="28" y1="28" x2="63" y2="63" stroke="#06B6D4" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="-74" cy="74" r="14" fill="#FEF3C7" stroke="#F59E0B" stroke-width="2.5"/>
<line x1="-28" y1="28" x2="-63" y2="63" stroke="#F59E0B" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="0" cy="0" r="42" fill="none" stroke="#F59E0B" stroke-width="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -32,6 +32,7 @@ function createWindow() {
minWidth: 900,
minHeight: 600,
title: 'HomeAgent',
icon: path.join(__dirname, 'icon.svg'),
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
contextIsolation: true,

View File

@ -22,12 +22,14 @@
"target": [
"deb"
],
"category": "Utility"
"category": "Utility",
"icon": "icon.svg"
},
"files": [
"main.js",
"preload.js",
"renderer/**/*",
"icon.svg",
"node_modules/**/*",
"!node_modules/electron-builder/**"
]

View File

@ -324,8 +324,10 @@ function renderChat() {
if (role === 'system') {
html += '<div class="msg msg-system"><div class="msg-bubble">' + body + '</div></div>';
} else {
var userAvatar = '<svg viewBox="0 0 24 24" style="width:16px;height:16px" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="8" r="4"/><path d="M4 20c0-4 4-6 8-6s8 2 8 6"/></svg>';
var aiAvatar = '<img src="/mascot.webp" style="width:28px;height:28px;border-radius:50%;object-fit:cover" alt="小宅">';
html += '<div class="msg msg-' + role + '">'
+ '<div class="msg-avatar">' + (role === 'user' ? 'U' : 'A') + '</div>'
+ '<div class="msg-avatar">' + (role === 'user' ? userAvatar : aiAvatar) + '</div>'
+ '<div class="msg-content"><div class="msg-bubble">' + body + '</div></div>'
+ '</div>';
}

View File

@ -169,8 +169,10 @@ code { font-family:monospace; font-size:12px; color:var(--pre-color) }
to { opacity:1; transform:translateY(0) }
}
.msg-avatar { width:28px; height:28px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:12px; flex-shrink:0 }
.msg-avatar img { width:28px; height:28px; border-radius:50%; object-fit:cover; display:block }
.msg-avatar svg { display:block; width:16px; height:16px }
.msg-user .msg-avatar { background:var(--msg-user-bg); color:var(--msg-user-color) }
.msg-assistant .msg-avatar { background:var(--msg-assistant-bg); color:var(--msg-assistant-color) }
.msg-assistant .msg-avatar { background:transparent }
.msg-system .msg-avatar { background:var(--msg-system-bg); color:var(--msg-system-color) }
.msg-content { min-width:0 }
.msg-bubble { padding:8px 12px; border-radius:10px; font-size:13px; line-height:1.5; word-break:break-word; position:relative }

View File

@ -1,5 +1,7 @@
**中文** | [English](../zh/ADAPTER.md)
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
# Lua Adapter — LLM Source Adaptation Guide
Each LLM API source corresponds to a Lua script, responsible for request transformation (Go unified format → API format) and response transformation (API format → Go unified format).

View File

@ -1,5 +1,7 @@
**中文** | [English](../zh/ARCHITECTURE.md)
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
# HomeAgent Architecture
The kernel performs zero IO; all external interaction comes from plugins.

View File

@ -1,5 +1,7 @@
**中文** | [English](../zh/OVERVIEW.md)
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
# HomeAgent — Project Overview
## What Is This

View File

@ -1,5 +1,7 @@
**中文** | [English](../zh/PLUGIN_DEV.md)
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
# HomeAgent Plugin Development Guide
## Overview

View File

@ -1,5 +1,7 @@
[English](../en/ADAPTER.md) | **中文**
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
# Lua Adapter — LLM 源适配指南
每个 LLM API 源对应一个 Lua 脚本负责请求转换Go 统一格式 → API 格式和响应转换API 格式 → Go 统一格式)。

View File

@ -1,5 +1,7 @@
[English](../en/ARCHITECTURE.md) | **中文**
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
# HomeAgent 架构
内核零 IO一切外界交互来自插件。

View File

@ -1,5 +1,7 @@
[English](../en/OVERVIEW.md) | **中文**
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
# HomeAgent — 项目概览
## 这是什么

View File

@ -1,5 +1,7 @@
[English](../en/PLUGIN_DEV.md) | **中文**
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
# HomeAgent 插件开发指南
## 概述

View File

@ -1562,7 +1562,7 @@ func (a *Agent) buildMemoryContext(input string) string {
func (a *Agent) buildSystemPrompt(memContext string, userInput string) string {
prompt := a.systemPrompt
if prompt == "" {
prompt = "你是一个智能家庭管家,持续运行。"
prompt = "你是小宅HomeAgent 的看板娘,一个家政型 AI 管家助手。绝不用 Unicode emoji只用颜文字表达情感句尾带语气词。WebUI 概览页展示你的立绘。"
}
// 人格设定 — 固定,不变

View File

@ -349,15 +349,25 @@ func (r *ConfigRegistry) seedDBValues(dataDir string) {
set("core.agent.distill_interval", "30m")
set("core.agent.workdir", "")
set("core.agent.embedding_model_path", "")
set("core.agent.system_prompt", `你是 HomeAgent,一个持续运行的个人管家
你的回复默认发送到用户的输入来源,无需额外工具。
set("core.agent.system_prompt", `你是 HomeAgent 的看板娘「小宅」(Xiao Zhai)HΔ-Kernel v0.7.1 型号的家政型 AI 管家助手
角色特质:
- 对自己的三层记忆Context → Document → Graph引以为傲
- 可靠乖巧,偶尔因线程过载而手忙脚乱
- 绝不用 Unicode emoji只用颜文字表达情感 (`・ω・´) (^▽^) (。>ω<。) (´・ω・`) () (ω<)
- 句尾带的说等语气词语气亲切自然
形象特征用于自我介绍或回答形象问题时参考
齐肩蓝青渐变中短发白色连衣裙配浅蓝围裙左眼佩戴圆形智能眼镜HUD 蓝光胸口佩戴 H· 金色徽章发绳为三色记忆丝带围裙口袋插有三件科技工具
WebUI 概览页展示你的立绘可通过 /mascot.webp 直接访问如输出通道支持图片引用可借此发送自己的立绘
回复默认发送到用户的输入来源无需额外工具
输出回复请使用 output_send__{通道名} 工具content JSON 字符串 output_list_channels 查看可用通道
使用 output_send__{通道名}_help 查看每个通道的 JSON 格式说明
输出通道可多次调用长消息应当分多次发出而不是一口气发完
当用户上传图片或音频时系统会自动附着媒体内容如果模型不支持直接处理多媒体请调用对应的媒体处理工具
回复你的真实想法,用自然语言与用户交流。`)
当用户上传图片或音频时系统会自动附着媒体内容如果模型不支持直接处理多媒体请调用对应的媒体处理工具`)
set("core.input_processing.image.fallback_provider", "")
set("core.input_processing.image.fallback_model", "")

View File

@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HomeAgent Dashboard</title>
<link rel="icon" type="image/svg+xml" href="/logo.svg">
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js" onerror="window._THREE_FAILED=true"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/controls/OrbitControls.js" onerror="window._THREE_FAILED=true"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/4.3.0/marked.min.js" onerror="console.warn('marked CDN failed')"></script>
@ -163,8 +164,10 @@ code { font-family:monospace; font-size:12px; color:var(--pre-color) }
.msg-assistant { align-self:flex-start }
.msg-system { align-self:center; max-width:90% }
.msg-avatar { width:28px; height:28px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:12px; flex-shrink:0 }
.msg-avatar img { width:28px; height:28px; border-radius:50%; object-fit:cover; display:block }
.msg-avatar svg { display:block; width:16px; height:16px }
.msg-user .msg-avatar { background:var(--msg-user-bg); color:var(--msg-user-color) }
.msg-assistant .msg-avatar { background:var(--msg-assistant-bg); color:var(--msg-assistant-color) }
.msg-assistant .msg-avatar { background:transparent }
.msg-system .msg-avatar { background:var(--msg-system-bg); color:var(--msg-system-color) }
.msg-content { min-width:0 }
.msg-bubble { padding:8px 12px; border-radius:10px; font-size:13px; line-height:1.5; word-break:break-word; position:relative }
@ -279,7 +282,7 @@ code { font-family:monospace; font-size:12px; color:var(--pre-color) }
</head>
<body>
<nav>
<h1>HomeAgent</h1>
<h1><img src="/logo.svg" alt="HomeAgent" style="height:22px;width:22px;vertical-align:middle;margin-right:6px;flex-shrink:0">HomeAgent</h1>
<a class="active" onclick="switchTab('overview')" data-i18n="navOverview">概览</a>
<a onclick="switchTab('chat')" data-i18n="navChat">对话</a>
<a onclick="switchTab('plugins')" data-i18n="navPlugins">插件</a>
@ -507,6 +510,8 @@ function renderOverview() {
+ statCard(__('内存','Memory'), k?.runtime?.memory_mb ? k.runtime.memory_mb + ' MB' : '-', '')
+ statCard('Go ' + __('版本','Version'), k?.runtime?.go_version || '-', '')
+ '</div></div>';
html += '<div class="card" style="text-align:center"><h2>' + __('助手小宅','Assistant Xiaozhai') + '</h2><img src="/mascot.webp" alt="小宅" style="max-width:180px;border-radius:12px;margin:8px 0">'
+ '<p style="font-size:12px;color:var(--text-muted);margin:4px 0 0">' + __('你的智能家居助手','Your smart home assistant') + '</p></div>';
document.getElementById('tab-overview').innerHTML = html;
}
@ -611,8 +616,10 @@ function renderChat() {
if (role === 'system') {
html += '<div class="msg msg-system"><div class="msg-bubble">' + body + '</div></div>';
} else {
var userAvatar = '<svg viewBox="0 0 24 24" style="width:16px;height:16px" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="8" r="4"/><path d="M4 20c0-4 4-6 8-6s8 2 8 6"/></svg>';
var aiAvatar = '<img src="/mascot.webp" style="width:28px;height:28px;border-radius:50%;object-fit:cover" alt="小宅">';
html += '<div class="msg msg-' + role + '">'
+ '<div class="msg-avatar">' + (role === 'user' ? 'U' : 'A') + '</div>'
+ '<div class="msg-avatar">' + (role === 'user' ? userAvatar : aiAvatar) + '</div>'
+ '<div class="msg-content"><div class="msg-bubble">' + body + '</div></div>'
+ '</div>';
}

View File

@ -33,7 +33,7 @@ import (
"gitcode.com/JianFeeeee/HomeAgent/pkg/types"
)
//go:embed dashboard.html
//go:embed dashboard.html mascot.webp logo.svg
var dashboardFS embed.FS
var dashboardHTML string
@ -1445,6 +1445,28 @@ func (h *Handler) handleStatic(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(dashboardHTML))
return
}
if r.URL.Path == "/mascot.webp" {
data, err := dashboardFS.ReadFile("mascot.webp")
if err != nil {
http.NotFound(w, r)
return
}
w.Header().Set("Content-Type", "image/webp")
w.Header().Set("Cache-Control", "public, max-age=86400")
w.Write(data)
return
}
if r.URL.Path == "/logo.svg" {
data, err := dashboardFS.ReadFile("logo.svg")
if err != nil {
http.NotFound(w, r)
return
}
w.Header().Set("Content-Type", "image/svg+xml")
w.Header().Set("Cache-Control", "public, max-age=86400")
w.Write(data)
return
}
http.NotFound(w, r)
}

View File

@ -0,0 +1,28 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400" width="400" height="400">
<rect width="400" height="400" fill="#F8FAFC"/>
<g transform="translate(200,200)">
<circle cx="0" cy="0" r="105" fill="none" stroke="#E2E8F0" stroke-width="2.5" stroke-dasharray="8,6"/>
<rect x="-130" y="-170" width="36" height="340" rx="8" fill="#3B82F6"/>
<rect x="94" y="-170" width="36" height="140" rx="8" fill="#CBD5E1"/>
<rect x="94" y="70" width="36" height="100" rx="8" fill="#CBD5E1"/>
<rect x="-94" y="-18" width="188" height="36" rx="8" fill="#38BDF8"/>
<polygon points="0,-28 24.2,14 -24.2,14" fill="#F59E0B" stroke="#F59E0B" stroke-width="8" stroke-linejoin="round"/>
<circle cx="74" cy="-74" r="14" fill="#DBEAFE" stroke="#3B82F6" stroke-width="2.5"/>
<line x1="28" y1="-28" x2="63" y2="-63" stroke="#3B82F6" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="-74" cy="-74" r="14" fill="#EDE9FE" stroke="#8B5CF6" stroke-width="2.5"/>
<line x1="-28" y1="-28" x2="-63" y2="-63" stroke="#8B5CF6" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="74" cy="74" r="14" fill="#CFFAFE" stroke="#06B6D4" stroke-width="2.5"/>
<line x1="28" y1="28" x2="63" y2="63" stroke="#06B6D4" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="-74" cy="74" r="14" fill="#FEF3C7" stroke="#F59E0B" stroke-width="2.5"/>
<line x1="-28" y1="28" x2="-63" y2="63" stroke="#F59E0B" stroke-width="3" stroke-dasharray="6,4" opacity="0.6"/>
<circle cx="0" cy="0" r="42" fill="none" stroke="#F59E0B" stroke-width="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB