@vfarcic/dot-ai 0.20.0 → 0.22.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/dist/tools/version.d.ts +1 -4
- package/dist/tools/version.d.ts.map +1 -1
- package/dist/tools/version.js +10 -14
- package/package.json +1 -1
package/dist/tools/version.d.ts
CHANGED
|
@@ -14,15 +14,12 @@ export declare const VERSION_TOOL_INPUT_SCHEMA: {
|
|
|
14
14
|
};
|
|
15
15
|
export interface VersionInfo {
|
|
16
16
|
version: string;
|
|
17
|
-
gitCommit?: string;
|
|
18
|
-
gitBranch?: string;
|
|
19
|
-
buildTime: string;
|
|
20
17
|
nodeVersion: string;
|
|
21
18
|
platform: string;
|
|
22
19
|
arch: string;
|
|
23
20
|
}
|
|
24
21
|
/**
|
|
25
|
-
* Get version information from package.json
|
|
22
|
+
* Get version information from package.json
|
|
26
23
|
*/
|
|
27
24
|
export declare function getVersionInfo(): VersionInfo;
|
|
28
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/tools/version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/tools/version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,wBAAwB,iEAAiE,CAAC;AACvG,eAAO,MAAM,yBAAyB;;;;;CAKrC,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAqB5C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAuBd"}
|
package/dist/tools/version.js
CHANGED
|
@@ -10,7 +10,6 @@ exports.getVersionInfo = getVersionInfo;
|
|
|
10
10
|
exports.handleVersionTool = handleVersionTool;
|
|
11
11
|
const fs_1 = require("fs");
|
|
12
12
|
const path_1 = require("path");
|
|
13
|
-
const child_process_1 = require("child_process");
|
|
14
13
|
exports.VERSION_TOOL_NAME = 'version';
|
|
15
14
|
exports.VERSION_TOOL_DESCRIPTION = 'Get version information for the DevOps AI Toolkit MCP server';
|
|
16
15
|
exports.VERSION_TOOL_INPUT_SCHEMA = {
|
|
@@ -20,27 +19,24 @@ exports.VERSION_TOOL_INPUT_SCHEMA = {
|
|
|
20
19
|
additionalProperties: false
|
|
21
20
|
};
|
|
22
21
|
/**
|
|
23
|
-
* Get version information from package.json
|
|
22
|
+
* Get version information from package.json
|
|
24
23
|
*/
|
|
25
24
|
function getVersionInfo() {
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
const packageJson = JSON.parse((0, fs_1.readFileSync)(packageJsonPath, 'utf8'));
|
|
29
|
-
// Get git information
|
|
30
|
-
let gitCommit;
|
|
31
|
-
let gitBranch;
|
|
25
|
+
// Find package.json relative to this module's location (MCP server's installation)
|
|
26
|
+
let packageJson;
|
|
32
27
|
try {
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
// Get the directory where this module is installed
|
|
29
|
+
// __dirname points to the compiled JS location (dist/tools/), go up two levels to find package.json
|
|
30
|
+
const mcpServerDir = (0, path_1.join)(__dirname, '..', '..');
|
|
31
|
+
const packageJsonPath = (0, path_1.join)(mcpServerDir, 'package.json');
|
|
32
|
+
packageJson = JSON.parse((0, fs_1.readFileSync)(packageJsonPath, 'utf8'));
|
|
35
33
|
}
|
|
36
34
|
catch (error) {
|
|
37
|
-
//
|
|
35
|
+
// If package.json not found, use unknown version
|
|
36
|
+
packageJson = { version: 'unknown' };
|
|
38
37
|
}
|
|
39
38
|
return {
|
|
40
39
|
version: packageJson.version,
|
|
41
|
-
gitCommit,
|
|
42
|
-
gitBranch,
|
|
43
|
-
buildTime: new Date().toISOString(),
|
|
44
40
|
nodeVersion: process.version,
|
|
45
41
|
platform: process.platform,
|
|
46
42
|
arch: process.arch
|