wangchuan 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +146 -174
  2. package/README.zh-CN.md +254 -0
  3. package/dist/bin/wangchuan.d.ts +1 -1
  4. package/dist/bin/wangchuan.js +2 -2
  5. package/dist/src/agents/codex.d.ts +9 -0
  6. package/dist/src/agents/codex.d.ts.map +1 -0
  7. package/dist/src/agents/codex.js +20 -0
  8. package/dist/src/agents/codex.js.map +1 -0
  9. package/dist/src/agents/index.d.ts.map +1 -1
  10. package/dist/src/agents/index.js +2 -0
  11. package/dist/src/agents/index.js.map +1 -1
  12. package/dist/src/commands/completions.js +2 -2
  13. package/dist/src/commands/completions.js.map +1 -1
  14. package/dist/src/commands/list.d.ts.map +1 -1
  15. package/dist/src/commands/list.js +1 -0
  16. package/dist/src/commands/list.js.map +1 -1
  17. package/dist/src/commands/template.js +1 -1
  18. package/dist/src/commands/template.js.map +1 -1
  19. package/dist/src/core/config.d.ts +9 -9
  20. package/dist/src/core/config.d.ts.map +1 -1
  21. package/dist/src/core/config.js +11 -11
  22. package/dist/src/core/config.js.map +1 -1
  23. package/dist/src/core/crypto.d.ts +10 -10
  24. package/dist/src/core/crypto.d.ts.map +1 -1
  25. package/dist/src/core/crypto.js +19 -19
  26. package/dist/src/core/crypto.js.map +1 -1
  27. package/dist/src/core/git.d.ts +2 -2
  28. package/dist/src/core/git.js +9 -9
  29. package/dist/src/core/git.js.map +1 -1
  30. package/dist/src/core/json-field.d.ts +5 -5
  31. package/dist/src/core/json-field.d.ts.map +1 -1
  32. package/dist/src/core/json-field.js +5 -5
  33. package/dist/src/core/json-field.js.map +1 -1
  34. package/dist/src/core/sync.d.ts +9 -9
  35. package/dist/src/core/sync.js +47 -47
  36. package/dist/src/core/sync.js.map +1 -1
  37. package/dist/src/i18n.js +2 -2
  38. package/dist/src/i18n.js.map +1 -1
  39. package/dist/src/types.d.ts +24 -23
  40. package/dist/src/types.d.ts.map +1 -1
  41. package/dist/src/types.js +3 -3
  42. package/dist/src/types.js.map +1 -1
  43. package/dist/src/utils/linediff.d.ts +6 -5
  44. package/dist/src/utils/linediff.d.ts.map +1 -1
  45. package/dist/src/utils/linediff.js +10 -9
  46. package/dist/src/utils/linediff.js.map +1 -1
  47. package/dist/test/crypto.test.d.ts +1 -1
  48. package/dist/test/crypto.test.js +16 -16
  49. package/dist/test/crypto.test.js.map +1 -1
  50. package/dist/test/json-field.test.d.ts +1 -1
  51. package/dist/test/json-field.test.js +13 -13
  52. package/dist/test/json-field.test.js.map +1 -1
  53. package/dist/test/sync.test.d.ts +8 -8
  54. package/dist/test/sync.test.js +122 -113
  55. package/dist/test/sync.test.js.map +1 -1
  56. package/package.json +1 -1
package/README.md CHANGED
@@ -1,185 +1,194 @@
1
- # 忘川 · Wangchuan
1
+ # Wangchuan (忘川)
2
+
3
+ [中文文档](README.zh-CN.md)
2
4
 
3
- > 忘川是中国神话中冥界的遗忘之河,亡魂渡河饮水即忘前世一切记忆。
4
- > 而 **Wangchuan** 让你的 agent 记忆在环境切换时永不遗失。
5
- >
6
5
  > In Chinese mythology, Wangchuan (忘川) is the River of Oblivion in the underworld — souls crossing it forget all memories of past lives.
7
6
  > **Wangchuan** ensures your AI agent memories are never lost across environments.
8
7
 
9
- AI 记忆同步系统,支持 OpenClaw / Claude / Gemini 多种智能体记忆的加密备份与跨环境迁移。
8
+ Encrypted backup and cross-environment migration for AI agent configs and memories. Supports **7 agents**: OpenClaw, Claude, Gemini, CodeBuddy, WorkBuddy, Cursor, and Codex.
9
+
10
+ [![npm version](https://img.shields.io/npm/v/wangchuan)](https://www.npmjs.com/package/wangchuan)
11
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D18.19.0-brightgreen)](https://nodejs.org)
12
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
13
+
14
+ ---
15
+
16
+ ## Features
10
17
 
11
- AI memory sync system encrypted backup and cross-environment migration for OpenClaw / Claude / Gemini agents.
18
+ - **AES-256-GCM encryption**keys stored locally, never committed to Git
19
+ - **7 agents** — OpenClaw, Claude, Gemini, CodeBuddy, WorkBuddy, Cursor, Codex
20
+ - **Cross-agent sharing** — skills and MCP configs auto-distributed across all agents
21
+ - **JSON field-level sync** — extract specific fields (e.g. `mcpServers` from `.claude.json`)
22
+ - **Delete propagation** — items deleted from all agents are pruned from repo
23
+ - **One-click restore** — `init + pull` fully restores all agent configs on a new server
24
+ - **Conflict resolution** — interactive overwrite/skip choices on pull
25
+ - **Auto-rollback** — failed operations don't pollute repo history
26
+ - **i18n** — full English and Chinese CLI support via `wangchuan lang zh|en`
27
+ - **Plaintext token scanning** — auto-detect leaked secrets before push
28
+ - **Config migration** — automatic v1→v2 migration with backup and rollback
12
29
 
13
30
  ---
14
31
 
15
- ## 功能特性 / Features
16
-
17
- | 命令 / Command | 描述 / Description |
18
- |------|------|
19
- | `init` | 初始化系统、生成 AES-256-GCM 密钥、克隆私有仓库 / Initialize system, generate AES-256-GCM key, clone private repo |
20
- | `pull` | 从私有仓库拉取并解密配置,还原到本地工作区 / Pull and decrypt configs from repo, restore to local workspace |
21
- | `push` | 将本地配置加密推送到私有仓库 / Encrypt and push local configs to repo |
22
- | `status` | 查看仓库状态、工作区差异与文件清单 / Show repo status, workspace diff and file inventory |
23
- | `diff` | 逐文件显示本地与仓库的行级差异(自动解密)/ Show line-level diff per file (auto-decrypt) |
24
- | `list` | 列出所有托管文件,显示本地/仓库存在状态 / List all managed files with local/repo presence |
25
- | `dump` | 生成明文快照到临时目录,方便检查同步内容 / Generate plaintext snapshot to temp dir for inspection |
26
- | `lang` | 切换 CLI 显示语言(zh/en)/ Switch CLI display language (zh/en) |
27
-
28
- - **AES-256-GCM** 加密:密钥本地存储,永不提交 Git / Encryption: keys stored locally, never committed to Git
29
- - 全局 `--agent` 过滤:只操作指定智能体 / Global `--agent` filter: operate on a single agent only
30
- - **多语言 / i18n**:`wangchuan lang zh|en` 切换 CLI 显示语言,支持环境变量 `WANGCHUAN_LANG` 覆盖 / `wangchuan lang zh|en` to switch CLI language, `WANGCHUAN_LANG` env override
31
- - **细粒度同步 / Fine-grained sync**:JSON 字段级提取(如 `.claude.json` 只同步 `mcpServers`) / JSON field-level extraction (e.g. only sync `mcpServers` from `.claude.json`)
32
- - **跨 agent 共享 / Cross-agent sharing**:Skills 和 MCP 配置自动在所有 agent 间分发 / Skills and MCP configs auto-distributed across all agents
33
- - **删除传播 / Delete propagation**:所有 agent 都删除的 skill/MCP → 自动从 repo 清理 / Items deleted from all agents are pruned from repo
34
- - **一键还原 / One-click restore**:新服务器 `init + pull` 即可完整恢复所有 agent 配置 / New server `init + pull` fully restores all agent configs
35
- - 推送前自动扫描明文 token/apiKey / Auto-scan for plaintext tokens before push
36
- - 拉取时检测本地独有文件,提示同步到云端 / Detect local-only files on pull, prompt to push
37
- - 拉取冲突时交互式选择:覆盖 / 跳过 / 全部覆盖 / 全部跳过 / Interactive conflict resolution on pull
38
- - 失败自动回滚,不污染仓库历史 / Auto-rollback on failure, no repo pollution
39
- - v1→v2 自动迁移,备份 + 锁文件 + 回滚保护 / Auto v1→v2 migration with backup + lock + rollback
40
- - 支持 OpenClaw Skill 封装,对话直接调用 / OpenClaw Skill wrapper for conversational invocation
32
+ ## Commands
33
+
34
+ | Command | Description |
35
+ |---------|-------------|
36
+ | `init` | Initialize system, generate AES-256-GCM key, clone private repo |
37
+ | `pull` | Pull and decrypt configs from repo, restore to local workspace |
38
+ | `push` | Encrypt and push local configs to repo |
39
+ | `sync` | Two-way sync (pull then push) |
40
+ | `status` | Show repo status, workspace diff and file inventory |
41
+ | `diff` | Line-level diff per file (auto-decrypt) |
42
+ | `list` | List all managed files with local/repo presence |
43
+ | `dump` | Generate plaintext snapshot to temp dir for inspection |
44
+ | `lang` | Switch CLI display language (zh/en) |
45
+ | `watch` | Watch for file changes and auto-sync |
46
+ | `env` | Manage sync environments (create/switch/list/delete) |
47
+ | `agent` | Manage agents (list/enable/disable/set-path/info) |
48
+ | `key` | Key management (export/import/rotate) |
49
+ | `report` | Generate sync report |
50
+ | `doctor` | Diagnose and fix common issues |
51
+ | `history` | Show sync operation history |
52
+ | `snapshot` | Create/restore/list point-in-time snapshots |
53
+ | `summary` | Show sync summary statistics |
54
+ | `setup` | Guided interactive setup wizard |
55
+ | `health` | System health check |
56
+ | `search` | Search across synced files |
57
+ | `config` | Config export/import management |
58
+ | `changelog` | Show sync changelog |
59
+ | `tag` | Memory tagging system |
60
+ | `cleanup` | Clean up expired memory entries |
61
+ | `template` | Apply pre-built sync config templates |
62
+ | `batch` | Run multiple commands in sequence |
63
+ | `completions` | Generate shell completion scripts (bash/zsh) |
64
+
65
+ All commands support `--agent <name>` filtering (except `lang`).
41
66
 
42
67
  ---
43
68
 
44
- ## 安装 / Installation
69
+ ## Installation
70
+
71
+ ```bash
72
+ npm install -g wangchuan
73
+ ```
74
+
75
+ Or from source:
45
76
 
46
77
  ```bash
47
- git clone https://github.com/SUpermin6u/wangchuan.git ~/wangchuan
48
- cd ~/wangchuan
78
+ git clone https://github.com/nicepkg/wangchuan.git
79
+ cd wangchuan
49
80
  npm install
50
- npm run build # 编译 TypeScript / Compile TypeScript
51
- npm link # 全局注册 wangchuan 命令(可选)/ Register global command (optional)
81
+ npm run build
82
+ npm link
52
83
  ```
53
84
 
54
85
  ---
55
86
 
56
- ## 快速开始 / Quick Start
87
+ ## Quick Start
57
88
 
58
- ### 1. 初始化 / Initialize
89
+ ### 1. Initialize
59
90
 
60
91
  ```bash
61
92
  wangchuan init --repo git@github.com:yourname/your-brain.git
62
93
  ```
63
94
 
64
- 执行后 / After running:
65
- - 生成 `~/.wangchuan/config.json`(系统配置)/ Creates system config
66
- - 生成 `~/.wangchuan/master.key`(主密钥,**请妥善保管**)/ Creates master key (**keep it safe**)
67
- - 克隆仓库到 `~/.wangchuan/repo` / Clones repo
95
+ This creates:
96
+ - `~/.wangchuan/config.json` system configuration
97
+ - `~/.wangchuan/master.key` master encryption key (**back this up!**)
98
+ - `~/.wangchuan/repo` local clone of your sync repo
68
99
 
69
- ### 2. 推送本地配置 / Push local configs
100
+ ### 2. Push local configs
70
101
 
71
102
  ```bash
72
- wangchuan push --message "初始化配置"
103
+ wangchuan push -m "initial sync"
73
104
  ```
74
105
 
75
- ### 3. 在新环境拉取记忆 / Pull memories on a new machine
106
+ ### 3. Pull on a new machine
76
107
 
77
108
  ```bash
78
- # 用 --key 导入已有密钥 / Import existing key with --key
79
109
  wangchuan init --repo git@github.com:yourname/your-brain.git --key /path/to/master.key
80
110
  wangchuan pull
81
111
  ```
82
112
 
83
- ### 4. 查看同步状态 / Check sync status
113
+ ### 4. Check status
84
114
 
85
115
  ```bash
86
116
  wangchuan status
87
117
  ```
88
118
 
89
- ### 5. 切换显示语言 / Switch display language
119
+ ### 5. Switch language
90
120
 
91
121
  ```bash
92
- wangchuan lang # 查看当前语言 / Show current language
93
- wangchuan lang en # 切换到英文 / Switch to English
94
- wangchuan lang zh # 切换到中文 / Switch to Chinese
122
+ wangchuan lang en # English
123
+ wangchuan lang zh # Chinese
124
+ WANGCHUAN_LANG=en wangchuan status # env override
95
125
  ```
96
126
 
97
- 也可通过环境变量覆盖 / Or override via env var:
127
+ ### 6. Filter by agent
98
128
 
99
129
  ```bash
100
- WANGCHUAN_LANG=en wangchuan status
101
- ```
102
-
103
- ### 6. 只操作指定智能体 / Filter by agent
104
-
105
- ```bash
106
- wangchuan push --agent openclaw -m "更新 OpenClaw 记忆"
107
- wangchuan pull --agent claude
130
+ wangchuan push --agent claude -m "update Claude config"
131
+ wangchuan pull --agent openclaw
108
132
  wangchuan diff --agent gemini
109
133
  ```
110
134
 
111
135
  ---
112
136
 
113
- ## 支持同步的配置 / Sync Scope
137
+ ## Supported Agents
114
138
 
115
- 每个智能体的 `workspacePath` 均可在 `~/.wangchuan/config.json` 中自定义。
139
+ | Agent | Default Path | Sync Files | JSON Fields |
140
+ |-------|-------------|------------|-------------|
141
+ | **OpenClaw** | `~/.openclaw/workspace/` | MEMORY.md (enc), AGENTS.md, SOUL.md | — |
142
+ | **Claude** | `~/.claude/` | CLAUDE.md, settings.json (enc) | `.claude.json` → `mcpServers` (enc) |
143
+ | **Gemini** | `~/.gemini/` | — | `settings.internal.json` → `security`, `model` |
144
+ | **CodeBuddy** | `~/.codebuddy/` | MEMORY.md (enc), CODEBUDDY.md | `mcp.json` → `mcpServers` (enc) |
145
+ | **WorkBuddy** | `~/.workbuddy/` | MEMORY.md (enc), IDENTITY.md, SOUL.md, USER.md (enc) | `mcp.json` → `mcpServers` (enc) |
146
+ | **Cursor** | `~/.cursor/` | rules/ (dir) | `mcp.json` → `mcpServers` (enc), `cli-config.json` → fields (enc) |
147
+ | **Codex** | `~/.codex/` | MEMORY.md (enc), instructions.md | — |
116
148
 
117
149
  Each agent's `workspacePath` can be customized in `~/.wangchuan/config.json`.
118
150
 
119
- ### Repo 目录结构 / Repo Structure (v2)
151
+ ---
152
+
153
+ ## Repo Structure (v2)
120
154
 
121
155
  ```
122
156
  repo/
123
- ├── shared/ 跨 agent 共享 / Cross-agent shared
124
- │ ├── skills/ 所有 agent 的 skills 合并 / Merged skills from all agents
125
- │ ├── mcp/ 各 agent 的 MCP 配置提取 / Extracted MCP configs
126
- │ └── memory/SHARED.md.enc 跨 agent 共享记忆 / Shared memory
157
+ ├── shared/ Cross-agent shared tier
158
+ │ ├── skills/ Merged skills from all agents
159
+ │ ├── mcp/ Extracted MCP configs
160
+ │ └── memory/SHARED.md.enc Shared memory (encrypted)
127
161
  ├── agents/
128
162
  │ ├── openclaw/
129
- │ │ ├── MEMORY.md.enc 永久记忆(加密)/ Long-term memory (encrypted)
130
- │ │ ├── AGENTS.md Agent 行为准则 / Agent behavior rules
131
- │ │ └── SOUL.md Agent 人格设定 / Agent persona
163
+ │ │ ├── MEMORY.md.enc Long-term memory (encrypted)
164
+ │ │ ├── AGENTS.md Agent behavior rules
165
+ │ │ └── SOUL.md Agent persona
132
166
  │ ├── claude/
133
- │ │ ├── CLAUDE.md 全局指令 / Global instructions
134
- │ │ ├── settings.json.enc 权限/插件/模型(加密)/ Permissions/plugins/model (encrypted)
135
- │ │ └── mcpServers.json.enc 从 .claude.json 提取的 mcpServers(加密)/ Extracted from .claude.json (encrypted)
136
- └── gemini/
137
- └── settings-sync.json settings.internal.json 提取的 security+model / Extracted fields
167
+ │ │ ├── CLAUDE.md Global instructions
168
+ │ │ ├── settings.json.enc Permissions/plugins/model (encrypted)
169
+ │ │ └── mcpServers.json.enc Extracted from .claude.json (encrypted)
170
+ ├── gemini/
171
+ └── settings-sync.json Extracted security + model fields
172
+ │ ├── codebuddy/
173
+ │ ├── workbuddy/
174
+ │ ├── cursor/
175
+ │ └── codex/
138
176
  ```
139
177
 
140
- ### OpenClaw(默认开启 / enabled by default)
141
-
142
- | 文件 / File | 加密 / Enc | 说明 / Description |
143
- |------|------|------|
144
- | `MEMORY.md` | ✔ | 永久记忆 / Long-term memory |
145
- | `AGENTS.md` | ✗ | 行为准则 / Behavior rules |
146
- | `SOUL.md` | ✗ | 人格设定 / Persona |
147
-
148
- 默认路径 / Default path:`~/.openclaw/workspace/`
149
-
150
- ### Claude(默认开启 / enabled by default)
151
-
152
- | 文件 / File | 加密 / Enc | 说明 / Description |
153
- |------|------|------|
154
- | `CLAUDE.md` | ✗ | 全局指令 / Global instructions |
155
- | `settings.json` | ✔ | 权限、插件、模型配置 / Permissions, plugins, model |
156
- | `.claude.json` → `mcpServers` | ✔ | JSON 字段级提取,仅同步 MCP 配置 / Field-level extraction, MCP config only |
157
-
158
- 默认路径 / Default path:`~/.claude/`
159
-
160
- ### Gemini(默认开启 / enabled by default)
161
-
162
- | 文件 / File | 加密 / Enc | 说明 / Description |
163
- |------|------|------|
164
- | `settings.internal.json` → `security`, `model` | ✔ | JSON 字段级提取 / Field-level extraction |
165
-
166
- 默认路径 / Default path:`~/.gemini/`
178
+ ---
167
179
 
168
- ### Shared 共享层 / Shared Tier
180
+ ## Encryption
169
181
 
170
- | 内容 / Content | 说明 / Description |
171
- |------|------|
172
- | `shared/skills/` | Claude OpenClaw skills 目录汇聚,自动分发 / Merged from all agents, auto-distributed |
173
- | `shared/mcp/` | 从各 agent 提取 MCP 配置,跨 agent 共享 / Extracted MCP configs, shared across agents |
174
- | `shared/memory/SHARED.md` | 跨 agent 共享记忆(加密)/ Cross-agent shared memory (encrypted) |
182
+ - **Algorithm**: AES-256-GCM (authenticated encryption, tamper-proof)
183
+ - **Key**: `~/.wangchuan/master.key` (32 bytes, hex-encoded)
184
+ - **Ciphertext format**: `IV(12B) + AuthTag(16B) + CipherText` Base64 `.enc` file
185
+ - ⚠️ **Losing `master.key` means losing access to all encrypted history back it up!**
175
186
 
176
187
  ---
177
188
 
178
- ## 配置文件 / Configuration
179
-
180
- 配置位于 `~/.wangchuan/config.json`,示例见 [.wangchuan/config.example.json](.wangchuan/config.example.json)。
189
+ ## Configuration
181
190
 
182
- Config at `~/.wangchuan/config.json`, see [.wangchuan/config.example.json](.wangchuan/config.example.json) for example.
191
+ Config at `~/.wangchuan/config.json`:
183
192
 
184
193
  ```jsonc
185
194
  {
@@ -190,9 +199,10 @@ Config at `~/.wangchuan/config.json`, see [.wangchuan/config.example.json](.wang
190
199
  "version": 2,
191
200
  "profiles": {
192
201
  "default": {
193
- "openclaw": { "enabled": true, "workspacePath": "~/.openclaw/workspace", ... },
194
- "claude": { "enabled": true, "workspacePath": "~/.claude", ... },
195
- "gemini": { "enabled": true, "workspacePath": "~/.gemini", ... }
202
+ "openclaw": { "enabled": true, "workspacePath": "~/.openclaw/workspace", ... },
203
+ "claude": { "enabled": true, "workspacePath": "~/.claude", ... },
204
+ "gemini": { "enabled": true, "workspacePath": "~/.gemini", ... },
205
+ "codex": { "enabled": true, "workspacePath": "~/.codex", ... }
196
206
  }
197
207
  },
198
208
  "shared": {
@@ -205,74 +215,36 @@ Config at `~/.wangchuan/config.json`, see [.wangchuan/config.example.json](.wang
205
215
 
206
216
  ---
207
217
 
208
- ## 加密说明 / Encryption
209
-
210
- - 算法 / Algorithm:**AES-256-GCM**(认证加密,防篡改 / Authenticated encryption, tamper-proof)
211
- - 密钥 / Key:`~/.wangchuan/master.key`(32 字节,十六进制存储 / 32 bytes, hex-encoded)
212
- - 密文格式 / Ciphertext format:`IV(12B) + AuthTag(16B) + CipherText`,Base64 编码后存储为 `.enc` 文件 / Base64-encoded `.enc` files
213
- - **⚠️ master.key 丢失将无法解密历史配置,请做好备份 / Losing master.key means losing access to all encrypted history — back it up!**
214
-
215
- ---
216
-
217
- ## OpenClaw Skill
218
-
219
- 将 `skill/` 目录注册为 OpenClaw Skill 后,即可在对话中直接说:
220
-
221
- Register the `skill/` directory as an OpenClaw Skill, then invoke via conversation:
222
-
223
- > "帮我拉取最新的 AI 配置" / "Pull the latest AI configs"
224
- > "把修改推送一下,备注:更新项目记忆" / "Push changes with note: update project memory"
225
- > "查看忘川状态" / "Check Wangchuan status"
226
- > "列出所有托管文件" / "List all managed files"
227
-
228
- ---
229
-
230
- ## 安全规范 / Security
218
+ ## Security
231
219
 
232
- 1. `master.key` 已加入 `.gitignore`,不会意外提交 / Added to `.gitignore`, never accidentally committed
233
- 2. 推送前自动扫描明文 token(`api_key`, `sk-xxx`, `password` 等)/ Auto-scan for plaintext tokens before push
234
- 3. 若需迁移密钥,用加密方式传输(不要通过明文邮件/IM)/ Transfer keys via encrypted channels only (never plaintext email/IM)
220
+ 1. `master.key` is in `.gitignore` never accidentally committed
221
+ 2. Auto-scan for plaintext tokens (`api_key`, `sk-xxx`, `password`, etc.) before push
222
+ 3. Transfer keys via encrypted channels only (never plaintext email/IM)
235
223
 
236
224
  ---
237
225
 
238
- ## 目录结构 / Project Structure
226
+ ## Project Structure
239
227
 
240
228
  ```
241
229
  wangchuan/
242
- ├── bin/wangchuan.ts CLI 入口 / CLI entry
230
+ ├── bin/wangchuan.ts CLI entry
243
231
  ├── src/
244
232
  │ ├── core/
245
- │ │ ├── sync.ts 同步引擎 / Sync engine (distribute, prune, 3-way ops)
246
- │ │ ├── json-field.ts JSON 字段级提取与合并 / JSON field extraction & merge
247
- │ │ ├── crypto.ts AES-256-GCM 加解密 / AES-256-GCM encrypt/decrypt
248
- │ │ ├── git.ts simple-git 封装 / simple-git wrapper
249
- │ │ ├── config.ts 配置管理 / Config management (v2 profiles + shared)
250
- │ │ └── migrate.ts v1→v2 迁移 / v1→v2 migration (backup + lock + rollback)
251
- │ ├── commands/
252
- ├── init.ts 初始化命令 / init command
253
- ├── pull.ts 拉取命令 / pull command (with localOnly detection)
254
- ├── push.ts 推送命令 / push command (with stale file cleanup)
255
- │ ├── status.ts 状态命令 / status command
256
- │ │ ├── diff.ts 差异命令 / diff command
257
- │ │ ├── list.ts 清单命令 / list command (shared/agents grouping)
258
- │ │ ├── dump.ts 明文快照 / dump command (plaintext snapshot)
259
- │ │ └── lang.ts 语言切换 / lang command (i18n switching)
260
- │ ├── utils/
261
- │ │ ├── logger.ts 日志工具 / Logger
262
- │ │ ├── validator.ts 参数校验 / Validator
263
- │ │ ├── linediff.ts LCS 行级差异算法 / LCS line diff
264
- │ │ └── prompt.ts 交互式冲突提示 / Interactive conflict prompt
265
- │ ├── i18n.ts 国际化消息字典 / i18n message dictionary & t() helper
266
- │ └── types.ts 全局类型定义 / Global type definitions
267
- ├── skill/
268
- │ ├── SKILL.md OpenClaw Skill 说明 / OpenClaw Skill doc
269
- │ └── wangchuan-skill.sh Skill 脚本 / Skill script
270
- ├── test/
271
- │ ├── crypto.test.ts 加密模块测试 / Crypto tests
272
- │ ├── json-field.test.ts JSON 字段提取测试 / JSON field tests
273
- │ └── sync.test.ts 同步引擎测试(42 用例)/ Sync engine tests (42 cases)
233
+ │ │ ├── sync.ts Sync engine (distribute, prune, 3-way ops)
234
+ │ │ ├── json-field.ts JSON field extraction & merge
235
+ │ │ ├── crypto.ts AES-256-GCM encrypt/decrypt
236
+ │ │ ├── git.ts simple-git wrapper
237
+ │ │ ├── config.ts Config management (v2 profiles + shared)
238
+ │ │ └── migrate.ts v1→v2 migration (backup + lock + rollback)
239
+ │ ├── agents/ Agent definitions (one file per agent)
240
+ │ ├── commands/ 28 CLI commands
241
+ │ ├── utils/ Logger, validator, line diff, prompt
242
+ │ ├── i18n.ts i18n message dictionary & t() helper
243
+ └── types.ts Global type definitions
244
+ ├── skill/ OpenClaw Skill wrapper
245
+ ├── test/ Unit tests (crypto, json-field, sync engine)
274
246
  └── .wangchuan/
275
- └── config.example.json 配置示例(v2)/ Config example (v2)
247
+ └── config.example.json Config example (v2)
276
248
  ```
277
249
 
278
250
  ---