@marvalt/digivalt-mcp 0.0.0-stage → 0.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/CHANGELOG.md +48 -0
- package/LICENSE +674 -0
- package/README.md +66 -3
- package/dist/audit.d.ts +24 -0
- package/dist/audit.js +34 -0
- package/dist/audit.js.map +1 -0
- package/dist/blocks/serialize.d.ts +15 -0
- package/dist/blocks/serialize.js +231 -0
- package/dist/blocks/serialize.js.map +1 -0
- package/dist/catalogue/blocks.d.ts +17 -0
- package/dist/catalogue/blocks.js +37 -0
- package/dist/catalogue/blocks.js.map +1 -0
- package/dist/catalogue/shortcodes.d.ts +49 -0
- package/dist/catalogue/shortcodes.js +384 -0
- package/dist/catalogue/shortcodes.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +57 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +43 -0
- package/dist/config.js +131 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/media.d.ts +26 -0
- package/dist/media.js +118 -0
- package/dist/media.js.map +1 -0
- package/dist/publish.d.ts +32 -0
- package/dist/publish.js +74 -0
- package/dist/publish.js.map +1 -0
- package/dist/refresh.d.ts +30 -0
- package/dist/refresh.js +93 -0
- package/dist/refresh.js.map +1 -0
- package/dist/resources/guides.d.ts +2 -0
- package/dist/resources/guides.js +51 -0
- package/dist/resources/guides.js.map +1 -0
- package/dist/server.d.ts +19 -0
- package/dist/server.js +522 -0
- package/dist/server.js.map +1 -0
- package/dist/validate/local.d.ts +17 -0
- package/dist/validate/local.js +75 -0
- package/dist/validate/local.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/dist/wp-client.d.ts +31 -0
- package/dist/wp-client.js +94 -0
- package/dist/wp-client.js.map +1 -0
- package/docs/README.md +98 -0
- package/docs/SECURITY.md +40 -0
- package/package.json +48 -4
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
export const SHORTCODE_CATALOGUE_VERSION = '2026-11-13';
|
|
2
|
+
const CORE = '@marvalt/digivalt-core';
|
|
3
|
+
const SHCODER = '@marvalt/shcoder';
|
|
4
|
+
export const SHORTCODES = [
|
|
5
|
+
{
|
|
6
|
+
name: 'icon',
|
|
7
|
+
source: CORE,
|
|
8
|
+
description: 'Material Symbols icon (ligature name).',
|
|
9
|
+
status: 'supported',
|
|
10
|
+
attrs: [
|
|
11
|
+
{ name: 'name', required: true, pattern: '^[a-z0-9_]+$', description: 'Icon name, for example shield or account_balance.' },
|
|
12
|
+
{ name: 'tone', values: ['neutral', 'positive', 'negative', 'brand'], description: 'Colour tone (default neutral).' },
|
|
13
|
+
{ name: 'shape', values: ['none', 'circle', 'rounded', 'square'], description: 'Background shape (default none).' },
|
|
14
|
+
{ name: 'size', values: ['sm', 'md', 'lg'], description: 'Size (default md).' },
|
|
15
|
+
{ name: 'label', description: 'Accessible name. Without it the icon is hidden from assistive tech.' },
|
|
16
|
+
],
|
|
17
|
+
example: '[icon name="shield" tone="brand" shape="circle"]',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'gf_embed',
|
|
21
|
+
source: CORE,
|
|
22
|
+
description: 'Gravity Form rendered inline by the app.',
|
|
23
|
+
status: 'supported',
|
|
24
|
+
attrs: [{ name: 'id', required: true, pattern: '^\\d+$', description: 'Gravity Forms form id.' }],
|
|
25
|
+
example: '[gf_embed id="1"]',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'gform',
|
|
29
|
+
source: CORE,
|
|
30
|
+
description: 'Alias of gf_embed.',
|
|
31
|
+
status: 'supported',
|
|
32
|
+
aliasOf: 'gf_embed',
|
|
33
|
+
attrs: [{ name: 'form_id', required: true, aliases: ['id'], pattern: '^\\d+$', description: 'Gravity Forms form id.' }],
|
|
34
|
+
example: '[gform form_id="1"]',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'popupbtn_gf',
|
|
38
|
+
source: CORE,
|
|
39
|
+
description: 'Button that opens a Gravity Form in a popup.',
|
|
40
|
+
status: 'supported',
|
|
41
|
+
attrs: [
|
|
42
|
+
{ name: 'id', required: true, pattern: '^\\d+$', description: 'Gravity Forms form id.' },
|
|
43
|
+
{ name: 'text', description: 'Button label.' },
|
|
44
|
+
],
|
|
45
|
+
example: '[popupbtn_gf id="1" text="Submit"]',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'popupgform',
|
|
49
|
+
source: CORE,
|
|
50
|
+
description: 'Alias of popupbtn_gf.',
|
|
51
|
+
status: 'supported',
|
|
52
|
+
aliasOf: 'popupbtn_gf',
|
|
53
|
+
attrs: [
|
|
54
|
+
{ name: 'form_id', required: true, aliases: ['id'], pattern: '^\\d+$', description: 'Gravity Forms form id.' },
|
|
55
|
+
{ name: 'text', description: 'Button label.' },
|
|
56
|
+
],
|
|
57
|
+
example: '[popupgform form_id="1"]',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'mautic_form',
|
|
61
|
+
source: '@marvalt/madapter',
|
|
62
|
+
description: 'Mautic form rendered inline (needs generated mautic-data.json).',
|
|
63
|
+
status: 'supported',
|
|
64
|
+
attrs: [
|
|
65
|
+
{ name: 'id', required: true, aliases: ['formId'], pattern: '^\\d+$', description: 'Mautic form id.' },
|
|
66
|
+
{ name: 'title', description: 'Heading above the form.' },
|
|
67
|
+
{ name: 'description', description: 'Intro text.' },
|
|
68
|
+
],
|
|
69
|
+
example: '[mautic_form id="1" title="Contact us"]',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'popupbtn_mautic',
|
|
73
|
+
source: CORE,
|
|
74
|
+
description: 'Button that opens a Mautic form in a popup.',
|
|
75
|
+
status: 'supported',
|
|
76
|
+
attrs: [
|
|
77
|
+
{ name: 'id', required: true, pattern: '^\\d+$', description: 'Mautic form id.' },
|
|
78
|
+
{ name: 'text', description: 'Button label.' },
|
|
79
|
+
{ name: 'title', description: 'Popup heading.' },
|
|
80
|
+
],
|
|
81
|
+
example: '[popupbtn_mautic id="1" text="Contact Us"]',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'phplist_subscribe',
|
|
85
|
+
source: '@marvalt/plister',
|
|
86
|
+
description: 'PHPList subscribe form (email plus nominated visible attributes).',
|
|
87
|
+
status: 'supported',
|
|
88
|
+
attrs: [
|
|
89
|
+
{ name: 'list', description: 'List id, slug or name. Omit to use the site default.' },
|
|
90
|
+
{ name: 'attrs', description: 'Comma-separated visible attribute names to collect (plus email).' },
|
|
91
|
+
{ name: 'page', description: 'PHPList subscribe page id.' },
|
|
92
|
+
{ name: 'title', description: 'Override subscribe-page title.' },
|
|
93
|
+
{ name: 'intro', description: 'Override subscribe-page intro.' },
|
|
94
|
+
],
|
|
95
|
+
example: '[phplist_subscribe list="1" attrs="firstname,lastname"]',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'post_card',
|
|
99
|
+
source: SHCODER,
|
|
100
|
+
description: 'Single post card. Title links to /{slug}.',
|
|
101
|
+
status: 'supported',
|
|
102
|
+
attrs: [{ name: 'id', required: true, pattern: '^\\d+$', description: 'Post id.' }],
|
|
103
|
+
example: '[post_card id="123"]',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'post_cards',
|
|
107
|
+
source: SHCODER,
|
|
108
|
+
description: 'Post grid from static posts.',
|
|
109
|
+
status: 'supported',
|
|
110
|
+
attrs: [
|
|
111
|
+
{ name: 'category', description: 'Category slug or id.' },
|
|
112
|
+
{ name: 'tag', description: 'Tag slug or id.' },
|
|
113
|
+
{ name: 'cols', pattern: '^\\d+$', description: 'Columns.' },
|
|
114
|
+
{ name: 'limit', pattern: '^\\d+$', description: 'Maximum posts.' },
|
|
115
|
+
{ name: 'image', values: ['true', 'false'], description: 'Show featured image.' },
|
|
116
|
+
{ name: 'orderby', description: 'Sort field, for example date.' },
|
|
117
|
+
{ name: 'order', values: ['asc', 'desc'], description: 'Sort direction.' },
|
|
118
|
+
],
|
|
119
|
+
example: '[post_cards category="news" cols="3" limit="6" image="true"]',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'latest_posts',
|
|
123
|
+
source: SHCODER,
|
|
124
|
+
description: 'Alias of post_cards.',
|
|
125
|
+
status: 'supported',
|
|
126
|
+
aliasOf: 'post_cards',
|
|
127
|
+
attrs: [{ name: 'limit', pattern: '^\\d+$', description: 'Maximum posts.' }],
|
|
128
|
+
example: '[latest_posts limit="3"]',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'post_slideshow',
|
|
132
|
+
source: SHCODER,
|
|
133
|
+
description: 'One post at a time, with dots.',
|
|
134
|
+
status: 'supported',
|
|
135
|
+
attrs: [
|
|
136
|
+
{ name: 'category', description: 'Category slug or id.' },
|
|
137
|
+
{ name: 'tag', description: 'Tag slug or id.' },
|
|
138
|
+
{ name: 'limit', pattern: '^\\d+$', description: 'Maximum posts.' },
|
|
139
|
+
{ name: 'interval', pattern: '^\\d+$', description: 'Milliseconds between slides.' },
|
|
140
|
+
{ name: 'show_image', values: ['true', 'false'], description: 'Show featured image.' },
|
|
141
|
+
],
|
|
142
|
+
example: '[post_slideshow category="news" limit="5" interval="5000"]',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'testimonial_card',
|
|
146
|
+
source: SHCODER,
|
|
147
|
+
description: 'Single testimonial.',
|
|
148
|
+
status: 'supported',
|
|
149
|
+
attrs: [{ name: 'id', required: true, pattern: '^\\d+$', description: 'Testimonial id.' }],
|
|
150
|
+
example: '[testimonial_card id="123"]',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: 'testimonial_cards',
|
|
154
|
+
source: SHCODER,
|
|
155
|
+
description: 'Testimonial grid.',
|
|
156
|
+
status: 'supported',
|
|
157
|
+
attrs: [
|
|
158
|
+
{ name: 'category', description: 'Category slug.' },
|
|
159
|
+
{ name: 'cols', pattern: '^\\d+$', description: 'Columns.' },
|
|
160
|
+
],
|
|
161
|
+
example: '[testimonial_cards category="external" cols="2"]',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: 'testimonial_slideshow',
|
|
165
|
+
source: SHCODER,
|
|
166
|
+
description: 'Testimonial slideshow.',
|
|
167
|
+
status: 'supported',
|
|
168
|
+
attrs: [
|
|
169
|
+
{ name: 'category', description: 'Category slug.' },
|
|
170
|
+
{ name: 'interval', pattern: '^\\d+$', description: 'Milliseconds between slides.' },
|
|
171
|
+
],
|
|
172
|
+
example: '[testimonial_slideshow category="external" interval="5000"]',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'event_card',
|
|
176
|
+
source: SHCODER,
|
|
177
|
+
description: 'Single event card.',
|
|
178
|
+
status: 'supported',
|
|
179
|
+
attrs: [{ name: 'id', required: true, pattern: '^\\d+$', description: 'Event id.' }],
|
|
180
|
+
example: '[event_card id="123"]',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'events_cards',
|
|
184
|
+
source: SHCODER,
|
|
185
|
+
description: 'Event cards grid.',
|
|
186
|
+
status: 'supported',
|
|
187
|
+
attrs: [
|
|
188
|
+
{ name: 'organization', description: 'Eventbrite organization id stored on each event.' },
|
|
189
|
+
{ name: 'category', description: 'Category.' },
|
|
190
|
+
{ name: 'cols', pattern: '^\\d+$', description: 'Columns.' },
|
|
191
|
+
],
|
|
192
|
+
example: '[events_cards organization="123" cols="3"]',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'events_slideshow',
|
|
196
|
+
source: SHCODER,
|
|
197
|
+
description: 'Event slideshow.',
|
|
198
|
+
status: 'supported',
|
|
199
|
+
attrs: [
|
|
200
|
+
{ name: 'organization', description: 'Eventbrite organization id.' },
|
|
201
|
+
{ name: 'category', description: 'Category.' },
|
|
202
|
+
{ name: 'interval', pattern: '^\\d+$', description: 'Milliseconds between slides.' },
|
|
203
|
+
],
|
|
204
|
+
example: '[events_slideshow organization="123" interval="5000"]',
|
|
205
|
+
},
|
|
206
|
+
...['eventbrite_event_card'].map((name) => ({
|
|
207
|
+
name,
|
|
208
|
+
source: SHCODER,
|
|
209
|
+
description: 'Legacy alias of event_card.',
|
|
210
|
+
status: 'supported',
|
|
211
|
+
aliasOf: 'event_card',
|
|
212
|
+
attrs: [{ name: 'id', required: true, pattern: '^\\d+$', description: 'Event id.' }],
|
|
213
|
+
example: `[${name} id="123"]`,
|
|
214
|
+
})),
|
|
215
|
+
...['eventbrite-events_cards', 'eventbriteevents_cards'].map((name) => ({
|
|
216
|
+
name,
|
|
217
|
+
source: SHCODER,
|
|
218
|
+
description: 'Legacy alias of events_cards.',
|
|
219
|
+
status: 'supported',
|
|
220
|
+
aliasOf: 'events_cards',
|
|
221
|
+
attrs: [
|
|
222
|
+
{ name: 'organization', description: 'Eventbrite organization id.' },
|
|
223
|
+
{ name: 'category', description: 'Category.' },
|
|
224
|
+
{ name: 'cols', pattern: '^\\d+$', description: 'Columns.' },
|
|
225
|
+
],
|
|
226
|
+
example: `[${name} organization="123"]`,
|
|
227
|
+
})),
|
|
228
|
+
...['eventbrite-events_slideshow', 'eventbriteevents_slideshow'].map((name) => ({
|
|
229
|
+
name,
|
|
230
|
+
source: SHCODER,
|
|
231
|
+
description: 'Legacy alias of events_slideshow.',
|
|
232
|
+
status: 'supported',
|
|
233
|
+
aliasOf: 'events_slideshow',
|
|
234
|
+
attrs: [
|
|
235
|
+
{ name: 'organization', description: 'Eventbrite organization id.' },
|
|
236
|
+
{ name: 'category', description: 'Category.' },
|
|
237
|
+
{ name: 'interval', pattern: '^\\d+$', description: 'Milliseconds between slides.' },
|
|
238
|
+
],
|
|
239
|
+
example: `[${name} organization="123"]`,
|
|
240
|
+
})),
|
|
241
|
+
{
|
|
242
|
+
name: 'member_card',
|
|
243
|
+
source: SHCODER,
|
|
244
|
+
description: 'Single member profile. Only in apps that merge their own shcoder member handlers.',
|
|
245
|
+
status: 'optional-app',
|
|
246
|
+
attrs: [{ name: 'id', required: true, pattern: '^\\d+$', description: 'Member id.' }],
|
|
247
|
+
example: '[member_card id="123"]',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: 'member_cards',
|
|
251
|
+
source: SHCODER,
|
|
252
|
+
description: 'Member grid. Only in apps that merge their own shcoder member handlers.',
|
|
253
|
+
status: 'optional-app',
|
|
254
|
+
attrs: [
|
|
255
|
+
{ name: 'tax', description: 'Taxonomy term.' },
|
|
256
|
+
{ name: 'cols', pattern: '^\\d+$', description: 'Columns.' },
|
|
257
|
+
{ name: 'image', values: ['true', 'false'], description: 'Show image.' },
|
|
258
|
+
],
|
|
259
|
+
example: '[member_cards tax="leadership" cols="3"]',
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: 'member_slideshow',
|
|
263
|
+
source: SHCODER,
|
|
264
|
+
description: 'Member slideshow. Only in apps that merge their own shcoder member handlers.',
|
|
265
|
+
status: 'optional-app',
|
|
266
|
+
attrs: [
|
|
267
|
+
{ name: 'category', description: 'Category.' },
|
|
268
|
+
{ name: 'interval', pattern: '^\\d+$', description: 'Milliseconds between slides.' },
|
|
269
|
+
{ name: 'show_bio', values: ['true', 'false'], description: 'Show biography.' },
|
|
270
|
+
],
|
|
271
|
+
example: '[member_slideshow category="leadership" interval="5000"]',
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: 'cf_image_list',
|
|
275
|
+
source: 'cf-render-paginated-image-galery (WordPress plugin)',
|
|
276
|
+
description: 'PHP shortcode rendered by WordPress only. The React frontend does not render it.',
|
|
277
|
+
status: 'wp-only',
|
|
278
|
+
attrs: [],
|
|
279
|
+
example: '[cf_image_list]',
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: 'eventbrite_next_event',
|
|
283
|
+
source: 'eventbrite-next-event (WordPress plugin)',
|
|
284
|
+
description: 'PHP shortcode rendered by WordPress only. The React frontend does not render it; use [event_card] or [events_cards].',
|
|
285
|
+
status: 'wp-only',
|
|
286
|
+
attrs: [],
|
|
287
|
+
example: '[eventbrite_next_event]',
|
|
288
|
+
},
|
|
289
|
+
];
|
|
290
|
+
const BY_NAME = new Map(SHORTCODES.map((s) => [s.name, s]));
|
|
291
|
+
export function getShortcode(name) {
|
|
292
|
+
return BY_NAME.get(name);
|
|
293
|
+
}
|
|
294
|
+
const ENTITIES = [
|
|
295
|
+
[/"|"|"|“|”|″|“|”|″/gi, '"'],
|
|
296
|
+
[/‘|’|'|'|‘|’/gi, "'"],
|
|
297
|
+
[/&|&/gi, '&'],
|
|
298
|
+
[/ | /gi, ' '],
|
|
299
|
+
];
|
|
300
|
+
/** Decode the few entities WordPress produces inside shortcode attributes. */
|
|
301
|
+
export function decodeEntities(text) {
|
|
302
|
+
return ENTITIES.reduce((acc, [re, to]) => acc.replace(re, to), text);
|
|
303
|
+
}
|
|
304
|
+
const SHORTCODE_RE = /\[([a-z][a-z0-9_-]*)((?:\s+[\w-]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s\]"']+))*)\s*\]/gi;
|
|
305
|
+
const ATTR_RE = /([\w-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s\]"']+))/g;
|
|
306
|
+
/** Find [name attr="value"] tokens in text (HTML tags are stripped first). Closing tags are ignored. */
|
|
307
|
+
export function findShortcodes(html) {
|
|
308
|
+
const text = decodeEntities(html.replace(/<[^>]+>/g, ''));
|
|
309
|
+
const found = [];
|
|
310
|
+
for (const match of text.matchAll(SHORTCODE_RE)) {
|
|
311
|
+
const attrs = {};
|
|
312
|
+
for (const a of (match[2] ?? '').matchAll(ATTR_RE)) {
|
|
313
|
+
attrs[a[1]] = a[2] ?? a[3] ?? a[4] ?? '';
|
|
314
|
+
}
|
|
315
|
+
found.push({ name: match[1], attrs, raw: match[0] });
|
|
316
|
+
}
|
|
317
|
+
return found;
|
|
318
|
+
}
|
|
319
|
+
/** Check one parsed shortcode against the catalogue. */
|
|
320
|
+
export function checkShortcode(sc) {
|
|
321
|
+
const def = getShortcode(sc.name);
|
|
322
|
+
if (!def) {
|
|
323
|
+
return [
|
|
324
|
+
{
|
|
325
|
+
severity: 'warning',
|
|
326
|
+
code: 'UNKNOWN_SHORTCODE',
|
|
327
|
+
message: `[${sc.name}] is not in the DigiValt shortcode catalogue; it will show as literal text. Use list_shortcodes for supported names.`,
|
|
328
|
+
},
|
|
329
|
+
];
|
|
330
|
+
}
|
|
331
|
+
if (def.status === 'wp-only') {
|
|
332
|
+
return [{ severity: 'error', code: 'SHORTCODE_WP_ONLY', message: `[${sc.name}] ${def.description}` }];
|
|
333
|
+
}
|
|
334
|
+
const issues = [];
|
|
335
|
+
if (def.status === 'optional-app') {
|
|
336
|
+
issues.push({
|
|
337
|
+
severity: 'warning',
|
|
338
|
+
code: 'SHORTCODE_OPTIONAL',
|
|
339
|
+
message: `[${sc.name}] only renders in apps that merge their own shcoder handlers. Check this app before relying on it.`,
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
const known = new Set();
|
|
343
|
+
for (const attr of def.attrs) {
|
|
344
|
+
const names = [attr.name, ...(attr.aliases ?? [])];
|
|
345
|
+
names.forEach((n) => known.add(n));
|
|
346
|
+
const given = names.find((n) => sc.attrs[n] !== undefined);
|
|
347
|
+
if (given === undefined) {
|
|
348
|
+
if (attr.required) {
|
|
349
|
+
issues.push({
|
|
350
|
+
severity: 'error',
|
|
351
|
+
code: 'SHORTCODE_MISSING_ATTR',
|
|
352
|
+
message: `[${sc.name}] requires ${attr.name}="...". Example: ${def.example}`,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
const value = sc.attrs[given];
|
|
358
|
+
if (attr.values && !attr.values.includes(value)) {
|
|
359
|
+
issues.push({
|
|
360
|
+
severity: 'error',
|
|
361
|
+
code: 'SHORTCODE_BAD_VALUE',
|
|
362
|
+
message: `[${sc.name}] ${given}="${value}" is not allowed. Use one of: ${attr.values.join(', ')}.`,
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
else if (attr.pattern && !new RegExp(attr.pattern).test(value)) {
|
|
366
|
+
issues.push({
|
|
367
|
+
severity: 'error',
|
|
368
|
+
code: 'SHORTCODE_BAD_VALUE',
|
|
369
|
+
message: `[${sc.name}] ${given}="${value}" has the wrong format (${attr.description}).`,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
for (const given of Object.keys(sc.attrs)) {
|
|
374
|
+
if (!known.has(given)) {
|
|
375
|
+
issues.push({
|
|
376
|
+
severity: 'warning',
|
|
377
|
+
code: 'SHORTCODE_UNKNOWN_ATTR',
|
|
378
|
+
message: `[${sc.name}] has no documented attribute "${given}"; it may be ignored.`,
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return issues;
|
|
383
|
+
}
|
|
384
|
+
//# sourceMappingURL=shortcodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortcodes.js","sourceRoot":"","sources":["../../src/catalogue/shortcodes.ts"],"names":[],"mappings":"AAiCA,MAAM,CAAC,MAAM,2BAA2B,GAAG,YAAY,CAAC;AAExD,MAAM,IAAI,GAAG,wBAAwB,CAAC;AACtC,MAAM,OAAO,GAAG,kBAAkB,CAAC;AAEnC,MAAM,CAAC,MAAM,UAAU,GAAmB;IACxC;QACE,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,wCAAwC;QACrD,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE;YACL,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,mDAAmD,EAAE;YAC3H,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,WAAW,EA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AC,KAAK,CAAC,EAAE,CAAC;QAC1C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,IAAI,CAAC;gBACV,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,wBAAwB;gBAC9B,OAAO,EAAE,IAAI,EAAE,CAAC,IAAI,kCAAkC,KAAK,uBAAuB;aACnF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
+
import { AuditLog } from './audit.js';
|
|
4
|
+
import { loadEnvFiles, readConfig } from './config.js';
|
|
5
|
+
import { WpClient } from './wp-client.js';
|
|
6
|
+
import { createServer } from './server.js';
|
|
7
|
+
import { PACKAGE_NAME, VERSION } from './version.js';
|
|
8
|
+
const HELP = `${PACKAGE_NAME} ${VERSION}
|
|
9
|
+
|
|
10
|
+
Local MCP server (stdio) for building WordPress pages for a DigiValt frontend.
|
|
11
|
+
|
|
12
|
+
Usage: digivalt-mcp [--cwd <dir>]
|
|
13
|
+
|
|
14
|
+
--cwd <dir> Load .env.local and .env from this directory (default: current directory)
|
|
15
|
+
--version Print the version
|
|
16
|
+
--help Print this help
|
|
17
|
+
|
|
18
|
+
Settings (environment or .env.local):
|
|
19
|
+
VITE_WORDPRESS_API_URL WordPress site URL (or DIGIVALT_MCP_WP_URL)
|
|
20
|
+
DIGIVALT_MCP_WP_USER WordPress user for the MCP
|
|
21
|
+
DIGIVALT_MCP_WP_APP_PASSWORD Application password for that user
|
|
22
|
+
CF_ACCESS_CLIENT_ID / _SECRET Cloudflare Access service token (optional)
|
|
23
|
+
VITE_ENABLED_POST_TYPES Post types the agent may edit
|
|
24
|
+
VITE_STAGING_FRONTEND Staging frontend slug for drafts
|
|
25
|
+
`;
|
|
26
|
+
function main() {
|
|
27
|
+
const args = process.argv.slice(2);
|
|
28
|
+
if (args.includes('--version') || args.includes('-v')) {
|
|
29
|
+
console.log(VERSION);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
33
|
+
console.log(HELP);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const cwdIndex = args.indexOf('--cwd');
|
|
37
|
+
const dir = cwdIndex >= 0 && args[cwdIndex + 1] ? args[cwdIndex + 1] : process.cwd();
|
|
38
|
+
// stdout carries the protocol: log to stderr only.
|
|
39
|
+
const loaded = loadEnvFiles(dir);
|
|
40
|
+
const config = readConfig();
|
|
41
|
+
for (const file of loaded)
|
|
42
|
+
console.error(`[digivalt-mcp] loaded ${file}`);
|
|
43
|
+
for (const p of config.problems)
|
|
44
|
+
console.error(`[digivalt-mcp] problem: ${p}`);
|
|
45
|
+
for (const n of config.notices)
|
|
46
|
+
console.error(`[digivalt-mcp] note: ${n}`);
|
|
47
|
+
const server = createServer(config, new WpClient(config), { audit: AuditLog.forDir(dir, config.wpUser), appDir: dir });
|
|
48
|
+
server
|
|
49
|
+
.connect(new StdioServerTransport())
|
|
50
|
+
.then(() => console.error(`[digivalt-mcp] ${VERSION} ready`))
|
|
51
|
+
.catch((e) => {
|
|
52
|
+
console.error('[digivalt-mcp] failed to start:', e);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
main();
|
|
57
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY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CAAC,QAAQ;QAAE,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;IAC/E,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;IAE3E,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IACvH,MAAM;SACH,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC;SACnC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,OAAO,QAAQ,CAAC,CAAC;SAC5D,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;QACpB,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface Config {
|
|
2
|
+
/** WordPress site root (no trailing slash, no /wp-json). */
|
|
3
|
+
wpUrl: string | null;
|
|
4
|
+
wpUser: string | null;
|
|
5
|
+
wpPassword: string | null;
|
|
6
|
+
/** Which credentials were found: the dedicated MCP user, the app's Gravity Forms user, or none. */
|
|
7
|
+
credentialSource: 'mcp' | 'app' | 'none';
|
|
8
|
+
cfClientId: string | null;
|
|
9
|
+
cfClientSecret: string | null;
|
|
10
|
+
/** How requests get through Cloudflare Access: a service token, or nothing (IP bypass / WARP). */
|
|
11
|
+
accessMode: 'service-token' | 'none';
|
|
12
|
+
/** Post types from VITE_ENABLED_POST_TYPES (pseudo-types removed); always includes page. */
|
|
13
|
+
enabledPostTypes: string[];
|
|
14
|
+
/** Staging frontend slug (VITE_STAGING_FRONTEND). New drafts are pinned to it. */
|
|
15
|
+
stagingFrontend: string | null;
|
|
16
|
+
frontendId: string | null;
|
|
17
|
+
/** Extra block names the app's registry renders beyond the DigiValt defaults. */
|
|
18
|
+
extraBlocks: string[];
|
|
19
|
+
/** Optional publisher credential, used only by promote/publish/rollback. Absent: those tools are not offered. */
|
|
20
|
+
publishUser: string | null;
|
|
21
|
+
publishPassword: string | null;
|
|
22
|
+
/** When true, publishing needs a client that can prompt the person (no approval-code fallback). */
|
|
23
|
+
requireElicitation: boolean;
|
|
24
|
+
/** Write budget: at most `max` writes per `windowMs`. */
|
|
25
|
+
writeLimit: {
|
|
26
|
+
max: number;
|
|
27
|
+
windowMs: number;
|
|
28
|
+
};
|
|
29
|
+
/** Blocking configuration problems. */
|
|
30
|
+
problems: string[];
|
|
31
|
+
/** Non-blocking remarks. */
|
|
32
|
+
notices: string[];
|
|
33
|
+
}
|
|
34
|
+
type Env = Record<string, string | undefined>;
|
|
35
|
+
/** Accepts the site root or a /wp-json URL; returns the site root. */
|
|
36
|
+
export declare function normalizeWpUrl(raw: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Load .env.local then .env from a directory into process.env.
|
|
39
|
+
* Existing variables win (shell > .env.local > .env).
|
|
40
|
+
*/
|
|
41
|
+
export declare function loadEnvFiles(dir: string): string[];
|
|
42
|
+
export declare function readConfig(env?: Env): Config;
|
|
43
|
+
export {};
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
function first(env, ...names) {
|
|
4
|
+
for (const name of names) {
|
|
5
|
+
const value = env[name]?.trim();
|
|
6
|
+
if (value)
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
function list(value) {
|
|
12
|
+
if (!value)
|
|
13
|
+
return [];
|
|
14
|
+
return [...new Set(value.split(/[\s,]+/).map((v) => v.trim()).filter(Boolean))];
|
|
15
|
+
}
|
|
16
|
+
/** Pseudo post types the app understands that are not WordPress post types. */
|
|
17
|
+
const PSEUDO_POST_TYPES = new Set(['google_reviews']);
|
|
18
|
+
/** Accepts the site root or a /wp-json URL; returns the site root. */
|
|
19
|
+
export function normalizeWpUrl(raw) {
|
|
20
|
+
const url = new URL(raw.trim());
|
|
21
|
+
const path = url.pathname.replace(/\/wp-json(\/.*)?$/, '').replace(/\/+$/, '');
|
|
22
|
+
return `${url.origin}${path}`;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Load .env.local then .env from a directory into process.env.
|
|
26
|
+
* Existing variables win (shell > .env.local > .env).
|
|
27
|
+
*/
|
|
28
|
+
export function loadEnvFiles(dir) {
|
|
29
|
+
const loaded = [];
|
|
30
|
+
for (const name of ['.env.local', '.env']) {
|
|
31
|
+
const file = join(dir, name);
|
|
32
|
+
if (!existsSync(file))
|
|
33
|
+
continue;
|
|
34
|
+
try {
|
|
35
|
+
process.loadEnvFile(file);
|
|
36
|
+
loaded.push(file);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// unreadable file: readConfig reports what is missing
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return loaded;
|
|
43
|
+
}
|
|
44
|
+
export function readConfig(env = process.env) {
|
|
45
|
+
const problems = [];
|
|
46
|
+
const notices = [];
|
|
47
|
+
let wpUrl = null;
|
|
48
|
+
const rawUrl = first(env, 'DIGIVALT_MCP_WP_URL', 'WORDPRESS_API_URL', 'VITE_WORDPRESS_API_URL');
|
|
49
|
+
if (!rawUrl) {
|
|
50
|
+
problems.push('WordPress URL missing: set VITE_WORDPRESS_API_URL (or DIGIVALT_MCP_WP_URL).');
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
try {
|
|
54
|
+
wpUrl = normalizeWpUrl(rawUrl);
|
|
55
|
+
const parsed = new URL(wpUrl);
|
|
56
|
+
if (parsed.protocol !== 'https:' && !['localhost', '127.0.0.1', '[::1]'].includes(parsed.hostname)) {
|
|
57
|
+
problems.push('WordPress URL must use https (credentials are sent with every request).');
|
|
58
|
+
wpUrl = null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
problems.push(`WordPress URL is not a valid URL: ${rawUrl}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
let wpUser = first(env, 'DIGIVALT_MCP_WP_USER');
|
|
66
|
+
let wpPassword = first(env, 'DIGIVALT_MCP_WP_APP_PASSWORD');
|
|
67
|
+
let credentialSource = 'mcp';
|
|
68
|
+
if (!wpUser || !wpPassword) {
|
|
69
|
+
wpUser = first(env, 'WP_API_USERNAME', 'VITE_WP_API_USERNAME');
|
|
70
|
+
wpPassword = first(env, 'WP_APP_PASSWORD', 'VITE_WP_APP_PASSWORD');
|
|
71
|
+
credentialSource = wpUser && wpPassword ? 'app' : 'none';
|
|
72
|
+
if (credentialSource === 'app') {
|
|
73
|
+
notices.push('Using the app WordPress credentials. Create a dedicated user for the MCP and set DIGIVALT_MCP_WP_USER / DIGIVALT_MCP_WP_APP_PASSWORD.');
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
wpUser = null;
|
|
77
|
+
wpPassword = null;
|
|
78
|
+
problems.push('WordPress credentials missing: set DIGIVALT_MCP_WP_USER and DIGIVALT_MCP_WP_APP_PASSWORD.');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const cfClientId = first(env, 'CF_ACCESS_CLIENT_ID', 'VITE_CF_ACCESS_CLIENT_ID');
|
|
82
|
+
const cfClientSecret = first(env, 'CF_ACCESS_CLIENT_SECRET', 'VITE_CF_ACCESS_CLIENT_SECRET');
|
|
83
|
+
let accessMode = 'none';
|
|
84
|
+
if (cfClientId && cfClientSecret) {
|
|
85
|
+
accessMode = 'service-token';
|
|
86
|
+
}
|
|
87
|
+
else if (cfClientId || cfClientSecret) {
|
|
88
|
+
problems.push('Cloudflare Access needs both CF_ACCESS_CLIENT_ID and CF_ACCESS_CLIENT_SECRET.');
|
|
89
|
+
}
|
|
90
|
+
const types = list(first(env, 'VITE_ENABLED_POST_TYPES')).filter((t) => !PSEUDO_POST_TYPES.has(t));
|
|
91
|
+
const enabledPostTypes = [...new Set(['page', ...types])];
|
|
92
|
+
const stagingFrontend = first(env, 'VITE_STAGING_FRONTEND', 'DIGIVALT_STAGING_FRONTEND');
|
|
93
|
+
const frontendId = first(env, 'VITE_FRONTEND_ID', 'FRONTEND_ID');
|
|
94
|
+
if (!stagingFrontend) {
|
|
95
|
+
notices.push('VITE_STAGING_FRONTEND is not set: the MCP cannot pin drafts to a staging frontend.');
|
|
96
|
+
}
|
|
97
|
+
else if (frontendId && frontendId !== stagingFrontend) {
|
|
98
|
+
notices.push(`VITE_FRONTEND_ID ("${frontendId}") differs from VITE_STAGING_FRONTEND ("${stagingFrontend}").`);
|
|
99
|
+
}
|
|
100
|
+
let publishUser = first(env, 'DIGIVALT_MCP_PUBLISH_USER');
|
|
101
|
+
let publishPassword = first(env, 'DIGIVALT_MCP_PUBLISH_APP_PASSWORD');
|
|
102
|
+
if (Boolean(publishUser) !== Boolean(publishPassword)) {
|
|
103
|
+
notices.push('Publishing disabled: it needs both DIGIVALT_MCP_PUBLISH_USER and DIGIVALT_MCP_PUBLISH_APP_PASSWORD.');
|
|
104
|
+
publishUser = null;
|
|
105
|
+
publishPassword = null;
|
|
106
|
+
}
|
|
107
|
+
else if (publishUser && publishUser === wpUser) {
|
|
108
|
+
notices.push('DIGIVALT_MCP_PUBLISH_USER equals the agent user: use a separate WordPress user so the agent user cannot publish.');
|
|
109
|
+
}
|
|
110
|
+
const limitRaw = Number.parseInt(first(env, 'DIGIVALT_MCP_WRITE_LIMIT') ?? '', 10);
|
|
111
|
+
return {
|
|
112
|
+
wpUrl,
|
|
113
|
+
wpUser,
|
|
114
|
+
wpPassword,
|
|
115
|
+
credentialSource,
|
|
116
|
+
cfClientId,
|
|
117
|
+
cfClientSecret,
|
|
118
|
+
accessMode,
|
|
119
|
+
enabledPostTypes,
|
|
120
|
+
stagingFrontend,
|
|
121
|
+
frontendId,
|
|
122
|
+
extraBlocks: list(first(env, 'DIGIVALT_MCP_EXTRA_BLOCKS')),
|
|
123
|
+
publishUser,
|
|
124
|
+
publishPassword,
|
|
125
|
+
requireElicitation: /^(1|true|yes)$/i.test(first(env, 'DIGIVALT_MCP_REQUIRE_ELICITATION') ?? ''),
|
|
126
|
+
writeLimit: { max: Number.isFinite(limitRaw) && limitRaw > 0 ? limitRaw : 60, windowMs: 10 * 60_000 },
|
|
127
|
+
problems,
|
|
128
|
+
notices,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAmCjC,SAAS,KAAK,CAAC,GAAQ,EAAE,GAAG,KAAe;IACzC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;QAChC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,IAAI,CAAC,KAAoB;IAChC,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,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