@yeepay/coderocket-mcp 1.2.4 → 1.2.6

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.
@@ -0,0 +1,141 @@
1
+ import { z } from 'zod';
2
+ import { ReviewCodeRequestSchema, ReviewChangesRequestSchema, ReviewCommitRequestSchema, ReviewFilesRequestSchema, ConfigureAIServiceRequestSchema, } from './types.js';
3
+ export const toolDefinitions = [
4
+ {
5
+ name: 'review_code',
6
+ description: `🔍 **代码片段智能审查工具**
7
+
8
+ **功能**: 对提供的代码片段进行深度质量分析,提供专业的改进建议和最佳实践指导。
9
+
10
+ **适用场景**:
11
+ - 代码重构前的质量评估
12
+ - 新功能开发的代码审查
13
+ - 学习和改进编程技能
14
+ - 代码规范性检查
15
+
16
+ **AI分析维度**:
17
+ - 代码逻辑和算法效率
18
+ - 安全漏洞和潜在风险
19
+ - 可读性和维护性
20
+ - 性能优化建议
21
+ - 最佳实践合规性
22
+
23
+ **输出格式**: 结构化的审查报告,包含状态评级、摘要和详细分析`,
24
+ schema: ReviewCodeRequestSchema,
25
+ },
26
+ {
27
+ name: 'review_changes',
28
+ description: `🚀 **Git变更自动审查工具**
29
+
30
+ **功能**: 自动检测并审查当前Git仓库中所有未提交的代码变更,无需手动传递代码内容。
31
+
32
+ **适用场景**:
33
+ - 提交前的自动化代码质量检查
34
+ - 开发过程中的实时代码审查
35
+ - CI/CD流程中的质量门禁
36
+ - 团队协作中的代码规范检查
37
+
38
+ **AI分析维度**:
39
+ - 变更逻辑的合理性和完整性
40
+ - 代码质量和最佳实践遵循
41
+ - 潜在的安全风险和性能问题
42
+ - 与现有代码的一致性检查
43
+ - 测试覆盖和文档更新建议
44
+
45
+ **自动化特性**:
46
+ - 零参数调用,自动检测Git变更
47
+ - 支持已暂存和未暂存变更的分别审查
48
+ - 智能识别文件类型和编程语言
49
+ - 提供上下文相关的改进建议
50
+
51
+ **输出格式**: 详细的变更审查报告,包含文件级和整体级分析`,
52
+ schema: ReviewChangesRequestSchema,
53
+ },
54
+ {
55
+ name: 'review_commit',
56
+ description: `📝 **Git提交智能审查工具**
57
+
58
+ **功能**: 分析Git提交的代码变更,评估变更的质量、影响范围和潜在风险。
59
+
60
+ **适用场景**:
61
+ - 代码合并前的质量把关
62
+ - 提交历史的质量回顾
63
+ - 团队代码审查流程
64
+ - 持续集成质量检查
65
+
66
+ **AI分析维度**:
67
+ - 变更逻辑的合理性
68
+ - 代码风格一致性
69
+ - 潜在的破坏性变更
70
+ - 测试覆盖率影响
71
+ - 文档更新需求
72
+
73
+ **输出格式**: 详细的提交审查报告,包含变更摘要和风险评估`,
74
+ schema: ReviewCommitRequestSchema,
75
+ },
76
+ {
77
+ name: 'review_files',
78
+ description: `📁 **多文件批量审查工具**
79
+
80
+ **功能**: 对指定的多个文件进行批量代码质量审查,提供整体项目质量评估。
81
+
82
+ **适用场景**:
83
+ - 项目整体质量评估
84
+ - 重构前的现状分析
85
+ - 新团队成员代码熟悉
86
+ - 技术债务识别
87
+
88
+ **AI分析维度**:
89
+ - 文件间依赖关系分析
90
+ - 架构设计合理性
91
+ - 代码重复度检测
92
+ - 模块化程度评估
93
+ - 整体代码健康度
94
+
95
+ **输出格式**: 综合性的多文件审查报告,包含文件级和项目级分析`,
96
+ schema: ReviewFilesRequestSchema,
97
+ },
98
+ {
99
+ name: 'configure_ai_service',
100
+ description: `⚙️ **AI服务配置管理工具**
101
+
102
+ **功能**: 配置和管理CodeRocket使用的AI服务,包括API密钥设置、服务选择和参数调优。
103
+
104
+ **支持的AI服务**:
105
+ - **Gemini**: Google的先进AI模型,擅长代码分析和建议
106
+ - **ClaudeCode**: Anthropic的专业代码审查模型
107
+
108
+ **配置选项**:
109
+ - API密钥管理(项目级/全局级)
110
+ - 服务优先级设置
111
+ - 超时和重试参数
112
+ - 自动故障转移配置
113
+
114
+ **安全性**: API密钥加密存储,支持环境变量配置
115
+
116
+ **输出格式**: 配置操作结果和当前配置状态`,
117
+ schema: ConfigureAIServiceRequestSchema,
118
+ },
119
+ {
120
+ name: 'get_ai_service_status',
121
+ description: `📊 **AI服务状态监控工具**
122
+
123
+ **功能**: 获取所有已配置AI服务的实时状态信息,包括可用性、配置状态和性能指标。
124
+
125
+ **监控信息**:
126
+ - 服务连接状态
127
+ - API配额使用情况
128
+ - 响应时间统计
129
+ - 错误率监控
130
+ - 配置完整性检查
131
+
132
+ **故障诊断**:
133
+ - 自动检测配置问题
134
+ - 提供修复建议
135
+ - 显示详细错误信息
136
+
137
+ **输出格式**: 完整的服务状态报告,包含所有服务的健康状况`,
138
+ schema: z.object({}), // 无参数工具
139
+ },
140
+ ];
141
+ //# sourceMappingURL=toolDefinitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolDefinitions.js","sourceRoot":"","sources":["../src/toolDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,+BAA+B,GAChC,MAAM,YAAY,CAAC;AAQpB,MAAM,CAAC,MAAM,eAAe,GAAc;IACxC;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE;;;;;;;;;;;;;;;;;kCAiBiB;QAC9B,MAAM,EAAE,uBAAuB;KAChC;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;gCAuBe;QAC5B,MAAM,EAAE,0BAA0B;KACnC;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE;;;;;;;;;;;;;;;;;gCAiBe;QAC5B,MAAM,EAAE,yBAAyB;KAClC;IACD;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE;;;;;;;;;;;;;;;;;kCAiBiB;QAC9B,MAAM,EAAE,wBAAwB;KACjC;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE;;;;;;;;;;;;;;;;wBAgBO;QACpB,MAAM,EAAE,+BAA+B;KACxC;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE;;;;;;;;;;;;;;;;gCAgBe;QAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,QAAQ;KAC/B;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeepay/coderocket-mcp",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "CodeRocket MCP - Independent AI-powered code review server for Model Context Protocol",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -27,7 +27,6 @@
27
27
  "code-review",
28
28
  "ai",
29
29
  "gemini",
30
- "opencode",
31
30
  "claudecode",
32
31
  "typescript",
33
32
  "code-analysis",
@@ -46,8 +45,10 @@
46
45
  "@anthropic-ai/sdk": "^0.27.0",
47
46
  "@google/generative-ai": "^0.21.0",
48
47
  "@modelcontextprotocol/sdk": "^0.5.0",
48
+ "@yeepay/coderocket-mcp": "^1.2.5",
49
49
  "axios": "^1.6.0",
50
- "zod": "^3.22.4"
50
+ "zod": "^3.22.4",
51
+ "zod-to-json-schema": "^3.24.6"
51
52
  },
52
53
  "devDependencies": {
53
54
  "@eslint/js": "^9.32.0",
@@ -0,0 +1,69 @@
1
+ # 代码审查报告:feat: 统一提示词系统实现
2
+
3
+ **Commit Hash**: `2eacf48a6028d5fd8c4ee5d950618145520bebd2`
4
+
5
+ ## 审阅状态
6
+
7
+ ✅ **通过**
8
+
9
+ ## 总体评价
10
+
11
+ 本次提交高质量地完成了一项重要的重构任务:**统一提示词系统**。
12
+
13
+ 代码修改清晰、目标明确,并且通过添加测试用例和更新文档确保了变更的可靠性和可维护性。这是一个优秀的提交,提升了项目的一致性和可扩展性。
14
+
15
+ ## 审阅维度分析
16
+
17
+ ### 1. 功能完整性与正确性
18
+
19
+ * **逻辑正确性**:
20
+ * **[通过]** `PromptManager` 的重构逻辑正确,成功移除了旧的 `code-review-prompt`,并将所有审查功能(`reviewCode`, `reviewFile`)统一指向 `git-commit-review-prompt`。
21
+ * **[通过]** 内置的 `git-commit-review-prompt` 提示词内容经过了优化,使其更具通用性,能够覆盖所有代码审查场景,而不仅仅是 Git Commit 审查。
22
+ * **功能实现**:
23
+ * **[通过]** 完全实现了 Commit Message 中描述的目标,成功统一了提示词系统。
24
+ * **[通过]** `preloadCommonPrompts` 的逻辑也同步更新,不再预加载已移除的提示词,提高了启动效率。
25
+ * **错误处理**:
26
+ * **[符合预期]** 本次修改未引入新的错误处理逻辑,现有逻辑保持不变。
27
+
28
+ ### 2. 代码质量与规范
29
+
30
+ * **代码规范**:
31
+ * **[通过]** 代码遵循了项目既定的 Prettier 格式化标准和命名约定。
32
+ * **可读性与可维护性**:
33
+ * **[优秀]** 移除冗余的提示词并统一接口,极大地提高了代码的可读性和可维护性。未来维护提示词只需修改一个地方,降低了心智负担。
34
+ * **注释质量**:
35
+ * **[优秀]** `test.ts` 中新增的测试用例 `testUnifiedPromptUsage` 包含了清晰的注释,准确描述了测试意图。
36
+
37
+ ### 3. 健壮性与风险
38
+
39
+ * **安全性**:
40
+ * **[符合预期]** 本次修改不涉及安全相关内容。
41
+ * **性能**:
42
+ * **[优秀]** `preloadCommonPrompts` 只加载必要的提示词,轻微提升了应用的冷启动性能。
43
+ * **资源管理**:
44
+ * **[符合预期]** 本次修改不涉及资源管理。
45
+
46
+ ### 4. 测试与文档
47
+
48
+ * **可测试性**:
49
+ * **[优秀]** 新增了专门的 `testUnifiedPromptUsage` 测试用例,用于验证统一提示词系统的正确性。测试覆盖了内置提示词的内容、加载机制和统一性,确保了重构的可靠性。
50
+ * **文档完整性**:
51
+ * **[优秀]** `README.md` 中新增了“提示词自定义”章节,详细说明了统一提示词的优先级、自定义方法和优势。
52
+ * **[优秀]** `CHANGELOG.md` 记录了清晰、完整的变更历史。
53
+
54
+ ### 5. 架构与扩展性
55
+
56
+ * **设计合理性**:
57
+ * **[优秀]** 将所有审查功能收敛到单一提示词模板,是优秀的设计决策。它简化了系统架构,增强了功能的一致性。
58
+ * **扩展性**:
59
+ * **[优秀]** 统一的提示词系统为未来扩展新的审查功能(如审查一个目录、一个函数等)奠定了坚实的基础,新功能可以轻松复用现有的提示词逻辑。
60
+
61
+ ## 优秀实践识别
62
+
63
+ 1. **测试驱动重构**: 在进行重构的同时,编写了专门的测试用例来验证其正确性,这是保证代码质量的最佳实践。
64
+ 2. **文档同步更新**: 任何对用户或开发者有影响的变更,都及时、清晰地更新了 `README.md` 和 `CHANGELOG.md`,值得称赞。
65
+ 3. **简化优于复杂**: 移除了冗余代码和配置,用更简单的方案解决了问题,提升了系统的可维护性。
66
+
67
+ ## 结论
68
+
69
+ 此次提交堪称典范,建议合并。
@@ -0,0 +1,35 @@
1
+ # Code Review Report for commit d3bd2f0d87d13d0584477df3bc9554959e0d041f
2
+
3
+ **Commit Author:** im47cn <dremabt@gmail.com>
4
+ **Commit Date:** Fri Aug 1 16:32:24 2025 +0800
5
+ **Commit Message:** feat: 移除对OpenCode服务的支持,更新相关文档和测试用例
6
+
7
+ ## Overall Assessment
8
+
9
+ This is a solid commit that effectively removes the OpenCode service from the project. The changes are consistent across the codebase, including documentation, examples, and configuration, which demonstrates thoroughness.
10
+
11
+ ## Detailed Review
12
+
13
+ ### `README.md`
14
+ - **Change:** Removed references to `OPENCODE_API_KEY` and the OpenCode service.
15
+ - **Assessment:** Correct and necessary change.
16
+
17
+ ### `examples/usage-examples.md`
18
+ - **Change:** Updated examples to use `gemini` instead of `opencode` and removed `opencode` from a status example.
19
+ - **Assessment:** Good. This ensures the examples are up-to-date with the current state of the codebase.
20
+
21
+ ### `package.json`
22
+ - **Change:** Removed `opencode` from the keywords.
23
+ - **Assessment:** Good. This is a nice touch for keeping the package metadata clean.
24
+
25
+ ### `src/coderocket.ts`
26
+ - **Change:** Removed `OPENCODE_API_KEY` from the list of environment variables.
27
+ - **Assessment:** Correct. This is the core change to remove the service's configuration.
28
+
29
+ ### `src/test.ts`
30
+ - **Change:** Removed the assertion `!serviceNames.includes('opencode' as any)`.
31
+ - **Assessment:** This change is slightly concerning. While the test might have become redundant if the underlying code now completely filters out 'opencode', removing a test that explicitly checks for the removal of a feature is counter-intuitive. It would have been better to keep the test to ensure the service is not accidentally re-introduced in the future. However, this is a minor point and does not break any functionality.
32
+
33
+ ## Conclusion
34
+
35
+ The commit is approved. The changes are well-executed and complete.
@@ -0,0 +1,28 @@
1
+ # Code Review Report
2
+
3
+ **Commit:** `d6c546005f337299aeaf7fc61c7bb610c1359bac`
4
+ **Author:** im47cn <dremabt@gmail.com>
5
+ **Date:** Fri Aug 1 18:52:45 2025 +0800
6
+ **Subject:** chore: 升级版本到 1.2.5
7
+
8
+ ## 1. Review Summary
9
+
10
+ The commit is a routine version update, changing the version number in `package.json` from `1.2.4` to `1.2.5`. The changes are consistent with the commit message.
11
+
12
+ ## 2. Code Changes Analysis
13
+
14
+ - **File:** `package.json`
15
+ - **Change:** The `version` field was updated from "1.2.4" to "1.2.5".
16
+
17
+ ## 3. Guideline Compliance (`CRUSH.md`)
18
+
19
+ - **Commit Message:** The commit message `chore: 升级版本到 1.2.5` is clear and correctly uses the "chore" type for a maintenance task, which aligns with conventional commit standards.
20
+ - **Code Style:** The change is in a `package.json` file and the modification is syntactically correct. No other code style rules from `CRUSH.md` are applicable to this change.
21
+ - **Overall:** The commit is simple, straightforward, and adheres to all relevant project guidelines.
22
+
23
+ ## 4. Conclusion
24
+
25
+ This commit is approved. It is a standard and necessary change for version management.
26
+
27
+ ---
28
+ *This review was generated automatically.*
@@ -0,0 +1,33 @@
1
+ # Code Review Report for Commit 5767eab8
2
+
3
+ **Commit Author:** im47cn <dremabt@gmail.com>
4
+ **Commit Date:** Fri Aug 1 19:32:16 2025 +0800
5
+ **Commit Message:** fix: 修复ES模块导入路径问题
6
+
7
+ ---
8
+
9
+ ## 1. Review Summary
10
+
11
+ The commit primarily addresses an ES module import path issue, which is a valid and necessary fix for compatibility. The change in `src/toolDefinitions.ts` aligns with the project's coding standards.
12
+
13
+ However, the changes in `package.json` and `package-lock.json` introduce a self-dependency, which is highly unusual and likely an error. This could lead to problems with package resolution and management.
14
+
15
+ ## 2. Changes Analysis
16
+
17
+ ### `src/toolDefinitions.ts`
18
+
19
+ * **Change:** The import path for `./types` was changed to `./types.js`.
20
+ * **Assessment:** **Positive**. This change correctly follows the guidelines in `CRUSH.md` which state: "Add a `.js` extension to relative imports". This resolves a runtime module loading error in an ES module context.
21
+
22
+ ### `package.json` and `package-lock.json`
23
+
24
+ * **Change:** The package `@yeepay/coderocket-mcp` was added as a dependency to itself.
25
+ * **Assessment:** **Potential Issue**. This is not a standard practice and should be investigated. It might be a mistake made during dependency updates. Self-dependencies can create circular resolution problems and are generally unnecessary.
26
+
27
+ ## 3. Actionable Recommendations
28
+
29
+ * **Recommendation:** Revert the changes in `package.json` and `package-lock.json` that introduce the self-dependency. The version bump is acceptable, but the dependency itself should be removed.
30
+ * **Action:** The change in `src/toolDefinitions.ts` is correct and should be kept.
31
+
32
+ ---
33
+ *This report was generated automatically.*
@@ -1,74 +0,0 @@
1
- # Code Review Report for Commit `fc88c611ec9b`
2
-
3
- **Commit Author:** `im47cn <dremabt@gmail.com>`
4
- **Commit Date:** `Fri Aug 1 15:41:41 2025 +0800`
5
- **Commit Message:**
6
- ```
7
- fix: 移除自引用依赖,确保完全独立
8
-
9
- 🔧 关键修复:
10
- - 移除 package.json 中的自引用依赖 @yeepay/coderocket-mcp
11
- - 修复可能导致安装问题的循环依赖
12
- - 确保依赖列表只包含必要的外部包
13
-
14
- ✅ 独立性验证:
15
- - 系统性排查确认零 coderocket-cli 依赖
16
- - 所有 shell 命令都是标准 Git 操作
17
- - 使用独立的 ~/.coderocket/ 配置目录
18
- - 所有功能通过直接 API 调用实现
19
-
20
- 🧪 质量保证:
21
- - 100% 测试通过率 (9/9)
22
- - Git 变更检测和 AI 审查功能正常
23
- - 无破坏性变更,保持向后兼容
24
-
25
- 📦 版本发布:
26
- - 版本号:v1.2.3
27
- - NPM发布:@yeepay/coderocket-mcp@1.2.3
28
- - 完全独立的 MCP 服务器
29
- ```
30
-
31
- ---
32
-
33
- ## 1. Review Summary
34
-
35
- This is an **excellent** and crucial fix that addresses a critical circular dependency issue. The change is well-executed, and the developer has been exceptionally thorough in updating all related parts of the project, including documentation and versioning.
36
-
37
- **Overall Assessment:** ✅ **Approve**
38
-
39
- ---
40
-
41
- ## 2. Analysis of Changes
42
-
43
- ### 2.1. Dependency Fix (`package.json`, `package-lock.json`)
44
-
45
- - **[Positive]** The primary goal of removing the `@yeepay/coderocket-mcp` self-reference from `dependencies` has been successfully achieved. This resolves a significant packaging flaw that could lead to installation failures and versioning conflicts.
46
- - **[Positive]** The `package-lock.json` file has been correctly updated to reflect this change.
47
- - **[Positive]** The package version was correctly bumped to `1.2.3`, following semantic versioning for a patch fix.
48
-
49
- ### 2.2. Documentation and Consistency (`README.md`, `CHANGELOG.md`, `examples/usage-examples.md`)
50
-
51
- - **[Positive]** The `CHANGELOG.md` is updated with a clear, well-formatted entry for version `1.2.3`. The description of the fix is detailed and easy to understand.
52
- - **[Positive]** The `README.md` has been updated to remove incorrect statements about dependencies (e.g., the note about needing `CodeRocket-CLI`). This improves user clarity and accuracy.
53
- - **[Positive]** Other documentation files (`examples/usage-examples.md`) have also been updated for consistency.
54
-
55
- ### 2.3. Source Code (`src/*.ts`)
56
-
57
- - **[Positive]** Fallback and default version numbers in `src/banner.ts` and `src/index.ts` have been updated to `1.2.3`, ensuring consistency with the `package.json` version.
58
-
59
- ---
60
-
61
- ## 3. Adherence to Project Guidelines (`CRUSH.md`)
62
-
63
- - **[Positive]** **Code Style & Formatting:** The changes adhere to the project's style.
64
- - **[Positive]** **Clarity:** The commit message is exemplary. It is highly detailed, structured, and clearly communicates the purpose, scope, and verification of the change. This level of detail is incredibly helpful for future maintenance.
65
- - **[Positive]** **Thoroughness:** The developer demonstrated great attention to detail by updating not just the code, but all user-facing documentation and changelogs.
66
-
67
- ---
68
-
69
- ## 4. Suggestions for Improvement
70
-
71
- - **None.** This commit is a model example of a high-quality contribution. It is comprehensive, well-documented, and correctly executed.
72
-
73
- ---
74
- **End of Report**