@vfarcic/dot-ai 0.94.0 → 0.96.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.
|
@@ -8,25 +8,6 @@ export declare const SAFE_OPERATIONS: readonly ["get", "describe", "logs", "even
|
|
|
8
8
|
export type SafeOperation = typeof SAFE_OPERATIONS[number];
|
|
9
9
|
export declare const REMEDIATE_TOOL_INPUT_SCHEMA: {
|
|
10
10
|
issue: z.ZodOptional<z.ZodString>;
|
|
11
|
-
context: z.ZodOptional<z.ZodObject<{
|
|
12
|
-
event: z.ZodOptional<z.ZodAny>;
|
|
13
|
-
logs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14
|
-
metrics: z.ZodOptional<z.ZodAny>;
|
|
15
|
-
podSpec: z.ZodOptional<z.ZodAny>;
|
|
16
|
-
relatedEvents: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
17
|
-
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
logs?: string[] | undefined;
|
|
19
|
-
event?: any;
|
|
20
|
-
metrics?: any;
|
|
21
|
-
podSpec?: any;
|
|
22
|
-
relatedEvents?: any[] | undefined;
|
|
23
|
-
}, {
|
|
24
|
-
logs?: string[] | undefined;
|
|
25
|
-
event?: any;
|
|
26
|
-
metrics?: any;
|
|
27
|
-
podSpec?: any;
|
|
28
|
-
relatedEvents?: any[] | undefined;
|
|
29
|
-
}>>;
|
|
30
11
|
mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["manual", "automatic"]>>>;
|
|
31
12
|
confidenceThreshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
32
13
|
maxRiskLevel: z.ZodDefault<z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>>;
|
|
@@ -36,13 +17,6 @@ export declare const REMEDIATE_TOOL_INPUT_SCHEMA: {
|
|
|
36
17
|
};
|
|
37
18
|
export interface RemediateInput {
|
|
38
19
|
issue?: string;
|
|
39
|
-
context?: {
|
|
40
|
-
event?: any;
|
|
41
|
-
logs?: string[];
|
|
42
|
-
metrics?: any;
|
|
43
|
-
podSpec?: any;
|
|
44
|
-
relatedEvents?: any[];
|
|
45
|
-
};
|
|
46
20
|
mode?: 'manual' | 'automatic';
|
|
47
21
|
confidenceThreshold?: number;
|
|
48
22
|
maxRiskLevel?: 'low' | 'medium' | 'high';
|
|
@@ -70,7 +44,6 @@ export interface InvestigationIteration {
|
|
|
70
44
|
export interface RemediateSession {
|
|
71
45
|
sessionId: string;
|
|
72
46
|
issue: string;
|
|
73
|
-
initialContext: any;
|
|
74
47
|
mode: 'manual' | 'automatic';
|
|
75
48
|
iterations: InvestigationIteration[];
|
|
76
49
|
finalAnalysis?: RemediateOutput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remediate.d.ts","sourceRoot":"","sources":["../../src/tools/remediate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,0BAA0B,yfAAwf,CAAC;AAGhiB,eAAO,MAAM,eAAe,kEAAmE,CAAC;AAChG,MAAM,MAAM,aAAa,GAAG,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AAgB3D,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"remediate.d.ts","sourceRoot":"","sources":["../../src/tools/remediate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,0BAA0B,yfAAwf,CAAC;AAGhiB,eAAO,MAAM,eAAe,kEAAmE,CAAC;AAChG,MAAM,MAAM,aAAa,GAAG,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AAgB3D,eAAO,MAAM,2BAA2B;;;;;;;;CAQvC,CAAC;AAGF,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
CHANGED
|
@@ -67,13 +67,6 @@ function hasDryRunFlag(args) {
|
|
|
67
67
|
// Zod schema for MCP registration
|
|
68
68
|
exports.REMEDIATE_TOOL_INPUT_SCHEMA = {
|
|
69
69
|
issue: zod_1.z.string().min(1).max(2000).describe('Issue description that needs to be analyzed and remediated').optional(),
|
|
70
|
-
context: zod_1.z.object({
|
|
71
|
-
event: zod_1.z.any().optional().describe('Kubernetes event object'),
|
|
72
|
-
logs: zod_1.z.array(zod_1.z.string()).optional().describe('Relevant log entries'),
|
|
73
|
-
metrics: zod_1.z.any().optional().describe('Relevant metrics data'),
|
|
74
|
-
podSpec: zod_1.z.any().optional().describe('Pod specification if relevant'),
|
|
75
|
-
relatedEvents: zod_1.z.array(zod_1.z.any()).optional().describe('Related Kubernetes events')
|
|
76
|
-
}).optional().describe('Optional initial context to help with analysis'),
|
|
77
70
|
mode: zod_1.z.enum(['manual', 'automatic']).optional().default('manual').describe('Execution mode: manual requires user approval, automatic executes based on thresholds'),
|
|
78
71
|
confidenceThreshold: zod_1.z.number().min(0).max(1).optional().default(0.8).describe('For automatic mode: minimum confidence required for execution (default: 0.8)'),
|
|
79
72
|
maxRiskLevel: zod_1.z.enum(['low', 'medium', 'high']).optional().default('low').describe('For automatic mode: maximum risk level allowed for execution (default: low)'),
|
|
@@ -232,7 +225,7 @@ async function analyzeCurrentState(session, claudeIntegration, logger, requestId
|
|
|
232
225
|
logger.debug('Analyzing current state with AI', { requestId, sessionId: session.sessionId });
|
|
233
226
|
try {
|
|
234
227
|
// Load investigation prompt template
|
|
235
|
-
const promptPath = path.join(
|
|
228
|
+
const promptPath = path.join(__dirname, '..', '..', 'prompts', 'remediate-investigation.md');
|
|
236
229
|
const promptTemplate = fs.readFileSync(promptPath, 'utf8');
|
|
237
230
|
// Discover cluster API resources for complete visibility - REQUIRED for quality remediation
|
|
238
231
|
let clusterApiResources = '';
|
|
@@ -256,7 +249,6 @@ async function analyzeCurrentState(session, claudeIntegration, logger, requestId
|
|
|
256
249
|
// Prepare template variables
|
|
257
250
|
const currentIteration = session.iterations.length + 1;
|
|
258
251
|
const maxIterations = 20;
|
|
259
|
-
const initialContextJson = JSON.stringify(session.initialContext, null, 2);
|
|
260
252
|
const previousIterationsJson = JSON.stringify(session.iterations.map(iter => ({
|
|
261
253
|
step: iter.step,
|
|
262
254
|
analysis: iter.aiAnalysis,
|
|
@@ -266,7 +258,6 @@ async function analyzeCurrentState(session, claudeIntegration, logger, requestId
|
|
|
266
258
|
// Replace template variables
|
|
267
259
|
const investigationPrompt = promptTemplate
|
|
268
260
|
.replace('{issue}', session.issue)
|
|
269
|
-
.replace('{initialContext}', initialContextJson)
|
|
270
261
|
.replace('{currentIteration}', currentIteration.toString())
|
|
271
262
|
.replace('{maxIterations}', maxIterations.toString())
|
|
272
263
|
.replace('{previousIterations}', previousIterationsJson)
|
|
@@ -526,7 +517,7 @@ async function generateFinalAnalysis(session, logger, requestId) {
|
|
|
526
517
|
}
|
|
527
518
|
const claudeIntegration = new claude_1.ClaudeIntegration(claudeApiKey);
|
|
528
519
|
// Load final analysis prompt template
|
|
529
|
-
const promptPath = path.join(
|
|
520
|
+
const promptPath = path.join(__dirname, '..', '..', 'prompts', 'remediate-final-analysis.md');
|
|
530
521
|
const promptTemplate = fs.readFileSync(promptPath, 'utf8');
|
|
531
522
|
// Prepare template variables - extract actual data source identifiers
|
|
532
523
|
const dataSources = session.iterations.flatMap(iter => {
|
|
@@ -970,7 +961,6 @@ async function handleRemediateTool(args) {
|
|
|
970
961
|
const session = {
|
|
971
962
|
sessionId,
|
|
972
963
|
issue: validatedInput.issue,
|
|
973
|
-
initialContext: validatedInput.context || {},
|
|
974
964
|
mode: validatedInput.mode || 'manual',
|
|
975
965
|
iterations: [],
|
|
976
966
|
created: new Date(),
|
|
@@ -1131,7 +1121,6 @@ function validateRemediateInput(args) {
|
|
|
1131
1121
|
// Basic validation using our schema
|
|
1132
1122
|
const validated = {
|
|
1133
1123
|
issue: args.issue ? exports.REMEDIATE_TOOL_INPUT_SCHEMA.issue.parse(args.issue) : undefined,
|
|
1134
|
-
context: args.context ? exports.REMEDIATE_TOOL_INPUT_SCHEMA.context.parse(args.context) : undefined,
|
|
1135
1124
|
mode: args.mode ? exports.REMEDIATE_TOOL_INPUT_SCHEMA.mode.parse(args.mode) : 'manual',
|
|
1136
1125
|
confidenceThreshold: args.confidenceThreshold !== undefined ?
|
|
1137
1126
|
exports.REMEDIATE_TOOL_INPUT_SCHEMA.confidenceThreshold.parse(args.confidenceThreshold) : 0.8,
|
|
@@ -1151,7 +1140,7 @@ function validateRemediateInput(args) {
|
|
|
1151
1140
|
suggestedActions: [
|
|
1152
1141
|
'Check that issue is a non-empty string',
|
|
1153
1142
|
'Verify mode is either "manual" or "automatic"',
|
|
1154
|
-
'Ensure
|
|
1143
|
+
'Ensure confidenceThreshold is between 0 and 1 if provided'
|
|
1155
1144
|
]
|
|
1156
1145
|
});
|
|
1157
1146
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfarcic/dot-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.96.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",
|
|
@@ -84,11 +84,10 @@
|
|
|
84
84
|
"typescript": "^5.0.0"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@anthropic-ai/sdk": "^0.
|
|
87
|
+
"@anthropic-ai/sdk": "^0.63.0",
|
|
88
88
|
"@kubernetes/client-node": "^1.3.0",
|
|
89
89
|
"@modelcontextprotocol/sdk": "^1.13.2",
|
|
90
90
|
"@qdrant/js-client-rest": "^1.15.0",
|
|
91
|
-
"@vfarcic/dot-ai": "^0.90.0",
|
|
92
91
|
"glob": "^11.0.3",
|
|
93
92
|
"openai": "^5.11.0",
|
|
94
93
|
"yaml": "^2.8.0",
|
|
@@ -6,8 +6,6 @@ You are an expert Kubernetes troubleshooting agent conducting a systematic inves
|
|
|
6
6
|
|
|
7
7
|
**Issue**: {issue}
|
|
8
8
|
|
|
9
|
-
**Initial Context**: {initialContext}
|
|
10
|
-
|
|
11
9
|
**Investigation Iteration**: {currentIteration} of {maxIterations}
|
|
12
10
|
|
|
13
11
|
**Previous Investigation Data**: {previousIterations}
|