@vfarcic/dot-ai 0.115.0 → 0.117.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 +21 -18
- package/dist/core/ai-provider-factory.d.ts +4 -2
- package/dist/core/ai-provider-factory.d.ts.map +1 -1
- package/dist/core/ai-provider-factory.js +17 -6
- package/dist/core/capability-operations.js +1 -1
- package/dist/core/generic-session-manager.d.ts +67 -0
- package/dist/core/generic-session-manager.d.ts.map +1 -0
- package/dist/core/generic-session-manager.js +192 -0
- package/dist/core/pattern-operations.js +1 -1
- package/dist/core/providers/noop-provider.d.ts +47 -0
- package/dist/core/providers/noop-provider.d.ts.map +1 -0
- package/dist/core/providers/noop-provider.js +63 -0
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +13 -13
- package/dist/core/session-utils.d.ts +3 -6
- package/dist/core/session-utils.d.ts.map +1 -1
- package/dist/core/session-utils.js +5 -13
- package/dist/core/shared-prompt-loader.d.ts +15 -3
- package/dist/core/shared-prompt-loader.d.ts.map +1 -1
- package/dist/core/shared-prompt-loader.js +67 -14
- package/dist/core/unified-creation-session.d.ts +3 -10
- package/dist/core/unified-creation-session.d.ts.map +1 -1
- package/dist/core/unified-creation-session.js +34 -75
- package/dist/core/unified-creation-types.d.ts +31 -22
- package/dist/core/unified-creation-types.d.ts.map +1 -1
- package/dist/evaluation/eval-runner.js +12 -3
- package/dist/evaluation/evaluators/base-comparative.d.ts +2 -0
- package/dist/evaluation/evaluators/base-comparative.d.ts.map +1 -1
- package/dist/evaluation/evaluators/base-comparative.js +13 -1
- package/dist/evaluation/graph-generator.d.ts +56 -0
- package/dist/evaluation/graph-generator.d.ts.map +1 -0
- package/dist/evaluation/graph-generator.js +694 -0
- package/dist/evaluation/metadata-loader.d.ts +39 -0
- package/dist/evaluation/metadata-loader.d.ts.map +1 -0
- package/dist/evaluation/metadata-loader.js +74 -0
- package/dist/evaluation/platform-synthesizer.d.ts +5 -1
- package/dist/evaluation/platform-synthesizer.d.ts.map +1 -1
- package/dist/evaluation/platform-synthesizer.js +65 -23
- package/dist/evaluation/run-platform-synthesis.js +22 -5
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +9 -34
- package/dist/tools/answer-question.d.ts.map +1 -1
- package/dist/tools/answer-question.js +12 -12
- package/dist/tools/choose-solution.js +1 -1
- package/dist/tools/generate-manifests.d.ts.map +1 -1
- package/dist/tools/generate-manifests.js +9 -10
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -6
- package/dist/tools/organizational-data.js +12 -12
- package/dist/tools/project-setup/discovery.d.ts +15 -0
- package/dist/tools/project-setup/discovery.d.ts.map +1 -0
- package/dist/tools/project-setup/discovery.js +104 -0
- package/dist/tools/project-setup/generate-scope.d.ts +15 -0
- package/dist/tools/project-setup/generate-scope.d.ts.map +1 -0
- package/dist/tools/project-setup/generate-scope.js +237 -0
- package/dist/tools/project-setup/report-scan.d.ts +15 -0
- package/dist/tools/project-setup/report-scan.d.ts.map +1 -0
- package/dist/tools/project-setup/report-scan.js +156 -0
- package/dist/tools/project-setup/types.d.ts +111 -0
- package/dist/tools/project-setup/types.d.ts.map +1 -0
- package/dist/tools/project-setup/types.js +8 -0
- package/dist/tools/project-setup.d.ts +28 -0
- package/dist/tools/project-setup.d.ts.map +1 -0
- package/dist/tools/project-setup.js +134 -0
- package/dist/tools/recommend.js +1 -1
- package/dist/tools/remediate.js +1 -1
- package/dist/tools/version.d.ts +0 -7
- package/dist/tools/version.d.ts.map +1 -1
- package/dist/tools/version.js +5 -34
- package/package.json +4 -2
- package/prompts/capability-inference.md +2 -2
- package/prompts/infrastructure-trigger-expansion.md +2 -2
- package/prompts/intent-analysis.md +2 -2
- package/prompts/kyverno-generation.md +14 -14
- package/prompts/manifest-generation.md +5 -5
- package/prompts/map-intent-to-operation.md +2 -2
- package/prompts/pattern-complete-error.md +1 -1
- package/prompts/pattern-complete-success.md +4 -4
- package/prompts/pattern-rationale.md +1 -1
- package/prompts/pattern-resources.md +1 -1
- package/prompts/pattern-review.md +5 -5
- package/prompts/policy-complete-apply.md +4 -4
- package/prompts/policy-complete-discard.md +1 -1
- package/prompts/policy-complete-error.md +1 -1
- package/prompts/policy-complete-save.md +4 -4
- package/prompts/policy-complete-success.md +4 -4
- package/prompts/policy-namespace-scope.md +1 -1
- package/prompts/question-generation.md +5 -5
- package/prompts/resource-analysis.md +3 -3
- package/prompts/resource-selection.md +3 -3
- package/prompts/solution-enhancement.md +4 -4
- package/scripts/anthropic.nu +9 -13
- package/scripts/common.nu +31 -33
- package/scripts/ingress.nu +5 -4
- package/scripts/kubernetes.nu +38 -53
- package/dist/core/doc-discovery.d.ts +0 -38
- package/dist/core/doc-discovery.d.ts.map +0 -1
- package/dist/core/doc-discovery.js +0 -231
- package/dist/core/doc-testing-session.d.ts +0 -109
- package/dist/core/doc-testing-session.d.ts.map +0 -1
- package/dist/core/doc-testing-session.js +0 -696
- package/dist/core/doc-testing-types.d.ts +0 -127
- package/dist/core/doc-testing-types.d.ts.map +0 -1
- package/dist/core/doc-testing-types.js +0 -53
- package/dist/core/nushell-runtime.d.ts +0 -39
- package/dist/core/nushell-runtime.d.ts.map +0 -1
- package/dist/core/nushell-runtime.js +0 -103
- package/dist/core/platform-operations.d.ts +0 -70
- package/dist/core/platform-operations.d.ts.map +0 -1
- package/dist/core/platform-operations.js +0 -294
- package/dist/tools/build-platform.d.ts +0 -25
- package/dist/tools/build-platform.d.ts.map +0 -1
- package/dist/tools/build-platform.js +0 -277
- package/dist/tools/test-docs.d.ts +0 -22
- package/dist/tools/test-docs.d.ts.map +0 -1
- package/dist/tools/test-docs.js +0 -351
- package/prompts/doc-testing-done.md +0 -51
- package/prompts/doc-testing-fix.md +0 -120
- package/prompts/doc-testing-scan.md +0 -140
- package/prompts/doc-testing-test-section.md +0 -169
- package/prompts/platform-operations-parse-script-help.md +0 -68
- package/scripts/ack.nu +0 -195
- package/scripts/argo-workflows.nu +0 -47
- package/scripts/argocd.nu +0 -85
- package/scripts/aso.nu +0 -74
- package/scripts/backstage.nu +0 -349
- package/scripts/cert-manager.nu +0 -13
- package/scripts/cnpg.nu +0 -14
- package/scripts/dot.nu +0 -32
- package/scripts/external-secrets.nu +0 -110
- package/scripts/gatekeeper.nu +0 -19
- package/scripts/github.nu +0 -42
- package/scripts/image.nu +0 -67
- package/scripts/kro.nu +0 -11
- package/scripts/kubevela.nu +0 -22
- package/scripts/port.nu +0 -71
- package/scripts/prometheus.nu +0 -21
- package/scripts/registry.nu +0 -55
- package/scripts/storage.nu +0 -210
- package/scripts/tests.nu +0 -12
- package/scripts/velero.nu +0 -45
- package/shared-prompts/validate-docs.md +0 -22
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Metadata Loader
|
|
3
|
+
*
|
|
4
|
+
* Provides consistent access to model and tool metadata across all evaluators
|
|
5
|
+
*/
|
|
6
|
+
export interface ModelMetadata {
|
|
7
|
+
provider: string;
|
|
8
|
+
pricing: {
|
|
9
|
+
input_cost_per_million_tokens: number;
|
|
10
|
+
output_cost_per_million_tokens: number;
|
|
11
|
+
};
|
|
12
|
+
context_window: number;
|
|
13
|
+
supports_function_calling: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ToolMetadata {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
primaryFunction: string;
|
|
19
|
+
testTimeout: string;
|
|
20
|
+
successCriteria: string[];
|
|
21
|
+
modelRequirements: Record<string, string>;
|
|
22
|
+
}
|
|
23
|
+
export interface EvaluationMetadata {
|
|
24
|
+
models: Record<string, ModelMetadata>;
|
|
25
|
+
tools: Record<string, ToolMetadata>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Load model and tool metadata from model-metadata.json
|
|
29
|
+
*/
|
|
30
|
+
export declare function loadEvaluationMetadata(): EvaluationMetadata;
|
|
31
|
+
/**
|
|
32
|
+
* Build model pricing context for evaluation prompts
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildModelPricingContext(models: Record<string, ModelMetadata>): string;
|
|
35
|
+
/**
|
|
36
|
+
* Build tool context for evaluation prompts (tool-specific description and constraints)
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildToolContext(toolName: string, tools: Record<string, ToolMetadata>): string;
|
|
39
|
+
//# sourceMappingURL=metadata-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata-loader.d.ts","sourceRoot":"","sources":["../../src/evaluation/metadata-loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QACP,6BAA6B,EAAE,MAAM,CAAC;QACtC,8BAA8B,EAAE,MAAM,CAAC;KACxC,CAAC;IACF,cAAc,EAAE,MAAM,CAAC;IACvB,yBAAyB,EAAE,OAAO,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACrC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,kBAAkB,CAa3D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,CAkBtF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,MAAM,CAqB9F"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared Metadata Loader
|
|
4
|
+
*
|
|
5
|
+
* Provides consistent access to model and tool metadata across all evaluators
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.loadEvaluationMetadata = loadEvaluationMetadata;
|
|
9
|
+
exports.buildModelPricingContext = buildModelPricingContext;
|
|
10
|
+
exports.buildToolContext = buildToolContext;
|
|
11
|
+
const fs_1 = require("fs");
|
|
12
|
+
const path_1 = require("path");
|
|
13
|
+
/**
|
|
14
|
+
* Load model and tool metadata from model-metadata.json
|
|
15
|
+
*/
|
|
16
|
+
function loadEvaluationMetadata() {
|
|
17
|
+
try {
|
|
18
|
+
const metadataPath = (0, path_1.join)(process.cwd(), 'src', 'evaluation', 'model-metadata.json');
|
|
19
|
+
const metadata = JSON.parse((0, fs_1.readFileSync)(metadataPath, 'utf8'));
|
|
20
|
+
console.log(`✅ Loaded metadata for ${Object.keys(metadata.models || {}).length} models and ${Object.keys(metadata.tools || {}).length} tools`);
|
|
21
|
+
return {
|
|
22
|
+
models: metadata.models || {},
|
|
23
|
+
tools: metadata.tools || {}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.warn('⚠️ Failed to load evaluation metadata:', error);
|
|
28
|
+
return { models: {}, tools: {} };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Build model pricing context for evaluation prompts
|
|
33
|
+
*/
|
|
34
|
+
function buildModelPricingContext(models) {
|
|
35
|
+
const modelIds = Object.keys(models);
|
|
36
|
+
if (modelIds.length === 0) {
|
|
37
|
+
return 'No pricing information available.';
|
|
38
|
+
}
|
|
39
|
+
const pricingLines = modelIds.map(modelId => {
|
|
40
|
+
const model = models[modelId];
|
|
41
|
+
const inputCost = model.pricing?.input_cost_per_million_tokens?.toFixed(2) || 'N/A';
|
|
42
|
+
const outputCost = model.pricing?.output_cost_per_million_tokens?.toFixed(2) || 'N/A';
|
|
43
|
+
const avgCost = model.pricing
|
|
44
|
+
? ((model.pricing.input_cost_per_million_tokens + model.pricing.output_cost_per_million_tokens) / 2).toFixed(2)
|
|
45
|
+
: 'N/A';
|
|
46
|
+
const contextWindow = model.context_window ? `${(model.context_window / 1000).toFixed(0)}K` : 'N/A';
|
|
47
|
+
return `- **${modelId}** (${model.provider}): $${avgCost}/1M tokens ($${inputCost} input, $${outputCost} output) | Context: ${contextWindow} tokens`;
|
|
48
|
+
});
|
|
49
|
+
return `## Model Pricing Information\n\n${pricingLines.join('\n')}`;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build tool context for evaluation prompts (tool-specific description and constraints)
|
|
53
|
+
*/
|
|
54
|
+
function buildToolContext(toolName, tools) {
|
|
55
|
+
const tool = tools[toolName];
|
|
56
|
+
if (!tool) {
|
|
57
|
+
return `No metadata available for tool: ${toolName}`;
|
|
58
|
+
}
|
|
59
|
+
return `## Tool Being Evaluated: ${tool.name}
|
|
60
|
+
|
|
61
|
+
**Description**: ${tool.description}
|
|
62
|
+
|
|
63
|
+
**Primary Function**: ${tool.primaryFunction}
|
|
64
|
+
|
|
65
|
+
**Test Timeout Constraint**: ${tool.testTimeout}
|
|
66
|
+
|
|
67
|
+
**Success Criteria**:
|
|
68
|
+
${tool.successCriteria.map((c) => `- ${c}`).join('\n')}
|
|
69
|
+
|
|
70
|
+
**Model Requirements**:
|
|
71
|
+
${Object.entries(tool.modelRequirements).map(([key, value]) => `- **${key}**: ${value}`).join('\n')}
|
|
72
|
+
|
|
73
|
+
**IMPORTANT**: When analyzing model failures, consider whether the model exceeded the timeout constraint. Models that timeout should be noted as failing due to timeout constraints rather than quality issues.`;
|
|
74
|
+
}
|
|
@@ -35,7 +35,7 @@ export declare class PlatformSynthesizer {
|
|
|
35
35
|
private aiProvider;
|
|
36
36
|
private reportsDir;
|
|
37
37
|
constructor(aiProvider: VercelProvider, reportsDir?: string);
|
|
38
|
-
generatePlatformWideAnalysis(): Promise<string>;
|
|
38
|
+
generatePlatformWideAnalysis(graphsToGenerate?: string[], skipReport?: boolean): Promise<string>;
|
|
39
39
|
private loadToolMetadata;
|
|
40
40
|
private loadAllReports;
|
|
41
41
|
private analyzeCrossToolPerformance;
|
|
@@ -49,6 +49,10 @@ export declare class PlatformSynthesizer {
|
|
|
49
49
|
private generateProductionRecommendations;
|
|
50
50
|
private calculateCostEstimate;
|
|
51
51
|
private extractBaseModelId;
|
|
52
|
+
/**
|
|
53
|
+
* Generates graphs and replaces placeholders in the markdown report
|
|
54
|
+
*/
|
|
55
|
+
private addGraphsToReport;
|
|
52
56
|
saveSynthesisReport(markdownContent: string, outputPath?: string): Promise<void>;
|
|
53
57
|
}
|
|
54
58
|
//# sourceMappingURL=platform-synthesizer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-synthesizer.d.ts","sourceRoot":"","sources":["../../src/evaluation/platform-synthesizer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"platform-synthesizer.d.ts","sourceRoot":"","sources":["../../src/evaluation/platform-synthesizer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAItE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,6BAA6B,EAAE,MAAM,CAAC;QACtC,8BAA8B,EAAE,MAAM,CAAC;KACxC,CAAC;IACF,YAAY,EAAE;QACZ,cAAc,EAAE,MAAM,CAAC;QACvB,yBAAyB,EAAE,OAAO,CAAC;KACpC,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,gBAAgB,EAAE,CAAC;IACnC,cAAc,EAAE,gBAAgB,EAAE,CAAC;IACnC,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,kBAAkB,EAAE,gBAAgB,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,eAAe,GAAG,aAAa,GAAG,YAAY,GAAG,UAAU,CAAC;IACtE,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,UAAU,CAAS;gBAEf,UAAU,EAAE,cAAc,EAAE,UAAU,SAA+B;IAK3E,4BAA4B,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE,UAAU,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IA6CpG,OAAO,CAAC,gBAAgB;YAKV,cAAc;YAyBd,2BAA2B;IA8DzC,OAAO,CAAC,0BAA0B;IA2ElC,OAAO,CAAC,wBAAwB;IAiDhC,OAAO,CAAC,4BAA4B;YA0CtB,wBAAwB;IAoBtC,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,oBAAoB;IAsB5B,OAAO,CAAC,yBAAyB;IAWjC,OAAO,CAAC,iCAAiC;IASzC,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,kBAAkB;IAS1B;;OAEG;YACW,iBAAiB;IA8CzB,mBAAmB,CACvB,eAAe,EAAE,MAAM,EACvB,UAAU,SAAiD,GAC1D,OAAO,CAAC,IAAI,CAAC;CAWjB"}
|
|
@@ -36,6 +36,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.PlatformSynthesizer = void 0;
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
|
+
const graph_generator_js_1 = require("./graph-generator.js");
|
|
40
|
+
const metadata_loader_js_1 = require("./metadata-loader.js");
|
|
39
41
|
class PlatformSynthesizer {
|
|
40
42
|
aiProvider;
|
|
41
43
|
reportsDir;
|
|
@@ -43,48 +45,48 @@ class PlatformSynthesizer {
|
|
|
43
45
|
this.aiProvider = aiProvider;
|
|
44
46
|
this.reportsDir = reportsDir;
|
|
45
47
|
}
|
|
46
|
-
async generatePlatformWideAnalysis() {
|
|
48
|
+
async generatePlatformWideAnalysis(graphsToGenerate, skipReport = false) {
|
|
47
49
|
console.log('🔍 Loading all evaluation reports...');
|
|
48
50
|
const allReports = await this.loadAllReports();
|
|
49
51
|
console.log('🔧 Loading tool metadata...');
|
|
50
52
|
const toolMetadata = this.loadToolMetadata();
|
|
51
53
|
console.log('📊 Analyzing cross-tool performance patterns...');
|
|
52
54
|
const crossToolAnalysis = await this.analyzeCrossToolPerformance(allReports);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const markdownReport = await this.generatePlatformInsights(crossToolAnalysis, decisionMatrices, usageRecommendations, toolMetadata);
|
|
59
|
-
return markdownReport;
|
|
60
|
-
}
|
|
61
|
-
loadToolMetadata() {
|
|
62
|
-
try {
|
|
63
|
-
const metadataPath = path.join(process.cwd(), 'src', 'evaluation', 'model-metadata.json');
|
|
64
|
-
const metadataContent = fs.readFileSync(metadataPath, 'utf8');
|
|
65
|
-
const metadata = JSON.parse(metadataContent);
|
|
66
|
-
console.log(`✅ Loaded tool metadata with ${Object.keys(metadata.tools || {}).length} tools`);
|
|
67
|
-
return metadata.tools || {};
|
|
55
|
+
let markdownReport;
|
|
56
|
+
if (skipReport) {
|
|
57
|
+
console.log('⏭️ Skipping AI report generation...');
|
|
58
|
+
// Return empty string if we're only generating graphs
|
|
59
|
+
markdownReport = '';
|
|
68
60
|
}
|
|
69
|
-
|
|
70
|
-
console.
|
|
71
|
-
|
|
61
|
+
else {
|
|
62
|
+
console.log('🎯 Generating decision matrices...');
|
|
63
|
+
const decisionMatrices = this.generateDecisionMatrices(crossToolAnalysis.modelPerformances);
|
|
64
|
+
console.log('💡 Creating usage recommendations...');
|
|
65
|
+
const usageRecommendations = this.generateUsageRecommendations(crossToolAnalysis, decisionMatrices);
|
|
66
|
+
console.log('🚀 Generating comprehensive AI-powered report...');
|
|
67
|
+
markdownReport = await this.generatePlatformInsights(crossToolAnalysis, decisionMatrices, usageRecommendations, toolMetadata);
|
|
72
68
|
}
|
|
69
|
+
console.log('📊 Generating data visualizations...');
|
|
70
|
+
const reportWithGraphs = await this.addGraphsToReport(markdownReport, crossToolAnalysis.modelPerformances, graphsToGenerate);
|
|
71
|
+
return reportWithGraphs;
|
|
72
|
+
}
|
|
73
|
+
loadToolMetadata() {
|
|
74
|
+
const metadata = (0, metadata_loader_js_1.loadEvaluationMetadata)();
|
|
75
|
+
return { tools: metadata.tools };
|
|
73
76
|
}
|
|
74
77
|
async loadAllReports() {
|
|
75
78
|
const reports = {};
|
|
76
79
|
// Load all JSON result files from the directory
|
|
77
80
|
const reportFiles = fs.readdirSync(this.reportsDir)
|
|
78
|
-
.filter(file => file.endsWith('-results
|
|
79
|
-
.filter(file => file.endsWith('.json'));
|
|
81
|
+
.filter(file => file.endsWith('-results.json'));
|
|
80
82
|
if (reportFiles.length === 0) {
|
|
81
83
|
throw new Error(`No evaluation result files found in ${this.reportsDir}`);
|
|
82
84
|
}
|
|
83
85
|
for (const fileName of reportFiles) {
|
|
84
86
|
const reportPath = path.join(this.reportsDir, fileName);
|
|
85
87
|
const reportContent = JSON.parse(fs.readFileSync(reportPath, 'utf8'));
|
|
86
|
-
// Extract tool type from filename (e.g., "capability-results
|
|
87
|
-
const toolType = fileName.split('-results
|
|
88
|
+
// Extract tool type from filename (e.g., "capability-results.json" -> "capability")
|
|
89
|
+
const toolType = fileName.split('-results.json')[0];
|
|
88
90
|
reports[toolType] = reportContent;
|
|
89
91
|
console.log(`✅ Loaded ${toolType} report: ${fileName}`);
|
|
90
92
|
}
|
|
@@ -355,6 +357,46 @@ class PlatformSynthesizer {
|
|
|
355
357
|
}
|
|
356
358
|
return fullModelId;
|
|
357
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
* Generates graphs and replaces placeholders in the markdown report
|
|
362
|
+
*/
|
|
363
|
+
async addGraphsToReport(markdownContent, modelPerformances, graphsToGenerate) {
|
|
364
|
+
const graphGenerator = new graph_generator_js_1.GraphGenerator('./eval/analysis/platform/graphs');
|
|
365
|
+
try {
|
|
366
|
+
// Generate all or specific graphs
|
|
367
|
+
const graphResults = await graphGenerator.generateAllGraphs(modelPerformances, graphsToGenerate);
|
|
368
|
+
// Replace placeholders with actual image markdown
|
|
369
|
+
let updatedMarkdown = markdownContent;
|
|
370
|
+
const graphMappings = {
|
|
371
|
+
'[GRAPH:performance-tiers]': '',
|
|
372
|
+
'[GRAPH:cost-vs-quality]': '',
|
|
373
|
+
'[GRAPH:reliability-comparison]': '',
|
|
374
|
+
'[GRAPH:tool-performance-heatmap]': '',
|
|
375
|
+
'[GRAPH:context-window-correlation]': ''
|
|
376
|
+
};
|
|
377
|
+
for (const [placeholder, imageMarkdown] of Object.entries(graphMappings)) {
|
|
378
|
+
updatedMarkdown = updatedMarkdown.replace(placeholder, imageMarkdown);
|
|
379
|
+
}
|
|
380
|
+
// Log graph generation results
|
|
381
|
+
for (const [graphName, result] of Object.entries(graphResults)) {
|
|
382
|
+
if (result.success) {
|
|
383
|
+
console.log(` ✅ ${graphName}: ${result.graphPath}`);
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
console.warn(` ⚠️ ${graphName}: ${result.error}`);
|
|
387
|
+
// If graph generation failed, remove the placeholder to avoid broken markdown
|
|
388
|
+
const placeholderKey = `[GRAPH:${graphName}]`;
|
|
389
|
+
updatedMarkdown = updatedMarkdown.replace(placeholderKey, `*Graph generation failed: ${result.error}*`);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return updatedMarkdown;
|
|
393
|
+
}
|
|
394
|
+
catch (error) {
|
|
395
|
+
console.error('⚠️ Failed to generate graphs, returning report without visualizations:', error);
|
|
396
|
+
// If graph generation completely fails, remove all placeholders
|
|
397
|
+
return markdownContent.replace(/\[GRAPH:[^\]]+\]/g, '*Graph generation failed*');
|
|
398
|
+
}
|
|
399
|
+
}
|
|
358
400
|
async saveSynthesisReport(markdownContent, outputPath = './eval/analysis/platform/synthesis-report.md') {
|
|
359
401
|
const dir = path.dirname(outputPath);
|
|
360
402
|
if (!fs.existsSync(dir)) {
|
|
@@ -13,6 +13,21 @@ const model_config_js_1 = require("../core/model-config.js");
|
|
|
13
13
|
async function runPlatformSynthesis() {
|
|
14
14
|
console.log('🚀 Starting Platform-Wide AI Model Synthesis...\n');
|
|
15
15
|
try {
|
|
16
|
+
// Parse command line arguments for graph filtering
|
|
17
|
+
const args = process.argv.slice(2);
|
|
18
|
+
let graphsToGenerate;
|
|
19
|
+
let skipReport = false;
|
|
20
|
+
if (args.length > 0) {
|
|
21
|
+
const graphArg = args.find(arg => arg.startsWith('--graphs='));
|
|
22
|
+
if (graphArg) {
|
|
23
|
+
graphsToGenerate = graphArg.split('=')[1].split(',');
|
|
24
|
+
console.log(`📊 Generating specific graphs: ${graphsToGenerate.join(', ')}\n`);
|
|
25
|
+
}
|
|
26
|
+
skipReport = args.includes('--skip-report');
|
|
27
|
+
if (skipReport) {
|
|
28
|
+
console.log('⏭️ Skipping AI report generation (graphs only)\n');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
16
31
|
// Initialize AI provider for synthesis analysis (use Claude for comprehensive analysis)
|
|
17
32
|
const aiProvider = new vercel_provider_js_1.VercelProvider({
|
|
18
33
|
provider: 'anthropic',
|
|
@@ -22,12 +37,14 @@ async function runPlatformSynthesis() {
|
|
|
22
37
|
});
|
|
23
38
|
// Initialize synthesizer
|
|
24
39
|
const synthesizer = new platform_synthesizer_js_1.PlatformSynthesizer(aiProvider);
|
|
25
|
-
// Generate comprehensive platform-wide analysis
|
|
40
|
+
// Generate comprehensive platform-wide analysis (or just graphs if skip-report is set)
|
|
26
41
|
console.log('📊 Generating platform-wide analysis...');
|
|
27
|
-
const markdownReport = await synthesizer.generatePlatformWideAnalysis();
|
|
28
|
-
// Save synthesis report
|
|
29
|
-
|
|
30
|
-
|
|
42
|
+
const markdownReport = await synthesizer.generatePlatformWideAnalysis(graphsToGenerate, skipReport);
|
|
43
|
+
// Save synthesis report only if we generated it
|
|
44
|
+
if (!skipReport) {
|
|
45
|
+
console.log('\n💾 Saving synthesis report...');
|
|
46
|
+
await synthesizer.saveSynthesisReport(markdownReport);
|
|
47
|
+
}
|
|
31
48
|
console.log('\n✅ Platform-wide synthesis complete!');
|
|
32
49
|
console.log('📄 Report saved: ./eval/analysis/platform/synthesis-report.md');
|
|
33
50
|
console.log('\n✨ AI-generated comprehensive report includes:');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/interfaces/mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/interfaces/mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAwCtC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;CACxC;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,gBAAgB,CAAa;IACrC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,UAAU,CAAC,CAAkC;IACrD,OAAO,CAAC,aAAa,CAAC,CAAgC;IACtD,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,aAAa,CAAgB;gBAEzB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe;IAsCjD;;OAEG;IACH,OAAO,CAAC,YAAY;IAsBpB;;OAEG;IACH,OAAO,CAAC,aAAa;IA2GrB;;OAEG;IACH,OAAO,CAAC,eAAe;IAqCvB,OAAO,CAAC,iBAAiB;IAInB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAkBd,mBAAmB;YAMnB,kBAAkB;YAiFlB,gBAAgB;IAexB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB3B,OAAO,IAAI,OAAO;CAGnB"}
|
package/dist/interfaces/mcp.js
CHANGED
|
@@ -16,15 +16,9 @@ const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
|
16
16
|
const error_handling_1 = require("../core/error-handling");
|
|
17
17
|
const recommend_1 = require("../tools/recommend");
|
|
18
18
|
const version_1 = require("../tools/version");
|
|
19
|
-
const test_docs_1 = require("../tools/test-docs");
|
|
20
19
|
const organizational_data_1 = require("../tools/organizational-data");
|
|
21
20
|
const remediate_1 = require("../tools/remediate");
|
|
22
|
-
|
|
23
|
-
// BUILD_PLATFORM_TOOL_NAME,
|
|
24
|
-
// BUILD_PLATFORM_TOOL_DESCRIPTION,
|
|
25
|
-
// BUILD_PLATFORM_TOOL_INPUT_SCHEMA,
|
|
26
|
-
// handleBuildPlatformTool,
|
|
27
|
-
// } from '../tools/build-platform';
|
|
21
|
+
const project_setup_1 = require("../tools/project-setup");
|
|
28
22
|
const prompts_1 = require("../tools/prompts");
|
|
29
23
|
const rest_registry_1 = require("./rest-registry");
|
|
30
24
|
const rest_api_1 = require("./rest-api");
|
|
@@ -102,14 +96,6 @@ class MCPServer {
|
|
|
102
96
|
});
|
|
103
97
|
return await (0, version_1.handleVersionTool)(args, this.logger, requestId);
|
|
104
98
|
}, 'System', ['version', 'diagnostics', 'status']);
|
|
105
|
-
// Register testDocs tool
|
|
106
|
-
this.registerTool(test_docs_1.TESTDOCS_TOOL_NAME, test_docs_1.TESTDOCS_TOOL_DESCRIPTION, test_docs_1.TESTDOCS_TOOL_INPUT_SCHEMA, async (args) => {
|
|
107
|
-
const requestId = this.generateRequestId();
|
|
108
|
-
this.logger.info(`Processing ${test_docs_1.TESTDOCS_TOOL_NAME} tool request`, {
|
|
109
|
-
requestId,
|
|
110
|
-
});
|
|
111
|
-
return await (0, test_docs_1.handleTestDocsTool)(args, null, this.logger, requestId);
|
|
112
|
-
}, 'Documentation', ['testing', 'validation', 'docs']);
|
|
113
99
|
// Register organizational-data tool
|
|
114
100
|
this.registerTool(organizational_data_1.ORGANIZATIONAL_DATA_TOOL_NAME, organizational_data_1.ORGANIZATIONAL_DATA_TOOL_DESCRIPTION, organizational_data_1.ORGANIZATIONAL_DATA_TOOL_INPUT_SCHEMA, async (args) => {
|
|
115
101
|
const requestId = this.generateRequestId();
|
|
@@ -122,30 +108,19 @@ class MCPServer {
|
|
|
122
108
|
this.logger.info(`Processing ${remediate_1.REMEDIATE_TOOL_NAME} tool request`, { requestId });
|
|
123
109
|
return await (0, remediate_1.handleRemediateTool)(args);
|
|
124
110
|
}, 'Troubleshooting', ['remediation', 'troubleshooting', 'kubernetes', 'analysis']);
|
|
125
|
-
// Register
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
// const requestId = this.generateRequestId();
|
|
132
|
-
// this.logger.info(
|
|
133
|
-
// `Processing ${BUILD_PLATFORM_TOOL_NAME} tool request`,
|
|
134
|
-
// { requestId }
|
|
135
|
-
// );
|
|
136
|
-
// return await handleBuildPlatformTool(args, this.dotAI, this.logger, requestId);
|
|
137
|
-
// },
|
|
138
|
-
// 'Platform',
|
|
139
|
-
// ['platform', 'kubernetes', 'installation', 'infrastructure']
|
|
140
|
-
// );
|
|
111
|
+
// Register projectSetup tool
|
|
112
|
+
this.registerTool(project_setup_1.PROJECT_SETUP_TOOL_NAME, project_setup_1.PROJECT_SETUP_TOOL_DESCRIPTION, project_setup_1.PROJECT_SETUP_TOOL_INPUT_SCHEMA, async (args) => {
|
|
113
|
+
const requestId = this.generateRequestId();
|
|
114
|
+
this.logger.info(`Processing ${project_setup_1.PROJECT_SETUP_TOOL_NAME} tool request`, { requestId });
|
|
115
|
+
return await (0, project_setup_1.handleProjectSetupTool)(args, this.logger);
|
|
116
|
+
}, 'Project Setup', ['governance', 'infrastructure', 'configuration', 'files']);
|
|
141
117
|
this.logger.info('Registered all tools with McpServer', {
|
|
142
118
|
tools: [
|
|
143
119
|
recommend_1.RECOMMEND_TOOL_NAME,
|
|
144
120
|
version_1.VERSION_TOOL_NAME,
|
|
145
|
-
test_docs_1.TESTDOCS_TOOL_NAME,
|
|
146
121
|
organizational_data_1.ORGANIZATIONAL_DATA_TOOL_NAME,
|
|
147
|
-
remediate_1.REMEDIATE_TOOL_NAME
|
|
148
|
-
|
|
122
|
+
remediate_1.REMEDIATE_TOOL_NAME,
|
|
123
|
+
project_setup_1.PROJECT_SETUP_TOOL_NAME
|
|
149
124
|
],
|
|
150
125
|
totalTools: 5,
|
|
151
126
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"answer-question.d.ts","sourceRoot":"","sources":["../../src/tools/answer-question.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAQhD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AACzD,eAAO,MAAM,+BAA+B,8HAA4H,CAAC;AAGzK,eAAO,MAAM,gCAAgC;;;;;CAK5C,CAAC;
|
|
1
|
+
{"version":3,"file":"answer-question.d.ts","sourceRoot":"","sources":["../../src/tools/answer-question.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAQhD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AACzD,eAAO,MAAM,+BAA+B,8HAA4H,CAAC;AAGzK,eAAO,MAAM,gCAAgC;;;;;CAK5C,CAAC;AAwiBF;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,EACtI,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAqUxD"}
|
|
@@ -355,7 +355,6 @@ function getStageGuidance(stage) {
|
|
|
355
355
|
* Phase 1: Analyze what resources are needed for the user request
|
|
356
356
|
*/
|
|
357
357
|
async function analyzeResourceNeeds(currentSolution, openResponse, context, interaction_id) {
|
|
358
|
-
const template = (0, shared_prompt_loader_1.loadPrompt)('resource-analysis');
|
|
359
358
|
// Get available resources from solution or use defaults
|
|
360
359
|
const availableResources = currentSolution.availableResources || {
|
|
361
360
|
resources: [],
|
|
@@ -366,10 +365,11 @@ async function analyzeResourceNeeds(currentSolution, openResponse, context, inte
|
|
|
366
365
|
...(availableResources.resources || []),
|
|
367
366
|
...(availableResources.custom || [])
|
|
368
367
|
].map((r) => r.kind || r);
|
|
369
|
-
const analysisPrompt =
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
368
|
+
const analysisPrompt = (0, shared_prompt_loader_1.loadPrompt)('resource-analysis', {
|
|
369
|
+
current_solution: JSON.stringify(currentSolution, null, 2),
|
|
370
|
+
user_request: openResponse,
|
|
371
|
+
available_resource_types: JSON.stringify(availableResourceTypes, null, 2)
|
|
372
|
+
});
|
|
373
373
|
// Get AI provider from context
|
|
374
374
|
const aiProvider = context.dotAI.ai;
|
|
375
375
|
context.logger.info('Analyzing resource needs for open question', {
|
|
@@ -430,12 +430,12 @@ async function applySolutionEnhancement(solution, openResponse, analysisResult,
|
|
|
430
430
|
* Auto-populate existing questions based on user requirements
|
|
431
431
|
*/
|
|
432
432
|
async function autoPopulateQuestions(solution, openResponse, analysisResult, context, interaction_id) {
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
433
|
+
const enhancementPrompt = (0, shared_prompt_loader_1.loadPrompt)('solution-enhancement', {
|
|
434
|
+
current_solution: JSON.stringify(solution, null, 2),
|
|
435
|
+
detailed_schemas: JSON.stringify(solution.schemas || {}, null, 2),
|
|
436
|
+
analysis_result: JSON.stringify(analysisResult, null, 2),
|
|
437
|
+
open_response: openResponse
|
|
438
|
+
});
|
|
439
439
|
// Get AI provider from context
|
|
440
440
|
const aiProvider = context.dotAI.ai;
|
|
441
441
|
const response = await aiProvider.sendMessage(enhancementPrompt, 'answer-question-solution-enhancement', {
|
|
@@ -517,7 +517,7 @@ async function handleAnswerQuestionTool(args, dotAI, logger, requestId) {
|
|
|
517
517
|
// Get session directory from environment
|
|
518
518
|
let sessionDir;
|
|
519
519
|
try {
|
|
520
|
-
sessionDir = (0, session_utils_1.getAndValidateSessionDirectory)(
|
|
520
|
+
sessionDir = (0, session_utils_1.getAndValidateSessionDirectory)(false); // requireWrite=false for reading
|
|
521
521
|
logger.debug('Session directory resolved and validated', { sessionDir });
|
|
522
522
|
}
|
|
523
523
|
catch (error) {
|
|
@@ -85,7 +85,7 @@ async function handleChooseSolutionTool(args, dotAI, logger, requestId) {
|
|
|
85
85
|
// Get session directory from environment
|
|
86
86
|
let sessionDir;
|
|
87
87
|
try {
|
|
88
|
-
sessionDir = (0, session_utils_1.getAndValidateSessionDirectory)(
|
|
88
|
+
sessionDir = (0, session_utils_1.getAndValidateSessionDirectory)(false); // requireWrite=false
|
|
89
89
|
logger.debug('Session directory resolved and validated', { sessionDir });
|
|
90
90
|
}
|
|
91
91
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-manifests.d.ts","sourceRoot":"","sources":["../../src/tools/generate-manifests.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAYhD,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAC/D,eAAO,MAAM,kCAAkC,+IAA+I,CAAC;AAG/L,eAAO,MAAM,mCAAmC;;;CAG/C,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-manifests.d.ts","sourceRoot":"","sources":["../../src/tools/generate-manifests.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAYhD,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAC/D,eAAO,MAAM,kCAAkC,+IAA+I,CAAC;AAG/L,eAAO,MAAM,mCAAmC;;;CAG/C,CAAC;AAyRF;;GAEG;AACH,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,EACrD,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAsMxD"}
|
|
@@ -182,8 +182,6 @@ async function validateManifests(yamlPath) {
|
|
|
182
182
|
* Generate manifests using AI provider
|
|
183
183
|
*/
|
|
184
184
|
async function generateManifestsWithAI(solution, dotAI, logger, errorContext, dotAiLabels, interaction_id) {
|
|
185
|
-
// Load prompt template
|
|
186
|
-
const template = (0, shared_prompt_loader_1.loadPrompt)('manifest-generation');
|
|
187
185
|
// Retrieve schemas for solution resources
|
|
188
186
|
const resourceSchemas = await retrieveResourceSchemas(solution, dotAI, logger);
|
|
189
187
|
// Prepare template variables
|
|
@@ -199,15 +197,16 @@ ${errorContext.previousManifests}
|
|
|
199
197
|
**Validation Errors**: ${errorContext.validationResult.errors.join(', ')}
|
|
200
198
|
**Validation Warnings**: ${errorContext.validationResult.warnings.join(', ')}
|
|
201
199
|
` : 'None - this is the first attempt.';
|
|
202
|
-
//
|
|
200
|
+
// Prepare template variables
|
|
203
201
|
const schemasData = JSON.stringify(resourceSchemas, null, 2);
|
|
204
202
|
const labelsData = dotAiLabels ? JSON.stringify(dotAiLabels, null, 2) : '{}';
|
|
205
|
-
const aiPrompt =
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
203
|
+
const aiPrompt = (0, shared_prompt_loader_1.loadPrompt)('manifest-generation', {
|
|
204
|
+
solution: solutionData,
|
|
205
|
+
schemas: schemasData,
|
|
206
|
+
previous_attempt: previousAttempt,
|
|
207
|
+
error_details: errorDetails,
|
|
208
|
+
labels: labelsData
|
|
209
|
+
});
|
|
211
210
|
const isRetry = !!errorContext;
|
|
212
211
|
logger.info('Generating manifests with AI', {
|
|
213
212
|
isRetry,
|
|
@@ -298,7 +297,7 @@ async function handleGenerateManifestsTool(args, dotAI, logger, requestId) {
|
|
|
298
297
|
// Get session directory from environment
|
|
299
298
|
let sessionDir;
|
|
300
299
|
try {
|
|
301
|
-
sessionDir = (0, session_utils_1.getAndValidateSessionDirectory)(
|
|
300
|
+
sessionDir = (0, session_utils_1.getAndValidateSessionDirectory)(true); // requireWrite=true for manifest generation
|
|
302
301
|
logger.debug('Session directory resolved and validated', { sessionDir });
|
|
303
302
|
}
|
|
304
303
|
catch (error) {
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export { GENERATEMANIFESTS_TOOL_NAME, GENERATEMANIFESTS_TOOL_DESCRIPTION, GENERA
|
|
|
10
10
|
export { DEPLOYMANIFESTS_TOOL_NAME, DEPLOYMANIFESTS_TOOL_DESCRIPTION, DEPLOYMANIFESTS_TOOL_INPUT_SCHEMA, handleDeployManifestsTool, } from './deploy-manifests';
|
|
11
11
|
export { ORGANIZATIONAL_DATA_TOOL_NAME, ORGANIZATIONAL_DATA_TOOL_DESCRIPTION, ORGANIZATIONAL_DATA_TOOL_INPUT_SCHEMA, handleOrganizationalDataTool, } from './organizational-data';
|
|
12
12
|
export { REMEDIATE_TOOL_NAME, REMEDIATE_TOOL_DESCRIPTION, REMEDIATE_TOOL_INPUT_SCHEMA, handleRemediateTool, } from './remediate';
|
|
13
|
-
export {
|
|
13
|
+
export { PROJECT_SETUP_TOOL_NAME, PROJECT_SETUP_TOOL_DESCRIPTION, PROJECT_SETUP_TOOL_INPUT_SCHEMA, handleProjectSetupTool, } from './project-setup';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,EAClC,mCAAmC,EACnC,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,iCAAiC,EACjC,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,6BAA6B,EAC7B,oCAAoC,EACpC,qCAAqC,EACrC,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,EAClC,mCAAmC,EACnC,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,iCAAiC,EACjC,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,6BAA6B,EAC7B,oCAAoC,EACpC,qCAAqC,EACrC,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,+BAA+B,EAC/B,sBAAsB,GACvB,MAAM,iBAAiB,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Centralized exports for all available tools (direct handlers)
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.handleProjectSetupTool = exports.PROJECT_SETUP_TOOL_INPUT_SCHEMA = exports.PROJECT_SETUP_TOOL_DESCRIPTION = exports.PROJECT_SETUP_TOOL_NAME = exports.handleRemediateTool = exports.REMEDIATE_TOOL_INPUT_SCHEMA = exports.REMEDIATE_TOOL_DESCRIPTION = exports.REMEDIATE_TOOL_NAME = exports.handleOrganizationalDataTool = exports.ORGANIZATIONAL_DATA_TOOL_INPUT_SCHEMA = exports.ORGANIZATIONAL_DATA_TOOL_DESCRIPTION = exports.ORGANIZATIONAL_DATA_TOOL_NAME = exports.handleDeployManifestsTool = exports.DEPLOYMANIFESTS_TOOL_INPUT_SCHEMA = exports.DEPLOYMANIFESTS_TOOL_DESCRIPTION = exports.DEPLOYMANIFESTS_TOOL_NAME = exports.handleGenerateManifestsTool = exports.GENERATEMANIFESTS_TOOL_INPUT_SCHEMA = exports.GENERATEMANIFESTS_TOOL_DESCRIPTION = exports.GENERATEMANIFESTS_TOOL_NAME = exports.handleAnswerQuestionTool = exports.ANSWERQUESTION_TOOL_INPUT_SCHEMA = exports.ANSWERQUESTION_TOOL_DESCRIPTION = exports.ANSWERQUESTION_TOOL_NAME = exports.handleChooseSolutionTool = exports.CHOOSESOLUTION_TOOL_INPUT_SCHEMA = exports.CHOOSESOLUTION_TOOL_DESCRIPTION = exports.CHOOSESOLUTION_TOOL_NAME = exports.handleRecommendTool = exports.RECOMMEND_TOOL_INPUT_SCHEMA = exports.RECOMMEND_TOOL_DESCRIPTION = exports.RECOMMEND_TOOL_NAME = void 0;
|
|
9
9
|
// Export direct tool handlers for use in MCP server and CLI
|
|
10
10
|
var recommend_1 = require("./recommend");
|
|
11
11
|
Object.defineProperty(exports, "RECOMMEND_TOOL_NAME", { enumerable: true, get: function () { return recommend_1.RECOMMEND_TOOL_NAME; } });
|
|
@@ -42,8 +42,8 @@ Object.defineProperty(exports, "REMEDIATE_TOOL_NAME", { enumerable: true, get: f
|
|
|
42
42
|
Object.defineProperty(exports, "REMEDIATE_TOOL_DESCRIPTION", { enumerable: true, get: function () { return remediate_1.REMEDIATE_TOOL_DESCRIPTION; } });
|
|
43
43
|
Object.defineProperty(exports, "REMEDIATE_TOOL_INPUT_SCHEMA", { enumerable: true, get: function () { return remediate_1.REMEDIATE_TOOL_INPUT_SCHEMA; } });
|
|
44
44
|
Object.defineProperty(exports, "handleRemediateTool", { enumerable: true, get: function () { return remediate_1.handleRemediateTool; } });
|
|
45
|
-
var
|
|
46
|
-
Object.defineProperty(exports, "
|
|
47
|
-
Object.defineProperty(exports, "
|
|
48
|
-
Object.defineProperty(exports, "
|
|
49
|
-
Object.defineProperty(exports, "
|
|
45
|
+
var project_setup_1 = require("./project-setup");
|
|
46
|
+
Object.defineProperty(exports, "PROJECT_SETUP_TOOL_NAME", { enumerable: true, get: function () { return project_setup_1.PROJECT_SETUP_TOOL_NAME; } });
|
|
47
|
+
Object.defineProperty(exports, "PROJECT_SETUP_TOOL_DESCRIPTION", { enumerable: true, get: function () { return project_setup_1.PROJECT_SETUP_TOOL_DESCRIPTION; } });
|
|
48
|
+
Object.defineProperty(exports, "PROJECT_SETUP_TOOL_INPUT_SCHEMA", { enumerable: true, get: function () { return project_setup_1.PROJECT_SETUP_TOOL_INPUT_SCHEMA; } });
|
|
49
|
+
Object.defineProperty(exports, "handleProjectSetupTool", { enumerable: true, get: function () { return project_setup_1.handleProjectSetupTool; } });
|