cursor-guard 4.2.0 → 4.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cursor-guard",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
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
5
  "keywords": [
6
6
  "cursor",
@@ -166,7 +166,7 @@ const I18N = {
166
166
  'detail.node_ok': '{v}',
167
167
  'detail.node_old': '{v} — recommended >=18',
168
168
  'detail.mcp_ok': 'server.js found, SDK {v}',
169
- 'detail.mcp_no_sdk': 'server.js found but @modelcontextprotocol/sdk not installed — run: cd <skill-dir> && npm install',
169
+ 'detail.mcp_no_sdk': 'server.js found but @modelcontextprotocol/sdk not installed — run: cd <skill-dir>; npm install',
170
170
  'detail.mcp_no_server': 'SDK installed ({v}) but server.js not found at expected path',
171
171
  'detail.mcp_not_configured': 'MCP not configured (optional — cursor-guard works without it)',
172
172
  'detail.mcp_version_mismatch': 'running v{mem} but disk has v{disk} — restart Cursor to load the new version',
@@ -332,7 +332,7 @@ const I18N = {
332
332
  'detail.node_ok': '{v}',
333
333
  'detail.node_old': '{v}——建议 >=18',
334
334
  'detail.mcp_ok': 'server.js 已找到,SDK {v}',
335
- 'detail.mcp_no_sdk': 'server.js 已找到但 @modelcontextprotocol/sdk 未安装——请运行:cd <skill-dir> && npm install',
335
+ 'detail.mcp_no_sdk': 'server.js 已找到但 @modelcontextprotocol/sdk 未安装——请运行:cd <skill-dir>; npm install',
336
336
  'detail.mcp_no_server': 'SDK 已安装({v})但 server.js 未在预期路径找到',
337
337
  'detail.mcp_not_configured': 'MCP 未配置(可选——cursor-guard 无需 MCP 也能工作)',
338
338
  'detail.mcp_version_mismatch': '运行中 v{mem},磁盘为 v{disk}——请重启 Cursor 加载新版本',
@@ -378,7 +378,7 @@ function t(key, params) {
378
378
  let text = dict[key] || I18N['en-US'][key] || key;
379
379
  if (params) {
380
380
  for (const [k, v] of Object.entries(params)) {
381
- text = text.replace(`{${k}}`, v);
381
+ text = text.replaceAll(`{${k}}`, String(v));
382
382
  }
383
383
  }
384
384
  return text;
@@ -770,6 +770,7 @@ function renderFilterBar() {
770
770
  { key: 'all', label: 'backups.filterAll' },
771
771
  { key: 'git-auto-backup', label: 'type.git-auto-backup' },
772
772
  { key: 'git-pre-restore', label: 'type.git-pre-restore' },
773
+ { key: 'git-snapshot', label: 'type.git-snapshot' },
773
774
  { key: 'shadow', label: 'type.shadow' },
774
775
  { key: 'shadow-pre-restore',label: 'type.shadow-pre-restore' },
775
776
  ];
@@ -8,7 +8,6 @@ const path = require('path');
8
8
  const { getDashboard } = require('../lib/core/dashboard');
9
9
  const { runDiagnostics } = require('../lib/core/doctor');
10
10
  const { listBackups } = require('../lib/core/backups');
11
- const { loadActiveAlert } = require('../lib/core/anomaly');
12
11
 
13
12
  const PUBLIC_DIR = path.join(__dirname, 'public');
14
13
  const DEFAULT_PORT = 3120;
@@ -221,7 +221,6 @@ function runDiagnostics(projectDir) {
221
221
  // Search multiple candidate locations for SDK package.json
222
222
  const sdkCandidates = [
223
223
  path.join(skillRoot, 'node_modules', '@modelcontextprotocol', 'sdk', 'package.json'),
224
- path.join(__dirname, '..', '..', '..', 'node_modules', '@modelcontextprotocol', 'sdk', 'package.json'),
225
224
  ];
226
225
  for (const candidate of sdkCandidates) {
227
226
  try {