@houtini/lm 1.0.12 → 2.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 (263) hide show
  1. package/README.md +5 -6
  2. package/dist/index.d.ts +5 -3
  3. package/dist/index.js +142 -213
  4. package/dist/index.js.map +1 -1
  5. package/package.json +10 -33
  6. package/CHANGELOG.md +0 -282
  7. package/dist/cache/analysis-cache.d.ts +0 -33
  8. package/dist/cache/analysis-cache.d.ts.map +0 -1
  9. package/dist/cache/analysis-cache.js +0 -56
  10. package/dist/cache/analysis-cache.js.map +0 -1
  11. package/dist/cache/cache-manager.d.ts +0 -29
  12. package/dist/cache/cache-manager.d.ts.map +0 -1
  13. package/dist/cache/cache-manager.js +0 -85
  14. package/dist/cache/cache-manager.js.map +0 -1
  15. package/dist/cache/index.d.ts +0 -16
  16. package/dist/cache/index.d.ts.map +0 -1
  17. package/dist/cache/index.js +0 -17
  18. package/dist/cache/index.js.map +0 -1
  19. package/dist/cache/prompt-cache.d.ts +0 -33
  20. package/dist/cache/prompt-cache.d.ts.map +0 -1
  21. package/dist/cache/prompt-cache.js +0 -61
  22. package/dist/cache/prompt-cache.js.map +0 -1
  23. package/dist/config.d.ts +0 -41
  24. package/dist/config.d.ts.map +0 -1
  25. package/dist/config.js +0 -71
  26. package/dist/config.js.map +0 -1
  27. package/dist/core/ThreeStagePromptManager.d.ts +0 -23
  28. package/dist/core/ThreeStagePromptManager.d.ts.map +0 -1
  29. package/dist/core/ThreeStagePromptManager.js +0 -118
  30. package/dist/core/ThreeStagePromptManager.js.map +0 -1
  31. package/dist/index.d.ts.map +0 -1
  32. package/dist/plugins/base-plugin.d.ts +0 -55
  33. package/dist/plugins/base-plugin.d.ts.map +0 -1
  34. package/dist/plugins/base-plugin.js +0 -120
  35. package/dist/plugins/base-plugin.js.map +0 -1
  36. package/dist/plugins/index.d.ts +0 -58
  37. package/dist/plugins/index.d.ts.map +0 -1
  38. package/dist/plugins/index.js +0 -162
  39. package/dist/plugins/index.js.map +0 -1
  40. package/dist/plugins/types.d.ts +0 -5
  41. package/dist/plugins/types.d.ts.map +0 -1
  42. package/dist/plugins/types.js +0 -5
  43. package/dist/plugins/types.js.map +0 -1
  44. package/dist/prompts/analyze/code-quality.d.ts +0 -116
  45. package/dist/prompts/analyze/code-quality.d.ts.map +0 -1
  46. package/dist/prompts/analyze/code-quality.js +0 -437
  47. package/dist/prompts/analyze/code-quality.js.map +0 -1
  48. package/dist/prompts/analyze/compare-integration.d.ts +0 -130
  49. package/dist/prompts/analyze/compare-integration.d.ts.map +0 -1
  50. package/dist/prompts/analyze/compare-integration.js +0 -547
  51. package/dist/prompts/analyze/compare-integration.js.map +0 -1
  52. package/dist/prompts/analyze/count-files.d.ts +0 -109
  53. package/dist/prompts/analyze/count-files.d.ts.map +0 -1
  54. package/dist/prompts/analyze/count-files.js +0 -403
  55. package/dist/prompts/analyze/count-files.js.map +0 -1
  56. package/dist/prompts/analyze/database-queries.d.ts +0 -156
  57. package/dist/prompts/analyze/database-queries.d.ts.map +0 -1
  58. package/dist/prompts/analyze/database-queries.js +0 -763
  59. package/dist/prompts/analyze/database-queries.js.map +0 -1
  60. package/dist/prompts/analyze/dependencies.d.ts +0 -97
  61. package/dist/prompts/analyze/dependencies.d.ts.map +0 -1
  62. package/dist/prompts/analyze/dependencies.js +0 -337
  63. package/dist/prompts/analyze/dependencies.js.map +0 -1
  64. package/dist/prompts/analyze/diff-signatures.d.ts +0 -139
  65. package/dist/prompts/analyze/diff-signatures.d.ts.map +0 -1
  66. package/dist/prompts/analyze/diff-signatures.js +0 -708
  67. package/dist/prompts/analyze/diff-signatures.js.map +0 -1
  68. package/dist/prompts/analyze/find-patterns.d.ts +0 -128
  69. package/dist/prompts/analyze/find-patterns.d.ts.map +0 -1
  70. package/dist/prompts/analyze/find-patterns.js +0 -524
  71. package/dist/prompts/analyze/find-patterns.js.map +0 -1
  72. package/dist/prompts/analyze/find-unused-css.d.ts +0 -151
  73. package/dist/prompts/analyze/find-unused-css.d.ts.map +0 -1
  74. package/dist/prompts/analyze/find-unused-css.js +0 -760
  75. package/dist/prompts/analyze/find-unused-css.js.map +0 -1
  76. package/dist/prompts/analyze/n8n-workflow.d.ts +0 -137
  77. package/dist/prompts/analyze/n8n-workflow.d.ts.map +0 -1
  78. package/dist/prompts/analyze/n8n-workflow.js +0 -533
  79. package/dist/prompts/analyze/n8n-workflow.js.map +0 -1
  80. package/dist/prompts/analyze/project-structure.d.ts +0 -126
  81. package/dist/prompts/analyze/project-structure.d.ts.map +0 -1
  82. package/dist/prompts/analyze/project-structure.js +0 -573
  83. package/dist/prompts/analyze/project-structure.js.map +0 -1
  84. package/dist/prompts/analyze/security-audit.d.ts +0 -142
  85. package/dist/prompts/analyze/security-audit.d.ts.map +0 -1
  86. package/dist/prompts/analyze/security-audit.js +0 -641
  87. package/dist/prompts/analyze/security-audit.js.map +0 -1
  88. package/dist/prompts/analyze/single-file.d.ts +0 -162
  89. package/dist/prompts/analyze/single-file.d.ts.map +0 -1
  90. package/dist/prompts/analyze/single-file.js +0 -669
  91. package/dist/prompts/analyze/single-file.js.map +0 -1
  92. package/dist/prompts/analyze/trace-execution.d.ts +0 -126
  93. package/dist/prompts/analyze/trace-execution.d.ts.map +0 -1
  94. package/dist/prompts/analyze/trace-execution.js +0 -613
  95. package/dist/prompts/analyze/trace-execution.js.map +0 -1
  96. package/dist/prompts/analyze/wordpress-plugin-audit.d.ts +0 -116
  97. package/dist/prompts/analyze/wordpress-plugin-audit.d.ts.map +0 -1
  98. package/dist/prompts/analyze/wordpress-plugin-audit.js +0 -456
  99. package/dist/prompts/analyze/wordpress-plugin-audit.js.map +0 -1
  100. package/dist/prompts/analyze/wordpress-plugin-readiness.d.ts +0 -103
  101. package/dist/prompts/analyze/wordpress-plugin-readiness.d.ts.map +0 -1
  102. package/dist/prompts/analyze/wordpress-plugin-readiness.js +0 -506
  103. package/dist/prompts/analyze/wordpress-plugin-readiness.js.map +0 -1
  104. package/dist/prompts/analyze/wordpress-security.d.ts +0 -146
  105. package/dist/prompts/analyze/wordpress-security.d.ts.map +0 -1
  106. package/dist/prompts/analyze/wordpress-security.js +0 -702
  107. package/dist/prompts/analyze/wordpress-security.js.map +0 -1
  108. package/dist/prompts/analyze/wordpress-theme-audit.d.ts +0 -114
  109. package/dist/prompts/analyze/wordpress-theme-audit.d.ts.map +0 -1
  110. package/dist/prompts/analyze/wordpress-theme-audit.js +0 -540
  111. package/dist/prompts/analyze/wordpress-theme-audit.js.map +0 -1
  112. package/dist/prompts/custom/custom-prompt.d.ts +0 -135
  113. package/dist/prompts/custom/custom-prompt.d.ts.map +0 -1
  114. package/dist/prompts/custom/custom-prompt.js +0 -421
  115. package/dist/prompts/custom/custom-prompt.js.map +0 -1
  116. package/dist/prompts/fun/arcade-game.d.ts +0 -152
  117. package/dist/prompts/fun/arcade-game.d.ts.map +0 -1
  118. package/dist/prompts/fun/arcade-game.js +0 -657
  119. package/dist/prompts/fun/arcade-game.js.map +0 -1
  120. package/dist/prompts/fun/create_text_adventure.d.ts +0 -100
  121. package/dist/prompts/fun/create_text_adventure.d.ts.map +0 -1
  122. package/dist/prompts/fun/create_text_adventure.js +0 -401
  123. package/dist/prompts/fun/create_text_adventure.js.map +0 -1
  124. package/dist/prompts/fun/css-art-generator.d.ts +0 -168
  125. package/dist/prompts/fun/css-art-generator.d.ts.map +0 -1
  126. package/dist/prompts/fun/css-art-generator.js +0 -831
  127. package/dist/prompts/fun/css-art-generator.js.map +0 -1
  128. package/dist/prompts/generate/project-documentation.d.ts +0 -137
  129. package/dist/prompts/generate/project-documentation.d.ts.map +0 -1
  130. package/dist/prompts/generate/project-documentation.js +0 -670
  131. package/dist/prompts/generate/project-documentation.js.map +0 -1
  132. package/dist/prompts/generate/refactoring.d.ts +0 -164
  133. package/dist/prompts/generate/refactoring.d.ts.map +0 -1
  134. package/dist/prompts/generate/refactoring.js +0 -625
  135. package/dist/prompts/generate/refactoring.js.map +0 -1
  136. package/dist/prompts/generate/responsive-component.d.ts +0 -147
  137. package/dist/prompts/generate/responsive-component.d.ts.map +0 -1
  138. package/dist/prompts/generate/responsive-component.js +0 -957
  139. package/dist/prompts/generate/responsive-component.js.map +0 -1
  140. package/dist/prompts/generate/typescript-conversion.d.ts +0 -144
  141. package/dist/prompts/generate/typescript-conversion.d.ts.map +0 -1
  142. package/dist/prompts/generate/typescript-conversion.js +0 -531
  143. package/dist/prompts/generate/typescript-conversion.js.map +0 -1
  144. package/dist/prompts/generate/unit-tests.d.ts +0 -139
  145. package/dist/prompts/generate/unit-tests.d.ts.map +0 -1
  146. package/dist/prompts/generate/unit-tests.js +0 -582
  147. package/dist/prompts/generate/unit-tests.js.map +0 -1
  148. package/dist/prompts/generate/wordpress-plugin.d.ts +0 -179
  149. package/dist/prompts/generate/wordpress-plugin.d.ts.map +0 -1
  150. package/dist/prompts/generate/wordpress-plugin.js +0 -767
  151. package/dist/prompts/generate/wordpress-plugin.js.map +0 -1
  152. package/dist/prompts/generate/wordpress-theme-from-static.d.ts +0 -177
  153. package/dist/prompts/generate/wordpress-theme-from-static.d.ts.map +0 -1
  154. package/dist/prompts/generate/wordpress-theme-from-static.js +0 -699
  155. package/dist/prompts/generate/wordpress-theme-from-static.js.map +0 -1
  156. package/dist/prompts/shared/cache-manager.d.ts +0 -45
  157. package/dist/prompts/shared/cache-manager.d.ts.map +0 -1
  158. package/dist/prompts/shared/cache-manager.js +0 -129
  159. package/dist/prompts/shared/cache-manager.js.map +0 -1
  160. package/dist/prompts/shared/helpers.d.ts +0 -39
  161. package/dist/prompts/shared/helpers.d.ts.map +0 -1
  162. package/dist/prompts/shared/helpers.js +0 -151
  163. package/dist/prompts/shared/helpers.js.map +0 -1
  164. package/dist/prompts/shared/templates.d.ts +0 -35
  165. package/dist/prompts/shared/templates.d.ts.map +0 -1
  166. package/dist/prompts/shared/templates.js +0 -77
  167. package/dist/prompts/shared/templates.js.map +0 -1
  168. package/dist/prompts/shared/types.d.ts +0 -112
  169. package/dist/prompts/shared/types.d.ts.map +0 -1
  170. package/dist/prompts/shared/types.js +0 -5
  171. package/dist/prompts/shared/types.js.map +0 -1
  172. package/dist/prompts/system/find-unused-files.d.ts +0 -106
  173. package/dist/prompts/system/find-unused-files.d.ts.map +0 -1
  174. package/dist/prompts/system/find-unused-files.js +0 -357
  175. package/dist/prompts/system/find-unused-files.js.map +0 -1
  176. package/dist/security/index.d.ts +0 -39
  177. package/dist/security/index.d.ts.map +0 -1
  178. package/dist/security/index.js +0 -46
  179. package/dist/security/index.js.map +0 -1
  180. package/dist/security/integration-helpers.d.ts +0 -121
  181. package/dist/security/integration-helpers.d.ts.map +0 -1
  182. package/dist/security/integration-helpers.js +0 -190
  183. package/dist/security/integration-helpers.js.map +0 -1
  184. package/dist/security/output-encoder.d.ts +0 -94
  185. package/dist/security/output-encoder.d.ts.map +0 -1
  186. package/dist/security/output-encoder.js +0 -295
  187. package/dist/security/output-encoder.js.map +0 -1
  188. package/dist/security/prompt-injection-guard.d.ts +0 -59
  189. package/dist/security/prompt-injection-guard.d.ts.map +0 -1
  190. package/dist/security/prompt-injection-guard.js +0 -249
  191. package/dist/security/prompt-injection-guard.js.map +0 -1
  192. package/dist/security/sanitisation.d.ts +0 -67
  193. package/dist/security/sanitisation.d.ts.map +0 -1
  194. package/dist/security/sanitisation.js +0 -398
  195. package/dist/security/sanitisation.js.map +0 -1
  196. package/dist/security/security-service.d.ts +0 -103
  197. package/dist/security/security-service.d.ts.map +0 -1
  198. package/dist/security/security-service.js +0 -303
  199. package/dist/security/security-service.js.map +0 -1
  200. package/dist/security-config.d.ts +0 -45
  201. package/dist/security-config.d.ts.map +0 -1
  202. package/dist/security-config.js +0 -63
  203. package/dist/security-config.js.map +0 -1
  204. package/dist/system/function-list.d.ts +0 -61
  205. package/dist/system/function-list.d.ts.map +0 -1
  206. package/dist/system/function-list.js +0 -111
  207. package/dist/system/function-list.js.map +0 -1
  208. package/dist/system/function-registry.d.ts +0 -23
  209. package/dist/system/function-registry.d.ts.map +0 -1
  210. package/dist/system/function-registry.js +0 -136
  211. package/dist/system/function-registry.js.map +0 -1
  212. package/dist/system/health-check.d.ts +0 -33
  213. package/dist/system/health-check.d.ts.map +0 -1
  214. package/dist/system/health-check.js +0 -98
  215. package/dist/system/health-check.js.map +0 -1
  216. package/dist/system/path-resolver.d.ts +0 -55
  217. package/dist/system/path-resolver.d.ts.map +0 -1
  218. package/dist/system/path-resolver.js +0 -90
  219. package/dist/system/path-resolver.js.map +0 -1
  220. package/dist/templates/plugin-template.d.ts +0 -121
  221. package/dist/templates/plugin-template.d.ts.map +0 -1
  222. package/dist/templates/plugin-template.js +0 -454
  223. package/dist/templates/plugin-template.js.map +0 -1
  224. package/dist/types/chunking-types.d.ts +0 -88
  225. package/dist/types/chunking-types.d.ts.map +0 -1
  226. package/dist/types/chunking-types.js +0 -18
  227. package/dist/types/chunking-types.js.map +0 -1
  228. package/dist/types/prompt-stages.d.ts +0 -30
  229. package/dist/types/prompt-stages.d.ts.map +0 -1
  230. package/dist/types/prompt-stages.js +0 -6
  231. package/dist/types/prompt-stages.js.map +0 -1
  232. package/dist/types.d.ts +0 -45
  233. package/dist/types.d.ts.map +0 -1
  234. package/dist/types.js +0 -6
  235. package/dist/types.js.map +0 -1
  236. package/dist/utils/css-parser.d.ts +0 -26
  237. package/dist/utils/css-parser.d.ts.map +0 -1
  238. package/dist/utils/css-parser.js +0 -117
  239. package/dist/utils/css-parser.js.map +0 -1
  240. package/dist/utils/path-resolver.d.ts +0 -13
  241. package/dist/utils/path-resolver.d.ts.map +0 -1
  242. package/dist/utils/path-resolver.js +0 -78
  243. package/dist/utils/path-resolver.js.map +0 -1
  244. package/dist/utils/plugin-utilities.d.ts +0 -176
  245. package/dist/utils/plugin-utilities.d.ts.map +0 -1
  246. package/dist/utils/plugin-utilities.js +0 -269
  247. package/dist/utils/plugin-utilities.js.map +0 -1
  248. package/dist/utils/streamHandler.d.ts +0 -3
  249. package/dist/utils/streamHandler.d.ts.map +0 -1
  250. package/dist/utils/streamHandler.js +0 -137
  251. package/dist/utils/streamHandler.js.map +0 -1
  252. package/dist/validation/output-validator.d.ts +0 -136
  253. package/dist/validation/output-validator.d.ts.map +0 -1
  254. package/dist/validation/output-validator.js +0 -262
  255. package/dist/validation/output-validator.js.map +0 -1
  256. package/dist/validation/response-factory.d.ts +0 -44
  257. package/dist/validation/response-factory.d.ts.map +0 -1
  258. package/dist/validation/response-factory.js +0 -202
  259. package/dist/validation/response-factory.js.map +0 -1
  260. package/dist/validation/schemas.d.ts +0 -519
  261. package/dist/validation/schemas.d.ts.map +0 -1
  262. package/dist/validation/schemas.js +0 -6
  263. package/dist/validation/schemas.js.map +0 -1
@@ -1,625 +0,0 @@
1
- /**
2
- * Plugin Template - Modern v4.2 (Single Source of Truth)
3
- *
4
- * Universal template that intelligently handles both single-file and multi-file analysis
5
- * Automatically detects analysis type based on provided parameters
6
- *
7
- * Copy this template for creating any new plugin - it adapts to your needs
8
- */
9
- import { BasePlugin } from '../../plugins/base-plugin.js';
10
- import { ThreeStagePromptManager } from '../../core/ThreeStagePromptManager.js';
11
- import { withSecurity } from '../../security/integration-helpers.js';
12
- import { readFileContent } from '../shared/helpers.js';
13
- import { ModelSetup, ResponseProcessor, ParameterValidator, ErrorHandler, MultiFileAnalysis, TokenCalculator } from '../../utils/plugin-utilities.js';
14
- import { getAnalysisCache } from '../../cache/index.js';
15
- // Common Node.js modules - Use these instead of require()
16
- import { basename, dirname, extname, relative } from 'path';
17
- import { readFile, stat } from 'fs/promises';
18
- export class RefactoringAnalyzer extends BasePlugin {
19
- constructor() {
20
- super();
21
- this.name = 'suggest_refactoring';
22
- this.category = 'generate';
23
- this.description = 'Analyze code and suggest refactoring improvements with project-specific patterns (handles both single and multi-file)';
24
- // Universal parameter set - supports both single and multi-file scenarios
25
- this.parameters = {
26
- // Single-file parameters
27
- code: {
28
- type: 'string',
29
- description: 'The code to analyze for refactoring (for single-file analysis)',
30
- required: false
31
- },
32
- filePath: {
33
- type: 'string',
34
- description: 'Path to single file to refactor',
35
- required: false
36
- },
37
- // Multi-file parameters
38
- projectPath: {
39
- type: 'string',
40
- description: 'Path to project root (for multi-file refactoring analysis)',
41
- required: false
42
- },
43
- files: {
44
- type: 'array',
45
- description: 'Array of specific file paths (for multi-file analysis)',
46
- required: false,
47
- items: { type: 'string' }
48
- },
49
- maxDepth: {
50
- type: 'number',
51
- description: 'Maximum directory depth for multi-file discovery (1-5)',
52
- required: false,
53
- default: 3
54
- },
55
- // Universal parameters
56
- language: {
57
- type: 'string',
58
- description: 'Programming language',
59
- required: false,
60
- default: 'javascript'
61
- },
62
- analysisDepth: {
63
- type: 'string',
64
- description: 'Level of analysis detail',
65
- enum: ['basic', 'detailed', 'comprehensive'],
66
- default: 'detailed',
67
- required: false
68
- },
69
- analysisType: {
70
- type: 'string',
71
- description: 'Type of refactoring to focus on',
72
- enum: ['readability', 'performance', 'comprehensive'],
73
- default: 'comprehensive',
74
- required: false
75
- },
76
- // Refactoring-specific parameters
77
- focusAreas: {
78
- type: 'array',
79
- description: 'Areas to focus on for refactoring',
80
- required: false,
81
- items: {
82
- type: 'string',
83
- enum: ['readability', 'performance', 'maintainability', 'testability', 'security', 'type-safety', 'error-handling', 'logging', 'documentation']
84
- },
85
- default: ['readability', 'maintainability']
86
- },
87
- context: {
88
- type: 'object',
89
- description: 'Optional context for project-specific refactoring',
90
- required: false,
91
- properties: {
92
- projectType: {
93
- type: 'string',
94
- enum: ['wordpress-plugin', 'wordpress-theme', 'react-app', 'react-component', 'node-api', 'n8n-node', 'n8n-workflow', 'html-component', 'browser-extension', 'cli-tool', 'generic'],
95
- description: 'Project type for appropriate patterns'
96
- },
97
- preserveApi: {
98
- type: 'boolean',
99
- description: 'Maintain backward compatibility',
100
- default: true
101
- },
102
- modernizationLevel: {
103
- type: 'string',
104
- enum: ['conservative', 'moderate', 'aggressive'],
105
- description: 'How aggressively to modernize code',
106
- default: 'moderate'
107
- },
108
- targetComplexity: {
109
- type: 'number',
110
- description: 'Target cyclomatic complexity',
111
- default: 10
112
- },
113
- standards: {
114
- type: 'array',
115
- items: { type: 'string' },
116
- description: 'Coding standards to follow'
117
- }
118
- }
119
- }
120
- };
121
- this.analysisCache = getAnalysisCache();
122
- this.multiFileAnalysis = new MultiFileAnalysis();
123
- // Cache and analysis utilities are initialized above
124
- }
125
- async execute(params, llmClient) {
126
- return await withSecurity(this, params, llmClient, async (secureParams) => {
127
- try {
128
- // 1. Auto-detect analysis mode based on parameters
129
- const analysisMode = this.detectAnalysisMode(secureParams);
130
- // 2. Validate parameters based on detected mode
131
- this.validateParameters(secureParams, analysisMode);
132
- // 3. Setup model
133
- const { model, contextLength } = await ModelSetup.getReadyModel(llmClient);
134
- // 4. Route to appropriate analysis method
135
- if (analysisMode === 'single-file') {
136
- return await this.executeSingleFileAnalysis(secureParams, model, contextLength);
137
- }
138
- else {
139
- return await this.executeMultiFileAnalysis(secureParams, model, contextLength);
140
- }
141
- }
142
- catch (error) {
143
- return ErrorHandler.createExecutionError('suggest_refactoring', error);
144
- }
145
- });
146
- }
147
- /**
148
- * Auto-detect whether this is single-file or multi-file analysis
149
- *
150
- * For refactoring: Single-file is primary use case, multi-file for project-wide patterns
151
- */
152
- detectAnalysisMode(params) {
153
- // Single-file indicators take priority (avoids default parameter issues)
154
- if (params.code || params.filePath) {
155
- return 'single-file';
156
- }
157
- // Multi-file indicators
158
- if (params.projectPath || params.files) {
159
- return 'multi-file';
160
- }
161
- // Default to single-file for refactoring (most common use case)
162
- return 'single-file';
163
- }
164
- /**
165
- * Validate parameters based on detected analysis mode
166
- */
167
- validateParameters(params, mode) {
168
- if (mode === 'single-file') {
169
- ParameterValidator.validateCodeOrFile(params);
170
- }
171
- else {
172
- ParameterValidator.validateProjectPath(params);
173
- ParameterValidator.validateDepth(params);
174
- }
175
- // Universal validations
176
- ParameterValidator.validateEnum(params, 'analysisType', ['readability', 'performance', 'comprehensive']);
177
- ParameterValidator.validateEnum(params, 'analysisDepth', ['basic', 'detailed', 'comprehensive']);
178
- }
179
- /**
180
- * Execute single-file analysis
181
- */
182
- async executeSingleFileAnalysis(params, model, contextLength) {
183
- // Process single file input
184
- let codeToAnalyze = params.code;
185
- if (params.filePath) {
186
- codeToAnalyze = await readFileContent(params.filePath);
187
- }
188
- // Generate prompt stages for single file
189
- const promptStages = this.getSingleFilePromptStages({
190
- ...params,
191
- code: codeToAnalyze
192
- });
193
- // Execute with appropriate method
194
- const promptManager = new ThreeStagePromptManager();
195
- const needsChunking = TokenCalculator.needsChunking(promptStages, contextLength);
196
- if (needsChunking) {
197
- const chunkSize = TokenCalculator.calculateOptimalChunkSize(promptStages, contextLength);
198
- const dataChunks = promptManager.chunkDataPayload(promptStages.dataPayload, chunkSize);
199
- const conversation = promptManager.createChunkedConversation(promptStages, dataChunks);
200
- const messages = [
201
- conversation.systemMessage,
202
- ...conversation.dataMessages,
203
- conversation.analysisMessage
204
- ];
205
- return await ResponseProcessor.executeChunked(messages, model, contextLength, 'suggest_refactoring', 'single');
206
- }
207
- else {
208
- return await ResponseProcessor.executeDirect(promptStages, model, contextLength, 'suggest_refactoring');
209
- }
210
- }
211
- /**
212
- * Execute multi-file analysis
213
- */
214
- async executeMultiFileAnalysis(params, model, contextLength) {
215
- // Discover files
216
- let filesToAnalyze = params.files ||
217
- await this.discoverRelevantFiles(params.projectPath, params.maxDepth, params.analysisType);
218
- // Perform multi-file analysis with caching
219
- const analysisResult = await this.performMultiFileAnalysis(filesToAnalyze, params, model, contextLength);
220
- // Generate prompt stages for multi-file
221
- const promptStages = this.getMultiFilePromptStages({
222
- ...params,
223
- analysisResult,
224
- fileCount: filesToAnalyze.length
225
- });
226
- // Always use chunking for multi-file
227
- const promptManager = new ThreeStagePromptManager();
228
- const chunkSize = TokenCalculator.calculateOptimalChunkSize(promptStages, contextLength);
229
- const dataChunks = promptManager.chunkDataPayload(promptStages.dataPayload, chunkSize);
230
- const conversation = promptManager.createChunkedConversation(promptStages, dataChunks);
231
- const messages = [
232
- conversation.systemMessage,
233
- ...conversation.dataMessages,
234
- conversation.analysisMessage
235
- ];
236
- return await ResponseProcessor.executeChunked(messages, model, contextLength, 'suggest_refactoring', 'multifile');
237
- }
238
- /**
239
- * Implement single-file refactoring prompt stages
240
- */
241
- getSingleFilePromptStages(params) {
242
- const { code, language, analysisDepth, analysisType, focusAreas, context } = params;
243
- const projectType = context?.projectType || 'generic';
244
- const modernizationLevel = context?.modernizationLevel || 'moderate';
245
- const preserveApi = context?.preserveApi !== false;
246
- const targetComplexity = context?.targetComplexity || 10;
247
- const systemAndContext = `You are a world-class software architect and refactoring expert with 20+ years of experience. Your mission is to transform code into masterpieces of clarity, performance, and maintainability.
248
-
249
- **REFACTORING CONTEXT:**
250
- - Language: ${language}
251
- - Project Type: ${projectType}
252
- - Analysis Focus: ${analysisType} (${analysisDepth} analysis)
253
- - Focus Areas: ${focusAreas?.join(', ') || 'readability, maintainability'}
254
- - API Preservation: ${preserveApi ? 'CRITICAL - Maintain backward compatibility' : 'Breaking changes allowed'}
255
- - Modernization Level: ${modernizationLevel}
256
- - Target Complexity: ≤${targetComplexity} cyclomatic complexity
257
- - Standards: ${context?.standards?.join(', ') || 'Clean Code, SOLID principles'}
258
-
259
- **YOUR EXPERTISE:**
260
- ${this.getProjectSpecificExpertise(projectType, language)}
261
-
262
- **REFACTORING PHILOSOPHY:**
263
- - Code should read like well-written prose
264
- - Every line should have a clear purpose
265
- - Complexity is the enemy of maintainability
266
- - Performance optimizations must be measurable
267
- - Security should be built-in, not bolted-on
268
-
269
- You identify anti-patterns like a detective finds clues, and you craft solutions that developers will thank you for years later.`;
270
- const dataPayload = `**CODE TO REFACTOR:**
271
-
272
- \`\`\`${language}
273
- ${code}
274
- \`\`\`
275
-
276
- **CONTEXT CLUES:**
277
- - File appears to be: ${this.inferCodePurpose(code, language)}
278
- - Estimated complexity: ${this.estimateComplexity(code)}
279
- - Key patterns detected: ${this.detectPatterns(code, language)}`;
280
- const outputInstructions = `**DELIVER COMPREHENSIVE REFACTORING ANALYSIS:**
281
-
282
- ## 🔍 Code Health Assessment
283
- **Current State Analysis:**
284
- - Code smells identified (be specific with line references)
285
- - Complexity metrics (cyclomatic, cognitive load)
286
- - Maintainability score and reasoning
287
- - Performance bottlenecks (if ${focusAreas?.includes('performance') ? 'applicable' : 'obvious'})
288
- - Security vulnerabilities (if ${focusAreas?.includes('security') ? 'applicable' : 'critical'})
289
-
290
- ## ✨ Refactoring Roadmap
291
- **Priority 1 (Critical Issues):**
292
- - Issue: [Specific problem with line numbers]
293
- - Impact: [How it hurts ${focusAreas?.join(', ')}]
294
- - Solution: [Exact refactoring technique]
295
- - Code Example: [Before/after snippet]
296
-
297
- **Priority 2 (Significant Improvements):**
298
- [Same structure as Priority 1]
299
-
300
- **Priority 3 (Polish & Optimization):**
301
- [Same structure as Priority 1]
302
-
303
- ## 🏗️ Architecture Recommendations
304
- ${this.getArchitectureGuidelines(projectType, modernizationLevel)}
305
-
306
- ## 📝 Refactored Code Examples
307
- Show complete before/after examples for major improvements:
308
-
309
- \`\`\`${language}
310
- // BEFORE (problematic)
311
- [original code section]
312
-
313
- // AFTER (refactored)
314
- [improved code section]
315
- \`\`\`
316
-
317
- ## 📊 Improvement Metrics
318
- - Complexity reduction: [current] → [target]
319
- - Readability improvement: [specific gains]
320
- - Performance impact: ${focusAreas?.includes('performance') ? '[measurable improvements]' : '[maintainability focused]'}
321
- - Test coverage considerations
322
- - ${preserveApi ? 'Backward compatibility: [how preserved]' : 'Breaking changes: [migration path]'}
323
-
324
- ## 🚀 Implementation Strategy
325
- **Phase 1 (Foundation):** [Safe, non-breaking improvements]
326
- **Phase 2 (Enhancement):** [Structural improvements]
327
- **Phase 3 (Optimization):** [Performance and advanced patterns]
328
-
329
- **Migration Notes:** ${preserveApi ? 'All changes maintain API compatibility' : 'Breaking changes documented with migration guide'}
330
-
331
- Focus on providing actionable, copy-paste ready improvements that make developers say "Wow, this is so much cleaner!"`;
332
- return { systemAndContext, dataPayload, outputInstructions };
333
- }
334
- /**
335
- * Implement multi-file refactoring prompt stages
336
- */
337
- getMultiFilePromptStages(params) {
338
- const { analysisResult, analysisType, analysisDepth, fileCount, focusAreas, context } = params;
339
- const projectType = context?.projectType || 'generic';
340
- const systemAndContext = `You are a senior software architect specializing in large-scale refactoring and system design. Your expertise lies in identifying cross-file patterns, architectural debt, and system-wide improvements.
341
-
342
- **PROJECT-WIDE REFACTORING CONTEXT:**
343
- - Project Type: ${projectType}
344
- - Files Analyzed: ${fileCount}
345
- - Analysis Focus: ${analysisType} (${analysisDepth} analysis)
346
- - Focus Areas: ${focusAreas?.join(', ') || 'architecture, maintainability'}
347
- - Scope: Cross-file patterns and system architecture
348
-
349
- **YOUR ARCHITECTURAL EXPERTISE:**
350
- ${this.getProjectSpecificExpertise(projectType, 'multi-file')}
351
-
352
- **SYSTEM-LEVEL REFACTORING PHILOSOPHY:**
353
- - Architecture should support change, not resist it
354
- - Coupling should be loose, cohesion should be high
355
- - Patterns should emerge naturally, not be forced
356
- - Dependencies should flow in one direction
357
- - Complexity should be managed, not just moved around
358
-
359
- You see the forest, not just the trees, and you design systems that scale gracefully.`;
360
- const dataPayload = `**PROJECT ANALYSIS RESULTS:**
361
-
362
- ${JSON.stringify(analysisResult, null, 2)}
363
-
364
- **SYSTEM OVERVIEW:**
365
- - Total Files: ${fileCount}
366
- - Project Structure: ${this.analyzeProjectStructure(analysisResult)}
367
- - Key Dependencies: ${this.identifyKeyDependencies(analysisResult)}`;
368
- const outputInstructions = `**DELIVER PROJECT-WIDE REFACTORING STRATEGY:**
369
-
370
- ## 🏗️ Architectural Assessment
371
- **Current Architecture Analysis:**
372
- - System boundaries and responsibilities
373
- - Coupling and cohesion patterns
374
- - Dependency direction and cycles
375
- - Cross-cutting concerns identification
376
-
377
- ## 🎯 Cross-File Refactoring Opportunities
378
- **Pattern-Level Issues:**
379
- - Anti-pattern: [Specific architectural problem]
380
- - Affected Files: [List of files showing this pattern]
381
- - Impact: [How it hurts system ${focusAreas?.join(', ')}]
382
- - Solution: [Architectural refactoring approach]
383
- - Migration Strategy: [Step-by-step approach]
384
-
385
- ## 📁 File Organization Recommendations
386
- **Directory Structure Improvements:**
387
- - Current issues with organization
388
- - Proposed structure changes
389
- - File naming conventions
390
- - Module boundary definitions
391
-
392
- ## 🔄 Dependency Refactoring
393
- **Dependency Health:**
394
- - Circular dependency issues
395
- - Missing abstractions
396
- - Coupling hotspots
397
- - Dependency injection opportunities
398
-
399
- ## 📋 System-Wide Improvements
400
- **Cross-Cutting Refactoring:**
401
- 1. **Error Handling Standardization**
402
- 2. **Logging Strategy Unification**
403
- 3. **Configuration Management**
404
- 4. **Testing Strategy Alignment**
405
- 5. **Performance Monitoring Integration**
406
-
407
- ## 🚀 Implementation Roadmap
408
- **Phase 1 (Foundation):** [Architecture groundwork]
409
- - Files to refactor: [specific list]
410
- - Dependencies to restructure
411
- - New abstractions to introduce
412
-
413
- **Phase 2 (Systematization):** [Pattern application]
414
- - Cross-file pattern implementation
415
- - Interface standardization
416
- - Testing infrastructure
417
-
418
- **Phase 3 (Optimization):** [Performance and scaling]
419
- - Performance bottleneck resolution
420
- - Scalability improvements
421
- - Monitoring and observability
422
-
423
- ## 📊 Project Health Metrics
424
- - Architecture debt reduction
425
- - Coupling metrics improvement
426
- - Code reuse opportunities
427
- - Maintainability index gains
428
-
429
- Provide a roadmap that transforms the entire codebase into a well-architected, maintainable system that developers love working with.`;
430
- return { systemAndContext, dataPayload, outputInstructions };
431
- }
432
- /**
433
- * Implement for backwards compatibility
434
- * The system still expects this method, so we intelligently route to the appropriate stages
435
- */
436
- getPromptStages(params) {
437
- const mode = this.detectAnalysisMode(params);
438
- if (mode === 'single-file') {
439
- return this.getSingleFilePromptStages(params);
440
- }
441
- else {
442
- return this.getMultiFilePromptStages(params);
443
- }
444
- }
445
- // Multi-file helper methods
446
- async discoverRelevantFiles(projectPath, maxDepth, analysisType) {
447
- const extensions = this.getFileExtensions(analysisType);
448
- return await this.multiFileAnalysis.discoverFiles(projectPath, extensions, maxDepth);
449
- }
450
- async performMultiFileAnalysis(files, params, model, contextLength) {
451
- const cacheKey = this.analysisCache.generateKey('suggest_refactoring', params, files);
452
- const cached = await this.analysisCache.get(cacheKey);
453
- if (cached)
454
- return cached;
455
- const fileAnalysisResults = await this.multiFileAnalysis.analyzeBatch(files, (file) => this.analyzeIndividualFile(file, params, model), contextLength);
456
- // Aggregate results into proper analysis result format
457
- const aggregatedResult = {
458
- summary: `Refactoring analysis of ${files.length} files`,
459
- findings: fileAnalysisResults,
460
- data: {
461
- fileCount: files.length,
462
- totalSize: fileAnalysisResults.reduce((sum, result) => sum + (result.size || 0), 0),
463
- codeHealth: this.assessCodeHealth(fileAnalysisResults),
464
- architecturalPatterns: this.identifyArchitecturalPatterns(fileAnalysisResults)
465
- }
466
- };
467
- await this.analysisCache.cacheAnalysis(cacheKey, aggregatedResult, {
468
- modelUsed: model.identifier || 'unknown',
469
- executionTime: Date.now() - Date.now(), // TODO: Track actual execution time
470
- timestamp: new Date().toISOString()
471
- });
472
- return aggregatedResult;
473
- }
474
- async analyzeIndividualFile(file, params, model) {
475
- const content = await readFile(file, 'utf-8');
476
- const stats = await stat(file);
477
- return {
478
- filePath: file,
479
- fileName: basename(file),
480
- size: content.length,
481
- lines: content.split('\n').length,
482
- extension: extname(file),
483
- relativePath: relative(params.projectPath || '', file),
484
- complexity: this.estimateComplexity(content),
485
- patterns: this.detectPatterns(content, extname(file).substring(1)),
486
- purpose: this.inferCodePurpose(content, extname(file).substring(1))
487
- };
488
- }
489
- getFileExtensions(analysisType) {
490
- const extensionMap = {
491
- 'readability': ['.js', '.ts', '.jsx', '.tsx', '.py', '.java', '.cs', '.php', '.rb'],
492
- 'performance': ['.js', '.ts', '.py', '.java', '.cs', '.cpp', '.c', '.php'],
493
- 'comprehensive': ['.js', '.ts', '.jsx', '.tsx', '.py', '.java', '.cs', '.php', '.rb', '.go', '.rs', '.cpp', '.c']
494
- };
495
- return extensionMap[analysisType] || extensionMap.comprehensive;
496
- }
497
- // Helper methods for intelligent analysis
498
- getProjectSpecificExpertise(projectType, language) {
499
- const expertise = {
500
- 'wordpress-plugin': 'WordPress hooks, actions, filters, security (nonces, sanitization), database optimization, WP coding standards',
501
- 'wordpress-theme': 'Template hierarchy, theme.json, block patterns, accessibility, performance optimization, SEO',
502
- 'react-app': 'Component composition, hooks optimization, state management, performance (memoization, lazy loading)',
503
- 'react-component': 'Reusable patterns, prop design, accessibility, testing strategies, Storybook integration',
504
- 'node-api': 'RESTful design, middleware patterns, error handling, security (authentication, validation), performance',
505
- 'n8n-node': 'Webhook handling, credential management, error recovery, data transformation, batch processing',
506
- 'n8n-workflow': 'Node orchestration, error handling, data flow optimization, conditional logic, loop efficiency',
507
- 'html-component': 'Semantic HTML, CSS architecture, accessibility (ARIA), progressive enhancement, performance',
508
- 'browser-extension': 'Content scripts, message passing, permission management, security, cross-browser compatibility',
509
- 'cli-tool': 'Argument parsing, error handling, progress indication, cross-platform compatibility, performance',
510
- 'generic': 'Clean code principles, SOLID design, design patterns, testing strategies, documentation'
511
- };
512
- return expertise[projectType] || expertise.generic;
513
- }
514
- getArchitectureGuidelines(projectType, modernizationLevel) {
515
- const base = `**Design Patterns to Consider:**
516
- - Strategy Pattern for algorithm variations
517
- - Observer Pattern for event handling
518
- - Factory Pattern for object creation
519
- - Repository Pattern for data access`;
520
- const modernization = modernizationLevel === 'aggressive' ? `
521
- **Modernization Opportunities:**
522
- - Latest language features and syntax
523
- - Modern async patterns (async/await over callbacks)
524
- - Module system upgrades
525
- - Framework pattern updates` : '';
526
- const projectSpecific = {
527
- 'wordpress-plugin': `
528
- **WordPress Architecture:**
529
- - Proper hook organization and priority
530
- - Object-oriented plugin structure
531
- - Namespace implementation
532
- - Admin interface separation`,
533
- 'react-app': `
534
- **React Architecture:**
535
- - Component composition patterns
536
- - Custom hooks for logic reuse
537
- - Context API for state management
538
- - Error boundary implementation`,
539
- 'node-api': `
540
- **API Architecture:**
541
- - Layered architecture (controller, service, repository)
542
- - Middleware chain optimization
543
- - Input validation strategies
544
- - Response consistency patterns`
545
- };
546
- return base + modernization + (projectSpecific[projectType] || '');
547
- }
548
- estimateComplexity(code) {
549
- const lines = code.split('\n').length;
550
- const functions = (code.match(/function|=>|def |class /g) || []).length;
551
- const conditions = (code.match(/if|else|switch|case|for|while|catch/g) || []).length;
552
- if (conditions > functions * 3)
553
- return 'High';
554
- if (conditions > functions * 1.5)
555
- return 'Moderate';
556
- return 'Low';
557
- }
558
- detectPatterns(code, language) {
559
- const patterns = [];
560
- if (code.includes('class ') || code.includes('function '))
561
- patterns.push('Object-Oriented');
562
- if (code.includes('=>') || code.includes('map(') || code.includes('filter('))
563
- patterns.push('Functional');
564
- if (code.includes('async') || code.includes('await') || code.includes('Promise'))
565
- patterns.push('Asynchronous');
566
- if (code.includes('try') || code.includes('catch'))
567
- patterns.push('Error-Handling');
568
- if (code.includes('test(') || code.includes('describe(') || code.includes('it('))
569
- patterns.push('Testing');
570
- return patterns;
571
- }
572
- inferCodePurpose(code, language) {
573
- if (code.includes('router') || code.includes('app.get') || code.includes('express'))
574
- return 'API/Server';
575
- if (code.includes('component') || code.includes('jsx') || code.includes('useState'))
576
- return 'UI Component';
577
- if (code.includes('test') || code.includes('spec') || code.includes('describe'))
578
- return 'Test Suite';
579
- if (code.includes('config') || code.includes('settings') || code.includes('env'))
580
- return 'Configuration';
581
- if (code.includes('util') || code.includes('helper') || code.includes('lib'))
582
- return 'Utility/Helper';
583
- return 'Business Logic';
584
- }
585
- assessCodeHealth(results) {
586
- return {
587
- averageComplexity: results.reduce((sum, r) => sum + (r.complexity === 'High' ? 3 : r.complexity === 'Moderate' ? 2 : 1), 0) / results.length,
588
- largestFiles: results.sort((a, b) => b.size - a.size).slice(0, 3),
589
- patternDistribution: this.aggregatePatterns(results)
590
- };
591
- }
592
- identifyArchitecturalPatterns(results) {
593
- const allPatterns = results.flatMap(r => r.patterns || []);
594
- const uniquePatterns = [...new Set(allPatterns)];
595
- return uniquePatterns;
596
- }
597
- aggregatePatterns(results) {
598
- const patternCount = {};
599
- results.forEach(result => {
600
- (result.patterns || []).forEach((pattern) => {
601
- patternCount[pattern] = (patternCount[pattern] || 0) + 1;
602
- });
603
- });
604
- return patternCount;
605
- }
606
- analyzeProjectStructure(analysisResult) {
607
- // Simple structure analysis based on file paths
608
- const files = analysisResult.findings || [];
609
- const directories = [...new Set(files.map((f) => dirname(f.relativePath || f.filePath)))];
610
- return `${directories.length} directories, organized by ${directories.includes('src') ? 'source structure' : 'functional areas'}`;
611
- }
612
- identifyKeyDependencies(analysisResult) {
613
- // Extract patterns that suggest dependencies
614
- const findings = analysisResult.findings || [];
615
- const imports = findings.flatMap((f) => f.patterns || []).filter((p) => p.includes('import') || p.includes('require'));
616
- return imports.length > 0 ? `${imports.length} import patterns detected` : 'Self-contained modules';
617
- }
618
- generateCacheKey(files, params) {
619
- const fileHash = files.join('|');
620
- const paramHash = JSON.stringify(params);
621
- return `${fileHash}_${paramHash}`.substring(0, 64);
622
- }
623
- }
624
- export default RefactoringAnalyzer;
625
- //# sourceMappingURL=refactoring.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"refactoring.js","sourceRoot":"","sources":["../../../src/prompts/generate/refactoring.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;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,0DAA0D;AAC1D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAQ,QAAQ,E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