@wix/mcp 1.0.22 → 1.0.24
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/build/bin-standalone.js +1114 -1093
- package/build/bin-standalone.js.map +4 -4
- package/build/cjs/index.cjs +8738 -7238
- package/build/cjs/index.cjs.map +4 -4
- package/build/dts/api-call/index.d.ts +7 -1
- package/build/dts/api-call/index.d.ts.map +1 -1
- package/build/dts/api-call/index.js +115 -39
- package/build/dts/api-call/index.js.map +1 -1
- package/build/dts/api-call/upload-image-tool.d.ts +8 -0
- package/build/dts/api-call/upload-image-tool.d.ts.map +1 -0
- package/build/dts/api-call/upload-image-tool.js +150 -0
- package/build/dts/api-call/upload-image-tool.js.map +1 -0
- package/build/dts/api-call/validation.d.ts +1 -0
- package/build/dts/api-call/validation.d.ts.map +1 -1
- package/build/dts/api-call/validation.js +7 -7
- package/build/dts/api-call/validation.js.map +1 -1
- package/build/dts/bin.d.ts.map +1 -1
- package/build/dts/bin.js.map +1 -1
- package/build/dts/cli-tools/cli.d.ts.map +1 -1
- package/build/dts/cli-tools/cli.js +6 -4
- package/build/dts/cli-tools/cli.js.map +1 -1
- package/build/dts/config/default-config.d.ts +41 -0
- package/build/dts/config/default-config.d.ts.map +1 -0
- package/build/dts/config/default-config.js +169 -0
- package/build/dts/config/default-config.js.map +1 -0
- package/build/dts/docs/create-site-guide.d.ts +1 -1
- package/build/dts/docs/create-site-guide.d.ts.map +1 -1
- package/build/dts/docs/create-site-guide.js +5 -2
- package/build/dts/docs/create-site-guide.js.map +1 -1
- package/build/dts/docs/docs.d.ts +24 -0
- package/build/dts/docs/docs.d.ts.map +1 -1
- package/build/dts/docs/docs.js +117 -167
- package/build/dts/docs/docs.js.map +1 -1
- package/build/dts/docs/fetch-article.d.ts +1 -1
- package/build/dts/docs/fetch-article.d.ts.map +1 -1
- package/build/dts/docs/fetch-article.js +39 -1
- package/build/dts/docs/fetch-article.js.map +1 -1
- package/build/dts/docs/get-to-know.d.ts +16 -2
- package/build/dts/docs/get-to-know.d.ts.map +1 -1
- package/build/dts/docs/get-to-know.js +80 -80
- package/build/dts/docs/get-to-know.js.map +1 -1
- package/build/dts/docs/semanticSearch.d.ts.map +1 -1
- package/build/dts/docs/semanticSearch.js +4 -1
- package/build/dts/docs/semanticSearch.js.map +1 -1
- package/build/dts/docs/semanticSearch.test.js +5 -14
- package/build/dts/docs/semanticSearch.test.js.map +1 -1
- package/build/dts/docs/velo-readme.d.ts.map +1 -1
- package/build/dts/docs/velo-readme.js +1 -1
- package/build/dts/docs/velo-readme.js.map +1 -1
- package/build/dts/index.d.ts +5 -2
- package/build/dts/index.d.ts.map +1 -1
- package/build/dts/index.js +4 -0
- package/build/dts/index.js.map +1 -1
- package/build/dts/infra/logger.d.ts +1 -0
- package/build/dts/infra/logger.d.ts.map +1 -1
- package/build/dts/infra/logger.js +4 -0
- package/build/dts/infra/logger.js.map +1 -1
- package/build/dts/infra/widget-payload.d.ts +11 -0
- package/build/dts/infra/widget-payload.d.ts.map +1 -0
- package/build/dts/infra/widget-payload.js +2 -0
- package/build/dts/infra/widget-payload.js.map +1 -0
- package/build/dts/site-widget-tools/constants.d.ts +4 -0
- package/build/dts/site-widget-tools/constants.d.ts.map +1 -0
- package/build/dts/site-widget-tools/constants.js +6 -0
- package/build/dts/site-widget-tools/constants.js.map +1 -0
- package/build/dts/site-widget-tools/edit-site-tool/index.d.ts +4 -0
- package/build/dts/site-widget-tools/edit-site-tool/index.d.ts.map +1 -0
- package/build/dts/site-widget-tools/edit-site-tool/index.js +171 -0
- package/build/dts/site-widget-tools/edit-site-tool/index.js.map +1 -0
- package/build/dts/site-widget-tools/index.d.ts +4 -0
- package/build/dts/site-widget-tools/index.d.ts.map +1 -0
- package/build/dts/site-widget-tools/index.js +4 -0
- package/build/dts/site-widget-tools/index.js.map +1 -0
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.d.ts +4 -0
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.d.ts.map +1 -0
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.js +177 -0
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.js.map +1 -0
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/types.d.ts +52 -0
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/types.d.ts.map +1 -0
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/types.js +2 -0
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/types.js.map +1 -0
- package/build/dts/site-widget-tools/site-builder-tool/index.d.ts +4 -0
- package/build/dts/site-widget-tools/site-builder-tool/index.d.ts.map +1 -0
- package/build/dts/site-widget-tools/site-builder-tool/index.js +157 -0
- package/build/dts/site-widget-tools/site-builder-tool/index.js.map +1 -0
- package/build/dts/support/index.d.ts +1 -1
- package/build/dts/support/index.d.ts.map +1 -1
- package/build/dts/support/index.js +15 -17
- package/build/dts/support/index.js.map +1 -1
- package/build/dts/widget-manifest.d.ts +6 -0
- package/build/dts/widget-manifest.d.ts.map +1 -0
- package/build/dts/widget-manifest.js +19 -0
- package/build/dts/widget-manifest.js.map +1 -0
- package/build/dts/wix-mcp-server.d.ts +18 -3
- package/build/dts/wix-mcp-server.d.ts.map +1 -1
- package/build/dts/wix-mcp-server.js +129 -106
- package/build/dts/wix-mcp-server.js.map +1 -1
- package/build/esm/index.js +8402 -6402
- package/build/esm/index.js.map +4 -4
- package/package.json +49 -25
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createHttpClient } from '@wix/http-client';
|
|
3
|
+
import { getWidgetHtml } from '../../widget-manifest.js';
|
|
4
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
5
|
+
import { EDIT_SITE_TOOL_NAME } from '../constants.js';
|
|
6
|
+
const httpClient = createHttpClient();
|
|
7
|
+
const EDIT_SITE_WIDGET_URI = 'ui://widget/edit-site.html';
|
|
8
|
+
export function addEditSiteWidgetTool(server, authStrategy) {
|
|
9
|
+
const { getAccountAuthHeaders } = authStrategy;
|
|
10
|
+
const toolMeta = (widgetPayload) => {
|
|
11
|
+
return {
|
|
12
|
+
'openai/toolInvocation/invoking': 'Editing your website...',
|
|
13
|
+
'openai/toolInvocation/invoked': 'Website editing in progress...',
|
|
14
|
+
'openai/outputTemplate': EDIT_SITE_WIDGET_URI,
|
|
15
|
+
'openai/widgetAccessible': true,
|
|
16
|
+
'openai/resultCanProduceWidget': true,
|
|
17
|
+
'openai/widgetCSP': {
|
|
18
|
+
connect_domains: [
|
|
19
|
+
'https://*.wix.com',
|
|
20
|
+
'https://*.wixsite.com',
|
|
21
|
+
'https://static.parastorage.com',
|
|
22
|
+
'https://cdn.openai.com'
|
|
23
|
+
],
|
|
24
|
+
resource_domains: [
|
|
25
|
+
'https://*.wix.com',
|
|
26
|
+
'https://*.wixsite.com',
|
|
27
|
+
'https://static.parastorage.com',
|
|
28
|
+
'https://cdn.openai.com'
|
|
29
|
+
],
|
|
30
|
+
frame_domains: ['https://*.wix.com', 'https://*.wixsite.com'],
|
|
31
|
+
redirect_domains: ['https://*.wix.com', 'https://*.wixsite.com']
|
|
32
|
+
},
|
|
33
|
+
'openai/widgetDescription': "Displays a live progress showing your editing progress, including site editing status and a link to the editor. When it's ready, it will show a live preview of the website.",
|
|
34
|
+
...(widgetPayload ? { widgetPayload } : {})
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
// Add edit site widget resource
|
|
38
|
+
server.registerResource(`${EDIT_SITE_TOOL_NAME}_RESOURCE`, EDIT_SITE_WIDGET_URI, {}, async (uri) => {
|
|
39
|
+
return {
|
|
40
|
+
contents: [
|
|
41
|
+
{
|
|
42
|
+
uri: uri.href,
|
|
43
|
+
_meta: toolMeta(),
|
|
44
|
+
mimeType: 'text/html+skybridge',
|
|
45
|
+
text: getWidgetHtml({ widgetId: 'editWixSite' })
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
// Add edit site tool that communicates with the widget
|
|
51
|
+
server.registerTool(EDIT_SITE_TOOL_NAME, {
|
|
52
|
+
title: 'Edit Site',
|
|
53
|
+
description: `A tool that edits a Wix site. Use this ONLY when the user explicitly asks to edit/modify/update a site/website/application visually or by adding/removing/editing components inside the page. The widget resource is available at ${EDIT_SITE_WIDGET_URI}`,
|
|
54
|
+
inputSchema: {
|
|
55
|
+
jobId: z
|
|
56
|
+
.string()
|
|
57
|
+
.optional()
|
|
58
|
+
.describe('The job ID of the site editing. If not provided, a new job will be created.'),
|
|
59
|
+
siteId: z
|
|
60
|
+
.string()
|
|
61
|
+
.describe('The site ID to edit. If not provided, the user will be asked to provide a site ID.'),
|
|
62
|
+
editPrompt: z
|
|
63
|
+
.string()
|
|
64
|
+
.describe('The prompt to edit the site. If not provided, the user will be asked to provide a prompt.')
|
|
65
|
+
},
|
|
66
|
+
_meta: toolMeta(),
|
|
67
|
+
annotations: {
|
|
68
|
+
readOnlyHint: true,
|
|
69
|
+
destructiveHint: false,
|
|
70
|
+
openWorldHint: false
|
|
71
|
+
}
|
|
72
|
+
}, async (args, { setToolBiParams }) => {
|
|
73
|
+
console.log(`[${EDIT_SITE_TOOL_NAME}] 🚀 Start Editing Your Site tool invoked!`);
|
|
74
|
+
console.log(`[${EDIT_SITE_TOOL_NAME}] Site ID:`, args.siteId);
|
|
75
|
+
console.log(`[${EDIT_SITE_TOOL_NAME}] Edit prompt:`, args.editPrompt);
|
|
76
|
+
console.log(`[${EDIT_SITE_TOOL_NAME}] JobId (if provided):`, args.jobId);
|
|
77
|
+
const accountHeaders = await getAccountAuthHeaders();
|
|
78
|
+
let jobId;
|
|
79
|
+
// Priority: 1. Explicit jobId from args, 2. Last saved jobId, 3. Create new job
|
|
80
|
+
if (args.jobId) {
|
|
81
|
+
console.log(`[${EDIT_SITE_TOOL_NAME}] Using provided jobId:`, args.jobId);
|
|
82
|
+
jobId = args.jobId;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// Create new job
|
|
86
|
+
const { success, jobId: newJobId, message } = await editHarmonySite({
|
|
87
|
+
userPrompt: args.editPrompt,
|
|
88
|
+
siteId: args.siteId,
|
|
89
|
+
accountHeaders
|
|
90
|
+
});
|
|
91
|
+
setToolBiParams({ jobId: newJobId });
|
|
92
|
+
if (!success || !newJobId) {
|
|
93
|
+
return {
|
|
94
|
+
isError: true,
|
|
95
|
+
content: [
|
|
96
|
+
{
|
|
97
|
+
type: 'text',
|
|
98
|
+
text: message
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
structuredContent: {
|
|
102
|
+
success: false,
|
|
103
|
+
status: message,
|
|
104
|
+
jobId: null
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
jobId = newJobId;
|
|
109
|
+
console.log(`[${EDIT_SITE_TOOL_NAME}] Created new job:`, jobId);
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
content: [
|
|
113
|
+
{
|
|
114
|
+
type: 'text',
|
|
115
|
+
text: 'Respond only with a confirmation that the website editing has started and that progress is available in the widget. No other content is allowed. DO NOT mention jobId.'
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
structuredContent: {
|
|
119
|
+
success: true,
|
|
120
|
+
status: 'Respond only with a confirmation that the website editing has started and that progress is available in the widget. No other content is allowed. DO NOT mention jobId.',
|
|
121
|
+
jobId // Return jobId so model can use it in future calls
|
|
122
|
+
},
|
|
123
|
+
_meta: toolMeta({ jobId })
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
async function editHarmonySite({ userPrompt, siteId, accountHeaders }) {
|
|
128
|
+
const editorUrl = getEditorUrl(siteId);
|
|
129
|
+
const editSiteRequest = {
|
|
130
|
+
userPrompt,
|
|
131
|
+
siteId,
|
|
132
|
+
editorUrl,
|
|
133
|
+
withScreenshots: true,
|
|
134
|
+
actionContext: 'wix-mcp'
|
|
135
|
+
};
|
|
136
|
+
console.log('[editHarmonySite] request', {
|
|
137
|
+
editSiteRequest
|
|
138
|
+
});
|
|
139
|
+
try {
|
|
140
|
+
const response = await httpClient.post('https://manage.wix.com/_api/harmony-site-builder/edit-harmony-site', editSiteRequest, { headers: accountHeaders });
|
|
141
|
+
console.log('[editHarmonySite]: response:', response);
|
|
142
|
+
if (response.data.success) {
|
|
143
|
+
return {
|
|
144
|
+
success: true,
|
|
145
|
+
message: 'Successfully started editing your website',
|
|
146
|
+
jobId: response.data.jobId
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
return {
|
|
151
|
+
success: false,
|
|
152
|
+
message: response.data.message ||
|
|
153
|
+
'Failed to start editing your website using Harmony',
|
|
154
|
+
jobId: ''
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
console.error('[editHarmonySite]: error:', error);
|
|
160
|
+
return {
|
|
161
|
+
success: false,
|
|
162
|
+
message: `Failed to start editing your website using Harmony: ${error}`,
|
|
163
|
+
jobId: ''
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function getEditorUrl(siteId) {
|
|
168
|
+
const fakeInstanceId = uuidv4();
|
|
169
|
+
return `https://editor.wix.com/edit/od/${fakeInstanceId}?metaSiteId=${siteId}`;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/site-widget-tools/edit-site-tool/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEt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,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/site-widget-tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpAuthenticationStrategy } from '../../auth/index.js';
|
|
2
|
+
import { WixMcpServer } from '../../wix-mcp-server.js';
|
|
3
|
+
export declare function addPullSiteJobTool(server: WixMcpServer, authStrategy: McpAuthenticationStrategy): void;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/site-widget-tools/pull-site-creation-job-tool/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAQvD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,yBAAyB,QAmKxC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { createHttpClient } from '@wix/http-client';
|
|
2
|
+
import z from 'zod';
|
|
3
|
+
import { siteCreatedUsingWixMcpSrc39Evid1608 } from '@wix/bi-logger-wix-code-data/v2';
|
|
4
|
+
import { PULL_SITE_JOB_TOOL_NAME } from '../constants.js';
|
|
5
|
+
const httpClient = createHttpClient();
|
|
6
|
+
export function addPullSiteJobTool(server, authStrategy) {
|
|
7
|
+
const { getAccountAuthHeaders, getSiteAuthHeaders } = authStrategy;
|
|
8
|
+
server.registerTool(PULL_SITE_JOB_TOOL_NAME, {
|
|
9
|
+
title: 'Pull Site Job',
|
|
10
|
+
description: 'Pull the status of a site job',
|
|
11
|
+
inputSchema: {
|
|
12
|
+
jobId: z.string().describe('The job ID to pull')
|
|
13
|
+
},
|
|
14
|
+
annotations: {
|
|
15
|
+
readOnlyHint: true,
|
|
16
|
+
destructiveHint: false,
|
|
17
|
+
openWorldHint: false
|
|
18
|
+
},
|
|
19
|
+
_meta: {
|
|
20
|
+
'openai/toolInvocation/invoking': 'Fetching codegen job',
|
|
21
|
+
'openai/toolInvocation/invoked': 'Jobs retrieved',
|
|
22
|
+
'openai/visibility': 'private'
|
|
23
|
+
}
|
|
24
|
+
}, async (args, { biLogger, setToolBiParams }) => {
|
|
25
|
+
const { jobId } = args;
|
|
26
|
+
if (!jobId) {
|
|
27
|
+
console.log(`[pullSiteJob] Missing jobId, returning empty jobs`);
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: 'text', text: 'No job ID provided' }],
|
|
30
|
+
structuredContent: { job: null }
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
setToolBiParams({ jobId });
|
|
34
|
+
try {
|
|
35
|
+
const headers = await getAccountAuthHeaders();
|
|
36
|
+
const response = await httpClient.post('https://manage.wix.com/_api/harmony-site-builder/pull-job', { jobId }, { headers });
|
|
37
|
+
console.log('[pullSiteJob] Response:', response.data);
|
|
38
|
+
if (!response.data.success) {
|
|
39
|
+
return {
|
|
40
|
+
isError: true,
|
|
41
|
+
content: [{ type: 'text', text: 'Failed to pull job' }],
|
|
42
|
+
structuredContent: {
|
|
43
|
+
job: null,
|
|
44
|
+
error: 'Failed to pull job'
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const job = response.data.job;
|
|
49
|
+
const isEditJob = job.type === 'EDIT_SITE';
|
|
50
|
+
const pullJobMessage = job.status === 'COMPLETED'
|
|
51
|
+
? `Job completed. previewUrl: ${job.data?.previewUrl} editorUrl: ${job.data?.editorUrl} siteId: ${job.data?.siteId}`
|
|
52
|
+
: 'Job in progress';
|
|
53
|
+
if (job.status === 'COMPLETED' && job.data?.siteId) {
|
|
54
|
+
console.log(`[pullSiteJob] job is completed ${jobId}`);
|
|
55
|
+
try {
|
|
56
|
+
const siteHeaders = await getSiteAuthHeaders(job.data?.siteId);
|
|
57
|
+
let publishedSiteUrl;
|
|
58
|
+
if (!job.isPublished) {
|
|
59
|
+
console.log(`[pullSiteJob] site is not published ${jobId}, publishing...`, { job });
|
|
60
|
+
// Avoid duplicate publishing and reporting, by checking if the site not already published
|
|
61
|
+
if (isEditJob) {
|
|
62
|
+
// TODO: Add site updated event
|
|
63
|
+
// biLogger.report(
|
|
64
|
+
// siteUpdatedUsingWixMcpSrc39Evid1608({
|
|
65
|
+
// jobId,
|
|
66
|
+
// msid: job.data?.siteId,
|
|
67
|
+
// builderType: 'Harmony',
|
|
68
|
+
// duration: job.durationMs,
|
|
69
|
+
// sitePrompt: job.userPrompt
|
|
70
|
+
// })
|
|
71
|
+
// );
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
biLogger.report(siteCreatedUsingWixMcpSrc39Evid1608({
|
|
75
|
+
jobId,
|
|
76
|
+
msid: job.data?.siteId,
|
|
77
|
+
builderType: 'Harmony',
|
|
78
|
+
duration: job.durationInMinutes,
|
|
79
|
+
sitePrompt: job.userPrompt
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
publishedSiteUrl = await publishSite({
|
|
83
|
+
siteLevelToken: siteHeaders.Authorization,
|
|
84
|
+
siteId: job.data?.siteId,
|
|
85
|
+
jobId
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (publishedSiteUrl) {
|
|
89
|
+
job.data.previewUrl = publishedSiteUrl;
|
|
90
|
+
try {
|
|
91
|
+
await httpClient.post('https://manage.wix.com/_api/harmony-site-builder/update-job', {
|
|
92
|
+
jobId,
|
|
93
|
+
job: {
|
|
94
|
+
isPublished: true,
|
|
95
|
+
data: {
|
|
96
|
+
previewUrl: publishedSiteUrl
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, { headers });
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
console.error(`[pullSiteJob] Failed to update job published status ${jobId}`, { jobId, error: error.message });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
console.error(`[pullSiteJob] Failed to publish site for job ${jobId}`, { jobId, error: error.message });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
content: [
|
|
112
|
+
{
|
|
113
|
+
type: 'text',
|
|
114
|
+
text: `Job pulled successfully.\n${pullJobMessage}`
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
structuredContent: { job: response.data.job }
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
122
|
+
console.error(`[pullSiteJob] Error pulling job for job ${jobId}`, {
|
|
123
|
+
jobId,
|
|
124
|
+
error: errorMessage
|
|
125
|
+
});
|
|
126
|
+
return {
|
|
127
|
+
isError: true,
|
|
128
|
+
content: [{ type: 'text', text: 'Failed to pull job' }],
|
|
129
|
+
structuredContent: { job: null, error: errorMessage }
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
async function publishSite({ siteLevelToken, siteId, jobId }) {
|
|
135
|
+
const response = await httpClient.post('https://www.wixapis.com/site-publisher/v1/site/publish', {}, {
|
|
136
|
+
headers: {
|
|
137
|
+
Authorization: `Bearer ${siteLevelToken}`,
|
|
138
|
+
'wix-site-id': siteId
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
if (response.status !== 200) {
|
|
142
|
+
console.error(`[publishSite] Failed to publish site for job ${jobId}`, {
|
|
143
|
+
jobId,
|
|
144
|
+
error: response.statusText
|
|
145
|
+
});
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const publishedSiteUrl = await getPublishedSiteUrl({
|
|
149
|
+
siteLevelToken,
|
|
150
|
+
siteId,
|
|
151
|
+
jobId
|
|
152
|
+
});
|
|
153
|
+
if (!publishedSiteUrl) {
|
|
154
|
+
console.error(`[publishSite] Failed to get published site url for job ${jobId}`);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
return publishedSiteUrl;
|
|
158
|
+
}
|
|
159
|
+
async function getPublishedSiteUrl({ siteLevelToken, siteId, jobId }) {
|
|
160
|
+
try {
|
|
161
|
+
const response = await httpClient.get('https://www.wixapis.com/urls-server/v2/published-site-urls', {
|
|
162
|
+
headers: {
|
|
163
|
+
Authorization: `Bearer ${siteLevelToken}`,
|
|
164
|
+
'wix-site-id': siteId
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
if (response.data?.urls) {
|
|
168
|
+
const primaryUrl = response.data.urls.find((url) => !!url.primary);
|
|
169
|
+
return primaryUrl?.url ?? '';
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
console.error(`[pullSiteJob] Failed to get published site urls for job ${jobId}`, { jobId, error: error.message });
|
|
174
|
+
}
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/site-widget-tools/pull-site-creation-job-tool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,mCAAmC,EAAE,MAAM,iCAAiC,CAAC;AAEtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;AAEtC,MAAM,UAAU,kBAAkB,CAChC,MAAoB,EACpB,YAAuC;IAEvC,MAAM,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,GAAG,YAAY,CAAC;IA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AC;AAC1B,CAAC;AAED,KAAK,UAAU,mBAAmB,CAAC,EACjC,cAAc,EACd,MAAM,EACN,KAAK,EAKN;IACC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,GAAG,CAElC,4DAA4D,EAAE;YAC/D,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,cAAc,EAAE;gBACzC,aAAa,EAAE,MAAM;aACtB;SACF,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;YACxB,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACnE,OAAO,UAAU,EAAE,GAAG,IAAI,EAAE,CAAC;QAC/B,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CACX,2DAA2D,KAAK,EAAE,EAClE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAChC,CAAC;IACJ,CAAC;IACD,OAAO;AACT,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface GenerateHarmonySiteRequest {
|
|
2
|
+
userPrompt: string;
|
|
3
|
+
jobId?: string;
|
|
4
|
+
withScreenshots?: boolean;
|
|
5
|
+
actionContext?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GenerateHarmonySiteResponse {
|
|
8
|
+
success: boolean;
|
|
9
|
+
message?: string;
|
|
10
|
+
jobId?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface EditHarmonySiteRequest {
|
|
13
|
+
userPrompt: string;
|
|
14
|
+
jobId?: string;
|
|
15
|
+
siteId: string;
|
|
16
|
+
editorUrl: string;
|
|
17
|
+
withScreenshots?: boolean;
|
|
18
|
+
actionContext?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface EditHarmonySiteResponse {
|
|
21
|
+
success: boolean;
|
|
22
|
+
message?: string;
|
|
23
|
+
jobId?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface PullJobResponse {
|
|
26
|
+
success: boolean;
|
|
27
|
+
message?: string;
|
|
28
|
+
job: Job;
|
|
29
|
+
}
|
|
30
|
+
export interface UpdateJobResponse {
|
|
31
|
+
success: boolean;
|
|
32
|
+
message?: string;
|
|
33
|
+
job?: Job;
|
|
34
|
+
}
|
|
35
|
+
export interface Job {
|
|
36
|
+
id: string;
|
|
37
|
+
status: 'STARTED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
|
|
38
|
+
errorMessage?: string;
|
|
39
|
+
isPublished?: boolean;
|
|
40
|
+
createdAt?: Date;
|
|
41
|
+
updatedAt?: Date;
|
|
42
|
+
durationInMinutes?: number;
|
|
43
|
+
userPrompt: string;
|
|
44
|
+
progress?: string;
|
|
45
|
+
data?: {
|
|
46
|
+
editorUrl?: string;
|
|
47
|
+
siteId?: string;
|
|
48
|
+
previewUrl?: string;
|
|
49
|
+
};
|
|
50
|
+
type?: 'GENERATE_SITE' | 'EDIT_SITE';
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/site-widget-tools/pull-site-creation-job-tool/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IAEzC,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,sBAAsB;IAErC,UAA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","sources":["../../../../src/site-widget-tools/pull-site-creation-job-tool/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpAuthenticationStrategy } from '../../auth/index.js';
|
|
2
|
+
import { WixMcpServer } from '../../wix-mcp-server.js';
|
|
3
|
+
export declare function addCreateSiteWidgetTool(server: WixMcpServer, authStrategy: McpAuthenticationStrategy): void;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/site-widget-tools/site-builder-tool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAc,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAWvD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,yBAAyB,QAqJxC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createHttpClient } from '@wix/http-client';
|
|
3
|
+
import { getWidgetHtml } from '../../widget-manifest.js';
|
|
4
|
+
import { SITE_BUILDER_TOOL_NAME } from '../constants.js';
|
|
5
|
+
const httpClient = createHttpClient();
|
|
6
|
+
const CREATE_SITE_WIDGET_URI = 'ui://widget/wix-site-builder.html';
|
|
7
|
+
export function addCreateSiteWidgetTool(server, authStrategy) {
|
|
8
|
+
const { getAccountAuthHeaders } = authStrategy;
|
|
9
|
+
const toolMeta = (widgetPayload) => {
|
|
10
|
+
return {
|
|
11
|
+
'openai/toolInvocation/invoking': 'Creating your website...',
|
|
12
|
+
'openai/toolInvocation/invoked': 'Website creation in progress...',
|
|
13
|
+
'openai/outputTemplate': CREATE_SITE_WIDGET_URI,
|
|
14
|
+
'openai/widgetAccessible': true,
|
|
15
|
+
'openai/resultCanProduceWidget': true,
|
|
16
|
+
'openai/widgetCSP': {
|
|
17
|
+
connect_domains: [
|
|
18
|
+
'https://*.wix.com',
|
|
19
|
+
'https://*.wixsite.com',
|
|
20
|
+
'https://static.parastorage.com',
|
|
21
|
+
'https://cdn.openai.com'
|
|
22
|
+
],
|
|
23
|
+
resource_domains: [
|
|
24
|
+
'https://*.wix.com',
|
|
25
|
+
'https://*.wixsite.com',
|
|
26
|
+
'https://static.parastorage.com',
|
|
27
|
+
'https://cdn.openai.com'
|
|
28
|
+
],
|
|
29
|
+
frame_domains: ['https://*.wix.com', 'https://*.wixsite.com'],
|
|
30
|
+
redirect_domains: ['https://*.wix.com', 'https://*.wixsite.com']
|
|
31
|
+
},
|
|
32
|
+
'openai/widgetDescription': "Displays a live progress showing your website being built, including site generation status and a link to the editor. When it's ready, it will show a live preview of the website.",
|
|
33
|
+
...(widgetPayload ? { widgetPayload } : {})
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
// Add site builder widget resource
|
|
37
|
+
server.registerResource(`${SITE_BUILDER_TOOL_NAME}_RESOURCE`, CREATE_SITE_WIDGET_URI, {}, async (uri) => {
|
|
38
|
+
return {
|
|
39
|
+
contents: [
|
|
40
|
+
{
|
|
41
|
+
uri: uri.href,
|
|
42
|
+
_meta: toolMeta(),
|
|
43
|
+
mimeType: 'text/html+skybridge',
|
|
44
|
+
text: getWidgetHtml({ widgetId: 'buildWixSite' })
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
// Add site builder tool that communicates with the widget
|
|
50
|
+
server.registerTool(SITE_BUILDER_TOOL_NAME, {
|
|
51
|
+
title: 'Wix Site Builder',
|
|
52
|
+
description: `A tool that builds a site using Wix. Use this ONLY when the user explicitly asks to build/create/generate a site/website/application. The widget resource is available at ${CREATE_SITE_WIDGET_URI}.
|
|
53
|
+
Keep the prompt short and concise, single page site if possible, do not add pages that are not explicitly requested. `,
|
|
54
|
+
inputSchema: {
|
|
55
|
+
jobId: z
|
|
56
|
+
.string()
|
|
57
|
+
.optional()
|
|
58
|
+
.describe('The job ID of the site build. If not provided, a new job will be created.'),
|
|
59
|
+
sitePrompt: z
|
|
60
|
+
.string()
|
|
61
|
+
.describe('The prompt to build the site. Keep the prompt short and concise, single page site if possible, do not add pages that are not explicitly requested. If not provided, the user will be asked to provide a prompt.')
|
|
62
|
+
},
|
|
63
|
+
_meta: toolMeta(),
|
|
64
|
+
annotations: {
|
|
65
|
+
readOnlyHint: true,
|
|
66
|
+
destructiveHint: false,
|
|
67
|
+
openWorldHint: false
|
|
68
|
+
}
|
|
69
|
+
}, async (args, { setToolBiParams }) => {
|
|
70
|
+
console.log(`[${SITE_BUILDER_TOOL_NAME}] 🚀 Start Building Your Site tool invoked!`, { prompt: args.sitePrompt, jobId: args.jobId });
|
|
71
|
+
const accountHeaders = await getAccountAuthHeaders();
|
|
72
|
+
let jobId;
|
|
73
|
+
// Priority: 1. Explicit jobId from args, 2. Last saved jobId, 3. Create new job
|
|
74
|
+
if (args.jobId) {
|
|
75
|
+
console.log(`[${SITE_BUILDER_TOOL_NAME}] Using provided jobId:`, args.jobId);
|
|
76
|
+
jobId = args.jobId;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
// Create new job
|
|
80
|
+
const { success, jobId: newJobId, message } = await buildHarmonySite({
|
|
81
|
+
userPrompt: args.sitePrompt,
|
|
82
|
+
accountHeaders
|
|
83
|
+
});
|
|
84
|
+
setToolBiParams({ jobId: newJobId });
|
|
85
|
+
if (!success || !newJobId) {
|
|
86
|
+
return {
|
|
87
|
+
isError: true,
|
|
88
|
+
content: [
|
|
89
|
+
{
|
|
90
|
+
type: 'text',
|
|
91
|
+
text: message
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
structuredContent: {
|
|
95
|
+
success: false,
|
|
96
|
+
status: message,
|
|
97
|
+
jobId: null
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
jobId = newJobId;
|
|
102
|
+
console.log(`[${SITE_BUILDER_TOOL_NAME}] Created new job:`, jobId);
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
content: [
|
|
106
|
+
{
|
|
107
|
+
type: 'text',
|
|
108
|
+
text: 'Respond only with a confirmation that the website build has started and that progress is available in the widget. No other content is allowed. DO NOT mention jobId.'
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
structuredContent: {
|
|
112
|
+
success: true,
|
|
113
|
+
status: 'Respond only with a confirmation that the website build has started and that progress is available in the widget. No other content is allowed. DO NOT mention jobId.',
|
|
114
|
+
jobId // Return jobId so model can use it in future calls
|
|
115
|
+
},
|
|
116
|
+
_meta: toolMeta({ jobId, extras: server.getWidgetExtras() })
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async function buildHarmonySite({ userPrompt, accountHeaders }) {
|
|
121
|
+
const buildSiteRequest = {
|
|
122
|
+
userPrompt,
|
|
123
|
+
withScreenshots: true,
|
|
124
|
+
actionContext: 'wix-mcp'
|
|
125
|
+
};
|
|
126
|
+
console.log('[buildHarmonySite] request', {
|
|
127
|
+
buildSiteRequest
|
|
128
|
+
});
|
|
129
|
+
try {
|
|
130
|
+
const response = await httpClient.post('https://manage.wix.com/_api/harmony-site-builder/generate-harmony-site', buildSiteRequest, { headers: accountHeaders });
|
|
131
|
+
console.log('[buildHarmonySite]: response:', response);
|
|
132
|
+
if (response.data.success) {
|
|
133
|
+
return {
|
|
134
|
+
success: true,
|
|
135
|
+
message: 'Successfully started building your website',
|
|
136
|
+
jobId: response.data.jobId
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
return {
|
|
141
|
+
success: false,
|
|
142
|
+
message: response.data.message ||
|
|
143
|
+
'Failed to start building your website using Harmony',
|
|
144
|
+
jobId: ''
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
console.error('[buildHarmonySite]: error:', error);
|
|
150
|
+
return {
|
|
151
|
+
success: false,
|
|
152
|
+
message: `Failed to start building your website using Harmony: ${error}`,
|
|
153
|
+
jobId: ''
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/site-widget-tools/site-builder-tool/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;AAEtC,MAAM,sBAAsB,GAAG,mCAAmC,CAAC;AAEnE,MAAM,UAAU,uBAAuB,CACrC,MAAoB,EACpB,YAAuC;IAEvC,MAAM,EAAE,qBAAqB,EAAE,GAAG,YAAY,CAAC;IAE/C,MAAM,QAAQ,GAAG,CAAC,aAAgD,EAAE,EAAE;QACpE,OAAO;YACL,gCAAgC,EAAE,0BAA0B;YAC5D,+BAA+B,EAAE,iCAAiC;YAClE,uBAAuB,EAAE,sBAAsB;YAC/C,yBAAyB,EAAE,IAAI;YAC/B,+BAA+B,EAAE,IAAI;YACrC,kBAAkB,EAAE;gBAClB,eAAe,EAAE;oBACf,mBAAmB;oBACnB,uBAAuB;oBACvB,gCAAgC;oBAChC,wBAAwB;iBACzB;gBACD,gBAAgB,EAAE;oBAChB,mBAAmB;oBACnB,uBAAuB;oBACvB,gCAAgC;oBAChC,wBAAwB;iBACzB;gBACD,aAAa,EAAE,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;gBAC7D,gBAAgB,EAAE,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;aACjE;YACD,0BAA0B,EACxB,oLAAoL;YACtL,GAAG,CAAC,aAAa,CAAC,CAA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EAIf;IAKC,MAAM,gBAAgB,GAAG;QACvB,UAAU;QACV,eAAe,EAAE,IAAI;QACrB,aAAa,EAAE,SAAS;KACzB,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE;QACxC,gBAAgB;KACjB,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,IAAI,CAKpC,wEAAwE,EACxE,gBAAgB,EAChB,EAAE,OAAO,EAAE,cAAc,EAAE,CAC5B,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC;QACvD,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAC1B,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,4CAA4C;gBACrD,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK;aAC3B,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EACL,QAAQ,CAAC,IAAI,CAAC,OAAO;oBACrB,qDAAqD;gBACvD,KAAK,EAAE,EAAE;aACV,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;QACnD,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,wDAAwD,KAAK,EAAE;YACxE,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { WixMcpServer } from '../wix-mcp-server.js';
|
|
2
|
-
export declare function addSupportTool(server: WixMcpServer): void;
|
|
2
|
+
export declare function addSupportTool(server: WixMcpServer, disableTools?: string[], toolDescriptions?: Record<string, string>): void;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/support/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/support/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIpD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,YAAY,GAAE,MAAM,EAAO,EAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAoC1C"}
|