@zzp123/mcp-zentao 1.7.2 → 1.7.3
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 +12 -0
- package/dist/index.js +59 -43
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ 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.3] - 2025-11-06
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **updateStory 工具参数格式优化**
|
|
12
|
+
- 修复 `update` 参数只能接受对象格式的问题
|
|
13
|
+
- 现在同时支持对象格式和 JSON 字符串格式
|
|
14
|
+
- 自动解析 JSON 字符串并提供友好的错误提示
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- `update` 参数使用 `z.union()` 同时接受对象和字符串格式
|
|
18
|
+
- 添加 JSON 字符串解析逻辑,提升工具兼容性
|
|
19
|
+
|
|
8
20
|
## [1.7.2] - 2025-11-06
|
|
9
21
|
|
|
10
22
|
### Added
|
package/dist/index.js
CHANGED
|
@@ -463,52 +463,68 @@ server.tool("getProjects", {
|
|
|
463
463
|
// Add updateStory tool
|
|
464
464
|
server.tool("updateStory", {
|
|
465
465
|
storyId: z.number(),
|
|
466
|
-
update: z.
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
466
|
+
update: z.union([
|
|
467
|
+
z.object({
|
|
468
|
+
// 基本信息
|
|
469
|
+
title: z.string().optional(),
|
|
470
|
+
product: z.number().optional(),
|
|
471
|
+
parent: z.number().optional(),
|
|
472
|
+
module: z.number().optional(),
|
|
473
|
+
branch: z.number().optional(),
|
|
474
|
+
plan: z.union([z.number(), z.array(z.number())]).optional(),
|
|
475
|
+
type: z.string().optional(),
|
|
476
|
+
// 来源信息
|
|
477
|
+
source: z.string().optional(),
|
|
478
|
+
sourceNote: z.string().optional(),
|
|
479
|
+
// 分类与优先级
|
|
480
|
+
category: z.string().optional(),
|
|
481
|
+
pri: z.number().optional(),
|
|
482
|
+
estimate: z.number().optional(),
|
|
483
|
+
// 状态与阶段
|
|
484
|
+
stage: z.string().optional(),
|
|
485
|
+
status: z.string().optional(),
|
|
486
|
+
// 关键词与标识
|
|
487
|
+
keywords: z.string().optional(),
|
|
488
|
+
color: z.string().optional(),
|
|
489
|
+
grade: z.number().optional(),
|
|
490
|
+
// 人员相关
|
|
491
|
+
mailto: z.array(z.string()).optional(),
|
|
492
|
+
reviewer: z.array(z.string()).optional(),
|
|
493
|
+
assignedTo: z.string().optional(),
|
|
494
|
+
closedBy: z.string().optional(),
|
|
495
|
+
feedbackBy: z.string().optional(),
|
|
496
|
+
// 关闭相关
|
|
497
|
+
closedReason: z.enum(['done', 'subdivided', 'duplicate', 'postponed', 'willnotdo', 'cancel', 'bydesign']).optional(),
|
|
498
|
+
duplicateStory: z.number().optional(),
|
|
499
|
+
// 评审相关
|
|
500
|
+
needNotReview: z.boolean().optional(),
|
|
501
|
+
// 通知相关
|
|
502
|
+
notifyEmail: z.string().optional(),
|
|
503
|
+
// 描述内容
|
|
504
|
+
spec: z.string().optional(),
|
|
505
|
+
verify: z.string().optional(),
|
|
506
|
+
// 备注
|
|
507
|
+
comment: z.string().optional()
|
|
508
|
+
}),
|
|
509
|
+
z.string()
|
|
510
|
+
]).describe("需求更新字段 - 支持对象或JSON字符串格式")
|
|
508
511
|
}, async ({ storyId, update }) => {
|
|
509
512
|
if (!zentaoApi)
|
|
510
513
|
throw new Error("Please initialize Zentao API first");
|
|
511
|
-
|
|
514
|
+
// 如果 update 是字符串,尝试解析为对象
|
|
515
|
+
let updateData;
|
|
516
|
+
if (typeof update === 'string') {
|
|
517
|
+
try {
|
|
518
|
+
updateData = JSON.parse(update);
|
|
519
|
+
}
|
|
520
|
+
catch (error) {
|
|
521
|
+
throw new Error(`Invalid JSON string: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
updateData = update;
|
|
526
|
+
}
|
|
527
|
+
const story = await zentaoApi.updateStory(storyId, updateData);
|
|
512
528
|
return {
|
|
513
529
|
content: [{ type: "text", text: JSON.stringify(story, null, 2) }]
|
|
514
530
|
};
|