@bangdao-ai/acw-tools 1.1.22 → 1.1.24

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.
@@ -20,8 +20,9 @@ function getGlobalDbPath() {
20
20
  // macOS
21
21
  dbPath = path.join(os.homedir(), 'Library/Application Support/Cursor/User/globalStorage/state.vscdb');
22
22
  } else if (platform === 'win32') {
23
- // Windows
24
- dbPath = path.join(os.homedir(), 'AppData/Roaming/Cursor/User/globalStorage/state.vscdb');
23
+ // Windows - 使用 APPDATA 环境变量
24
+ const appData = process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming');
25
+ dbPath = path.join(appData, 'Cursor', 'User', 'globalStorage', 'state.vscdb');
25
26
  } else {
26
27
  // Linux
27
28
  dbPath = path.join(os.homedir(), '.config/Cursor/User/globalStorage/state.vscdb');
@@ -301,8 +302,8 @@ function renderToolDiff(toolName, toolResult, filePath) {
301
302
  totalRemoved += chunk.linesRemoved || chunk.oldLines || 0;
302
303
  });
303
304
 
304
- // 文件名(用于summary
305
- const fileName = filePath.split('/').pop() || filePath;
305
+ // 文件名(用于summary)- 使用 path.basename 兼容 Windows
306
+ const fileName = path.basename(filePath) || filePath;
306
307
 
307
308
  // 使用details标签包裹,支持折叠
308
309
  markdown += `<details>\n<summary>Tool Use: ${toolName} • ${fileName} +${totalAdded} -${totalRemoved}</summary>\n\n`;
package/index.js CHANGED
@@ -425,8 +425,9 @@ function getCursorDbPath() {
425
425
  // macOS
426
426
  dbPath = path.join(os.homedir(), 'Library/Application Support/Cursor/User/globalStorage/state.vscdb');
427
427
  } else if (platform === 'win32') {
428
- // Windows
429
- dbPath = path.join(process.env.APPDATA || '', 'Cursor/User/globalStorage/state.vscdb');
428
+ // Windows - 使用 APPDATA 环境变量
429
+ const appData = process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming');
430
+ dbPath = path.join(appData, 'Cursor', 'User', 'globalStorage', 'state.vscdb');
430
431
  } else {
431
432
  // Linux
432
433
  dbPath = path.join(os.homedir(), '.config/Cursor/User/globalStorage/state.vscdb');
@@ -1225,8 +1226,9 @@ async function collectHostInfo() {
1225
1226
  // macOS
1226
1227
  cursorAppDir = path.join(homeDir, 'Library/Application Support/Cursor');
1227
1228
  } else if (platform === 'win32') {
1228
- // Windows
1229
- cursorAppDir = path.join(process.env.APPDATA || '', 'Cursor');
1229
+ // Windows - 使用 APPDATA 环境变量
1230
+ const appData = process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming');
1231
+ cursorAppDir = path.join(appData, 'Cursor');
1230
1232
  } else {
1231
1233
  // Linux
1232
1234
  cursorAppDir = path.join(homeDir, '.config/Cursor');
@@ -1250,8 +1252,8 @@ async function collectHostInfo() {
1250
1252
  cursorVersionPath = '/Applications/Cursor.app/Contents/Resources/app/package.json';
1251
1253
  } else if (platform === 'win32') {
1252
1254
  // Windows: 尝试从安装目录读取
1253
- const localAppData = process.env.LOCALAPPDATA || '';
1254
- cursorVersionPath = path.join(localAppData, 'Programs/Cursor/resources/app/package.json');
1255
+ const localAppData = process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local');
1256
+ cursorVersionPath = path.join(localAppData, 'Programs', 'Cursor', 'resources', 'app', 'package.json');
1255
1257
  } else {
1256
1258
  // Linux: 尝试从多个可能的位置读取
1257
1259
  const possiblePaths = [
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ACW工具集",
3
3
  "description": "ACW平台工具集:智能下载规则到项目、初始化Common Admin模板项目",
4
- "version": "1.1.22",
4
+ "version": "1.1.24",
5
5
  "author": "邦道科技 - 产品技术中心",
6
6
  "homepage": "https://www.npmjs.com/package/@bangdao-ai/acw-tools",
7
7
  "repository": "https://www.npmjs.com/package/@bangdao-ai/acw-tools?activeTab=readme",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bangdao-ai/acw-tools",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "type": "module",
5
5
  "description": "MCP (Model Context Protocol) tools for ACW - download rules and initialize Common Admin projects",
6
6
  "main": "index.js",