@vfarcic/dot-ai 0.14.0 → 0.16.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() {
@@ -1 +1 @@
1
- {"version":3,"file":"answer-question.d.ts","sourceRoot":"","sources":["../../src/tools/answer-question.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAMhD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AACzD,eAAO,MAAM,+BAA+B,8HAA4H,CAAC;AAGzK,eAAO,MAAM,gCAAgC;;;;CAI5C,CAAC;AA6eF;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,EAC7G,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAmTxD"}
1
+ {"version":3,"file":"answer-question.d.ts","sourceRoot":"","sources":["../../src/tools/answer-question.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAMhD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AACzD,eAAO,MAAM,+BAA+B,8HAA4H,CAAC;AAGzK,eAAO,MAAM,gCAAgC;;;;CAI5C,CAAC;AA+eF;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,EAC7G,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAmTxD"}
@@ -157,17 +157,18 @@ function validateAnswer(answer, question) {
157
157
  * Get anti-cascade agent instructions for stage responses
158
158
  */
159
159
  function getAgentInstructions(stage) {
160
+ const antiCascadeRule = 'CRITICAL ANTI-CASCADE RULE: When user says "skip" for ANY stage, only skip THAT specific stage and present the NEXT stage questions to the user. NEVER automatically skip multiple stages in sequence.';
160
161
  switch (stage) {
161
162
  case 'required':
162
- return 'CRITICAL: Present these required questions to the user. All must be answered before proceeding.';
163
+ return `${antiCascadeRule} Present these required questions to the user. All must be answered before proceeding.`;
163
164
  case 'basic':
164
- return 'CRITICAL: Present these questions to the user and wait for their response. Do NOT skip this stage unless the user explicitly says to skip THIS specific stage.';
165
+ return `${antiCascadeRule} Present these questions to the user and wait for their response. Do NOT skip this stage unless the user explicitly says to skip THIS specific stage.`;
165
166
  case 'advanced':
166
- return 'CRITICAL: Present these questions to the user and wait for their response. Do NOT skip this stage unless the user explicitly says to skip THIS specific stage.';
167
+ return `${antiCascadeRule} Present these questions to the user and wait for their response. Do NOT skip this stage unless the user explicitly says to skip THIS specific stage.`;
167
168
  case 'open':
168
- return 'CRITICAL: This is the final configuration stage. Present these questions to the user. Use "N/A" only if user explicitly states no additional requirements.';
169
+ return `${antiCascadeRule} This is the final configuration stage. Present these questions to the user and wait for their response. Use "N/A" only if user explicitly states no additional requirements.`;
169
170
  default:
170
- return 'Present questions to the user and wait for their response.';
171
+ return `${antiCascadeRule} Present questions to the user and wait for their response.`;
171
172
  }
172
173
  }
173
174
  /**
@@ -321,7 +322,7 @@ function getStageGuidance(stage) {
321
322
  case 'advanced':
322
323
  return 'Answer questions in this stage or skip to proceed to the open stage. Do NOT try to generate manifests yet.';
323
324
  case 'open':
324
- return 'Use "N/A" if you have no additional requirements. Complete this stage before generating manifests. IMPORTANT: This is the final configuration stage - do not skip.';
325
+ return 'Use "N/A" if you have no additional requirements. Complete this stage before generating manifests.';
325
326
  default:
326
327
  return 'Please provide answers for this stage.';
327
328
  }
@@ -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.16.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",