Skip to content

Latest commit

 

History

384 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-WPS

A WPS AI assistant for intranet office terminals. Architecture: native WPS JS/HTML add-in + local Python adapter + enterprise AI API. The add-in owns UI, document extraction, preview, and write-back. Rules, templates, configuration, logs, diagnostics, and model calls stay in the local adapter.

Current scope is Phase 1: platform foundation + Word / Excel / PPT, targeting Kylin V10 ARM, Python 3.8, and offline install.

English | Chinese

Product page: English · 中文

Current Version

Item Value
Version v0.26.0-preview.1
Version rule number AI-WPS-WORD-EXCEL-PPT-0.26.0-preview.1
Phase P1 platform foundation + Word + Excel + PPT
Runtime target Kylin V10 ARM, Python 3.8, WPS native JS add-in
Delivery status v0.26.0-preview.1 automated status candidate after build; Issue #120 target-machine acceptance remains manual-pending; blocking Issue #119 implementation is completed and closed
Baseline v0.25.3-alpha target-machine acceptance is target-accepted under Issue #59

v0.26.0-preview.1 establishes the neutral Preview delivery boundary and adds Excel Smart Fill as the ninth independently configured task. The feature is synthetic-data validated and still requires target-machine acceptance; the package does not claim WPS or model acceptance. The accepted v0.25.3-alpha baseline remains recorded under Issue #59.

Version rule: AI-WPS-P{phase}-{scope}-{major.minor.patch}-{yyyymmdd}. Major is a compatibility boundary, minor is user-visible capability, patch covers fixes, UI, packaging, and docs.

What's new

Version Summary
v0.26.0-preview.1 Excel Smart Fill as an independently configured ninth task; guarded preview and write-back
v0.25.3-alpha Result preview; format-issue cards; caption-association conclusions; slide page roles
v0.25.2-alpha Image-semantics supplement default-on with visual-off degrade; PPT Chinese template title recognition
v0.25.1-alpha Format-review v2 JS/Python hash contract; allowlist assembly; Python 3.8 lifecycle gate
v0.25.0-alpha Deterministic format review and restricted semantics DSL; image semantics shipped dormant

Frozen kits: v0.25.2-alpha candidate 20260825-850871c (SHA-256 c5d663d1249147104bee66790fea60f5e15675418a51c0c1a7a0fc028a285a92); v0.25.1-alpha candidate 20260824-d7a1dd8 (SHA-256 ec318db4ffbda499c24aa6fb50958628cc4eaa030b22389bbf29cd783b1adbf6). Rejected predecessors, gate numbers, and lineage live in packaging/v0253-delivery.md, packaging/v0252-delivery.md, and packaging/v0251-delivery.md.

Features

Word, Excel, and PPT ship as separate add-ins so Ribbon buttons never cross-display. Model output is previewed before any write-back. Review and analysis tasks are read-only by default.

Host Entry Notes
Word Smart Write Rewrite, continue, summarize, custom write; preview / compare / plain text, then write-back
Word Smart Imitation Template-based imitation; preview, plain text, copy; no write-back
Word Document Review Typos, expression, logic, fluency, professionalism; selection or limited full document
Word Format Review Against 技术文件格式及书写要求; 格式问题 cards, 题注关联结论, 图像语义补充; no format write-back
Word Writing policy Four preset packs plus a local organization library
Excel 智能分析 Selected or used range; structured report and briefing paragraph; no cell writes
Excel 公式助手 Explicit selection (max 30×20); generate or explain; copy only
Excel 智能填写 One contiguous single-column target (max 500); preview, edit/exclude/retry, then guarded write-back; no undo
PPT 智能总结 Current slide, or one .md / .docx (≤10 MB) for a full-deck outline; preview and copy only
PPT 结构审查 Up to 60 slides; 幻灯片页角色 list; read-only

The local adapter (default 127.0.0.1:18100) stores per-task model configurations for nine tasks. Workflow-platform access uses /chat-messages; direct-model access uses OpenAI-compatible /chat/completions. Runtime requests do not fall back to a unified URL or key. Production mock output stays off unless explicitly enabled.

Architecture

flowchart LR
  User[User in WPS] --> Addin[WPS JS/HTML Add-in]
  Addin --> Bridge[Document Bridge]
  Bridge --> Adapter[Local Adapter<br/>127.0.0.1:18100]
  Adapter --> Rules[Rules and templates]
  Adapter --> Provider[Enterprise AI API]
  Adapter --> Logs[Logs and diagnostics]
  Adapter --> Addin
  Addin --> Preview[Preview and confirm]
  Preview --> WPS[Write back]
Loading
  • The add-in handles UI, extraction, preview, and write-back.
  • Documents travel as structured payloads (paragraphs, headings, fonts, sizes, alignment, outline levels).
  • Health distinguishes live, ready, degraded, and recovery. Recovery blocks config changes and new model jobs.

Repository Map

Path Purpose
wps-addon/ Add-in source (Vite + TypeScript)
adapter_service/ Local adapter (FastAPI, rules, provider, tests)
formal-plugin-kit/ Formal WPS manual-import kit
templates/ Office templates and review rules
config/ Runtime config examples
packaging/ Offline install, diagnostics, kit build
phase1-delivery-kit/ Phase 1 installer and acceptance materials
adapter-start-kit/ Manual adapter startup kit
probe-kit/ Target-machine runtime probe
docs/ Design, operations, acceptance
jsaddons/ WPS import / publish materials

Quick Start

For local development, start the adapter then load the add-in. For intranet terminals use Offline Delivery.

1. Start the local adapter

cd adapter_service
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --host 127.0.0.1 --port 18100

Health check:

curl http://127.0.0.1:18100/health/live
curl -i http://127.0.0.1:18100/health/ready
curl http://127.0.0.1:18100/health

/health/live does not read business data. /health/ready returns 503 in recovery. Aggregate /health always returns 200 with sanitized subsystem status. Without FastAPI deps: python adapter_service/standalone_adapter.py 18100. Recovery operations: runtime-state recovery guide.

2. Build or import the add-in

cd wps-addon
npm install
npm test
npm run build

Output is wps-addon/dist/. Formal terminals should import formal-plugin-kit/.

3. Configure the enterprise AI provider

cp config/adapter.example.json config/adapter.json
export ENTERPRISE_AI_API_KEY="your-api-key"

adapter.json stores access method, URL, model parameters, and key references. Keys live under run/provider_api_keys/<ref>. See config/adapter.example.json and the model configuration guide.

Docs

Doc Topic
Model configuration Workflow platform / direct model, keys, activation
Writing policy Preset packs, import/export, backup, degrade
Smart Write Word writing workflow
Smart Imitation Word imitation workflow
Document Review Word document review
Format Review Word format review
智能分析 Excel analysis
公式助手 Excel formula assistant
Excel Smart Fill contract Smart Fill input/output, limits, and write-back boundary
Excel Smart Fill workflow Workflow-platform configuration and validation
智能总结 PPT current-slide / document summary
结构审查 PPT structure review
Prompt templates Deployable Excel / PPT templates
Kylin test host Target machine and SSH

API Summary

Envelope:

{
  "success": true,
  "traceId": "word-document-review-...",
  "taskType": "word.document_review",
  "message": "completed",
  "data": {},
  "errors": []
}
Group Paths
Health GET /health/live, /health/ready, /health
Recovery POST /recovery/backups, GET /recovery/diagnostics
Config GET /config, GET /templates, GET /provider/status
Model configs /provider/model-configurations plus activate, rotate key, validate, copy
Writing policy /writing-policies/* (items, import preview, export, backup)
Word /word/smart-write/jobs, /word/smart-imitation/jobs, /word/document-review/jobs, /word/format-review/jobs (v2 snapshot / job / issues / report)
Excel /excel/analysis/jobs, /excel/formula-assistant/jobs, /excel/smart-fill/jobs; preview compatibility route /excel/smart-fill
PPT /ppt/document-files, /ppt/slide-assistant/jobs, /ppt/structure-review/jobs

POST /word/format-review is retired and always returns 410 WORD_FORMAT_REVIEW_SYNC_RETIRED. Long tasks submit a job, poll with short requests, and allow cancel only while queued.

Offline Delivery

The formal Phase 1 release is one Word / Excel / PPT package and one installer. Overwrite installs keep config/adapter.json, API keys, the writing-policy database, and existing backups.

bash packaging/build_offline_bundle.sh
bash packaging/install.sh "$HOME/.wps-ai-assistant"
bash packaging/start_adapter.sh "$HOME/.wps-ai-assistant" 18100
bash packaging/diagnose.sh "$HOME/.wps-ai-assistant"
bash packaging/uninstall.sh "$HOME/.wps-ai-assistant"

Default output: dist-offline/wps-ai-assistant-offline.tar.gz.

Command Purpose
bash packaging/build_formal_plugin_kit.sh Formal add-in import kit
bash packaging/build_probe_kit.sh Target-machine probe kit
bash packaging/build_adapter_start_kit.sh Manual adapter start kit

When system Python has no pip, get-pip runs with -sS so Kylin apt dist-packages are not scanned.

Tests

cd adapter_service
pytest
cd wps-addon
npm test

Target-machine regression uses Python 3.8 on Kylin V10 ARM64 (test host). Delivery audit scripts live under packaging/.

Roadmap

Phase 1 covers the three-host task pane, structured extraction, adapter health and config, nine tasks, guarded preview-then-write-back for Word and Excel Smart Fill, runtime probe, and offline install. The current neutral Preview package remains target-machine manual-pending.

Later work on the same adapter can add multi-sheet Excel flows, multi-file compare, governed PPT generation, and richer template / audit / policy governance.

About

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages