feat: add version tracking and update mechanism
- Add VERSION file (1.2.0) - SKILL.md Step 1: auto-check for updates on each run - SKILL.md: add "更新" auxiliary function (git pull) - README: install via git clone instead of cp/ln - build_openclaw.py: include VERSION in dist Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1e4a74f930
commit
f1e9c084d9
4 changed files with 24 additions and 8 deletions
18
README.md
18
README.md
|
|
@ -122,19 +122,21 @@ python3 toolkit/cli.py themes
|
|||
|
||||
## 安装
|
||||
|
||||
**Claude Code**:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/oaker-io/wewrite.git
|
||||
cd wewrite
|
||||
pip install -r requirements.txt
|
||||
git clone --depth 1 https://github.com/oaker-io/wewrite.git ~/.claude/skills/wewrite
|
||||
cd ~/.claude/skills/wewrite && pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### 挂载为 Skill
|
||||
**OpenClaw**:
|
||||
|
||||
**Claude Code**:`cp -r wewrite ~/.claude/skills/wewrite`
|
||||
```bash
|
||||
git clone --depth 1 https://github.com/oaker-io/wewrite.git ~/.openclaw/skills/wewrite
|
||||
cd ~/.openclaw/skills/wewrite && pip install -r requirements.txt
|
||||
```
|
||||
|
||||
**OpenClaw**:`ln -s /path/to/wewrite/dist/openclaw ~/.openclaw/skills/wewrite`
|
||||
|
||||
> `dist/openclaw/` 是自动构建的 OpenClaw 兼容版(工具名、路径变量已转换),push to main 时 CI 自动更新。
|
||||
安装后 skill 会在每次运行时自动检查新版本。有更新时说"更新"即可升级。
|
||||
|
||||
### 配置(可选)
|
||||
|
||||
|
|
|
|||
12
SKILL.md
12
SKILL.md
|
|
@ -53,6 +53,7 @@ allowed-tools:
|
|||
- 读取 `writing-config.yaml`(如存在),检查是否有 AI 特征参数(emotional_arc: flat、paragraph_rhythm: structured、closing_style: summary)
|
||||
- 读取 `history.yaml` 最近 5 篇,检查 persona 使用和 WebSearch 降级情况
|
||||
4. 综合输出自然语言报告 + 按优先级排序的改进建议
|
||||
- 用户说"更新"/"更新 WeWrite"/"升级" → 在 `{skill_dir}` 执行 `git pull origin main`,完成后告知版本变化
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -73,6 +74,17 @@ python3 -c "import markdown, bs4, cssutils, requests, yaml, pygments, PIL" 2>&1
|
|||
| `wechat.appid` + `secret` | 静默 | 设 `skip_publish = true` |
|
||||
| `image.api_key` | 静默 | 设 `skip_image_gen = true` |
|
||||
|
||||
**1a-2. 版本检查**(静默通过或提醒):
|
||||
|
||||
```bash
|
||||
cd {skill_dir} && git fetch origin main --quiet 2>/dev/null
|
||||
```
|
||||
|
||||
比对本地 `{skill_dir}/VERSION` 与远程 `git show origin/main:VERSION`:
|
||||
- 相同 → 静默通过
|
||||
- 不同 → 提示用户:"WeWrite 有新版本可用(当前 X → 最新 Y),说「更新」即可升级。"**不阻断流程**,继续 Step 1b
|
||||
- git 不可用(无 .git 目录或 fetch 失败)→ 静默跳过
|
||||
|
||||
**1b. 加载风格**:
|
||||
|
||||
```
|
||||
|
|
|
|||
1
VERSION
Normal file
1
VERSION
Normal file
|
|
@ -0,0 +1 @@
|
|||
1.2.0
|
||||
|
|
@ -23,6 +23,7 @@ COPY_FILES = [
|
|||
"config.example.yaml",
|
||||
"style.example.yaml",
|
||||
"writing-config.example.yaml",
|
||||
"VERSION",
|
||||
]
|
||||
|
||||
# Frontmatter keys to strip (OpenClaw ignores allowed-tools)
|
||||
|
|
|
|||
Loading…
Reference in a new issue