@daghis/teamcity-mcp 1.3.5 → 1.4.0
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 +34 -6
- 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.4.0](https://github.com/Daghis/teamcity-mcp/compare/v1.3.5...v1.4.0) (2025-09-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **tests:** add batched mcp tool execution ([#163](https://github.com/Daghis/teamcity-mcp/issues/163)) ([5f48060](https://github.com/Daghis/teamcity-mcp/commit/5f4806043b95686d5dac41a9d67515740b82a3f8)), closes [#162](https://github.com/Daghis/teamcity-mcp/issues/162)
|
|
9
|
+
|
|
3
10
|
## [1.3.5](https://github.com/Daghis/teamcity-mcp/compare/v1.3.4...v1.3.5) (2025-09-19)
|
|
4
11
|
|
|
5
12
|
|
package/dist/index.js
CHANGED
|
@@ -1621,7 +1621,14 @@ var BuildResultsManager = class _BuildResultsManager {
|
|
|
1621
1621
|
{ responseType: "arraybuffer" }
|
|
1622
1622
|
);
|
|
1623
1623
|
const axiosResponse = response;
|
|
1624
|
-
|
|
1624
|
+
const { data } = axiosResponse;
|
|
1625
|
+
if (data instanceof ArrayBuffer) {
|
|
1626
|
+
return data.slice(0);
|
|
1627
|
+
}
|
|
1628
|
+
if (Buffer.isBuffer(data)) {
|
|
1629
|
+
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
1630
|
+
}
|
|
1631
|
+
throw new Error("Artifact download returned unexpected binary payload type");
|
|
1625
1632
|
}
|
|
1626
1633
|
/**
|
|
1627
1634
|
* Parse TeamCity date format
|
|
@@ -1695,12 +1702,24 @@ var BuildResultsManager = class _BuildResultsManager {
|
|
|
1695
1702
|
// src/teamcity/client-adapter.ts
|
|
1696
1703
|
var import_axios = __toESM(require("axios"));
|
|
1697
1704
|
var FALLBACK_BASE_URL = "http://not-configured";
|
|
1705
|
+
var toRecord = (value) => {
|
|
1706
|
+
if (typeof value === "object" && value !== null) {
|
|
1707
|
+
return value;
|
|
1708
|
+
}
|
|
1709
|
+
return {};
|
|
1710
|
+
};
|
|
1711
|
+
var createBuildApiBridge = (api) => ({
|
|
1712
|
+
getAllBuilds: (locator, fields, options) => api.getAllBuilds(locator, fields, options),
|
|
1713
|
+
getBuild: (buildLocator, fields, options) => api.getBuild(buildLocator, fields, options),
|
|
1714
|
+
getMultipleBuilds: (locator, fields, options) => api.getMultipleBuilds(locator, fields, options),
|
|
1715
|
+
getBuildProblems: (buildLocator, fields, options) => api.getBuildProblems(buildLocator, fields, options)
|
|
1716
|
+
});
|
|
1698
1717
|
var resolveModules = (api) => {
|
|
1699
1718
|
const candidate = api.modules;
|
|
1700
1719
|
if (candidate != null) {
|
|
1701
1720
|
return candidate;
|
|
1702
1721
|
}
|
|
1703
|
-
const legacy = api;
|
|
1722
|
+
const legacy = toRecord(api);
|
|
1704
1723
|
const pick = (key) => legacy[key] ?? {};
|
|
1705
1724
|
const fallback = {
|
|
1706
1725
|
agents: pick("agents"),
|
|
@@ -1762,7 +1781,7 @@ function createAdapterFromTeamCityAPI(api, options = {}) {
|
|
|
1762
1781
|
});
|
|
1763
1782
|
}
|
|
1764
1783
|
const request = async (fn) => fn({ axios: httpInstance, baseUrl: resolvedApiConfig.baseUrl, requestId: void 0 });
|
|
1765
|
-
const buildApi = modules.builds;
|
|
1784
|
+
const buildApi = createBuildApiBridge(modules.builds);
|
|
1766
1785
|
return {
|
|
1767
1786
|
modules,
|
|
1768
1787
|
http: httpInstance,
|
|
@@ -2483,6 +2502,12 @@ var esm_default = axiosRetry;
|
|
|
2483
2502
|
// src/teamcity/auth.ts
|
|
2484
2503
|
var import_crypto = require("crypto");
|
|
2485
2504
|
init_errors();
|
|
2505
|
+
var asTimingMetaContainer = (value) => {
|
|
2506
|
+
if (typeof value === "object" && value !== null) {
|
|
2507
|
+
return value;
|
|
2508
|
+
}
|
|
2509
|
+
return null;
|
|
2510
|
+
};
|
|
2486
2511
|
function generateRequestId() {
|
|
2487
2512
|
return (0, import_crypto.randomUUID)();
|
|
2488
2513
|
}
|
|
@@ -2491,7 +2516,10 @@ function addRequestId(config2) {
|
|
|
2491
2516
|
config2.headers["X-Request-ID"] = requestId;
|
|
2492
2517
|
const configWithId = config2;
|
|
2493
2518
|
configWithId.requestId = requestId;
|
|
2494
|
-
|
|
2519
|
+
const metaContainer = asTimingMetaContainer(config2);
|
|
2520
|
+
if (metaContainer) {
|
|
2521
|
+
metaContainer._tcMeta = { start: Date.now() };
|
|
2522
|
+
}
|
|
2495
2523
|
info("Starting TeamCity API request", {
|
|
2496
2524
|
requestId,
|
|
2497
2525
|
method: config2.method?.toUpperCase(),
|
|
@@ -2505,7 +2533,7 @@ function addRequestId(config2) {
|
|
|
2505
2533
|
}
|
|
2506
2534
|
function logResponse(response) {
|
|
2507
2535
|
const requestId = response.config?.requestId;
|
|
2508
|
-
const meta = response.config
|
|
2536
|
+
const meta = asTimingMetaContainer(response.config)?._tcMeta;
|
|
2509
2537
|
const headers = response.headers;
|
|
2510
2538
|
const headerDuration = headers?.["x-response-time"] ?? headers?.["x-response-duration"];
|
|
2511
2539
|
const duration = headerDuration ?? (meta?.start ? Date.now() - meta.start : void 0);
|
|
@@ -2521,7 +2549,7 @@ function logResponse(response) {
|
|
|
2521
2549
|
function logAndTransformError(error2) {
|
|
2522
2550
|
const requestId = error2.config?.requestId;
|
|
2523
2551
|
const tcError = TeamCityAPIError.fromAxiosError(error2, requestId);
|
|
2524
|
-
const meta = error2.config?._tcMeta;
|
|
2552
|
+
const meta = asTimingMetaContainer(error2.config)?._tcMeta;
|
|
2525
2553
|
const duration = meta?.start ? Date.now() - meta.start : void 0;
|
|
2526
2554
|
const sanitize = (val) => {
|
|
2527
2555
|
const redact = (s) => s.replace(/(token[=:\s]*)[^\s&]+/gi, "$1***").replace(/(password[=:\s]*)[^\s&]+/gi, "$1***").replace(/(apikey[=:\s]*)[^\s&]+/gi, "$1***").replace(/(authorization[=:\s:]*)[^\s&]+/gi, "$1***");
|