claude-plugin-wordpress-manager 2.1.0 → 2.2.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/.claude-plugin/plugin.json +2 -2
- package/CHANGELOG.md +30 -0
- package/agents/wp-content-strategist.md +30 -0
- package/agents/wp-monitoring-agent.md +50 -0
- package/docs/GUIDE.md +249 -15
- package/docs/plans/2026-02-28-wcop-strategic-assessment.md +220 -0
- package/hooks/hooks.json +9 -0
- package/package.json +6 -3
- package/servers/wp-rest-bridge/build/tools/index.d.ts +119 -0
- package/servers/wp-rest-bridge/build/tools/index.js +3 -0
- package/servers/wp-rest-bridge/build/tools/wc-webhooks.d.ts +129 -0
- package/servers/wp-rest-bridge/build/tools/wc-webhooks.js +142 -0
- package/servers/wp-rest-bridge/build/types.d.ts +12 -0
- package/skills/wordpress-router/references/decision-tree.md +7 -3
- package/skills/wp-content/SKILL.md +3 -0
- package/skills/wp-content-repurposing/SKILL.md +96 -0
- package/skills/wp-content-repurposing/references/content-atomization.md +117 -0
- package/skills/wp-content-repurposing/references/email-newsletter.md +136 -0
- package/skills/wp-content-repurposing/references/platform-specs.md +80 -0
- package/skills/wp-content-repurposing/references/social-formats.md +169 -0
- package/skills/wp-content-repurposing/scripts/repurposing_inspect.mjs +140 -0
- package/skills/wp-headless/SKILL.md +1 -0
- package/skills/wp-monitoring/SKILL.md +12 -2
- package/skills/wp-monitoring/references/fleet-monitoring.md +160 -0
- package/skills/wp-monitoring/scripts/monitoring_inspect.mjs +54 -1
- package/skills/wp-webhooks/SKILL.md +107 -0
- package/skills/wp-webhooks/references/integration-recipes.md +176 -0
- package/skills/wp-webhooks/references/payload-formats.md +134 -0
- package/skills/wp-webhooks/references/webhook-security.md +147 -0
- package/skills/wp-webhooks/references/woocommerce-webhooks.md +129 -0
- package/skills/wp-webhooks/references/wordpress-core-webhooks.md +162 -0
- package/skills/wp-webhooks/scripts/webhook_inspect.mjs +157 -0
- package/skills/wp-woocommerce/SKILL.md +1 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# WordPress Manager — Assessment Strategico WCOP
|
|
2
|
+
|
|
3
|
+
> **WordPress Content Orchestration Platform (WCOP)**
|
|
4
|
+
> Valutazione del plugin v2.1.1 come piattaforma di orchestrazione per content management distribuito a supporto di strategie SEO, engagement e social amplification.
|
|
5
|
+
|
|
6
|
+
**Data:** 2026-02-28
|
|
7
|
+
**Versione plugin:** 2.1.1
|
|
8
|
+
**Scope:** Alto livello strategico — nessuna implementazione
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. Modello di Riferimento: WCOP a 5 Layer
|
|
13
|
+
|
|
14
|
+
Il plugin v2.1.1 va valutato non come "gestore di siti WordPress" ma come **piattaforma di orchestrazione contenuti** strutturata su 5 livelli:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
Layer 5 ─ Automation CI/CD pipeline, webhook, trigger
|
|
18
|
+
Layer 4 ─ Observability Monitoring, baseline, alerting
|
|
19
|
+
Layer 3 ─ Distribution Headless, syndication, social, email
|
|
20
|
+
Layer 2 ─ Quality Assur. Testing, security, accessibility, PHPStan
|
|
21
|
+
Layer 1 ─ Content Factory Multisite, WooCommerce, REST API, block dev
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Punteggi per Layer
|
|
25
|
+
|
|
26
|
+
| Layer | Copertura | Score | Note |
|
|
27
|
+
|-------|-----------|-------|------|
|
|
28
|
+
| 1 — Content Factory | Eccellente | **9/10** | 81 tool MCP, 28 skill, multisite, WooCommerce, headless skill |
|
|
29
|
+
| 2 — Quality Assurance | Forte | **8/10** | E2E + PHPStan + security audit + a11y + hardening |
|
|
30
|
+
| 3 — Distribution | **Debole** | **4/10** | Solo headless skill teorico, nessun connettore outbound reale |
|
|
31
|
+
| 4 — Observability | Parziale | **5/10** | Monitoring single-site, manca fleet monitoring cross-site |
|
|
32
|
+
| 5 — Automation | Parziale | **4/10** | CI/CD per codice, non per contenuto; manca webhook propagation |
|
|
33
|
+
|
|
34
|
+
**Score complessivo: 6/10** — Il plugin e forte **centripetalmente** (portare contenuto DENTRO WordPress) ma debole **centrifugalmente** (distribuire contenuto FUORI DA WordPress).
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 2. Hub Content Architecture
|
|
39
|
+
|
|
40
|
+
Il plugin ha la base per un modello **Hub-and-Spoke**:
|
|
41
|
+
|
|
42
|
+
- **Hub**: WordPress Multisite (10 tool MCP) come sorgente canonica
|
|
43
|
+
- **Spoke**: Frontend headless via `wp-headless` skill (REST/WPGraphQL -> Next.js/Nuxt/Astro)
|
|
44
|
+
- **Commerce layer**: WooCommerce (30 tool MCP) come transazione integrata
|
|
45
|
+
|
|
46
|
+
**Punto di forza**: L'orchestrazione `wp-site-manager` -> delegazione a 10 agent specializzati e un pattern raro nel panorama plugin CLI. La catena audit->hardening (`wp-security-auditor` -> `wp-security-hardener`) e la delegazione monitor->specialist (`wp-monitoring-agent` -> performance/security agent) sono differenzianti.
|
|
47
|
+
|
|
48
|
+
**Gap**: L'hub e forte nella creazione ma non nella propagazione. Il contenuto nasce in WordPress e li resta.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 3. SEO Topology
|
|
53
|
+
|
|
54
|
+
| Strategia SEO | Supporto | Dettaglio |
|
|
55
|
+
|---------------|----------|-----------|
|
|
56
|
+
| Pillar-Cluster | ✅ Forte | Content strategist + REST API categories/tags + headless rendering |
|
|
57
|
+
| E-Commerce SEO | ✅ Forte | WooCommerce products + structured data via headless |
|
|
58
|
+
| Programmatic SEO | ⚠️ Parziale | Headless skill copre il pattern, ma manca generazione template scalabile |
|
|
59
|
+
| Local SEO (multi-location) | ⚠️ Parziale | Multisite permette siti per location, manca schema LocalBusiness |
|
|
60
|
+
| Cross-Domain SEO | ❌ Assente | Nessun tool per canonical cross-domain, hreflang fleet, o link graph |
|
|
61
|
+
|
|
62
|
+
**Opportunita chiave**: Programmatic SEO tramite headless + Multisite e a portata di mano. Un sito multisite dove ogni sub-site genera pagine programmatiche (es. "/prodotto/citta/variante") con Next.js ISR sarebbe potente.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 4. Content Syndication
|
|
67
|
+
|
|
68
|
+
| Livello | Descrizione | Supporto |
|
|
69
|
+
|---------|-------------|----------|
|
|
70
|
+
| L1 — Canonical Source | WordPress come sorgente unica di verita | ✅ Eccellente (REST API, WPGraphQL) |
|
|
71
|
+
| L2 — Format Adaptation | Trasformare contenuto per canali diversi | ⚠️ Solo manuale (content strategist) |
|
|
72
|
+
| L3 — Channel Distribution | Pubblicare su social, email, ads, partner | ❌ Assente |
|
|
73
|
+
|
|
74
|
+
Il plugin produce contenuto strutturato di alta qualita (L1) ma non ha pipeline per riformattarlo (L2) ne distribuirlo (L3). Il contenuto "muore" dentro WordPress.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 5. Commerce-Content Integration
|
|
79
|
+
|
|
80
|
+
WooCommerce e ben integrato (30 tool) ma come layer **transazionale**, non come layer **content-driven**:
|
|
81
|
+
|
|
82
|
+
- **Content -> Commerce** ⚠️: Si possono creare prodotti e gestire ordini, ma manca il funnel content->conversion tracking
|
|
83
|
+
- **Commerce -> Content** ⚠️: I dati vendita (report WC) esistono ma non alimentano automaticamente la strategia contenuti
|
|
84
|
+
- **Headless Commerce** ⚠️: `wp-headless` skill copre la teoria ma non c'e un workflow "WooCommerce headless" dedicato
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 6. Social Amplification
|
|
89
|
+
|
|
90
|
+
**Posizione corretta del plugin**: Non deve diventare un social media manager (esistono tool dedicati). Deve essere il **miglior fornitore di contenuto strutturato** per tool di distribuzione esterni.
|
|
91
|
+
|
|
92
|
+
Cio significa: API-first content packaging. WordPress produce JSON strutturato (titolo, excerpt, immagini ottimizzate, categorie, schema markup) che un tool esterno (Buffer, Hootsuite, Zapier) può consumare.
|
|
93
|
+
|
|
94
|
+
**Gap**: Manca un layer di "content packaging for distribution" — endpoint REST dedicati che formattino il contenuto per i vari canali.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 7. Monitoring come Quality Gate + CI/CD come Content Pipeline
|
|
99
|
+
|
|
100
|
+
### Monitoring (Differenziante)
|
|
101
|
+
|
|
102
|
+
Il monitoring v2.1.0 e un **differenziante unico**: nessun altro plugin CLI offre monitoring integrato con delegazione a agent specializzati. La catena:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
wp-monitoring-agent (detect anomaly)
|
|
106
|
+
-> wp-performance-optimizer (if performance issue)
|
|
107
|
+
-> wp-security-auditor (if security issue)
|
|
108
|
+
-> wp-site-manager (if infrastructure issue)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Questo pattern va **esteso a fleet level**: monitorare N siti simultaneamente, aggregare metriche, identificare pattern cross-site.
|
|
112
|
+
|
|
113
|
+
### CI/CD come Content Pipeline (Innovativo)
|
|
114
|
+
|
|
115
|
+
L'insight piu interessante: CI/CD non dovrebbe essere solo per codice ma anche per **contenuto**:
|
|
116
|
+
|
|
117
|
+
- Quality gate su contenuti (SEO score minimo, a11y check, reading level)
|
|
118
|
+
- Preview environment per contenuto (staging -> produzione)
|
|
119
|
+
- Rollback contenuto (versioning via REST API revisions)
|
|
120
|
+
|
|
121
|
+
Il plugin ha gia `wp-cicd-engineer` per codice. Estenderlo a "content pipeline" sarebbe innovativo.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 8. Gap Analysis — Roadmap Strategica
|
|
126
|
+
|
|
127
|
+
### Tier 1 — Alto Impatto, Alta Fattibilita
|
|
128
|
+
|
|
129
|
+
| Gap | Descrizione | Effort | Impatto |
|
|
130
|
+
|-----|-------------|--------|---------|
|
|
131
|
+
| **Fleet Monitoring** | Estendere monitoring a N siti (loop su sites.json) | Medio | Trasforma il plugin da single-site a network operator |
|
|
132
|
+
| **Content Repurposing Skill** | Skill che guida la trasformazione contenuto->formati (social post, email, snippet) | Basso | Sblocca L2 syndication |
|
|
133
|
+
| **Webhook Propagation** | Skill/tool per configurare webhook WordPress -> servizi esterni | Basso | Primo mattone per distribuzione automatica |
|
|
134
|
+
|
|
135
|
+
### Tier 2 — Alto Impatto, Media Fattibilita
|
|
136
|
+
|
|
137
|
+
| Gap | Descrizione | Effort | Impatto |
|
|
138
|
+
|-----|-------------|--------|---------|
|
|
139
|
+
| **Programmatic SEO Skill** | Generazione template pagine scalabili (headless + multisite) | Medio | SEO topology massiva |
|
|
140
|
+
| **Content-Commerce Attribution** | Collegare metriche WooCommerce a contenuti che generano conversioni | Medio | ROI content misurabile |
|
|
141
|
+
| **Multi-Language Network** | Orchestrazione multisite multilingua (hreflang, i18n + multisite) | Alto | Sblocca mercati internazionali |
|
|
142
|
+
|
|
143
|
+
### Tier 3 — Alto Impatto, Richiede Ecosistema
|
|
144
|
+
|
|
145
|
+
| Gap | Descrizione | Effort | Impatto |
|
|
146
|
+
|-----|-------------|--------|---------|
|
|
147
|
+
| **Social/Email Connectors** | MCP tool per Mailchimp, Buffer, etc. (o Zapier bridge) | Alto | L3 distribution completa |
|
|
148
|
+
| **Google Search Console Integration** | MCP tool per GSC API (keyword tracking, indexing) | Medio | SEO feedback loop |
|
|
149
|
+
| **AI Content Optimization** | Skill per ottimizzazione contenuto con AI (headline testing, readability) | Medio | Content quality automatica |
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 9. Modello d'Impiego Massimizzato
|
|
154
|
+
|
|
155
|
+
### Scenario: "Content Hub Distribuito per Brand D2C"
|
|
156
|
+
|
|
157
|
+
Esempio concreto di impiego simultaneo massimale del plugin:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
┌─────────────────────┐
|
|
161
|
+
│ WORDPRESS MULTISITE │
|
|
162
|
+
│ (Hub Centrale) │
|
|
163
|
+
│ wp-site-manager │
|
|
164
|
+
└──────────┬──────────┘
|
|
165
|
+
┌───────────────────┼───────────────────┐
|
|
166
|
+
│ │ │
|
|
167
|
+
┌──────▼──────┐ ┌──────▼──────┐ ┌──────▼──────┐
|
|
168
|
+
│ Sub-site 1 │ │ Sub-site 2 │ │ Sub-site 3 │
|
|
169
|
+
│ Blog/SEO │ │ WooCommerce │ │ Landing │
|
|
170
|
+
│ (content) │ │ (shop) │ │ (campaign) │
|
|
171
|
+
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘
|
|
172
|
+
│ │ │
|
|
173
|
+
┌──────▼──────┐ ┌──────▼──────┐ ┌──────▼──────┐
|
|
174
|
+
│ Next.js │ │ Nuxt.js │ │ Astro │
|
|
175
|
+
│ (headless) │ │ (headless) │ │ (static) │
|
|
176
|
+
└─────────────┘ └─────────────┘ └─────────────┘
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Agent attivi simultaneamente:**
|
|
180
|
+
|
|
181
|
+
1. `wp-content-strategist` — crea contenuto pillar nel sub-site blog
|
|
182
|
+
2. `wp-ecommerce-manager` — gestisce catalogo e promozioni nel sub-site shop
|
|
183
|
+
3. `wp-cicd-engineer` — mantiene pipeline deploy per i 3 frontend headless
|
|
184
|
+
4. `wp-monitoring-agent` — sorveglia uptime e performance di tutti i sub-siti
|
|
185
|
+
5. `wp-security-auditor` + `wp-security-hardener` — ciclo audit/hardening periodico
|
|
186
|
+
6. `wp-test-engineer` — E2E testing sui frontend headless
|
|
187
|
+
7. `wp-accessibility-auditor` — compliance WCAG sui frontend pubblici
|
|
188
|
+
|
|
189
|
+
**Skill attive:**
|
|
190
|
+
|
|
191
|
+
- `wp-multisite` per gestione rete
|
|
192
|
+
- `wp-headless` per configurazione API layer
|
|
193
|
+
- `wp-woocommerce` per store operations
|
|
194
|
+
- `wp-cicd` per pipeline automation
|
|
195
|
+
- `wp-monitoring` per observability
|
|
196
|
+
- `wordpress-router` per orchestrazione decisionale
|
|
197
|
+
|
|
198
|
+
> Questo scenario usa **7 degli 11 agent** e **6 delle 28 skill** simultaneamente.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 10. Conclusione Strategica
|
|
203
|
+
|
|
204
|
+
Il plugin WordPress Manager v2.1.1 e una **piattaforma di orchestrazione contenuti matura al 60%**:
|
|
205
|
+
|
|
206
|
+
- **Eccellente** come Content Factory (Layer 1) e Quality Assurance (Layer 2)
|
|
207
|
+
- **Differenziante** nel pattern monitoring->delegazione e nella copertura agent (11 specializzati)
|
|
208
|
+
- **Carente** nella distribuzione outbound (Layer 3) e nell'automazione contenuto (Layer 5)
|
|
209
|
+
|
|
210
|
+
### La trasformazione da "gestore WordPress" a "Content Orchestration Platform" richiede 3 mosse strategiche:
|
|
211
|
+
|
|
212
|
+
1. **Fleet-first**: Ogni tool e agent deve pensare "N siti", non "1 sito"
|
|
213
|
+
2. **Content-out**: Aggiungere il layer di distribuzione (content packaging -> webhook -> canali)
|
|
214
|
+
3. **Content pipeline**: Estendere CI/CD dal codice al contenuto (quality gates, staging, rollback)
|
|
215
|
+
|
|
216
|
+
Con queste 3 evoluzioni, il plugin passerebbe da **6/10 a 8-9/10** come piattaforma WCOP, posizionandosi come l'unico strumento CLI che copre l'intero ciclo di vita del contenuto WordPress: **creazione -> qualita -> distribuzione -> osservabilita -> automazione**.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
*Assessment WCOP v1.0 — wordpress-manager v2.1.1 — 2026-02-28*
|
package/hooks/hooks.json
CHANGED
|
@@ -51,6 +51,15 @@
|
|
|
51
51
|
"timeout": 15
|
|
52
52
|
}
|
|
53
53
|
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"matcher": "mcp__wp-rest-bridge__wc_delete_webhook",
|
|
57
|
+
"hooks": [
|
|
58
|
+
{
|
|
59
|
+
"type": "prompt",
|
|
60
|
+
"prompt": "The agent is about to DELETE a WooCommerce webhook. This will stop notifications to the configured delivery URL. Verify the user explicitly requested this deletion and understands that external integrations depending on this webhook will stop receiving events."
|
|
61
|
+
}
|
|
62
|
+
]
|
|
54
63
|
}
|
|
55
64
|
]
|
|
56
65
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-plugin-wordpress-manager",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Unified WordPress management and development plugin for Claude Code. Orchestrates Hostinger MCP, WP REST API bridge (
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"description": "Unified WordPress management and development plugin for Claude Code. Orchestrates Hostinger MCP, WP REST API bridge (85 tools incl. 30 WooCommerce + 10 Multisite + 4 Webhooks), and WordPress.com MCP with 30 skills, 11 agents, and security hooks. v2.2.0 adds fleet monitoring, content repurposing skill, and webhook propagation (WooCommerce webhook MCP tools + mu-plugin patterns).",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "vinmor",
|
|
7
7
|
"email": "morreale.v@gmail.com"
|
|
@@ -33,7 +33,10 @@
|
|
|
33
33
|
"gitlab-ci",
|
|
34
34
|
"monitoring",
|
|
35
35
|
"uptime",
|
|
36
|
-
"health-check"
|
|
36
|
+
"health-check",
|
|
37
|
+
"webhook",
|
|
38
|
+
"content-repurposing",
|
|
39
|
+
"fleet-monitoring"
|
|
37
40
|
],
|
|
38
41
|
"repository": {
|
|
39
42
|
"type": "git",
|
|
@@ -1,6 +1,125 @@
|
|
|
1
1
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
export declare const allTools: Tool[];
|
|
3
3
|
export declare const toolHandlers: {
|
|
4
|
+
wc_list_webhooks: (params: import("zod").TypeOf<import("zod").ZodObject<{
|
|
5
|
+
status: import("zod").ZodOptional<import("zod").ZodEnum<["active", "paused", "disabled"]>>;
|
|
6
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
7
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
10
|
+
}>>) => Promise<{
|
|
11
|
+
toolResult: {
|
|
12
|
+
content: {
|
|
13
|
+
type: string;
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
isError?: undefined;
|
|
17
|
+
};
|
|
18
|
+
} | {
|
|
19
|
+
toolResult: {
|
|
20
|
+
isError: boolean;
|
|
21
|
+
content: {
|
|
22
|
+
type: string;
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
27
|
+
wc_create_webhook: (params: import("zod").TypeOf<import("zod").ZodObject<{
|
|
28
|
+
name: import("zod").ZodString;
|
|
29
|
+
topic: import("zod").ZodString;
|
|
30
|
+
delivery_url: import("zod").ZodString;
|
|
31
|
+
secret: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
|
+
status: import("zod").ZodOptional<import("zod").ZodEnum<["active", "paused", "disabled"]>>;
|
|
33
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
34
|
+
name: string;
|
|
35
|
+
topic: string;
|
|
36
|
+
delivery_url: string;
|
|
37
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
38
|
+
secret?: string | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
name: string;
|
|
41
|
+
topic: string;
|
|
42
|
+
delivery_url: string;
|
|
43
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
44
|
+
secret?: string | undefined;
|
|
45
|
+
}>>) => Promise<{
|
|
46
|
+
toolResult: {
|
|
47
|
+
content: {
|
|
48
|
+
type: string;
|
|
49
|
+
text: string;
|
|
50
|
+
}[];
|
|
51
|
+
isError?: undefined;
|
|
52
|
+
};
|
|
53
|
+
} | {
|
|
54
|
+
toolResult: {
|
|
55
|
+
isError: boolean;
|
|
56
|
+
content: {
|
|
57
|
+
type: string;
|
|
58
|
+
text: string;
|
|
59
|
+
}[];
|
|
60
|
+
};
|
|
61
|
+
}>;
|
|
62
|
+
wc_update_webhook: (params: import("zod").TypeOf<import("zod").ZodObject<{
|
|
63
|
+
id: import("zod").ZodNumber;
|
|
64
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
65
|
+
topic: import("zod").ZodOptional<import("zod").ZodString>;
|
|
66
|
+
delivery_url: import("zod").ZodOptional<import("zod").ZodString>;
|
|
67
|
+
secret: import("zod").ZodOptional<import("zod").ZodString>;
|
|
68
|
+
status: import("zod").ZodOptional<import("zod").ZodEnum<["active", "paused", "disabled"]>>;
|
|
69
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
70
|
+
id: number;
|
|
71
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
72
|
+
name?: string | undefined;
|
|
73
|
+
topic?: string | undefined;
|
|
74
|
+
delivery_url?: string | undefined;
|
|
75
|
+
secret?: string | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
id: number;
|
|
78
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
79
|
+
name?: string | undefined;
|
|
80
|
+
topic?: string | undefined;
|
|
81
|
+
delivery_url?: string | undefined;
|
|
82
|
+
secret?: string | undefined;
|
|
83
|
+
}>>) => Promise<{
|
|
84
|
+
toolResult: {
|
|
85
|
+
content: {
|
|
86
|
+
type: string;
|
|
87
|
+
text: string;
|
|
88
|
+
}[];
|
|
89
|
+
isError?: undefined;
|
|
90
|
+
};
|
|
91
|
+
} | {
|
|
92
|
+
toolResult: {
|
|
93
|
+
isError: boolean;
|
|
94
|
+
content: {
|
|
95
|
+
type: string;
|
|
96
|
+
text: string;
|
|
97
|
+
}[];
|
|
98
|
+
};
|
|
99
|
+
}>;
|
|
100
|
+
wc_delete_webhook: (params: import("zod").TypeOf<import("zod").ZodObject<{
|
|
101
|
+
id: import("zod").ZodNumber;
|
|
102
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
103
|
+
id: number;
|
|
104
|
+
}, {
|
|
105
|
+
id: number;
|
|
106
|
+
}>>) => Promise<{
|
|
107
|
+
toolResult: {
|
|
108
|
+
content: {
|
|
109
|
+
type: string;
|
|
110
|
+
text: string;
|
|
111
|
+
}[];
|
|
112
|
+
isError?: undefined;
|
|
113
|
+
};
|
|
114
|
+
} | {
|
|
115
|
+
toolResult: {
|
|
116
|
+
isError: boolean;
|
|
117
|
+
content: {
|
|
118
|
+
type: string;
|
|
119
|
+
text: string;
|
|
120
|
+
}[];
|
|
121
|
+
};
|
|
122
|
+
}>;
|
|
4
123
|
ms_list_network_plugins: (params: import("zod").TypeOf<import("zod").ZodObject<{
|
|
5
124
|
site_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
125
|
}, "strict", import("zod").ZodTypeAny, {
|
|
@@ -14,6 +14,7 @@ import { wcReportTools, wcReportHandlers } from './wc-reports.js';
|
|
|
14
14
|
import { wcSettingTools, wcSettingHandlers } from './wc-settings.js';
|
|
15
15
|
import { multisiteSiteTools, multisiteSiteHandlers } from './multisite-sites.js';
|
|
16
16
|
import { multisiteNetworkTools, multisiteNetworkHandlers } from './multisite-network.js';
|
|
17
|
+
import { wcWebhookTools, wcWebhookHandlers } from './wc-webhooks.js';
|
|
17
18
|
// Combine all tools
|
|
18
19
|
export const allTools = [
|
|
19
20
|
...unifiedContentTools, // 8 tools
|
|
@@ -32,6 +33,7 @@ export const allTools = [
|
|
|
32
33
|
...wcSettingTools, // 4 tools
|
|
33
34
|
...multisiteSiteTools, // 5 tools
|
|
34
35
|
...multisiteNetworkTools, // 5 tools
|
|
36
|
+
...wcWebhookTools, // 4 tools
|
|
35
37
|
];
|
|
36
38
|
// Combine all handlers
|
|
37
39
|
export const toolHandlers = {
|
|
@@ -51,4 +53,5 @@ export const toolHandlers = {
|
|
|
51
53
|
...wcSettingHandlers,
|
|
52
54
|
...multisiteSiteHandlers,
|
|
53
55
|
...multisiteNetworkHandlers,
|
|
56
|
+
...wcWebhookHandlers,
|
|
54
57
|
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
declare const wcListWebhooksSchema: z.ZodObject<{
|
|
4
|
+
status: z.ZodOptional<z.ZodEnum<["active", "paused", "disabled"]>>;
|
|
5
|
+
}, "strict", z.ZodTypeAny, {
|
|
6
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
7
|
+
}, {
|
|
8
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
declare const wcCreateWebhookSchema: z.ZodObject<{
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
topic: z.ZodString;
|
|
13
|
+
delivery_url: z.ZodString;
|
|
14
|
+
secret: z.ZodOptional<z.ZodString>;
|
|
15
|
+
status: z.ZodOptional<z.ZodEnum<["active", "paused", "disabled"]>>;
|
|
16
|
+
}, "strict", z.ZodTypeAny, {
|
|
17
|
+
name: string;
|
|
18
|
+
topic: string;
|
|
19
|
+
delivery_url: string;
|
|
20
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
21
|
+
secret?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
name: string;
|
|
24
|
+
topic: string;
|
|
25
|
+
delivery_url: string;
|
|
26
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
27
|
+
secret?: string | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
declare const wcUpdateWebhookSchema: z.ZodObject<{
|
|
30
|
+
id: z.ZodNumber;
|
|
31
|
+
name: z.ZodOptional<z.ZodString>;
|
|
32
|
+
topic: z.ZodOptional<z.ZodString>;
|
|
33
|
+
delivery_url: z.ZodOptional<z.ZodString>;
|
|
34
|
+
secret: z.ZodOptional<z.ZodString>;
|
|
35
|
+
status: z.ZodOptional<z.ZodEnum<["active", "paused", "disabled"]>>;
|
|
36
|
+
}, "strict", z.ZodTypeAny, {
|
|
37
|
+
id: number;
|
|
38
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
39
|
+
name?: string | undefined;
|
|
40
|
+
topic?: string | undefined;
|
|
41
|
+
delivery_url?: string | undefined;
|
|
42
|
+
secret?: string | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
id: number;
|
|
45
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
46
|
+
name?: string | undefined;
|
|
47
|
+
topic?: string | undefined;
|
|
48
|
+
delivery_url?: string | undefined;
|
|
49
|
+
secret?: string | undefined;
|
|
50
|
+
}>;
|
|
51
|
+
declare const wcDeleteWebhookSchema: z.ZodObject<{
|
|
52
|
+
id: z.ZodNumber;
|
|
53
|
+
}, "strict", z.ZodTypeAny, {
|
|
54
|
+
id: number;
|
|
55
|
+
}, {
|
|
56
|
+
id: number;
|
|
57
|
+
}>;
|
|
58
|
+
export declare const wcWebhookTools: Tool[];
|
|
59
|
+
export declare const wcWebhookHandlers: {
|
|
60
|
+
wc_list_webhooks: (params: z.infer<typeof wcListWebhooksSchema>) => Promise<{
|
|
61
|
+
toolResult: {
|
|
62
|
+
content: {
|
|
63
|
+
type: string;
|
|
64
|
+
text: string;
|
|
65
|
+
}[];
|
|
66
|
+
isError?: undefined;
|
|
67
|
+
};
|
|
68
|
+
} | {
|
|
69
|
+
toolResult: {
|
|
70
|
+
isError: boolean;
|
|
71
|
+
content: {
|
|
72
|
+
type: string;
|
|
73
|
+
text: string;
|
|
74
|
+
}[];
|
|
75
|
+
};
|
|
76
|
+
}>;
|
|
77
|
+
wc_create_webhook: (params: z.infer<typeof wcCreateWebhookSchema>) => Promise<{
|
|
78
|
+
toolResult: {
|
|
79
|
+
content: {
|
|
80
|
+
type: string;
|
|
81
|
+
text: string;
|
|
82
|
+
}[];
|
|
83
|
+
isError?: undefined;
|
|
84
|
+
};
|
|
85
|
+
} | {
|
|
86
|
+
toolResult: {
|
|
87
|
+
isError: boolean;
|
|
88
|
+
content: {
|
|
89
|
+
type: string;
|
|
90
|
+
text: string;
|
|
91
|
+
}[];
|
|
92
|
+
};
|
|
93
|
+
}>;
|
|
94
|
+
wc_update_webhook: (params: z.infer<typeof wcUpdateWebhookSchema>) => Promise<{
|
|
95
|
+
toolResult: {
|
|
96
|
+
content: {
|
|
97
|
+
type: string;
|
|
98
|
+
text: string;
|
|
99
|
+
}[];
|
|
100
|
+
isError?: undefined;
|
|
101
|
+
};
|
|
102
|
+
} | {
|
|
103
|
+
toolResult: {
|
|
104
|
+
isError: boolean;
|
|
105
|
+
content: {
|
|
106
|
+
type: string;
|
|
107
|
+
text: string;
|
|
108
|
+
}[];
|
|
109
|
+
};
|
|
110
|
+
}>;
|
|
111
|
+
wc_delete_webhook: (params: z.infer<typeof wcDeleteWebhookSchema>) => Promise<{
|
|
112
|
+
toolResult: {
|
|
113
|
+
content: {
|
|
114
|
+
type: string;
|
|
115
|
+
text: string;
|
|
116
|
+
}[];
|
|
117
|
+
isError?: undefined;
|
|
118
|
+
};
|
|
119
|
+
} | {
|
|
120
|
+
toolResult: {
|
|
121
|
+
isError: boolean;
|
|
122
|
+
content: {
|
|
123
|
+
type: string;
|
|
124
|
+
text: string;
|
|
125
|
+
}[];
|
|
126
|
+
};
|
|
127
|
+
}>;
|
|
128
|
+
};
|
|
129
|
+
export {};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { makeWooCommerceRequest } from '../wordpress.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const wcListWebhooksSchema = z.object({
|
|
4
|
+
status: z.enum(['active', 'paused', 'disabled']).optional()
|
|
5
|
+
.describe('Filter webhooks by status'),
|
|
6
|
+
}).strict();
|
|
7
|
+
const wcCreateWebhookSchema = z.object({
|
|
8
|
+
name: z.string().describe('Webhook name (for identification)'),
|
|
9
|
+
topic: z.string().describe('Event topic, e.g. "order.created", "product.updated"'),
|
|
10
|
+
delivery_url: z.string().describe('URL to receive the webhook payload'),
|
|
11
|
+
secret: z.string().optional().describe('Secret for HMAC-SHA256 signature verification'),
|
|
12
|
+
status: z.enum(['active', 'paused', 'disabled']).optional()
|
|
13
|
+
.describe('Webhook status (default: active)'),
|
|
14
|
+
}).strict();
|
|
15
|
+
const wcUpdateWebhookSchema = z.object({
|
|
16
|
+
id: z.number().describe('Webhook ID to update'),
|
|
17
|
+
name: z.string().optional().describe('Updated webhook name'),
|
|
18
|
+
topic: z.string().optional().describe('Updated event topic'),
|
|
19
|
+
delivery_url: z.string().optional().describe('Updated delivery URL'),
|
|
20
|
+
secret: z.string().optional().describe('Updated secret'),
|
|
21
|
+
status: z.enum(['active', 'paused', 'disabled']).optional()
|
|
22
|
+
.describe('Updated webhook status'),
|
|
23
|
+
}).strict();
|
|
24
|
+
const wcDeleteWebhookSchema = z.object({
|
|
25
|
+
id: z.number().describe('Webhook ID to delete'),
|
|
26
|
+
}).strict();
|
|
27
|
+
export const wcWebhookTools = [
|
|
28
|
+
{
|
|
29
|
+
name: "wc_list_webhooks",
|
|
30
|
+
description: "Lists all WooCommerce webhooks with their status, topic, and delivery URL",
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: {
|
|
34
|
+
status: {
|
|
35
|
+
type: "string",
|
|
36
|
+
enum: ["active", "paused", "disabled"],
|
|
37
|
+
description: "Filter webhooks by status",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "wc_create_webhook",
|
|
44
|
+
description: "Creates a new WooCommerce webhook for event notifications (e.g. order.created, product.updated)",
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
name: { type: "string", description: "Webhook name (for identification)" },
|
|
49
|
+
topic: { type: "string", description: "Event topic, e.g. 'order.created', 'product.updated'" },
|
|
50
|
+
delivery_url: { type: "string", description: "URL to receive the webhook payload" },
|
|
51
|
+
secret: { type: "string", description: "Secret for HMAC-SHA256 signature verification" },
|
|
52
|
+
status: {
|
|
53
|
+
type: "string",
|
|
54
|
+
enum: ["active", "paused", "disabled"],
|
|
55
|
+
description: "Webhook status (default: active)",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
required: ["name", "topic", "delivery_url"],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "wc_update_webhook",
|
|
63
|
+
description: "Updates an existing WooCommerce webhook (status, delivery URL, topic, etc.)",
|
|
64
|
+
inputSchema: {
|
|
65
|
+
type: "object",
|
|
66
|
+
properties: {
|
|
67
|
+
id: { type: "number", description: "Webhook ID to update" },
|
|
68
|
+
name: { type: "string", description: "Updated webhook name" },
|
|
69
|
+
topic: { type: "string", description: "Updated event topic" },
|
|
70
|
+
delivery_url: { type: "string", description: "Updated delivery URL" },
|
|
71
|
+
secret: { type: "string", description: "Updated secret" },
|
|
72
|
+
status: {
|
|
73
|
+
type: "string",
|
|
74
|
+
enum: ["active", "paused", "disabled"],
|
|
75
|
+
description: "Updated webhook status",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
required: ["id"],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "wc_delete_webhook",
|
|
83
|
+
description: "Deletes a WooCommerce webhook (stops notifications to the delivery URL)",
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: "object",
|
|
86
|
+
properties: {
|
|
87
|
+
id: { type: "number", description: "Webhook ID to delete" },
|
|
88
|
+
},
|
|
89
|
+
required: ["id"],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
export const wcWebhookHandlers = {
|
|
94
|
+
wc_list_webhooks: async (params) => {
|
|
95
|
+
try {
|
|
96
|
+
const query = params.status ? `?status=${params.status}` : '';
|
|
97
|
+
const response = await makeWooCommerceRequest("GET", `webhooks${query}`);
|
|
98
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] } };
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
102
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error listing webhooks: ${errorMessage}` }] } };
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
wc_create_webhook: async (params) => {
|
|
106
|
+
try {
|
|
107
|
+
const { name, topic, delivery_url, secret, status } = params;
|
|
108
|
+
const body = { name, topic, delivery_url };
|
|
109
|
+
if (secret)
|
|
110
|
+
body.secret = secret;
|
|
111
|
+
if (status)
|
|
112
|
+
body.status = status;
|
|
113
|
+
const response = await makeWooCommerceRequest("POST", "webhooks", body);
|
|
114
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] } };
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
118
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error creating webhook: ${errorMessage}` }] } };
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
wc_update_webhook: async (params) => {
|
|
122
|
+
try {
|
|
123
|
+
const { id, ...updates } = params;
|
|
124
|
+
const response = await makeWooCommerceRequest("PUT", `webhooks/${id}`, updates);
|
|
125
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] } };
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
129
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error updating webhook: ${errorMessage}` }] } };
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
wc_delete_webhook: async (params) => {
|
|
133
|
+
try {
|
|
134
|
+
const response = await makeWooCommerceRequest("DELETE", `webhooks/${params.id}?force=true`);
|
|
135
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] } };
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
139
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error deleting webhook: ${errorMessage}` }] } };
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
};
|