@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.
Files changed (260) hide show
  1. package/CHANGELOG.md +273 -0
  2. package/LICENSE +21 -0
  3. package/README.md +203 -0
  4. package/dist/cache/analysis-cache.d.ts +33 -0
  5. package/dist/cache/analysis-cache.d.ts.map +1 -0
  6. package/dist/cache/analysis-cache.js +56 -0
  7. package/dist/cache/analysis-cache.js.map +1 -0
  8. package/dist/cache/cache-manager.d.ts +29 -0
  9. package/dist/cache/cache-manager.d.ts.map +1 -0
  10. package/dist/cache/cache-manager.js +85 -0
  11. package/dist/cache/cache-manager.js.map +1 -0
  12. package/dist/cache/index.d.ts +16 -0
  13. package/dist/cache/index.d.ts.map +1 -0
  14. package/dist/cache/index.js +17 -0
  15. package/dist/cache/index.js.map +1 -0
  16. package/dist/cache/prompt-cache.d.ts +33 -0
  17. package/dist/cache/prompt-cache.d.ts.map +1 -0
  18. package/dist/cache/prompt-cache.js +61 -0
  19. package/dist/cache/prompt-cache.js.map +1 -0
  20. package/dist/config.d.ts +43 -0
  21. package/dist/config.d.ts.map +1 -0
  22. package/dist/config.js +70 -0
  23. package/dist/config.js.map +1 -0
  24. package/dist/core/ThreeStagePromptManager.d.ts +39 -0
  25. package/dist/core/ThreeStagePromptManager.d.ts.map +1 -0
  26. package/dist/core/ThreeStagePromptManager.js +176 -0
  27. package/dist/core/ThreeStagePromptManager.js.map +1 -0
  28. package/dist/index.d.ts +6 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +230 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/plugins/base-plugin.d.ts +47 -0
  33. package/dist/plugins/base-plugin.d.ts.map +1 -0
  34. package/dist/plugins/base-plugin.js +90 -0
  35. package/dist/plugins/base-plugin.js.map +1 -0
  36. package/dist/plugins/index.d.ts +58 -0
  37. package/dist/plugins/index.d.ts.map +1 -0
  38. package/dist/plugins/index.js +161 -0
  39. package/dist/plugins/index.js.map +1 -0
  40. package/dist/plugins/types.d.ts +5 -0
  41. package/dist/plugins/types.d.ts.map +1 -0
  42. package/dist/plugins/types.js +5 -0
  43. package/dist/plugins/types.js.map +1 -0
  44. package/dist/prompts/analyze/code-quality.d.ts +116 -0
  45. package/dist/prompts/analyze/code-quality.d.ts.map +1 -0
  46. package/dist/prompts/analyze/code-quality.js +433 -0
  47. package/dist/prompts/analyze/code-quality.js.map +1 -0
  48. package/dist/prompts/analyze/compare-integration.d.ts +130 -0
  49. package/dist/prompts/analyze/compare-integration.d.ts.map +1 -0
  50. package/dist/prompts/analyze/compare-integration.js +543 -0
  51. package/dist/prompts/analyze/compare-integration.js.map +1 -0
  52. package/dist/prompts/analyze/count-files.d.ts +109 -0
  53. package/dist/prompts/analyze/count-files.d.ts.map +1 -0
  54. package/dist/prompts/analyze/count-files.js +399 -0
  55. package/dist/prompts/analyze/count-files.js.map +1 -0
  56. package/dist/prompts/analyze/database-queries.d.ts +156 -0
  57. package/dist/prompts/analyze/database-queries.d.ts.map +1 -0
  58. package/dist/prompts/analyze/database-queries.js +759 -0
  59. package/dist/prompts/analyze/database-queries.js.map +1 -0
  60. package/dist/prompts/analyze/dependencies.d.ts +97 -0
  61. package/dist/prompts/analyze/dependencies.d.ts.map +1 -0
  62. package/dist/prompts/analyze/dependencies.js +333 -0
  63. package/dist/prompts/analyze/dependencies.js.map +1 -0
  64. package/dist/prompts/analyze/diff-signatures.d.ts +139 -0
  65. package/dist/prompts/analyze/diff-signatures.d.ts.map +1 -0
  66. package/dist/prompts/analyze/diff-signatures.js +702 -0
  67. package/dist/prompts/analyze/diff-signatures.js.map +1 -0
  68. package/dist/prompts/analyze/find-patterns.d.ts +128 -0
  69. package/dist/prompts/analyze/find-patterns.d.ts.map +1 -0
  70. package/dist/prompts/analyze/find-patterns.js +520 -0
  71. package/dist/prompts/analyze/find-patterns.js.map +1 -0
  72. package/dist/prompts/analyze/find-unused-css.d.ts +151 -0
  73. package/dist/prompts/analyze/find-unused-css.d.ts.map +1 -0
  74. package/dist/prompts/analyze/find-unused-css.js +754 -0
  75. package/dist/prompts/analyze/find-unused-css.js.map +1 -0
  76. package/dist/prompts/analyze/n8n-workflow.d.ts +137 -0
  77. package/dist/prompts/analyze/n8n-workflow.d.ts.map +1 -0
  78. package/dist/prompts/analyze/n8n-workflow.js +529 -0
  79. package/dist/prompts/analyze/n8n-workflow.js.map +1 -0
  80. package/dist/prompts/analyze/project-structure.d.ts +126 -0
  81. package/dist/prompts/analyze/project-structure.d.ts.map +1 -0
  82. package/dist/prompts/analyze/project-structure.js +569 -0
  83. package/dist/prompts/analyze/project-structure.js.map +1 -0
  84. package/dist/prompts/analyze/security-audit.d.ts +142 -0
  85. package/dist/prompts/analyze/security-audit.d.ts.map +1 -0
  86. package/dist/prompts/analyze/security-audit.js +637 -0
  87. package/dist/prompts/analyze/security-audit.js.map +1 -0
  88. package/dist/prompts/analyze/single-file.d.ts +162 -0
  89. package/dist/prompts/analyze/single-file.d.ts.map +1 -0
  90. package/dist/prompts/analyze/single-file.js +665 -0
  91. package/dist/prompts/analyze/single-file.js.map +1 -0
  92. package/dist/prompts/analyze/trace-execution.d.ts +126 -0
  93. package/dist/prompts/analyze/trace-execution.d.ts.map +1 -0
  94. package/dist/prompts/analyze/trace-execution.js +609 -0
  95. package/dist/prompts/analyze/trace-execution.js.map +1 -0
  96. package/dist/prompts/analyze/wordpress-plugin-audit.d.ts +116 -0
  97. package/dist/prompts/analyze/wordpress-plugin-audit.d.ts.map +1 -0
  98. package/dist/prompts/analyze/wordpress-plugin-audit.js +454 -0
  99. package/dist/prompts/analyze/wordpress-plugin-audit.js.map +1 -0
  100. package/dist/prompts/analyze/wordpress-security.d.ts +146 -0
  101. package/dist/prompts/analyze/wordpress-security.d.ts.map +1 -0
  102. package/dist/prompts/analyze/wordpress-security.js +698 -0
  103. package/dist/prompts/analyze/wordpress-security.js.map +1 -0
  104. package/dist/prompts/analyze/wordpress-theme-audit.d.ts +114 -0
  105. package/dist/prompts/analyze/wordpress-theme-audit.d.ts.map +1 -0
  106. package/dist/prompts/analyze/wordpress-theme-audit.js +538 -0
  107. package/dist/prompts/analyze/wordpress-theme-audit.js.map +1 -0
  108. package/dist/prompts/custom/custom-prompt.d.ts +135 -0
  109. package/dist/prompts/custom/custom-prompt.d.ts.map +1 -0
  110. package/dist/prompts/custom/custom-prompt.js +419 -0
  111. package/dist/prompts/custom/custom-prompt.js.map +1 -0
  112. package/dist/prompts/fun/arcade-game.d.ts +152 -0
  113. package/dist/prompts/fun/arcade-game.d.ts.map +1 -0
  114. package/dist/prompts/fun/arcade-game.js +653 -0
  115. package/dist/prompts/fun/arcade-game.js.map +1 -0
  116. package/dist/prompts/fun/create_text_adventure.d.ts +100 -0
  117. package/dist/prompts/fun/create_text_adventure.d.ts.map +1 -0
  118. package/dist/prompts/fun/create_text_adventure.js +397 -0
  119. package/dist/prompts/fun/create_text_adventure.js.map +1 -0
  120. package/dist/prompts/fun/css-art-generator.d.ts +168 -0
  121. package/dist/prompts/fun/css-art-generator.d.ts.map +1 -0
  122. package/dist/prompts/fun/css-art-generator.js +827 -0
  123. package/dist/prompts/fun/css-art-generator.js.map +1 -0
  124. package/dist/prompts/generate/project-documentation.d.ts +137 -0
  125. package/dist/prompts/generate/project-documentation.d.ts.map +1 -0
  126. package/dist/prompts/generate/project-documentation.js +666 -0
  127. package/dist/prompts/generate/project-documentation.js.map +1 -0
  128. package/dist/prompts/generate/refactoring.d.ts +164 -0
  129. package/dist/prompts/generate/refactoring.d.ts.map +1 -0
  130. package/dist/prompts/generate/refactoring.js +621 -0
  131. package/dist/prompts/generate/refactoring.js.map +1 -0
  132. package/dist/prompts/generate/responsive-component.d.ts +147 -0
  133. package/dist/prompts/generate/responsive-component.d.ts.map +1 -0
  134. package/dist/prompts/generate/responsive-component.js +955 -0
  135. package/dist/prompts/generate/responsive-component.js.map +1 -0
  136. package/dist/prompts/generate/typescript-conversion.d.ts +144 -0
  137. package/dist/prompts/generate/typescript-conversion.d.ts.map +1 -0
  138. package/dist/prompts/generate/typescript-conversion.js +527 -0
  139. package/dist/prompts/generate/typescript-conversion.js.map +1 -0
  140. package/dist/prompts/generate/unit-tests.d.ts +139 -0
  141. package/dist/prompts/generate/unit-tests.d.ts.map +1 -0
  142. package/dist/prompts/generate/unit-tests.js +578 -0
  143. package/dist/prompts/generate/unit-tests.js.map +1 -0
  144. package/dist/prompts/generate/wordpress-plugin.d.ts +179 -0
  145. package/dist/prompts/generate/wordpress-plugin.d.ts.map +1 -0
  146. package/dist/prompts/generate/wordpress-plugin.js +763 -0
  147. package/dist/prompts/generate/wordpress-plugin.js.map +1 -0
  148. package/dist/prompts/generate/wordpress-theme-from-static.d.ts +177 -0
  149. package/dist/prompts/generate/wordpress-theme-from-static.d.ts.map +1 -0
  150. package/dist/prompts/generate/wordpress-theme-from-static.js +695 -0
  151. package/dist/prompts/generate/wordpress-theme-from-static.js.map +1 -0
  152. package/dist/prompts/shared/cache-manager.d.ts +45 -0
  153. package/dist/prompts/shared/cache-manager.d.ts.map +1 -0
  154. package/dist/prompts/shared/cache-manager.js +129 -0
  155. package/dist/prompts/shared/cache-manager.js.map +1 -0
  156. package/dist/prompts/shared/helpers.d.ts +39 -0
  157. package/dist/prompts/shared/helpers.d.ts.map +1 -0
  158. package/dist/prompts/shared/helpers.js +151 -0
  159. package/dist/prompts/shared/helpers.js.map +1 -0
  160. package/dist/prompts/shared/templates.d.ts +35 -0
  161. package/dist/prompts/shared/templates.d.ts.map +1 -0
  162. package/dist/prompts/shared/templates.js +77 -0
  163. package/dist/prompts/shared/templates.js.map +1 -0
  164. package/dist/prompts/shared/types.d.ts +112 -0
  165. package/dist/prompts/shared/types.d.ts.map +1 -0
  166. package/dist/prompts/shared/types.js +5 -0
  167. package/dist/prompts/shared/types.js.map +1 -0
  168. package/dist/prompts/system/find-unused-files.d.ts +106 -0
  169. package/dist/prompts/system/find-unused-files.d.ts.map +1 -0
  170. package/dist/prompts/system/find-unused-files.js +353 -0
  171. package/dist/prompts/system/find-unused-files.js.map +1 -0
  172. package/dist/security/index.d.ts +39 -0
  173. package/dist/security/index.d.ts.map +1 -0
  174. package/dist/security/index.js +46 -0
  175. package/dist/security/index.js.map +1 -0
  176. package/dist/security/integration-helpers.d.ts +121 -0
  177. package/dist/security/integration-helpers.d.ts.map +1 -0
  178. package/dist/security/integration-helpers.js +190 -0
  179. package/dist/security/integration-helpers.js.map +1 -0
  180. package/dist/security/output-encoder.d.ts +94 -0
  181. package/dist/security/output-encoder.d.ts.map +1 -0
  182. package/dist/security/output-encoder.js +295 -0
  183. package/dist/security/output-encoder.js.map +1 -0
  184. package/dist/security/prompt-injection-guard.d.ts +59 -0
  185. package/dist/security/prompt-injection-guard.d.ts.map +1 -0
  186. package/dist/security/prompt-injection-guard.js +249 -0
  187. package/dist/security/prompt-injection-guard.js.map +1 -0
  188. package/dist/security/sanitisation.d.ts +67 -0
  189. package/dist/security/sanitisation.d.ts.map +1 -0
  190. package/dist/security/sanitisation.js +398 -0
  191. package/dist/security/sanitisation.js.map +1 -0
  192. package/dist/security/security-service.d.ts +103 -0
  193. package/dist/security/security-service.d.ts.map +1 -0
  194. package/dist/security/security-service.js +303 -0
  195. package/dist/security/security-service.js.map +1 -0
  196. package/dist/security-config.d.ts +45 -0
  197. package/dist/security-config.d.ts.map +1 -0
  198. package/dist/security-config.js +63 -0
  199. package/dist/security-config.js.map +1 -0
  200. package/dist/system/function-list.d.ts +61 -0
  201. package/dist/system/function-list.d.ts.map +1 -0
  202. package/dist/system/function-list.js +111 -0
  203. package/dist/system/function-list.js.map +1 -0
  204. package/dist/system/function-registry.d.ts +23 -0
  205. package/dist/system/function-registry.d.ts.map +1 -0
  206. package/dist/system/function-registry.js +136 -0
  207. package/dist/system/function-registry.js.map +1 -0
  208. package/dist/system/health-check.d.ts +33 -0
  209. package/dist/system/health-check.d.ts.map +1 -0
  210. package/dist/system/health-check.js +98 -0
  211. package/dist/system/health-check.js.map +1 -0
  212. package/dist/system/path-resolver.d.ts +55 -0
  213. package/dist/system/path-resolver.d.ts.map +1 -0
  214. package/dist/system/path-resolver.js +90 -0
  215. package/dist/system/path-resolver.js.map +1 -0
  216. package/dist/templates/plugin-template.d.ts +121 -0
  217. package/dist/templates/plugin-template.d.ts.map +1 -0
  218. package/dist/templates/plugin-template.js +450 -0
  219. package/dist/templates/plugin-template.js.map +1 -0
  220. package/dist/types/chunking-types.d.ts +88 -0
  221. package/dist/types/chunking-types.d.ts.map +1 -0
  222. package/dist/types/chunking-types.js +18 -0
  223. package/dist/types/chunking-types.js.map +1 -0
  224. package/dist/types/prompt-stages.d.ts +42 -0
  225. package/dist/types/prompt-stages.d.ts.map +1 -0
  226. package/dist/types/prompt-stages.js +6 -0
  227. package/dist/types/prompt-stages.js.map +1 -0
  228. package/dist/types.d.ts +46 -0
  229. package/dist/types.d.ts.map +1 -0
  230. package/dist/types.js +6 -0
  231. package/dist/types.js.map +1 -0
  232. package/dist/utils/css-parser.d.ts +26 -0
  233. package/dist/utils/css-parser.d.ts.map +1 -0
  234. package/dist/utils/css-parser.js +117 -0
  235. package/dist/utils/css-parser.js.map +1 -0
  236. package/dist/utils/path-resolver.d.ts +13 -0
  237. package/dist/utils/path-resolver.d.ts.map +1 -0
  238. package/dist/utils/path-resolver.js +78 -0
  239. package/dist/utils/path-resolver.js.map +1 -0
  240. package/dist/utils/plugin-utilities.d.ts +171 -0
  241. package/dist/utils/plugin-utilities.d.ts.map +1 -0
  242. package/dist/utils/plugin-utilities.js +221 -0
  243. package/dist/utils/plugin-utilities.js.map +1 -0
  244. package/dist/utils/streamHandler.d.ts +3 -0
  245. package/dist/utils/streamHandler.d.ts.map +1 -0
  246. package/dist/utils/streamHandler.js +137 -0
  247. package/dist/utils/streamHandler.js.map +1 -0
  248. package/dist/validation/output-validator.d.ts +136 -0
  249. package/dist/validation/output-validator.d.ts.map +1 -0
  250. package/dist/validation/output-validator.js +262 -0
  251. package/dist/validation/output-validator.js.map +1 -0
  252. package/dist/validation/response-factory.d.ts +44 -0
  253. package/dist/validation/response-factory.d.ts.map +1 -0
  254. package/dist/validation/response-factory.js +202 -0
  255. package/dist/validation/response-factory.js.map +1 -0
  256. package/dist/validation/schemas.d.ts +519 -0
  257. package/dist/validation/schemas.d.ts.map +1 -0
  258. package/dist/validation/schemas.js +6 -0
  259. package/dist/validation/schemas.js.map +1 -0
  260. package/package.json +72 -0
@@ -0,0 +1,538 @@
1
+ /**
2
+ * WordPress Theme Comprehensive Auditor - Modern v4.3
3
+ *
4
+ * Chains multiple analysis steps for comprehensive WordPress theme audit
5
+ * Covers theme-specific security, performance, accessibility, and code quality
6
+ */
7
+ import { BasePlugin } from '../../plugins/base-plugin.js';
8
+ import { ThreeStagePromptManager } from '../../core/ThreeStagePromptManager.js';
9
+ import { withSecurity } from '../../security/integration-helpers.js';
10
+ import { ModelSetup, ResponseProcessor, ParameterValidator, ErrorHandler, MultiFileAnalysis } from '../../utils/plugin-utilities.js';
11
+ import { getAnalysisCache } from '../../cache/index.js';
12
+ export class WordPressThemeAuditor extends BasePlugin {
13
+ constructor() {
14
+ super();
15
+ this.name = 'audit_wordpress_theme';
16
+ this.category = 'analyze';
17
+ this.description = 'Comprehensive WordPress theme audit - chains multiple analysis steps for security, performance, accessibility, SEO, and code quality';
18
+ this.parameters = {
19
+ // Multi-file parameters (primary mode for theme audit)
20
+ projectPath: {
21
+ type: 'string',
22
+ description: 'Path to WordPress theme root directory',
23
+ required: true
24
+ },
25
+ // Analysis configuration
26
+ auditDepth: {
27
+ type: 'string',
28
+ description: 'Depth of audit analysis',
29
+ enum: ['basic', 'detailed', 'comprehensive'],
30
+ default: 'comprehensive',
31
+ required: false
32
+ },
33
+ auditType: {
34
+ type: 'string',
35
+ description: 'Type of audit focus',
36
+ enum: ['security', 'performance', 'accessibility', 'seo', 'quality', 'full-audit'],
37
+ default: 'full-audit',
38
+ required: false
39
+ },
40
+ // Theme-specific analysis steps
41
+ includeSteps: {
42
+ type: 'array',
43
+ description: 'Analysis steps to include in theme audit',
44
+ required: false,
45
+ items: { type: 'string' },
46
+ default: ['structure', 'security', 'performance', 'accessibility', 'quality', 'seo']
47
+ },
48
+ maxDepth: {
49
+ type: 'number',
50
+ description: 'Maximum directory depth for analysis (1-5)',
51
+ required: false,
52
+ default: 4
53
+ },
54
+ // WordPress-specific context
55
+ wpVersion: {
56
+ type: 'string',
57
+ description: 'Target WordPress version for compatibility checks',
58
+ required: false,
59
+ default: '6.4'
60
+ },
61
+ phpVersion: {
62
+ type: 'string',
63
+ description: 'Target PHP version for compatibility checks',
64
+ required: false,
65
+ default: '8.0'
66
+ },
67
+ // Theme-specific options
68
+ themeType: {
69
+ type: 'string',
70
+ description: 'Type of WordPress theme',
71
+ enum: ['classic', 'block', 'hybrid'],
72
+ default: 'classic',
73
+ required: false
74
+ },
75
+ checkAccessibility: {
76
+ type: 'boolean',
77
+ description: 'Include detailed accessibility audit',
78
+ default: true,
79
+ required: false
80
+ }
81
+ };
82
+ this.analysisCache = getAnalysisCache();
83
+ this.multiFileAnalysis = new MultiFileAnalysis();
84
+ }
85
+ async execute(params, llmClient) {
86
+ return await withSecurity(this, params, llmClient, async (secureParams) => {
87
+ try {
88
+ // 1. Validate WordPress theme structure
89
+ this.validateWordPressTheme(secureParams);
90
+ // 2. Setup model
91
+ const { model, contextLength } = await ModelSetup.getReadyModel(llmClient);
92
+ // 3. Execute chained theme analysis workflow
93
+ return await this.executeChainedThemeAnalysis(secureParams, llmClient, model, contextLength);
94
+ }
95
+ catch (error) {
96
+ return ErrorHandler.createExecutionError('audit_wordpress_theme', error);
97
+ }
98
+ });
99
+ }
100
+ /**
101
+ * Validate WordPress theme structure
102
+ */
103
+ validateWordPressTheme(params) {
104
+ ParameterValidator.validateProjectPath(params);
105
+ ParameterValidator.validateDepth(params);
106
+ ParameterValidator.validateEnum(params, 'auditType', ['security', 'performance', 'accessibility', 'seo', 'quality', 'full-audit']);
107
+ ParameterValidator.validateEnum(params, 'auditDepth', ['basic', 'detailed', 'comprehensive']);
108
+ ParameterValidator.validateEnum(params, 'themeType', ['classic', 'block', 'hybrid']);
109
+ }
110
+ /**
111
+ * Execute the chained theme analysis workflow
112
+ */
113
+ async executeChainedThemeAnalysis(params, llmClient, model, contextLength) {
114
+ const auditSteps = params.includeSteps || ['structure', 'security', 'performance', 'accessibility', 'quality', 'seo'];
115
+ const results = {};
116
+ const stepExecutionLog = [];
117
+ try {
118
+ stepExecutionLog.push(`Starting WordPress theme audit with ${auditSteps.length} steps`);
119
+ stepExecutionLog.push(`Theme type: ${params.themeType || 'classic'}`);
120
+ // Step 1: Theme Structure Overview
121
+ if (auditSteps.includes('structure')) {
122
+ stepExecutionLog.push('Executing: Theme structure analysis');
123
+ results.structure = await this.runAnalysisStep('count_files', {
124
+ projectPath: params.projectPath,
125
+ analysisType: 'comprehensive',
126
+ maxDepth: params.maxDepth
127
+ }, llmClient);
128
+ stepExecutionLog.push(`Structure analysis: ${results.structure.success ? 'SUCCESS' : 'FAILED'}`);
129
+ }
130
+ // Step 2: WordPress Theme Security Audit
131
+ if (auditSteps.includes('security')) {
132
+ stepExecutionLog.push('Executing: WordPress theme security analysis');
133
+ results.security = await this.runAnalysisStep('analyze_wordpress_security', {
134
+ projectPath: params.projectPath,
135
+ wpType: 'theme',
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 3: Performance Analysis (theme-specific)
143
+ if (auditSteps.includes('performance')) {
144
+ stepExecutionLog.push('Executing: Theme performance analysis');
145
+ results.performance = await this.runAnalysisStep('analyze_code_quality', {
146
+ projectPath: params.projectPath,
147
+ analysisType: 'performance',
148
+ language: 'php',
149
+ context: {
150
+ projectType: 'wordpress-theme',
151
+ themeType: params.themeType,
152
+ focusAreas: ['performance', 'optimization']
153
+ }
154
+ }, llmClient);
155
+ stepExecutionLog.push(`Performance analysis: ${results.performance.success ? 'SUCCESS' : 'FAILED'}`);
156
+ }
157
+ // Step 4: Accessibility Audit
158
+ if (auditSteps.includes('accessibility') && params.checkAccessibility) {
159
+ stepExecutionLog.push('Executing: Accessibility analysis');
160
+ results.accessibility = await this.runAnalysisStep('analyze_single_file', {
161
+ projectPath: params.projectPath,
162
+ analysisType: 'comprehensive',
163
+ context: {
164
+ projectType: 'wordpress-theme',
165
+ focusAreas: ['accessibility', 'wcag', 'semantic-html'],
166
+ standards: ['WCAG 2.1 AA', 'Section 508']
167
+ }
168
+ }, llmClient);
169
+ stepExecutionLog.push(`Accessibility analysis: ${results.accessibility.success ? 'SUCCESS' : 'FAILED'}`);
170
+ }
171
+ // Step 5: Code Quality Assessment
172
+ if (auditSteps.includes('quality')) {
173
+ stepExecutionLog.push('Executing: Code quality analysis');
174
+ results.quality = await this.runAnalysisStep('analyze_code_quality', {
175
+ projectPath: params.projectPath,
176
+ analysisType: 'comprehensive',
177
+ language: 'php',
178
+ context: { projectType: 'wordpress-theme' }
179
+ }, llmClient);
180
+ stepExecutionLog.push(`Quality analysis: ${results.quality.success ? 'SUCCESS' : 'FAILED'}`);
181
+ }
182
+ // Step 6: SEO Analysis
183
+ if (auditSteps.includes('seo')) {
184
+ stepExecutionLog.push('Executing: SEO structure analysis');
185
+ results.seo = await this.runAnalysisStep('analyze_single_file', {
186
+ projectPath: params.projectPath,
187
+ analysisType: 'comprehensive',
188
+ context: {
189
+ projectType: 'wordpress-theme',
190
+ focusAreas: ['seo', 'structured-data', 'meta-tags', 'performance']
191
+ }
192
+ }, llmClient);
193
+ stepExecutionLog.push(`SEO analysis: ${results.seo.success ? 'SUCCESS' : 'FAILED'}`);
194
+ }
195
+ // Step 7: Database Query Analysis (if applicable)
196
+ if (auditSteps.includes('database')) {
197
+ stepExecutionLog.push('Executing: Database query analysis');
198
+ results.database = await this.runAnalysisStep('analyze_database_queries', {
199
+ projectPath: params.projectPath,
200
+ analysisType: 'comprehensive',
201
+ context: { projectType: 'wordpress-theme' }
202
+ }, llmClient);
203
+ stepExecutionLog.push(`Database analysis: ${results.database.success ? 'SUCCESS' : 'FAILED'}`);
204
+ }
205
+ // Step 8: Synthesize all results
206
+ stepExecutionLog.push('Synthesizing comprehensive theme audit report');
207
+ const synthesizedResults = await this.synthesizeThemeAuditResults({
208
+ ...results,
209
+ executionLog: stepExecutionLog,
210
+ completedSteps: auditSteps.filter(step => results[step]?.success),
211
+ failedSteps: auditSteps.filter(step => results[step]?.success === false)
212
+ }, params, model, contextLength);
213
+ stepExecutionLog.push('Theme audit synthesis: COMPLETED');
214
+ return synthesizedResults;
215
+ }
216
+ catch (error) {
217
+ stepExecutionLog.push(`Theme audit failed: ${error.message}`);
218
+ return ErrorHandler.createExecutionError('audit_wordpress_theme', error);
219
+ }
220
+ }
221
+ /**
222
+ * Run individual analysis step by calling other MCP functions
223
+ */
224
+ async runAnalysisStep(functionName, stepParams, llmClient) {
225
+ try {
226
+ // Check cache first
227
+ const cacheKey = this.analysisCache.generateKey(functionName, stepParams, []);
228
+ const cached = await this.analysisCache.get(cacheKey);
229
+ if (cached)
230
+ return cached;
231
+ // Import the plugin loader to call other MCP functions
232
+ const { PluginRegistry } = await import('../../plugins/index.js');
233
+ const pluginLoader = PluginRegistry.getInstance();
234
+ // Execute the specific analysis function
235
+ let result;
236
+ try {
237
+ result = await pluginLoader.executePlugin(functionName, stepParams, llmClient);
238
+ // Wrap successful results
239
+ const wrappedResult = {
240
+ stepName: functionName,
241
+ parameters: stepParams,
242
+ status: 'completed',
243
+ timestamp: new Date().toISOString(),
244
+ data: result.data || result,
245
+ summary: `Completed ${functionName} analysis`,
246
+ success: true
247
+ };
248
+ // Cache the result
249
+ await this.analysisCache.cacheAnalysis(cacheKey, wrappedResult, {
250
+ modelUsed: result.modelUsed || 'unknown',
251
+ executionTime: result.executionTimeMs || 0,
252
+ timestamp: new Date().toISOString()
253
+ });
254
+ return wrappedResult;
255
+ }
256
+ catch (pluginError) {
257
+ // If the plugin doesn't exist or fails, return error result
258
+ const errorResult = {
259
+ stepName: functionName,
260
+ status: 'failed',
261
+ error: pluginError.message,
262
+ timestamp: new Date().toISOString(),
263
+ summary: `Failed ${functionName} analysis`,
264
+ success: false
265
+ };
266
+ return errorResult;
267
+ }
268
+ }
269
+ catch (error) {
270
+ return {
271
+ stepName: functionName,
272
+ status: 'system-error',
273
+ error: error.message,
274
+ timestamp: new Date().toISOString(),
275
+ summary: 'System error during analysis',
276
+ success: false
277
+ };
278
+ }
279
+ }
280
+ /**
281
+ * Synthesize all theme audit results into comprehensive report
282
+ */
283
+ async synthesizeThemeAuditResults(results, params, model, contextLength) {
284
+ // Generate final synthesis prompt stages
285
+ const promptStages = this.getMultiFilePromptStages({
286
+ ...params,
287
+ analysisResult: results,
288
+ stepCount: Object.keys(results).length
289
+ });
290
+ // Always use chunking for comprehensive synthesis
291
+ const promptManager = new ThreeStagePromptManager(contextLength);
292
+ const conversation = promptManager.createChunkedConversation(promptStages);
293
+ const messages = [
294
+ conversation.systemMessage,
295
+ ...conversation.dataMessages,
296
+ conversation.analysisMessage
297
+ ];
298
+ return await ResponseProcessor.executeChunked(messages, model, contextLength, 'audit_wordpress_theme', 'multifile');
299
+ }
300
+ /**
301
+ * Single-file mode not applicable for theme audit
302
+ */
303
+ getSingleFilePromptStages(params) {
304
+ const systemAndContext = `WordPress Theme Auditor - Single File Mode
305
+
306
+ This mode is not recommended for WordPress theme audits.
307
+ Use multi-file mode with projectPath parameter for comprehensive theme analysis.`;
308
+ const dataPayload = `Single file analysis not supported for WordPress theme audits.
309
+ Please use projectPath parameter to analyze the entire theme structure.`;
310
+ const outputInstructions = `{
311
+ "error": "Single file mode not supported for WordPress theme audits",
312
+ "recommendation": "Use projectPath parameter for comprehensive theme analysis"
313
+ }`;
314
+ return { systemAndContext, dataPayload, outputInstructions };
315
+ }
316
+ /**
317
+ * Multi-file prompt stages for comprehensive theme audit synthesis
318
+ */
319
+ getMultiFilePromptStages(params) {
320
+ const { analysisResult, auditType, auditDepth, wpVersion, phpVersion, themeType, stepCount } = params;
321
+ const systemAndContext = `You are a senior WordPress theme developer and security expert with 15+ years of experience auditing enterprise WordPress themes for performance, accessibility, and security.
322
+
323
+ **THEME AUDIT CONTEXT:**
324
+ - Audit Type: ${auditType}
325
+ - Audit Depth: ${auditDepth}
326
+ - Analysis Steps Completed: ${stepCount}
327
+ - Theme Type: ${themeType}
328
+ - Target WordPress Version: ${wpVersion}
329
+ - Target PHP Version: ${phpVersion}
330
+
331
+ **YOUR EXPERTISE:**
332
+ You are internationally recognized for:
333
+ - WordPress theme security auditing and vulnerability assessment
334
+ - Frontend performance optimization for WordPress themes
335
+ - Accessibility compliance (WCAG 2.1 AA, Section 508)
336
+ - SEO optimization and Core Web Vitals improvement
337
+ - Theme architecture and template hierarchy mastery
338
+ - WordPress.org theme repository review standards
339
+
340
+ **THEME-SPECIFIC AUDIT METHODOLOGY:**
341
+ 1. **Security Assessment**: Template injection, XSS, CSRF, data sanitization
342
+ 2. **Performance Analysis**: Asset loading, image optimization, caching strategies
343
+ 3. **Accessibility Review**: ARIA labels, keyboard navigation, screen reader support
344
+ 4. **SEO Optimization**: Structured data, meta tags, page speed, mobile responsiveness
345
+ 5. **Code Quality**: WordPress Coding Standards, template hierarchy compliance
346
+ 6. **Architecture Review**: Child theme compatibility, customizer integration
347
+
348
+ **CRITICAL THEME FOCUS AREAS:**
349
+ - Template security: Proper escaping and sanitization in templates
350
+ - Asset optimization: CSS/JS minification, critical path optimization
351
+ - Accessibility compliance: Color contrast, focus management, semantic HTML
352
+ - SEO implementation: Schema markup, Open Graph, Twitter Cards
353
+ - Performance bottlenecks: Render-blocking resources, unused CSS
354
+ - WordPress integration: Proper enqueueing, theme supports, customizer
355
+ - Cross-browser compatibility and responsive design
356
+ - Template hierarchy compliance and hook usage`;
357
+ const dataPayload = `**COMPREHENSIVE THEME AUDIT RESULTS:**
358
+
359
+ ${JSON.stringify(analysisResult, null, 2)}`;
360
+ const outputInstructions = `**PROVIDE COMPREHENSIVE WORDPRESS THEME AUDIT REPORT:**
361
+
362
+ {
363
+ "executiveSummary": {
364
+ "overallRating": "critical|high-risk|medium-risk|low-risk|excellent",
365
+ "themeReadiness": "production-ready|needs-fixes|major-issues|not-ready",
366
+ "primaryConcerns": ["concern1", "concern2", "concern3"],
367
+ "strengths": ["strength1", "strength2"],
368
+ "timeToFix": "immediate|1-2 days|1 week|2+ weeks",
369
+ "wpOrgCompliance": "compliant|minor-issues|major-issues|non-compliant"
370
+ },
371
+
372
+ "securityAssessment": {
373
+ "criticalVulnerabilities": [
374
+ {
375
+ "type": "XSS|CSRF|Template Injection|Data Exposure",
376
+ "severity": "critical|high|medium|low",
377
+ "location": "specific template and line",
378
+ "description": "detailed vulnerability description",
379
+ "exploit": "how this could be exploited in theme context",
380
+ "fix": "specific theme security fix with code example"
381
+ }
382
+ ],
383
+ "templateSecurity": {
384
+ "escaping": "proper|inconsistent|missing",
385
+ "sanitization": "proper|inconsistent|missing",
386
+ "authorization": "proper|inconsistent|missing"
387
+ },
388
+ "securityScore": "A|B|C|D|F"
389
+ },
390
+
391
+ "performanceAssessment": {
392
+ "coreWebVitals": {
393
+ "lcp": "good|needs-improvement|poor",
394
+ "fid": "good|needs-improvement|poor",
395
+ "cls": "good|needs-improvement|poor"
396
+ },
397
+ "assetOptimization": {
398
+ "css": "optimized|needs-optimization|poor",
399
+ "javascript": "optimized|needs-optimization|poor",
400
+ "images": "optimized|needs-optimization|poor"
401
+ },
402
+ "performanceIssues": [
403
+ {
404
+ "type": "Render Blocking|Unused CSS|Large Images|Slow Queries",
405
+ "severity": "critical|high|medium|low",
406
+ "location": "specific file or template",
407
+ "impact": "performance impact description",
408
+ "optimization": "specific optimization recommendation"
409
+ }
410
+ ],
411
+ "performanceScore": "A|B|C|D|F"
412
+ },
413
+
414
+ "accessibilityAssessment": {
415
+ "wcagCompliance": {
416
+ "level": "AA|A|Non-compliant",
417
+ "score": "A|B|C|D|F"
418
+ },
419
+ "accessibilityIssues": [
420
+ {
421
+ "type": "Color Contrast|Keyboard Navigation|Screen Reader|ARIA|Focus Management",
422
+ "severity": "critical|high|medium|low",
423
+ "location": "specific template or component",
424
+ "wcagCriterion": "1.4.3|2.1.1|4.1.2|etc",
425
+ "fix": "specific accessibility fix with code example"
426
+ }
427
+ ],
428
+ "keyboardNavigation": "full|partial|broken",
429
+ "screenReaderSupport": "excellent|good|poor"
430
+ },
431
+
432
+ "seoAssessment": {
433
+ "technicalSeo": {
434
+ "structuredData": "implemented|partial|missing",
435
+ "metaTags": "complete|incomplete|missing",
436
+ "performance": "fast|average|slow"
437
+ },
438
+ "seoIssues": [
439
+ {
440
+ "type": "Missing Meta|No Structured Data|Slow Loading|Poor Mobile",
441
+ "severity": "high|medium|low",
442
+ "impact": "SEO impact description",
443
+ "recommendation": "specific SEO improvement"
444
+ }
445
+ ],
446
+ "seoScore": "A|B|C|D|F"
447
+ },
448
+
449
+ "codeQualityAssessment": {
450
+ "wordpressStandards": {
451
+ "phpCompliance": "high|medium|low",
452
+ "cssCompliance": "high|medium|low",
453
+ "jsCompliance": "high|medium|low"
454
+ },
455
+ "themeStructure": {
456
+ "templateHierarchy": "proper|issues|broken",
457
+ "childThemeSupport": "excellent|good|poor",
458
+ "customizerIntegration": "complete|partial|missing"
459
+ },
460
+ "qualityScore": "A|B|C|D|F"
461
+ },
462
+
463
+ "actionPlan": {
464
+ "immediate": [
465
+ {
466
+ "priority": 1,
467
+ "task": "fix critical security vulnerability",
468
+ "category": "security|performance|accessibility|seo|quality",
469
+ "estimatedTime": "2 hours",
470
+ "risk": "critical|high|medium|low"
471
+ }
472
+ ],
473
+ "shortTerm": [
474
+ {
475
+ "priority": 2,
476
+ "task": "optimize Core Web Vitals",
477
+ "category": "performance",
478
+ "estimatedTime": "4 hours",
479
+ "risk": "medium"
480
+ }
481
+ ],
482
+ "longTerm": [
483
+ {
484
+ "priority": 3,
485
+ "task": "improve accessibility compliance",
486
+ "category": "accessibility",
487
+ "estimatedTime": "2 days",
488
+ "risk": "low"
489
+ }
490
+ ]
491
+ },
492
+
493
+ "complianceReport": {
494
+ "wordpressOrgReady": true,
495
+ "accessibilityCompliant": true,
496
+ "performanceOptimized": false,
497
+ "issuesBlocking": ["issue1", "issue2"],
498
+ "recommendationsForSubmission": ["recommendation1", "recommendation2"]
499
+ }
500
+ }
501
+
502
+ **REQUIREMENTS:**
503
+ - Provide specific template file names and line numbers for all issues
504
+ - Include code examples for theme-specific fixes where applicable
505
+ - Prioritize findings by user impact and compliance requirements
506
+ - Focus on WordPress theme-specific best practices and standards
507
+ - Ensure all recommendations are testable and implementable
508
+ - Consider theme type (classic vs block) in recommendations`;
509
+ return { systemAndContext, dataPayload, outputInstructions };
510
+ }
511
+ /**
512
+ * Backwards compatibility method
513
+ */
514
+ getPromptStages(params) {
515
+ return this.getMultiFilePromptStages(params);
516
+ }
517
+ // Unused methods for theme audit workflow
518
+ async discoverRelevantFiles(projectPath, maxDepth, analysisType) {
519
+ const extensions = ['.php', '.css', '.js', '.json', '.xml', '.txt', '.md', '.scss', '.sass'];
520
+ return await this.multiFileAnalysis.discoverFiles(projectPath, extensions, maxDepth);
521
+ }
522
+ async performMultiFileAnalysis(files, params, model, contextLength) {
523
+ return {};
524
+ }
525
+ async analyzeIndividualFile(file, params, model) {
526
+ return {};
527
+ }
528
+ getFileExtensions(analysisType) {
529
+ return ['.php', '.css', '.js', '.json', '.xml', '.txt', '.md', '.scss', '.sass'];
530
+ }
531
+ generateCacheKey(files, params) {
532
+ const fileHash = files.join('|');
533
+ const paramHash = JSON.stringify(params);
534
+ return `${fileHash}_${paramHash}`.substring(0, 64);
535
+ }
536
+ }
537
+ export default WordPressThemeAuditor;
538
+ //# sourceMappingURL=wordpress-theme-audit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordpress-theme-audit.js","sourceRoot":"","sources":["../../../src/prompts/analyze/wordpress-theme-audit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAA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