@houtini/lm 1.0.13 → 2.0.1

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 (264) hide show
  1. package/README.md +67 -237
  2. package/dist/index.d.ts +5 -3
  3. package/dist/index.js +149 -213
  4. package/dist/index.js.map +1 -1
  5. package/package.json +23 -32
  6. package/server.json +44 -0
  7. package/CHANGELOG.md +0 -282
  8. package/dist/cache/analysis-cache.d.ts +0 -33
  9. package/dist/cache/analysis-cache.d.ts.map +0 -1
  10. package/dist/cache/analysis-cache.js +0 -56
  11. package/dist/cache/analysis-cache.js.map +0 -1
  12. package/dist/cache/cache-manager.d.ts +0 -29
  13. package/dist/cache/cache-manager.d.ts.map +0 -1
  14. package/dist/cache/cache-manager.js +0 -85
  15. package/dist/cache/cache-manager.js.map +0 -1
  16. package/dist/cache/index.d.ts +0 -16
  17. package/dist/cache/index.d.ts.map +0 -1
  18. package/dist/cache/index.js +0 -17
  19. package/dist/cache/index.js.map +0 -1
  20. package/dist/cache/prompt-cache.d.ts +0 -33
  21. package/dist/cache/prompt-cache.d.ts.map +0 -1
  22. package/dist/cache/prompt-cache.js +0 -61
  23. package/dist/cache/prompt-cache.js.map +0 -1
  24. package/dist/config.d.ts +0 -41
  25. package/dist/config.d.ts.map +0 -1
  26. package/dist/config.js +0 -71
  27. package/dist/config.js.map +0 -1
  28. package/dist/core/ThreeStagePromptManager.d.ts +0 -23
  29. package/dist/core/ThreeStagePromptManager.d.ts.map +0 -1
  30. package/dist/core/ThreeStagePromptManager.js +0 -118
  31. package/dist/core/ThreeStagePromptManager.js.map +0 -1
  32. package/dist/index.d.ts.map +0 -1
  33. package/dist/plugins/base-plugin.d.ts +0 -55
  34. package/dist/plugins/base-plugin.d.ts.map +0 -1
  35. package/dist/plugins/base-plugin.js +0 -120
  36. package/dist/plugins/base-plugin.js.map +0 -1
  37. package/dist/plugins/index.d.ts +0 -58
  38. package/dist/plugins/index.d.ts.map +0 -1
  39. package/dist/plugins/index.js +0 -162
  40. package/dist/plugins/index.js.map +0 -1
  41. package/dist/plugins/types.d.ts +0 -5
  42. package/dist/plugins/types.d.ts.map +0 -1
  43. package/dist/plugins/types.js +0 -5
  44. package/dist/plugins/types.js.map +0 -1
  45. package/dist/prompts/analyze/code-quality.d.ts +0 -116
  46. package/dist/prompts/analyze/code-quality.d.ts.map +0 -1
  47. package/dist/prompts/analyze/code-quality.js +0 -437
  48. package/dist/prompts/analyze/code-quality.js.map +0 -1
  49. package/dist/prompts/analyze/compare-integration.d.ts +0 -130
  50. package/dist/prompts/analyze/compare-integration.d.ts.map +0 -1
  51. package/dist/prompts/analyze/compare-integration.js +0 -547
  52. package/dist/prompts/analyze/compare-integration.js.map +0 -1
  53. package/dist/prompts/analyze/count-files.d.ts +0 -109
  54. package/dist/prompts/analyze/count-files.d.ts.map +0 -1
  55. package/dist/prompts/analyze/count-files.js +0 -403
  56. package/dist/prompts/analyze/count-files.js.map +0 -1
  57. package/dist/prompts/analyze/database-queries.d.ts +0 -156
  58. package/dist/prompts/analyze/database-queries.d.ts.map +0 -1
  59. package/dist/prompts/analyze/database-queries.js +0 -763
  60. package/dist/prompts/analyze/database-queries.js.map +0 -1
  61. package/dist/prompts/analyze/dependencies.d.ts +0 -97
  62. package/dist/prompts/analyze/dependencies.d.ts.map +0 -1
  63. package/dist/prompts/analyze/dependencies.js +0 -337
  64. package/dist/prompts/analyze/dependencies.js.map +0 -1
  65. package/dist/prompts/analyze/diff-signatures.d.ts +0 -139
  66. package/dist/prompts/analyze/diff-signatures.d.ts.map +0 -1
  67. package/dist/prompts/analyze/diff-signatures.js +0 -708
  68. package/dist/prompts/analyze/diff-signatures.js.map +0 -1
  69. package/dist/prompts/analyze/find-patterns.d.ts +0 -128
  70. package/dist/prompts/analyze/find-patterns.d.ts.map +0 -1
  71. package/dist/prompts/analyze/find-patterns.js +0 -524
  72. package/dist/prompts/analyze/find-patterns.js.map +0 -1
  73. package/dist/prompts/analyze/find-unused-css.d.ts +0 -151
  74. package/dist/prompts/analyze/find-unused-css.d.ts.map +0 -1
  75. package/dist/prompts/analyze/find-unused-css.js +0 -760
  76. package/dist/prompts/analyze/find-unused-css.js.map +0 -1
  77. package/dist/prompts/analyze/n8n-workflow.d.ts +0 -137
  78. package/dist/prompts/analyze/n8n-workflow.d.ts.map +0 -1
  79. package/dist/prompts/analyze/n8n-workflow.js +0 -533
  80. package/dist/prompts/analyze/n8n-workflow.js.map +0 -1
  81. package/dist/prompts/analyze/project-structure.d.ts +0 -126
  82. package/dist/prompts/analyze/project-structure.d.ts.map +0 -1
  83. package/dist/prompts/analyze/project-structure.js +0 -573
  84. package/dist/prompts/analyze/project-structure.js.map +0 -1
  85. package/dist/prompts/analyze/security-audit.d.ts +0 -142
  86. package/dist/prompts/analyze/security-audit.d.ts.map +0 -1
  87. package/dist/prompts/analyze/security-audit.js +0 -641
  88. package/dist/prompts/analyze/security-audit.js.map +0 -1
  89. package/dist/prompts/analyze/single-file.d.ts +0 -162
  90. package/dist/prompts/analyze/single-file.d.ts.map +0 -1
  91. package/dist/prompts/analyze/single-file.js +0 -669
  92. package/dist/prompts/analyze/single-file.js.map +0 -1
  93. package/dist/prompts/analyze/trace-execution.d.ts +0 -126
  94. package/dist/prompts/analyze/trace-execution.d.ts.map +0 -1
  95. package/dist/prompts/analyze/trace-execution.js +0 -613
  96. package/dist/prompts/analyze/trace-execution.js.map +0 -1
  97. package/dist/prompts/analyze/wordpress-plugin-audit.d.ts +0 -116
  98. package/dist/prompts/analyze/wordpress-plugin-audit.d.ts.map +0 -1
  99. package/dist/prompts/analyze/wordpress-plugin-audit.js +0 -456
  100. package/dist/prompts/analyze/wordpress-plugin-audit.js.map +0 -1
  101. package/dist/prompts/analyze/wordpress-plugin-readiness.d.ts +0 -103
  102. package/dist/prompts/analyze/wordpress-plugin-readiness.d.ts.map +0 -1
  103. package/dist/prompts/analyze/wordpress-plugin-readiness.js +0 -506
  104. package/dist/prompts/analyze/wordpress-plugin-readiness.js.map +0 -1
  105. package/dist/prompts/analyze/wordpress-security.d.ts +0 -146
  106. package/dist/prompts/analyze/wordpress-security.d.ts.map +0 -1
  107. package/dist/prompts/analyze/wordpress-security.js +0 -702
  108. package/dist/prompts/analyze/wordpress-security.js.map +0 -1
  109. package/dist/prompts/analyze/wordpress-theme-audit.d.ts +0 -114
  110. package/dist/prompts/analyze/wordpress-theme-audit.d.ts.map +0 -1
  111. package/dist/prompts/analyze/wordpress-theme-audit.js +0 -540
  112. package/dist/prompts/analyze/wordpress-theme-audit.js.map +0 -1
  113. package/dist/prompts/custom/custom-prompt.d.ts +0 -135
  114. package/dist/prompts/custom/custom-prompt.d.ts.map +0 -1
  115. package/dist/prompts/custom/custom-prompt.js +0 -421
  116. package/dist/prompts/custom/custom-prompt.js.map +0 -1
  117. package/dist/prompts/fun/arcade-game.d.ts +0 -152
  118. package/dist/prompts/fun/arcade-game.d.ts.map +0 -1
  119. package/dist/prompts/fun/arcade-game.js +0 -657
  120. package/dist/prompts/fun/arcade-game.js.map +0 -1
  121. package/dist/prompts/fun/create_text_adventure.d.ts +0 -100
  122. package/dist/prompts/fun/create_text_adventure.d.ts.map +0 -1
  123. package/dist/prompts/fun/create_text_adventure.js +0 -401
  124. package/dist/prompts/fun/create_text_adventure.js.map +0 -1
  125. package/dist/prompts/fun/css-art-generator.d.ts +0 -168
  126. package/dist/prompts/fun/css-art-generator.d.ts.map +0 -1
  127. package/dist/prompts/fun/css-art-generator.js +0 -831
  128. package/dist/prompts/fun/css-art-generator.js.map +0 -1
  129. package/dist/prompts/generate/project-documentation.d.ts +0 -137
  130. package/dist/prompts/generate/project-documentation.d.ts.map +0 -1
  131. package/dist/prompts/generate/project-documentation.js +0 -670
  132. package/dist/prompts/generate/project-documentation.js.map +0 -1
  133. package/dist/prompts/generate/refactoring.d.ts +0 -164
  134. package/dist/prompts/generate/refactoring.d.ts.map +0 -1
  135. package/dist/prompts/generate/refactoring.js +0 -625
  136. package/dist/prompts/generate/refactoring.js.map +0 -1
  137. package/dist/prompts/generate/responsive-component.d.ts +0 -147
  138. package/dist/prompts/generate/responsive-component.d.ts.map +0 -1
  139. package/dist/prompts/generate/responsive-component.js +0 -957
  140. package/dist/prompts/generate/responsive-component.js.map +0 -1
  141. package/dist/prompts/generate/typescript-conversion.d.ts +0 -144
  142. package/dist/prompts/generate/typescript-conversion.d.ts.map +0 -1
  143. package/dist/prompts/generate/typescript-conversion.js +0 -531
  144. package/dist/prompts/generate/typescript-conversion.js.map +0 -1
  145. package/dist/prompts/generate/unit-tests.d.ts +0 -139
  146. package/dist/prompts/generate/unit-tests.d.ts.map +0 -1
  147. package/dist/prompts/generate/unit-tests.js +0 -582
  148. package/dist/prompts/generate/unit-tests.js.map +0 -1
  149. package/dist/prompts/generate/wordpress-plugin.d.ts +0 -179
  150. package/dist/prompts/generate/wordpress-plugin.d.ts.map +0 -1
  151. package/dist/prompts/generate/wordpress-plugin.js +0 -767
  152. package/dist/prompts/generate/wordpress-plugin.js.map +0 -1
  153. package/dist/prompts/generate/wordpress-theme-from-static.d.ts +0 -177
  154. package/dist/prompts/generate/wordpress-theme-from-static.d.ts.map +0 -1
  155. package/dist/prompts/generate/wordpress-theme-from-static.js +0 -699
  156. package/dist/prompts/generate/wordpress-theme-from-static.js.map +0 -1
  157. package/dist/prompts/shared/cache-manager.d.ts +0 -45
  158. package/dist/prompts/shared/cache-manager.d.ts.map +0 -1
  159. package/dist/prompts/shared/cache-manager.js +0 -129
  160. package/dist/prompts/shared/cache-manager.js.map +0 -1
  161. package/dist/prompts/shared/helpers.d.ts +0 -39
  162. package/dist/prompts/shared/helpers.d.ts.map +0 -1
  163. package/dist/prompts/shared/helpers.js +0 -151
  164. package/dist/prompts/shared/helpers.js.map +0 -1
  165. package/dist/prompts/shared/templates.d.ts +0 -35
  166. package/dist/prompts/shared/templates.d.ts.map +0 -1
  167. package/dist/prompts/shared/templates.js +0 -77
  168. package/dist/prompts/shared/templates.js.map +0 -1
  169. package/dist/prompts/shared/types.d.ts +0 -112
  170. package/dist/prompts/shared/types.d.ts.map +0 -1
  171. package/dist/prompts/shared/types.js +0 -5
  172. package/dist/prompts/shared/types.js.map +0 -1
  173. package/dist/prompts/system/find-unused-files.d.ts +0 -106
  174. package/dist/prompts/system/find-unused-files.d.ts.map +0 -1
  175. package/dist/prompts/system/find-unused-files.js +0 -357
  176. package/dist/prompts/system/find-unused-files.js.map +0 -1
  177. package/dist/security/index.d.ts +0 -39
  178. package/dist/security/index.d.ts.map +0 -1
  179. package/dist/security/index.js +0 -46
  180. package/dist/security/index.js.map +0 -1
  181. package/dist/security/integration-helpers.d.ts +0 -121
  182. package/dist/security/integration-helpers.d.ts.map +0 -1
  183. package/dist/security/integration-helpers.js +0 -190
  184. package/dist/security/integration-helpers.js.map +0 -1
  185. package/dist/security/output-encoder.d.ts +0 -94
  186. package/dist/security/output-encoder.d.ts.map +0 -1
  187. package/dist/security/output-encoder.js +0 -295
  188. package/dist/security/output-encoder.js.map +0 -1
  189. package/dist/security/prompt-injection-guard.d.ts +0 -59
  190. package/dist/security/prompt-injection-guard.d.ts.map +0 -1
  191. package/dist/security/prompt-injection-guard.js +0 -249
  192. package/dist/security/prompt-injection-guard.js.map +0 -1
  193. package/dist/security/sanitisation.d.ts +0 -67
  194. package/dist/security/sanitisation.d.ts.map +0 -1
  195. package/dist/security/sanitisation.js +0 -398
  196. package/dist/security/sanitisation.js.map +0 -1
  197. package/dist/security/security-service.d.ts +0 -103
  198. package/dist/security/security-service.d.ts.map +0 -1
  199. package/dist/security/security-service.js +0 -303
  200. package/dist/security/security-service.js.map +0 -1
  201. package/dist/security-config.d.ts +0 -45
  202. package/dist/security-config.d.ts.map +0 -1
  203. package/dist/security-config.js +0 -63
  204. package/dist/security-config.js.map +0 -1
  205. package/dist/system/function-list.d.ts +0 -61
  206. package/dist/system/function-list.d.ts.map +0 -1
  207. package/dist/system/function-list.js +0 -111
  208. package/dist/system/function-list.js.map +0 -1
  209. package/dist/system/function-registry.d.ts +0 -23
  210. package/dist/system/function-registry.d.ts.map +0 -1
  211. package/dist/system/function-registry.js +0 -136
  212. package/dist/system/function-registry.js.map +0 -1
  213. package/dist/system/health-check.d.ts +0 -33
  214. package/dist/system/health-check.d.ts.map +0 -1
  215. package/dist/system/health-check.js +0 -98
  216. package/dist/system/health-check.js.map +0 -1
  217. package/dist/system/path-resolver.d.ts +0 -55
  218. package/dist/system/path-resolver.d.ts.map +0 -1
  219. package/dist/system/path-resolver.js +0 -90
  220. package/dist/system/path-resolver.js.map +0 -1
  221. package/dist/templates/plugin-template.d.ts +0 -121
  222. package/dist/templates/plugin-template.d.ts.map +0 -1
  223. package/dist/templates/plugin-template.js +0 -454
  224. package/dist/templates/plugin-template.js.map +0 -1
  225. package/dist/types/chunking-types.d.ts +0 -88
  226. package/dist/types/chunking-types.d.ts.map +0 -1
  227. package/dist/types/chunking-types.js +0 -18
  228. package/dist/types/chunking-types.js.map +0 -1
  229. package/dist/types/prompt-stages.d.ts +0 -30
  230. package/dist/types/prompt-stages.d.ts.map +0 -1
  231. package/dist/types/prompt-stages.js +0 -6
  232. package/dist/types/prompt-stages.js.map +0 -1
  233. package/dist/types.d.ts +0 -45
  234. package/dist/types.d.ts.map +0 -1
  235. package/dist/types.js +0 -6
  236. package/dist/types.js.map +0 -1
  237. package/dist/utils/css-parser.d.ts +0 -26
  238. package/dist/utils/css-parser.d.ts.map +0 -1
  239. package/dist/utils/css-parser.js +0 -117
  240. package/dist/utils/css-parser.js.map +0 -1
  241. package/dist/utils/path-resolver.d.ts +0 -13
  242. package/dist/utils/path-resolver.d.ts.map +0 -1
  243. package/dist/utils/path-resolver.js +0 -78
  244. package/dist/utils/path-resolver.js.map +0 -1
  245. package/dist/utils/plugin-utilities.d.ts +0 -176
  246. package/dist/utils/plugin-utilities.d.ts.map +0 -1
  247. package/dist/utils/plugin-utilities.js +0 -269
  248. package/dist/utils/plugin-utilities.js.map +0 -1
  249. package/dist/utils/streamHandler.d.ts +0 -3
  250. package/dist/utils/streamHandler.d.ts.map +0 -1
  251. package/dist/utils/streamHandler.js +0 -137
  252. package/dist/utils/streamHandler.js.map +0 -1
  253. package/dist/validation/output-validator.d.ts +0 -136
  254. package/dist/validation/output-validator.d.ts.map +0 -1
  255. package/dist/validation/output-validator.js +0 -262
  256. package/dist/validation/output-validator.js.map +0 -1
  257. package/dist/validation/response-factory.d.ts +0 -44
  258. package/dist/validation/response-factory.d.ts.map +0 -1
  259. package/dist/validation/response-factory.js +0 -202
  260. package/dist/validation/response-factory.js.map +0 -1
  261. package/dist/validation/schemas.d.ts +0 -519
  262. package/dist/validation/schemas.d.ts.map +0 -1
  263. package/dist/validation/schemas.js +0 -6
  264. package/dist/validation/schemas.js.map +0 -1
@@ -1,767 +0,0 @@
1
- /**
2
- * WordPress Plugin Generator - Modern v4.3 Universal Template
3
- *
4
- * Generates complete WordPress plugin structures with all necessary files and best practices
5
- * Intelligently handles plugin requirements and generates production-ready code
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 { readFileContent } from '../shared/helpers.js';
11
- import { ModelSetup, ResponseProcessor, ParameterValidator, ErrorHandler, MultiFileAnalysis, TokenCalculator } from '../../utils/plugin-utilities.js';
12
- import { getAnalysisCache } from '../../cache/index.js';
13
- // Common Node.js modules - Use these instead of require()
14
- import { basename, extname, relative } from 'path';
15
- export class WordPressPluginGenerator extends BasePlugin {
16
- constructor() {
17
- super();
18
- this.name = 'generate_wordpress_plugin';
19
- this.category = 'generate';
20
- this.description = 'Generate a complete WordPress plugin structure with all necessary files and best practices';
21
- // Universal parameter set - supports both single and multi-file scenarios
22
- this.parameters = {
23
- // WordPress plugin specific parameters
24
- name: {
25
- type: 'string',
26
- description: 'Plugin name',
27
- required: true
28
- },
29
- description: {
30
- type: 'string',
31
- description: 'Plugin description',
32
- required: true
33
- },
34
- features: {
35
- type: 'array',
36
- description: 'List of features to include',
37
- required: true,
38
- items: { type: 'string' }
39
- },
40
- prefix: {
41
- type: 'string',
42
- description: 'Plugin prefix for functions and classes (e.g., "wp_my_plugin")',
43
- required: true
44
- },
45
- // Optional WordPress parameters
46
- wpVersion: {
47
- type: 'string',
48
- description: 'Minimum WordPress version',
49
- required: false,
50
- default: '6.0'
51
- },
52
- phpVersion: {
53
- type: 'string',
54
- description: 'Minimum PHP version',
55
- required: false,
56
- default: '7.4'
57
- },
58
- textDomain: {
59
- type: 'string',
60
- description: 'Text domain for internationalization',
61
- required: false
62
- },
63
- // Feature flags
64
- includeAdmin: {
65
- type: 'boolean',
66
- description: 'Include admin interface',
67
- required: false,
68
- default: true
69
- },
70
- includeDatabase: {
71
- type: 'boolean',
72
- description: 'Include database tables',
73
- required: false,
74
- default: false
75
- },
76
- includeAjax: {
77
- type: 'boolean',
78
- description: 'Include AJAX handlers',
79
- required: false,
80
- default: false
81
- },
82
- includeRest: {
83
- type: 'boolean',
84
- description: 'Include REST API endpoints',
85
- required: false,
86
- default: false
87
- },
88
- includeGutenberg: {
89
- type: 'boolean',
90
- description: 'Include Gutenberg blocks',
91
- required: false,
92
- default: false
93
- },
94
- // Template compatibility parameters (for future flexibility)
95
- code: {
96
- type: 'string',
97
- description: 'Existing plugin code to analyze (for single-file analysis)',
98
- required: false
99
- },
100
- filePath: {
101
- type: 'string',
102
- description: 'Path to existing plugin file to analyze',
103
- required: false
104
- },
105
- projectPath: {
106
- type: 'string',
107
- description: 'Path to existing plugin project root (for multi-file analysis)',
108
- required: false
109
- },
110
- files: {
111
- type: 'array',
112
- description: 'Array of specific plugin files to analyze (for multi-file analysis)',
113
- required: false,
114
- items: { type: 'string' }
115
- },
116
- maxDepth: {
117
- type: 'number',
118
- description: 'Maximum directory depth for plugin analysis (1-5)',
119
- required: false,
120
- default: 3
121
- },
122
- // Universal parameters
123
- language: {
124
- type: 'string',
125
- description: 'Programming language (PHP for WordPress)',
126
- required: false,
127
- default: 'php'
128
- },
129
- analysisDepth: {
130
- type: 'string',
131
- description: 'Level of plugin generation detail',
132
- enum: ['basic', 'detailed', 'comprehensive'],
133
- default: 'comprehensive',
134
- required: false
135
- },
136
- analysisType: {
137
- type: 'string',
138
- description: 'Type of plugin generation to perform',
139
- enum: ['simple', 'advanced', 'comprehensive'],
140
- default: 'comprehensive',
141
- required: false
142
- }
143
- };
144
- this.analysisCache = getAnalysisCache();
145
- this.multiFileAnalysis = new MultiFileAnalysis();
146
- // Cache and analysis utilities are initialized above
147
- }
148
- async execute(params, llmClient) {
149
- return await withSecurity(this, params, llmClient, async (secureParams) => {
150
- try {
151
- // 1. Auto-detect analysis mode based on parameters
152
- const analysisMode = this.detectAnalysisMode(secureParams);
153
- // 2. Validate parameters based on detected mode
154
- this.validateParameters(secureParams, analysisMode);
155
- // 3. Setup model
156
- const { model, contextLength } = await ModelSetup.getReadyModel(llmClient);
157
- // 4. Route to appropriate analysis method
158
- if (analysisMode === 'single-file') {
159
- return await this.executeSingleFileAnalysis(secureParams, model, contextLength);
160
- }
161
- else {
162
- return await this.executeMultiFileAnalysis(secureParams, model, contextLength);
163
- }
164
- }
165
- catch (error) {
166
- return ErrorHandler.createExecutionError('generate_wordpress_plugin', error);
167
- }
168
- });
169
- }
170
- /**
171
- * Auto-detect whether this is plugin generation or plugin analysis
172
- *
173
- * For WordPress plugins, we default to generation (single-file mode) unless
174
- * existing plugin files are provided for analysis
175
- */
176
- detectAnalysisMode(params) {
177
- // Multi-file mode: when analyzing existing plugin projects
178
- if (params.projectPath || params.files) {
179
- return 'multi-file';
180
- }
181
- // Single-file mode: when analyzing individual plugin files or generating new plugins
182
- if (params.code || params.filePath) {
183
- return 'single-file';
184
- }
185
- // Default to single-file for plugin generation (most common use case)
186
- return 'single-file';
187
- }
188
- /**
189
- * Validate parameters based on detected analysis mode
190
- */
191
- validateParameters(params, mode) {
192
- if (mode === 'single-file') {
193
- // For plugin generation, require plugin-specific parameters
194
- if (!params.code && !params.filePath) {
195
- // This is plugin generation - validate required fields
196
- if (!params.name || !params.description || !params.features || !params.prefix) {
197
- throw new Error('For plugin generation: name, description, features, and prefix are required');
198
- }
199
- }
200
- else {
201
- // This is plugin analysis - use standard validation
202
- ParameterValidator.validateCodeOrFile(params);
203
- }
204
- }
205
- else {
206
- ParameterValidator.validateProjectPath(params);
207
- ParameterValidator.validateDepth(params);
208
- }
209
- // Universal validations
210
- ParameterValidator.validateEnum(params, 'analysisType', ['simple', 'advanced', 'comprehensive']);
211
- ParameterValidator.validateEnum(params, 'analysisDepth', ['basic', 'detailed', 'comprehensive']);
212
- }
213
- /**
214
- * Execute single-file analysis (plugin generation or single file analysis)
215
- */
216
- async executeSingleFileAnalysis(params, model, contextLength) {
217
- // Process single file input if provided, otherwise this is plugin generation
218
- let codeToAnalyze = params.code;
219
- if (params.filePath) {
220
- codeToAnalyze = await readFileContent(params.filePath);
221
- }
222
- // Generate prompt stages for single file (generation or analysis)
223
- const promptStages = this.getSingleFilePromptStages({
224
- ...params,
225
- code: codeToAnalyze
226
- });
227
- // Execute with appropriate method
228
- const promptManager = new ThreeStagePromptManager();
229
- const needsChunking = TokenCalculator.needsChunking(promptStages, contextLength);
230
- if (needsChunking) {
231
- const chunkSize = TokenCalculator.calculateOptimalChunkSize(promptStages, contextLength);
232
- const dataChunks = promptManager.chunkDataPayload(promptStages.dataPayload, chunkSize);
233
- const conversation = promptManager.createChunkedConversation(promptStages, dataChunks);
234
- const messages = [
235
- conversation.systemMessage,
236
- ...conversation.dataMessages,
237
- conversation.analysisMessage
238
- ];
239
- return await ResponseProcessor.executeChunked(messages, model, contextLength, 'generate_wordpress_plugin', 'single');
240
- }
241
- else {
242
- return await ResponseProcessor.executeDirect(promptStages, model, contextLength, 'generate_wordpress_plugin');
243
- }
244
- }
245
- /**
246
- * Execute multi-file analysis (existing plugin project analysis)
247
- */
248
- async executeMultiFileAnalysis(params, model, contextLength) {
249
- // Discover files
250
- let filesToAnalyze = params.files ||
251
- await this.discoverRelevantFiles(params.projectPath, params.maxDepth, params.analysisType);
252
- // Perform multi-file analysis with caching
253
- const analysisResult = await this.performMultiFileAnalysis(filesToAnalyze, params, model, contextLength);
254
- // Generate prompt stages for multi-file
255
- const promptStages = this.getMultiFilePromptStages({
256
- ...params,
257
- analysisResult,
258
- fileCount: filesToAnalyze.length
259
- });
260
- // Always use chunking for multi-file
261
- const promptManager = new ThreeStagePromptManager();
262
- const chunkSize = TokenCalculator.calculateOptimalChunkSize(promptStages, contextLength);
263
- const dataChunks = promptManager.chunkDataPayload(promptStages.dataPayload, chunkSize);
264
- const conversation = promptManager.createChunkedConversation(promptStages, dataChunks);
265
- const messages = [
266
- conversation.systemMessage,
267
- ...conversation.dataMessages,
268
- conversation.analysisMessage
269
- ];
270
- return await ResponseProcessor.executeChunked(messages, model, contextLength, 'generate_wordpress_plugin', 'multifile');
271
- }
272
- /**
273
- * Single-file prompt stages - WordPress plugin generation or single file analysis
274
- */
275
- getSingleFilePromptStages(params) {
276
- const { code, analysisDepth, analysisType, name, description, features, prefix } = params;
277
- // Determine if this is generation or analysis
278
- const isGeneration = !code && name && description && features && prefix;
279
- let systemAndContext;
280
- let dataPayload;
281
- let outputInstructions;
282
- if (isGeneration) {
283
- // Plugin Generation Mode
284
- systemAndContext = `You are an expert WordPress plugin developer specializing in ${analysisDepth} ${analysisType} plugin development.
285
-
286
- WordPress Plugin Development Expertise:
287
- - WordPress Standards: Follow WordPress Coding Standards (WPCS) meticulously
288
- - Security Best Practices: Implement proper nonces, capabilities, escaping, and sanitization
289
- - Modern PHP Architecture: Use namespaces, dependency injection, and design patterns
290
- - Compatibility: WordPress ${params.wpVersion || '6.0'}+ and PHP ${params.phpVersion || '7.4'}+
291
- - Internationalization: Ready for translation with proper text domains
292
- - Performance: Optimize for speed, lazy loading, and minimal footprint
293
- - Accessibility: WCAG compliant admin interfaces
294
- - Code Quality: Clean, maintainable, well-documented code
295
-
296
- Generation Context:
297
- - Plugin Generation Mode: Creating complete, production-ready plugin structure
298
- - Analysis Depth: ${analysisDepth}
299
- - Plugin Complexity: ${analysisType}
300
-
301
- Your task is to generate a complete, professional WordPress plugin that developers can immediately use in production.`;
302
- dataPayload = `WordPress Plugin Requirements:
303
-
304
- **Core Details:**
305
- - Plugin Name: ${name}
306
- - Description: ${description}
307
- - Features Required: ${features.join(', ')}
308
- - Function Prefix: ${prefix}
309
- - Text Domain: ${params.textDomain || prefix}
310
-
311
- **Technical Requirements:**
312
- - Minimum WordPress Version: ${params.wpVersion || '6.0'}
313
- - Minimum PHP Version: ${params.phpVersion || '7.4'}
314
- - Include Admin Interface: ${params.includeAdmin !== false}
315
- - Include Database Tables: ${params.includeDatabase || false}
316
- - Include AJAX Handlers: ${params.includeAjax || false}
317
- - Include REST API Endpoints: ${params.includeRest || false}
318
- - Include Gutenberg Blocks: ${params.includeGutenberg || false}
319
-
320
- **Quality Standards Required:**
321
- - WordPress Coding Standards (WPCS) compliance
322
- - Security-first approach with proper sanitization
323
- - Internationalization ready
324
- - Performance optimized
325
- - Accessibility compliant admin interfaces
326
- - Comprehensive documentation`;
327
- outputInstructions = `Generate a complete WordPress plugin structure with production-ready code, comprehensive QA analysis, and deployment package preparation:
328
-
329
- ## Part 1: Complete Plugin Architecture
330
-
331
- ### 1. Main Plugin File (${prefix}.php)
332
- - Complete plugin header with all metadata
333
- - Namespace: ${prefix.charAt(0).toUpperCase() + prefix.slice(1)}
334
- - Main plugin class with singleton pattern
335
- - Proper activation/deactivation hooks with error handling
336
- - Security checks and early exits
337
- - **CRITICAL**: Include activation safety checks to prevent fatal errors
338
-
339
- ### 2. Core Plugin Structure
340
- - **Includes Directory**: Core functionality classes
341
- - Main plugin class (${prefix}-core.php)
342
- - Activation/deactivation handlers with rollback capability
343
- - Security and validation utilities
344
-
345
- ${params.includeAdmin !== false ? `
346
- ### 3. Admin Interface (admin/)
347
- - Admin menu registration with proper capabilities
348
- - Settings API implementation with sections and fields
349
- - Form handling with nonces and validation
350
- - Admin notices system with dismissible functionality
351
- - Dashboard widgets (if relevant)` : ''}
352
-
353
- ${params.includeDatabase ? `
354
- ### 4. Database Layer (includes/database/)
355
- - Custom table schema with proper indexes and rollback
356
- - Database abstraction layer with $wpdb
357
- - Migration system with version checking
358
- - Data validation and sanitization layers with error recovery` : ''}
359
-
360
- ${params.includeAjax ? `
361
- ### 5. AJAX System (includes/ajax/)
362
- - Nonce verification for all AJAX calls
363
- - Capability checks and user permissions
364
- - Structured response formatting with error codes
365
- - Error handling and logging with graceful degradation` : ''}
366
-
367
- ${params.includeRest ? `
368
- ### 6. REST API (includes/rest/)
369
- - Custom endpoint registration with permission callbacks
370
- - Authentication and authorization layers
371
- - Request/response schema definitions with validation
372
- - API versioning and backward compatibility` : ''}
373
-
374
- ${params.includeGutenberg ? `
375
- ### 7. Gutenberg Integration (blocks/)
376
- - Block registration with fallback for older WordPress
377
- - JavaScript/CSS asset management with dependency checking
378
- - Block attributes and server-side rendering
379
- - Editor and frontend styles with theme compatibility` : ''}
380
-
381
- ## Part 2: Essential WordPress Standards Implementation
382
-
383
- ### Security Requirements (MANDATORY):
384
- - Nonce verification: wp_verify_nonce() for ALL forms and AJAX
385
- - Capability checks: current_user_can() for ALL admin functions
386
- - Data escaping: esc_html(), esc_attr(), esc_url() for ALL output
387
- - Input sanitization: sanitize_text_field(), sanitize_email(), etc.
388
- - SQL injection prevention: $wpdb prepared statements ONLY
389
- - File inclusion security: Absolute paths and existence checks
390
-
391
- ### Activation Safety Requirements (CRITICAL):
392
- - PHP version compatibility checks before class definitions
393
- - WordPress version compatibility verification
394
- - Required function/class existence checks
395
- - Database connection verification (if database features used)
396
- - Write permission checks for required directories
397
- - Memory limit and execution time considerations
398
- - Graceful failure with informative error messages
399
-
400
- ### Code Quality Requirements:
401
- - WordPress hooks: Properly registered actions and filters
402
- - Error handling: Try-catch blocks with wp_die() for user-facing errors
403
- - Logging: error_log() for debugging with conditional logging
404
- - Documentation: PHPDoc blocks for ALL functions and classes
405
- - Coding standards: WordPress-VIP-Go standards compliance
406
-
407
- ### Performance Requirements:
408
- - Lazy loading: Load heavy resources only when needed
409
- - Caching: Implement transients with expiration and cleanup
410
- - Database optimization: Proper indexes and optimized queries
411
- - Asset optimization: Minification and concatenation strategies
412
-
413
- ## Part 3: QA Analysis and Validation
414
-
415
- ### Pre-Activation Checklist Analysis:
416
- Provide a comprehensive QA analysis covering:
417
-
418
- 1. **Fatal Error Prevention:**
419
- - All class names unique and properly namespaced
420
- - All function names prefixed to avoid conflicts
421
- - All required files exist and are properly included
422
- - All WordPress functions have availability checks
423
- - All third-party dependencies properly loaded
424
-
425
- 2. **Security Vulnerability Assessment:**
426
- - All user inputs properly sanitized
427
- - All outputs properly escaped
428
- - All nonces implemented correctly
429
- - All capability checks in place
430
- - All SQL queries use prepared statements
431
-
432
- 3. **WordPress Compatibility Verification:**
433
- - Minimum WordPress version requirements met
434
- - Hooks and filters properly registered
435
- - Admin interfaces follow WordPress UI guidelines
436
- - Internationalization properly implemented
437
- - Settings API correctly utilized
438
-
439
- 4. **Performance Impact Assessment:**
440
- - Database queries optimized and indexed
441
- - Assets properly enqueued with dependencies
442
- - Caching implemented where beneficial
443
- - Memory usage considerations addressed
444
-
445
- ## Part 4: Deployment Package Preparation
446
-
447
- ### ZIP Package Instructions:
448
- 1. **File Structure for ZIP**: Complete directory listing for packaging
449
- 2. **README.txt Creation**: WordPress.org standard readme with installation steps
450
- 3. **Version Management**: Clear version numbering and changelog
451
- 4. **Asset Optimization**: Minified CSS/JS for production
452
- 5. **Permission Settings**: Correct file permissions (644 for files, 755 for directories)
453
-
454
- ### Installation Testing Checklist:
455
- 1. **Upload Test**: ZIP file uploads successfully via WordPress admin
456
- 2. **Activation Test**: Plugin activates without fatal errors
457
- 3. **Functionality Test**: All features work as expected
458
- 4. **Deactivation Test**: Plugin deactivates cleanly without orphaned data
459
- 5. **Reactivation Test**: Plugin reactivates properly with saved settings
460
-
461
- ## Part 5: Output Format Requirements
462
-
463
- Provide your response in exactly this structure:
464
-
465
- ### A. Complete Plugin Code
466
- [All plugin files with full, production-ready code]
467
-
468
- ### B. QA Analysis Report
469
- \`\`\`
470
- # Plugin QA Analysis Report
471
-
472
- ## Fatal Error Prevention: ✅ PASS / ⚠️ WARNING / ❌ FAIL
473
- - Class naming conflicts: [assessment]
474
- - Function naming conflicts: [assessment]
475
- - File inclusion safety: [assessment]
476
- - WordPress function availability: [assessment]
477
-
478
- ## Security Assessment: ✅ PASS / ⚠️ WARNING / ❌ FAIL
479
- - Input sanitization: [assessment]
480
- - Output escaping: [assessment]
481
- - Nonce implementation: [assessment]
482
- - Capability checks: [assessment]
483
- - SQL injection prevention: [assessment]
484
-
485
- ## WordPress Compatibility: ✅ PASS / ⚠️ WARNING / ❌ FAIL
486
- - Version requirements: [assessment]
487
- - Hook implementation: [assessment]
488
- - Admin UI compliance: [assessment]
489
- - Internationalization: [assessment]
490
-
491
- ## Performance Assessment: ✅ PASS / ⚠️ WARNING / ❌ FAIL
492
- - Database optimization: [assessment]
493
- - Asset management: [assessment]
494
- - Caching implementation: [assessment]
495
- - Memory usage: [assessment]
496
-
497
- ## Overall Plugin Grade: A / B / C / D / F
498
- [Summary of plugin quality and readiness]
499
- \`\`\`
500
-
501
- ### C. ZIP Package Creation Guide
502
- \`\`\`
503
- # Plugin ZIP Package Instructions
504
-
505
- 1. **Create ZIP Structure:**
506
- - Include all plugin files in folder named: ${prefix}
507
- - Maintain exact directory structure shown above
508
- - Include README.txt with WordPress.org format
509
-
510
- 2. **File Permissions:**
511
- - PHP files: 644
512
- - CSS/JS files: 644
513
- - Directories: 755
514
-
515
- 3. **ZIP Creation Command:**
516
- [Provide command-line or manual ZIP creation steps]
517
-
518
- 4. **Upload Instructions:**
519
- - Navigate to WordPress Admin → Plugins → Add New → Upload Plugin
520
- - Select the created ZIP file
521
- - Click "Install Now"
522
- - Activate the plugin
523
- \`\`\`
524
-
525
- ### D. Testing Checklist
526
- \`\`\`
527
- # Pre-Deployment Testing
528
-
529
- □ ZIP file uploads successfully
530
- □ Plugin activates without errors
531
- □ Admin menu appears correctly
532
- □ Settings page functions properly
533
- □ All features work as designed
534
- □ No PHP errors in debug log
535
- □ Plugin deactivates cleanly
536
- □ Reactivation works properly
537
- □ No database orphans after deactivation
538
- \`\`\`
539
-
540
- Provide complete, functional, production-ready code that has been thoroughly analyzed for activation safety, security vulnerabilities, and WordPress compatibility. Include comprehensive QA analysis, deployment preparation, and testing procedures.`;
541
- }
542
- else {
543
- // Plugin Analysis Mode
544
- systemAndContext = `You are an expert WordPress plugin analyst specializing in ${analysisDepth} ${analysisType} analysis.
545
-
546
- Analysis Context:
547
- - Language: PHP (WordPress)
548
- - Analysis Depth: ${analysisDepth}
549
- - Analysis Type: ${analysisType}
550
- - Mode: Single WordPress Plugin File Analysis
551
-
552
- Your task is to provide actionable insights and recommendations for this individual WordPress plugin file.`;
553
- dataPayload = `WordPress plugin code to analyze:
554
-
555
- \`\`\`php
556
- ${code}
557
- \`\`\``;
558
- outputInstructions = `Provide comprehensive WordPress plugin analysis in the following structured format:
559
-
560
- {
561
- "summary": "Brief overview of this plugin file's purpose and functionality",
562
- "analysis": {
563
- "wordpressCompliance": {
564
- "codingStandards": "assessment of WPCS compliance",
565
- "hooksUsage": "evaluation of actions and filters usage",
566
- "apiUsage": "assessment of WordPress API usage"
567
- },
568
- "security": {
569
- "nonceUsage": "evaluation of nonce implementation",
570
- "sanitization": "input sanitization assessment",
571
- "escaping": "output escaping assessment",
572
- "capabilities": "user capability checks assessment"
573
- },
574
- "functionality": {
575
- "coreFeatures": ["list of main features identified"],
576
- "integrations": ["WordPress integrations detected"],
577
- "dependencies": ["external dependencies identified"]
578
- },
579
- "codeQuality": {
580
- "structure": "code organization assessment",
581
- "documentation": "code documentation quality",
582
- "errorHandling": "error handling implementation"
583
- }
584
- },
585
- "recommendations": [
586
- "specific WordPress-focused recommendations for improvement"
587
- ],
588
- "securityConcerns": [
589
- "identified security issues with suggested fixes"
590
- ],
591
- "confidence": 0.85
592
- }`;
593
- }
594
- return { systemAndContext, dataPayload, outputInstructions };
595
- }
596
- /**
597
- * Multi-file prompt stages - WordPress plugin project analysis
598
- */
599
- getMultiFilePromptStages(params) {
600
- const { analysisResult, analysisType, analysisDepth, fileCount } = params;
601
- const systemAndContext = `You are an expert WordPress plugin architect specializing in ${analysisDepth} ${analysisType} analysis.
602
-
603
- WordPress Plugin Project Analysis Context:
604
- - Analysis Type: ${analysisType}
605
- - Analysis Depth: ${analysisDepth}
606
- - Files Analyzed: ${fileCount}
607
- - Mode: Multi-File WordPress Plugin Project Analysis
608
-
609
- Your task is to provide comprehensive architectural insights and recommendations for this WordPress plugin project.`;
610
- const dataPayload = `WordPress plugin project analysis results:
611
-
612
- ${JSON.stringify(analysisResult, null, 2)}`;
613
- const outputInstructions = `Provide comprehensive WordPress plugin project analysis in the following structured format:
614
-
615
- {
616
- "summary": "Overall WordPress plugin project assessment",
617
- "architecture": {
618
- "pluginStructure": "evaluation of plugin organization and structure",
619
- "namespacing": "assessment of PHP namespacing and class organization",
620
- "hookSystem": "evaluation of WordPress hooks implementation across files"
621
- },
622
- "crossFileFindings": [
623
- {
624
- "type": "security|performance|compatibility|standards",
625
- "severity": "high|medium|low",
626
- "description": "Cross-file issue description in WordPress context",
627
- "affectedFiles": ["file1.php", "file2.php"],
628
- "recommendation": "WordPress-specific fix recommendation"
629
- }
630
- ],
631
- "wordpressCompliance": {
632
- "codingStandards": "overall WPCS compliance assessment",
633
- "securityImplementation": "security best practices implementation",
634
- "performanceOptimization": "performance optimization assessment",
635
- "accessibilityCompliance": "accessibility standards compliance"
636
- },
637
- "recommendations": [
638
- "project-wide WordPress plugin improvement recommendations"
639
- ],
640
- "migrationPath": "suggestions for modernizing the plugin architecture"
641
- }`;
642
- return { systemAndContext, dataPayload, outputInstructions };
643
- }
644
- /**
645
- * Backwards compatibility method
646
- */
647
- getPromptStages(params) {
648
- const mode = this.detectAnalysisMode(params);
649
- if (mode === 'single-file') {
650
- return this.getSingleFilePromptStages(params);
651
- }
652
- else {
653
- return this.getMultiFilePromptStages(params);
654
- }
655
- }
656
- // Multi-file helper methods
657
- async discoverRelevantFiles(projectPath, maxDepth, analysisType) {
658
- const extensions = this.getFileExtensions(analysisType);
659
- return await this.multiFileAnalysis.discoverFiles(projectPath, extensions, maxDepth);
660
- }
661
- async performMultiFileAnalysis(files, params, model, contextLength) {
662
- const cacheKey = this.analysisCache.generateKey('generate_wordpress_plugin', params, files);
663
- const cached = await this.analysisCache.get(cacheKey);
664
- if (cached)
665
- return cached;
666
- const fileAnalysisResults = await this.multiFileAnalysis.analyzeBatch(files, (file) => this.analyzeIndividualFile(file, params, model), contextLength);
667
- // Aggregate results into proper analysis result format
668
- const aggregatedResult = {
669
- summary: `WordPress plugin project analysis of ${files.length} files`,
670
- findings: fileAnalysisResults,
671
- data: {
672
- fileCount: files.length,
673
- totalSize: fileAnalysisResults.reduce((sum, result) => sum + (result.size || 0), 0),
674
- pluginStructure: this.analyzePluginStructure(fileAnalysisResults),
675
- phpFiles: fileAnalysisResults.filter(f => f.extension === '.php').length,
676
- jsFiles: fileAnalysisResults.filter(f => f.extension === '.js').length,
677
- cssFiles: fileAnalysisResults.filter(f => f.extension === '.css').length
678
- }
679
- };
680
- await this.analysisCache.cacheAnalysis(cacheKey, aggregatedResult, {
681
- modelUsed: model.identifier || 'unknown',
682
- executionTime: Date.now() - Date.now(), // TODO: Track actual execution time
683
- timestamp: new Date().toISOString()
684
- });
685
- return aggregatedResult;
686
- }
687
- async analyzeIndividualFile(file, params, model) {
688
- const content = await import('fs/promises').then(fs => fs.readFile(file, 'utf-8'));
689
- const stats = await import('fs/promises').then(fs => fs.stat(file));
690
- // WordPress-specific file analysis
691
- const isMainPluginFile = basename(file).endsWith('.php') && content.includes('Plugin Name:');
692
- const hasWordPressHooks = content.includes('add_action') || content.includes('add_filter');
693
- const hasSecurityChecks = content.includes('wp_verify_nonce') || content.includes('current_user_can');
694
- return {
695
- filePath: file,
696
- fileName: basename(file),
697
- size: content.length,
698
- lines: content.split('\n').length,
699
- extension: extname(file),
700
- relativePath: relative(params.projectPath || '', file),
701
- isMainPluginFile,
702
- hasWordPressHooks,
703
- hasSecurityChecks,
704
- fileType: this.categorizeWordPressFile(file, content)
705
- };
706
- }
707
- categorizeWordPressFile(filePath, content) {
708
- const fileName = basename(filePath).toLowerCase();
709
- const fileContent = content.toLowerCase();
710
- if (fileName.endsWith('.php')) {
711
- if (fileContent.includes('plugin name:'))
712
- return 'main-plugin-file';
713
- if (fileName.includes('admin'))
714
- return 'admin-file';
715
- if (fileName.includes('ajax'))
716
- return 'ajax-handler';
717
- if (fileName.includes('rest') || fileName.includes('api'))
718
- return 'rest-api';
719
- if (fileName.includes('block'))
720
- return 'gutenberg-block';
721
- if (fileName.includes('widget'))
722
- return 'widget';
723
- if (fileName.includes('shortcode'))
724
- return 'shortcode';
725
- return 'php-file';
726
- }
727
- if (fileName.endsWith('.js')) {
728
- if (fileContent.includes('wp.blocks'))
729
- return 'gutenberg-script';
730
- if (fileContent.includes('jquery'))
731
- return 'jquery-script';
732
- return 'javascript-file';
733
- }
734
- if (fileName.endsWith('.css')) {
735
- if (fileName.includes('admin'))
736
- return 'admin-styles';
737
- return 'stylesheet';
738
- }
739
- return 'other-file';
740
- }
741
- analyzePluginStructure(fileResults) {
742
- const structure = {
743
- hasMainFile: fileResults.some(f => f.isMainPluginFile),
744
- hasAdminInterface: fileResults.some(f => f.fileType === 'admin-file'),
745
- hasAjaxHandlers: fileResults.some(f => f.fileType === 'ajax-handler'),
746
- hasRestAPI: fileResults.some(f => f.fileType === 'rest-api'),
747
- hasGutenbergBlocks: fileResults.some(f => f.fileType === 'gutenberg-block' || f.fileType === 'gutenberg-script'),
748
- securityImplementation: fileResults.filter(f => f.hasSecurityChecks).length / fileResults.length
749
- };
750
- return structure;
751
- }
752
- getFileExtensions(analysisType) {
753
- const extensionMap = {
754
- 'simple': ['.php', '.js', '.css'],
755
- 'advanced': ['.php', '.js', '.css', '.json', '.md', '.txt'],
756
- 'comprehensive': ['.php', '.js', '.css', '.json', '.md', '.txt', '.xml', '.yml', '.yaml', '.po', '.pot']
757
- };
758
- return extensionMap[analysisType] || extensionMap.comprehensive;
759
- }
760
- generateCacheKey(files, params) {
761
- const fileHash = files.join('|');
762
- const paramHash = JSON.stringify(params);
763
- return `${fileHash}_${paramHash}`.substring(0, 64);
764
- }
765
- }
766
- export default WordPressPluginGenerator;
767
- //# sourceMappingURL=wordpress-plugin.js.map