@vfarcic/dot-ai 0.14.0 → 0.15.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.
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/interfaces/mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAoCtC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,gBAAgB,CAAa;gBAEzB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe;IA2BjD;;OAEG;IACH,OAAO,CAAC,aAAa;IAyErB,OAAO,CAAC,iBAAiB;IAKnB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B,OAAO,IAAI,OAAO;CAGnB"}
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/interfaces/mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AA0CtC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,gBAAgB,CAAa;gBAEzB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe;IA2BjD;;OAEG;IACH,OAAO,CAAC,aAAa;IAsFrB,OAAO,CAAC,iBAAiB;IAKnB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B,OAAO,IAAI,OAAO;CAGnB"}
@@ -15,6 +15,7 @@ const choose_solution_1 = require("../tools/choose-solution");
15
15
  const answer_question_1 = require("../tools/answer-question");
16
16
  const generate_manifests_1 = require("../tools/generate-manifests");
17
17
  const deploy_manifests_1 = require("../tools/deploy-manifests");
18
+ const version_1 = require("../tools/version");
18
19
  class MCPServer {
19
20
  server;
20
21
  dotAI;
@@ -75,15 +76,22 @@ class MCPServer {
75
76
  this.logger.info(`Processing ${deploy_manifests_1.DEPLOYMANIFESTS_TOOL_NAME} tool request`, { requestId });
76
77
  return await (0, deploy_manifests_1.handleDeployManifestsTool)(args, this.dotAI, this.logger, requestId);
77
78
  });
79
+ // Register version tool
80
+ this.server.tool(version_1.VERSION_TOOL_NAME, version_1.VERSION_TOOL_DESCRIPTION, version_1.VERSION_TOOL_INPUT_SCHEMA, async (args) => {
81
+ const requestId = this.generateRequestId();
82
+ this.logger.info(`Processing ${version_1.VERSION_TOOL_NAME} tool request`, { requestId });
83
+ return await (0, version_1.handleVersionTool)(args, this.logger, requestId);
84
+ });
78
85
  this.logger.info('Registered all tools with McpServer', {
79
86
  tools: [
80
87
  recommend_1.RECOMMEND_TOOL_NAME,
81
88
  choose_solution_1.CHOOSESOLUTION_TOOL_NAME,
82
89
  answer_question_1.ANSWERQUESTION_TOOL_NAME,
83
90
  generate_manifests_1.GENERATEMANIFESTS_TOOL_NAME,
84
- deploy_manifests_1.DEPLOYMANIFESTS_TOOL_NAME
91
+ deploy_manifests_1.DEPLOYMANIFESTS_TOOL_NAME,
92
+ version_1.VERSION_TOOL_NAME
85
93
  ],
86
- totalTools: 5
94
+ totalTools: 6
87
95
  });
88
96
  }
89
97
  generateRequestId() {
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Version tool for MCP server
3
+ *
4
+ * Provides version information for debugging and validation
5
+ */
6
+ import { Logger } from '../core/error-handling';
7
+ export declare const VERSION_TOOL_NAME = "version";
8
+ export declare const VERSION_TOOL_DESCRIPTION = "Get version information for the DevOps AI Toolkit MCP server";
9
+ export declare const VERSION_TOOL_INPUT_SCHEMA: {
10
+ type: string;
11
+ properties: {};
12
+ required: never[];
13
+ additionalProperties: boolean;
14
+ };
15
+ export interface VersionInfo {
16
+ version: string;
17
+ gitCommit?: string;
18
+ gitBranch?: string;
19
+ buildTime: string;
20
+ nodeVersion: string;
21
+ platform: string;
22
+ arch: string;
23
+ }
24
+ /**
25
+ * Get version information from package.json and git
26
+ */
27
+ export declare function getVersionInfo(): VersionInfo;
28
+ /**
29
+ * Handle version tool request
30
+ */
31
+ export declare function handleVersionTool(args: any, logger: Logger, requestId: string): Promise<any>;
32
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/tools/version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,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,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAyB5C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAuBd"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ /**
3
+ * Version tool for MCP server
4
+ *
5
+ * Provides version information for debugging and validation
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.VERSION_TOOL_INPUT_SCHEMA = exports.VERSION_TOOL_DESCRIPTION = exports.VERSION_TOOL_NAME = void 0;
9
+ exports.getVersionInfo = getVersionInfo;
10
+ exports.handleVersionTool = handleVersionTool;
11
+ const fs_1 = require("fs");
12
+ const path_1 = require("path");
13
+ const child_process_1 = require("child_process");
14
+ exports.VERSION_TOOL_NAME = 'version';
15
+ exports.VERSION_TOOL_DESCRIPTION = 'Get version information for the DevOps AI Toolkit MCP server';
16
+ exports.VERSION_TOOL_INPUT_SCHEMA = {
17
+ type: 'object',
18
+ properties: {},
19
+ required: [],
20
+ additionalProperties: false
21
+ };
22
+ /**
23
+ * Get version information from package.json and git
24
+ */
25
+ function getVersionInfo() {
26
+ // Read package.json version
27
+ const packageJsonPath = (0, path_1.join)(process.cwd(), 'package.json');
28
+ const packageJson = JSON.parse((0, fs_1.readFileSync)(packageJsonPath, 'utf8'));
29
+ // Get git information
30
+ let gitCommit;
31
+ let gitBranch;
32
+ try {
33
+ gitCommit = (0, child_process_1.execSync)('git rev-parse HEAD', { encoding: 'utf8' }).trim();
34
+ gitBranch = (0, child_process_1.execSync)('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' }).trim();
35
+ }
36
+ catch (error) {
37
+ // Git info not available (e.g., not a git repo or git not installed)
38
+ }
39
+ return {
40
+ version: packageJson.version,
41
+ gitCommit,
42
+ gitBranch,
43
+ buildTime: new Date().toISOString(),
44
+ nodeVersion: process.version,
45
+ platform: process.platform,
46
+ arch: process.arch
47
+ };
48
+ }
49
+ /**
50
+ * Handle version tool request
51
+ */
52
+ async function handleVersionTool(args, logger, requestId) {
53
+ try {
54
+ logger.info('Processing version tool request', { requestId });
55
+ const versionInfo = getVersionInfo();
56
+ logger.info('Version tool request completed', { requestId, version: versionInfo.version });
57
+ return {
58
+ status: 'success',
59
+ versionInfo,
60
+ timestamp: new Date().toISOString()
61
+ };
62
+ }
63
+ catch (error) {
64
+ const errorMessage = error instanceof Error ? error.message : String(error);
65
+ logger.error('Version tool request failed', error);
66
+ return {
67
+ status: 'error',
68
+ error: errorMessage,
69
+ timestamp: new Date().toISOString()
70
+ };
71
+ }
72
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vfarcic/dot-ai",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Universal Kubernetes application deployment agent with CLI and MCP interfaces",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",