@zzp123/mcp-zentao 1.7.0 → 1.7.2

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/CHANGELOG.md CHANGED
@@ -5,6 +5,51 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.7.2] - 2025-11-06
9
+
10
+ ### Added
11
+ - **updateStory 工具重大增强**
12
+ - 新增29个可编辑字段支持,��全对接禅道最新API文档
13
+ - 支持需求基本信息编辑:title, product, parent, module, branch, plan, type
14
+ - 支持来源信息编辑:source, sourceNote(支持8种来源类型)
15
+ - 支持分类与优先级:category, pri, estimate
16
+ - 支持状态与阶段:stage, status
17
+ - 支持关键词与标识:keywords, color, grade
18
+ - 支持人员相关:mailto, reviewer, assignedTo, closedBy, feedbackBy
19
+ - 支持关闭相关:closedReason, duplicateStory(7种关闭原因)
20
+ - 支持评审相关:needNotReview
21
+ - 支持通知相关:notifyEmail
22
+ - 支持描述内容:spec, verify(HTML格式)
23
+ - 支持备注:comment
24
+
25
+ ### Changed
26
+ - `UpdateStoryRequest` 接口完全重构,从7个字段扩展到29个字段
27
+ - `updateStory` MCP 工具参数完全重新定义,支持所有新字段
28
+ - 添加了详细的字段注释和类型定义,提升开发体验
29
+
30
+ ### Technical
31
+ - 所有字段均为可选参数,支持部分更新
32
+ - `plan` 字段支持单个ID或数组格式
33
+ - `closedReason` 使用枚举类型确保数据正确性
34
+ - `mailto` 和 `reviewer` 字段支持数组格式
35
+
36
+ ### Benefits
37
+ - **功能完整性**:支持禅道需求管理的所有常用编辑功能
38
+ - **灵活性**:可以批量更新多个字段,也可以单独更新单个字段
39
+ - **类型安全**:完整的 TypeScript 类型定义,减少运行时错误
40
+
41
+ ## [1.7.1] - 2025-11-06
42
+
43
+ ### Fixed
44
+ - **图片 HTML 格式优化**
45
+ - `uploadFile` 和 `uploadImageFromClipboard` 工具现在生成的 `imageHtml` 会被 `<p>` 标签包裹
46
+ - 修复了某些情况下图片在禅道中无法正确显示的问题
47
+ - 确保生成的 HTML 格式与禅道富文本编辑器的标准格式一致
48
+
49
+ ### Changed
50
+ - 图片 HTML 格式从 `<img ... />` 改为 `<p><img ... /></p>`
51
+ - 更新使用提示,明确说明图片会被包裹在 `<p>` 标签中
52
+
8
53
  ## [1.7.0] - 2025-11-06
9
54
 
10
55
  ### Added
package/dist/index.js CHANGED
@@ -464,14 +464,47 @@ server.tool("getProjects", {
464
464
  server.tool("updateStory", {
465
465
  storyId: z.number(),
466
466
  update: z.object({
467
+ // 基本信息
468
+ title: z.string().optional(),
469
+ product: z.number().optional(),
470
+ parent: z.number().optional(),
467
471
  module: z.number().optional(),
472
+ branch: z.number().optional(),
473
+ plan: z.union([z.number(), z.array(z.number())]).optional(),
474
+ type: z.string().optional(),
475
+ // 来源信息
468
476
  source: z.string().optional(),
469
477
  sourceNote: z.string().optional(),
470
- pri: z.number().optional(),
478
+ // 分类与优先级
471
479
  category: z.string().optional(),
480
+ pri: z.number().optional(),
472
481
  estimate: z.number().optional(),
473
- keywords: z.string().optional()
474
- })
482
+ // 状态与阶段
483
+ stage: z.string().optional(),
484
+ status: z.string().optional(),
485
+ // 关键词与标识
486
+ keywords: z.string().optional(),
487
+ color: z.string().optional(),
488
+ grade: z.number().optional(),
489
+ // 人员相关
490
+ mailto: z.array(z.string()).optional(),
491
+ reviewer: z.array(z.string()).optional(),
492
+ assignedTo: z.string().optional(),
493
+ closedBy: z.string().optional(),
494
+ feedbackBy: z.string().optional(),
495
+ // 关闭相关
496
+ closedReason: z.enum(['done', 'subdivided', 'duplicate', 'postponed', 'willnotdo', 'cancel', 'bydesign']).optional(),
497
+ duplicateStory: z.number().optional(),
498
+ // 评审相关
499
+ needNotReview: z.boolean().optional(),
500
+ // 通知相关
501
+ notifyEmail: z.string().optional(),
502
+ // 描述内容
503
+ spec: z.string().optional(),
504
+ verify: z.string().optional(),
505
+ // 备注
506
+ comment: z.string().optional()
507
+ }).describe("需求更新字段 - 根据API文档支持29个可编辑字段")
475
508
  }, async ({ storyId, update }) => {
476
509
  if (!zentaoApi)
477
510
  throw new Error("Please initialize Zentao API first");
@@ -992,13 +1025,13 @@ server.tool("uploadFile", {
992
1025
  const fileId = result.id;
993
1026
  const baseUrl = zentaoApi.getConfig().url;
994
1027
  const imageUrl = `${baseUrl}/zentao/entao/api.php?m=file&f=read&t=png&fileID=${fileId}`;
995
- const imageHtml = `<img onload="setImageSize(this,0)" src="${imageUrl}" alt="${finalFilename}" />`;
1028
+ const imageHtml = `<p><img onload="setImageSize(this,0)" src="${imageUrl}" alt="${finalFilename}" /></p>`;
996
1029
  const response = {
997
1030
  upload: result,
998
1031
  fileId: fileId,
999
1032
  imageUrl: imageUrl,
1000
1033
  imageHtml: imageHtml,
1001
- tip: `更新 Bug 描述时,请使用 imageHtml 字段中的 HTML 代码`
1034
+ tip: `更新 Bug 描述时,请使用 imageHtml 字段中的 HTML 代码。图片会被包裹在 <p> 标签中以确保正确显示。`
1002
1035
  };
1003
1036
  if (savedPath) {
1004
1037
  response.savedPath = savedPath;
@@ -1142,7 +1175,7 @@ server.tool("uploadImageFromClipboard", {
1142
1175
  const fileId = uploadResult.id;
1143
1176
  const baseUrl = zentaoApi.getConfig().url;
1144
1177
  const imageUrl = `${baseUrl}/zentao/entao/api.php?m=file&f=read&t=png&fileID=${fileId}`;
1145
- const imageHtml = `<img onload="setImageSize(this,0)" src="${imageUrl}" alt="${finalFilename}" />`;
1178
+ const imageHtml = `<p><img onload="setImageSize(this,0)" src="${imageUrl}" alt="${finalFilename}" /></p>`;
1146
1179
  const response = {
1147
1180
  success: true,
1148
1181
  upload: uploadResult,
@@ -1153,7 +1186,7 @@ server.tool("uploadImageFromClipboard", {
1153
1186
  imageUrl: imageUrl,
1154
1187
  imageHtml: imageHtml,
1155
1188
  message: `图片已保存到本地并上传到禅道`,
1156
- tip: `更新 Bug 描述时,请使用 imageHtml 字段中的 HTML 代码`
1189
+ tip: `更新 Bug 描述时,请使用 imageHtml 字段中的 HTML 代码。图片会被包裹在 <p> 标签中以确保正确显示。`
1157
1190
  };
1158
1191
  console.log('[uploadImageFromClipboard] 返回结果:', response);
1159
1192
  return {
@@ -257,13 +257,35 @@ export interface Project {
257
257
  progress: number;
258
258
  }
259
259
  export interface UpdateStoryRequest {
260
+ title?: string;
261
+ product?: number;
262
+ parent?: number;
260
263
  module?: number;
264
+ branch?: number;
265
+ plan?: number | number[];
266
+ type?: string;
261
267
  source?: string;
262
268
  sourceNote?: string;
263
- pri?: number;
264
269
  category?: string;
270
+ pri?: number;
265
271
  estimate?: number;
272
+ stage?: string;
273
+ status?: string;
266
274
  keywords?: string;
275
+ color?: string;
276
+ grade?: number;
277
+ mailto?: string[];
278
+ reviewer?: string[];
279
+ assignedTo?: string;
280
+ closedBy?: string;
281
+ feedbackBy?: string;
282
+ closedReason?: 'done' | 'subdivided' | 'duplicate' | 'postponed' | 'willnotdo' | 'cancel' | 'bydesign';
283
+ duplicateStory?: number;
284
+ needNotReview?: boolean;
285
+ notifyEmail?: string;
286
+ spec?: string;
287
+ verify?: string;
288
+ comment?: string;
267
289
  }
268
290
  export interface CreateProgramRequest {
269
291
  name?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zzp123/mcp-zentao",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "禅道项目管理系统的高级API集成包,提供任务管理、Bug跟踪等功能的完整封装,专为Cursor IDE设计的MCP扩展",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -42,7 +42,7 @@
42
42
  "license": "MIT",
43
43
  "repository": {
44
44
  "type": "git",
45
- "url": "https://github.com/yourusername/mcp-zentao.git"
45
+ "url": "git+https://github.com/yourusername/mcp-zentao.git"
46
46
  },
47
47
  "dependencies": {
48
48
  "@modelcontextprotocol/sdk": "^1.6.1",