@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,135 +0,0 @@
1
- /**
2
- * Custom Prompt Executor - Modern v4.3 Universal Template
3
- *
4
- * Universal fallback function that allows Claude to communicate any task directly to local LLM
5
- * Acts as the Swiss Army knife for tasks that don't match other specialized functions
6
- *
7
- * Created using the modern universal template architecture
8
- */
9
- import { BasePlugin } from '../../plugins/base-plugin.js';
10
- import { IPromptPlugin } from '../shared/types.js';
11
- import { PromptStages } from '../../types/prompt-stages.js';
12
- export declare class CustomPromptExecutor extends BasePlugin implements IPromptPlugin {
13
- name: string;
14
- category: "custom";
15
- description: string;
16
- parameters: {
17
- code: {
18
- type: "string";
19
- description: string;
20
- required: boolean;
21
- };
22
- filePath: {
23
- type: "string";
24
- description: string;
25
- required: boolean;
26
- };
27
- projectPath: {
28
- type: "string";
29
- description: string;
30
- required: boolean;
31
- };
32
- files: {
33
- type: "array";
34
- description: string;
35
- required: boolean;
36
- items: {
37
- type: "string";
38
- };
39
- };
40
- maxDepth: {
41
- type: "number";
42
- description: string;
43
- required: boolean;
44
- default: number;
45
- };
46
- prompt: {
47
- type: "string";
48
- description: string;
49
- required: boolean;
50
- };
51
- working_directory: {
52
- type: "string";
53
- description: string;
54
- required: boolean;
55
- };
56
- context: {
57
- type: "object";
58
- description: string;
59
- required: boolean;
60
- properties: {
61
- task_type: {
62
- type: "string";
63
- };
64
- requirements: {
65
- type: "array";
66
- };
67
- constraints: {
68
- type: "array";
69
- };
70
- output_format: {
71
- type: "string";
72
- };
73
- };
74
- };
75
- language: {
76
- type: "string";
77
- description: string;
78
- required: boolean;
79
- default: string;
80
- };
81
- analysisDepth: {
82
- type: "string";
83
- description: string;
84
- enum: string[];
85
- default: string;
86
- required: boolean;
87
- };
88
- analysisType: {
89
- type: "string";
90
- description: string;
91
- enum: string[];
92
- default: string;
93
- required: boolean;
94
- };
95
- };
96
- private analysisCache;
97
- private multiFileAnalysis;
98
- constructor();
99
- execute(params: any, llmClient: any): Promise<any>;
100
- /**
101
- * Auto-detect whether this is single-file or multi-file analysis
102
- */
103
- private detectAnalysisMode;
104
- /**
105
- * Validate parameters based on detected analysis mode
106
- */
107
- private validateParameters;
108
- /**
109
- * Execute single-file analysis
110
- */
111
- private executeSingleFileAnalysis;
112
- /**
113
- * Execute multi-file analysis
114
- */
115
- private executeMultiFileAnalysis;
116
- /**
117
- * Single-file prompt stages - optimized for universal custom tasks
118
- */
119
- private getSingleFilePromptStages;
120
- /**
121
- * Multi-file prompt stages - optimized for complex custom tasks across multiple files
122
- */
123
- private getMultiFilePromptStages;
124
- /**
125
- * Backwards compatibility method
126
- */
127
- getPromptStages(params: any): PromptStages;
128
- private discoverRelevantFiles;
129
- private performMultiFileAnalysis;
130
- private analyzeIndividualFile;
131
- private getFileExtensions;
132
- private generateCacheKey;
133
- }
134
- export default CustomPromptExecutor;
135
- //# sourceMappingURL=custom-prompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"custom-prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/custom/custom-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAa5D,qBAAa,oBAAqB,SAAQ,UAAW,YAAW,aAAa;IAC3E,IAAI,SAAmB;IACvB,QAAQ,EAAG,QAAQ,CAAU;IAC7B,WAAW,SAAuS;IAGlT,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6ER;IAEF,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,iBAAiB,CAA2B;;IAO9C,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IAyBzC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA2B1B;;OAEG;YACW,yBAAyB;IAgEvC;;OAEG;YACW,wBAAwB;IA4CtC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAsDjC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAkDhC;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,GAAG,GAAG,YAAY;YAW5B,qBAAqB;YASrB,wBAAwB;YA6CxB,qBAAqB;IAenC,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,gBAAgB;CAKzB;AAED,eAAe,oBAAoB,CAAC"}
@@ -1,421 +0,0 @@
1
- /**
2
- * Custom Prompt Executor - Modern v4.3 Universal Template
3
- *
4
- * Universal fallback function that allows Claude to communicate any task directly to local LLM
5
- * Acts as the Swiss Army knife for tasks that don't match other specialized functions
6
- *
7
- * Created using the modern universal template architecture
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
- export class CustomPromptExecutor extends BasePlugin {
16
- constructor() {
17
- super();
18
- this.name = 'custom_prompt';
19
- this.category = 'custom';
20
- this.description = 'Universal fallback executor for any custom prompt with optional file context. Uses dynamic token allocation based on your loaded model - can handle everything from quick tasks to comprehensive multi-file analysis. The Swiss Army knife when no other specialized function matches your needs.';
21
- // Universal parameter set - supports both single and multi-file scenarios
22
- this.parameters = {
23
- // Single-file parameters
24
- code: {
25
- type: 'string',
26
- description: 'The code to analyze (for single-file analysis)',
27
- required: false
28
- },
29
- filePath: {
30
- type: 'string',
31
- description: 'Path to single file to analyze',
32
- required: false
33
- },
34
- // Multi-file parameters
35
- projectPath: {
36
- type: 'string',
37
- description: 'Path to project root (for multi-file analysis)',
38
- required: false
39
- },
40
- files: {
41
- type: 'array',
42
- description: 'Array of specific file paths to include as context',
43
- required: false,
44
- items: { type: 'string' }
45
- },
46
- maxDepth: {
47
- type: 'number',
48
- description: 'Maximum directory depth for multi-file discovery (1-5)',
49
- required: false,
50
- default: 3
51
- },
52
- // Custom prompt specific parameters
53
- prompt: {
54
- type: 'string',
55
- description: 'The custom prompt/task to send to local LLM',
56
- required: true
57
- },
58
- working_directory: {
59
- type: 'string',
60
- description: 'Working directory context (defaults to current working directory)',
61
- required: false
62
- },
63
- context: {
64
- type: 'object',
65
- description: 'Optional structured context object for the task',
66
- required: false,
67
- properties: {
68
- task_type: { type: 'string' },
69
- requirements: { type: 'array' },
70
- constraints: { type: 'array' },
71
- output_format: { type: 'string' }
72
- }
73
- },
74
- // Universal parameters
75
- language: {
76
- type: 'string',
77
- description: 'Programming language (if applicable)',
78
- required: false,
79
- default: 'text'
80
- },
81
- analysisDepth: {
82
- type: 'string',
83
- description: 'Level of analysis detail',
84
- enum: ['basic', 'detailed', 'comprehensive'],
85
- default: 'detailed',
86
- required: false
87
- },
88
- analysisType: {
89
- type: 'string',
90
- description: 'Type of analysis to perform',
91
- enum: ['general', 'technical', 'creative', 'analytical'],
92
- default: 'general',
93
- required: false
94
- }
95
- };
96
- this.analysisCache = getAnalysisCache();
97
- this.multiFileAnalysis = new MultiFileAnalysis();
98
- // Cache and analysis utilities are initialized above
99
- }
100
- async execute(params, llmClient) {
101
- return await withSecurity(this, params, llmClient, async (secureParams) => {
102
- try {
103
- // 1. Auto-detect analysis mode based on parameters
104
- const analysisMode = this.detectAnalysisMode(secureParams);
105
- // 2. Validate parameters based on detected mode
106
- this.validateParameters(secureParams, analysisMode);
107
- // 3. Setup model
108
- const { model, contextLength } = await ModelSetup.getReadyModel(llmClient);
109
- // 4. Route to appropriate analysis method
110
- if (analysisMode === 'single-file') {
111
- return await this.executeSingleFileAnalysis(secureParams, model, contextLength);
112
- }
113
- else {
114
- return await this.executeMultiFileAnalysis(secureParams, model, contextLength);
115
- }
116
- }
117
- catch (error) {
118
- return ErrorHandler.createExecutionError('custom_prompt', error);
119
- }
120
- });
121
- }
122
- /**
123
- * Auto-detect whether this is single-file or multi-file analysis
124
- */
125
- detectAnalysisMode(params) {
126
- // Multi-file indicators
127
- if (params.projectPath || (params.files && params.files.length > 1)) {
128
- return 'multi-file';
129
- }
130
- // Single-file indicators or no file context (just prompt)
131
- if (params.code || params.filePath || (params.files && params.files.length === 1) || (!params.projectPath && !params.files)) {
132
- return 'single-file';
133
- }
134
- // Default to single-file for simple prompts
135
- return 'single-file';
136
- }
137
- /**
138
- * Validate parameters based on detected analysis mode
139
- */
140
- validateParameters(params, mode) {
141
- // Always require the prompt
142
- if (!params.prompt || typeof params.prompt !== 'string') {
143
- throw new Error('Prompt is required and must be a string');
144
- }
145
- if (mode === 'single-file') {
146
- // Single-file mode can work with just a prompt, or with file context
147
- if (params.filePath) {
148
- ParameterValidator.validateCodeOrFile(params);
149
- }
150
- }
151
- else {
152
- // Multi-file mode requires either projectPath or files array
153
- if (!params.projectPath && !params.files) {
154
- throw new Error('Multi-file mode requires either projectPath or files array');
155
- }
156
- if (params.projectPath) {
157
- ParameterValidator.validateProjectPath(params);
158
- }
159
- ParameterValidator.validateDepth(params);
160
- }
161
- // Universal validations
162
- ParameterValidator.validateEnum(params, 'analysisType', ['general', 'technical', 'creative', 'analytical']);
163
- ParameterValidator.validateEnum(params, 'analysisDepth', ['basic', 'detailed', 'comprehensive']);
164
- }
165
- /**
166
- * Execute single-file analysis
167
- */
168
- async executeSingleFileAnalysis(params, model, contextLength) {
169
- // Process single file input
170
- let codeToAnalyze = params.code || '';
171
- if (params.filePath) {
172
- codeToAnalyze = await readFileContent(params.filePath);
173
- }
174
- else if (params.files && params.files.length === 1) {
175
- codeToAnalyze = await readFileContent(params.files[0]);
176
- }
177
- // Generate prompt stages for single file
178
- const promptStages = this.getSingleFilePromptStages({
179
- ...params,
180
- code: codeToAnalyze
181
- });
182
- // Execute with appropriate method
183
- const promptManager = new ThreeStagePromptManager();
184
- const needsChunking = TokenCalculator.needsChunking(promptStages, contextLength);
185
- if (needsChunking) {
186
- const chunkSize = TokenCalculator.calculateOptimalChunkSize(promptStages, contextLength);
187
- const dataChunks = promptManager.chunkDataPayload(promptStages.dataPayload, chunkSize);
188
- const conversation = promptManager.createChunkedConversation(promptStages, dataChunks);
189
- const messages = [
190
- conversation.systemMessage,
191
- ...conversation.dataMessages,
192
- conversation.analysisMessage
193
- ];
194
- return await ResponseProcessor.executeChunked(messages, model, contextLength, 'custom_prompt', 'single');
195
- }
196
- else {
197
- // Use proper dynamic token calculation for custom prompts
198
- const maxTokens = TokenCalculator.calculateForDirect(promptStages, contextLength, {
199
- minTokens: 2000 // Minimum for code generation
200
- });
201
- const fullPrompt = `${promptStages.systemAndContext}
202
-
203
- ${promptStages.dataPayload}
204
-
205
- ${promptStages.outputInstructions}`;
206
- const response = await model.complete(fullPrompt, { maxTokens, temperature: 0.7 });
207
- return {
208
- success: true,
209
- timestamp: new Date().toISOString(),
210
- modelUsed: model.identifier || 'unknown',
211
- executionTimeMs: 0,
212
- data: response?.content || response?.text || response || 'No response content'
213
- };
214
- }
215
- }
216
- /**
217
- * Execute multi-file analysis
218
- */
219
- async executeMultiFileAnalysis(params, model, contextLength) {
220
- // Discover files
221
- let filesToAnalyze = params.files ||
222
- await this.discoverRelevantFiles(params.projectPath, params.maxDepth, params.analysisType);
223
- // Perform multi-file analysis with caching
224
- const analysisResult = await this.performMultiFileAnalysis(filesToAnalyze, params, model, contextLength);
225
- // Generate prompt stages for multi-file
226
- const promptStages = this.getMultiFilePromptStages({
227
- ...params,
228
- analysisResult,
229
- fileCount: filesToAnalyze.length
230
- });
231
- // Always use chunking for multi-file
232
- const promptManager = new ThreeStagePromptManager();
233
- const chunkSize = TokenCalculator.calculateOptimalChunkSize(promptStages, contextLength);
234
- const dataChunks = promptManager.chunkDataPayload(promptStages.dataPayload, chunkSize);
235
- const conversation = promptManager.createChunkedConversation(promptStages, dataChunks);
236
- const messages = [
237
- conversation.systemMessage,
238
- ...conversation.dataMessages,
239
- conversation.analysisMessage
240
- ];
241
- return await ResponseProcessor.executeChunked(messages, model, contextLength, 'custom_prompt', 'multifile');
242
- }
243
- /**
244
- * Single-file prompt stages - optimized for universal custom tasks
245
- */
246
- getSingleFilePromptStages(params) {
247
- const { prompt, code, language, analysisDepth, analysisType, context, working_directory } = params;
248
- let systemAndContext = `You are an expert AI assistant specializing in ${analysisDepth} ${analysisType} tasks.
249
-
250
- **Your Role**: Universal problem-solver and task executor with full access to dynamic token allocation
251
- **Analysis Context**:
252
- - Task Type: ${analysisType}
253
- - Analysis Depth: ${analysisDepth}
254
- - Language: ${language}
255
- - Mode: Single File/Context Analysis
256
- - Token Allocation: Dynamic (optimized for your current model's context window)
257
-
258
- **Your Mission**: Execute the custom task with precision, creativity, and actionable results. You have access to the full context window of the loaded model, so don't hesitate to be comprehensive when the task requires it. You are the Swiss Army knife - adaptable, reliable, and comprehensive.`;
259
- if (working_directory) {
260
- systemAndContext += `\n- Working Directory: ${working_directory}`;
261
- }
262
- if (context) {
263
- systemAndContext += `\n\n**Task Context**:`;
264
- if (context.task_type)
265
- systemAndContext += `\n- Task Type: ${context.task_type}`;
266
- if (context.requirements)
267
- systemAndContext += `\n- Requirements: ${Array.isArray(context.requirements) ? context.requirements.join(', ') : context.requirements}`;
268
- if (context.constraints)
269
- systemAndContext += `\n- Constraints: ${Array.isArray(context.constraints) ? context.constraints.join(', ') : context.constraints}`;
270
- if (context.output_format)
271
- systemAndContext += `\n- Output Format: ${context.output_format}`;
272
- }
273
- let dataPayload = '';
274
- if (code && code.trim()) {
275
- dataPayload = `**File Content for Analysis:**
276
-
277
- \`\`\`${language}
278
- ${code}
279
- \`\`\``;
280
- }
281
- else {
282
- dataPayload = `**Context**: Ready to execute custom task without specific file context.`;
283
- }
284
- const outputInstructions = `**CUSTOM TASK TO EXECUTE:**
285
-
286
- ${prompt}
287
-
288
- **Your Response Should:**
289
- - Directly address the task requirements
290
- - Be actionable and practical
291
- - Match the requested output format (if specified)
292
- - Demonstrate deep understanding and expertise
293
- - Provide clear, implementable solutions
294
-
295
- Execute this task with excellence and precision. You are Claude's trusted specialist for custom operations.`;
296
- return { systemAndContext, dataPayload, outputInstructions };
297
- }
298
- /**
299
- * Multi-file prompt stages - optimized for complex custom tasks across multiple files
300
- */
301
- getMultiFilePromptStages(params) {
302
- const { prompt, analysisResult, analysisType, analysisDepth, fileCount, context, working_directory } = params;
303
- let systemAndContext = `You are an expert multi-file AI analyst specializing in ${analysisDepth} ${analysisType} tasks.
304
-
305
- **Your Role**: Advanced multi-file task executor and architectural consultant with full dynamic token access
306
- **Analysis Context**:
307
- - Task Type: ${analysisType}
308
- - Analysis Depth: ${analysisDepth}
309
- - Files Processed: ${fileCount}
310
- - Mode: Multi-File Custom Analysis
311
- - Token Allocation: Dynamic (full model context window available)
312
-
313
- **Your Mission**: Execute complex custom tasks across multiple files with comprehensive understanding. You have access to the full context window, so provide detailed, thorough analysis when appropriate. You excel at seeing patterns, relationships, and providing strategic insights across entire codebases and project structures.`;
314
- if (working_directory) {
315
- systemAndContext += `\n- Working Directory: ${working_directory}`;
316
- }
317
- if (context) {
318
- systemAndContext += `\n\n**Task Context**:`;
319
- if (context.task_type)
320
- systemAndContext += `\n- Task Type: ${context.task_type}`;
321
- if (context.requirements)
322
- systemAndContext += `\n- Requirements: ${Array.isArray(context.requirements) ? context.requirements.join(', ') : context.requirements}`;
323
- if (context.constraints)
324
- systemAndContext += `\n- Constraints: ${Array.isArray(context.constraints) ? context.constraints.join(', ') : context.constraints}`;
325
- if (context.output_format)
326
- systemAndContext += `\n- Output Format: ${context.output_format}`;
327
- }
328
- const dataPayload = `**Multi-File Analysis Results:**
329
-
330
- ${JSON.stringify(analysisResult, null, 2)}
331
-
332
- **Files Analyzed**: ${fileCount} files processed across the project structure.`;
333
- const outputInstructions = `**CUSTOM MULTI-FILE TASK TO EXECUTE:**
334
-
335
- ${prompt}
336
-
337
- **Your Multi-File Response Should:**
338
- - Synthesize insights across all ${fileCount} analyzed files
339
- - Identify cross-file patterns, dependencies, and relationships
340
- - Provide architectural and strategic recommendations
341
- - Address the task with comprehensive project-wide understanding
342
- - Deliver actionable results that consider the entire codebase context
343
- - Match any specified output format requirements
344
-
345
- Execute this complex multi-file task with expert-level analysis and strategic thinking. You are Claude's advanced specialist for comprehensive project-wide operations.`;
346
- return { systemAndContext, dataPayload, outputInstructions };
347
- }
348
- /**
349
- * Backwards compatibility method
350
- */
351
- getPromptStages(params) {
352
- const mode = this.detectAnalysisMode(params);
353
- if (mode === 'single-file') {
354
- return this.getSingleFilePromptStages(params);
355
- }
356
- else {
357
- return this.getMultiFilePromptStages(params);
358
- }
359
- }
360
- // Multi-file helper methods
361
- async discoverRelevantFiles(projectPath, maxDepth, analysisType) {
362
- const extensions = this.getFileExtensions(analysisType);
363
- return await this.multiFileAnalysis.discoverFiles(projectPath, extensions, maxDepth);
364
- }
365
- async performMultiFileAnalysis(files, params, model, contextLength) {
366
- const cacheKey = this.analysisCache.generateKey('custom_prompt', params, files);
367
- const cached = await this.analysisCache.get(cacheKey);
368
- if (cached)
369
- return cached;
370
- const fileAnalysisResults = await this.multiFileAnalysis.analyzeBatch(files, (file) => this.analyzeIndividualFile(file, params, model), contextLength);
371
- // Aggregate results into proper analysis result format
372
- const aggregatedResult = {
373
- summary: `Multi-file custom task analysis of ${files.length} files`,
374
- findings: fileAnalysisResults,
375
- data: {
376
- fileCount: files.length,
377
- totalSize: fileAnalysisResults.reduce((sum, result) => sum + (result.size || 0), 0),
378
- customTaskContext: {
379
- prompt: params.prompt,
380
- analysisType: params.analysisType,
381
- context: params.context
382
- }
383
- }
384
- };
385
- await this.analysisCache.cacheAnalysis(cacheKey, aggregatedResult, {
386
- modelUsed: model.identifier || 'unknown',
387
- executionTime: Date.now() - Date.now(), // TODO: Track actual execution time
388
- timestamp: new Date().toISOString()
389
- });
390
- return aggregatedResult;
391
- }
392
- async analyzeIndividualFile(file, params, model) {
393
- const content = await import('fs/promises').then(fs => fs.readFile(file, 'utf-8'));
394
- return {
395
- filePath: file,
396
- size: content.length,
397
- lines: content.split('\n').length,
398
- extension: file.split('.').pop() || '',
399
- customContext: {
400
- taskType: params.analysisType,
401
- prompt: params.prompt
402
- }
403
- };
404
- }
405
- getFileExtensions(analysisType) {
406
- const extensionMap = {
407
- 'general': ['.js', '.ts', '.jsx', '.tsx', '.php', '.py', '.java', '.md', '.txt', '.json', '.xml', '.css', '.html'],
408
- 'technical': ['.js', '.ts', '.jsx', '.tsx', '.php', '.py', '.java', '.cs', '.cpp', '.h', '.go', '.rs', '.rb'],
409
- 'creative': ['.md', '.txt', '.html', '.css', '.json', '.xml', '.yml', '.yaml'],
410
- 'analytical': ['.js', '.ts', '.jsx', '.tsx', '.php', '.py', '.java', '.json', '.csv', '.sql', '.md']
411
- };
412
- return extensionMap[analysisType] || extensionMap.general;
413
- }
414
- generateCacheKey(files, params) {
415
- const fileHash = files.join('|');
416
- const paramHash = JSON.stringify(params);
417
- return `${fileHash}_${paramHash}`.substring(0, 64);
418
- }
419
- }
420
- export default CustomPromptExecutor;
421
- //# sourceMappingURL=custom-prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"custom-prompt.js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