@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
package/build/esm/index.js
CHANGED
|
@@ -11069,17 +11069,6 @@ var require_axios6 = __commonJS({
|
|
|
11069
11069
|
}
|
|
11070
11070
|
});
|
|
11071
11071
|
|
|
11072
|
-
// ../../node_modules/@wix/metro-runtime/es/build/serializer/domain.js
|
|
11073
|
-
var ConverterType;
|
|
11074
|
-
var init_domain = __esm({
|
|
11075
|
-
"../../node_modules/@wix/metro-runtime/es/build/serializer/domain.js"() {
|
|
11076
|
-
(function(ConverterType2) {
|
|
11077
|
-
ConverterType2[ConverterType2["TO_JSON"] = 0] = "TO_JSON";
|
|
11078
|
-
ConverterType2[ConverterType2["FROM_JSON"] = 1] = "FROM_JSON";
|
|
11079
|
-
})(ConverterType = ConverterType || (ConverterType = {}));
|
|
11080
|
-
}
|
|
11081
|
-
});
|
|
11082
|
-
|
|
11083
11072
|
// ../../node_modules/@wix/metro-runtime/es/build/serialization/utils.js
|
|
11084
11073
|
function parseLeanSchemaRef(renderedSchemaName = "") {
|
|
11085
11074
|
const [typeOrName, schemaName] = getSchemaNameAndType(renderedSchemaName);
|
|
@@ -11147,24 +11136,27 @@ function resolveDomain(host) {
|
|
|
11147
11136
|
return resolvedHost.replace(REGEX_CAPTURE_DOMAINS, "._base_domain_").replace(REGEX_CAPTURE_API_DOMAINS, "._api_base_domain_").replace(REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN, "*.dev.wix-code.com");
|
|
11148
11137
|
}
|
|
11149
11138
|
function fixHostExceptions(host) {
|
|
11150
|
-
return host
|
|
11139
|
+
return HOST_ALIASES[host] ?? host;
|
|
11151
11140
|
}
|
|
11152
11141
|
function resolveMappingsByDomain(domain, domainToMappings) {
|
|
11153
11142
|
const mappings = domainToMappings[domain];
|
|
11154
11143
|
if (mappings) {
|
|
11155
11144
|
return mappings;
|
|
11156
11145
|
}
|
|
11157
|
-
const
|
|
11158
|
-
if (!
|
|
11146
|
+
const matchedMappings = resolveRootDomain(domain, domainToMappings) ?? resolveWildcardDomain(domain, domainToMappings);
|
|
11147
|
+
if (!matchedMappings) {
|
|
11148
|
+
if (isBaseDomain(domain)) {
|
|
11149
|
+
const wwwMappings = domainToMappings[WWW_BASE_DOMAIN];
|
|
11150
|
+
if (wwwMappings) {
|
|
11151
|
+
return wwwMappings;
|
|
11152
|
+
}
|
|
11153
|
+
}
|
|
11159
11154
|
const userMappings = domainToMappings[USER_DOMAIN];
|
|
11160
11155
|
if (userMappings) {
|
|
11161
11156
|
return userMappings;
|
|
11162
11157
|
}
|
|
11163
|
-
if (isBaseDomain(domain)) {
|
|
11164
|
-
return domainToMappings[wwwBaseDomain];
|
|
11165
|
-
}
|
|
11166
11158
|
}
|
|
11167
|
-
return
|
|
11159
|
+
return matchedMappings ?? [];
|
|
11168
11160
|
}
|
|
11169
11161
|
function resolveRootDomain(domain, domainToMappings) {
|
|
11170
11162
|
return Object.entries(domainToMappings).find(([entryDomain]) => {
|
|
@@ -11172,6 +11164,22 @@ function resolveRootDomain(domain, domainToMappings) {
|
|
|
11172
11164
|
return rooDomainSegments.join(".") === entryDomain;
|
|
11173
11165
|
})?.[1];
|
|
11174
11166
|
}
|
|
11167
|
+
function resolveWildcardDomain(domain, domainToMappings) {
|
|
11168
|
+
const matchingEntries = Object.entries(domainToMappings).filter(([entryDomain]) => matchesWildcardDomain(domain, entryDomain));
|
|
11169
|
+
const [mostSpecificEntry] = matchingEntries.sort(([entryDomainA], [entryDomainB]) => entryDomainB.length - entryDomainA.length);
|
|
11170
|
+
if (!mostSpecificEntry) {
|
|
11171
|
+
return void 0;
|
|
11172
|
+
}
|
|
11173
|
+
const [, mappings] = mostSpecificEntry;
|
|
11174
|
+
return mappings;
|
|
11175
|
+
}
|
|
11176
|
+
function matchesWildcardDomain(domain, entryDomain) {
|
|
11177
|
+
if (!entryDomain.startsWith(WILDCARD_PREFIX)) {
|
|
11178
|
+
return false;
|
|
11179
|
+
}
|
|
11180
|
+
const suffix = entryDomain.slice(WILDCARD_PREFIX.length - 1);
|
|
11181
|
+
return domain.length > suffix.length && domain.endsWith(suffix);
|
|
11182
|
+
}
|
|
11175
11183
|
function resolvePath(protoPath, mappings) {
|
|
11176
11184
|
const mapping = mappings?.find((m2) => protoPath.startsWith(m2.destPath));
|
|
11177
11185
|
if (!mapping) {
|
|
@@ -11182,19 +11190,30 @@ function resolvePath(protoPath, mappings) {
|
|
|
11182
11190
|
function isBaseDomain(domain) {
|
|
11183
11191
|
return !!domain.match(/\._base_domain_$/);
|
|
11184
11192
|
}
|
|
11185
|
-
var USER_DOMAIN, DOMAINS, WIX_API_DOMAINS, DEV_WIX_CODE_DOMAIN, REGEX_CAPTURE_PROTO_FIELD, REGEX_CAPTURE_DOMAINS, REGEX_CAPTURE_API_DOMAINS, REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN
|
|
11193
|
+
var USER_DOMAIN, WWW_BASE_DOMAIN, WILDCARD_PREFIX, DOMAINS, WIX_API_DOMAINS, DEV_WIX_CODE_DOMAIN, HOST_ALIASES, REGEX_CAPTURE_PROTO_FIELD, REGEX_CAPTURE_DOMAINS, REGEX_CAPTURE_API_DOMAINS, REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN;
|
|
11186
11194
|
var init_url_resolver = __esm({
|
|
11187
11195
|
"../../node_modules/@wix/metro-runtime/es/build/url-resolver.js"() {
|
|
11188
11196
|
init_utils2();
|
|
11189
11197
|
USER_DOMAIN = "_";
|
|
11198
|
+
WWW_BASE_DOMAIN = "www._base_domain_";
|
|
11199
|
+
WILDCARD_PREFIX = "*.";
|
|
11190
11200
|
DOMAINS = ["wix.com", "editorx.com"];
|
|
11191
|
-
WIX_API_DOMAINS = [
|
|
11201
|
+
WIX_API_DOMAINS = [
|
|
11202
|
+
"42.wixprod.net",
|
|
11203
|
+
"uw2-edt-1.wixprod.net",
|
|
11204
|
+
"virginia-edt.wixprod.net"
|
|
11205
|
+
];
|
|
11192
11206
|
DEV_WIX_CODE_DOMAIN = "dev.wix-code.com";
|
|
11207
|
+
HOST_ALIASES = {
|
|
11208
|
+
// payments.base44.com runs customised Business Manager, which needs to work exactly the same as normal BM on manage.wix.com
|
|
11209
|
+
"payments.base44.com": "manage.wix.com",
|
|
11210
|
+
// https://system-kb.wixanswers.com/kb/en/article/editorx-domains-matching-to-wixcom
|
|
11211
|
+
"create.editorx.com": "editor.editorx.com"
|
|
11212
|
+
};
|
|
11193
11213
|
REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;
|
|
11194
11214
|
REGEX_CAPTURE_DOMAINS = new RegExp(`\\.(${DOMAINS.join("|")})$`);
|
|
11195
11215
|
REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\.(${WIX_API_DOMAINS.join("|")})$`);
|
|
11196
11216
|
REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(`.*\\.${DEV_WIX_CODE_DOMAIN}$`);
|
|
11197
|
-
wwwBaseDomain = "www._base_domain_";
|
|
11198
11217
|
}
|
|
11199
11218
|
});
|
|
11200
11219
|
|
|
@@ -11303,6 +11322,17 @@ var init_build = __esm({
|
|
|
11303
11322
|
}
|
|
11304
11323
|
});
|
|
11305
11324
|
|
|
11325
|
+
// ../../node_modules/@wix/metro-runtime/es/build/serializer/domain.js
|
|
11326
|
+
var ConverterType;
|
|
11327
|
+
var init_domain = __esm({
|
|
11328
|
+
"../../node_modules/@wix/metro-runtime/es/build/serializer/domain.js"() {
|
|
11329
|
+
(function(ConverterType2) {
|
|
11330
|
+
ConverterType2[ConverterType2["TO_JSON"] = 0] = "TO_JSON";
|
|
11331
|
+
ConverterType2[ConverterType2["FROM_JSON"] = 1] = "FROM_JSON";
|
|
11332
|
+
})(ConverterType || (ConverterType = {}));
|
|
11333
|
+
}
|
|
11334
|
+
});
|
|
11335
|
+
|
|
11306
11336
|
// ../../node_modules/@wix/metro-runtime/es/build/serializer/serializer.js
|
|
11307
11337
|
function schemaSerializer(rootSchema, depSchemas = {}, converterSets) {
|
|
11308
11338
|
return function serialize(json = {}, converterType) {
|
|
@@ -29710,7 +29740,7 @@ function extractText(result) {
|
|
|
29710
29740
|
return result.content.filter((content) => content.type === "text" && content.text != null).map((content) => content.text).join("\n");
|
|
29711
29741
|
}
|
|
29712
29742
|
var TOOL_RESULT_PREVIEW_MAX_CHARS = 4e3;
|
|
29713
|
-
function formatToolResultAdditionalFields(result) {
|
|
29743
|
+
function formatToolResultAdditionalFields(result, extras) {
|
|
29714
29744
|
const resultText = extractText(result);
|
|
29715
29745
|
const contentTypes = [
|
|
29716
29746
|
...new Set(
|
|
@@ -29726,7 +29756,8 @@ function formatToolResultAdditionalFields(result) {
|
|
|
29726
29756
|
resultPreview: resultText.slice(0, TOOL_RESULT_PREVIEW_MAX_CHARS),
|
|
29727
29757
|
resultTextLength: resultText.length,
|
|
29728
29758
|
resultPreviewTruncated: resultText.length > TOOL_RESULT_PREVIEW_MAX_CHARS,
|
|
29729
|
-
resultContentTypes: contentTypes
|
|
29759
|
+
resultContentTypes: contentTypes,
|
|
29760
|
+
...extras
|
|
29730
29761
|
});
|
|
29731
29762
|
}
|
|
29732
29763
|
function createToolBiEvent(params) {
|
|
@@ -29902,7 +29933,10 @@ var WixMcpServer = class extends McpServer {
|
|
|
29902
29933
|
if (!toolSucceeded) {
|
|
29903
29934
|
errorBody = extractText(cbResult);
|
|
29904
29935
|
} else {
|
|
29905
|
-
additionalFields = formatToolResultAdditionalFields(cbResult
|
|
29936
|
+
additionalFields = formatToolResultAdditionalFields(cbResult, {
|
|
29937
|
+
returnedRows: toolBiParams.returnedRows,
|
|
29938
|
+
originalLength: toolBiParams.originalLength
|
|
29939
|
+
});
|
|
29906
29940
|
}
|
|
29907
29941
|
if (toolSucceeded && !isDevEnvironment) {
|
|
29908
29942
|
panorama.transaction(toolName).finish({ toolInvocationId });
|
|
@@ -30806,6 +30840,9 @@ function rethrowIfUnauthorized(error2) {
|
|
|
30806
30840
|
}
|
|
30807
30841
|
}
|
|
30808
30842
|
|
|
30843
|
+
// src/config/api-request-rules.ts
|
|
30844
|
+
var ARRAY_QUERY_PARAMS_RULE = "Repeat array query params once per value: `?fieldsets=URL&fieldsets=RICH_CONTENT`. Do NOT comma-join values (`fieldsets=URL,RICH_CONTENT`), do NOT leave a trailing comma, and do NOT use a value the method schema does not list, even if a sibling method accepts it (draft posts have no `SEO` fieldset).";
|
|
30845
|
+
|
|
30809
30846
|
// src/config/default-config.ts
|
|
30810
30847
|
var AGENT_GOAL = dedent_default`
|
|
30811
30848
|
You are an agent that helps the user manage their Wix site.
|
|
@@ -30816,7 +30853,7 @@ var DISCOVERY_FLOWS = [
|
|
|
30816
30853
|
"- METHOD CODE EXAMPLE BASED: BrowseWixRESTDocsMenu() or SearchWixRESTDocumentation() -> find relevant method -> read method article using ReadFullDocsArticle() to get method code examples -> call API using CallWixSiteAPI() based on the method code examples",
|
|
30817
30854
|
"- FULL SCHEMA BASED: BrowseWixRESTDocsMenu() or SearchWixRESTDocumentation() -> find relevant method -> read method article using ReadFullDocsArticle() -> no method code examples found -> inspect the method schema using SearchWixAPISpec or ReadFullDocsMethodSchema -> call API using CallWixSiteAPI() based on the schema"
|
|
30818
30855
|
];
|
|
30819
|
-
function buildSystemReminderGuidelines(includeReadme) {
|
|
30856
|
+
function buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance) {
|
|
30820
30857
|
const exception = includeReadme ? "**Exception:** " : "";
|
|
30821
30858
|
const lines = [];
|
|
30822
30859
|
if (includeReadme) {
|
|
@@ -30828,9 +30865,13 @@ function buildSystemReminderGuidelines(includeReadme) {
|
|
|
30828
30865
|
);
|
|
30829
30866
|
}
|
|
30830
30867
|
lines.push(
|
|
30831
|
-
`${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? "skip WixREADME and " : ""}call ListWixSites directly
|
|
30832
|
-
`${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 \u2014 call UploadImageToWixSite directly. Do NOT use ExecuteWixAPI, SearchWixAPISpec, or any Media Manager REST API for image uploads.`
|
|
30868
|
+
`${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? "skip WixREADME and " : ""}call ListWixSites directly.`
|
|
30833
30869
|
);
|
|
30870
|
+
if (includeImageUploadGuidance) {
|
|
30871
|
+
lines.push(
|
|
30872
|
+
`${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 \u2014 call UploadImageToWixSite directly. Do NOT use ExecuteWixAPI, SearchWixAPISpec, or any Media Manager REST API for image uploads.`
|
|
30873
|
+
);
|
|
30874
|
+
}
|
|
30834
30875
|
if (includeReadme) {
|
|
30835
30876
|
lines.push(
|
|
30836
30877
|
"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."
|
|
@@ -30857,9 +30898,15 @@ function buildSystemReminderFlows(includeReadme) {
|
|
|
30857
30898
|
lines.push(...DISCOVERY_FLOWS);
|
|
30858
30899
|
return lines.join("\n");
|
|
30859
30900
|
}
|
|
30860
|
-
var SYSTEM_REMINDER_GUIDELINES = buildSystemReminderGuidelines(
|
|
30861
|
-
|
|
30862
|
-
|
|
30901
|
+
var SYSTEM_REMINDER_GUIDELINES = buildSystemReminderGuidelines(
|
|
30902
|
+
true,
|
|
30903
|
+
true
|
|
30904
|
+
);
|
|
30905
|
+
function buildSystemReminder(includeReadme, includeImageUploadGuidance = true) {
|
|
30906
|
+
const guidelines = buildSystemReminderGuidelines(
|
|
30907
|
+
includeReadme,
|
|
30908
|
+
includeImageUploadGuidance
|
|
30909
|
+
);
|
|
30863
30910
|
const flows = buildSystemReminderFlows(includeReadme);
|
|
30864
30911
|
return dedent_default`
|
|
30865
30912
|
<agent-mandatory-instructions>
|
|
@@ -30917,11 +30964,13 @@ var EXECUTE_WIX_API_INTRO = dedent_default`
|
|
|
30917
30964
|
CODE CONTRACT:
|
|
30918
30965
|
- Pass an async function expression: \`async function() { ... }\` or \`async () => { ... }\`. Put every declaration, \`await\`, and \`return\` inside it, and do not invoke it yourself.
|
|
30919
30966
|
- Use only \`wix.request({ method, url, body })\` and in-memory JavaScript. Node.js modules, filesystem access, and downloadable-file creation are unavailable.
|
|
30967
|
+
- 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.
|
|
30920
30968
|
|
|
30921
30969
|
CONFIRM API CONTRACTS:
|
|
30922
30970
|
- 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.
|
|
30923
30971
|
- Prefer \`method.publicUrl\` from SearchWixAPISpec; never use \`method.servers[0]\`. Pass all supporting documentation URLs through \`sourceDocUrls\`.
|
|
30924
30972
|
- 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.
|
|
30973
|
+
- ${ARRAY_QUERY_PARAMS_RULE}
|
|
30925
30974
|
- 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.
|
|
30926
30975
|
`;
|
|
30927
30976
|
var EXECUTE_WIX_API_OUTPUT_AND_ERRORS = dedent_default`
|
|
@@ -30937,6 +30986,7 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
30937
30986
|
SCOPE AND SITE TARGETING:
|
|
30938
30987
|
- 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.
|
|
30939
30988
|
- If \`scope\` is omitted it defaults to site when either the ExecuteWixAPI call or \`wix.request\` provides a \`siteId\`; otherwise it defaults to account.
|
|
30989
|
+
- 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.
|
|
30940
30990
|
- \`scope: "account"\` ignores any \`siteId\` you pass, so a site-level endpoint called that way fails.
|
|
30941
30991
|
- Authentication is injected automatically; never set Authorization, wix-site-id, or wix-account-id headers.
|
|
30942
30992
|
- For one named site, prefer GetSiteContext. If it is unavailable, resolve the exact site and perform the action in the same invocation.
|
|
@@ -31070,8 +31120,11 @@ var executeWixApiDescription = dedent_default`
|
|
|
31070
31120
|
|
|
31071
31121
|
${EXECUTE_WIX_API_MULTI_SITE_EXAMPLE}
|
|
31072
31122
|
`;
|
|
31073
|
-
function buildToolDescriptions(includeReadme) {
|
|
31074
|
-
const reminder = buildSystemReminder(
|
|
31123
|
+
function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true) {
|
|
31124
|
+
const reminder = buildSystemReminder(
|
|
31125
|
+
includeReadme,
|
|
31126
|
+
includeImageUploadGuidance
|
|
31127
|
+
);
|
|
31075
31128
|
return {
|
|
31076
31129
|
WixREADME: dedent_default`
|
|
31077
31130
|
# Tool: WixREADME
|
|
@@ -31122,6 +31175,7 @@ function buildToolDescriptions(includeReadme) {
|
|
|
31122
31175
|
**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.
|
|
31123
31176
|
${reminder}
|
|
31124
31177
|
`,
|
|
31178
|
+
get_profile: "Returns the authenticated user's email address",
|
|
31125
31179
|
GetSiteContext: dedent_default`
|
|
31126
31180
|
Fetches deep context for a specific Wix site and returns it as structured markdown.
|
|
31127
31181
|
|
|
@@ -31253,8 +31307,10 @@ function buildToolDescriptions(includeReadme) {
|
|
|
31253
31307
|
SearchBuildAppsDocumentation: dedent_default`
|
|
31254
31308
|
Searches the Wix Build Apps documentation.
|
|
31255
31309
|
`,
|
|
31256
|
-
|
|
31257
|
-
|
|
31310
|
+
SearchDevelopmentDocumentation: dedent_default`
|
|
31311
|
+
Broad Wix development documentation (platform concepts, developer guides, getting started). **Last resort — development tasks only.**
|
|
31312
|
+
Skip it entirely for general, business, support, or Wix-editor questions.
|
|
31313
|
+
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.
|
|
31258
31314
|
`,
|
|
31259
31315
|
SearchWixHeadlessDocumentation: dedent_default`
|
|
31260
31316
|
Searches the Wix Headless documentation.
|
|
@@ -31906,14 +31962,20 @@ function renderApps(apps, knownApps) {
|
|
|
31906
31962
|
}
|
|
31907
31963
|
function renderProperties(props) {
|
|
31908
31964
|
const sections = [];
|
|
31909
|
-
const
|
|
31910
|
-
if (props.language)
|
|
31911
|
-
if (props.locale?.country)
|
|
31912
|
-
|
|
31913
|
-
if (props.
|
|
31914
|
-
if (
|
|
31915
|
-
|
|
31916
|
-
|
|
31965
|
+
const regionalFormat = [];
|
|
31966
|
+
if (props.language) regionalFormat.push(`- Language: **${props.language}**`);
|
|
31967
|
+
if (props.locale?.country)
|
|
31968
|
+
regionalFormat.push(`- Locale region: **${props.locale.country}**`);
|
|
31969
|
+
if (props.timeZone) regionalFormat.push(`- Timezone: **${props.timeZone}**`);
|
|
31970
|
+
if (props.paymentCurrency)
|
|
31971
|
+
regionalFormat.push(`- Currency: **${props.paymentCurrency}**`);
|
|
31972
|
+
if (regionalFormat.length) {
|
|
31973
|
+
sections.push(`**Regional Format**
|
|
31974
|
+
${regionalFormat.join("\n")}`);
|
|
31975
|
+
}
|
|
31976
|
+
if (props.address?.country) {
|
|
31977
|
+
sections.push(`**Location**
|
|
31978
|
+
- Country: **${props.address.country}**`);
|
|
31917
31979
|
}
|
|
31918
31980
|
const contact = [];
|
|
31919
31981
|
if (props.email) contact.push(`- Email: **${props.email}**`);
|
|
@@ -32060,6 +32122,7 @@ var known_apps_default = {
|
|
|
32060
32122
|
"225dd912-7dea-4738-8688-4b8c6955ffc2": "Wix Forms",
|
|
32061
32123
|
"d80111c5-a0f4-47a8-b63a-65b54d774a27": "Wix Gift Cards",
|
|
32062
32124
|
"148c2287-c669-d849-d153-463c7486a694": "Wix Groups",
|
|
32125
|
+
"14bca956-e09f-f4d6-14d7-466cb3f09103": "Wix Hotels",
|
|
32063
32126
|
"13ee94c1-b635-8505-3391-97919052c16f": "Wix Invoices",
|
|
32064
32127
|
"14cc59bc-f0b7-15b8-e1c7-89ce41d0e0c9": "Wix Members Area",
|
|
32065
32128
|
"14d84998-ae09-1abf-c6fc-3f3cace5bf19": "Wix Multilingual",
|
|
@@ -32094,8 +32157,8 @@ async function getDynamicContext(auth, httpClient6, filter, options) {
|
|
|
32094
32157
|
partnerContextEnabled: options,
|
|
32095
32158
|
includeAccountContext: options
|
|
32096
32159
|
} : options;
|
|
32097
|
-
const includePartnerContext = contextOptions?.partnerContextEnabled ??
|
|
32098
|
-
const includeAccountContext = contextOptions?.includeAccountContext ??
|
|
32160
|
+
const includePartnerContext = contextOptions?.partnerContextEnabled ?? true;
|
|
32161
|
+
const includeAccountContext = contextOptions?.includeAccountContext ?? true;
|
|
32099
32162
|
try {
|
|
32100
32163
|
const accountHeaders = await auth.getAccountAuthHeaders();
|
|
32101
32164
|
const noFilter = !filter?.siteId && !filter?.siteName;
|
|
@@ -32209,7 +32272,8 @@ var paramDescriptions = {
|
|
|
32209
32272
|
"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",
|
|
32210
32273
|
'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',
|
|
32211
32274
|
`Allowed API urls are: ${ALLOWED_HOSTNAMES.join(", ")}`,
|
|
32212
|
-
`Docs urls like https://dev.wix.com/docs/... are not API urls, if you want to read the docs, use the "ReadFullDocsArticle" tool
|
|
32275
|
+
`Docs urls like https://dev.wix.com/docs/... are not API urls, if you want to read the docs, use the "ReadFullDocsArticle" tool`,
|
|
32276
|
+
ARRAY_QUERY_PARAMS_RULE
|
|
32213
32277
|
].join("\n"),
|
|
32214
32278
|
method: "The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)",
|
|
32215
32279
|
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.',
|
|
@@ -32282,8 +32346,8 @@ var paramDescriptions = {
|
|
|
32282
32346
|
searchTerm: "The search term to search for in the Build Apps Documentation",
|
|
32283
32347
|
maxResults: "The maximum number of results to return, default is 10, max is 15"
|
|
32284
32348
|
},
|
|
32285
|
-
|
|
32286
|
-
searchTerm: "The search term
|
|
32349
|
+
SearchDevelopmentDocumentation: {
|
|
32350
|
+
searchTerm: "The development-related search term. Use only after a more specific docs search (REST/SDK/CLI/Build Apps/Headless/WDS) came back empty.",
|
|
32287
32351
|
maxResults: "The maximum number of results to return, default is 10, max is 15"
|
|
32288
32352
|
},
|
|
32289
32353
|
SearchWixHeadlessDocumentation: {
|
|
@@ -33090,15 +33154,15 @@ var addDocsTools = (server, allowedTools = [
|
|
|
33090
33154
|
}
|
|
33091
33155
|
);
|
|
33092
33156
|
}
|
|
33093
|
-
if (allowedTools.includes("OVERVIEW") && !disableTools?.includes("
|
|
33157
|
+
if (allowedTools.includes("OVERVIEW") && !disableTools?.includes("SearchDevelopmentDocumentation")) {
|
|
33094
33158
|
server.tool(
|
|
33095
|
-
"
|
|
33159
|
+
"SearchDevelopmentDocumentation",
|
|
33096
33160
|
getDescription(
|
|
33097
|
-
"
|
|
33098
|
-
defaultToolDescriptions.
|
|
33161
|
+
"SearchDevelopmentDocumentation",
|
|
33162
|
+
defaultToolDescriptions.SearchDevelopmentDocumentation ?? ""
|
|
33099
33163
|
),
|
|
33100
33164
|
(() => {
|
|
33101
|
-
const d2 = desc("
|
|
33165
|
+
const d2 = desc("SearchDevelopmentDocumentation");
|
|
33102
33166
|
return {
|
|
33103
33167
|
searchTerm: external_exports.string().describe(d2.searchTerm),
|
|
33104
33168
|
maxResults: external_exports.number().describe(d2.maxResults).min(1).max(15).optional().default(15)
|
|
@@ -33128,8 +33192,8 @@ var addDocsTools = (server, allowedTools = [
|
|
|
33128
33192
|
panorama.errorMonitor().reportError(error2);
|
|
33129
33193
|
captureException(error2, {
|
|
33130
33194
|
tags: {
|
|
33131
|
-
componentId: "
|
|
33132
|
-
toolName: "
|
|
33195
|
+
componentId: "SearchDevelopmentDocumentation",
|
|
33196
|
+
toolName: "SearchDevelopmentDocumentation"
|
|
33133
33197
|
}
|
|
33134
33198
|
});
|
|
33135
33199
|
logger2.error(
|
|
@@ -33948,6 +34012,19 @@ var MAX_ALLOWED_RESPONSE_CHARS = 2e6;
|
|
|
33948
34012
|
|
|
33949
34013
|
// src/api-call/index.ts
|
|
33950
34014
|
var DEFAULT_MAX_RESPONSE_SIZE = 5e4;
|
|
34015
|
+
function extractReturnedRows(responseData) {
|
|
34016
|
+
if (responseData === null || typeof responseData !== "object") {
|
|
34017
|
+
return void 0;
|
|
34018
|
+
}
|
|
34019
|
+
const data = responseData;
|
|
34020
|
+
const block = data.pagingMetadata ?? data.cursorPagingMetadata ?? data.pagingOffsetMetadata ?? data.metaData ?? data.metadata;
|
|
34021
|
+
const raw = block?.count;
|
|
34022
|
+
if (typeof raw !== "number" && (typeof raw !== "string" || raw.trim() === "")) {
|
|
34023
|
+
return void 0;
|
|
34024
|
+
}
|
|
34025
|
+
const count = Number(raw);
|
|
34026
|
+
return Number.isFinite(count) ? count : void 0;
|
|
34027
|
+
}
|
|
33951
34028
|
function formatApiResponse(responseData, maxResponseSize = DEFAULT_MAX_RESPONSE_SIZE) {
|
|
33952
34029
|
if (typeof responseData === "string" && responseData.trim().startsWith("<!DOCTYPE")) {
|
|
33953
34030
|
return {
|
|
@@ -33955,13 +34032,15 @@ function formatApiResponse(responseData, maxResponseSize = DEFAULT_MAX_RESPONSE_
|
|
|
33955
34032
|
isError: true
|
|
33956
34033
|
};
|
|
33957
34034
|
}
|
|
34035
|
+
const returnedRows = extractReturnedRows(responseData);
|
|
33958
34036
|
let responseText = JSON.stringify(responseData);
|
|
34037
|
+
const originalLength = responseText.length;
|
|
33959
34038
|
const effectiveMax = Math.min(maxResponseSize, MAX_ALLOWED_RESPONSE_CHARS);
|
|
33960
34039
|
if (responseText.length > effectiveMax) {
|
|
33961
34040
|
responseText = responseText.slice(0, effectiveMax) + `
|
|
33962
34041
|
...[TRUNCATED - response was ${responseText.length} chars, showing first ${effectiveMax}]`;
|
|
33963
34042
|
}
|
|
33964
|
-
return { text: responseText, isError: false };
|
|
34043
|
+
return { text: responseText, isError: false, originalLength, returnedRows };
|
|
33965
34044
|
}
|
|
33966
34045
|
function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "ListWixSites", "ManageWixSite"], disableTools = [], enableTools = [], toolDescriptions, toolHints, maxResponseSize) {
|
|
33967
34046
|
const effectiveAllowedTools = [
|
|
@@ -34024,9 +34103,14 @@ function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "Lis
|
|
|
34024
34103
|
data: method === "GET" ? void 0 : body
|
|
34025
34104
|
});
|
|
34026
34105
|
const requestId = response.headers?.["x-wix-request-id"];
|
|
34027
|
-
setToolBiParams({ requestId, siteId });
|
|
34028
34106
|
const responseData = await handleWixAPIResponse(response);
|
|
34029
34107
|
const formatted = formatApiResponse(responseData, maxResponseSize);
|
|
34108
|
+
setToolBiParams({
|
|
34109
|
+
requestId,
|
|
34110
|
+
siteId,
|
|
34111
|
+
returnedRows: formatted.returnedRows,
|
|
34112
|
+
originalLength: formatted.originalLength
|
|
34113
|
+
});
|
|
34030
34114
|
if (formatted.isError) {
|
|
34031
34115
|
return {
|
|
34032
34116
|
content: [
|
|
@@ -34165,7 +34249,7 @@ function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "Lis
|
|
|
34165
34249
|
destructiveHint: true,
|
|
34166
34250
|
openWorldHint: false
|
|
34167
34251
|
}),
|
|
34168
|
-
async ({ url, body, method, reason }, { httpClient: httpClient6 }) => {
|
|
34252
|
+
async ({ url, body, method, reason }, { httpClient: httpClient6, setToolBiParams }) => {
|
|
34169
34253
|
logger2.log(
|
|
34170
34254
|
`Calling Wix Account level API: ${url}, reason="${reason}", body: ${JSON.stringify(body)}`
|
|
34171
34255
|
);
|
|
@@ -34194,6 +34278,10 @@ function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "Lis
|
|
|
34194
34278
|
});
|
|
34195
34279
|
const responseData = await handleWixAPIResponse(response);
|
|
34196
34280
|
const formatted = formatApiResponse(responseData, maxResponseSize);
|
|
34281
|
+
setToolBiParams({
|
|
34282
|
+
returnedRows: formatted.returnedRows,
|
|
34283
|
+
originalLength: formatted.originalLength
|
|
34284
|
+
});
|
|
34197
34285
|
if (formatted.isError) {
|
|
34198
34286
|
return {
|
|
34199
34287
|
content: [
|
|
@@ -34346,6 +34434,192 @@ request id: ${requestId}` : message;
|
|
|
34346
34434
|
);
|
|
34347
34435
|
}
|
|
34348
34436
|
|
|
34437
|
+
// ../../node_modules/@wix/ambassador-identity-account-v1-user/es/build/http.impl.js
|
|
34438
|
+
init_build();
|
|
34439
|
+
init_ambassador_index();
|
|
34440
|
+
init_build();
|
|
34441
|
+
var _getTeamMemberRequest = {};
|
|
34442
|
+
var _getTeamMemberResponse = { user: "_user" };
|
|
34443
|
+
var _user = { joinedAt: "google.protobuf.Timestamp" };
|
|
34444
|
+
function resolveComWixpressAccountApiTeamServiceUrl(opts) {
|
|
34445
|
+
const domainToMappings = {
|
|
34446
|
+
"api._api_base_domain_": [
|
|
34447
|
+
{
|
|
34448
|
+
srcPath: "/account-server",
|
|
34449
|
+
destPath: ""
|
|
34450
|
+
}
|
|
34451
|
+
],
|
|
34452
|
+
"www._base_domain_": [
|
|
34453
|
+
{
|
|
34454
|
+
srcPath: "/_api/account-server",
|
|
34455
|
+
destPath: ""
|
|
34456
|
+
}
|
|
34457
|
+
],
|
|
34458
|
+
"manage._base_domain_": [
|
|
34459
|
+
{
|
|
34460
|
+
srcPath: "/_api/account-server",
|
|
34461
|
+
destPath: ""
|
|
34462
|
+
},
|
|
34463
|
+
{
|
|
34464
|
+
srcPath: "/account-server",
|
|
34465
|
+
destPath: ""
|
|
34466
|
+
}
|
|
34467
|
+
],
|
|
34468
|
+
"premium._base_domain_": [
|
|
34469
|
+
{
|
|
34470
|
+
srcPath: "/_api/account-server",
|
|
34471
|
+
destPath: ""
|
|
34472
|
+
}
|
|
34473
|
+
],
|
|
34474
|
+
"editor._base_domain_": [
|
|
34475
|
+
{
|
|
34476
|
+
srcPath: "/_api/account-server",
|
|
34477
|
+
destPath: ""
|
|
34478
|
+
}
|
|
34479
|
+
],
|
|
34480
|
+
"blocks._base_domain_": [
|
|
34481
|
+
{
|
|
34482
|
+
srcPath: "/_api/account-server",
|
|
34483
|
+
destPath: ""
|
|
34484
|
+
}
|
|
34485
|
+
],
|
|
34486
|
+
"create.editorx": [
|
|
34487
|
+
{
|
|
34488
|
+
srcPath: "/_api/account-server",
|
|
34489
|
+
destPath: ""
|
|
34490
|
+
}
|
|
34491
|
+
],
|
|
34492
|
+
"bo._base_domain_": [
|
|
34493
|
+
{
|
|
34494
|
+
srcPath: "/account-server",
|
|
34495
|
+
destPath: ""
|
|
34496
|
+
}
|
|
34497
|
+
],
|
|
34498
|
+
"wixbo.ai": [
|
|
34499
|
+
{
|
|
34500
|
+
srcPath: "/account-server",
|
|
34501
|
+
destPath: ""
|
|
34502
|
+
}
|
|
34503
|
+
],
|
|
34504
|
+
"wix-bo.com": [
|
|
34505
|
+
{
|
|
34506
|
+
srcPath: "/account-server",
|
|
34507
|
+
destPath: ""
|
|
34508
|
+
}
|
|
34509
|
+
],
|
|
34510
|
+
"www.wixapis.com": [
|
|
34511
|
+
{
|
|
34512
|
+
srcPath: "/accounts",
|
|
34513
|
+
destPath: ""
|
|
34514
|
+
},
|
|
34515
|
+
{
|
|
34516
|
+
srcPath: "/accounts/v1/accounts",
|
|
34517
|
+
destPath: "/v1/accounts"
|
|
34518
|
+
},
|
|
34519
|
+
{
|
|
34520
|
+
srcPath: "/accounts/v1/account",
|
|
34521
|
+
destPath: "/v1/account"
|
|
34522
|
+
}
|
|
34523
|
+
],
|
|
34524
|
+
"users._base_domain_": [
|
|
34525
|
+
{
|
|
34526
|
+
srcPath: "/_api/account-server",
|
|
34527
|
+
destPath: ""
|
|
34528
|
+
}
|
|
34529
|
+
],
|
|
34530
|
+
"*.dev.wix-code.com": [
|
|
34531
|
+
{
|
|
34532
|
+
srcPath: "/_api/account-server",
|
|
34533
|
+
destPath: ""
|
|
34534
|
+
}
|
|
34535
|
+
],
|
|
34536
|
+
"twins._base_domain_": [
|
|
34537
|
+
{
|
|
34538
|
+
srcPath: "/_api/account-server",
|
|
34539
|
+
destPath: ""
|
|
34540
|
+
}
|
|
34541
|
+
]
|
|
34542
|
+
};
|
|
34543
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
34544
|
+
}
|
|
34545
|
+
function getTeamMember(payload) {
|
|
34546
|
+
const { toJSON: toReq, fromJSON: fromReq } = serializer(_getTeamMemberRequest, {});
|
|
34547
|
+
const { fromJSON: fromRes } = serializer(_getTeamMemberResponse, { _user });
|
|
34548
|
+
function __getTeamMember({ host }) {
|
|
34549
|
+
const serializedData = toReq(payload);
|
|
34550
|
+
const metadata = {
|
|
34551
|
+
entityFqdn: "wix.identity.account.v1.user",
|
|
34552
|
+
method: "GET",
|
|
34553
|
+
methodFqn: "com.wixpress.account.api.TeamService.getTeamMember",
|
|
34554
|
+
migrationOptions: {
|
|
34555
|
+
optInTransformResponse: true
|
|
34556
|
+
},
|
|
34557
|
+
url: resolveComWixpressAccountApiTeamServiceUrl({
|
|
34558
|
+
protoPath: "/v1/team/members",
|
|
34559
|
+
data: serializedData,
|
|
34560
|
+
host
|
|
34561
|
+
}),
|
|
34562
|
+
params: toURLSearchParams(serializedData),
|
|
34563
|
+
transformResponse: fromRes
|
|
34564
|
+
};
|
|
34565
|
+
return metadata;
|
|
34566
|
+
}
|
|
34567
|
+
__getTeamMember.fromReq = fromReq;
|
|
34568
|
+
__getTeamMember.__isAmbassador = true;
|
|
34569
|
+
return __getTeamMember;
|
|
34570
|
+
}
|
|
34571
|
+
|
|
34572
|
+
// src/account-tools/get-profile-tool.ts
|
|
34573
|
+
var WIX_APIS_BASE_URL = "https://www.wixapis.com";
|
|
34574
|
+
var GET_PROFILE_TOOL_NAME = "get_profile";
|
|
34575
|
+
function addGetProfileTool(server, authStrategy, disableTools = [], toolDescriptions, toolHints) {
|
|
34576
|
+
if (disableTools.includes(GET_PROFILE_TOOL_NAME)) {
|
|
34577
|
+
return;
|
|
34578
|
+
}
|
|
34579
|
+
const cache = {};
|
|
34580
|
+
const hints = toolHints?.[GET_PROFILE_TOOL_NAME];
|
|
34581
|
+
server.tool(
|
|
34582
|
+
GET_PROFILE_TOOL_NAME,
|
|
34583
|
+
toolDescriptions?.[GET_PROFILE_TOOL_NAME] ?? defaultToolDescriptions[GET_PROFILE_TOOL_NAME],
|
|
34584
|
+
{},
|
|
34585
|
+
{
|
|
34586
|
+
readOnlyHint: hints?.readOnlyHint ?? true,
|
|
34587
|
+
destructiveHint: hints?.destructiveHint ?? false,
|
|
34588
|
+
openWorldHint: hints?.openWorldHint ?? false
|
|
34589
|
+
},
|
|
34590
|
+
async () => {
|
|
34591
|
+
const profilePromise = cache.profilePromise ??= (async () => {
|
|
34592
|
+
const accountAuthHeaders = await authStrategy.getAccountAuthHeaders();
|
|
34593
|
+
const httpClient6 = createHttpClient2({
|
|
34594
|
+
baseURL: WIX_APIS_BASE_URL,
|
|
34595
|
+
headers: accountAuthHeaders
|
|
34596
|
+
});
|
|
34597
|
+
const response = await httpClient6.request(getTeamMember({}));
|
|
34598
|
+
const email2 = response.data.user?.email;
|
|
34599
|
+
if (!email2) {
|
|
34600
|
+
throw new Error("The current Wix user profile has no email address.");
|
|
34601
|
+
}
|
|
34602
|
+
return { email: email2 };
|
|
34603
|
+
})();
|
|
34604
|
+
const profile = await profilePromise.catch(async (error2) => {
|
|
34605
|
+
cache.profilePromise = void 0;
|
|
34606
|
+
rethrowIfUnauthorized(error2);
|
|
34607
|
+
await authStrategy.enforceValidWixToken?.(error2);
|
|
34608
|
+
throw error2;
|
|
34609
|
+
});
|
|
34610
|
+
return {
|
|
34611
|
+
content: [
|
|
34612
|
+
{
|
|
34613
|
+
type: "text",
|
|
34614
|
+
text: profile.email
|
|
34615
|
+
}
|
|
34616
|
+
],
|
|
34617
|
+
structuredContent: profile
|
|
34618
|
+
};
|
|
34619
|
+
}
|
|
34620
|
+
);
|
|
34621
|
+
}
|
|
34622
|
+
|
|
34349
34623
|
// ../../node_modules/@wix/bi-logger-wix-code-data/dist/esm/v2/index.js
|
|
34350
34624
|
function siteCreatedUsingWixMcpSrc39Evid1608(params) {
|
|
34351
34625
|
return { evid: 1608, src: 39, endpoint: "", params };
|
|
@@ -34589,7 +34863,7 @@ function listPublishedSiteUrls(payload) {
|
|
|
34589
34863
|
}
|
|
34590
34864
|
|
|
34591
34865
|
// src/site-widget-tools/utils.ts
|
|
34592
|
-
var
|
|
34866
|
+
var WIX_APIS_BASE_URL2 = "https://www.wixapis.com";
|
|
34593
34867
|
async function publishSite2({
|
|
34594
34868
|
siteAuthorization,
|
|
34595
34869
|
siteId,
|
|
@@ -34599,7 +34873,7 @@ async function publishSite2({
|
|
|
34599
34873
|
Authorization: `Bearer ${siteAuthorization}`,
|
|
34600
34874
|
"wix-site-id": siteId
|
|
34601
34875
|
};
|
|
34602
|
-
const httpClient6 = createHttpClient2({ baseURL:
|
|
34876
|
+
const httpClient6 = createHttpClient2({ baseURL: WIX_APIS_BASE_URL2, headers });
|
|
34603
34877
|
const response = await httpClient6.request(publishSite({}));
|
|
34604
34878
|
if (response.status !== 200) {
|
|
34605
34879
|
console.error(`[publishSite] Failed to publish site for job ${jobId}`, {
|
|
@@ -41496,10 +41770,10 @@ async function buildHarmonySite({
|
|
|
41496
41770
|
}
|
|
41497
41771
|
|
|
41498
41772
|
// src/site-widget-tools/suggested-domain-tool/index.ts
|
|
41499
|
-
var
|
|
41773
|
+
var WIX_APIS_BASE_URL3 = "https://www.wixapis.com";
|
|
41500
41774
|
async function fetchSiteDisplayName(siteAuthorization, siteId) {
|
|
41501
41775
|
const response = await fetch(
|
|
41502
|
-
`${
|
|
41776
|
+
`${WIX_APIS_BASE_URL3}/site-properties/v4/properties`,
|
|
41503
41777
|
{
|
|
41504
41778
|
headers: {
|
|
41505
41779
|
Authorization: siteAuthorization,
|
|
@@ -41623,7 +41897,7 @@ function addSuggestedDomainTool(server, authStrategy) {
|
|
|
41623
41897
|
}
|
|
41624
41898
|
}
|
|
41625
41899
|
const response = await fetch(
|
|
41626
|
-
`${
|
|
41900
|
+
`${WIX_APIS_BASE_URL3}/domain-search/v2/suggest-domains?${params}`,
|
|
41627
41901
|
{
|
|
41628
41902
|
method: "GET",
|
|
41629
41903
|
headers: {
|
|
@@ -42564,7 +42838,7 @@ function getEditorUrls(payload) {
|
|
|
42564
42838
|
}
|
|
42565
42839
|
|
|
42566
42840
|
// src/site-widget-tools/create-site-from-template-tool/index.ts
|
|
42567
|
-
var
|
|
42841
|
+
var WIX_APIS_BASE_URL4 = "https://www.wixapis.com";
|
|
42568
42842
|
var CREATE_SITE_FROM_TEMPLATE_WIDGET_URI = "ui://widget/create-site-from-template.html";
|
|
42569
42843
|
function addCreateSiteFromTemplateTool(server, authStrategy, options) {
|
|
42570
42844
|
const resourceMeta = {
|
|
@@ -42696,7 +42970,7 @@ function addCreateSiteFromTemplateTool(server, authStrategy, options) {
|
|
|
42696
42970
|
}
|
|
42697
42971
|
async function createSiteFromTemplate(templateId, accountHeaders) {
|
|
42698
42972
|
const accountHttpClient = createHttpClient2({
|
|
42699
|
-
baseURL:
|
|
42973
|
+
baseURL: WIX_APIS_BASE_URL4,
|
|
42700
42974
|
headers: accountHeaders
|
|
42701
42975
|
});
|
|
42702
42976
|
const response = await accountHttpClient.request(
|
|
@@ -42732,7 +43006,7 @@ async function publishCreatedSite(siteId, siteHeaders, panorama) {
|
|
|
42732
43006
|
async function fetchEditorUrls(siteId, siteHeaders, panorama) {
|
|
42733
43007
|
try {
|
|
42734
43008
|
const siteHttpClient = createHttpClient2({
|
|
42735
|
-
baseURL:
|
|
43009
|
+
baseURL: WIX_APIS_BASE_URL4,
|
|
42736
43010
|
headers: {
|
|
42737
43011
|
...siteHeaders,
|
|
42738
43012
|
"wix-site-id": siteHeaders["wix-site-id"] ?? siteId
|
|
@@ -43002,7 +43276,6 @@ function listAssetsByProjectId(payload) {
|
|
|
43002
43276
|
// src/wixel/constants.ts
|
|
43003
43277
|
var WIXEL_ASSISTANT_V1_NO_ENTITY_API_BASE_URL = "https://manage.wix.com/";
|
|
43004
43278
|
var WWW_ASSET_V1_ASSET_API_BASE_URL = "https://manage.wix.com/";
|
|
43005
|
-
var HARMONY_SITE_BUILDER_API_BASE_URL = "https://manage.wix.com/";
|
|
43006
43279
|
var WIXEL_AGENT_EXTERNAL_API_BASE_URL = "https://manage.wix.com/";
|
|
43007
43280
|
var WIXEL_WIDGET_URI = "ui://widget/wixel-widget.html";
|
|
43008
43281
|
var WIXEL_ICON_PNG_URL = "https://wixmp-e9a92e1fa066d7bc836e4d31.wixmp.com/logos/wixel-icon-180.png";
|
|
@@ -43119,87 +43392,6 @@ async function queryAssets({
|
|
|
43119
43392
|
} = await httpClient6.request(listAssetsByProjectId({ projectId }));
|
|
43120
43393
|
return { assets };
|
|
43121
43394
|
}
|
|
43122
|
-
async function openHeadlessWixelProject({
|
|
43123
|
-
accountAuthHeaders,
|
|
43124
|
-
apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL,
|
|
43125
|
-
url,
|
|
43126
|
-
userPrompt,
|
|
43127
|
-
jobId,
|
|
43128
|
-
siteId,
|
|
43129
|
-
projectId,
|
|
43130
|
-
conversationId,
|
|
43131
|
-
withScreenshots,
|
|
43132
|
-
useProvidedCookies,
|
|
43133
|
-
timeout,
|
|
43134
|
-
conductorOverride
|
|
43135
|
-
}) {
|
|
43136
|
-
const httpClient6 = createHttpClient2({
|
|
43137
|
-
headers: {
|
|
43138
|
-
...COMMON_HEADERS,
|
|
43139
|
-
...accountAuthHeaders,
|
|
43140
|
-
...conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {},
|
|
43141
|
-
"Content-Type": "application/json"
|
|
43142
|
-
},
|
|
43143
|
-
baseURL: apiBaseURL
|
|
43144
|
-
});
|
|
43145
|
-
const response = await httpClient6.post(
|
|
43146
|
-
"/_api/harmony-site-builder/open-wixel-project",
|
|
43147
|
-
{
|
|
43148
|
-
url,
|
|
43149
|
-
userPrompt,
|
|
43150
|
-
jobId,
|
|
43151
|
-
siteId,
|
|
43152
|
-
projectId,
|
|
43153
|
-
conversationId,
|
|
43154
|
-
withScreenshots,
|
|
43155
|
-
useProvidedCookies,
|
|
43156
|
-
timeout
|
|
43157
|
-
}
|
|
43158
|
-
);
|
|
43159
|
-
return response.data;
|
|
43160
|
-
}
|
|
43161
|
-
async function updateHeadlessWixelJob({
|
|
43162
|
-
accountAuthHeaders,
|
|
43163
|
-
job,
|
|
43164
|
-
apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL,
|
|
43165
|
-
conductorOverride
|
|
43166
|
-
}) {
|
|
43167
|
-
const httpClient6 = createHttpClient2({
|
|
43168
|
-
headers: {
|
|
43169
|
-
...COMMON_HEADERS,
|
|
43170
|
-
...accountAuthHeaders,
|
|
43171
|
-
...conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {},
|
|
43172
|
-
"Content-Type": "application/json"
|
|
43173
|
-
},
|
|
43174
|
-
baseURL: apiBaseURL
|
|
43175
|
-
});
|
|
43176
|
-
const response = await httpClient6.post(
|
|
43177
|
-
"/_api/harmony-site-builder/update-wixel-job",
|
|
43178
|
-
{ job }
|
|
43179
|
-
);
|
|
43180
|
-
return response.data;
|
|
43181
|
-
}
|
|
43182
|
-
async function pullHeadlessWixelJob({
|
|
43183
|
-
accountAuthHeaders,
|
|
43184
|
-
apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL,
|
|
43185
|
-
jobId,
|
|
43186
|
-
conductorOverride
|
|
43187
|
-
}) {
|
|
43188
|
-
const httpClient6 = createHttpClient2({
|
|
43189
|
-
headers: {
|
|
43190
|
-
...COMMON_HEADERS,
|
|
43191
|
-
...accountAuthHeaders,
|
|
43192
|
-
...conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {},
|
|
43193
|
-
"Content-Type": "application/json"
|
|
43194
|
-
},
|
|
43195
|
-
baseURL: apiBaseURL
|
|
43196
|
-
});
|
|
43197
|
-
const response = await httpClient6.post(
|
|
43198
|
-
"/_api/harmony-site-builder/pull-wixel-job",
|
|
43199
|
-
{ jobId }
|
|
43200
|
-
);
|
|
43201
|
-
return response.data;
|
|
43202
|
-
}
|
|
43203
43395
|
async function getStylePresetsByIds2({
|
|
43204
43396
|
siteAuthHeaders,
|
|
43205
43397
|
stylePresetIds,
|
|
@@ -43519,240 +43711,6 @@ function addGetWixelProjectAssetsTool(server, authStrategy, options = {}) {
|
|
|
43519
43711
|
);
|
|
43520
43712
|
}
|
|
43521
43713
|
|
|
43522
|
-
// src/wixel/update-headless-wixel-job-tool.ts
|
|
43523
|
-
var TOOL_NAME5 = "updateHeadlessWixelJob";
|
|
43524
|
-
var TOOL_TITLE5 = "Update Headless Wixel Job";
|
|
43525
|
-
var TOOL_DESCRIPTION5 = `Update the status and data of a headless Wixel job.`;
|
|
43526
|
-
var TOOL_META5 = {
|
|
43527
|
-
ui: { visibility: ["app"] }
|
|
43528
|
-
};
|
|
43529
|
-
var wixelJobStatusSchema = external_exports.enum([
|
|
43530
|
-
"STARTED",
|
|
43531
|
-
"IN_PROGRESS",
|
|
43532
|
-
"COMPLETED",
|
|
43533
|
-
"FAILED",
|
|
43534
|
-
"CANCELLED"
|
|
43535
|
-
]);
|
|
43536
|
-
function addUpdateHeadlessWixelJobTool(server, authStrategy, options = {}) {
|
|
43537
|
-
const { getAccountAuthHeaders } = authStrategy;
|
|
43538
|
-
vD(
|
|
43539
|
-
server,
|
|
43540
|
-
TOOL_NAME5,
|
|
43541
|
-
{
|
|
43542
|
-
title: TOOL_TITLE5,
|
|
43543
|
-
description: TOOL_DESCRIPTION5,
|
|
43544
|
-
inputSchema: {
|
|
43545
|
-
id: external_exports.string().describe("The job ID"),
|
|
43546
|
-
status: wixelJobStatusSchema.describe("The job status"),
|
|
43547
|
-
userPrompt: external_exports.string().optional().describe("The user prompt for the job"),
|
|
43548
|
-
shouldRefresh: external_exports.boolean().optional().describe("Whether the job should refresh"),
|
|
43549
|
-
errorMessage: external_exports.string().optional().describe("Error message if the job failed"),
|
|
43550
|
-
type: external_exports.string().optional().describe("The type of asset being created"),
|
|
43551
|
-
data: external_exports.object({
|
|
43552
|
-
siteId: external_exports.string().optional().describe("The site ID"),
|
|
43553
|
-
assetId: external_exports.string().optional().describe("The asset ID"),
|
|
43554
|
-
projectId: external_exports.string().optional().describe("The project ID"),
|
|
43555
|
-
conversationId: external_exports.string().optional().describe("The conversation ID")
|
|
43556
|
-
}).optional().describe("Additional job data"),
|
|
43557
|
-
userId: external_exports.string().optional().describe("The user ID"),
|
|
43558
|
-
accountId: external_exports.string().optional().describe("The account ID")
|
|
43559
|
-
},
|
|
43560
|
-
annotations: {
|
|
43561
|
-
readOnlyHint: false,
|
|
43562
|
-
destructiveHint: true,
|
|
43563
|
-
openWorldHint: false
|
|
43564
|
-
},
|
|
43565
|
-
_meta: TOOL_META5
|
|
43566
|
-
},
|
|
43567
|
-
async (args) => {
|
|
43568
|
-
try {
|
|
43569
|
-
const accountAuthHeaders = await getAccountAuthHeaders();
|
|
43570
|
-
const result = await updateHeadlessWixelJob({
|
|
43571
|
-
accountAuthHeaders,
|
|
43572
|
-
conductorOverride: options.conductorOverride,
|
|
43573
|
-
job: {
|
|
43574
|
-
id: args.id,
|
|
43575
|
-
status: args.status,
|
|
43576
|
-
userPrompt: args.userPrompt,
|
|
43577
|
-
shouldRefresh: args.shouldRefresh,
|
|
43578
|
-
errorMessage: args.errorMessage,
|
|
43579
|
-
type: args.type,
|
|
43580
|
-
data: args.data,
|
|
43581
|
-
userId: args.userId,
|
|
43582
|
-
accountId: args.accountId
|
|
43583
|
-
}
|
|
43584
|
-
});
|
|
43585
|
-
return {
|
|
43586
|
-
isError: false,
|
|
43587
|
-
content: [
|
|
43588
|
-
{
|
|
43589
|
-
type: "text",
|
|
43590
|
-
text: `Headless Wixel job ${args.id} updated to status: ${args.status}`
|
|
43591
|
-
}
|
|
43592
|
-
],
|
|
43593
|
-
structuredContent: {
|
|
43594
|
-
jobId: args.id,
|
|
43595
|
-
status: args.status,
|
|
43596
|
-
...result
|
|
43597
|
-
}
|
|
43598
|
-
};
|
|
43599
|
-
} catch (error2) {
|
|
43600
|
-
console.error("\u274C Error updating headless Wixel job:", error2);
|
|
43601
|
-
const errorMessage = error2.message;
|
|
43602
|
-
return {
|
|
43603
|
-
isError: true,
|
|
43604
|
-
content: [{ type: "text", text: errorMessage }],
|
|
43605
|
-
structuredContent: {
|
|
43606
|
-
success: false,
|
|
43607
|
-
error: errorMessage
|
|
43608
|
-
}
|
|
43609
|
-
};
|
|
43610
|
-
}
|
|
43611
|
-
}
|
|
43612
|
-
);
|
|
43613
|
-
}
|
|
43614
|
-
|
|
43615
|
-
// src/wixel/pull-headless-wixel-job-tool.ts
|
|
43616
|
-
var TOOL_NAME6 = "pullHeadlessWixelJob";
|
|
43617
|
-
var TOOL_TITLE6 = "Pull Headless Wixel Job";
|
|
43618
|
-
var TOOL_DESCRIPTION6 = `Pull the next available headless Wixel job.`;
|
|
43619
|
-
var TOOL_META6 = {
|
|
43620
|
-
ui: { visibility: ["app"] }
|
|
43621
|
-
};
|
|
43622
|
-
function addPullHeadlessWixelJobTool(server, authStrategy, options = {}) {
|
|
43623
|
-
const { getAccountAuthHeaders } = authStrategy;
|
|
43624
|
-
vD(
|
|
43625
|
-
server,
|
|
43626
|
-
TOOL_NAME6,
|
|
43627
|
-
{
|
|
43628
|
-
title: TOOL_TITLE6,
|
|
43629
|
-
description: TOOL_DESCRIPTION6,
|
|
43630
|
-
inputSchema: {
|
|
43631
|
-
jobId: external_exports.string().describe("The job ID")
|
|
43632
|
-
},
|
|
43633
|
-
annotations: {
|
|
43634
|
-
readOnlyHint: false,
|
|
43635
|
-
destructiveHint: false,
|
|
43636
|
-
openWorldHint: false
|
|
43637
|
-
},
|
|
43638
|
-
_meta: TOOL_META6
|
|
43639
|
-
},
|
|
43640
|
-
async (args) => {
|
|
43641
|
-
try {
|
|
43642
|
-
const accountAuthHeaders = await getAccountAuthHeaders();
|
|
43643
|
-
const result = await pullHeadlessWixelJob({
|
|
43644
|
-
accountAuthHeaders,
|
|
43645
|
-
jobId: args.jobId,
|
|
43646
|
-
conductorOverride: options.conductorOverride
|
|
43647
|
-
});
|
|
43648
|
-
return {
|
|
43649
|
-
isError: false,
|
|
43650
|
-
content: [
|
|
43651
|
-
{
|
|
43652
|
-
type: "text",
|
|
43653
|
-
text: result.job ? `Pulled headless Wixel job: ${result.job.id}` : "No headless Wixel job available"
|
|
43654
|
-
}
|
|
43655
|
-
],
|
|
43656
|
-
structuredContent: {
|
|
43657
|
-
...result
|
|
43658
|
-
}
|
|
43659
|
-
};
|
|
43660
|
-
} catch (error2) {
|
|
43661
|
-
console.error("\u274C Error pulling headless Wixel job:", error2);
|
|
43662
|
-
const errorMessage = error2.message;
|
|
43663
|
-
return {
|
|
43664
|
-
isError: true,
|
|
43665
|
-
content: [{ type: "text", text: errorMessage }],
|
|
43666
|
-
structuredContent: {
|
|
43667
|
-
success: false,
|
|
43668
|
-
error: errorMessage
|
|
43669
|
-
}
|
|
43670
|
-
};
|
|
43671
|
-
}
|
|
43672
|
-
}
|
|
43673
|
-
);
|
|
43674
|
-
}
|
|
43675
|
-
|
|
43676
|
-
// src/wixel/open-headless-wixel-project-tool.ts
|
|
43677
|
-
var TOOL_NAME7 = "openHeadlessWixelProject";
|
|
43678
|
-
var TOOL_TITLE7 = "Open Headless Wixel Project";
|
|
43679
|
-
var TOOL_DESCRIPTION7 = `Open a headless Wixel project for background asset generation.`;
|
|
43680
|
-
var TOOL_META7 = {
|
|
43681
|
-
ui: { visibility: ["app"] }
|
|
43682
|
-
};
|
|
43683
|
-
function addOpenHeadlessWixelProjectTool(server, authStrategy, options = {}) {
|
|
43684
|
-
const { getAccountAuthHeaders } = authStrategy;
|
|
43685
|
-
vD(
|
|
43686
|
-
server,
|
|
43687
|
-
TOOL_NAME7,
|
|
43688
|
-
{
|
|
43689
|
-
title: TOOL_TITLE7,
|
|
43690
|
-
description: TOOL_DESCRIPTION7,
|
|
43691
|
-
inputSchema: {
|
|
43692
|
-
url: external_exports.string().describe("The URL of the Wixel project"),
|
|
43693
|
-
userPrompt: external_exports.string().describe("The user prompt for the project"),
|
|
43694
|
-
jobId: external_exports.string().describe("The job ID"),
|
|
43695
|
-
siteId: external_exports.string().describe("The site ID"),
|
|
43696
|
-
projectId: external_exports.string().describe("The project ID"),
|
|
43697
|
-
conversationId: external_exports.string().describe("The conversation ID"),
|
|
43698
|
-
withScreenshots: external_exports.boolean().optional().describe("Whether to include screenshots"),
|
|
43699
|
-
useProvidedCookies: external_exports.boolean().optional().describe("Whether to use provided cookies"),
|
|
43700
|
-
timeout: external_exports.number().optional().describe("Timeout in milliseconds")
|
|
43701
|
-
},
|
|
43702
|
-
annotations: {
|
|
43703
|
-
readOnlyHint: false,
|
|
43704
|
-
destructiveHint: true,
|
|
43705
|
-
openWorldHint: false
|
|
43706
|
-
},
|
|
43707
|
-
_meta: TOOL_META7
|
|
43708
|
-
},
|
|
43709
|
-
async (args) => {
|
|
43710
|
-
try {
|
|
43711
|
-
const accountAuthHeaders = await getAccountAuthHeaders();
|
|
43712
|
-
const result = await openHeadlessWixelProject({
|
|
43713
|
-
accountAuthHeaders,
|
|
43714
|
-
url: args.url,
|
|
43715
|
-
userPrompt: args.userPrompt,
|
|
43716
|
-
jobId: args.jobId,
|
|
43717
|
-
siteId: args.siteId,
|
|
43718
|
-
projectId: args.projectId,
|
|
43719
|
-
conversationId: args.conversationId,
|
|
43720
|
-
withScreenshots: args.withScreenshots,
|
|
43721
|
-
useProvidedCookies: args.useProvidedCookies,
|
|
43722
|
-
timeout: args.timeout,
|
|
43723
|
-
conductorOverride: options.conductorOverride
|
|
43724
|
-
});
|
|
43725
|
-
return {
|
|
43726
|
-
isError: false,
|
|
43727
|
-
content: [
|
|
43728
|
-
{
|
|
43729
|
-
type: "text",
|
|
43730
|
-
text: `Headless Wixel project opened for job ${args.jobId}`
|
|
43731
|
-
}
|
|
43732
|
-
],
|
|
43733
|
-
structuredContent: {
|
|
43734
|
-
success: true,
|
|
43735
|
-
jobId: args.jobId,
|
|
43736
|
-
projectId: args.projectId,
|
|
43737
|
-
...result
|
|
43738
|
-
}
|
|
43739
|
-
};
|
|
43740
|
-
} catch (error2) {
|
|
43741
|
-
console.error("\u274C Error opening headless Wixel project:", error2);
|
|
43742
|
-
const errorMessage = error2.message;
|
|
43743
|
-
return {
|
|
43744
|
-
isError: true,
|
|
43745
|
-
content: [{ type: "text", text: errorMessage }],
|
|
43746
|
-
structuredContent: {
|
|
43747
|
-
success: false,
|
|
43748
|
-
error: errorMessage
|
|
43749
|
-
}
|
|
43750
|
-
};
|
|
43751
|
-
}
|
|
43752
|
-
}
|
|
43753
|
-
);
|
|
43754
|
-
}
|
|
43755
|
-
|
|
43756
43714
|
// ../../node_modules/@wix/ambassador-www-wixel-agent-v1-external-agent/es/build/http.impl.js
|
|
43757
43715
|
init_ambassador_index();
|
|
43758
43716
|
init_build();
|
|
@@ -44091,7 +44049,7 @@ async function getWixelPendingQuestion({
|
|
|
44091
44049
|
}
|
|
44092
44050
|
|
|
44093
44051
|
// src/wixel/wixel-session-tools.ts
|
|
44094
|
-
var
|
|
44052
|
+
var TOOL_META5 = {
|
|
44095
44053
|
ui: { visibility: ["app", "model"] }
|
|
44096
44054
|
};
|
|
44097
44055
|
function buildWixelEditorUrl(metaSiteId, projectId) {
|
|
@@ -44400,7 +44358,7 @@ Without arguments Wixel provisions a new project and session. Pass metaSiteId to
|
|
|
44400
44358
|
destructiveHint: false,
|
|
44401
44359
|
openWorldHint: false
|
|
44402
44360
|
},
|
|
44403
|
-
_meta:
|
|
44361
|
+
_meta: TOOL_META5
|
|
44404
44362
|
},
|
|
44405
44363
|
async (args, extra) => {
|
|
44406
44364
|
setWixelToolBi(extra, {
|
|
@@ -44494,7 +44452,7 @@ Send the user's request as THEY phrased it. Do NOT add creative direction they d
|
|
|
44494
44452
|
destructiveHint: true,
|
|
44495
44453
|
openWorldHint: false
|
|
44496
44454
|
},
|
|
44497
|
-
_meta:
|
|
44455
|
+
_meta: TOOL_META5
|
|
44498
44456
|
},
|
|
44499
44457
|
async (args, extra) => {
|
|
44500
44458
|
setWixelToolBi(extra, {
|
|
@@ -44595,7 +44553,7 @@ Event types: "reply" (the agent's answer), "failed" (the turn failed), and "user
|
|
|
44595
44553
|
destructiveHint: false,
|
|
44596
44554
|
openWorldHint: false
|
|
44597
44555
|
},
|
|
44598
|
-
_meta:
|
|
44556
|
+
_meta: TOOL_META5
|
|
44599
44557
|
},
|
|
44600
44558
|
async (args, extra) => {
|
|
44601
44559
|
setWixelToolBi(extra, {
|
|
@@ -44765,7 +44723,7 @@ function addGetWixelStylePresetsTool(server, authStrategy, options = {}) {
|
|
|
44765
44723
|
destructiveHint: false,
|
|
44766
44724
|
openWorldHint: false
|
|
44767
44725
|
},
|
|
44768
|
-
_meta:
|
|
44726
|
+
_meta: TOOL_META5
|
|
44769
44727
|
},
|
|
44770
44728
|
async (args, extra) => {
|
|
44771
44729
|
setWixelToolBi(extra, { siteId: args.metaSiteId });
|
|
@@ -45068,9 +45026,6 @@ function addWixelTools(server, authStrategy, options = {}) {
|
|
|
45068
45026
|
addMarkWixelJobAsFulfilledTool(server, authStrategy, options);
|
|
45069
45027
|
addGetWixelAssetTool(server, authStrategy, options);
|
|
45070
45028
|
addGetWixelProjectAssetsTool(server, authStrategy, options);
|
|
45071
|
-
addUpdateHeadlessWixelJobTool(server, authStrategy, options);
|
|
45072
|
-
addOpenHeadlessWixelProjectTool(server, authStrategy, options);
|
|
45073
|
-
addPullHeadlessWixelJobTool(server, authStrategy, options);
|
|
45074
45029
|
addWixelSessionTools(server, authStrategy, options);
|
|
45075
45030
|
}
|
|
45076
45031
|
|
|
@@ -45507,10 +45462,13 @@ function executeTextResult(message) {
|
|
|
45507
45462
|
content: [{ type: "text", text: message }]
|
|
45508
45463
|
};
|
|
45509
45464
|
}
|
|
45510
|
-
function formatExecuteResult(data, maxResponseSize) {
|
|
45465
|
+
function formatExecuteResult(data, maxResponseSize, reportBi) {
|
|
45511
45466
|
if (data.error) {
|
|
45512
45467
|
return executeErrorResult(data.error);
|
|
45513
45468
|
}
|
|
45469
|
+
reportBi?.({
|
|
45470
|
+
originalLength: typeof data.result === "string" ? data.result.length : JSON.stringify(data.result)?.length
|
|
45471
|
+
});
|
|
45514
45472
|
return {
|
|
45515
45473
|
content: [
|
|
45516
45474
|
{ type: "text", text: truncateResponse(data.result, maxResponseSize) }
|
|
@@ -45620,7 +45578,11 @@ function addExecuteTool(server, options) {
|
|
|
45620
45578
|
status: data.authErrorStatus
|
|
45621
45579
|
});
|
|
45622
45580
|
}
|
|
45623
|
-
return formatExecuteResult(
|
|
45581
|
+
return formatExecuteResult(
|
|
45582
|
+
data,
|
|
45583
|
+
maxResponseSize,
|
|
45584
|
+
extra?.setToolBiParams
|
|
45585
|
+
);
|
|
45624
45586
|
} catch (err) {
|
|
45625
45587
|
const message = err instanceof Error ? err.message : String(err);
|
|
45626
45588
|
logger2.log(
|
|
@@ -45721,13 +45683,13 @@ function createWixToolkit(options) {
|
|
|
45721
45683
|
clientName,
|
|
45722
45684
|
hooks,
|
|
45723
45685
|
conversationId,
|
|
45724
|
-
includeReadmeMentions = false
|
|
45686
|
+
includeReadmeMentions = false,
|
|
45687
|
+
includeImageUploadGuidance = false
|
|
45725
45688
|
} = options;
|
|
45726
45689
|
const authStrategy = normalizeAuth(auth);
|
|
45727
45690
|
const executeWixApiRequested = isExecuteWixApiRequested(api);
|
|
45728
|
-
|
|
45691
|
+
const descriptionsWithoutReadme = buildToolDescriptions(includeReadmeMentions, includeImageUploadGuidance);
|
|
45729
45692
|
if (!includeReadmeMentions) {
|
|
45730
|
-
descriptionsWithoutReadme = buildToolDescriptions(false);
|
|
45731
45693
|
delete descriptionsWithoutReadme.WixREADME;
|
|
45732
45694
|
}
|
|
45733
45695
|
const sessionId = v4_default();
|
|
@@ -45744,13 +45706,16 @@ function createWixToolkit(options) {
|
|
|
45744
45706
|
authStrategy,
|
|
45745
45707
|
dynamicContextEnabled: true,
|
|
45746
45708
|
// README-free defaults first so consumer overrides still win.
|
|
45747
|
-
toolDescriptions:
|
|
45709
|
+
toolDescriptions: {
|
|
45710
|
+
...descriptionsWithoutReadme,
|
|
45711
|
+
...docsOptions.toolDescriptions
|
|
45712
|
+
}
|
|
45748
45713
|
});
|
|
45749
45714
|
} else {
|
|
45750
45715
|
addDocsTools(server, void 0, {
|
|
45751
45716
|
authStrategy,
|
|
45752
45717
|
dynamicContextEnabled: true,
|
|
45753
|
-
|
|
45718
|
+
toolDescriptions: descriptionsWithoutReadme
|
|
45754
45719
|
});
|
|
45755
45720
|
}
|
|
45756
45721
|
if (api) {
|
|
@@ -45763,7 +45728,7 @@ function createWixToolkit(options) {
|
|
|
45763
45728
|
maxResponseSize,
|
|
45764
45729
|
codeModeBaseUrl = "https://mcp.wix.com"
|
|
45765
45730
|
} = api;
|
|
45766
|
-
const effectiveToolDescriptions =
|
|
45731
|
+
const effectiveToolDescriptions = {
|
|
45767
45732
|
...descriptionsWithoutReadme,
|
|
45768
45733
|
...executeWixApiRequested ? executeCodeModeToolDescriptions : {},
|
|
45769
45734
|
...toolDescriptions
|
|
@@ -45862,7 +45827,10 @@ function createWixToolkit(options) {
|
|
|
45862
45827
|
if (!toolSucceeded) {
|
|
45863
45828
|
errorBody = extractText(cbResult);
|
|
45864
45829
|
} else {
|
|
45865
|
-
additionalFields = formatToolResultAdditionalFields(cbResult
|
|
45830
|
+
additionalFields = formatToolResultAdditionalFields(cbResult, {
|
|
45831
|
+
returnedRows: toolBiParams.returnedRows,
|
|
45832
|
+
originalLength: toolBiParams.originalLength
|
|
45833
|
+
});
|
|
45866
45834
|
}
|
|
45867
45835
|
if (!isDevEnvironment) {
|
|
45868
45836
|
if (toolSucceeded) {
|
|
@@ -46013,14 +45981,13 @@ export {
|
|
|
46013
45981
|
addDocsTools,
|
|
46014
45982
|
addEditSiteWidgetTool,
|
|
46015
45983
|
addExecuteCodeModeTool,
|
|
45984
|
+
addGetProfileTool,
|
|
46016
45985
|
addGetWixelAssetTool,
|
|
46017
45986
|
addGetWixelJobStatusTool,
|
|
46018
45987
|
addGetWixelProjectAssetsTool,
|
|
46019
45988
|
addImportClaudeDesignTool,
|
|
46020
45989
|
addListWixelEventsTool,
|
|
46021
45990
|
addMarkWixelJobAsFulfilledTool,
|
|
46022
|
-
addOpenHeadlessWixelProjectTool,
|
|
46023
|
-
addPullHeadlessWixelJobTool,
|
|
46024
45991
|
addPullSiteJobTool,
|
|
46025
45992
|
addSearchCodeModeTool,
|
|
46026
45993
|
addSearchSiteTemplatesTool,
|
|
@@ -46028,7 +45995,6 @@ export {
|
|
|
46028
45995
|
addSiteCreationWidgetTools,
|
|
46029
45996
|
addStartWixelSessionTool,
|
|
46030
45997
|
addSupportTool,
|
|
46031
|
-
addUpdateHeadlessWixelJobTool,
|
|
46032
45998
|
addWixSiteCreationTool,
|
|
46033
45999
|
addWixelSessionTools,
|
|
46034
46000
|
addWixelTools,
|