@pkagentic/mcp 1.4.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.
- package/README.md +68 -0
- package/dist/handlers/image-generation.d.ts +14 -0
- package/dist/handlers/image-generation.js +77 -0
- package/dist/handlers/image-generation.js.map +1 -0
- package/dist/handlers/index.d.ts +5 -0
- package/dist/handlers/index.js +6 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/handlers/pk-agent.d.ts +156 -0
- package/dist/handlers/pk-agent.js +500 -0
- package/dist/handlers/pk-agent.js.map +1 -0
- package/dist/handlers/tailwind.d.ts +11 -0
- package/dist/handlers/tailwind.js +93 -0
- package/dist/handlers/tailwind.js.map +1 -0
- package/dist/handlers/utility.d.ts +41 -0
- package/dist/handlers/utility.js +153 -0
- package/dist/handlers/utility.js.map +1 -0
- package/dist/handlers/web-crawler.d.ts +30 -0
- package/dist/handlers/web-crawler.js +101 -0
- package/dist/handlers/web-crawler.js.map +1 -0
- package/dist/handlers.d.ts +234 -0
- package/dist/handlers.js +855 -0
- package/dist/handlers.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +745 -0
- package/dist/index.js.map +1 -0
- package/dist/tools.d.ts +2 -0
- package/dist/tools.js +806 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +329 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +36 -0
package/dist/tools.js
ADDED
|
@@ -0,0 +1,806 @@
|
|
|
1
|
+
export const TOOLS = [
|
|
2
|
+
{
|
|
3
|
+
name: "get_site_info",
|
|
4
|
+
description: "Get WordPress site metadata, enabled post types, plugin version, permissions, batch limits, and menu locations.",
|
|
5
|
+
inputSchema: { type: "object", properties: {} },
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: "sync",
|
|
9
|
+
description: "List all items (templates, scripts, content) managed by the plugin. Includes lock status.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
type: {
|
|
14
|
+
type: "string",
|
|
15
|
+
enum: ["all", "template", "script", "content"],
|
|
16
|
+
description: "Filter by item type.",
|
|
17
|
+
default: "all",
|
|
18
|
+
},
|
|
19
|
+
page: {
|
|
20
|
+
type: "number",
|
|
21
|
+
description: "Page number (1-based).",
|
|
22
|
+
default: 1,
|
|
23
|
+
},
|
|
24
|
+
per_page: {
|
|
25
|
+
type: "number",
|
|
26
|
+
description: "Items per page (1-100).",
|
|
27
|
+
default: 25,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "get_file",
|
|
34
|
+
description: "Retrieve full or partial content (HTML/CSS/JS) of a single template, script, or content item. Includes lock status.",
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
id: { type: "number", description: "The data record ID (pk_agentic_data.id)." },
|
|
39
|
+
version: {
|
|
40
|
+
type: "string",
|
|
41
|
+
enum: ["sandbox", "production"],
|
|
42
|
+
description: "Which version to return.",
|
|
43
|
+
default: "sandbox",
|
|
44
|
+
},
|
|
45
|
+
download_type: {
|
|
46
|
+
type: "string",
|
|
47
|
+
enum: ["all", "html", "css", "js"],
|
|
48
|
+
description: "Which code type to return.",
|
|
49
|
+
default: "all",
|
|
50
|
+
},
|
|
51
|
+
from_line: {
|
|
52
|
+
type: "number",
|
|
53
|
+
description: "Starting line number (1-based). Only for single type downloads.",
|
|
54
|
+
},
|
|
55
|
+
to_line: {
|
|
56
|
+
type: "number",
|
|
57
|
+
description: "Ending line number. Only for single type downloads.",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
required: ["id"],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "get_files_batch",
|
|
65
|
+
description: "Batch download full content for multiple items. Subject to batch_file_limit from get_site_info. Includes lock status.",
|
|
66
|
+
inputSchema: {
|
|
67
|
+
type: "object",
|
|
68
|
+
properties: {
|
|
69
|
+
ids: { type: "array", items: { type: "number" }, description: "Array of data record IDs." },
|
|
70
|
+
version: {
|
|
71
|
+
type: "string",
|
|
72
|
+
enum: ["sandbox", "production"],
|
|
73
|
+
default: "sandbox",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
required: ["ids"],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "get_template_info",
|
|
81
|
+
description: "Retrieve metadata for a template (conditions, sub_type, location_php, location_js, lock status) without code content.",
|
|
82
|
+
inputSchema: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
id: { type: "number", description: "The data record ID." },
|
|
86
|
+
},
|
|
87
|
+
required: ["id"],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "get_script_info",
|
|
92
|
+
description: "Retrieve metadata for a global script (conditions, location_js, location_php, mode, lock status) without code content.",
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
id: { type: "number", description: "The data record ID." },
|
|
97
|
+
},
|
|
98
|
+
required: ["id"],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "get_content_info",
|
|
103
|
+
description: "Retrieve metadata for a content item (permalink, preview key, location_js, lock status) without code content.",
|
|
104
|
+
inputSchema: {
|
|
105
|
+
type: "object",
|
|
106
|
+
properties: {
|
|
107
|
+
id: { type: "number", description: "The data record ID (pk_agentic_data.id)." },
|
|
108
|
+
},
|
|
109
|
+
required: ["id"],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
// Templates
|
|
113
|
+
{
|
|
114
|
+
name: "save_template",
|
|
115
|
+
description: "Save template code and settings to sandbox (draft).",
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: "object",
|
|
118
|
+
properties: {
|
|
119
|
+
id: { type: "number", description: "The data record ID." },
|
|
120
|
+
html_path: { type: "string", description: "Path to the HTML/PHP template code file." },
|
|
121
|
+
css_path: { type: "string", description: "Path to the CSS code file." },
|
|
122
|
+
js_path: { type: "string", description: "Path to the JavaScript code file." },
|
|
123
|
+
document_content_path: { type: "string", description: "Path to the Markdown documentation file." },
|
|
124
|
+
description: { type: "string", description: "Short description of the item." },
|
|
125
|
+
priority_css: { type: "number", description: "CSS hook priority." },
|
|
126
|
+
priority_js: { type: "number", description: "JS hook priority." },
|
|
127
|
+
location_js: { type: "string", enum: ["head", "open_body", "foot"], description: "JS injection location." },
|
|
128
|
+
location_php: { type: "object", description: "PHP hook locations object." },
|
|
129
|
+
},
|
|
130
|
+
required: ["id"],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "publish_template",
|
|
135
|
+
description: "Publish template from sandbox to production.",
|
|
136
|
+
inputSchema: {
|
|
137
|
+
type: "object",
|
|
138
|
+
properties: {
|
|
139
|
+
id: { type: "number", description: "The data record ID." },
|
|
140
|
+
},
|
|
141
|
+
required: ["id"],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "create_template",
|
|
146
|
+
description: "Create a new template.",
|
|
147
|
+
inputSchema: {
|
|
148
|
+
type: "object",
|
|
149
|
+
properties: {
|
|
150
|
+
title: { type: "string", description: "Title of the new template." },
|
|
151
|
+
sub_type: {
|
|
152
|
+
type: "string",
|
|
153
|
+
enum: ["header", "footer", "single", "archive", "404", "search", "front_page", "blog", "custom", "partial"],
|
|
154
|
+
description: "Template sub-type."
|
|
155
|
+
},
|
|
156
|
+
html_path: { type: "string", description: "Path to the initial HTML/PHP code file." },
|
|
157
|
+
css_path: { type: "string", description: "Path to the initial CSS code file." },
|
|
158
|
+
js_path: { type: "string", description: "Path to the initial JavaScript code file." },
|
|
159
|
+
conditions: { type: "object", description: "Conditions JSON object." },
|
|
160
|
+
priority_css: { type: "number", description: "CSS hook priority.", default: 30 },
|
|
161
|
+
priority_js: { type: "number", description: "JS hook priority.", default: 30 },
|
|
162
|
+
location_js: { type: "string", enum: ["head", "open_body", "foot"], description: "JS injection location.", default: "foot" },
|
|
163
|
+
location_php: { type: "object", description: "PHP hook locations object." },
|
|
164
|
+
},
|
|
165
|
+
required: ["title", "sub_type"],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "update_template",
|
|
170
|
+
description: "Update template title or slug.",
|
|
171
|
+
inputSchema: {
|
|
172
|
+
type: "object",
|
|
173
|
+
properties: {
|
|
174
|
+
id: { type: "number", description: "The data record ID." },
|
|
175
|
+
title: { type: "string", description: "New title." },
|
|
176
|
+
slug: { type: "string", description: "New slug." },
|
|
177
|
+
},
|
|
178
|
+
required: ["id"],
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: "toggle_template",
|
|
183
|
+
description: "Enable or disable a template.",
|
|
184
|
+
inputSchema: {
|
|
185
|
+
type: "object",
|
|
186
|
+
properties: {
|
|
187
|
+
id: { type: "number", description: "The data record ID." },
|
|
188
|
+
enabled: { type: "boolean", description: "New state." },
|
|
189
|
+
},
|
|
190
|
+
required: ["id"],
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: "update_template_conditions",
|
|
195
|
+
description: "Update the condition rules for a template. Supports unified groups format (v3).",
|
|
196
|
+
inputSchema: {
|
|
197
|
+
type: "object",
|
|
198
|
+
properties: {
|
|
199
|
+
id: { type: "number", description: "The data record ID." },
|
|
200
|
+
conditions: { type: "object", description: "Conditions JSON object." },
|
|
201
|
+
},
|
|
202
|
+
required: ["id", "conditions"],
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "delete_template",
|
|
207
|
+
description: "Delete a template.",
|
|
208
|
+
inputSchema: {
|
|
209
|
+
type: "object",
|
|
210
|
+
properties: {
|
|
211
|
+
id: { type: "number", description: "The data record ID." },
|
|
212
|
+
},
|
|
213
|
+
required: ["id"],
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "get_template_revisions",
|
|
218
|
+
description: "List revision history for a template.",
|
|
219
|
+
inputSchema: {
|
|
220
|
+
type: "object",
|
|
221
|
+
properties: {
|
|
222
|
+
id: { type: "number", description: "The data record ID." },
|
|
223
|
+
},
|
|
224
|
+
required: ["id"],
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: "restore_template_revision",
|
|
229
|
+
description: "Restore a template revision to sandbox.",
|
|
230
|
+
inputSchema: {
|
|
231
|
+
type: "object",
|
|
232
|
+
properties: {
|
|
233
|
+
id: { type: "number", description: "The data record ID." },
|
|
234
|
+
revision_id: { type: "number", description: "The ID of the revision to restore." },
|
|
235
|
+
},
|
|
236
|
+
required: ["id", "revision_id"],
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
// Scripts
|
|
240
|
+
{
|
|
241
|
+
name: "save_script",
|
|
242
|
+
description: "Save script code and settings to sandbox (draft).",
|
|
243
|
+
inputSchema: {
|
|
244
|
+
type: "object",
|
|
245
|
+
properties: {
|
|
246
|
+
id: { type: "number", description: "The data record ID." },
|
|
247
|
+
html_path: { type: "string", description: "Path to the HTML/PHP code file." },
|
|
248
|
+
css_path: { type: "string", description: "Path to the CSS code file." },
|
|
249
|
+
js_path: { type: "string", description: "Path to the JavaScript code file." },
|
|
250
|
+
document_content_path: { type: "string", description: "Path to the Markdown documentation file." },
|
|
251
|
+
description: { type: "string", description: "Short description of the item." },
|
|
252
|
+
priority_css: { type: "number", description: "CSS hook priority." },
|
|
253
|
+
priority_js: { type: "number", description: "JS hook priority." },
|
|
254
|
+
location_js: { type: "string", enum: ["head", "open_body", "foot"], description: "JS injection location." },
|
|
255
|
+
script_mode: { type: "string", enum: ["advanced", "php", "css", "js"], description: "Script mode." },
|
|
256
|
+
location_php: { type: "object", description: "PHP hook locations object." },
|
|
257
|
+
},
|
|
258
|
+
required: ["id"],
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: "publish_script",
|
|
263
|
+
description: "Publish script from sandbox to production.",
|
|
264
|
+
inputSchema: {
|
|
265
|
+
type: "object",
|
|
266
|
+
properties: {
|
|
267
|
+
id: { type: "number", description: "The data record ID." },
|
|
268
|
+
},
|
|
269
|
+
required: ["id"],
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: "create_script",
|
|
274
|
+
description: "Create a new global script.",
|
|
275
|
+
inputSchema: {
|
|
276
|
+
type: "object",
|
|
277
|
+
properties: {
|
|
278
|
+
title: { type: "string", description: "Title of the new script." },
|
|
279
|
+
html_path: { type: "string", description: "Path to the initial HTML/PHP code file." },
|
|
280
|
+
css_path: { type: "string", description: "Path to the initial CSS code file." },
|
|
281
|
+
js_path: { type: "string", description: "Path to the initial JavaScript code file." },
|
|
282
|
+
conditions: { type: "object", description: "Conditions JSON object." },
|
|
283
|
+
priority_css: { type: "number", description: "CSS hook priority.", default: 30 },
|
|
284
|
+
priority_js: { type: "number", description: "JS hook priority.", default: 30 },
|
|
285
|
+
location_js: { type: "string", enum: ["head", "open_body", "foot"], description: "JS injection location.", default: "foot" },
|
|
286
|
+
script_mode: { type: "string", enum: ["advanced", "php", "css", "js"], description: "Script mode.", default: "advanced" },
|
|
287
|
+
location_php: { type: "object", description: "PHP hook locations object." },
|
|
288
|
+
},
|
|
289
|
+
required: ["title"],
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
name: "update_script",
|
|
294
|
+
description: "Update script title or slug.",
|
|
295
|
+
inputSchema: {
|
|
296
|
+
type: "object",
|
|
297
|
+
properties: {
|
|
298
|
+
id: { type: "number", description: "The data record ID." },
|
|
299
|
+
title: { type: "string", description: "New title." },
|
|
300
|
+
slug: { type: "string", description: "New slug." },
|
|
301
|
+
},
|
|
302
|
+
required: ["id"],
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: "toggle_script",
|
|
307
|
+
description: "Enable or disable a script.",
|
|
308
|
+
inputSchema: {
|
|
309
|
+
type: "object",
|
|
310
|
+
properties: {
|
|
311
|
+
id: { type: "number", description: "The data record ID." },
|
|
312
|
+
enabled: { type: "boolean", description: "New state." },
|
|
313
|
+
},
|
|
314
|
+
required: ["id"],
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: "update_script_conditions",
|
|
319
|
+
description: "Update the condition rules for a script. Supports unified groups format (v3).",
|
|
320
|
+
inputSchema: {
|
|
321
|
+
type: "object",
|
|
322
|
+
properties: {
|
|
323
|
+
id: { type: "number", description: "The data record ID." },
|
|
324
|
+
conditions: { type: "object", description: "Conditions JSON object." },
|
|
325
|
+
},
|
|
326
|
+
required: ["id", "conditions"],
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: "delete_script",
|
|
331
|
+
description: "Delete a script.",
|
|
332
|
+
inputSchema: {
|
|
333
|
+
type: "object",
|
|
334
|
+
properties: {
|
|
335
|
+
id: { type: "number", description: "The data record ID." },
|
|
336
|
+
},
|
|
337
|
+
required: ["id"],
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: "get_script_revisions",
|
|
342
|
+
description: "List revision history for a script.",
|
|
343
|
+
inputSchema: {
|
|
344
|
+
type: "object",
|
|
345
|
+
properties: {
|
|
346
|
+
id: { type: "number", description: "The data record ID." },
|
|
347
|
+
},
|
|
348
|
+
required: ["id"],
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
name: "restore_script_revision",
|
|
353
|
+
description: "Restore a script revision to sandbox.",
|
|
354
|
+
inputSchema: {
|
|
355
|
+
type: "object",
|
|
356
|
+
properties: {
|
|
357
|
+
id: { type: "number", description: "The data record ID." },
|
|
358
|
+
revision_id: { type: "number", description: "The ID of the revision to restore." },
|
|
359
|
+
},
|
|
360
|
+
required: ["id", "revision_id"],
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
// Content
|
|
364
|
+
{
|
|
365
|
+
name: "save_content",
|
|
366
|
+
description: "Save content code and settings to sandbox (draft).",
|
|
367
|
+
inputSchema: {
|
|
368
|
+
type: "object",
|
|
369
|
+
properties: {
|
|
370
|
+
id: { type: "number", description: "The data record ID." },
|
|
371
|
+
html_path: { type: "string", description: "Path to the HTML code file." },
|
|
372
|
+
css_path: { type: "string", description: "Path to the CSS code file." },
|
|
373
|
+
js_path: { type: "string", description: "Path to the JavaScript code file." },
|
|
374
|
+
document_content_path: { type: "string", description: "Path to the Markdown documentation file." },
|
|
375
|
+
description: { type: "string", description: "Short description of the item." },
|
|
376
|
+
priority_css: { type: "number", description: "CSS hook priority." },
|
|
377
|
+
priority_js: { type: "number", description: "JS hook priority." },
|
|
378
|
+
location_js: { type: "string", enum: ["head", "open_body", "foot"], description: "JS injection location." },
|
|
379
|
+
},
|
|
380
|
+
required: ["id"],
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
name: "publish_content",
|
|
385
|
+
description: "Publish content from sandbox to production.",
|
|
386
|
+
inputSchema: {
|
|
387
|
+
type: "object",
|
|
388
|
+
properties: {
|
|
389
|
+
id: { type: "number", description: "The data record ID." },
|
|
390
|
+
},
|
|
391
|
+
required: ["id"],
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
name: "create_content",
|
|
396
|
+
description: "Create a new content item (page, post, etc).",
|
|
397
|
+
inputSchema: {
|
|
398
|
+
type: "object",
|
|
399
|
+
properties: {
|
|
400
|
+
title: { type: "string", description: "Title of the new content." },
|
|
401
|
+
post_type: { type: "string", description: "WordPress post type." },
|
|
402
|
+
html_path: { type: "string", description: "Path to the initial HTML code file." },
|
|
403
|
+
css_path: { type: "string", description: "Path to the initial CSS code file." },
|
|
404
|
+
js_path: { type: "string", description: "Path to the initial JavaScript code file." },
|
|
405
|
+
priority_css: { type: "number", description: "CSS hook priority.", default: 30 },
|
|
406
|
+
priority_js: { type: "number", description: "JS hook priority.", default: 30 },
|
|
407
|
+
location_js: { type: "string", enum: ["head", "open_body", "foot"], description: "JS injection location.", default: "foot" },
|
|
408
|
+
},
|
|
409
|
+
required: ["title", "post_type"],
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
name: "update_content",
|
|
414
|
+
description: "Update content title or slug.",
|
|
415
|
+
inputSchema: {
|
|
416
|
+
type: "object",
|
|
417
|
+
properties: {
|
|
418
|
+
id: { type: "number", description: "The data record ID." },
|
|
419
|
+
title: { type: "string", description: "New title." },
|
|
420
|
+
slug: { type: "string", description: "New slug." },
|
|
421
|
+
},
|
|
422
|
+
required: ["id"],
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
// Search & Utilities
|
|
426
|
+
{
|
|
427
|
+
name: "search_contents",
|
|
428
|
+
description: "Search all public post types by title or slug (contains match). Includes PK Agentic status for discovery.",
|
|
429
|
+
inputSchema: {
|
|
430
|
+
type: "object",
|
|
431
|
+
properties: {
|
|
432
|
+
search: { type: "string", description: "Keyword to match against post_title or post_name." },
|
|
433
|
+
post_type: { type: "string", description: "Filter to a single post type." },
|
|
434
|
+
per_page: { type: "number", description: "Max results (max 100).", default: 20 },
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
name: "mark_content_edit",
|
|
440
|
+
description: "Onboard an existing WordPress post into PK Agentic so an agent can edit it.",
|
|
441
|
+
inputSchema: {
|
|
442
|
+
type: "object",
|
|
443
|
+
properties: {
|
|
444
|
+
post_id: { type: "number", description: "WordPress post ID (wp_posts.ID)." },
|
|
445
|
+
},
|
|
446
|
+
required: ["post_id"],
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: "search_media",
|
|
451
|
+
description: "Search WordPress Media Library by keyword and type.",
|
|
452
|
+
inputSchema: {
|
|
453
|
+
type: "object",
|
|
454
|
+
properties: {
|
|
455
|
+
search: { type: "string", description: "Keyword to search in title/filename." },
|
|
456
|
+
media_type: {
|
|
457
|
+
type: "string",
|
|
458
|
+
enum: ["image", "svg", "pdf", "font"],
|
|
459
|
+
description: "Filter by type.",
|
|
460
|
+
default: "image"
|
|
461
|
+
},
|
|
462
|
+
per_page: { type: "number", description: "Max results (max 50).", default: 20 },
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: "upload_media",
|
|
468
|
+
description: "Upload a media file (image, SVG, PDF, or font) to the WordPress Media Library. Supports local file paths (multipart) or base64 data. Response includes a `srcset` string for responsive images (images only; null for SVG, PDF, font or when WP cannot generate sizes). Always pair `srcset` with a `sizes` attribute.",
|
|
469
|
+
inputSchema: {
|
|
470
|
+
type: "object",
|
|
471
|
+
properties: {
|
|
472
|
+
file_path: { type: "string", description: "Local path to the file to upload (e.g. 'workspace/resources/images/hero.jpg')." },
|
|
473
|
+
base64: { type: "string", description: "Base64-encoded file data (alternative to file_path)." },
|
|
474
|
+
filename: { type: "string", description: "Filename (required for base64, optional for file_path)." },
|
|
475
|
+
media_type: {
|
|
476
|
+
type: "string",
|
|
477
|
+
enum: ["image", "svg", "pdf", "font"],
|
|
478
|
+
description: "Type of media being uploaded.",
|
|
479
|
+
default: "image"
|
|
480
|
+
},
|
|
481
|
+
alt_text: { type: "string", description: "Alt text for images/SVGs." },
|
|
482
|
+
title: { type: "string", description: "Media title." },
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
name: "get_image_srcset",
|
|
488
|
+
description: "Get the WordPress-generated srcset string and basic metadata for an existing image attachment. Use this when you already have an attachment_id from search_media results and need responsive image markup without re-uploading.",
|
|
489
|
+
inputSchema: {
|
|
490
|
+
type: "object",
|
|
491
|
+
properties: {
|
|
492
|
+
attachment_id: { type: "number", description: "The WordPress attachment ID of the image." },
|
|
493
|
+
},
|
|
494
|
+
required: ["attachment_id"],
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
name: "get_roles",
|
|
499
|
+
description: "List WordPress user roles (for condition building).",
|
|
500
|
+
inputSchema: { type: "object", properties: {} },
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
name: "download_image",
|
|
504
|
+
description: "Download an image from a URL and save it to a local file.",
|
|
505
|
+
inputSchema: {
|
|
506
|
+
type: "object",
|
|
507
|
+
properties: {
|
|
508
|
+
url: { type: "string", description: "The URL of the image to download." },
|
|
509
|
+
path: { type: "string", description: "The local file path (including filename) to save the image to." },
|
|
510
|
+
},
|
|
511
|
+
required: ["url", "path"],
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
name: "optimize_image",
|
|
516
|
+
description: "Resize and/or convert an image to WebP in one call. PNG, JPG, BMP, TIFF, and HEIC files are always converted to WebP. Resizing only occurs when the image exceeds the specified width or height — it never upscales. Default quality is 80%.",
|
|
517
|
+
inputSchema: {
|
|
518
|
+
type: "object",
|
|
519
|
+
properties: {
|
|
520
|
+
file_path: { type: "string", description: "Path to the source image file." },
|
|
521
|
+
output_path: { type: "string", description: "Output file path. Defaults to same directory as input with .webp extension." },
|
|
522
|
+
width: { type: "number", description: "Max width in pixels. Resizes only if image width exceeds this value. Aspect ratio preserved." },
|
|
523
|
+
height: { type: "number", description: "Max height in pixels. Resizes only if image height exceeds this value. Aspect ratio preserved." },
|
|
524
|
+
quality: { type: "number", description: "WebP quality 1–100. Default is 80.", default: 80 },
|
|
525
|
+
},
|
|
526
|
+
required: ["file_path"],
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
name: "read_web_page",
|
|
531
|
+
description: "Read content from a web page, supporting both static and JavaScript-rendered sites.",
|
|
532
|
+
inputSchema: {
|
|
533
|
+
type: "object",
|
|
534
|
+
properties: {
|
|
535
|
+
url: { type: "string", description: "The URL of the web page to read." },
|
|
536
|
+
render_js: {
|
|
537
|
+
type: "boolean",
|
|
538
|
+
description: "Whether to render JavaScript using a headless browser. Default is true.",
|
|
539
|
+
default: true
|
|
540
|
+
},
|
|
541
|
+
wait_selector: {
|
|
542
|
+
type: "string",
|
|
543
|
+
description: "Optional CSS selector to wait for before extracting content."
|
|
544
|
+
},
|
|
545
|
+
css_selector: {
|
|
546
|
+
type: "string",
|
|
547
|
+
description: "Optional CSS selector to extract specific content from the page."
|
|
548
|
+
},
|
|
549
|
+
},
|
|
550
|
+
required: ["url"],
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
name: "init_project",
|
|
555
|
+
description: "Initialize the project structure in the current directory.",
|
|
556
|
+
inputSchema: {
|
|
557
|
+
type: "object",
|
|
558
|
+
properties: {
|
|
559
|
+
path: {
|
|
560
|
+
type: "string",
|
|
561
|
+
description: "Optional: The path where to initialize the project. Defaults to current directory.",
|
|
562
|
+
default: "."
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
name: "get_agent_guide",
|
|
569
|
+
description: "Retrieve a detailed sub-guide for a specific topic and write it to agent-guide/{topic}.md in the project directory. Available guides: workflow, templates, conditions, scripts, preview, errors, media, permissions, navigation, tailwind-config, image-generation, php-location, image-optimize, global-library, tailwind-optimize.",
|
|
570
|
+
inputSchema: {
|
|
571
|
+
type: "object",
|
|
572
|
+
properties: {
|
|
573
|
+
guide: {
|
|
574
|
+
type: "string",
|
|
575
|
+
enum: ["workflow", "templates", "conditions", "scripts", "preview", "errors", "media", "permissions", "navigation", "tailwind-config", "image-generation", "php-location", "image-optimize", "global-library", "tailwind-optimize"],
|
|
576
|
+
description: "The topic of the guide to retrieve."
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
required: ["guide"]
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
name: "get_tailwind_config",
|
|
584
|
+
description: "Get the Tailwind CSS configuration (@theme CSS block) from Settings > Layout. The prefix is always 'pkt-'. Returns the default kit config if none has been saved.",
|
|
585
|
+
inputSchema: { type: "object", properties: {} },
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
name: "update_tailwind_config",
|
|
589
|
+
description: "Update the @theme CSS block of the Tailwind CSS config in Settings > Layout. Pass the complete @theme { ... } CSS block — it is not merged. The prefix 'pkt-' is fixed and cannot be changed. Changes take effect immediately on the next page load.",
|
|
590
|
+
inputSchema: {
|
|
591
|
+
type: "object",
|
|
592
|
+
properties: {
|
|
593
|
+
theme_css: {
|
|
594
|
+
type: "string",
|
|
595
|
+
description: "The new @theme { ... } CSS block as a string. Replaces the entire existing theme config.",
|
|
596
|
+
},
|
|
597
|
+
},
|
|
598
|
+
required: ["theme_css"],
|
|
599
|
+
},
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
name: "tailwind_optimize",
|
|
603
|
+
description: "Optimize Tailwind CSS for production using PostCSS and Tailwind v4. Scans all HTML/PHP files in the workspace and uses the provided Tailwind configuration to generate a minified CSS file at workspace/optimize/optimized-tailwind.css.",
|
|
604
|
+
inputSchema: {
|
|
605
|
+
type: "object",
|
|
606
|
+
properties: {
|
|
607
|
+
tailwind_config: {
|
|
608
|
+
type: "string",
|
|
609
|
+
description: "The Tailwind @theme { ... } CSS block.",
|
|
610
|
+
},
|
|
611
|
+
},
|
|
612
|
+
required: ["tailwind_config"],
|
|
613
|
+
},
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
name: "generate_image",
|
|
617
|
+
description: "Generate an image using Gemini AI (Imagen 3) based on a prompt stored in a file. Saves the image to workspace/generated-images/.",
|
|
618
|
+
inputSchema: {
|
|
619
|
+
type: "object",
|
|
620
|
+
properties: {
|
|
621
|
+
prompt_path: {
|
|
622
|
+
type: "string",
|
|
623
|
+
description: "Local path to the Markdown file containing the image prompt."
|
|
624
|
+
},
|
|
625
|
+
image_name: {
|
|
626
|
+
type: "string",
|
|
627
|
+
description: "Base name for the output image file (without extension)."
|
|
628
|
+
},
|
|
629
|
+
page_name: {
|
|
630
|
+
type: "string",
|
|
631
|
+
description: "Name of the page for which the image is generated."
|
|
632
|
+
},
|
|
633
|
+
aspect_ratio: {
|
|
634
|
+
type: "string",
|
|
635
|
+
enum: ["1:1", "9:16", "16:9", "3:2", "4:3"],
|
|
636
|
+
default: "1:1",
|
|
637
|
+
description: "Desired aspect ratio for the generated image."
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
required: ["prompt_path", "image_name", "page_name"]
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
// Global Library
|
|
644
|
+
{
|
|
645
|
+
name: "list_libraries",
|
|
646
|
+
description: "List all Global Libraries managed by the plugin. Returns metadata and file information.",
|
|
647
|
+
inputSchema: {
|
|
648
|
+
type: "object",
|
|
649
|
+
properties: {
|
|
650
|
+
page: { type: "number", description: "Page number (1-based).", default: 1 },
|
|
651
|
+
per_page: { type: "number", description: "Items per page (1-100).", default: 50 },
|
|
652
|
+
},
|
|
653
|
+
},
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
name: "create_library",
|
|
657
|
+
description: "Create a new Global Library.",
|
|
658
|
+
inputSchema: {
|
|
659
|
+
type: "object",
|
|
660
|
+
properties: {
|
|
661
|
+
title: { type: "string", description: "Title of the new library." },
|
|
662
|
+
library_type: {
|
|
663
|
+
type: "string",
|
|
664
|
+
enum: ["js", "css", "font"],
|
|
665
|
+
description: "Library type."
|
|
666
|
+
},
|
|
667
|
+
},
|
|
668
|
+
required: ["title", "library_type"],
|
|
669
|
+
},
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
name: "update_library",
|
|
673
|
+
description: "Update Global Library metadata (title, type, mode).",
|
|
674
|
+
inputSchema: {
|
|
675
|
+
type: "object",
|
|
676
|
+
properties: {
|
|
677
|
+
id: { type: "number", description: "The library ID." },
|
|
678
|
+
title: { type: "string", description: "New title." },
|
|
679
|
+
library_type: { type: "string", enum: ["js", "css", "font"], description: "New library type." },
|
|
680
|
+
mode: { type: "string", enum: ["local", "cdn"], description: "Loading mode." },
|
|
681
|
+
},
|
|
682
|
+
required: ["id"],
|
|
683
|
+
},
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
name: "delete_library",
|
|
687
|
+
description: "Delete a Global Library and all its files from disk.",
|
|
688
|
+
inputSchema: {
|
|
689
|
+
type: "object",
|
|
690
|
+
properties: {
|
|
691
|
+
id: { type: "number", description: "The library ID." },
|
|
692
|
+
},
|
|
693
|
+
required: ["id"],
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
name: "search_libraries",
|
|
698
|
+
description: "Search Global Libraries by title.",
|
|
699
|
+
inputSchema: {
|
|
700
|
+
type: "object",
|
|
701
|
+
properties: {
|
|
702
|
+
q: { type: "string", description: "Keyword to match against the library title." },
|
|
703
|
+
},
|
|
704
|
+
required: ["q"],
|
|
705
|
+
},
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
name: "get_library",
|
|
709
|
+
description: "Retrieve full metadata and file list for a specific Global Library.",
|
|
710
|
+
inputSchema: {
|
|
711
|
+
type: "object",
|
|
712
|
+
properties: {
|
|
713
|
+
id: { type: "number", description: "The library ID." },
|
|
714
|
+
},
|
|
715
|
+
required: ["id"],
|
|
716
|
+
},
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
name: "cdn_download_library",
|
|
720
|
+
description: "Download asset files from CDN URLs to local library storage.",
|
|
721
|
+
inputSchema: {
|
|
722
|
+
type: "object",
|
|
723
|
+
properties: {
|
|
724
|
+
id: { type: "number", description: "The library ID." },
|
|
725
|
+
urls: {
|
|
726
|
+
type: "array",
|
|
727
|
+
items: { type: "string" },
|
|
728
|
+
description: "Array of CDN URLs to download."
|
|
729
|
+
},
|
|
730
|
+
},
|
|
731
|
+
required: ["id", "urls"],
|
|
732
|
+
},
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
name: "save_library_files",
|
|
736
|
+
description: "Update settings for files within a library (priority, location).",
|
|
737
|
+
inputSchema: {
|
|
738
|
+
type: "object",
|
|
739
|
+
properties: {
|
|
740
|
+
id: { type: "number", description: "The library ID." },
|
|
741
|
+
files: {
|
|
742
|
+
type: "array",
|
|
743
|
+
items: {
|
|
744
|
+
type: "object",
|
|
745
|
+
properties: {
|
|
746
|
+
filename: { type: "string" },
|
|
747
|
+
priority: { type: "number" },
|
|
748
|
+
location_js: { type: "string", enum: ["foot", "head", "open_body"] },
|
|
749
|
+
},
|
|
750
|
+
required: ["filename"],
|
|
751
|
+
},
|
|
752
|
+
},
|
|
753
|
+
},
|
|
754
|
+
required: ["id", "files"],
|
|
755
|
+
},
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
name: "restore_library_backup",
|
|
759
|
+
description: "Restore library files from a previous backup.",
|
|
760
|
+
inputSchema: {
|
|
761
|
+
type: "object",
|
|
762
|
+
properties: {
|
|
763
|
+
id: { type: "number", description: "The library ID." },
|
|
764
|
+
backup_key: { type: "string", description: "The timestamp key of the backup to restore." },
|
|
765
|
+
},
|
|
766
|
+
required: ["id", "backup_key"],
|
|
767
|
+
},
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
name: "update_library_conditions",
|
|
771
|
+
description: "Update display conditions for a Global Library.",
|
|
772
|
+
inputSchema: {
|
|
773
|
+
type: "object",
|
|
774
|
+
properties: {
|
|
775
|
+
id: { type: "number", description: "The library ID." },
|
|
776
|
+
conditions: { type: "object", description: "Conditions JSON object." },
|
|
777
|
+
},
|
|
778
|
+
required: ["id", "conditions"],
|
|
779
|
+
},
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
name: "toggle_library",
|
|
783
|
+
description: "Enable or disable a Global Library.",
|
|
784
|
+
inputSchema: {
|
|
785
|
+
type: "object",
|
|
786
|
+
properties: {
|
|
787
|
+
id: { type: "number", description: "The library ID." },
|
|
788
|
+
enabled: { type: "boolean", description: "New state." },
|
|
789
|
+
},
|
|
790
|
+
required: ["id"],
|
|
791
|
+
},
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
name: "toggle_library_lock",
|
|
795
|
+
description: "Lock or unlock a Global Library. Locked libraries cannot be modified or deleted.",
|
|
796
|
+
inputSchema: {
|
|
797
|
+
type: "object",
|
|
798
|
+
properties: {
|
|
799
|
+
id: { type: "number", description: "The library ID." },
|
|
800
|
+
locked: { type: "boolean", description: "New locked state (true to lock, false to unlock). If omitted, toggles the current state." },
|
|
801
|
+
},
|
|
802
|
+
required: ["id"],
|
|
803
|
+
},
|
|
804
|
+
},
|
|
805
|
+
];
|
|
806
|
+
//# sourceMappingURL=tools.js.map
|