@wplaunchify/ml-mcp-server 1.0.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/LICENSE +22 -0
- package/README.md +220 -0
- package/build/cli.d.ts +2 -0
- package/build/cli.js +52 -0
- package/build/server.d.ts +2 -0
- package/build/server.js +97 -0
- package/build/tools/comments.d.ts +212 -0
- package/build/tools/comments.js +181 -0
- package/build/tools/fluent-affiliate.d.ts +2 -0
- package/build/tools/fluent-affiliate.js +3 -0
- package/build/tools/fluent-cart.d.ts +706 -0
- package/build/tools/fluent-cart.js +642 -0
- package/build/tools/fluent-community-BACKUP.d.ts +364 -0
- package/build/tools/fluent-community-BACKUP.js +883 -0
- package/build/tools/fluent-community-MINIMAL.d.ts +69 -0
- package/build/tools/fluent-community-MINIMAL.js +92 -0
- package/build/tools/fluent-community-design.d.ts +3 -0
- package/build/tools/fluent-community-design.js +150 -0
- package/build/tools/fluent-community-layout.d.ts +119 -0
- package/build/tools/fluent-community-layout.js +88 -0
- package/build/tools/fluent-community.d.ts +364 -0
- package/build/tools/fluent-community.js +528 -0
- package/build/tools/fluent-crm.d.ts +3 -0
- package/build/tools/fluent-crm.js +392 -0
- package/build/tools/index.d.ts +2205 -0
- package/build/tools/index.js +54 -0
- package/build/tools/media.d.ts +135 -0
- package/build/tools/media.js +168 -0
- package/build/tools/ml-canvas.d.ts +91 -0
- package/build/tools/ml-canvas.js +109 -0
- package/build/tools/ml-image-editor.d.ts +230 -0
- package/build/tools/ml-image-editor.js +270 -0
- package/build/tools/ml-media-hub.d.ts +575 -0
- package/build/tools/ml-media-hub.js +714 -0
- package/build/tools/plugin-repository.d.ts +62 -0
- package/build/tools/plugin-repository.js +149 -0
- package/build/tools/plugins.d.ts +129 -0
- package/build/tools/plugins.js +148 -0
- package/build/tools/unified-content.d.ts +313 -0
- package/build/tools/unified-content.js +615 -0
- package/build/tools/unified-taxonomies.d.ts +229 -0
- package/build/tools/unified-taxonomies.js +479 -0
- package/build/tools/users.d.ts +227 -0
- package/build/tools/users.js +182 -0
- package/build/types/wordpress-types.d.ts +151 -0
- package/build/types/wordpress-types.js +2 -0
- package/build/wordpress.d.ts +26 -0
- package/build/wordpress.js +223 -0
- package/package.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 1WD LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# ML MCP Server
|
|
2
|
+
|
|
3
|
+
**Universal Model Context Protocol (MCP) Server for WordPress and Fluent Suite**
|
|
4
|
+
|
|
5
|
+
Connect AI assistants like Claude and Cursor directly to your WordPress site with 145 powerful tools for managing content, e-commerce, CRM, community, and more.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🚀 Features
|
|
10
|
+
|
|
11
|
+
### **WordPress Core (37 tools)**
|
|
12
|
+
- Content management (posts, pages, custom post types)
|
|
13
|
+
- Taxonomy management (categories, tags, custom taxonomies)
|
|
14
|
+
- User management
|
|
15
|
+
- Media library
|
|
16
|
+
- Comments
|
|
17
|
+
- Plugin management
|
|
18
|
+
|
|
19
|
+
### **Fluent Suite (79 tools)**
|
|
20
|
+
- **FluentCommunity** (29 tools) - Spaces, posts, members, design, layout
|
|
21
|
+
- **FluentCart** (31 tools) - Products, orders, customers, subscriptions, coupons
|
|
22
|
+
- **FluentCRM** (19 tools) - Contacts, lists, campaigns, tags
|
|
23
|
+
|
|
24
|
+
### **MinuteLaunch Plugins (29 tools)**
|
|
25
|
+
- **ML Canvas Block** (3 tools) - Surgical HTML editing
|
|
26
|
+
- **ML Image Editor** (8 tools) - AI image generation and editing
|
|
27
|
+
- **ML Media Hub** (18 tools) - Google Images search, Noun Project icons, advanced filters
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 📦 Installation
|
|
32
|
+
|
|
33
|
+
### **Prerequisites**
|
|
34
|
+
- Node.js 18 or higher
|
|
35
|
+
- WordPress site with one of the following plugins:
|
|
36
|
+
- `ml-mcp` (MinuteLaunch - full feature set)
|
|
37
|
+
- `fluent-mcp` (FluentMCP - Community/Cart/CRM only)
|
|
38
|
+
|
|
39
|
+
### **Install via npx (Recommended)**
|
|
40
|
+
|
|
41
|
+
Add to your MCP client configuration (e.g., Cursor's `mcp.json`):
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"wordpress": {
|
|
47
|
+
"command": "npx",
|
|
48
|
+
"args": ["-y", "@wplaunchify/ml-mcp-server"],
|
|
49
|
+
"env": {
|
|
50
|
+
"WORDPRESS_API_URL": "https://your-site.com",
|
|
51
|
+
"WORDPRESS_USERNAME": "your-username",
|
|
52
|
+
"WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### **Install Globally**
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm install -g @wplaunchify/ml-mcp-server
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 🔧 Configuration
|
|
68
|
+
|
|
69
|
+
### **1. WordPress Application Password**
|
|
70
|
+
|
|
71
|
+
1. Go to **WordPress Admin → Users → Profile**
|
|
72
|
+
2. Scroll to **Application Passwords**
|
|
73
|
+
3. Enter name: "MCP Server"
|
|
74
|
+
4. Click **Add New Application Password**
|
|
75
|
+
5. Copy the generated password (format: `xxxx xxxx xxxx xxxx xxxx xxxx`)
|
|
76
|
+
|
|
77
|
+
### **2. Environment Variables**
|
|
78
|
+
|
|
79
|
+
Create a `.env` file or set in your MCP client config:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
WORDPRESS_API_URL=https://your-site.com
|
|
83
|
+
WORDPRESS_USERNAME=your-username
|
|
84
|
+
WORDPRESS_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### **3. WordPress Plugin**
|
|
88
|
+
|
|
89
|
+
Install one of these plugins on your WordPress site:
|
|
90
|
+
|
|
91
|
+
- **ml-mcp.php** - Full feature set (MinuteLaunch subscribers)
|
|
92
|
+
- **fluent-mcp.php** - Core features only (FluentMCP customers)
|
|
93
|
+
|
|
94
|
+
The plugin exposes REST API endpoints that the MCP server connects to.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 🛠️ Development
|
|
99
|
+
|
|
100
|
+
### **Build from Source**
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
git clone https://github.com/wplaunchify/ml-mcp-server.git
|
|
104
|
+
cd ml-mcp-server
|
|
105
|
+
npm install
|
|
106
|
+
npm run build
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### **Run in Development Mode**
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npm run dev
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### **Run Tests**
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm test
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 📖 Usage Examples
|
|
124
|
+
|
|
125
|
+
### **Create a FluentCommunity Post**
|
|
126
|
+
|
|
127
|
+
```javascript
|
|
128
|
+
// AI assistant can now do this:
|
|
129
|
+
"Create a post in the General space titled 'Welcome' with content 'Hello everyone!'"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### **Manage FluentCart Products**
|
|
133
|
+
|
|
134
|
+
```javascript
|
|
135
|
+
// AI assistant can now do this:
|
|
136
|
+
"List all products, then update the price of 'Premium Plan' to $99"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### **Search and Import Images**
|
|
140
|
+
|
|
141
|
+
```javascript
|
|
142
|
+
// AI assistant can now do this:
|
|
143
|
+
"Search Google Images for 'sunset beach' with large size and creative commons license, then import the first result"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 🏗️ Architecture
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
AI Assistant (Claude/Cursor)
|
|
152
|
+
↓
|
|
153
|
+
MCP Server (this package)
|
|
154
|
+
↓
|
|
155
|
+
WordPress REST API
|
|
156
|
+
↓
|
|
157
|
+
WordPress Plugin (ml-mcp or fluent-mcp)
|
|
158
|
+
↓
|
|
159
|
+
WordPress Site + Fluent Plugins
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The MCP server acts as a bridge, translating AI requests into WordPress REST API calls.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 📋 Tool Categories
|
|
167
|
+
|
|
168
|
+
| Category | Tools | Description |
|
|
169
|
+
|----------|-------|-------------|
|
|
170
|
+
| **Content** | 8 | Posts, pages, custom post types |
|
|
171
|
+
| **Taxonomies** | 8 | Categories, tags, custom taxonomies |
|
|
172
|
+
| **Users** | 5 | User management and roles |
|
|
173
|
+
| **Media** | 4 | Media library management |
|
|
174
|
+
| **Comments** | 5 | Comment moderation |
|
|
175
|
+
| **Plugins** | 7 | Plugin management and repository search |
|
|
176
|
+
| **FluentCommunity** | 29 | Social network features |
|
|
177
|
+
| **FluentCart** | 31 | E-commerce management |
|
|
178
|
+
| **FluentCRM** | 19 | Contact and campaign management |
|
|
179
|
+
| **ML Canvas** | 3 | HTML editing |
|
|
180
|
+
| **ML Image Editor** | 8 | AI image generation |
|
|
181
|
+
| **ML Media Hub** | 18 | Image/icon search and import |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 🔐 Security
|
|
186
|
+
|
|
187
|
+
- Uses WordPress Application Passwords (no plain passwords)
|
|
188
|
+
- REST API authentication via HTTP Basic Auth
|
|
189
|
+
- License validation enforced by WordPress plugin
|
|
190
|
+
- No credentials stored in MCP server
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 📄 License
|
|
195
|
+
|
|
196
|
+
MIT License - Copyright (c) 2025 1WD LLC
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 🆘 Support
|
|
201
|
+
|
|
202
|
+
- **Documentation**: [GitHub Wiki](https://github.com/wplaunchify/ml-mcp-server/wiki)
|
|
203
|
+
- **Issues**: [GitHub Issues](https://github.com/wplaunchify/ml-mcp-server/issues)
|
|
204
|
+
- **Website**: [MinuteLaunch.com](https://minutelaunch.com) | [FluentMCP.com](https://fluentmcp.com)
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 🎯 Products
|
|
209
|
+
|
|
210
|
+
This MCP server powers two products:
|
|
211
|
+
|
|
212
|
+
- **MinuteLaunch MCP** - Full feature set with ML plugins (recurring subscription)
|
|
213
|
+
- **FluentMCP** - Core WordPress + Fluent Suite only (one-time purchase)
|
|
214
|
+
|
|
215
|
+
Both use the same MCP server - the WordPress plugin determines which features are available.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
**Built with ❤️ by 1WD LLC**
|
|
220
|
+
|
package/build/cli.d.ts
ADDED
package/build/cli.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// src/cli.ts
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
import { spawn } from 'child_process';
|
|
6
|
+
// Function to check if required environment variables are set
|
|
7
|
+
function checkEnvironmentVariables() {
|
|
8
|
+
const requiredVars = ['WORDPRESS_API_URL', 'WORDPRESS_USERNAME', 'WORDPRESS_APP_PASSWORD'];
|
|
9
|
+
const missingVars = requiredVars.filter(varName => !process.env[varName]);
|
|
10
|
+
if (missingVars.length > 0) {
|
|
11
|
+
console.error(`Missing required environment variables: ${missingVars.join(', ')}`);
|
|
12
|
+
console.error('Please set these variables in your .env file or environment');
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
// Main function to run the MCP server
|
|
17
|
+
async function main() {
|
|
18
|
+
console.log('Starting WordPress MCP Server...');
|
|
19
|
+
// Check for .env file in current directory
|
|
20
|
+
const envPath = path.join(process.cwd(), '.env');
|
|
21
|
+
if (!fs.existsSync(envPath)) {
|
|
22
|
+
console.warn('No .env file found in current directory.');
|
|
23
|
+
console.warn('Make sure your WordPress credentials are set in your environment variables.');
|
|
24
|
+
}
|
|
25
|
+
checkEnvironmentVariables();
|
|
26
|
+
// Start the server
|
|
27
|
+
const serverPath = path.join(__dirname, 'server.js');
|
|
28
|
+
const serverProcess = spawn('node', [serverPath], {
|
|
29
|
+
stdio: 'inherit',
|
|
30
|
+
env: process.env
|
|
31
|
+
});
|
|
32
|
+
// Handle server process events
|
|
33
|
+
serverProcess.on('close', (code) => {
|
|
34
|
+
if (code !== 0) {
|
|
35
|
+
console.error(`Server process exited with code ${code}`);
|
|
36
|
+
process.exit(code || 1);
|
|
37
|
+
}
|
|
38
|
+
process.exit(0);
|
|
39
|
+
});
|
|
40
|
+
// Forward termination signals to the child process
|
|
41
|
+
['SIGINT', 'SIGTERM'].forEach(signal => {
|
|
42
|
+
process.on(signal, () => {
|
|
43
|
+
// Fix: Convert string signal to number for kill method
|
|
44
|
+
serverProcess.kill();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// Run the main function
|
|
49
|
+
main().catch(error => {
|
|
50
|
+
console.error('Failed to start server:', error);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
});
|
package/build/server.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// src/server.ts
|
|
3
|
+
import * as dotenv from 'dotenv';
|
|
4
|
+
dotenv.config(); // Load environment variables from .env first
|
|
5
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
7
|
+
import { allTools, toolHandlers } from './tools/index.js';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
// Create MCP server instance
|
|
10
|
+
const server = new McpServer({
|
|
11
|
+
name: "wordpress",
|
|
12
|
+
version: "0.0.1"
|
|
13
|
+
}, {
|
|
14
|
+
capabilities: {
|
|
15
|
+
tools: allTools.reduce((acc, tool) => {
|
|
16
|
+
acc[tool.name] = tool;
|
|
17
|
+
return acc;
|
|
18
|
+
}, {})
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
// Register each tool from our tools list with its corresponding handler
|
|
22
|
+
let registeredCount = 0;
|
|
23
|
+
for (const tool of allTools) {
|
|
24
|
+
const handler = toolHandlers[tool.name];
|
|
25
|
+
if (!handler) {
|
|
26
|
+
console.error(`⚠️ No handler for tool: ${tool.name}`);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const wrappedHandler = async (args) => {
|
|
30
|
+
// The handler functions are already typed with their specific parameter types
|
|
31
|
+
const result = await handler(args);
|
|
32
|
+
return {
|
|
33
|
+
content: result.toolResult.content.map((item) => ({
|
|
34
|
+
...item,
|
|
35
|
+
type: "text"
|
|
36
|
+
})),
|
|
37
|
+
isError: result.toolResult.isError
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
// console.log(`Registering tool: ${tool.name}`);
|
|
41
|
+
// console.log(`Input schema: ${JSON.stringify(tool.inputSchema)}`);
|
|
42
|
+
// const zodSchema = z.any().optional();
|
|
43
|
+
// const jsonSchema = zodToJsonSchema(z.object(tool.inputSchema.properties as z.ZodRawShape));
|
|
44
|
+
// const schema = z.object(tool.inputSchema as z.ZodRawShape).catchall(z.unknown());
|
|
45
|
+
// The inputSchema is already in JSON Schema format with properties
|
|
46
|
+
// server.tool(tool.name, tool.inputSchema.shape, wrappedHandler);
|
|
47
|
+
// const zodSchema = z.any().optional();
|
|
48
|
+
// const jsonSchema = zodToJsonSchema(z.object(tool.inputSchema.properties as z.ZodRawShape));
|
|
49
|
+
// const parsedSchema = z.any().optional().parse(jsonSchema);
|
|
50
|
+
const zodSchema = z.object(tool.inputSchema.properties);
|
|
51
|
+
server.tool(tool.name, zodSchema.shape, wrappedHandler);
|
|
52
|
+
registeredCount++;
|
|
53
|
+
}
|
|
54
|
+
console.error(`✅ Registered ${registeredCount} of ${allTools.length} tools`);
|
|
55
|
+
async function main() {
|
|
56
|
+
const { logToFile } = await import('./wordpress.js');
|
|
57
|
+
logToFile('Starting WordPress MCP server...');
|
|
58
|
+
if (!process.env.WORDPRESS_API_URL) {
|
|
59
|
+
logToFile('Missing required environment variables. Please check your .env file.');
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
logToFile('Initializing WordPress client...');
|
|
64
|
+
const { initWordPress } = await import('./wordpress.js');
|
|
65
|
+
await initWordPress();
|
|
66
|
+
logToFile('WordPress client initialized successfully.');
|
|
67
|
+
logToFile('Setting up server transport...');
|
|
68
|
+
const transport = new StdioServerTransport();
|
|
69
|
+
await server.connect(transport);
|
|
70
|
+
logToFile('WordPress MCP Server running on stdio');
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
logToFile(`Failed to initialize server: ${error}`);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Handle process signals and errors
|
|
78
|
+
process.on('SIGTERM', () => {
|
|
79
|
+
console.log('Received SIGTERM signal, shutting down...');
|
|
80
|
+
process.exit(0);
|
|
81
|
+
});
|
|
82
|
+
process.on('SIGINT', () => {
|
|
83
|
+
console.log('Received SIGINT signal, shutting down...');
|
|
84
|
+
process.exit(0);
|
|
85
|
+
});
|
|
86
|
+
process.on('uncaughtException', (error) => {
|
|
87
|
+
console.error('Uncaught exception:', error);
|
|
88
|
+
process.exit(1);
|
|
89
|
+
});
|
|
90
|
+
process.on('unhandledRejection', (error) => {
|
|
91
|
+
console.error('Unhandled rejection:', error);
|
|
92
|
+
process.exit(1);
|
|
93
|
+
});
|
|
94
|
+
main().catch((error) => {
|
|
95
|
+
console.error('Startup error:', error);
|
|
96
|
+
process.exit(1);
|
|
97
|
+
});
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
declare const listCommentsSchema: z.ZodObject<{
|
|
4
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
per_page: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
search: z.ZodOptional<z.ZodString>;
|
|
7
|
+
after: z.ZodOptional<z.ZodString>;
|
|
8
|
+
author: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>>;
|
|
9
|
+
author_email: z.ZodOptional<z.ZodString>;
|
|
10
|
+
author_exclude: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
11
|
+
post: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
status: z.ZodOptional<z.ZodEnum<["approve", "hold", "spam", "trash"]>>;
|
|
13
|
+
type: z.ZodOptional<z.ZodString>;
|
|
14
|
+
orderby: z.ZodOptional<z.ZodEnum<["date", "date_gmt", "id", "include", "post", "parent", "type"]>>;
|
|
15
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
post?: number | undefined;
|
|
18
|
+
page?: number | undefined;
|
|
19
|
+
per_page?: number | undefined;
|
|
20
|
+
search?: string | undefined;
|
|
21
|
+
status?: "approve" | "hold" | "spam" | "trash" | undefined;
|
|
22
|
+
type?: string | undefined;
|
|
23
|
+
author?: number | number[] | undefined;
|
|
24
|
+
orderby?: "post" | "type" | "date" | "parent" | "id" | "include" | "date_gmt" | undefined;
|
|
25
|
+
order?: "asc" | "desc" | undefined;
|
|
26
|
+
after?: string | undefined;
|
|
27
|
+
author_email?: string | undefined;
|
|
28
|
+
author_exclude?: number[] | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
post?: number | undefined;
|
|
31
|
+
page?: number | undefined;
|
|
32
|
+
per_page?: number | undefined;
|
|
33
|
+
search?: string | undefined;
|
|
34
|
+
status?: "approve" | "hold" | "spam" | "trash" | undefined;
|
|
35
|
+
type?: string | undefined;
|
|
36
|
+
author?: number | number[] | undefined;
|
|
37
|
+
orderby?: "post" | "type" | "date" | "parent" | "id" | "include" | "date_gmt" | undefined;
|
|
38
|
+
order?: "asc" | "desc" | undefined;
|
|
39
|
+
after?: string | undefined;
|
|
40
|
+
author_email?: string | undefined;
|
|
41
|
+
author_exclude?: number[] | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
declare const getCommentSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodNumber;
|
|
45
|
+
}, "strict", z.ZodTypeAny, {
|
|
46
|
+
id: number;
|
|
47
|
+
}, {
|
|
48
|
+
id: number;
|
|
49
|
+
}>;
|
|
50
|
+
declare const createCommentSchema: z.ZodObject<{
|
|
51
|
+
post: z.ZodNumber;
|
|
52
|
+
author: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
author_name: z.ZodOptional<z.ZodString>;
|
|
54
|
+
author_email: z.ZodOptional<z.ZodString>;
|
|
55
|
+
author_url: z.ZodOptional<z.ZodString>;
|
|
56
|
+
content: z.ZodString;
|
|
57
|
+
parent: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
status: z.ZodOptional<z.ZodEnum<["approve", "hold"]>>;
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
|
+
post: number;
|
|
61
|
+
content: string;
|
|
62
|
+
status?: "approve" | "hold" | undefined;
|
|
63
|
+
author?: number | undefined;
|
|
64
|
+
parent?: number | undefined;
|
|
65
|
+
author_email?: string | undefined;
|
|
66
|
+
author_name?: string | undefined;
|
|
67
|
+
author_url?: string | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
post: number;
|
|
70
|
+
content: string;
|
|
71
|
+
status?: "approve" | "hold" | undefined;
|
|
72
|
+
author?: number | undefined;
|
|
73
|
+
parent?: number | undefined;
|
|
74
|
+
author_email?: string | undefined;
|
|
75
|
+
author_name?: string | undefined;
|
|
76
|
+
author_url?: string | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
declare const updateCommentSchema: z.ZodObject<{
|
|
79
|
+
id: z.ZodNumber;
|
|
80
|
+
post: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
author: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
author_name: z.ZodOptional<z.ZodString>;
|
|
83
|
+
author_email: z.ZodOptional<z.ZodString>;
|
|
84
|
+
author_url: z.ZodOptional<z.ZodString>;
|
|
85
|
+
content: z.ZodOptional<z.ZodString>;
|
|
86
|
+
parent: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
status: z.ZodOptional<z.ZodEnum<["approve", "hold", "spam", "trash"]>>;
|
|
88
|
+
}, "strict", z.ZodTypeAny, {
|
|
89
|
+
id: number;
|
|
90
|
+
post?: number | undefined;
|
|
91
|
+
status?: "approve" | "hold" | "spam" | "trash" | undefined;
|
|
92
|
+
author?: number | undefined;
|
|
93
|
+
parent?: number | undefined;
|
|
94
|
+
content?: string | undefined;
|
|
95
|
+
author_email?: string | undefined;
|
|
96
|
+
author_name?: string | undefined;
|
|
97
|
+
author_url?: string | undefined;
|
|
98
|
+
}, {
|
|
99
|
+
id: number;
|
|
100
|
+
post?: number | undefined;
|
|
101
|
+
status?: "approve" | "hold" | "spam" | "trash" | undefined;
|
|
102
|
+
author?: number | undefined;
|
|
103
|
+
parent?: number | undefined;
|
|
104
|
+
content?: string | undefined;
|
|
105
|
+
author_email?: string | undefined;
|
|
106
|
+
author_name?: string | undefined;
|
|
107
|
+
author_url?: string | undefined;
|
|
108
|
+
}>;
|
|
109
|
+
declare const deleteCommentSchema: z.ZodObject<{
|
|
110
|
+
id: z.ZodNumber;
|
|
111
|
+
force: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
}, "strict", z.ZodTypeAny, {
|
|
113
|
+
id: number;
|
|
114
|
+
force?: boolean | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
id: number;
|
|
117
|
+
force?: boolean | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
type ListCommentsParams = z.infer<typeof listCommentsSchema>;
|
|
120
|
+
type GetCommentParams = z.infer<typeof getCommentSchema>;
|
|
121
|
+
type CreateCommentParams = z.infer<typeof createCommentSchema>;
|
|
122
|
+
type UpdateCommentParams = z.infer<typeof updateCommentSchema>;
|
|
123
|
+
type DeleteCommentParams = z.infer<typeof deleteCommentSchema>;
|
|
124
|
+
export declare const commentTools: Tool[];
|
|
125
|
+
export declare const commentHandlers: {
|
|
126
|
+
list_comments: (params: ListCommentsParams) => Promise<{
|
|
127
|
+
toolResult: {
|
|
128
|
+
content: {
|
|
129
|
+
type: string;
|
|
130
|
+
text: string;
|
|
131
|
+
}[];
|
|
132
|
+
isError?: undefined;
|
|
133
|
+
};
|
|
134
|
+
} | {
|
|
135
|
+
toolResult: {
|
|
136
|
+
isError: boolean;
|
|
137
|
+
content: {
|
|
138
|
+
type: string;
|
|
139
|
+
text: string;
|
|
140
|
+
}[];
|
|
141
|
+
};
|
|
142
|
+
}>;
|
|
143
|
+
get_comment: (params: GetCommentParams) => Promise<{
|
|
144
|
+
toolResult: {
|
|
145
|
+
content: {
|
|
146
|
+
type: string;
|
|
147
|
+
text: string;
|
|
148
|
+
}[];
|
|
149
|
+
isError?: undefined;
|
|
150
|
+
};
|
|
151
|
+
} | {
|
|
152
|
+
toolResult: {
|
|
153
|
+
isError: boolean;
|
|
154
|
+
content: {
|
|
155
|
+
type: string;
|
|
156
|
+
text: string;
|
|
157
|
+
}[];
|
|
158
|
+
};
|
|
159
|
+
}>;
|
|
160
|
+
create_comment: (params: CreateCommentParams) => Promise<{
|
|
161
|
+
toolResult: {
|
|
162
|
+
content: {
|
|
163
|
+
type: string;
|
|
164
|
+
text: string;
|
|
165
|
+
}[];
|
|
166
|
+
isError?: undefined;
|
|
167
|
+
};
|
|
168
|
+
} | {
|
|
169
|
+
toolResult: {
|
|
170
|
+
isError: boolean;
|
|
171
|
+
content: {
|
|
172
|
+
type: string;
|
|
173
|
+
text: string;
|
|
174
|
+
}[];
|
|
175
|
+
};
|
|
176
|
+
}>;
|
|
177
|
+
update_comment: (params: UpdateCommentParams) => Promise<{
|
|
178
|
+
toolResult: {
|
|
179
|
+
content: {
|
|
180
|
+
type: string;
|
|
181
|
+
text: string;
|
|
182
|
+
}[];
|
|
183
|
+
isError?: undefined;
|
|
184
|
+
};
|
|
185
|
+
} | {
|
|
186
|
+
toolResult: {
|
|
187
|
+
isError: boolean;
|
|
188
|
+
content: {
|
|
189
|
+
type: string;
|
|
190
|
+
text: string;
|
|
191
|
+
}[];
|
|
192
|
+
};
|
|
193
|
+
}>;
|
|
194
|
+
delete_comment: (params: DeleteCommentParams) => Promise<{
|
|
195
|
+
toolResult: {
|
|
196
|
+
content: {
|
|
197
|
+
type: string;
|
|
198
|
+
text: string;
|
|
199
|
+
}[];
|
|
200
|
+
isError?: undefined;
|
|
201
|
+
};
|
|
202
|
+
} | {
|
|
203
|
+
toolResult: {
|
|
204
|
+
isError: boolean;
|
|
205
|
+
content: {
|
|
206
|
+
type: string;
|
|
207
|
+
text: string;
|
|
208
|
+
}[];
|
|
209
|
+
};
|
|
210
|
+
}>;
|
|
211
|
+
};
|
|
212
|
+
export {};
|