Content
# Lingxi AI · WPS Office Multi-Host AI Assistant
**🌐 Language**: English · [English](README.en.md)
A TaskPane compatible with **WPS Writer / Spreadsheets / Presentation / PDF** four endpoints, supporting multiple AI providers (Codex / OpenAI compatible / Anthropic) + one image provider. AI can directly read and write documents through tools.
> 🤖 100% completed with Claude vibe coding: architecture, provider adaptation, PPT themes/charts, Word rendering, cross-platform installer, and documentation through [Claude](https://claude.com/claude-code) and human conversation iteration. No manual coding in the repository - feel free to fork and vibe.
---
## Screenshots
| WPS Writer | WPS Spreadsheets | WPS Presentation |
|---|---|---|
|  |  |  |
---
## Get Started in 5 Minutes
### 1. Download Installation Package
| Platform | Installation Package | Size |
|---|---|---|
| **Windows** | [`lingxi-ai-1.3.0-setup.exe`](https://github.com/lewis-hui1202/WPS-AI/releases) | ~30 MB |
| **macOS** | [`lingxi-ai-1.3.0.pkg`](https://github.com/lewis-hui1202/WPS-AI/releases) (double-click to install) | ~35 MB |
Both packages include a built-in Node runtime, **no need to install Node separately**.
### 2. Installation
- **Windows**: Temporarily disable antivirus real-time protection → double-click setup.exe → completely exit WPS → restart WPS, and the "Lingxi AI" tab will appear in the ribbon.
- **macOS**: **Right-click .pkg → Open** (Gatekeeper may block unsigned packages, double-click may result in an error) → enter system password → completely exit WPS → restart WPS.
Detailed steps (uninstall / upgrade / troubleshooting / installer building) see [INSTALL.md](INSTALL.md).
### 3. Configure AI Model
1. Click "Open Lingxi AI" on the ribbon → TaskPane pops up on the right → ⚙ settings (independent 960×720 popup).
2. "Chat Model" panel → **+ Add Vendor** → select one of the 12 presets (baseURL is pre-filled).
3. Enter API Key → ⚡ test → close popup → select model from header dropdown to start chatting.
**Multiple providers can be used simultaneously**: DeepSeek + Anthropic + Codex + Kimi can be used together, and switched from the dropdown.
| Preset | baseURL (pre-filled) |
|---|---|
| **Codex (ChatGPT OAuth)** | (OAuth) |
| **Anthropic** / **OpenAI** | `api.anthropic.com` / `api.openai.com` |
| **DeepSeek** / **Kimi** / **Qwen** | DeepSeek / Moonshot / DashScope compatible addresses |
| **GLM** / **豆包** / **硅基** / **OpenRouter** | OpenAI compatible protocol addresses |
| **Local Ollama** | `http://localhost:11434/v1` (no API key required) |
| **Custom** | URL + Key self-filled |
#### System Requirements
| Item | Windows | macOS |
|---|---|---|
| **Operating System** | Windows 10 / 11 (x64) | macOS 10.15 Catalina+ (Intel + Apple Silicon) |
| **WPS** | WPS Office 12.x+ | WPS Office 5.x+ |
| **Runtime** | Built-in portable Node 22.x | Built-in darwin-x64 + arm64 Node |
| **Permissions** | Default installation to user directory | Installation requires system password (writing to `/Library/Application Support/LingxiAI/`) |
Not supported: WebOffice, mobile WPS, low-version desktop clients — JSAPI plugin requires desktop clients + above minimum version.
---
## Feature Overview
### Common Features
**AI Integration**
- Support multiple chat providers (Codex / Anthropic / OpenAI compatible 11 providers + custom), header dropdown grouped by provider.
- Three ability icons next to the model: 🖼 Image / 📄 PDF / 💡 Thinking.
- Thinking intensity adjustable (low / medium / high / off), mapped to `thinking.budget_tokens` / `reasoning_effort` / `reasoning.effort` by provider.
- PDF as multimodal attachment feeding large models, Claude uses document block / OpenAI uses Files API / Codex uses input_file.
- Streaming output + tool-use loop: continuously call multiple tool operations within a single conversation.
- **Preview confirmation mode** vs **AI direct writing mode**: two safety levels.
**TaskPane Experience**
- Settings / PPT style presets independent WPS dialog window, detached from TaskPane width limit.
- One-click detach / dock: floating window with 8 corner resize handles.
- Popups adapt to screen resolution (no overflow on small screens).
**Conversation**
- Multi-conversation management + complete history replay (inference + tool calls + text response).
- Tool call bubble similar to Claude Code: default shows only tail parameter preview, result arrives and disappears; can open developer log in settings to view complete JSON.
- Progress bar with recent output segment.
- AI working during document lock banner + progress merge (no visual overlap).
- Attachment support: image / PDF / text file.
- System prompt customizable; support "skills" (built-in 4 sets + import .md/.txt) to拼 to system prompt.
**Operation Security**
- AI working during hard document lock (Word `Document.Protect` / Excel `UserInterfaceOnly`).
- Temporary document reject modification (before chatting, fail-fast to avoid waiting for AI output).
- Per-turn document backup + one-click rollback (automatic GC recent 20 documents).
- Modification record Tab: grouped by file, expand to view input/before snapshot/error.
- Configuration import and export (API Key encryption + version compatibility).
### Writer / Spreadsheets / Presentation / PDF
| Host | Feature Overview |
|---|---|
| **Writer** | 6 groups of shortcut buttons (writing / rewriting / polishing / translation / summarization / intelligent) + markdown→Word native format (true table + nested list + paragraph indent forced to zero) |
| **Spreadsheets** | Cell/range read/write, batch formatting, table beautification, column width adaptive, AI-generated formula / conversion table / proofreading |
| **Presentation** | 50+ sets of color palettes with design concept + 8 shape templates + 4 SVG visual templates + 6 data visualization charts + PPT outline generation + HTML template system (17 layouts: cover / section / content / stat / feature-grid / quote / comparison / metric-trio / timeline / agenda / two-column / image-text / process / table / bento / closer / freeform) + visual editor (drag / 8-direction resize / multi-select / PS-style alignment guides + snap) + ECharts + unified style + AI flavor removal |
| **PDF** | Side-by-side translation (markdown original/translation table) + full-text summarization + document-generated PPT outline + PDF Q&A + intelligent recommendation operation |
### MCP Service (added in v1.4)
Settings → MCP Service → enable exposes WPS tools to external agents (Claude Code CLI / Claude Desktop / Cursor, etc.):
- JSON configuration one-click copy (automatically fill in plugin installation path).
- Tools displayed grouped by host.
- Real-time status badge (connected / enabled but not connected / disabled).
---
## Project Structure
```text
plugin/
├── taskpane.html # Business UI entry
├── main.js # Script loader
├── manifest.json / ribbon.xml # Plugin declaration + ribbon
├── css/style.css
├── js/
│ ├── app.js # Business UI orchestration
│ ├── wps.js / hosts/* # Host distribution + host jsapi bridge
│ ├── providers/* # Provider registry + 12 presets + capabilities
│ ├── tools/* # AI-callable tools (grouped by host + registry)
│ ├── html-templates/* # Template system (cache / components / renderer / studio)
│ ├── mcp-bridge.js # MCP bridge (plugin side)
│ └── skills.js # Skills (built-in + imported)
└── tools/
├── proxy-server.js # CORS proxy + file / backup / MCP endpoint
├── mcp-server.js # stdio MCP server (for external agents)
├── serve-permanent.js # Permanent mode static server
├── build-variants.js # Multi-host variant packaging
└── dev.js / gen-ribbon.js
```
---
## Secondary Development
```bash
cd plugin
npm install
npm run dev:wps # or dev:et / dev:wpp / dev:pdf
```
Simultaneously starts CORS proxy (3890) and wpsjs debug (3889), WPS automatically awakens.
**Add new tool** — edit `js/tools/<host>.js`:
```js
registry.registerTool({
name: "wps_my_tool",
hosts: ["wps"], // or ["wps","et","wpp","pdf"]
description: "...", // The clearer AI knows when to call
parameters: { type: "object", properties: { ... }, required: [...] },
handler: async (params) => ({ ok: true, ... })
});
```
**Add new ribbon button** — edit `js/quick-actions.js`, run `npm run gen-ribbon`.
**Permanent mode packaging** — `node tools/build-variants.js --out C:/path/dist-permanent`.
---
## Known Limitations
- Exclusive to WPS desktop clients, Web/Mobile WPS not supported.
- Mac WPS WKWebView permanent mode occasionally requires clearing WebKit cache after reinstallation (see [INSTALL.md](INSTALL.md) Q7).
- wpsjs debug can only register one host at a time, debugging switch host mainly restarts.
- Codex OAuth is a non-official reuse solution; OpenAI adjusting authorization strategy may require updating client_id.
- Image provider protocol bound toapis; switching to other services requires adapting in `providers/image.js`.
---
## Feedback
### Join Fan Group
Scan the QR code to follow the official account, reply `ai` to get the fan group link, and communicate with other users or report bugs:
<img src="img/qrcode_for_gh_e26e731fb54c_258.jpg" alt="Official Account QR Code" width="160" />
> WeChat scan → follow official account → reply `ai` → join fan group
### Bug Report Information
If you find a bug, please report in the group or [GitHub Issues](https://github.com/lewis-hui1202/WPS-AI/issues) with:
- System + WPS version
- Which host, which tool triggered
- Console error (TaskPane internal right-click → inspect / "Open JS Debugger")
- Last 50 lines of `~/.lingxi-ai/server.log` (permanent mode)
---
## Update Log
Complete change record see [CHANGELOG.md](CHANGELOG.md).
- **v1.4** (completed): HTML template system expanded to 17 layouts (cover/section/content/stat/feature-grid/quote/comparison/metric-trio/timeline/agenda/two-column/image-text/process/table/bento/closer/freeform, typography + editing feel details + golden ratio transformation) / HTML preview visual editor (arbitrary layout automatically converted to freeform, then drag / 8-direction resize / multi-select / PS-style alignment guides + 6px snap + Shift temporary disable / coordinate hint) / skills (opt-in, no default enable) / MCP service / responsive popup / PPT style preset independent window + visual theme grid + real-time preview / grayscale hot update (device SN + canary whitelist + rolloutPercent percentage release) / local Ollama model selection suggestion / image generation (toapis + codex-bridge, including CF JA3 interception accurate error attribution)
- **v1.3**: PDF host / multi-vendor management / settings popup / TaskPane free layout
- **v1.2.1**: multi-conversation management / modification record / document lock / configuration encryption
- **v1.1**: permanent installation upgrade / Mac WKWebView cache fix / IME input compatibility
- **v1.0**: first version (permanent installation / 12 themes / 6 charts / multi-provider)
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
No recommendations available