vme-mcp-server 0.1.10 → 0.1.13

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,68 +1,47 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toolHandlers = exports.allTools = exports.handleQueryResources = exports.queryResourcesTool = exports.handleGetCacheStatus = exports.getCacheStatusTool = exports.handleCheckCapability = exports.checkCapabilityTool = exports.handleDiscoverCapabilities = exports.discoverCapabilitiesTool = exports.handleProvideFeedback = exports.provideFeedbackTool = exports.handleExportTrainingData = exports.exportTrainingDataTool = exports.handleCreateVM = exports.createVMTool = exports.handleParseIntent = exports.parseIntentTool = exports.handleGetResources = exports.getResourcesTool = void 0;
4
- const parse_intent_js_1 = require("./parse-intent.js");
5
- const create_vm_js_1 = require("./create-vm.js");
6
- const export_training_data_js_1 = require("./export-training-data.js");
7
- const provide_feedback_js_1 = require("./provide-feedback.js");
1
+ import { parseIntentTool, handleParseIntent } from "./parse-intent.js";
2
+ import { createVMTool, handleCreateVM } from "./create-vm.js";
3
+ import { exportTrainingDataTool, handleExportTrainingData } from "./export-training-data.js";
4
+ import { provideFeedbackTool, handleProvideFeedback } from "./provide-feedback.js";
8
5
  // Sprint 2: Capability Discovery Tools
9
- const discover_capabilities_js_1 = require("./discover-capabilities.js");
10
- const check_capability_js_1 = require("./check-capability.js");
11
- const get_cache_status_js_1 = require("./get-cache-status.js");
12
- const query_resources_js_1 = require("./query-resources.js");
6
+ import { discoverCapabilitiesTool, handleDiscoverCapabilities } from "./discover-capabilities.js";
7
+ import { checkCapabilityTool, handleCheckCapability } from "./check-capability.js";
8
+ import { getCacheStatusTool, handleGetCacheStatus } from "./get-cache-status.js";
9
+ import { queryResourcesTool, handleQueryResources } from "./query-resources.js";
13
10
  // Re-export for external use
14
- var get_resources_js_1 = require("./get-resources.js");
15
- Object.defineProperty(exports, "getResourcesTool", { enumerable: true, get: function () { return get_resources_js_1.getResourcesTool; } });
16
- Object.defineProperty(exports, "handleGetResources", { enumerable: true, get: function () { return get_resources_js_1.handleGetResources; } });
17
- var parse_intent_js_2 = require("./parse-intent.js");
18
- Object.defineProperty(exports, "parseIntentTool", { enumerable: true, get: function () { return parse_intent_js_2.parseIntentTool; } });
19
- Object.defineProperty(exports, "handleParseIntent", { enumerable: true, get: function () { return parse_intent_js_2.handleParseIntent; } });
20
- var create_vm_js_2 = require("./create-vm.js");
21
- Object.defineProperty(exports, "createVMTool", { enumerable: true, get: function () { return create_vm_js_2.createVMTool; } });
22
- Object.defineProperty(exports, "handleCreateVM", { enumerable: true, get: function () { return create_vm_js_2.handleCreateVM; } });
23
- var export_training_data_js_2 = require("./export-training-data.js");
24
- Object.defineProperty(exports, "exportTrainingDataTool", { enumerable: true, get: function () { return export_training_data_js_2.exportTrainingDataTool; } });
25
- Object.defineProperty(exports, "handleExportTrainingData", { enumerable: true, get: function () { return export_training_data_js_2.handleExportTrainingData; } });
26
- var provide_feedback_js_2 = require("./provide-feedback.js");
27
- Object.defineProperty(exports, "provideFeedbackTool", { enumerable: true, get: function () { return provide_feedback_js_2.provideFeedbackTool; } });
28
- Object.defineProperty(exports, "handleProvideFeedback", { enumerable: true, get: function () { return provide_feedback_js_2.handleProvideFeedback; } });
29
- var discover_capabilities_js_2 = require("./discover-capabilities.js");
30
- Object.defineProperty(exports, "discoverCapabilitiesTool", { enumerable: true, get: function () { return discover_capabilities_js_2.discoverCapabilitiesTool; } });
31
- Object.defineProperty(exports, "handleDiscoverCapabilities", { enumerable: true, get: function () { return discover_capabilities_js_2.handleDiscoverCapabilities; } });
32
- var check_capability_js_2 = require("./check-capability.js");
33
- Object.defineProperty(exports, "checkCapabilityTool", { enumerable: true, get: function () { return check_capability_js_2.checkCapabilityTool; } });
34
- Object.defineProperty(exports, "handleCheckCapability", { enumerable: true, get: function () { return check_capability_js_2.handleCheckCapability; } });
35
- var get_cache_status_js_2 = require("./get-cache-status.js");
36
- Object.defineProperty(exports, "getCacheStatusTool", { enumerable: true, get: function () { return get_cache_status_js_2.getCacheStatusTool; } });
37
- Object.defineProperty(exports, "handleGetCacheStatus", { enumerable: true, get: function () { return get_cache_status_js_2.handleGetCacheStatus; } });
38
- var query_resources_js_2 = require("./query-resources.js");
39
- Object.defineProperty(exports, "queryResourcesTool", { enumerable: true, get: function () { return query_resources_js_2.queryResourcesTool; } });
40
- Object.defineProperty(exports, "handleQueryResources", { enumerable: true, get: function () { return query_resources_js_2.handleQueryResources; } });
11
+ export { getResourcesTool, handleGetResources } from "./get-resources.js";
12
+ export { parseIntentTool, handleParseIntent } from "./parse-intent.js";
13
+ export { createVMTool, handleCreateVM } from "./create-vm.js";
14
+ export { exportTrainingDataTool, handleExportTrainingData } from "./export-training-data.js";
15
+ export { provideFeedbackTool, handleProvideFeedback } from "./provide-feedback.js";
16
+ export { discoverCapabilitiesTool, handleDiscoverCapabilities } from "./discover-capabilities.js";
17
+ export { checkCapabilityTool, handleCheckCapability } from "./check-capability.js";
18
+ export { getCacheStatusTool, handleGetCacheStatus } from "./get-cache-status.js";
19
+ export { queryResourcesTool, handleQueryResources } from "./query-resources.js";
41
20
  // Collect all tool definitions
42
- exports.allTools = [
21
+ export const allTools = [
43
22
  // Sprint 1.5 tools
44
23
  // getResourcesTool, // DISABLED - caused 37K+ token responses, replaced by Sprint 2 capability discovery
45
- parse_intent_js_1.parseIntentTool,
46
- create_vm_js_1.createVMTool,
47
- export_training_data_js_1.exportTrainingDataTool,
48
- provide_feedback_js_1.provideFeedbackTool,
24
+ parseIntentTool,
25
+ createVMTool,
26
+ exportTrainingDataTool,
27
+ provideFeedbackTool,
49
28
  // Sprint 2 capability discovery tools
50
- discover_capabilities_js_1.discoverCapabilitiesTool,
51
- check_capability_js_1.checkCapabilityTool,
52
- get_cache_status_js_1.getCacheStatusTool,
53
- query_resources_js_1.queryResourcesTool
29
+ discoverCapabilitiesTool,
30
+ checkCapabilityTool,
31
+ getCacheStatusTool,
32
+ queryResourcesTool
54
33
  ];
55
34
  // Export tool handlers map for easy lookup
56
- exports.toolHandlers = {
35
+ export const toolHandlers = {
57
36
  // Sprint 1.5 handlers
58
37
  // get_resources: handleGetResources, // DISABLED - caused 37K+ token responses
59
- parse_vm_intent: parse_intent_js_1.handleParseIntent,
60
- create_vm: create_vm_js_1.handleCreateVM,
61
- export_training_data: export_training_data_js_1.handleExportTrainingData,
62
- provide_feedback: provide_feedback_js_1.handleProvideFeedback,
38
+ parse_vm_intent: handleParseIntent,
39
+ create_vm: handleCreateVM,
40
+ export_training_data: handleExportTrainingData,
41
+ provide_feedback: handleProvideFeedback,
63
42
  // Sprint 2 capability discovery handlers
64
- discover_capabilities: discover_capabilities_js_1.handleDiscoverCapabilities,
65
- check_capability: check_capability_js_1.handleCheckCapability,
66
- get_cache_status: get_cache_status_js_1.handleGetCacheStatus,
67
- query_resources: query_resources_js_1.handleQueryResources
43
+ discover_capabilities: handleDiscoverCapabilities,
44
+ check_capability: handleCheckCapability,
45
+ get_cache_status: handleGetCacheStatus,
46
+ query_resources: handleQueryResources
68
47
  };
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleParseIntent = exports.parseIntentTool = void 0;
4
- const intent_recognition_js_1 = require("../lib/intent-recognition.js");
5
- const session_js_1 = require("../lib/session.js");
6
- exports.parseIntentTool = {
1
+ import { parseVMIntent } from "../lib/intent-recognition.js";
2
+ import { generateSessionId, logInteraction } from "../lib/session.js";
3
+ export const parseIntentTool = {
7
4
  name: "parse_vm_intent",
8
5
  description: "Parse natural language VM requests into structured parameters with confidence scoring",
9
6
  inputSchema: {
@@ -17,14 +14,14 @@ exports.parseIntentTool = {
17
14
  required: ["naturalLanguageInput"]
18
15
  }
19
16
  };
20
- async function handleParseIntent(args) {
17
+ export async function handleParseIntent(args) {
21
18
  const startTime = Date.now();
22
19
  const { naturalLanguageInput } = args;
23
- const sessionId = (0, session_js_1.generateSessionId)();
24
- const parsedIntent = (0, intent_recognition_js_1.parseVMIntent)(naturalLanguageInput);
20
+ const sessionId = generateSessionId();
21
+ const parsedIntent = parseVMIntent(naturalLanguageInput);
25
22
  const parseTime = Date.now() - startTime;
26
23
  // Log interaction for AI training (respects privacy settings)
27
- (0, session_js_1.logInteraction)({
24
+ logInteraction({
28
25
  session_id: sessionId,
29
26
  tool_name: 'parse_vm_intent',
30
27
  user_input: { naturalLanguageInput },
@@ -49,4 +46,3 @@ async function handleParseIntent(args) {
49
46
  isError: parsedIntent.action === 'unknown' && parsedIntent.confidence < 0.3
50
47
  };
51
48
  }
52
- exports.handleParseIntent = handleParseIntent;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleProvideFeedback = exports.provideFeedbackTool = void 0;
4
- const session_js_1 = require("../lib/session.js");
5
- exports.provideFeedbackTool = {
1
+ import { generateSessionId, logInteraction } from "../lib/session.js";
2
+ export const provideFeedbackTool = {
6
3
  name: "provide_feedback",
7
4
  description: "Provide feedback on intent parsing accuracy to improve future predictions",
8
5
  inputSchema: {
@@ -28,11 +25,11 @@ exports.provideFeedbackTool = {
28
25
  required: ["original_input", "feedback_notes"]
29
26
  }
30
27
  };
31
- async function handleProvideFeedback(args) {
28
+ export async function handleProvideFeedback(args) {
32
29
  const { original_input, parsed_result, correct_interpretation, feedback_notes } = args;
33
- const sessionId = (0, session_js_1.generateSessionId)();
30
+ const sessionId = generateSessionId();
34
31
  // Log feedback for future model improvements
35
- (0, session_js_1.logInteraction)({
32
+ logInteraction({
36
33
  session_id: sessionId,
37
34
  tool_name: 'provide_feedback',
38
35
  user_input: { original_input, feedback_notes },
@@ -58,4 +55,3 @@ async function handleProvideFeedback(args) {
58
55
  isError: false
59
56
  };
60
57
  }
61
- exports.handleProvideFeedback = handleProvideFeedback;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleQueryResources = exports.queryResourcesTool = void 0;
4
- const api_utils_js_1 = require("../lib/api-utils.js");
5
- exports.queryResourcesTool = {
1
+ import { api } from "../lib/api-utils.js";
2
+ export const queryResourcesTool = {
6
3
  name: "query_resources",
7
4
  description: "Query actual infrastructure resources (VMs, cluster nodes, networks) with natural language. Supports network placement queries. ⚡ TIP: Run discover_capabilities first to learn available OS types, groups, and statuses in your environment.",
8
5
  inputSchema: {
@@ -280,7 +277,7 @@ function formatResponse(parsedQuery, results, totalCount, detailLevel = 2) {
280
277
  query_summary: `Showing ${limitedResults.length} of ${results.length} ${resource} matching criteria`
281
278
  };
282
279
  }
283
- async function handleQueryResources(args) {
280
+ export async function handleQueryResources(args) {
284
281
  try {
285
282
  const { natural_query, limit = 10, detail_level = 2 } = args;
286
283
  if (!natural_query || typeof natural_query !== 'string') {
@@ -308,7 +305,7 @@ async function handleQueryResources(args) {
308
305
  };
309
306
  const endpoint = endpointMap[parsedQuery.resource];
310
307
  // Query the VME API
311
- const response = await api_utils_js_1.api.get(endpoint);
308
+ const response = await api.get(endpoint);
312
309
  // Extract data array from response
313
310
  let rawData = [];
314
311
  if (parsedQuery.resource === 'instances' && response.data.instances) {
@@ -368,4 +365,3 @@ async function handleQueryResources(args) {
368
365
  };
369
366
  }
370
367
  }
371
- exports.handleQueryResources = handleQueryResources;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vme-mcp-server",
3
- "version": "0.1.10",
3
+ "version": "0.1.13",
4
4
  "description": "",
5
5
  "main": "dist/server.js",
6
6
  "bin": {
@@ -11,7 +11,7 @@
11
11
  "start": "node dist/server.js",
12
12
  "dev": "tsx watch src/server.ts",
13
13
  "prepare": "husky install",
14
- "prepublishOnly": "npm run build && echo '#!/usr/bin/env node' | cat - dist/server.js > temp && mv temp dist/server.js && chmod +x dist/server.js && cp README-NPM.md dist/README.md",
14
+ "prepublishOnly": "npm run build && chmod +x dist/server.js && cp README-NPM.md dist/README.md",
15
15
  "test": "npm run test:critical",
16
16
  "test:unit": "mocha tests/unit/*.test.js",
17
17
  "test:binary": "mocha tests/binary/*.test.js",
@@ -22,7 +22,7 @@
22
22
  "test:all": "mocha tests/**/*.test.js",
23
23
  "test:coverage": "nyc mocha tests/**/*.test.js",
24
24
  "lint": "echo 'Linting not configured yet'",
25
- "precommit": "npm run lint && npm run test:critical && npm run build"
25
+ "precommit": "npm run lint && npm run test:critical && npm run build && npm run test:package"
26
26
  },
27
27
  "keywords": [
28
28
  "mcp",