@vfarcic/dot-ai 0.65.0 → 0.67.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/dist/core/capability-vector-service.d.ts +3 -3
- package/dist/core/capability-vector-service.d.ts.map +1 -1
- package/dist/core/capability-vector-service.js +4 -13
- package/dist/core/claude.d.ts +31 -0
- package/dist/core/claude.d.ts.map +1 -1
- package/dist/core/claude.js +64 -0
- package/dist/tools/recommend.d.ts +2 -0
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +75 -85
- package/dist/tools/version.d.ts.map +1 -1
- package/dist/tools/version.js +14 -29
- package/package.json +1 -1
- package/prompts/intent-analysis.md +122 -0
- package/shared-prompts/prd-done.md +13 -1
- package/prompts/intent-validation.md +0 -74
|
@@ -52,10 +52,10 @@ export declare class CapabilityVectorService extends BaseVectorService<ResourceC
|
|
|
52
52
|
*/
|
|
53
53
|
searchCapabilities(intent: string, options?: CapabilitySearchOptions): Promise<BaseSearchResult<ResourceCapability>[]>;
|
|
54
54
|
/**
|
|
55
|
-
* Get capability by ID
|
|
56
|
-
*
|
|
55
|
+
* Get capability by ID
|
|
56
|
+
* Used by MCP operations with IDs from list/search results
|
|
57
57
|
*/
|
|
58
|
-
getCapability(
|
|
58
|
+
getCapability(id: string): Promise<ResourceCapability | null>;
|
|
59
59
|
/**
|
|
60
60
|
* Delete capability by resource name
|
|
61
61
|
*/
|
|
@@ -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,WAA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,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,kBAAkB;IAczE;;OAEG;IACG,eAAe,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE;;OAEG;IACG,kBAAkB,CACtB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,CAAC;IAoBlD;;;OAGG;IACG,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAInE;;OAEG;IACG,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3D;;OAEG;IACG,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD;;OAEG;IACG,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5C;;OAEG;IACG,kBAAkB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAIvE;;OAEG;IACG,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC;CAK9C"}
|
|
@@ -90,20 +90,11 @@ class CapabilityVectorService extends base_vector_service_1.BaseVectorService {
|
|
|
90
90
|
return results;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
* Get capability by ID
|
|
94
|
-
*
|
|
93
|
+
* Get capability by ID
|
|
94
|
+
* Used by MCP operations with IDs from list/search results
|
|
95
95
|
*/
|
|
96
|
-
async getCapability(
|
|
97
|
-
|
|
98
|
-
let capability = await this.getData(idOrResourceName);
|
|
99
|
-
if (!capability) {
|
|
100
|
-
// If not found, try generating ID from resource name (for direct resource queries)
|
|
101
|
-
const generatedId = capabilities_1.CapabilityInferenceEngine.generateCapabilityId(idOrResourceName);
|
|
102
|
-
if (generatedId !== idOrResourceName) {
|
|
103
|
-
capability = await this.getData(generatedId);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return capability;
|
|
96
|
+
async getCapability(id) {
|
|
97
|
+
return await this.getData(id);
|
|
107
98
|
}
|
|
108
99
|
/**
|
|
109
100
|
* Delete capability by resource name
|
package/dist/core/claude.d.ts
CHANGED
|
@@ -20,6 +20,29 @@ export interface Interaction {
|
|
|
20
20
|
success: boolean;
|
|
21
21
|
timestamp?: Date;
|
|
22
22
|
}
|
|
23
|
+
export type ImpactLevel = 'HIGH' | 'MEDIUM' | 'LOW';
|
|
24
|
+
export type ClarificationCategory = 'TECHNICAL_SPECIFICATIONS' | 'ARCHITECTURAL_CONTEXT' | 'OPERATIONAL_REQUIREMENTS' | 'SECURITY_COMPLIANCE' | 'ORGANIZATIONAL_ALIGNMENT';
|
|
25
|
+
export interface ClarificationOpportunity {
|
|
26
|
+
category: ClarificationCategory;
|
|
27
|
+
missingContext: string;
|
|
28
|
+
impactLevel: ImpactLevel;
|
|
29
|
+
reasoning: string;
|
|
30
|
+
suggestedQuestions?: string[];
|
|
31
|
+
patternAlignment?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IntentAnalysisResult {
|
|
34
|
+
clarificationOpportunities: ClarificationOpportunity[];
|
|
35
|
+
overallAssessment: {
|
|
36
|
+
enhancementPotential: ImpactLevel;
|
|
37
|
+
primaryGaps: string[];
|
|
38
|
+
recommendedFocus: string;
|
|
39
|
+
};
|
|
40
|
+
intentQuality: {
|
|
41
|
+
currentSpecificity: string;
|
|
42
|
+
strengthAreas: string[];
|
|
43
|
+
improvementAreas: string[];
|
|
44
|
+
};
|
|
45
|
+
}
|
|
23
46
|
export declare class ClaudeIntegration {
|
|
24
47
|
private client;
|
|
25
48
|
private apiKey;
|
|
@@ -50,6 +73,14 @@ export declare class ClaudeIntegration {
|
|
|
50
73
|
analyzeError(error: string, _context?: any): Promise<string>;
|
|
51
74
|
suggestImprovements(_manifest: string): Promise<string[]>;
|
|
52
75
|
processUserInput(input: string, context?: any): Promise<any>;
|
|
76
|
+
/**
|
|
77
|
+
* Analyze user intent for clarification opportunities
|
|
78
|
+
*
|
|
79
|
+
* @param intent User's deployment intent
|
|
80
|
+
* @param organizationalPatterns Available organizational patterns context
|
|
81
|
+
* @returns Analysis result with clarification opportunities
|
|
82
|
+
*/
|
|
83
|
+
analyzeIntentForClarification(intent: string, organizationalPatterns?: string): Promise<IntentAnalysisResult>;
|
|
53
84
|
isInitialized(): boolean;
|
|
54
85
|
}
|
|
55
86
|
//# sourceMappingURL=claude.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/core/claude.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,mBAAmB,CAAa;IACxC,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,SAAS,CAAU;gBAEf,MAAM,EAAE,MAAM;IAY1B,OAAO,CAAC,cAAc;IActB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAQ5B;;OAEG;IACH,OAAO,CAAC,eAAe;IAOvB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA+BrB,WAAW,CAAC,OAAO,EAAE,MAAM,EAA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O,CAAC,YAAY,CAAC;IA6CtE,iBAAiB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAS1D,qBAAqB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAIrD,sBAAsB,IAAI,GAAG,EAAE;IAI/B,wBAAwB,IAAI,IAAI;IAI1B,gBAAgB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IA+B5C,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAS5D,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAazD,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IA2BlE;;;;;;OAMG;IACG,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,sBAAsB,GAAE,MAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAkEvH,aAAa,IAAI,OAAO;CAGzB"}
|
package/dist/core/claude.js
CHANGED
|
@@ -318,6 +318,70 @@ spec:
|
|
|
318
318
|
suggestions: ['Start by exploring your cluster resources']
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* Analyze user intent for clarification opportunities
|
|
323
|
+
*
|
|
324
|
+
* @param intent User's deployment intent
|
|
325
|
+
* @param organizationalPatterns Available organizational patterns context
|
|
326
|
+
* @returns Analysis result with clarification opportunities
|
|
327
|
+
*/
|
|
328
|
+
async analyzeIntentForClarification(intent, organizationalPatterns = '') {
|
|
329
|
+
if (!this.client) {
|
|
330
|
+
throw new Error('Claude client not initialized');
|
|
331
|
+
}
|
|
332
|
+
try {
|
|
333
|
+
// Load intent analysis prompt template
|
|
334
|
+
const promptPath = path.join(__dirname, '..', '..', 'prompts', 'intent-analysis.md');
|
|
335
|
+
const template = fs.readFileSync(promptPath, 'utf8');
|
|
336
|
+
// Replace template variables
|
|
337
|
+
const analysisPrompt = template
|
|
338
|
+
.replaceAll('{intent}', intent)
|
|
339
|
+
.replaceAll('{organizational_patterns}', organizationalPatterns || 'No specific organizational patterns available');
|
|
340
|
+
// Send to Claude for analysis
|
|
341
|
+
const response = await this.sendMessage(analysisPrompt, 'intent-analysis');
|
|
342
|
+
// Parse JSON response with robust error handling
|
|
343
|
+
let jsonContent = response.content;
|
|
344
|
+
// Try to find JSON object wrapped in code blocks
|
|
345
|
+
const codeBlockMatch = response.content.match(/```(?:json)?\s*(\{[\s\S]*?\})\s*```/);
|
|
346
|
+
if (codeBlockMatch) {
|
|
347
|
+
jsonContent = codeBlockMatch[1];
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
// Try to find JSON object that starts with { and find the matching closing }
|
|
351
|
+
const jsonMatch = response.content.match(/\{[\s\S]*\}/);
|
|
352
|
+
if (jsonMatch) {
|
|
353
|
+
jsonContent = jsonMatch[0];
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
// Parse the JSON
|
|
357
|
+
const analysisResult = JSON.parse(jsonContent);
|
|
358
|
+
// Validate the response structure
|
|
359
|
+
if (!analysisResult.clarificationOpportunities || !Array.isArray(analysisResult.clarificationOpportunities)) {
|
|
360
|
+
throw new Error('Invalid analysis result structure: missing clarificationOpportunities array');
|
|
361
|
+
}
|
|
362
|
+
if (!analysisResult.overallAssessment || !analysisResult.intentQuality) {
|
|
363
|
+
throw new Error('Invalid analysis result structure: missing overallAssessment or intentQuality');
|
|
364
|
+
}
|
|
365
|
+
return analysisResult;
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
// If parsing fails or API call fails, return a fallback minimal analysis
|
|
369
|
+
console.warn('Intent analysis failed, returning minimal analysis:', error);
|
|
370
|
+
return {
|
|
371
|
+
clarificationOpportunities: [],
|
|
372
|
+
overallAssessment: {
|
|
373
|
+
enhancementPotential: 'LOW',
|
|
374
|
+
primaryGaps: [],
|
|
375
|
+
recommendedFocus: 'Proceed with original intent - analysis unavailable'
|
|
376
|
+
},
|
|
377
|
+
intentQuality: {
|
|
378
|
+
currentSpecificity: 'Unable to analyze - using original intent',
|
|
379
|
+
strengthAreas: ['User provided clear deployment intent'],
|
|
380
|
+
improvementAreas: []
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
}
|
|
321
385
|
isInitialized() {
|
|
322
386
|
return this.client !== null;
|
|
323
387
|
}
|
|
@@ -8,12 +8,14 @@ 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.";
|
|
9
9
|
export declare const RECOMMEND_TOOL_INPUT_SCHEMA: {
|
|
10
10
|
intent: z.ZodString;
|
|
11
|
+
final: z.ZodOptional<z.ZodBoolean>;
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
14
|
* Direct MCP tool handler for recommend functionality
|
|
14
15
|
*/
|
|
15
16
|
export declare function handleRecommendTool(args: {
|
|
16
17
|
intent: string;
|
|
18
|
+
final?: boolean;
|
|
17
19
|
}, dotAI: DotAI, logger: Logger, requestId: string): Promise<{
|
|
18
20
|
content: {
|
|
19
21
|
type: 'text';
|
|
@@ -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;AAQhD,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,0BAA0B,+JAA+J,CAAC;AAGvM,eAAO,MAAM,2BAA2B
|
|
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;AAQhD,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,0BAA0B,+JAA+J,CAAC;AAGvM,eAAO,MAAM,2BAA2B;;;CAGvC,CAAC;AA2EF;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,EACzC,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,CAuQxD"}
|
package/dist/tools/recommend.js
CHANGED
|
@@ -52,74 +52,36 @@ exports.RECOMMEND_TOOL_NAME = 'recommend';
|
|
|
52
52
|
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.';
|
|
53
53
|
// Zod schema for MCP registration
|
|
54
54
|
exports.RECOMMEND_TOOL_INPUT_SCHEMA = {
|
|
55
|
-
intent: zod_1.z.string().min(1).max(1000).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"')
|
|
55
|
+
intent: zod_1.z.string().min(1).max(1000).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"'),
|
|
56
|
+
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.')
|
|
56
57
|
};
|
|
57
58
|
/**
|
|
58
|
-
*
|
|
59
|
+
* Analyze intent for clarification opportunities using AI
|
|
59
60
|
*/
|
|
60
|
-
async function
|
|
61
|
+
async function analyzeIntentForClarification(intent, claudeIntegration, logger) {
|
|
61
62
|
try {
|
|
62
|
-
//
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
// Replace template variables
|
|
66
|
-
const validationPrompt = template.replace('{intent}', intent);
|
|
67
|
-
// Send to Claude for validation
|
|
68
|
-
const response = await claudeIntegration.sendMessage(validationPrompt, 'intent-validation');
|
|
69
|
-
// Parse JSON response with robust error handling
|
|
70
|
-
let jsonContent = response.content;
|
|
71
|
-
// Try to find JSON object wrapped in code blocks
|
|
72
|
-
const codeBlockMatch = response.content.match(/```(?:json)?\s*(\{[\s\S]*?\})\s*```/);
|
|
73
|
-
if (codeBlockMatch) {
|
|
74
|
-
jsonContent = codeBlockMatch[1];
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
// Try to find JSON object that starts with { and find the matching closing }
|
|
78
|
-
const startIndex = response.content.indexOf('{');
|
|
79
|
-
if (startIndex !== -1) {
|
|
80
|
-
let braceCount = 0;
|
|
81
|
-
let endIndex = startIndex;
|
|
82
|
-
for (let i = startIndex; i < response.content.length; i++) {
|
|
83
|
-
if (response.content[i] === '{')
|
|
84
|
-
braceCount++;
|
|
85
|
-
if (response.content[i] === '}')
|
|
86
|
-
braceCount--;
|
|
87
|
-
if (braceCount === 0) {
|
|
88
|
-
endIndex = i;
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
if (braceCount === 0) {
|
|
93
|
-
jsonContent = response.content.substring(startIndex, endIndex + 1);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
const validation = JSON.parse(jsonContent.trim());
|
|
98
|
-
// Validate response structure
|
|
99
|
-
if (typeof validation.isSpecific !== 'boolean' ||
|
|
100
|
-
typeof validation.reason !== 'string' ||
|
|
101
|
-
!Array.isArray(validation.suggestions)) {
|
|
102
|
-
throw new Error('AI response has invalid structure');
|
|
103
|
-
}
|
|
104
|
-
// If intent is not specific enough, throw error with suggestions
|
|
105
|
-
if (!validation.isSpecific) {
|
|
106
|
-
const suggestions = validation.suggestions.length
|
|
107
|
-
? validation.suggestions.map((s) => `• ${s}`).join('\n')
|
|
108
|
-
: '• Include specific technology (Node.js, PostgreSQL, React, etc.)\n• Describe the purpose or function\n• Add context about requirements';
|
|
109
|
-
throw new Error(`Intent needs more specificity: ${validation.reason}\n\n` +
|
|
110
|
-
`Suggestions to improve your intent:\n${suggestions}\n\n` +
|
|
111
|
-
`Original intent: "${intent}"`);
|
|
112
|
-
}
|
|
63
|
+
// Use the Claude service method for intent analysis
|
|
64
|
+
const analysisResult = await claudeIntegration.analyzeIntentForClarification(intent);
|
|
65
|
+
return analysisResult;
|
|
113
66
|
}
|
|
114
67
|
catch (error) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
68
|
+
logger.warn?.('Intent analysis failed, proceeding without clarification', {
|
|
69
|
+
error: error instanceof Error ? error.message : String(error)
|
|
70
|
+
});
|
|
71
|
+
// Return minimal analysis that indicates no clarification available
|
|
72
|
+
return {
|
|
73
|
+
clarificationOpportunities: [],
|
|
74
|
+
overallAssessment: {
|
|
75
|
+
enhancementPotential: 'LOW',
|
|
76
|
+
primaryGaps: [],
|
|
77
|
+
recommendedFocus: 'Proceeding with original intent - analysis unavailable'
|
|
78
|
+
},
|
|
79
|
+
intentQuality: {
|
|
80
|
+
currentSpecificity: 'Analysis unavailable',
|
|
81
|
+
strengthAreas: ['User provided deployment intent'],
|
|
82
|
+
improvementAreas: []
|
|
83
|
+
}
|
|
84
|
+
};
|
|
123
85
|
}
|
|
124
86
|
}
|
|
125
87
|
/**
|
|
@@ -197,38 +159,66 @@ async function handleRecommendTool(args, dotAI, logger, requestId) {
|
|
|
197
159
|
]
|
|
198
160
|
}, error instanceof Error ? error : new Error(String(error)));
|
|
199
161
|
}
|
|
200
|
-
// Ensure cluster connectivity before proceeding
|
|
201
|
-
await (0, cluster_utils_1.ensureClusterConnection)(dotAI, logger, requestId, 'RecommendTool');
|
|
202
162
|
logger.info('Starting resource recommendation process', {
|
|
203
163
|
requestId,
|
|
204
164
|
intent: args.intent,
|
|
205
165
|
hasApiKey: !!claudeApiKey
|
|
206
166
|
});
|
|
207
|
-
//
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
167
|
+
// Initialize Claude integration for potential clarification analysis
|
|
168
|
+
const claudeIntegration = new claude_1.ClaudeIntegration(claudeApiKey);
|
|
169
|
+
// Check if intent clarification is needed (unless final=true)
|
|
170
|
+
if (!args.final) {
|
|
171
|
+
logger.debug('Analyzing intent for clarification opportunities', { requestId, intent: args.intent });
|
|
172
|
+
const analysisResult = await analyzeIntentForClarification(args.intent, claudeIntegration, logger);
|
|
173
|
+
// If clarification opportunities exist, return them to the client agent
|
|
174
|
+
if (analysisResult.clarificationOpportunities &&
|
|
175
|
+
analysisResult.clarificationOpportunities.length > 0 &&
|
|
176
|
+
analysisResult.overallAssessment.enhancementPotential !== 'LOW') {
|
|
177
|
+
// Convert analysis to structured questions for client agent
|
|
178
|
+
const questions = analysisResult.clarificationOpportunities
|
|
179
|
+
.filter((opp) => opp.impactLevel === 'HIGH' || opp.impactLevel === 'MEDIUM')
|
|
180
|
+
.slice(0, 5) // Limit to 5 most important questions
|
|
181
|
+
.map((opp, index) => ({
|
|
182
|
+
id: `clarification-${index + 1}`,
|
|
183
|
+
question: opp.suggestedQuestions?.[0] || `Can you provide more details about ${opp.missingContext.toLowerCase()}?`,
|
|
184
|
+
category: opp.category,
|
|
185
|
+
reasoning: opp.reasoning,
|
|
186
|
+
examples: opp.suggestedQuestions?.slice(1) || []
|
|
187
|
+
}));
|
|
188
|
+
const clarificationResponse = {
|
|
189
|
+
status: 'clarification_available',
|
|
190
|
+
intent: args.intent,
|
|
191
|
+
analysis: {
|
|
192
|
+
enhancementPotential: analysisResult.overallAssessment.enhancementPotential,
|
|
193
|
+
recommendedFocus: analysisResult.overallAssessment.recommendedFocus,
|
|
194
|
+
currentSpecificity: analysisResult.intentQuality.currentSpecificity,
|
|
195
|
+
strengthAreas: analysisResult.intentQuality.strengthAreas,
|
|
196
|
+
improvementAreas: analysisResult.intentQuality.improvementAreas
|
|
197
|
+
},
|
|
198
|
+
questions,
|
|
199
|
+
agentInstructions: 'Present these clarification questions to help the user provide a more specific intent. When the user provides a refined intent (or confirms the current intent is sufficient), call the recommend tool again with final: true to proceed with recommendations.'
|
|
200
|
+
};
|
|
201
|
+
logger.debug('Returning clarification questions', {
|
|
220
202
|
requestId,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
203
|
+
questionsCount: questions.length,
|
|
204
|
+
enhancementPotential: analysisResult.overallAssessment.enhancementPotential
|
|
205
|
+
});
|
|
206
|
+
return {
|
|
207
|
+
content: [
|
|
208
|
+
{
|
|
209
|
+
type: 'text',
|
|
210
|
+
text: JSON.stringify(clarificationResponse, null, 2)
|
|
211
|
+
}
|
|
226
212
|
]
|
|
227
|
-
}
|
|
213
|
+
};
|
|
228
214
|
}
|
|
229
|
-
|
|
230
|
-
logger.warn('Intent validation failed, continuing with recommendation', { requestId, error: error instanceof Error ? error.message : 'Unknown error' });
|
|
215
|
+
logger.debug('No significant clarification opportunities found, proceeding with recommendations', { requestId });
|
|
231
216
|
}
|
|
217
|
+
else {
|
|
218
|
+
logger.debug('Skipping intent clarification (final=true), proceeding directly with recommendations', { requestId });
|
|
219
|
+
}
|
|
220
|
+
// Ensure cluster connectivity before proceeding with recommendations
|
|
221
|
+
await (0, cluster_utils_1.ensureClusterConnection)(dotAI, logger, requestId, 'RecommendTool');
|
|
232
222
|
// Initialize AI-powered ResourceRecommender
|
|
233
223
|
const rankingConfig = { claudeApiKey };
|
|
234
224
|
const recommender = new schema_1.ResourceRecommender(rankingConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/tools/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,wBAAwB,gMAAgM,CAAC;AACtO,eAAO,MAAM,yBAAyB,IAAK,CAAC;AAE5C,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE;QACR,SAAS,EAAE,OAAO,CAAC;QACnB,GAAG,EAAE,MAAM,CAAC;QACZ,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,SAAS,EAAE;QACT,SAAS,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf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K,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,SAAS,EAAE;QACT,SAAS,EAAE,OAAO,CAAC;QACnB,aAAa,EAAE,OAAO,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,YAAY,EAAE;QACZ,WAAW,EAAE,OAAO,CAAC;QACrB,eAAe,EAAE,OAAO,CAAC;QACzB,oBAAoB,EAAE,OAAO,CAAC;QAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AA+MD;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAqB5C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAsEd"}
|
package/dist/tools/version.js
CHANGED
|
@@ -134,21 +134,9 @@ async function getCapabilityStatus() {
|
|
|
134
134
|
await capabilityService.initialize();
|
|
135
135
|
storedCount = await capabilityService.getCapabilitiesCount();
|
|
136
136
|
collectionAccessible = true;
|
|
137
|
-
// Test
|
|
138
|
-
const testCapability = {
|
|
139
|
-
resourceName: 'test.version.diagnostic',
|
|
140
|
-
capabilities: ['version-test'],
|
|
141
|
-
providers: ['test'],
|
|
142
|
-
abstractions: ['diagnostic'],
|
|
143
|
-
complexity: 'low',
|
|
144
|
-
description: 'Version tool diagnostic test capability',
|
|
145
|
-
useCase: 'Testing capability storage pipeline',
|
|
146
|
-
confidence: 0.95, // Should be 0-1 range, not 0-100
|
|
147
|
-
analyzedAt: timestamp
|
|
148
|
-
};
|
|
149
|
-
// Test embedding generation directly first
|
|
137
|
+
// Test MCP-used operations: verify vector operations work
|
|
150
138
|
const embeddingService = new index_1.EmbeddingService();
|
|
151
|
-
const testEmbedding = await embeddingService.generateEmbedding('test
|
|
139
|
+
const testEmbedding = await embeddingService.generateEmbedding('diagnostic test query');
|
|
152
140
|
if (!testEmbedding || testEmbedding.length !== 1536) {
|
|
153
141
|
throw new Error(`Embedding dimension mismatch: expected 1536, got ${testEmbedding?.length || 'null'} dimensions`);
|
|
154
142
|
}
|
|
@@ -156,31 +144,28 @@ async function getCapabilityStatus() {
|
|
|
156
144
|
if (testEmbedding.some(val => !Number.isFinite(val))) {
|
|
157
145
|
throw new Error('Embedding contains invalid values (NaN or Infinity)');
|
|
158
146
|
}
|
|
159
|
-
//
|
|
160
|
-
await capabilityService.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (!retrieved) {
|
|
164
|
-
throw new Error('Test capability storage failed - could not retrieve stored test data');
|
|
147
|
+
// Test core MCP operations: verify we can list capabilities (most basic operation)
|
|
148
|
+
const capabilities = await capabilityService.getAllCapabilities(1);
|
|
149
|
+
if (capabilities.length === 0 && storedCount > 0) {
|
|
150
|
+
throw new Error('Capability listing failed - cannot retrieve stored capabilities');
|
|
165
151
|
}
|
|
166
|
-
// Clean up test capability
|
|
167
|
-
await capabilityService.deleteCapability('test.version.diagnostic');
|
|
168
152
|
}
|
|
169
153
|
catch (error) {
|
|
170
154
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
171
|
-
// Check for
|
|
172
|
-
const isDimensionMismatch = errorMessage.toLowerCase().includes('dimension')
|
|
173
|
-
errorMessage.toLowerCase().includes('vector')
|
|
174
|
-
errorMessage.toLowerCase().includes('size')
|
|
175
|
-
|
|
155
|
+
// Check for actual dimension mismatch errors (be specific)
|
|
156
|
+
const isDimensionMismatch = (errorMessage.toLowerCase().includes('dimension') &&
|
|
157
|
+
(errorMessage.toLowerCase().includes('mismatch') || errorMessage.toLowerCase().includes('expected'))) || (errorMessage.toLowerCase().includes('vector') &&
|
|
158
|
+
errorMessage.toLowerCase().includes('size'));
|
|
159
|
+
// Since core MCP functionality works (list, search, ID-based get), downgrade severity
|
|
160
|
+
const isCoreSystemWorking = vectorDBHealthy && collectionAccessible && (storedCount || 0) > 0;
|
|
176
161
|
return {
|
|
177
|
-
systemReady:
|
|
162
|
+
systemReady: isCoreSystemWorking, // Core system is ready if MCP operations work
|
|
178
163
|
vectorDBHealthy: true,
|
|
179
164
|
collectionAccessible: collectionAccessible,
|
|
180
165
|
storedCount: storedCount,
|
|
181
166
|
error: isDimensionMismatch ?
|
|
182
167
|
`Vector dimension mismatch detected: ${errorMessage}. The capabilities collection exists but has incompatible vector dimensions. Delete the collection to allow recreation with correct dimensions.` :
|
|
183
|
-
`Capability
|
|
168
|
+
`Capability system test failed: ${errorMessage}`,
|
|
184
169
|
lastDiagnosis: timestamp,
|
|
185
170
|
// Add raw error for debugging
|
|
186
171
|
rawError: errorMessage
|
package/package.json
CHANGED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Intent Analysis for Clarification Opportunities
|
|
2
|
+
|
|
3
|
+
You are an expert Kubernetes deployment consultant analyzing user intents to identify opportunities for clarification that would lead to better deployment recommendations.
|
|
4
|
+
|
|
5
|
+
## User Intent
|
|
6
|
+
{intent}
|
|
7
|
+
|
|
8
|
+
## Organizational Patterns Context
|
|
9
|
+
{organizational_patterns}
|
|
10
|
+
|
|
11
|
+
## Analysis Framework
|
|
12
|
+
|
|
13
|
+
Analyze the user's intent for **clarification opportunities** that would significantly improve the quality and relevance of deployment recommendations. Focus on identifying missing context that, when provided, would lead to more targeted and appropriate solutions.
|
|
14
|
+
|
|
15
|
+
### Clarification Categories
|
|
16
|
+
|
|
17
|
+
**1. TECHNICAL SPECIFICATIONS**
|
|
18
|
+
- Specific technology versions, frameworks, or implementations
|
|
19
|
+
- Performance requirements (CPU, memory, throughput, latency)
|
|
20
|
+
- Scalability expectations (traffic patterns, growth projections)
|
|
21
|
+
- Storage requirements (data persistence, volume sizes, access patterns)
|
|
22
|
+
|
|
23
|
+
**2. ARCHITECTURAL CONTEXT**
|
|
24
|
+
- Application architecture patterns (microservices, monolith, serverless)
|
|
25
|
+
- Integration requirements (databases, external services, APIs)
|
|
26
|
+
- Communication patterns (synchronous, asynchronous, event-driven)
|
|
27
|
+
- Deployment patterns (blue-green, rolling, canary)
|
|
28
|
+
|
|
29
|
+
**3. OPERATIONAL REQUIREMENTS**
|
|
30
|
+
- Environment targets (development, staging, production)
|
|
31
|
+
- High availability and disaster recovery needs
|
|
32
|
+
- Monitoring and observability requirements
|
|
33
|
+
- Backup and maintenance procedures
|
|
34
|
+
|
|
35
|
+
**4. SECURITY & COMPLIANCE**
|
|
36
|
+
- Authentication and authorization requirements
|
|
37
|
+
- Data classification and encryption needs
|
|
38
|
+
- Compliance frameworks (GDPR, HIPAA, SOC2, PCI-DSS)
|
|
39
|
+
- Network security policies and isolation requirements
|
|
40
|
+
|
|
41
|
+
**5. ORGANIZATIONAL ALIGNMENT**
|
|
42
|
+
- Team responsibilities and ownership models
|
|
43
|
+
- Existing infrastructure integration points
|
|
44
|
+
- Budget and resource constraints
|
|
45
|
+
- Timeline and rollout preferences
|
|
46
|
+
|
|
47
|
+
### Opportunity Assessment
|
|
48
|
+
|
|
49
|
+
For each category, evaluate:
|
|
50
|
+
- **Missing Context**: What specific information is absent?
|
|
51
|
+
- **Impact Level**: How much would this information improve recommendations?
|
|
52
|
+
- **Question Potential**: Can this be addressed with a clear, actionable question?
|
|
53
|
+
- **Pattern Alignment**: Does this relate to organizational patterns or standards?
|
|
54
|
+
|
|
55
|
+
### Question Generation Priorities
|
|
56
|
+
|
|
57
|
+
**HIGH PRIORITY**: Missing context that would fundamentally change the recommended solution
|
|
58
|
+
**MEDIUM PRIORITY**: Information that would optimize the deployment for the user's environment
|
|
59
|
+
**LOW PRIORITY**: Nice-to-have details that provide minor refinements
|
|
60
|
+
|
|
61
|
+
## Organizational Pattern Integration
|
|
62
|
+
|
|
63
|
+
Use the provided organizational patterns to inform your analysis:
|
|
64
|
+
- Identify alignment opportunities with existing patterns
|
|
65
|
+
- Recognize potential governance requirements
|
|
66
|
+
- Consider standard approaches within the organization
|
|
67
|
+
- Highlight areas where clarification could ensure compliance
|
|
68
|
+
|
|
69
|
+
## Analysis Guidelines
|
|
70
|
+
|
|
71
|
+
**DO NOT suggest clarification for:**
|
|
72
|
+
- Information that is clearly implied by the intent
|
|
73
|
+
- Standard Kubernetes configurations that have sensible defaults
|
|
74
|
+
- Details that don't significantly impact solution recommendations
|
|
75
|
+
- Overly technical specifics that most users wouldn't know
|
|
76
|
+
|
|
77
|
+
**DO suggest clarification for:**
|
|
78
|
+
- Ambiguous requirements that could lead to multiple valid interpretations
|
|
79
|
+
- Missing context that would change the fundamental solution approach
|
|
80
|
+
- Organizational-specific requirements that align with provided patterns
|
|
81
|
+
- Performance, security, or compliance needs that aren't specified
|
|
82
|
+
|
|
83
|
+
## Response Format
|
|
84
|
+
|
|
85
|
+
Respond with ONLY a JSON object in this exact format:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"clarificationOpportunities": [
|
|
90
|
+
{
|
|
91
|
+
"category": "TECHNICAL_SPECIFICATIONS|ARCHITECTURAL_CONTEXT|OPERATIONAL_REQUIREMENTS|SECURITY_COMPLIANCE|ORGANIZATIONAL_ALIGNMENT",
|
|
92
|
+
"missingContext": "Specific description of what context is missing",
|
|
93
|
+
"impactLevel": "HIGH|MEDIUM|LOW",
|
|
94
|
+
"reasoning": "Why this clarification would improve recommendations",
|
|
95
|
+
"suggestedQuestions": [
|
|
96
|
+
"Specific question that could gather this information",
|
|
97
|
+
"Alternative question approach for the same context"
|
|
98
|
+
],
|
|
99
|
+
"patternAlignment": "How this relates to organizational patterns (if applicable)"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"overallAssessment": {
|
|
103
|
+
"enhancementPotential": "HIGH|MEDIUM|LOW",
|
|
104
|
+
"primaryGaps": ["Most important missing context area 1", "Most important missing context area 2"],
|
|
105
|
+
"recommendedFocus": "The single most valuable clarification opportunity"
|
|
106
|
+
},
|
|
107
|
+
"intentQuality": {
|
|
108
|
+
"currentSpecificity": "Assessment of how specific the intent currently is",
|
|
109
|
+
"strengthAreas": ["What aspects of the intent are already clear"],
|
|
110
|
+
"improvementAreas": ["What aspects would benefit most from clarification"]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Important Notes
|
|
116
|
+
|
|
117
|
+
- Focus on **meaningful clarification opportunities** that would lead to measurably better recommendations
|
|
118
|
+
- Consider the **user's perspective** - suggest questions they can actually answer
|
|
119
|
+
- **Prioritize ruthlessly** - only suggest clarification that provides significant value
|
|
120
|
+
- **Leverage organizational patterns** to identify governance and compliance opportunities
|
|
121
|
+
- **Be practical** - ensure suggested questions are actionable and specific
|
|
122
|
+
- **Quality over quantity** - fewer high-impact opportunities are better than many low-impact ones
|
|
@@ -58,9 +58,21 @@ Complete the PRD implementation workflow including branch management, pull reque
|
|
|
58
58
|
### 4. Review and Merge Process
|
|
59
59
|
- [ ] **Check ongoing processes**: Use `gh pr checks [pr-number]` to check for any ongoing CI/CD, security analysis, or automated reviews (CodeRabbit, CodeQL, etc.)
|
|
60
60
|
- [ ] **Check PR details**: Use `gh pr view [pr-number]` to check for human review comments and PR metadata
|
|
61
|
+
- [ ] **Review all automated feedback**: Check PR comments section for automated code review feedback (bots, linters, analyzers)
|
|
62
|
+
- Look for actionable suggestions about code quality, security, performance, or maintainability
|
|
63
|
+
- Check for recommendations about test coverage, error handling, or architectural improvements
|
|
64
|
+
- Review suggestions for refactoring, type safety, or code organization
|
|
65
|
+
- [ ] **Assess feedback priority**: Categorize review feedback
|
|
66
|
+
- **Critical**: Security issues, breaking changes, test failures - MUST address before merge
|
|
67
|
+
- **Important**: Code quality, maintainability, performance - SHOULD address for production readiness
|
|
68
|
+
- **Optional**: Style preferences, minor optimizations - MAY address based on project standards
|
|
61
69
|
- [ ] **Wait for completion**: Do NOT merge if checks show pending processes or PR comments indicate reviews still in progress
|
|
62
|
-
- [ ] **Address review feedback**: Make
|
|
70
|
+
- [ ] **Address review feedback**: Make required changes from code review (both automated and human)
|
|
71
|
+
- Create additional commits on the feature branch to address feedback
|
|
72
|
+
- Update tests if needed to cover suggested improvements
|
|
73
|
+
- Document any feedback that was intentionally not addressed and why
|
|
63
74
|
- [ ] **Verify all checks pass**: Ensure all CI/CD, tests, security analysis, and automated processes are complete and passing
|
|
75
|
+
- [ ] **Final review**: Confirm the PR addresses the original PRD requirements and maintains code quality
|
|
64
76
|
- [ ] **Merge to main**: Complete the pull request merge only after all feedback addressed and processes complete
|
|
65
77
|
- [ ] **Verify deployment**: Ensure feature works in production environment
|
|
66
78
|
- [ ] **Monitor for issues**: Watch for any post-deployment problems
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# Intent Validation for Kubernetes Deployment Recommendations
|
|
2
|
-
|
|
3
|
-
You are a Kubernetes expert analyzing user intents for deployment recommendations. Evaluate whether this intent provides enough specificity to generate meaningful Kubernetes deployment recommendations.
|
|
4
|
-
|
|
5
|
-
## User Intent
|
|
6
|
-
{intent}
|
|
7
|
-
|
|
8
|
-
## Evaluation Criteria
|
|
9
|
-
|
|
10
|
-
An intent is **TOO VAGUE OR GENERIC** if it:
|
|
11
|
-
- Completely generic terms without context (e.g., just "app", "something", "service" alone)
|
|
12
|
-
- Single action words without objects (e.g., "deploy", "create", "setup", "run" alone)
|
|
13
|
-
- Meaningless requests (e.g., "help", "please", "can you")
|
|
14
|
-
- Extremely short without any technical context (1-2 words like "database", "container")
|
|
15
|
-
|
|
16
|
-
An intent is **SPECIFIC ENOUGH** if it includes ANY of:
|
|
17
|
-
- Specific technology or framework (Node.js, PostgreSQL, Redis, React, Python, Prometheus, Grafana, etc.)
|
|
18
|
-
- Clear architectural pattern (stateless app, microservice, web server, REST API, operator, etc.)
|
|
19
|
-
- Application type or purpose (frontend, backend, database, cache, queue, monitoring, storage, etc.)
|
|
20
|
-
- Infrastructure component (load balancer, ingress controller, persistent storage, networking, etc.)
|
|
21
|
-
- Deployment context that helps understand Kubernetes resource needs
|
|
22
|
-
|
|
23
|
-
**IMPORTANT**: Be generous in accepting intents. Focus on rejecting only truly meaningless requests. Terms like "stateless app", "web application", "microservice", "database cluster" provide sufficient Kubernetes deployment context.
|
|
24
|
-
|
|
25
|
-
## Examples
|
|
26
|
-
|
|
27
|
-
**TOO VAGUE:**
|
|
28
|
-
- "create an app" (no architectural or technical context)
|
|
29
|
-
- "deploy something" (completely generic)
|
|
30
|
-
- "database" (single word, no context)
|
|
31
|
-
- "help" (not a deployment request)
|
|
32
|
-
- "app" (single word)
|
|
33
|
-
- "setup" (action without object)
|
|
34
|
-
|
|
35
|
-
**SPECIFIC ENOUGH:**
|
|
36
|
-
- "stateless app" (architectural pattern + type)
|
|
37
|
-
- "web application" (clear application type)
|
|
38
|
-
- "microservice" (architectural pattern)
|
|
39
|
-
- "REST API" (clear service type)
|
|
40
|
-
- "database cluster" (type + deployment pattern)
|
|
41
|
-
- "Node.js application" (technology + type)
|
|
42
|
-
- "frontend service" (purpose + type)
|
|
43
|
-
- "cache service" (purpose + type)
|
|
44
|
-
- "PostgreSQL database" (technology + infrastructure type)
|
|
45
|
-
- "Redis cache" (technology + infrastructure purpose)
|
|
46
|
-
- "Prometheus monitoring" (technology + infrastructure purpose)
|
|
47
|
-
- "Ingress controller" (infrastructure component + type)
|
|
48
|
-
- "MongoDB operator" (technology + operator pattern)
|
|
49
|
-
- "load balancer" (infrastructure component)
|
|
50
|
-
- "persistent storage" (infrastructure capability)
|
|
51
|
-
- "CI/CD pipeline" (workflow automation)
|
|
52
|
-
|
|
53
|
-
## Response Format
|
|
54
|
-
|
|
55
|
-
Respond with ONLY a JSON object in this exact format:
|
|
56
|
-
|
|
57
|
-
```json
|
|
58
|
-
{
|
|
59
|
-
"isSpecific": boolean,
|
|
60
|
-
"reason": "brief explanation of why it is or isn't specific enough",
|
|
61
|
-
"suggestions": [
|
|
62
|
-
"specific suggestion 1 to improve the intent",
|
|
63
|
-
"specific suggestion 2 to improve the intent",
|
|
64
|
-
"specific suggestion 3 to improve the intent"
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**IMPORTANT:**
|
|
70
|
-
- Your response must be ONLY the JSON object, nothing else
|
|
71
|
-
- If `isSpecific` is true, still provide 3 suggestions for making it even more detailed
|
|
72
|
-
- If `isSpecific` is false, provide 3 concrete suggestions to make it deployable
|
|
73
|
-
- Keep suggestions practical and actionable
|
|
74
|
-
- Focus on what technologies, purposes, or contexts are missing
|