@houtini/lm 1.0.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/CHANGELOG.md +273 -0
- package/LICENSE +21 -0
- package/README.md +203 -0
- package/dist/cache/analysis-cache.d.ts +33 -0
- package/dist/cache/analysis-cache.d.ts.map +1 -0
- package/dist/cache/analysis-cache.js +56 -0
- package/dist/cache/analysis-cache.js.map +1 -0
- package/dist/cache/cache-manager.d.ts +29 -0
- package/dist/cache/cache-manager.d.ts.map +1 -0
- package/dist/cache/cache-manager.js +85 -0
- package/dist/cache/cache-manager.js.map +1 -0
- package/dist/cache/index.d.ts +16 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +17 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/prompt-cache.d.ts +33 -0
- package/dist/cache/prompt-cache.d.ts.map +1 -0
- package/dist/cache/prompt-cache.js +61 -0
- package/dist/cache/prompt-cache.js.map +1 -0
- package/dist/config.d.ts +43 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +70 -0
- package/dist/config.js.map +1 -0
- package/dist/core/ThreeStagePromptManager.d.ts +39 -0
- package/dist/core/ThreeStagePromptManager.d.ts.map +1 -0
- package/dist/core/ThreeStagePromptManager.js +176 -0
- package/dist/core/ThreeStagePromptManager.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +230 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/base-plugin.d.ts +47 -0
- package/dist/plugins/base-plugin.d.ts.map +1 -0
- package/dist/plugins/base-plugin.js +90 -0
- package/dist/plugins/base-plugin.js.map +1 -0
- package/dist/plugins/index.d.ts +58 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +161 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/types.d.ts +5 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +5 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/prompts/analyze/code-quality.d.ts +116 -0
- package/dist/prompts/analyze/code-quality.d.ts.map +1 -0
- package/dist/prompts/analyze/code-quality.js +433 -0
- package/dist/prompts/analyze/code-quality.js.map +1 -0
- package/dist/prompts/analyze/compare-integration.d.ts +130 -0
- package/dist/prompts/analyze/compare-integration.d.ts.map +1 -0
- package/dist/prompts/analyze/compare-integration.js +543 -0
- package/dist/prompts/analyze/compare-integration.js.map +1 -0
- package/dist/prompts/analyze/count-files.d.ts +109 -0
- package/dist/prompts/analyze/count-files.d.ts.map +1 -0
- package/dist/prompts/analyze/count-files.js +399 -0
- package/dist/prompts/analyze/count-files.js.map +1 -0
- package/dist/prompts/analyze/database-queries.d.ts +156 -0
- package/dist/prompts/analyze/database-queries.d.ts.map +1 -0
- package/dist/prompts/analyze/database-queries.js +759 -0
- package/dist/prompts/analyze/database-queries.js.map +1 -0
- package/dist/prompts/analyze/dependencies.d.ts +97 -0
- package/dist/prompts/analyze/dependencies.d.ts.map +1 -0
- package/dist/prompts/analyze/dependencies.js +333 -0
- package/dist/prompts/analyze/dependencies.js.map +1 -0
- package/dist/prompts/analyze/diff-signatures.d.ts +139 -0
- package/dist/prompts/analyze/diff-signatures.d.ts.map +1 -0
- package/dist/prompts/analyze/diff-signatures.js +702 -0
- package/dist/prompts/analyze/diff-signatures.js.map +1 -0
- package/dist/prompts/analyze/find-patterns.d.ts +128 -0
- package/dist/prompts/analyze/find-patterns.d.ts.map +1 -0
- package/dist/prompts/analyze/find-patterns.js +520 -0
- package/dist/prompts/analyze/find-patterns.js.map +1 -0
- package/dist/prompts/analyze/find-unused-css.d.ts +151 -0
- package/dist/prompts/analyze/find-unused-css.d.ts.map +1 -0
- package/dist/prompts/analyze/find-unused-css.js +754 -0
- package/dist/prompts/analyze/find-unused-css.js.map +1 -0
- package/dist/prompts/analyze/n8n-workflow.d.ts +137 -0
- package/dist/prompts/analyze/n8n-workflow.d.ts.map +1 -0
- package/dist/prompts/analyze/n8n-workflow.js +529 -0
- package/dist/prompts/analyze/n8n-workflow.js.map +1 -0
- package/dist/prompts/analyze/project-structure.d.ts +126 -0
- package/dist/prompts/analyze/project-structure.d.ts.map +1 -0
- package/dist/prompts/analyze/project-structure.js +569 -0
- package/dist/prompts/analyze/project-structure.js.map +1 -0
- package/dist/prompts/analyze/security-audit.d.ts +142 -0
- package/dist/prompts/analyze/security-audit.d.ts.map +1 -0
- package/dist/prompts/analyze/security-audit.js +637 -0
- package/dist/prompts/analyze/security-audit.js.map +1 -0
- package/dist/prompts/analyze/single-file.d.ts +162 -0
- package/dist/prompts/analyze/single-file.d.ts.map +1 -0
- package/dist/prompts/analyze/single-file.js +665 -0
- package/dist/prompts/analyze/single-file.js.map +1 -0
- package/dist/prompts/analyze/trace-execution.d.ts +126 -0
- package/dist/prompts/analyze/trace-execution.d.ts.map +1 -0
- package/dist/prompts/analyze/trace-execution.js +609 -0
- package/dist/prompts/analyze/trace-execution.js.map +1 -0
- package/dist/prompts/analyze/wordpress-plugin-audit.d.ts +116 -0
- package/dist/prompts/analyze/wordpress-plugin-audit.d.ts.map +1 -0
- package/dist/prompts/analyze/wordpress-plugin-audit.js +454 -0
- package/dist/prompts/analyze/wordpress-plugin-audit.js.map +1 -0
- package/dist/prompts/analyze/wordpress-security.d.ts +146 -0
- package/dist/prompts/analyze/wordpress-security.d.ts.map +1 -0
- package/dist/prompts/analyze/wordpress-security.js +698 -0
- package/dist/prompts/analyze/wordpress-security.js.map +1 -0
- package/dist/prompts/analyze/wordpress-theme-audit.d.ts +114 -0
- package/dist/prompts/analyze/wordpress-theme-audit.d.ts.map +1 -0
- package/dist/prompts/analyze/wordpress-theme-audit.js +538 -0
- package/dist/prompts/analyze/wordpress-theme-audit.js.map +1 -0
- package/dist/prompts/custom/custom-prompt.d.ts +135 -0
- package/dist/prompts/custom/custom-prompt.d.ts.map +1 -0
- package/dist/prompts/custom/custom-prompt.js +419 -0
- package/dist/prompts/custom/custom-prompt.js.map +1 -0
- package/dist/prompts/fun/arcade-game.d.ts +152 -0
- package/dist/prompts/fun/arcade-game.d.ts.map +1 -0
- package/dist/prompts/fun/arcade-game.js +653 -0
- package/dist/prompts/fun/arcade-game.js.map +1 -0
- package/dist/prompts/fun/create_text_adventure.d.ts +100 -0
- package/dist/prompts/fun/create_text_adventure.d.ts.map +1 -0
- package/dist/prompts/fun/create_text_adventure.js +397 -0
- package/dist/prompts/fun/create_text_adventure.js.map +1 -0
- package/dist/prompts/fun/css-art-generator.d.ts +168 -0
- package/dist/prompts/fun/css-art-generator.d.ts.map +1 -0
- package/dist/prompts/fun/css-art-generator.js +827 -0
- package/dist/prompts/fun/css-art-generator.js.map +1 -0
- package/dist/prompts/generate/project-documentation.d.ts +137 -0
- package/dist/prompts/generate/project-documentation.d.ts.map +1 -0
- package/dist/prompts/generate/project-documentation.js +666 -0
- package/dist/prompts/generate/project-documentation.js.map +1 -0
- package/dist/prompts/generate/refactoring.d.ts +164 -0
- package/dist/prompts/generate/refactoring.d.ts.map +1 -0
- package/dist/prompts/generate/refactoring.js +621 -0
- package/dist/prompts/generate/refactoring.js.map +1 -0
- package/dist/prompts/generate/responsive-component.d.ts +147 -0
- package/dist/prompts/generate/responsive-component.d.ts.map +1 -0
- package/dist/prompts/generate/responsive-component.js +955 -0
- package/dist/prompts/generate/responsive-component.js.map +1 -0
- package/dist/prompts/generate/typescript-conversion.d.ts +144 -0
- package/dist/prompts/generate/typescript-conversion.d.ts.map +1 -0
- package/dist/prompts/generate/typescript-conversion.js +527 -0
- package/dist/prompts/generate/typescript-conversion.js.map +1 -0
- package/dist/prompts/generate/unit-tests.d.ts +139 -0
- package/dist/prompts/generate/unit-tests.d.ts.map +1 -0
- package/dist/prompts/generate/unit-tests.js +578 -0
- package/dist/prompts/generate/unit-tests.js.map +1 -0
- package/dist/prompts/generate/wordpress-plugin.d.ts +179 -0
- package/dist/prompts/generate/wordpress-plugin.d.ts.map +1 -0
- package/dist/prompts/generate/wordpress-plugin.js +763 -0
- package/dist/prompts/generate/wordpress-plugin.js.map +1 -0
- package/dist/prompts/generate/wordpress-theme-from-static.d.ts +177 -0
- package/dist/prompts/generate/wordpress-theme-from-static.d.ts.map +1 -0
- package/dist/prompts/generate/wordpress-theme-from-static.js +695 -0
- package/dist/prompts/generate/wordpress-theme-from-static.js.map +1 -0
- package/dist/prompts/shared/cache-manager.d.ts +45 -0
- package/dist/prompts/shared/cache-manager.d.ts.map +1 -0
- package/dist/prompts/shared/cache-manager.js +129 -0
- package/dist/prompts/shared/cache-manager.js.map +1 -0
- package/dist/prompts/shared/helpers.d.ts +39 -0
- package/dist/prompts/shared/helpers.d.ts.map +1 -0
- package/dist/prompts/shared/helpers.js +151 -0
- package/dist/prompts/shared/helpers.js.map +1 -0
- package/dist/prompts/shared/templates.d.ts +35 -0
- package/dist/prompts/shared/templates.d.ts.map +1 -0
- package/dist/prompts/shared/templates.js +77 -0
- package/dist/prompts/shared/templates.js.map +1 -0
- package/dist/prompts/shared/types.d.ts +112 -0
- package/dist/prompts/shared/types.d.ts.map +1 -0
- package/dist/prompts/shared/types.js +5 -0
- package/dist/prompts/shared/types.js.map +1 -0
- package/dist/prompts/system/find-unused-files.d.ts +106 -0
- package/dist/prompts/system/find-unused-files.d.ts.map +1 -0
- package/dist/prompts/system/find-unused-files.js +353 -0
- package/dist/prompts/system/find-unused-files.js.map +1 -0
- package/dist/security/index.d.ts +39 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +46 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/integration-helpers.d.ts +121 -0
- package/dist/security/integration-helpers.d.ts.map +1 -0
- package/dist/security/integration-helpers.js +190 -0
- package/dist/security/integration-helpers.js.map +1 -0
- package/dist/security/output-encoder.d.ts +94 -0
- package/dist/security/output-encoder.d.ts.map +1 -0
- package/dist/security/output-encoder.js +295 -0
- package/dist/security/output-encoder.js.map +1 -0
- package/dist/security/prompt-injection-guard.d.ts +59 -0
- package/dist/security/prompt-injection-guard.d.ts.map +1 -0
- package/dist/security/prompt-injection-guard.js +249 -0
- package/dist/security/prompt-injection-guard.js.map +1 -0
- package/dist/security/sanitisation.d.ts +67 -0
- package/dist/security/sanitisation.d.ts.map +1 -0
- package/dist/security/sanitisation.js +398 -0
- package/dist/security/sanitisation.js.map +1 -0
- package/dist/security/security-service.d.ts +103 -0
- package/dist/security/security-service.d.ts.map +1 -0
- package/dist/security/security-service.js +303 -0
- package/dist/security/security-service.js.map +1 -0
- package/dist/security-config.d.ts +45 -0
- package/dist/security-config.d.ts.map +1 -0
- package/dist/security-config.js +63 -0
- package/dist/security-config.js.map +1 -0
- package/dist/system/function-list.d.ts +61 -0
- package/dist/system/function-list.d.ts.map +1 -0
- package/dist/system/function-list.js +111 -0
- package/dist/system/function-list.js.map +1 -0
- package/dist/system/function-registry.d.ts +23 -0
- package/dist/system/function-registry.d.ts.map +1 -0
- package/dist/system/function-registry.js +136 -0
- package/dist/system/function-registry.js.map +1 -0
- package/dist/system/health-check.d.ts +33 -0
- package/dist/system/health-check.d.ts.map +1 -0
- package/dist/system/health-check.js +98 -0
- package/dist/system/health-check.js.map +1 -0
- package/dist/system/path-resolver.d.ts +55 -0
- package/dist/system/path-resolver.d.ts.map +1 -0
- package/dist/system/path-resolver.js +90 -0
- package/dist/system/path-resolver.js.map +1 -0
- package/dist/templates/plugin-template.d.ts +121 -0
- package/dist/templates/plugin-template.d.ts.map +1 -0
- package/dist/templates/plugin-template.js +450 -0
- package/dist/templates/plugin-template.js.map +1 -0
- package/dist/types/chunking-types.d.ts +88 -0
- package/dist/types/chunking-types.d.ts.map +1 -0
- package/dist/types/chunking-types.js +18 -0
- package/dist/types/chunking-types.js.map +1 -0
- package/dist/types/prompt-stages.d.ts +42 -0
- package/dist/types/prompt-stages.d.ts.map +1 -0
- package/dist/types/prompt-stages.js +6 -0
- package/dist/types/prompt-stages.js.map +1 -0
- package/dist/types.d.ts +46 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/css-parser.d.ts +26 -0
- package/dist/utils/css-parser.d.ts.map +1 -0
- package/dist/utils/css-parser.js +117 -0
- package/dist/utils/css-parser.js.map +1 -0
- package/dist/utils/path-resolver.d.ts +13 -0
- package/dist/utils/path-resolver.d.ts.map +1 -0
- package/dist/utils/path-resolver.js +78 -0
- package/dist/utils/path-resolver.js.map +1 -0
- package/dist/utils/plugin-utilities.d.ts +171 -0
- package/dist/utils/plugin-utilities.d.ts.map +1 -0
- package/dist/utils/plugin-utilities.js +221 -0
- package/dist/utils/plugin-utilities.js.map +1 -0
- package/dist/utils/streamHandler.d.ts +3 -0
- package/dist/utils/streamHandler.d.ts.map +1 -0
- package/dist/utils/streamHandler.js +137 -0
- package/dist/utils/streamHandler.js.map +1 -0
- package/dist/validation/output-validator.d.ts +136 -0
- package/dist/validation/output-validator.d.ts.map +1 -0
- package/dist/validation/output-validator.js +262 -0
- package/dist/validation/output-validator.js.map +1 -0
- package/dist/validation/response-factory.d.ts +44 -0
- package/dist/validation/response-factory.d.ts.map +1 -0
- package/dist/validation/response-factory.js +202 -0
- package/dist/validation/response-factory.js.map +1 -0
- package/dist/validation/schemas.d.ts +519 -0
- package/dist/validation/schemas.d.ts.map +1 -0
- package/dist/validation/schemas.js +6 -0
- package/dist/validation/schemas.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Template - Modern v4.2 (Single Source of Truth)
|
|
3
|
+
*
|
|
4
|
+
* Universal template that intelligently handles both single-file and multi-file analysis
|
|
5
|
+
* Automatically detects analysis type based on provided parameters
|
|
6
|
+
*
|
|
7
|
+
* Copy this template for creating any new plugin - it adapts to your needs
|
|
8
|
+
*/
|
|
9
|
+
import { BasePlugin } from '../../plugins/base-plugin.js';
|
|
10
|
+
import { ThreeStagePromptManager } from '../../core/ThreeStagePromptManager.js';
|
|
11
|
+
import { withSecurity } from '../../security/integration-helpers.js';
|
|
12
|
+
import { readFileContent } from '../shared/helpers.js';
|
|
13
|
+
import { ModelSetup, ResponseProcessor, ParameterValidator, ErrorHandler, MultiFileAnalysis } from '../../utils/plugin-utilities.js';
|
|
14
|
+
import { getAnalysisCache } from '../../cache/index.js';
|
|
15
|
+
export class N8nWorkflowAnalyzer extends BasePlugin {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.name = 'analyze_n8n_workflow';
|
|
19
|
+
this.category = 'analyze';
|
|
20
|
+
this.description = 'Analyze and optimize n8n workflow JSON for efficiency, error handling, and best practices';
|
|
21
|
+
// Universal parameter set - supports both single and multi-file scenarios
|
|
22
|
+
this.parameters = {
|
|
23
|
+
// Single-file parameters
|
|
24
|
+
code: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'The code to analyze (for single-file analysis)',
|
|
27
|
+
required: false
|
|
28
|
+
},
|
|
29
|
+
filePath: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'Path to single file to analyze',
|
|
32
|
+
required: false
|
|
33
|
+
},
|
|
34
|
+
// Multi-file parameters
|
|
35
|
+
projectPath: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'Path to project root (for multi-file analysis)',
|
|
38
|
+
required: false
|
|
39
|
+
},
|
|
40
|
+
files: {
|
|
41
|
+
type: 'array',
|
|
42
|
+
description: 'Array of specific file paths (for multi-file analysis)',
|
|
43
|
+
required: false,
|
|
44
|
+
items: { type: 'string' }
|
|
45
|
+
},
|
|
46
|
+
maxDepth: {
|
|
47
|
+
type: 'number',
|
|
48
|
+
description: 'Maximum directory depth for multi-file discovery (1-5)',
|
|
49
|
+
required: false,
|
|
50
|
+
default: 3
|
|
51
|
+
},
|
|
52
|
+
// n8n-specific parameters
|
|
53
|
+
workflow: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
description: 'n8n workflow JSON object',
|
|
56
|
+
required: false
|
|
57
|
+
},
|
|
58
|
+
optimizationFocus: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'Primary optimization focus',
|
|
61
|
+
enum: ['performance', 'error-handling', 'maintainability', 'all'],
|
|
62
|
+
default: 'all',
|
|
63
|
+
required: false
|
|
64
|
+
},
|
|
65
|
+
includeCredentialCheck: {
|
|
66
|
+
type: 'boolean',
|
|
67
|
+
description: 'Check for exposed credentials',
|
|
68
|
+
default: true,
|
|
69
|
+
required: false
|
|
70
|
+
},
|
|
71
|
+
suggestAlternativeNodes: {
|
|
72
|
+
type: 'boolean',
|
|
73
|
+
description: 'Suggest alternative node configurations',
|
|
74
|
+
default: true,
|
|
75
|
+
required: false
|
|
76
|
+
},
|
|
77
|
+
// Universal parameters
|
|
78
|
+
language: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
description: 'Programming language',
|
|
81
|
+
required: false,
|
|
82
|
+
default: 'javascript'
|
|
83
|
+
},
|
|
84
|
+
analysisDepth: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
description: 'Level of analysis detail',
|
|
87
|
+
enum: ['basic', 'detailed', 'comprehensive'],
|
|
88
|
+
default: 'detailed',
|
|
89
|
+
required: false
|
|
90
|
+
},
|
|
91
|
+
analysisType: {
|
|
92
|
+
type: 'string',
|
|
93
|
+
description: 'Type of analysis to perform',
|
|
94
|
+
enum: ['workflow', 'security', 'comprehensive'],
|
|
95
|
+
default: 'comprehensive',
|
|
96
|
+
required: false
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
this.analysisCache = getAnalysisCache();
|
|
100
|
+
this.multiFileAnalysis = new MultiFileAnalysis();
|
|
101
|
+
// Cache and analysis utilities are initialized above
|
|
102
|
+
}
|
|
103
|
+
async execute(params, llmClient) {
|
|
104
|
+
return await withSecurity(this, params, llmClient, async (secureParams) => {
|
|
105
|
+
try {
|
|
106
|
+
// 1. Auto-detect analysis mode based on parameters
|
|
107
|
+
const analysisMode = this.detectAnalysisMode(secureParams);
|
|
108
|
+
// 2. Validate parameters based on detected mode
|
|
109
|
+
this.validateParameters(secureParams, analysisMode);
|
|
110
|
+
// 3. Setup model
|
|
111
|
+
const { model, contextLength } = await ModelSetup.getReadyModel(llmClient);
|
|
112
|
+
// 4. Route to appropriate analysis method
|
|
113
|
+
if (analysisMode === 'single-file') {
|
|
114
|
+
return await this.executeSingleFileAnalysis(secureParams, model, contextLength);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
return await this.executeMultiFileAnalysis(secureParams, model, contextLength);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
return ErrorHandler.createExecutionError('analyze_n8n_workflow', error);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Auto-detect whether this is single-file or multi-file analysis
|
|
127
|
+
*/
|
|
128
|
+
detectAnalysisMode(params) {
|
|
129
|
+
// n8n workflow object indicates single-file analysis
|
|
130
|
+
if (params.workflow) {
|
|
131
|
+
return 'single-file';
|
|
132
|
+
}
|
|
133
|
+
// Multi-file indicators
|
|
134
|
+
if (params.projectPath || params.files || params.maxDepth !== undefined) {
|
|
135
|
+
return 'multi-file';
|
|
136
|
+
}
|
|
137
|
+
// Single-file indicators
|
|
138
|
+
if (params.code || params.filePath) {
|
|
139
|
+
return 'single-file';
|
|
140
|
+
}
|
|
141
|
+
// Default to single-file for n8n workflow analysis
|
|
142
|
+
return 'single-file';
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Validate parameters based on detected analysis mode
|
|
146
|
+
*/
|
|
147
|
+
validateParameters(params, mode) {
|
|
148
|
+
if (mode === 'single-file') {
|
|
149
|
+
// For n8n, either workflow object, code, or filePath is required
|
|
150
|
+
if (!params.workflow && !params.code && !params.filePath) {
|
|
151
|
+
throw new Error('Either workflow object, code, or filePath is required for n8n workflow analysis');
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
ParameterValidator.validateProjectPath(params);
|
|
156
|
+
ParameterValidator.validateDepth(params);
|
|
157
|
+
}
|
|
158
|
+
// Universal validations
|
|
159
|
+
ParameterValidator.validateEnum(params, 'analysisType', ['workflow', 'security', 'comprehensive']);
|
|
160
|
+
ParameterValidator.validateEnum(params, 'analysisDepth', ['basic', 'detailed', 'comprehensive']);
|
|
161
|
+
ParameterValidator.validateEnum(params, 'optimizationFocus', ['performance', 'error-handling', 'maintainability', 'all']);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Execute single-file analysis
|
|
165
|
+
*/
|
|
166
|
+
async executeSingleFileAnalysis(params, model, contextLength) {
|
|
167
|
+
// Process workflow input - could be direct workflow object, code string, or file
|
|
168
|
+
let workflowToAnalyze;
|
|
169
|
+
if (params.workflow) {
|
|
170
|
+
workflowToAnalyze = params.workflow;
|
|
171
|
+
}
|
|
172
|
+
else if (params.filePath) {
|
|
173
|
+
const fileContent = await readFileContent(params.filePath);
|
|
174
|
+
try {
|
|
175
|
+
workflowToAnalyze = JSON.parse(fileContent);
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
throw new Error('Failed to parse workflow JSON from file');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
else if (params.code) {
|
|
182
|
+
try {
|
|
183
|
+
workflowToAnalyze = JSON.parse(params.code);
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
throw new Error('Failed to parse workflow JSON from code parameter');
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Generate prompt stages for single workflow
|
|
190
|
+
const promptStages = this.getSingleFilePromptStages({
|
|
191
|
+
...params,
|
|
192
|
+
workflow: workflowToAnalyze
|
|
193
|
+
});
|
|
194
|
+
// Execute with appropriate method
|
|
195
|
+
const promptManager = new ThreeStagePromptManager(contextLength);
|
|
196
|
+
const needsChunking = promptManager.needsChunking(promptStages);
|
|
197
|
+
if (needsChunking) {
|
|
198
|
+
const conversation = promptManager.createChunkedConversation(promptStages);
|
|
199
|
+
const messages = [
|
|
200
|
+
conversation.systemMessage,
|
|
201
|
+
...conversation.dataMessages,
|
|
202
|
+
conversation.analysisMessage
|
|
203
|
+
];
|
|
204
|
+
return await ResponseProcessor.executeChunked(messages, model, contextLength, 'analyze_n8n_workflow', 'single');
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
return await ResponseProcessor.executeDirect(promptStages, model, contextLength, 'analyze_n8n_workflow');
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Execute multi-file analysis
|
|
212
|
+
*/
|
|
213
|
+
async executeMultiFileAnalysis(params, model, contextLength) {
|
|
214
|
+
// Discover files
|
|
215
|
+
let filesToAnalyze = params.files ||
|
|
216
|
+
await this.discoverRelevantFiles(params.projectPath, params.maxDepth, params.analysisType);
|
|
217
|
+
// Perform multi-file analysis with caching
|
|
218
|
+
const analysisResult = await this.performMultiFileAnalysis(filesToAnalyze, params, model, contextLength);
|
|
219
|
+
// Generate prompt stages for multi-file
|
|
220
|
+
const promptStages = this.getMultiFilePromptStages({
|
|
221
|
+
...params,
|
|
222
|
+
analysisResult,
|
|
223
|
+
fileCount: filesToAnalyze.length
|
|
224
|
+
});
|
|
225
|
+
// Always use chunking for multi-file
|
|
226
|
+
const promptManager = new ThreeStagePromptManager(contextLength);
|
|
227
|
+
const conversation = promptManager.createChunkedConversation(promptStages);
|
|
228
|
+
const messages = [
|
|
229
|
+
conversation.systemMessage,
|
|
230
|
+
...conversation.dataMessages,
|
|
231
|
+
conversation.analysisMessage
|
|
232
|
+
];
|
|
233
|
+
return await ResponseProcessor.executeChunked(messages, model, contextLength, 'analyze_n8n_workflow', 'multifile');
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Implement n8n workflow single-file prompt stages
|
|
237
|
+
*/
|
|
238
|
+
getSingleFilePromptStages(params) {
|
|
239
|
+
const { workflow, optimizationFocus, includeCredentialCheck, suggestAlternativeNodes, analysisDepth } = params;
|
|
240
|
+
const systemAndContext = `You are an expert n8n workflow optimization specialist with extensive experience in automation, API integration, and workflow efficiency.
|
|
241
|
+
|
|
242
|
+
Analysis Context:
|
|
243
|
+
- Optimization Focus: ${optimizationFocus}
|
|
244
|
+
- Analysis Depth: ${analysisDepth}
|
|
245
|
+
- Include Credential Check: ${includeCredentialCheck}
|
|
246
|
+
- Suggest Alternative Nodes: ${suggestAlternativeNodes}
|
|
247
|
+
- Mode: Single Workflow Analysis
|
|
248
|
+
|
|
249
|
+
Your expertise covers:
|
|
250
|
+
- n8n node configurations and best practices
|
|
251
|
+
- API optimization and rate limiting strategies
|
|
252
|
+
- Error handling and workflow resilience
|
|
253
|
+
- Performance optimization and parallel processing
|
|
254
|
+
- Security assessment for automation workflows
|
|
255
|
+
- Workflow maintainability and organization
|
|
256
|
+
|
|
257
|
+
Your task is to provide comprehensive analysis and actionable optimization recommendations for this n8n workflow.`;
|
|
258
|
+
const dataPayload = `n8n Workflow to Analyze:
|
|
259
|
+
|
|
260
|
+
\`\`\`json
|
|
261
|
+
${JSON.stringify(workflow, null, 2)}
|
|
262
|
+
\`\`\``;
|
|
263
|
+
const outputInstructions = `Analyze this n8n workflow and provide a comprehensive optimization report in the following structured format:
|
|
264
|
+
|
|
265
|
+
## Workflow Analysis Summary
|
|
266
|
+
- Overall complexity assessment (node count: ${workflow?.nodes?.length || 0})
|
|
267
|
+
- Flow efficiency rating
|
|
268
|
+
- Primary optimization opportunities identified
|
|
269
|
+
|
|
270
|
+
## Detailed Analysis
|
|
271
|
+
|
|
272
|
+
### 1. Efficiency Issues
|
|
273
|
+
- Redundant nodes or operations
|
|
274
|
+
- Duplicate API calls that could be consolidated
|
|
275
|
+
- Unnecessary data transformations
|
|
276
|
+
- Node consolidation opportunities
|
|
277
|
+
|
|
278
|
+
### 2. Error Handling Review
|
|
279
|
+
- Missing error handling (Error Trigger nodes)
|
|
280
|
+
- Proper try-catch pattern implementation
|
|
281
|
+
- Retry configurations and strategies
|
|
282
|
+
- Error notification setup
|
|
283
|
+
|
|
284
|
+
### 3. Performance Optimization
|
|
285
|
+
- Bottlenecks and synchronous operations
|
|
286
|
+
- Parallel processing opportunities
|
|
287
|
+
- API rate limiting considerations
|
|
288
|
+
- Memory usage with large datasets
|
|
289
|
+
|
|
290
|
+
${includeCredentialCheck ? `
|
|
291
|
+
### 4. Security Assessment
|
|
292
|
+
- Exposed credentials or API keys in node configurations
|
|
293
|
+
- Sensitive data in logs or outputs
|
|
294
|
+
- Webhook authentication security
|
|
295
|
+
- Input sanitization validation
|
|
296
|
+
` : ''}
|
|
297
|
+
|
|
298
|
+
### 5. Maintainability Improvements
|
|
299
|
+
- Node naming conventions and clarity
|
|
300
|
+
- Workflow organization and logical grouping
|
|
301
|
+
- Sub-workflow opportunities for reusability
|
|
302
|
+
- Documentation completeness
|
|
303
|
+
|
|
304
|
+
${suggestAlternativeNodes ? `
|
|
305
|
+
### 6. Alternative Node Suggestions
|
|
306
|
+
- More efficient node alternatives for current setup
|
|
307
|
+
- Built-in vs custom code node recommendations
|
|
308
|
+
- Community node suggestions for better functionality
|
|
309
|
+
- Simpler implementation approaches
|
|
310
|
+
` : ''}
|
|
311
|
+
|
|
312
|
+
## Implementation Recommendations
|
|
313
|
+
1. **Priority Changes** (high impact, low effort first)
|
|
314
|
+
2. **Performance Improvements** with expected metrics
|
|
315
|
+
3. **Step-by-step Implementation Guide**
|
|
316
|
+
4. **Risk Assessment** for proposed changes
|
|
317
|
+
|
|
318
|
+
## Optimized Workflow Structure
|
|
319
|
+
Provide specific suggestions for structural improvements to the workflow design.
|
|
320
|
+
|
|
321
|
+
${this.getOptimizationFocusInstructions(optimizationFocus)}
|
|
322
|
+
|
|
323
|
+
**Important**: Reference specific node names and IDs from the workflow. Provide actionable recommendations with clear business impact and implementation steps.`;
|
|
324
|
+
return { systemAndContext, dataPayload, outputInstructions };
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Implement multi-file n8n workflow analysis (for multiple workflow files)
|
|
328
|
+
*/
|
|
329
|
+
getMultiFilePromptStages(params) {
|
|
330
|
+
const { analysisResult, analysisType, analysisDepth, fileCount, optimizationFocus } = params;
|
|
331
|
+
const systemAndContext = `You are an expert n8n workflow architect specializing in ${analysisDepth} ${analysisType} analysis across multiple workflows.
|
|
332
|
+
|
|
333
|
+
Analysis Context:
|
|
334
|
+
- Analysis Type: ${analysisType}
|
|
335
|
+
- Analysis Depth: ${analysisDepth}
|
|
336
|
+
- Workflows Analyzed: ${fileCount}
|
|
337
|
+
- Optimization Focus: ${optimizationFocus}
|
|
338
|
+
- Mode: Multi-Workflow Analysis
|
|
339
|
+
|
|
340
|
+
Your task is to provide comprehensive cross-workflow insights, identify shared patterns, and suggest architectural improvements across the entire n8n workflow collection.`;
|
|
341
|
+
const dataPayload = `Multi-workflow analysis results:
|
|
342
|
+
|
|
343
|
+
${JSON.stringify(analysisResult, null, 2)}`;
|
|
344
|
+
const outputInstructions = `Provide comprehensive multi-workflow analysis in the following structured format:
|
|
345
|
+
|
|
346
|
+
## Multi-Workflow Summary
|
|
347
|
+
Overall analysis of ${fileCount} n8n workflows with architectural recommendations
|
|
348
|
+
|
|
349
|
+
## Cross-Workflow Findings
|
|
350
|
+
### Shared Patterns & Duplications
|
|
351
|
+
- Common node configurations that could be standardized
|
|
352
|
+
- Duplicate API calls across workflows
|
|
353
|
+
- Shared data processing patterns
|
|
354
|
+
- Common error handling approaches
|
|
355
|
+
|
|
356
|
+
### Integration Opportunities
|
|
357
|
+
- Workflows that could be combined or share sub-workflows
|
|
358
|
+
- Common triggers or data sources
|
|
359
|
+
- Shared credential management opportunities
|
|
360
|
+
- Cross-workflow dependencies and data flow
|
|
361
|
+
|
|
362
|
+
### Architectural Improvements
|
|
363
|
+
- Workflow organization and naming conventions
|
|
364
|
+
- Sub-workflow extraction opportunities
|
|
365
|
+
- Shared utility workflow recommendations
|
|
366
|
+
- Common variable and environment management
|
|
367
|
+
|
|
368
|
+
## Performance & Efficiency Analysis
|
|
369
|
+
- Resource usage across workflows
|
|
370
|
+
- Bottlenecks affecting multiple workflows
|
|
371
|
+
- Optimization opportunities with compound benefits
|
|
372
|
+
- Scaling considerations for the workflow collection
|
|
373
|
+
|
|
374
|
+
## Recommendations
|
|
375
|
+
### Immediate Actions
|
|
376
|
+
1. High-impact standardizations
|
|
377
|
+
2. Duplicate elimination priorities
|
|
378
|
+
3. Quick performance wins
|
|
379
|
+
|
|
380
|
+
### Strategic Improvements
|
|
381
|
+
1. Architectural restructuring suggestions
|
|
382
|
+
2. Long-term maintainability enhancements
|
|
383
|
+
3. Scalability preparations
|
|
384
|
+
|
|
385
|
+
### Implementation Roadmap
|
|
386
|
+
Step-by-step approach for optimizing the entire workflow ecosystem
|
|
387
|
+
|
|
388
|
+
Focus on ${optimizationFocus} aspects and provide specific, actionable recommendations for managing multiple n8n workflows effectively.`;
|
|
389
|
+
return { systemAndContext, dataPayload, outputInstructions };
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Get focus-specific additional instructions
|
|
393
|
+
*/
|
|
394
|
+
getOptimizationFocusInstructions(focus) {
|
|
395
|
+
const instructions = {
|
|
396
|
+
'performance': `
|
|
397
|
+
**Performance Focus Instructions:**
|
|
398
|
+
- Prioritize execution speed improvements and resource optimization
|
|
399
|
+
- Identify memory usage patterns and optimization opportunities
|
|
400
|
+
- Focus heavily on API call efficiency and caching strategies
|
|
401
|
+
- Suggest parallel processing configurations where beneficial
|
|
402
|
+
- Provide specific performance metrics estimates and benchmarks`,
|
|
403
|
+
'error-handling': `
|
|
404
|
+
**Error Handling Focus Instructions:**
|
|
405
|
+
- Examine every potential failure point in the workflow
|
|
406
|
+
- Recommend comprehensive error recovery and resilience strategies
|
|
407
|
+
- Suggest proper retry logic configurations with exponential backoff
|
|
408
|
+
- Focus extensively on workflow reliability and fault tolerance
|
|
409
|
+
- Include detailed alerting, monitoring, and notification recommendations`,
|
|
410
|
+
'maintainability': `
|
|
411
|
+
**Maintainability Focus Instructions:**
|
|
412
|
+
- Assess workflow complexity and readability thoroughly
|
|
413
|
+
- Review workflow organization, structure, and documentation
|
|
414
|
+
- Focus on long-term maintenance and team collaboration aspects
|
|
415
|
+
- Suggest modularization and reusability opportunities
|
|
416
|
+
- Consider upgrade paths and version management implications`,
|
|
417
|
+
'all': `
|
|
418
|
+
**Comprehensive Analysis Instructions:**
|
|
419
|
+
- Balance all aspects: performance, reliability, maintainability, and security
|
|
420
|
+
- Prioritize recommendations by impact, implementation effort, and business value
|
|
421
|
+
- Consider scalability, future requirements, and growth scenarios
|
|
422
|
+
- Provide holistic optimization strategy with clear implementation phases`
|
|
423
|
+
};
|
|
424
|
+
return instructions[focus] || instructions.all;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Implement for backwards compatibility
|
|
428
|
+
* The system still expects this method, so we intelligently route to the appropriate stages
|
|
429
|
+
*/
|
|
430
|
+
getPromptStages(params) {
|
|
431
|
+
const mode = this.detectAnalysisMode(params);
|
|
432
|
+
if (mode === 'single-file') {
|
|
433
|
+
return this.getSingleFilePromptStages(params);
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
return this.getMultiFilePromptStages(params);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
// Multi-file helper methods
|
|
440
|
+
async discoverRelevantFiles(projectPath, maxDepth, analysisType) {
|
|
441
|
+
const extensions = this.getFileExtensions(analysisType);
|
|
442
|
+
return await this.multiFileAnalysis.discoverFiles(projectPath, extensions, maxDepth);
|
|
443
|
+
}
|
|
444
|
+
async performMultiFileAnalysis(files, params, model, contextLength) {
|
|
445
|
+
const cacheKey = this.analysisCache.generateKey('analyze_n8n_workflow', params, files);
|
|
446
|
+
const cached = await this.analysisCache.get(cacheKey);
|
|
447
|
+
if (cached)
|
|
448
|
+
return cached;
|
|
449
|
+
const fileAnalysisResults = await this.multiFileAnalysis.analyzeBatch(files, (file) => this.analyzeIndividualFile(file, params, model), contextLength);
|
|
450
|
+
// Aggregate results into n8n-specific analysis format
|
|
451
|
+
const aggregatedResult = {
|
|
452
|
+
summary: `n8n workflow analysis of ${files.length} workflow files`,
|
|
453
|
+
findings: fileAnalysisResults,
|
|
454
|
+
data: {
|
|
455
|
+
workflowCount: files.length,
|
|
456
|
+
totalNodes: fileAnalysisResults.reduce((sum, result) => sum + (result.nodeCount || 0), 0),
|
|
457
|
+
commonPatterns: this.identifyCommonPatterns(fileAnalysisResults),
|
|
458
|
+
sharedTriggers: this.identifySharedTriggers(fileAnalysisResults)
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
await this.analysisCache.cacheAnalysis(cacheKey, aggregatedResult, {
|
|
462
|
+
modelUsed: model.identifier || 'unknown',
|
|
463
|
+
executionTime: Date.now() - Date.now(), // TODO: Track actual execution time
|
|
464
|
+
timestamp: new Date().toISOString()
|
|
465
|
+
});
|
|
466
|
+
return aggregatedResult;
|
|
467
|
+
}
|
|
468
|
+
async analyzeIndividualFile(file, params, model) {
|
|
469
|
+
const content = await import('fs/promises').then(fs => fs.readFile(file, 'utf-8'));
|
|
470
|
+
try {
|
|
471
|
+
const workflow = JSON.parse(content);
|
|
472
|
+
return {
|
|
473
|
+
filePath: file,
|
|
474
|
+
size: content.length,
|
|
475
|
+
nodeCount: workflow.nodes?.length || 0,
|
|
476
|
+
connections: workflow.connections ? Object.keys(workflow.connections).length : 0,
|
|
477
|
+
triggers: workflow.nodes?.filter((node) => node.type?.includes('trigger')) || [],
|
|
478
|
+
hasCredentials: workflow.nodes?.some((node) => node.credentials) || false
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
catch (error) {
|
|
482
|
+
return {
|
|
483
|
+
filePath: file,
|
|
484
|
+
size: content.length,
|
|
485
|
+
error: 'Invalid JSON workflow file'
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
getFileExtensions(analysisType) {
|
|
490
|
+
const extensionMap = {
|
|
491
|
+
'workflow': ['.json'], // n8n workflows are JSON files
|
|
492
|
+
'security': ['.json'], // Same for security analysis
|
|
493
|
+
'comprehensive': ['.json'] // Comprehensive analysis of JSON workflows
|
|
494
|
+
};
|
|
495
|
+
return extensionMap[analysisType] || extensionMap.comprehensive;
|
|
496
|
+
}
|
|
497
|
+
identifyCommonPatterns(results) {
|
|
498
|
+
// Analyze common node patterns across workflows
|
|
499
|
+
const nodeTypes = {};
|
|
500
|
+
results.forEach(result => {
|
|
501
|
+
if (result.triggers) {
|
|
502
|
+
result.triggers.forEach((trigger) => {
|
|
503
|
+
nodeTypes[trigger.type] = (nodeTypes[trigger.type] || 0) + 1;
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
return Object.entries(nodeTypes)
|
|
508
|
+
.filter(([_, count]) => count > 1)
|
|
509
|
+
.map(([type, count]) => `${type} (used in ${count} workflows)`);
|
|
510
|
+
}
|
|
511
|
+
identifySharedTriggers(results) {
|
|
512
|
+
const triggers = new Set();
|
|
513
|
+
results.forEach(result => {
|
|
514
|
+
if (result.triggers) {
|
|
515
|
+
result.triggers.forEach((trigger) => {
|
|
516
|
+
triggers.add(trigger.type);
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
return Array.from(triggers);
|
|
521
|
+
}
|
|
522
|
+
generateCacheKey(files, params) {
|
|
523
|
+
const fileHash = files.join('|');
|
|
524
|
+
const paramHash = JSON.stringify(params);
|
|
525
|
+
return `${fileHash}_${paramHash}`.substring(0, 64);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
export default N8nWorkflowAnalyzer;
|
|
529
|
+
//# sourceMappingURL=n8n-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n8n-workflow.js","sourceRoot":"","sources":["../../../src/prompts/analyze/n8n-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAA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IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,aAAa,KAAK,aAAa,CAAC,CAAC;IACpE,CAAC;IAEO,sBAAsB,CAAC,OAAc;QAC3C,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;QAEnC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACvB,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACpB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAY,EAAE,EAAE;oBACvC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC7B,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAEO,gBAAgB,CAAC,KAAe,EAAE,MAAW;QACnD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,GAAG,QAAQ,IAAI,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC;CACF;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Template - Modern v4.2 (Single Source of Truth)
|
|
3
|
+
*
|
|
4
|
+
* Universal template that intelligently handles both single-file and multi-file analysis
|
|
5
|
+
* Automatically detects analysis type based on provided parameters
|
|
6
|
+
*
|
|
7
|
+
* Copy this template for creating any new plugin - it adapts to your needs
|
|
8
|
+
*/
|
|
9
|
+
import { BasePlugin } from '../../plugins/base-plugin.js';
|
|
10
|
+
import { IPromptPlugin } from '../shared/types.js';
|
|
11
|
+
import { PromptStages } from '../../types/prompt-stages.js';
|
|
12
|
+
export declare class ProjectStructureAnalyzer extends BasePlugin implements IPromptPlugin {
|
|
13
|
+
name: string;
|
|
14
|
+
category: "analyze";
|
|
15
|
+
description: string;
|
|
16
|
+
parameters: {
|
|
17
|
+
code: {
|
|
18
|
+
type: "string";
|
|
19
|
+
description: string;
|
|
20
|
+
required: boolean;
|
|
21
|
+
};
|
|
22
|
+
filePath: {
|
|
23
|
+
type: "string";
|
|
24
|
+
description: string;
|
|
25
|
+
required: boolean;
|
|
26
|
+
};
|
|
27
|
+
projectPath: {
|
|
28
|
+
type: "string";
|
|
29
|
+
description: string;
|
|
30
|
+
required: boolean;
|
|
31
|
+
};
|
|
32
|
+
files: {
|
|
33
|
+
type: "array";
|
|
34
|
+
description: string;
|
|
35
|
+
required: boolean;
|
|
36
|
+
items: {
|
|
37
|
+
type: "string";
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
maxDepth: {
|
|
41
|
+
type: "number";
|
|
42
|
+
description: string;
|
|
43
|
+
required: boolean;
|
|
44
|
+
default: number;
|
|
45
|
+
};
|
|
46
|
+
language: {
|
|
47
|
+
type: "string";
|
|
48
|
+
description: string;
|
|
49
|
+
required: boolean;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
analysisDepth: {
|
|
53
|
+
type: "string";
|
|
54
|
+
description: string;
|
|
55
|
+
enum: string[];
|
|
56
|
+
default: string;
|
|
57
|
+
required: boolean;
|
|
58
|
+
};
|
|
59
|
+
analysisType: {
|
|
60
|
+
type: "string";
|
|
61
|
+
description: string;
|
|
62
|
+
enum: string[];
|
|
63
|
+
default: string;
|
|
64
|
+
required: boolean;
|
|
65
|
+
};
|
|
66
|
+
focusAreas: {
|
|
67
|
+
type: "array";
|
|
68
|
+
description: string;
|
|
69
|
+
required: boolean;
|
|
70
|
+
default: any[];
|
|
71
|
+
items: {
|
|
72
|
+
type: "string";
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
private analysisCache;
|
|
77
|
+
private multiFileAnalysis;
|
|
78
|
+
constructor();
|
|
79
|
+
execute(params: any, llmClient: any): Promise<any>;
|
|
80
|
+
/**
|
|
81
|
+
* Auto-detect whether this is single-file or multi-file analysis
|
|
82
|
+
*/
|
|
83
|
+
private detectAnalysisMode;
|
|
84
|
+
/**
|
|
85
|
+
* Validate parameters based on detected analysis mode
|
|
86
|
+
*/
|
|
87
|
+
private validateParameters;
|
|
88
|
+
/**
|
|
89
|
+
* Execute single-file analysis
|
|
90
|
+
*/
|
|
91
|
+
private executeSingleFileAnalysis;
|
|
92
|
+
/**
|
|
93
|
+
* Execute multi-file analysis
|
|
94
|
+
*/
|
|
95
|
+
private executeMultiFileAnalysis;
|
|
96
|
+
/**
|
|
97
|
+
* Single-file structure analysis - focuses on file's role in larger architecture
|
|
98
|
+
*/
|
|
99
|
+
private getSingleFilePromptStages;
|
|
100
|
+
/**
|
|
101
|
+
* Multi-file project structure analysis - comprehensive architectural overview
|
|
102
|
+
*/
|
|
103
|
+
private getMultiFilePromptStages;
|
|
104
|
+
/**
|
|
105
|
+
* Backwards compatibility method
|
|
106
|
+
*/
|
|
107
|
+
getPromptStages(params: any): PromptStages;
|
|
108
|
+
private discoverRelevantFiles;
|
|
109
|
+
private performMultiFileAnalysis;
|
|
110
|
+
private analyzeIndividualFile;
|
|
111
|
+
private getFileExtensions;
|
|
112
|
+
private analyzeFileTypes;
|
|
113
|
+
private analyzeDirectoryStructure;
|
|
114
|
+
private calculateComplexityMetrics;
|
|
115
|
+
private identifyOrganizationPatterns;
|
|
116
|
+
private analyzeDependencyStructure;
|
|
117
|
+
private isConfigFile;
|
|
118
|
+
private isTestFile;
|
|
119
|
+
private countFunctions;
|
|
120
|
+
private countImports;
|
|
121
|
+
private countExports;
|
|
122
|
+
private calculateVariance;
|
|
123
|
+
private generateCacheKey;
|
|
124
|
+
}
|
|
125
|
+
export default ProjectStructureAnalyzer;
|
|
126
|
+
//# sourceMappingURL=project-structure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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