@vfarcic/dot-ai 0.101.0 → 0.103.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 +1 -1
- package/dist/core/capability-operations.d.ts +2 -1
- package/dist/core/capability-operations.d.ts.map +1 -1
- package/dist/core/capability-operations.js +5 -3
- package/dist/core/capability-vector-service.d.ts +1 -1
- package/dist/core/capability-vector-service.d.ts.map +1 -1
- package/dist/core/capability-vector-service.js +2 -2
- package/dist/core/claude.js +1 -1
- package/dist/core/schema.d.ts +1 -0
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +5 -3
- package/dist/core/unified-creation-session.d.ts.map +1 -1
- package/dist/core/unified-creation-session.js +16 -9
- package/dist/core/unified-creation-types.d.ts +1 -0
- package/dist/core/unified-creation-types.d.ts.map +1 -1
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +4 -35
- package/dist/tools/answer-question.js +2 -2
- package/dist/tools/choose-solution.js +1 -1
- package/dist/tools/organizational-data.d.ts +1 -0
- package/dist/tools/organizational-data.d.ts.map +1 -1
- package/dist/tools/organizational-data.js +5 -2
- package/dist/tools/recommend.d.ts +7 -6
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +40 -6
- package/package.json +11 -46
- package/prompts/question-generation.md +3 -1
- package/shared-prompts/prd-done.md +4 -1
package/README.md
CHANGED
|
@@ -156,7 +156,7 @@ This video explains the platform engineering problem and demonstrates the Kubern
|
|
|
156
156
|
|
|
157
157
|
We welcome contributions! Please:
|
|
158
158
|
- Fork the repository and create a feature branch
|
|
159
|
-
- Run tests
|
|
159
|
+
- Run integration tests to ensure changes work correctly (see [Integration Testing Guide](docs/integration-testing-guide.md))
|
|
160
160
|
- Follow existing code style and conventions
|
|
161
161
|
- Submit a pull request with a clear description of changes
|
|
162
162
|
|
|
@@ -8,8 +8,9 @@ import { Logger } from './error-handling';
|
|
|
8
8
|
import { CapabilityVectorService } from './capability-vector-service';
|
|
9
9
|
/**
|
|
10
10
|
* Get initialized capability service
|
|
11
|
+
* @param collection - Collection name (default: 'capabilities')
|
|
11
12
|
*/
|
|
12
|
-
export declare function getCapabilityService(): Promise<CapabilityVectorService>;
|
|
13
|
+
export declare function getCapabilityService(collection?: string): Promise<CapabilityVectorService>;
|
|
13
14
|
/**
|
|
14
15
|
* Handle capability list operation
|
|
15
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability-operations.d.ts","sourceRoot":"","sources":["../../src/core/capability-operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAStE
|
|
1
|
+
{"version":3,"file":"capability-operations.d.ts","sourceRoot":"","sources":["../../src/core/capability-operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAStE;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAahG;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CA2Dd;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CA+Ed;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CAuEd;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CA2Dd;AAoCD;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CA4Nd;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CAwFd;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAmDd"}
|
|
@@ -56,9 +56,10 @@ const path = __importStar(require("path"));
|
|
|
56
56
|
// that remain in the main organizational-data.ts file as they're used by multiple domains
|
|
57
57
|
/**
|
|
58
58
|
* Get initialized capability service
|
|
59
|
+
* @param collection - Collection name (default: 'capabilities')
|
|
59
60
|
*/
|
|
60
|
-
async function getCapabilityService() {
|
|
61
|
-
const capabilityService = new capability_vector_service_1.CapabilityVectorService();
|
|
61
|
+
async function getCapabilityService(collection) {
|
|
62
|
+
const capabilityService = new capability_vector_service_1.CapabilityVectorService(collection);
|
|
62
63
|
// Always ensure proper collection initialization
|
|
63
64
|
try {
|
|
64
65
|
await capabilityService.initialize();
|
|
@@ -635,7 +636,8 @@ async function handleCapabilitySearch(args, logger, requestId, capabilityService
|
|
|
635
636
|
*/
|
|
636
637
|
async function handleCapabilityCRUD(operation, args, logger, requestId) {
|
|
637
638
|
// Create and initialize capability service for CRUD operations
|
|
638
|
-
|
|
639
|
+
// Use collection from args if provided, otherwise defaults to 'capabilities'
|
|
640
|
+
const capabilityService = new capability_vector_service_1.CapabilityVectorService(args.collection);
|
|
639
641
|
try {
|
|
640
642
|
const vectorDBHealthy = await capabilityService.healthCheck();
|
|
641
643
|
if (!vectorDBHealthy) {
|
|
@@ -26,7 +26,7 @@ export interface CapabilitySearchOptions extends BaseSearchOptions {
|
|
|
26
26
|
* Vector service for storing and searching resource capabilities
|
|
27
27
|
*/
|
|
28
28
|
export declare class CapabilityVectorService extends BaseVectorService<ResourceCapability> {
|
|
29
|
-
constructor(vectorDB?: VectorDBService, embeddingService?: EmbeddingService);
|
|
29
|
+
constructor(collectionName?: string, vectorDB?: VectorDBService, embeddingService?: EmbeddingService);
|
|
30
30
|
/**
|
|
31
31
|
* Create searchable text from capability data for embedding generation
|
|
32
32
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability-vector-service.d.ts","sourceRoot":"","sources":["../../src/core/capability-vector-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE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|
15
15
|
class CapabilityVectorService extends base_vector_service_1.BaseVectorService {
|
|
16
|
-
constructor(vectorDB, embeddingService) {
|
|
17
|
-
super(
|
|
16
|
+
constructor(collectionName = 'capabilities', vectorDB, embeddingService) {
|
|
17
|
+
super(collectionName, vectorDB, embeddingService);
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Create searchable text from capability data for embedding generation
|
package/dist/core/claude.js
CHANGED
|
@@ -148,7 +148,7 @@ ${response.content}`;
|
|
|
148
148
|
if (this.apiKey.startsWith('sk-ant-') && this.client) {
|
|
149
149
|
// Make real API call to Claude with streaming
|
|
150
150
|
const stream = await this.client.messages.create({
|
|
151
|
-
model: 'claude-sonnet-4-
|
|
151
|
+
model: process.env.MODEL || 'claude-sonnet-4-5-20250929', // Latest Claude Sonnet 4.5
|
|
152
152
|
max_tokens: 64000,
|
|
153
153
|
messages: [{ role: 'user', content: message }],
|
|
154
154
|
stream: true // Enable streaming by default to support long operations (>10 minutes)
|
package/dist/core/schema.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAclD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CA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AAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,cAAc,CAAC,CAAuB;IAC9C,OAAO,CAAC,iBAAiB,CAAC,CAA0B;IACpD,OAAO,CAAC,aAAa,CAAC,CAAsB;gBAEhC,MAAM,EAAE,eAAe;IAqCnC;;OAEG;IACG,iBAAiB,CACrB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,GACnD,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAyE9B;;OAEG;YACW,wBAAwB;IAiBtC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IA+CnC;;OAEG;YACW,0BAA0B;IA6CxC;;OAEG;YACW,0BAA0B;IAuFxC;;OAEG;IACH,OAAO,CAAC,8BAA8B;IAOtC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAanC;;OAEG;IACH,OAAO,CAAC,4BAA4B;IASpC;;OAEG;IACH,OAAO,CAAC,mCAAmC;IAU3C;;;OAGG;YACW,sBAAsB;IAsBpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8FG;YACW,oBAAoB;IAmDlC;;OAEG;YACW,sBAAsB;IAiEpC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAgCjC;;OAEG;YACW,uBAAuB;CAqItC"}
|
package/dist/core/schema.js
CHANGED
|
@@ -276,9 +276,11 @@ class ResourceRecommender {
|
|
|
276
276
|
this.claudeIntegration = new claude_1.ClaudeIntegration(config.claudeApiKey);
|
|
277
277
|
// Initialize capability service - fail gracefully if Vector DB unavailable
|
|
278
278
|
try {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
// Use environment variable for collection name (allows using test data collection)
|
|
280
|
+
const collectionName = process.env.QDRANT_CAPABILITIES_COLLECTION || 'capabilities';
|
|
281
|
+
const capabilityVectorDB = new vector_db_service_1.VectorDBService({ collectionName });
|
|
282
|
+
this.capabilityService = new capability_vector_service_1.CapabilityVectorService(collectionName, capabilityVectorDB);
|
|
283
|
+
console.log(`✅ Capability service initialized with Vector DB (collection: ${collectionName})`);
|
|
282
284
|
}
|
|
283
285
|
catch (error) {
|
|
284
286
|
console.warn('⚠️ Vector DB not available, capabilities disabled:', error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-creation-session.d.ts","sourceRoot":"","sources":["../../src/core/unified-creation-session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAKlD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,iCAAiC,EACjC,UAAU,EAIX,MAAM,0BAA0B,CAAC;AAKlC,qBAAa,6BAA6B;IACxC,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,SAAS,CAAsB;gBAE3B,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,mBAAmB;IAKnE;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,GAAG,GAAG,sBAAsB;
|
|
1
|
+
{"version":3,"file":"unified-creation-session.d.ts","sourceRoot":"","sources":["../../src/core/unified-creation-session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAKlD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,iCAAiC,EACjC,UAAU,EAIX,MAAM,0BAA0B,CAAC;AAKlC,qBAAa,6BAA6B;IACxC,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,SAAS,CAAsB;gBAE3B,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,mBAAmB;IAKnE;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,GAAG,GAAG,sBAAsB;IAqBhD;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,sBAAsB,GAAG,IAAI;IAiBxE;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,sBAAsB;IA2GvF;;OAEG;IACG,mBAAmB,CAAC,OAAO,EAAE,sBAAsB,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,2BAA2B,GAAG,iCAAiC,CAAC;IAoGhJ;;OAEG;YACW,4BAA4B;IA4C1C;;OAEG;YACW,gCAAgC;IAsC9C;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA6E1B;;OAEG;YACW,gBAAgB;IAsF9B;;OAEG;YACW,4BAA4B;IAoH1C;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAY1B;;OAEG;YACW,qBAAqB;IAqCnC;;OAEG;YACW,mBAAmB;IAqLjC;;OAEG;YACW,uBAAuB;IAmFrC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;OAEG;IACH,OAAO,CAAC,WAAW;IAgBnB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAG1B"}
|
|
@@ -74,7 +74,10 @@ class UnifiedCreationSessionManager {
|
|
|
74
74
|
currentStep: this.config.steps[0], // Start with first step
|
|
75
75
|
createdAt: new Date().toISOString(),
|
|
76
76
|
updatedAt: new Date().toISOString(),
|
|
77
|
-
data: {
|
|
77
|
+
data: {
|
|
78
|
+
// Store capabilities collection if provided (for policy testing with pre-populated data)
|
|
79
|
+
capabilitiesCollection: args.collection
|
|
80
|
+
}
|
|
78
81
|
};
|
|
79
82
|
this.saveSession(session, args);
|
|
80
83
|
return session;
|
|
@@ -703,7 +706,8 @@ The policy intent has been stored in the database. The Kyverno policy was not ap
|
|
|
703
706
|
// Ensure discovery service is connected to cluster before retrieving schemas
|
|
704
707
|
await this.discovery.connect();
|
|
705
708
|
// Retrieve actual resource schemas using semantic search and discovery
|
|
706
|
-
|
|
709
|
+
// Use capabilities collection from session data if provided (for testing with pre-populated data)
|
|
710
|
+
const resourceSchemas = await this.retrieveRelevantSchemas(data.description || '', finalTriggers, data.capabilitiesCollection);
|
|
707
711
|
// Prepare session directory for YAML saving
|
|
708
712
|
const sessionDir = (0, session_utils_1.getAndValidateSessionDirectory)(args, true);
|
|
709
713
|
const policySessionDir = path.join(sessionDir, 'policy-sessions');
|
|
@@ -829,14 +833,15 @@ Please try again or modify your policy description.`,
|
|
|
829
833
|
/**
|
|
830
834
|
* Retrieve relevant schemas for Kyverno generation using semantic search
|
|
831
835
|
*/
|
|
832
|
-
async retrieveRelevantSchemas(policyDescription, triggers) {
|
|
836
|
+
async retrieveRelevantSchemas(policyDescription, triggers, collection) {
|
|
833
837
|
// Combine policy description with triggers for enhanced search
|
|
834
838
|
const searchQuery = [policyDescription, ...triggers].join(' ');
|
|
835
839
|
console.info('Performing semantic search for relevant capabilities', {
|
|
836
840
|
searchQuery,
|
|
837
|
-
triggerCount: triggers.length
|
|
841
|
+
triggerCount: triggers.length,
|
|
842
|
+
collection: collection || 'capabilities'
|
|
838
843
|
});
|
|
839
|
-
const capabilityService = new capability_vector_service_1.CapabilityVectorService();
|
|
844
|
+
const capabilityService = new capability_vector_service_1.CapabilityVectorService(collection);
|
|
840
845
|
// Use existing searchCapabilities function - no fallback, let it throw if it fails
|
|
841
846
|
const searchResults = await capabilityService.searchCapabilities(searchQuery, {
|
|
842
847
|
limit: 50 // Higher limit to get more relevant resources - aligns with recommendation tool
|
|
@@ -877,11 +882,13 @@ Please try again or modify your policy description.`,
|
|
|
877
882
|
});
|
|
878
883
|
}
|
|
879
884
|
catch (error) {
|
|
880
|
-
console.
|
|
881
|
-
resourceName
|
|
885
|
+
console.warn('Skipping resource schema (not available in cluster)', error, {
|
|
886
|
+
resourceName,
|
|
887
|
+
error: error instanceof Error ? error.message : String(error)
|
|
882
888
|
});
|
|
883
|
-
//
|
|
884
|
-
|
|
889
|
+
// Skip resources that don't exist in the cluster instead of failing
|
|
890
|
+
// This allows policy generation to work across different Kubernetes versions
|
|
891
|
+
continue;
|
|
885
892
|
}
|
|
886
893
|
}
|
|
887
894
|
console.info('All resource schemas retrieved successfully', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-creation-types.d.ts","sourceRoot":"","sources":["../../src/core/unified-creation-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,UAAU,GACV,mBAAmB,GACnB,WAAW,GACX,WAAW,GACX,YAAY,GACZ,iBAAiB,GACjB,oBAAoB,GACpB,QAAQ,GACR,oBAAoB,GACpB,UAAU,CAAC;AAEf,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9C,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,YAAY,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAGlB,IAAI,EAAE;QACJ,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC5B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAChC,sBAAsB,CAAC,EA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CAGnB"}
|
package/dist/interfaces/mcp.js
CHANGED
|
@@ -15,10 +15,6 @@ const node_crypto_1 = require("node:crypto");
|
|
|
15
15
|
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
16
16
|
const error_handling_1 = require("../core/error-handling");
|
|
17
17
|
const recommend_1 = require("../tools/recommend");
|
|
18
|
-
const choose_solution_1 = require("../tools/choose-solution");
|
|
19
|
-
const answer_question_1 = require("../tools/answer-question");
|
|
20
|
-
const generate_manifests_1 = require("../tools/generate-manifests");
|
|
21
|
-
const deploy_manifests_1 = require("../tools/deploy-manifests");
|
|
22
18
|
const version_1 = require("../tools/version");
|
|
23
19
|
const test_docs_1 = require("../tools/test-docs");
|
|
24
20
|
const organizational_data_1 = require("../tools/organizational-data");
|
|
@@ -83,38 +79,15 @@ class MCPServer {
|
|
|
83
79
|
* Register all tools with McpServer and REST registry
|
|
84
80
|
*/
|
|
85
81
|
registerTools() {
|
|
86
|
-
// Register recommend tool
|
|
82
|
+
// Register unified recommend tool with stage-based routing
|
|
83
|
+
// Handles all deployment workflow stages: recommend, chooseSolution, answerQuestion, generateManifests, deployManifests
|
|
87
84
|
this.registerTool(recommend_1.RECOMMEND_TOOL_NAME, recommend_1.RECOMMEND_TOOL_DESCRIPTION, recommend_1.RECOMMEND_TOOL_INPUT_SCHEMA, async (args) => {
|
|
88
85
|
const requestId = this.generateRequestId();
|
|
89
86
|
this.logger.info(`Processing ${recommend_1.RECOMMEND_TOOL_NAME} tool request`, {
|
|
90
87
|
requestId,
|
|
91
88
|
});
|
|
92
89
|
return await (0, recommend_1.handleRecommendTool)(args, this.dotAI, this.logger, requestId);
|
|
93
|
-
}, '
|
|
94
|
-
// Register chooseSolution tool
|
|
95
|
-
this.registerTool(choose_solution_1.CHOOSESOLUTION_TOOL_NAME, choose_solution_1.CHOOSESOLUTION_TOOL_DESCRIPTION, choose_solution_1.CHOOSESOLUTION_TOOL_INPUT_SCHEMA, async (args) => {
|
|
96
|
-
const requestId = this.generateRequestId();
|
|
97
|
-
this.logger.info(`Processing ${choose_solution_1.CHOOSESOLUTION_TOOL_NAME} tool request`, { requestId });
|
|
98
|
-
return await (0, choose_solution_1.handleChooseSolutionTool)(args, this.dotAI, this.logger, requestId);
|
|
99
|
-
}, 'AI Tools', ['solution', 'kubernetes', 'configuration']);
|
|
100
|
-
// Register answerQuestion tool
|
|
101
|
-
this.registerTool(answer_question_1.ANSWERQUESTION_TOOL_NAME, answer_question_1.ANSWERQUESTION_TOOL_DESCRIPTION, answer_question_1.ANSWERQUESTION_TOOL_INPUT_SCHEMA, async (args) => {
|
|
102
|
-
const requestId = this.generateRequestId();
|
|
103
|
-
this.logger.info(`Processing ${answer_question_1.ANSWERQUESTION_TOOL_NAME} tool request`, { requestId });
|
|
104
|
-
return await (0, answer_question_1.handleAnswerQuestionTool)(args, this.dotAI, this.logger, requestId);
|
|
105
|
-
}, 'AI Tools', ['configuration', 'questions', 'workflow']);
|
|
106
|
-
// Register generateManifests tool
|
|
107
|
-
this.registerTool(generate_manifests_1.GENERATEMANIFESTS_TOOL_NAME, generate_manifests_1.GENERATEMANIFESTS_TOOL_DESCRIPTION, generate_manifests_1.GENERATEMANIFESTS_TOOL_INPUT_SCHEMA, async (args) => {
|
|
108
|
-
const requestId = this.generateRequestId();
|
|
109
|
-
this.logger.info(`Processing ${generate_manifests_1.GENERATEMANIFESTS_TOOL_NAME} tool request`, { requestId });
|
|
110
|
-
return await (0, generate_manifests_1.handleGenerateManifestsTool)(args, this.dotAI, this.logger, requestId);
|
|
111
|
-
}, 'Deployment', ['manifests', 'kubernetes', 'generation']);
|
|
112
|
-
// Register deployManifests tool
|
|
113
|
-
this.registerTool(deploy_manifests_1.DEPLOYMANIFESTS_TOOL_NAME, deploy_manifests_1.DEPLOYMANIFESTS_TOOL_DESCRIPTION, deploy_manifests_1.DEPLOYMANIFESTS_TOOL_INPUT_SCHEMA, async (args) => {
|
|
114
|
-
const requestId = this.generateRequestId();
|
|
115
|
-
this.logger.info(`Processing ${deploy_manifests_1.DEPLOYMANIFESTS_TOOL_NAME} tool request`, { requestId });
|
|
116
|
-
return await (0, deploy_manifests_1.handleDeployManifestsTool)(args, this.dotAI, this.logger, requestId);
|
|
117
|
-
}, 'Deployment', ['deployment', 'kubernetes', 'kubectl']);
|
|
90
|
+
}, 'Deployment', ['recommendation', 'kubernetes', 'deployment', 'workflow']);
|
|
118
91
|
// Register version tool
|
|
119
92
|
this.registerTool(version_1.VERSION_TOOL_NAME, version_1.VERSION_TOOL_DESCRIPTION, version_1.VERSION_TOOL_INPUT_SCHEMA, async (args) => {
|
|
120
93
|
const requestId = this.generateRequestId();
|
|
@@ -146,16 +119,12 @@ class MCPServer {
|
|
|
146
119
|
this.logger.info('Registered all tools with McpServer', {
|
|
147
120
|
tools: [
|
|
148
121
|
recommend_1.RECOMMEND_TOOL_NAME,
|
|
149
|
-
choose_solution_1.CHOOSESOLUTION_TOOL_NAME,
|
|
150
|
-
answer_question_1.ANSWERQUESTION_TOOL_NAME,
|
|
151
|
-
generate_manifests_1.GENERATEMANIFESTS_TOOL_NAME,
|
|
152
|
-
deploy_manifests_1.DEPLOYMANIFESTS_TOOL_NAME,
|
|
153
122
|
version_1.VERSION_TOOL_NAME,
|
|
154
123
|
test_docs_1.TESTDOCS_TOOL_NAME,
|
|
155
124
|
organizational_data_1.ORGANIZATIONAL_DATA_TOOL_NAME,
|
|
156
125
|
remediate_1.REMEDIATE_TOOL_NAME,
|
|
157
126
|
],
|
|
158
|
-
totalTools:
|
|
127
|
+
totalTools: 5,
|
|
159
128
|
});
|
|
160
129
|
}
|
|
161
130
|
/**
|
|
@@ -736,7 +736,7 @@ async function handleAnswerQuestionTool(args, dotAI, logger, requestId) {
|
|
|
736
736
|
userAnswers: userAnswers,
|
|
737
737
|
hasOpenRequirements: !!(openAnswer && openAnswer !== 'N/A')
|
|
738
738
|
},
|
|
739
|
-
nextAction: 'generateManifests',
|
|
739
|
+
nextAction: 'Call recommend tool with stage: generateManifests',
|
|
740
740
|
guidance: 'Configuration complete. Ready to generate Kubernetes manifests for deployment.',
|
|
741
741
|
agentInstructions: 'All configuration stages are now complete. You may proceed to generate Kubernetes manifests using the generateManifests tool.',
|
|
742
742
|
timestamp: new Date().toISOString()
|
|
@@ -763,7 +763,7 @@ async function handleAnswerQuestionTool(args, dotAI, logger, requestId) {
|
|
|
763
763
|
message: getStageMessage(newStageState.currentStage),
|
|
764
764
|
guidance: getStageGuidance(newStageState.currentStage),
|
|
765
765
|
agentInstructions: getAgentInstructions(newStageState.currentStage),
|
|
766
|
-
nextAction:
|
|
766
|
+
nextAction: `Call recommend tool with stage: answerQuestion:${newStageState.currentStage}`,
|
|
767
767
|
timestamp: new Date().toISOString()
|
|
768
768
|
};
|
|
769
769
|
return {
|
|
@@ -138,7 +138,7 @@ async function handleChooseSolutionTool(args, dotAI, logger, requestId) {
|
|
|
138
138
|
questions: solution.questions.required || [],
|
|
139
139
|
nextStage: 'basic',
|
|
140
140
|
message: 'Please provide the required configuration for your application.',
|
|
141
|
-
nextAction: 'answerQuestion',
|
|
141
|
+
nextAction: 'Call recommend tool with stage: answerQuestion:required',
|
|
142
142
|
guidance: 'Answer questions in this stage or skip to proceed to the next stage. Do NOT try to generate manifests yet.',
|
|
143
143
|
timestamp: new Date().toISOString()
|
|
144
144
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizational-data.d.ts","sourceRoot":"","sources":["../../src/tools/organizational-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAchD,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAC7D,eAAO,MAAM,oCAAoC,+jBAAyjB,CAAC;AAG3mB,eAAO,MAAM,qCAAqC
|
|
1
|
+
{"version":3,"file":"organizational-data.d.ts","sourceRoot":"","sources":["../../src/tools/organizational-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAchD,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAC7D,eAAO,MAAM,oCAAoC,+jBAAyjB,CAAC;AAG3mB,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;CA2BjD,CAAC;AAujBF;;GAEG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,KAAK,GAAG,IAAI,EACpB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CA0Hd"}
|
|
@@ -78,7 +78,9 @@ exports.ORGANIZATIONAL_DATA_TOOL_INPUT_SCHEMA = {
|
|
|
78
78
|
apiVersion: zod_1.z.string()
|
|
79
79
|
}).optional().describe('Kubernetes resource reference (for capabilities operations)'),
|
|
80
80
|
// Resource list for specific resource scanning
|
|
81
|
-
resourceList: zod_1.z.string().optional().describe('Comma-separated list of resources to scan (format: Kind.group or Kind for core resources)')
|
|
81
|
+
resourceList: zod_1.z.string().optional().describe('Comma-separated list of resources to scan (format: Kind.group or Kind for core resources)'),
|
|
82
|
+
// Collection name for capabilities (allows using different collections for different purposes)
|
|
83
|
+
collection: zod_1.z.string().optional().describe('Collection name for capabilities operations (default: "capabilities", use "capabilities-policies" for pre-populated test data)')
|
|
82
84
|
};
|
|
83
85
|
/**
|
|
84
86
|
* Validate Vector DB connection and return helpful error if unavailable
|
|
@@ -374,7 +376,8 @@ function cleanupCapabilitySession(session, args, logger, requestId) {
|
|
|
374
376
|
async function handleCapabilityScan(args, logger, requestId) {
|
|
375
377
|
// Validate Vector DB and embedding service dependencies upfront
|
|
376
378
|
// This prevents users from going through the entire workflow only to fail at storage
|
|
377
|
-
|
|
379
|
+
// Use collection from args if provided (for testing with pre-populated data)
|
|
380
|
+
const capabilityService = new index_1.CapabilityVectorService(args.collection);
|
|
378
381
|
// Check Vector DB connection and initialize collection
|
|
379
382
|
try {
|
|
380
383
|
const vectorDBHealthy = await capabilityService.healthCheck();
|
|
@@ -7,16 +7,17 @@ import { Logger } from '../core/error-handling';
|
|
|
7
7
|
export declare const RECOMMEND_TOOL_NAME = "recommend";
|
|
8
8
|
export declare const RECOMMEND_TOOL_DESCRIPTION = "Deploy, create, setup, install, or run applications, infrastructure, and services on Kubernetes with AI recommendations. Describe what you want to deploy. Does NOT handle policy creation, organizational patterns, or resource capabilities - use manageOrgData for those.";
|
|
9
9
|
export declare const RECOMMEND_TOOL_INPUT_SCHEMA: {
|
|
10
|
-
|
|
10
|
+
stage: z.ZodOptional<z.ZodString>;
|
|
11
|
+
intent: z.ZodOptional<z.ZodString>;
|
|
11
12
|
final: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
solutionId: z.ZodOptional<z.ZodString>;
|
|
14
|
+
answers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
15
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
12
16
|
};
|
|
13
17
|
/**
|
|
14
|
-
* Direct MCP tool handler for recommend functionality
|
|
18
|
+
* Direct MCP tool handler for recommend functionality (unified with stage routing)
|
|
15
19
|
*/
|
|
16
|
-
export declare function handleRecommendTool(args: {
|
|
17
|
-
intent: string;
|
|
18
|
-
final?: boolean;
|
|
19
|
-
}, dotAI: DotAI, logger: Logger, requestId: string): Promise<{
|
|
20
|
+
export declare function handleRecommendTool(args: any, dotAI: DotAI, logger: Logger, requestId: string): Promise<{
|
|
20
21
|
content: {
|
|
21
22
|
type: 'text';
|
|
22
23
|
text: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommend.d.ts","sourceRoot":"","sources":["../../src/tools/recommend.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"recommend.d.ts","sourceRoot":"","sources":["../../src/tools/recommend.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAYhD,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,0BAA0B,iRAAiR,CAAC;AAGzT,eAAO,MAAM,2BAA2B;;;;;;;CAUvC,CAAC;AA2EF;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,GAAG,EACT,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,CAgSxD"}
|
package/dist/tools/recommend.js
CHANGED
|
@@ -47,13 +47,24 @@ const fs = __importStar(require("fs"));
|
|
|
47
47
|
const path = __importStar(require("path"));
|
|
48
48
|
const crypto = __importStar(require("crypto"));
|
|
49
49
|
const session_utils_1 = require("../core/session-utils");
|
|
50
|
+
const choose_solution_1 = require("./choose-solution");
|
|
51
|
+
const answer_question_1 = require("./answer-question");
|
|
52
|
+
const generate_manifests_1 = require("./generate-manifests");
|
|
53
|
+
const deploy_manifests_1 = require("./deploy-manifests");
|
|
50
54
|
// Tool metadata for direct MCP registration
|
|
51
55
|
exports.RECOMMEND_TOOL_NAME = 'recommend';
|
|
52
56
|
exports.RECOMMEND_TOOL_DESCRIPTION = 'Deploy, create, setup, install, or run applications, infrastructure, and services on Kubernetes with AI recommendations. Describe what you want to deploy. Does NOT handle policy creation, organizational patterns, or resource capabilities - use manageOrgData for those.';
|
|
53
|
-
// Zod schema for MCP registration
|
|
57
|
+
// Zod schema for MCP registration (unified tool with stage routing)
|
|
54
58
|
exports.RECOMMEND_TOOL_INPUT_SCHEMA = {
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
stage: zod_1.z.string().optional().describe('Deployment workflow stage: "recommend" (default), "chooseSolution", "answerQuestion:required", "answerQuestion:basic", "answerQuestion:advanced", "answerQuestion:open", "generateManifests", "deployManifests". Defaults to "recommend" if omitted.'),
|
|
60
|
+
intent: zod_1.z.string().min(1).max(1000).optional().describe('What the user wants to deploy, create, setup, install, or run on Kubernetes. Examples: "deploy web application", "create PostgreSQL database", "setup Redis cache", "install Prometheus monitoring", "configure Ingress controller", "provision storage volumes", "launch MongoDB operator", "run Node.js API", "setup CI/CD pipeline", "create load balancer", "install Grafana dashboard", "deploy React frontend"'),
|
|
61
|
+
final: zod_1.z.boolean().optional().describe('Set to true to skip intent clarification and proceed directly with recommendations. If false or omitted, the tool will analyze the intent and provide clarification questions to help improve recommendation quality.'),
|
|
62
|
+
// Parameters for chooseSolution stage
|
|
63
|
+
solutionId: zod_1.z.string().optional().describe('Solution ID for chooseSolution, answerQuestion, generateManifests, and deployManifests stages'),
|
|
64
|
+
// Parameters for answerQuestion stage (stage parameter contains the config stage like "answerQuestion:required")
|
|
65
|
+
answers: zod_1.z.record(zod_1.z.any()).optional().describe('User answers for answerQuestion stage'),
|
|
66
|
+
// Parameters for deployManifests stage
|
|
67
|
+
timeout: zod_1.z.number().optional().describe('Deployment timeout in seconds for deployManifests stage')
|
|
57
68
|
};
|
|
58
69
|
/**
|
|
59
70
|
* Analyze intent for clarification opportunities using AI
|
|
@@ -120,11 +131,34 @@ function writeSolutionFile(sessionDir, solutionId, solutionData) {
|
|
|
120
131
|
}
|
|
121
132
|
}
|
|
122
133
|
/**
|
|
123
|
-
* Direct MCP tool handler for recommend functionality
|
|
134
|
+
* Direct MCP tool handler for recommend functionality (unified with stage routing)
|
|
124
135
|
*/
|
|
125
136
|
async function handleRecommendTool(args, dotAI, logger, requestId) {
|
|
126
137
|
return await error_handling_1.ErrorHandler.withErrorHandling(async () => {
|
|
127
|
-
|
|
138
|
+
// Stage-based routing: extract stage and route to appropriate handler
|
|
139
|
+
const stage = args.stage || 'recommend'; // Default to 'recommend' if not specified
|
|
140
|
+
logger.debug('Handling recommend request with stage routing', { requestId, stage, intent: args?.intent });
|
|
141
|
+
// Route to appropriate handler based on stage
|
|
142
|
+
if (stage === 'chooseSolution') {
|
|
143
|
+
return await (0, choose_solution_1.handleChooseSolutionTool)(args, dotAI, logger, requestId);
|
|
144
|
+
}
|
|
145
|
+
if (stage.startsWith('answerQuestion:')) {
|
|
146
|
+
// Extract config stage from stage parameter (e.g., "answerQuestion:required" -> "required")
|
|
147
|
+
const configStage = stage.split(':')[1];
|
|
148
|
+
const answerQuestionArgs = {
|
|
149
|
+
solutionId: args.solutionId,
|
|
150
|
+
stage: configStage,
|
|
151
|
+
answers: args.answers
|
|
152
|
+
};
|
|
153
|
+
return await (0, answer_question_1.handleAnswerQuestionTool)(answerQuestionArgs, dotAI, logger, requestId);
|
|
154
|
+
}
|
|
155
|
+
if (stage === 'generateManifests') {
|
|
156
|
+
return await (0, generate_manifests_1.handleGenerateManifestsTool)(args, dotAI, logger, requestId);
|
|
157
|
+
}
|
|
158
|
+
if (stage === 'deployManifests') {
|
|
159
|
+
return await (0, deploy_manifests_1.handleDeployManifestsTool)(args, dotAI, logger, requestId);
|
|
160
|
+
}
|
|
161
|
+
// Default: recommend stage (original recommend logic)
|
|
128
162
|
// Input validation is handled automatically by MCP SDK with Zod schema
|
|
129
163
|
// args are already validated and typed when we reach this point
|
|
130
164
|
// Check for Claude API key
|
|
@@ -308,7 +342,7 @@ async function handleRecommendTool(args, dotAI, logger, requestId) {
|
|
|
308
342
|
totalPatternInfluences: totalPatternInfluences,
|
|
309
343
|
patternsAvailable: totalPatternInfluences > 0 ? "Yes" : "None found or pattern search failed"
|
|
310
344
|
},
|
|
311
|
-
nextAction: "Call
|
|
345
|
+
nextAction: "Call recommend tool with stage: chooseSolution and your preferred solutionId",
|
|
312
346
|
guidance: "🔴 CRITICAL: You MUST present these solutions to the user and ask them to choose. DO NOT automatically call chooseSolution() without user input. Stop here and wait for user selection. IMPORTANT: Show the list of Kubernetes resources (from the 'resources' field) that each solution will use - this helps users understand what gets deployed. ALSO: Include pattern usage information in your response - show which solutions used organizational patterns and which did not.",
|
|
313
347
|
timestamp
|
|
314
348
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfarcic/dot-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.103.0",
|
|
4
4
|
"description": "AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance",
|
|
5
5
|
"mcpName": "io.github.vfarcic/dot-ai",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
"./mcp": "./dist/mcp/server.js"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"
|
|
17
|
-
"test": "
|
|
18
|
-
"test:
|
|
19
|
-
"test:
|
|
20
|
-
"test:
|
|
16
|
+
"test": "npm run test:integration",
|
|
17
|
+
"test:integration:setup": "./tests/integration/infrastructure/setup-cluster.sh",
|
|
18
|
+
"test:integration:teardown": "./tests/integration/infrastructure/teardown-cluster.sh",
|
|
19
|
+
"test:integration:server": "KUBECONFIG=./kubeconfig-test.yaml PORT=3456 DOT_AI_SESSION_DIR=./tmp/sessions TRANSPORT_TYPE=http QDRANT_URL=http://localhost:6335 QDRANT_CAPABILITIES_COLLECTION=capabilities-policies ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY OPENAI_API_KEY=$OPENAI_API_KEY node dist/mcp/server.js",
|
|
20
|
+
"test:integration": "vitest run --config=vitest.integration.config.ts --test-timeout=1200000",
|
|
21
|
+
"test:integration:watch": "vitest --config=vitest.integration.config.ts --test-timeout=1200000",
|
|
21
22
|
"clean": "rm -rf dist",
|
|
22
23
|
"prebuild": "npm run clean && npm run lint",
|
|
23
24
|
"build": "tsc --sourceMap false",
|
|
@@ -30,9 +31,6 @@
|
|
|
30
31
|
"start:mcp": "node dist/mcp/server.js",
|
|
31
32
|
"lint": "eslint src/ --ext .ts",
|
|
32
33
|
"format": "prettier --write src/",
|
|
33
|
-
"ci": "npm run lint && npm run ci:build && npm run ci:test && npm audit --audit-level moderate",
|
|
34
|
-
"ci:test": "npm run test",
|
|
35
|
-
"ci:build": "npm run build:prod",
|
|
36
34
|
"audit": "npm audit",
|
|
37
35
|
"version:dev": "npm version patch --preid=devel --prerelease",
|
|
38
36
|
"version:prod": "npm version patch"
|
|
@@ -72,19 +70,18 @@
|
|
|
72
70
|
],
|
|
73
71
|
"devDependencies": {
|
|
74
72
|
"@types/glob": "^9.0.0",
|
|
75
|
-
"@types/jest": "^29.5.0",
|
|
76
73
|
"@types/node": "^22.0.0",
|
|
77
74
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
78
75
|
"@typescript-eslint/parser": "^6.21.0",
|
|
76
|
+
"@vitest/ui": "^3.2.4",
|
|
79
77
|
"eslint": "^8.0.0",
|
|
80
|
-
"jest": "^29.5.0",
|
|
81
78
|
"prettier": "^3.0.0",
|
|
82
|
-
"ts-jest": "^29.1.0",
|
|
83
79
|
"ts-node": "^10.9.0",
|
|
84
|
-
"typescript": "^5.0.0"
|
|
80
|
+
"typescript": "^5.0.0",
|
|
81
|
+
"vitest": "^3.2.4"
|
|
85
82
|
},
|
|
86
83
|
"dependencies": {
|
|
87
|
-
"@anthropic-ai/sdk": "^0.
|
|
84
|
+
"@anthropic-ai/sdk": "^0.65.0",
|
|
88
85
|
"@kubernetes/client-node": "^1.3.0",
|
|
89
86
|
"@modelcontextprotocol/sdk": "^1.13.2",
|
|
90
87
|
"@qdrant/js-client-rest": "^1.15.0",
|
|
@@ -92,37 +89,5 @@
|
|
|
92
89
|
"openai": "^5.11.0",
|
|
93
90
|
"yaml": "^2.8.0",
|
|
94
91
|
"zod-to-json-schema": "^3.24.6"
|
|
95
|
-
},
|
|
96
|
-
"jest": {
|
|
97
|
-
"preset": "ts-jest",
|
|
98
|
-
"testEnvironment": "node",
|
|
99
|
-
"silent": false,
|
|
100
|
-
"verbose": false,
|
|
101
|
-
"roots": [
|
|
102
|
-
"<rootDir>/src",
|
|
103
|
-
"<rootDir>/tests"
|
|
104
|
-
],
|
|
105
|
-
"testMatch": [
|
|
106
|
-
"**/__tests__/**/*.ts",
|
|
107
|
-
"**/*.test.ts",
|
|
108
|
-
"**/*.spec.ts"
|
|
109
|
-
],
|
|
110
|
-
"collectCoverageFrom": [
|
|
111
|
-
"src/**/*.ts",
|
|
112
|
-
"!src/**/*.d.ts",
|
|
113
|
-
"!src/**/index.ts"
|
|
114
|
-
],
|
|
115
|
-
"coverageDirectory": "coverage",
|
|
116
|
-
"coverageReporters": [
|
|
117
|
-
"text",
|
|
118
|
-
"lcov",
|
|
119
|
-
"html"
|
|
120
|
-
],
|
|
121
|
-
"moduleNameMapper": {
|
|
122
|
-
"@kubernetes/client-node": "<rootDir>/tests/__mocks__/@kubernetes/client-node.ts"
|
|
123
|
-
},
|
|
124
|
-
"setupFilesAfterEnv": [
|
|
125
|
-
"<rootDir>/tests/setup.ts"
|
|
126
|
-
]
|
|
127
92
|
}
|
|
128
93
|
}
|
|
@@ -125,13 +125,14 @@ Return your response as JSON in this exact format:
|
|
|
125
125
|
"max": 100,
|
|
126
126
|
"pattern": "^[a-z0-9-]+$"
|
|
127
127
|
},
|
|
128
|
+
"suggestedAnswer": "example-value"
|
|
128
129
|
}
|
|
129
130
|
],
|
|
130
131
|
"basic": [
|
|
131
132
|
// same format as required
|
|
132
133
|
],
|
|
133
134
|
"advanced": [
|
|
134
|
-
// same format as required
|
|
135
|
+
// same format as required
|
|
135
136
|
],
|
|
136
137
|
"open": {
|
|
137
138
|
"question": "Is there anything else about your requirements or constraints that would help us provide better recommendations?",
|
|
@@ -143,6 +144,7 @@ Return your response as JSON in this exact format:
|
|
|
143
144
|
## Important Notes
|
|
144
145
|
|
|
145
146
|
- **CRITICAL**: Only ask questions about properties explicitly defined in the provided resource schemas
|
|
147
|
+
- **REQUIRED**: Each question must include a `suggestedAnswer` field with a valid example value that passes the validation rules
|
|
146
148
|
- **Generate comprehensive questions** covering all meaningful configuration options available in the resource schemas
|
|
147
149
|
- Focus on questions that actually affect the generated manifests based on the actual schema
|
|
148
150
|
- **Prefer explicit configuration over defaults** - give users control over important settings even if reasonable defaults exist
|
|
@@ -29,10 +29,12 @@ Complete the PRD implementation workflow including branch management, pull reque
|
|
|
29
29
|
|
|
30
30
|
### 1. Pre-Completion Validation
|
|
31
31
|
- [ ] **All PRD checkboxes completed**: Verify every requirement is implemented and tested
|
|
32
|
-
- [ ] **All tests passing**: Run project test suite to ensure quality standards (skip if documentation-only)
|
|
33
32
|
- [ ] **Documentation updated**: All user-facing docs reflect implemented functionality
|
|
34
33
|
- [ ] **No outstanding blockers**: All dependencies resolved and technical debt addressed
|
|
35
34
|
- [ ] **Update PRD status**: Mark PRD as "Complete" with completion date
|
|
35
|
+
- [ ] **Archive PRD file**: Move completed PRD to `./prds/done/` directory to maintain project organization
|
|
36
|
+
|
|
37
|
+
**Note**: Tests will run automatically in the CI/CD pipeline when the PR is created. Do not run tests locally during the completion workflow.
|
|
36
38
|
|
|
37
39
|
### 2. Branch and Commit Management
|
|
38
40
|
|
|
@@ -92,6 +94,7 @@ Complete the PRD implementation workflow including branch management, pull reque
|
|
|
92
94
|
- [ ] **Monitor for issues**: Watch for any post-deployment problems
|
|
93
95
|
|
|
94
96
|
### 5. Issue Closure
|
|
97
|
+
- [ ] **Update issue PRD link**: Update the GitHub issue description to reference the new PRD path in `./prds/done/` directory
|
|
95
98
|
- [ ] **Close GitHub issue**: Add final completion comment and close
|
|
96
99
|
- [ ] **Archive artifacts**: Save any temporary files or testing data if needed
|
|
97
100
|
- [ ] **Team notification**: Announce feature completion to relevant stakeholders
|