wangchuan 1.0.2 → 2.2.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 (52) hide show
  1. package/.wangchuan/config.example.json +44 -19
  2. package/README.md +145 -91
  3. package/dist/bin/wangchuan.js +9 -0
  4. package/dist/bin/wangchuan.js.map +1 -1
  5. package/dist/src/commands/diff.d.ts.map +1 -1
  6. package/dist/src/commands/diff.js +3 -1
  7. package/dist/src/commands/diff.js.map +1 -1
  8. package/dist/src/commands/dump.d.ts +9 -0
  9. package/dist/src/commands/dump.d.ts.map +1 -0
  10. package/dist/src/commands/dump.js +68 -0
  11. package/dist/src/commands/dump.js.map +1 -0
  12. package/dist/src/commands/list.d.ts +1 -1
  13. package/dist/src/commands/list.d.ts.map +1 -1
  14. package/dist/src/commands/list.js +26 -12
  15. package/dist/src/commands/list.js.map +1 -1
  16. package/dist/src/commands/pull.d.ts.map +1 -1
  17. package/dist/src/commands/pull.js +11 -1
  18. package/dist/src/commands/pull.js.map +1 -1
  19. package/dist/src/commands/push.d.ts.map +1 -1
  20. package/dist/src/commands/push.js +13 -5
  21. package/dist/src/commands/push.js.map +1 -1
  22. package/dist/src/commands/status.d.ts.map +1 -1
  23. package/dist/src/commands/status.js +5 -2
  24. package/dist/src/commands/status.js.map +1 -1
  25. package/dist/src/core/config.d.ts +8 -1
  26. package/dist/src/core/config.d.ts.map +1 -1
  27. package/dist/src/core/config.js +54 -15
  28. package/dist/src/core/config.js.map +1 -1
  29. package/dist/src/core/json-field.d.ts +17 -0
  30. package/dist/src/core/json-field.d.ts.map +1 -0
  31. package/dist/src/core/json-field.js +21 -0
  32. package/dist/src/core/json-field.js.map +1 -0
  33. package/dist/src/core/migrate.d.ts +22 -0
  34. package/dist/src/core/migrate.d.ts.map +1 -0
  35. package/dist/src/core/migrate.js +183 -0
  36. package/dist/src/core/migrate.js.map +1 -0
  37. package/dist/src/core/sync.d.ts +7 -0
  38. package/dist/src/core/sync.d.ts.map +1 -1
  39. package/dist/src/core/sync.js +423 -68
  40. package/dist/src/core/sync.js.map +1 -1
  41. package/dist/src/types.d.ts +62 -17
  42. package/dist/src/types.d.ts.map +1 -1
  43. package/dist/test/json-field.test.d.ts +5 -0
  44. package/dist/test/json-field.test.d.ts.map +1 -0
  45. package/dist/test/json-field.test.js +71 -0
  46. package/dist/test/json-field.test.js.map +1 -0
  47. package/dist/test/sync.test.d.ts +13 -0
  48. package/dist/test/sync.test.d.ts.map +1 -0
  49. package/dist/test/sync.test.js +477 -0
  50. package/dist/test/sync.test.js.map +1 -0
  51. package/package.json +2 -2
  52. package/skill/SKILL.md +52 -39
package/skill/SKILL.md CHANGED
@@ -1,67 +1,80 @@
1
- # wangchuan — 智能体记忆同步技能
1
+ # wangchuan — 智能体记忆同步技能 / AI Agent Memory Sync Skill
2
2
 
3
- ## 技能简介
3
+ ## 技能简介 / Overview
4
4
 
5
- 忘川(Wangchuan)AI 记忆同步系统的 OpenClaw Skill 封装。
6
- 在对话中直接调用以同步 AI 智能体的配置文件,跨环境永不遗失记忆。
5
+ 忘川(Wangchuan)AI 记忆同步系统的 OpenClaw Skill 封装。在对话中直接调用以同步 AI 智能体的配置文件,跨环境永不遗失记忆。
7
6
 
8
- ## 命令速查
7
+ OpenClaw Skill wrapper for the Wangchuan AI memory sync system. Invoke directly in conversation to sync AI agent configs — memories never lost across environments.
8
+
9
+ ## 命令速查 / Command Reference
9
10
 
10
11
  ```
11
- wangchuan list [--agent openclaw|claude|gemini] 列出所有受管配置项
12
- wangchuan status [--agent openclaw|claude|gemini] 查看同步状态和差异摘要
13
- wangchuan diff [--agent openclaw|claude|gemini] 显示行级文件差异
14
- wangchuan pull [--agent openclaw|claude|gemini] 拉取远端配置,还原到本地
15
- wangchuan push [--agent <name>] [-m "<描述>"] 加密推送本地配置到远端
16
- wangchuan init --repo <git地址> 首次初始化
12
+ wangchuan list [--agent openclaw|claude|gemini] 列出所有受管配置项 / List managed configs
13
+ wangchuan status [--agent openclaw|claude|gemini] 查看同步状态和差异摘要 / Show sync status & diff summary
14
+ wangchuan diff [--agent openclaw|claude|gemini] 显示行级文件差异 / Show line-level file diff
15
+ wangchuan pull [--agent openclaw|claude|gemini] 拉取远端配置,还原到本地 / Pull & restore from repo
16
+ wangchuan push [--agent <name>] [-m "<描述>"] 加密推送本地配置到远端 / Encrypt & push to repo
17
+ wangchuan dump [--agent openclaw|claude|gemini] 生成明文快照到临时目录 / Plaintext snapshot to temp dir
18
+ wangchuan init --repo <git地址> 首次初始化 / First-time init
17
19
  ```
18
20
 
19
- ## 调用示例
21
+ ## 调用示例 / Invocation Examples
22
+
23
+ > 帮我列出忘川管理的所有配置文件 / List all files managed by Wangchuan
20
24
 
21
- > 帮我列出忘川管理的所有配置文件
25
+ > 查看一下忘川的同步状态 / Check Wangchuan sync status
22
26
 
23
- > 查看一下忘川的同步状态
27
+ > 只看 openclaw 的配置差异 / Show diff for openclaw only
24
28
 
25
- > 只看 openclaw 的配置差异
29
+ > 帮我把最新的 AI 记忆同步到本地 / Pull the latest AI memories to local
26
30
 
27
- > 帮我把最新的 AI 记忆同步到本地
31
+ > 只拉取 openclaw 的配置 / Pull openclaw configs only
28
32
 
29
- > 只拉取 openclaw 的配置
33
+ > 我修改了 MEMORY.md,帮我推送一下,描述是"更新项目记忆" / Push my MEMORY.md changes with note "update project memory"
30
34
 
31
- > 我修改了 MEMORY.md,帮我推送一下,描述是"更新项目记忆"
35
+ > 只推送 claude 的配置 / Push claude configs only
32
36
 
33
- > 只推送 claude 的配置
37
+ > 生成明文快照,让我检查一下同步内容 / Generate a plaintext dump so I can inspect
34
38
 
35
- ## 输出说明
39
+ ## 输出说明 / Output Guide
36
40
 
37
41
  ### list
38
- - `✔ 本地 ✔ 仓库` — 两侧均存在,已同步
39
- - `✔ 本地 · 仓库` — 本地有但未推送
40
- - `✖ 本地 ✔ 仓库` — 仓库有但本地缺失,执行 pull 还原
41
- - `[enc]` — 该文件加密存储(AES-256-GCM
42
+ - `✔ 本地 ✔ 仓库` — 两侧均存在,已同步 / Present on both sides, in sync
43
+ - `✔ 本地 · 仓库` — 本地有但未推送 / Local only, not yet pushed
44
+ - `✖ 本地 ✔ 仓库` — 仓库有但本地缺失,执行 pull 还原 / In repo but missing locally, run pull
45
+ - `[enc]` — 该文件加密存储(AES-256-GCM)/ Encrypted (AES-256-GCM)
46
+ - `[字段]` — JSON 字段级提取(只同步指定字段)/ JSON field-level extraction (only syncs specified fields)
42
47
 
43
48
  ### diff
44
- - `+` 绿色行 — 本地新增内容
45
- - `-` 红色行 — 仓库有但本地已删除
46
- - 灰色行 — 上下文(未变化)
47
- - `[enc]` — 加密文件已自动解密后再对比
49
+ - `+` 绿色行 — 本地新增内容 / Green: local additions
50
+ - `-` 红色行 — 仓库有但本地已删除 / Red: removed locally
51
+ - 灰色行 — 上下文(未变化)/ Gray: context (unchanged)
52
+ - `[enc]` — 加密文件已自动解密后再对比 / Encrypted files auto-decrypted for comparison
48
53
 
49
54
  ### push / pull
50
- - `[已加密]` / `[已解密]` — 经过 AES-256-GCM 处理
55
+ - `[已加密]` / `[已解密]` — 经过 AES-256-GCM 处理 / Processed with AES-256-GCM
56
+ - `[已清理]` — 所有 agent 都已删除的文件从 repo 移除 / Stale files pruned from repo (delete propagation)
57
+ - `⚠ 本地独有` — pull 时检测到本地有但 repo 无的文件,建议 push / Local-only files detected, suggest push
58
+
59
+ ## --agent 说明 / --agent Filter
51
60
 
52
- ## --agent 说明
61
+ 所有命令均支持 `--agent` 过滤,只操作指定智能体的配置。
53
62
 
54
- 所有命令均支持 `--agent` 过滤,只操作指定智能体的配置:
63
+ All commands support `--agent` to filter by agent.
55
64
 
56
- | 值 | 说明 |
65
+ | 值 / Value | 说明 / Description |
57
66
  |----|------|
58
- | `openclaw` | ~/.openclaw/workspace/ 下的所有配置 |
59
- | `claude` | ~/.claude/.claude.json(需在 config.json enabled:true)|
60
- | `gemini` | ~/.gemini/ 下的配置(需在 config.json 中 enabled:true)|
67
+ | `openclaw` | MEMORY.md(加密/enc)、AGENTS.md、SOUL.md — 默认/default ~/.openclaw/workspace/ |
68
+ | `claude` | CLAUDE.md、settings.json(加密/enc)、.claude.json→mcpServers 字段提取(加密/enc) — 默认/default ~/.claude-internal/ |
69
+ | `gemini` | settings.internal.json→security+model 字段提取(加密/enc) — 默认/default ~/.gemini/ |
70
+
71
+ 不指定 `--agent` 时,同时操作所有已启用的 agent 及 shared 共享层(skills/MCP/共享记忆)。
72
+
73
+ When omitted, operates on all enabled agents plus the shared tier (skills/MCP/shared memory).
61
74
 
62
- ## 前置条件
75
+ ## 前置条件 / Prerequisites
63
76
 
64
77
  1. Node.js ≥ 18
65
- 2. 已执行过 `wangchuan init`(~/.wangchuan/config.json 存在)
66
- 3. 本地 SSH 密钥可访问目标 git 仓库
67
- 4. 跨机器迁移时需手动复制 `~/.wangchuan/master.key`
78
+ 2. 已执行过 `wangchuan init`(~/.wangchuan/config.json 存在)/ `wangchuan init` has been run
79
+ 3. 本地 SSH 密钥可访问目标 git 仓库 / Local SSH key has access to the target repo
80
+ 4. 跨机器迁移时需手动复制 `~/.wangchuan/master.key` / Copy `master.key` manually when migrating across machines