@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
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
declare const listPostsSchema: z.ZodObject<{
|
|
4
|
+
space_id: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
space_id?: number | undefined;
|
|
8
|
+
limit?: number | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
space_id?: number | undefined;
|
|
11
|
+
limit?: number | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
declare const listSpacesSchema: z.ZodObject<{
|
|
14
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
search: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
search?: string | undefined;
|
|
18
|
+
limit?: number | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
search?: string | undefined;
|
|
21
|
+
limit?: number | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
declare const createPostSchema: z.ZodObject<{
|
|
24
|
+
space_id: z.ZodNumber;
|
|
25
|
+
user_id: z.ZodNumber;
|
|
26
|
+
message: z.ZodString;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
message: string;
|
|
29
|
+
space_id: number;
|
|
30
|
+
user_id: number;
|
|
31
|
+
}, {
|
|
32
|
+
message: string;
|
|
33
|
+
space_id: number;
|
|
34
|
+
user_id: number;
|
|
35
|
+
}>;
|
|
36
|
+
type ListPostsParams = z.infer<typeof listPostsSchema>;
|
|
37
|
+
type ListSpacesParams = z.infer<typeof listSpacesSchema>;
|
|
38
|
+
type CreatePostParams = z.infer<typeof createPostSchema>;
|
|
39
|
+
export declare const fluentCommunityTools: Tool[];
|
|
40
|
+
export declare const fluentCommunityHandlers: {
|
|
41
|
+
fc_list_posts: (params: ListPostsParams) => Promise<{
|
|
42
|
+
toolResult: {
|
|
43
|
+
content: {
|
|
44
|
+
type: string;
|
|
45
|
+
text: string;
|
|
46
|
+
}[];
|
|
47
|
+
isError: boolean;
|
|
48
|
+
};
|
|
49
|
+
}>;
|
|
50
|
+
fc_list_spaces: (params: ListSpacesParams) => Promise<{
|
|
51
|
+
toolResult: {
|
|
52
|
+
content: {
|
|
53
|
+
type: string;
|
|
54
|
+
text: string;
|
|
55
|
+
}[];
|
|
56
|
+
isError: boolean;
|
|
57
|
+
};
|
|
58
|
+
}>;
|
|
59
|
+
fc_create_post: (params: CreatePostParams) => Promise<{
|
|
60
|
+
toolResult: {
|
|
61
|
+
content: {
|
|
62
|
+
type: string;
|
|
63
|
+
text: string;
|
|
64
|
+
}[];
|
|
65
|
+
isError: boolean;
|
|
66
|
+
};
|
|
67
|
+
}>;
|
|
68
|
+
};
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { makeWordPressRequest } from '../wordpress.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
// Zod Schema Definitions
|
|
4
|
+
const listPostsSchema = z.object({
|
|
5
|
+
space_id: z.number().optional().describe('Filter posts by space ID'),
|
|
6
|
+
limit: z.number().optional().describe('Number of posts to return')
|
|
7
|
+
});
|
|
8
|
+
const listSpacesSchema = z.object({
|
|
9
|
+
limit: z.number().optional().describe('Number of spaces to return'),
|
|
10
|
+
search: z.string().optional().describe('Search term')
|
|
11
|
+
});
|
|
12
|
+
const createPostSchema = z.object({
|
|
13
|
+
space_id: z.number().describe('The space ID where the post will be created'),
|
|
14
|
+
user_id: z.number().describe('The user ID who creates the post'),
|
|
15
|
+
message: z.string().describe('Post content/message')
|
|
16
|
+
});
|
|
17
|
+
export const fluentCommunityTools = [
|
|
18
|
+
{
|
|
19
|
+
name: 'fc_list_posts',
|
|
20
|
+
description: 'List all posts from FluentCommunity with optional filtering',
|
|
21
|
+
inputSchema: { type: 'object', properties: listPostsSchema.shape }
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'fc_list_spaces',
|
|
25
|
+
description: 'List all spaces in FluentCommunity',
|
|
26
|
+
inputSchema: { type: 'object', properties: listSpacesSchema.shape }
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'fc_create_post',
|
|
30
|
+
description: 'Create a new post in FluentCommunity',
|
|
31
|
+
inputSchema: { type: 'object', properties: createPostSchema.shape }
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
export const fluentCommunityHandlers = {
|
|
35
|
+
fc_list_posts: async (params) => {
|
|
36
|
+
try {
|
|
37
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/posts', params);
|
|
38
|
+
return {
|
|
39
|
+
toolResult: {
|
|
40
|
+
content: [{ type: 'text', text: JSON.stringify(response, null, 2) }],
|
|
41
|
+
isError: false
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
return {
|
|
47
|
+
toolResult: {
|
|
48
|
+
content: [{ type: 'text', text: `Error listing posts: ${error.message}` }],
|
|
49
|
+
isError: true
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
fc_list_spaces: async (params) => {
|
|
55
|
+
try {
|
|
56
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/spaces', params);
|
|
57
|
+
return {
|
|
58
|
+
toolResult: {
|
|
59
|
+
content: [{ type: 'text', text: JSON.stringify(response, null, 2) }],
|
|
60
|
+
isError: false
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
return {
|
|
66
|
+
toolResult: {
|
|
67
|
+
content: [{ type: 'text', text: `Error listing spaces: ${error.message}` }],
|
|
68
|
+
isError: true
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
fc_create_post: async (params) => {
|
|
74
|
+
try {
|
|
75
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/posts', params);
|
|
76
|
+
return {
|
|
77
|
+
toolResult: {
|
|
78
|
+
content: [{ type: 'text', text: JSON.stringify(response, null, 2) }],
|
|
79
|
+
isError: false
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
return {
|
|
85
|
+
toolResult: {
|
|
86
|
+
content: [{ type: 'text', text: `Error creating post: ${error.message}` }],
|
|
87
|
+
isError: true
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeWordPressRequest } from '../wordpress.js';
|
|
3
|
+
// ==================== ZOD SCHEMA DEFINITIONS ====================
|
|
4
|
+
const getColorsSchema = z.object({
|
|
5
|
+
mode: z.enum(['light', 'dark']).optional().default('light').describe('Color mode (light or dark)')
|
|
6
|
+
});
|
|
7
|
+
const updateColorsSchema = z.object({
|
|
8
|
+
mode: z.enum(['light', 'dark']).optional().default('light').describe('Color mode (light or dark)'),
|
|
9
|
+
colors: z.object({
|
|
10
|
+
navbar_bg: z.string().optional().describe('Navbar background color (hex)'),
|
|
11
|
+
navbar_text: z.string().optional().describe('Navbar text color (hex)'),
|
|
12
|
+
sidebar_bg: z.string().optional().describe('Sidebar background color (hex)'),
|
|
13
|
+
sidebar_text: z.string().optional().describe('Sidebar text color (hex)'),
|
|
14
|
+
feed_bg: z.string().optional().describe('Feed background color (hex)'),
|
|
15
|
+
button_primary: z.string().optional().describe('Primary button color (hex)'),
|
|
16
|
+
button_secondary: z.string().optional().describe('Secondary button color (hex)'),
|
|
17
|
+
link_color: z.string().optional().describe('Link color (hex)'),
|
|
18
|
+
accent_color: z.string().optional().describe('Accent color (hex)')
|
|
19
|
+
}).describe('Color values to update')
|
|
20
|
+
});
|
|
21
|
+
const updatePortalSettingsSchema = z.object({
|
|
22
|
+
settings: z.object({
|
|
23
|
+
dark_mode_enabled: z.boolean().optional().describe('Enable dark mode'),
|
|
24
|
+
sticky_header: z.boolean().optional().describe('Enable sticky header'),
|
|
25
|
+
post_layout: z.enum(['card', 'list', 'grid']).optional().describe('Post layout style'),
|
|
26
|
+
sidebar_position: z.enum(['left', 'right']).optional().describe('Sidebar position'),
|
|
27
|
+
show_member_count: z.boolean().optional().describe('Show member count'),
|
|
28
|
+
show_post_count: z.boolean().optional().describe('Show post count'),
|
|
29
|
+
enable_reactions: z.boolean().optional().describe('Enable post reactions'),
|
|
30
|
+
enable_comments: z.boolean().optional().describe('Enable comments')
|
|
31
|
+
}).describe('Portal settings to update')
|
|
32
|
+
});
|
|
33
|
+
const updateBrandingSchema = z.object({
|
|
34
|
+
branding: z.object({
|
|
35
|
+
logo_url: z.string().optional().describe('Logo URL'),
|
|
36
|
+
logo_width: z.number().optional().describe('Logo width in pixels'),
|
|
37
|
+
favicon_url: z.string().optional().describe('Favicon URL'),
|
|
38
|
+
site_title: z.string().optional().describe('Site title'),
|
|
39
|
+
site_tagline: z.string().optional().describe('Site tagline'),
|
|
40
|
+
custom_css: z.string().optional().describe('Custom CSS code'),
|
|
41
|
+
custom_header_code: z.string().optional().describe('Custom header HTML/JS'),
|
|
42
|
+
custom_footer_code: z.string().optional().describe('Custom footer HTML/JS')
|
|
43
|
+
}).describe('Branding data to update')
|
|
44
|
+
});
|
|
45
|
+
// ==================== TOOL DEFINITIONS ====================
|
|
46
|
+
export const fluentCommunityDesignTools = [
|
|
47
|
+
{
|
|
48
|
+
name: 'fc_get_colors',
|
|
49
|
+
description: 'Get FluentCommunity color scheme (light or dark mode)',
|
|
50
|
+
inputSchema: { type: 'object', properties: getColorsSchema.shape }
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'fc_update_colors',
|
|
54
|
+
description: 'Update FluentCommunity color scheme for light or dark mode',
|
|
55
|
+
inputSchema: { type: 'object', properties: updateColorsSchema.shape }
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'fc_get_portal_settings',
|
|
59
|
+
description: 'Get FluentCommunity portal display settings',
|
|
60
|
+
inputSchema: { type: 'object', properties: {} }
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'fc_update_portal_settings',
|
|
64
|
+
description: 'Update FluentCommunity portal display settings (layout, sidebar, features)',
|
|
65
|
+
inputSchema: { type: 'object', properties: updatePortalSettingsSchema.shape }
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'fc_get_branding',
|
|
69
|
+
description: 'Get FluentCommunity branding settings (logo, favicon, custom CSS)',
|
|
70
|
+
inputSchema: { type: 'object', properties: {} }
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'fc_update_branding',
|
|
74
|
+
description: 'Update FluentCommunity branding (logo, favicon, custom CSS/HTML)',
|
|
75
|
+
inputSchema: { type: 'object', properties: updateBrandingSchema.shape }
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
// ==================== TOOL HANDLERS ====================
|
|
79
|
+
export const fluentCommunityDesignHandlers = {
|
|
80
|
+
fc_get_colors: async (args) => {
|
|
81
|
+
try {
|
|
82
|
+
// Use FluentCommunity's NATIVE color-config endpoint
|
|
83
|
+
const response = await makeWordPressRequest('GET', 'fluent-community/v2/settings/color-config');
|
|
84
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
fc_update_colors: async (args) => {
|
|
91
|
+
try {
|
|
92
|
+
// Use FluentCommunity's NATIVE color-config endpoint
|
|
93
|
+
const data = {
|
|
94
|
+
mode: args.mode || 'light',
|
|
95
|
+
colors: args.colors
|
|
96
|
+
};
|
|
97
|
+
const response = await makeWordPressRequest('POST', 'fluent-community/v2/settings/color-config', data);
|
|
98
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
fc_get_portal_settings: async (args) => {
|
|
105
|
+
try {
|
|
106
|
+
// Use FluentCommunity's NATIVE customization-settings endpoint
|
|
107
|
+
const response = await makeWordPressRequest('GET', 'fluent-community/v2/settings/customization-settings');
|
|
108
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
fc_update_portal_settings: async (args) => {
|
|
115
|
+
try {
|
|
116
|
+
// Use FluentCommunity's NATIVE customization-settings endpoint
|
|
117
|
+
const data = {
|
|
118
|
+
settings: args.settings
|
|
119
|
+
};
|
|
120
|
+
const response = await makeWordPressRequest('POST', 'fluent-community/v2/settings/customization-settings', data);
|
|
121
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
fc_get_branding: async (args) => {
|
|
128
|
+
try {
|
|
129
|
+
// Use FluentCommunity's NATIVE customization-settings endpoint (branding is part of customization)
|
|
130
|
+
const response = await makeWordPressRequest('GET', 'fluent-community/v2/settings/customization-settings');
|
|
131
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
fc_update_branding: async (args) => {
|
|
138
|
+
try {
|
|
139
|
+
// Use FluentCommunity's NATIVE customization-settings endpoint (branding is part of customization)
|
|
140
|
+
const data = {
|
|
141
|
+
branding: args.branding
|
|
142
|
+
};
|
|
143
|
+
const response = await makeWordPressRequest('POST', 'fluent-community/v2/settings/customization-settings', data);
|
|
144
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const fluentCommunityLayoutTools: ({
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {};
|
|
8
|
+
};
|
|
9
|
+
} | {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: "object";
|
|
14
|
+
properties: {
|
|
15
|
+
layout: z.ZodObject<{
|
|
16
|
+
menu_position: z.ZodOptional<z.ZodEnum<["top", "side"]>>;
|
|
17
|
+
sidebar_position: z.ZodOptional<z.ZodEnum<["left", "right"]>>;
|
|
18
|
+
hide_members_list: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
hide_spaces_list: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
hide_activity_feed: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
hide_search: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
custom_header_content: z.ZodOptional<z.ZodString>;
|
|
23
|
+
custom_sidebar_content: z.ZodOptional<z.ZodString>;
|
|
24
|
+
custom_footer_content: z.ZodOptional<z.ZodString>;
|
|
25
|
+
hide_home_feed: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
custom_home_content: z.ZodOptional<z.ZodString>;
|
|
27
|
+
home_feed_label: z.ZodOptional<z.ZodString>;
|
|
28
|
+
embed_post_id: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
social_links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
30
|
+
platform: z.ZodString;
|
|
31
|
+
url: z.ZodString;
|
|
32
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
url: string;
|
|
35
|
+
platform: string;
|
|
36
|
+
icon?: string | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
url: string;
|
|
39
|
+
platform: string;
|
|
40
|
+
icon?: string | undefined;
|
|
41
|
+
}>, "many">>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
sidebar_position?: "left" | "right" | undefined;
|
|
44
|
+
menu_position?: "top" | "side" | undefined;
|
|
45
|
+
hide_members_list?: boolean | undefined;
|
|
46
|
+
hide_spaces_list?: boolean | undefined;
|
|
47
|
+
hide_activity_feed?: boolean | undefined;
|
|
48
|
+
hide_search?: boolean | undefined;
|
|
49
|
+
custom_header_content?: string | undefined;
|
|
50
|
+
custom_sidebar_content?: string | undefined;
|
|
51
|
+
custom_footer_content?: string | undefined;
|
|
52
|
+
hide_home_feed?: boolean | undefined;
|
|
53
|
+
custom_home_content?: string | undefined;
|
|
54
|
+
home_feed_label?: string | undefined;
|
|
55
|
+
embed_post_id?: number | undefined;
|
|
56
|
+
social_links?: {
|
|
57
|
+
url: string;
|
|
58
|
+
platform: string;
|
|
59
|
+
icon?: string | undefined;
|
|
60
|
+
}[] | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
sidebar_position?: "left" | "right" | undefined;
|
|
63
|
+
menu_position?: "top" | "side" | undefined;
|
|
64
|
+
hide_members_list?: boolean | undefined;
|
|
65
|
+
hide_spaces_list?: boolean | undefined;
|
|
66
|
+
hide_activity_feed?: boolean | undefined;
|
|
67
|
+
hide_search?: boolean | undefined;
|
|
68
|
+
custom_header_content?: string | undefined;
|
|
69
|
+
custom_sidebar_content?: string | undefined;
|
|
70
|
+
custom_footer_content?: string | undefined;
|
|
71
|
+
hide_home_feed?: boolean | undefined;
|
|
72
|
+
custom_home_content?: string | undefined;
|
|
73
|
+
home_feed_label?: string | undefined;
|
|
74
|
+
embed_post_id?: number | undefined;
|
|
75
|
+
social_links?: {
|
|
76
|
+
url: string;
|
|
77
|
+
platform: string;
|
|
78
|
+
icon?: string | undefined;
|
|
79
|
+
}[] | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
})[];
|
|
84
|
+
export declare const fluentCommunityLayoutHandlers: {
|
|
85
|
+
fc_get_layout: (args: any) => Promise<{
|
|
86
|
+
toolResult: {
|
|
87
|
+
content: {
|
|
88
|
+
type: string;
|
|
89
|
+
text: string;
|
|
90
|
+
}[];
|
|
91
|
+
isError?: undefined;
|
|
92
|
+
};
|
|
93
|
+
} | {
|
|
94
|
+
toolResult: {
|
|
95
|
+
isError: boolean;
|
|
96
|
+
content: {
|
|
97
|
+
type: string;
|
|
98
|
+
text: string;
|
|
99
|
+
}[];
|
|
100
|
+
};
|
|
101
|
+
}>;
|
|
102
|
+
fc_update_layout: (args: any) => Promise<{
|
|
103
|
+
toolResult: {
|
|
104
|
+
content: {
|
|
105
|
+
type: string;
|
|
106
|
+
text: string;
|
|
107
|
+
}[];
|
|
108
|
+
isError?: undefined;
|
|
109
|
+
};
|
|
110
|
+
} | {
|
|
111
|
+
toolResult: {
|
|
112
|
+
isError: boolean;
|
|
113
|
+
content: {
|
|
114
|
+
type: string;
|
|
115
|
+
text: string;
|
|
116
|
+
}[];
|
|
117
|
+
};
|
|
118
|
+
}>;
|
|
119
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeWordPressRequest } from '../wordpress.js';
|
|
3
|
+
// Layout Control Tools for FluentCommunity Manager
|
|
4
|
+
export const fluentCommunityLayoutTools = [
|
|
5
|
+
{
|
|
6
|
+
name: 'fc_get_layout',
|
|
7
|
+
description: 'Get FluentCommunity layout settings (menu position, sidebar placement, component visibility, content injection)',
|
|
8
|
+
inputSchema: { type: 'object', properties: {} },
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'fc_update_layout',
|
|
12
|
+
description: 'Update FluentCommunity layout settings. Control menu positioning (top/side), sidebar placement (left/right), component visibility (hide/show members, spaces, etc.), and inject custom content (header, sidebar, footer with HTML/shortcodes)',
|
|
13
|
+
inputSchema: { type: 'object', properties: z.object({
|
|
14
|
+
layout: z.object({
|
|
15
|
+
menu_position: z.enum(['top', 'side']).optional().describe('Menu position: top or side'),
|
|
16
|
+
sidebar_position: z.enum(['left', 'right']).optional().describe('Sidebar position: left or right'),
|
|
17
|
+
hide_members_list: z.boolean().optional().describe('Hide members list component'),
|
|
18
|
+
hide_spaces_list: z.boolean().optional().describe('Hide spaces list component'),
|
|
19
|
+
hide_activity_feed: z.boolean().optional().describe('Hide activity feed component'),
|
|
20
|
+
hide_search: z.boolean().optional().describe('Hide search component'),
|
|
21
|
+
custom_header_content: z.string().optional().describe('Custom header content (HTML/shortcodes)'),
|
|
22
|
+
custom_sidebar_content: z.string().optional().describe('Custom sidebar content (HTML/shortcodes)'),
|
|
23
|
+
custom_footer_content: z.string().optional().describe('Custom footer content (HTML/shortcodes)'),
|
|
24
|
+
hide_home_feed: z.boolean().optional().describe('Hide the default home feed'),
|
|
25
|
+
custom_home_content: z.string().optional().describe('Custom home page content (HTML/shortcodes)'),
|
|
26
|
+
home_feed_label: z.string().optional().describe('Custom label for home feed'),
|
|
27
|
+
embed_post_id: z.number().optional().describe('Post ID to embed on home page'),
|
|
28
|
+
social_links: z.array(z.object({
|
|
29
|
+
platform: z.string().describe('Social platform name (e.g., twitter, linkedin, github)'),
|
|
30
|
+
url: z.string().describe('Profile URL'),
|
|
31
|
+
icon: z.string().optional().describe('Icon class or SVG'),
|
|
32
|
+
})).optional().describe('Social profile links for user profiles'),
|
|
33
|
+
}).describe('Layout settings object'),
|
|
34
|
+
}).shape },
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
export const fluentCommunityLayoutHandlers = {
|
|
38
|
+
fc_get_layout: async (args) => {
|
|
39
|
+
try {
|
|
40
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/settings/layout');
|
|
41
|
+
return {
|
|
42
|
+
toolResult: {
|
|
43
|
+
content: [{
|
|
44
|
+
type: 'text',
|
|
45
|
+
text: JSON.stringify(response, null, 2)
|
|
46
|
+
}]
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
return {
|
|
52
|
+
toolResult: {
|
|
53
|
+
isError: true,
|
|
54
|
+
content: [{
|
|
55
|
+
type: 'text',
|
|
56
|
+
text: `Error getting layout settings: ${error.message}`
|
|
57
|
+
}]
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
fc_update_layout: async (args) => {
|
|
63
|
+
try {
|
|
64
|
+
const response = await makeWordPressRequest('PUT', 'fc-manager/v1/settings/layout', {
|
|
65
|
+
layout: args.layout
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
toolResult: {
|
|
69
|
+
content: [{
|
|
70
|
+
type: 'text',
|
|
71
|
+
text: JSON.stringify(response, null, 2)
|
|
72
|
+
}]
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
return {
|
|
78
|
+
toolResult: {
|
|
79
|
+
isError: true,
|
|
80
|
+
content: [{
|
|
81
|
+
type: 'text',
|
|
82
|
+
text: `Error updating layout settings: ${error.message}`
|
|
83
|
+
}]
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
};
|