@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
|
@@ -35,11 +35,11 @@ class DeployOperation {
|
|
|
35
35
|
manifestPath,
|
|
36
36
|
readinessTimeout: false,
|
|
37
37
|
message: 'Deployment completed successfully',
|
|
38
|
-
kubectlOutput
|
|
38
|
+
kubectlOutput,
|
|
39
39
|
};
|
|
40
40
|
}, {
|
|
41
41
|
operation: 'deploy',
|
|
42
|
-
component: 'deploy-operation'
|
|
42
|
+
component: 'deploy-operation',
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
@@ -100,7 +100,7 @@ class DeployOperation {
|
|
|
100
100
|
// Apply using kubectl_apply tool which accepts content via stdin
|
|
101
101
|
const applyResult = await this.applyManifestContent(manifestContent);
|
|
102
102
|
// Try to wait for deployments to be ready (ignore failures for other resource types)
|
|
103
|
-
let waitOutput
|
|
103
|
+
let waitOutput;
|
|
104
104
|
try {
|
|
105
105
|
const waitResult = await this.executeKubectl([
|
|
106
106
|
'wait',
|
|
@@ -108,7 +108,7 @@ class DeployOperation {
|
|
|
108
108
|
'deployments',
|
|
109
109
|
'--all',
|
|
110
110
|
`--timeout=${timeout}s`,
|
|
111
|
-
'--all-namespaces'
|
|
111
|
+
'--all-namespaces',
|
|
112
112
|
]);
|
|
113
113
|
waitOutput = `\n\nWait output:\n${waitResult}`;
|
|
114
114
|
}
|
|
@@ -116,7 +116,8 @@ class DeployOperation {
|
|
|
116
116
|
// If no deployments found or wait fails, that's OK for other resource types (Services, etc.)
|
|
117
117
|
const errorMsg = waitError instanceof Error ? waitError.message : String(waitError);
|
|
118
118
|
if (errorMsg.includes('no matching resources found')) {
|
|
119
|
-
waitOutput =
|
|
119
|
+
waitOutput =
|
|
120
|
+
'\n\nWait output: No deployments found to wait for (likely Services, CRs, etc.)';
|
|
120
121
|
}
|
|
121
122
|
else {
|
|
122
123
|
waitOutput = `\n\nWait output: Warning - ${errorMsg}`;
|
|
@@ -129,7 +130,9 @@ class DeployOperation {
|
|
|
129
130
|
* PRD #359: Uses unified plugin registry's kubectl_apply tool with stdin
|
|
130
131
|
*/
|
|
131
132
|
async applyManifestContent(manifest) {
|
|
132
|
-
const response = await (0, plugin_registry_1.invokePluginTool)('agentic-tools', 'kubectl_apply', {
|
|
133
|
+
const response = await (0, plugin_registry_1.invokePluginTool)('agentic-tools', 'kubectl_apply', {
|
|
134
|
+
manifest,
|
|
135
|
+
});
|
|
133
136
|
if (response.success) {
|
|
134
137
|
if (typeof response.result === 'object' && response.result !== null) {
|
|
135
138
|
const result = response.result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/core/discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/core/discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAID,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,OAAO,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjC,wBAAwB,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,CAAC,gBAAgB,EAAE,CAAC;IAkFzB,eAAe,CACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3B,OAAO,CAAC,MAAM,CAAC;IAsBlB;;;;OAIG;IACG,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA8CxD;;;;;;;;OAQG;IACG,iBAAiB,CACrB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,GACjB,OAAO,CACR,KAAK,CAAC;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CACH;IAwCK,kBAAkB,IAAI,OAAO,CAAC,kBAAkB,CAAC;YAoGzC,iBAAiB;YA4DjB,iBAAiB;YAwCjB,eAAe;YA8Cf,cAAc;IA0C5B,OAAO,CAAC,aAAa;IAWf,iBAAiB,CACrB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAiB7B,aAAa,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAiDlC,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS1D;;OAEG;YACW,uBAAuB;IA4DrC;;OAEG;YACW,8BAA8B;IAyB5C;;OAEG;YACW,8BAA8B;IAqE5C;;OAEG;IACH,OAAO,CAAC,wBAAwB;CAwBjC"}
|
package/dist/core/discovery.js
CHANGED
|
@@ -66,11 +66,11 @@ class KubernetesDiscovery {
|
|
|
66
66
|
return {
|
|
67
67
|
type: this.detectClusterType(),
|
|
68
68
|
version: 'v1.0.0', // Simplified for now
|
|
69
|
-
capabilities: await this.detectCapabilities()
|
|
69
|
+
capabilities: await this.detectCapabilities(),
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
catch (error) {
|
|
73
|
-
throw new Error(`Failed to get cluster info: ${error}
|
|
73
|
+
throw new Error(`Failed to get cluster info: ${error}`, { cause: error });
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
@@ -97,7 +97,14 @@ class KubernetesDiscovery {
|
|
|
97
97
|
capabilities.push('api-server');
|
|
98
98
|
// Check for scheduler by looking at system pods
|
|
99
99
|
try {
|
|
100
|
-
const systemPods = await this.executeKubectl([
|
|
100
|
+
const systemPods = await this.executeKubectl([
|
|
101
|
+
'get',
|
|
102
|
+
'pods',
|
|
103
|
+
'-n',
|
|
104
|
+
'kube-system',
|
|
105
|
+
'-o',
|
|
106
|
+
'json',
|
|
107
|
+
]);
|
|
101
108
|
const pods = JSON.parse(systemPods);
|
|
102
109
|
if (pods.items.some((pod) => pod.metadata.name.includes('scheduler'))) {
|
|
103
110
|
capabilities.push('scheduler');
|
|
@@ -158,7 +165,7 @@ class KubernetesDiscovery {
|
|
|
158
165
|
}
|
|
159
166
|
return {
|
|
160
167
|
resources: allResources, // Return all resources with full metadata
|
|
161
|
-
custom: customCRDs
|
|
168
|
+
custom: customCRDs,
|
|
162
169
|
};
|
|
163
170
|
}
|
|
164
171
|
catch (error) {
|
|
@@ -203,8 +210,10 @@ class KubernetesDiscovery {
|
|
|
203
210
|
* Parse a raw CRD object into EnhancedCRD format
|
|
204
211
|
*/
|
|
205
212
|
parseCRDItem(item) {
|
|
206
|
-
const versions = item.spec.versions || [
|
|
207
|
-
|
|
213
|
+
const versions = item.spec.versions || [
|
|
214
|
+
{ name: item.spec.version || '', served: true, storage: true },
|
|
215
|
+
];
|
|
216
|
+
const storageVersion = versions.find(v => v.storage)?.name || versions[0]?.name;
|
|
208
217
|
return {
|
|
209
218
|
name: item.metadata.name,
|
|
210
219
|
group: item.spec.group,
|
|
@@ -212,20 +221,20 @@ class KubernetesDiscovery {
|
|
|
212
221
|
kind: item.spec.names.kind,
|
|
213
222
|
scope: item.spec.scope,
|
|
214
223
|
resourcePlural: item.spec.names.plural,
|
|
215
|
-
versions: versions.map(
|
|
224
|
+
versions: versions.map(v => ({
|
|
216
225
|
name: v.name,
|
|
217
226
|
served: v.served,
|
|
218
227
|
storage: v.storage,
|
|
219
228
|
schema: undefined,
|
|
220
|
-
additionalPrinterColumns: v.additionalPrinterColumns?.map(
|
|
229
|
+
additionalPrinterColumns: v.additionalPrinterColumns?.map(col => ({
|
|
221
230
|
name: col.name,
|
|
222
231
|
type: col.type || 'string',
|
|
223
232
|
jsonPath: col.jsonPath,
|
|
224
233
|
description: col.description,
|
|
225
|
-
priority: col.priority
|
|
226
|
-
}))
|
|
234
|
+
priority: col.priority,
|
|
235
|
+
})),
|
|
227
236
|
})),
|
|
228
|
-
schema: {}
|
|
237
|
+
schema: {},
|
|
229
238
|
};
|
|
230
239
|
}
|
|
231
240
|
/**
|
|
@@ -236,7 +245,13 @@ class KubernetesDiscovery {
|
|
|
236
245
|
if (!(0, plugin_registry_1.isPluginInitialized)()) {
|
|
237
246
|
throw new Error('Not connected to cluster');
|
|
238
247
|
}
|
|
239
|
-
const output = await this.executeKubectl([
|
|
248
|
+
const output = await this.executeKubectl([
|
|
249
|
+
'get',
|
|
250
|
+
'crd',
|
|
251
|
+
crdName,
|
|
252
|
+
'-o',
|
|
253
|
+
'json',
|
|
254
|
+
]);
|
|
240
255
|
const item = JSON.parse(output);
|
|
241
256
|
return this.parseCRDItem(item);
|
|
242
257
|
}
|
|
@@ -256,7 +271,9 @@ class KubernetesDiscovery {
|
|
|
256
271
|
catch (error) {
|
|
257
272
|
// Graceful degradation: For authorization errors, return empty array
|
|
258
273
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
259
|
-
if (errorMsg.includes('forbidden') ||
|
|
274
|
+
if (errorMsg.includes('forbidden') ||
|
|
275
|
+
errorMsg.includes('Forbidden') ||
|
|
276
|
+
errorMsg.includes('unauthorized')) {
|
|
260
277
|
console.warn(`Warning: Cannot list CRDs - ${errorMsg}`);
|
|
261
278
|
return []; // Return empty array to allow core functionality to continue
|
|
262
279
|
}
|
|
@@ -314,9 +331,11 @@ class KubernetesDiscovery {
|
|
|
314
331
|
name,
|
|
315
332
|
namespaced: namespaced === 'true',
|
|
316
333
|
kind,
|
|
317
|
-
shortNames: shortNames && shortNames !== '<none>'
|
|
334
|
+
shortNames: shortNames && shortNames !== '<none>'
|
|
335
|
+
? shortNames.split(',')
|
|
336
|
+
: [],
|
|
318
337
|
apiVersion,
|
|
319
|
-
group
|
|
338
|
+
group,
|
|
320
339
|
};
|
|
321
340
|
})
|
|
322
341
|
.filter(resource => resource !== null);
|
|
@@ -344,7 +363,7 @@ class KubernetesDiscovery {
|
|
|
344
363
|
return output;
|
|
345
364
|
}
|
|
346
365
|
catch (error) {
|
|
347
|
-
throw new Error(`Failed to explain resource '${resource}': ${error instanceof Error ? error.message : 'Unknown error'}. Please check resource name and cluster connectivity
|
|
366
|
+
throw new Error(`Failed to explain resource '${resource}': ${error instanceof Error ? error.message : 'Unknown error'}. Please check resource name and cluster connectivity.`, { cause: error });
|
|
348
367
|
}
|
|
349
368
|
}
|
|
350
369
|
/**
|
|
@@ -357,7 +376,13 @@ class KubernetesDiscovery {
|
|
|
357
376
|
throw new Error('Not connected to cluster');
|
|
358
377
|
}
|
|
359
378
|
try {
|
|
360
|
-
const yamlOutput = await this.executeKubectl([
|
|
379
|
+
const yamlOutput = await this.executeKubectl([
|
|
380
|
+
'get',
|
|
381
|
+
'crd',
|
|
382
|
+
crdName,
|
|
383
|
+
'-o',
|
|
384
|
+
'yaml',
|
|
385
|
+
]);
|
|
361
386
|
// Parse YAML
|
|
362
387
|
const crdObject = yaml.parse(yamlOutput);
|
|
363
388
|
// Remove massive last-applied-configuration annotation
|
|
@@ -378,7 +403,7 @@ class KubernetesDiscovery {
|
|
|
378
403
|
return yaml.stringify(crdObject);
|
|
379
404
|
}
|
|
380
405
|
catch (error) {
|
|
381
|
-
throw new Error(`Failed to get CRD definition for '${crdName}': ${error instanceof Error ? error.message : 'Unknown error'}
|
|
406
|
+
throw new Error(`Failed to get CRD definition for '${crdName}': ${error instanceof Error ? error.message : 'Unknown error'}`, { cause: error });
|
|
382
407
|
}
|
|
383
408
|
}
|
|
384
409
|
/**
|
|
@@ -396,7 +421,7 @@ class KubernetesDiscovery {
|
|
|
396
421
|
}
|
|
397
422
|
const response = await (0, plugin_registry_1.invokePluginTool)('agentic-tools', 'kubectl_get_printer_columns', {
|
|
398
423
|
resourcePlural,
|
|
399
|
-
apiVersion
|
|
424
|
+
apiVersion,
|
|
400
425
|
});
|
|
401
426
|
if (response.success) {
|
|
402
427
|
if (typeof response.result === 'object' && response.result !== null) {
|
|
@@ -427,13 +452,22 @@ class KubernetesDiscovery {
|
|
|
427
452
|
}
|
|
428
453
|
try {
|
|
429
454
|
// Get cluster version
|
|
430
|
-
const versionOutput = await this.executeKubectl([
|
|
455
|
+
const versionOutput = await this.executeKubectl([
|
|
456
|
+
'version',
|
|
457
|
+
'-o',
|
|
458
|
+
'json',
|
|
459
|
+
]);
|
|
431
460
|
const versionInfo = JSON.parse(versionOutput);
|
|
432
461
|
const version = versionInfo.serverVersion?.gitVersion || 'unknown';
|
|
433
462
|
// Detect platform type
|
|
434
463
|
const platform = this.detectClusterType();
|
|
435
464
|
// Get node count
|
|
436
|
-
const nodesOutput = await this.executeKubectl([
|
|
465
|
+
const nodesOutput = await this.executeKubectl([
|
|
466
|
+
'get',
|
|
467
|
+
'nodes',
|
|
468
|
+
'-o',
|
|
469
|
+
'json',
|
|
470
|
+
]);
|
|
437
471
|
const nodes = JSON.parse(nodesOutput);
|
|
438
472
|
const nodeCount = nodes.items.length;
|
|
439
473
|
// Get namespace count
|
|
@@ -462,7 +496,7 @@ class KubernetesDiscovery {
|
|
|
462
496
|
features,
|
|
463
497
|
networking,
|
|
464
498
|
security,
|
|
465
|
-
storage
|
|
499
|
+
storage,
|
|
466
500
|
};
|
|
467
501
|
}
|
|
468
502
|
catch {
|
|
@@ -479,36 +513,60 @@ class KubernetesDiscovery {
|
|
|
479
513
|
services: 0,
|
|
480
514
|
pods: 0,
|
|
481
515
|
configMaps: 0,
|
|
482
|
-
secrets: 0
|
|
516
|
+
secrets: 0,
|
|
483
517
|
},
|
|
484
518
|
networking: {
|
|
485
519
|
cni: 'unknown',
|
|
486
520
|
serviceSubnet: 'unknown',
|
|
487
521
|
podSubnet: 'unknown',
|
|
488
|
-
dnsProvider: 'unknown'
|
|
522
|
+
dnsProvider: 'unknown',
|
|
489
523
|
},
|
|
490
524
|
security: {
|
|
491
525
|
rbacEnabled: false,
|
|
492
526
|
podSecurityPolicy: false,
|
|
493
527
|
networkPolicies: false,
|
|
494
|
-
admissionControllers: []
|
|
528
|
+
admissionControllers: [],
|
|
495
529
|
},
|
|
496
530
|
storage: {
|
|
497
531
|
storageClasses: [],
|
|
498
532
|
persistentVolumes: 0,
|
|
499
|
-
csiDrivers: []
|
|
500
|
-
}
|
|
533
|
+
csiDrivers: [],
|
|
534
|
+
},
|
|
501
535
|
};
|
|
502
536
|
}
|
|
503
537
|
}
|
|
504
538
|
async getResourceCounts() {
|
|
505
539
|
try {
|
|
506
540
|
const promises = [
|
|
507
|
-
this.executeKubectl([
|
|
508
|
-
|
|
541
|
+
this.executeKubectl([
|
|
542
|
+
'get',
|
|
543
|
+
'deployments',
|
|
544
|
+
'--all-namespaces',
|
|
545
|
+
'-o',
|
|
546
|
+
'json',
|
|
547
|
+
]),
|
|
548
|
+
this.executeKubectl([
|
|
549
|
+
'get',
|
|
550
|
+
'services',
|
|
551
|
+
'--all-namespaces',
|
|
552
|
+
'-o',
|
|
553
|
+
'json',
|
|
554
|
+
]),
|
|
509
555
|
this.executeKubectl(['get', 'pods', '--all-namespaces', '-o', 'json']),
|
|
510
|
-
this.executeKubectl([
|
|
511
|
-
|
|
556
|
+
this.executeKubectl([
|
|
557
|
+
'get',
|
|
558
|
+
'configmaps',
|
|
559
|
+
'--all-namespaces',
|
|
560
|
+
'-o',
|
|
561
|
+
'json',
|
|
562
|
+
]),
|
|
563
|
+
this.executeKubectl([
|
|
564
|
+
'get',
|
|
565
|
+
'secrets',
|
|
566
|
+
'--all-namespaces',
|
|
567
|
+
'-o',
|
|
568
|
+
'json',
|
|
569
|
+
]),
|
|
512
570
|
];
|
|
513
571
|
const results = await Promise.all(promises);
|
|
514
572
|
return {
|
|
@@ -516,25 +574,40 @@ class KubernetesDiscovery {
|
|
|
516
574
|
services: JSON.parse(results[1]).items.length,
|
|
517
575
|
pods: JSON.parse(results[2]).items.length,
|
|
518
576
|
configMaps: JSON.parse(results[3]).items.length,
|
|
519
|
-
secrets: JSON.parse(results[4]).items.length
|
|
577
|
+
secrets: JSON.parse(results[4]).items.length,
|
|
520
578
|
};
|
|
521
579
|
}
|
|
522
580
|
catch {
|
|
523
|
-
return {
|
|
581
|
+
return {
|
|
582
|
+
deployments: 0,
|
|
583
|
+
services: 0,
|
|
584
|
+
pods: 0,
|
|
585
|
+
configMaps: 0,
|
|
586
|
+
secrets: 0,
|
|
587
|
+
};
|
|
524
588
|
}
|
|
525
589
|
}
|
|
526
590
|
async getNetworkingInfo() {
|
|
527
591
|
try {
|
|
528
592
|
// Get cluster info
|
|
529
|
-
const clusterInfoOutput = await this.executeKubectl([
|
|
593
|
+
const clusterInfoOutput = await this.executeKubectl([
|
|
594
|
+
'cluster-info',
|
|
595
|
+
'dump',
|
|
596
|
+
]);
|
|
530
597
|
// Extract networking information from cluster info
|
|
531
598
|
return {
|
|
532
|
-
cni: clusterInfoOutput.includes('calico')
|
|
533
|
-
|
|
534
|
-
|
|
599
|
+
cni: clusterInfoOutput.includes('calico')
|
|
600
|
+
? 'calico'
|
|
601
|
+
: clusterInfoOutput.includes('flannel')
|
|
602
|
+
? 'flannel'
|
|
603
|
+
: clusterInfoOutput.includes('weave')
|
|
604
|
+
? 'weave'
|
|
605
|
+
: 'unknown',
|
|
535
606
|
serviceSubnet: this.extractSubnet(clusterInfoOutput, 'service') || '10.96.0.0/12',
|
|
536
607
|
podSubnet: this.extractSubnet(clusterInfoOutput, 'pod') || '10.244.0.0/16',
|
|
537
|
-
dnsProvider: clusterInfoOutput.includes('coredns')
|
|
608
|
+
dnsProvider: clusterInfoOutput.includes('coredns')
|
|
609
|
+
? 'coredns'
|
|
610
|
+
: 'kube-dns',
|
|
538
611
|
};
|
|
539
612
|
}
|
|
540
613
|
catch {
|
|
@@ -542,26 +615,35 @@ class KubernetesDiscovery {
|
|
|
542
615
|
cni: 'unknown',
|
|
543
616
|
serviceSubnet: '10.96.0.0/12',
|
|
544
617
|
podSubnet: '10.244.0.0/16',
|
|
545
|
-
dnsProvider: 'coredns'
|
|
618
|
+
dnsProvider: 'coredns',
|
|
546
619
|
};
|
|
547
620
|
}
|
|
548
621
|
}
|
|
549
622
|
async getSecurityInfo() {
|
|
550
623
|
try {
|
|
551
624
|
// Check RBAC
|
|
552
|
-
const rbacOutput = await this.executeKubectl([
|
|
625
|
+
const rbacOutput = await this.executeKubectl([
|
|
626
|
+
'auth',
|
|
627
|
+
'can-i',
|
|
628
|
+
'get',
|
|
629
|
+
'clusterroles',
|
|
630
|
+
]);
|
|
553
631
|
const rbacEnabled = rbacOutput.includes('yes');
|
|
554
632
|
// Check for PSP
|
|
555
633
|
const pspOutput = await this.executeKubectl(['get', 'psp']).catch(() => '');
|
|
556
634
|
const podSecurityPolicy = pspOutput.includes('NAME');
|
|
557
635
|
// Check for Network Policies
|
|
558
|
-
const npOutput = await this.executeKubectl([
|
|
636
|
+
const npOutput = await this.executeKubectl([
|
|
637
|
+
'get',
|
|
638
|
+
'networkpolicies',
|
|
639
|
+
'--all-namespaces',
|
|
640
|
+
]).catch(() => '');
|
|
559
641
|
const networkPolicies = npOutput.includes('NAME');
|
|
560
642
|
return {
|
|
561
643
|
rbacEnabled,
|
|
562
644
|
podSecurityPolicy,
|
|
563
645
|
networkPolicies,
|
|
564
|
-
admissionControllers: ['api-server', 'scheduler', 'controller-manager'] // Basic controllers
|
|
646
|
+
admissionControllers: ['api-server', 'scheduler', 'controller-manager'], // Basic controllers
|
|
565
647
|
};
|
|
566
648
|
}
|
|
567
649
|
catch {
|
|
@@ -569,29 +651,39 @@ class KubernetesDiscovery {
|
|
|
569
651
|
rbacEnabled: false,
|
|
570
652
|
podSecurityPolicy: false,
|
|
571
653
|
networkPolicies: false,
|
|
572
|
-
admissionControllers: []
|
|
654
|
+
admissionControllers: [],
|
|
573
655
|
};
|
|
574
656
|
}
|
|
575
657
|
}
|
|
576
658
|
async getStorageInfo() {
|
|
577
659
|
try {
|
|
578
|
-
const scOutput = await this.executeKubectl([
|
|
660
|
+
const scOutput = await this.executeKubectl([
|
|
661
|
+
'get',
|
|
662
|
+
'storageclass',
|
|
663
|
+
'-o',
|
|
664
|
+
'json',
|
|
665
|
+
]);
|
|
579
666
|
const pvOutput = await this.executeKubectl(['get', 'pv', '-o', 'json']);
|
|
580
|
-
const csiOutput = await this.executeKubectl([
|
|
667
|
+
const csiOutput = await this.executeKubectl([
|
|
668
|
+
'get',
|
|
669
|
+
'csidriver',
|
|
670
|
+
'-o',
|
|
671
|
+
'json',
|
|
672
|
+
]).catch(() => '{"items":[]}');
|
|
581
673
|
const storageClasses = JSON.parse(scOutput).items.map((sc) => sc.metadata.name);
|
|
582
674
|
const persistentVolumes = JSON.parse(pvOutput).items.length;
|
|
583
675
|
const csiDrivers = JSON.parse(csiOutput).items.map((driver) => driver.metadata.name);
|
|
584
676
|
return {
|
|
585
677
|
storageClasses,
|
|
586
678
|
persistentVolumes,
|
|
587
|
-
csiDrivers
|
|
679
|
+
csiDrivers,
|
|
588
680
|
};
|
|
589
681
|
}
|
|
590
682
|
catch {
|
|
591
683
|
return {
|
|
592
684
|
storageClasses: [],
|
|
593
685
|
persistentVolumes: 0,
|
|
594
|
-
csiDrivers: []
|
|
686
|
+
csiDrivers: [],
|
|
595
687
|
};
|
|
596
688
|
}
|
|
597
689
|
}
|
|
@@ -599,7 +691,7 @@ class KubernetesDiscovery {
|
|
|
599
691
|
// Simple regex to extract subnet information from cluster info
|
|
600
692
|
const patterns = {
|
|
601
693
|
service: /service-cluster-ip-range[=\s]+([0-9./]+)/i,
|
|
602
|
-
pod: /cluster-cidr[=\s]+([0-9./]+)/i
|
|
694
|
+
pod: /cluster-cidr[=\s]+([0-9./]+)/i,
|
|
603
695
|
};
|
|
604
696
|
const match = text.match(patterns[type]);
|
|
605
697
|
return match ? match[1] : null;
|
|
@@ -614,9 +706,9 @@ class KubernetesDiscovery {
|
|
|
614
706
|
apiVersion: { type: 'string' },
|
|
615
707
|
kind: { type: 'string' },
|
|
616
708
|
metadata: { type: 'object' },
|
|
617
|
-
spec: { type: 'object' }
|
|
709
|
+
spec: { type: 'object' },
|
|
618
710
|
},
|
|
619
|
-
required: ['apiVersion', 'kind', 'metadata']
|
|
711
|
+
required: ['apiVersion', 'kind', 'metadata'],
|
|
620
712
|
};
|
|
621
713
|
}
|
|
622
714
|
async getNamespaces() {
|
|
@@ -626,7 +718,7 @@ class KubernetesDiscovery {
|
|
|
626
718
|
try {
|
|
627
719
|
// PRD #359: Use unified plugin registry for kubectl operations
|
|
628
720
|
const response = await (0, plugin_registry_1.invokePluginTool)('agentic-tools', 'kubectl_exec_command', {
|
|
629
|
-
args: ['get', 'namespaces', '-o', 'json']
|
|
721
|
+
args: ['get', 'namespaces', '-o', 'json'],
|
|
630
722
|
});
|
|
631
723
|
if (!response.success) {
|
|
632
724
|
throw new Error(response.error?.message || 'Failed to get namespaces via plugin');
|
|
@@ -642,12 +734,14 @@ class KubernetesDiscovery {
|
|
|
642
734
|
const resultData = response.result?.data || response.result;
|
|
643
735
|
const data = typeof resultData === 'string' ? JSON.parse(resultData) : resultData;
|
|
644
736
|
if (data?.items) {
|
|
645
|
-
return data.items
|
|
737
|
+
return data.items
|
|
738
|
+
.map((ns) => ns.metadata?.name || '')
|
|
739
|
+
.filter(Boolean);
|
|
646
740
|
}
|
|
647
741
|
return [];
|
|
648
742
|
}
|
|
649
743
|
catch (error) {
|
|
650
|
-
throw new Error(`Failed to get namespaces: ${error}
|
|
744
|
+
throw new Error(`Failed to get namespaces: ${error}`, { cause: error });
|
|
651
745
|
}
|
|
652
746
|
}
|
|
653
747
|
async namespaceExists(namespace) {
|
|
@@ -719,7 +813,12 @@ class KubernetesDiscovery {
|
|
|
719
813
|
if (!kind)
|
|
720
814
|
return [];
|
|
721
815
|
// Get all compositions and find ones that match this CRD
|
|
722
|
-
const output = await this.executeKubectl([
|
|
816
|
+
const output = await this.executeKubectl([
|
|
817
|
+
'get',
|
|
818
|
+
'compositions',
|
|
819
|
+
'-o',
|
|
820
|
+
'json',
|
|
821
|
+
]);
|
|
723
822
|
const compositionList = JSON.parse(output);
|
|
724
823
|
return compositionList.items.filter((comp) => {
|
|
725
824
|
const claimNames = comp.spec?.compositeTypeRef?.kind;
|
|
@@ -769,7 +868,8 @@ class KubernetesDiscovery {
|
|
|
769
868
|
if (source.includes('repo.github')) {
|
|
770
869
|
capabilities.push('GitHub Repository Management');
|
|
771
870
|
}
|
|
772
|
-
if (source.includes('ci.yaml') ||
|
|
871
|
+
if (source.includes('ci.yaml') ||
|
|
872
|
+
source.includes('github.com/workflows')) {
|
|
773
873
|
capabilities.push('CI/CD Pipeline Setup');
|
|
774
874
|
}
|
|
775
875
|
if (source.includes('image') && source.includes('tag')) {
|
|
@@ -802,7 +902,8 @@ class KubernetesDiscovery {
|
|
|
802
902
|
if (capabilities.some(cap => cap.includes('Application Deployment')) &&
|
|
803
903
|
capabilities.some(cap => cap.includes('Auto-scaling')) &&
|
|
804
904
|
capabilities.some(cap => cap.includes('CI/CD'))) {
|
|
805
|
-
description +=
|
|
905
|
+
description +=
|
|
906
|
+
'\n\nThis is a comprehensive application platform that handles deployment, scaling, and CI/CD automation.';
|
|
806
907
|
}
|
|
807
908
|
}
|
|
808
909
|
return description;
|
|
@@ -9,7 +9,7 @@ import { CircuitBreakerStats } from './circuit-breaker';
|
|
|
9
9
|
* Supported embedding providers - single source of truth
|
|
10
10
|
*/
|
|
11
11
|
export declare const EMBEDDING_PROVIDERS: readonly ["openai", "google", "amazon_bedrock"];
|
|
12
|
-
export type EmbeddingProviderType = typeof EMBEDDING_PROVIDERS[number];
|
|
12
|
+
export type EmbeddingProviderType = (typeof EMBEDDING_PROVIDERS)[number];
|
|
13
13
|
export interface EmbeddingConfig {
|
|
14
14
|
provider?: EmbeddingProviderType;
|
|
15
15
|
apiKey?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embedding-service.d.ts","sourceRoot":"","sources":["../../src/core/embedding-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,
|
|
1
|
+
{"version":3,"file":"embedding-service.d.ts","sourceRoot":"","sources":["../../src/core/embedding-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAEL,mBAAmB,EAEpB,MAAM,mBAAmB,CAAC;AAc3B;;GAEG;AACH,eAAO,MAAM,mBAAmB,iDAItB,CAAC;AACX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACnD,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACzD,WAAW,IAAI,OAAO,CAAC;IACvB,aAAa,IAAI,MAAM,CAAC;IACxB,QAAQ,IAAI,MAAM,CAAC;CACpB;AAgBD;;;GAGG;AACH,qBAAa,uBAAwB,Y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