mcp-wordpress 2.6.3 → 2.7.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 (333) hide show
  1. package/README.md +1 -1
  2. package/dist/cache/CacheInvalidation.d.ts +25 -6
  3. package/dist/cache/CacheInvalidation.d.ts.map +1 -1
  4. package/dist/cache/CacheInvalidation.js +168 -16
  5. package/dist/cache/CacheInvalidation.js.map +1 -1
  6. package/dist/cache/HttpCacheWrapper.d.ts.map +1 -1
  7. package/dist/cache/HttpCacheWrapper.js +3 -4
  8. package/dist/cache/HttpCacheWrapper.js.map +1 -1
  9. package/dist/cache/SEOCacheManager.d.ts +150 -0
  10. package/dist/cache/SEOCacheManager.d.ts.map +1 -0
  11. package/dist/cache/SEOCacheManager.js +275 -0
  12. package/dist/cache/SEOCacheManager.js.map +1 -0
  13. package/dist/client/SEOWordPressClient.d.ts +164 -0
  14. package/dist/client/SEOWordPressClient.d.ts.map +1 -0
  15. package/dist/client/SEOWordPressClient.js +674 -0
  16. package/dist/client/SEOWordPressClient.js.map +1 -0
  17. package/dist/client/api.d.ts.map +1 -1
  18. package/dist/client/api.js +50 -20
  19. package/dist/client/api.js.map +1 -1
  20. package/dist/client/auth.js +19 -19
  21. package/dist/client/auth.js.map +1 -1
  22. package/dist/client/index.d.ts +11 -0
  23. package/dist/client/index.d.ts.map +1 -0
  24. package/dist/client/index.js +14 -0
  25. package/dist/client/index.js.map +1 -0
  26. package/dist/client/managers/AuthManager.d.ts +39 -0
  27. package/dist/client/managers/AuthManager.d.ts.map +1 -0
  28. package/dist/client/managers/AuthManager.js +142 -0
  29. package/dist/client/managers/AuthManager.js.map +1 -0
  30. package/dist/client/managers/AuthenticationManager.d.ts.map +1 -1
  31. package/dist/client/managers/AuthenticationManager.js +10 -9
  32. package/dist/client/managers/AuthenticationManager.js.map +1 -1
  33. package/dist/client/managers/BaseManager.d.ts.map +1 -1
  34. package/dist/client/managers/BaseManager.js +12 -0
  35. package/dist/client/managers/BaseManager.js.map +1 -1
  36. package/dist/client/managers/ComposedAuthenticationManager.d.ts +94 -0
  37. package/dist/client/managers/ComposedAuthenticationManager.d.ts.map +1 -0
  38. package/dist/client/managers/ComposedAuthenticationManager.js +340 -0
  39. package/dist/client/managers/ComposedAuthenticationManager.js.map +1 -0
  40. package/dist/client/managers/ComposedManagerFactory.d.ts +104 -0
  41. package/dist/client/managers/ComposedManagerFactory.d.ts.map +1 -0
  42. package/dist/client/managers/ComposedManagerFactory.js +180 -0
  43. package/dist/client/managers/ComposedManagerFactory.js.map +1 -0
  44. package/dist/client/managers/ComposedRequestManager.d.ts +82 -0
  45. package/dist/client/managers/ComposedRequestManager.d.ts.map +1 -0
  46. package/dist/client/managers/ComposedRequestManager.js +260 -0
  47. package/dist/client/managers/ComposedRequestManager.js.map +1 -0
  48. package/dist/client/managers/JWTAuthImplementation.d.ts +86 -0
  49. package/dist/client/managers/JWTAuthImplementation.d.ts.map +1 -0
  50. package/dist/client/managers/JWTAuthImplementation.js +240 -0
  51. package/dist/client/managers/JWTAuthImplementation.js.map +1 -0
  52. package/dist/client/managers/ManagersIndex.d.ts +6 -0
  53. package/dist/client/managers/ManagersIndex.d.ts.map +1 -0
  54. package/dist/client/managers/ManagersIndex.js +6 -0
  55. package/dist/client/managers/ManagersIndex.js.map +1 -0
  56. package/dist/client/managers/RequestManager.d.ts.map +1 -1
  57. package/dist/client/managers/RequestManager.js +5 -3
  58. package/dist/client/managers/RequestManager.js.map +1 -1
  59. package/dist/client/managers/composed/MigrationAdapter.d.ts +80 -0
  60. package/dist/client/managers/composed/MigrationAdapter.d.ts.map +1 -0
  61. package/dist/client/managers/composed/MigrationAdapter.js +214 -0
  62. package/dist/client/managers/composed/MigrationAdapter.js.map +1 -0
  63. package/dist/client/managers/composed/index.d.ts +23 -0
  64. package/dist/client/managers/composed/index.d.ts.map +1 -0
  65. package/dist/client/managers/composed/index.js +26 -0
  66. package/dist/client/managers/composed/index.js.map +1 -0
  67. package/dist/client/managers/implementations/ConfigurationProviderImpl.d.ts +27 -0
  68. package/dist/client/managers/implementations/ConfigurationProviderImpl.d.ts.map +1 -0
  69. package/dist/client/managers/implementations/ConfigurationProviderImpl.js +41 -0
  70. package/dist/client/managers/implementations/ConfigurationProviderImpl.js.map +1 -0
  71. package/dist/client/managers/implementations/ErrorHandlerImpl.d.ts +31 -0
  72. package/dist/client/managers/implementations/ErrorHandlerImpl.d.ts.map +1 -0
  73. package/dist/client/managers/implementations/ErrorHandlerImpl.js +73 -0
  74. package/dist/client/managers/implementations/ErrorHandlerImpl.js.map +1 -0
  75. package/dist/client/managers/implementations/ParameterValidatorImpl.d.ts +47 -0
  76. package/dist/client/managers/implementations/ParameterValidatorImpl.d.ts.map +1 -0
  77. package/dist/client/managers/implementations/ParameterValidatorImpl.js +141 -0
  78. package/dist/client/managers/implementations/ParameterValidatorImpl.js.map +1 -0
  79. package/dist/client/managers/interfaces/ManagerInterfaces.d.ts +147 -0
  80. package/dist/client/managers/interfaces/ManagerInterfaces.d.ts.map +1 -0
  81. package/dist/client/managers/interfaces/ManagerInterfaces.js +6 -0
  82. package/dist/client/managers/interfaces/ManagerInterfaces.js.map +1 -0
  83. package/dist/config/Config.d.ts +30 -0
  84. package/dist/config/Config.d.ts.map +1 -1
  85. package/dist/config/Config.js +30 -0
  86. package/dist/config/Config.js.map +1 -1
  87. package/dist/config/ConfigurationSchema.d.ts +75 -198
  88. package/dist/config/ConfigurationSchema.d.ts.map +1 -1
  89. package/dist/config/ConfigurationSchema.js +17 -17
  90. package/dist/config/ConfigurationSchema.js.map +1 -1
  91. package/dist/config/ServerConfiguration.d.ts +2 -2
  92. package/dist/config/ServerConfiguration.d.ts.map +1 -1
  93. package/dist/config/ServerConfiguration.js +15 -13
  94. package/dist/config/ServerConfiguration.js.map +1 -1
  95. package/dist/config/index.d.ts +8 -0
  96. package/dist/config/index.d.ts.map +1 -0
  97. package/dist/config/index.js +11 -0
  98. package/dist/config/index.js.map +1 -0
  99. package/dist/docs/DocumentationGenerator.js +2 -2
  100. package/dist/docs/DocumentationGenerator.js.map +1 -1
  101. package/dist/dxt-entry.js +3 -3
  102. package/dist/dxt-entry.js.map +1 -1
  103. package/dist/index.d.ts +1 -0
  104. package/dist/index.d.ts.map +1 -1
  105. package/dist/index.js +38 -37
  106. package/dist/index.js.map +1 -1
  107. package/dist/performance/MetricsCollector.d.ts.map +1 -1
  108. package/dist/performance/MetricsCollector.js +5 -4
  109. package/dist/performance/MetricsCollector.js.map +1 -1
  110. package/dist/security/AISecurityScanner.js +7 -7
  111. package/dist/security/AISecurityScanner.js.map +1 -1
  112. package/dist/security/AutomatedRemediation.d.ts.map +1 -1
  113. package/dist/security/AutomatedRemediation.js +11 -11
  114. package/dist/security/AutomatedRemediation.js.map +1 -1
  115. package/dist/security/InputValidator.d.ts +50 -126
  116. package/dist/security/InputValidator.d.ts.map +1 -1
  117. package/dist/security/InputValidator.js +9 -9
  118. package/dist/security/InputValidator.js.map +1 -1
  119. package/dist/security/SecurityCIPipeline.d.ts +47 -5
  120. package/dist/security/SecurityCIPipeline.d.ts.map +1 -1
  121. package/dist/security/SecurityCIPipeline.js +390 -49
  122. package/dist/security/SecurityCIPipeline.js.map +1 -1
  123. package/dist/security/SecurityConfigManager.js +10 -10
  124. package/dist/security/SecurityConfigManager.js.map +1 -1
  125. package/dist/security/SecurityMonitoring.js +4 -4
  126. package/dist/security/SecurityMonitoring.js.map +1 -1
  127. package/dist/security/SecurityReviewer.d.ts.map +1 -1
  128. package/dist/security/SecurityReviewer.js +13 -6
  129. package/dist/security/SecurityReviewer.js.map +1 -1
  130. package/dist/security/index.js +3 -3
  131. package/dist/security/index.js.map +1 -1
  132. package/dist/server/ConnectionTester.js +5 -5
  133. package/dist/server/ConnectionTester.js.map +1 -1
  134. package/dist/server/ToolRegistry.d.ts +2 -2
  135. package/dist/server/ToolRegistry.d.ts.map +1 -1
  136. package/dist/server/ToolRegistry.js +7 -6
  137. package/dist/server/ToolRegistry.js.map +1 -1
  138. package/dist/server/index.d.ts +7 -0
  139. package/dist/server/index.d.ts.map +1 -0
  140. package/dist/server/index.js +9 -0
  141. package/dist/server/index.js.map +1 -0
  142. package/dist/tools/BaseToolManager.d.ts.map +1 -1
  143. package/dist/tools/BaseToolManager.js +11 -11
  144. package/dist/tools/BaseToolManager.js.map +1 -1
  145. package/dist/tools/auth.d.ts.map +1 -1
  146. package/dist/tools/auth.js +7 -7
  147. package/dist/tools/auth.js.map +1 -1
  148. package/dist/tools/comments.d.ts.map +1 -1
  149. package/dist/tools/comments.js +14 -14
  150. package/dist/tools/comments.js.map +1 -1
  151. package/dist/tools/index.d.ts +1 -0
  152. package/dist/tools/index.d.ts.map +1 -1
  153. package/dist/tools/index.js +1 -0
  154. package/dist/tools/index.js.map +1 -1
  155. package/dist/tools/media.d.ts.map +1 -1
  156. package/dist/tools/media.js +14 -11
  157. package/dist/tools/media.js.map +1 -1
  158. package/dist/tools/pages.d.ts.map +1 -1
  159. package/dist/tools/pages.js +12 -12
  160. package/dist/tools/pages.js.map +1 -1
  161. package/dist/tools/performance.d.ts.map +1 -1
  162. package/dist/tools/performance.js +13 -11
  163. package/dist/tools/performance.js.map +1 -1
  164. package/dist/tools/posts/PostHandlers.d.ts.map +1 -1
  165. package/dist/tools/posts/PostHandlers.js +16 -16
  166. package/dist/tools/posts/PostHandlers.js.map +1 -1
  167. package/dist/tools/posts/PostToolDefinitions.d.ts.map +1 -1
  168. package/dist/tools/posts/index.d.ts.map +1 -1
  169. package/dist/tools/seo/BulkOperations.d.ts +113 -0
  170. package/dist/tools/seo/BulkOperations.d.ts.map +1 -0
  171. package/dist/tools/seo/BulkOperations.js +398 -0
  172. package/dist/tools/seo/BulkOperations.js.map +1 -0
  173. package/dist/tools/seo/SEOHandlers.d.ts +55 -0
  174. package/dist/tools/seo/SEOHandlers.d.ts.map +1 -0
  175. package/dist/tools/seo/SEOHandlers.js +255 -0
  176. package/dist/tools/seo/SEOHandlers.js.map +1 -0
  177. package/dist/tools/seo/SEOToolDefinitions.d.ts +59 -0
  178. package/dist/tools/seo/SEOToolDefinitions.d.ts.map +1 -0
  179. package/dist/tools/seo/SEOToolDefinitions.js +385 -0
  180. package/dist/tools/seo/SEOToolDefinitions.js.map +1 -0
  181. package/dist/tools/seo/SEOTools.d.ts +203 -0
  182. package/dist/tools/seo/SEOTools.d.ts.map +1 -0
  183. package/dist/tools/seo/SEOTools.js +708 -0
  184. package/dist/tools/seo/SEOTools.js.map +1 -0
  185. package/dist/tools/seo/analyzers/ContentAnalyzer.d.ts +94 -0
  186. package/dist/tools/seo/analyzers/ContentAnalyzer.d.ts.map +1 -0
  187. package/dist/tools/seo/analyzers/ContentAnalyzer.js +402 -0
  188. package/dist/tools/seo/analyzers/ContentAnalyzer.js.map +1 -0
  189. package/dist/tools/seo/auditors/SiteAuditor.d.ts +121 -0
  190. package/dist/tools/seo/auditors/SiteAuditor.d.ts.map +1 -0
  191. package/dist/tools/seo/auditors/SiteAuditor.js +600 -0
  192. package/dist/tools/seo/auditors/SiteAuditor.js.map +1 -0
  193. package/dist/tools/seo/generators/MetaGenerator.d.ts +128 -0
  194. package/dist/tools/seo/generators/MetaGenerator.d.ts.map +1 -0
  195. package/dist/tools/seo/generators/MetaGenerator.js +547 -0
  196. package/dist/tools/seo/generators/MetaGenerator.js.map +1 -0
  197. package/dist/tools/seo/generators/SchemaGenerator.d.ts +204 -0
  198. package/dist/tools/seo/generators/SchemaGenerator.d.ts.map +1 -0
  199. package/dist/tools/seo/generators/SchemaGenerator.js +670 -0
  200. package/dist/tools/seo/generators/SchemaGenerator.js.map +1 -0
  201. package/dist/tools/seo/index.d.ts +17 -0
  202. package/dist/tools/seo/index.d.ts.map +1 -0
  203. package/dist/tools/seo/index.js +18 -0
  204. package/dist/tools/seo/index.js.map +1 -0
  205. package/dist/tools/seo/optimizers/InternalLinkingSuggester.d.ts +186 -0
  206. package/dist/tools/seo/optimizers/InternalLinkingSuggester.d.ts.map +1 -0
  207. package/dist/tools/seo/optimizers/InternalLinkingSuggester.js +683 -0
  208. package/dist/tools/seo/optimizers/InternalLinkingSuggester.js.map +1 -0
  209. package/dist/tools/site.d.ts.map +1 -1
  210. package/dist/tools/site.js +12 -12
  211. package/dist/tools/site.js.map +1 -1
  212. package/dist/tools/taxonomies.d.ts.map +1 -1
  213. package/dist/tools/taxonomies.js +20 -20
  214. package/dist/tools/taxonomies.js.map +1 -1
  215. package/dist/tools/users.d.ts.map +1 -1
  216. package/dist/tools/users.js +12 -12
  217. package/dist/tools/users.js.map +1 -1
  218. package/dist/types/client.d.ts +8 -6
  219. package/dist/types/client.d.ts.map +1 -1
  220. package/dist/types/client.js.map +1 -1
  221. package/dist/types/seo.d.ts +473 -0
  222. package/dist/types/seo.d.ts.map +1 -0
  223. package/dist/types/seo.js +94 -0
  224. package/dist/types/seo.js.map +1 -0
  225. package/dist/utils/enhancedError.js +1 -1
  226. package/dist/utils/enhancedError.js.map +1 -1
  227. package/dist/utils/error.d.ts.map +1 -1
  228. package/dist/utils/error.js +0 -1
  229. package/dist/utils/error.js.map +1 -1
  230. package/dist/utils/index.d.ts +12 -0
  231. package/dist/utils/index.d.ts.map +1 -0
  232. package/dist/utils/index.js +18 -0
  233. package/dist/utils/index.js.map +1 -0
  234. package/dist/utils/logger.js +3 -3
  235. package/dist/utils/logger.js.map +1 -1
  236. package/dist/utils/toolWrapper.d.ts +2 -2
  237. package/dist/utils/toolWrapper.js +8 -8
  238. package/dist/utils/toolWrapper.js.map +1 -1
  239. package/dist/utils/validation/core.d.ts.map +1 -1
  240. package/dist/utils/validation/core.js.map +1 -1
  241. package/dist/utils/validation/index.d.ts.map +1 -1
  242. package/dist/utils/validation/index.js.map +1 -1
  243. package/dist/utils/validation/network.js +3 -3
  244. package/dist/utils/validation/network.js.map +1 -1
  245. package/dist/utils/validation/rateLimit.js.map +1 -1
  246. package/dist/utils/validation/security.js.map +1 -1
  247. package/dist/utils/validation/wordpress.js.map +1 -1
  248. package/dist/utils/version.d.ts +144 -0
  249. package/dist/utils/version.d.ts.map +1 -0
  250. package/dist/utils/version.js +318 -0
  251. package/dist/utils/version.js.map +1 -0
  252. package/package.json +24 -58
  253. package/src/cache/CacheInvalidation.ts +183 -20
  254. package/src/cache/HttpCacheWrapper.ts +8 -5
  255. package/src/cache/SEOCacheManager.ts +330 -0
  256. package/src/cache/__tests__/CacheInvalidation.test.ts +6 -11
  257. package/src/cache/__tests__/CachedWordPressClient.test.ts +37 -62
  258. package/src/client/SEOWordPressClient.ts +876 -0
  259. package/src/client/api.ts +50 -21
  260. package/src/client/auth.ts +19 -19
  261. package/src/client/index.ts +16 -0
  262. package/src/client/managers/AuthManager.ts +175 -0
  263. package/src/client/managers/AuthenticationManager.ts +16 -14
  264. package/src/client/managers/BaseManager.ts +24 -5
  265. package/src/client/managers/ComposedAuthenticationManager.ts +409 -0
  266. package/src/client/managers/ComposedManagerFactory.ts +231 -0
  267. package/src/client/managers/ComposedRequestManager.ts +336 -0
  268. package/src/client/managers/JWTAuthImplementation.ts +326 -0
  269. package/src/client/managers/ManagersIndex.ts +6 -0
  270. package/src/client/managers/RequestManager.ts +9 -7
  271. package/src/client/managers/composed/MigrationAdapter.ts +263 -0
  272. package/src/client/managers/composed/index.ts +47 -0
  273. package/src/client/managers/implementations/ConfigurationProviderImpl.ts +52 -0
  274. package/src/client/managers/implementations/ErrorHandlerImpl.ts +102 -0
  275. package/src/client/managers/implementations/ParameterValidatorImpl.ts +221 -0
  276. package/src/client/managers/interfaces/ManagerInterfaces.ts +171 -0
  277. package/src/config/Config.ts +63 -0
  278. package/src/config/ConfigurationSchema.ts +17 -17
  279. package/src/config/ServerConfiguration.ts +18 -16
  280. package/src/config/index.ts +13 -0
  281. package/src/docs/DocumentationGenerator.ts +2 -2
  282. package/src/dxt-entry.ts +3 -3
  283. package/src/index.ts +43 -43
  284. package/src/performance/MetricsCollector.ts +15 -11
  285. package/src/security/AISecurityScanner.ts +7 -7
  286. package/src/security/AutomatedRemediation.ts +13 -11
  287. package/src/security/InputValidator.ts +10 -9
  288. package/src/security/SecurityCIPipeline.ts +494 -56
  289. package/src/security/SecurityConfigManager.ts +10 -10
  290. package/src/security/SecurityMonitoring.ts +5 -5
  291. package/src/security/SecurityReviewer.ts +13 -6
  292. package/src/security/index.ts +3 -3
  293. package/src/server/ConnectionTester.ts +5 -5
  294. package/src/server/ToolRegistry.ts +9 -8
  295. package/src/server/index.ts +10 -0
  296. package/src/tools/BaseToolManager.ts +55 -83
  297. package/src/tools/auth.ts +21 -12
  298. package/src/tools/comments.ts +23 -19
  299. package/src/tools/index.ts +1 -0
  300. package/src/tools/media.ts +23 -20
  301. package/src/tools/pages.ts +20 -13
  302. package/src/tools/performance.ts +101 -32
  303. package/src/tools/posts/PostHandlers.ts +23 -23
  304. package/src/tools/posts/PostToolDefinitions.ts +1 -1
  305. package/src/tools/posts/index.ts +2 -2
  306. package/src/tools/seo/BulkOperations.ts +557 -0
  307. package/src/tools/seo/SEOHandlers.ts +296 -0
  308. package/src/tools/seo/SEOToolDefinitions.ts +402 -0
  309. package/src/tools/seo/SEOTools.ts +871 -0
  310. package/src/tools/seo/analyzers/ContentAnalyzer.ts +493 -0
  311. package/src/tools/seo/auditors/SiteAuditor.ts +787 -0
  312. package/src/tools/seo/generators/MetaGenerator.ts +694 -0
  313. package/src/tools/seo/generators/SchemaGenerator.ts +955 -0
  314. package/src/tools/seo/index.ts +47 -0
  315. package/src/tools/seo/optimizers/InternalLinkingSuggester.ts +934 -0
  316. package/src/tools/site.ts +27 -26
  317. package/src/tools/taxonomies.ts +29 -25
  318. package/src/tools/users.ts +20 -13
  319. package/src/types/client.ts +8 -6
  320. package/src/types/seo.ts +546 -0
  321. package/src/utils/enhancedError.ts +1 -1
  322. package/src/utils/error.ts +1 -2
  323. package/src/utils/index.ts +23 -0
  324. package/src/utils/logger.ts +3 -3
  325. package/src/utils/toolWrapper.ts +10 -10
  326. package/src/utils/validation/core.ts +2 -2
  327. package/src/utils/validation/index.ts +2 -2
  328. package/src/utils/validation/network.ts +5 -5
  329. package/src/utils/validation/rateLimit.ts +1 -1
  330. package/src/utils/validation/security.ts +1 -1
  331. package/src/utils/validation/wordpress.ts +1 -1
  332. package/src/utils/version.ts +402 -0
  333. package/src/dxt-entry.cjs +0 -68
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Manager Interface Definitions
3
+ * Defines contracts for manager behaviors to enable composition over inheritance
4
+ */
5
+
6
+ import type { WordPressClientConfig } from "@/types/client.js";
7
+
8
+ /**
9
+ * Core configuration management interface
10
+ */
11
+ export interface ConfigurationProvider {
12
+ readonly config: WordPressClientConfig;
13
+
14
+ /**
15
+ * Get configuration value by path
16
+ */
17
+ getConfigValue<T>(path: string, defaultValue?: T): T | undefined;
18
+ }
19
+
20
+ /**
21
+ * Error handling interface for managers
22
+ */
23
+ export interface ErrorHandler {
24
+ /**
25
+ * Handle and transform errors with context
26
+ */
27
+ handleError(error: unknown, operation: string): never;
28
+
29
+ /**
30
+ * Log successful operations
31
+ */
32
+ logSuccess(operation: string, details?: unknown): void;
33
+ }
34
+
35
+ /**
36
+ * Parameter validation interface
37
+ */
38
+ export interface ParameterValidator {
39
+ /**
40
+ * Validate required parameters are present
41
+ */
42
+ validateRequired(params: Record<string, unknown>, requiredFields: string[]): void;
43
+
44
+ /**
45
+ * Validate parameter types and formats
46
+ */
47
+ validateParameters<T>(params: unknown, schema?: unknown): T;
48
+
49
+ /**
50
+ * Validate string parameters
51
+ */
52
+ validateString(value: unknown, fieldName: string, options?: {
53
+ required?: boolean;
54
+ minLength?: number;
55
+ maxLength?: number;
56
+ pattern?: RegExp;
57
+ }): string;
58
+
59
+ /**
60
+ * Validate WordPress ID parameters
61
+ */
62
+ validateWordPressId(value: unknown, fieldName?: string): number;
63
+ }
64
+
65
+ /**
66
+ * Base manager contract combining common behaviors
67
+ */
68
+ export interface BaseManagerContract extends ConfigurationProvider, ErrorHandler, ParameterValidator {}
69
+
70
+ /**
71
+ * Request management interface
72
+ */
73
+ export interface RequestHandler {
74
+ /**
75
+ * Execute HTTP request with full request lifecycle management
76
+ */
77
+ request<T>(method: string, endpoint: string, data?: unknown, options?: unknown): Promise<T>;
78
+
79
+ /**
80
+ * Get request statistics
81
+ */
82
+ getStats(): unknown;
83
+
84
+ /**
85
+ * Reset statistics
86
+ */
87
+ resetStats(): void;
88
+ }
89
+
90
+ /**
91
+ * Authentication management interface
92
+ */
93
+ export interface AuthenticationProvider {
94
+ /**
95
+ * Authenticate with the configured method
96
+ */
97
+ authenticate(): Promise<boolean>;
98
+
99
+ /**
100
+ * Check if currently authenticated
101
+ */
102
+ isAuthenticated(): boolean;
103
+
104
+ /**
105
+ * Get authentication headers for requests
106
+ */
107
+ getAuthHeaders(): Record<string, string>;
108
+
109
+ /**
110
+ * Handle authentication failure
111
+ */
112
+ handleAuthFailure(error: unknown): Promise<boolean>;
113
+ }
114
+
115
+ /**
116
+ * Manager factory interface for dependency injection
117
+ */
118
+ export interface ManagerFactory {
119
+ /**
120
+ * Create configuration provider
121
+ */
122
+ createConfigurationProvider(config: WordPressClientConfig): ConfigurationProvider;
123
+
124
+ /**
125
+ * Create error handler
126
+ */
127
+ createErrorHandler(config: WordPressClientConfig): ErrorHandler;
128
+
129
+ /**
130
+ * Create parameter validator
131
+ */
132
+ createParameterValidator(): ParameterValidator;
133
+
134
+ /**
135
+ * Create request handler
136
+ */
137
+ createRequestHandler(config: WordPressClientConfig, authProvider: AuthenticationProvider): RequestHandler;
138
+
139
+ /**
140
+ * Create authentication provider
141
+ */
142
+ createAuthenticationProvider(config: WordPressClientConfig): AuthenticationProvider;
143
+ }
144
+
145
+ /**
146
+ * Configuration for manager composition
147
+ */
148
+ export interface ManagerCompositionConfig {
149
+ /** WordPress client configuration */
150
+ clientConfig: WordPressClientConfig;
151
+
152
+ /** Optional custom implementations */
153
+ customErrorHandler?: ErrorHandler;
154
+ customValidator?: ParameterValidator;
155
+ customAuthProvider?: AuthenticationProvider;
156
+ }
157
+
158
+ /**
159
+ * Composed manager that uses composition instead of inheritance
160
+ */
161
+ export interface ComposedManager extends BaseManagerContract, RequestHandler, AuthenticationProvider {
162
+ /**
163
+ * Initialize the composed manager
164
+ */
165
+ initialize(): Promise<void>;
166
+
167
+ /**
168
+ * Cleanup resources
169
+ */
170
+ dispose(): void;
171
+ }
@@ -74,6 +74,38 @@ export interface AppConfig {
74
74
  readonly isTravis: boolean;
75
75
  readonly isCircleCI: boolean;
76
76
  };
77
+
78
+ // SEO Configuration
79
+ readonly seo: {
80
+ readonly enabled: boolean;
81
+ readonly providers: {
82
+ readonly searchConsole: boolean;
83
+ readonly dataForSEO: boolean;
84
+ readonly ahrefs: boolean;
85
+ };
86
+ readonly limits: {
87
+ readonly bulkOperationSize: number;
88
+ readonly rateLimitPerMinute: number;
89
+ readonly maxConcurrentAnalysis: number;
90
+ };
91
+ readonly cache: {
92
+ readonly analysisTTL: number;
93
+ readonly schemaTTL: number;
94
+ readonly auditTTL: number;
95
+ readonly keywordsTTL: number;
96
+ };
97
+ readonly metadata: {
98
+ readonly titleMaxLength: number;
99
+ readonly descriptionMaxLength: number;
100
+ readonly descriptionMinLength: number;
101
+ };
102
+ readonly analysis: {
103
+ readonly minWordCount: number;
104
+ readonly targetKeywordDensity: number;
105
+ readonly maxKeywordDensity: number;
106
+ readonly minReadabilityScore: number;
107
+ };
108
+ };
77
109
  }
78
110
 
79
111
  /**
@@ -174,6 +206,37 @@ export class Config {
174
206
  isTravis: process.env.TRAVIS === "true",
175
207
  isCircleCI: process.env.CIRCLECI === "true",
176
208
  },
209
+
210
+ seo: {
211
+ enabled: process.env.SEO_ENABLED !== "false",
212
+ providers: {
213
+ searchConsole: process.env.SEO_PROVIDER_SEARCH_CONSOLE === "true",
214
+ dataForSEO: process.env.SEO_PROVIDER_DATAFORSEO === "true",
215
+ ahrefs: process.env.SEO_PROVIDER_AHREFS === "true",
216
+ },
217
+ limits: {
218
+ bulkOperationSize: parseInt(process.env.SEO_BULK_OPERATION_SIZE || "10", 10),
219
+ rateLimitPerMinute: parseInt(process.env.SEO_RATE_LIMIT_PER_MINUTE || "30", 10),
220
+ maxConcurrentAnalysis: parseInt(process.env.SEO_MAX_CONCURRENT_ANALYSIS || "5", 10),
221
+ },
222
+ cache: {
223
+ analysisTTL: parseInt(process.env.SEO_CACHE_ANALYSIS_TTL || "21600", 10), // 6 hours
224
+ schemaTTL: parseInt(process.env.SEO_CACHE_SCHEMA_TTL || "86400", 10), // 24 hours
225
+ auditTTL: parseInt(process.env.SEO_CACHE_AUDIT_TTL || "3600", 10), // 1 hour
226
+ keywordsTTL: parseInt(process.env.SEO_CACHE_KEYWORDS_TTL || "604800", 10), // 7 days
227
+ },
228
+ metadata: {
229
+ titleMaxLength: parseInt(process.env.SEO_TITLE_MAX_LENGTH || "60", 10),
230
+ descriptionMaxLength: parseInt(process.env.SEO_DESCRIPTION_MAX_LENGTH || "160", 10),
231
+ descriptionMinLength: parseInt(process.env.SEO_DESCRIPTION_MIN_LENGTH || "155", 10),
232
+ },
233
+ analysis: {
234
+ minWordCount: parseInt(process.env.SEO_MIN_WORD_COUNT || "300", 10),
235
+ targetKeywordDensity: parseFloat(process.env.SEO_TARGET_KEYWORD_DENSITY || "2.5"),
236
+ maxKeywordDensity: parseFloat(process.env.SEO_MAX_KEYWORD_DENSITY || "3.5"),
237
+ minReadabilityScore: parseFloat(process.env.SEO_MIN_READABILITY_SCORE || "60"),
238
+ },
239
+ },
177
240
  };
178
241
  }
179
242
 
@@ -142,12 +142,12 @@ export class ConfigurationValidator {
142
142
  static validateMultiSiteConfig(config: unknown): MultiSiteConfigType {
143
143
  try {
144
144
  return MultiSiteConfigSchema.parse(config);
145
- } catch (error) {
146
- if (error instanceof z.ZodError) {
147
- const messages = error.errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("; ");
145
+ } catch (_error) {
146
+ if (_error instanceof z.ZodError) {
147
+ const messages = _error.issues.map((err: z.ZodIssue) => `${err.path.join(".")}: ${err.message}`).join("; ");
148
148
  throw new Error(`Multi-site configuration validation failed: ${messages}`);
149
149
  }
150
- throw error;
150
+ throw _error;
151
151
  }
152
152
  }
153
153
 
@@ -157,12 +157,12 @@ export class ConfigurationValidator {
157
157
  static validateEnvironmentConfig(env: Record<string, string | undefined>): EnvironmentConfigType {
158
158
  try {
159
159
  return EnvironmentConfigSchema.parse(env);
160
- } catch (error) {
161
- if (error instanceof z.ZodError) {
162
- const messages = error.errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("; ");
160
+ } catch (_error) {
161
+ if (_error instanceof z.ZodError) {
162
+ const messages = _error.issues.map((err: z.ZodIssue) => `${err.path.join(".")}: ${err.message}`).join("; ");
163
163
  throw new Error(`Environment configuration validation failed: ${messages}`);
164
164
  }
165
- throw error;
165
+ throw _error;
166
166
  }
167
167
  }
168
168
 
@@ -172,12 +172,12 @@ export class ConfigurationValidator {
172
172
  static validateMcpConfig(config: unknown): McpConfigType {
173
173
  try {
174
174
  return McpConfigSchema.parse(config);
175
- } catch (error) {
176
- if (error instanceof z.ZodError) {
177
- const messages = error.errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("; ");
175
+ } catch (_error) {
176
+ if (_error instanceof z.ZodError) {
177
+ const messages = _error.issues.map((err: z.ZodIssue) => `${err.path.join(".")}: ${err.message}`).join("; ");
178
178
  throw new Error(`MCP configuration validation failed: ${messages}`);
179
179
  }
180
- throw error;
180
+ throw _error;
181
181
  }
182
182
  }
183
183
 
@@ -187,12 +187,12 @@ export class ConfigurationValidator {
187
187
  static validateSiteConfig(config: unknown): SiteType {
188
188
  try {
189
189
  return SiteSchema.parse(config);
190
- } catch (error) {
191
- if (error instanceof z.ZodError) {
192
- const messages = error.errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("; ");
190
+ } catch (_error) {
191
+ if (_error instanceof z.ZodError) {
192
+ const messages = _error.issues.map((err: z.ZodIssue) => `${err.path.join(".")}: ${err.message}`).join("; ");
193
193
  throw new Error(`Site configuration validation failed: ${messages}`);
194
194
  }
195
- throw error;
195
+ throw _error;
196
196
  }
197
197
  }
198
198
 
@@ -220,7 +220,7 @@ export class ConfigurationValidator {
220
220
  if (result.success) {
221
221
  return [];
222
222
  }
223
- return result.error.errors.map((err) => `${err.path.join(".")}: ${err.message}`);
223
+ return result.error.issues.map((err: z.ZodIssue) => `${err.path.join(".")}: ${err.message}`);
224
224
  }
225
225
  }
226
226
 
@@ -1,5 +1,5 @@
1
1
  import dotenv from "dotenv";
2
- import * as fs from "fs";
2
+ import { promises as fsPromises } from "fs";
3
3
  import * as path from "path";
4
4
  import { fileURLToPath } from "url";
5
5
  import { WordPressClient } from "../client/api.js";
@@ -46,10 +46,10 @@ export class ServerConfiguration {
46
46
  console.log = () => {};
47
47
  // eslint-disable-next-line no-console
48
48
  console.error = () => {};
49
- dotenv.config({
49
+ dotenv.config({
50
50
  path: this.envPath,
51
51
  debug: false,
52
- override: false
52
+ override: false,
53
53
  });
54
54
  } finally {
55
55
  // eslint-disable-next-line no-console
@@ -63,7 +63,7 @@ export class ServerConfiguration {
63
63
  this.logger.debug("ServerConfiguration initialized", {
64
64
  rootDir: this.rootDir,
65
65
  envPath: this.envPath,
66
- envFileExists: fs.existsSync(this.envPath),
66
+ // Note: envFileExists check moved to async initialization
67
67
  });
68
68
  }
69
69
  }
@@ -82,18 +82,20 @@ export class ServerConfiguration {
82
82
  * Load WordPress client configurations
83
83
  * Returns a Map of site ID to WordPressClient instances
84
84
  */
85
- public loadClientConfigurations(mcpConfig?: McpConfigType): {
85
+ public async loadClientConfigurations(mcpConfig?: McpConfigType): Promise<{
86
86
  clients: Map<string, WordPressClient>;
87
87
  configs: SiteConfig[];
88
- } {
88
+ }> {
89
89
  const configPath = path.resolve(this.rootDir, "mcp-wordpress.config.json");
90
90
 
91
- if (fs.existsSync(configPath)) {
91
+ try {
92
+ await fsPromises.access(configPath);
92
93
  if (ConfigHelpers.shouldLogInfo()) {
93
94
  this.logger.info("Found multi-site configuration file", { configPath });
94
95
  }
95
- return this.loadMultiSiteConfig(configPath);
96
- } else {
96
+ return await this.loadMultiSiteConfig(configPath);
97
+ } catch (_error) {
98
+ // Config file doesn't exist or is not accessible
97
99
  if (ConfigHelpers.shouldLogInfo()) {
98
100
  this.logger.info("Multi-site config not found, using environment variables for single-site mode", {
99
101
  configPath,
@@ -106,12 +108,12 @@ export class ServerConfiguration {
106
108
  /**
107
109
  * Load multi-site configuration from JSON file
108
110
  */
109
- private loadMultiSiteConfig(configPath: string): {
111
+ private async loadMultiSiteConfig(configPath: string): Promise<{
110
112
  clients: Map<string, WordPressClient>;
111
113
  configs: SiteConfig[];
112
- } {
114
+ }> {
113
115
  try {
114
- const configFile = fs.readFileSync(configPath, "utf-8");
116
+ const configFile = await fsPromises.readFile(configPath, "utf-8");
115
117
  const rawConfig = JSON.parse(configFile);
116
118
 
117
119
  // Validate configuration using Zod schema
@@ -147,10 +149,10 @@ export class ServerConfiguration {
147
149
  }
148
150
 
149
151
  return { clients, configs: validConfigs };
150
- } catch (error) {
152
+ } catch (_error) {
151
153
  this.logger.fatal("Failed to load multi-site configuration", {
152
154
  configPath,
153
- error: getErrorMessage(error),
155
+ _error: getErrorMessage(_error),
154
156
  });
155
157
  process.exit(1);
156
158
  }
@@ -287,9 +289,9 @@ export class ServerConfiguration {
287
289
  }
288
290
 
289
291
  return { clients, configs: [siteConfig] };
290
- } catch (error) {
292
+ } catch (_error) {
291
293
  this.logger.error("Configuration validation failed for single-site mode", {
292
- error: getErrorMessage(error),
294
+ _error: getErrorMessage(_error),
293
295
  suggestion: "Please check your environment variables or MCP configuration",
294
296
  });
295
297
  return { clients: new Map(), configs: [] };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Configuration Barrel Export
3
+ * Centralized exports for all configuration management
4
+ */
5
+
6
+ // Main Configuration System
7
+ export { Config, ConfigHelpers, config } from './Config.js';
8
+
9
+ // Configuration Schema and Validation
10
+ export * from './ConfigurationSchema.js';
11
+
12
+ // Server Configuration (legacy)
13
+ export * from './ServerConfiguration.js';
@@ -193,8 +193,8 @@ export class DocumentationGenerator {
193
193
  const doc = await this.extractToolDocumentation(toolDef as ToolDefinition, category, className);
194
194
  toolDocs.push(doc);
195
195
  }
196
- } catch (error) {
197
- this.logger.warn(`⚠️ Failed to extract documentation for ${className}:`, { error: String(error) });
196
+ } catch (_error) {
197
+ this.logger.warn(`⚠️ Failed to extract documentation for ${className}:`, { _error: String(_error) });
198
198
  }
199
199
  }
200
200
 
package/src/dxt-entry.ts CHANGED
@@ -34,9 +34,9 @@ async function startDXTServer() {
34
34
 
35
35
  process.on("SIGINT", shutdown);
36
36
  process.on("SIGTERM", shutdown);
37
- } catch (error) {
38
- logger.fatal(`DXT server failed to start: ${error instanceof Error ? error.message : String(error)}`);
39
- logger.fatal(`Stack trace: ${error instanceof Error ? error.stack : "No stack trace available"}`);
37
+ } catch (_error) {
38
+ logger.fatal(`DXT server failed to start: ${_error instanceof Error ? _error.message : String(_error)}`);
39
+ logger.fatal(`Stack trace: ${_error instanceof Error ? _error.stack : "No stack trace available"}`);
40
40
  process.exit(1);
41
41
  }
42
42
  }
package/src/index.ts CHANGED
@@ -9,9 +9,7 @@ import { getErrorMessage } from "./utils/error.js";
9
9
  import { LoggerFactory } from "./utils/logger.js";
10
10
  import { ConfigHelpers } from "./config/Config.js";
11
11
  import { McpConfigType } from "./config/ServerConfiguration.js";
12
-
13
- // --- Constants ---
14
- const SERVER_VERSION = "1.1.8"; // Technical debt resolution and modular architecture
12
+ import { getVersion, getDisplayVersion } from "./utils/version.js";
15
13
 
16
14
  // --- Main Server Class ---
17
15
  class MCPWordPressServer {
@@ -19,42 +17,20 @@ class MCPWordPressServer {
19
17
  private wordpressClients: Map<string, WordPressClient> = new Map();
20
18
  private initialized: boolean = false;
21
19
  private siteConfigs: SiteConfig[] = [];
22
- private toolRegistry: ToolRegistry;
20
+ private toolRegistry!: ToolRegistry;
23
21
  private logger = LoggerFactory.server();
24
22
 
25
- constructor(mcpConfig?: McpConfigType) {
26
- this.loadConfiguration(mcpConfig);
27
-
28
- if (this.wordpressClients.size === 0) {
29
- // In test environments, don't exit the process
30
- if (ConfigHelpers.isCI() || ConfigHelpers.isTest() || (globalThis as Record<string, unknown>).__EXECUTION_CONTEXT__ === "jest") {
31
- this.logger.warn("No WordPress sites configured in test environment");
32
- // Create a dummy client for testing
33
- this.wordpressClients.set("test", {} as WordPressClient);
34
- } else {
35
- this.logger.fatal("No WordPress sites configured. Server cannot start.", {
36
- expectedEnvVars: [
37
- "WORDPRESS_SITE_URL",
38
- "WORDPRESS_USERNAME",
39
- "WORDPRESS_APP_PASSWORD"
40
- ]
41
- });
42
- process.exit(1);
43
- }
44
- }
45
-
23
+ constructor(private mcpConfig?: McpConfigType) {
24
+ // Server initialization will happen in run() method
46
25
  this.server = new McpServer({
47
26
  name: "mcp-wordpress",
48
- version: SERVER_VERSION,
27
+ version: getVersion(),
49
28
  });
50
-
51
- this.toolRegistry = new ToolRegistry(this.server, this.wordpressClients);
52
- this.setupTools();
53
29
  }
54
30
 
55
- private loadConfiguration(mcpConfig?: McpConfigType) {
31
+ private async loadConfiguration(mcpConfig?: McpConfigType) {
56
32
  const serverConfig = ServerConfiguration.getInstance();
57
- const { clients, configs } = serverConfig.loadClientConfigurations(mcpConfig);
33
+ const { clients, configs } = await serverConfig.loadClientConfigurations(mcpConfig);
58
34
 
59
35
  this.wordpressClients = clients;
60
36
  this.siteConfigs = configs;
@@ -68,24 +44,48 @@ class MCPWordPressServer {
68
44
  // Use optimized connection testing with timeouts and concurrency control
69
45
  await ConnectionTester.testClientConnections(this.wordpressClients, {
70
46
  timeout: ConfigHelpers.getTimeout("test"),
71
- maxConcurrent: ConfigHelpers.isCI() ? 2 : 3 // Reduce concurrency in CI
47
+ maxConcurrent: ConfigHelpers.isCI() ? 2 : 3, // Reduce concurrency in CI
72
48
  });
73
49
  this.initialized = true;
74
50
  }
75
51
 
76
52
  async run() {
53
+ // Load configuration asynchronously
54
+ await this.loadConfiguration(this.mcpConfig);
55
+
56
+ if (this.wordpressClients.size === 0) {
57
+ // In test environments, don't exit the process
58
+ if (
59
+ ConfigHelpers.isCI() ||
60
+ ConfigHelpers.isTest() ||
61
+ (globalThis as Record<string, unknown>).__EXECUTION_CONTEXT__ === "jest"
62
+ ) {
63
+ this.logger.warn("No WordPress sites configured in test environment");
64
+ // Create a dummy client for testing
65
+ this.wordpressClients.set("test", {} as WordPressClient);
66
+ } else {
67
+ this.logger.fatal("No WordPress sites configured. Server cannot start.", {
68
+ expectedEnvVars: ["WORDPRESS_SITE_URL", "WORDPRESS_USERNAME", "WORDPRESS_APP_PASSWORD"],
69
+ });
70
+ process.exit(1);
71
+ }
72
+ }
73
+
74
+ this.toolRegistry = new ToolRegistry(this.server, this.wordpressClients);
75
+ this.setupTools();
76
+
77
77
  // Skip connection testing in DXT environment to prevent timeouts
78
78
  const isDXTMode = ConfigHelpers.isDXT() || process.argv[0]?.includes("dxt-entry");
79
79
 
80
80
  if (!this.initialized && !isDXTMode) {
81
81
  this.logger.info("Testing connections to configured WordPress sites...", {
82
- siteCount: this.wordpressClients.size
82
+ siteCount: this.wordpressClients.size,
83
83
  });
84
84
  try {
85
85
  await this.testClientConnections();
86
- } catch (error) {
86
+ } catch (_error) {
87
87
  this.logger.warn("Connection test failed - continuing with server startup", {
88
- error: getErrorMessage(error)
88
+ _error: getErrorMessage(_error),
89
89
  });
90
90
  }
91
91
  } else if (isDXTMode) {
@@ -94,8 +94,8 @@ class MCPWordPressServer {
94
94
  }
95
95
 
96
96
  this.logger.info("Starting MCP WordPress Server...", {
97
- version: SERVER_VERSION,
98
- sites: this.wordpressClients.size
97
+ version: getDisplayVersion(),
98
+ sites: this.wordpressClients.size,
99
99
  });
100
100
 
101
101
  // Connect to stdio transport with timeout
@@ -112,14 +112,14 @@ class MCPWordPressServer {
112
112
  clearTimeout(connectionTimeout);
113
113
 
114
114
  this.logger.info("Server started and connected successfully", {
115
- sites: this.wordpressClients.size
115
+ sites: this.wordpressClients.size,
116
116
  });
117
117
 
118
118
  // Keep the process alive
119
119
  process.stdin.resume();
120
- } catch (error) {
120
+ } catch (_error) {
121
121
  clearTimeout(connectionTimeout);
122
- throw error;
122
+ throw _error;
123
123
  }
124
124
  }
125
125
 
@@ -133,7 +133,7 @@ class MCPWordPressServer {
133
133
  // --- Main Execution ---
134
134
  async function main() {
135
135
  const mainLogger = LoggerFactory.server();
136
-
136
+
137
137
  try {
138
138
  const mcpServer = new MCPWordPressServer();
139
139
  await mcpServer.run();
@@ -145,8 +145,8 @@ async function main() {
145
145
 
146
146
  process.on("SIGINT", shutdown);
147
147
  process.on("SIGTERM", shutdown);
148
- } catch (error) {
149
- mainLogger.fatal("Failed to start server", { error: getErrorMessage(error) });
148
+ } catch (_error) {
149
+ mainLogger.fatal("Failed to start server", { _error: getErrorMessage(_error) });
150
150
  process.exit(1);
151
151
  }
152
152
  }
@@ -178,6 +178,7 @@ export class MetricsCollector {
178
178
  averageResponseTime: 0,
179
179
  rateLimitHits: 0,
180
180
  authFailures: 0,
181
+ errors: 0,
181
182
  };
182
183
 
183
184
  const responseTimes: number[] = [];
@@ -252,13 +253,16 @@ export class MetricsCollector {
252
253
  worstPerforming: string;
253
254
  } {
254
255
  const sites = Array.from(this.clientInstances.keys());
255
- const comparison: Record<string, {
256
- responseTime: number;
257
- cacheHitRate: number;
258
- errorRate: number;
259
- requestCount: number;
260
- ranking: number;
261
- }> = {};
256
+ const comparison: Record<
257
+ string,
258
+ {
259
+ responseTime: number;
260
+ cacheHitRate: number;
261
+ errorRate: number;
262
+ requestCount: number;
263
+ ranking: number;
264
+ }
265
+ > = {};
262
266
  const rankings: Array<{ site: string; score: number }> = [];
263
267
 
264
268
  for (const siteId of sites) {
@@ -401,9 +405,9 @@ export class MetricsCollector {
401
405
  this.updateCacheMetrics();
402
406
  this.updateClientMetrics();
403
407
  this.logger.debug("Real-time metrics updated");
404
- } catch (error) {
408
+ } catch (_error) {
405
409
  this.logger.error("Failed to update real-time metrics", {
406
- error: error instanceof Error ? error.message : String(error),
410
+ _error: _error instanceof Error ? _error.message : String(_error),
407
411
  });
408
412
  }
409
413
  }, interval);
@@ -480,12 +484,12 @@ export class MetricsCollector {
480
484
  this.activeRequests.delete(requestId);
481
485
 
482
486
  return result;
483
- } catch (error) {
487
+ } catch (_error) {
484
488
  const responseTime = Date.now() - startTime;
485
489
  this.monitor.recordRequest(responseTime, false);
486
490
  this.activeRequests.delete(requestId);
487
491
 
488
- throw error;
492
+ throw _error;
489
493
  }
490
494
  };
491
495
  }