wangchuan 2.20.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.
- package/README.md +146 -174
- package/README.zh-CN.md +254 -0
- package/dist/bin/wangchuan.d.ts +1 -1
- package/dist/bin/wangchuan.js +11 -3
- package/dist/bin/wangchuan.js.map +1 -1
- package/dist/src/agents/codex.d.ts +9 -0
- package/dist/src/agents/codex.d.ts.map +1 -0
- package/dist/src/agents/codex.js +20 -0
- package/dist/src/agents/codex.js.map +1 -0
- package/dist/src/agents/index.d.ts.map +1 -1
- package/dist/src/agents/index.js +2 -0
- package/dist/src/agents/index.js.map +1 -1
- package/dist/src/commands/completions.d.ts +9 -0
- package/dist/src/commands/completions.d.ts.map +1 -0
- package/dist/src/commands/completions.js +202 -0
- package/dist/src/commands/completions.js.map +1 -0
- package/dist/src/commands/init.d.ts +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +30 -1
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/list.d.ts.map +1 -1
- package/dist/src/commands/list.js +1 -0
- package/dist/src/commands/list.js.map +1 -1
- package/dist/src/commands/pull.d.ts.map +1 -1
- package/dist/src/commands/pull.js +3 -0
- package/dist/src/commands/pull.js.map +1 -1
- package/dist/src/commands/push.d.ts.map +1 -1
- package/dist/src/commands/push.js +3 -0
- package/dist/src/commands/push.js.map +1 -1
- package/dist/src/commands/sync.d.ts.map +1 -1
- package/dist/src/commands/sync.js +3 -0
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/template.js +1 -1
- package/dist/src/commands/template.js.map +1 -1
- package/dist/src/core/config.d.ts +9 -9
- package/dist/src/core/config.d.ts.map +1 -1
- package/dist/src/core/config.js +11 -11
- package/dist/src/core/config.js.map +1 -1
- package/dist/src/core/crypto.d.ts +10 -10
- package/dist/src/core/crypto.d.ts.map +1 -1
- package/dist/src/core/crypto.js +19 -19
- package/dist/src/core/crypto.js.map +1 -1
- package/dist/src/core/git.d.ts +2 -2
- package/dist/src/core/git.js +9 -9
- package/dist/src/core/git.js.map +1 -1
- package/dist/src/core/hooks.d.ts +14 -0
- package/dist/src/core/hooks.d.ts.map +1 -0
- package/dist/src/core/hooks.js +35 -0
- package/dist/src/core/hooks.js.map +1 -0
- package/dist/src/core/json-field.d.ts +5 -5
- package/dist/src/core/json-field.d.ts.map +1 -1
- package/dist/src/core/json-field.js +5 -5
- package/dist/src/core/json-field.js.map +1 -1
- package/dist/src/core/sync.d.ts +9 -9
- package/dist/src/core/sync.js +47 -47
- package/dist/src/core/sync.js.map +1 -1
- package/dist/src/i18n.d.ts.map +1 -1
- package/dist/src/i18n.js +12 -2
- package/dist/src/i18n.js.map +1 -1
- package/dist/src/types.d.ts +31 -24
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +3 -3
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/linediff.d.ts +6 -5
- package/dist/src/utils/linediff.d.ts.map +1 -1
- package/dist/src/utils/linediff.js +10 -9
- package/dist/src/utils/linediff.js.map +1 -1
- package/dist/test/crypto.test.d.ts +1 -1
- package/dist/test/crypto.test.js +16 -16
- package/dist/test/crypto.test.js.map +1 -1
- package/dist/test/json-field.test.d.ts +1 -1
- package/dist/test/json-field.test.js +13 -13
- package/dist/test/json-field.test.js.map +1 -1
- package/dist/test/sync.test.d.ts +8 -8
- package/dist/test/sync.test.js +122 -113
- package/dist/test/sync.test.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,185 +1,194 @@
|
|
|
1
|
-
# 忘川
|
|
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
|
|
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
|
+
[](https://www.npmjs.com/package/wangchuan)
|
|
11
|
+
[](https://nodejs.org)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Features
|
|
10
17
|
|
|
11
|
-
|
|
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
|
-
##
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
| `init`
|
|
20
|
-
| `pull`
|
|
21
|
-
| `push`
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
##
|
|
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/
|
|
48
|
-
cd
|
|
78
|
+
git clone https://github.com/nicepkg/wangchuan.git
|
|
79
|
+
cd wangchuan
|
|
49
80
|
npm install
|
|
50
|
-
npm run build
|
|
51
|
-
npm link
|
|
81
|
+
npm run build
|
|
82
|
+
npm link
|
|
52
83
|
```
|
|
53
84
|
|
|
54
85
|
---
|
|
55
86
|
|
|
56
|
-
##
|
|
87
|
+
## Quick Start
|
|
57
88
|
|
|
58
|
-
### 1.
|
|
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
|
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
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.
|
|
100
|
+
### 2. Push local configs
|
|
70
101
|
|
|
71
102
|
```bash
|
|
72
|
-
wangchuan push
|
|
103
|
+
wangchuan push -m "initial sync"
|
|
73
104
|
```
|
|
74
105
|
|
|
75
|
-
### 3.
|
|
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.
|
|
113
|
+
### 4. Check status
|
|
84
114
|
|
|
85
115
|
```bash
|
|
86
116
|
wangchuan status
|
|
87
117
|
```
|
|
88
118
|
|
|
89
|
-
### 5.
|
|
119
|
+
### 5. Switch language
|
|
90
120
|
|
|
91
121
|
```bash
|
|
92
|
-
wangchuan lang
|
|
93
|
-
wangchuan lang
|
|
94
|
-
wangchuan
|
|
122
|
+
wangchuan lang en # English
|
|
123
|
+
wangchuan lang zh # Chinese
|
|
124
|
+
WANGCHUAN_LANG=en wangchuan status # env override
|
|
95
125
|
```
|
|
96
126
|
|
|
97
|
-
|
|
127
|
+
### 6. Filter by agent
|
|
98
128
|
|
|
99
129
|
```bash
|
|
100
|
-
|
|
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
|
-
##
|
|
137
|
+
## Supported Agents
|
|
114
138
|
|
|
115
|
-
|
|
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
|
-
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Repo Structure (v2)
|
|
120
154
|
|
|
121
155
|
```
|
|
122
156
|
repo/
|
|
123
|
-
├── shared/
|
|
124
|
-
│ ├── skills/
|
|
125
|
-
│ ├── mcp/
|
|
126
|
-
│ └── memory/SHARED.md.enc
|
|
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
|
|
130
|
-
│ │ ├── AGENTS.md Agent
|
|
131
|
-
│ │ └── SOUL.md Agent
|
|
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
|
|
134
|
-
│ │ ├── settings.json.enc
|
|
135
|
-
│ │ └── mcpServers.json.enc
|
|
136
|
-
│
|
|
137
|
-
│
|
|
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
|
-
|
|
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
|
-
|
|
180
|
+
## Encryption
|
|
169
181
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
##
|
|
179
|
-
|
|
180
|
-
配置位于 `~/.wangchuan/config.json`,示例见 [.wangchuan/config.example.json](.wangchuan/config.example.json)。
|
|
189
|
+
## Configuration
|
|
181
190
|
|
|
182
|
-
Config at `~/.wangchuan/config.json
|
|
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,
|
|
194
|
-
"claude": { "enabled": true,
|
|
195
|
-
"gemini": { "enabled": true,
|
|
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
|
-
##
|
|
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`
|
|
233
|
-
2.
|
|
234
|
-
3.
|
|
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
|
-
##
|
|
226
|
+
## Project Structure
|
|
239
227
|
|
|
240
228
|
```
|
|
241
229
|
wangchuan/
|
|
242
|
-
├── bin/wangchuan.ts CLI
|
|
230
|
+
├── bin/wangchuan.ts CLI entry
|
|
243
231
|
├── src/
|
|
244
232
|
│ ├── core/
|
|
245
|
-
│ │ ├── sync.ts
|
|
246
|
-
│ │ ├── json-field.ts JSON
|
|
247
|
-
│ │ ├── crypto.ts AES-256-GCM
|
|
248
|
-
│ │ ├── git.ts simple-git
|
|
249
|
-
│ │ ├── config.ts
|
|
250
|
-
│ │ └── migrate.ts v1→v2
|
|
251
|
-
│ ├──
|
|
252
|
-
│
|
|
253
|
-
│
|
|
254
|
-
│
|
|
255
|
-
│
|
|
256
|
-
|
|
257
|
-
|
|
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
|
|
247
|
+
└── config.example.json Config example (v2)
|
|
276
248
|
```
|
|
277
249
|
|
|
278
250
|
---
|