@vfarcic/dot-ai 1.2.4 → 1.4.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/artifacthub.d.ts.map +1 -1
- package/dist/core/artifacthub.js +16 -10
- package/dist/core/base-vector-service.d.ts.map +1 -1
- package/dist/core/base-vector-service.js +19 -10
- package/dist/core/capabilities.d.ts.map +1 -1
- package/dist/core/capabilities.js +17 -11
- package/dist/core/capability-operations.d.ts.map +1 -1
- package/dist/core/capability-operations.js +118 -98
- package/dist/core/crd-availability.d.ts.map +1 -1
- package/dist/core/crd-availability.js +2 -2
- package/dist/core/deploy-operation.d.ts.map +1 -1
- package/dist/core/deploy-operation.js +9 -6
- package/dist/core/discovery.d.ts.map +1 -1
- package/dist/core/discovery.js +157 -56
- package/dist/core/embedding-service.d.ts +1 -1
- package/dist/core/embedding-service.d.ts.map +1 -1
- package/dist/core/embedding-service.js +76 -43
- package/dist/core/model-config.d.ts +3 -3
- package/dist/core/model-config.js +3 -3
- package/dist/core/packaging.d.ts.map +1 -1
- package/dist/core/packaging.js +11 -10
- package/dist/core/platform-utils.d.ts.map +1 -1
- package/dist/core/platform-utils.js +6 -2
- package/dist/core/plugin-manager.d.ts.map +1 -1
- package/dist/core/plugin-manager.js +26 -20
- package/dist/core/policy-operations.d.ts.map +1 -1
- package/dist/core/policy-operations.js +111 -65
- package/dist/core/providers/host-provider.d.ts.map +1 -1
- package/dist/core/providers/host-provider.js +12 -5
- package/dist/core/providers/vercel-provider.d.ts.map +1 -1
- package/dist/core/providers/vercel-provider.js +4 -2
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +173 -95
- package/dist/core/session-utils.d.ts.map +1 -1
- package/dist/core/session-utils.js +3 -3
- package/dist/core/user-prompts-loader.d.ts.map +1 -1
- package/dist/core/user-prompts-loader.js +2 -4
- package/dist/evaluation/datasets/loader.d.ts.map +1 -1
- package/dist/evaluation/datasets/loader.js +7 -3
- package/dist/interfaces/embedding-migration-handler.d.ts +16 -0
- package/dist/interfaces/embedding-migration-handler.d.ts.map +1 -0
- package/dist/interfaces/embedding-migration-handler.js +296 -0
- package/dist/interfaces/rest-api.d.ts +8 -0
- package/dist/interfaces/rest-api.d.ts.map +1 -1
- package/dist/interfaces/rest-api.js +294 -132
- package/dist/interfaces/rest-route-registry.js +3 -3
- package/dist/interfaces/routes/index.d.ts.map +1 -1
- package/dist/interfaces/routes/index.js +72 -12
- package/dist/interfaces/schemas/common.d.ts +2 -0
- package/dist/interfaces/schemas/common.d.ts.map +1 -1
- package/dist/interfaces/schemas/common.js +2 -0
- package/dist/interfaces/schemas/embeddings.d.ts +138 -0
- package/dist/interfaces/schemas/embeddings.d.ts.map +1 -0
- package/dist/interfaces/schemas/embeddings.js +79 -0
- package/dist/interfaces/schemas/index.d.ts +2 -1
- package/dist/interfaces/schemas/index.d.ts.map +1 -1
- package/dist/interfaces/schemas/index.js +14 -2
- package/dist/interfaces/schemas/prompts.d.ts +37 -0
- package/dist/interfaces/schemas/prompts.d.ts.map +1 -1
- package/dist/interfaces/schemas/prompts.js +18 -1
- package/dist/tools/answer-question.d.ts.map +1 -1
- package/dist/tools/answer-question.js +109 -81
- package/dist/tools/generate-manifests.d.ts.map +1 -1
- package/dist/tools/generate-manifests.js +163 -103
- package/dist/tools/operate-analysis.d.ts.map +1 -1
- package/dist/tools/operate-analysis.js +35 -18
- package/dist/tools/operate.d.ts.map +1 -1
- package/dist/tools/operate.js +47 -17
- package/dist/tools/prompts.d.ts.map +1 -1
- package/dist/tools/prompts.js +1 -1
- package/dist/tools/remediate.d.ts.map +1 -1
- package/dist/tools/remediate.js +205 -116
- package/package.json +6 -6
- package/prompts/remediate-system.md +1 -1
|
@@ -66,7 +66,7 @@ async function getCapabilityService(collection) {
|
|
|
66
66
|
catch (error) {
|
|
67
67
|
// If initialization fails, try to provide helpful error context
|
|
68
68
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
69
|
-
throw new Error(`Vector DB collection initialization failed: ${errorMessage}. This may be due to dimension mismatch or collection configuration issues
|
|
69
|
+
throw new Error(`Vector DB collection initialization failed: ${errorMessage}. This may be due to dimension mismatch or collection configuration issues.`, { cause: error });
|
|
70
70
|
}
|
|
71
71
|
return capabilityService;
|
|
72
72
|
}
|
|
@@ -84,7 +84,7 @@ async function handleCapabilityList(args, logger, requestId, capabilityService)
|
|
|
84
84
|
requestId,
|
|
85
85
|
count: capabilities.length,
|
|
86
86
|
totalCount: count,
|
|
87
|
-
limit
|
|
87
|
+
limit,
|
|
88
88
|
});
|
|
89
89
|
return {
|
|
90
90
|
success: true,
|
|
@@ -94,7 +94,8 @@ async function handleCapabilityList(args, logger, requestId, capabilityService)
|
|
|
94
94
|
capabilities: capabilities.map(cap => {
|
|
95
95
|
const desc = typeof cap.description === 'string' ? cap.description : '';
|
|
96
96
|
return {
|
|
97
|
-
id: cap.id ??
|
|
97
|
+
id: cap.id ??
|
|
98
|
+
capabilities_1.CapabilityInferenceEngine.generateCapabilityId(cap.resourceName),
|
|
98
99
|
resourceName: cap.resourceName,
|
|
99
100
|
apiVersion: cap.apiVersion,
|
|
100
101
|
version: cap.version,
|
|
@@ -103,25 +104,25 @@ async function handleCapabilityList(args, logger, requestId, capabilityService)
|
|
|
103
104
|
description: desc.length > 100 ? desc.slice(0, 100) + '...' : desc,
|
|
104
105
|
complexity: cap.complexity,
|
|
105
106
|
confidence: cap.confidence,
|
|
106
|
-
analyzedAt: cap.analyzedAt
|
|
107
|
+
analyzedAt: cap.analyzedAt,
|
|
107
108
|
};
|
|
108
109
|
}),
|
|
109
110
|
totalCount: count,
|
|
110
111
|
returnedCount: capabilities.length,
|
|
111
|
-
limit
|
|
112
|
+
limit,
|
|
112
113
|
},
|
|
113
114
|
message: `Retrieved ${capabilities.length} capabilities (${count} total)`,
|
|
114
115
|
clientInstructions: {
|
|
115
116
|
behavior: 'Display capability list with IDs prominently visible for user reference',
|
|
116
117
|
requirement: 'Each capability must show: ID, resource name, main capabilities, and description',
|
|
117
118
|
format: 'List format with ID clearly labeled (e.g., "ID: abc123") so users can reference specific capabilities',
|
|
118
|
-
prohibit: 'Do not hide or omit capability IDs from the display - users need them for get operations'
|
|
119
|
-
}
|
|
119
|
+
prohibit: 'Do not hide or omit capability IDs from the display - users need them for get operations',
|
|
120
|
+
},
|
|
120
121
|
};
|
|
121
122
|
}
|
|
122
123
|
catch (error) {
|
|
123
124
|
logger.error('Failed to list capabilities', error, {
|
|
124
|
-
requestId
|
|
125
|
+
requestId,
|
|
125
126
|
});
|
|
126
127
|
return {
|
|
127
128
|
success: false,
|
|
@@ -129,8 +130,8 @@ async function handleCapabilityList(args, logger, requestId, capabilityService)
|
|
|
129
130
|
dataType: 'capabilities',
|
|
130
131
|
error: {
|
|
131
132
|
message: 'Failed to list capabilities',
|
|
132
|
-
details: error instanceof Error ? error.message : String(error)
|
|
133
|
-
}
|
|
133
|
+
details: error instanceof Error ? error.message : String(error),
|
|
134
|
+
},
|
|
134
135
|
};
|
|
135
136
|
}
|
|
136
137
|
}
|
|
@@ -154,9 +155,9 @@ async function handleCapabilityGet(args, logger, requestId, capabilityService) {
|
|
|
154
155
|
example: { id: 'capability-id-example' },
|
|
155
156
|
alternativeFormat: {
|
|
156
157
|
description: 'You can also use JSON format for kind/apiVersion lookup',
|
|
157
|
-
example: '{"kind":"Deployment","apiVersion":"apps/v1"}'
|
|
158
|
-
}
|
|
159
|
-
}
|
|
158
|
+
example: '{"kind":"Deployment","apiVersion":"apps/v1"}',
|
|
159
|
+
},
|
|
160
|
+
},
|
|
160
161
|
};
|
|
161
162
|
}
|
|
162
163
|
let capability = null;
|
|
@@ -172,14 +173,14 @@ async function handleCapabilityGet(args, logger, requestId, capabilityService) {
|
|
|
172
173
|
error: {
|
|
173
174
|
message: 'Invalid JSON lookup format',
|
|
174
175
|
details: 'JSON format requires both "kind" and "apiVersion" fields',
|
|
175
|
-
example: { id: '{"kind":"Deployment","apiVersion":"apps/v1"}' }
|
|
176
|
-
}
|
|
176
|
+
example: { id: '{"kind":"Deployment","apiVersion":"apps/v1"}' },
|
|
177
|
+
},
|
|
177
178
|
};
|
|
178
179
|
}
|
|
179
180
|
logger.info('Looking up capability by kind/apiVersion', {
|
|
180
181
|
requestId,
|
|
181
182
|
kind: lookup.kind,
|
|
182
|
-
apiVersion: lookup.apiVersion
|
|
183
|
+
apiVersion: lookup.apiVersion,
|
|
183
184
|
});
|
|
184
185
|
capability = await capabilityService.getCapabilityByKindApiVersion(lookup.kind, lookup.apiVersion);
|
|
185
186
|
}
|
|
@@ -190,9 +191,11 @@ async function handleCapabilityGet(args, logger, requestId, capabilityService) {
|
|
|
190
191
|
dataType: 'capabilities',
|
|
191
192
|
error: {
|
|
192
193
|
message: 'Invalid JSON format in id parameter',
|
|
193
|
-
details: parseError instanceof Error
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
details: parseError instanceof Error
|
|
195
|
+
? parseError.message
|
|
196
|
+
: String(parseError),
|
|
197
|
+
example: { id: '{"kind":"Deployment","apiVersion":"apps/v1"}' },
|
|
198
|
+
},
|
|
196
199
|
};
|
|
197
200
|
}
|
|
198
201
|
}
|
|
@@ -203,7 +206,7 @@ async function handleCapabilityGet(args, logger, requestId, capabilityService) {
|
|
|
203
206
|
if (!capability) {
|
|
204
207
|
logger.warn('Capability not found', {
|
|
205
208
|
requestId,
|
|
206
|
-
capabilityId: args.id
|
|
209
|
+
capabilityId: args.id,
|
|
207
210
|
});
|
|
208
211
|
return {
|
|
209
212
|
success: false,
|
|
@@ -212,8 +215,8 @@ async function handleCapabilityGet(args, logger, requestId, capabilityService) {
|
|
|
212
215
|
error: {
|
|
213
216
|
message: `Capability not found for ID: ${args.id}`,
|
|
214
217
|
details: 'Resource capability may not have been scanned yet',
|
|
215
|
-
suggestion: 'Use scan operation to analyze this resource first'
|
|
216
|
-
}
|
|
218
|
+
suggestion: 'Use scan operation to analyze this resource first',
|
|
219
|
+
},
|
|
217
220
|
};
|
|
218
221
|
}
|
|
219
222
|
logger.info('Capability retrieved successfully', {
|
|
@@ -221,7 +224,7 @@ async function handleCapabilityGet(args, logger, requestId, capabilityService) {
|
|
|
221
224
|
capabilityId: args.id,
|
|
222
225
|
resourceName: capability.resourceName,
|
|
223
226
|
capabilitiesFound: capability.capabilities.length,
|
|
224
|
-
confidence: capability.confidence
|
|
227
|
+
confidence: capability.confidence,
|
|
225
228
|
});
|
|
226
229
|
return {
|
|
227
230
|
success: true,
|
|
@@ -237,15 +240,15 @@ async function handleCapabilityGet(args, logger, requestId, capabilityService) {
|
|
|
237
240
|
resourceInfo: 'Resource name and description with use case',
|
|
238
241
|
capabilities: 'List all capabilities, providers, and abstractions clearly',
|
|
239
242
|
technicalDetails: 'Complexity level and provider information',
|
|
240
|
-
analysisResults: 'Confidence score, analysis timestamp, and ID for reference'
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
+
analysisResults: 'Confidence score, analysis timestamp, and ID for reference',
|
|
244
|
+
},
|
|
245
|
+
},
|
|
243
246
|
};
|
|
244
247
|
}
|
|
245
248
|
catch (error) {
|
|
246
249
|
logger.error('Failed to get capability', error, {
|
|
247
250
|
requestId,
|
|
248
|
-
capabilityId: args.id
|
|
251
|
+
capabilityId: args.id,
|
|
249
252
|
});
|
|
250
253
|
return {
|
|
251
254
|
success: false,
|
|
@@ -253,8 +256,8 @@ async function handleCapabilityGet(args, logger, requestId, capabilityService) {
|
|
|
253
256
|
dataType: 'capabilities',
|
|
254
257
|
error: {
|
|
255
258
|
message: 'Failed to retrieve capability',
|
|
256
|
-
details: error instanceof Error ? error.message : String(error)
|
|
257
|
-
}
|
|
259
|
+
details: error instanceof Error ? error.message : String(error),
|
|
260
|
+
},
|
|
258
261
|
};
|
|
259
262
|
}
|
|
260
263
|
}
|
|
@@ -272,8 +275,8 @@ async function handleCapabilityDelete(args, logger, requestId, capabilityService
|
|
|
272
275
|
error: {
|
|
273
276
|
message: validation_1.VALIDATION_MESSAGES.MISSING_PARAMETER('id'),
|
|
274
277
|
details: 'Specify id to delete capability data',
|
|
275
|
-
example: { id: 'capability-id-example' }
|
|
276
|
-
}
|
|
278
|
+
example: { id: 'capability-id-example' },
|
|
279
|
+
},
|
|
277
280
|
};
|
|
278
281
|
}
|
|
279
282
|
// Check if capability exists before deletion
|
|
@@ -281,7 +284,7 @@ async function handleCapabilityDelete(args, logger, requestId, capabilityService
|
|
|
281
284
|
if (!capability) {
|
|
282
285
|
logger.warn('Capability not found for deletion', {
|
|
283
286
|
requestId,
|
|
284
|
-
capabilityId: args.id
|
|
287
|
+
capabilityId: args.id,
|
|
285
288
|
});
|
|
286
289
|
return {
|
|
287
290
|
success: false,
|
|
@@ -289,8 +292,8 @@ async function handleCapabilityDelete(args, logger, requestId, capabilityService
|
|
|
289
292
|
dataType: 'capabilities',
|
|
290
293
|
error: {
|
|
291
294
|
message: `Capability not found for ID: ${args.id}`,
|
|
292
|
-
details: 'Cannot delete capability that does not exist'
|
|
293
|
-
}
|
|
295
|
+
details: 'Cannot delete capability that does not exist',
|
|
296
|
+
},
|
|
294
297
|
};
|
|
295
298
|
}
|
|
296
299
|
// Delete capability by ID
|
|
@@ -298,7 +301,7 @@ async function handleCapabilityDelete(args, logger, requestId, capabilityService
|
|
|
298
301
|
logger.info('Capability deleted successfully', {
|
|
299
302
|
requestId,
|
|
300
303
|
capabilityId: args.id,
|
|
301
|
-
resourceName: capability.resourceName
|
|
304
|
+
resourceName: capability.resourceName,
|
|
302
305
|
});
|
|
303
306
|
return {
|
|
304
307
|
success: true,
|
|
@@ -306,15 +309,15 @@ async function handleCapabilityDelete(args, logger, requestId, capabilityService
|
|
|
306
309
|
dataType: 'capabilities',
|
|
307
310
|
deletedCapability: {
|
|
308
311
|
id: args.id,
|
|
309
|
-
resourceName: capability.resourceName
|
|
312
|
+
resourceName: capability.resourceName,
|
|
310
313
|
},
|
|
311
|
-
message: `Capability deleted: ${capability.resourceName}
|
|
314
|
+
message: `Capability deleted: ${capability.resourceName}`,
|
|
312
315
|
};
|
|
313
316
|
}
|
|
314
317
|
catch (error) {
|
|
315
318
|
logger.error('Failed to delete capability', error, {
|
|
316
319
|
requestId,
|
|
317
|
-
capabilityId: args.id
|
|
320
|
+
capabilityId: args.id,
|
|
318
321
|
});
|
|
319
322
|
return {
|
|
320
323
|
success: false,
|
|
@@ -322,8 +325,8 @@ async function handleCapabilityDelete(args, logger, requestId, capabilityService
|
|
|
322
325
|
dataType: 'capabilities',
|
|
323
326
|
error: {
|
|
324
327
|
message: 'Failed to delete capability',
|
|
325
|
-
details: error instanceof Error ? error.message : String(error)
|
|
326
|
-
}
|
|
328
|
+
details: error instanceof Error ? error.message : String(error),
|
|
329
|
+
},
|
|
327
330
|
};
|
|
328
331
|
}
|
|
329
332
|
}
|
|
@@ -342,20 +345,20 @@ async function handleCapabilityDeleteAll(_args, logger, requestId, capabilitySer
|
|
|
342
345
|
dataType: 'capabilities',
|
|
343
346
|
deletedCount: 0,
|
|
344
347
|
totalCount: 0,
|
|
345
|
-
message: 'No capabilities found to delete'
|
|
348
|
+
message: 'No capabilities found to delete',
|
|
346
349
|
};
|
|
347
350
|
}
|
|
348
351
|
logger.info('Starting efficient bulk capability deletion', {
|
|
349
352
|
requestId,
|
|
350
353
|
totalCapabilities: totalCount,
|
|
351
|
-
method: 'collection recreation'
|
|
354
|
+
method: 'collection recreation',
|
|
352
355
|
});
|
|
353
356
|
// Efficiently delete all capabilities by recreating collection
|
|
354
357
|
await capabilityService.deleteAllCapabilities();
|
|
355
358
|
logger.info('Bulk capability deletion completed successfully', {
|
|
356
359
|
requestId,
|
|
357
360
|
deleted: totalCount,
|
|
358
|
-
method: 'collection recreation'
|
|
361
|
+
method: 'collection recreation',
|
|
359
362
|
});
|
|
360
363
|
return {
|
|
361
364
|
success: true,
|
|
@@ -366,12 +369,12 @@ async function handleCapabilityDeleteAll(_args, logger, requestId, capabilitySer
|
|
|
366
369
|
errorCount: 0,
|
|
367
370
|
message: `Successfully deleted all ${totalCount} capabilities`,
|
|
368
371
|
confirmation: 'All capability data has been permanently removed from the Vector DB',
|
|
369
|
-
method: 'Efficient collection recreation (no individual record retrieval)'
|
|
372
|
+
method: 'Efficient collection recreation (no individual record retrieval)',
|
|
370
373
|
};
|
|
371
374
|
}
|
|
372
375
|
catch (error) {
|
|
373
376
|
logger.error('Failed to delete all capabilities', error, {
|
|
374
|
-
requestId
|
|
377
|
+
requestId,
|
|
375
378
|
});
|
|
376
379
|
return {
|
|
377
380
|
success: false,
|
|
@@ -379,8 +382,8 @@ async function handleCapabilityDeleteAll(_args, logger, requestId, capabilitySer
|
|
|
379
382
|
dataType: 'capabilities',
|
|
380
383
|
error: {
|
|
381
384
|
message: 'Failed to delete all capabilities',
|
|
382
|
-
details: error instanceof Error ? error.message : String(error)
|
|
383
|
-
}
|
|
385
|
+
details: error instanceof Error ? error.message : String(error),
|
|
386
|
+
},
|
|
384
387
|
};
|
|
385
388
|
}
|
|
386
389
|
}
|
|
@@ -391,7 +394,7 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
391
394
|
try {
|
|
392
395
|
logger.info('Capability progress query requested', {
|
|
393
396
|
requestId,
|
|
394
|
-
sessionId: args.sessionId
|
|
397
|
+
sessionId: args.sessionId,
|
|
395
398
|
});
|
|
396
399
|
// Get session directory first
|
|
397
400
|
const sessionDir = (0, session_utils_1.getAndValidateSessionDirectory)(false);
|
|
@@ -399,12 +402,17 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
399
402
|
let sessionFilePath;
|
|
400
403
|
// If no sessionId provided, auto-discover the latest session
|
|
401
404
|
if (!sessionId) {
|
|
402
|
-
logger.info('No sessionId provided, searching for latest session file', {
|
|
405
|
+
logger.info('No sessionId provided, searching for latest session file', {
|
|
406
|
+
requestId,
|
|
407
|
+
});
|
|
403
408
|
try {
|
|
404
409
|
// Check if capability-sessions subdirectory exists
|
|
405
410
|
const sessionSubDir = path.join(sessionDir, 'capability-sessions');
|
|
406
411
|
if (!fs.existsSync(sessionSubDir)) {
|
|
407
|
-
logger.info('No capability-sessions directory found', {
|
|
412
|
+
logger.info('No capability-sessions directory found', {
|
|
413
|
+
requestId,
|
|
414
|
+
sessionDir,
|
|
415
|
+
});
|
|
408
416
|
return {
|
|
409
417
|
success: false,
|
|
410
418
|
operation: 'progress',
|
|
@@ -413,12 +421,13 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
413
421
|
message: 'No capability scan sessions found',
|
|
414
422
|
details: 'No capability-sessions directory found in the session directory',
|
|
415
423
|
help: 'Start a new capability scan with the scan operation first',
|
|
416
|
-
sessionDirectory: sessionDir
|
|
417
|
-
}
|
|
424
|
+
sessionDirectory: sessionDir,
|
|
425
|
+
},
|
|
418
426
|
};
|
|
419
427
|
}
|
|
420
428
|
// Find all capability scan session files in the subdirectory
|
|
421
|
-
const sessionFiles = fs
|
|
429
|
+
const sessionFiles = fs
|
|
430
|
+
.readdirSync(sessionSubDir)
|
|
422
431
|
.filter(file => file.endsWith('.json'))
|
|
423
432
|
.map(file => {
|
|
424
433
|
const filePath = path.join(sessionSubDir, file);
|
|
@@ -427,12 +436,15 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
427
436
|
filename: file,
|
|
428
437
|
path: filePath,
|
|
429
438
|
mtime: stats.mtime,
|
|
430
|
-
sessionId: file.replace('.json', '') // Remove .json extension to get sessionId
|
|
439
|
+
sessionId: file.replace('.json', ''), // Remove .json extension to get sessionId
|
|
431
440
|
};
|
|
432
441
|
})
|
|
433
442
|
.sort((a, b) => b.mtime.getTime() - a.mtime.getTime()); // Sort by newest first
|
|
434
443
|
if (sessionFiles.length === 0) {
|
|
435
|
-
logger.info('No capability scan session files found', {
|
|
444
|
+
logger.info('No capability scan session files found', {
|
|
445
|
+
requestId,
|
|
446
|
+
sessionDir,
|
|
447
|
+
});
|
|
436
448
|
return {
|
|
437
449
|
success: false,
|
|
438
450
|
operation: 'progress',
|
|
@@ -441,8 +453,8 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
441
453
|
message: 'No capability scan sessions found',
|
|
442
454
|
details: 'No active or recent capability scans found in the session directory',
|
|
443
455
|
help: 'Start a new capability scan with the scan operation first',
|
|
444
|
-
sessionDirectory: sessionDir
|
|
445
|
-
}
|
|
456
|
+
sessionDirectory: sessionDir,
|
|
457
|
+
},
|
|
446
458
|
};
|
|
447
459
|
}
|
|
448
460
|
// Use the latest session (first after sorting)
|
|
@@ -453,11 +465,14 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
453
465
|
requestId,
|
|
454
466
|
sessionId,
|
|
455
467
|
totalSessions: sessionFiles.length,
|
|
456
|
-
sessionFile: latestSession.filename
|
|
468
|
+
sessionFile: latestSession.filename,
|
|
457
469
|
});
|
|
458
470
|
}
|
|
459
471
|
catch (error) {
|
|
460
|
-
logger.error('Failed to discover session files', error, {
|
|
472
|
+
logger.error('Failed to discover session files', error, {
|
|
473
|
+
requestId,
|
|
474
|
+
sessionDir,
|
|
475
|
+
});
|
|
461
476
|
return {
|
|
462
477
|
success: false,
|
|
463
478
|
operation: 'progress',
|
|
@@ -465,8 +480,8 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
465
480
|
error: {
|
|
466
481
|
message: 'Failed to discover session files',
|
|
467
482
|
details: error instanceof Error ? error.message : String(error),
|
|
468
|
-
sessionDirectory: sessionDir
|
|
469
|
-
}
|
|
483
|
+
sessionDirectory: sessionDir,
|
|
484
|
+
},
|
|
470
485
|
};
|
|
471
486
|
}
|
|
472
487
|
}
|
|
@@ -478,7 +493,7 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
478
493
|
logger.warn('Session file not found for provided sessionId', {
|
|
479
494
|
requestId,
|
|
480
495
|
sessionId,
|
|
481
|
-
filePath: sessionFilePath
|
|
496
|
+
filePath: sessionFilePath,
|
|
482
497
|
});
|
|
483
498
|
return {
|
|
484
499
|
success: false,
|
|
@@ -487,8 +502,8 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
487
502
|
error: {
|
|
488
503
|
message: 'Session not found',
|
|
489
504
|
details: `No capability scan found for session: ${sessionId}`,
|
|
490
|
-
help: 'Use the scan operation to start a new capability scan, or omit sessionId to use the latest session'
|
|
491
|
-
}
|
|
505
|
+
help: 'Use the scan operation to start a new capability scan, or omit sessionId to use the latest session',
|
|
506
|
+
},
|
|
492
507
|
};
|
|
493
508
|
}
|
|
494
509
|
}
|
|
@@ -506,7 +521,7 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
506
521
|
message: 'Session exists but no progress tracking is active',
|
|
507
522
|
currentStep: sessionData.currentStep,
|
|
508
523
|
startedAt: sessionData.startedAt,
|
|
509
|
-
lastActivity: sessionData.lastActivity
|
|
524
|
+
lastActivity: sessionData.lastActivity,
|
|
510
525
|
};
|
|
511
526
|
}
|
|
512
527
|
// Build comprehensive progress response
|
|
@@ -522,17 +537,19 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
522
537
|
percentage: progress.percentage,
|
|
523
538
|
currentResource: progress.currentResource,
|
|
524
539
|
startedAt: progress.startedAt,
|
|
525
|
-
lastUpdated: progress.lastUpdated
|
|
540
|
+
lastUpdated: progress.lastUpdated,
|
|
526
541
|
},
|
|
527
542
|
sessionInfo: {
|
|
528
543
|
currentStep: sessionData.currentStep,
|
|
529
544
|
processingMode: sessionData.processingMode,
|
|
530
545
|
resourceCount: Array.isArray(sessionData.selectedResources)
|
|
531
546
|
? sessionData.selectedResources.length
|
|
532
|
-
:
|
|
547
|
+
: sessionData.selectedResources === 'all'
|
|
548
|
+
? 'all resources'
|
|
549
|
+
: 'unknown',
|
|
533
550
|
startedAt: sessionData.startedAt,
|
|
534
|
-
lastActivity: sessionData.lastActivity
|
|
535
|
-
}
|
|
551
|
+
lastActivity: sessionData.lastActivity,
|
|
552
|
+
},
|
|
536
553
|
};
|
|
537
554
|
// Add completion information if scan is done
|
|
538
555
|
if (progress.status === 'completed') {
|
|
@@ -541,7 +558,8 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
541
558
|
response.message = 'Capability scan completed successfully';
|
|
542
559
|
}
|
|
543
560
|
else {
|
|
544
|
-
response.progress.estimatedTimeRemaining =
|
|
561
|
+
response.progress.estimatedTimeRemaining =
|
|
562
|
+
progress.estimatedTimeRemaining;
|
|
545
563
|
response.message = `Capability scan in progress: ${progress.current}/${progress.total} resources processed`;
|
|
546
564
|
}
|
|
547
565
|
// Add user-friendly display information with client formatting instructions
|
|
@@ -553,8 +571,8 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
553
571
|
timeline: {
|
|
554
572
|
started: progress.startedAt,
|
|
555
573
|
lastUpdate: progress.lastUpdated,
|
|
556
|
-
...(progress.completedAt && { completed: progress.completedAt })
|
|
557
|
-
}
|
|
574
|
+
...(progress.completedAt && { completed: progress.completedAt }),
|
|
575
|
+
},
|
|
558
576
|
};
|
|
559
577
|
// Add client instructions for readable formatting
|
|
560
578
|
response.clientInstructions = {
|
|
@@ -566,20 +584,20 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
566
584
|
example: progress.status === 'completed'
|
|
567
585
|
? '✅ Capability Scan Complete\n📊 Processed: X resources\n⏰ Processing time: X minutes'
|
|
568
586
|
: '⏳ Progress: X/Y resources (Z%)\n📊 Current resource: ResourceName\n⏰ Est. remaining: X minutes\n🕒 Started: timestamp\n🔄 Last updated: timestamp',
|
|
569
|
-
prohibit: 'Do not display all progress information on a single line'
|
|
587
|
+
prohibit: 'Do not display all progress information on a single line',
|
|
570
588
|
};
|
|
571
589
|
logger.info('Progress query completed successfully', {
|
|
572
590
|
requestId,
|
|
573
591
|
sessionId: args.sessionId,
|
|
574
592
|
status: progress.status,
|
|
575
|
-
percentage: progress.percentage
|
|
593
|
+
percentage: progress.percentage,
|
|
576
594
|
});
|
|
577
595
|
return response;
|
|
578
596
|
}
|
|
579
597
|
catch (error) {
|
|
580
598
|
logger.error('Failed to query capability progress', error, {
|
|
581
599
|
requestId,
|
|
582
|
-
sessionId: args.sessionId
|
|
600
|
+
sessionId: args.sessionId,
|
|
583
601
|
});
|
|
584
602
|
return {
|
|
585
603
|
success: false,
|
|
@@ -587,8 +605,8 @@ async function handleCapabilityProgress(args, logger, requestId) {
|
|
|
587
605
|
dataType: 'capabilities',
|
|
588
606
|
error: {
|
|
589
607
|
message: 'Failed to query scan progress',
|
|
590
|
-
details: error instanceof Error ? error.message : String(error)
|
|
591
|
-
}
|
|
608
|
+
details: error instanceof Error ? error.message : String(error),
|
|
609
|
+
},
|
|
592
610
|
};
|
|
593
611
|
}
|
|
594
612
|
}
|
|
@@ -605,8 +623,8 @@ async function handleCapabilitySearch(args, logger, requestId, capabilityService
|
|
|
605
623
|
dataType: 'capabilities',
|
|
606
624
|
error: {
|
|
607
625
|
message: 'Search query required',
|
|
608
|
-
details: 'The id field must contain a search query (e.g., "postgresql database in azure")'
|
|
609
|
-
}
|
|
626
|
+
details: 'The id field must contain a search query (e.g., "postgresql database in azure")',
|
|
627
|
+
},
|
|
610
628
|
};
|
|
611
629
|
}
|
|
612
630
|
const searchQuery = args.id.trim();
|
|
@@ -614,7 +632,7 @@ async function handleCapabilitySearch(args, logger, requestId, capabilityService
|
|
|
614
632
|
logger.info('Searching capabilities', {
|
|
615
633
|
requestId,
|
|
616
634
|
query: searchQuery,
|
|
617
|
-
limit
|
|
635
|
+
limit,
|
|
618
636
|
});
|
|
619
637
|
// Perform the search using existing service
|
|
620
638
|
const searchResults = await capabilityService.searchCapabilities(searchQuery, { limit });
|
|
@@ -630,13 +648,13 @@ async function handleCapabilitySearch(args, logger, requestId, capabilityService
|
|
|
630
648
|
description: result.data.description,
|
|
631
649
|
useCase: result.data.useCase,
|
|
632
650
|
confidence: result.data.confidence,
|
|
633
|
-
analyzedAt: result.data.analyzedAt
|
|
651
|
+
analyzedAt: result.data.analyzedAt,
|
|
634
652
|
}));
|
|
635
653
|
logger.info('Capability search completed', {
|
|
636
654
|
requestId,
|
|
637
655
|
query: searchQuery,
|
|
638
656
|
resultsFound: searchResults.length,
|
|
639
|
-
limit
|
|
657
|
+
limit,
|
|
640
658
|
});
|
|
641
659
|
return {
|
|
642
660
|
success: true,
|
|
@@ -646,7 +664,7 @@ async function handleCapabilitySearch(args, logger, requestId, capabilityService
|
|
|
646
664
|
query: searchQuery,
|
|
647
665
|
results: formattedResults,
|
|
648
666
|
resultCount: searchResults.length,
|
|
649
|
-
limit
|
|
667
|
+
limit,
|
|
650
668
|
},
|
|
651
669
|
message: `Found ${searchResults.length} capabilities matching "${searchQuery}"`,
|
|
652
670
|
clientInstructions: {
|
|
@@ -655,17 +673,17 @@ async function handleCapabilitySearch(args, logger, requestId, capabilityService
|
|
|
655
673
|
searchSummary: 'Show query and result count prominently',
|
|
656
674
|
resultsList: 'Display each result with rank, score, resource name, and capabilities',
|
|
657
675
|
capabilityDetails: 'Include providers, complexity, and description for context',
|
|
658
|
-
actionGuidance: 'Show IDs for get operations and suggest refinement if needed'
|
|
676
|
+
actionGuidance: 'Show IDs for get operations and suggest refinement if needed',
|
|
659
677
|
},
|
|
660
678
|
format: 'Ranked list with scores (higher scores = better matches)',
|
|
661
|
-
emphasize: 'Resource names and main capabilities for easy scanning'
|
|
662
|
-
}
|
|
679
|
+
emphasize: 'Resource names and main capabilities for easy scanning',
|
|
680
|
+
},
|
|
663
681
|
};
|
|
664
682
|
}
|
|
665
683
|
catch (error) {
|
|
666
684
|
logger.error('Failed to search capabilities', error, {
|
|
667
685
|
requestId,
|
|
668
|
-
query: args.id
|
|
686
|
+
query: args.id,
|
|
669
687
|
});
|
|
670
688
|
return {
|
|
671
689
|
success: false,
|
|
@@ -673,8 +691,8 @@ async function handleCapabilitySearch(args, logger, requestId, capabilityService
|
|
|
673
691
|
dataType: 'capabilities',
|
|
674
692
|
error: {
|
|
675
693
|
message: 'Capability search failed',
|
|
676
|
-
details: error instanceof Error ? error.message : String(error)
|
|
677
|
-
}
|
|
694
|
+
details: error instanceof Error ? error.message : String(error),
|
|
695
|
+
},
|
|
678
696
|
};
|
|
679
697
|
}
|
|
680
698
|
}
|
|
@@ -699,9 +717,9 @@ async function handleCapabilityCRUD(operation, args, logger, requestId) {
|
|
|
699
717
|
details: 'Capability operations require a working Qdrant connection.',
|
|
700
718
|
setup: {
|
|
701
719
|
docker: 'docker run -p 6333:6333 qdrant/qdrant',
|
|
702
|
-
config: 'export QDRANT_URL=http://localhost:6333'
|
|
703
|
-
}
|
|
704
|
-
}
|
|
720
|
+
config: 'export QDRANT_URL=http://localhost:6333',
|
|
721
|
+
},
|
|
722
|
+
},
|
|
705
723
|
};
|
|
706
724
|
}
|
|
707
725
|
// For read operations, check if collection exists without creating it
|
|
@@ -716,7 +734,7 @@ async function handleCapabilityCRUD(operation, args, logger, requestId) {
|
|
|
716
734
|
operation: 'list',
|
|
717
735
|
dataType: 'capabilities',
|
|
718
736
|
data: { capabilities: [], totalCount: 0, returnedCount: 0 },
|
|
719
|
-
message: 'No capabilities found (collection not initialized)'
|
|
737
|
+
message: 'No capabilities found (collection not initialized)',
|
|
720
738
|
};
|
|
721
739
|
}
|
|
722
740
|
else if (operation === 'get') {
|
|
@@ -724,7 +742,7 @@ async function handleCapabilityCRUD(operation, args, logger, requestId) {
|
|
|
724
742
|
success: false,
|
|
725
743
|
operation: 'get',
|
|
726
744
|
dataType: 'capabilities',
|
|
727
|
-
error: { message: 'Capability not found' }
|
|
745
|
+
error: { message: 'Capability not found' },
|
|
728
746
|
};
|
|
729
747
|
}
|
|
730
748
|
else if (operation === 'search') {
|
|
@@ -733,7 +751,7 @@ async function handleCapabilityCRUD(operation, args, logger, requestId) {
|
|
|
733
751
|
operation: 'search',
|
|
734
752
|
dataType: 'capabilities',
|
|
735
753
|
data: { query: args.id, results: [], resultCount: 0 },
|
|
736
|
-
message: 'No capabilities found (collection not initialized)'
|
|
754
|
+
message: 'No capabilities found (collection not initialized)',
|
|
737
755
|
};
|
|
738
756
|
}
|
|
739
757
|
}
|
|
@@ -758,15 +776,17 @@ async function handleCapabilityCRUD(operation, args, logger, requestId) {
|
|
|
758
776
|
}
|
|
759
777
|
}
|
|
760
778
|
catch (error) {
|
|
761
|
-
logger.error(`Capability ${operation} operation failed`, error, {
|
|
779
|
+
logger.error(`Capability ${operation} operation failed`, error, {
|
|
780
|
+
requestId,
|
|
781
|
+
});
|
|
762
782
|
return {
|
|
763
783
|
success: false,
|
|
764
784
|
operation,
|
|
765
785
|
dataType: 'capabilities',
|
|
766
786
|
error: {
|
|
767
787
|
message: `Capability ${operation} failed`,
|
|
768
|
-
details: error instanceof Error ? error.message : String(error)
|
|
769
|
-
}
|
|
788
|
+
details: error instanceof Error ? error.message : String(error),
|
|
789
|
+
},
|
|
770
790
|
};
|
|
771
791
|
}
|
|
772
792
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crd-availability.d.ts","sourceRoot":"","sources":["../../src/core/crd-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"crd-availability.d.ts","sourceRoot":"","sources":["../../src/core/crd-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiHH;;;;GAIG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC,CAG/D;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAGhD"}
|
|
@@ -40,7 +40,7 @@ class CRDAvailabilityCache {
|
|
|
40
40
|
const crdName = 'solutions.dot-ai.devopstoolkit.live';
|
|
41
41
|
try {
|
|
42
42
|
const response = await (0, plugin_registry_1.invokePluginTool)('agentic-tools', 'kubectl_get_resource_json', {
|
|
43
|
-
resource: `crd/${crdName}
|
|
43
|
+
resource: `crd/${crdName}`,
|
|
44
44
|
});
|
|
45
45
|
if (response.success) {
|
|
46
46
|
// Check for nested error - plugin wraps kubectl errors in { success: false, error: "..." }
|
|
@@ -80,7 +80,7 @@ class CRDAvailabilityCache {
|
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
82
82
|
// Other errors - don't cache, throw
|
|
83
|
-
throw new Error(`Failed to check Solution CRD availability: ${errorMsg}
|
|
83
|
+
throw new Error(`Failed to check Solution CRD availability: ${errorMsg}`, { cause: error });
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-operation.d.ts","sourceRoot":"","sources":["../../src/core/deploy-operation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB;AAYD,qBAAa,eAAe;IAC1B;;OAEG;;
|
|
1
|
+
{"version":3,"file":"deploy-operation.d.ts","sourceRoot":"","sources":["../../src/core/deploy-operation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB;AAYD,qBAAa,eAAe;IAC1B;;OAEG;;IASH;;;OAGG;IACU,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IA8BlE;;OAEG;IACH,OAAO,CAAC,eAAe;IAMvB;;OAEG;YACW,oBAAoB;IAQlC;;;OAGG;YACW,cAAc;IAkC5B;;;;OAIG;YACW,cAAc;IAqC5B;;;OAGG;YACW,oBAAoB;CA+BnC"}
|