@wix/mcp 1.0.94 → 1.0.95
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 +2 -2
- package/build/bin-standalone.js +1116 -321
- package/build/cjs/index.cjs +2813 -1147
- package/build/cjs/toolkit.cjs +1788 -362
- package/build/dts/api-call/headless-release.d.ts +56 -0
- package/build/dts/api-call/headless-release.js +135 -0
- package/build/dts/api-call/index.d.ts +9 -1
- package/build/dts/api-call/index.js +13 -7
- package/build/dts/api-call/site-files.d.ts +14 -0
- package/build/dts/api-call/site-files.js +106 -10
- package/build/dts/api-call/upload-headless-website-files.d.ts +88 -5
- package/build/dts/api-call/upload-headless-website-files.js +473 -20
- package/build/dts/api-call/upload-image-tool.d.ts +2 -0
- package/build/dts/api-call/upload-image-tool.js +8 -4
- package/build/dts/bin.d.ts +1 -1
- package/build/dts/bin.js +3 -1
- package/build/dts/code-mode/index.d.ts +6 -1
- package/build/dts/code-mode/index.js +30 -10
- package/build/dts/code-mode/truncate-response.js +5 -1
- package/build/dts/config/default-config.d.ts +35 -5
- package/build/dts/config/default-config.js +334 -178
- package/build/dts/config/file-params.d.ts +22 -0
- package/build/dts/config/file-params.js +24 -0
- package/build/dts/config/param-descriptions.d.ts +14 -2
- package/build/dts/config/param-descriptions.js +33 -14
- package/build/dts/constants.d.ts +1 -0
- package/build/dts/constants.js +1 -0
- package/build/dts/docs/docs.d.ts +12 -1
- package/build/dts/docs/docs.js +210 -42
- package/build/dts/docs/fetch-article.d.ts +21 -0
- package/build/dts/docs/fetch-article.js +66 -4
- package/build/dts/docs/get-to-know.d.ts +7 -2
- package/build/dts/docs/get-to-know.js +36 -14
- package/build/dts/docs/mintlify-docs.d.ts +121 -0
- package/build/dts/docs/mintlify-docs.js +391 -0
- package/build/dts/docs/semanticSearch.d.ts +2 -1
- package/build/dts/docs/semanticSearch.js +14 -7
- package/build/dts/docs/start-deploy-website.d.ts +7 -6
- package/build/dts/docs/start-deploy-website.js +13 -8
- package/build/dts/docs/start-headless-build.d.ts +8 -10
- package/build/dts/docs/start-headless-build.js +14 -28
- package/build/dts/index.d.ts +2 -2
- package/build/dts/index.js +2 -2
- package/build/dts/infra/redact-personal-data.d.ts +4 -0
- package/build/dts/infra/redact-personal-data.js +79 -0
- package/build/dts/site-widget-tools/constants.d.ts +49 -1
- package/build/dts/site-widget-tools/constants.js +64 -7
- package/build/dts/site-widget-tools/index.d.ts +1 -0
- package/build/dts/site-widget-tools/index.js +1 -0
- package/build/dts/site-widget-tools/pick-images-tool/index.d.ts +14 -0
- package/build/dts/site-widget-tools/pick-images-tool/index.js +138 -0
- package/build/dts/site-widget-tools/search-site-templates-tool/index.js +16 -2
- package/build/dts/site-widget-tools/site-builder-tool/index.js +22 -2
- package/build/dts/site-widget-tools/site-creation-tool/index.d.ts +7 -1
- package/build/dts/site-widget-tools/site-creation-tool/index.js +22 -51
- package/build/dts/site-widget-tools/suggested-domain-tool/index.js +6 -3
- package/build/dts/support/index.d.ts +4 -0
- package/build/dts/support/index.js +13 -7
- package/build/dts/toolkit-entry.d.cts +15 -10
- package/build/dts/toolkit-entry.d.ts +15 -10
- package/build/dts/toolkit.d.ts +2 -2
- package/build/dts/toolkit.js +14 -7
- package/build/dts/wix-mcp-server.d.ts +10 -1
- package/build/dts/wix-mcp-server.js +25 -7
- package/build/dts/wixel/constants.d.ts +8 -1
- package/build/dts/wixel/constants.js +8 -1
- package/build/dts/wixel/index.d.ts +1 -1
- package/build/dts/wixel/index.js +2 -2
- package/build/dts/wixel/wixel-a2a-client.d.ts +83 -0
- package/build/dts/wixel/wixel-a2a-client.js +166 -0
- package/build/dts/wixel/wixel-bi.d.ts +2 -1
- package/build/dts/wixel/wixel-bi.js +2 -1
- package/build/dts/wixel/{external-agent-api.d.ts → wixel-session-entries.d.ts} +11 -33
- package/build/dts/wixel/{external-agent-api.js → wixel-session-entries.js} +33 -54
- package/build/dts/wixel/wixel-session-tools.d.ts +21 -26
- package/build/dts/wixel/wixel-session-tools.js +494 -599
- package/build/esm/index.js +2824 -1170
- package/build/esm/toolkit.js +1786 -360
- package/package.json +4 -4
|
@@ -46,6 +46,9 @@ const runSemanticSearch = async (toolName, toolParams, maxResults = 20, rerank =
|
|
|
46
46
|
else if (toolName === 'CLI') {
|
|
47
47
|
kbNames.push('CLI_KB_ID');
|
|
48
48
|
}
|
|
49
|
+
else if (toolName === 'HELP_CENTER') {
|
|
50
|
+
kbNames.push('HELP_CENTER_KB_ID');
|
|
51
|
+
}
|
|
49
52
|
logger.log(`[SemanticSearch] Tool: ${toolName}, KBs: [${kbNames.join(', ')}], Query: "${toolParams.searchTerm}"`);
|
|
50
53
|
for (const kbName of kbNames) {
|
|
51
54
|
url.searchParams.append('kbName', kbName);
|
|
@@ -70,13 +73,16 @@ const runSemanticSearch = async (toolName, toolParams, maxResults = 20, rerank =
|
|
|
70
73
|
logger.log('Ran RAG search successfully with params', JSON.stringify(toolParams), timeTaskFormatted, typeof data);
|
|
71
74
|
return data?.results;
|
|
72
75
|
};
|
|
73
|
-
const runPlatformizedSemanticSearch = async (toolName, searchTerm, maxResults = 20, linesInEachResult, extraDocumentTypes) => {
|
|
76
|
+
const runPlatformizedSemanticSearch = async (toolName, searchTerm, maxResults = 20, linesInEachResult, extraDocumentTypes, documentTypesOverride) => {
|
|
74
77
|
const startTime = Date.now();
|
|
75
78
|
// When extra types are requested, search them in one combined ranking via the
|
|
76
79
|
// plural `document_types` field (mutually exclusive with `document_type`).
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
// An override replaces the tool's own types (the Mintlify KBs).
|
|
81
|
+
const documentTypes = documentTypesOverride?.length
|
|
82
|
+
? documentTypesOverride
|
|
83
|
+
: extraDocumentTypes?.length
|
|
84
|
+
? [toolName, ...extraDocumentTypes]
|
|
85
|
+
: undefined;
|
|
80
86
|
logger.log(`[SemanticSearch/v2] Tool: ${documentTypes ? documentTypes.join('+') : toolName}, Query: "${searchTerm}"`);
|
|
81
87
|
const response = await fetch('https://www.wixapis.com/mcp-docs-search/v1/docs/search/markdown', {
|
|
82
88
|
method: 'POST',
|
|
@@ -105,9 +111,10 @@ const runPlatformizedSemanticSearch = async (toolName, searchTerm, maxResults =
|
|
|
105
111
|
}
|
|
106
112
|
return content;
|
|
107
113
|
};
|
|
108
|
-
export const runSemanticSearchAndFormat = async ({ toolName, toolParams, maxResults = DEFAULT_MAX_RESULTS, rerank, linesInEachResult, usePlatformizedSearch = true, extraDocumentTypes }) => {
|
|
109
|
-
|
|
110
|
-
|
|
114
|
+
export const runSemanticSearchAndFormat = async ({ toolName, toolParams, maxResults = DEFAULT_MAX_RESULTS, rerank, linesInEachResult, usePlatformizedSearch = true, extraDocumentTypes, documentTypes }) => {
|
|
115
|
+
// A document-type override names platformized types; the legacy path can't honor it.
|
|
116
|
+
if (usePlatformizedSearch || documentTypes?.length) {
|
|
117
|
+
return runPlatformizedSemanticSearch(toolName, toolParams.searchTerm, maxResults, linesInEachResult, extraDocumentTypes, documentTypes);
|
|
111
118
|
}
|
|
112
119
|
else {
|
|
113
120
|
const results = await runSemanticSearch(toolName, toolParams, maxResults, rerank);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { WixMcpServer } from '../wix-mcp-server.js';
|
|
2
|
+
export declare const NO_PERSONAL_DATA = "No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
2
3
|
export declare const START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS: {
|
|
3
|
-
readonly userRequest: "
|
|
4
|
-
readonly siteDescription: "What the site is: its purpose and who it is for. One or two sentences.";
|
|
5
|
-
readonly siteForm: "The form the site exists in right now (HTML/CSS/JS files, a static build, a zip, another builder's export, a design created in this conversation, or something else), roughly how many files, and whether it includes images.";
|
|
6
|
-
readonly siteFunctionality: "What the site must be able to do for its visitors beyond showing pages, if anything (for example selling, bookings or reservations, tickets, menus and orders, rentals, forms, memberships or paid plans, donations, a blog, or anything else the user expects to work), in your own words. If it is a plain static site with no such needs, say so.";
|
|
7
|
-
readonly agentIdentity: "Which agent or product you are and the harness you run in.";
|
|
8
|
-
readonly wixAccess: "How you can reach Wix from where you run: through this MCP only, or also from a shell whose network can reach wixapis.com; whether you can run the Wix CLI (npx @wix/cli) there and whether it is logged in;
|
|
4
|
+
readonly userRequest: "A short summary of what the user asked for and the context that led here, in a sentence or two, including whether this is a new site or an edit or new version of a site already on Wix. No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
5
|
+
readonly siteDescription: "What the site is: its purpose and who it is for. One or two sentences. No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
6
|
+
readonly siteForm: "The form the site exists in right now (HTML/CSS/JS files, a static build, a zip, a framework project, another builder's export, a design created in this conversation, or something else), roughly how many files, and whether it includes images. For a framework project: which framework, whether you have its built static output (for example dist/) or only the source, and whether it needs a server at runtime (SSR, API routes, a backend), or that you don't know. Also where it came from: built in this conversation, the user's own project or repo, another builder (which one), or a Wix skill or template (which one). No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
7
|
+
readonly siteFunctionality: "What the site must be able to do for its visitors beyond showing pages, if anything (for example selling, bookings or reservations, tickets, menus and orders, rentals, forms, memberships or paid plans, donations, a blog, or anything else the user expects to work), in your own words. If it is a plain static site with no such needs, say so. No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
8
|
+
readonly agentIdentity: "Which agent or product you are, which model if you know it, and the harness you run in. No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
9
|
+
readonly wixAccess: "How you can reach Wix from where you run: through this MCP only, or also from a shell whose network can reach wixapis.com; whether you can run the Wix CLI (npx @wix/cli) there and whether it is logged in; which Wix identity you act with — the user's login through this MCP, a CLI login, or none; and which Wix skills you have (for example wix-headless-kit or wix-manage), by name and where they come from (installed on disk, a plugin, read online), or none. Name the kind of identity, not the account or its email. No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
9
10
|
};
|
|
10
11
|
export declare const START_DEPLOY_WEBSITE_PARAMS: Array<keyof typeof START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS>;
|
|
11
12
|
export declare const START_DEPLOY_WEBSITE_TOOL_NAME = "StartDeployWebsite";
|
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { defaultToolDescriptions } from '../config/default-config.js';
|
|
3
3
|
import { fetchArticleContent } from './fetch-article.js';
|
|
4
|
+
// Personal data in these fields is also redacted before they are recorded
|
|
5
|
+
// (redact-personal-data.ts); this line keeps it out in the first place.
|
|
6
|
+
export const NO_PERSONAL_DATA = 'No personal data: no names, emails, phones, passwords, keys or local paths.';
|
|
4
7
|
// These arguments are the only record of who deploys what; they are read by
|
|
5
8
|
// people via BI and do not change the response. One field per question so each
|
|
6
9
|
// can be analyzed on its own.
|
|
7
10
|
export const START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS = {
|
|
8
|
-
userRequest:
|
|
9
|
-
siteDescription:
|
|
10
|
-
siteForm:
|
|
11
|
-
siteFunctionality:
|
|
12
|
-
agentIdentity:
|
|
13
|
-
wixAccess:
|
|
11
|
+
userRequest: `A short summary of what the user asked for and the context that led here, in a sentence or two, including whether this is a new site or an edit or new version of a site already on Wix. ${NO_PERSONAL_DATA}`,
|
|
12
|
+
siteDescription: `What the site is: its purpose and who it is for. One or two sentences. ${NO_PERSONAL_DATA}`,
|
|
13
|
+
siteForm: `The form the site exists in right now (HTML/CSS/JS files, a static build, a zip, a framework project, another builder's export, a design created in this conversation, or something else), roughly how many files, and whether it includes images. For a framework project: which framework, whether you have its built static output (for example dist/) or only the source, and whether it needs a server at runtime (SSR, API routes, a backend), or that you don't know. Also where it came from: built in this conversation, the user's own project or repo, another builder (which one), or a Wix skill or template (which one). ${NO_PERSONAL_DATA}`,
|
|
14
|
+
siteFunctionality: `What the site must be able to do for its visitors beyond showing pages, if anything (for example selling, bookings or reservations, tickets, menus and orders, rentals, forms, memberships or paid plans, donations, a blog, or anything else the user expects to work), in your own words. If it is a plain static site with no such needs, say so. ${NO_PERSONAL_DATA}`,
|
|
15
|
+
agentIdentity: `Which agent or product you are, which model if you know it, and the harness you run in. ${NO_PERSONAL_DATA}`,
|
|
16
|
+
wixAccess: `How you can reach Wix from where you run: through this MCP only, or also from a shell whose network can reach wixapis.com; whether you can run the Wix CLI (npx @wix/cli) there and whether it is logged in; which Wix identity you act with — the user's login through this MCP, a CLI login, or none; and which Wix skills you have (for example wix-headless-kit or wix-manage), by name and where they come from (installed on disk, a plugin, read online), or none. Name the kind of identity, not the account or its email. ${NO_PERSONAL_DATA}`
|
|
14
17
|
};
|
|
15
18
|
export const START_DEPLOY_WEBSITE_PARAMS = Object.keys(START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS);
|
|
19
|
+
// Named in SERVER_INSTRUCTIONS (config/default-config.ts): when this tool's name or what it is for changes, update them to match.
|
|
16
20
|
export const START_DEPLOY_WEBSITE_TOOL_NAME = 'StartDeployWebsite';
|
|
17
21
|
export const START_DEPLOY_WEBSITE_RECIPE_URL = 'https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md';
|
|
18
22
|
export const DROP_PAGE_URL = 'https://www.wix.com/headless/drop?utm_campaign=mcp';
|
|
23
|
+
const WRITE_THE_CODE_LINE = "When the user brought no files, write the site's code yourself, then upload it as the guide shows.";
|
|
19
24
|
const FALLBACK_LINE = `Only if you cannot run it (you can't reach the file bytes, or a step fails and you can't fix it): send the user to ${DROP_PAGE_URL} — give that URL exactly as written, keeping the utm_campaign=mcp parameter.`;
|
|
20
25
|
// The tool exists to take the agent's attention at routing time; the work itself
|
|
21
26
|
// is the recipe, so the response IS the recipe — fetched live and returned whole,
|
|
22
27
|
// so the agent never has to decide whether to go read it.
|
|
23
28
|
export function startDeployWebsiteResponse(recipe) {
|
|
24
29
|
return [
|
|
25
|
-
`The following is the content of ${START_DEPLOY_WEBSITE_RECIPE_URL}. Follow it end to end and do the publishing yourself — do not hand the user instructions
|
|
30
|
+
`The following is the content of ${START_DEPLOY_WEBSITE_RECIPE_URL}. Follow it end to end and do the publishing yourself — do not hand the user instructions. ${WRITE_THE_CODE_LINE}`,
|
|
26
31
|
FALLBACK_LINE,
|
|
27
32
|
'---',
|
|
28
33
|
recipe.trim()
|
|
@@ -31,7 +36,7 @@ export function startDeployWebsiteResponse(recipe) {
|
|
|
31
36
|
// When the recipe can't be fetched, the pointer still routes correctly.
|
|
32
37
|
export const START_DEPLOY_WEBSITE_POINTER_RESPONSE = [
|
|
33
38
|
`Read and follow this recipe end to end: ${START_DEPLOY_WEBSITE_RECIPE_URL}`,
|
|
34
|
-
|
|
39
|
+
`It covers creating the site and uploading the files (with or without a Wix login), updating a site deployed this way, and implementing a backend on it (stores, bookings, CMS, members) as a Wix Headless project. Do the publishing yourself — do not hand the user instructions. ${WRITE_THE_CODE_LINE}`,
|
|
35
40
|
FALLBACK_LINE
|
|
36
41
|
].join('\n\n');
|
|
37
42
|
export function addStartDeployWebsiteTool(server, disableTools = [], toolDescriptions, fetchOptions = {}) {
|
|
@@ -3,17 +3,15 @@ import { type StartDeployWebsiteFetchOptions } from './start-deploy-website.js';
|
|
|
3
3
|
export declare const START_HEADLESS_BUILD_TOOL_NAME = "StartHeadlessBuild";
|
|
4
4
|
/** Wix's headless guide; identical to https://www.wix.com/headless/skill.md. */
|
|
5
5
|
export declare const HEADLESS_GUIDE_URL = "https://www.wix.com/skills/headless-cold-start/headless-kit.md";
|
|
6
|
-
export declare const START_HEADLESS_BUILD_STARTING_POINTS: readonly ["nothing yet", "a design worked out in this conversation", "an existing Wix Headless site", "a project download link", "a Wix site to move to code"];
|
|
7
|
-
type StartingPoint = (typeof START_HEADLESS_BUILD_STARTING_POINTS)[number];
|
|
8
6
|
export declare const START_HEADLESS_BUILD_PARAM_DESCRIPTIONS: {
|
|
9
|
-
readonly userRequest: "
|
|
10
|
-
readonly siteDescription: "What the site is: its purpose and who it is for. One or two sentences.";
|
|
11
|
-
readonly startingPoint: "What the
|
|
12
|
-
readonly siteFunctionality: "What the site must be able to do for its visitors beyond showing pages, if anything (for example selling, bookings or reservations, tickets, menus and orders, rentals, forms, memberships or paid plans, donations, a blog, or anything else the user expects to work), in your own words. If it is a plain static site with no such needs, say so.";
|
|
13
|
-
readonly agentIdentity: "Which agent or product you are and the harness you run in.";
|
|
14
|
-
readonly wixAccess: "How you can reach Wix from where you run: through this MCP only, or also from a shell whose network can reach wixapis.com; whether you can run the Wix CLI (npx @wix/cli) there and whether it is logged in;
|
|
7
|
+
readonly userRequest: "A short summary of what the user asked for and the context that led here, in a sentence or two, including whether this is a new site or an edit or new version of a site already on Wix. No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
8
|
+
readonly siteDescription: "What the site is: its purpose and who it is for. One or two sentences. No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
9
|
+
readonly startingPoint: "What the site starts from, in your own words: a new site; an existing Wix Headless site (a site deployed from files is one), with its metaSiteId if you have it; a project download link (a download.zip from Wix); a Wix site moving to code; or something else. No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
10
|
+
readonly siteFunctionality: "What the site must be able to do for its visitors beyond showing pages, if anything (for example selling, bookings or reservations, tickets, menus and orders, rentals, forms, memberships or paid plans, donations, a blog, or anything else the user expects to work), in your own words. If it is a plain static site with no such needs, say so. No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
11
|
+
readonly agentIdentity: "Which agent or product you are, which model if you know it, and the harness you run in. No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
12
|
+
readonly wixAccess: "How you can reach Wix from where you run: through this MCP only, or also from a shell whose network can reach wixapis.com; whether you can run the Wix CLI (npx @wix/cli) there and whether it is logged in; which Wix identity you act with — the user's login through this MCP, a CLI login, or none; and which Wix skills you have (for example wix-headless-kit or wix-manage), by name and where they come from (installed on disk, a plugin, read online), or none. Name the kind of identity, not the account or its email. No personal data: no names, emails, phones, passwords, keys or local paths.";
|
|
15
13
|
};
|
|
16
|
-
|
|
14
|
+
/** The same response for every call: the headless guide, inline. */
|
|
15
|
+
export declare function startHeadlessBuildResponse(guide: string | undefined): string;
|
|
17
16
|
export declare function addStartHeadlessBuildTool(server: WixMcpServer, disableTools?: string[], toolDescriptions?: Record<string, string>, fetchOptions?: StartDeployWebsiteFetchOptions): void;
|
|
18
|
-
export {};
|
|
19
17
|
//# sourceMappingURL=start-headless-build.d.ts.map
|
|
@@ -1,41 +1,29 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { defaultToolDescriptions } from '../config/default-config.js';
|
|
3
3
|
import { fetchArticleContent } from './fetch-article.js';
|
|
4
|
-
import { START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS } from './start-deploy-website.js';
|
|
4
|
+
import { NO_PERSONAL_DATA, START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS } from './start-deploy-website.js';
|
|
5
|
+
// Named in SERVER_INSTRUCTIONS (config/default-config.ts): when this tool's name or what it is for changes, update them to match.
|
|
5
6
|
export const START_HEADLESS_BUILD_TOOL_NAME = 'StartHeadlessBuild';
|
|
6
7
|
/** Wix's headless guide; identical to https://www.wix.com/headless/skill.md. */
|
|
7
8
|
export const HEADLESS_GUIDE_URL = 'https://www.wix.com/skills/headless-cold-start/headless-kit.md';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
'a design worked out in this conversation',
|
|
11
|
-
'an existing Wix Headless site',
|
|
12
|
-
'a project download link',
|
|
13
|
-
'a Wix site to move to code'
|
|
14
|
-
];
|
|
15
|
-
// Like StartDeployWebsite's, these arguments are read by people via BI; only
|
|
16
|
-
// `startingPoint` changes the response.
|
|
9
|
+
// Like StartDeployWebsite's, these arguments are read by people via BI and do not change the
|
|
10
|
+
// response.
|
|
17
11
|
export const START_HEADLESS_BUILD_PARAM_DESCRIPTIONS = {
|
|
18
12
|
userRequest: START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS.userRequest,
|
|
19
13
|
siteDescription: START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS.siteDescription,
|
|
20
|
-
startingPoint:
|
|
14
|
+
startingPoint: `What the site starts from, in your own words: a new site; an existing Wix Headless site (a site deployed from files is one), with its metaSiteId if you have it; a project download link (a download.zip from Wix); a Wix site moving to code; or something else. ${NO_PERSONAL_DATA}`,
|
|
21
15
|
siteFunctionality: START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS.siteFunctionality,
|
|
22
16
|
agentIdentity: START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS.agentIdentity,
|
|
23
17
|
wixAccess: START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS.wixAccess
|
|
24
18
|
};
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (startingPoint === 'a Wix site to move to code') {
|
|
30
|
-
lines.push(MOVE_TO_CODE_LINE);
|
|
31
|
-
}
|
|
19
|
+
const BUILT_HERE = "The site is built here, in code: don't offer Wix's editor or a template instead.";
|
|
20
|
+
const PREFIX = `The following is Wix's headless guide. Follow it end to end and do the work yourself: you write the site, and the guide creates it, connects its Wix business features, and uploads it. ${BUILT_HERE}`;
|
|
21
|
+
/** The same response for every call: the headless guide, inline. */
|
|
22
|
+
export function startHeadlessBuildResponse(guide) {
|
|
32
23
|
if (guide && guide.trim()) {
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
lines.push(`Wix's headless guide could not be loaded here. It is at ${HEADLESS_GUIDE_URL}: read it whole with ReadFullDocsArticle if you have that tool, otherwise fetch it with curl or your web tool, then follow it end to end and do the work yourself. If you find the user already has the site's code, call StartDeployWebsite instead.`);
|
|
24
|
+
return [PREFIX, '---', guide.trim()].join('\n\n');
|
|
37
25
|
}
|
|
38
|
-
return
|
|
26
|
+
return `Wix's headless guide could not be loaded here. It is at ${HEADLESS_GUIDE_URL}: read it whole with ReadFullDocsArticle if you have that tool, otherwise fetch it with curl or your web tool, then follow it end to end and do the work yourself. ${BUILT_HERE}`;
|
|
39
27
|
}
|
|
40
28
|
export function addStartHeadlessBuildTool(server, disableTools = [], toolDescriptions, fetchOptions = {}) {
|
|
41
29
|
if (disableTools.includes(START_HEADLESS_BUILD_TOOL_NAME)) {
|
|
@@ -46,13 +34,11 @@ export function addStartHeadlessBuildTool(server, disableTools = [], toolDescrip
|
|
|
46
34
|
defaultToolDescriptions[START_HEADLESS_BUILD_TOOL_NAME], {
|
|
47
35
|
userRequest: z.string().min(1).describe(d.userRequest),
|
|
48
36
|
siteDescription: z.string().min(1).describe(d.siteDescription),
|
|
49
|
-
startingPoint: z
|
|
50
|
-
.enum(START_HEADLESS_BUILD_STARTING_POINTS)
|
|
51
|
-
.describe(d.startingPoint),
|
|
37
|
+
startingPoint: z.string().optional().describe(d.startingPoint),
|
|
52
38
|
siteFunctionality: z.string().min(1).describe(d.siteFunctionality),
|
|
53
39
|
agentIdentity: z.string().min(1).describe(d.agentIdentity),
|
|
54
40
|
wixAccess: z.string().min(1).describe(d.wixAccess)
|
|
55
|
-
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async (
|
|
41
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async (_args, { httpClient }) => {
|
|
56
42
|
// Inline, not a link: chat agents cannot fetch www.wix.com themselves.
|
|
57
43
|
let guide;
|
|
58
44
|
try {
|
|
@@ -65,7 +51,7 @@ export function addStartHeadlessBuildTool(server, disableTools = [], toolDescrip
|
|
|
65
51
|
content: [
|
|
66
52
|
{
|
|
67
53
|
type: 'text',
|
|
68
|
-
text: startHeadlessBuildResponse(guide
|
|
54
|
+
text: startHeadlessBuildResponse(guide)
|
|
69
55
|
}
|
|
70
56
|
]
|
|
71
57
|
};
|
package/build/dts/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { handleWixAPIResponse } from './tool-utils.js';
|
|
|
6
6
|
export { addDocsResources } from './resources/docs.js';
|
|
7
7
|
export { addSupportTool } from './support/index.js';
|
|
8
8
|
export { addGetProfileTool } from './account-tools/get-profile-tool.js';
|
|
9
|
-
export { addCreateSiteWidgetTool, addEditSiteWidgetTool, addPullSiteJobTool, addClaimSiteTool, addSuggestedDomainTool, addSiteCreationWidgetTools, addWixSiteCreationTool, addSearchSiteTemplatesTool, addCreateSiteFromTemplateTool, type SiteWidgetToolOptions } from './site-widget-tools/index.js';
|
|
9
|
+
export { addCreateSiteWidgetTool, addEditSiteWidgetTool, addPullSiteJobTool, addClaimSiteTool, addSuggestedDomainTool, addSiteCreationWidgetTools, addWixSiteCreationTool, addSearchSiteTemplatesTool, addCreateSiteFromTemplateTool, addPickImagesTools, type SiteWidgetToolOptions } from './site-widget-tools/index.js';
|
|
10
10
|
export * from './wixel/index.js';
|
|
11
11
|
export { addImportClaudeDesignTool, type ImportClaudeDesignToolOptions } from './import-claude-design-tool/index.js';
|
|
12
12
|
export { IMPORT_CLAUDE_DESIGN_TOOL_NAME } from './import-claude-design-tool/constants.js';
|
|
@@ -25,6 +25,6 @@ export { addCodeModeTools, addExecuteCodeModeTool, addSearchCodeModeTool, type C
|
|
|
25
25
|
export { addUploadHeadlessWebsiteFilesTool, UPLOAD_HEADLESS_WEBSITE_FILES_TOOL_NAME } from './api-call/upload-headless-website-files.js';
|
|
26
26
|
export { validateExecuteCode, EXECUTE_FUNCTION_EXPRESSION_HINT, type CodeValidationResult } from './code-mode/validation.js';
|
|
27
27
|
export { addGraphqlTools, resetGraphqlSchemaCache, GRAPHQL_TOOL_NAMES, SEARCH_GRAPHQL_TOOL_NAME, INSPECT_GRAPHQL_TOOL_NAME, EXECUTE_GRAPHQL_TOOL_NAME, WIX_GRAPHQL_ENDPOINT, type GraphqlToolsOptions, type GraphqlToolName } from './graphql/index.js';
|
|
28
|
-
export { defaultConfig, defaultToolDescriptions, defaultReadmeDocs, widgetSiteCreationConfig, SITE_CREATION_COPY, toWidget, executeCodeModeToolDescriptions, SYSTEM_REMINDER_GUIDELINES, SYSTEM_REMINDER, mergeConfig, type ModeDefaultConfig } from './config/default-config.js';
|
|
28
|
+
export { defaultConfig, defaultToolDescriptions, defaultReadmeDocs, widgetSiteCreationConfig, SITE_CREATION_COPY, toWidget, withUsageGuideOnEveryTool, buildReadmeDocs, executeCodeModeToolDescriptions, SYSTEM_REMINDER_GUIDELINES, SYSTEM_REMINDER, SERVER_INSTRUCTIONS, SERVER_INSTRUCTIONS_TOOLS, mergeConfig, type ModeDefaultConfig } from './config/default-config.js';
|
|
29
29
|
export * from './site-widget-tools/constants.js';
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
package/build/dts/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { handleWixAPIResponse } from './tool-utils.js';
|
|
|
6
6
|
export { addDocsResources } from './resources/docs.js';
|
|
7
7
|
export { addSupportTool } from './support/index.js';
|
|
8
8
|
export { addGetProfileTool } from './account-tools/get-profile-tool.js';
|
|
9
|
-
export { addCreateSiteWidgetTool, addEditSiteWidgetTool, addPullSiteJobTool, addClaimSiteTool, addSuggestedDomainTool, addSiteCreationWidgetTools, addWixSiteCreationTool, addSearchSiteTemplatesTool, addCreateSiteFromTemplateTool } from './site-widget-tools/index.js';
|
|
9
|
+
export { addCreateSiteWidgetTool, addEditSiteWidgetTool, addPullSiteJobTool, addClaimSiteTool, addSuggestedDomainTool, addSiteCreationWidgetTools, addWixSiteCreationTool, addSearchSiteTemplatesTool, addCreateSiteFromTemplateTool, addPickImagesTools } from './site-widget-tools/index.js';
|
|
10
10
|
export * from './wixel/index.js';
|
|
11
11
|
export { addImportClaudeDesignTool } from './import-claude-design-tool/index.js';
|
|
12
12
|
export { IMPORT_CLAUDE_DESIGN_TOOL_NAME } from './import-claude-design-tool/constants.js';
|
|
@@ -31,6 +31,6 @@ export { validateExecuteCode, EXECUTE_FUNCTION_EXPRESSION_HINT } from './code-mo
|
|
|
31
31
|
// GraphQL tools (search operations + inspect schema + execute)
|
|
32
32
|
export { addGraphqlTools, resetGraphqlSchemaCache, GRAPHQL_TOOL_NAMES, SEARCH_GRAPHQL_TOOL_NAME, INSPECT_GRAPHQL_TOOL_NAME, EXECUTE_GRAPHQL_TOOL_NAME, WIX_GRAPHQL_ENDPOINT } from './graphql/index.js';
|
|
33
33
|
// Config exports
|
|
34
|
-
export { defaultConfig, defaultToolDescriptions, defaultReadmeDocs, widgetSiteCreationConfig, SITE_CREATION_COPY, toWidget, executeCodeModeToolDescriptions, SYSTEM_REMINDER_GUIDELINES, SYSTEM_REMINDER, mergeConfig } from './config/default-config.js';
|
|
34
|
+
export { defaultConfig, defaultToolDescriptions, defaultReadmeDocs, widgetSiteCreationConfig, SITE_CREATION_COPY, toWidget, withUsageGuideOnEveryTool, buildReadmeDocs, executeCodeModeToolDescriptions, SYSTEM_REMINDER_GUIDELINES, SYSTEM_REMINDER, SERVER_INSTRUCTIONS, SERVER_INSTRUCTIONS_TOOLS, mergeConfig } from './config/default-config.js';
|
|
35
35
|
export * from './site-widget-tools/constants.js';
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const FREE_TEXT_INFO_PARAMS: readonly ["userRequest", "siteDescription", "siteForm", "siteFunctionality", "agentIdentity", "wixAccess", "reason", "whyNotExecuteWixAPI"];
|
|
2
|
+
export declare function redactPersonalData(text: string): string;
|
|
3
|
+
export declare function serializeToolParamsForBi(args: unknown): string;
|
|
4
|
+
//# sourceMappingURL=redact-personal-data.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Free-text arguments that agents fill in for BI. Their descriptions ask for no
|
|
2
|
+
// personal data; this is the backstop for what comes through anyway, applied to
|
|
3
|
+
// these fields only before tool arguments are recorded. Other arguments (API
|
|
4
|
+
// bodies, code) carry the data the call needs and are recorded as sent.
|
|
5
|
+
export const FREE_TEXT_INFO_PARAMS = [
|
|
6
|
+
'userRequest',
|
|
7
|
+
'siteDescription',
|
|
8
|
+
'siteForm',
|
|
9
|
+
'siteFunctionality',
|
|
10
|
+
'agentIdentity',
|
|
11
|
+
'wixAccess',
|
|
12
|
+
'reason',
|
|
13
|
+
'whyNotExecuteWixAPI'
|
|
14
|
+
];
|
|
15
|
+
const EMAIL = /[A-Z0-9._%+-]+@[A-Z0-9-]+(?:\.[A-Z0-9-]+)*\.[A-Z]{2,}/gi;
|
|
16
|
+
// A secret's value after its name: "password: x", "token=x", "the password is x",
|
|
17
|
+
// "set the password to x". "password-protected" has no value and is kept. An
|
|
18
|
+
// unquoted value runs to the end of its clause, since it may contain spaces.
|
|
19
|
+
const NAMED_SECRET = /\b(passwords?|passwd|pwd|passcodes?|secrets?|tokens?|api[ _-]?keys?|access[ _-]?keys?|credentials?)(\s*[:=]\s*|\s+(?:is|was|to)\s+)(?:"[^"]*"|'[^']*'|`[^`]*`|[^\s"'`,;][^,;\n]*?(?=[.!?]\s|[,;\n]|$))/gi;
|
|
20
|
+
const BEARER = /\bBearer\s+[A-Za-z0-9._~+/=-]+/gi;
|
|
21
|
+
const JWT = /\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
22
|
+
const KEY_PREFIXES = /\b(?:sk-[A-Za-z0-9_-]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|github_pat_\w{20,}|xox[abprs]-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z_-]{35})\b/g;
|
|
23
|
+
// Local paths, not inside a URL ("https://example.com/work/" is kept). A
|
|
24
|
+
// folder name may contain spaces ("/Users/Jane Doe/site"); the last segment
|
|
25
|
+
// ends at the first space unless the path is quoted.
|
|
26
|
+
const BACKTICK = '`';
|
|
27
|
+
const UNIX_ROOT = String.raw `(?<![\w.:/~-])(?:~|/(?:Users|home|root|mnt|tmp|private|var|Volumes|workspace|work))`;
|
|
28
|
+
const WINDOWS_ROOT = String.raw `(?<!\w)[A-Za-z]:(?=\\\w)`;
|
|
29
|
+
const PATH_ROOT = `(?:${UNIX_ROOT}|${WINDOWS_ROOT})`;
|
|
30
|
+
const QUOTED_PATH = new RegExp(String.raw `(?<![\w])(["'${BACKTICK}])${PATH_ROOT}[^"'${BACKTICK}\n]*\1`, 'g');
|
|
31
|
+
const FOLDER = String.raw `[^\s/\\"'${BACKTICK},;()<>]+(?: [^\s/\\"'${BACKTICK},;()<>]+)*`;
|
|
32
|
+
const LOCAL_PATH = new RegExp(String.raw `${PATH_ROOT}(?:[/\\]${FOLDER}(?=[/\\]))*[/\\][^\s"'${BACKTICK},;()<>]*`, 'g');
|
|
33
|
+
// 9 to 15 digits with phone separators, standing alone. Dates, times, UUIDs
|
|
34
|
+
// and shorter counts stay; a bare 9-15 digit number reads as a phone and is
|
|
35
|
+
// redacted, since free text can't tell the two apart.
|
|
36
|
+
const PHONE_CANDIDATE = /(?<![\w-])\+?\(?\d[\d\s().-]{7,}\d(?![\w-])/g;
|
|
37
|
+
const DATE_START = /^\d{4}-\d{2}-\d{2}/;
|
|
38
|
+
function redactPhone(match, offset, text) {
|
|
39
|
+
if (DATE_START.test(match) ||
|
|
40
|
+
/^:\d{2}\b/.test(text.slice(offset + match.length))) {
|
|
41
|
+
return match;
|
|
42
|
+
}
|
|
43
|
+
const digits = match.replace(/\D/g, '').length;
|
|
44
|
+
return digits >= 9 && digits <= 15 ? '[phone]' : match;
|
|
45
|
+
}
|
|
46
|
+
export function redactPersonalData(text) {
|
|
47
|
+
return text
|
|
48
|
+
.replace(EMAIL, '[email]')
|
|
49
|
+
.replace(BEARER, 'Bearer [secret]')
|
|
50
|
+
.replace(JWT, '[secret]')
|
|
51
|
+
.replace(KEY_PREFIXES, '[secret]')
|
|
52
|
+
.replace(NAMED_SECRET, '$1$2[secret]')
|
|
53
|
+
.replace(QUOTED_PATH, '$1[path]$1')
|
|
54
|
+
.replace(LOCAL_PATH, '[path]')
|
|
55
|
+
.replace(PHONE_CANDIDATE, redactPhone);
|
|
56
|
+
}
|
|
57
|
+
function redactInfoParams(value) {
|
|
58
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
const record = value;
|
|
62
|
+
if (!FREE_TEXT_INFO_PARAMS.some((key) => typeof record[key] === 'string')) {
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
const redacted = { ...record };
|
|
66
|
+
for (const key of FREE_TEXT_INFO_PARAMS) {
|
|
67
|
+
if (typeof redacted[key] === 'string') {
|
|
68
|
+
redacted[key] = redactPersonalData(redacted[key]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return redacted;
|
|
72
|
+
}
|
|
73
|
+
// Tool arguments as recorded in BI and error reports: the arguments object, or
|
|
74
|
+
// the MCP SDK's positional argument list, with the free-text info fields
|
|
75
|
+
// redacted.
|
|
76
|
+
export function serializeToolParamsForBi(args) {
|
|
77
|
+
return JSON.stringify(Array.isArray(args) ? args.map(redactInfoParams) : redactInfoParams(args));
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=redact-personal-data.js.map
|
|
@@ -6,6 +6,21 @@ export declare const GET_SUGGESTED_DOMAINS_TOOL_NAME = "GetSuggestedDomains";
|
|
|
6
6
|
export declare const WIX_SITE_CREATION_TOOL_NAME = "WixSiteCreation";
|
|
7
7
|
export declare const SEARCH_SITE_TEMPLATES_TOOL_NAME = "SearchSiteTemplates";
|
|
8
8
|
export declare const CREATE_SITE_FROM_TEMPLATE_TOOL_NAME = "CreateSiteFromTemplate";
|
|
9
|
+
export declare const PICK_IMAGES_TOOL_NAME = "PickImagesForWixMedia";
|
|
10
|
+
export declare const MEDIA_UPLOAD_URL_TOOL_NAME = "CreateWixMediaUploadUrl";
|
|
11
|
+
/** The Wix business features that send a site to StartHeadlessBuild: what wix-headless-kit ships. */
|
|
12
|
+
export declare const WIX_BUSINESS_FEATURES = "a store, bookings or appointments, rentals, events and tickets, a restaurant menu with online orders or reservations, a blog, a portfolio, pricing plans and memberships, donations, Wix Forms, members and login, a CMS, payments";
|
|
13
|
+
/** WixSiteBuilder's and SearchSiteTemplates' answer when the agent says the user did not ask for them. */
|
|
14
|
+
/**
|
|
15
|
+
* The widget payload of a refused editor call: the gallery and builder widgets render nothing
|
|
16
|
+
* for it, since the host mounts them for every call of their tool.
|
|
17
|
+
*/
|
|
18
|
+
export declare const NOT_REQUESTED_WIDGET_PAYLOAD: {
|
|
19
|
+
readonly notRequested: true;
|
|
20
|
+
};
|
|
21
|
+
export declare const EDITOR_NOT_REQUESTED_MESSAGE = "Nothing was created: the user did not ask for this. A new site is written in code and uploaded: call StartDeployWebsite, or StartHeadlessBuild when it needs Wix business features. Don't offer Wix's editor or a template instead.";
|
|
22
|
+
/** WixSiteCreation's answer: it no longer opens a chooser, it sends the agent to the code path. */
|
|
23
|
+
export declare const SITE_CREATION_ROUTE_MESSAGE = "A new site is written in code and uploaded. Call StartDeployWebsite now for the upload guide, or StartHeadlessBuild when the site needs Wix business features. Use WixSiteBuilder or SearchSiteTemplates only when the user asked for the Wix Harmony Editor, a template, Wix Studio or the Classic Editor.";
|
|
9
24
|
/** Fallback actions when the industry is generic or unclear. */
|
|
10
25
|
export declare const SITE_CREATION_DEFAULT_ACTIONS = "add products, set up bookings, and adjust your content";
|
|
11
26
|
/**
|
|
@@ -13,6 +28,38 @@ export declare const SITE_CREATION_DEFAULT_ACTIONS = "add products, set up booki
|
|
|
13
28
|
* that fill the "Next up:" line, generalizing to any industry (the patterns are a reference).
|
|
14
29
|
*/
|
|
15
30
|
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.";
|
|
31
|
+
/**
|
|
32
|
+
* Who builds a new site, as the user is asked it. Named by who builds it and where it gets
|
|
33
|
+
* edited, never "AI": the user is already talking to an AI, so "Build with AI" does not say
|
|
34
|
+
* which one. Shared by the tool descriptions, the chooser widget and its reply.
|
|
35
|
+
*/
|
|
36
|
+
export declare const SITE_BUILDER_CHOICE: {
|
|
37
|
+
readonly here: {
|
|
38
|
+
readonly label: "Build it here with me";
|
|
39
|
+
readonly pitch: "I build it in code right here, and you change anything by asking me";
|
|
40
|
+
};
|
|
41
|
+
readonly editor: {
|
|
42
|
+
readonly label: "Design it in Wix's editor";
|
|
43
|
+
readonly pitch: "Wix designs a first version or you start from a template, then you edit it in Wix";
|
|
44
|
+
};
|
|
45
|
+
/** The editor's second step, in the widget and its reply. */
|
|
46
|
+
readonly editorStart: {
|
|
47
|
+
readonly wix: {
|
|
48
|
+
readonly label: "Let Wix design it";
|
|
49
|
+
readonly pitch: "Wix designs a first version from your description for you to edit";
|
|
50
|
+
};
|
|
51
|
+
readonly template: {
|
|
52
|
+
readonly label: "Browse templates";
|
|
53
|
+
readonly pitch: "start from a ready-made design and edit it in Wix";
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
/** Asked in chat when no widget is shown: who builds it. */
|
|
57
|
+
readonly whoQuestion: "Do you want me to build it here, so you can change anything just by asking me, or do you want to design it yourself in Wix's editor?";
|
|
58
|
+
/** Asked next, only when the user chose Wix's editor. */
|
|
59
|
+
readonly editorQuestion: "Should Wix design a first version for you to edit, or do you want to start from a template?";
|
|
60
|
+
/** What the widget sends as the user's message when they pick "Build it here with me". */
|
|
61
|
+
readonly hereFollowUp: "Build it here with me, in code, so I can keep changing it by asking you.";
|
|
62
|
+
};
|
|
16
63
|
/**
|
|
17
64
|
* Builds the WixSiteCreation chooser reply. The message is fully composed here and wrapped in a
|
|
18
65
|
* preamble that tells the host model to display the body verbatim (keeping the bullets and line
|
|
@@ -24,8 +71,9 @@ export declare const SITE_CREATION_CUSTOM_ACTIONS_GUIDANCE = "2\u20133 specific,
|
|
|
24
71
|
* injection and blocks the whole reply ("Sorry, it looks like I can't chat about this"); there the
|
|
25
72
|
* verbatim-reply instruction lives only in the tool description.
|
|
26
73
|
*/
|
|
27
|
-
export declare function buildSiteCreationSelectorMessage(siteType?: string, customActions?: string, { plain }?: {
|
|
74
|
+
export declare function buildSiteCreationSelectorMessage(siteType?: string, customActions?: string, { plain, editorChosen }?: {
|
|
28
75
|
plain?: boolean;
|
|
76
|
+
editorChosen?: boolean;
|
|
29
77
|
}): string;
|
|
30
78
|
/** OpenAI/ChatGPT widget MIME type for Skybridge rendering */
|
|
31
79
|
export declare const OPENAI_WIDGET_MIME_TYPE = "text/html+skybridge";
|
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
// Tool name constants - separated to avoid circular dependencies during widget builds
|
|
2
2
|
// These constants can be imported by both the widgets and the tool implementations
|
|
3
|
+
// Named in SERVER_INSTRUCTIONS (config/default-config.ts): when this tool's name or what it is for changes, update them to match.
|
|
3
4
|
export const SITE_BUILDER_TOOL_NAME = 'WixSiteBuilder';
|
|
4
5
|
export const EDIT_SITE_TOOL_NAME = 'EditSite';
|
|
5
6
|
export const PULL_SITE_JOB_TOOL_NAME = 'pullSiteCreationJob';
|
|
6
7
|
export const CLAIM_SITE_TOOL_NAME = 'ClaimAnonymousSite';
|
|
7
8
|
export const GET_SUGGESTED_DOMAINS_TOOL_NAME = 'GetSuggestedDomains';
|
|
8
9
|
export const WIX_SITE_CREATION_TOOL_NAME = 'WixSiteCreation';
|
|
10
|
+
// Named in SERVER_INSTRUCTIONS (config/default-config.ts): when this tool's name or what it is for changes, update them to match.
|
|
9
11
|
export const SEARCH_SITE_TEMPLATES_TOOL_NAME = 'SearchSiteTemplates';
|
|
10
12
|
export const CREATE_SITE_FROM_TEMPLATE_TOOL_NAME = 'CreateSiteFromTemplate';
|
|
13
|
+
// Claude clients only: the image picker, and the app-only tool its widget uploads through.
|
|
14
|
+
export const PICK_IMAGES_TOOL_NAME = 'PickImagesForWixMedia';
|
|
15
|
+
export const MEDIA_UPLOAD_URL_TOOL_NAME = 'CreateWixMediaUploadUrl';
|
|
16
|
+
/** The Wix business features that send a site to StartHeadlessBuild: what wix-headless-kit ships. */
|
|
17
|
+
export const WIX_BUSINESS_FEATURES = 'a store, bookings or appointments, rentals, events and tickets, a restaurant menu with online orders or reservations, a blog, a portfolio, pricing plans and memberships, donations, Wix Forms, members and login, a CMS, payments';
|
|
18
|
+
/** WixSiteBuilder's and SearchSiteTemplates' answer when the agent says the user did not ask for them. */
|
|
19
|
+
/**
|
|
20
|
+
* The widget payload of a refused editor call: the gallery and builder widgets render nothing
|
|
21
|
+
* for it, since the host mounts them for every call of their tool.
|
|
22
|
+
*/
|
|
23
|
+
export const NOT_REQUESTED_WIDGET_PAYLOAD = { notRequested: true };
|
|
24
|
+
export const EDITOR_NOT_REQUESTED_MESSAGE = `Nothing was created: the user did not ask for this. A new site is written in code and uploaded: call StartDeployWebsite, or StartHeadlessBuild when it needs Wix business features. Don't offer Wix's editor or a template instead.`;
|
|
25
|
+
/** WixSiteCreation's answer: it no longer opens a chooser, it sends the agent to the code path. */
|
|
26
|
+
export const SITE_CREATION_ROUTE_MESSAGE = `A new site is written in code and uploaded. Call StartDeployWebsite now for the upload guide, or StartHeadlessBuild when the site needs Wix business features. Use WixSiteBuilder or SearchSiteTemplates only when the user asked for the Wix Harmony Editor, a template, Wix Studio or the Classic Editor.`;
|
|
11
27
|
/** Fallback actions when the industry is generic or unclear. */
|
|
12
28
|
export const SITE_CREATION_DEFAULT_ACTIONS = 'add products, set up bookings, and adjust your content';
|
|
13
29
|
/**
|
|
@@ -22,6 +38,38 @@ export const SITE_CREATION_CUSTOM_ACTIONS_GUIDANCE = `2–3 specific, high-value
|
|
|
22
38
|
* Events / Weddings / Real Estate: "add event schedules, display listings, and manage RSVP forms"
|
|
23
39
|
* General / Unspecified: "${SITE_CREATION_DEFAULT_ACTIONS}"
|
|
24
40
|
If none of these patterns fit the site, infer 2–3 actions that suit what that kind of business would manage on its site.`;
|
|
41
|
+
/**
|
|
42
|
+
* Who builds a new site, as the user is asked it. Named by who builds it and where it gets
|
|
43
|
+
* edited, never "AI": the user is already talking to an AI, so "Build with AI" does not say
|
|
44
|
+
* which one. Shared by the tool descriptions, the chooser widget and its reply.
|
|
45
|
+
*/
|
|
46
|
+
export const SITE_BUILDER_CHOICE = {
|
|
47
|
+
here: {
|
|
48
|
+
label: 'Build it here with me',
|
|
49
|
+
pitch: 'I build it in code right here, and you change anything by asking me'
|
|
50
|
+
},
|
|
51
|
+
editor: {
|
|
52
|
+
label: "Design it in Wix's editor",
|
|
53
|
+
pitch: 'Wix designs a first version or you start from a template, then you edit it in Wix'
|
|
54
|
+
},
|
|
55
|
+
/** The editor's second step, in the widget and its reply. */
|
|
56
|
+
editorStart: {
|
|
57
|
+
wix: {
|
|
58
|
+
label: 'Let Wix design it',
|
|
59
|
+
pitch: 'Wix designs a first version from your description for you to edit'
|
|
60
|
+
},
|
|
61
|
+
template: {
|
|
62
|
+
label: 'Browse templates',
|
|
63
|
+
pitch: 'start from a ready-made design and edit it in Wix'
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
/** Asked in chat when no widget is shown: who builds it. */
|
|
67
|
+
whoQuestion: "Do you want me to build it here, so you can change anything just by asking me, or do you want to design it yourself in Wix's editor?",
|
|
68
|
+
/** Asked next, only when the user chose Wix's editor. */
|
|
69
|
+
editorQuestion: 'Should Wix design a first version for you to edit, or do you want to start from a template?',
|
|
70
|
+
/** What the widget sends as the user's message when they pick "Build it here with me". */
|
|
71
|
+
hereFollowUp: 'Build it here with me, in code, so I can keep changing it by asking you.'
|
|
72
|
+
};
|
|
25
73
|
/**
|
|
26
74
|
* Builds the WixSiteCreation chooser reply. The message is fully composed here and wrapped in a
|
|
27
75
|
* preamble that tells the host model to display the body verbatim (keeping the bullets and line
|
|
@@ -33,23 +81,32 @@ If none of these patterns fit the site, infer 2–3 actions that suit what that
|
|
|
33
81
|
* injection and blocks the whole reply ("Sorry, it looks like I can't chat about this"); there the
|
|
34
82
|
* verbatim-reply instruction lives only in the tool description.
|
|
35
83
|
*/
|
|
36
|
-
export function buildSiteCreationSelectorMessage(siteType, customActions, { plain = false } = {}) {
|
|
84
|
+
export function buildSiteCreationSelectorMessage(siteType, customActions, { plain = false, editorChosen = false } = {}) {
|
|
37
85
|
const type = (siteType ?? '').trim() || 'new';
|
|
38
86
|
const actions = (customActions ?? '').trim() || SITE_CREATION_DEFAULT_ACTIONS;
|
|
87
|
+
// With the editor already chosen, the widget opens at "how to start", so the two
|
|
88
|
+
// bullets are that step's options instead of who builds it.
|
|
89
|
+
const here = editorChosen
|
|
90
|
+
? `* **${SITE_BUILDER_CHOICE.editorStart.wix.label}**: ${SITE_BUILDER_CHOICE.editorStart.wix.pitch}`
|
|
91
|
+
: `* **${SITE_BUILDER_CHOICE.here.label}**: ${SITE_BUILDER_CHOICE.here.pitch}`;
|
|
92
|
+
const editor = editorChosen
|
|
93
|
+
? `* **${SITE_BUILDER_CHOICE.editorStart.template.label}**: ${SITE_BUILDER_CHOICE.editorStart.template.pitch}`
|
|
94
|
+
: `* **${SITE_BUILDER_CHOICE.editor.label}**: ${SITE_BUILDER_CHOICE.editor.pitch}`;
|
|
95
|
+
const nextUp = `**Next up:** Either way, you can ask me to ${actions}—right here in the chat!`;
|
|
39
96
|
const body = `Ready to set up your ${type} site? Choose your path in the widget above:
|
|
40
97
|
|
|
41
|
-
|
|
42
|
-
|
|
98
|
+
${here}
|
|
99
|
+
${editor}
|
|
43
100
|
|
|
44
|
-
|
|
101
|
+
${nextUp}`;
|
|
45
102
|
if (plain) {
|
|
46
103
|
return body;
|
|
47
104
|
}
|
|
48
105
|
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:
|
|
49
106
|
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.
|
|
50
|
-
2. "
|
|
51
|
-
3. "
|
|
52
|
-
4. "
|
|
107
|
+
2. "${here}"
|
|
108
|
+
3. "${editor}"
|
|
109
|
+
4. "${nextUp}"
|
|
53
110
|
|
|
54
111
|
Copy those four lines as written; do not summarize, shorten, reorder, or reword any of them. Here is the full message to send:
|
|
55
112
|
|
|
@@ -9,5 +9,6 @@ export { addSuggestedDomainTool } from './suggested-domain-tool/index.js';
|
|
|
9
9
|
export { addWixSiteCreationTool } from './site-creation-tool/index.js';
|
|
10
10
|
export { addSearchSiteTemplatesTool } from './search-site-templates-tool/index.js';
|
|
11
11
|
export { addCreateSiteFromTemplateTool } from './create-site-from-template-tool/index.js';
|
|
12
|
+
export { addPickImagesTools } from './pick-images-tool/index.js';
|
|
12
13
|
export declare function addSiteCreationWidgetTools(server: WixMcpServer, authStrategy: McpAuthenticationStrategy, options?: SiteWidgetToolOptions): void;
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -10,6 +10,7 @@ export { addSuggestedDomainTool } from './suggested-domain-tool/index.js';
|
|
|
10
10
|
export { addWixSiteCreationTool } from './site-creation-tool/index.js';
|
|
11
11
|
export { addSearchSiteTemplatesTool } from './search-site-templates-tool/index.js';
|
|
12
12
|
export { addCreateSiteFromTemplateTool } from './create-site-from-template-tool/index.js';
|
|
13
|
+
export { addPickImagesTools } from './pick-images-tool/index.js';
|
|
13
14
|
// Combine all the required site widget tools
|
|
14
15
|
export function addSiteCreationWidgetTools(server, authStrategy, options) {
|
|
15
16
|
addCreateSiteWidgetTool(server, authStrategy, options);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { McpAuthenticationStrategy } from '../../auth/index.js';
|
|
2
|
+
import { WixMcpServer } from '../../wix-mcp-server.js';
|
|
3
|
+
/**
|
|
4
|
+
* Exists only because Claude can't hand a file to a tool: recheck when it can (see
|
|
5
|
+
* config/file-params.ts), and drop or narrow this then.
|
|
6
|
+
*
|
|
7
|
+
* The image picker for clients that can't hand a file to a tool (Claude): the user
|
|
8
|
+
* picks images in a widget, which uploads them from the browser to the site's Media
|
|
9
|
+
* Manager through upload URLs from the app-only CreateWixMediaUploadUrl tool.
|
|
10
|
+
*/
|
|
11
|
+
export declare function addPickImagesTools(server: WixMcpServer, strategy: McpAuthenticationStrategy, options?: {
|
|
12
|
+
toolDescriptions?: Record<string, string>;
|
|
13
|
+
}): void;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|