@wix/mcp 1.0.79 → 1.0.81
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 +94 -36
- package/build/cjs/index.cjs +449 -459
- package/build/cjs/toolkit.cjs +112 -44
- package/build/dts/account-tools/get-profile-tool.d.ts +5 -0
- package/build/dts/account-tools/get-profile-tool.js +49 -0
- 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.d.ts +2 -2
- package/build/dts/config/default-config.js +19 -9
- 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/index.d.ts +1 -0
- package/build/dts/index.js +1 -0
- package/build/dts/infra/tool-bi.d.ts +1 -1
- package/build/dts/infra/tool-bi.js +3 -2
- package/build/dts/toolkit-entry.d.cts +3 -1
- package/build/dts/toolkit-entry.d.ts +3 -1
- package/build/dts/toolkit.d.ts +2 -0
- package/build/dts/toolkit.js +18 -21
- package/build/dts/wix-mcp-server.d.ts +2 -0
- package/build/dts/wix-mcp-server.js +4 -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 +367 -401
- package/build/esm/toolkit.js +112 -44
- package/package.json +4 -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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import dedent from 'dedent';
|
|
2
|
+
import { ARRAY_QUERY_PARAMS_RULE } from './api-request-rules.js';
|
|
2
3
|
/**
|
|
3
4
|
* Common agent goal - used in both SYSTEM_REMINDER and defaultReadmeDocs
|
|
4
5
|
*/
|
|
@@ -13,13 +14,16 @@ const DISCOVERY_FLOWS = [
|
|
|
13
14
|
];
|
|
14
15
|
// README-only lines and site-creation routing are added only when includeReadme
|
|
15
16
|
// is true (README-free consumers like aria don't do site creation).
|
|
16
|
-
function buildSystemReminderGuidelines(includeReadme) {
|
|
17
|
+
function buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance) {
|
|
17
18
|
const exception = includeReadme ? '**Exception:** ' : '';
|
|
18
19
|
const lines = [];
|
|
19
20
|
if (includeReadme) {
|
|
20
21
|
lines.push('if the WixREADME tool is available to you, YOU MUST USE IT AT THE BEGINNING OF ANY CONVERSATION and then continue with calling the other tools and calling the Wix APIs until the task is completed.', '**Exception — creating a new Wix site/website:** For a normal creation request — and only then — skip WixREADME and the docs search, and route straight to the Wix site-creation tools available to you; their descriptions carry the routing rules. Everything else starts with WixREADME as usual.', "If the user explicitly asks for a headless site, Wix Classic Editor site, or manual account/API-based site creation, call CreateWixBusinessGuide right away — these don't need the site's purpose first.", "Never default to AI or search templates unless the user explicitly requests it. When the user named no creation method - let the user make that choice as the site-creation tools' descriptions direct. Never route normal site creation through ManageWixSite, CallWixSiteAPI, or ExecuteWixAPI.");
|
|
21
22
|
}
|
|
22
|
-
lines.push(`${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? 'skip WixREADME and ' : ''}call ListWixSites directly
|
|
23
|
+
lines.push(`${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? 'skip WixREADME and ' : ''}call ListWixSites directly.`);
|
|
24
|
+
if (includeImageUploadGuidance) {
|
|
25
|
+
lines.push(`${exception}If the user wants to upload local or attached image files to a Wix site, skip ${includeReadme ? 'WixREADME and ' : ''}all docs/schema/API flows — call UploadImageToWixSite directly. Do NOT use ExecuteWixAPI, SearchWixAPISpec, or any Media Manager REST API for image uploads.`);
|
|
26
|
+
}
|
|
23
27
|
if (includeReadme) {
|
|
24
28
|
lines.push('If the WixREADME tool is not available to you, you should use the other flows as described without using the WixREADME tool until the task is completed.');
|
|
25
29
|
}
|
|
@@ -34,9 +38,9 @@ function buildSystemReminderFlows(includeReadme) {
|
|
|
34
38
|
lines.push(...DISCOVERY_FLOWS);
|
|
35
39
|
return lines.join('\n');
|
|
36
40
|
}
|
|
37
|
-
export const SYSTEM_REMINDER_GUIDELINES = buildSystemReminderGuidelines(true);
|
|
38
|
-
export function buildSystemReminder(includeReadme) {
|
|
39
|
-
const guidelines = buildSystemReminderGuidelines(includeReadme);
|
|
41
|
+
export const SYSTEM_REMINDER_GUIDELINES = buildSystemReminderGuidelines(true, true);
|
|
42
|
+
export function buildSystemReminder(includeReadme, includeImageUploadGuidance = true) {
|
|
43
|
+
const guidelines = buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance);
|
|
40
44
|
const flows = buildSystemReminderFlows(includeReadme);
|
|
41
45
|
return dedent `
|
|
42
46
|
<agent-mandatory-instructions>
|
|
@@ -101,11 +105,13 @@ const EXECUTE_WIX_API_INTRO = dedent `
|
|
|
101
105
|
CODE CONTRACT:
|
|
102
106
|
- Pass an async function expression: \`async function() { ... }\` or \`async () => { ... }\`. Put every declaration, \`await\`, and \`return\` inside it, and do not invoke it yourself.
|
|
103
107
|
- Use only \`wix.request({ method, url, body })\` and in-memory JavaScript. Node.js modules, filesystem access, and downloadable-file creation are unavailable.
|
|
108
|
+
- Do not minify the code. Put each object property on its own line, with spaces after colons and commas, and declare deep literals (request bodies, filters, patch lists) as a named \`const\` before use so each \`wix.request({ ... })\` argument stays short.
|
|
104
109
|
|
|
105
110
|
CONFIRM API CONTRACTS:
|
|
106
111
|
- Do not rely on memory for endpoints, methods, bodies, response paths, filters, enum values, or auth scope. Confirm every method from conversation-provided details, a complete matching docs example, or the schema/docs tools before executing.
|
|
107
112
|
- Prefer \`method.publicUrl\` from SearchWixAPISpec; never use \`method.servers[0]\`. Pass all supporting documentation URLs through \`sourceDocUrls\`.
|
|
108
113
|
- A response field is not automatically filterable or sortable. Use only capabilities declared for that exact query/search method. If an unsupported filter is unavoidable, fetch a bounded result set and filter it in code.
|
|
114
|
+
- ${ARRAY_QUERY_PARAMS_RULE}
|
|
109
115
|
- Read-only probes may inspect state or resolve IDs. Never use speculative create/update/delete calls to discover request or response shapes, and never repeat a successful mutation merely to obtain more response data.
|
|
110
116
|
`;
|
|
111
117
|
const EXECUTE_WIX_API_OUTPUT_AND_ERRORS = dedent `
|
|
@@ -121,6 +127,7 @@ const ACCOUNT_SITE_EXECUTE_SCOPE = dedent `
|
|
|
121
127
|
SCOPE AND SITE TARGETING:
|
|
122
128
|
- Set \`scope: "site"\` for site-level APIs and \`scope: "account"\` for account-level APIs. Account-level acts on the account itself, or on sites as objects within it; anything that reads or writes inside a site is site-level.
|
|
123
129
|
- If \`scope\` is omitted it defaults to site when either the ExecuteWixAPI call or \`wix.request\` provides a \`siteId\`; otherwise it defaults to account.
|
|
130
|
+
- Site-level calls need a site ID; there is no implicit current site. Before any \`scope: "site"\` call, pass the site's ID as the ExecuteWixAPI \`siteId\` parameter or per request. \`scope: "site"\` without a \`siteId\` fails.
|
|
124
131
|
- \`scope: "account"\` ignores any \`siteId\` you pass, so a site-level endpoint called that way fails.
|
|
125
132
|
- Authentication is injected automatically; never set Authorization, wix-site-id, or wix-account-id headers.
|
|
126
133
|
- For one named site, prefer GetSiteContext. If it is unavailable, resolve the exact site and perform the action in the same invocation.
|
|
@@ -254,8 +261,8 @@ export const executeWixApiDescription = dedent `
|
|
|
254
261
|
|
|
255
262
|
${EXECUTE_WIX_API_MULTI_SITE_EXAMPLE}
|
|
256
263
|
`;
|
|
257
|
-
export function buildToolDescriptions(includeReadme) {
|
|
258
|
-
const reminder = buildSystemReminder(includeReadme);
|
|
264
|
+
export function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true) {
|
|
265
|
+
const reminder = buildSystemReminder(includeReadme, includeImageUploadGuidance);
|
|
259
266
|
return {
|
|
260
267
|
WixREADME: dedent `
|
|
261
268
|
# Tool: WixREADME
|
|
@@ -306,6 +313,7 @@ export function buildToolDescriptions(includeReadme) {
|
|
|
306
313
|
**Prefer this tool over CallWixSiteAPI for listing sites.** Call this tool directly — it already knows the correct API and handles everything needed. Only fall back to CallWixSiteAPI if the user needs advanced filtering or specific site details beyond what this tool provides.
|
|
307
314
|
${reminder}
|
|
308
315
|
`,
|
|
316
|
+
get_profile: "Returns the authenticated user's email address",
|
|
309
317
|
GetSiteContext: dedent `
|
|
310
318
|
Fetches deep context for a specific Wix site and returns it as structured markdown.
|
|
311
319
|
|
|
@@ -437,8 +445,10 @@ export function buildToolDescriptions(includeReadme) {
|
|
|
437
445
|
SearchBuildAppsDocumentation: dedent `
|
|
438
446
|
Searches the Wix Build Apps documentation.
|
|
439
447
|
`,
|
|
440
|
-
|
|
441
|
-
|
|
448
|
+
SearchDevelopmentDocumentation: dedent `
|
|
449
|
+
Broad Wix development documentation (platform concepts, developer guides, getting started). **Last resort — development tasks only.**
|
|
450
|
+
Skip it entirely for general, business, support, or Wix-editor questions.
|
|
451
|
+
Call it only after the specific search for your task returned nothing useful: \`SearchWixRESTDocumentation\` (REST), \`SearchWixSDKDocumentation\` (JS SDK), \`SearchWixCLIDocumentation\` (CLI), \`SearchBuildAppsDocumentation\` (apps), \`SearchWixHeadlessDocumentation\` (Headless), \`SearchWixWDSDocumentation\` (WDS). Never use it as a first search.
|
|
442
452
|
`,
|
|
443
453
|
SearchWixHeadlessDocumentation: dedent `
|
|
444
454
|
Searches the Wix Headless documentation.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ALLOWED_HOSTNAMES } from '../api-call/validation.js';
|
|
2
|
+
import { ARRAY_QUERY_PARAMS_RULE } from './api-request-rules.js';
|
|
2
3
|
/**
|
|
3
4
|
* Centralized parameter descriptions organized by tool.
|
|
4
5
|
* Each tool has all its parameter descriptions in one place.
|
|
@@ -10,7 +11,8 @@ export const paramDescriptions = {
|
|
|
10
11
|
'The url of the api to call - ALWAYS get the API url from the Wix REST docs or from the conversation context, the URL MUST BE ABSOLUTE URL',
|
|
11
12
|
'NEVER guess the API url, ALWAYS get it from the conversation context, i.e from the user prompt or from the "WixREADME" tool or from the "SearchWixRESTDocumentation" tool or from the "BrowseWixRESTDocsMenu" tool or from the "ReadFullDocsArticle" tool',
|
|
12
13
|
`Allowed API urls are: ${ALLOWED_HOSTNAMES.join(', ')}`,
|
|
13
|
-
`Docs urls like https://dev.wix.com/docs/... are not API urls, if you want to read the docs, use the "ReadFullDocsArticle" tool
|
|
14
|
+
`Docs urls like https://dev.wix.com/docs/... are not API urls, if you want to read the docs, use the "ReadFullDocsArticle" tool`,
|
|
15
|
+
ARRAY_QUERY_PARAMS_RULE
|
|
14
16
|
].join('\n'),
|
|
15
17
|
method: 'The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)',
|
|
16
18
|
body: 'The request body as a JSON object or array with all the required fields and values, including nested objects. Pass the actual value (object or array), NOT a JSON string. YOU MUST NEVER MAKE UP A BODY - the body should be based on the conversation context, i.e from the user prompt OR got into the conversation context by the "ReadFullDocsArticle" tool OR by the "SearchWixAPISpec" tool OR by the "ReadFullDocsMethodSchema" tool - i.e based on the API docs, a relevant recipe you read (preferably), a code example you found in the docs, a schema you read etc.. YOU MUST NEVER ASSUME YOU KNOW WHAT THE BODY SCHEMA IS WITHOUT CONCRETE EXAMPLES OR SCHEMA DEFINITIONS FROM THE CONVERSATION CONTEXT. Prefer reading relevant recipes if you have them in context for understand the body schema for API calls.',
|
|
@@ -83,8 +85,8 @@ export const paramDescriptions = {
|
|
|
83
85
|
searchTerm: 'The search term to search for in the Build Apps Documentation',
|
|
84
86
|
maxResults: 'The maximum number of results to return, default is 10, max is 15'
|
|
85
87
|
},
|
|
86
|
-
|
|
87
|
-
searchTerm: 'The search term
|
|
88
|
+
SearchDevelopmentDocumentation: {
|
|
89
|
+
searchTerm: 'The development-related search term. Use only after a more specific docs search (REST/SDK/CLI/Build Apps/Headless/WDS) came back empty.',
|
|
88
90
|
maxResults: 'The maximum number of results to return, default is 10, max is 15'
|
|
89
91
|
},
|
|
90
92
|
SearchWixHeadlessDocumentation: {
|
package/build/dts/docs/docs.js
CHANGED
|
@@ -399,11 +399,11 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
399
399
|
}
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
|
-
//
|
|
402
|
+
// Development Documentation
|
|
403
403
|
if (allowedTools.includes('OVERVIEW') &&
|
|
404
|
-
!disableTools?.includes('
|
|
405
|
-
server.tool('
|
|
406
|
-
const d = desc('
|
|
404
|
+
!disableTools?.includes('SearchDevelopmentDocumentation')) {
|
|
405
|
+
server.tool('SearchDevelopmentDocumentation', getDescription('SearchDevelopmentDocumentation', defaultToolDescriptions.SearchDevelopmentDocumentation ?? ''), (() => {
|
|
406
|
+
const d = desc('SearchDevelopmentDocumentation');
|
|
407
407
|
return {
|
|
408
408
|
searchTerm: z.string().describe(d.searchTerm),
|
|
409
409
|
maxResults: z
|
|
@@ -438,8 +438,8 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
438
438
|
panorama.errorMonitor().reportError(error);
|
|
439
439
|
captureException(error, {
|
|
440
440
|
tags: {
|
|
441
|
-
componentId: '
|
|
442
|
-
toolName: '
|
|
441
|
+
componentId: 'SearchDevelopmentDocumentation',
|
|
442
|
+
toolName: 'SearchDevelopmentDocumentation'
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
445
|
logger.error(`Error searching for ${searchTerm} in Wix Overview: ${error}`);
|
package/build/dts/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { addApiCallTool, ToolHintsConfig } from './api-call/index.js';
|
|
|
5
5
|
export { handleWixAPIResponse } from './tool-utils.js';
|
|
6
6
|
export { addDocsResources } from './resources/docs.js';
|
|
7
7
|
export { addSupportTool } from './support/index.js';
|
|
8
|
+
export { addGetProfileTool } from './account-tools/get-profile-tool.js';
|
|
8
9
|
export { addCreateSiteWidgetTool, addEditSiteWidgetTool, addPullSiteJobTool, addClaimSiteTool, addSiteCreationWidgetTools, addWixSiteCreationTool, addSearchSiteTemplatesTool, addCreateSiteFromTemplateTool, type SiteWidgetToolOptions } from './site-widget-tools/index.js';
|
|
9
10
|
export * from './wixel/index.js';
|
|
10
11
|
export { addImportClaudeDesignTool, type ImportClaudeDesignToolOptions } from './import-claude-design-tool/index.js';
|
package/build/dts/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { addApiCallTool } from './api-call/index.js';
|
|
|
5
5
|
export { handleWixAPIResponse } from './tool-utils.js';
|
|
6
6
|
export { addDocsResources } from './resources/docs.js';
|
|
7
7
|
export { addSupportTool } from './support/index.js';
|
|
8
|
+
export { addGetProfileTool } from './account-tools/get-profile-tool.js';
|
|
8
9
|
export { addCreateSiteWidgetTool, addEditSiteWidgetTool, addPullSiteJobTool, addClaimSiteTool, addSiteCreationWidgetTools, addWixSiteCreationTool, addSearchSiteTemplatesTool, addCreateSiteFromTemplateTool } from './site-widget-tools/index.js';
|
|
9
10
|
export * from './wixel/index.js';
|
|
10
11
|
export { addImportClaudeDesignTool } from './import-claude-design-tool/index.js';
|
|
@@ -6,7 +6,7 @@ import { wixMcpRequestSrc39Evid1607, executeWixApiToolRequestSrc39Evid1612 } fro
|
|
|
6
6
|
* and concatenates text blocks with newlines.
|
|
7
7
|
*/
|
|
8
8
|
export declare function extractText(result: WixToolCallResult): string;
|
|
9
|
-
export declare function formatToolResultAdditionalFields(result: WixToolCallResult): string | undefined;
|
|
9
|
+
export declare function formatToolResultAdditionalFields(result: WixToolCallResult, extras?: Record<string, unknown>): string | undefined;
|
|
10
10
|
export declare function createToolBiEvent(params: Parameters<typeof wixMcpRequestSrc39Evid1607>[0]): import("@wix/bi-logger-api-infra-data/v2/types").LogObject<import("@wix/bi-logger-api-infra-data/v2/types").wixMcpRequestSrc39Evid1607Params>;
|
|
11
11
|
export declare function createExecuteWixAPICallToolBiEvent(params: Parameters<typeof executeWixApiToolRequestSrc39Evid1612>[0]): import("@wix/bi-logger-api-infra-data/v2/types").LogObject<import("@wix/bi-logger-api-infra-data/v2/types").executeWixApiToolRequestSrc39Evid1612Params>;
|
|
12
12
|
//# sourceMappingURL=tool-bi.d.ts.map
|
|
@@ -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) {
|
|
@@ -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') */
|
|
@@ -289,6 +289,8 @@ export interface WixToolkitOptions {
|
|
|
289
289
|
* MCP server's text. Only affects description text — never the tool set itself.
|
|
290
290
|
*/
|
|
291
291
|
includeReadmeMentions?: boolean;
|
|
292
|
+
/** Keep image-upload routing guidance in tool descriptions. Defaults to `false`. */
|
|
293
|
+
includeImageUploadGuidance?: boolean;
|
|
292
294
|
}
|
|
293
295
|
/**
|
|
294
296
|
* Create a WixToolkit that provides pre-wired tool objects for in-process use.
|
|
@@ -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') */
|
|
@@ -289,6 +289,8 @@ export interface WixToolkitOptions {
|
|
|
289
289
|
* MCP server's text. Only affects description text — never the tool set itself.
|
|
290
290
|
*/
|
|
291
291
|
includeReadmeMentions?: boolean;
|
|
292
|
+
/** Keep image-upload routing guidance in tool descriptions. Defaults to `false`. */
|
|
293
|
+
includeImageUploadGuidance?: boolean;
|
|
292
294
|
}
|
|
293
295
|
/**
|
|
294
296
|
* Create a WixToolkit that provides pre-wired tool objects for in-process use.
|
package/build/dts/toolkit.d.ts
CHANGED
|
@@ -151,6 +151,8 @@ export interface WixToolkitOptions {
|
|
|
151
151
|
* MCP server's text. Only affects description text — never the tool set itself.
|
|
152
152
|
*/
|
|
153
153
|
includeReadmeMentions?: boolean;
|
|
154
|
+
/** Keep image-upload routing guidance in tool descriptions. Defaults to `false`. */
|
|
155
|
+
includeImageUploadGuidance?: boolean;
|
|
154
156
|
}
|
|
155
157
|
export { extractText, formatToolResultAdditionalFields };
|
|
156
158
|
/**
|
package/build/dts/toolkit.js
CHANGED
|
@@ -148,14 +148,13 @@ export { extractText, formatToolResultAdditionalFields };
|
|
|
148
148
|
* schema manipulation (defaults) internally.
|
|
149
149
|
*/
|
|
150
150
|
export function createWixToolkit(options) {
|
|
151
|
-
const { auth, docs, api, defaults = {}, exclude = [], clientName, hooks, conversationId, includeReadmeMentions = false } = options;
|
|
151
|
+
const { auth, docs, api, defaults = {}, exclude = [], clientName, hooks, conversationId, includeReadmeMentions = false, includeImageUploadGuidance = false } = options;
|
|
152
152
|
const authStrategy = normalizeAuth(auth);
|
|
153
153
|
const executeWixApiRequested = isExecuteWixApiRequested(api);
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
|
|
154
|
+
// Apply both description flags consistently. WixREADME is left out when
|
|
155
|
+
// mentions are disabled so its own description keeps its default text.
|
|
156
|
+
const descriptionsWithoutReadme = buildToolDescriptions(includeReadmeMentions, includeImageUploadGuidance);
|
|
157
157
|
if (!includeReadmeMentions) {
|
|
158
|
-
descriptionsWithoutReadme = buildToolDescriptions(false);
|
|
159
158
|
delete descriptionsWithoutReadme.WixREADME;
|
|
160
159
|
}
|
|
161
160
|
const sessionId = uuidv4();
|
|
@@ -177,9 +176,10 @@ export function createWixToolkit(options) {
|
|
|
177
176
|
authStrategy,
|
|
178
177
|
dynamicContextEnabled: true,
|
|
179
178
|
// README-free defaults first so consumer overrides still win.
|
|
180
|
-
toolDescriptions:
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
toolDescriptions: {
|
|
180
|
+
...descriptionsWithoutReadme,
|
|
181
|
+
...docsOptions.toolDescriptions
|
|
182
|
+
}
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
else {
|
|
@@ -187,24 +187,18 @@ export function createWixToolkit(options) {
|
|
|
187
187
|
addDocsTools(server, undefined, {
|
|
188
188
|
authStrategy,
|
|
189
189
|
dynamicContextEnabled: true,
|
|
190
|
-
|
|
191
|
-
? { toolDescriptions: descriptionsWithoutReadme }
|
|
192
|
-
: {})
|
|
190
|
+
toolDescriptions: descriptionsWithoutReadme
|
|
193
191
|
});
|
|
194
192
|
}
|
|
195
193
|
// Register API tools
|
|
196
194
|
if (api) {
|
|
197
195
|
const { tools: apiTools, disableTools, enableTools, toolDescriptions, toolHints, maxResponseSize, codeModeBaseUrl = 'https://mcp.wix.com' } = api;
|
|
198
196
|
// Precedence (low → high): README-free defaults, code-mode variant, consumer overrides.
|
|
199
|
-
const effectiveToolDescriptions =
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
...descriptionsWithoutReadme,
|
|
205
|
-
...(executeWixApiRequested ? executeCodeModeToolDescriptions : {}),
|
|
206
|
-
...toolDescriptions
|
|
207
|
-
};
|
|
197
|
+
const effectiveToolDescriptions = {
|
|
198
|
+
...descriptionsWithoutReadme,
|
|
199
|
+
...(executeWixApiRequested ? executeCodeModeToolDescriptions : {}),
|
|
200
|
+
...toolDescriptions
|
|
201
|
+
};
|
|
208
202
|
addApiCallTool(server, authStrategy, apiTools, disableTools, enableTools, effectiveToolDescriptions, toolHints, maxResponseSize);
|
|
209
203
|
const requestedTools = new Set([
|
|
210
204
|
...(apiTools ?? []),
|
|
@@ -306,7 +300,10 @@ export function createWixToolkit(options) {
|
|
|
306
300
|
errorBody = extractText(cbResult);
|
|
307
301
|
}
|
|
308
302
|
else {
|
|
309
|
-
additionalFields = formatToolResultAdditionalFields(cbResult
|
|
303
|
+
additionalFields = formatToolResultAdditionalFields(cbResult, {
|
|
304
|
+
returnedRows: toolBiParams.returnedRows,
|
|
305
|
+
originalLength: toolBiParams.originalLength
|
|
306
|
+
});
|
|
310
307
|
}
|
|
311
308
|
// Panorama: finish or report error
|
|
312
309
|
if (!isDevEnvironment) {
|
|
@@ -175,7 +175,10 @@ export class WixMcpServer extends McpServer {
|
|
|
175
175
|
errorBody = extractText(cbResult);
|
|
176
176
|
}
|
|
177
177
|
else {
|
|
178
|
-
additionalFields = formatToolResultAdditionalFields(cbResult
|
|
178
|
+
additionalFields = formatToolResultAdditionalFields(cbResult, {
|
|
179
|
+
returnedRows: toolBiParams.returnedRows,
|
|
180
|
+
originalLength: toolBiParams.originalLength
|
|
181
|
+
});
|
|
179
182
|
}
|
|
180
183
|
if (toolSucceeded && !isDevEnvironment) {
|
|
181
184
|
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
|
}
|