@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,116 @@
|
|
|
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 WordPressPluginAuditor extends BasePlugin implements IPromptPlugin {
|
|
13
|
+
name: string;
|
|
14
|
+
category: "analyze";
|
|
15
|
+
description: string;
|
|
16
|
+
parameters: {
|
|
17
|
+
projectPath: {
|
|
18
|
+
type: "string";
|
|
19
|
+
description: string;
|
|
20
|
+
required: boolean;
|
|
21
|
+
};
|
|
22
|
+
auditDepth: {
|
|
23
|
+
type: "string";
|
|
24
|
+
description: string;
|
|
25
|
+
enum: string[];
|
|
26
|
+
default: string;
|
|
27
|
+
required: boolean;
|
|
28
|
+
};
|
|
29
|
+
auditType: {
|
|
30
|
+
type: "string";
|
|
31
|
+
description: string;
|
|
32
|
+
enum: string[];
|
|
33
|
+
default: string;
|
|
34
|
+
required: boolean;
|
|
35
|
+
};
|
|
36
|
+
includeSteps: {
|
|
37
|
+
type: "array";
|
|
38
|
+
description: string;
|
|
39
|
+
required: boolean;
|
|
40
|
+
items: {
|
|
41
|
+
type: "string";
|
|
42
|
+
};
|
|
43
|
+
default: string[];
|
|
44
|
+
};
|
|
45
|
+
maxDepth: {
|
|
46
|
+
type: "number";
|
|
47
|
+
description: string;
|
|
48
|
+
required: boolean;
|
|
49
|
+
default: number;
|
|
50
|
+
};
|
|
51
|
+
wpVersion: {
|
|
52
|
+
type: "string";
|
|
53
|
+
description: string;
|
|
54
|
+
required: boolean;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
phpVersion: {
|
|
58
|
+
type: "string";
|
|
59
|
+
description: string;
|
|
60
|
+
required: boolean;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
private analysisCache;
|
|
65
|
+
private multiFileAnalysis;
|
|
66
|
+
private chainedResults;
|
|
67
|
+
constructor();
|
|
68
|
+
execute(params: any, llmClient: any): Promise<any>;
|
|
69
|
+
/**
|
|
70
|
+
* Validate WordPress plugin structure
|
|
71
|
+
*/
|
|
72
|
+
private validateWordPressPlugin;
|
|
73
|
+
/**
|
|
74
|
+
* Execute the chained analysis workflow
|
|
75
|
+
*/
|
|
76
|
+
private executeChainedAnalysis;
|
|
77
|
+
/**
|
|
78
|
+
* Run individual analysis step by calling other MCP functions
|
|
79
|
+
*/
|
|
80
|
+
private runAnalysisStep;
|
|
81
|
+
/**
|
|
82
|
+
* Synthesize all audit results into comprehensive report
|
|
83
|
+
*/
|
|
84
|
+
private synthesizeAuditResults;
|
|
85
|
+
/**
|
|
86
|
+
* Single-file mode not applicable for plugin audit
|
|
87
|
+
*/
|
|
88
|
+
private getSingleFilePromptStages;
|
|
89
|
+
/**
|
|
90
|
+
* Multi-file prompt stages for comprehensive audit synthesis
|
|
91
|
+
*/
|
|
92
|
+
private getMultiFilePromptStages;
|
|
93
|
+
/**
|
|
94
|
+
* Backwards compatibility method
|
|
95
|
+
*/
|
|
96
|
+
getPromptStages(params: any): PromptStages;
|
|
97
|
+
/**
|
|
98
|
+
* Not used in plugin audit workflow
|
|
99
|
+
*/
|
|
100
|
+
private discoverRelevantFiles;
|
|
101
|
+
/**
|
|
102
|
+
* Not used in chained analysis workflow
|
|
103
|
+
*/
|
|
104
|
+
private performMultiFileAnalysis;
|
|
105
|
+
/**
|
|
106
|
+
* Not used in chained analysis workflow
|
|
107
|
+
*/
|
|
108
|
+
private analyzeIndividualFile;
|
|
109
|
+
/**
|
|
110
|
+
* WordPress plugin file extensions
|
|
111
|
+
*/
|
|
112
|
+
private getFileExtensions;
|
|
113
|
+
private generateCacheKey;
|
|
114
|
+
}
|
|
115
|
+
export default WordPressPluginAuditor;
|
|
116
|
+
//# sourceMappingURL=wordpress-plugin-audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wordpress-plugin-audit.d.ts","sourceRoot":"","sources":["../../../src/prompts/analyze/wordpress-plugin-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAgB5D,qBAAa,sBAAuB,SAAQ,UAAW,YAAW,aAAa;IAC7E,IAAI,SAA4B;IAChC,QAAQ,EAAG,SAAS,CAAU;IAC9B,WAAW,SAAqI;IAGhJ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqDR;IAEF,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,iBAAiB,CAA2B;IACpD,OAAO,CAAC,cAAc,CAA+B;;IAO/C,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IAkBzC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAO/B;;OAEG;YACW,sBAAsB;IAoFpC;;OAEG;YACW,eAAe;IA4D7B;;OAEG;YACW,sBAAsB;IA0BpC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAiBjC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAmJhC;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,GAAG,GAAG,YAAY;IAI1C;;OAEG;YACW,qBAAqB;IAKnC;;OAEG;YACW,wBAAwB;IAItC;;OAEG;YACW,qBAAqB;IAInC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,gBAAgB;CAKzB;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,454 @@
|
|
|
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 { ModelSetup, ResponseProcessor, ParameterValidator, ErrorHandler, MultiFileAnalysis } from '../../utils/plugin-utilities.js';
|
|
13
|
+
import { getAnalysisCache } from '../../cache/index.js';
|
|
14
|
+
export class WordPressPluginAuditor extends BasePlugin {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.name = 'audit_wordpress_plugin';
|
|
18
|
+
this.category = 'analyze';
|
|
19
|
+
this.description = 'Comprehensive WordPress plugin audit - chains multiple analysis steps for security, performance, dependencies, and code quality';
|
|
20
|
+
// Universal parameter set - supports both single and multi-file scenarios
|
|
21
|
+
this.parameters = {
|
|
22
|
+
// Multi-file parameters (primary mode for plugin audit)
|
|
23
|
+
projectPath: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'Path to WordPress plugin root directory',
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
// Analysis configuration
|
|
29
|
+
auditDepth: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'Depth of audit analysis',
|
|
32
|
+
enum: ['basic', 'detailed', 'comprehensive'],
|
|
33
|
+
default: 'comprehensive',
|
|
34
|
+
required: false
|
|
35
|
+
},
|
|
36
|
+
auditType: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'Type of audit focus',
|
|
39
|
+
enum: ['security', 'performance', 'quality', 'full-audit'],
|
|
40
|
+
default: 'full-audit',
|
|
41
|
+
required: false
|
|
42
|
+
},
|
|
43
|
+
// Analysis step configuration
|
|
44
|
+
includeSteps: {
|
|
45
|
+
type: 'array',
|
|
46
|
+
description: 'Analysis steps to include in audit',
|
|
47
|
+
required: false,
|
|
48
|
+
items: { type: 'string' },
|
|
49
|
+
default: ['structure', 'dependencies', 'security', 'database', 'quality']
|
|
50
|
+
},
|
|
51
|
+
maxDepth: {
|
|
52
|
+
type: 'number',
|
|
53
|
+
description: 'Maximum directory depth for analysis (1-5)',
|
|
54
|
+
required: false,
|
|
55
|
+
default: 4
|
|
56
|
+
},
|
|
57
|
+
// WordPress-specific context
|
|
58
|
+
wpVersion: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'Target WordPress version for compatibility checks',
|
|
61
|
+
required: false,
|
|
62
|
+
default: '6.4'
|
|
63
|
+
},
|
|
64
|
+
phpVersion: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
description: 'Target PHP version for compatibility checks',
|
|
67
|
+
required: false,
|
|
68
|
+
default: '8.0'
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
this.analysisCache = getAnalysisCache();
|
|
72
|
+
this.multiFileAnalysis = new MultiFileAnalysis();
|
|
73
|
+
this.chainedResults = new Map();
|
|
74
|
+
// Cache and analysis utilities are initialized above
|
|
75
|
+
}
|
|
76
|
+
async execute(params, llmClient) {
|
|
77
|
+
return await withSecurity(this, params, llmClient, async (secureParams) => {
|
|
78
|
+
try {
|
|
79
|
+
// 1. Validate WordPress plugin structure
|
|
80
|
+
this.validateWordPressPlugin(secureParams);
|
|
81
|
+
// 2. Setup model
|
|
82
|
+
const { model, contextLength } = await ModelSetup.getReadyModel(llmClient);
|
|
83
|
+
// 3. Execute chained analysis workflow
|
|
84
|
+
return await this.executeChainedAnalysis(secureParams, llmClient, model, contextLength);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
return ErrorHandler.createExecutionError('audit_wordpress_plugin', error);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Validate WordPress plugin structure
|
|
93
|
+
*/
|
|
94
|
+
validateWordPressPlugin(params) {
|
|
95
|
+
ParameterValidator.validateProjectPath(params);
|
|
96
|
+
ParameterValidator.validateDepth(params);
|
|
97
|
+
ParameterValidator.validateEnum(params, 'auditType', ['security', 'performance', 'quality', 'full-audit']);
|
|
98
|
+
ParameterValidator.validateEnum(params, 'auditDepth', ['basic', 'detailed', 'comprehensive']);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Execute the chained analysis workflow
|
|
102
|
+
*/
|
|
103
|
+
async executeChainedAnalysis(params, llmClient, model, contextLength) {
|
|
104
|
+
const auditSteps = params.includeSteps || ['structure', 'dependencies', 'security', 'database', 'quality'];
|
|
105
|
+
const results = {};
|
|
106
|
+
const stepExecutionLog = [];
|
|
107
|
+
try {
|
|
108
|
+
stepExecutionLog.push(`Starting WordPress plugin audit with ${auditSteps.length} steps`);
|
|
109
|
+
// Step 1: Project Structure Overview
|
|
110
|
+
if (auditSteps.includes('structure')) {
|
|
111
|
+
stepExecutionLog.push('Executing: Project structure analysis');
|
|
112
|
+
results.structure = await this.runAnalysisStep('count_files', {
|
|
113
|
+
projectPath: params.projectPath,
|
|
114
|
+
analysisType: 'comprehensive',
|
|
115
|
+
maxDepth: params.maxDepth
|
|
116
|
+
}, llmClient);
|
|
117
|
+
stepExecutionLog.push(`Structure analysis: ${results.structure.success ? 'SUCCESS' : 'FAILED'}`);
|
|
118
|
+
}
|
|
119
|
+
// Step 2: Dependencies Analysis
|
|
120
|
+
if (auditSteps.includes('dependencies')) {
|
|
121
|
+
stepExecutionLog.push('Executing: Dependencies analysis');
|
|
122
|
+
results.dependencies = await this.runAnalysisStep('analyze_dependencies', {
|
|
123
|
+
projectPath: params.projectPath,
|
|
124
|
+
analysisType: 'comprehensive',
|
|
125
|
+
includePackageJson: true,
|
|
126
|
+
checkDevDependencies: false
|
|
127
|
+
}, llmClient);
|
|
128
|
+
stepExecutionLog.push(`Dependencies analysis: ${results.dependencies.success ? 'SUCCESS' : 'FAILED'}`);
|
|
129
|
+
}
|
|
130
|
+
// Step 3: WordPress Security Audit
|
|
131
|
+
if (auditSteps.includes('security')) {
|
|
132
|
+
stepExecutionLog.push('Executing: WordPress security analysis');
|
|
133
|
+
results.security = await this.runAnalysisStep('analyze_wordpress_security', {
|
|
134
|
+
projectPath: params.projectPath,
|
|
135
|
+
wpType: 'plugin',
|
|
136
|
+
wpVersion: params.wpVersion,
|
|
137
|
+
analysisType: 'comprehensive',
|
|
138
|
+
includeOwaspTop10: true
|
|
139
|
+
}, llmClient);
|
|
140
|
+
stepExecutionLog.push(`Security analysis: ${results.security.success ? 'SUCCESS' : 'FAILED'}`);
|
|
141
|
+
}
|
|
142
|
+
// Step 4: Database Query Analysis
|
|
143
|
+
if (auditSteps.includes('database')) {
|
|
144
|
+
stepExecutionLog.push('Executing: Database query analysis');
|
|
145
|
+
results.database = await this.runAnalysisStep('analyze_database_queries', {
|
|
146
|
+
projectPath: params.projectPath,
|
|
147
|
+
analysisType: 'comprehensive',
|
|
148
|
+
context: { projectType: 'wordpress-plugin' }
|
|
149
|
+
}, llmClient);
|
|
150
|
+
stepExecutionLog.push(`Database analysis: ${results.database.success ? 'SUCCESS' : 'FAILED'}`);
|
|
151
|
+
}
|
|
152
|
+
// Step 5: Code Quality Assessment
|
|
153
|
+
if (auditSteps.includes('quality')) {
|
|
154
|
+
stepExecutionLog.push('Executing: Code quality analysis');
|
|
155
|
+
results.quality = await this.runAnalysisStep('analyze_code_quality', {
|
|
156
|
+
projectPath: params.projectPath,
|
|
157
|
+
analysisType: 'comprehensive',
|
|
158
|
+
language: 'php'
|
|
159
|
+
}, llmClient);
|
|
160
|
+
stepExecutionLog.push(`Quality analysis: ${results.quality.success ? 'SUCCESS' : 'FAILED'}`);
|
|
161
|
+
}
|
|
162
|
+
// Step 6: Synthesize all results
|
|
163
|
+
stepExecutionLog.push('Synthesizing comprehensive audit report');
|
|
164
|
+
const synthesizedResults = await this.synthesizeAuditResults({
|
|
165
|
+
...results,
|
|
166
|
+
executionLog: stepExecutionLog,
|
|
167
|
+
completedSteps: auditSteps.filter(step => results[step]?.success),
|
|
168
|
+
failedSteps: auditSteps.filter(step => results[step]?.success === false)
|
|
169
|
+
}, params, model, contextLength);
|
|
170
|
+
stepExecutionLog.push('Audit synthesis: COMPLETED');
|
|
171
|
+
return synthesizedResults;
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
stepExecutionLog.push(`Audit failed: ${error.message}`);
|
|
175
|
+
return ErrorHandler.createExecutionError('audit_wordpress_plugin', error);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Run individual analysis step by calling other MCP functions
|
|
180
|
+
*/
|
|
181
|
+
async runAnalysisStep(functionName, stepParams, llmClient) {
|
|
182
|
+
try {
|
|
183
|
+
// Check cache first
|
|
184
|
+
const cacheKey = this.analysisCache.generateKey(functionName, stepParams, []);
|
|
185
|
+
const cached = await this.analysisCache.get(cacheKey);
|
|
186
|
+
if (cached)
|
|
187
|
+
return cached;
|
|
188
|
+
// Import the plugin loader to call other MCP functions
|
|
189
|
+
const { PluginRegistry } = await import('../../plugins/index.js');
|
|
190
|
+
const pluginLoader = PluginRegistry.getInstance();
|
|
191
|
+
// Execute the specific analysis function
|
|
192
|
+
let result;
|
|
193
|
+
try {
|
|
194
|
+
result = await pluginLoader.executePlugin(functionName, stepParams, llmClient);
|
|
195
|
+
// Wrap successful results
|
|
196
|
+
const wrappedResult = {
|
|
197
|
+
stepName: functionName,
|
|
198
|
+
parameters: stepParams,
|
|
199
|
+
status: 'completed',
|
|
200
|
+
timestamp: new Date().toISOString(),
|
|
201
|
+
data: result.data || result,
|
|
202
|
+
summary: `Completed ${functionName} analysis`,
|
|
203
|
+
success: true
|
|
204
|
+
};
|
|
205
|
+
// Cache the result
|
|
206
|
+
await this.analysisCache.cacheAnalysis(cacheKey, wrappedResult, {
|
|
207
|
+
modelUsed: result.modelUsed || 'unknown',
|
|
208
|
+
executionTime: result.executionTimeMs || 0,
|
|
209
|
+
timestamp: new Date().toISOString()
|
|
210
|
+
});
|
|
211
|
+
return wrappedResult;
|
|
212
|
+
}
|
|
213
|
+
catch (pluginError) {
|
|
214
|
+
// If the plugin doesn't exist or fails, return error result
|
|
215
|
+
const errorResult = {
|
|
216
|
+
stepName: functionName,
|
|
217
|
+
status: 'failed',
|
|
218
|
+
error: pluginError.message,
|
|
219
|
+
timestamp: new Date().toISOString(),
|
|
220
|
+
success: false
|
|
221
|
+
};
|
|
222
|
+
return errorResult;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
return {
|
|
227
|
+
stepName: functionName,
|
|
228
|
+
status: 'system-error',
|
|
229
|
+
error: error.message,
|
|
230
|
+
timestamp: new Date().toISOString(),
|
|
231
|
+
success: false
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Synthesize all audit results into comprehensive report
|
|
237
|
+
*/
|
|
238
|
+
async synthesizeAuditResults(results, params, model, contextLength) {
|
|
239
|
+
// Generate final synthesis prompt stages
|
|
240
|
+
const promptStages = this.getMultiFilePromptStages({
|
|
241
|
+
...params,
|
|
242
|
+
analysisResult: results,
|
|
243
|
+
stepCount: Object.keys(results).length
|
|
244
|
+
});
|
|
245
|
+
// Always use chunking for comprehensive synthesis
|
|
246
|
+
const promptManager = new ThreeStagePromptManager(contextLength);
|
|
247
|
+
const conversation = promptManager.createChunkedConversation(promptStages);
|
|
248
|
+
const messages = [
|
|
249
|
+
conversation.systemMessage,
|
|
250
|
+
...conversation.dataMessages,
|
|
251
|
+
conversation.analysisMessage
|
|
252
|
+
];
|
|
253
|
+
return await ResponseProcessor.executeChunked(messages, model, contextLength, 'audit_wordpress_plugin', 'multifile');
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Single-file mode not applicable for plugin audit
|
|
257
|
+
*/
|
|
258
|
+
getSingleFilePromptStages(params) {
|
|
259
|
+
const systemAndContext = `WordPress Plugin Auditor - Single File Mode
|
|
260
|
+
|
|
261
|
+
This mode is not recommended for WordPress plugin audits.
|
|
262
|
+
Use multi-file mode with projectPath parameter for comprehensive plugin analysis.`;
|
|
263
|
+
const dataPayload = `Single file analysis not supported for WordPress plugin audits.
|
|
264
|
+
Please use projectPath parameter to analyze the entire plugin structure.`;
|
|
265
|
+
const outputInstructions = `{
|
|
266
|
+
"error": "Single file mode not supported for WordPress plugin audits",
|
|
267
|
+
"recommendation": "Use projectPath parameter for comprehensive plugin analysis"
|
|
268
|
+
}`;
|
|
269
|
+
return { systemAndContext, dataPayload, outputInstructions };
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Multi-file prompt stages for comprehensive audit synthesis
|
|
273
|
+
*/
|
|
274
|
+
getMultiFilePromptStages(params) {
|
|
275
|
+
const { analysisResult, auditType, auditDepth, wpVersion, phpVersion, stepCount } = params;
|
|
276
|
+
const systemAndContext = `You are a senior WordPress plugin security and performance expert with 15+ years of experience auditing enterprise WordPress installations.
|
|
277
|
+
|
|
278
|
+
**AUDIT CONTEXT:**
|
|
279
|
+
- Audit Type: ${auditType}
|
|
280
|
+
- Audit Depth: ${auditDepth}
|
|
281
|
+
- Analysis Steps Completed: ${stepCount}
|
|
282
|
+
- Target WordPress Version: ${wpVersion}
|
|
283
|
+
- Target PHP Version: ${phpVersion}
|
|
284
|
+
- Plugin Type: WordPress Plugin
|
|
285
|
+
|
|
286
|
+
**YOUR EXPERTISE:**
|
|
287
|
+
You are internationally recognized for:
|
|
288
|
+
- WordPress plugin security auditing and penetration testing
|
|
289
|
+
- Performance optimization for high-traffic WordPress sites
|
|
290
|
+
- Code quality assessment for WordPress.org repository submissions
|
|
291
|
+
- Database optimization and query performance analysis
|
|
292
|
+
- Dependency management and conflict resolution
|
|
293
|
+
|
|
294
|
+
**AUDIT METHODOLOGY:**
|
|
295
|
+
1. **Security Assessment**: OWASP Top 10, WordPress-specific vulnerabilities
|
|
296
|
+
2. **Performance Analysis**: Database queries, caching, resource usage
|
|
297
|
+
3. **Code Quality Review**: WordPress Coding Standards, best practices
|
|
298
|
+
4. **Dependency Analysis**: Plugin conflicts, version compatibility
|
|
299
|
+
5. **Architecture Review**: Plugin structure, hooks usage, extensibility
|
|
300
|
+
|
|
301
|
+
**CRITICAL FOCUS AREAS:**
|
|
302
|
+
- SQL injection vulnerabilities in custom queries
|
|
303
|
+
- XSS vulnerabilities in admin interfaces and frontend output
|
|
304
|
+
- CSRF protection through nonces validation
|
|
305
|
+
- Capability and permission checks
|
|
306
|
+
- Data sanitization and validation
|
|
307
|
+
- Performance bottlenecks in database queries
|
|
308
|
+
- Unused code and dependencies
|
|
309
|
+
- WordPress API compliance and best practices`;
|
|
310
|
+
const dataPayload = `**COMPREHENSIVE AUDIT RESULTS:**
|
|
311
|
+
|
|
312
|
+
${JSON.stringify(analysisResult, null, 2)}`;
|
|
313
|
+
const outputInstructions = `**PROVIDE COMPREHENSIVE WORDPRESS PLUGIN AUDIT REPORT:**
|
|
314
|
+
|
|
315
|
+
{
|
|
316
|
+
"executiveSummary": {
|
|
317
|
+
"overallRating": "critical|high-risk|medium-risk|low-risk|excellent",
|
|
318
|
+
"primaryConcerns": ["concern1", "concern2", "concern3"],
|
|
319
|
+
"strengths": ["strength1", "strength2"],
|
|
320
|
+
"recommendedActions": ["action1", "action2"],
|
|
321
|
+
"timeToFix": "immediate|1-2 days|1 week|2+ weeks"
|
|
322
|
+
},
|
|
323
|
+
|
|
324
|
+
"securityAssessment": {
|
|
325
|
+
"criticalVulnerabilities": [
|
|
326
|
+
{
|
|
327
|
+
"type": "SQL Injection|XSS|CSRF|Authentication Bypass",
|
|
328
|
+
"severity": "critical|high|medium|low",
|
|
329
|
+
"location": "specific file and line",
|
|
330
|
+
"description": "detailed vulnerability description",
|
|
331
|
+
"exploit": "how this could be exploited",
|
|
332
|
+
"fix": "specific fix with code example"
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
"securityScore": "A|B|C|D|F",
|
|
336
|
+
"complianceIssues": ["OWASP issue 1", "WordPress security issue 2"]
|
|
337
|
+
},
|
|
338
|
+
|
|
339
|
+
"performanceAssessment": {
|
|
340
|
+
"databaseIssues": [
|
|
341
|
+
{
|
|
342
|
+
"type": "N+1 Query|Missing Index|Inefficient Query|Direct SQL",
|
|
343
|
+
"severity": "critical|high|medium|low",
|
|
344
|
+
"location": "file and function",
|
|
345
|
+
"impact": "performance impact description",
|
|
346
|
+
"optimization": "specific optimization recommendation"
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"performanceScore": "A|B|C|D|F",
|
|
350
|
+
"bottlenecks": ["bottleneck1", "bottleneck2"],
|
|
351
|
+
"optimizations": ["optimization1", "optimization2"]
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
"codeQualityAssessment": {
|
|
355
|
+
"wordpressStandards": {
|
|
356
|
+
"compliance": "high|medium|low",
|
|
357
|
+
"violations": ["violation1", "violation2"],
|
|
358
|
+
"score": "A|B|C|D|F"
|
|
359
|
+
},
|
|
360
|
+
"maintainability": {
|
|
361
|
+
"score": "high|medium|low",
|
|
362
|
+
"issues": ["issue1", "issue2"],
|
|
363
|
+
"improvements": ["improvement1", "improvement2"]
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
|
|
367
|
+
"dependencyAssessment": {
|
|
368
|
+
"unusedCode": ["unused file 1", "unused function 2"],
|
|
369
|
+
"conflicts": ["potential conflict 1"],
|
|
370
|
+
"outdatedDependencies": ["dependency1", "dependency2"],
|
|
371
|
+
"recommendations": ["remove unused X", "update Y to version Z"]
|
|
372
|
+
},
|
|
373
|
+
|
|
374
|
+
"actionPlan": {
|
|
375
|
+
"immediate": [
|
|
376
|
+
{
|
|
377
|
+
"priority": 1,
|
|
378
|
+
"task": "fix critical security vulnerability",
|
|
379
|
+
"estimatedTime": "2 hours",
|
|
380
|
+
"risk": "critical"
|
|
381
|
+
}
|
|
382
|
+
],
|
|
383
|
+
"shortTerm": [
|
|
384
|
+
{
|
|
385
|
+
"priority": 2,
|
|
386
|
+
"task": "optimize database queries",
|
|
387
|
+
"estimatedTime": "4 hours",
|
|
388
|
+
"risk": "medium"
|
|
389
|
+
}
|
|
390
|
+
],
|
|
391
|
+
"longTerm": [
|
|
392
|
+
{
|
|
393
|
+
"priority": 3,
|
|
394
|
+
"task": "refactor architecture",
|
|
395
|
+
"estimatedTime": "2 days",
|
|
396
|
+
"risk": "low"
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
},
|
|
400
|
+
|
|
401
|
+
"complianceReport": {
|
|
402
|
+
"wordpressOrgReady": true,
|
|
403
|
+
"issuesBlocking": ["issue1", "issue2"],
|
|
404
|
+
"recommendationsForSubmission": ["recommendation1", "recommendation2"]
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
**REQUIREMENTS:**
|
|
409
|
+
- Provide specific file names and line numbers for all issues
|
|
410
|
+
- Include code examples for fixes where applicable
|
|
411
|
+
- Prioritize findings by business impact and security risk
|
|
412
|
+
- Ensure all recommendations are actionable and testable
|
|
413
|
+
- Focus on WordPress-specific best practices and security guidelines`;
|
|
414
|
+
return { systemAndContext, dataPayload, outputInstructions };
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Backwards compatibility method
|
|
418
|
+
*/
|
|
419
|
+
getPromptStages(params) {
|
|
420
|
+
return this.getMultiFilePromptStages(params);
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Not used in plugin audit workflow
|
|
424
|
+
*/
|
|
425
|
+
async discoverRelevantFiles(projectPath, maxDepth, analysisType) {
|
|
426
|
+
const extensions = ['.php', '.js', '.css', '.json', '.xml', '.txt', '.md'];
|
|
427
|
+
return await this.multiFileAnalysis.discoverFiles(projectPath, extensions, maxDepth);
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Not used in chained analysis workflow
|
|
431
|
+
*/
|
|
432
|
+
async performMultiFileAnalysis(files, params, model, contextLength) {
|
|
433
|
+
return {};
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Not used in chained analysis workflow
|
|
437
|
+
*/
|
|
438
|
+
async analyzeIndividualFile(file, params, model) {
|
|
439
|
+
return {};
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* WordPress plugin file extensions
|
|
443
|
+
*/
|
|
444
|
+
getFileExtensions(analysisType) {
|
|
445
|
+
return ['.php', '.js', '.css', '.json', '.xml', '.txt', '.md', '.yml', '.yaml'];
|
|
446
|
+
}
|
|
447
|
+
generateCacheKey(files, params) {
|
|
448
|
+
const fileHash = files.join('|');
|
|
449
|
+
const paramHash = JSON.stringify(params);
|
|
450
|
+
return `${fileHash}_${paramHash}`.substring(0, 64);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
export default WordPressPluginAuditor;
|
|
454
|
+
//# sourceMappingURL=wordpress-plugin-audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wordpress-plugin-audit.js","sourceRoot":"","sources":["../../../src/prompts/analyze/wordpress-plugin-audit.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,CAAC;AAErE,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAMxD,MAAM,OAAO,sBAAuB,SAAQ,UAAU;IAiEpD;QACE,KAAK,EAAE,CAAC;QAjEV,SAAI,GAAG,wBAAwB,CAAC;QAChC,aAAQ,GAAG,SAAkB,CAAC;QAC9B,gBAAW,GAAG,iIAAiI,CAAC;QAEhJ,0EAA0E;QAC1E,eAAU,GAAG;YACX,wDAAwD;YACxD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,WAAW,EAAE,yCAAyC;gBACtD,QAAQ,EAAE,IAAI;aACf;YAED,yBAAyB;YACzB,UAAU,EAAE;gBACV,IAAI,EAAE,QAAiB;gBACvB,WAAW,EAAE,yBAAyB;gBACtC,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,eAAe,CAAC;gBAC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