@wix/mcp 1.0.80 → 1.0.82
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/README.md +1 -1
- package/build/bin-standalone.js +93 -31
- package/build/cjs/index.cjs +151 -380
- package/build/cjs/toolkit.cjs +97 -33
- package/build/dts/api-call/index.js +41 -3
- package/build/dts/code-mode/index.js +8 -2
- package/build/dts/config/api-request-rules.d.ts +11 -0
- package/build/dts/config/api-request-rules.js +11 -0
- package/build/dts/config/default-config.js +13 -3
- package/build/dts/config/param-descriptions.d.ts +1 -1
- package/build/dts/config/param-descriptions.js +5 -3
- package/build/dts/docs/docs.js +6 -6
- package/build/dts/import-claude-design-tool/index.js +2 -2
- package/build/dts/infra/tool-bi.d.ts +1 -1
- package/build/dts/infra/tool-bi.js +3 -2
- package/build/dts/site-widget-tools/constants.d.ts +12 -5
- package/build/dts/site-widget-tools/constants.js +20 -11
- package/build/dts/site-widget-tools/site-builder-tool/index.js +1 -1
- package/build/dts/site-widget-tools/site-creation-tool/index.js +3 -2
- package/build/dts/site-widget-tools/suggested-domain-tool/index.js +23 -5
- package/build/dts/toolkit-entry.d.cts +1 -1
- package/build/dts/toolkit-entry.d.ts +1 -1
- package/build/dts/toolkit.js +4 -1
- package/build/dts/wix-mcp-server.d.ts +4 -0
- package/build/dts/wix-mcp-server.js +9 -1
- package/build/dts/wixel/api.d.ts +0 -60
- package/build/dts/wixel/api.js +1 -50
- package/build/dts/wixel/constants.d.ts +0 -1
- package/build/dts/wixel/constants.js +0 -1
- package/build/dts/wixel/index.d.ts +0 -3
- package/build/dts/wixel/index.js +0 -9
- package/build/esm/index.js +151 -377
- package/build/esm/toolkit.js +97 -33
- package/package.json +3 -3
- package/build/dts/wixel/open-headless-wixel-project-tool.d.ts +0 -6
- package/build/dts/wixel/open-headless-wixel-project-tool.js +0 -84
- package/build/dts/wixel/pull-headless-wixel-job-tool.d.ts +0 -6
- package/build/dts/wixel/pull-headless-wixel-job-tool.js +0 -61
- package/build/dts/wixel/update-headless-wixel-job-tool.d.ts +0 -6
- package/build/dts/wixel/update-headless-wixel-job-tool.js +0 -106
|
@@ -11,7 +11,7 @@ export function extractText(result) {
|
|
|
11
11
|
.join('\n');
|
|
12
12
|
}
|
|
13
13
|
const TOOL_RESULT_PREVIEW_MAX_CHARS = 4000;
|
|
14
|
-
export function formatToolResultAdditionalFields(result) {
|
|
14
|
+
export function formatToolResultAdditionalFields(result, extras) {
|
|
15
15
|
const resultText = extractText(result);
|
|
16
16
|
const contentTypes = [
|
|
17
17
|
...new Set(result.content?.map((content) => content.type) ?? [])
|
|
@@ -23,7 +23,8 @@ export function formatToolResultAdditionalFields(result) {
|
|
|
23
23
|
resultPreview: resultText.slice(0, TOOL_RESULT_PREVIEW_MAX_CHARS),
|
|
24
24
|
resultTextLength: resultText.length,
|
|
25
25
|
resultPreviewTruncated: resultText.length > TOOL_RESULT_PREVIEW_MAX_CHARS,
|
|
26
|
-
resultContentTypes: contentTypes
|
|
26
|
+
resultContentTypes: contentTypes,
|
|
27
|
+
...extras
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
export function createToolBiEvent(params) {
|
|
@@ -14,12 +14,19 @@ export declare const SITE_CREATION_DEFAULT_ACTIONS = "add products, set up booki
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const SITE_CREATION_CUSTOM_ACTIONS_GUIDANCE = "2\u20133 specific, high-value setup actions for the site's industry, written as a comma-separated phrase (it slots into \"\u2026ask me to ___ right here in the chat\"). Use the following domain patterns as guidance:\n* E-commerce / Retail: \"add products, set up payment methods, and organize collections\"\n* Restaurants / Food / Bakeries: \"add menu items, set up online ordering, and collect table reservations\"\n* Services / Fitness / Salons / Consultants: \"set up booking slots, add service pricing, and manage appointments\"\n* Creative / Portfolios / Photographers: \"upload project galleries, feature client reviews, and customize contact forms\"\n* Events / Weddings / Real Estate: \"add event schedules, display listings, and manage RSVP forms\"\n* General / Unspecified: \"add products, set up bookings, and adjust your content\"\nIf none of these patterns fit the site, infer 2\u20133 actions that suit what that kind of business would manage on its site.";
|
|
16
16
|
/**
|
|
17
|
-
* Builds the WixSiteCreation chooser reply. The message is fully composed here and wrapped in
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* Builds the WixSiteCreation chooser reply. The message is fully composed here and wrapped in a
|
|
18
|
+
* preamble that tells the host model to display the body verbatim (keeping the bullets and line
|
|
19
|
+
* breaks). The site type comes from `query`; the "Next up:" actions come from the inferred
|
|
20
|
+
* `customActions`.
|
|
21
|
+
*
|
|
22
|
+
* With `plain`, only the message itself is returned. Microsoft 365 Copilot's safety filter reads
|
|
23
|
+
* instructions inside a tool result ("you are the assistant…", "word for word…") as prompt
|
|
24
|
+
* injection and blocks the whole reply ("Sorry, it looks like I can't chat about this"); there the
|
|
25
|
+
* verbatim-reply instruction lives only in the tool description.
|
|
21
26
|
*/
|
|
22
|
-
export declare function buildSiteCreationSelectorMessage(siteType?: string, customActions?: string
|
|
27
|
+
export declare function buildSiteCreationSelectorMessage(siteType?: string, customActions?: string, { plain }?: {
|
|
28
|
+
plain?: boolean;
|
|
29
|
+
}): string;
|
|
23
30
|
/** OpenAI/ChatGPT widget MIME type for Skybridge rendering */
|
|
24
31
|
export declare const OPENAI_WIDGET_MIME_TYPE = "text/html+skybridge";
|
|
25
32
|
/**
|
|
@@ -23,14 +23,28 @@ export const SITE_CREATION_CUSTOM_ACTIONS_GUIDANCE = `2–3 specific, high-value
|
|
|
23
23
|
* General / Unspecified: "${SITE_CREATION_DEFAULT_ACTIONS}"
|
|
24
24
|
If none of these patterns fit the site, infer 2–3 actions that suit what that kind of business would manage on its site.`;
|
|
25
25
|
/**
|
|
26
|
-
* Builds the WixSiteCreation chooser reply. The message is fully composed here and wrapped in
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
26
|
+
* Builds the WixSiteCreation chooser reply. The message is fully composed here and wrapped in a
|
|
27
|
+
* preamble that tells the host model to display the body verbatim (keeping the bullets and line
|
|
28
|
+
* breaks). The site type comes from `query`; the "Next up:" actions come from the inferred
|
|
29
|
+
* `customActions`.
|
|
30
|
+
*
|
|
31
|
+
* With `plain`, only the message itself is returned. Microsoft 365 Copilot's safety filter reads
|
|
32
|
+
* instructions inside a tool result ("you are the assistant…", "word for word…") as prompt
|
|
33
|
+
* injection and blocks the whole reply ("Sorry, it looks like I can't chat about this"); there the
|
|
34
|
+
* verbatim-reply instruction lives only in the tool description.
|
|
30
35
|
*/
|
|
31
|
-
export function buildSiteCreationSelectorMessage(siteType, customActions) {
|
|
36
|
+
export function buildSiteCreationSelectorMessage(siteType, customActions, { plain = false } = {}) {
|
|
32
37
|
const type = (siteType ?? '').trim() || 'new';
|
|
33
38
|
const actions = (customActions ?? '').trim() || SITE_CREATION_DEFAULT_ACTIONS;
|
|
39
|
+
const body = `Ready to set up your ${type} site? Choose your path in the widget above:
|
|
40
|
+
|
|
41
|
+
* **Build with AI** for a custom, tailor-made layout
|
|
42
|
+
* **Pick a template** to start with a pre-designed layout
|
|
43
|
+
|
|
44
|
+
**Next up:** Once your site is created, you can customize it in Wix or ask me to ${actions}—right here in the chat!`;
|
|
45
|
+
if (plain) {
|
|
46
|
+
return body;
|
|
47
|
+
}
|
|
34
48
|
return `You are the assistant replying to the user — say this message out loud in chat (do NOT stay silent, and do NOT just point at the widget). Your reply is only complete if it includes ALL of the following, word for word, each on its own line and in this order:
|
|
35
49
|
1. "Ready to set up your ${type} site? Choose your path in the widget above:" — keep the "Choose your path in the widget above:" part.
|
|
36
50
|
2. "* **Build with AI** for a custom, tailor-made layout"
|
|
@@ -39,12 +53,7 @@ export function buildSiteCreationSelectorMessage(siteType, customActions) {
|
|
|
39
53
|
|
|
40
54
|
Copy those four lines as written; do not summarize, shorten, reorder, or reword any of them. Here is the full message to send:
|
|
41
55
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* **Build with AI** for a custom, tailor-made layout
|
|
45
|
-
* **Pick a template** to start with a pre-designed layout
|
|
46
|
-
|
|
47
|
-
**Next up:** Once your site is created, you can customize it in Wix or ask me to ${actions}—right here in the chat!`;
|
|
56
|
+
${body}`;
|
|
48
57
|
}
|
|
49
58
|
/** OpenAI/ChatGPT widget MIME type for Skybridge rendering */
|
|
50
59
|
export const OPENAI_WIDGET_MIME_TYPE = 'text/html+skybridge';
|
|
@@ -67,7 +67,7 @@ export function addCreateSiteWidgetTool(server, authStrategy, options) {
|
|
|
67
67
|
suggestedSiteName: z
|
|
68
68
|
.string()
|
|
69
69
|
.optional()
|
|
70
|
-
.describe('
|
|
70
|
+
.describe('You must provide this on every call, including updates to an existing job, in English. A short name for the site: the business name the user gave, or one you derive from the site prompt.')
|
|
71
71
|
},
|
|
72
72
|
_meta: toolDefinitionMeta,
|
|
73
73
|
annotations: {
|
|
@@ -85,8 +85,9 @@ export function addWixSiteCreationTool(server, _authStrategy, options) {
|
|
|
85
85
|
// Reply instruction: a fixed SHAPE (question + the two options + a "Next up:" line) built
|
|
86
86
|
// from the query (site type) and the inferred customActions, with the two option lines left
|
|
87
87
|
// for the model to tailor to the industry. Returned as-is; the tool description also
|
|
88
|
-
// instructs the model to write it out (both are load-bearing).
|
|
89
|
-
|
|
88
|
+
// instructs the model to write it out (both are load-bearing). Microsoft Copilot gets the
|
|
89
|
+
// message without the preamble: its safety filter blocks the reply otherwise.
|
|
90
|
+
const message = buildSiteCreationSelectorMessage(args.query, args.customActions, { plain: server.isMicrosoftCopilotClient() });
|
|
90
91
|
return withJsonContent({
|
|
91
92
|
content: [
|
|
92
93
|
{
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { rethrowIfUnauthorized } from '../../auth/index.js';
|
|
2
2
|
import z from 'zod';
|
|
3
|
+
import dedent from 'dedent';
|
|
3
4
|
import { GET_SUGGESTED_DOMAINS_TOOL_NAME } from '../constants.js';
|
|
4
5
|
const WIX_APIS_BASE_URL = 'https://www.wixapis.com';
|
|
6
|
+
// Sites keep this placeholder until the owner renames them, and domain search
|
|
7
|
+
// rejects it as a blacklisted term.
|
|
8
|
+
const DEFAULT_SITE_NAME = /^my site(\s+\d+)?$/i;
|
|
9
|
+
function isDefaultSiteName(siteName) {
|
|
10
|
+
return DEFAULT_SITE_NAME.test(siteName.trim());
|
|
11
|
+
}
|
|
5
12
|
async function fetchSiteDisplayName(siteAuthorization, siteId) {
|
|
6
13
|
const response = await fetch(`${WIX_APIS_BASE_URL}/site-properties/v4/properties`, {
|
|
7
14
|
headers: {
|
|
@@ -19,7 +26,15 @@ export function addSuggestedDomainTool(server, authStrategy) {
|
|
|
19
26
|
const { getSiteAuthHeaders, isAnonymous } = authStrategy;
|
|
20
27
|
server.registerTool(GET_SUGGESTED_DOMAINS_TOOL_NAME, {
|
|
21
28
|
title: 'Get Suggested Domains',
|
|
22
|
-
description:
|
|
29
|
+
description: dedent `
|
|
30
|
+
Suggests available domain names for a business, brand, or Wix site.
|
|
31
|
+
|
|
32
|
+
Call this when the user asks for domain name ideas, wants to know which domains are available, or wants a domain for a new or existing site.
|
|
33
|
+
|
|
34
|
+
Provide either a free-text \`query\` (the user's own words, e.g. "pancakes business", "modern yoga studio") OR a \`siteId\` to base the suggestions on that site's name. At least one of them is required.
|
|
35
|
+
|
|
36
|
+
Present the returned domains to the user as a short list. This tool only suggests domains — it does not purchase or connect them.
|
|
37
|
+
`,
|
|
23
38
|
inputSchema: {
|
|
24
39
|
query: z
|
|
25
40
|
.string()
|
|
@@ -45,10 +60,11 @@ export function addSuggestedDomainTool(server, authStrategy) {
|
|
|
45
60
|
},
|
|
46
61
|
_meta: {
|
|
47
62
|
securitySchemes: [{ type: 'oauth2', scopes: ['offline_access'] }],
|
|
48
|
-
|
|
63
|
+
// Model-visible so hosts (e.g. Microsoft 365 Copilot) can call it directly and show it
|
|
64
|
+
// in their debug info; 'app' keeps it callable from the site-builder widget.
|
|
65
|
+
ui: { visibility: ['app', 'model'] },
|
|
49
66
|
'openai/toolInvocation/invoking': 'Fetching suggested domains',
|
|
50
|
-
'openai/toolInvocation/invoked': 'Suggested domains retrieved'
|
|
51
|
-
'openai/visibility': 'private'
|
|
67
|
+
'openai/toolInvocation/invoked': 'Suggested domains retrieved'
|
|
52
68
|
}
|
|
53
69
|
}, async (args, { panorama }) => {
|
|
54
70
|
console.log('[getSuggestedDomains] Invoked with args:', args);
|
|
@@ -90,7 +106,9 @@ export function addSuggestedDomainTool(server, authStrategy) {
|
|
|
90
106
|
structuredContent: { domains: [] }
|
|
91
107
|
};
|
|
92
108
|
}
|
|
93
|
-
resolvedQuery
|
|
109
|
+
if (!isDefaultSiteName(siteName) || !resolvedQuery) {
|
|
110
|
+
resolvedQuery = siteName;
|
|
111
|
+
}
|
|
94
112
|
}
|
|
95
113
|
catch (error) {
|
|
96
114
|
panorama
|
|
@@ -169,7 +169,7 @@ export interface ToolHintsConfig {
|
|
|
169
169
|
* and concatenates text blocks with newlines.
|
|
170
170
|
*/
|
|
171
171
|
export declare function extractText(result: WixToolCallResult): string;
|
|
172
|
-
export declare function formatToolResultAdditionalFields(result: WixToolCallResult): string | undefined;
|
|
172
|
+
export declare function formatToolResultAdditionalFields(result: WixToolCallResult, extras?: Record<string, unknown>): string | undefined;
|
|
173
173
|
/** A single tool extracted from @wix/mcp, ready to execute. */
|
|
174
174
|
export interface WixTool {
|
|
175
175
|
/** Tool name (e.g. 'CallWixSiteAPI', 'SearchWixRESTDocumentation') */
|
|
@@ -169,7 +169,7 @@ export interface ToolHintsConfig {
|
|
|
169
169
|
* and concatenates text blocks with newlines.
|
|
170
170
|
*/
|
|
171
171
|
export declare function extractText(result: WixToolCallResult): string;
|
|
172
|
-
export declare function formatToolResultAdditionalFields(result: WixToolCallResult): string | undefined;
|
|
172
|
+
export declare function formatToolResultAdditionalFields(result: WixToolCallResult, extras?: Record<string, unknown>): string | undefined;
|
|
173
173
|
/** A single tool extracted from @wix/mcp, ready to execute. */
|
|
174
174
|
export interface WixTool {
|
|
175
175
|
/** Tool name (e.g. 'CallWixSiteAPI', 'SearchWixRESTDocumentation') */
|
package/build/dts/toolkit.js
CHANGED
|
@@ -300,7 +300,10 @@ export function createWixToolkit(options) {
|
|
|
300
300
|
errorBody = extractText(cbResult);
|
|
301
301
|
}
|
|
302
302
|
else {
|
|
303
|
-
additionalFields = formatToolResultAdditionalFields(cbResult
|
|
303
|
+
additionalFields = formatToolResultAdditionalFields(cbResult, {
|
|
304
|
+
returnedRows: toolBiParams.returnedRows,
|
|
305
|
+
originalLength: toolBiParams.originalLength
|
|
306
|
+
});
|
|
304
307
|
}
|
|
305
308
|
// Panorama: finish or report error
|
|
306
309
|
if (!isDevEnvironment) {
|
|
@@ -17,6 +17,8 @@ interface ToolBiParams {
|
|
|
17
17
|
conversationId?: string;
|
|
18
18
|
projectId?: string;
|
|
19
19
|
assetId?: string;
|
|
20
|
+
returnedRows?: number;
|
|
21
|
+
originalLength?: number;
|
|
20
22
|
}
|
|
21
23
|
type WixRequestHandlerExtra = RequestHandlerExtra<any, any> & {
|
|
22
24
|
logger: Logger;
|
|
@@ -56,6 +58,8 @@ export declare class WixMcpServer extends McpServer {
|
|
|
56
58
|
setOpenAiMcpAppsEnabled(enabled: boolean): void;
|
|
57
59
|
setMcpAppsInMcpEnabled(enabled: boolean): void;
|
|
58
60
|
isMcpAppsInMcpEnabled(): boolean;
|
|
61
|
+
/** Microsoft 365 Copilot ("sydney" at runtime) or Copilot Cowork ("copilot"). */
|
|
62
|
+
isMicrosoftCopilotClient(): boolean;
|
|
59
63
|
shouldRenderMcpApps(): boolean;
|
|
60
64
|
getWidgetExtras(): WidgetExtras;
|
|
61
65
|
tool(name: string, cb: WixToolCallback): RegisteredTool;
|
|
@@ -60,6 +60,11 @@ export class WixMcpServer extends McpServer {
|
|
|
60
60
|
isMcpAppsInMcpEnabled() {
|
|
61
61
|
return this.mcpAppsInMcpEnabled;
|
|
62
62
|
}
|
|
63
|
+
/** Microsoft 365 Copilot ("sydney" at runtime) or Copilot Cowork ("copilot"). */
|
|
64
|
+
isMicrosoftCopilotClient() {
|
|
65
|
+
const clientName = this.getClientName?.()?.toLowerCase() ?? '';
|
|
66
|
+
return clientName.includes('sydney') || clientName.includes('copilot');
|
|
67
|
+
}
|
|
63
68
|
shouldRenderMcpApps() {
|
|
64
69
|
const clientName = this.getClientName?.()?.toLowerCase();
|
|
65
70
|
const isOpenAi = clientName?.includes('openai') ?? false;
|
|
@@ -175,7 +180,10 @@ export class WixMcpServer extends McpServer {
|
|
|
175
180
|
errorBody = extractText(cbResult);
|
|
176
181
|
}
|
|
177
182
|
else {
|
|
178
|
-
additionalFields = formatToolResultAdditionalFields(cbResult
|
|
183
|
+
additionalFields = formatToolResultAdditionalFields(cbResult, {
|
|
184
|
+
returnedRows: toolBiParams.returnedRows,
|
|
185
|
+
originalLength: toolBiParams.originalLength
|
|
186
|
+
});
|
|
179
187
|
}
|
|
180
188
|
if (toolSucceeded && !isDevEnvironment) {
|
|
181
189
|
panorama.transaction(toolName).finish({ toolInvocationId });
|
package/build/dts/wixel/api.d.ts
CHANGED
|
@@ -48,66 +48,6 @@ export interface PublishAssetOptions {
|
|
|
48
48
|
apiBaseURL?: string;
|
|
49
49
|
conductorOverride?: string;
|
|
50
50
|
}
|
|
51
|
-
export type WixelJobStatus = 'STARTED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
|
|
52
|
-
export interface WixelJob {
|
|
53
|
-
id: string;
|
|
54
|
-
status: WixelJobStatus;
|
|
55
|
-
errorMessage?: string;
|
|
56
|
-
userPrompt?: string;
|
|
57
|
-
createdAt?: Date;
|
|
58
|
-
updatedAt?: Date;
|
|
59
|
-
durationInMinutes?: number;
|
|
60
|
-
data?: {
|
|
61
|
-
siteId?: string;
|
|
62
|
-
assetId?: string;
|
|
63
|
-
projectId?: string;
|
|
64
|
-
conversationId?: string;
|
|
65
|
-
};
|
|
66
|
-
type?: string;
|
|
67
|
-
userId?: string;
|
|
68
|
-
accountId?: string;
|
|
69
|
-
shouldRefresh?: boolean;
|
|
70
|
-
thumbnailUrl?: string;
|
|
71
|
-
}
|
|
72
|
-
export interface OpenHeadlessWixelProjectOptions {
|
|
73
|
-
accountAuthHeaders: Record<string, string>;
|
|
74
|
-
apiBaseURL?: string;
|
|
75
|
-
url: string;
|
|
76
|
-
userPrompt: string;
|
|
77
|
-
jobId: string;
|
|
78
|
-
siteId: string;
|
|
79
|
-
projectId: string;
|
|
80
|
-
conversationId: string;
|
|
81
|
-
withScreenshots?: boolean;
|
|
82
|
-
useProvidedCookies?: boolean;
|
|
83
|
-
timeout?: number;
|
|
84
|
-
conductorOverride?: string;
|
|
85
|
-
}
|
|
86
|
-
export declare function openHeadlessWixelProject({ accountAuthHeaders, apiBaseURL, url, userPrompt, jobId, siteId, projectId, conversationId, withScreenshots, useProvidedCookies, timeout, conductorOverride }: OpenHeadlessWixelProjectOptions): Promise<any>;
|
|
87
|
-
export interface UpdateHeadlessWixelJobOptions {
|
|
88
|
-
accountAuthHeaders: Record<string, string>;
|
|
89
|
-
job: WixelJob;
|
|
90
|
-
apiBaseURL?: string;
|
|
91
|
-
conductorOverride?: string;
|
|
92
|
-
}
|
|
93
|
-
export interface UpdateHeadlessWixelJobResponse {
|
|
94
|
-
success: boolean;
|
|
95
|
-
message?: string;
|
|
96
|
-
job?: WixelJob;
|
|
97
|
-
}
|
|
98
|
-
export declare function updateHeadlessWixelJob({ accountAuthHeaders, job, apiBaseURL, conductorOverride }: UpdateHeadlessWixelJobOptions): Promise<UpdateHeadlessWixelJobResponse>;
|
|
99
|
-
export interface PullHeadlessWixelJobOptions {
|
|
100
|
-
accountAuthHeaders: Record<string, string>;
|
|
101
|
-
apiBaseURL?: string;
|
|
102
|
-
jobId: string;
|
|
103
|
-
conductorOverride?: string;
|
|
104
|
-
}
|
|
105
|
-
export interface PullWixelJobResponse {
|
|
106
|
-
success: boolean;
|
|
107
|
-
message?: string;
|
|
108
|
-
job?: WixelJob;
|
|
109
|
-
}
|
|
110
|
-
export declare function pullHeadlessWixelJob({ accountAuthHeaders, apiBaseURL, jobId, conductorOverride }: PullHeadlessWixelJobOptions): Promise<PullWixelJobResponse>;
|
|
111
51
|
export interface GetStylePresetsOptions {
|
|
112
52
|
siteAuthHeaders: Record<string, string>;
|
|
113
53
|
stylePresetIds: string[];
|
package/build/dts/wixel/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHttpClient } from '@wix/http-client';
|
|
2
2
|
import { getProcessWidgetStatus, markJobConversationEnded } from '@wix/ambassador-wixel-assistant-v1-no-entity/http';
|
|
3
3
|
import { realtimeGetAsset, listAssetsByProjectId } from '@wix/ambassador-www-asset-v1-asset/http';
|
|
4
|
-
import { WIXEL_ASSISTANT_V1_NO_ENTITY_API_BASE_URL, WWW_ASSET_V1_ASSET_API_BASE_URL
|
|
4
|
+
import { WIXEL_ASSISTANT_V1_NO_ENTITY_API_BASE_URL, WWW_ASSET_V1_ASSET_API_BASE_URL } from './constants.js';
|
|
5
5
|
const CONDUCTOR_OVERRIDE_HEADERS = {
|
|
6
6
|
Cookie: 'petri_ovr=specs.wixel-slides.enableInWixel#true|specs.wixel-assistant.sidePanelEnabled#true|creditTransactionsPremiumIntegration#A'
|
|
7
7
|
};
|
|
@@ -66,55 +66,6 @@ export async function queryAssets({ siteAuthHeaders, projectId, apiBaseURL = WWW
|
|
|
66
66
|
const { data: { assets } } = await httpClient.request(listAssetsByProjectId({ projectId }));
|
|
67
67
|
return { assets };
|
|
68
68
|
}
|
|
69
|
-
export async function openHeadlessWixelProject({ accountAuthHeaders, apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL, url, userPrompt, jobId, siteId, projectId, conversationId, withScreenshots, useProvidedCookies, timeout, conductorOverride }) {
|
|
70
|
-
const httpClient = createHttpClient({
|
|
71
|
-
headers: {
|
|
72
|
-
...COMMON_HEADERS,
|
|
73
|
-
...accountAuthHeaders,
|
|
74
|
-
...(conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {}),
|
|
75
|
-
'Content-Type': 'application/json'
|
|
76
|
-
},
|
|
77
|
-
baseURL: apiBaseURL
|
|
78
|
-
});
|
|
79
|
-
const response = await httpClient.post('/_api/harmony-site-builder/open-wixel-project', {
|
|
80
|
-
url,
|
|
81
|
-
userPrompt,
|
|
82
|
-
jobId,
|
|
83
|
-
siteId,
|
|
84
|
-
projectId,
|
|
85
|
-
conversationId,
|
|
86
|
-
withScreenshots,
|
|
87
|
-
useProvidedCookies,
|
|
88
|
-
timeout
|
|
89
|
-
});
|
|
90
|
-
return response.data;
|
|
91
|
-
}
|
|
92
|
-
export async function updateHeadlessWixelJob({ accountAuthHeaders, job, apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL, conductorOverride }) {
|
|
93
|
-
const httpClient = createHttpClient({
|
|
94
|
-
headers: {
|
|
95
|
-
...COMMON_HEADERS,
|
|
96
|
-
...accountAuthHeaders,
|
|
97
|
-
...(conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {}),
|
|
98
|
-
'Content-Type': 'application/json'
|
|
99
|
-
},
|
|
100
|
-
baseURL: apiBaseURL
|
|
101
|
-
});
|
|
102
|
-
const response = await httpClient.post('/_api/harmony-site-builder/update-wixel-job', { job });
|
|
103
|
-
return response.data;
|
|
104
|
-
}
|
|
105
|
-
export async function pullHeadlessWixelJob({ accountAuthHeaders, apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL, jobId, conductorOverride }) {
|
|
106
|
-
const httpClient = createHttpClient({
|
|
107
|
-
headers: {
|
|
108
|
-
...COMMON_HEADERS,
|
|
109
|
-
...accountAuthHeaders,
|
|
110
|
-
...(conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {}),
|
|
111
|
-
'Content-Type': 'application/json'
|
|
112
|
-
},
|
|
113
|
-
baseURL: apiBaseURL
|
|
114
|
-
});
|
|
115
|
-
const response = await httpClient.post('/_api/harmony-site-builder/pull-wixel-job', { jobId });
|
|
116
|
-
return response.data;
|
|
117
|
-
}
|
|
118
69
|
// wixel-slides WixelAgentService.GetStylePresetsByIds — resolves curated (KB)
|
|
119
70
|
// style presets so clients can render palette swatches for design options.
|
|
120
71
|
export async function getStylePresetsByIds({ siteAuthHeaders, stylePresetIds, apiBaseURL = WIXEL_ASSISTANT_V1_NO_ENTITY_API_BASE_URL, conductorOverride }) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const WIXEL_ASSISTANT_V1_NO_ENTITY_API_BASE_URL = "https://manage.wix.com/";
|
|
2
2
|
export declare const WWW_ASSET_V1_ASSET_API_BASE_URL = "https://manage.wix.com/";
|
|
3
|
-
export declare const HARMONY_SITE_BUILDER_API_BASE_URL = "https://manage.wix.com/";
|
|
4
3
|
export { OPENAI_WIDGET_MIME_TYPE } from '../site-widget-tools/constants.js';
|
|
5
4
|
export declare const WIXEL_AGENT_EXTERNAL_API_BASE_URL = "https://manage.wix.com/";
|
|
6
5
|
export declare const WIXEL_WIDGET_URI = "ui://widget/wixel-widget.html";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export const WIXEL_ASSISTANT_V1_NO_ENTITY_API_BASE_URL = 'https://manage.wix.com/';
|
|
2
2
|
export const WWW_ASSET_V1_ASSET_API_BASE_URL = 'https://manage.wix.com/';
|
|
3
|
-
export const HARMONY_SITE_BUILDER_API_BASE_URL = 'https://manage.wix.com/';
|
|
4
3
|
export { OPENAI_WIDGET_MIME_TYPE } from '../site-widget-tools/constants.js';
|
|
5
4
|
export const WIXEL_AGENT_EXTERNAL_API_BASE_URL = 'https://manage.wix.com/';
|
|
6
5
|
export const WIXEL_WIDGET_URI = 'ui://widget/wixel-widget.html';
|
|
@@ -6,9 +6,6 @@ export { addGetWixelJobStatusTool } from './get-wixel-job-status-tool.js';
|
|
|
6
6
|
export { addMarkWixelJobAsFulfilledTool } from './mark-wixel-job-as-fulfilled-tool.js';
|
|
7
7
|
export { addGetWixelAssetTool } from './get-wixel-asset-tool.js';
|
|
8
8
|
export { addGetWixelProjectAssetsTool } from './get-wixel-project-assets-tool.js';
|
|
9
|
-
export { addUpdateHeadlessWixelJobTool } from './update-headless-wixel-job-tool.js';
|
|
10
|
-
export { addOpenHeadlessWixelProjectTool } from './open-headless-wixel-project-tool.js';
|
|
11
|
-
export { addPullHeadlessWixelJobTool } from './pull-headless-wixel-job-tool.js';
|
|
12
9
|
export declare function addWixelTools(server: WixMcpServer, authStrategy: McpAuthenticationStrategy, options?: {
|
|
13
10
|
conductorOverride?: string;
|
|
14
11
|
supportsWidgets?: () => boolean;
|
package/build/dts/wixel/index.js
CHANGED
|
@@ -2,9 +2,6 @@ import { addGetWixelJobStatusTool } from './get-wixel-job-status-tool.js';
|
|
|
2
2
|
import { addMarkWixelJobAsFulfilledTool } from './mark-wixel-job-as-fulfilled-tool.js';
|
|
3
3
|
import { addGetWixelAssetTool } from './get-wixel-asset-tool.js';
|
|
4
4
|
import { addGetWixelProjectAssetsTool } from './get-wixel-project-assets-tool.js';
|
|
5
|
-
import { addUpdateHeadlessWixelJobTool } from './update-headless-wixel-job-tool.js';
|
|
6
|
-
import { addPullHeadlessWixelJobTool } from './pull-headless-wixel-job-tool.js';
|
|
7
|
-
import { addOpenHeadlessWixelProjectTool } from './open-headless-wixel-project-tool.js';
|
|
8
5
|
import { addWixelSessionTools } from './wixel-session-tools.js';
|
|
9
6
|
export { WIXEL_ICON_SVG_URL, WIXEL_ICON_PNG_URL } from './constants.js';
|
|
10
7
|
export { addWixelSessionTools, addStartWixelSessionTool, addSendWixelMessageTool, addListWixelEventsTool } from './wixel-session-tools.js';
|
|
@@ -12,17 +9,11 @@ export { addGetWixelJobStatusTool } from './get-wixel-job-status-tool.js';
|
|
|
12
9
|
export { addMarkWixelJobAsFulfilledTool } from './mark-wixel-job-as-fulfilled-tool.js';
|
|
13
10
|
export { addGetWixelAssetTool } from './get-wixel-asset-tool.js';
|
|
14
11
|
export { addGetWixelProjectAssetsTool } from './get-wixel-project-assets-tool.js';
|
|
15
|
-
export { addUpdateHeadlessWixelJobTool } from './update-headless-wixel-job-tool.js';
|
|
16
|
-
export { addOpenHeadlessWixelProjectTool } from './open-headless-wixel-project-tool.js';
|
|
17
|
-
export { addPullHeadlessWixelJobTool } from './pull-headless-wixel-job-tool.js';
|
|
18
12
|
export function addWixelTools(server, authStrategy, options = {}) {
|
|
19
13
|
addGetWixelJobStatusTool(server, authStrategy, options);
|
|
20
14
|
addMarkWixelJobAsFulfilledTool(server, authStrategy, options);
|
|
21
15
|
addGetWixelAssetTool(server, authStrategy, options);
|
|
22
16
|
addGetWixelProjectAssetsTool(server, authStrategy, options);
|
|
23
|
-
addUpdateHeadlessWixelJobTool(server, authStrategy, options);
|
|
24
|
-
addOpenHeadlessWixelProjectTool(server, authStrategy, options);
|
|
25
|
-
addPullHeadlessWixelJobTool(server, authStrategy, options);
|
|
26
17
|
// Agent-to-agent session API (wixel-agent-service ExternalAgentService)
|
|
27
18
|
addWixelSessionTools(server, authStrategy, options);
|
|
28
19
|
}
|