@wix/mcp 1.0.31 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bin-standalone.js +65 -19
- package/build/bin-standalone.js.map +3 -3
- package/build/cjs/index.cjs +350 -23
- package/build/cjs/index.cjs.map +4 -4
- package/build/dts/bin.js +3 -1
- package/build/dts/bin.js.map +1 -1
- package/build/dts/config/default-config.d.ts +1 -0
- package/build/dts/config/default-config.d.ts.map +1 -1
- package/build/dts/config/default-config.js +27 -4
- package/build/dts/config/default-config.js.map +1 -1
- package/build/dts/docs/docs.d.ts +2 -0
- package/build/dts/docs/docs.d.ts.map +1 -1
- package/build/dts/docs/docs.js +10 -2
- package/build/dts/docs/docs.js.map +1 -1
- package/build/dts/docs/get-to-know.d.ts +12 -1
- package/build/dts/docs/get-to-know.d.ts.map +1 -1
- package/build/dts/docs/get-to-know.js +20 -8
- package/build/dts/docs/get-to-know.js.map +1 -1
- package/build/dts/docs/get-to-know.test.d.ts +2 -0
- package/build/dts/docs/get-to-know.test.d.ts.map +1 -0
- package/build/dts/docs/get-to-know.test.js +89 -0
- package/build/dts/docs/get-to-know.test.js.map +1 -0
- package/build/dts/site-widget-tools/site-builder-tool/index.d.ts +4 -0
- package/build/dts/site-widget-tools/site-builder-tool/index.d.ts.map +1 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.js +22 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.js.map +1 -1
- package/build/dts/toolkit.d.ts +11 -2
- package/build/dts/toolkit.d.ts.map +1 -1
- package/build/dts/toolkit.js +15 -3
- package/build/dts/toolkit.js.map +1 -1
- package/build/esm/index.js +346 -19
- package/build/esm/index.js.map +4 -4
- package/package.json +3 -2
package/build/dts/toolkit.d.ts
CHANGED
|
@@ -52,8 +52,17 @@ export interface WixToolkit {
|
|
|
52
52
|
getTool(name: string): WixTool | undefined;
|
|
53
53
|
/** Just the tool names */
|
|
54
54
|
getToolNames(): string[];
|
|
55
|
-
/** Pre-load WixREADME content (calls the WixREADME tool internally)
|
|
56
|
-
|
|
55
|
+
/** Pre-load WixREADME content (calls the WixREADME tool internally).
|
|
56
|
+
* Optionally pass a filter to scope dynamic context to a specific site. */
|
|
57
|
+
preloadReadme(filter?: {
|
|
58
|
+
siteId?: string;
|
|
59
|
+
siteName?: string;
|
|
60
|
+
}): Promise<string | null>;
|
|
61
|
+
/** Pre-load dynamic context (site info, installed apps, etc.) */
|
|
62
|
+
preloadDynamicContext(filter?: {
|
|
63
|
+
siteId?: string;
|
|
64
|
+
siteName?: string;
|
|
65
|
+
}): Promise<string | null>;
|
|
57
66
|
}
|
|
58
67
|
/** Lifecycle hooks for consumer-side observability. */
|
|
59
68
|
export interface WixToolkitHooks {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../src/toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../src/toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,QAAQ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,CAAC,EAAE,oBAAoB,CAAC;IAC5B,8BAA8B;IAC9B,GAAG,CAAC,EAAE,mBAAmB,CAAC;IAC1B;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sFAAsF;IACtF,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AA+GD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAK1D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAuQvE"}
|
package/build/dts/toolkit.js
CHANGED
|
@@ -31,6 +31,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
31
31
|
import { HttpClient } from '@wix/http-client';
|
|
32
32
|
import { addDocsTools } from './docs/docs.js';
|
|
33
33
|
import { addApiCallTool } from './api-call/index.js';
|
|
34
|
+
import { getDynamicContext } from './docs/get-to-know.js';
|
|
34
35
|
import { createPanoramaClient } from './infra/panorama.js';
|
|
35
36
|
import { createBiLogger } from './infra/bi-logger.js';
|
|
36
37
|
import { DEV_ENVIRONMENTS, getEnvironment } from './infra/environment.js';
|
|
@@ -154,7 +155,9 @@ export function createWixToolkit(options) {
|
|
|
154
155
|
}
|
|
155
156
|
else {
|
|
156
157
|
// Default: register all docs tools
|
|
157
|
-
addDocsTools(server, undefined, {
|
|
158
|
+
addDocsTools(server, undefined, {
|
|
159
|
+
authStrategy
|
|
160
|
+
});
|
|
158
161
|
}
|
|
159
162
|
// Register API tools
|
|
160
163
|
if (api) {
|
|
@@ -313,17 +316,26 @@ export function createWixToolkit(options) {
|
|
|
313
316
|
getTools: () => allTools,
|
|
314
317
|
getTool: (name) => toolsByName.get(name),
|
|
315
318
|
getToolNames: () => allTools.map((t) => t.name),
|
|
316
|
-
preloadReadme: async () => {
|
|
319
|
+
preloadReadme: async (filter) => {
|
|
317
320
|
const readmeTool = toolsByName.get('WixREADME');
|
|
318
321
|
if (!readmeTool)
|
|
319
322
|
return null;
|
|
320
323
|
try {
|
|
321
|
-
const result = await readmeTool.execute({});
|
|
324
|
+
const result = await readmeTool.execute(filter ?? {});
|
|
322
325
|
return extractText(result);
|
|
323
326
|
}
|
|
324
327
|
catch {
|
|
325
328
|
return null;
|
|
326
329
|
}
|
|
330
|
+
},
|
|
331
|
+
preloadDynamicContext: async (filter) => {
|
|
332
|
+
try {
|
|
333
|
+
const httpClient = new HttpClient();
|
|
334
|
+
return ((await getDynamicContext(authStrategy, httpClient, filter)) || null);
|
|
335
|
+
}
|
|
336
|
+
catch {
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
327
339
|
}
|
|
328
340
|
};
|
|
329
341
|
}
|
package/build/dts/toolkit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolkit.js","sourceRoot":"","sources":["../../src/toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,YAAY,EAGb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"toolkit.js","sourceRoot":"","sources":["../../src/toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;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AE,CAAC,CAAC;gBACtD,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;YAC7B,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,qBAAqB,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YACtC,IAAI,CAAC;gBACH,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;gBACpC,OAAO,CACL,CAAC,MAAM,iBAAiB,CAAC,YAAY,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,IAAI,IAAI,CACpE,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/build/esm/index.js
CHANGED
|
@@ -29193,6 +29193,8 @@ var SYSTEM_REMINDER = dedent_default`
|
|
|
29193
29193
|
</goal>
|
|
29194
29194
|
<guidelines>
|
|
29195
29195
|
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.
|
|
29196
|
+
**Exception:** If the user asks to create, build, or generate a new Wix site/website, skip WixREADME and call WixSiteBuilder directly if it is available.
|
|
29197
|
+
**Exception:** If the user asks to list, show, or find their Wix sites, skip WixREADME and call ListWixSites directly.
|
|
29196
29198
|
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.
|
|
29197
29199
|
If the user prompt / task is an instruction to do something in Wix, You should not tell the user what Docs to read or what API to call, your task is to do the work and complete the task in minimal steps and time with minimal back and forth with the user, unless absolutely necessary.
|
|
29198
29200
|
</guidelines>
|
|
@@ -29235,6 +29237,7 @@ var defaultToolDescriptions = {
|
|
|
29235
29237
|
`,
|
|
29236
29238
|
CallWixSiteAPI: dedent_default`
|
|
29237
29239
|
Call Wix apis on a business or site. Use this to create, read, update, and delete data and other Wix entities in your Wix site.
|
|
29240
|
+
**Prefer using the "ListWixSites" tool when the user asks to list or show their sites.** Only use this tool for site listing if the user needs advanced filtering or specific site details beyond what ListWixSites provides.
|
|
29238
29241
|
For POST/PATCH/PUT requests, pass the request body as a JSON object in the "body" parameter with all the required fields and values as described in the API schema, code examples, or docs you retrieved (e.g. body: {"name": "value", "nested": {"key": "value"}}).
|
|
29239
29242
|
The API endpoint url param MUST ALWAYS be taken from the conversation context.
|
|
29240
29243
|
By conversation context we mean the endpoint url was given in the user prompt OR got into the conversation context by the "WixREADME" tool OR by the "SearchWixRESTDocumentation" tool OR by the "BrowseWixRESTDocsMenu" tool OR by the "ReadFullDocsArticle" tool.
|
|
@@ -29247,7 +29250,11 @@ var defaultToolDescriptions = {
|
|
|
29247
29250
|
${SYSTEM_REMINDER}
|
|
29248
29251
|
`,
|
|
29249
29252
|
ListWixSites: dedent_default`
|
|
29250
|
-
|
|
29253
|
+
**Use this tool whenever the user asks to list, show, get, or find their Wix sites.** This is the dedicated tool for listing Wix sites for the current user. By default it returns all sites, but you can filter by name.
|
|
29254
|
+
|
|
29255
|
+
**Do NOT use WixREADME before this tool.** When the user asks to list their sites, call this tool directly — no need to read documentation first.
|
|
29256
|
+
|
|
29257
|
+
**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.
|
|
29251
29258
|
${SYSTEM_REMINDER}
|
|
29252
29259
|
`,
|
|
29253
29260
|
ManageWixSite: dedent_default`
|
|
@@ -29289,6 +29296,15 @@ var defaultToolDescriptions = {
|
|
|
29289
29296
|
- Site Properties: "https://dev.wix.com/docs/api-reference/business-management/site-properties"
|
|
29290
29297
|
${SYSTEM_REMINDER}
|
|
29291
29298
|
`,
|
|
29299
|
+
WixSiteBuilder: dedent_default`
|
|
29300
|
+
**PRIMARY tool for creating/building/generating a Wix site or website.** This is the preferred and recommended way to create a new Wix site. Use this tool whenever the user asks to build, create, or generate a site/website/application. Do NOT use CreateWixBusinessGuide for site creation — use this tool instead.
|
|
29301
|
+
|
|
29302
|
+
**Do NOT use WixREADME or SearchWixRESTDocumentation before this tool.** When the user asks to build, create, or generate a site, call this tool directly. It handles everything needed for site creation.
|
|
29303
|
+
|
|
29304
|
+
**IMPORTANT: You MUST call this tool to build the site.** Do NOT suggest HTML code, prompt templates, or alternative approaches instead of actually building the site. When a user asks to create a site, your job is to call this tool and build it — not to describe how to build it or suggest alternatives.
|
|
29305
|
+
|
|
29306
|
+
**IMPORTANT: The sitePrompt must be under 6000 characters.** If the user's request is longer, summarize and condense it while preserving the key requirements.
|
|
29307
|
+
`,
|
|
29292
29308
|
CreateWixBusinessGuide: dedent_default`
|
|
29293
29309
|
Provides comprehensive documentation for creating a new Wix Business (i.e site, app, etc.)
|
|
29294
29310
|
|
|
@@ -29584,7 +29600,12 @@ var defaultReadmeDocs = [
|
|
|
29584
29600
|
|
|
29585
29601
|
<flow-description>
|
|
29586
29602
|
Wix MCP Site Management Flows:
|
|
29587
|
-
|
|
29603
|
+
|
|
29604
|
+
Site Creation flow (highest priority for site creation requests):
|
|
29605
|
+
1. User asks to create, build, or generate a Wix site/website,
|
|
29606
|
+
2. Call the "WixSiteBuilder" tool directly with the user's prompt. Do NOT call WixREADME first.
|
|
29607
|
+
3. Do NOT suggest HTML code or alternative approaches — actually build the site.
|
|
29608
|
+
|
|
29588
29609
|
"Recipe" based flow (The most preferred flow):
|
|
29589
29610
|
1. User asks you to do something,
|
|
29590
29611
|
2. You use the "WixREADME" tool to get the context, it will return a list of "recipes" which are essentially Wix docs articles that describe how to do something in Wix.
|
|
@@ -29653,7 +29674,8 @@ function mergeConfig(base, overrides) {
|
|
|
29653
29674
|
getToKnowWixEnabled: overrides.getToKnowWixEnabled ?? base.getToKnowWixEnabled,
|
|
29654
29675
|
createWixBusinessGuideEnabled: overrides.createWixBusinessGuideEnabled ?? base.createWixBusinessGuideEnabled,
|
|
29655
29676
|
codeModeEnabled: overrides.codeModeEnabled ?? base.codeModeEnabled,
|
|
29656
|
-
maxResponseSize: overrides.maxResponseSize ?? base.maxResponseSize
|
|
29677
|
+
maxResponseSize: overrides.maxResponseSize ?? base.maxResponseSize,
|
|
29678
|
+
dynamicContextEnabled: overrides.dynamicContextEnabled ?? base.dynamicContextEnabled
|
|
29657
29679
|
};
|
|
29658
29680
|
}
|
|
29659
29681
|
var defaultConfig = {
|
|
@@ -29663,11 +29685,271 @@ var defaultConfig = {
|
|
|
29663
29685
|
readmeDocs: defaultReadmeDocs,
|
|
29664
29686
|
// docsTools not set - defaults to all docs tools in addDocsTools()
|
|
29665
29687
|
getToKnowWixEnabled: true,
|
|
29666
|
-
createWixBusinessGuideEnabled: true
|
|
29688
|
+
createWixBusinessGuideEnabled: true,
|
|
29689
|
+
dynamicContextEnabled: true
|
|
29667
29690
|
};
|
|
29668
29691
|
|
|
29692
|
+
// ../dynamic-context-enricher/build/index.mjs
|
|
29693
|
+
var __defProp2 = Object.defineProperty;
|
|
29694
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
29695
|
+
var __esm2 = (fn, res) => function __init() {
|
|
29696
|
+
return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
|
|
29697
|
+
};
|
|
29698
|
+
var __export2 = (target, all) => {
|
|
29699
|
+
for (var name in all)
|
|
29700
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
29701
|
+
};
|
|
29702
|
+
var enrich_exports = {};
|
|
29703
|
+
__export2(enrich_exports, {
|
|
29704
|
+
enrichDynamicContext: () => enrichDynamicContext
|
|
29705
|
+
});
|
|
29706
|
+
function snakeToCamel(obj) {
|
|
29707
|
+
if (Array.isArray(obj)) return obj.map(snakeToCamel);
|
|
29708
|
+
if (obj !== null && typeof obj === "object") {
|
|
29709
|
+
const result = {};
|
|
29710
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
29711
|
+
const camelKey = key.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
|
|
29712
|
+
result[camelKey] = snakeToCamel(value);
|
|
29713
|
+
}
|
|
29714
|
+
return result;
|
|
29715
|
+
}
|
|
29716
|
+
return obj;
|
|
29717
|
+
}
|
|
29718
|
+
function formatTimestamp(value) {
|
|
29719
|
+
if (!value) return "";
|
|
29720
|
+
try {
|
|
29721
|
+
const date3 = new Date(value);
|
|
29722
|
+
return date3.toLocaleDateString("en-US", {
|
|
29723
|
+
month: "short",
|
|
29724
|
+
day: "2-digit",
|
|
29725
|
+
year: "numeric",
|
|
29726
|
+
hour: "2-digit",
|
|
29727
|
+
minute: "2-digit",
|
|
29728
|
+
hour12: false,
|
|
29729
|
+
timeZone: "UTC"
|
|
29730
|
+
});
|
|
29731
|
+
} catch {
|
|
29732
|
+
return value;
|
|
29733
|
+
}
|
|
29734
|
+
}
|
|
29735
|
+
function capitalize(s) {
|
|
29736
|
+
if (!s) return s;
|
|
29737
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
29738
|
+
}
|
|
29739
|
+
function renderAccountHeader(account) {
|
|
29740
|
+
const lines = [];
|
|
29741
|
+
if (account.displayName) {
|
|
29742
|
+
lines.push(`**Account**: ${account.displayName}`);
|
|
29743
|
+
}
|
|
29744
|
+
if (account.id) {
|
|
29745
|
+
lines.push(`**Account ID**: \`${account.id}\``);
|
|
29746
|
+
}
|
|
29747
|
+
const meta = [];
|
|
29748
|
+
if (account.status) meta.push(`Status: **${account.status}**`);
|
|
29749
|
+
if (account.coBranding && account.coBranding !== "None" && account.coBranding !== "CO_BRANDING_UNSPECIFIED") {
|
|
29750
|
+
meta.push("Co-branded");
|
|
29751
|
+
}
|
|
29752
|
+
if (meta.length) lines.push(meta.join(" \xB7 "));
|
|
29753
|
+
if (account.createdDate) {
|
|
29754
|
+
let dateLine = `**Created**: ${formatTimestamp(account.createdDate)}`;
|
|
29755
|
+
if (account.updatedDate) {
|
|
29756
|
+
dateLine += ` \xB7 **Updated**: ${formatTimestamp(account.updatedDate)}`;
|
|
29757
|
+
}
|
|
29758
|
+
lines.push(dateLine);
|
|
29759
|
+
}
|
|
29760
|
+
return lines.length ? lines.join("\n") : "";
|
|
29761
|
+
}
|
|
29762
|
+
function renderStatusBadges(site) {
|
|
29763
|
+
const tags = [];
|
|
29764
|
+
tags.push(site.published ? "Published" : "Draft");
|
|
29765
|
+
if (site.premium) tags.push("Premium");
|
|
29766
|
+
if (site.domainConnected) tags.push("Custom Domain");
|
|
29767
|
+
if (site.editorType && site.editorType !== "EDITOR_TYPE_UNSPECIFIED" && site.editorType !== "UNKNOWN") {
|
|
29768
|
+
tags.push(capitalize(site.editorType.replace(/_/g, " ").toLowerCase()));
|
|
29769
|
+
}
|
|
29770
|
+
return tags.join(" \xB7 ");
|
|
29771
|
+
}
|
|
29772
|
+
function renderApps(apps) {
|
|
29773
|
+
const relevant = apps.filter((a) => a.appId && KNOWN_APPS[a.appId]).sort(
|
|
29774
|
+
(a, b) => (KNOWN_APPS[a.appId] ?? "").localeCompare(KNOWN_APPS[b.appId] ?? "")
|
|
29775
|
+
);
|
|
29776
|
+
if (!relevant.length) return "";
|
|
29777
|
+
const lines = [];
|
|
29778
|
+
for (const app of relevant) {
|
|
29779
|
+
let line = `- **${KNOWN_APPS[app.appId]}**`;
|
|
29780
|
+
if (app.catalogVersion) {
|
|
29781
|
+
line += ` \u2014 catalog: **${app.catalogVersion}**`;
|
|
29782
|
+
}
|
|
29783
|
+
lines.push(line);
|
|
29784
|
+
}
|
|
29785
|
+
return lines.join("\n");
|
|
29786
|
+
}
|
|
29787
|
+
function renderProperties(props) {
|
|
29788
|
+
const items = [];
|
|
29789
|
+
if (props.language) items.push(`**Language**: ${props.language}`);
|
|
29790
|
+
if (props.locale?.country) items.push(`**Country**: ${props.locale.country}`);
|
|
29791
|
+
if (props.paymentCurrency) items.push(`**Currency**: ${props.paymentCurrency}`);
|
|
29792
|
+
if (props.timeZone) items.push(`**Timezone**: ${props.timeZone}`);
|
|
29793
|
+
if (props.email) items.push(`**Email**: ${props.email}`);
|
|
29794
|
+
if (props.phone) items.push(`**Phone**: ${props.phone}`);
|
|
29795
|
+
return items.join("\n");
|
|
29796
|
+
}
|
|
29797
|
+
function renderCmsCollections(collections) {
|
|
29798
|
+
const nonEmpty = collections.filter(
|
|
29799
|
+
(c) => c.displayName || c.fields && c.fields.length > 0
|
|
29800
|
+
);
|
|
29801
|
+
if (!nonEmpty.length) return "";
|
|
29802
|
+
const lines = [];
|
|
29803
|
+
for (const col of nonEmpty) {
|
|
29804
|
+
const name = col.displayName ?? col.id ?? "Unnamed";
|
|
29805
|
+
lines.push(`- **${name}**`);
|
|
29806
|
+
const customFields = (col.fields ?? []).filter((f) => !f.systemField);
|
|
29807
|
+
if (customFields.length) {
|
|
29808
|
+
for (const field of customFields) {
|
|
29809
|
+
const fieldName = field.displayName ?? field.key ?? "";
|
|
29810
|
+
let fieldLine = ` - ${fieldName}`;
|
|
29811
|
+
if (field.type) fieldLine += ` (\`${field.type}\`)`;
|
|
29812
|
+
if (field.referencedCollection) {
|
|
29813
|
+
fieldLine += ` \u2192 \`${field.referencedCollection}\``;
|
|
29814
|
+
}
|
|
29815
|
+
lines.push(fieldLine);
|
|
29816
|
+
}
|
|
29817
|
+
}
|
|
29818
|
+
}
|
|
29819
|
+
return lines.join("\n");
|
|
29820
|
+
}
|
|
29821
|
+
function renderSite(site, index) {
|
|
29822
|
+
const lines = [];
|
|
29823
|
+
const heading = site.displayName ?? `Site ${index}`;
|
|
29824
|
+
lines.push(`## ${index}. ${heading}`);
|
|
29825
|
+
lines.push("");
|
|
29826
|
+
if (site.id) lines.push(`**ID**: \`${site.id}\``);
|
|
29827
|
+
if (site.url) lines.push(`**URL**: [${site.url}](${site.url})`);
|
|
29828
|
+
lines.push(`**Status**: ${renderStatusBadges(site)}`);
|
|
29829
|
+
if (site.createdDate) {
|
|
29830
|
+
let dateLine = `**Created**: ${formatTimestamp(site.createdDate)}`;
|
|
29831
|
+
if (site.updatedDate) {
|
|
29832
|
+
dateLine += ` \xB7 **Updated**: ${formatTimestamp(site.updatedDate)}`;
|
|
29833
|
+
}
|
|
29834
|
+
lines.push(dateLine);
|
|
29835
|
+
}
|
|
29836
|
+
if (site.veloEnabled !== void 0 && site.veloEnabled !== null) {
|
|
29837
|
+
lines.push(`**Velo**: ${site.veloEnabled ? "Enabled" : "Disabled"}`);
|
|
29838
|
+
}
|
|
29839
|
+
if (site.properties) {
|
|
29840
|
+
const propsContent = renderProperties(site.properties);
|
|
29841
|
+
if (propsContent) {
|
|
29842
|
+
lines.push("");
|
|
29843
|
+
lines.push("### Properties");
|
|
29844
|
+
lines.push("");
|
|
29845
|
+
lines.push(propsContent);
|
|
29846
|
+
}
|
|
29847
|
+
}
|
|
29848
|
+
const appsContent = renderApps(site.installedApps ?? []);
|
|
29849
|
+
if (appsContent) {
|
|
29850
|
+
lines.push("");
|
|
29851
|
+
lines.push("### Apps");
|
|
29852
|
+
lines.push("");
|
|
29853
|
+
lines.push(appsContent);
|
|
29854
|
+
}
|
|
29855
|
+
if (site.cmsCollections?.length) {
|
|
29856
|
+
const cmsContent = renderCmsCollections(site.cmsCollections);
|
|
29857
|
+
if (cmsContent) {
|
|
29858
|
+
lines.push("");
|
|
29859
|
+
lines.push("### CMS Collections");
|
|
29860
|
+
lines.push("");
|
|
29861
|
+
lines.push(cmsContent);
|
|
29862
|
+
}
|
|
29863
|
+
}
|
|
29864
|
+
lines.push("");
|
|
29865
|
+
lines.push("---");
|
|
29866
|
+
lines.push("");
|
|
29867
|
+
return lines.join("\n");
|
|
29868
|
+
}
|
|
29869
|
+
function enrichDynamicContext(data) {
|
|
29870
|
+
let parsed = data;
|
|
29871
|
+
if (typeof data === "string") {
|
|
29872
|
+
try {
|
|
29873
|
+
parsed = JSON.parse(data);
|
|
29874
|
+
} catch {
|
|
29875
|
+
return data;
|
|
29876
|
+
}
|
|
29877
|
+
}
|
|
29878
|
+
if (parsed === null || parsed === void 0) return "";
|
|
29879
|
+
if (typeof parsed !== "object") return "";
|
|
29880
|
+
const response = snakeToCamel(parsed);
|
|
29881
|
+
const sections = [];
|
|
29882
|
+
sections.push("# My Wix Sites Context");
|
|
29883
|
+
sections.push("");
|
|
29884
|
+
if (response.account) {
|
|
29885
|
+
const accountSection = renderAccountHeader(response.account);
|
|
29886
|
+
if (accountSection) {
|
|
29887
|
+
sections.push(accountSection);
|
|
29888
|
+
}
|
|
29889
|
+
}
|
|
29890
|
+
const siteCount = response.sites?.length ?? 0;
|
|
29891
|
+
const hasNext = Boolean(response.pagingMetadata?.cursors?.next);
|
|
29892
|
+
let countLine = `_Showing ${siteCount} sites`;
|
|
29893
|
+
if (hasNext) countLine += " (more available)";
|
|
29894
|
+
countLine += "_";
|
|
29895
|
+
sections.push(countLine);
|
|
29896
|
+
sections.push("");
|
|
29897
|
+
sections.push("---");
|
|
29898
|
+
sections.push("");
|
|
29899
|
+
if (response.sites?.length) {
|
|
29900
|
+
for (let i = 0; i < response.sites.length; i++) {
|
|
29901
|
+
sections.push(renderSite(response.sites[i], i + 1));
|
|
29902
|
+
}
|
|
29903
|
+
}
|
|
29904
|
+
if (!response.account && !siteCount) return "";
|
|
29905
|
+
return sections.join("\n");
|
|
29906
|
+
}
|
|
29907
|
+
var KNOWN_APPS;
|
|
29908
|
+
var init_enrich = __esm2({
|
|
29909
|
+
"src/enrich.ts"() {
|
|
29910
|
+
"use strict";
|
|
29911
|
+
KNOWN_APPS = {
|
|
29912
|
+
"14bcded7-0066-7c35-14d7-466cb3f09103": "Wix Bookings",
|
|
29913
|
+
"215238eb-22a5-4c36-9e7b-e7c08025e04e": "Wix Stores",
|
|
29914
|
+
"9a5d83fd-8570-482e-81ab-cfa88942ee60": "Wix Restaurants (Orders)",
|
|
29915
|
+
"b278a256-2757-4f19-9313-c05c783bec92": "Wix Restaurants (Menus)"
|
|
29916
|
+
};
|
|
29917
|
+
}
|
|
29918
|
+
});
|
|
29919
|
+
init_enrich();
|
|
29920
|
+
var DYNAMIC_CONTEXT_URL = "https://dev.wix.com/_api/dynamic-context/v1/dynamic-context";
|
|
29921
|
+
async function getDynamicContext(auth, httpClient6, filter) {
|
|
29922
|
+
const { enrichDynamicContext: enrichDynamicContext2 } = await Promise.resolve().then(() => (init_enrich(), enrich_exports));
|
|
29923
|
+
try {
|
|
29924
|
+
const accountHeaders = await auth.getAccountAuthHeaders();
|
|
29925
|
+
const body = {};
|
|
29926
|
+
if (filter?.siteId) body.site_id = filter.siteId;
|
|
29927
|
+
else if (filter?.siteName) body.site_name = filter.siteName;
|
|
29928
|
+
const response = await httpClient6.request({
|
|
29929
|
+
url: DYNAMIC_CONTEXT_URL,
|
|
29930
|
+
method: "POST",
|
|
29931
|
+
headers: { ...accountHeaders, "Content-Type": "application/json" },
|
|
29932
|
+
data: body
|
|
29933
|
+
});
|
|
29934
|
+
return enrichDynamicContext2(response.data);
|
|
29935
|
+
} catch (error2) {
|
|
29936
|
+
console.error(
|
|
29937
|
+
`[dynamic-context-enricher] Fetch failed: ${error2.message}`
|
|
29938
|
+
);
|
|
29939
|
+
return "";
|
|
29940
|
+
}
|
|
29941
|
+
}
|
|
29942
|
+
|
|
29669
29943
|
// src/docs/get-to-know.ts
|
|
29670
|
-
async function addGetToKnowTools(
|
|
29944
|
+
async function addGetToKnowTools({
|
|
29945
|
+
server,
|
|
29946
|
+
disableTools = [],
|
|
29947
|
+
toolDescriptions,
|
|
29948
|
+
readmeDocs,
|
|
29949
|
+
authStrategy,
|
|
29950
|
+
picassoPortalUrl,
|
|
29951
|
+
dynamicContextEnabled
|
|
29952
|
+
}) {
|
|
29671
29953
|
if (disableTools.includes("WixREADME")) {
|
|
29672
29954
|
return;
|
|
29673
29955
|
}
|
|
@@ -29678,6 +29960,7 @@ async function addGetToKnowTools(server, disableTools = [], toolDescriptions, re
|
|
|
29678
29960
|
{},
|
|
29679
29961
|
{ readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
29680
29962
|
async (_, { httpClient: httpClient6 }) => {
|
|
29963
|
+
const { siteId, siteName } = _;
|
|
29681
29964
|
const contents = await Promise.all(
|
|
29682
29965
|
docsToUse.map(
|
|
29683
29966
|
async ({
|
|
@@ -29774,12 +30057,23 @@ Failed to fetch content: ${errorMsg}`
|
|
|
29774
30057
|
}
|
|
29775
30058
|
)
|
|
29776
30059
|
);
|
|
29777
|
-
const
|
|
29778
|
-
|
|
29779
|
-
);
|
|
29780
|
-
const
|
|
30060
|
+
const filter = {};
|
|
30061
|
+
if (siteId) filter.siteId = siteId;
|
|
30062
|
+
if (siteName) filter.siteName = siteName;
|
|
30063
|
+
const dynamicContext = dynamicContextEnabled && authStrategy ? await getDynamicContext(
|
|
30064
|
+
authStrategy,
|
|
30065
|
+
httpClient6,
|
|
30066
|
+
Object.keys(filter).length ? filter : void 0
|
|
30067
|
+
) : "";
|
|
30068
|
+
const parts = [
|
|
30069
|
+
...contents.filter(
|
|
30070
|
+
(item) => item !== null
|
|
30071
|
+
).map((item) => item.text),
|
|
30072
|
+
...dynamicContext ? [dynamicContext] : []
|
|
30073
|
+
];
|
|
30074
|
+
const text = parts.join("\n\n");
|
|
29781
30075
|
return {
|
|
29782
|
-
content: [{ type: "text", text
|
|
30076
|
+
content: [{ type: "text", text }]
|
|
29783
30077
|
};
|
|
29784
30078
|
}
|
|
29785
30079
|
);
|
|
@@ -29999,18 +30293,20 @@ var addDocsTools = (server, allowedTools = [
|
|
|
29999
30293
|
toolDescriptions,
|
|
30000
30294
|
readmeDocs,
|
|
30001
30295
|
authStrategy,
|
|
30002
|
-
picassoPortalUrl
|
|
30296
|
+
picassoPortalUrl,
|
|
30297
|
+
dynamicContextEnabled
|
|
30003
30298
|
} = options;
|
|
30004
30299
|
const getDescription = (toolName, defaultDesc) => toolDescriptions?.[toolName] ?? defaultDesc;
|
|
30005
30300
|
if (getToKnowWixEnabled && !disableTools?.includes("WixREADME")) {
|
|
30006
|
-
addGetToKnowTools(
|
|
30301
|
+
addGetToKnowTools({
|
|
30007
30302
|
server,
|
|
30008
|
-
disableTools || [],
|
|
30303
|
+
disableTools: disableTools || [],
|
|
30009
30304
|
toolDescriptions,
|
|
30010
30305
|
readmeDocs,
|
|
30011
30306
|
authStrategy,
|
|
30012
|
-
picassoPortalUrl
|
|
30013
|
-
|
|
30307
|
+
picassoPortalUrl,
|
|
30308
|
+
dynamicContextEnabled
|
|
30309
|
+
});
|
|
30014
30310
|
}
|
|
30015
30311
|
if (createWixBusinessGuideEnabled && !disableTools?.includes("CreateWixBusinessGuide")) {
|
|
30016
30312
|
addCreateWixBusinessGuideTools(
|
|
@@ -31259,6 +31555,7 @@ var CLAIM_SITE_TOOL_NAME = "ClaimAnonymousSite";
|
|
|
31259
31555
|
// src/site-widget-tools/site-builder-tool/index.ts
|
|
31260
31556
|
var httpClient = createHttpClient2();
|
|
31261
31557
|
var CREATE_SITE_WIDGET_URI = "ui://widget/site-builder.html";
|
|
31558
|
+
var MAX_SITE_PROMPT_CHARS = 6e3;
|
|
31262
31559
|
function addCreateSiteWidgetTool(server, authStrategy, options) {
|
|
31263
31560
|
const { getAccountAuthHeaders } = authStrategy;
|
|
31264
31561
|
const isAnonymous = authStrategy.isAnonymous?.() ?? false;
|
|
@@ -31314,7 +31611,7 @@ function addCreateSiteWidgetTool(server, authStrategy, options) {
|
|
|
31314
31611
|
SITE_BUILDER_TOOL_NAME,
|
|
31315
31612
|
{
|
|
31316
31613
|
title: "Wix Site Builder",
|
|
31317
|
-
description:
|
|
31614
|
+
description: options?.toolDescriptions?.[SITE_BUILDER_TOOL_NAME] ?? defaultToolDescriptions[SITE_BUILDER_TOOL_NAME],
|
|
31318
31615
|
inputSchema: {
|
|
31319
31616
|
jobId: external_exports.string().optional().describe(
|
|
31320
31617
|
"The job ID of the site build. If not provided, a new job will be created."
|
|
@@ -31335,6 +31632,26 @@ function addCreateSiteWidgetTool(server, authStrategy, options) {
|
|
|
31335
31632
|
`[${SITE_BUILDER_TOOL_NAME}] \u{1F680} Start Building Your Site tool invoked!`,
|
|
31336
31633
|
{ prompt: args.sitePrompt, jobId: args.jobId }
|
|
31337
31634
|
);
|
|
31635
|
+
const charCount = args.sitePrompt.length;
|
|
31636
|
+
if (charCount > MAX_SITE_PROMPT_CHARS) {
|
|
31637
|
+
console.log(
|
|
31638
|
+
`[${SITE_BUILDER_TOOL_NAME}] The site prompt is too long (${charCount} characters). Please shorten it to under ${MAX_SITE_PROMPT_CHARS} characters and try again.`
|
|
31639
|
+
);
|
|
31640
|
+
return {
|
|
31641
|
+
isError: true,
|
|
31642
|
+
content: [
|
|
31643
|
+
{
|
|
31644
|
+
type: "text",
|
|
31645
|
+
text: `The site prompt is too long (${charCount} characters). Please shorten it to under ${MAX_SITE_PROMPT_CHARS} characters and try again.`
|
|
31646
|
+
}
|
|
31647
|
+
],
|
|
31648
|
+
structuredContent: {
|
|
31649
|
+
success: false,
|
|
31650
|
+
status: `Prompt exceeds maximum length of ${MAX_SITE_PROMPT_CHARS} characters`,
|
|
31651
|
+
jobId: null
|
|
31652
|
+
}
|
|
31653
|
+
};
|
|
31654
|
+
}
|
|
31338
31655
|
let jobId;
|
|
31339
31656
|
if (args.jobId) {
|
|
31340
31657
|
console.log(
|
|
@@ -33989,7 +34306,9 @@ function createWixToolkit(options) {
|
|
|
33989
34306
|
authStrategy
|
|
33990
34307
|
});
|
|
33991
34308
|
} else {
|
|
33992
|
-
addDocsTools(server, void 0, {
|
|
34309
|
+
addDocsTools(server, void 0, {
|
|
34310
|
+
authStrategy
|
|
34311
|
+
});
|
|
33993
34312
|
}
|
|
33994
34313
|
if (api) {
|
|
33995
34314
|
const {
|
|
@@ -34143,15 +34462,23 @@ function createWixToolkit(options) {
|
|
|
34143
34462
|
getTools: () => allTools,
|
|
34144
34463
|
getTool: (name) => toolsByName.get(name),
|
|
34145
34464
|
getToolNames: () => allTools.map((t) => t.name),
|
|
34146
|
-
preloadReadme: async () => {
|
|
34465
|
+
preloadReadme: async (filter) => {
|
|
34147
34466
|
const readmeTool = toolsByName.get("WixREADME");
|
|
34148
34467
|
if (!readmeTool) return null;
|
|
34149
34468
|
try {
|
|
34150
|
-
const result = await readmeTool.execute({});
|
|
34469
|
+
const result = await readmeTool.execute(filter ?? {});
|
|
34151
34470
|
return extractText(result);
|
|
34152
34471
|
} catch {
|
|
34153
34472
|
return null;
|
|
34154
34473
|
}
|
|
34474
|
+
},
|
|
34475
|
+
preloadDynamicContext: async (filter) => {
|
|
34476
|
+
try {
|
|
34477
|
+
const httpClient6 = new HttpClient2();
|
|
34478
|
+
return await getDynamicContext(authStrategy, httpClient6, filter) || null;
|
|
34479
|
+
} catch {
|
|
34480
|
+
return null;
|
|
34481
|
+
}
|
|
34155
34482
|
}
|
|
34156
34483
|
};
|
|
34157
34484
|
}
|