llm-sentry-tools 1.0.0 → 1.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 CHANGED
@@ -1,4 +1,8 @@
1
- # LLM Tools
1
+ # LLM Sentry Tools
2
+
3
+ [![npm version](https://badge.fury.io/js/llm-sentry-tools.svg)](https://www.npmjs.com/package/llm-sentry-tools)
4
+ [![npm downloads](https://img.shields.io/npm/dm/llm-sentry-tools.svg)](https://www.npmjs.com/package/llm-sentry-tools)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
2
6
 
3
7
  基于 Sentry MCP 的智能错误分析和修复工具,让 AI 助手能够自动分析和修复 Sentry 上报的错误。
4
8
 
@@ -6,9 +10,12 @@
6
10
 
7
11
  - 🔍 **智能错误分析**:自动从 Sentry 获取错误详情并进行深度分析
8
12
  - 🛠️ **自动错误修复**:AI 辅助修复代码,减少人工调试时间
9
- - 🤖 **多 AI 工具支持**:支持 Claude Code、Cursor、Windsurf、Continue 等主流 AI 编程工具
13
+ - 🤖 **广泛的 AI 工具支持**:支持 7 款主流 AI 编程工具
14
+ - Claude Code、Cursor、Windsurf、Continue
15
+ - Antigravity、Cline、GitHub Copilot
10
16
  - 🎯 **简单易用**:通过斜杠命令快速调用,只需粘贴 Sentry URL
11
17
  - 🏢 **自建 Sentry 支持**:完美支持自建 Sentry 站点
18
+ - 🔄 **智能检测**:自动检测已配置的工具,避免重复配置
12
19
 
13
20
  ## 📦 安装
14
21
 
@@ -44,18 +51,24 @@ npx llm-sentry-tools setup-commands
44
51
  ```
45
52
 
46
53
  脚本会引导你:
47
- 1. **选择要配置的 AI 工具**(支持多选,空格选择,回车确认)
54
+ 1. **输入项目根目录路径**(默认为当前目录)
55
+ 2. **选择要配置的 AI 工具**(支持多选,空格选择,回车确认,✓ 表示已配置)
48
56
  - ✅ Claude Code
49
57
  - ✅ Cursor
50
58
  - ✅ Windsurf
51
59
  - ✅ Continue
52
- 2. **输入项目根目录路径**(默认为当前目录)
60
+ - ✅ Antigravity
61
+ - ✅ Cline
62
+ - ✅ GitHub Copilot
53
63
 
54
64
  配置完成后,对应的命令文件会自动创建:
55
- - Claude Code → `.claude/skills/`
56
- - Cursor → `.cursor/commands/`
57
- - Windsurf → `.windsurf/commands/`
58
- - Continue → `.continue/commands/`
65
+ - **Claude Code** → `.claude/skills/`
66
+ - **Cursor** → `.cursor/prompts/`
67
+ - **Windsurf** → `.windsurf/commands/`
68
+ - **Continue** → `.continue/prompts/`
69
+ - **Antigravity** → `.agent/workflows/`
70
+ - **Cline** → `.clinerules/workflows/`
71
+ - **GitHub Copilot** → `.github/prompts/`
59
72
 
60
73
  ## 💡 使用方法
61
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llm-sentry-tools",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "基于 Sentry MCP 的错误分析和修复工具,支持 Claude Code、Cursor 等 AI 工具",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,9 +17,12 @@ const AI_TOOLS = {
17
17
  configDir: '.claude/skills',
18
18
  fileExtension: 'md',
19
19
  createCommand: (commandName, promptContent) => {
20
- // Claude Code 使用 skill 格式
20
+ const descriptions = {
21
+ 'analyze-sentry-error': 'Sentry 错误分析',
22
+ 'fix-sentry-error': 'Sentry 错误修复'
23
+ };
21
24
  return `---
22
- description: ${commandName === 'analyze-sentry-error' ? 'Sentry 错误分析' : 'Sentry 错误修复'}
25
+ description: ${descriptions[commandName] || commandName}
23
26
  ---
24
27
 
25
28
  ${promptContent}`;
@@ -27,7 +30,7 @@ ${promptContent}`;
27
30
  },
28
31
  'cursor': {
29
32
  name: 'Cursor',
30
- configDir: '.cursor/commands',
33
+ configDir: '.cursor/prompts',
31
34
  fileExtension: 'md',
32
35
  createCommand: (commandName, promptContent) => promptContent
33
36
  },
@@ -39,24 +42,100 @@ ${promptContent}`;
39
42
  },
40
43
  'continue': {
41
44
  name: 'Continue',
42
- configDir: '.continue/commands',
45
+ configDir: '.continue/prompts',
46
+ fileExtension: 'prompt',
47
+ createCommand: (commandName, promptContent) => {
48
+ const descriptions = {
49
+ 'analyze-sentry-error': 'Sentry 错误分析',
50
+ 'fix-sentry-error': 'Sentry 错误修复'
51
+ };
52
+ return `---
53
+ name: ${commandName}
54
+ description: ${descriptions[commandName] || commandName}
55
+ ---
56
+
57
+ ${promptContent}`;
58
+ }
59
+ },
60
+ 'antigravity': {
61
+ name: 'Antigravity',
62
+ configDir: '.agent/workflows',
63
+ fileExtension: 'md',
64
+ createCommand: (commandName, promptContent) => {
65
+ const descriptions = {
66
+ 'analyze-sentry-error': 'Sentry 错误分析',
67
+ 'fix-sentry-error': 'Sentry 错误修复'
68
+ };
69
+ return `---
70
+ description: ${descriptions[commandName] || commandName}
71
+ ---
72
+
73
+ ${promptContent}`;
74
+ }
75
+ },
76
+ 'cline': {
77
+ name: 'Cline',
78
+ configDir: '.clinerules/workflows',
43
79
  fileExtension: 'md',
44
80
  createCommand: (commandName, promptContent) => promptContent
81
+ },
82
+ 'github-copilot': {
83
+ name: 'GitHub Copilot',
84
+ configDir: '.github/prompts',
85
+ fileExtension: 'prompt.md',
86
+ createCommand: (commandName, promptContent) => {
87
+ const descriptions = {
88
+ 'analyze-sentry-error': 'Sentry 错误分析',
89
+ 'fix-sentry-error': 'Sentry 错误修复'
90
+ };
91
+ return `---
92
+ name: ${commandName}
93
+ description: ${descriptions[commandName] || commandName}
94
+ ---
95
+
96
+ ${promptContent}`;
97
+ }
98
+ }
99
+ };
100
+
101
+ // 检测已配置的工具
102
+ const detectConfiguredTools = (projectPath) => {
103
+ const configured = {};
104
+
105
+ for (const [key, tool] of Object.entries(AI_TOOLS)) {
106
+ // 检查工具配置目录是否存在
107
+ const configPath = join(projectPath, tool.configDir);
108
+ configured[key] = existsSync(configPath);
45
109
  }
110
+
111
+ return configured;
46
112
  };
47
113
 
48
114
  const setupCommands = async () => {
49
115
  try {
116
+ // 先询问项目路径
117
+ const { projectPath } = await inquirer.prompt([
118
+ {
119
+ type: 'input',
120
+ name: 'projectPath',
121
+ message: '请输入项目根目录路径(留空使用当前目录):',
122
+ default: process.cwd()
123
+ }
124
+ ]);
125
+
126
+ // 检测已配置的工具
127
+ const configuredTools = detectConfiguredTools(projectPath);
128
+
50
129
  // 让用户选择要配置的 AI 工具
51
130
  const { selectedTools } = await inquirer.prompt([
52
131
  {
53
132
  type: 'checkbox',
54
133
  name: 'selectedTools',
55
- message: '请选择要配置的 AI 工具(空格选择,回车确认):',
134
+ message: '请选择要配置的 AI 工具(空格选择,回车确认,✓ 表示已配置):',
56
135
  choices: Object.entries(AI_TOOLS).map(([key, value]) => ({
57
- name: value.name,
136
+ name: configuredTools[key] ? `${value.name} ✓` : value.name,
58
137
  value: key,
59
- checked: false
138
+ checked: configuredTools[key] || false
60
139
  })),
61
140
  validate: (answer) => {
62
141
  if (answer.length === 0) {
@@ -67,16 +146,6 @@ const setupCommands = async () => {
67
146
  }
68
147
  ]);
69
148
 
70
- // 询问项目路径
71
- const { projectPath } = await inquirer.prompt([
72
- {
73
- type: 'input',
74
- name: 'projectPath',
75
- message: '请输入项目根目录路径(留空使用当前目录):',
76
- default: process.cwd()
77
- }
78
- ]);
79
-
80
149
  console.log('\n开始配置命令...\n');
81
150
 
82
151
  // 读取 prompt 模板