@daghis/teamcity-mcp 1.9.0 → 1.9.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.
- package/CHANGELOG.md +7 -0
- package/dist/index.js +112 -93
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.9.1](https://github.com/Daghis/teamcity-mcp/compare/v1.9.0...v1.9.1) (2025-09-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **tools:** allow manage_build_steps updates ([#182](https://github.com/Daghis/teamcity-mcp/issues/182)) ([2c6bea0](https://github.com/Daghis/teamcity-mcp/commit/2c6bea0cf6770d22068b9e4b733542a056399148))
|
|
9
|
+
|
|
3
10
|
## [1.9.0](https://github.com/Daghis/teamcity-mcp/compare/v1.8.2...v1.9.0) (2025-09-20)
|
|
4
11
|
|
|
5
12
|
|
package/dist/index.js
CHANGED
|
@@ -40400,103 +40400,122 @@ var FULL_MODE_TOOLS = [
|
|
|
40400
40400
|
required: ["buildTypeId", "action"]
|
|
40401
40401
|
},
|
|
40402
40402
|
handler: async (args) => {
|
|
40403
|
-
const
|
|
40404
|
-
|
|
40405
|
-
|
|
40406
|
-
|
|
40407
|
-
|
|
40408
|
-
|
|
40409
|
-
|
|
40410
|
-
|
|
40411
|
-
|
|
40412
|
-
|
|
40413
|
-
|
|
40414
|
-
|
|
40415
|
-
|
|
40416
|
-
|
|
40417
|
-
property: Object.entries(stepProps).map(([k, v]) => ({ name: k, value: v }))
|
|
40418
|
-
}
|
|
40419
|
-
};
|
|
40420
|
-
await adapter.modules.buildTypes.addBuildStepToBuildType(
|
|
40421
|
-
typedArgs.buildTypeId,
|
|
40422
|
-
void 0,
|
|
40423
|
-
step,
|
|
40424
|
-
{
|
|
40425
|
-
headers: { "Content-Type": "application/json", Accept: "application/json" }
|
|
40426
|
-
}
|
|
40427
|
-
);
|
|
40428
|
-
return json({
|
|
40429
|
-
success: true,
|
|
40430
|
-
action: "add_build_step",
|
|
40431
|
-
buildTypeId: typedArgs.buildTypeId
|
|
40432
|
-
});
|
|
40433
|
-
}
|
|
40434
|
-
case "update": {
|
|
40435
|
-
if (typedArgs.stepId == null || typedArgs.stepId === "") {
|
|
40436
|
-
return json({
|
|
40437
|
-
success: false,
|
|
40438
|
-
action: "update_build_step",
|
|
40439
|
-
error: "Step ID is required for update action"
|
|
40440
|
-
});
|
|
40441
|
-
}
|
|
40442
|
-
const updatePayload = {};
|
|
40443
|
-
if (typedArgs.name != null) {
|
|
40444
|
-
updatePayload["name"] = typedArgs.name;
|
|
40445
|
-
}
|
|
40446
|
-
if (typedArgs.type != null) {
|
|
40447
|
-
updatePayload["type"] = typedArgs.type;
|
|
40448
|
-
}
|
|
40449
|
-
const rawProps = typedArgs.properties ?? {};
|
|
40450
|
-
const stepProps = Object.fromEntries(
|
|
40451
|
-
Object.entries(rawProps).map(([k, v]) => [k, String(v)])
|
|
40452
|
-
);
|
|
40453
|
-
if (stepProps["script.content"]) {
|
|
40454
|
-
stepProps["use.custom.script"] = stepProps["use.custom.script"] ?? "true";
|
|
40455
|
-
stepProps["script.type"] = stepProps["script.type"] ?? "customScript";
|
|
40456
|
-
}
|
|
40457
|
-
if (Object.keys(stepProps).length > 0) {
|
|
40458
|
-
updatePayload["properties"] = {
|
|
40459
|
-
property: Object.entries(stepProps).map(([name, value]) => ({ name, value }))
|
|
40460
|
-
};
|
|
40461
|
-
}
|
|
40462
|
-
if (Object.keys(updatePayload).length === 0) {
|
|
40463
|
-
return json({
|
|
40464
|
-
success: false,
|
|
40465
|
-
action: "update_build_step",
|
|
40466
|
-
error: "No update fields provided"
|
|
40403
|
+
const schema = import_zod4.z.object({
|
|
40404
|
+
buildTypeId: import_zod4.z.string().min(1, "buildTypeId is required"),
|
|
40405
|
+
action: import_zod4.z.enum(["add", "update", "delete"]),
|
|
40406
|
+
stepId: import_zod4.z.string().min(1).optional(),
|
|
40407
|
+
name: import_zod4.z.string().optional(),
|
|
40408
|
+
type: import_zod4.z.string().optional(),
|
|
40409
|
+
properties: import_zod4.z.record(import_zod4.z.unknown()).optional()
|
|
40410
|
+
}).superRefine((value, ctx) => {
|
|
40411
|
+
if (value.action === "update" || value.action === "delete") {
|
|
40412
|
+
if (!value.stepId || value.stepId.trim() === "") {
|
|
40413
|
+
ctx.addIssue({
|
|
40414
|
+
code: import_zod4.z.ZodIssueCode.custom,
|
|
40415
|
+
message: "stepId is required for update or delete actions",
|
|
40416
|
+
path: ["stepId"]
|
|
40467
40417
|
});
|
|
40468
40418
|
}
|
|
40469
|
-
await adapter.modules.buildTypes.replaceBuildStep(
|
|
40470
|
-
typedArgs.buildTypeId,
|
|
40471
|
-
typedArgs.stepId,
|
|
40472
|
-
void 0,
|
|
40473
|
-
updatePayload
|
|
40474
|
-
);
|
|
40475
|
-
return json({
|
|
40476
|
-
success: true,
|
|
40477
|
-
action: "update_build_step",
|
|
40478
|
-
buildTypeId: typedArgs.buildTypeId,
|
|
40479
|
-
stepId: typedArgs.stepId
|
|
40480
|
-
});
|
|
40481
40419
|
}
|
|
40482
|
-
|
|
40483
|
-
|
|
40484
|
-
|
|
40485
|
-
|
|
40486
|
-
|
|
40487
|
-
|
|
40488
|
-
|
|
40420
|
+
});
|
|
40421
|
+
return runTool(
|
|
40422
|
+
"manage_build_steps",
|
|
40423
|
+
schema,
|
|
40424
|
+
async (typedArgs) => {
|
|
40425
|
+
const adapter = createAdapterFromTeamCityAPI(TeamCityAPI.getInstance());
|
|
40426
|
+
switch (typedArgs.action) {
|
|
40427
|
+
case "add": {
|
|
40428
|
+
const stepProps = Object.fromEntries(
|
|
40429
|
+
Object.entries(typedArgs.properties ?? {}).map(([k, v]) => [k, String(v)])
|
|
40430
|
+
);
|
|
40431
|
+
if (typedArgs.type === "simpleRunner" && stepProps["script.content"]) {
|
|
40432
|
+
stepProps["use.custom.script"] = stepProps["use.custom.script"] ?? "true";
|
|
40433
|
+
}
|
|
40434
|
+
const step = {
|
|
40435
|
+
name: typedArgs.name,
|
|
40436
|
+
type: typedArgs.type,
|
|
40437
|
+
properties: {
|
|
40438
|
+
property: Object.entries(stepProps).map(([k, v]) => ({ name: k, value: v }))
|
|
40439
|
+
}
|
|
40440
|
+
};
|
|
40441
|
+
await adapter.modules.buildTypes.addBuildStepToBuildType(
|
|
40442
|
+
typedArgs.buildTypeId,
|
|
40443
|
+
void 0,
|
|
40444
|
+
step,
|
|
40445
|
+
{
|
|
40446
|
+
headers: { "Content-Type": "application/json", Accept: "application/json" }
|
|
40447
|
+
}
|
|
40448
|
+
);
|
|
40449
|
+
return json({
|
|
40450
|
+
success: true,
|
|
40451
|
+
action: "add_build_step",
|
|
40452
|
+
buildTypeId: typedArgs.buildTypeId
|
|
40453
|
+
});
|
|
40454
|
+
}
|
|
40455
|
+
case "update": {
|
|
40456
|
+
const updatePayload = {};
|
|
40457
|
+
if (typedArgs.name != null) {
|
|
40458
|
+
updatePayload["name"] = typedArgs.name;
|
|
40459
|
+
}
|
|
40460
|
+
if (typedArgs.type != null) {
|
|
40461
|
+
updatePayload["type"] = typedArgs.type;
|
|
40462
|
+
}
|
|
40463
|
+
const rawProps = typedArgs.properties ?? {};
|
|
40464
|
+
const stepProps = Object.fromEntries(
|
|
40465
|
+
Object.entries(rawProps).map(([k, v]) => [k, String(v)])
|
|
40466
|
+
);
|
|
40467
|
+
if (stepProps["script.content"]) {
|
|
40468
|
+
stepProps["use.custom.script"] = stepProps["use.custom.script"] ?? "true";
|
|
40469
|
+
stepProps["script.type"] = stepProps["script.type"] ?? "customScript";
|
|
40470
|
+
}
|
|
40471
|
+
if (Object.keys(stepProps).length > 0) {
|
|
40472
|
+
updatePayload["properties"] = {
|
|
40473
|
+
property: Object.entries(stepProps).map(([name, value]) => ({ name, value }))
|
|
40474
|
+
};
|
|
40475
|
+
}
|
|
40476
|
+
if (Object.keys(updatePayload).length === 0) {
|
|
40477
|
+
return json({
|
|
40478
|
+
success: false,
|
|
40479
|
+
action: "update_build_step",
|
|
40480
|
+
error: "No update fields provided"
|
|
40481
|
+
});
|
|
40482
|
+
}
|
|
40483
|
+
await adapter.modules.buildTypes.replaceBuildStep(
|
|
40484
|
+
typedArgs.buildTypeId,
|
|
40485
|
+
typedArgs.stepId,
|
|
40486
|
+
void 0,
|
|
40487
|
+
updatePayload,
|
|
40488
|
+
{
|
|
40489
|
+
headers: {
|
|
40490
|
+
"Content-Type": "application/json",
|
|
40491
|
+
Accept: "application/json"
|
|
40492
|
+
}
|
|
40493
|
+
}
|
|
40494
|
+
);
|
|
40495
|
+
return json({
|
|
40496
|
+
success: true,
|
|
40497
|
+
action: "update_build_step",
|
|
40498
|
+
buildTypeId: typedArgs.buildTypeId,
|
|
40499
|
+
stepId: typedArgs.stepId
|
|
40500
|
+
});
|
|
40501
|
+
}
|
|
40502
|
+
case "delete":
|
|
40503
|
+
await adapter.modules.buildTypes.deleteBuildStep(
|
|
40504
|
+
typedArgs.buildTypeId,
|
|
40505
|
+
typedArgs.stepId
|
|
40506
|
+
);
|
|
40507
|
+
return json({
|
|
40508
|
+
success: true,
|
|
40509
|
+
action: "delete_build_step",
|
|
40510
|
+
buildTypeId: typedArgs.buildTypeId,
|
|
40511
|
+
stepId: typedArgs.stepId
|
|
40512
|
+
});
|
|
40513
|
+
default:
|
|
40514
|
+
return json({ success: false, error: "Invalid action" });
|
|
40489
40515
|
}
|
|
40490
|
-
|
|
40491
|
-
|
|
40492
|
-
|
|
40493
|
-
action: "delete_build_step",
|
|
40494
|
-
buildTypeId: typedArgs.buildTypeId,
|
|
40495
|
-
stepId: typedArgs.stepId
|
|
40496
|
-
});
|
|
40497
|
-
default:
|
|
40498
|
-
return json({ success: false, error: "Invalid action" });
|
|
40499
|
-
}
|
|
40516
|
+
},
|
|
40517
|
+
args
|
|
40518
|
+
);
|
|
40500
40519
|
},
|
|
40501
40520
|
mode: "full"
|
|
40502
40521
|
},
|