@wix/mcp 1.0.22 → 1.0.23
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 +541 -982
- package/build/bin-standalone.js.map +4 -4
- package/build/cjs/index.cjs +7820 -7095
- package/build/cjs/index.cjs.map +4 -4
- package/build/dts/api-call/index.d.ts +1 -1
- package/build/dts/api-call/index.d.ts.map +1 -1
- package/build/dts/api-call/index.js +20 -12
- package/build/dts/api-call/index.js.map +1 -1
- package/build/dts/bin.d.ts.map +1 -1
- package/build/dts/bin.js.map +1 -1
- package/build/dts/docs/create-site-guide.d.ts +1 -1
- package/build/dts/docs/create-site-guide.d.ts.map +1 -1
- package/build/dts/docs/create-site-guide.js +5 -2
- package/build/dts/docs/create-site-guide.js.map +1 -1
- package/build/dts/docs/docs.d.ts +14 -0
- package/build/dts/docs/docs.d.ts.map +1 -1
- package/build/dts/docs/docs.js +133 -109
- package/build/dts/docs/docs.js.map +1 -1
- package/build/dts/docs/get-to-know.d.ts +10 -1
- package/build/dts/docs/get-to-know.d.ts.map +1 -1
- package/build/dts/docs/get-to-know.js +11 -6
- package/build/dts/docs/get-to-know.js.map +1 -1
- package/build/dts/docs/velo-readme.d.ts.map +1 -1
- package/build/dts/docs/velo-readme.js +1 -1
- package/build/dts/docs/velo-readme.js.map +1 -1
- package/build/dts/index.d.ts +3 -1
- package/build/dts/index.d.ts.map +1 -1
- package/build/dts/index.js +2 -0
- package/build/dts/index.js.map +1 -1
- package/build/dts/pull-site-creation-job-tool/constants.d.ts +3 -0
- package/build/dts/pull-site-creation-job-tool/constants.d.ts.map +1 -0
- package/build/dts/pull-site-creation-job-tool/constants.js +3 -0
- package/build/dts/pull-site-creation-job-tool/constants.js.map +1 -0
- package/build/dts/pull-site-creation-job-tool/index.d.ts +21 -0
- package/build/dts/pull-site-creation-job-tool/index.d.ts.map +1 -0
- package/build/dts/pull-site-creation-job-tool/index.js +144 -0
- package/build/dts/pull-site-creation-job-tool/index.js.map +1 -0
- package/build/dts/site-builder-tool/constants.d.ts +7 -0
- package/build/dts/site-builder-tool/constants.d.ts.map +1 -0
- package/build/dts/site-builder-tool/constants.js +7 -0
- package/build/dts/site-builder-tool/constants.js.map +1 -0
- package/build/dts/site-builder-tool/index.d.ts +4 -0
- package/build/dts/site-builder-tool/index.d.ts.map +1 -0
- package/build/dts/site-builder-tool/index.js +160 -0
- package/build/dts/site-builder-tool/index.js.map +1 -0
- package/build/dts/support/index.d.ts +1 -1
- package/build/dts/support/index.d.ts.map +1 -1
- package/build/dts/support/index.js +8 -4
- package/build/dts/support/index.js.map +1 -1
- package/build/dts/widget-manifest.d.ts +6 -0
- package/build/dts/widget-manifest.d.ts.map +1 -0
- package/build/dts/widget-manifest.js +19 -0
- package/build/dts/widget-manifest.js.map +1 -0
- package/build/dts/wix-mcp-server.d.ts +16 -3
- package/build/dts/wix-mcp-server.d.ts.map +1 -1
- package/build/dts/wix-mcp-server.js +121 -106
- package/build/dts/wix-mcp-server.js.map +1 -1
- package/build/esm/index.js +7487 -6254
- package/build/esm/index.js.map +4 -4
- package/package.json +28 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { WixMcpServer } from '../wix-mcp-server.js';
|
|
2
2
|
import { McpAuthenticationStrategy } from '../auth/index.js';
|
|
3
|
-
export declare function addApiCallTool(server: WixMcpServer, strategy: McpAuthenticationStrategy, allowedTools?: string[]): void;
|
|
3
|
+
export declare function addApiCallTool(server: WixMcpServer, strategy: McpAuthenticationStrategy, allowedTools?: string[], disableTools?: string[], toolDescriptions?: Record<string, string>): void;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api-call/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,yBAAyB,EACnC,YAAY,GAAE,MAAM,EAAwD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api-call/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,yBAAyB,EACnC,YAAY,GAAE,MAAM,EAAwD,EAC5E,YAAY,GAAE,MAAM,EAAO,EAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAyQ1C"}
|
|
@@ -3,16 +3,20 @@ import { HttpClient } from '@wix/http-client';
|
|
|
3
3
|
import { logger } from '../infra/logger.js';
|
|
4
4
|
import { handleWixAPIResponse } from '../tool-utils.js';
|
|
5
5
|
import { isApiUrlAllowed } from './validation.js';
|
|
6
|
-
export function addApiCallTool(server, strategy, allowedTools = ['CallWixSiteAPI', 'ListWixSites', 'ManageWixSite']) {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export function addApiCallTool(server, strategy, allowedTools = ['CallWixSiteAPI', 'ListWixSites', 'ManageWixSite'], disableTools = [], toolDescriptions) {
|
|
7
|
+
// Helper to get description (custom or default)
|
|
8
|
+
const getDescription = (toolName, defaultDesc) => toolDescriptions?.[toolName] ?? defaultDesc;
|
|
9
|
+
if (allowedTools.includes('CallWixSiteAPI') &&
|
|
10
|
+
!disableTools.includes('CallWixSiteAPI')) {
|
|
11
|
+
const defaultCallApiDesc = [
|
|
9
12
|
'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,',
|
|
10
13
|
`You should ALWAYS check the rest docs - "SearchWixRESTDocumentation" for the specific API you want to call, don't just call it without knowing what it does, CHECK THE DOCS`,
|
|
11
14
|
'Error Handling:',
|
|
12
15
|
'If the error is related to missing installed app or "WDE0110: Wix Code not enabled", you should install the missing app by using ReadFullDocsArticle tool to fetch the article - https://dev.wix.com/docs/kb-only/MCP_REST_RECIPES_KB_ID/TRAIN_wix.devcenter.apps.installer.v1.AppsInstallerService.InstallApp',
|
|
13
16
|
'**Note:** there is no need to check if an app is installed/ Wix Code enabled in advance, just call the API and handle the error if it occurs, the API error message will state it clearly.',
|
|
14
17
|
'For any other error, use your default error handling mechanism'
|
|
15
|
-
].join('\n')
|
|
18
|
+
].join('\n');
|
|
19
|
+
server.tool('CallWixSiteAPI', getDescription('CallWixSiteAPI', defaultCallApiDesc), {
|
|
16
20
|
siteId: z
|
|
17
21
|
.string()
|
|
18
22
|
.describe('The id of the site selected using site selection tool'),
|
|
@@ -27,7 +31,7 @@ export function addApiCallTool(server, strategy, allowedTools = ['CallWixSiteAPI
|
|
|
27
31
|
.string()
|
|
28
32
|
.optional()
|
|
29
33
|
.describe('A string representing of a valid JSON object to describe the body of the request')
|
|
30
|
-
}, async ({ url, body, method, siteId }, { httpClient, setToolBiParams }) => {
|
|
34
|
+
}, { readOnlyHint: false, destructiveHint: true, openWorldHint: false }, async ({ url, body, method, siteId }, { httpClient, setToolBiParams }) => {
|
|
31
35
|
logger.log(`Calling Wix Site API: ${siteId} ${url}, body: ${JSON.stringify(body)}`);
|
|
32
36
|
const { isAllowed, error: urlError } = isApiUrlAllowed(url);
|
|
33
37
|
if (!isAllowed) {
|
|
@@ -79,15 +83,17 @@ export function addApiCallTool(server, strategy, allowedTools = ['CallWixSiteAPI
|
|
|
79
83
|
}
|
|
80
84
|
});
|
|
81
85
|
}
|
|
82
|
-
if (allowedTools.includes('ListWixSites')
|
|
83
|
-
|
|
86
|
+
if (allowedTools.includes('ListWixSites') &&
|
|
87
|
+
!disableTools.includes('ListWixSites')) {
|
|
88
|
+
const defaultListSitesDesc = 'List Wix sites for the current user, by default it will return all sites, but you can filter by name';
|
|
89
|
+
server.tool('ListWixSites', getDescription('ListWixSites', defaultListSitesDesc), {
|
|
84
90
|
nameSearch: z
|
|
85
91
|
.string()
|
|
86
92
|
.optional()
|
|
87
93
|
.describe('optional filer by name, if not provided all sites will be returned'),
|
|
88
94
|
// Hack for Cursor ignoring tools with no params (when nameSearch is optional)
|
|
89
95
|
alwaysTrue: z.boolean().describe('Always pass true to this parameter')
|
|
90
|
-
}, async ({ nameSearch }, { httpClient }) => {
|
|
96
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ nameSearch }, { httpClient }) => {
|
|
91
97
|
const sitesRes = await httpClient.post('https://www.wixapis.com/site-list/v2/sites/query', {
|
|
92
98
|
query: {
|
|
93
99
|
cursorPaging: { limit: 21 },
|
|
@@ -128,10 +134,12 @@ export function addApiCallTool(server, strategy, allowedTools = ['CallWixSiteAPI
|
|
|
128
134
|
};
|
|
129
135
|
});
|
|
130
136
|
}
|
|
131
|
-
if (allowedTools.includes('ManageWixSite')
|
|
132
|
-
|
|
137
|
+
if (allowedTools.includes('ManageWixSite') &&
|
|
138
|
+
!disableTools.includes('ManageWixSite')) {
|
|
139
|
+
const defaultManageSiteDesc = `Use account level API in order to create a site, update a site and publish site.
|
|
133
140
|
ALWAYS use "SearchWixRESTDocumentation" to search for the API you should invoke, NEVER GUESS THE SITE API URL
|
|
134
|
-
You should ALWAYS check the rest docs - "SearchWixRESTDocumentation" for the specific API you want to call, don't just call it without knowing what it does, CHECK THE DOCS
|
|
141
|
+
You should ALWAYS check the rest docs - "SearchWixRESTDocumentation" for the specific API you want to call, don't just call it without knowing what it does, CHECK THE DOCS`;
|
|
142
|
+
server.tool('ManageWixSite', getDescription('ManageWixSite', defaultManageSiteDesc), {
|
|
135
143
|
url: z
|
|
136
144
|
.string()
|
|
137
145
|
.url()
|
|
@@ -143,7 +151,7 @@ export function addApiCallTool(server, strategy, allowedTools = ['CallWixSiteAPI
|
|
|
143
151
|
.string()
|
|
144
152
|
.optional()
|
|
145
153
|
.describe('A string representing of a valid JSON object to describe the body of the request')
|
|
146
|
-
}, async ({ url, body, method }, { httpClient }) => {
|
|
154
|
+
}, { readOnlyHint: false, destructiveHint: true, openWorldHint: false }, async ({ url, body, method }, { httpClient }) => {
|
|
147
155
|
logger.log(`Calling Wix Account level API: ${url}, body: ${JSON.stringify(body)}`);
|
|
148
156
|
const { isAllowed, error: urlError } = isApiUrlAllowed(url);
|
|
149
157
|
if (!isAllowed) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-call/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,UAAU,cAAc,CAC5B,MAAoB,EACpB,QAAmC,EACnC,eAAyB,CAAC,gBAAgB,EAAE,cAAc,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-call/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,UAAU,cAAc,CAC5B,MAAoB,EACpB,QAAmC,EACnC,eAAyB,CAAC,gBAAgB,EAAE,cAAc,EAAE,eAAe,CAAC,EAC5E,eAAyB,EAAE,EAC3B,gBAAyC;IAEzC,gDAAgD;IA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E;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,KAAK,CAAC,mCAAmC,KAAK,EAAE,CAAC,CAAC;gBAEzD,MAAM,QAAQ,GAAI,KAAmB,CAAC,QAAQ,CAAC;gBAC/C,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,EAAE,CAAC,CAAC;gBAC9D,CAAC;gBAED,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;YACxC,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/build/dts/bin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/bin.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAmB3B,QAAA,MAAM,YAAY,6FAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/bin.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAmB3B,QAAA,MAAM,YAAY,6FAAiC,CAAC;AAEpD,QAAA,MAAM,kBAAkB,0HAOd,CAAC;AAEX,KAAK,IAAI,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChF,eAAO,MAAM,aAAa,EAAE,IAAI,EAA0B,CAAC"}
|
package/build/dts/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/bin.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAE3B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAY,gBAAgB,EAAE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AM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AACtC,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAChC,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAElC,IAAI,UAAU,KAAK,KAAK,EAAE,CAAC;IACzB,wCAAwC;IACxC,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { WixMcpServer } from '../wix-mcp-server.js';
|
|
2
|
-
export declare function addCreateWixBusinessGuideTools(server: WixMcpServer): Promise<void>;
|
|
2
|
+
export declare function addCreateWixBusinessGuideTools(server: WixMcpServer, disableTools?: string[], toolDescriptions?: Record<string, string>): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=create-site-guide.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-site-guide.d.ts","sourceRoot":"","sources":["../../../src/docs/create-site-guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA6CpD,wBAAsB,8BAA8B,
|
|
1
|
+
{"version":3,"file":"create-site-guide.d.ts","sourceRoot":"","sources":["../../../src/docs/create-site-guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA6CpD,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,YAAY,EACpB,YAAY,GAAE,MAAM,EAAO,EAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,iBA8C1C"}
|
|
@@ -37,8 +37,11 @@ This tool provides complete documentation including:
|
|
|
37
37
|
2. Use CallWixSiteAPI to install apps (if needed)
|
|
38
38
|
|
|
39
39
|
If the user wants to create a Wix site, call this tool directly. It contains ALL necessary documentation. You don't need to search for additional documentation, read more articles, use the WixREADME tool etc unless the user asks you to do so explicitly or you encounter an error.`;
|
|
40
|
-
export async function addCreateWixBusinessGuideTools(server) {
|
|
41
|
-
|
|
40
|
+
export async function addCreateWixBusinessGuideTools(server, disableTools = [], toolDescriptions) {
|
|
41
|
+
if (disableTools.includes('CreateWixBusinessGuide')) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
server.tool('CreateWixBusinessGuide', toolDescriptions?.['CreateWixBusinessGuide'] ?? CREATE_SITE_DESCRIPTION, {}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async (_args, { httpClient }) => {
|
|
42
45
|
try {
|
|
43
46
|
const contents = await Promise.all(CREATE_SITE_DOCS.map(async ({ url, title, nextSteps }) => {
|
|
44
47
|
const articleContent = await fetchArticleContent(httpClient, url, 'article', true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-site-guide.js","sourceRoot":"","sources":["../../../src/docs/create-site-guide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,gBAAgB,GAAG;IACvB;QACE,GAAG,EAAE,+FAA+F;QACpG,KAAK,EAAE,8BAA8B;QACrC,SAAS,EACP,gGAAgG;KACnG;IACD;QACE,GAAG,EAAE,+HAA+H;QACpI,KAAK,EAAE,kCAAkC;QACzC,SAAS,EACP,2GAA2G;KAC9G;CACF,CAAC;AAEF,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;wRAyBwP,CAAC;AAEzR,MAAM,CAAC,KAAK,UAAU,8BAA8B,
|
|
1
|
+
{"version":3,"file":"create-site-guide.js","sourceRoot":"","sources":["../../../src/docs/create-site-guide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,gBAAgB,GAAG;IACvB;QACE,GAAG,EAAE,+FAA+F;QACpG,KAAK,EAAE,8BAA8B;QACrC,SAAS,EACP,gGAAgG;KACnG;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8C,KAAe,CAAC,OAAO,EAAE;qBAC9E;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/build/dts/docs/docs.d.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import type { WixMcpServer } from '../wix-mcp-server.js';
|
|
2
2
|
export declare const VALID_DOCS_TOOLS: readonly ["WDS", "REST", "SDK", "BUILD_APPS", "WIX_HEADLESS", "VELO", "BUSINESS_SOLUTIONS"];
|
|
3
3
|
export type DocsTool = (typeof VALID_DOCS_TOOLS)[number];
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for a README doc entry
|
|
6
|
+
*/
|
|
7
|
+
export interface ReadmeDocConfig {
|
|
8
|
+
url: string;
|
|
9
|
+
action: 'include' | 'index';
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
4
13
|
export interface DocsToolsOptions {
|
|
5
14
|
getToKnowWixEnabled?: boolean;
|
|
6
15
|
createWixBusinessGuideEnabled?: boolean;
|
|
16
|
+
disableTools?: string[];
|
|
17
|
+
/** Custom descriptions for tools, keyed by tool name */
|
|
18
|
+
toolDescriptions?: Record<string, string>;
|
|
19
|
+
/** Custom list of docs that compose the WixREADME tool output */
|
|
20
|
+
readmeDocs?: ReadmeDocConfig[];
|
|
7
21
|
}
|
|
8
22
|
export declare const addDocsTools: (server: WixMcpServer, allowedTools?: DocsTool[], options?: DocsToolsOptions) => void;
|
|
9
23
|
//# sourceMappingURL=docs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/docs/docs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AASzD,eAAO,MAAM,gBAAgB,6FAQnB,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6BAA6B,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/docs/docs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AASzD,eAAO,MAAM,gBAAgB,6FAQnB,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,iEAAiE;IACjE,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;CAChC;AAED,eAAO,MAAM,YAAY,GACvB,QAAQ,YAAY,EACpB,eAAc,QAAQ,EAOrB,EACD,UAAS,gBAAqB,SAqqB/B,CAAC"}
|
package/build/dts/docs/docs.js
CHANGED
|
@@ -22,22 +22,27 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
22
22
|
'WIX_HEADLESS',
|
|
23
23
|
'BUSINESS_SOLUTIONS'
|
|
24
24
|
], options = {}) => {
|
|
25
|
-
const { getToKnowWixEnabled = false, createWixBusinessGuideEnabled = true } = options;
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const { getToKnowWixEnabled = false, createWixBusinessGuideEnabled = true, disableTools, toolDescriptions, readmeDocs } = options;
|
|
26
|
+
// Helper to get description (custom or default)
|
|
27
|
+
const getDescription = (toolName, defaultDesc) => toolDescriptions?.[toolName] ?? defaultDesc;
|
|
28
|
+
if (getToKnowWixEnabled && !disableTools?.includes('WixREADME')) {
|
|
29
|
+
addGetToKnowTools(server, disableTools || [], toolDescriptions, readmeDocs);
|
|
28
30
|
}
|
|
29
|
-
if (createWixBusinessGuideEnabled
|
|
30
|
-
|
|
31
|
+
if (createWixBusinessGuideEnabled &&
|
|
32
|
+
!disableTools?.includes('CreateWixBusinessGuide')) {
|
|
33
|
+
addCreateWixBusinessGuideTools(server, disableTools || [], toolDescriptions);
|
|
31
34
|
}
|
|
32
35
|
// WDS Documentation
|
|
33
|
-
if (allowedTools.includes('WDS')
|
|
34
|
-
|
|
36
|
+
if (allowedTools.includes('WDS') &&
|
|
37
|
+
!disableTools?.includes('SearchWixWDSDocumentation')) {
|
|
38
|
+
const defaultWdsDesc = [
|
|
35
39
|
'Searches the Wix Design System Documentation for components and patterns.',
|
|
36
40
|
'Use this tool when you need to understand or implement UI components and design patterns in a Wix project.',
|
|
37
41
|
'Search for specific component names, patterns, or UI requirements.',
|
|
38
42
|
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
|
|
39
43
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ''
|
|
40
|
-
].join('\n')
|
|
44
|
+
].join('\n');
|
|
45
|
+
server.tool('SearchWixWDSDocumentation', getDescription('SearchWixWDSDocumentation', defaultWdsDesc), {
|
|
41
46
|
searchTerm: z
|
|
42
47
|
.string()
|
|
43
48
|
.describe('The search term to search for in the Wix Design System Documentation'),
|
|
@@ -48,7 +53,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
48
53
|
.max(15)
|
|
49
54
|
.optional()
|
|
50
55
|
.default(10)
|
|
51
|
-
}, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
56
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
52
57
|
try {
|
|
53
58
|
logger.log(`Searching for ${searchTerm} in Wix WDS`);
|
|
54
59
|
const result = await runSemanticSearchAndFormat({
|
|
@@ -84,14 +89,16 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
84
89
|
});
|
|
85
90
|
}
|
|
86
91
|
// REST Documentation
|
|
87
|
-
if (allowedTools.includes('REST')
|
|
88
|
-
|
|
92
|
+
if (allowedTools.includes('REST') &&
|
|
93
|
+
!disableTools?.includes('SearchWixRESTDocumentation')) {
|
|
94
|
+
const defaultRestDesc = [
|
|
89
95
|
'Searches the official Wix REST API documentation.',
|
|
90
96
|
'Use this tool whenever you need to to interact with the Wix platform via HTTP requests.',
|
|
91
97
|
"Specify the API endpoint, resource, or action you need information about (e.g., 'get site details endpoint', 'create data collection', 'update product API', 'REST authentication').",
|
|
92
98
|
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
|
|
93
99
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ''
|
|
94
|
-
].join('\n')
|
|
100
|
+
].join('\n');
|
|
101
|
+
server.tool('SearchWixRESTDocumentation', getDescription('SearchWixRESTDocumentation', defaultRestDesc), {
|
|
95
102
|
searchTerm: z
|
|
96
103
|
.string()
|
|
97
104
|
.describe('The search term to search for in the Wix REST API Documentation'),
|
|
@@ -102,7 +109,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
102
109
|
.max(15)
|
|
103
110
|
.optional()
|
|
104
111
|
.default(10)
|
|
105
|
-
}, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
112
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
106
113
|
try {
|
|
107
114
|
logger.log(`Searching for ${searchTerm} in Wix REST API`);
|
|
108
115
|
const result = await runSemanticSearchAndFormat({
|
|
@@ -142,8 +149,10 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
142
149
|
}
|
|
143
150
|
});
|
|
144
151
|
}
|
|
145
|
-
if (allowedTools.includes('BUSINESS_SOLUTIONS') &&
|
|
146
|
-
|
|
152
|
+
if (allowedTools.includes('BUSINESS_SOLUTIONS') &&
|
|
153
|
+
!getToKnowWixEnabled &&
|
|
154
|
+
!disableTools?.includes('WixBusinessFlowsDocumentation')) {
|
|
155
|
+
const defaultBusinessDesc = [
|
|
147
156
|
'This tool provides step-by-step recipes for setting up complex Wix business solutions that involve multiple API calls.',
|
|
148
157
|
'It excels at guiding the creation of features like booking systems with payments.',
|
|
149
158
|
'For example, it can guide the setup of a service in Wix Bookings where customers can pay using Wix Payments, such as creating a bookable yoga class',
|
|
@@ -152,7 +161,8 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
152
161
|
'**IMPORTANT NOTES:**',
|
|
153
162
|
'1. Before attempting to implement a multi step API calls on Wix, YOU MUST TRY THIS TOOL FIRST.',
|
|
154
163
|
'2. Out of the returned list of articles that you will receive, you MUST select the most relevant one and use the ReadFullDocsArticle tool to fetch it.'
|
|
155
|
-
].join('\n')
|
|
164
|
+
].join('\n');
|
|
165
|
+
server.tool('WixBusinessFlowsDocumentation', getDescription('WixBusinessFlowsDocumentation', defaultBusinessDesc), {
|
|
156
166
|
searchTerm: z
|
|
157
167
|
.string()
|
|
158
168
|
.describe('The search term for the required sample flow (e.g. "setup a new business")'),
|
|
@@ -163,7 +173,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
163
173
|
.max(15)
|
|
164
174
|
.optional()
|
|
165
175
|
.default(5)
|
|
166
|
-
}, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
176
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
167
177
|
try {
|
|
168
178
|
logger.log(`Searching for ${searchTerm} in Wix Sample Flows`);
|
|
169
179
|
const result = await runSemanticSearchAndFormat({
|
|
@@ -204,14 +214,16 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
204
214
|
});
|
|
205
215
|
}
|
|
206
216
|
// SDK Documentation
|
|
207
|
-
if (allowedTools.includes('SDK')
|
|
208
|
-
|
|
217
|
+
if (allowedTools.includes('SDK') &&
|
|
218
|
+
!disableTools?.includes('SearchWixSDKDocumentation')) {
|
|
219
|
+
const defaultSdkDesc = [
|
|
209
220
|
'Searches the official Wix javascript SDK documentation.',
|
|
210
221
|
'Use this tool whenever you need to write or modify Wix related SDK code.',
|
|
211
222
|
"Specify the SDK module, function, or feature you need information about (e.g., 'how to query all items from a data collection?', 'how to use wix-stores-backend', 'authentication methods in the SDK').",
|
|
212
223
|
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
|
|
213
224
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ''
|
|
214
|
-
].join('\n')
|
|
225
|
+
].join('\n');
|
|
226
|
+
server.tool('SearchWixSDKDocumentation', getDescription('SearchWixSDKDocumentation', defaultSdkDesc), {
|
|
215
227
|
searchTerm: z
|
|
216
228
|
.string()
|
|
217
229
|
.describe('The search term to search for in the Wix SDK Documentation'),
|
|
@@ -222,7 +234,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
222
234
|
.max(15)
|
|
223
235
|
.optional()
|
|
224
236
|
.default(5)
|
|
225
|
-
}, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
237
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
226
238
|
try {
|
|
227
239
|
logger.log(`Searching for ${searchTerm} in Wix SDK`);
|
|
228
240
|
panorama
|
|
@@ -269,14 +281,16 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
269
281
|
});
|
|
270
282
|
}
|
|
271
283
|
// Build Apps Documentation
|
|
272
|
-
if (allowedTools.includes('BUILD_APPS')
|
|
273
|
-
|
|
284
|
+
if (allowedTools.includes('BUILD_APPS') &&
|
|
285
|
+
!disableTools?.includes('SearchBuildAppsDocumentation')) {
|
|
286
|
+
const defaultBuildAppsDesc = [
|
|
274
287
|
'Searches the official Build Apps documentation.',
|
|
275
288
|
'Use this tool when you need to understand or implement Wix CLI applications related code.',
|
|
276
289
|
'The search term should be a specific Wix CLI command or specific topic related to Wix CLI applications or its ecosystem (e.g. deployment, creating new extensions etc).',
|
|
277
290
|
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
|
|
278
291
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ''
|
|
279
|
-
].join('\n')
|
|
292
|
+
].join('\n');
|
|
293
|
+
server.tool('SearchBuildAppsDocumentation', getDescription('SearchBuildAppsDocumentation', defaultBuildAppsDesc), {
|
|
280
294
|
searchTerm: z
|
|
281
295
|
.string()
|
|
282
296
|
.describe('The search term to search for in the Build Apps Documentation'),
|
|
@@ -287,7 +301,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
287
301
|
.max(15)
|
|
288
302
|
.optional()
|
|
289
303
|
.default(5)
|
|
290
|
-
}, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
304
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
291
305
|
try {
|
|
292
306
|
logger.log(`Searching for ${searchTerm} in Build Apps`);
|
|
293
307
|
const result = await runSemanticSearchAndFormat({
|
|
@@ -322,14 +336,16 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
322
336
|
});
|
|
323
337
|
}
|
|
324
338
|
// Wix Headless Documentation
|
|
325
|
-
if (allowedTools.includes('WIX_HEADLESS')
|
|
326
|
-
|
|
339
|
+
if (allowedTools.includes('WIX_HEADLESS') &&
|
|
340
|
+
!disableTools?.includes('SearchWixHeadlessDocumentation')) {
|
|
341
|
+
const defaultHeadlessDesc = [
|
|
327
342
|
'Searches the official Wix Headless Documentation.',
|
|
328
343
|
'Use this tool when you need to understand or implement Headless related code.',
|
|
329
344
|
'The search term should be a specific Wix Headless topic or feature you need information about.',
|
|
330
345
|
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
|
|
331
346
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ''
|
|
332
|
-
].join('\n')
|
|
347
|
+
].join('\n');
|
|
348
|
+
server.tool('SearchWixHeadlessDocumentation', getDescription('SearchWixHeadlessDocumentation', defaultHeadlessDesc), {
|
|
333
349
|
searchTerm: z
|
|
334
350
|
.string()
|
|
335
351
|
.describe('The search term to search for in the Headless Documentation'),
|
|
@@ -340,7 +356,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
340
356
|
.max(15)
|
|
341
357
|
.optional()
|
|
342
358
|
.default(5)
|
|
343
|
-
}, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
359
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
344
360
|
try {
|
|
345
361
|
logger.log(`Searching for ${searchTerm} in Headless`);
|
|
346
362
|
const result = await runSemanticSearchAndFormat({
|
|
@@ -375,14 +391,16 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
375
391
|
});
|
|
376
392
|
}
|
|
377
393
|
// Velo Documentation
|
|
378
|
-
if (allowedTools.includes('VELO')
|
|
379
|
-
|
|
394
|
+
if (allowedTools.includes('VELO') &&
|
|
395
|
+
!disableTools?.includes('SearchWixVeloDocumentation')) {
|
|
396
|
+
const defaultVeloDesc = [
|
|
380
397
|
'Searches the official Velo documentation.',
|
|
381
398
|
'Use this tool when you need to understand or implement Velo related code.',
|
|
382
399
|
'The search term should be a specific Velo topic or feature you need information about.',
|
|
383
400
|
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
|
|
384
401
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ''
|
|
385
|
-
].join('\n')
|
|
402
|
+
].join('\n');
|
|
403
|
+
server.tool('SearchWixVeloDocumentation', getDescription('SearchWixVeloDocumentation', defaultVeloDesc), {
|
|
386
404
|
searchTerm: z
|
|
387
405
|
.string()
|
|
388
406
|
.describe('The search term to search for in the Velo Documentation'),
|
|
@@ -393,7 +411,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
393
411
|
.max(15)
|
|
394
412
|
.optional()
|
|
395
413
|
.default(5)
|
|
396
|
-
}, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
414
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ searchTerm, maxResults }, { panorama }) => {
|
|
397
415
|
try {
|
|
398
416
|
logger.log(`Searching for ${searchTerm} in Velo`);
|
|
399
417
|
panorama
|
|
@@ -439,83 +457,89 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
439
457
|
}
|
|
440
458
|
});
|
|
441
459
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
460
|
+
if (!disableTools?.includes('ReadFullDocsArticle')) {
|
|
461
|
+
const defaultReadArticleDesc = [
|
|
462
|
+
'Fetches the full Wix docs article or method article.',
|
|
463
|
+
'Use this tool when you read a summary of a docs article or method article, you have the docs url and want to read the full article.',
|
|
464
|
+
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ''
|
|
465
|
+
].join('\n');
|
|
466
|
+
server.tool('ReadFullDocsArticle', getDescription('ReadFullDocsArticle', defaultReadArticleDesc), {
|
|
467
|
+
articleUrl: z
|
|
468
|
+
.string()
|
|
469
|
+
.url()
|
|
470
|
+
.describe('The URL of the docs article or method article to fetch. Should be something like https://dev.wix.com/docs/.../.../...')
|
|
471
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ articleUrl }, { httpClient }) => {
|
|
472
|
+
try {
|
|
473
|
+
const articleContent = await fetchArticleContent(httpClient, articleUrl, 'article');
|
|
474
|
+
if (!articleContent) {
|
|
475
|
+
throw new Error('Article content is empty');
|
|
476
|
+
}
|
|
477
|
+
return {
|
|
478
|
+
content: [
|
|
479
|
+
{
|
|
480
|
+
type: 'text',
|
|
481
|
+
text: articleContent
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
type: 'text',
|
|
485
|
+
text: [
|
|
486
|
+
'---',
|
|
487
|
+
'Next, if you are dealing with a method - you MUST call ReadFullDocsMethodSchema tool - it will give you the full request schema for the method.'
|
|
488
|
+
].join('\n')
|
|
489
|
+
}
|
|
490
|
+
]
|
|
491
|
+
};
|
|
456
492
|
}
|
|
457
|
-
|
|
458
|
-
content:
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
'Next, if you are dealing with a method - you MUST call ReadFullDocsMethodSchema tool - it will give you the full request schema for the method.'
|
|
468
|
-
].join('\n')
|
|
469
|
-
}
|
|
470
|
-
]
|
|
471
|
-
};
|
|
472
|
-
}
|
|
473
|
-
catch (error) {
|
|
474
|
-
logger.error(`Error fetching article content or method schema for ${articleUrl}: ${error}`);
|
|
475
|
-
return {
|
|
476
|
-
content: [
|
|
477
|
-
{
|
|
478
|
-
type: 'text',
|
|
479
|
-
text: `Could not fetch article content: "${error.message}". You should try completing the task without it.`
|
|
480
|
-
}
|
|
481
|
-
]
|
|
482
|
-
};
|
|
483
|
-
}
|
|
484
|
-
});
|
|
485
|
-
server.tool('ReadFullDocsMethodSchema', [
|
|
486
|
-
'Fetches the full method schema for a given method. Always use it before calling the method.',
|
|
487
|
-
'This will give you the entire request/response schema with all the fields and their descriptions.'
|
|
488
|
-
].join('\n'), {
|
|
489
|
-
articleUrl: z
|
|
490
|
-
.string()
|
|
491
|
-
.url()
|
|
492
|
-
.describe('The URL of the documentation to fetch. Should be something like https://dev.wix.com/docs/.../.../...')
|
|
493
|
-
}, async ({ articleUrl }, { httpClient }) => {
|
|
494
|
-
try {
|
|
495
|
-
const articleContent = await fetchArticleContent(httpClient, articleUrl, 'methodSchema');
|
|
496
|
-
if (!articleContent) {
|
|
497
|
-
throw new Error('Method schema is empty');
|
|
493
|
+
catch (error) {
|
|
494
|
+
logger.error(`Error fetching article content or method schema for ${articleUrl}: ${error}`);
|
|
495
|
+
return {
|
|
496
|
+
content: [
|
|
497
|
+
{
|
|
498
|
+
type: 'text',
|
|
499
|
+
text: `Could not fetch article content: "${error.message}". You should try completing the task without it.`
|
|
500
|
+
}
|
|
501
|
+
]
|
|
502
|
+
};
|
|
498
503
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
if (!disableTools?.includes('ReadFullDocsMethodSchema')) {
|
|
507
|
+
const defaultMethodSchemaDesc = [
|
|
508
|
+
'Fetches the full method schema for a given method. Always use it before calling the method.',
|
|
509
|
+
'This will give you the entire request/response schema with all the fields and their descriptions.'
|
|
510
|
+
].join('\n');
|
|
511
|
+
server.tool('ReadFullDocsMethodSchema', getDescription('ReadFullDocsMethodSchema', defaultMethodSchemaDesc), {
|
|
512
|
+
articleUrl: z
|
|
513
|
+
.string()
|
|
514
|
+
.url()
|
|
515
|
+
.describe('The URL of the documentation to fetch. Should be something like https://dev.wix.com/docs/.../.../...')
|
|
516
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ articleUrl }, { httpClient }) => {
|
|
517
|
+
try {
|
|
518
|
+
const articleContent = await fetchArticleContent(httpClient, articleUrl, 'methodSchema');
|
|
519
|
+
if (!articleContent) {
|
|
520
|
+
throw new Error('Method schema is empty');
|
|
521
|
+
}
|
|
522
|
+
return {
|
|
523
|
+
content: [
|
|
524
|
+
{
|
|
525
|
+
type: 'text',
|
|
526
|
+
text: articleContent
|
|
527
|
+
}
|
|
528
|
+
]
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
catch (error) {
|
|
532
|
+
logger.error(`Error fetching method schema for ${articleUrl}: ${error}`);
|
|
533
|
+
return {
|
|
534
|
+
content: [
|
|
535
|
+
{
|
|
536
|
+
type: 'text',
|
|
537
|
+
text: `Could not fetch method schema: "${error.message}". You should try completing the task without it.`
|
|
538
|
+
}
|
|
539
|
+
]
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
}
|
|
520
544
|
};
|
|
521
545
|
//# sourceMappingURL=docs.js.map
|