Skip to content

Commit 4e7dd73

Browse files
kellyvvclaude
andcommitted
docs: add YouTube videos, WeChat EN section, fix port + install UX
- README: demo video below top screenshots, how-it-works video in engine architecture section (both zh + en) - README_EN: add WeChat integration section (parity with zh) - README_EN: fix port typo 8800 → 8000 - GitHub Actions: build + ad-hoc sign + release OpenHer.app.zip on tag push - setup.sh: auto-detect Python 3.11+ (tries 3.13/3.12/3.11 via Homebrew) - run.sh: venv path validation — upgrade first, rebuild only on failure - .gitignore: add .venv/, .build/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0d5b45e commit 4e7dd73

6 files changed

Lines changed: 235 additions & 10 deletions

File tree

.github/workflows/build-app.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Build macOS App
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build:
12+
runs-on: macos-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Build with Swift (Release)
17+
working-directory: desktop/OpenHer
18+
run: swift build -c release
19+
20+
- name: Assemble .app bundle
21+
working-directory: desktop/OpenHer
22+
run: |
23+
BUILD_DIR=".build/release"
24+
APP_DIR="$BUILD_DIR/OpenHer.app"
25+
CONTENTS="$APP_DIR/Contents"
26+
MACOS_DIR="$CONTENTS/MacOS"
27+
RESOURCES_DIR="$CONTENTS/Resources"
28+
29+
mkdir -p "$MACOS_DIR" "$RESOURCES_DIR"
30+
31+
# Binary
32+
cp "$BUILD_DIR/OpenHer" "$MACOS_DIR/OpenHer"
33+
34+
# Icon
35+
if [ -f "Sources/Resources/AppIcon.icns" ]; then
36+
cp "Sources/Resources/AppIcon.icns" "$RESOURCES_DIR/AppIcon.icns"
37+
fi
38+
39+
# SPM resource bundles
40+
for bundle in "$BUILD_DIR"/*.bundle; do
41+
if [ -d "$bundle" ]; then
42+
cp -R "$bundle" "$MACOS_DIR/"
43+
fi
44+
done
45+
46+
# Info.plist
47+
TAG_VERSION="${GITHUB_REF_NAME#v}"
48+
cat > "$CONTENTS/Info.plist" << PLIST
49+
<?xml version="1.0" encoding="UTF-8"?>
50+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
51+
<plist version="1.0">
52+
<dict>
53+
<key>CFBundleExecutable</key>
54+
<string>OpenHer</string>
55+
<key>CFBundleIdentifier</key>
56+
<string>com.openher.app</string>
57+
<key>CFBundleName</key>
58+
<string>OpenHer</string>
59+
<key>CFBundleDisplayName</key>
60+
<string>OpenHer</string>
61+
<key>CFBundleVersion</key>
62+
<string>${TAG_VERSION}</string>
63+
<key>CFBundleShortVersionString</key>
64+
<string>${TAG_VERSION}</string>
65+
<key>CFBundleIconFile</key>
66+
<string>AppIcon</string>
67+
<key>CFBundlePackageType</key>
68+
<string>APPL</string>
69+
<key>LSMinimumSystemVersion</key>
70+
<string>14.0</string>
71+
<key>NSHighResolutionCapable</key>
72+
<true/>
73+
</dict>
74+
</plist>
75+
PLIST
76+
77+
# Ad-hoc code signing (avoids Gatekeeper quarantine block)
78+
codesign --force --deep --sign - "$APP_DIR"
79+
80+
echo "✅ OpenHer.app assembled and signed (ad-hoc)"
81+
82+
- name: Create zip
83+
working-directory: desktop/OpenHer
84+
run: |
85+
cd .build/release
86+
ditto -c -k --keepParent OpenHer.app OpenHer.app.zip
87+
echo "✅ OpenHer.app.zip created ($(du -h OpenHer.app.zip | cut -f1))"
88+
89+
- name: Create GitHub Release
90+
uses: softprops/action-gh-release@v2
91+
with:
92+
files: desktop/OpenHer/.build/release/OpenHer.app.zip
93+
body: |
94+
## OpenHer macOS 客户端
95+
96+
下载 `OpenHer.app.zip`,解压后双击打开。
97+
98+
> ⚠️ 首次打开 macOS 可能会提示"无法验证开发者",请右键 → 打开 → 信任。
99+
100+
需要后端服务配合使用,请参考 [快速开始](https://github.com/kellyvv/OpenHer#-快速开始)。
101+
generate_release_notes: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ node_modules/
1818
.data/
1919
models/
2020
.pytest_cache/
21+
.venv/
22+
.build/
2123
venv/
2224
*.egg-info/
2325
dist/

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
</table>
3333

3434
*她们在等你唤醒。*
35+
36+
<br>
37+
38+
[![演示视频](https://img.youtube.com/vi/AE7bspVHEI8/maxresdefault.jpg)](https://www.youtube.com/watch?v=AE7bspVHEI8)
39+
3540
</div>
3641

3742
---
@@ -187,8 +192,12 @@ OpenHer 以同样的逻辑构建 Persona Engine——**运用仿生机制,创
187192

188193
<div align="center">
189194
<img src="docs/assets/architecture.png" alt="OpenHer Persona Engine 架构图" width="90%">
190-
</div>
191195

196+
<br>
197+
198+
[![原理讲解视频](https://img.youtube.com/vi/9X8CnuJpc9M/maxresdefault.jpg)](https://www.youtube.com/watch?v=9X8CnuJpc9M)
199+
200+
</div>
192201

193202
不同的随机种子 → 不同的神经网络初始化 → 不同的涌现人格。相同 MBTI,完全不同的人——连我们自己都会感到意外。
194203

@@ -324,13 +333,24 @@ INFO: Uvicorn running on http://0.0.0.0:8000
324333

325334
### 四、启动桌面客户端
326335

336+
**推荐:下载预编译版本**
337+
338+
[GitHub Releases](https://github.com/kellyvv/OpenHer/releases) 下载最新的 `OpenHer.app.zip`,解压后双击打开。
339+
340+
> ⚠️ 首次打开 macOS 可能提示"无法验证开发者",请右键 → 打开 → 信任。
341+
342+
<details>
343+
<summary>🔧 开发者:从源码编译</summary>
344+
327345
```bash
328346
cd desktop/OpenHer
329347
chmod +x run.sh
330348
./run.sh # 编译 SwiftUI 应用并启动 OpenHer.app
331349
```
332350

333-
> 需要 macOS 14.0+ 和 Xcode 命令行工具(`xcode-select --install`)。
351+
需要 macOS 14.0+ 和 Xcode 命令行工具(`xcode-select --install`)。
352+
353+
</details>
334354

335355
### 五、长期记忆(可选)
336356

README_EN.md

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
</table>
3333

3434
*They are waiting for you to awaken them.*
35+
36+
<br>
37+
38+
[![Demo](https://img.youtube.com/vi/AE7bspVHEI8/maxresdefault.jpg)](https://www.youtube.com/watch?v=AE7bspVHEI8)
39+
3540
</div>
3641

3742
---
@@ -165,6 +170,11 @@ An extensible skill framework that gives her real-world capabilities. Weather, s
165170

166171
<div align="center">
167172
<img src="docs/assets/architecture.png" alt="OpenHer Persona Engine Architecture" width="90%">
173+
174+
<br>
175+
176+
[![How It Works Video](https://img.youtube.com/vi/9X8CnuJpc9M/maxresdefault.jpg)](https://www.youtube.com/watch?v=9X8CnuJpc9M)
177+
168178
</div>
169179

170180
**The core insight:** no line of prompt describes her personality. The Critic perceives 8-dimensional context, 5 drives metabolize with real time, and the Genome Engine's random neural network fuses it all into 8 behavioral signals — what the LLM reads is not an instruction, but a living personality state. Different seeds → different people → emergent surprises.
@@ -295,19 +305,30 @@ python main.py
295305

296306
You should see:
297307
```
298-
INFO: Uvicorn running on http://0.0.0.0:8800
308+
INFO: Uvicorn running on http://0.0.0.0:8000
299309
✓ GenomeEngine loaded · 10 personas available
300310
```
301311

302312
### 4. Launch the Desktop Client
303313

314+
**Recommended: Download pre-built app**
315+
316+
Download the latest `OpenHer.app.zip` from [GitHub Releases](https://github.com/kellyvv/OpenHer/releases), unzip and double-click to open.
317+
318+
> ⚠️ macOS may warn "unverified developer" on first launch — right-click → Open → Trust.
319+
320+
<details>
321+
<summary>🔧 Developers: Build from source</summary>
322+
304323
```bash
305324
cd desktop/OpenHer
306325
chmod +x run.sh
307326
./run.sh # Builds SwiftUI app and launches OpenHer.app
308327
```
309328

310-
> Requires macOS 14.0+ and Xcode Command Line Tools (`xcode-select --install`).
329+
Requires macOS 14.0+ and Xcode Command Line Tools (`xcode-select --install`).
330+
331+
</details>
311332

312333
### 5. Long-Term Memory (Optional)
313334

@@ -332,6 +353,50 @@ Set in `.env`:
332353
EVERMEMOS_BASE_URL=http://localhost:1995/api/v1
333354
```
334355

356+
### 💬 WeChat Integration (Optional)
357+
358+
Connect OpenHer to WeChat via [wechat-to-anything](https://www.npmjs.com/package/wechat-to-anything) for the full text, voice, and photo experience.
359+
360+
**How it works:** A lightweight Python adapter (`wechat_adapter.py`) translates the OpenHer REST API into OpenAI-compatible format. `wechat-to-anything` handles WeChat message routing.
361+
362+
```
363+
WeChat user ←→ wechat-to-anything ←→ wechat_adapter.py ←→ OpenHer
364+
(bridge) (adapter :8001) (backend :8000)
365+
```
366+
367+
**1. Start the adapter**
368+
369+
```bash
370+
python wechat_adapter.py
371+
# 🔗 OpenHer WeChat Adapter
372+
# Listen: 0.0.0.0:8001
373+
```
374+
375+
Environment variables:
376+
377+
| Variable | Description | Default |
378+
|----------|-------------|---------|
379+
| `OPENHER_BASE` | OpenHer backend URL | `http://localhost:8000` |
380+
| `OPENHER_PERSONA` | Default persona | `luna` |
381+
| `ADAPTER_PORT` | Adapter port | `8001` |
382+
383+
**2. Start the WeChat bridge**
384+
385+
```bash
386+
npx -y wechat-to-anything@latest http://localhost:8001/v1
387+
# A QR code will appear on first run — scan with WeChat to log in
388+
```
389+
390+
**Supported message types:**
391+
392+
| Direction | Text | Voice | Photo | File |
393+
|:----------|:----:|:-----:|:-----:|:----:|
394+
| WeChat → Agent || ✅ auto-transcribed | ✅ multimodal | ✅ content extracted |
395+
| Agent → WeChat || ✅ persona TTS | ✅ CDN upload ||
396+
397+
- **Voice replies:** Uses the persona engine's emotional TTS (Qwen3-TTS + emotional guidance), auto-encoded to SILK format
398+
- **Photo replies:** Gemini Imagen → adapter serves locally → bridge downloads and CDN-uploads → WeChat image message
399+
335400
---
336401

337402
## 🎨 Create Your Own Character

run.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,27 @@ cd "$(dirname "$0")"
1212
PORT=${PORT:-8000}
1313
LOG_FILE=".data/server.log"
1414

15-
# Activate venv
15+
# Activate venv (with path validation)
1616
if [ -d ".venv" ]; then
17+
# Check if venv python shebang points to a valid interpreter
18+
VENV_PYTHON=".venv/bin/python"
19+
if [ -f "$VENV_PYTHON" ]; then
20+
SHEBANG_PATH=$(head -1 "$VENV_PYTHON" | sed 's/^#!//')
21+
if [ ! -x "$SHEBANG_PATH" ]; then
22+
echo "⚠️ 虚拟环境路径已失效(项目被移动过?)"
23+
echo " 尝试修复..."
24+
if python3 -m venv --upgrade .venv 2>/dev/null; then
25+
echo "✅ 虚拟环境已修复 (upgrade)"
26+
else
27+
echo "♻️ 修复失败,正在重建虚拟环境..."
28+
rm -rf .venv
29+
python3 -m venv .venv
30+
source .venv/bin/activate
31+
pip install -r requirements.txt -q
32+
echo "✅ 虚拟环境已重建"
33+
fi
34+
fi
35+
fi
1736
source .venv/bin/activate
1837
fi
1938

setup.sh

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,36 @@ echo "║ OpenHer — 环境安装 ║"
1010
echo "╚══════════════════════════════════════╝"
1111
echo ""
1212

13-
# 1. Python version check
13+
# 1. Python version check (auto-detect Homebrew versions)
1414
PYTHON=${PYTHON:-python3}
1515
PY_VERSION=$($PYTHON --version 2>&1 | grep -oE '[0-9]+\.[0-9]+')
1616
PY_MAJOR=$(echo "$PY_VERSION" | cut -d. -f1)
1717
PY_MINOR=$(echo "$PY_VERSION" | cut -d. -f2)
1818

1919
if [ "$PY_MAJOR" -lt 3 ] || ([ "$PY_MAJOR" -eq 3 ] && [ "$PY_MINOR" -lt 11 ]); then
20-
echo "❌ 需要 Python 3.11+,当前版本: $PY_VERSION"
21-
echo " brew install python@3.13 (macOS)"
22-
exit 1
20+
echo "⚠️ 默认 Python 版本太低: $PY_VERSION(需要 3.11+)"
21+
echo " 正在搜索更高版本..."
22+
FOUND=0
23+
for V in python3.13 python3.12 python3.11; do
24+
if command -v "$V" &>/dev/null; then
25+
PYTHON="$V"
26+
PY_VERSION=$($PYTHON --version 2>&1 | grep -oE '[0-9]+\.[0-9]+')
27+
echo "✅ 找到 $V ($PY_VERSION)"
28+
FOUND=1
29+
break
30+
fi
31+
done
32+
if [ "$FOUND" -eq 0 ]; then
33+
echo ""
34+
echo "❌ 未找到 Python 3.11+,请先安装:"
35+
echo ""
36+
echo " brew install python@3.13"
37+
echo ""
38+
echo " 安装后重新运行 bash setup.sh"
39+
exit 1
40+
fi
2341
fi
24-
echo "✅ Python $PY_VERSION"
42+
echo "✅ Python $PY_VERSION ($PYTHON)"
2543

2644
# 2. Virtual environment
2745
if [ ! -d ".venv" ]; then

0 commit comments

Comments
 (0)