mcp-wordpress 2.10.0 → 2.10.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.
- package/README.md +17 -19
- package/bin/mcp-wordpress.js +3 -3
- package/bin/setup.js +140 -141
- package/bin/status.js +112 -114
- package/dist/client/MockWordPressClient.d.ts.map +1 -1
- package/dist/client/MockWordPressClient.js.map +1 -1
- package/dist/client/SEOWordPressClient.d.ts.map +1 -1
- package/dist/client/SEOWordPressClient.js +16 -14
- package/dist/client/SEOWordPressClient.js.map +1 -1
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +6 -6
- package/dist/client/managers/AuthManager.d.ts.map +1 -1
- package/dist/client/managers/AuthManager.js +2 -2
- package/dist/client/managers/AuthManager.js.map +1 -1
- package/dist/client/managers/AuthenticationManager.js +1 -1
- package/dist/client/managers/JWTAuthImplementation.d.ts.map +1 -1
- package/dist/client/managers/JWTAuthImplementation.js +7 -7
- package/dist/client/managers/JWTAuthImplementation.js.map +1 -1
- package/dist/client/managers/composed/MigrationAdapter.js +1 -1
- package/dist/client/managers/composed/index.d.ts +2 -2
- package/dist/client/managers/composed/index.d.ts.map +1 -1
- package/dist/client/managers/composed/index.js +1 -1
- package/dist/client/managers/composed/index.js.map +1 -1
- package/dist/client/managers/implementations/ErrorHandlerImpl.d.ts.map +1 -1
- package/dist/client/managers/implementations/ErrorHandlerImpl.js +2 -4
- package/dist/client/managers/implementations/ErrorHandlerImpl.js.map +1 -1
- package/dist/client/managers/implementations/ParameterValidatorImpl.d.ts.map +1 -1
- package/dist/client/managers/implementations/ParameterValidatorImpl.js +1 -1
- package/dist/client/managers/implementations/ParameterValidatorImpl.js.map +1 -1
- package/dist/client/managers/interfaces/ManagerInterfaces.d.ts.map +1 -1
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.js +3 -3
- package/dist/docs/MarkdownFormatter.d.ts.map +1 -1
- package/dist/docs/MarkdownFormatter.js +7 -7
- package/dist/docs/MarkdownFormatter.js.map +1 -1
- package/dist/performance/PerformanceAnalytics.d.ts.map +1 -1
- package/dist/performance/PerformanceAnalytics.js +3 -1
- package/dist/performance/PerformanceAnalytics.js.map +1 -1
- package/dist/security/InputValidator.js +1 -1
- package/dist/security/SecurityCIPipeline.js +1 -1
- package/dist/security/SecurityCIPipeline.js.map +1 -1
- package/dist/security/SecurityConfig.d.ts.map +1 -1
- package/dist/security/SecurityConfig.js +6 -2
- package/dist/security/SecurityConfig.js.map +1 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +2 -2
- package/dist/tools/cache.d.ts.map +1 -1
- package/dist/tools/cache.js.map +1 -1
- package/dist/tools/comments.d.ts.map +1 -1
- package/dist/tools/comments.js.map +1 -1
- package/dist/tools/performance.d.ts.map +1 -1
- package/dist/tools/performance.js.map +1 -1
- package/dist/tools/posts/PostHandlers.d.ts.map +1 -1
- package/dist/tools/posts/PostHandlers.js.map +1 -1
- package/dist/tools/seo/SEOTools.d.ts.map +1 -1
- package/dist/tools/seo/SEOTools.js.map +1 -1
- package/dist/tools/seo/analyzers/ContentAnalyzer.d.ts.map +1 -1
- package/dist/tools/seo/analyzers/ContentAnalyzer.js.map +1 -1
- package/dist/types/enhanced.d.ts +17 -17
- package/dist/types/enhanced.d.ts.map +1 -1
- package/dist/types/enhanced.js +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/requests.d.ts +16 -16
- package/dist/types/tools.d.ts +46 -46
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/index.js +7 -7
- package/docs/ARCHITECTURE.md +17 -17
- package/docs/BADGE_UPDATES.md +11 -11
- package/docs/CACHING.md +2 -0
- package/docs/CI_CD_IMPROVEMENTS.md +8 -5
- package/docs/CONFIGURATION.md +76 -46
- package/docs/DOCKER_PUBLISHING_TROUBLESHOOTING.md +11 -2
- package/docs/EVALUATION.md +16 -21
- package/docs/INCREMENTAL_COVERAGE.md +7 -3
- package/docs/INSTALLATION.md +33 -19
- package/docs/PUBLISHING-TROUBLESHOOTING.md +3 -2
- package/docs/SECURITY.md +17 -15
- package/docs/SECURITY_TESTING.md +3 -0
- package/docs/TROUBLESHOOTING.md +85 -36
- package/docs/api/README.md +118 -125
- package/docs/api/categories/auth.md +3 -1
- package/docs/api/categories/cache.md +3 -1
- package/docs/api/categories/comment.md +3 -1
- package/docs/api/categories/media.md +3 -1
- package/docs/api/categories/page.md +3 -1
- package/docs/api/categories/performance.md +3 -1
- package/docs/api/categories/post.md +3 -1
- package/docs/api/categories/site.md +3 -1
- package/docs/api/categories/taxonomy.md +3 -1
- package/docs/api/categories/user.md +3 -1
- package/docs/api/openapi.json +114 -410
- package/docs/api/summary.json +1 -1
- package/docs/api/tools/wp_approve_comment.md +13 -25
- package/docs/api/tools/wp_cache_clear.md +17 -30
- package/docs/api/tools/wp_cache_info.md +16 -29
- package/docs/api/tools/wp_cache_stats.md +16 -29
- package/docs/api/tools/wp_cache_warm.md +16 -29
- package/docs/api/tools/wp_create_application_password.md +14 -26
- package/docs/api/tools/wp_create_category.md +14 -26
- package/docs/api/tools/wp_create_comment.md +18 -31
- package/docs/api/tools/wp_create_page.md +17 -29
- package/docs/api/tools/wp_create_post.md +25 -30
- package/docs/api/tools/wp_create_tag.md +13 -25
- package/docs/api/tools/wp_create_user.md +18 -30
- package/docs/api/tools/wp_delete_application_password.md +14 -26
- package/docs/api/tools/wp_delete_category.md +13 -25
- package/docs/api/tools/wp_delete_comment.md +14 -26
- package/docs/api/tools/wp_delete_media.md +14 -25
- package/docs/api/tools/wp_delete_page.md +14 -25
- package/docs/api/tools/wp_delete_post.md +17 -25
- package/docs/api/tools/wp_delete_tag.md +13 -25
- package/docs/api/tools/wp_delete_user.md +14 -25
- package/docs/api/tools/wp_get_application_passwords.md +13 -25
- package/docs/api/tools/wp_get_auth_status.md +12 -24
- package/docs/api/tools/wp_get_category.md +13 -25
- package/docs/api/tools/wp_get_comment.md +13 -25
- package/docs/api/tools/wp_get_current_user.md +17 -30
- package/docs/api/tools/wp_get_media.md +13 -25
- package/docs/api/tools/wp_get_page.md +13 -25
- package/docs/api/tools/wp_get_page_revisions.md +13 -25
- package/docs/api/tools/wp_get_post.md +16 -25
- package/docs/api/tools/wp_get_post_revisions.md +13 -25
- package/docs/api/tools/wp_get_site_settings.md +12 -23
- package/docs/api/tools/wp_get_tag.md +13 -25
- package/docs/api/tools/wp_get_user.md +13 -25
- package/docs/api/tools/wp_list_categories.md +15 -27
- package/docs/api/tools/wp_list_comments.md +15 -27
- package/docs/api/tools/wp_list_media.md +18 -31
- package/docs/api/tools/wp_list_pages.md +18 -31
- package/docs/api/tools/wp_list_posts.md +29 -41
- package/docs/api/tools/wp_list_tags.md +14 -26
- package/docs/api/tools/wp_list_users.md +20 -34
- package/docs/api/tools/wp_performance_alerts.md +22 -36
- package/docs/api/tools/wp_performance_benchmark.md +20 -34
- package/docs/api/tools/wp_performance_export.md +22 -36
- package/docs/api/tools/wp_performance_history.md +21 -35
- package/docs/api/tools/wp_performance_optimize.md +22 -36
- package/docs/api/tools/wp_performance_stats.md +20 -34
- package/docs/api/tools/wp_search_site.md +18 -32
- package/docs/api/tools/wp_spam_comment.md +13 -25
- package/docs/api/tools/wp_switch_auth_method.md +18 -31
- package/docs/api/tools/wp_test_auth.md +15 -30
- package/docs/api/tools/wp_update_category.md +14 -26
- package/docs/api/tools/wp_update_comment.md +17 -30
- package/docs/api/tools/wp_update_media.md +19 -32
- package/docs/api/tools/wp_update_page.md +18 -30
- package/docs/api/tools/wp_update_post.md +21 -30
- package/docs/api/tools/wp_update_site_settings.md +18 -31
- package/docs/api/tools/wp_update_tag.md +14 -26
- package/docs/api/tools/wp_update_user.md +17 -29
- package/docs/api/tools/wp_upload_media.md +20 -32
- package/docs/api/types/WordPressPost.md +8 -15
- package/docs/code-improvements.md +1 -0
- package/docs/developer/GITHUB_ACTIONS_SETUP.md +2 -2
- package/docs/developer/MAINTENANCE.md +4 -0
- package/docs/developer/NPM_AUTH_SETUP.md +3 -0
- package/docs/developer/RELEASE_PROCESS.md +1 -0
- package/docs/examples/multi-site-setup.md +2 -0
- package/docs/integrations/claude-desktop.md +14 -5
- package/docs/integrations/cline.md +1 -0
- package/docs/user-guides/DTX_SETUP.md +9 -8
- package/docs/user-guides/NPX_SETUP.md +5 -9
- package/docs/user-guides/SMITHERY_SETUP.md +5 -0
- package/docs/v2.2.0-resolution-demo.md +17 -2
- package/package.json +2 -1
- package/src/cache/__tests__/CacheManager.test.ts +4 -8
- package/src/client/MockWordPressClient.ts +5 -1
- package/src/client/SEOWordPressClient.ts +30 -26
- package/src/client/index.ts +6 -6
- package/src/client/managers/AuthManager.ts +16 -8
- package/src/client/managers/AuthenticationManager.ts +2 -2
- package/src/client/managers/JWTAuthImplementation.ts +24 -27
- package/src/client/managers/ManagersIndex.ts +1 -1
- package/src/client/managers/composed/MigrationAdapter.ts +1 -1
- package/src/client/managers/composed/index.ts +7 -7
- package/src/client/managers/implementations/ErrorHandlerImpl.ts +12 -26
- package/src/client/managers/implementations/ParameterValidatorImpl.ts +49 -49
- package/src/client/managers/interfaces/ManagerInterfaces.ts +13 -9
- package/src/config/index.ts +3 -3
- package/src/docs/MarkdownFormatter.ts +13 -9
- package/src/performance/PerformanceAnalytics.ts +9 -3
- package/src/security/InputValidator.ts +1 -1
- package/src/security/SecurityCIPipeline.ts +1 -1
- package/src/security/SecurityConfig.ts +9 -3
- package/src/server/index.ts +2 -2
- package/src/tools/cache.ts +3 -1
- package/src/tools/comments.ts +3 -1
- package/src/tools/performance.ts +7 -3
- package/src/tools/posts/PostHandlers.ts +3 -1
- package/src/tools/seo/SEOTools.ts +6 -2
- package/src/tools/seo/analyzers/ContentAnalyzer.ts +9 -3
- package/src/types/enhanced.ts +34 -34
- package/src/types/index.ts +13 -11
- package/src/types/requests.ts +19 -19
- package/src/types/tools.ts +137 -84
- package/src/utils/index.ts +7 -7
package/src/types/tools.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Enhanced Tool Types for MCP WordPress
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* This file provides strongly-typed interfaces for all WordPress MCP tools,
|
|
5
5
|
* replacing loose typing with precise, validated type definitions.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type {
|
|
9
|
-
WordPressId,
|
|
10
|
-
PostId,
|
|
11
|
-
UserId,
|
|
12
|
-
MediaId,
|
|
13
|
-
CommentId,
|
|
14
|
-
CategoryId,
|
|
8
|
+
import type {
|
|
9
|
+
WordPressId,
|
|
10
|
+
PostId,
|
|
11
|
+
UserId,
|
|
12
|
+
MediaId,
|
|
13
|
+
CommentId,
|
|
14
|
+
CategoryId,
|
|
15
15
|
TagId,
|
|
16
16
|
DeepReadonly,
|
|
17
17
|
Result,
|
|
18
|
-
ToolResult
|
|
19
|
-
} from
|
|
18
|
+
ToolResult,
|
|
19
|
+
} from "./enhanced.js";
|
|
20
20
|
|
|
21
21
|
import type {
|
|
22
22
|
WordPressPost,
|
|
@@ -32,8 +32,8 @@ import type {
|
|
|
32
32
|
CommentStatus,
|
|
33
33
|
PingStatus,
|
|
34
34
|
UserRole,
|
|
35
|
-
MediaType
|
|
36
|
-
} from
|
|
35
|
+
MediaType,
|
|
36
|
+
} from "./wordpress.js";
|
|
37
37
|
|
|
38
38
|
// Base Tool Parameter Interface
|
|
39
39
|
export interface BaseToolParams {
|
|
@@ -87,17 +87,27 @@ export interface UpdatePostParams extends BaseToolParams {
|
|
|
87
87
|
|
|
88
88
|
export interface GetPostParams extends BaseToolParams {
|
|
89
89
|
readonly id: PostId;
|
|
90
|
-
readonly context?:
|
|
90
|
+
readonly context?: "view" | "embed" | "edit";
|
|
91
91
|
readonly password?: string;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export interface ListPostsParams extends BaseToolParams {
|
|
95
|
-
readonly context?:
|
|
95
|
+
readonly context?: "view" | "embed" | "edit";
|
|
96
96
|
readonly page?: number;
|
|
97
97
|
readonly per_page?: number;
|
|
98
98
|
readonly search?: string;
|
|
99
|
-
readonly order?:
|
|
100
|
-
readonly orderby?:
|
|
99
|
+
readonly order?: "asc" | "desc";
|
|
100
|
+
readonly orderby?:
|
|
101
|
+
| "author"
|
|
102
|
+
| "date"
|
|
103
|
+
| "id"
|
|
104
|
+
| "include"
|
|
105
|
+
| "modified"
|
|
106
|
+
| "parent"
|
|
107
|
+
| "relevance"
|
|
108
|
+
| "slug"
|
|
109
|
+
| "include_slugs"
|
|
110
|
+
| "title";
|
|
101
111
|
readonly author?: UserId;
|
|
102
112
|
readonly author_exclude?: readonly UserId[];
|
|
103
113
|
readonly before?: string;
|
|
@@ -145,17 +155,28 @@ export interface UpdatePageParams extends Partial<CreatePageParams> {
|
|
|
145
155
|
|
|
146
156
|
export interface GetPageParams extends BaseToolParams {
|
|
147
157
|
readonly id: PostId;
|
|
148
|
-
readonly context?:
|
|
158
|
+
readonly context?: "view" | "embed" | "edit";
|
|
149
159
|
readonly password?: string;
|
|
150
160
|
}
|
|
151
161
|
|
|
152
162
|
export interface ListPagesParams extends BaseToolParams {
|
|
153
|
-
readonly context?:
|
|
163
|
+
readonly context?: "view" | "embed" | "edit";
|
|
154
164
|
readonly page?: number;
|
|
155
165
|
readonly per_page?: number;
|
|
156
166
|
readonly search?: string;
|
|
157
|
-
readonly order?:
|
|
158
|
-
readonly orderby?:
|
|
167
|
+
readonly order?: "asc" | "desc";
|
|
168
|
+
readonly orderby?:
|
|
169
|
+
| "author"
|
|
170
|
+
| "date"
|
|
171
|
+
| "id"
|
|
172
|
+
| "include"
|
|
173
|
+
| "modified"
|
|
174
|
+
| "parent"
|
|
175
|
+
| "relevance"
|
|
176
|
+
| "slug"
|
|
177
|
+
| "include_slugs"
|
|
178
|
+
| "title"
|
|
179
|
+
| "menu_order";
|
|
159
180
|
readonly author?: UserId;
|
|
160
181
|
readonly author_exclude?: readonly UserId[];
|
|
161
182
|
readonly before?: string;
|
|
@@ -209,24 +230,24 @@ export interface UpdateUserParams extends BaseToolParams {
|
|
|
209
230
|
}
|
|
210
231
|
|
|
211
232
|
export interface GetUserParams extends BaseToolParams {
|
|
212
|
-
readonly id: UserId |
|
|
213
|
-
readonly context?:
|
|
233
|
+
readonly id: UserId | "me";
|
|
234
|
+
readonly context?: "view" | "embed" | "edit";
|
|
214
235
|
}
|
|
215
236
|
|
|
216
237
|
export interface ListUsersParams extends BaseToolParams {
|
|
217
|
-
readonly context?:
|
|
238
|
+
readonly context?: "view" | "embed" | "edit";
|
|
218
239
|
readonly page?: number;
|
|
219
240
|
readonly per_page?: number;
|
|
220
241
|
readonly search?: string;
|
|
221
|
-
readonly order?:
|
|
222
|
-
readonly orderby?:
|
|
242
|
+
readonly order?: "asc" | "desc";
|
|
243
|
+
readonly orderby?: "id" | "include" | "name" | "registered_date" | "slug" | "include_slugs" | "email" | "url";
|
|
223
244
|
readonly exclude?: readonly UserId[];
|
|
224
245
|
readonly include?: readonly UserId[];
|
|
225
246
|
readonly offset?: number;
|
|
226
247
|
readonly slug?: readonly string[];
|
|
227
248
|
readonly roles?: readonly UserRole[];
|
|
228
249
|
readonly capabilities?: readonly string[];
|
|
229
|
-
readonly who?:
|
|
250
|
+
readonly who?: "authors";
|
|
230
251
|
readonly has_published_posts?: readonly string[];
|
|
231
252
|
}
|
|
232
253
|
|
|
@@ -263,16 +284,26 @@ export interface UpdateMediaParams extends BaseToolParams {
|
|
|
263
284
|
|
|
264
285
|
export interface GetMediaParams extends BaseToolParams {
|
|
265
286
|
readonly id: MediaId;
|
|
266
|
-
readonly context?:
|
|
287
|
+
readonly context?: "view" | "embed" | "edit";
|
|
267
288
|
}
|
|
268
289
|
|
|
269
290
|
export interface ListMediaParams extends BaseToolParams {
|
|
270
|
-
readonly context?:
|
|
291
|
+
readonly context?: "view" | "embed" | "edit";
|
|
271
292
|
readonly page?: number;
|
|
272
293
|
readonly per_page?: number;
|
|
273
294
|
readonly search?: string;
|
|
274
|
-
readonly order?:
|
|
275
|
-
readonly orderby?:
|
|
295
|
+
readonly order?: "asc" | "desc";
|
|
296
|
+
readonly orderby?:
|
|
297
|
+
| "author"
|
|
298
|
+
| "date"
|
|
299
|
+
| "id"
|
|
300
|
+
| "include"
|
|
301
|
+
| "modified"
|
|
302
|
+
| "parent"
|
|
303
|
+
| "relevance"
|
|
304
|
+
| "slug"
|
|
305
|
+
| "include_slugs"
|
|
306
|
+
| "title";
|
|
276
307
|
readonly author?: UserId;
|
|
277
308
|
readonly author_exclude?: readonly UserId[];
|
|
278
309
|
readonly before?: string;
|
|
@@ -304,7 +335,7 @@ export interface CreateCommentParams extends BaseToolParams {
|
|
|
304
335
|
readonly author_url?: string;
|
|
305
336
|
readonly date?: string;
|
|
306
337
|
readonly date_gmt?: string;
|
|
307
|
-
readonly status?:
|
|
338
|
+
readonly status?: "approved" | "unapproved";
|
|
308
339
|
readonly meta?: DeepReadonly<Record<string, unknown>>;
|
|
309
340
|
}
|
|
310
341
|
|
|
@@ -319,23 +350,23 @@ export interface UpdateCommentParams extends BaseToolParams {
|
|
|
319
350
|
readonly author_url?: string;
|
|
320
351
|
readonly date?: string;
|
|
321
352
|
readonly date_gmt?: string;
|
|
322
|
-
readonly status?:
|
|
353
|
+
readonly status?: "approved" | "unapproved" | "spam" | "trash";
|
|
323
354
|
readonly meta?: DeepReadonly<Record<string, unknown>>;
|
|
324
355
|
}
|
|
325
356
|
|
|
326
357
|
export interface GetCommentParams extends BaseToolParams {
|
|
327
358
|
readonly id: CommentId;
|
|
328
|
-
readonly context?:
|
|
359
|
+
readonly context?: "view" | "embed" | "edit";
|
|
329
360
|
readonly password?: string;
|
|
330
361
|
}
|
|
331
362
|
|
|
332
363
|
export interface ListCommentsParams extends BaseToolParams {
|
|
333
|
-
readonly context?:
|
|
364
|
+
readonly context?: "view" | "embed" | "edit";
|
|
334
365
|
readonly page?: number;
|
|
335
366
|
readonly per_page?: number;
|
|
336
367
|
readonly search?: string;
|
|
337
|
-
readonly order?:
|
|
338
|
-
readonly orderby?:
|
|
368
|
+
readonly order?: "asc" | "desc";
|
|
369
|
+
readonly orderby?: "date" | "date_gmt" | "id" | "include" | "post" | "parent" | "type";
|
|
339
370
|
readonly after?: string;
|
|
340
371
|
readonly author?: readonly UserId[];
|
|
341
372
|
readonly author_exclude?: readonly UserId[];
|
|
@@ -347,8 +378,8 @@ export interface ListCommentsParams extends BaseToolParams {
|
|
|
347
378
|
readonly parent?: readonly CommentId[];
|
|
348
379
|
readonly parent_exclude?: readonly CommentId[];
|
|
349
380
|
readonly post?: readonly PostId[];
|
|
350
|
-
readonly status?:
|
|
351
|
-
readonly type?:
|
|
381
|
+
readonly status?: "approved" | "unapproved" | "spam" | "trash" | "hold" | "all";
|
|
382
|
+
readonly type?: "comment" | "trackback" | "pingback";
|
|
352
383
|
readonly password?: string;
|
|
353
384
|
}
|
|
354
385
|
|
|
@@ -359,7 +390,7 @@ export interface DeleteCommentParams extends BaseToolParams {
|
|
|
359
390
|
|
|
360
391
|
export interface ModerateCommentParams extends BaseToolParams {
|
|
361
392
|
readonly id: CommentId;
|
|
362
|
-
readonly status:
|
|
393
|
+
readonly status: "approved" | "unapproved" | "spam" | "trash";
|
|
363
394
|
}
|
|
364
395
|
|
|
365
396
|
// Taxonomy Tool Parameters
|
|
@@ -382,16 +413,16 @@ export interface UpdateCategoryParams extends BaseToolParams {
|
|
|
382
413
|
|
|
383
414
|
export interface GetCategoryParams extends BaseToolParams {
|
|
384
415
|
readonly id: CategoryId;
|
|
385
|
-
readonly context?:
|
|
416
|
+
readonly context?: "view" | "embed" | "edit";
|
|
386
417
|
}
|
|
387
418
|
|
|
388
419
|
export interface ListCategoriesParams extends BaseToolParams {
|
|
389
|
-
readonly context?:
|
|
420
|
+
readonly context?: "view" | "embed" | "edit";
|
|
390
421
|
readonly page?: number;
|
|
391
422
|
readonly per_page?: number;
|
|
392
423
|
readonly search?: string;
|
|
393
|
-
readonly order?:
|
|
394
|
-
readonly orderby?:
|
|
424
|
+
readonly order?: "asc" | "desc";
|
|
425
|
+
readonly orderby?: "id" | "include" | "name" | "slug" | "include_slugs" | "term_group" | "description" | "count";
|
|
395
426
|
readonly exclude?: readonly CategoryId[];
|
|
396
427
|
readonly include?: readonly CategoryId[];
|
|
397
428
|
readonly hide_empty?: boolean;
|
|
@@ -422,16 +453,16 @@ export interface UpdateTagParams extends BaseToolParams {
|
|
|
422
453
|
|
|
423
454
|
export interface GetTagParams extends BaseToolParams {
|
|
424
455
|
readonly id: TagId;
|
|
425
|
-
readonly context?:
|
|
456
|
+
readonly context?: "view" | "embed" | "edit";
|
|
426
457
|
}
|
|
427
458
|
|
|
428
459
|
export interface ListTagsParams extends BaseToolParams {
|
|
429
|
-
readonly context?:
|
|
460
|
+
readonly context?: "view" | "embed" | "edit";
|
|
430
461
|
readonly page?: number;
|
|
431
462
|
readonly per_page?: number;
|
|
432
463
|
readonly search?: string;
|
|
433
|
-
readonly order?:
|
|
434
|
-
readonly orderby?:
|
|
464
|
+
readonly order?: "asc" | "desc";
|
|
465
|
+
readonly orderby?: "id" | "include" | "name" | "slug" | "include_slugs" | "term_group" | "description" | "count";
|
|
435
466
|
readonly exclude?: readonly TagId[];
|
|
436
467
|
readonly include?: readonly TagId[];
|
|
437
468
|
readonly hide_empty?: boolean;
|
|
@@ -470,7 +501,7 @@ export interface GetSiteInfoParams extends BaseToolParams {}
|
|
|
470
501
|
// Search Tool Parameters
|
|
471
502
|
export interface SearchParams extends BaseToolParams {
|
|
472
503
|
readonly query: string;
|
|
473
|
-
readonly type?: readonly (
|
|
504
|
+
readonly type?: readonly ("post" | "page" | "attachment" | "user" | "comment")[];
|
|
474
505
|
readonly subtype?: readonly string[];
|
|
475
506
|
readonly include?: readonly WordPressId[];
|
|
476
507
|
readonly exclude?: readonly WordPressId[];
|
|
@@ -484,13 +515,13 @@ export interface TestAuthParams extends BaseToolParams {}
|
|
|
484
515
|
export interface GetCurrentUserParams extends BaseToolParams {}
|
|
485
516
|
|
|
486
517
|
export interface CreateAppPasswordParams extends BaseToolParams {
|
|
487
|
-
readonly user_id: UserId |
|
|
518
|
+
readonly user_id: UserId | "me";
|
|
488
519
|
readonly name: string;
|
|
489
520
|
readonly app_id?: string;
|
|
490
521
|
}
|
|
491
522
|
|
|
492
523
|
export interface DeleteAppPasswordParams extends BaseToolParams {
|
|
493
|
-
readonly user_id: UserId |
|
|
524
|
+
readonly user_id: UserId | "me";
|
|
494
525
|
readonly uuid: string;
|
|
495
526
|
}
|
|
496
527
|
|
|
@@ -510,12 +541,12 @@ export interface GetCacheInfoParams extends BaseToolParams {}
|
|
|
510
541
|
|
|
511
542
|
// Performance Tool Parameters
|
|
512
543
|
export interface GetPerformanceMetricsParams extends BaseToolParams {
|
|
513
|
-
readonly timeframe?:
|
|
514
|
-
readonly metrics?: readonly (
|
|
544
|
+
readonly timeframe?: "1h" | "24h" | "7d" | "30d";
|
|
545
|
+
readonly metrics?: readonly ("response_time" | "error_rate" | "cache_hit_rate" | "throughput")[];
|
|
515
546
|
}
|
|
516
547
|
|
|
517
548
|
export interface GetPerformanceReportParams extends BaseToolParams {
|
|
518
|
-
readonly format?:
|
|
549
|
+
readonly format?: "json" | "csv" | "html";
|
|
519
550
|
readonly include_recommendations?: boolean;
|
|
520
551
|
}
|
|
521
552
|
|
|
@@ -538,52 +569,74 @@ export interface ListToolResult<T> extends ToolResult<readonly T[]> {
|
|
|
538
569
|
};
|
|
539
570
|
}
|
|
540
571
|
|
|
541
|
-
export interface DeleteToolResult
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
572
|
+
export interface DeleteToolResult
|
|
573
|
+
extends ToolResult<{
|
|
574
|
+
readonly deleted: boolean;
|
|
575
|
+
readonly previous?: unknown;
|
|
576
|
+
}> {}
|
|
545
577
|
|
|
546
|
-
export interface SearchToolResult
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
578
|
+
export interface SearchToolResult
|
|
579
|
+
extends ToolResult<
|
|
580
|
+
readonly {
|
|
581
|
+
readonly id: number;
|
|
582
|
+
readonly title: string;
|
|
583
|
+
readonly url: string;
|
|
584
|
+
readonly type: string;
|
|
585
|
+
readonly subtype: string;
|
|
586
|
+
}[]
|
|
587
|
+
> {}
|
|
553
588
|
|
|
554
589
|
// Tool Handler Type Definitions
|
|
555
|
-
export type PostToolHandler<TParams extends BaseToolParams, TResult = PostToolResult> =
|
|
556
|
-
|
|
590
|
+
export type PostToolHandler<TParams extends BaseToolParams, TResult = PostToolResult> = (
|
|
591
|
+
params: DeepReadonly<TParams>,
|
|
592
|
+
) => Promise<TResult>;
|
|
557
593
|
|
|
558
|
-
export type PageToolHandler<TParams extends BaseToolParams, TResult = PageToolResult> =
|
|
559
|
-
|
|
594
|
+
export type PageToolHandler<TParams extends BaseToolParams, TResult = PageToolResult> = (
|
|
595
|
+
params: DeepReadonly<TParams>,
|
|
596
|
+
) => Promise<TResult>;
|
|
560
597
|
|
|
561
|
-
export type UserToolHandler<TParams extends BaseToolParams, TResult = UserToolResult> =
|
|
562
|
-
|
|
598
|
+
export type UserToolHandler<TParams extends BaseToolParams, TResult = UserToolResult> = (
|
|
599
|
+
params: DeepReadonly<TParams>,
|
|
600
|
+
) => Promise<TResult>;
|
|
563
601
|
|
|
564
|
-
export type MediaToolHandler<TParams extends BaseToolParams, TResult = MediaToolResult> =
|
|
565
|
-
|
|
602
|
+
export type MediaToolHandler<TParams extends BaseToolParams, TResult = MediaToolResult> = (
|
|
603
|
+
params: DeepReadonly<TParams>,
|
|
604
|
+
) => Promise<TResult>;
|
|
566
605
|
|
|
567
|
-
export type CommentToolHandler<TParams extends BaseToolParams, TResult = CommentToolResult> =
|
|
568
|
-
|
|
606
|
+
export type CommentToolHandler<TParams extends BaseToolParams, TResult = CommentToolResult> = (
|
|
607
|
+
params: DeepReadonly<TParams>,
|
|
608
|
+
) => Promise<TResult>;
|
|
569
609
|
|
|
570
|
-
export type CategoryToolHandler<TParams extends BaseToolParams, TResult = CategoryToolResult> =
|
|
571
|
-
|
|
610
|
+
export type CategoryToolHandler<TParams extends BaseToolParams, TResult = CategoryToolResult> = (
|
|
611
|
+
params: DeepReadonly<TParams>,
|
|
612
|
+
) => Promise<TResult>;
|
|
572
613
|
|
|
573
|
-
export type TagToolHandler<TParams extends BaseToolParams, TResult = TagToolResult> =
|
|
574
|
-
|
|
614
|
+
export type TagToolHandler<TParams extends BaseToolParams, TResult = TagToolResult> = (
|
|
615
|
+
params: DeepReadonly<TParams>,
|
|
616
|
+
) => Promise<TResult>;
|
|
575
617
|
|
|
576
|
-
export type SiteToolHandler<TParams extends BaseToolParams, TResult = SiteSettingsToolResult> =
|
|
577
|
-
|
|
618
|
+
export type SiteToolHandler<TParams extends BaseToolParams, TResult = SiteSettingsToolResult> = (
|
|
619
|
+
params: DeepReadonly<TParams>,
|
|
620
|
+
) => Promise<TResult>;
|
|
578
621
|
|
|
579
622
|
// Tool Registry Types
|
|
580
623
|
export interface ToolDefinition<TParams extends BaseToolParams = BaseToolParams, TResult = ToolResult> {
|
|
581
624
|
readonly name: string;
|
|
582
625
|
readonly description: string;
|
|
583
|
-
readonly category:
|
|
626
|
+
readonly category:
|
|
627
|
+
| "posts"
|
|
628
|
+
| "pages"
|
|
629
|
+
| "users"
|
|
630
|
+
| "media"
|
|
631
|
+
| "comments"
|
|
632
|
+
| "taxonomies"
|
|
633
|
+
| "site"
|
|
634
|
+
| "auth"
|
|
635
|
+
| "cache"
|
|
636
|
+
| "performance";
|
|
584
637
|
readonly handler: (params: DeepReadonly<TParams>) => Promise<TResult>;
|
|
585
638
|
readonly schema: {
|
|
586
|
-
readonly type:
|
|
639
|
+
readonly type: "object";
|
|
587
640
|
readonly properties: DeepReadonly<Record<string, unknown>>;
|
|
588
641
|
readonly required: readonly string[];
|
|
589
642
|
readonly additionalProperties: false;
|
|
@@ -604,5 +657,5 @@ export interface ToolValidationResult {
|
|
|
604
657
|
|
|
605
658
|
export interface ToolValidator<TParams extends BaseToolParams> {
|
|
606
659
|
readonly validate: (params: unknown) => Result<TParams, Error>;
|
|
607
|
-
readonly schema: ToolDefinition[
|
|
608
|
-
}
|
|
660
|
+
readonly schema: ToolDefinition["schema"];
|
|
661
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Debug utilities
|
|
7
|
-
export { debug, startTimer } from
|
|
7
|
+
export { debug, startTimer } from "./debug.js";
|
|
8
8
|
|
|
9
9
|
// Error handling utilities
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
10
|
+
export * from "./error.js";
|
|
11
|
+
export * from "./enhancedError.js";
|
|
12
12
|
|
|
13
13
|
// Logging utilities
|
|
14
|
-
export { LoggerFactory } from
|
|
14
|
+
export { LoggerFactory } from "./logger.js";
|
|
15
15
|
|
|
16
16
|
// Validation utilities
|
|
17
|
-
export * from
|
|
17
|
+
export * from "./validation.js";
|
|
18
18
|
|
|
19
19
|
// Tool wrapper utilities
|
|
20
|
-
export * from
|
|
20
|
+
export * from "./toolWrapper.js";
|
|
21
21
|
|
|
22
22
|
// Streaming utilities (if any exports exist)
|
|
23
|
-
export * from
|
|
23
|
+
export * from "./streaming.js";
|