mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-17 11:07:11 +08:00
Merge the "Models" menu item into the "Settings" page with top tabs
(Basic / Models), reducing one nav entry. Basic settings now only handles
provider + model selection; API key/base are consolidated into the Models
tab. Unconfigured providers are marked in the dropdown and guide the user
to configure them.
The Models tab covers all 7 capabilities (chat/vision/image/asr/tts/
embedding/search) with vendor credentials and routing. The vendor section
follows the web client's unified design: built-in and custom providers
share one grid, "set as default" is removed, and credentials are configured
via modals.
- Add settings/ directory: SettingsPage (tab shell), BasicSettings, ModelsTab,
CapabilityCard, primitives, modelsHelpers; remove the old ConfigPage
- Rewrite ModelEntry/ModelProvider/CapabilityState/SearchCapabilityState in
types.ts to match the real /api/models shape (mixed string|{value,hint})
- Fix empty chat model dropdown: chat has no provider_models, so fall back
to the top-level providers[].models
- Fix chat scroll sliding from top on session switch: snap instantly to
bottom on switch, smooth-scroll only for streaming updates
- Rename the Knowledge menu label and align model/config copy with the web
client (vendor credentials, main model, etc.)
- Clean up orphaned i18n keys
CowAgent Desktop
Cross-platform desktop client for CowAgent, built with Electron + React + TypeScript.
Development
Prerequisites
- Node.js 18+
- npm or yarn
- Python 3.7+ (for the backend)
Setup
cd desktop
npm install
Run in Development
Start the renderer dev server and Electron together:
npm run dev
Or run them separately:
# Terminal 1: Start Vite dev server
npm run dev:renderer
# Terminal 2: Start Electron (after renderer is ready)
npm run dev:main
The app will automatically start the Python backend from the parent directory.
Build
# Build for current platform
npm run dist
# Build for macOS only
npm run dist:mac
# Build for Windows only
npm run dist:win
Build outputs are placed in the release/ directory.
Architecture
desktop/
├── src/
│ ├── main/ # Electron main process
│ │ ├── index.ts # Window management, IPC
│ │ ├── python-manager.ts # Python backend lifecycle
│ │ └── preload.ts # Context bridge for renderer
│ └── renderer/ # React UI (Vite)
│ └── src/
│ ├── api/ # HTTP client for backend APIs
│ ├── components/ # Reusable UI components
│ ├── hooks/ # React hooks
│ ├── pages/ # Page components
│ └── types.ts # TypeScript types
├── resources/ # App icons
├── package.json # Dependencies and build config
└── vite.config.ts # Vite config
How it Works
- Electron main process starts and creates the app window
- It spawns the Python backend (
app.py) as a child process - The React UI communicates with the Python backend via HTTP APIs
- SSE (Server-Sent Events) is used for streaming chat responses and live logs