@vfarcic/dot-ai 0.151.0 → 0.153.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/core/artifacthub.d.ts +85 -0
- package/dist/core/artifacthub.d.ts.map +1 -0
- package/dist/core/artifacthub.js +106 -0
- package/dist/core/helm-types.d.ts +39 -0
- package/dist/core/helm-types.d.ts.map +1 -0
- package/dist/core/helm-types.js +5 -0
- package/dist/core/helm-utils.d.ts +66 -0
- package/dist/core/helm-utils.d.ts.map +1 -0
- package/dist/core/helm-utils.js +196 -0
- package/dist/core/index.d.ts +7 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +12 -0
- package/dist/core/schema.d.ts +32 -4
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +200 -18
- package/dist/core/solution-cr.d.ts.map +1 -1
- package/dist/core/solution-cr.js +2 -3
- package/dist/tools/answer-question.d.ts.map +1 -1
- package/dist/tools/answer-question.js +85 -16
- package/dist/tools/choose-solution.d.ts.map +1 -1
- package/dist/tools/choose-solution.js +36 -24
- package/dist/tools/deploy-manifests.d.ts +2 -1
- package/dist/tools/deploy-manifests.d.ts.map +1 -1
- package/dist/tools/deploy-manifests.js +86 -2
- package/dist/tools/generate-manifests.d.ts +1 -0
- package/dist/tools/generate-manifests.d.ts.map +1 -1
- package/dist/tools/generate-manifests.js +204 -1
- package/dist/tools/recommend.d.ts +3 -2
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +116 -3
- package/package.json +1 -1
- package/prompts/helm-chart-selection.md +65 -0
- package/prompts/helm-generation.md +85 -0
- package/prompts/intent-analysis.md +17 -0
- package/prompts/question-generation.md +34 -24
- package/prompts/resource-selection.md +52 -8
- package/shared-prompts/prd-start.md +20 -10
- /package/prompts/{manifest-generation.md → capabilities-generation.md} +0 -0
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ DevOps AI Toolkit democratizes platform engineering and cloud native operations
|
|
|
57
57
|
## Key Features
|
|
58
58
|
|
|
59
59
|
### 🔍 Resource Provisioning Intelligence
|
|
60
|
-
Automatically discovers cluster resources using semantic capability management. AI understands what each resource actually does, providing intelligent recommendations for provisioning resources across clouds using Kubernetes as a control plane.
|
|
60
|
+
Automatically discovers cluster resources using semantic capability management. AI understands what each resource actually does, providing intelligent recommendations for provisioning resources across clouds using Kubernetes as a control plane. When no matching capability exists, automatically discovers and installs third-party tools (Prometheus, Argo CD, Crossplane, etc.) via Helm charts from ArtifactHub.
|
|
61
61
|
📖 [Deployment Guide](./docs/mcp-recommendation-guide.md) | [Capability Management](./docs/mcp-capability-management-guide.md)
|
|
62
62
|
|
|
63
63
|
### 🛠️ Issue Remediation
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ArtifactHub API Client
|
|
3
|
+
*
|
|
4
|
+
* Handles searching and retrieving Helm chart information from ArtifactHub
|
|
5
|
+
* API Documentation: https://artifacthub.io/docs/api/
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Raw search result from ArtifactHub API
|
|
9
|
+
*/
|
|
10
|
+
export interface ArtifactHubSearchResult {
|
|
11
|
+
package_id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
normalized_name: string;
|
|
14
|
+
logo_image_id?: string;
|
|
15
|
+
stars: number;
|
|
16
|
+
official: boolean;
|
|
17
|
+
verified_publisher: boolean;
|
|
18
|
+
repository: {
|
|
19
|
+
name: string;
|
|
20
|
+
url: string;
|
|
21
|
+
official: boolean;
|
|
22
|
+
verified_publisher: boolean;
|
|
23
|
+
};
|
|
24
|
+
version: string;
|
|
25
|
+
app_version?: string;
|
|
26
|
+
description: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Raw package details from ArtifactHub API
|
|
30
|
+
*/
|
|
31
|
+
export interface ArtifactHubPackageDetails {
|
|
32
|
+
package_id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
normalized_name: string;
|
|
35
|
+
version: string;
|
|
36
|
+
app_version?: string;
|
|
37
|
+
description: string;
|
|
38
|
+
readme?: string;
|
|
39
|
+
values_schema?: Record<string, any>;
|
|
40
|
+
default_values?: string;
|
|
41
|
+
repository: {
|
|
42
|
+
name: string;
|
|
43
|
+
url: string;
|
|
44
|
+
};
|
|
45
|
+
maintainers?: Array<{
|
|
46
|
+
name: string;
|
|
47
|
+
email?: string;
|
|
48
|
+
}>;
|
|
49
|
+
links?: Array<{
|
|
50
|
+
name: string;
|
|
51
|
+
url: string;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* ArtifactHub API client for Helm chart discovery
|
|
56
|
+
*/
|
|
57
|
+
export declare class ArtifactHubService {
|
|
58
|
+
private baseUrl;
|
|
59
|
+
private timeout;
|
|
60
|
+
private excludedRepos;
|
|
61
|
+
/**
|
|
62
|
+
* Search for Helm charts matching the query
|
|
63
|
+
*
|
|
64
|
+
* @param query - Search query (e.g., "argo cd", "prometheus")
|
|
65
|
+
* @param limit - Maximum number of results to return
|
|
66
|
+
* @returns Array of search results sorted by relevance (excludes Bitnami)
|
|
67
|
+
*/
|
|
68
|
+
searchCharts(query: string, limit?: number): Promise<ArtifactHubSearchResult[]>;
|
|
69
|
+
/**
|
|
70
|
+
* Get detailed information about a specific chart
|
|
71
|
+
*
|
|
72
|
+
* @param repoName - Repository name (e.g., "argo")
|
|
73
|
+
* @param chartName - Chart name (e.g., "argo-cd")
|
|
74
|
+
* @returns Detailed chart information including README and values schema
|
|
75
|
+
*/
|
|
76
|
+
getChartDetails(repoName: string, chartName: string): Promise<ArtifactHubPackageDetails>;
|
|
77
|
+
/**
|
|
78
|
+
* Format chart results for AI analysis prompt
|
|
79
|
+
*
|
|
80
|
+
* @param charts - Array of ArtifactHub search results
|
|
81
|
+
* @returns Formatted string for AI prompt
|
|
82
|
+
*/
|
|
83
|
+
formatChartsForAI(charts: ArtifactHubSearchResult[]): string;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=artifacthub.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacthub.d.ts","sourceRoot":"","sources":["../../src/core/artifacthub.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,OAAO,CAAC;QAClB,kBAAkB,EAAE,OAAO,CAAC;KAC7B,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9C;AAED;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,OAAO,CAAmC;IAClD,OAAO,CAAC,OAAO,CAAS;IAIxB,OAAO,CAAC,aAAa,CAAe;IAEpC;;;;;;OAMG;IACG,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAsCzF;;;;;;OAMG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IA8B9F;;;;;OAKG;IACH,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,EAAE,GAAG,MAAM;CAW7D"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ArtifactHub API Client
|
|
4
|
+
*
|
|
5
|
+
* Handles searching and retrieving Helm chart information from ArtifactHub
|
|
6
|
+
* API Documentation: https://artifacthub.io/docs/api/
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ArtifactHubService = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* ArtifactHub API client for Helm chart discovery
|
|
12
|
+
*/
|
|
13
|
+
class ArtifactHubService {
|
|
14
|
+
baseUrl = 'https://artifacthub.io/api/v1';
|
|
15
|
+
timeout = 10000; // 10 seconds
|
|
16
|
+
// Repositories to exclude from search results
|
|
17
|
+
// Bitnami charts often have non-standard configurations
|
|
18
|
+
excludedRepos = ['bitnami'];
|
|
19
|
+
/**
|
|
20
|
+
* Search for Helm charts matching the query
|
|
21
|
+
*
|
|
22
|
+
* @param query - Search query (e.g., "argo cd", "prometheus")
|
|
23
|
+
* @param limit - Maximum number of results to return
|
|
24
|
+
* @returns Array of search results sorted by relevance (excludes Bitnami)
|
|
25
|
+
*/
|
|
26
|
+
async searchCharts(query, limit = 10) {
|
|
27
|
+
const encodedQuery = encodeURIComponent(query);
|
|
28
|
+
// kind=0 filters for Helm charts only
|
|
29
|
+
const url = `${this.baseUrl}/packages/search?ts_query_web=${encodedQuery}&kind=0&limit=${limit}`;
|
|
30
|
+
try {
|
|
31
|
+
const controller = new AbortController();
|
|
32
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
33
|
+
const response = await fetch(url, {
|
|
34
|
+
method: 'GET',
|
|
35
|
+
headers: {
|
|
36
|
+
'Accept': 'application/json',
|
|
37
|
+
},
|
|
38
|
+
signal: controller.signal,
|
|
39
|
+
});
|
|
40
|
+
clearTimeout(timeoutId);
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
throw new Error(`ArtifactHub API error: ${response.status} ${response.statusText}`);
|
|
43
|
+
}
|
|
44
|
+
const data = await response.json();
|
|
45
|
+
// Filter out excluded repositories (e.g., Bitnami)
|
|
46
|
+
const packages = data.packages || [];
|
|
47
|
+
return packages.filter(pkg => !this.excludedRepos.includes(pkg.repository.name.toLowerCase()));
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
51
|
+
throw new Error(`ArtifactHub API timeout after ${this.timeout}ms`);
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`ArtifactHub search failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get detailed information about a specific chart
|
|
58
|
+
*
|
|
59
|
+
* @param repoName - Repository name (e.g., "argo")
|
|
60
|
+
* @param chartName - Chart name (e.g., "argo-cd")
|
|
61
|
+
* @returns Detailed chart information including README and values schema
|
|
62
|
+
*/
|
|
63
|
+
async getChartDetails(repoName, chartName) {
|
|
64
|
+
const url = `${this.baseUrl}/packages/helm/${repoName}/${chartName}`;
|
|
65
|
+
try {
|
|
66
|
+
const controller = new AbortController();
|
|
67
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
68
|
+
const response = await fetch(url, {
|
|
69
|
+
method: 'GET',
|
|
70
|
+
headers: {
|
|
71
|
+
'Accept': 'application/json',
|
|
72
|
+
},
|
|
73
|
+
signal: controller.signal,
|
|
74
|
+
});
|
|
75
|
+
clearTimeout(timeoutId);
|
|
76
|
+
if (!response.ok) {
|
|
77
|
+
throw new Error(`ArtifactHub API error: ${response.status} ${response.statusText}`);
|
|
78
|
+
}
|
|
79
|
+
return await response.json();
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
83
|
+
throw new Error(`ArtifactHub API timeout after ${this.timeout}ms`);
|
|
84
|
+
}
|
|
85
|
+
throw new Error(`ArtifactHub chart details failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Format chart results for AI analysis prompt
|
|
90
|
+
*
|
|
91
|
+
* @param charts - Array of ArtifactHub search results
|
|
92
|
+
* @returns Formatted string for AI prompt
|
|
93
|
+
*/
|
|
94
|
+
formatChartsForAI(charts) {
|
|
95
|
+
return charts.map((chart, index) => `
|
|
96
|
+
Chart ${index + 1}: ${chart.name}
|
|
97
|
+
Repository: ${chart.repository.name} (${chart.repository.url})
|
|
98
|
+
Version: ${chart.version}${chart.app_version ? ` (App: ${chart.app_version})` : ''}
|
|
99
|
+
Description: ${chart.description || 'No description'}
|
|
100
|
+
Official: ${chart.official || chart.repository.official ? 'Yes' : 'No'}
|
|
101
|
+
Verified Publisher: ${chart.verified_publisher || chart.repository.verified_publisher ? 'Yes' : 'No'}
|
|
102
|
+
Stars: ${chart.stars}
|
|
103
|
+
`).join('\n');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.ArtifactHubService = ArtifactHubService;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for Helm-based solutions and sessions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Helm chart information from ArtifactHub
|
|
6
|
+
*/
|
|
7
|
+
export interface HelmChartInfo {
|
|
8
|
+
repository: string;
|
|
9
|
+
repositoryName: string;
|
|
10
|
+
chartName: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
appVersion?: string;
|
|
13
|
+
official?: boolean;
|
|
14
|
+
verifiedPublisher?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Solution data for Helm-based installations
|
|
18
|
+
* Stored in sol-* sessions alongside capability-based solutions
|
|
19
|
+
*/
|
|
20
|
+
export interface HelmSolutionData {
|
|
21
|
+
intent: string;
|
|
22
|
+
type: 'helm';
|
|
23
|
+
chart: HelmChartInfo;
|
|
24
|
+
score: number;
|
|
25
|
+
description: string;
|
|
26
|
+
reasons: string[];
|
|
27
|
+
questions?: {
|
|
28
|
+
required?: any[];
|
|
29
|
+
basic?: any[];
|
|
30
|
+
advanced?: any[];
|
|
31
|
+
};
|
|
32
|
+
answers: Record<string, any>;
|
|
33
|
+
generatedValues?: Record<string, any>;
|
|
34
|
+
helmCommand?: string;
|
|
35
|
+
namespace?: string;
|
|
36
|
+
releaseName?: string;
|
|
37
|
+
timestamp: string;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=helm-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helm-types.d.ts","sourceRoot":"","sources":["../../src/core/helm-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE;QACV,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;QACd,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helm Utilities - Shared functions for Helm chart operations
|
|
3
|
+
*/
|
|
4
|
+
import { HelmChartInfo } from './helm-types';
|
|
5
|
+
/**
|
|
6
|
+
* Sanitize input for safe shell command usage.
|
|
7
|
+
* Validates that input contains only safe characters to prevent command injection.
|
|
8
|
+
* @throws Error if input contains potentially dangerous characters
|
|
9
|
+
*/
|
|
10
|
+
export declare function sanitizeShellArg(arg: string, fieldName?: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Validate and sanitize HelmChartInfo for safe shell command usage
|
|
13
|
+
*/
|
|
14
|
+
export declare function sanitizeChartInfo(chart: HelmChartInfo): {
|
|
15
|
+
repositoryName: string;
|
|
16
|
+
repository: string;
|
|
17
|
+
chartName: string;
|
|
18
|
+
version?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Build the Helm command from chart info and deployment options
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildHelmCommand(chart: HelmChartInfo, releaseName: string, namespace: string, valuesPath?: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Ensure Helm repository is added and updated
|
|
26
|
+
*/
|
|
27
|
+
export declare function ensureHelmRepo(chart: HelmChartInfo): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Execute a Helm command with proper error handling
|
|
30
|
+
*/
|
|
31
|
+
export declare function executeHelmCommand(command: string, options?: {
|
|
32
|
+
timeout?: number;
|
|
33
|
+
maxBuffer?: number;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
stdout: string;
|
|
36
|
+
stderr: string;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Get the path for Helm values file
|
|
40
|
+
*/
|
|
41
|
+
export declare function getHelmValuesPath(solutionId: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Check if Helm values file exists for a solution
|
|
44
|
+
*/
|
|
45
|
+
export declare function helmValuesExist(solutionId: string): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Ensure tmp directory exists
|
|
48
|
+
*/
|
|
49
|
+
export declare function ensureTmpDir(): string;
|
|
50
|
+
/**
|
|
51
|
+
* Result of Helm command execution
|
|
52
|
+
*/
|
|
53
|
+
export interface HelmExecutionResult {
|
|
54
|
+
success: boolean;
|
|
55
|
+
output: string;
|
|
56
|
+
error?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Run Helm dry-run validation
|
|
60
|
+
*/
|
|
61
|
+
export declare function validateHelmDryRun(chart: HelmChartInfo, releaseName: string, namespace: string, valuesPath: string): Promise<HelmExecutionResult>;
|
|
62
|
+
/**
|
|
63
|
+
* Deploy a Helm chart
|
|
64
|
+
*/
|
|
65
|
+
export declare function deployHelmRelease(chart: HelmChartInfo, releaseName: string, namespace: string, valuesPath: string | undefined, timeout: number): Promise<HelmExecutionResult>;
|
|
66
|
+
//# sourceMappingURL=helm-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helm-utils.d.ts","sourceRoot":"","sources":["../../src/core/helm-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,GAAE,MAAmB,GAAG,MAAM,CAOpF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG;IACvD,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAOA;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CAwBR;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxE;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GACA,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAO7C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAMrC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAyB9B;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,mBAAmB,CAAC,CA6B9B"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Helm Utilities - Shared functions for Helm chart operations
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.sanitizeShellArg = sanitizeShellArg;
|
|
40
|
+
exports.sanitizeChartInfo = sanitizeChartInfo;
|
|
41
|
+
exports.buildHelmCommand = buildHelmCommand;
|
|
42
|
+
exports.ensureHelmRepo = ensureHelmRepo;
|
|
43
|
+
exports.executeHelmCommand = executeHelmCommand;
|
|
44
|
+
exports.getHelmValuesPath = getHelmValuesPath;
|
|
45
|
+
exports.helmValuesExist = helmValuesExist;
|
|
46
|
+
exports.ensureTmpDir = ensureTmpDir;
|
|
47
|
+
exports.validateHelmDryRun = validateHelmDryRun;
|
|
48
|
+
exports.deployHelmRelease = deployHelmRelease;
|
|
49
|
+
const path = __importStar(require("path"));
|
|
50
|
+
const fs = __importStar(require("fs"));
|
|
51
|
+
const platform_utils_1 = require("./platform-utils");
|
|
52
|
+
/**
|
|
53
|
+
* Sanitize input for safe shell command usage.
|
|
54
|
+
* Validates that input contains only safe characters to prevent command injection.
|
|
55
|
+
* @throws Error if input contains potentially dangerous characters
|
|
56
|
+
*/
|
|
57
|
+
function sanitizeShellArg(arg, fieldName = 'argument') {
|
|
58
|
+
// Allow alphanumeric, dash, underscore, dot, forward slash, colon (for URLs), and @ (for versions)
|
|
59
|
+
// This covers valid Helm chart names, repo names, URLs, and version strings
|
|
60
|
+
if (!/^[a-zA-Z0-9\-_./:\\@]+$/.test(arg)) {
|
|
61
|
+
throw new Error(`Invalid characters in ${fieldName}: "${arg}". Only alphanumeric characters, dashes, underscores, dots, forward slashes, colons, and @ are allowed.`);
|
|
62
|
+
}
|
|
63
|
+
return arg;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Validate and sanitize HelmChartInfo for safe shell command usage
|
|
67
|
+
*/
|
|
68
|
+
function sanitizeChartInfo(chart) {
|
|
69
|
+
return {
|
|
70
|
+
repositoryName: sanitizeShellArg(chart.repositoryName, 'repository name'),
|
|
71
|
+
repository: sanitizeShellArg(chart.repository, 'repository URL'),
|
|
72
|
+
chartName: sanitizeShellArg(chart.chartName, 'chart name'),
|
|
73
|
+
version: chart.version ? sanitizeShellArg(chart.version, 'version') : undefined
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Build the Helm command from chart info and deployment options
|
|
78
|
+
*/
|
|
79
|
+
function buildHelmCommand(chart, releaseName, namespace, valuesPath) {
|
|
80
|
+
// Sanitize all inputs to prevent command injection
|
|
81
|
+
const safeChart = sanitizeChartInfo(chart);
|
|
82
|
+
const safeReleaseName = sanitizeShellArg(releaseName, 'release name');
|
|
83
|
+
const safeNamespace = sanitizeShellArg(namespace, 'namespace');
|
|
84
|
+
const parts = [
|
|
85
|
+
'helm upgrade --install',
|
|
86
|
+
safeReleaseName,
|
|
87
|
+
`${safeChart.repositoryName}/${safeChart.chartName}`,
|
|
88
|
+
`--namespace ${safeNamespace}`,
|
|
89
|
+
'--create-namespace'
|
|
90
|
+
];
|
|
91
|
+
if (safeChart.version) {
|
|
92
|
+
parts.push(`--version ${safeChart.version}`);
|
|
93
|
+
}
|
|
94
|
+
if (valuesPath) {
|
|
95
|
+
// Values path is internally generated, but sanitize anyway
|
|
96
|
+
parts.push(`-f ${sanitizeShellArg(valuesPath, 'values path')}`);
|
|
97
|
+
}
|
|
98
|
+
return parts.join(' ');
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Ensure Helm repository is added and updated
|
|
102
|
+
*/
|
|
103
|
+
async function ensureHelmRepo(chart) {
|
|
104
|
+
// Sanitize chart info to prevent command injection
|
|
105
|
+
const safeChart = sanitizeChartInfo(chart);
|
|
106
|
+
await (0, platform_utils_1.execAsync)(`helm repo add ${safeChart.repositoryName} ${safeChart.repository} 2>/dev/null || true`);
|
|
107
|
+
await (0, platform_utils_1.execAsync)('helm repo update 2>/dev/null || true');
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Execute a Helm command with proper error handling
|
|
111
|
+
*/
|
|
112
|
+
async function executeHelmCommand(command, options) {
|
|
113
|
+
const execOptions = {
|
|
114
|
+
maxBuffer: options?.maxBuffer || 10 * 1024 * 1024,
|
|
115
|
+
timeout: options?.timeout
|
|
116
|
+
};
|
|
117
|
+
return await (0, platform_utils_1.execAsync)(command, execOptions);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Get the path for Helm values file
|
|
121
|
+
*/
|
|
122
|
+
function getHelmValuesPath(solutionId) {
|
|
123
|
+
const tmpDir = path.join(process.cwd(), 'tmp');
|
|
124
|
+
return path.join(tmpDir, `${solutionId}-values.yaml`);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Check if Helm values file exists for a solution
|
|
128
|
+
*/
|
|
129
|
+
function helmValuesExist(solutionId) {
|
|
130
|
+
return fs.existsSync(getHelmValuesPath(solutionId));
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Ensure tmp directory exists
|
|
134
|
+
*/
|
|
135
|
+
function ensureTmpDir() {
|
|
136
|
+
const tmpDir = path.join(process.cwd(), 'tmp');
|
|
137
|
+
if (!fs.existsSync(tmpDir)) {
|
|
138
|
+
fs.mkdirSync(tmpDir, { recursive: true });
|
|
139
|
+
}
|
|
140
|
+
return tmpDir;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Run Helm dry-run validation
|
|
144
|
+
*/
|
|
145
|
+
async function validateHelmDryRun(chart, releaseName, namespace, valuesPath) {
|
|
146
|
+
try {
|
|
147
|
+
await ensureHelmRepo(chart);
|
|
148
|
+
const dryRunCommand = buildHelmCommand(chart, releaseName, namespace, valuesPath) + ' --dry-run';
|
|
149
|
+
const { stdout, stderr } = await executeHelmCommand(dryRunCommand);
|
|
150
|
+
return {
|
|
151
|
+
success: true,
|
|
152
|
+
output: stdout + (stderr ? `\n${stderr}` : '')
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
157
|
+
let cleanError = errorMessage;
|
|
158
|
+
if (error instanceof Error && 'stderr' in error) {
|
|
159
|
+
cleanError = error.stderr || errorMessage;
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
success: false,
|
|
163
|
+
output: '',
|
|
164
|
+
error: cleanError
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Deploy a Helm chart
|
|
170
|
+
*/
|
|
171
|
+
async function deployHelmRelease(chart, releaseName, namespace, valuesPath, timeout) {
|
|
172
|
+
try {
|
|
173
|
+
await ensureHelmRepo(chart);
|
|
174
|
+
const helmCommand = buildHelmCommand(chart, releaseName, namespace, valuesPath) +
|
|
175
|
+
` --timeout ${timeout}s --wait`;
|
|
176
|
+
const { stdout, stderr } = await executeHelmCommand(helmCommand, {
|
|
177
|
+
timeout: (timeout + 30) * 1000 // Add buffer for command overhead
|
|
178
|
+
});
|
|
179
|
+
return {
|
|
180
|
+
success: true,
|
|
181
|
+
output: stdout + (stderr ? `\n\nStderr:\n${stderr}` : '')
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
186
|
+
let cleanError = errorMessage;
|
|
187
|
+
if (error instanceof Error && 'stderr' in error) {
|
|
188
|
+
cleanError = error.stderr || errorMessage;
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
success: false,
|
|
192
|
+
output: '',
|
|
193
|
+
error: cleanError
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ import { KubernetesDiscovery } from './discovery';
|
|
|
7
7
|
import { MemorySystem } from './memory';
|
|
8
8
|
import { WorkflowEngine } from './workflow';
|
|
9
9
|
import { AIProvider } from './ai-provider.interface';
|
|
10
|
-
import { SchemaParser, ManifestValidator, ResourceRecommender } from './schema';
|
|
10
|
+
import { SchemaParser, ManifestValidator, ResourceRecommender, QuestionGroup } from './schema';
|
|
11
|
+
import { HelmChartInfo } from './helm-types';
|
|
11
12
|
export interface CoreConfig {
|
|
12
13
|
kubernetesConfig?: string;
|
|
13
14
|
}
|
|
@@ -24,6 +25,11 @@ export declare class DotAI {
|
|
|
24
25
|
ranker: ResourceRecommender | null;
|
|
25
26
|
parseResource: (resourceName: string) => Promise<any>;
|
|
26
27
|
rankResources: (intent: string) => Promise<any>;
|
|
28
|
+
generateQuestionsForHelmChart: (intent: string, chart: HelmChartInfo, description: string, interaction_id?: string) => Promise<QuestionGroup>;
|
|
29
|
+
fetchHelmChartContent: (chart: HelmChartInfo) => Promise<{
|
|
30
|
+
valuesYaml: string;
|
|
31
|
+
readme: string;
|
|
32
|
+
}>;
|
|
27
33
|
};
|
|
28
34
|
constructor(config?: CoreConfig);
|
|
29
35
|
initialize(): Promise<void>;
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,UAAU;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,WAAW,CAAkB;IAErC,SAAgB,SAAS,EAAE,mBAAmB,CAAC;IAC/C,SAAgB,MAAM,EAAE,YAAY,CAAC;IACrC,SAAgB,QAAQ,EAAE,cAAc,CAAC;IACzC,SAAgB,EAAE,EAAE,UAAU,CAAC;IAC/B,SAAgB,MAAM,EAAE;QACtB,MAAM,EAAE,YAAY,CAAC;QACrB,SAAS,EAAE,iBAAiB,CAAC;QAC7B,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;QACnC,aAAa,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;QACtD,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;QAChD,6BAA6B,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9I,qBAAqB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAClG,CAAC;gBAEU,MAAM,GAAE,UAAe;IA2E7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAc3B,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAa/C,aAAa,IAAI,OAAO;IAIxB,UAAU,IAAI,MAAM;CAGrB;AAGD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACpI,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE5G,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACvG,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACnH,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAGjI,eAAe,KAAK,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -69,6 +69,18 @@ class DotAI {
|
|
|
69
69
|
// Create discovery function with proper binding
|
|
70
70
|
const explainResourceFn = async (resource) => await this.discovery.explainResource(resource);
|
|
71
71
|
return await ranker.findBestSolutions(intent, explainResourceFn);
|
|
72
|
+
},
|
|
73
|
+
generateQuestionsForHelmChart: async (intent, chart, description, interaction_id) => {
|
|
74
|
+
if (!ranker) {
|
|
75
|
+
throw new Error('ResourceRanker not available. AI provider API key is required for question generation.');
|
|
76
|
+
}
|
|
77
|
+
return await ranker.generateQuestionsForHelmChart(intent, chart, description, interaction_id);
|
|
78
|
+
},
|
|
79
|
+
fetchHelmChartContent: async (chart) => {
|
|
80
|
+
if (!ranker) {
|
|
81
|
+
throw new Error('ResourceRanker not available for fetching Helm chart content.');
|
|
82
|
+
}
|
|
83
|
+
return await ranker.fetchHelmChartContent(chart);
|
|
72
84
|
}
|
|
73
85
|
};
|
|
74
86
|
}
|
package/dist/core/schema.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { ResourceExplanation } from './discovery';
|
|
8
8
|
import { AIProvider } from './ai-provider.interface';
|
|
9
|
+
import { HelmChartInfo } from './helm-types';
|
|
9
10
|
export interface FieldConstraints {
|
|
10
11
|
minimum?: number;
|
|
11
12
|
maximum?: number;
|
|
@@ -87,14 +88,26 @@ export interface ResourceSolution {
|
|
|
87
88
|
score: number;
|
|
88
89
|
description: string;
|
|
89
90
|
reasons: string[];
|
|
90
|
-
analysis: string;
|
|
91
91
|
questions: QuestionGroup;
|
|
92
92
|
appliedPatterns?: string[];
|
|
93
93
|
}
|
|
94
|
+
export interface HelmRecommendation {
|
|
95
|
+
reason: string;
|
|
96
|
+
suggestedTool: string;
|
|
97
|
+
searchQuery: string;
|
|
98
|
+
}
|
|
99
|
+
export interface SolutionResult {
|
|
100
|
+
solutions: ResourceSolution[];
|
|
101
|
+
helmRecommendation: HelmRecommendation | null;
|
|
102
|
+
}
|
|
103
|
+
export interface ClusterResourceInfo {
|
|
104
|
+
name: string;
|
|
105
|
+
isDefault: boolean;
|
|
106
|
+
}
|
|
94
107
|
export interface ClusterOptions {
|
|
95
108
|
namespaces: string[];
|
|
96
|
-
storageClasses:
|
|
97
|
-
ingressClasses:
|
|
109
|
+
storageClasses: ClusterResourceInfo[];
|
|
110
|
+
ingressClasses: ClusterResourceInfo[];
|
|
98
111
|
nodeLabels: string[];
|
|
99
112
|
serviceAccounts?: {
|
|
100
113
|
[namespace: string]: string[];
|
|
@@ -150,7 +163,7 @@ export declare class ResourceRecommender {
|
|
|
150
163
|
/**
|
|
151
164
|
* Find the best resource solution(s) for user intent using two-phase analysis
|
|
152
165
|
*/
|
|
153
|
-
findBestSolutions(intent: string, _explainResource: (resource: string) => Promise<any>, interaction_id?: string): Promise<
|
|
166
|
+
findBestSolutions(intent: string, _explainResource: (resource: string) => Promise<any>, interaction_id?: string): Promise<SolutionResult>;
|
|
154
167
|
/**
|
|
155
168
|
* Phase 2: AI assembles and ranks complete solutions (replaces separate selection + ranking)
|
|
156
169
|
*/
|
|
@@ -192,9 +205,24 @@ export declare class ResourceRecommender {
|
|
|
192
205
|
* Discover cluster options for dynamic question generation
|
|
193
206
|
*/
|
|
194
207
|
private discoverClusterOptions;
|
|
208
|
+
/**
|
|
209
|
+
* Format cluster options for inclusion in prompts
|
|
210
|
+
*/
|
|
211
|
+
private formatClusterOptionsText;
|
|
195
212
|
/**
|
|
196
213
|
* Generate contextual questions using AI based on user intent and solution resources
|
|
197
214
|
*/
|
|
198
215
|
private generateQuestionsWithAI;
|
|
216
|
+
/**
|
|
217
|
+
* Generate contextual questions for Helm chart installation
|
|
218
|
+
*/
|
|
219
|
+
generateQuestionsForHelmChart(intent: string, chart: HelmChartInfo, description: string, interaction_id?: string): Promise<QuestionGroup>;
|
|
220
|
+
/**
|
|
221
|
+
* Fetch Helm chart values.yaml and README
|
|
222
|
+
*/
|
|
223
|
+
fetchHelmChartContent(chart: HelmChartInfo): Promise<{
|
|
224
|
+
valuesYaml: string;
|
|
225
|
+
readme: string;
|
|
226
|
+
}>;
|
|
199
227
|
}
|
|
200
228
|
//# sourceMappingURL=schema.d.ts.map
|