front/xhs-agent-desktop/README.md
2026-07-02 15:52:09 +08:00

50 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# OMS 小红书 Agent 桌面端
**替代 LIKE AI 的独立程序**:内置 Chrome 扩展、Bridge 引擎与自动化脚本,只需本程序 + OMS 网页即可使用。
## 架构
```
OMS 网页(编排任务) ←→ HTTPS + JWT ←→ 本桌面端(执行浏览器操作)
├── engine/extension Chrome 扩展
├── engine/scripts 自动化 CLI
└── engine/xhs_bridge Bridge 服务
```
网页负责:内容分析、爆款创作、发布记录、拟人设置、AI 助手配置等。
桌面端负责:连接 OMS、启停引擎、执行网页下发的任务。
## 安装
```powershell
cd E:\oms0414\xhs-agent-desktop
.\run.ps1
```
首次运行会自动创建 `.venv` 并安装依赖。
## 使用(一键连接)
1. 浏览器登录 OMS,打开 **小红书 → 启动服务**(保持页面打开)
2. 运行桌面端 `run.ps1`,点击 **连接 OMS**
3. 网页会自动把登录凭证发给本机 Agent,**无需填写 API 地址或 Token**
4. **启动引擎**,在 Chrome `chrome://extensions` 加载扩展目录(界面已显示路径)
5. 打开小红书登录;网页即可远程控制
若未自动授权,桌面端会打开授权页;也可手动访问 `/xhs/agentPair`。
## 开发说明
`engine/` 目录为从 LIKE AI 提取的运行时(无 GUI)。后续可在 OMS 仓库内独立演进,不再依赖外部 LIKE AI 安装。
更新运行时(可选):
```powershell
.\sync-engine.ps1
```
## 联调
- 开发环境:网页 dev server(5173)会通过 Vite 代理 `/xhs`;桌面端配对后自动使用相同根地址
- 生产环境:配对时自动写入 `VITE_API_ADMIN_URL` 对应的后端地址