cursor-guard 4.9.9 → 4.9.12

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/ROADMAP.md CHANGED
@@ -3,8 +3,8 @@
3
3
  > 本文档描述 cursor-guard 从 V2 到 V7 的长期演进方向。
4
4
  > 每一代向下兼容,低版本功能永远不废弃。
5
5
  >
6
- > **当前版本**:`V4.9.9`
7
- > **文档状态**:`V2` ~ `V4.9.9` 已完成交付(含 V5 intent/audit 基础),`V5` 主体规划中
6
+ > **当前版本**:`V4.9.12`
7
+ > **文档状态**:`V2` ~ `V4.9.12` 已完成交付(含 V5 intent/audit 基础),`V5` 主体规划中
8
8
 
9
9
  ## 阅读导航
10
10
 
@@ -740,6 +740,28 @@ V4 经过 4 轮系统性代码审查,修复了以下关键问题:
740
740
  | **docs/RELEASE.md** | 中英双语完整发版流程:版本源、VSIX、Git、GitHub Release、npm OTP;**Windows 下 `gh` 须用 UTF-8 文件 + `--notes-file`** 避免 Release 正文乱码;专设「给其他 AI 助手」摘要 |
741
741
  | **入口** | README / README.zh-CN 顶部与发版小节链接;`print-release-checklist.js` 末尾提示;`package.json` `files` 纳入该文档以便 npm tarball 携带 |
742
742
 
743
+ ### V4.9.11:仪表盘推送同步 + 备份元数据/交互收口 ✅
744
+
745
+ | 能力 | 说明 |
746
+ |------|------|
747
+ | **推送优先于轮询** | Dashboard HTTP:`GET /api/events`(SSE)+ `fs.watch` 监听 `refs/guard/*`、`.cursor-guard-backup/`、`.git` 下 `cursor-guard-alert.json` / `cursor-guard.lock`;`refs` 下首次出现 `guard` 时自动重挂 watcher。前端 `EventSource` 收 `guard-changed` 即刷新;仅保留 3min(前台)/ 10min(后台标签)兜底拉取 |
748
+ | **扩展 Poller** | 以 `fs.watch` 同上路径触发 `forceRefresh`,HTTP 心跳改为约 **3min** 兜底(不再高频轮询) |
749
+ | **活跃告警忽略** | `POST /api/dismiss-alert` + 仪表盘/侧边栏「忽略」;dismiss 后主动 SSE 广播 |
750
+ | **备份列表可读性** | Git 提交 `Guard-Diff-Base` / `Guard-Scope` trailer;`listBackups` 解析 + 仪表盘「范围/基线」列;`refs/guard/snapshot` 完整历史;`Summary` trailer 去 `\r` + 列表行合计 `+/-` 行数 |
751
+ | **5.x 后续(已记入下方 V5 规划)** | watcher 进程与仪表盘 **进程内/管道事件**、MCP `notifications`、统一事件总线——见「V5.x 深化:仪表盘与 watcher 联动」 |
752
+
753
+ ### V4.9.12:仪表盘 Intent 展示修复 ✅
754
+
755
+ | 能力 | 说明 |
756
+ |------|------|
757
+ | **变更列 Intent** | 仅当备份类型为 **`git-pre-restore` / `shadow-pre-restore`** 时使用 `From` + `Restore-To` 琥珀色恢复条;自动备份与手动快照不再被误解析的 `from`/`restoreTo` 抢占,**Intent** 蓝条正常显示 |
758
+
759
+ ### V4.9.10:扩展版本线对齐 ✅
760
+
761
+ | 说明 |
762
+ |------|
763
+ | IDE 扩展与根目录 `package.json` 版本对齐发版(VSIX 构建链 `build-vsix.js` 以根版本为准)。 |
764
+
743
765
  ### V4.9.8:发版流程文档化 + 侧边栏品牌占位 ✅
744
766
  | 能力 | 说明 |
745
767
  |------|------|
@@ -1143,6 +1165,19 @@ Phase 2 (V5.x):
1143
1165
  └── 完整审计链闭环,支持 restore_from_event
1144
1166
  ```
1145
1167
 
1168
+ ### V5.x 深化:仪表盘与 watcher 联动(建议纳入 5.x 更新)
1169
+
1170
+ > V4.9.11 已用 **文件系统监听 + SSE** 实现「备份/告警变更 → 仪表盘几乎实时更新」,无需依赖高频 HTTP 轮询。以下能力适合在 **V5.x** 与 embedded watcher / 审计事件链一并演进:
1171
+
1172
+ | 方向 | 说明 |
1173
+ |------|------|
1174
+ | **跨进程显式通知** | 独立 `auto-backup` 子进程在 snapshot 成功后,通过 **本地 socket / 命名管道 / 向 dashboard 进程发 UDP** 等方式推送 `backup_completed`(含 project root、shortHash、timestamp),补全 `fs.watch` 在少数 OS/网络盘上的漏事件 |
1175
+ | **MCP / LSP 式通知** | 若 MCP 宿主支持 `notifications`,由 server 在备份/告警状态变化时向客户端推送,IDE 与 Web 共用同一语义字段 |
1176
+ | **统一事件模型** | 将 `guard-changed`、intent 事件、审计 JSONL 写入映射到同一 **event type + payload schema**,便于 dashboard 时间线与 `restore_from_event` 对齐 |
1177
+ | **可观测性** | 可选:推送失败降级策略、SSE 连接数上限、watch 句柄泄漏检测(长会话桌面环境) |
1178
+
1179
+ **原则**:V4.9.x 保持「零新常驻依赖 + 本地回环」;V5.x 可在确认架构(embedded watcher)后引入更重的 IPC,且不破坏现有 SSE/Watch 降级路径。
1180
+
1146
1181
  #### 与"意图队列"方案的本质区别
1147
1182
 
1148
1183
  | | 意图队列(已否决) | embedded watcher + begin_edit |
@@ -1626,7 +1661,10 @@ V4.3.5 ───── ✅ Summary 增量 diff-tree 修复 + 变更列堆叠布
1626
1661
  V4.4.0 ───── ✅ V4 收官:首次快照 summary + doctor 完整性/retention 检查 + init 升级检测
1627
1662
  V4.9.0 ───── ✅ 事件驱动 watcher + 实时侧边栏计时
1628
1663
  V4.9.5 ───── ✅ 修复 `.git` 写入导致的疯狂自触发备份
1629
- V4.9.9 ─────docs/RELEASE.md 发版指南(人 + AI)+ gh UTF-8 说明 ← 当前版本
1664
+ V4.9.12 ────仪表盘变更列:Intent 仅被真正的恢复前快照类型让位给 From→Restore-To;常规备份正确显示 Intent ← 当前版本
1665
+ V4.9.11 ──── ✅ 仪表盘 SSE + fs.watch 推送;Poller 事件驱动;告警忽略;Guard trailer 列;Summary/列表行数;snapshot 历史列表
1666
+ V4.9.10 ──── ✅ 扩展版本线与根包对齐(VSIX 发版链)
1667
+ V4.9.9 ───── ✅ docs/RELEASE.md 发版指南(人 + AI)+ gh UTF-8 说明
1630
1668
  V4.9.8 ───── ✅ 发版清单(README 双语 + checklist 脚本)+ 侧边栏品牌图
1631
1669
  V4.9.7 ───── ✅ 预警体验打磨 + 语言同步 + watcher 单例保护
1632
1670
 
@@ -1716,5 +1754,5 @@ V7 的"可验证治理"是这条产品线的逻辑终点——该保护的都保
1716
1754
 
1717
1755
  ---
1718
1756
 
1719
- *最后更新:2026-03-22*
1720
- *版本:v1.9(V4.9.9,增加 docs/RELEASE.md 双语发版指南与 README 入口;历史含 V4.9.8 发版清单与侧边栏品牌、事件驱动 watcher、`pre_warning` 等)*
1757
+ *最后更新:2026-03-23*
1758
+ *版本:v1.11(V4.9.12:仪表盘 Intent 列修复;V4.9.11 起 SSE/fs.watch、Poller 事件驱动等;历史含 V4.9.9 发版指南、V4.9.0 事件驱动 watcher、`pre_warning` 等)*
package/package.json CHANGED
@@ -1,69 +1,69 @@
1
- {
2
- "name": "cursor-guard",
3
- "version": "4.9.9",
4
- "description": "Protects code from accidental AI overwrite or deletion in Cursor IDE — mandatory pre-write snapshots, review-before-apply, local Git safety net, and deterministic recovery. | 保护代码免受 Cursor AI 代理意外覆写或删除——强制写前快照、预览再执行、本地 Git 安全网、确定性恢复。",
5
- "keywords": [
6
- "cursor",
7
- "cursor-ide",
8
- "ai-safety",
9
- "code-protection",
10
- "git-backup",
11
- "snapshot",
12
- "recovery",
13
- "agent-skill",
14
- "cross-platform"
15
- ],
16
- "author": "zhangqiang8vipp",
17
- "license": "BUSL-1.1",
18
- "repository": {
19
- "type": "git",
20
- "url": "https://github.com/zhangqiang8vipp/cursor-guard.git"
21
- },
22
- "homepage": "https://github.com/zhangqiang8vipp/cursor-guard",
23
- "engines": {
24
- "node": ">=18"
25
- },
26
- "scripts": {
27
- "test": "node references/lib/utils.test.js && node references/lib/core/core.test.js && node references/mcp/mcp.test.js",
28
- "release:checklist": "node scripts/print-release-checklist.js"
29
- },
30
- "bin": {
31
- "cursor-guard-init": "references/bin/cursor-guard-init.js",
32
- "cursor-guard-backup": "references/bin/cursor-guard-backup.js",
33
- "cursor-guard-doctor": "references/bin/cursor-guard-doctor.js",
34
- "cursor-guard-mcp": "references/mcp/server.js",
35
- "cursor-guard-dashboard": "references/dashboard/server.js"
36
- },
37
- "files": [
38
- "SKILL.md",
39
- "README.md",
40
- "README.zh-CN.md",
41
- "docs/RELEASE.md",
42
- "ROADMAP.md",
43
- "LICENSE",
44
- "references/auto-backup.ps1",
45
- "references/auto-backup.sh",
46
- "references/guard-doctor.ps1",
47
- "references/guard-doctor.sh",
48
- "references/bin/",
49
- "references/lib/auto-backup.js",
50
- "references/lib/guard-doctor.js",
51
- "references/lib/utils.js",
52
- "references/lib/core/",
53
- "references/mcp/",
54
- "references/dashboard/",
55
- "references/vscode-extension/",
56
- "media/",
57
- "references/config-reference.md",
58
- "references/config-reference.zh-CN.md",
59
- "references/cursor-guard.example.json",
60
- "references/cursor-guard.schema.json",
61
- "references/recovery.md",
62
- "references/quickstart.zh-CN.md"
63
- ],
64
- "main": "SKILL.md",
65
- "dependencies": {
66
- "@modelcontextprotocol/sdk": "^1.27.1",
67
- "zod": "^4.3.6"
68
- }
69
- }
1
+ {
2
+ "name": "cursor-guard",
3
+ "version": "4.9.12",
4
+ "description": "Protects code from accidental AI overwrite or deletion in Cursor IDE — mandatory pre-write snapshots, review-before-apply, local Git safety net, and deterministic recovery. | 保护代码免受 Cursor AI 代理意外覆写或删除——强制写前快照、预览再执行、本地 Git 安全网、确定性恢复。",
5
+ "keywords": [
6
+ "cursor",
7
+ "cursor-ide",
8
+ "ai-safety",
9
+ "code-protection",
10
+ "git-backup",
11
+ "snapshot",
12
+ "recovery",
13
+ "agent-skill",
14
+ "cross-platform"
15
+ ],
16
+ "author": "zhangqiang8vipp",
17
+ "license": "BUSL-1.1",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/zhangqiang8vipp/cursor-guard.git"
21
+ },
22
+ "homepage": "https://github.com/zhangqiang8vipp/cursor-guard",
23
+ "engines": {
24
+ "node": ">=18"
25
+ },
26
+ "scripts": {
27
+ "test": "node references/lib/utils.test.js && node references/lib/core/core.test.js && node references/mcp/mcp.test.js",
28
+ "release:checklist": "node scripts/print-release-checklist.js"
29
+ },
30
+ "bin": {
31
+ "cursor-guard-init": "references/bin/cursor-guard-init.js",
32
+ "cursor-guard-backup": "references/bin/cursor-guard-backup.js",
33
+ "cursor-guard-doctor": "references/bin/cursor-guard-doctor.js",
34
+ "cursor-guard-mcp": "references/mcp/server.js",
35
+ "cursor-guard-dashboard": "references/dashboard/server.js"
36
+ },
37
+ "files": [
38
+ "SKILL.md",
39
+ "README.md",
40
+ "README.zh-CN.md",
41
+ "docs/RELEASE.md",
42
+ "ROADMAP.md",
43
+ "LICENSE",
44
+ "references/auto-backup.ps1",
45
+ "references/auto-backup.sh",
46
+ "references/guard-doctor.ps1",
47
+ "references/guard-doctor.sh",
48
+ "references/bin/",
49
+ "references/lib/auto-backup.js",
50
+ "references/lib/guard-doctor.js",
51
+ "references/lib/utils.js",
52
+ "references/lib/core/",
53
+ "references/mcp/",
54
+ "references/dashboard/",
55
+ "references/vscode-extension/",
56
+ "media/",
57
+ "references/config-reference.md",
58
+ "references/config-reference.zh-CN.md",
59
+ "references/cursor-guard.example.json",
60
+ "references/cursor-guard.schema.json",
61
+ "references/recovery.md",
62
+ "references/quickstart.zh-CN.md"
63
+ ],
64
+ "main": "SKILL.md",
65
+ "dependencies": {
66
+ "@modelcontextprotocol/sdk": "^1.27.1",
67
+ "zod": "^4.3.6"
68
+ }
69
+ }