@vfarcic/dot-ai 1.0.3 → 1.1.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 -0
- package/dist/core/ai-provider.interface.d.ts +12 -8
- package/dist/core/ai-provider.interface.d.ts.map +1 -1
- package/dist/core/artifacthub.d.ts +1 -1
- package/dist/core/artifacthub.d.ts.map +1 -1
- package/dist/core/base-vector-service.d.ts +22 -9
- package/dist/core/base-vector-service.d.ts.map +1 -1
- package/dist/core/base-vector-service.js +106 -37
- package/dist/core/capabilities.d.ts.map +1 -1
- package/dist/core/capabilities.js +5 -2
- package/dist/core/capability-operations.d.ts +55 -7
- package/dist/core/capability-operations.d.ts.map +1 -1
- package/dist/core/capability-operations.js +1 -3
- package/dist/core/capability-scan-workflow.d.ts +64 -8
- package/dist/core/capability-scan-workflow.d.ts.map +1 -1
- package/dist/core/capability-scan-workflow.js +14 -13
- package/dist/core/capability-tools.d.ts +1 -1
- package/dist/core/capability-tools.d.ts.map +1 -1
- package/dist/core/capability-tools.js +1 -1
- package/dist/core/capability-vector-service.d.ts +3 -4
- package/dist/core/capability-vector-service.d.ts.map +1 -1
- package/dist/core/capability-vector-service.js +2 -2
- package/dist/core/command-executor.d.ts +3 -4
- package/dist/core/command-executor.d.ts.map +1 -1
- package/dist/core/command-executor.js +8 -4
- package/dist/core/crd-availability.d.ts +3 -5
- package/dist/core/crd-availability.d.ts.map +1 -1
- package/dist/core/crd-availability.js +8 -18
- package/dist/core/deploy-operation.d.ts +6 -5
- package/dist/core/deploy-operation.d.ts.map +1 -1
- package/dist/core/deploy-operation.js +16 -10
- package/dist/core/discovery.d.ts +6 -14
- package/dist/core/discovery.d.ts.map +1 -1
- package/dist/core/discovery.js +35 -51
- package/dist/core/embedding-service.d.ts.map +1 -1
- package/dist/core/embedding-service.js +1 -1
- package/dist/core/error-handling.d.ts +13 -13
- package/dist/core/error-handling.d.ts.map +1 -1
- package/dist/core/error-handling.js +2 -3
- package/dist/core/generic-session-manager.d.ts +2 -2
- package/dist/core/generic-session-manager.d.ts.map +1 -1
- package/dist/core/helm-types.d.ts +5 -5
- package/dist/core/helm-types.d.ts.map +1 -1
- package/dist/core/index.d.ts +4 -11
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +8 -14
- package/dist/core/knowledge-types.d.ts +114 -0
- package/dist/core/knowledge-types.d.ts.map +1 -0
- package/dist/core/knowledge-types.js +10 -0
- package/dist/core/memory.d.ts +12 -12
- package/dist/core/memory.d.ts.map +1 -1
- package/dist/core/mermaid-tools.d.ts +24 -1
- package/dist/core/mermaid-tools.d.ts.map +1 -1
- package/dist/core/mermaid-tools.js +10 -8
- package/dist/core/packaging.d.ts +23 -1
- package/dist/core/packaging.d.ts.map +1 -1
- package/dist/core/pattern-operations.d.ts +32 -9
- package/dist/core/pattern-operations.d.ts.map +1 -1
- package/dist/core/pattern-operations.js +17 -22
- package/dist/core/pattern-vector-service.d.ts +3 -4
- package/dist/core/pattern-vector-service.d.ts.map +1 -1
- package/dist/core/pattern-vector-service.js +2 -2
- package/dist/core/platform-utils.d.ts +2 -2
- package/dist/core/platform-utils.d.ts.map +1 -1
- package/dist/core/plugin-manager.d.ts +6 -2
- package/dist/core/plugin-manager.d.ts.map +1 -1
- package/dist/core/plugin-manager.js +9 -16
- package/dist/core/plugin-registry.d.ts +59 -0
- package/dist/core/plugin-registry.d.ts.map +1 -0
- package/dist/core/plugin-registry.js +80 -0
- package/dist/core/policy-operations.d.ts +101 -21
- package/dist/core/policy-operations.d.ts.map +1 -1
- package/dist/core/policy-operations.js +45 -47
- package/dist/core/policy-vector-service.d.ts +3 -4
- package/dist/core/policy-vector-service.d.ts.map +1 -1
- package/dist/core/policy-vector-service.js +2 -2
- package/dist/core/providers/host-provider.d.ts +1 -1
- package/dist/core/providers/host-provider.d.ts.map +1 -1
- package/dist/core/providers/host-provider.js +2 -2
- package/dist/core/providers/provider-debug-utils.d.ts +2 -2
- package/dist/core/providers/provider-debug-utils.d.ts.map +1 -1
- package/dist/core/providers/tool-utils.d.ts +10 -2
- package/dist/core/providers/tool-utils.d.ts.map +1 -1
- package/dist/core/providers/tool-utils.js +2 -2
- package/dist/core/providers/vercel-provider.d.ts.map +1 -1
- package/dist/core/providers/vercel-provider.js +29 -23
- package/dist/core/resource-tools.d.ts +29 -1
- package/dist/core/resource-tools.d.ts.map +1 -1
- package/dist/core/resource-vector-service.d.ts +3 -4
- package/dist/core/resource-vector-service.d.ts.map +1 -1
- package/dist/core/resource-vector-service.js +2 -2
- package/dist/core/schema.d.ts +15 -14
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +32 -34
- package/dist/core/shared-prompt-loader.d.ts +1 -1
- package/dist/core/shared-prompt-loader.d.ts.map +1 -1
- package/dist/core/solution-cr.js +1 -1
- package/dist/core/solution-utils.d.ts +22 -3
- package/dist/core/solution-utils.d.ts.map +1 -1
- package/dist/core/solution-utils.js +1 -1
- package/dist/core/telemetry/client.d.ts +0 -6
- package/dist/core/telemetry/client.d.ts.map +1 -1
- package/dist/core/telemetry/client.js +6 -17
- package/dist/core/telemetry/config.js +1 -1
- package/dist/core/telemetry/index.d.ts +1 -1
- package/dist/core/telemetry/index.d.ts.map +1 -1
- package/dist/core/telemetry/index.js +1 -2
- package/dist/core/tracing/tool-tracing.d.ts +1 -1
- package/dist/core/tracing/tool-tracing.d.ts.map +1 -1
- package/dist/core/unified-creation-session.d.ts +15 -8
- package/dist/core/unified-creation-session.d.ts.map +1 -1
- package/dist/core/unified-creation-session.js +19 -19
- package/dist/core/unified-creation-types.d.ts +2 -2
- package/dist/core/unified-creation-types.d.ts.map +1 -1
- package/dist/core/visualization.d.ts +1 -1
- package/dist/core/visualization.d.ts.map +1 -1
- package/dist/core/workflow.d.ts +8 -5
- package/dist/core/workflow.d.ts.map +1 -1
- package/dist/evaluation/dataset-analyzer.d.ts +13 -7
- package/dist/evaluation/dataset-analyzer.d.ts.map +1 -1
- package/dist/evaluation/dataset-analyzer.js +1 -1
- package/dist/evaluation/datasets/loader.d.ts +2 -2
- package/dist/evaluation/datasets/loader.d.ts.map +1 -1
- package/dist/evaluation/eval-runner.js +7 -5
- package/dist/evaluation/evaluators/base-comparative.d.ts +1 -1
- package/dist/evaluation/evaluators/base-comparative.d.ts.map +1 -1
- package/dist/evaluation/evaluators/base-comparative.js +4 -3
- package/dist/evaluation/evaluators/base.d.ts +5 -5
- package/dist/evaluation/evaluators/base.d.ts.map +1 -1
- package/dist/evaluation/evaluators/capability-comparative.js +1 -1
- package/dist/evaluation/platform-synthesizer.d.ts.map +1 -1
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +26 -15
- package/dist/interfaces/openapi-generator.d.ts +116 -12
- package/dist/interfaces/openapi-generator.d.ts.map +1 -1
- package/dist/interfaces/openapi-generator.js +490 -199
- package/dist/interfaces/rest-api.d.ts +28 -6
- package/dist/interfaces/rest-api.d.ts.map +1 -1
- package/dist/interfaces/rest-api.js +436 -245
- package/dist/interfaces/rest-registry.d.ts +4 -4
- package/dist/interfaces/rest-registry.d.ts.map +1 -1
- package/dist/interfaces/rest-registry.js +6 -5
- package/dist/interfaces/rest-route-registry.d.ts +165 -0
- package/dist/interfaces/rest-route-registry.d.ts.map +1 -0
- package/dist/interfaces/rest-route-registry.js +230 -0
- package/dist/interfaces/routes/index.d.ts +22 -0
- package/dist/interfaces/routes/index.d.ts.map +1 -0
- package/dist/interfaces/routes/index.js +347 -0
- package/dist/interfaces/schemas/common.d.ts +177 -0
- package/dist/interfaces/schemas/common.d.ts.map +1 -0
- package/dist/interfaces/schemas/common.js +102 -0
- package/dist/interfaces/schemas/events.d.ts +131 -0
- package/dist/interfaces/schemas/events.d.ts.map +1 -0
- package/dist/interfaces/schemas/events.js +66 -0
- package/dist/interfaces/schemas/index.d.ts +21 -0
- package/dist/interfaces/schemas/index.d.ts.map +1 -0
- package/dist/interfaces/schemas/index.js +138 -0
- package/dist/interfaces/schemas/knowledge.d.ts +210 -0
- package/dist/interfaces/schemas/knowledge.d.ts.map +1 -0
- package/dist/interfaces/schemas/knowledge.js +117 -0
- package/dist/interfaces/schemas/logs.d.ts +82 -0
- package/dist/interfaces/schemas/logs.d.ts.map +1 -0
- package/dist/interfaces/schemas/logs.js +46 -0
- package/dist/interfaces/schemas/prompts.d.ts +191 -0
- package/dist/interfaces/schemas/prompts.d.ts.map +1 -0
- package/dist/interfaces/schemas/prompts.js +91 -0
- package/dist/interfaces/schemas/resources.d.ts +378 -0
- package/dist/interfaces/schemas/resources.d.ts.map +1 -0
- package/dist/interfaces/schemas/resources.js +173 -0
- package/dist/interfaces/schemas/sessions.d.ts +90 -0
- package/dist/interfaces/schemas/sessions.d.ts.map +1 -0
- package/dist/interfaces/schemas/sessions.js +56 -0
- package/dist/interfaces/schemas/tools.d.ts +194 -0
- package/dist/interfaces/schemas/tools.d.ts.map +1 -0
- package/dist/interfaces/schemas/tools.js +101 -0
- package/dist/interfaces/schemas/visualization.d.ts +373 -0
- package/dist/interfaces/schemas/visualization.d.ts.map +1 -0
- package/dist/interfaces/schemas/visualization.js +134 -0
- package/dist/mcp/server.js +5 -4
- package/dist/tools/answer-question.d.ts +1 -1
- package/dist/tools/answer-question.d.ts.map +1 -1
- package/dist/tools/answer-question.js +9 -8
- package/dist/tools/deploy-manifests.d.ts +4 -2
- package/dist/tools/deploy-manifests.d.ts.map +1 -1
- package/dist/tools/deploy-manifests.js +10 -6
- package/dist/tools/generate-manifests.d.ts.map +1 -1
- package/dist/tools/generate-manifests.js +28 -20
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -1
- package/dist/tools/manage-knowledge.d.ts +77 -0
- package/dist/tools/manage-knowledge.d.ts.map +1 -0
- package/dist/tools/manage-knowledge.js +573 -0
- package/dist/tools/operate-analysis.d.ts +31 -2
- package/dist/tools/operate-analysis.d.ts.map +1 -1
- package/dist/tools/operate-execution.d.ts +2 -3
- package/dist/tools/operate-execution.d.ts.map +1 -1
- package/dist/tools/operate-execution.js +7 -7
- package/dist/tools/operate.d.ts +7 -2
- package/dist/tools/operate.d.ts.map +1 -1
- package/dist/tools/operate.js +2 -2
- package/dist/tools/organizational-data.d.ts +30 -4
- package/dist/tools/organizational-data.d.ts.map +1 -1
- package/dist/tools/organizational-data.js +24 -19
- package/dist/tools/project-setup/discovery.d.ts.map +1 -1
- package/dist/tools/project-setup/generate-scope.d.ts +1 -1
- package/dist/tools/project-setup/generate-scope.d.ts.map +1 -1
- package/dist/tools/project-setup/types.d.ts +1 -0
- package/dist/tools/project-setup/types.d.ts.map +1 -1
- package/dist/tools/prompts.d.ts +28 -2
- package/dist/tools/prompts.d.ts.map +1 -1
- package/dist/tools/query.d.ts +17 -3
- package/dist/tools/query.d.ts.map +1 -1
- package/dist/tools/query.js +1 -7
- package/dist/tools/recommend.d.ts +24 -6
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +18 -15
- package/dist/tools/remediate.d.ts +12 -3
- package/dist/tools/remediate.d.ts.map +1 -1
- package/dist/tools/remediate.js +22 -14
- package/dist/tools/version.d.ts +19 -5
- package/dist/tools/version.d.ts.map +1 -1
- package/dist/tools/version.js +106 -54
- package/package.json +11 -5
- package/prompts/knowledge-ask.md +29 -0
- package/dist/core/vector-db-service.d.ts +0 -108
- package/dist/core/vector-db-service.d.ts.map +0 -1
- package/dist/core/vector-db-service.js +0 -647
package/dist/core/schema.js
CHANGED
|
@@ -40,8 +40,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
40
40
|
})();
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
exports.ResourceRecommender = exports.ManifestValidator = exports.SchemaParser = exports.OUTPUT_PATH_QUESTION = exports.OUTPUT_FORMAT_QUESTION = void 0;
|
|
43
|
+
const plugin_registry_1 = require("./plugin-registry");
|
|
43
44
|
const pattern_vector_service_1 = require("./pattern-vector-service");
|
|
44
|
-
const vector_db_service_1 = require("./vector-db-service");
|
|
45
45
|
const capability_vector_service_1 = require("./capability-vector-service");
|
|
46
46
|
const policy_vector_service_1 = require("./policy-vector-service");
|
|
47
47
|
const shared_prompt_loader_1 = require("./shared-prompt-loader");
|
|
@@ -252,19 +252,21 @@ exports.SchemaParser = SchemaParser;
|
|
|
252
252
|
* PRD #343: Supports plugin system for kubectl operations
|
|
253
253
|
*/
|
|
254
254
|
class ManifestValidator {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
/**
|
|
256
|
+
* PRD #359: Uses unified plugin registry for kubectl operations
|
|
257
|
+
*/
|
|
258
|
+
constructor() {
|
|
259
|
+
// Plugin registry will be checked at operation time
|
|
258
260
|
}
|
|
259
261
|
/**
|
|
260
262
|
* Execute kubectl via plugin system
|
|
261
|
-
* PRD #
|
|
263
|
+
* PRD #359: ALL Kubernetes operations go through unified plugin registry
|
|
262
264
|
*/
|
|
263
265
|
async executeKubectlViaPlugin(args) {
|
|
264
|
-
if (!
|
|
266
|
+
if (!(0, plugin_registry_1.isPluginInitialized)()) {
|
|
265
267
|
throw new Error('Plugin system not available. ManifestValidator requires agentic-tools plugin for kubectl operations.');
|
|
266
268
|
}
|
|
267
|
-
const response = await
|
|
269
|
+
const response = await (0, plugin_registry_1.invokePluginTool)('agentic-tools', 'kubectl_exec_command', { args });
|
|
268
270
|
if (response.success) {
|
|
269
271
|
if (typeof response.result === 'object' && response.result !== null) {
|
|
270
272
|
const result = response.result;
|
|
@@ -290,23 +292,23 @@ class ManifestValidator {
|
|
|
290
292
|
/**
|
|
291
293
|
* Validate a manifest using kubectl dry-run
|
|
292
294
|
* This uses the actual Kubernetes API server validation for accuracy
|
|
293
|
-
* PRD #
|
|
295
|
+
* PRD #359: Routes through unified plugin registry
|
|
294
296
|
*/
|
|
295
297
|
async validateManifest(manifestPath, config) {
|
|
296
298
|
const errors = [];
|
|
297
299
|
const warnings = [];
|
|
298
300
|
try {
|
|
299
301
|
const dryRunMode = config?.dryRunMode || 'server';
|
|
300
|
-
// PRD #
|
|
302
|
+
// PRD #359: Read manifest content and use kubectl_apply_dryrun tool via unified registry
|
|
301
303
|
// File paths don't work across containers, so we pass content via plugin tool
|
|
302
304
|
const fs = await Promise.resolve().then(() => __importStar(require('fs')));
|
|
303
305
|
const yaml = await Promise.resolve().then(() => __importStar(require('yaml')));
|
|
304
306
|
const manifestContent = fs.readFileSync(manifestPath, 'utf8');
|
|
305
|
-
if (!
|
|
307
|
+
if (!(0, plugin_registry_1.isPluginInitialized)()) {
|
|
306
308
|
throw new Error('Plugin system not available. ManifestValidator requires agentic-tools plugin for kubectl operations.');
|
|
307
309
|
}
|
|
308
310
|
// Use kubectl_apply_dryrun tool which accepts manifest content
|
|
309
|
-
const response = await
|
|
311
|
+
const response = await (0, plugin_registry_1.invokePluginTool)('agentic-tools', 'kubectl_apply_dryrun', {
|
|
310
312
|
manifest: manifestContent,
|
|
311
313
|
dryRunMode: dryRunMode
|
|
312
314
|
});
|
|
@@ -337,7 +339,7 @@ class ManifestValidator {
|
|
|
337
339
|
}
|
|
338
340
|
catch (error) {
|
|
339
341
|
// Parse kubectl error output for validation issues
|
|
340
|
-
const errorMessage = error.message
|
|
342
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
341
343
|
if (errorMessage.includes('validation failed')) {
|
|
342
344
|
errors.push('Kubernetes validation failed: ' + errorMessage);
|
|
343
345
|
}
|
|
@@ -374,64 +376,60 @@ class ManifestValidator {
|
|
|
374
376
|
exports.ManifestValidator = ManifestValidator;
|
|
375
377
|
/**
|
|
376
378
|
* ResourceRecommender determines which resources best meet user needs using AI
|
|
379
|
+
* PRD #359: Uses unified plugin registry for kubectl operations
|
|
377
380
|
*/
|
|
378
381
|
class ResourceRecommender {
|
|
379
382
|
aiProvider;
|
|
380
383
|
patternService;
|
|
381
384
|
capabilityService;
|
|
382
385
|
policyService;
|
|
383
|
-
|
|
384
|
-
pluginManager;
|
|
385
|
-
constructor(aiProvider, pluginManager) {
|
|
386
|
-
this.pluginManager = pluginManager;
|
|
386
|
+
constructor(aiProvider) {
|
|
387
387
|
// Use provided AI provider or create from environment
|
|
388
388
|
this.aiProvider = aiProvider || (() => {
|
|
389
389
|
// Lazy import to avoid circular dependencies
|
|
390
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports -- Dynamic require to avoid circular dependency
|
|
390
391
|
const { createAIProvider } = require('./ai-provider-factory');
|
|
391
392
|
return createAIProvider();
|
|
392
393
|
})();
|
|
393
|
-
// Initialize capability service - fail gracefully if
|
|
394
|
+
// Initialize capability service - fail gracefully if plugin unavailable
|
|
394
395
|
try {
|
|
395
396
|
// Use environment variable for collection name (allows using test data collection)
|
|
396
397
|
const collectionName = process.env.QDRANT_CAPABILITIES_COLLECTION || 'capabilities';
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
console.log(`✅ Capability service initialized with Vector DB (collection: ${collectionName})`);
|
|
398
|
+
this.capabilityService = new capability_vector_service_1.CapabilityVectorService(collectionName);
|
|
399
|
+
console.log(`✅ Capability service initialized (collection: ${collectionName})`);
|
|
400
400
|
}
|
|
401
401
|
catch (error) {
|
|
402
|
-
console.warn('⚠️ Vector
|
|
402
|
+
console.warn('⚠️ Vector service initialization failed, capabilities disabled:', error);
|
|
403
403
|
this.capabilityService = undefined;
|
|
404
404
|
}
|
|
405
|
-
// Initialize pattern service
|
|
405
|
+
// Initialize pattern service
|
|
406
406
|
try {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
console.log('✅ Pattern service initialized with Vector DB');
|
|
407
|
+
this.patternService = new pattern_vector_service_1.PatternVectorService('patterns');
|
|
408
|
+
console.log('✅ Pattern service initialized');
|
|
410
409
|
}
|
|
411
410
|
catch (error) {
|
|
412
|
-
console.warn('⚠️ Vector
|
|
411
|
+
console.warn('⚠️ Vector service initialization failed, patterns disabled:', error);
|
|
413
412
|
this.patternService = undefined;
|
|
414
413
|
}
|
|
415
|
-
// Initialize policy service
|
|
414
|
+
// Initialize policy service
|
|
416
415
|
try {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
console.log('✅ Policy service initialized with Vector DB');
|
|
416
|
+
this.policyService = new policy_vector_service_1.PolicyVectorService();
|
|
417
|
+
console.log('✅ Policy service initialized');
|
|
420
418
|
}
|
|
421
419
|
catch (error) {
|
|
422
|
-
console.warn('⚠️ Vector
|
|
420
|
+
console.warn('⚠️ Vector service initialization failed, policies disabled:', error);
|
|
423
421
|
this.policyService = undefined;
|
|
424
422
|
}
|
|
425
423
|
}
|
|
426
424
|
/**
|
|
427
425
|
* Execute kubectl via plugin system
|
|
428
|
-
* PRD #
|
|
426
|
+
* PRD #359: ALL Kubernetes operations go through unified plugin registry
|
|
429
427
|
*/
|
|
430
428
|
async executeKubectlViaPlugin(args) {
|
|
431
|
-
if (!
|
|
429
|
+
if (!(0, plugin_registry_1.isPluginInitialized)()) {
|
|
432
430
|
throw new Error('Plugin system not available. ResourceRecommender requires agentic-tools plugin for kubectl operations.');
|
|
433
431
|
}
|
|
434
|
-
const response = await
|
|
432
|
+
const response = await (0, plugin_registry_1.invokePluginTool)('agentic-tools', 'kubectl_exec_command', { args });
|
|
435
433
|
if (response.success) {
|
|
436
434
|
if (typeof response.result === 'object' && response.result !== null) {
|
|
437
435
|
const result = response.result;
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
* - {{#if variable}}...{{/if}} - Conditional blocks
|
|
22
22
|
* - {{#each array}}...{{/each}} - Iteration
|
|
23
23
|
*/
|
|
24
|
-
export declare function loadPrompt(templateName: string, variables?: Record<string,
|
|
24
|
+
export declare function loadPrompt(templateName: string, variables?: Record<string, unknown>, baseDir?: string, fileExtension?: string): string;
|
|
25
25
|
//# sourceMappingURL=shared-prompt-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-prompt-loader.d.ts","sourceRoot":"","sources":["../../src/core/shared-prompt-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"shared-prompt-loader.d.ts","sourceRoot":"","sources":["../../src/core/shared-prompt-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA2CH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,YAAY,EAAE,MAAM,EACpB,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACvC,OAAO,GAAE,MAAkB,EAC3B,aAAa,GAAE,MAAc,GAC5B,MAAM,CAyBR"}
|
package/dist/core/solution-cr.js
CHANGED
|
@@ -96,7 +96,7 @@ function extractResourceReferences(manifestsYaml, defaultNamespace) {
|
|
|
96
96
|
try {
|
|
97
97
|
const manifests = yaml.loadAll(manifestsYaml);
|
|
98
98
|
return manifests
|
|
99
|
-
.filter((manifest) => manifest && manifest.kind && manifest.metadata?.name)
|
|
99
|
+
.filter((manifest) => Boolean(manifest && manifest.kind && manifest.apiVersion && manifest.metadata?.name))
|
|
100
100
|
.map((manifest) => ({
|
|
101
101
|
apiVersion: manifest.apiVersion,
|
|
102
102
|
kind: manifest.kind,
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Solution utilities for working with solution data structures
|
|
3
3
|
*/
|
|
4
|
+
interface SolutionQuestion {
|
|
5
|
+
id?: string;
|
|
6
|
+
answer?: unknown;
|
|
7
|
+
}
|
|
8
|
+
interface SolutionQuestions {
|
|
9
|
+
required?: SolutionQuestion[];
|
|
10
|
+
basic?: SolutionQuestion[];
|
|
11
|
+
advanced?: SolutionQuestion[];
|
|
12
|
+
open?: {
|
|
13
|
+
answer?: string;
|
|
14
|
+
};
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface Solution {
|
|
18
|
+
questions: SolutionQuestions;
|
|
19
|
+
intent?: string;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
4
22
|
/**
|
|
5
23
|
* Extract all user answers from a solution's questions
|
|
6
24
|
*/
|
|
7
|
-
export declare function extractUserAnswers(solution:
|
|
25
|
+
export declare function extractUserAnswers(solution: Solution): Record<string, unknown>;
|
|
8
26
|
/**
|
|
9
27
|
* Sanitize intent string for use as Kubernetes label (63 char limit, alphanumeric + hyphens)
|
|
10
28
|
*/
|
|
@@ -12,9 +30,10 @@ export declare function sanitizeIntentForLabel(intent: string): string;
|
|
|
12
30
|
/**
|
|
13
31
|
* Generate standard dot-ai labels for Kubernetes resources
|
|
14
32
|
*/
|
|
15
|
-
export declare function generateDotAiLabels(userAnswers: Record<string,
|
|
33
|
+
export declare function generateDotAiLabels(userAnswers: Record<string, unknown>, solution: Solution): Record<string, string>;
|
|
16
34
|
/**
|
|
17
35
|
* Add dot-ai labels to existing labels object
|
|
18
36
|
*/
|
|
19
|
-
export declare function addDotAiLabels(existingLabels: Record<string, string> | undefined, userAnswers: Record<string,
|
|
37
|
+
export declare function addDotAiLabels(existingLabels: Record<string, string> | undefined, userAnswers: Record<string, unknown>, solution: Solution): Record<string, string>;
|
|
38
|
+
export {};
|
|
20
39
|
//# sourceMappingURL=solution-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solution-utils.d.ts","sourceRoot":"","sources":["../../src/core/solution-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"solution-utils.d.ts","sourceRoot":"","sources":["../../src/core/solution-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,UAAU,gBAAgB;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoB9E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAM7D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBpH;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAClD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,QAAQ,EAAE,QAAQ,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGxB"}
|
|
@@ -17,7 +17,7 @@ function extractUserAnswers(solution) {
|
|
|
17
17
|
for (const category of questionCategories) {
|
|
18
18
|
const questions = solution.questions[category] || [];
|
|
19
19
|
for (const question of questions) {
|
|
20
|
-
if (question.answer !== undefined && question.answer !== null) {
|
|
20
|
+
if (question.id && question.answer !== undefined && question.answer !== null) {
|
|
21
21
|
userAnswers[question.id] = question.answer;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -6,12 +6,6 @@
|
|
|
6
6
|
* PRD #343: Uses plugin system for K8s operations instead of direct @kubernetes/client-node.
|
|
7
7
|
*/
|
|
8
8
|
import { TelemetryService } from './types';
|
|
9
|
-
import type { PluginManager } from '../plugin-manager';
|
|
10
|
-
/**
|
|
11
|
-
* Set plugin manager for telemetry K8s operations
|
|
12
|
-
* Must be called before first getTelemetry() use for cluster ID generation
|
|
13
|
-
*/
|
|
14
|
-
export declare function setTelemetryPluginManager(pluginManager: PluginManager): void;
|
|
15
9
|
/**
|
|
16
10
|
* Get or create the global telemetry instance
|
|
17
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/core/telemetry/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAEL,gBAAgB,EAUjB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/core/telemetry/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAEL,gBAAgB,EAUjB,MAAM,SAAS,CAAC;AAmRjB;;GAEG;AACH,wBAAgB,YAAY,IAAI,gBAAgB,CAM/C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAKvD"}
|
|
@@ -7,39 +7,28 @@
|
|
|
7
7
|
* PRD #343: Uses plugin system for K8s operations instead of direct @kubernetes/client-node.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.setTelemetryPluginManager = setTelemetryPluginManager;
|
|
11
10
|
exports.getTelemetry = getTelemetry;
|
|
12
11
|
exports.shutdownTelemetry = shutdownTelemetry;
|
|
13
12
|
const posthog_node_1 = require("posthog-node");
|
|
14
13
|
const crypto_1 = require("crypto");
|
|
15
14
|
const config_1 = require("./config");
|
|
15
|
+
const plugin_registry_1 = require("../plugin-registry");
|
|
16
16
|
/**
|
|
17
17
|
* Global telemetry instance (singleton pattern with lazy initialization)
|
|
18
18
|
*/
|
|
19
19
|
let telemetryInstance = null;
|
|
20
|
-
/**
|
|
21
|
-
* PRD #343: Plugin manager for K8s operations (set before first telemetry use)
|
|
22
|
-
*/
|
|
23
|
-
let telemetryPluginManager = null;
|
|
24
|
-
/**
|
|
25
|
-
* Set plugin manager for telemetry K8s operations
|
|
26
|
-
* Must be called before first getTelemetry() use for cluster ID generation
|
|
27
|
-
*/
|
|
28
|
-
function setTelemetryPluginManager(pluginManager) {
|
|
29
|
-
telemetryPluginManager = pluginManager;
|
|
30
|
-
}
|
|
31
20
|
/**
|
|
32
21
|
* Generate anonymous instance ID from Kubernetes cluster UID
|
|
33
22
|
*
|
|
34
23
|
* Uses SHA-256 hash of the kube-system namespace UID to create a stable,
|
|
35
24
|
* anonymous identifier that's unique per cluster but doesn't reveal cluster identity.
|
|
36
|
-
* PRD #
|
|
25
|
+
* PRD #359: Uses unified plugin registry for kubectl operations.
|
|
37
26
|
*/
|
|
38
27
|
async function generateInstanceId() {
|
|
39
|
-
// PRD #
|
|
40
|
-
if (
|
|
28
|
+
// PRD #359: Use unified plugin registry for K8s operations
|
|
29
|
+
if ((0, plugin_registry_1.isPluginInitialized)()) {
|
|
41
30
|
try {
|
|
42
|
-
const response = await
|
|
31
|
+
const response = await (0, plugin_registry_1.invokePluginTool)('agentic-tools', 'kubectl_get_resource_json', {
|
|
43
32
|
resource: 'namespace/kube-system',
|
|
44
33
|
field: 'metadata'
|
|
45
34
|
});
|
|
@@ -69,7 +58,7 @@ async function generateInstanceId() {
|
|
|
69
58
|
}
|
|
70
59
|
}
|
|
71
60
|
}
|
|
72
|
-
catch
|
|
61
|
+
catch {
|
|
73
62
|
// Plugin not available or failed - fall through to random ID
|
|
74
63
|
}
|
|
75
64
|
}
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
*/
|
|
27
27
|
export * from './types';
|
|
28
28
|
export { loadTelemetryConfig } from './config';
|
|
29
|
-
export { getTelemetry, shutdownTelemetry
|
|
29
|
+
export { getTelemetry, shutdownTelemetry } from './client';
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/telemetry/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/telemetry/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -40,11 +40,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
40
40
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
41
41
|
};
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.
|
|
43
|
+
exports.shutdownTelemetry = exports.getTelemetry = exports.loadTelemetryConfig = void 0;
|
|
44
44
|
__exportStar(require("./types"), exports);
|
|
45
45
|
var config_1 = require("./config");
|
|
46
46
|
Object.defineProperty(exports, "loadTelemetryConfig", { enumerable: true, get: function () { return config_1.loadTelemetryConfig; } });
|
|
47
47
|
var client_1 = require("./client");
|
|
48
48
|
Object.defineProperty(exports, "getTelemetry", { enumerable: true, get: function () { return client_1.getTelemetry; } });
|
|
49
49
|
Object.defineProperty(exports, "shutdownTelemetry", { enumerable: true, get: function () { return client_1.shutdownTelemetry; } });
|
|
50
|
-
Object.defineProperty(exports, "setTelemetryPluginManager", { enumerable: true, get: function () { return client_1.setTelemetryPluginManager; } });
|
|
@@ -36,5 +36,5 @@ export interface ToolTracingOptions {
|
|
|
36
36
|
* }, { mcpClient: { name: 'claude-code', version: '1.0.0' } });
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
|
-
export declare function withToolTracing<T>(toolName: string, args:
|
|
39
|
+
export declare function withToolTracing<T, A = unknown>(toolName: string, args: A, handler: (args: A) => Promise<T>, options?: ToolTracingOptions): Promise<T>;
|
|
40
40
|
//# sourceMappingURL=tool-tracing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-tracing.d.ts","sourceRoot":"","sources":["../../../src/core/tracing/tool-tracing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAgB,aAAa,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,eAAe,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"tool-tracing.d.ts","sourceRoot":"","sources":["../../../src/core/tracing/tool-tracing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAgB,aAAa,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,EAClD,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EAChC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,CAAC,CAAC,CA+DZ"}
|
|
@@ -6,33 +6,39 @@
|
|
|
6
6
|
* Loads prompts from markdown files following CLAUDE.md guidelines.
|
|
7
7
|
*/
|
|
8
8
|
import { KubernetesDiscovery } from './discovery';
|
|
9
|
-
import type { PluginManager } from './plugin-manager';
|
|
10
9
|
import { UnifiedCreationSession, UnifiedWorkflowStepResponse, UnifiedWorkflowCompletionResponse, EntityType } from './unified-creation-types';
|
|
10
|
+
/**
|
|
11
|
+
* Session creation/operation arguments
|
|
12
|
+
*/
|
|
13
|
+
interface SessionArgs {
|
|
14
|
+
collection?: string;
|
|
15
|
+
interaction_id?: string;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
11
18
|
export declare class UnifiedCreationSessionManager {
|
|
12
19
|
private config;
|
|
13
20
|
private discovery;
|
|
14
21
|
private sessionManager;
|
|
15
|
-
private pluginManager;
|
|
16
22
|
/**
|
|
17
|
-
* PRD #
|
|
23
|
+
* PRD #359: Uses unified plugin registry for kubectl operations
|
|
18
24
|
*/
|
|
19
|
-
constructor(entityType: EntityType, discovery?: KubernetesDiscovery
|
|
25
|
+
constructor(entityType: EntityType, discovery?: KubernetesDiscovery);
|
|
20
26
|
/**
|
|
21
27
|
* Create a new creation session
|
|
22
28
|
*/
|
|
23
|
-
createSession(args:
|
|
29
|
+
createSession(args: SessionArgs): UnifiedCreationSession;
|
|
24
30
|
/**
|
|
25
31
|
* Load existing session
|
|
26
32
|
*/
|
|
27
|
-
loadSession(sessionId: string
|
|
33
|
+
loadSession(sessionId: string): UnifiedCreationSession | null;
|
|
28
34
|
/**
|
|
29
35
|
* Process user response and advance session
|
|
30
36
|
*/
|
|
31
|
-
processResponse(sessionId: string, response: string
|
|
37
|
+
processResponse(sessionId: string, response: string): UnifiedCreationSession;
|
|
32
38
|
/**
|
|
33
39
|
* Generate next workflow step
|
|
34
40
|
*/
|
|
35
|
-
getNextWorkflowStep(session: UnifiedCreationSession, args?:
|
|
41
|
+
getNextWorkflowStep(session: UnifiedCreationSession, args?: SessionArgs): Promise<UnifiedWorkflowStepResponse | UnifiedWorkflowCompletionResponse>;
|
|
36
42
|
/**
|
|
37
43
|
* Generate trigger expansion step with AI suggestions
|
|
38
44
|
*/
|
|
@@ -78,4 +84,5 @@ export declare class UnifiedCreationSessionManager {
|
|
|
78
84
|
*/
|
|
79
85
|
private formatSchemasForPrompt;
|
|
80
86
|
}
|
|
87
|
+
export {};
|
|
81
88
|
//# sourceMappingURL=unified-creation-session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-creation-session.d.ts","sourceRoot":"","sources":["../../src/core/unified-creation-session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"unified-creation-session.d.ts","sourceRoot":"","sources":["../../src/core/unified-creation-session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAMlD,OAAO,EACL,sBAAsB,EAEtB,2BAA2B,EAC3B,iCAAiC,EACjC,UAAU,EAIX,MAAM,0BAA0B,CAAC;AAKlC;;GAEG;AACH,UAAU,WAAW;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAyBD,qBAAa,6BAA6B;IACxC,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,cAAc,CAAoD;IAE1E;;OAEG;gBACS,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,mBAAmB;IAUnE;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,sBAAsB;IAWxD;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,sBAAsB,GAAG,IAAI;IAI7D;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,sBAAsB;IAiH5E;;OAEG;IACG,mBAAmB,CAAC,OAAO,EAAE,sBAAsB,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,2BAA2B,GAAG,iCAAiC,CAAC;IAiGxJ;;OAEG;YACW,4BAA4B;IA4C1C;;OAEG;YACW,gCAAgC;IA0C9C;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA6E1B;;OAEG;YACW,gBAAgB;IAsF9B;;OAEG;YACW,4BAA4B;IAsH1C;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAY1B;;OAEG;YACW,qBAAqB;IAsCnC;;OAEG;YACW,mBAAmB;IAuLjC;;OAEG;YACW,uBAAuB;IAsGrC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;CAY/B"}
|
|
@@ -52,6 +52,7 @@ const discovery_1 = require("./discovery");
|
|
|
52
52
|
const schema_1 = require("./schema");
|
|
53
53
|
const version_1 = require("../tools/version");
|
|
54
54
|
const platform_utils_1 = require("./platform-utils");
|
|
55
|
+
const plugin_registry_1 = require("./plugin-registry");
|
|
55
56
|
const yaml = __importStar(require("js-yaml"));
|
|
56
57
|
const unified_creation_types_1 = require("./unified-creation-types");
|
|
57
58
|
const pattern_operations_1 = require("./pattern-operations");
|
|
@@ -59,20 +60,16 @@ class UnifiedCreationSessionManager {
|
|
|
59
60
|
config;
|
|
60
61
|
discovery;
|
|
61
62
|
sessionManager;
|
|
62
|
-
pluginManager;
|
|
63
63
|
/**
|
|
64
|
-
* PRD #
|
|
64
|
+
* PRD #359: Uses unified plugin registry for kubectl operations
|
|
65
65
|
*/
|
|
66
|
-
constructor(entityType, discovery
|
|
67
|
-
if (!
|
|
66
|
+
constructor(entityType, discovery) {
|
|
67
|
+
if (!(0, plugin_registry_1.isPluginInitialized)()) {
|
|
68
68
|
throw new Error('Plugin system not available. UnifiedCreationSessionManager requires agentic-tools plugin for kubectl operations.');
|
|
69
69
|
}
|
|
70
70
|
this.config = unified_creation_types_1.WORKFLOW_CONFIGS[entityType];
|
|
71
71
|
this.discovery = discovery || new discovery_1.KubernetesDiscovery();
|
|
72
72
|
this.sessionManager = new generic_session_manager_1.GenericSessionManager(entityType);
|
|
73
|
-
this.pluginManager = pluginManager;
|
|
74
|
-
// PRD #343: Set pluginManager on discovery for kubectl operations
|
|
75
|
-
this.discovery.setPluginManager(pluginManager);
|
|
76
73
|
}
|
|
77
74
|
/**
|
|
78
75
|
* Create a new creation session
|
|
@@ -89,14 +86,14 @@ class UnifiedCreationSessionManager {
|
|
|
89
86
|
/**
|
|
90
87
|
* Load existing session
|
|
91
88
|
*/
|
|
92
|
-
loadSession(sessionId
|
|
89
|
+
loadSession(sessionId) {
|
|
93
90
|
return this.sessionManager.getSession(sessionId);
|
|
94
91
|
}
|
|
95
92
|
/**
|
|
96
93
|
* Process user response and advance session
|
|
97
94
|
*/
|
|
98
|
-
processResponse(sessionId, response
|
|
99
|
-
const session = this.loadSession(sessionId
|
|
95
|
+
processResponse(sessionId, response) {
|
|
96
|
+
const session = this.loadSession(sessionId);
|
|
100
97
|
if (!session) {
|
|
101
98
|
throw new Error(`${this.config.displayName} session ${sessionId} not found`);
|
|
102
99
|
}
|
|
@@ -117,7 +114,7 @@ class UnifiedCreationSessionManager {
|
|
|
117
114
|
session.data.expandedTriggers = confirmed;
|
|
118
115
|
session.data.currentStep = (0, unified_creation_types_1.getNextStep)('trigger-expansion', this.config);
|
|
119
116
|
}
|
|
120
|
-
catch
|
|
117
|
+
catch {
|
|
121
118
|
// If not JSON, treat as comma-separated list
|
|
122
119
|
session.data.expandedTriggers = response.split(',').map(t => t.trim()).filter(t => t.length > 0);
|
|
123
120
|
session.data.currentStep = (0, unified_creation_types_1.getNextStep)('trigger-expansion', this.config);
|
|
@@ -256,7 +253,7 @@ class UnifiedCreationSessionManager {
|
|
|
256
253
|
};
|
|
257
254
|
case 'namespace-scope': {
|
|
258
255
|
// Check if Kyverno is installed - only show namespace options if it is
|
|
259
|
-
const kyvernoStatus = await (0, version_1.getKyvernoStatusViaPlugin)(
|
|
256
|
+
const kyvernoStatus = await (0, version_1.getKyvernoStatusViaPlugin)();
|
|
260
257
|
if (!kyvernoStatus.installed) {
|
|
261
258
|
// Skip namespace-scope if Kyverno not installed, go to next step
|
|
262
259
|
session.data.currentStep = (0, unified_creation_types_1.getNextStep)('namespace-scope', this.config);
|
|
@@ -332,6 +329,7 @@ class UnifiedCreationSessionManager {
|
|
|
332
329
|
* Generate trigger expansion using internal AI
|
|
333
330
|
*/
|
|
334
331
|
async generateInternalTriggerExpansion(initialTriggers, description, interaction_id) {
|
|
332
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports -- Dynamic require to avoid circular dependency
|
|
335
333
|
const { createAIProvider } = require('./ai-provider-factory');
|
|
336
334
|
const aiProvider = createAIProvider();
|
|
337
335
|
if (!aiProvider.isInitialized()) {
|
|
@@ -547,10 +545,10 @@ The pattern is now ready to enhance AI recommendations. When users ask for deplo
|
|
|
547
545
|
// Save Kyverno policy to file
|
|
548
546
|
fs.writeFileSync(kyvernoFilePath, generatedKyvernoPolicy, 'utf8');
|
|
549
547
|
// Apply to cluster using existing DeployOperation
|
|
550
|
-
// PRD #
|
|
548
|
+
// PRD #359: Uses unified plugin registry for kubectl operations
|
|
551
549
|
try {
|
|
552
550
|
const { DeployOperation } = await Promise.resolve().then(() => __importStar(require('./deploy-operation')));
|
|
553
|
-
const deployOp = new DeployOperation(
|
|
551
|
+
const deployOp = new DeployOperation();
|
|
554
552
|
const deployResult = await deployOp.deploy({
|
|
555
553
|
solutionId: `${policy.id}-kyverno`,
|
|
556
554
|
sessionDir,
|
|
@@ -581,6 +579,7 @@ ${deployResult.kubectlOutput}`,
|
|
|
581
579
|
};
|
|
582
580
|
}
|
|
583
581
|
catch (deployError) {
|
|
582
|
+
const errorMessage = deployError instanceof Error ? deployError.message : String(deployError);
|
|
584
583
|
return {
|
|
585
584
|
sessionId: session.sessionId,
|
|
586
585
|
entityType: this.config.entityType,
|
|
@@ -588,12 +587,12 @@ ${deployResult.kubectlOutput}`,
|
|
|
588
587
|
|
|
589
588
|
**Policy ID**: ${policy.id}
|
|
590
589
|
**Description**: ${policy.description}
|
|
591
|
-
**Error**: ${
|
|
590
|
+
**Error**: ${errorMessage}
|
|
592
591
|
**Kyverno File**: ${kyvernoFilePath}
|
|
593
592
|
|
|
594
593
|
The policy intent has been stored in the database, but the Kyverno policy could not be applied to the cluster. You can manually apply it using:
|
|
595
594
|
\`kubectl apply -f ${kyvernoFilePath}\``,
|
|
596
|
-
data: { policy, kyvernoPolicy: generatedKyvernoPolicy, applied: false, error:
|
|
595
|
+
data: { policy, kyvernoPolicy: generatedKyvernoPolicy, applied: false, error: errorMessage, kyvernoFile: kyvernoFilePath }
|
|
597
596
|
};
|
|
598
597
|
}
|
|
599
598
|
}
|
|
@@ -667,9 +666,9 @@ The policy intent has been stored in the database. The Kyverno policy was not ap
|
|
|
667
666
|
};
|
|
668
667
|
}
|
|
669
668
|
// 2. kubectl dry-run validation using ManifestValidator
|
|
670
|
-
// PRD #
|
|
669
|
+
// PRD #359: Uses unified plugin registry for kubectl operations
|
|
671
670
|
try {
|
|
672
|
-
const validator = new schema_1.ManifestValidator(
|
|
671
|
+
const validator = new schema_1.ManifestValidator();
|
|
673
672
|
const result = await validator.validateManifest(yamlPath, { dryRunMode: 'server' });
|
|
674
673
|
return result;
|
|
675
674
|
}
|
|
@@ -686,7 +685,7 @@ The policy intent has been stored in the database. The Kyverno policy was not ap
|
|
|
686
685
|
*/
|
|
687
686
|
async generateKyvernoStep(session, args) {
|
|
688
687
|
// Check if Kyverno is available before attempting policy generation
|
|
689
|
-
const kyvernoStatus = await (0, version_1.getKyvernoStatusViaPlugin)(
|
|
688
|
+
const kyvernoStatus = await (0, version_1.getKyvernoStatusViaPlugin)();
|
|
690
689
|
if (!kyvernoStatus.policyGenerationReady) {
|
|
691
690
|
// Skip Kyverno generation and go directly to review with intent-only option
|
|
692
691
|
session.data.currentStep = (0, unified_creation_types_1.getNextStep)('kyverno-generation', this.config);
|
|
@@ -734,6 +733,7 @@ The policy intent has been stored in the database. The Kyverno policy was not ap
|
|
|
734
733
|
};
|
|
735
734
|
const prompt = (0, shared_prompt_loader_1.loadPrompt)('kyverno-generation', templateData);
|
|
736
735
|
// Call AI provider internally to generate Kyverno policy
|
|
736
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports -- Dynamic require to avoid circular dependency
|
|
737
737
|
const { createAIProvider } = require('./ai-provider-factory');
|
|
738
738
|
const aiProvider = createAIProvider();
|
|
739
739
|
const response = await aiProvider.sendMessage(prompt, 'policy-kyverno-generation', {
|
|
@@ -53,13 +53,13 @@ export interface UnifiedWorkflowStepResponse {
|
|
|
53
53
|
prompt?: string;
|
|
54
54
|
instruction: string;
|
|
55
55
|
nextStep?: WorkflowStep;
|
|
56
|
-
data?:
|
|
56
|
+
data?: unknown;
|
|
57
57
|
}
|
|
58
58
|
export interface UnifiedWorkflowCompletionResponse {
|
|
59
59
|
sessionId: string;
|
|
60
60
|
entityType: EntityType;
|
|
61
61
|
instruction: string;
|
|
62
|
-
data?:
|
|
62
|
+
data?: unknown;
|
|
63
63
|
}
|
|
64
64
|
export declare const WORKFLOW_CONFIGS: Record<EntityType, WorkflowConfig>;
|
|
65
65
|
export declare function requiresResources(config: WorkflowConfig): boolean;
|
|
@@ -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;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,YAAY,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,cAAc,CAAC,EAAE;QACf,IAAI,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC;QACpC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC;IAEF,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,0BAA0B,CAAC;CAClC;AAED,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,IAAI,CAAC,EAAE,
|
|
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;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,YAAY,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,cAAc,CAAC,EAAE;QACf,IAAI,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC;QACpC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC;IAEF,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,0BAA0B,CAAC;CAClC;AAED,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,iCAAiC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA4BD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,UAAU,EAAE,cAAc,CAW/D,CAAC;AAGF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAEjE;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,GAAG,YAAY,GAAG,IAAI,CAIlG;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,GAAG,YAAY,GAAG,IAAI,CAGtG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visualization.d.ts","sourceRoot":"","sources":["../../src/core/visualization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,KAAK,CAAC;QACpB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,iBAAiB,CAAC;QACxB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"visualization.d.ts","sourceRoot":"","sources":["../../src/core/visualization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,KAAK,CAAC;QACpB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,iBAAiB,CAAC;QACxB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC,CAAC;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,OAAO,GACP,WAAW,GACX,WAAW,GACX,SAAS,GACT,SAAS,GACT,cAAc,CAAC;AAEnB;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAUrF;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAIpE;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOxD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,qBAAqB,CAoD1G"}
|