@zzp123/mcp-zentao 1.17.9 → 1.18.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.
@@ -33,9 +33,8 @@ export declare class ZentaoAPI {
33
33
  */
34
34
  private filterBugFields;
35
35
  /**
36
- * 获取我的 Bug 列表(默认只查询指派给我的 Bug)
36
+ * 获取我的 Bug 列表(固定查询指派给我的 Bug)
37
37
  *
38
- * @param status Bug状态筛选(默认'assigntome'指派给我的,支持多种状态,详见BugStatus类型)
39
38
  * @param productId 产品ID(可选,默认使用第二个产品)
40
39
  * @param page 页码(从1开始,默认1)
41
40
  * @param limit 每页数量(默认20,最大100)
@@ -44,7 +43,7 @@ export declare class ZentaoAPI {
44
43
  * @param fields 返回字段级别('basic'基本/'default'默认/'full'完整,默认'basic')
45
44
  * @returns Promise<Bug列表及分页信息>
46
45
  */
47
- getMyBugs(status?: BugStatus, productId?: number, page?: number, limit?: number, branch?: string, order?: string, fields?: 'basic' | 'default' | 'full'): Promise<{
46
+ getMyBugs(productId?: number, page?: number, limit?: number, branch?: string, order?: string, fields?: 'basic' | 'default' | 'full'): Promise<{
48
47
  page: number;
49
48
  total: number;
50
49
  limit: number;
@@ -197,15 +197,18 @@ export class ZentaoAPI {
197
197
  }
198
198
  if (fields === 'basic') {
199
199
  // 基本信息:只返回最核心的字段
200
+ // 注意:移除了 assignedTo(因为 getMyBugs 固定查询指派给我的 Bug,该字段无信息价值)
201
+ // 新增:statusName(中文状态名)、deadline(截止日期)
200
202
  return {
201
203
  id: bug.id,
202
204
  title: bug.title,
203
205
  status: bug.status,
206
+ statusName: bug.statusName,
204
207
  pri: bug.pri,
205
208
  severity: bug.severity,
206
- assignedTo: bug.assignedTo,
207
209
  openedBy: bug.openedBy,
208
- openedDate: bug.openedDate
210
+ openedDate: bug.openedDate,
211
+ deadline: bug.deadline
209
212
  };
210
213
  }
211
214
  // default: 默认字段(适合列表展示)
@@ -232,9 +235,8 @@ export class ZentaoAPI {
232
235
  };
233
236
  }
234
237
  /**
235
- * 获取我的 Bug 列表(默认只查询指派给我的 Bug)
238
+ * 获取我的 Bug 列表(固定查询指派给我的 Bug)
236
239
  *
237
- * @param status Bug状态筛选(默认'assigntome'指派给我的,支持多种状态,详见BugStatus类型)
238
240
  * @param productId 产品ID(可选,默认使用第二个产品)
239
241
  * @param page 页码(从1开始,默认1)
240
242
  * @param limit 每页数量(默认20,最大100)
@@ -243,7 +245,7 @@ export class ZentaoAPI {
243
245
  * @param fields 返回字段级别('basic'基本/'default'默认/'full'完整,默认'basic')
244
246
  * @returns Promise<Bug列表及分页信息>
245
247
  */
246
- async getMyBugs(status, productId, page, limit, branch, order, fields) {
248
+ async getMyBugs(productId, page, limit, branch, order, fields) {
247
249
  if (!productId) {
248
250
  // 如果没有提供产品ID,获取第二个可用的产品(索引为1)
249
251
  const products = await this.getProducts();
@@ -260,18 +262,16 @@ export class ZentaoAPI {
260
262
  const finalBranch = branch || 'all';
261
263
  const finalOrder = order || 'id_desc';
262
264
  const finalFields = fields || 'basic';
263
- // 默认查询指派给我的 Bug
264
- const finalStatus = status || 'assigntome';
265
+ // 固定查询指派给我的 Bug
266
+ const finalStatus = 'assigntome';
265
267
  // 构建查询参数
266
268
  const queryParams = new URLSearchParams();
267
269
  queryParams.append('branch', finalBranch);
268
270
  queryParams.append('page', finalPage.toString());
269
271
  queryParams.append('limit', finalLimit.toString());
270
272
  queryParams.append('order', finalOrder);
271
- // 添加状态筛选
272
- if (finalStatus !== 'all') {
273
- queryParams.append('status', finalStatus);
274
- }
273
+ // 固定添加状态筛选:只查询指派给我的 Bug
274
+ queryParams.append('status', finalStatus);
275
275
  try {
276
276
  console.log(`正在获取产品 ${productId} 的Bug列表,参数: status=${finalStatus}, branch=${finalBranch}, page=${finalPage}, limit=${finalLimit}, order=${finalOrder}, fields=${finalFields}`);
277
277
  const response = await this.request('GET', `/products/${productId}/bugs?${queryParams.toString()}`);
package/dist/index-dev.js CHANGED
@@ -75,39 +75,17 @@ server.tool("getTaskDetail", {
75
75
  content: [{ type: "text", text: JSON.stringify(task, null, 2) }]
76
76
  };
77
77
  });
78
- server.tool("getMyBugs", "获取我的Bug列表 - 默认只查询指派给我的Bug,支持多种状态筛选和分支筛选", {
79
- status: z.enum([
80
- 'active', // 激活状态
81
- 'resolved', // 已解决
82
- 'closed', // 已关闭
83
- 'all', // 所有状态
84
- 'assigntome', // 指派给我的
85
- 'openedbyme', // 由我创建
86
- 'resolvedbyme', // 由我解决
87
- 'assignedbyme', // 由我指派
88
- 'assigntonull', // 未指派
89
- 'unconfirmed', // 未确认
90
- 'unclosed', // 未关闭
91
- 'unresolved', // 未解决(激活状态)
92
- 'toclosed', // 待关闭(已解决)
93
- 'postponedbugs', // 延期的Bug
94
- 'longlifebugs', // 长期未处理的Bug
95
- 'overduebugs', // 已过期的Bug
96
- 'review', // 待我审核
97
- 'feedback', // 用户反馈
98
- 'needconfirm', // 需求变更需确认
99
- 'bysearch' // 自定义搜索
100
- ]).optional().describe("Bug状态筛选,默认'assigntome'(指派给我的)"),
78
+ server.tool("getMyBugs", "获取我的Bug列表 - 固定查询指派给我的Bug(status='assigntome')", {
101
79
  productId: z.number().optional().describe("产品ID,默认使用第二个产品"),
102
80
  page: z.number().optional().describe("页码,从1开始,默认为1"),
103
81
  limit: z.number().optional().describe("每页数量,默认20,最大100"),
104
82
  branch: z.string().optional().describe("分支筛选:'all'(所有分支,默认)、'0'(主干分支)、分支ID"),
105
83
  order: z.string().optional().describe("排序方式,如 id_desc(ID降序), pri_desc(优先级降序), openedDate_desc(创建时间降序)等,默认id_desc"),
106
84
  fields: z.enum(['basic', 'default', 'full']).optional().describe("返回字段级别:'basic'(基本字段,默认)、'default'(默认字段)、'full'(完整字段),默认'basic'")
107
- }, async ({ status, productId, page, limit, branch, order, fields }) => {
85
+ }, async ({ productId, page, limit, branch, order, fields }) => {
108
86
  if (!zentaoApi)
109
87
  throw new Error("Please initialize Zentao API first");
110
- const result = await zentaoApi.getMyBugs(status, productId, page, limit, branch, order, fields);
88
+ const result = await zentaoApi.getMyBugs(productId, page, limit, branch, order, fields);
111
89
  // 返回分页信息和数据
112
90
  const summary = {
113
91
  summary: `当前第 ${result.page} 页,共 ${result.total} 个Bug,本页显示 ${result.bugs.length} 个`,
package/dist/index-pm.js CHANGED
@@ -85,39 +85,17 @@ server.tool("getProducts", "获取产品列表 - 只返回核心字段(id, 名
85
85
  content: [{ type: "text", text: JSON.stringify(products, null, 2) }]
86
86
  };
87
87
  });
88
- server.tool("getMyBugs", "获取我的Bug列表 - 默认只查询指派给我的Bug,支持多种状态筛选和分支筛选", {
89
- status: z.enum([
90
- 'active', // 激活状态
91
- 'resolved', // 已解决
92
- 'closed', // 已关闭
93
- 'all', // 所有状态
94
- 'assigntome', // 指派给我的
95
- 'openedbyme', // 由我创建
96
- 'resolvedbyme', // 由我解决
97
- 'assignedbyme', // 由我指派
98
- 'assigntonull', // 未指派
99
- 'unconfirmed', // 未确认
100
- 'unclosed', // 未关闭
101
- 'unresolved', // 未解决(激活状态)
102
- 'toclosed', // 待关闭(已解决)
103
- 'postponedbugs', // 延期的Bug
104
- 'longlifebugs', // 长期未处理的Bug
105
- 'overduebugs', // 已过期的Bug
106
- 'review', // 待我审核
107
- 'feedback', // 用户反馈
108
- 'needconfirm', // 需求变更需确认
109
- 'bysearch' // 自定义搜索
110
- ]).optional().describe("Bug状态筛选,默认'assigntome'(指派给我的)"),
88
+ server.tool("getMyBugs", "获取我的Bug列表 - 固定查询指派给我的Bug(status='assigntome')", {
111
89
  productId: z.number().optional().describe("产品ID,默认使用第二个产品"),
112
90
  page: z.number().optional().describe("页码,从1开始,默认为1"),
113
91
  limit: z.number().optional().describe("每页数量,默认20,最大100"),
114
92
  branch: z.string().optional().describe("分支筛选:'all'(所有分支,默认)、'0'(主干分支)、分支ID"),
115
93
  order: z.string().optional().describe("排序方式,如 id_desc(ID降序), pri_desc(优先级降序), openedDate_desc(创建时间降序)等,默认id_desc"),
116
94
  fields: z.enum(['basic', 'default', 'full']).optional().describe("返回字段级别:'basic'(基本字段,默认)、'default'(默认字段)、'full'(完整字段),默认'basic'")
117
- }, async ({ status, productId, page, limit, branch, order, fields }) => {
95
+ }, async ({ productId, page, limit, branch, order, fields }) => {
118
96
  if (!zentaoApi)
119
97
  throw new Error("Please initialize Zentao API first");
120
- const result = await zentaoApi.getMyBugs(status, productId, page, limit, branch, order, fields);
98
+ const result = await zentaoApi.getMyBugs(productId, page, limit, branch, order, fields);
121
99
  // 返回分页信息和数据
122
100
  const summary = {
123
101
  summary: `当前第 ${result.page} 页,共 ${result.total} 个Bug,本页显示 ${result.bugs.length} 个`,
package/dist/index-qa.js CHANGED
@@ -75,39 +75,17 @@ server.tool("getTaskDetail", {
75
75
  content: [{ type: "text", text: JSON.stringify(task, null, 2) }]
76
76
  };
77
77
  });
78
- server.tool("getMyBugs", "获取我的Bug列表 - 默认只查询指派给我的Bug,支持多种状态筛选和分支筛选", {
79
- status: z.enum([
80
- 'active', // 激活状态
81
- 'resolved', // 已解决
82
- 'closed', // 已关闭
83
- 'all', // 所有状态
84
- 'assigntome', // 指派给我的
85
- 'openedbyme', // 由我创建
86
- 'resolvedbyme', // 由我解决
87
- 'assignedbyme', // 由我指派
88
- 'assigntonull', // 未指派
89
- 'unconfirmed', // 未确认
90
- 'unclosed', // 未关闭
91
- 'unresolved', // 未解决(激活状态)
92
- 'toclosed', // 待关闭(已解决)
93
- 'postponedbugs', // 延期的Bug
94
- 'longlifebugs', // 长期未处理的Bug
95
- 'overduebugs', // 已过期的Bug
96
- 'review', // 待我审核
97
- 'feedback', // 用户反馈
98
- 'needconfirm', // 需求变更需确认
99
- 'bysearch' // 自定义搜索
100
- ]).optional().describe("Bug状态筛选,默认'assigntome'(指派给我的)"),
78
+ server.tool("getMyBugs", "获取我的Bug列表 - 固定查询指派给我的Bug(status='assigntome')", {
101
79
  productId: z.number().optional().describe("产品ID,默认使用第二个产品"),
102
80
  page: z.number().optional().describe("页码,从1开始,默认为1"),
103
81
  limit: z.number().optional().describe("每页数量,默认20,最大100"),
104
82
  branch: z.string().optional().describe("分支筛选:'all'(所有分支,默认)、'0'(主干分支)、分支ID"),
105
83
  order: z.string().optional().describe("排序方式,如 id_desc(ID降序), pri_desc(优先级降序), openedDate_desc(创建时间降序)等,默认id_desc"),
106
84
  fields: z.enum(['basic', 'default', 'full']).optional().describe("返回字段级别:'basic'(基本字段,默认)、'default'(默认字段)、'full'(完整字段),默认'basic'")
107
- }, async ({ status, productId, page, limit, branch, order, fields }) => {
85
+ }, async ({ productId, page, limit, branch, order, fields }) => {
108
86
  if (!zentaoApi)
109
87
  throw new Error("Please initialize Zentao API first");
110
- const result = await zentaoApi.getMyBugs(status, productId, page, limit, branch, order, fields);
88
+ const result = await zentaoApi.getMyBugs(productId, page, limit, branch, order, fields);
111
89
  // 返回分页信息和数据
112
90
  const summary = {
113
91
  summary: `当前第 ${result.page} 页,共 ${result.total} 个Bug,本页显示 ${result.bugs.length} 个`,
package/dist/index.js CHANGED
@@ -89,39 +89,17 @@ server.tool("getProducts", "获取产品列表 - 只返回核心字段(id, 名
89
89
  };
90
90
  });
91
91
  // Add getMyBugs tool
92
- server.tool("getMyBugs", "获取我的Bug列表 - 默认只查询指派给我的Bug,支持多种状态筛选和分支筛选", {
93
- status: z.enum([
94
- 'active', // 激活状态
95
- 'resolved', // 已解决
96
- 'closed', // 已关闭
97
- 'all', // 所有状态
98
- 'assigntome', // 指派给我的
99
- 'openedbyme', // 由我创建
100
- 'resolvedbyme', // 由我解决
101
- 'assignedbyme', // 由我指派
102
- 'assigntonull', // 未指派
103
- 'unconfirmed', // 未确认
104
- 'unclosed', // 未关闭
105
- 'unresolved', // 未解决(激活状态)
106
- 'toclosed', // 待关闭(已解决)
107
- 'postponedbugs', // 延期的Bug
108
- 'longlifebugs', // 长期未处理的Bug
109
- 'overduebugs', // 已过期的Bug
110
- 'review', // 待我审核
111
- 'feedback', // 用户反馈
112
- 'needconfirm', // 需求变更需确认
113
- 'bysearch' // 自定义搜索
114
- ]).optional().describe("Bug状态筛选,默认'assigntome'(指派给我的)"),
92
+ server.tool("getMyBugs", "获取我的Bug列表 - 固定查询指派给我的Bug(status='assigntome')", {
115
93
  productId: z.number().optional().describe("产品ID,默认使用第二个产品"),
116
94
  page: z.number().optional().describe("页码,从1开始,默认为1"),
117
95
  limit: z.number().optional().describe("每页数量,默认20,最大100"),
118
96
  branch: z.string().optional().describe("分支筛选:'all'(所有分支,默认)、'0'(主干分支)、分支ID"),
119
97
  order: z.string().optional().describe("排序方式,如 id_desc(ID降序), pri_desc(优先级降序), openedDate_desc(创建时间降序)等,默认id_desc"),
120
98
  fields: z.enum(['basic', 'default', 'full']).optional().describe("返回字段级别:'basic'(基本字段,默认)、'default'(默认字段)、'full'(完整字段),默认'basic'")
121
- }, async ({ status, productId, page, limit, branch, order, fields }) => {
99
+ }, async ({ productId, page, limit, branch, order, fields }) => {
122
100
  if (!zentaoApi)
123
101
  throw new Error("Please initialize Zentao API first");
124
- const result = await zentaoApi.getMyBugs(status, productId, page, limit, branch, order, fields);
102
+ const result = await zentaoApi.getMyBugs(productId, page, limit, branch, order, fields);
125
103
  // 返回分页信息和数据
126
104
  const summary = {
127
105
  summary: `当前第 ${result.page} 页,共 ${result.total} 个Bug,本页显示 ${result.bugs.length} 个`,
@@ -1,6 +1,6 @@
1
- import { BugStatus, TaskStatus, ZentaoConfig } from './types/zentao';
1
+ import { TaskStatus, ZentaoConfig } from './types/zentao';
2
2
  export declare function mcp_zentao_connect(config: ZentaoConfig): Promise<string>;
3
3
  export declare function mcp_zentao_tasks(status?: TaskStatus): Promise<string>;
4
4
  export declare function mcp_zentao_task(taskId: number): Promise<string>;
5
- export declare function mcp_zentao_bugs(status?: BugStatus): Promise<string>;
5
+ export declare function mcp_zentao_bugs(): Promise<string>;
6
6
  export declare function mcp_zentao_bug(bugId: number): Promise<string>;
@@ -44,11 +44,11 @@ export async function mcp_zentao_task(taskId) {
44
44
  return `获取任务详情失败: ${error instanceof Error ? error.message : '未知错误'}`;
45
45
  }
46
46
  }
47
- export async function mcp_zentao_bugs(status) {
47
+ export async function mcp_zentao_bugs() {
48
48
  try {
49
49
  if (!bugService)
50
50
  throw new Error('请先连接禅道');
51
- const bugs = await bugService.getMyBugs(status);
51
+ const bugs = await bugService.getMyBugs();
52
52
  if (bugs.length === 0)
53
53
  return '没有找到任何Bug';
54
54
  return formatBugsTable(bugs);
@@ -1,9 +1,9 @@
1
1
  import { ZentaoAPI } from '../api/zentaoApi';
2
- import { Bug, BugStatus } from '../types/zentao';
2
+ import { Bug } from '../types/zentao';
3
3
  export declare class BugService {
4
4
  private api;
5
5
  constructor(api: ZentaoAPI);
6
- getMyBugs(status?: BugStatus): Promise<Bug[]>;
6
+ getMyBugs(): Promise<Bug[]>;
7
7
  getBugDetail(bugId: number): Promise<Bug>;
8
8
  private enrichBugData;
9
9
  }
@@ -4,8 +4,8 @@ export class BugService {
4
4
  constructor(api) {
5
5
  this.api = api;
6
6
  }
7
- async getMyBugs(status) {
8
- const result = await this.api.getMyBugs(status);
7
+ async getMyBugs() {
8
+ const result = await this.api.getMyBugs();
9
9
  return result.bugs.map((bug) => this.enrichBugData(bug));
10
10
  }
11
11
  async getBugDetail(bugId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zzp123/mcp-zentao",
3
- "version": "1.17.9",
3
+ "version": "1.18.1",
4
4
  "description": "禅道项目管理系统的高级API集成包 - 完整版,包含所有94个工具。另有产品经理、测试工程师、开发工程师专用精简版本可选",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",