@vfarcic/dot-ai 0.44.0 → 0.46.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/README.md +33 -8
- package/dist/core/cluster-utils.d.ts +12 -0
- package/dist/core/cluster-utils.d.ts.map +1 -0
- package/dist/core/cluster-utils.js +27 -0
- package/dist/core/embedding-service.d.ts +80 -0
- package/dist/core/embedding-service.d.ts.map +1 -0
- package/dist/core/embedding-service.js +198 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +27 -1
- package/dist/core/pattern-creation-session.d.ts +43 -0
- package/dist/core/pattern-creation-session.d.ts.map +1 -0
- package/dist/core/pattern-creation-session.js +312 -0
- package/dist/core/pattern-creation-types.d.ts +30 -0
- package/dist/core/pattern-creation-types.d.ts.map +1 -0
- package/dist/core/pattern-creation-types.js +8 -0
- package/dist/core/pattern-operations.d.ts +11 -0
- package/dist/core/pattern-operations.d.ts.map +1 -0
- package/dist/core/pattern-operations.js +74 -0
- package/dist/core/pattern-types.d.ts +17 -0
- package/dist/core/pattern-types.d.ts.map +1 -0
- package/dist/core/pattern-types.js +8 -0
- package/dist/core/pattern-vector-service.d.ts +97 -0
- package/dist/core/pattern-vector-service.d.ts.map +1 -0
- package/dist/core/pattern-vector-service.js +302 -0
- package/dist/core/schema.d.ts +43 -0
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +176 -9
- package/dist/core/vector-db-service.d.ts +81 -0
- package/dist/core/vector-db-service.d.ts.map +1 -0
- package/dist/core/vector-db-service.js +299 -0
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +10 -2
- package/dist/mcp/server.js +7 -11
- package/dist/tools/deploy-manifests.d.ts.map +1 -1
- package/dist/tools/deploy-manifests.js +3 -0
- package/dist/tools/generate-manifests.d.ts.map +1 -1
- package/dist/tools/generate-manifests.js +3 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -1
- package/dist/tools/organizational-data.d.ts +27 -0
- package/dist/tools/organizational-data.d.ts.map +1 -0
- package/dist/tools/organizational-data.js +470 -0
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +16 -2
- package/dist/tools/version.d.ts +26 -3
- package/dist/tools/version.d.ts.map +1 -1
- package/dist/tools/version.js +161 -8
- package/package.json +3 -1
- package/prompts/concept-extraction.md +91 -0
- package/prompts/doc-testing-test-section.md +78 -226
- package/prompts/resource-selection.md +4 -0
- package/prompts/resource-solution-ranking.md +66 -2
- package/shared-prompts/prd-start.md +68 -3
- package/shared-prompts/prd-update-progress.md +50 -4
package/dist/tools/version.js
CHANGED
|
@@ -2,22 +2,145 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Version tool for MCP server
|
|
4
4
|
*
|
|
5
|
-
* Provides
|
|
5
|
+
* Provides comprehensive system status including version information,
|
|
6
|
+
* Vector DB connection status, and embedding service capabilities
|
|
6
7
|
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
7
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
42
|
exports.VERSION_TOOL_INPUT_SCHEMA = exports.VERSION_TOOL_DESCRIPTION = exports.VERSION_TOOL_NAME = void 0;
|
|
9
43
|
exports.getVersionInfo = getVersionInfo;
|
|
10
44
|
exports.handleVersionTool = handleVersionTool;
|
|
11
45
|
const fs_1 = require("fs");
|
|
12
46
|
const path_1 = require("path");
|
|
47
|
+
const index_1 = require("../core/index");
|
|
13
48
|
exports.VERSION_TOOL_NAME = 'version';
|
|
14
|
-
exports.VERSION_TOOL_DESCRIPTION = 'Get version information
|
|
49
|
+
exports.VERSION_TOOL_DESCRIPTION = 'Get comprehensive system status including version information, Vector DB connection status, embedding service capabilities, Anthropic API connectivity, and pattern management health check';
|
|
15
50
|
exports.VERSION_TOOL_INPUT_SCHEMA = {
|
|
16
51
|
type: 'object',
|
|
17
52
|
properties: {},
|
|
18
53
|
required: [],
|
|
19
54
|
additionalProperties: false
|
|
20
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Test Vector DB connectivity and get status
|
|
58
|
+
*/
|
|
59
|
+
async function getVectorDBStatus() {
|
|
60
|
+
const vectorDB = new index_1.VectorDBService();
|
|
61
|
+
const config = vectorDB.getConfig();
|
|
62
|
+
try {
|
|
63
|
+
const isHealthy = await vectorDB.healthCheck();
|
|
64
|
+
if (!isHealthy) {
|
|
65
|
+
return {
|
|
66
|
+
connected: false,
|
|
67
|
+
url: config.url || 'unknown',
|
|
68
|
+
collectionName: config.collectionName || 'patterns',
|
|
69
|
+
error: 'Health check failed - Vector DB not responding'
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// Try to get patterns count to verify collection access
|
|
73
|
+
const embeddingService = new index_1.EmbeddingService();
|
|
74
|
+
const patternService = new index_1.PatternVectorService(vectorDB, embeddingService);
|
|
75
|
+
let patternsCount;
|
|
76
|
+
try {
|
|
77
|
+
patternsCount = await patternService.getPatternsCount();
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
// Collection might not exist yet - that's okay
|
|
81
|
+
patternsCount = 0;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
connected: true,
|
|
85
|
+
url: config.url || 'unknown',
|
|
86
|
+
collectionName: config.collectionName || 'patterns',
|
|
87
|
+
patternsCount
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
return {
|
|
92
|
+
connected: false,
|
|
93
|
+
url: config.url || 'unknown',
|
|
94
|
+
collectionName: config.collectionName || 'patterns',
|
|
95
|
+
error: error instanceof Error ? error.message : String(error)
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Test embedding service status
|
|
101
|
+
*/
|
|
102
|
+
async function getEmbeddingStatus() {
|
|
103
|
+
const embeddingService = new index_1.EmbeddingService();
|
|
104
|
+
const status = embeddingService.getStatus();
|
|
105
|
+
return {
|
|
106
|
+
available: status.available,
|
|
107
|
+
provider: status.provider,
|
|
108
|
+
model: status.model,
|
|
109
|
+
dimensions: status.dimensions,
|
|
110
|
+
reason: status.reason
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Test Anthropic API connectivity
|
|
115
|
+
*/
|
|
116
|
+
async function getAnthropicStatus() {
|
|
117
|
+
const keyConfigured = !!process.env.ANTHROPIC_API_KEY;
|
|
118
|
+
if (!keyConfigured) {
|
|
119
|
+
return {
|
|
120
|
+
connected: false,
|
|
121
|
+
keyConfigured: false,
|
|
122
|
+
error: 'ANTHROPIC_API_KEY environment variable not set'
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
try {
|
|
126
|
+
// Import Claude integration and test a simple connection
|
|
127
|
+
const { ClaudeIntegration } = await Promise.resolve().then(() => __importStar(require('../core/claude')));
|
|
128
|
+
const claude = new ClaudeIntegration(process.env.ANTHROPIC_API_KEY);
|
|
129
|
+
// Test with a minimal request to check connectivity
|
|
130
|
+
await claude.sendMessage('test');
|
|
131
|
+
return {
|
|
132
|
+
connected: true,
|
|
133
|
+
keyConfigured: true
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
return {
|
|
138
|
+
connected: false,
|
|
139
|
+
keyConfigured: true,
|
|
140
|
+
error: error instanceof Error ? error.message : String(error)
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
21
144
|
/**
|
|
22
145
|
* Get version information from package.json
|
|
23
146
|
*/
|
|
@@ -43,19 +166,49 @@ function getVersionInfo() {
|
|
|
43
166
|
};
|
|
44
167
|
}
|
|
45
168
|
/**
|
|
46
|
-
* Handle version tool request
|
|
169
|
+
* Handle version tool request with comprehensive system diagnostics
|
|
47
170
|
*/
|
|
48
171
|
async function handleVersionTool(args, logger, requestId) {
|
|
49
172
|
try {
|
|
50
|
-
logger.info('Processing version tool request', { requestId });
|
|
51
|
-
|
|
52
|
-
|
|
173
|
+
logger.info('Processing version tool request with system diagnostics', { requestId });
|
|
174
|
+
// Get version info
|
|
175
|
+
const version = getVersionInfo();
|
|
176
|
+
// Run all diagnostics in parallel for better performance
|
|
177
|
+
logger.info('Running system diagnostics...', { requestId });
|
|
178
|
+
const [vectorDBStatus, embeddingStatus, anthropicStatus] = await Promise.all([
|
|
179
|
+
getVectorDBStatus(),
|
|
180
|
+
getEmbeddingStatus(),
|
|
181
|
+
getAnthropicStatus()
|
|
182
|
+
]);
|
|
183
|
+
const systemStatus = {
|
|
184
|
+
version,
|
|
185
|
+
vectorDB: vectorDBStatus,
|
|
186
|
+
embedding: embeddingStatus,
|
|
187
|
+
anthropic: anthropicStatus
|
|
188
|
+
};
|
|
189
|
+
// Log summary of system health
|
|
190
|
+
logger.info('System diagnostics completed', {
|
|
191
|
+
requestId,
|
|
192
|
+
version: version.version,
|
|
193
|
+
vectorDBConnected: vectorDBStatus.connected,
|
|
194
|
+
embeddingAvailable: embeddingStatus.available,
|
|
195
|
+
anthropicConnected: anthropicStatus.connected
|
|
196
|
+
});
|
|
53
197
|
return {
|
|
54
198
|
content: [{
|
|
55
199
|
type: 'text',
|
|
56
200
|
text: JSON.stringify({
|
|
57
201
|
status: 'success',
|
|
58
|
-
|
|
202
|
+
system: systemStatus,
|
|
203
|
+
summary: {
|
|
204
|
+
overall: vectorDBStatus.connected && anthropicStatus.connected ? 'healthy' : 'degraded',
|
|
205
|
+
patternSearch: embeddingStatus.available ? 'semantic+keyword' : 'keyword-only',
|
|
206
|
+
capabilities: [
|
|
207
|
+
vectorDBStatus.connected ? 'pattern-management' : null,
|
|
208
|
+
embeddingStatus.available ? 'semantic-search' : null,
|
|
209
|
+
anthropicStatus.connected ? 'ai-recommendations' : null
|
|
210
|
+
].filter(Boolean)
|
|
211
|
+
},
|
|
59
212
|
timestamp: new Date().toISOString()
|
|
60
213
|
}, null, 2)
|
|
61
214
|
}]
|
|
@@ -63,7 +216,7 @@ async function handleVersionTool(args, logger, requestId) {
|
|
|
63
216
|
}
|
|
64
217
|
catch (error) {
|
|
65
218
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
66
|
-
logger.error('Version tool request failed', error);
|
|
219
|
+
logger.error('Version tool request failed', error, { requestId });
|
|
67
220
|
return {
|
|
68
221
|
content: [{
|
|
69
222
|
type: 'text',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfarcic/dot-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.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",
|
|
@@ -86,10 +86,12 @@
|
|
|
86
86
|
"@anthropic-ai/sdk": "^0.27.0",
|
|
87
87
|
"@kubernetes/client-node": "^1.3.0",
|
|
88
88
|
"@modelcontextprotocol/sdk": "^1.13.2",
|
|
89
|
+
"@qdrant/js-client-rest": "^1.15.0",
|
|
89
90
|
"@vfarcic/dot-ai": "^0.34.0",
|
|
90
91
|
"cli-table3": "^0.6.5",
|
|
91
92
|
"commander": "^11.1.0",
|
|
92
93
|
"glob": "^11.0.3",
|
|
94
|
+
"openai": "^5.11.0",
|
|
93
95
|
"yaml": "^2.8.0"
|
|
94
96
|
},
|
|
95
97
|
"jest": {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Concept Extraction for Pattern Matching
|
|
2
|
+
|
|
3
|
+
You are a Kubernetes deployment expert. Extract multiple deployment concepts from user intent to enable comprehensive pattern matching.
|
|
4
|
+
|
|
5
|
+
## User Intent
|
|
6
|
+
{intent}
|
|
7
|
+
|
|
8
|
+
## Instructions
|
|
9
|
+
|
|
10
|
+
Analyze the user intent and extract all relevant deployment concepts. Consider these categories:
|
|
11
|
+
|
|
12
|
+
### **Application Architecture**
|
|
13
|
+
- Application types: web application, API service, microservice, monolith, frontend, backend
|
|
14
|
+
- Architectural patterns: stateless, stateful, serverless, event-driven, batch processing
|
|
15
|
+
- Service types: REST API, GraphQL API, gRPC service, websocket service, message consumer
|
|
16
|
+
|
|
17
|
+
### **Infrastructure & Integration**
|
|
18
|
+
- Data storage: database, cache, persistent storage, file storage, object storage
|
|
19
|
+
- Connectivity: external database, message queue, third-party API, service mesh
|
|
20
|
+
- Networking: public access, internal service, load balancing, ingress
|
|
21
|
+
|
|
22
|
+
### **Operational Requirements**
|
|
23
|
+
- Scaling: auto-scaling, high availability, load balancing, horizontal scaling
|
|
24
|
+
- Data management: schema management, database migrations, backup, monitoring
|
|
25
|
+
- Security: authentication, authorization, network policies, secrets management
|
|
26
|
+
- Deployment: CI/CD, blue-green deployment, canary deployment, rolling updates
|
|
27
|
+
|
|
28
|
+
### **Technology Stack**
|
|
29
|
+
- Programming languages: golang, java, python, nodejs, react, angular
|
|
30
|
+
- Frameworks: spring boot, express, flask, django, rails
|
|
31
|
+
- Databases: postgresql, mysql, mongodb, redis, elasticsearch
|
|
32
|
+
|
|
33
|
+
## Response Format
|
|
34
|
+
|
|
35
|
+
Extract 3-8 specific concepts that organizational patterns might address. Focus on concepts that would have dedicated deployment patterns.
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"concepts": [
|
|
40
|
+
{
|
|
41
|
+
"category": "application_architecture|infrastructure|operational|technology",
|
|
42
|
+
"concept": "specific concept name",
|
|
43
|
+
"importance": "high|medium|low",
|
|
44
|
+
"keywords": ["keyword1", "keyword2", "keyword3"]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Examples
|
|
51
|
+
|
|
52
|
+
**Input**: "deploy a stateless golang API that connects to PostgreSQL with auto-scaling"
|
|
53
|
+
**Output**:
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"concepts": [
|
|
57
|
+
{
|
|
58
|
+
"category": "application_architecture",
|
|
59
|
+
"concept": "stateless application",
|
|
60
|
+
"importance": "high",
|
|
61
|
+
"keywords": ["stateless", "stateless app", "stateless service", "stateless workload"]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"category": "application_architecture",
|
|
65
|
+
"concept": "REST API service",
|
|
66
|
+
"importance": "high",
|
|
67
|
+
"keywords": ["api", "rest api", "api service", "web service", "http service"]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"category": "technology",
|
|
71
|
+
"concept": "golang application",
|
|
72
|
+
"importance": "medium",
|
|
73
|
+
"keywords": ["golang", "go", "golang app", "go application", "go service"]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"category": "infrastructure",
|
|
77
|
+
"concept": "database connection",
|
|
78
|
+
"importance": "high",
|
|
79
|
+
"keywords": ["database", "postgresql", "db connection", "external database"]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"category": "operational",
|
|
83
|
+
"concept": "auto-scaling",
|
|
84
|
+
"importance": "medium",
|
|
85
|
+
"keywords": ["auto-scaling", "horizontal scaling", "scaling", "hpa"]
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**IMPORTANT**: Return ONLY the JSON object, nothing else.
|