mcp-wordpress 2.5.1 → 2.5.2

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 (289) hide show
  1. package/package.json +1 -1
  2. package/dist/src/cache/CacheInvalidation.d.ts +0 -120
  3. package/dist/src/cache/CacheInvalidation.d.ts.map +0 -1
  4. package/dist/src/cache/CacheInvalidation.js +0 -355
  5. package/dist/src/cache/CacheInvalidation.js.map +0 -1
  6. package/dist/src/cache/CacheManager.d.ts +0 -149
  7. package/dist/src/cache/CacheManager.d.ts.map +0 -1
  8. package/dist/src/cache/CacheManager.js +0 -326
  9. package/dist/src/cache/CacheManager.js.map +0 -1
  10. package/dist/src/cache/HttpCacheWrapper.d.ts +0 -122
  11. package/dist/src/cache/HttpCacheWrapper.d.ts.map +0 -1
  12. package/dist/src/cache/HttpCacheWrapper.js +0 -283
  13. package/dist/src/cache/HttpCacheWrapper.js.map +0 -1
  14. package/dist/src/cache/index.d.ts +0 -12
  15. package/dist/src/cache/index.d.ts.map +0 -1
  16. package/dist/src/cache/index.js +0 -9
  17. package/dist/src/cache/index.js.map +0 -1
  18. package/dist/src/client/CachedWordPressClient.d.ts +0 -174
  19. package/dist/src/client/CachedWordPressClient.d.ts.map +0 -1
  20. package/dist/src/client/CachedWordPressClient.js +0 -345
  21. package/dist/src/client/CachedWordPressClient.js.map +0 -1
  22. package/dist/src/client/MockWordPressClient.d.ts +0 -56
  23. package/dist/src/client/MockWordPressClient.d.ts.map +0 -1
  24. package/dist/src/client/MockWordPressClient.js +0 -371
  25. package/dist/src/client/MockWordPressClient.js.map +0 -1
  26. package/dist/src/client/api.d.ts +0 -235
  27. package/dist/src/client/api.d.ts.map +0 -1
  28. package/dist/src/client/api.js +0 -896
  29. package/dist/src/client/api.js.map +0 -1
  30. package/dist/src/client/auth.d.ts +0 -121
  31. package/dist/src/client/auth.d.ts.map +0 -1
  32. package/dist/src/client/auth.js +0 -429
  33. package/dist/src/client/auth.js.map +0 -1
  34. package/dist/src/client/managers/AuthenticationManager.d.ts +0 -92
  35. package/dist/src/client/managers/AuthenticationManager.d.ts.map +0 -1
  36. package/dist/src/client/managers/AuthenticationManager.js +0 -369
  37. package/dist/src/client/managers/AuthenticationManager.js.map +0 -1
  38. package/dist/src/client/managers/BaseManager.d.ts +0 -22
  39. package/dist/src/client/managers/BaseManager.d.ts.map +0 -1
  40. package/dist/src/client/managers/BaseManager.js +0 -53
  41. package/dist/src/client/managers/BaseManager.js.map +0 -1
  42. package/dist/src/client/managers/RequestManager.d.ts +0 -47
  43. package/dist/src/client/managers/RequestManager.d.ts.map +0 -1
  44. package/dist/src/client/managers/RequestManager.js +0 -193
  45. package/dist/src/client/managers/RequestManager.js.map +0 -1
  46. package/dist/src/client/managers/index.d.ts +0 -8
  47. package/dist/src/client/managers/index.d.ts.map +0 -1
  48. package/dist/src/client/managers/index.js +0 -8
  49. package/dist/src/client/managers/index.js.map +0 -1
  50. package/dist/src/config/Config.d.ts +0 -155
  51. package/dist/src/config/Config.d.ts.map +0 -1
  52. package/dist/src/config/Config.js +0 -215
  53. package/dist/src/config/Config.js.map +0 -1
  54. package/dist/src/config/ConfigurationSchema.d.ts +0 -281
  55. package/dist/src/config/ConfigurationSchema.d.ts.map +0 -1
  56. package/dist/src/config/ConfigurationSchema.js +0 -205
  57. package/dist/src/config/ConfigurationSchema.js.map +0 -1
  58. package/dist/src/config/ServerConfiguration.d.ts +0 -47
  59. package/dist/src/config/ServerConfiguration.d.ts.map +0 -1
  60. package/dist/src/config/ServerConfiguration.js +0 -255
  61. package/dist/src/config/ServerConfiguration.js.map +0 -1
  62. package/dist/src/docs/DocumentationGenerator.d.ts +0 -185
  63. package/dist/src/docs/DocumentationGenerator.d.ts.map +0 -1
  64. package/dist/src/docs/DocumentationGenerator.js +0 -777
  65. package/dist/src/docs/DocumentationGenerator.js.map +0 -1
  66. package/dist/src/docs/MarkdownFormatter.d.ts +0 -84
  67. package/dist/src/docs/MarkdownFormatter.d.ts.map +0 -1
  68. package/dist/src/docs/MarkdownFormatter.js +0 -458
  69. package/dist/src/docs/MarkdownFormatter.js.map +0 -1
  70. package/dist/src/docs/index.d.ts +0 -8
  71. package/dist/src/docs/index.d.ts.map +0 -1
  72. package/dist/src/docs/index.js +0 -7
  73. package/dist/src/docs/index.js.map +0 -1
  74. package/dist/src/dxt-entry.d.ts +0 -6
  75. package/dist/src/dxt-entry.d.ts.map +0 -1
  76. package/dist/src/dxt-entry.js +0 -39
  77. package/dist/src/dxt-entry.js.map +0 -1
  78. package/dist/src/index.d.ts +0 -18
  79. package/dist/src/index.d.ts.map +0 -1
  80. package/dist/src/index.js +0 -143
  81. package/dist/src/index.js.map +0 -1
  82. package/dist/src/performance/MetricsCollector.d.ts +0 -145
  83. package/dist/src/performance/MetricsCollector.d.ts.map +0 -1
  84. package/dist/src/performance/MetricsCollector.js +0 -368
  85. package/dist/src/performance/MetricsCollector.js.map +0 -1
  86. package/dist/src/performance/PerformanceAnalytics.d.ts +0 -168
  87. package/dist/src/performance/PerformanceAnalytics.d.ts.map +0 -1
  88. package/dist/src/performance/PerformanceAnalytics.js +0 -570
  89. package/dist/src/performance/PerformanceAnalytics.js.map +0 -1
  90. package/dist/src/performance/PerformanceMonitor.d.ts +0 -203
  91. package/dist/src/performance/PerformanceMonitor.d.ts.map +0 -1
  92. package/dist/src/performance/PerformanceMonitor.js +0 -478
  93. package/dist/src/performance/PerformanceMonitor.js.map +0 -1
  94. package/dist/src/performance/index.d.ts +0 -11
  95. package/dist/src/performance/index.d.ts.map +0 -1
  96. package/dist/src/performance/index.js +0 -8
  97. package/dist/src/performance/index.js.map +0 -1
  98. package/dist/src/security/AISecurityScanner.d.ts +0 -176
  99. package/dist/src/security/AISecurityScanner.d.ts.map +0 -1
  100. package/dist/src/security/AISecurityScanner.js +0 -655
  101. package/dist/src/security/AISecurityScanner.js.map +0 -1
  102. package/dist/src/security/AutomatedRemediation.d.ts +0 -146
  103. package/dist/src/security/AutomatedRemediation.d.ts.map +0 -1
  104. package/dist/src/security/AutomatedRemediation.js +0 -566
  105. package/dist/src/security/AutomatedRemediation.js.map +0 -1
  106. package/dist/src/security/InputValidator.d.ts +0 -219
  107. package/dist/src/security/InputValidator.d.ts.map +0 -1
  108. package/dist/src/security/InputValidator.js +0 -295
  109. package/dist/src/security/InputValidator.js.map +0 -1
  110. package/dist/src/security/SecurityCIPipeline.d.ts +0 -213
  111. package/dist/src/security/SecurityCIPipeline.d.ts.map +0 -1
  112. package/dist/src/security/SecurityCIPipeline.js +0 -693
  113. package/dist/src/security/SecurityCIPipeline.js.map +0 -1
  114. package/dist/src/security/SecurityConfig.d.ts +0 -129
  115. package/dist/src/security/SecurityConfig.d.ts.map +0 -1
  116. package/dist/src/security/SecurityConfig.js +0 -266
  117. package/dist/src/security/SecurityConfig.js.map +0 -1
  118. package/dist/src/security/SecurityConfigManager.d.ts +0 -294
  119. package/dist/src/security/SecurityConfigManager.d.ts.map +0 -1
  120. package/dist/src/security/SecurityConfigManager.js +0 -558
  121. package/dist/src/security/SecurityConfigManager.js.map +0 -1
  122. package/dist/src/security/SecurityMonitoring.d.ts +0 -245
  123. package/dist/src/security/SecurityMonitoring.d.ts.map +0 -1
  124. package/dist/src/security/SecurityMonitoring.js +0 -598
  125. package/dist/src/security/SecurityMonitoring.js.map +0 -1
  126. package/dist/src/security/SecurityReviewer.d.ts +0 -168
  127. package/dist/src/security/SecurityReviewer.d.ts.map +0 -1
  128. package/dist/src/security/SecurityReviewer.js +0 -686
  129. package/dist/src/security/SecurityReviewer.js.map +0 -1
  130. package/dist/src/security/index.d.ts +0 -183
  131. package/dist/src/security/index.d.ts.map +0 -1
  132. package/dist/src/security/index.js +0 -218
  133. package/dist/src/security/index.js.map +0 -1
  134. package/dist/src/server/ConnectionTester.d.ts +0 -32
  135. package/dist/src/server/ConnectionTester.d.ts.map +0 -1
  136. package/dist/src/server/ConnectionTester.js +0 -135
  137. package/dist/src/server/ConnectionTester.js.map +0 -1
  138. package/dist/src/server/ToolRegistry.d.ts +0 -50
  139. package/dist/src/server/ToolRegistry.d.ts.map +0 -1
  140. package/dist/src/server/ToolRegistry.js +0 -219
  141. package/dist/src/server/ToolRegistry.js.map +0 -1
  142. package/dist/src/server.d.ts +0 -7
  143. package/dist/src/server.d.ts.map +0 -1
  144. package/dist/src/server.js +0 -7
  145. package/dist/src/server.js.map +0 -1
  146. package/dist/src/tools/BaseToolManager.d.ts +0 -62
  147. package/dist/src/tools/BaseToolManager.d.ts.map +0 -1
  148. package/dist/src/tools/BaseToolManager.js +0 -195
  149. package/dist/src/tools/BaseToolManager.js.map +0 -1
  150. package/dist/src/tools/auth.d.ts +0 -50
  151. package/dist/src/tools/auth.d.ts.map +0 -1
  152. package/dist/src/tools/auth.js +0 -133
  153. package/dist/src/tools/auth.js.map +0 -1
  154. package/dist/src/tools/cache.d.ts +0 -260
  155. package/dist/src/tools/cache.d.ts.map +0 -1
  156. package/dist/src/tools/cache.js +0 -232
  157. package/dist/src/tools/cache.js.map +0 -1
  158. package/dist/src/tools/comments.d.ts +0 -33
  159. package/dist/src/tools/comments.d.ts.map +0 -1
  160. package/dist/src/tools/comments.js +0 -235
  161. package/dist/src/tools/comments.js.map +0 -1
  162. package/dist/src/tools/index.d.ts +0 -11
  163. package/dist/src/tools/index.d.ts.map +0 -1
  164. package/dist/src/tools/index.js +0 -11
  165. package/dist/src/tools/index.js.map +0 -1
  166. package/dist/src/tools/media.d.ts +0 -70
  167. package/dist/src/tools/media.d.ts.map +0 -1
  168. package/dist/src/tools/media.js +0 -248
  169. package/dist/src/tools/media.js.map +0 -1
  170. package/dist/src/tools/pages.d.ts +0 -32
  171. package/dist/src/tools/pages.d.ts.map +0 -1
  172. package/dist/src/tools/pages.js +0 -215
  173. package/dist/src/tools/pages.js.map +0 -1
  174. package/dist/src/tools/performance.d.ts +0 -73
  175. package/dist/src/tools/performance.d.ts.map +0 -1
  176. package/dist/src/tools/performance.js +0 -922
  177. package/dist/src/tools/performance.js.map +0 -1
  178. package/dist/src/tools/posts/PostHandlers.d.ts +0 -46
  179. package/dist/src/tools/posts/PostHandlers.d.ts.map +0 -1
  180. package/dist/src/tools/posts/PostHandlers.js +0 -400
  181. package/dist/src/tools/posts/PostHandlers.js.map +0 -1
  182. package/dist/src/tools/posts/PostToolDefinitions.d.ts +0 -37
  183. package/dist/src/tools/posts/PostToolDefinitions.d.ts.map +0 -1
  184. package/dist/src/tools/posts/PostToolDefinitions.js +0 -236
  185. package/dist/src/tools/posts/PostToolDefinitions.js.map +0 -1
  186. package/dist/src/tools/posts/index.d.ts +0 -138
  187. package/dist/src/tools/posts/index.d.ts.map +0 -1
  188. package/dist/src/tools/posts/index.js +0 -163
  189. package/dist/src/tools/posts/index.js.map +0 -1
  190. package/dist/src/tools/posts.d.ts +0 -15
  191. package/dist/src/tools/posts.d.ts.map +0 -1
  192. package/dist/src/tools/posts.js +0 -16
  193. package/dist/src/tools/posts.js.map +0 -1
  194. package/dist/src/tools/site.d.ts +0 -32
  195. package/dist/src/tools/site.d.ts.map +0 -1
  196. package/dist/src/tools/site.js +0 -234
  197. package/dist/src/tools/site.js.map +0 -1
  198. package/dist/src/tools/taxonomies.d.ts +0 -36
  199. package/dist/src/tools/taxonomies.d.ts.map +0 -1
  200. package/dist/src/tools/taxonomies.js +0 -286
  201. package/dist/src/tools/taxonomies.js.map +0 -1
  202. package/dist/src/tools/users.d.ts +0 -33
  203. package/dist/src/tools/users.d.ts.map +0 -1
  204. package/dist/src/tools/users.js +0 -308
  205. package/dist/src/tools/users.js.map +0 -1
  206. package/dist/src/types/client.d.ts +0 -223
  207. package/dist/src/types/client.d.ts.map +0 -1
  208. package/dist/src/types/client.js +0 -97
  209. package/dist/src/types/client.js.map +0 -1
  210. package/dist/src/types/enhanced.d.ts +0 -237
  211. package/dist/src/types/enhanced.d.ts.map +0 -1
  212. package/dist/src/types/enhanced.js +0 -49
  213. package/dist/src/types/enhanced.js.map +0 -1
  214. package/dist/src/types/index.d.ts +0 -160
  215. package/dist/src/types/index.d.ts.map +0 -1
  216. package/dist/src/types/index.js +0 -14
  217. package/dist/src/types/index.js.map +0 -1
  218. package/dist/src/types/mcp.d.ts +0 -178
  219. package/dist/src/types/mcp.d.ts.map +0 -1
  220. package/dist/src/types/mcp.js +0 -7
  221. package/dist/src/types/mcp.js.map +0 -1
  222. package/dist/src/types/requests.d.ts +0 -322
  223. package/dist/src/types/requests.d.ts.map +0 -1
  224. package/dist/src/types/requests.js +0 -8
  225. package/dist/src/types/requests.js.map +0 -1
  226. package/dist/src/types/tools.d.ts +0 -506
  227. package/dist/src/types/tools.d.ts.map +0 -1
  228. package/dist/src/types/tools.js +0 -8
  229. package/dist/src/types/tools.js.map +0 -1
  230. package/dist/src/types/wordpress.d.ts +0 -471
  231. package/dist/src/types/wordpress.d.ts.map +0 -1
  232. package/dist/src/types/wordpress.js +0 -14
  233. package/dist/src/types/wordpress.js.map +0 -1
  234. package/dist/src/utils/debug.d.ts +0 -71
  235. package/dist/src/utils/debug.d.ts.map +0 -1
  236. package/dist/src/utils/debug.js +0 -235
  237. package/dist/src/utils/debug.js.map +0 -1
  238. package/dist/src/utils/enhancedError.d.ts +0 -61
  239. package/dist/src/utils/enhancedError.d.ts.map +0 -1
  240. package/dist/src/utils/enhancedError.js +0 -221
  241. package/dist/src/utils/enhancedError.js.map +0 -1
  242. package/dist/src/utils/error.d.ts +0 -17
  243. package/dist/src/utils/error.d.ts.map +0 -1
  244. package/dist/src/utils/error.js +0 -108
  245. package/dist/src/utils/error.js.map +0 -1
  246. package/dist/src/utils/logger.d.ts +0 -106
  247. package/dist/src/utils/logger.d.ts.map +0 -1
  248. package/dist/src/utils/logger.js +0 -280
  249. package/dist/src/utils/logger.js.map +0 -1
  250. package/dist/src/utils/streaming.d.ts +0 -104
  251. package/dist/src/utils/streaming.d.ts.map +0 -1
  252. package/dist/src/utils/streaming.js +0 -331
  253. package/dist/src/utils/streaming.js.map +0 -1
  254. package/dist/src/utils/toolWrapper.d.ts +0 -42
  255. package/dist/src/utils/toolWrapper.d.ts.map +0 -1
  256. package/dist/src/utils/toolWrapper.js +0 -101
  257. package/dist/src/utils/toolWrapper.js.map +0 -1
  258. package/dist/src/utils/validation/core.d.ts +0 -21
  259. package/dist/src/utils/validation/core.d.ts.map +0 -1
  260. package/dist/src/utils/validation/core.js +0 -71
  261. package/dist/src/utils/validation/core.js.map +0 -1
  262. package/dist/src/utils/validation/index.d.ts +0 -25
  263. package/dist/src/utils/validation/index.d.ts.map +0 -1
  264. package/dist/src/utils/validation/index.js +0 -29
  265. package/dist/src/utils/validation/index.js.map +0 -1
  266. package/dist/src/utils/validation/network.d.ts +0 -19
  267. package/dist/src/utils/validation/network.d.ts.map +0 -1
  268. package/dist/src/utils/validation/network.js +0 -93
  269. package/dist/src/utils/validation/network.js.map +0 -1
  270. package/dist/src/utils/validation/rateLimit.d.ts +0 -21
  271. package/dist/src/utils/validation/rateLimit.d.ts.map +0 -1
  272. package/dist/src/utils/validation/rateLimit.js +0 -43
  273. package/dist/src/utils/validation/rateLimit.js.map +0 -1
  274. package/dist/src/utils/validation/security.d.ts +0 -29
  275. package/dist/src/utils/validation/security.d.ts.map +0 -1
  276. package/dist/src/utils/validation/security.js +0 -327
  277. package/dist/src/utils/validation/security.js.map +0 -1
  278. package/dist/src/utils/validation/wordpress.d.ts +0 -31
  279. package/dist/src/utils/validation/wordpress.d.ts.map +0 -1
  280. package/dist/src/utils/validation/wordpress.js +0 -146
  281. package/dist/src/utils/validation/wordpress.js.map +0 -1
  282. package/dist/src/utils/validation.d.ts +0 -15
  283. package/dist/src/utils/validation.d.ts.map +0 -1
  284. package/dist/src/utils/validation.js +0 -27
  285. package/dist/src/utils/validation.js.map +0 -1
  286. package/dist/tests/vitest.setup.d.ts +0 -6
  287. package/dist/tests/vitest.setup.d.ts.map +0 -1
  288. package/dist/tests/vitest.setup.js +0 -39
  289. package/dist/tests/vitest.setup.js.map +0 -1
@@ -1,236 +0,0 @@
1
- /**
2
- * WordPress Posts Tool Definitions
3
- *
4
- * Defines all MCP tool schemas for WordPress post management.
5
- * This module separates tool definitions from their implementations
6
- * for better maintainability and testing.
7
- */
8
- /**
9
- * Tool definition for listing WordPress posts
10
- */
11
- export const listPostsTool = {
12
- name: "wp_list_posts",
13
- description: "Lists posts from a WordPress site with comprehensive filtering options. Supports search, status filtering, and category/tag filtering with enhanced metadata display.\n\n" +
14
- "**Usage Examples:**\n" +
15
- "• Basic listing: `wp_list_posts`\n" +
16
- '• Search posts: `wp_list_posts --search="AI trends"`\n' +
17
- '• Filter by status: `wp_list_posts --status="draft"`\n' +
18
- "• Category filtering: `wp_list_posts --categories=[1,2,3]`\n" +
19
- "• Paginated results: `wp_list_posts --per_page=20 --page=2`\n" +
20
- '• Combined filters: `wp_list_posts --search="WordPress" --status="publish" --per_page=10`',
21
- inputSchema: {
22
- type: "object",
23
- properties: {
24
- per_page: {
25
- type: "number",
26
- description: "Number of items to return per page (max 100).",
27
- },
28
- search: {
29
- type: "string",
30
- description: "Limit results to those matching a search term.",
31
- },
32
- status: {
33
- type: "string",
34
- description: "Filter by post status.",
35
- enum: ["publish", "future", "draft", "pending", "private"],
36
- },
37
- categories: {
38
- type: "array",
39
- items: { type: "number" },
40
- description: "Limit results to posts in specific category IDs.",
41
- },
42
- tags: {
43
- type: "array",
44
- items: { type: "number" },
45
- description: "Limit results to posts with specific tag IDs.",
46
- },
47
- },
48
- },
49
- };
50
- /**
51
- * Tool definition for retrieving a single WordPress post
52
- */
53
- export const getPostTool = {
54
- name: "wp_get_post",
55
- description: "Retrieves detailed information about a single post including metadata, content statistics, and management links.",
56
- inputSchema: {
57
- type: "object",
58
- properties: {
59
- id: {
60
- type: "number",
61
- description: "The unique identifier for the post.",
62
- },
63
- },
64
- required: ["id"],
65
- },
66
- };
67
- /**
68
- * Tool definition for creating a new WordPress post
69
- */
70
- export const createPostTool = {
71
- name: "wp_create_post",
72
- description: "Creates a new WordPress post with comprehensive validation and detailed success feedback including management links.\n\n" +
73
- "**Usage Examples:**\n" +
74
- '• Simple post: `wp_create_post --title="My New Post" --content="<p>Hello World!</p>"`\n' +
75
- '• Draft post: `wp_create_post --title="Draft Post" --status="draft"`\n' +
76
- '• Categorized post: `wp_create_post --title="Tech News" --categories=[1,5] --tags=[10,20]`\n' +
77
- '• Post with featured image: `wp_create_post --title="My Post" --content="<p>Content</p>" --featured_media=42`\n' +
78
- '• Remove featured image: `wp_create_post --title="My Post" --featured_media=0`\n' +
79
- '• Scheduled post: `wp_create_post --title="Future Post" --status="future" --date="2024-12-25T10:00:00"`\n' +
80
- '• Complete post: `wp_create_post --title="Complete Post" --content="<p>Content</p>" --excerpt="Summary" --status="publish"`',
81
- inputSchema: {
82
- type: "object",
83
- properties: {
84
- title: {
85
- type: "string",
86
- description: "The title for the post.",
87
- },
88
- content: {
89
- type: "string",
90
- description: "The content for the post, in HTML format.",
91
- },
92
- status: {
93
- type: "string",
94
- description: "The publishing status for the post.",
95
- enum: ["publish", "draft", "pending", "private"],
96
- },
97
- excerpt: {
98
- type: "string",
99
- description: "The excerpt for the post.",
100
- },
101
- categories: {
102
- type: "array",
103
- items: { type: "number" },
104
- description: "An array of category IDs to assign to the post.",
105
- },
106
- tags: {
107
- type: "array",
108
- items: { type: "number" },
109
- description: "An array of tag IDs to assign to the post.",
110
- },
111
- featured_media: {
112
- type: "number",
113
- description: "The ID of the featured media (image). Use 0 to remove featured media.",
114
- },
115
- date: {
116
- type: "string",
117
- description: "The date the post was published, in the site's timezone (ISO 8601 format).",
118
- },
119
- },
120
- required: ["title"],
121
- },
122
- };
123
- /**
124
- * Tool definition for updating an existing WordPress post
125
- */
126
- export const updatePostTool = {
127
- name: "wp_update_post",
128
- description: "Updates an existing WordPress post with comprehensive validation and change tracking. All parameters except ID are optional - only provided fields will be updated.\n\n" +
129
- "**Usage Examples:**\n" +
130
- '• Update title: `wp_update_post --id=123 --title="New Title"`\n' +
131
- '• Update content: `wp_update_post --id=123 --content="<p>Updated content</p>"`\n' +
132
- '• Change status: `wp_update_post --id=123 --status="publish"`\n' +
133
- "• Update categories: `wp_update_post --id=123 --categories=[1,5,10]`\n" +
134
- "• Set featured image: `wp_update_post --id=123 --featured_media=42`\n" +
135
- "• Remove featured image: `wp_update_post --id=123 --featured_media=0`\n" +
136
- '• Multiple updates: `wp_update_post --id=123 --title="New Title" --status="publish" --categories=[1,2]`',
137
- inputSchema: {
138
- type: "object",
139
- properties: {
140
- id: {
141
- type: "number",
142
- description: "The ID of the post to update.",
143
- },
144
- title: {
145
- type: "string",
146
- description: "The new title for the post.",
147
- },
148
- content: {
149
- type: "string",
150
- description: "The new content for the post, in HTML format.",
151
- },
152
- status: {
153
- type: "string",
154
- description: "The new publishing status for the post.",
155
- enum: ["publish", "draft", "pending", "private"],
156
- },
157
- excerpt: {
158
- type: "string",
159
- description: "The new excerpt for the post.",
160
- },
161
- categories: {
162
- type: "array",
163
- items: { type: "number" },
164
- description: "An array of category IDs to assign to the post.",
165
- },
166
- tags: {
167
- type: "array",
168
- items: { type: "number" },
169
- description: "An array of tag IDs to assign to the post.",
170
- },
171
- featured_media: {
172
- type: "number",
173
- description: "The ID of the featured media (image). Use 0 to remove featured media.",
174
- },
175
- date: {
176
- type: "string",
177
- description: "The date the post was published, in the site's timezone (ISO 8601 format).",
178
- },
179
- },
180
- required: ["id"],
181
- },
182
- };
183
- /**
184
- * Tool definition for deleting a WordPress post
185
- */
186
- export const deletePostTool = {
187
- name: "wp_delete_post",
188
- description: "Deletes a WordPress post with options for trash or permanent deletion. Includes safety confirmations and detailed feedback on the deletion action.\n\n" +
189
- "**Usage Examples:**\n" +
190
- "• Trash a post: `wp_delete_post --id=123` (moves to trash)\n" +
191
- "• Permanent deletion: `wp_delete_post --id=123 --force=true`\n" +
192
- "• Bulk operations: Use multiple calls with different IDs",
193
- inputSchema: {
194
- type: "object",
195
- properties: {
196
- id: {
197
- type: "number",
198
- description: "The ID of the post to delete.",
199
- },
200
- force: {
201
- type: "boolean",
202
- description: "Whether to bypass trash and force deletion (default: false, moves to trash).",
203
- },
204
- },
205
- required: ["id"],
206
- },
207
- };
208
- /**
209
- * Tool definition for retrieving post revisions
210
- */
211
- export const getPostRevisionsTool = {
212
- name: "wp_get_post_revisions",
213
- description: "Retrieves the revision history for a specific post, including details about changes, dates, and authors for content management and auditing purposes.",
214
- inputSchema: {
215
- type: "object",
216
- properties: {
217
- id: {
218
- type: "number",
219
- description: "The ID of the post to get revisions for.",
220
- },
221
- },
222
- required: ["id"],
223
- },
224
- };
225
- /**
226
- * Collection of all post tool definitions
227
- */
228
- export const postToolDefinitions = [
229
- listPostsTool,
230
- getPostTool,
231
- createPostTool,
232
- updatePostTool,
233
- deletePostTool,
234
- getPostRevisionsTool,
235
- ];
236
- //# sourceMappingURL=PostToolDefinitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PostToolDefinitions.js","sourceRoot":"","sources":["../../../../src/tools/posts/PostToolDefinitions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAY;IACpC,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,2KAA2K;QAC3K,uBAAuB;QACvB,oCAAoC;QACpC,wDAAwD;QACxD,wDAAwD;QACxD,8DAA8D;QAC9D,+DAA+D;QAC/D,2FAA2F;IAC7F,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+CAA+C;aAC7D;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;aAC9D;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wBAAwB;gBACrC,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC;aAC3D;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,I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ools - Refactored Module
3
- *
4
- * This module provides comprehensive WordPress post management functionality
5
- * through a clean, modular architecture. It combines tool definitions with
6
- * their corresponding handlers for complete post management capabilities.
7
- *
8
- * Features:
9
- * - List posts with advanced filtering and search
10
- * - Get individual posts with detailed metadata
11
- * - Create new posts with validation and feedback
12
- * - Update existing posts with change tracking
13
- * - Delete posts with trash/permanent options
14
- * - Retrieve post revision history
15
- *
16
- * @example
17
- * ```typescript
18
- * import { PostTools } from './tools/posts';
19
- *
20
- * const postTools = new PostTools();
21
- * const tools = postTools.getTools();
22
- *
23
- * // Use with MCP server
24
- * server.setRequestHandler(ListToolsRequestSchema, () => ({
25
- * tools: [...tools, ...otherTools]
26
- * }));
27
- * ```
28
- */
29
- import { WordPressClient } from "../../client/api.js";
30
- import { CreatePostRequest, PostQueryParams, UpdatePostRequest, WordPressPost } from "../../types/wordpress.js";
31
- /**
32
- * Main PostTools class that provides WordPress post management functionality.
33
- *
34
- * This class serves as the interface between the MCP framework and WordPress
35
- * post operations. It combines tool definitions with their corresponding handlers
36
- * to provide a complete post management solution.
37
- *
38
- * The class is designed with a modular architecture:
39
- * - Tool definitions are separate from implementations
40
- * - Handlers are extracted into focused functions
41
- * - Business logic is isolated from framework concerns
42
- *
43
- * @since 2.0.0 (Refactored from monolithic implementation)
44
- */
45
- export declare class PostTools {
46
- /**
47
- * Retrieves all post management tool definitions for MCP registration.
48
- *
49
- * Returns an array of tool definitions that include:
50
- * - wp_list_posts: Advanced post listing with filtering
51
- * - wp_get_post: Detailed individual post retrieval
52
- * - wp_create_post: New post creation with validation
53
- * - wp_update_post: Post updating with change tracking
54
- * - wp_delete_post: Post deletion with trash/permanent options
55
- * - wp_get_post_revisions: Post revision history
56
- *
57
- * Each tool includes comprehensive parameter validation, detailed documentation,
58
- * and usage examples for optimal developer experience.
59
- *
60
- * @returns Tool definitions ready for MCP server registration
61
- */
62
- getTools(): unknown[];
63
- /**
64
- * Maps tool names to their corresponding handler methods.
65
- *
66
- * This method provides the binding between tool definitions and their
67
- * implementations, ensuring proper context and error handling.
68
- *
69
- * @param toolName - The name of the tool to get a handler for
70
- * @returns The bound handler method for the specified tool
71
- * @private
72
- */
73
- private getHandlerForTool;
74
- /**
75
- * Lists WordPress posts with advanced filtering capabilities.
76
- *
77
- * @param client - WordPress client instance
78
- * @param params - Query parameters for filtering posts
79
- * @returns Formatted list of posts or error message
80
- */
81
- handleListPosts(client: WordPressClient, params: PostQueryParams): Promise<WordPressPost[] | string>;
82
- /**
83
- * Retrieves a single WordPress post with detailed information.
84
- *
85
- * @param client - WordPress client instance
86
- * @param params - Parameters including post ID
87
- * @returns Detailed post information or error message
88
- */
89
- handleGetPost(client: WordPressClient, params: {
90
- id: number;
91
- }): Promise<WordPressPost | string>;
92
- /**
93
- * Creates a new WordPress post with validation and feedback.
94
- *
95
- * @param client - WordPress client instance
96
- * @param params - Post creation parameters
97
- * @returns Created post information or error message
98
- */
99
- handleCreatePost(client: WordPressClient, params: CreatePostRequest): Promise<WordPressPost | string>;
100
- /**
101
- * Updates an existing WordPress post with change tracking.
102
- *
103
- * @param client - WordPress client instance
104
- * @param params - Post update parameters including ID
105
- * @returns Updated post information or error message
106
- */
107
- handleUpdatePost(client: WordPressClient, params: UpdatePostRequest & {
108
- id: number;
109
- }): Promise<WordPressPost | string>;
110
- /**
111
- * Deletes a WordPress post with options for trash or permanent deletion.
112
- *
113
- * @param client - WordPress client instance
114
- * @param params - Deletion parameters including ID and force option
115
- * @returns Deletion result or error message
116
- */
117
- handleDeletePost(client: WordPressClient, params: {
118
- id: number;
119
- force?: boolean;
120
- }): Promise<{
121
- deleted: boolean;
122
- previous?: WordPressPost;
123
- } | string>;
124
- /**
125
- * Retrieves revision history for a WordPress post.
126
- *
127
- * @param client - WordPress client instance
128
- * @param params - Parameters including post ID
129
- * @returns Post revisions or error message
130
- */
131
- handleGetPostRevisions(client: WordPressClient, params: {
132
- id: number;
133
- }): Promise<WordPressPost[] | string>;
134
- }
135
- export { postToolDefinitions } from "./PostToolDefinitions.js";
136
- export * from "./PostHandlers.js";
137
- export default PostTools;
138
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/posts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAWhH;;;;;;;;;;;;;GAaG;AACH,qBAAa,SAAS;IACpB;;;;;;;;;;;;;;;OAeG;IACI,QAAQ,IAAI,OAAO,EAAE;IAO5B;;;;;;;;;OASG;IACH,OAAO,CAAC,iBAAiB;IAqBzB;;;;;;OAMG;IACU,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,EAAE,GAAG,MAAM,CAAC;IAIjH;;;;;;OAMG;IACU,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM,CAAC;IAI5G;;;;;;OAMG;IACU,gBAAgB,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM,CAAC;IAIlH;;;;;;OAMG;IACU,gBAAgB,CAC3B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,iBAAiB,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GACzC,OAAO,CAAC,aAAa,GAAG,MAAM,CAAC;IAIlC;;;;;;OAMG;IACU,gBAAgB,CAC3B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GACtC,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,aAAa,CAAA;KAAE,GAAG,MAAM,CAAC;IAInE;;;;;;OAMG;IACU,sBAAsB,CACjC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GACrB,OAAO,CAAC,aAAa,EAAE,GAAG,MAAM,CAAC;CAGrC;AAGD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,cAAc,mBAAmB,CAAC;AAGlC,eAAe,SAAS,CAAC"}
@@ -1,163 +0,0 @@
1
- /**
2
- * WordPress Posts Tools - Refactored Module
3
- *
4
- * This module provides comprehensive WordPress post management functionality
5
- * through a clean, modular architecture. It combines tool definitions with
6
- * their corresponding handlers for complete post management capabilities.
7
- *
8
- * Features:
9
- * - List posts with advanced filtering and search
10
- * - Get individual posts with detailed metadata
11
- * - Create new posts with validation and feedback
12
- * - Update existing posts with change tracking
13
- * - Delete posts with trash/permanent options
14
- * - Retrieve post revision history
15
- *
16
- * @example
17
- * ```typescript
18
- * import { PostTools } from './tools/posts';
19
- *
20
- * const postTools = new PostTools();
21
- * const tools = postTools.getTools();
22
- *
23
- * // Use with MCP server
24
- * server.setRequestHandler(ListToolsRequestSchema, () => ({
25
- * tools: [...tools, ...otherTools]
26
- * }));
27
- * ```
28
- */
29
- import { postToolDefinitions } from "./PostToolDefinitions.js";
30
- import { handleListPosts, handleGetPost, handleCreatePost, handleUpdatePost, handleDeletePost, handleGetPostRevisions, } from "./PostHandlers.js";
31
- /**
32
- * Main PostTools class that provides WordPress post management functionality.
33
- *
34
- * This class serves as the interface between the MCP framework and WordPress
35
- * post operations. It combines tool definitions with their corresponding handlers
36
- * to provide a complete post management solution.
37
- *
38
- * The class is designed with a modular architecture:
39
- * - Tool definitions are separate from implementations
40
- * - Handlers are extracted into focused functions
41
- * - Business logic is isolated from framework concerns
42
- *
43
- * @since 2.0.0 (Refactored from monolithic implementation)
44
- */
45
- export class PostTools {
46
- /**
47
- * Retrieves all post management tool definitions for MCP registration.
48
- *
49
- * Returns an array of tool definitions that include:
50
- * - wp_list_posts: Advanced post listing with filtering
51
- * - wp_get_post: Detailed individual post retrieval
52
- * - wp_create_post: New post creation with validation
53
- * - wp_update_post: Post updating with change tracking
54
- * - wp_delete_post: Post deletion with trash/permanent options
55
- * - wp_get_post_revisions: Post revision history
56
- *
57
- * Each tool includes comprehensive parameter validation, detailed documentation,
58
- * and usage examples for optimal developer experience.
59
- *
60
- * @returns Tool definitions ready for MCP server registration
61
- */
62
- getTools() {
63
- return postToolDefinitions.map((toolDef) => ({
64
- ...toolDef,
65
- handler: this.getHandlerForTool(toolDef.name),
66
- }));
67
- }
68
- /**
69
- * Maps tool names to their corresponding handler methods.
70
- *
71
- * This method provides the binding between tool definitions and their
72
- * implementations, ensuring proper context and error handling.
73
- *
74
- * @param toolName - The name of the tool to get a handler for
75
- * @returns The bound handler method for the specified tool
76
- * @private
77
- */
78
- getHandlerForTool(toolName) {
79
- switch (toolName) {
80
- case "wp_list_posts":
81
- return this.handleListPosts.bind(this);
82
- case "wp_get_post":
83
- return this.handleGetPost.bind(this);
84
- case "wp_create_post":
85
- return this.handleCreatePost.bind(this);
86
- case "wp_update_post":
87
- return this.handleUpdatePost.bind(this);
88
- case "wp_delete_post":
89
- return this.handleDeletePost.bind(this);
90
- case "wp_get_post_revisions":
91
- return this.handleGetPostRevisions.bind(this);
92
- default:
93
- throw new Error(`Unknown tool: ${toolName}`);
94
- }
95
- }
96
- // Handler Methods - Delegated to Extracted Functions
97
- /**
98
- * Lists WordPress posts with advanced filtering capabilities.
99
- *
100
- * @param client - WordPress client instance
101
- * @param params - Query parameters for filtering posts
102
- * @returns Formatted list of posts or error message
103
- */
104
- async handleListPosts(client, params) {
105
- return handleListPosts(client, params);
106
- }
107
- /**
108
- * Retrieves a single WordPress post with detailed information.
109
- *
110
- * @param client - WordPress client instance
111
- * @param params - Parameters including post ID
112
- * @returns Detailed post information or error message
113
- */
114
- async handleGetPost(client, params) {
115
- return handleGetPost(client, params);
116
- }
117
- /**
118
- * Creates a new WordPress post with validation and feedback.
119
- *
120
- * @param client - WordPress client instance
121
- * @param params - Post creation parameters
122
- * @returns Created post information or error message
123
- */
124
- async handleCreatePost(client, params) {
125
- return handleCreatePost(client, params);
126
- }
127
- /**
128
- * Updates an existing WordPress post with change tracking.
129
- *
130
- * @param client - WordPress client instance
131
- * @param params - Post update parameters including ID
132
- * @returns Updated post information or error message
133
- */
134
- async handleUpdatePost(client, params) {
135
- return handleUpdatePost(client, params);
136
- }
137
- /**
138
- * Deletes a WordPress post with options for trash or permanent deletion.
139
- *
140
- * @param client - WordPress client instance
141
- * @param params - Deletion parameters including ID and force option
142
- * @returns Deletion result or error message
143
- */
144
- async handleDeletePost(client, params) {
145
- return handleDeletePost(client, params);
146
- }
147
- /**
148
- * Retrieves revision history for a WordPress post.
149
- *
150
- * @param client - WordPress client instance
151
- * @param params - Parameters including post ID
152
- * @returns Post revisions or error message
153
- */
154
- async handleGetPostRevisions(client, params) {
155
- return handleGetPostRevisions(client, params);
156
- }
157
- }
158
- // Export everything for easy imports
159
- export { postToolDefinitions } from "./PostToolDefinitions.js";
160
- export * from "./PostHandlers.js";
161
- // Default export for backwards compatibility
162
- export default PostTools;
163
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/posts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACL,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,SAAS;IACpB;;;;;;;;;;;;;;;OAeG;IACI,Q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CAAC,MAAuB,EAAE,MAAyB;QAC9E,OAAO,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,gBAAgB,CAC3B,MAAuB,EACvB,MAA0C;QAE1C,OAAO,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,gBAAgB,CAC3B,MAAuB,EACvB,MAAuC;QAEvC,OAAO,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,sBAAsB,CACjC,MAAuB,EACvB,MAAsB;QAEtB,OAAO,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;CACF;AAED,qCAAqC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,cAAc,mBAAmB,CAAC;AAElC,6CAA6C;AAC7C,eAAe,SAAS,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * WordPress Posts Tools - Legacy Import Module
3
- *
4
- * This file maintains backward compatibility while the codebase transitions
5
- * to the new modular structure. The actual implementation has been refactored
6
- * into focused modules under ./posts/ directory.
7
- *
8
- * @deprecated Use direct imports from ./posts/ modules instead
9
- * @see ./posts/index.ts for the new modular implementation
10
- */
11
- export { PostTools as default, PostTools } from "./posts/index.js";
12
- export type { CreatePostRequest, PostQueryParams, UpdatePostRequest, WordPressPost } from "../types/wordpress.js";
13
- export { postToolDefinitions } from "./posts/PostToolDefinitions.js";
14
- export { handleListPosts, handleGetPost, handleCreatePost, handleUpdatePost, handleDeletePost, handleGetPostRevisions, } from "./posts/PostHandlers.js";
15
- //# sourceMappingURL=posts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../../src/tools/posts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGnE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGlH,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EACL,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * WordPress Posts Tools - Legacy Import Module
3
- *
4
- * This file maintains backward compatibility while the codebase transitions
5
- * to the new modular structure. The actual implementation has been refactored
6
- * into focused modules under ./posts/ directory.
7
- *
8
- * @deprecated Use direct imports from ./posts/ modules instead
9
- * @see ./posts/index.ts for the new modular implementation
10
- */
11
- // Re-export the refactored PostTools class for backward compatibility
12
- export { PostTools as default, PostTools } from "./posts/index.js";
13
- // Re-export specific components for granular imports
14
- export { postToolDefinitions } from "./posts/PostToolDefinitions.js";
15
- export { handleListPosts, handleGetPost, handleCreatePost, handleUpdatePost, handleDeletePost, handleGetPostRevisions, } from "./posts/PostHandlers.js";
16
- //# sourceMappingURL=posts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"posts.js","sourceRoot":"","sources":["../../../src/tools/posts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,sEAAsE;AACtE,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKnE,qDAAqD;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EACL,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC"}
@@ -1,32 +0,0 @@
1
- import { WordPressClient } from "../client/api.js";
2
- /**
3
- * Provides tools for managing general site settings and operations on a WordPress site.
4
- * This class encapsulates tool definitions and their corresponding handlers.
5
- */
6
- export declare class SiteTools {
7
- /**
8
- * Retrieves the list of site management tools.
9
- * @returns An array of MCPTool definitions.
10
- */
11
- getTools(): Array<{
12
- name: string;
13
- description: string;
14
- parameters?: Array<{
15
- name: string;
16
- type?: string;
17
- description?: string;
18
- required?: boolean;
19
- enum?: string[];
20
- items?: unknown;
21
- }>;
22
- handler: (client: WordPressClient, params: Record<string, unknown>) => Promise<unknown>;
23
- }>;
24
- handleGetSiteSettings(client: WordPressClient, _params: Record<string, unknown>): Promise<unknown>;
25
- handleUpdateSiteSettings(client: WordPressClient, params: Record<string, unknown>): Promise<unknown>;
26
- handleSearchSite(client: WordPressClient, params: Record<string, unknown>): Promise<unknown>;
27
- handleGetApplicationPasswords(client: WordPressClient, params: Record<string, unknown>): Promise<unknown>;
28
- handleCreateApplicationPassword(client: WordPressClient, params: Record<string, unknown>): Promise<unknown>;
29
- handleDeleteApplicationPassword(client: WordPressClient, params: Record<string, unknown>): Promise<unknown>;
30
- }
31
- export default SiteTools;
32
- //# sourceMappingURL=site.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../../../src/tools/site.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInD;;;GAGG;AACH,qBAAa,SAAS;IACpB;;;OAGG;IACI,QAAQ,IAAI,KAAK,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;YAAC,KAAK,CAAC,EAAE,O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