@wix/mcp 1.0.74 → 1.0.76
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 +83500 -12272
- package/build/cjs/index.cjs +41 -14
- package/build/cjs/toolkit.cjs +41 -14
- package/build/dts/docs/searchFormatting.d.ts +1 -0
- package/build/dts/docs/searchFormatting.js +49 -14
- package/build/dts/index.d.ts +1 -0
- package/build/dts/index.js +0 -1
- package/build/dts/infra/tool-bi.d.ts +4 -4
- package/build/dts/infra/tool-bi.js +1 -1
- package/build/dts/toolkit-entry.d.cts +410 -0
- package/build/dts/toolkit-entry.d.ts +409 -19
- package/build/dts/toolkit-entry.js +0 -1
- package/build/dts/toolkit-types.d.ts +31 -0
- package/build/dts/toolkit-types.js +12 -0
- package/build/dts/toolkit.d.ts +5 -5
- package/build/esm/index.js +41 -14
- package/build/esm/toolkit.js +41 -14
- package/package.json +26 -19
- package/build/bin-standalone.js.map +0 -7
- package/build/cjs/index.cjs.map +0 -7
- package/build/cjs/toolkit.cjs.map +0 -7
- package/build/dts/api-call/index.d.ts.map +0 -1
- package/build/dts/api-call/index.js.map +0 -1
- package/build/dts/api-call/upload-image-tool.d.ts.map +0 -1
- package/build/dts/api-call/upload-image-tool.js.map +0 -1
- package/build/dts/api-call/upload-image-tool.test.d.ts +0 -2
- package/build/dts/api-call/upload-image-tool.test.d.ts.map +0 -1
- package/build/dts/api-call/upload-image-tool.test.js +0 -217
- package/build/dts/api-call/upload-image-tool.test.js.map +0 -1
- package/build/dts/api-call/upload-image-utils.d.ts.map +0 -1
- package/build/dts/api-call/upload-image-utils.js.map +0 -1
- package/build/dts/api-call/upload-image-utils.test.d.ts +0 -2
- package/build/dts/api-call/upload-image-utils.test.d.ts.map +0 -1
- package/build/dts/api-call/upload-image-utils.test.js +0 -121
- package/build/dts/api-call/upload-image-utils.test.js.map +0 -1
- package/build/dts/api-call/validation.d.ts.map +0 -1
- package/build/dts/api-call/validation.js.map +0 -1
- package/build/dts/api-call/validation.test.d.ts +0 -2
- package/build/dts/api-call/validation.test.d.ts.map +0 -1
- package/build/dts/api-call/validation.test.js +0 -42
- package/build/dts/api-call/validation.test.js.map +0 -1
- package/build/dts/auth/auth-error-handling.test.d.ts +0 -2
- package/build/dts/auth/auth-error-handling.test.d.ts.map +0 -1
- package/build/dts/auth/auth-error-handling.test.js +0 -347
- package/build/dts/auth/auth-error-handling.test.js.map +0 -1
- package/build/dts/auth/index.d.ts.map +0 -1
- package/build/dts/auth/index.js.map +0 -1
- package/build/dts/bin.d.ts.map +0 -1
- package/build/dts/bin.js.map +0 -1
- package/build/dts/cli-tools/account-auth-strategy.d.ts.map +0 -1
- package/build/dts/cli-tools/account-auth-strategy.js.map +0 -1
- package/build/dts/cli-tools/account-token-store.d.ts.map +0 -1
- package/build/dts/cli-tools/account-token-store.js.map +0 -1
- package/build/dts/cli-tools/cli.d.ts.map +0 -1
- package/build/dts/cli-tools/cli.js.map +0 -1
- package/build/dts/cli-tools/utils.d.ts.map +0 -1
- package/build/dts/cli-tools/utils.js.map +0 -1
- package/build/dts/code-mode/index.d.ts.map +0 -1
- package/build/dts/code-mode/index.js.map +0 -1
- package/build/dts/code-mode/index.test.d.ts +0 -2
- package/build/dts/code-mode/index.test.d.ts.map +0 -1
- package/build/dts/code-mode/index.test.js +0 -342
- package/build/dts/code-mode/index.test.js.map +0 -1
- package/build/dts/code-mode/truncate-response.d.ts.map +0 -1
- package/build/dts/code-mode/truncate-response.js.map +0 -1
- package/build/dts/code-mode/truncate-response.test.d.ts +0 -2
- package/build/dts/code-mode/truncate-response.test.d.ts.map +0 -1
- package/build/dts/code-mode/truncate-response.test.js +0 -32
- package/build/dts/code-mode/truncate-response.test.js.map +0 -1
- package/build/dts/code-mode/validation.d.ts.map +0 -1
- package/build/dts/code-mode/validation.js.map +0 -1
- package/build/dts/code-mode/validation.test.d.ts +0 -2
- package/build/dts/code-mode/validation.test.d.ts.map +0 -1
- package/build/dts/code-mode/validation.test.js +0 -72
- package/build/dts/code-mode/validation.test.js.map +0 -1
- package/build/dts/config/default-config.bulk-preference.test.d.ts +0 -2
- package/build/dts/config/default-config.bulk-preference.test.d.ts.map +0 -1
- package/build/dts/config/default-config.bulk-preference.test.js +0 -42
- package/build/dts/config/default-config.bulk-preference.test.js.map +0 -1
- package/build/dts/config/default-config.d.ts.map +0 -1
- package/build/dts/config/default-config.execute-orchestration.test.d.ts +0 -2
- package/build/dts/config/default-config.execute-orchestration.test.d.ts.map +0 -1
- package/build/dts/config/default-config.execute-orchestration.test.js +0 -40
- package/build/dts/config/default-config.execute-orchestration.test.js.map +0 -1
- package/build/dts/config/default-config.js.map +0 -1
- package/build/dts/config/default-config.readme.test.d.ts +0 -2
- package/build/dts/config/default-config.readme.test.d.ts.map +0 -1
- package/build/dts/config/default-config.readme.test.js +0 -84
- package/build/dts/config/default-config.readme.test.js.map +0 -1
- package/build/dts/config/default-config.searchspec-goal.test.d.ts +0 -2
- package/build/dts/config/default-config.searchspec-goal.test.d.ts.map +0 -1
- package/build/dts/config/default-config.searchspec-goal.test.js +0 -30
- package/build/dts/config/default-config.searchspec-goal.test.js.map +0 -1
- package/build/dts/config/param-descriptions.d.ts.map +0 -1
- package/build/dts/config/param-descriptions.js.map +0 -1
- package/build/dts/constants.d.ts.map +0 -1
- package/build/dts/constants.js.map +0 -1
- package/build/dts/docs/browse-menu.d.ts.map +0 -1
- package/build/dts/docs/browse-menu.js.map +0 -1
- package/build/dts/docs/browse-menu.test.d.ts +0 -2
- package/build/dts/docs/browse-menu.test.d.ts.map +0 -1
- package/build/dts/docs/browse-menu.test.js +0 -66
- package/build/dts/docs/browse-menu.test.js.map +0 -1
- package/build/dts/docs/browse-tool.test.d.ts +0 -2
- package/build/dts/docs/browse-tool.test.d.ts.map +0 -1
- package/build/dts/docs/browse-tool.test.js +0 -77
- package/build/dts/docs/browse-tool.test.js.map +0 -1
- package/build/dts/docs/create-site-guide.d.ts.map +0 -1
- package/build/dts/docs/create-site-guide.js.map +0 -1
- package/build/dts/docs/docs.d.ts.map +0 -1
- package/build/dts/docs/docs.js.map +0 -1
- package/build/dts/docs/fetch-article.d.ts.map +0 -1
- package/build/dts/docs/fetch-article.js.map +0 -1
- package/build/dts/docs/fetch-article.test.d.ts +0 -2
- package/build/dts/docs/fetch-article.test.d.ts.map +0 -1
- package/build/dts/docs/fetch-article.test.js +0 -93
- package/build/dts/docs/fetch-article.test.js.map +0 -1
- package/build/dts/docs/fetch-skills.d.ts.map +0 -1
- package/build/dts/docs/fetch-skills.js.map +0 -1
- package/build/dts/docs/fetch-skills.test.d.ts +0 -2
- package/build/dts/docs/fetch-skills.test.d.ts.map +0 -1
- package/build/dts/docs/fetch-skills.test.js +0 -140
- package/build/dts/docs/fetch-skills.test.js.map +0 -1
- package/build/dts/docs/get-to-know.d.ts.map +0 -1
- package/build/dts/docs/get-to-know.js.map +0 -1
- package/build/dts/docs/get-to-know.test.d.ts +0 -2
- package/build/dts/docs/get-to-know.test.d.ts.map +0 -1
- package/build/dts/docs/get-to-know.test.js +0 -152
- package/build/dts/docs/get-to-know.test.js.map +0 -1
- package/build/dts/docs/long-content.d.ts.map +0 -1
- package/build/dts/docs/long-content.js.map +0 -1
- package/build/dts/docs/normalize-menu-content.d.ts.map +0 -1
- package/build/dts/docs/normalize-menu-content.js.map +0 -1
- package/build/dts/docs/searchFormatting.d.ts.map +0 -1
- package/build/dts/docs/searchFormatting.js.map +0 -1
- package/build/dts/docs/searchFormatting.test.d.ts +0 -2
- package/build/dts/docs/searchFormatting.test.d.ts.map +0 -1
- package/build/dts/docs/searchFormatting.test.js +0 -39
- package/build/dts/docs/searchFormatting.test.js.map +0 -1
- package/build/dts/docs/semanticSearch.d.ts.map +0 -1
- package/build/dts/docs/semanticSearch.js.map +0 -1
- package/build/dts/docs/semanticSearch.test.d.ts +0 -2
- package/build/dts/docs/semanticSearch.test.d.ts.map +0 -1
- package/build/dts/docs/semanticSearch.test.js +0 -923
- package/build/dts/docs/semanticSearch.test.js.map +0 -1
- package/build/dts/docs/velo-readme.d.ts.map +0 -1
- package/build/dts/docs/velo-readme.js.map +0 -1
- package/build/dts/import-claude-design-tool/banner.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/banner.js.map +0 -1
- package/build/dts/import-claude-design-tool/constants.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/constants.js.map +0 -1
- package/build/dts/import-claude-design-tool/index.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/index.js.map +0 -1
- package/build/dts/import-claude-design-tool/index.test.d.ts +0 -2
- package/build/dts/import-claude-design-tool/index.test.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/index.test.js +0 -329
- package/build/dts/import-claude-design-tool/index.test.js.map +0 -1
- package/build/dts/import-claude-design-tool/sanitize.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/sanitize.js.map +0 -1
- package/build/dts/import-claude-design-tool/wixstro-client.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/wixstro-client.js.map +0 -1
- package/build/dts/index.d.ts.map +0 -1
- package/build/dts/index.js.map +0 -1
- package/build/dts/infra/bi-logger.d.ts.map +0 -1
- package/build/dts/infra/bi-logger.js.map +0 -1
- package/build/dts/infra/environment.d.ts.map +0 -1
- package/build/dts/infra/environment.js.map +0 -1
- package/build/dts/infra/file-logger.d.ts.map +0 -1
- package/build/dts/infra/file-logger.js.map +0 -1
- package/build/dts/infra/logger.d.ts.map +0 -1
- package/build/dts/infra/logger.js.map +0 -1
- package/build/dts/infra/panorama.d.ts.map +0 -1
- package/build/dts/infra/panorama.js.map +0 -1
- package/build/dts/infra/response-size-limits.d.ts.map +0 -1
- package/build/dts/infra/response-size-limits.js.map +0 -1
- package/build/dts/infra/sentry.d.ts.map +0 -1
- package/build/dts/infra/sentry.js.map +0 -1
- package/build/dts/infra/tool-bi.d.ts.map +0 -1
- package/build/dts/infra/tool-bi.js.map +0 -1
- package/build/dts/infra/widget-payload.d.ts.map +0 -1
- package/build/dts/infra/widget-payload.js.map +0 -1
- package/build/dts/resources/docs.d.ts.map +0 -1
- package/build/dts/resources/docs.js.map +0 -1
- package/build/dts/site-widget-tools/claim-site-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/claim-site-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/constants.d.ts.map +0 -1
- package/build/dts/site-widget-tools/constants.js.map +0 -1
- package/build/dts/site-widget-tools/create-site-from-template-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/create-site-from-template-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/edit-site-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/edit-site-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/index.js.map +0 -1
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/search-site-templates-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/search-site-templates-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.test.d.ts +0 -2
- package/build/dts/site-widget-tools/site-builder-tool/index.test.d.ts.map +0 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.test.js +0 -46
- package/build/dts/site-widget-tools/site-builder-tool/index.test.js.map +0 -1
- package/build/dts/site-widget-tools/site-creation-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/site-creation-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/site-creation-tool/index.test.d.ts +0 -2
- package/build/dts/site-widget-tools/site-creation-tool/index.test.d.ts.map +0 -1
- package/build/dts/site-widget-tools/site-creation-tool/index.test.js +0 -57
- package/build/dts/site-widget-tools/site-creation-tool/index.test.js.map +0 -1
- package/build/dts/site-widget-tools/suggested-domain-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/suggested-domain-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/types.d.ts.map +0 -1
- package/build/dts/site-widget-tools/types.js.map +0 -1
- package/build/dts/site-widget-tools/utils.d.ts.map +0 -1
- package/build/dts/site-widget-tools/utils.js.map +0 -1
- package/build/dts/support/index.d.ts.map +0 -1
- package/build/dts/support/index.js.map +0 -1
- package/build/dts/tool-bi-reporting.test.d.ts +0 -2
- package/build/dts/tool-bi-reporting.test.d.ts.map +0 -1
- package/build/dts/tool-bi-reporting.test.js +0 -219
- package/build/dts/tool-bi-reporting.test.js.map +0 -1
- package/build/dts/tool-utils.d.ts.map +0 -1
- package/build/dts/tool-utils.js.map +0 -1
- package/build/dts/tool-utils.spec.d.ts +0 -2
- package/build/dts/tool-utils.spec.d.ts.map +0 -1
- package/build/dts/tool-utils.spec.js +0 -98
- package/build/dts/tool-utils.spec.js.map +0 -1
- package/build/dts/toolkit-entry.d.ts.map +0 -1
- package/build/dts/toolkit-entry.js.map +0 -1
- package/build/dts/toolkit-json-schema.test.d.ts +0 -2
- package/build/dts/toolkit-json-schema.test.d.ts.map +0 -1
- package/build/dts/toolkit-json-schema.test.js +0 -36
- package/build/dts/toolkit-json-schema.test.js.map +0 -1
- package/build/dts/toolkit.d.ts.map +0 -1
- package/build/dts/toolkit.js.map +0 -1
- package/build/dts/toolkit.test.d.ts +0 -2
- package/build/dts/toolkit.test.d.ts.map +0 -1
- package/build/dts/toolkit.test.js +0 -691
- package/build/dts/toolkit.test.js.map +0 -1
- package/build/dts/widget-manifest.d.ts.map +0 -1
- package/build/dts/widget-manifest.js.map +0 -1
- package/build/dts/wix-fetch-error.d.ts.map +0 -1
- package/build/dts/wix-fetch-error.js.map +0 -1
- package/build/dts/wix-mcp-server.d.ts.map +0 -1
- package/build/dts/wix-mcp-server.js.map +0 -1
- package/build/dts/wixel/api.d.ts.map +0 -1
- package/build/dts/wixel/api.js.map +0 -1
- package/build/dts/wixel/constants.d.ts.map +0 -1
- package/build/dts/wixel/constants.js.map +0 -1
- package/build/dts/wixel/external-agent-api.d.ts.map +0 -1
- package/build/dts/wixel/external-agent-api.js.map +0 -1
- package/build/dts/wixel/get-wixel-asset-tool.d.ts.map +0 -1
- package/build/dts/wixel/get-wixel-asset-tool.js.map +0 -1
- package/build/dts/wixel/get-wixel-job-status-tool.d.ts.map +0 -1
- package/build/dts/wixel/get-wixel-job-status-tool.js.map +0 -1
- package/build/dts/wixel/get-wixel-project-assets-tool.d.ts.map +0 -1
- package/build/dts/wixel/get-wixel-project-assets-tool.js.map +0 -1
- package/build/dts/wixel/index.d.ts.map +0 -1
- package/build/dts/wixel/index.js.map +0 -1
- package/build/dts/wixel/mark-wixel-job-as-fulfilled-tool.d.ts.map +0 -1
- package/build/dts/wixel/mark-wixel-job-as-fulfilled-tool.js.map +0 -1
- package/build/dts/wixel/open-headless-wixel-project-tool.d.ts.map +0 -1
- package/build/dts/wixel/open-headless-wixel-project-tool.js.map +0 -1
- package/build/dts/wixel/pull-headless-wixel-job-tool.d.ts.map +0 -1
- package/build/dts/wixel/pull-headless-wixel-job-tool.js.map +0 -1
- package/build/dts/wixel/update-headless-wixel-job-tool.d.ts.map +0 -1
- package/build/dts/wixel/update-headless-wixel-job-tool.js.map +0 -1
- package/build/dts/wixel/utils.d.ts.map +0 -1
- package/build/dts/wixel/utils.js.map +0 -1
- package/build/dts/wixel/wixel-bi.d.ts.map +0 -1
- package/build/dts/wixel/wixel-bi.js.map +0 -1
- package/build/dts/wixel/wixel-bi.test.d.ts +0 -2
- package/build/dts/wixel/wixel-bi.test.d.ts.map +0 -1
- package/build/dts/wixel/wixel-bi.test.js +0 -35
- package/build/dts/wixel/wixel-bi.test.js.map +0 -1
- package/build/dts/wixel/wixel-session-tools.d.ts.map +0 -1
- package/build/dts/wixel/wixel-session-tools.js.map +0 -1
- package/build/dts/wixel/wixel-session-tools.test.d.ts +0 -2
- package/build/dts/wixel/wixel-session-tools.test.d.ts.map +0 -1
- package/build/dts/wixel/wixel-session-tools.test.js +0 -143
- package/build/dts/wixel/wixel-session-tools.test.js.map +0 -1
- package/build/esm/index.js.map +0 -7
- package/build/esm/toolkit.js.map +0 -7
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Local structural types for the toolkit's public surface.
|
|
5
|
+
*
|
|
6
|
+
* The MCP SDK's `CallToolResult`/`ToolAnnotations` are z.infer projections of
|
|
7
|
+
* large zod schemas; exporting them from the toolkit forces every TS consumer
|
|
8
|
+
* to resolve the SDK's (zod-v4-flavored) declarations. These structural
|
|
9
|
+
* equivalents keep the published `./toolkit` types self-contained — the SDK's
|
|
10
|
+
* actual result objects are assignable to them, so implementations keep
|
|
11
|
+
* returning SDK results unchanged.
|
|
12
|
+
*/
|
|
13
|
+
/** One content block of a tool result (text blocks carry `text`). */
|
|
14
|
+
export type WixToolContentBlock = {
|
|
15
|
+
type: string;
|
|
16
|
+
text?: string;
|
|
17
|
+
} & Record<string, unknown>;
|
|
18
|
+
/** Structural equivalent of the MCP SDK's CallToolResult. */
|
|
19
|
+
export type WixToolCallResult = {
|
|
20
|
+
content: WixToolContentBlock[];
|
|
21
|
+
isError?: boolean;
|
|
22
|
+
structuredContent?: Record<string, unknown>;
|
|
23
|
+
_meta?: Record<string, unknown>;
|
|
24
|
+
} & Record<string, unknown>;
|
|
25
|
+
/** Structural equivalent of the MCP SDK's ToolAnnotations. */
|
|
26
|
+
export type WixToolAnnotations = {
|
|
27
|
+
title?: string;
|
|
28
|
+
readOnlyHint?: boolean;
|
|
29
|
+
destructiveHint?: boolean;
|
|
30
|
+
idempotentHint?: boolean;
|
|
31
|
+
openWorldHint?: boolean;
|
|
32
|
+
} & Record<string, unknown>;
|
|
33
|
+
export interface Logger {
|
|
34
|
+
log(...data: unknown[]): void;
|
|
35
|
+
error(...data: unknown[]): void;
|
|
36
|
+
}
|
|
37
|
+
export declare const attachConsoleLogger: () => void;
|
|
38
|
+
export declare const UNAUTHORIZED_ERROR_NAME = "UnauthorizedError";
|
|
39
|
+
export type McpHeaders = Record<string, string>;
|
|
40
|
+
/**
|
|
41
|
+
* Material the execute runtime needs to obtain a site-scoped token for any site
|
|
42
|
+
* on demand (multi-site ExecuteWixAPI). `oauth` is exchanged for a per-site
|
|
43
|
+
* token via the oauth2/token refresh-grant; `apiKey` works for any site as-is.
|
|
44
|
+
* The oauth refresh token is sensitive: never log it, never expose to sandbox JS.
|
|
45
|
+
*/
|
|
46
|
+
export type SiteAuthContext = {
|
|
47
|
+
type: "oauth";
|
|
48
|
+
clientId: string;
|
|
49
|
+
refreshToken: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: "apiKey";
|
|
52
|
+
accessToken: string;
|
|
53
|
+
};
|
|
54
|
+
export type McpAuthenticationStrategy = {
|
|
55
|
+
/**
|
|
56
|
+
* Call inside the tool callback so it resolves against the session's
|
|
57
|
+
* current handler — the handler can swap mid-session (e.g. anonymous
|
|
58
|
+
* → authenticated after OAuth), so anything resolved at registration
|
|
59
|
+
* time goes stale.
|
|
60
|
+
*/
|
|
61
|
+
isAnonymous?: () => boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Call inside the tool callback so it resolves against the session's
|
|
64
|
+
* current handler — the handler can swap mid-session, so anything
|
|
65
|
+
* resolved at registration time goes stale.
|
|
66
|
+
*/
|
|
67
|
+
getSiteAuthHeaders: (siteId: string) => Promise<McpHeaders> | McpHeaders;
|
|
68
|
+
/**
|
|
69
|
+
* Call inside the tool callback so it resolves against the session's
|
|
70
|
+
* current handler — the handler can swap mid-session, so anything
|
|
71
|
+
* resolved at registration time goes stale.
|
|
72
|
+
*/
|
|
73
|
+
getAccountAuthHeaders: (accountId?: string) => Promise<McpHeaders> | McpHeaders;
|
|
74
|
+
/**
|
|
75
|
+
* Material for the runtime to obtain per-site tokens (multi-site ExecuteWixAPI).
|
|
76
|
+
* Optional: strategies without it fall back to the single-site path. Call
|
|
77
|
+
* before any try/catch so an UnauthorizedError propagates to wrapToolCallback.
|
|
78
|
+
*/
|
|
79
|
+
getSiteAuthContext?: () => Promise<SiteAuthContext> | SiteAuthContext;
|
|
80
|
+
/**
|
|
81
|
+
* Call from a tool's catch block on a Wix API failure. Throws
|
|
82
|
+
* `UnauthorizedError` when the error indicates a revoked upstream session
|
|
83
|
+
* so `wrapToolCallback` surfaces the re-auth signal; returns silently
|
|
84
|
+
* otherwise so the tool's own error handling continues.
|
|
85
|
+
*/
|
|
86
|
+
enforceValidWixToken?: (error: unknown) => Promise<void>;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Re-throws the error if it is an UnauthorizedError.
|
|
90
|
+
*
|
|
91
|
+
* IMPORTANT FOR TOOL AUTHORS: When your tool calls getSiteAuthHeaders() or
|
|
92
|
+
* getAccountAuthHeaders(), prefer making that call BEFORE any try/catch block.
|
|
93
|
+
* This lets UnauthorizedError propagate naturally to wrapToolCallback, which
|
|
94
|
+
* attaches the OAuth metadata needed for anonymous-to-authenticated flow.
|
|
95
|
+
*
|
|
96
|
+
* If the auth call MUST be inside a try/catch (e.g. it's interleaved with
|
|
97
|
+
* other logic), add rethrowIfUnauthorized(error) as the first line of your
|
|
98
|
+
* catch block to ensure the error still propagates.
|
|
99
|
+
*/
|
|
100
|
+
export declare function rethrowIfUnauthorized(error: unknown): void;
|
|
101
|
+
declare const VALID_DOCS_TOOLS: readonly [
|
|
102
|
+
"WDS",
|
|
103
|
+
"REST",
|
|
104
|
+
"SDK",
|
|
105
|
+
"BUILD_APPS",
|
|
106
|
+
"WIX_HEADLESS",
|
|
107
|
+
"VELO",
|
|
108
|
+
"BUSINESS_SOLUTIONS",
|
|
109
|
+
"CLI",
|
|
110
|
+
"OVERVIEW"
|
|
111
|
+
];
|
|
112
|
+
export type DocsTool = (typeof VALID_DOCS_TOOLS)[number];
|
|
113
|
+
/**
|
|
114
|
+
* Configuration for a README doc entry
|
|
115
|
+
*/
|
|
116
|
+
export interface ReadmeDocConfig {
|
|
117
|
+
url?: string;
|
|
118
|
+
action: "include" | "index" | "text" | "api";
|
|
119
|
+
title?: string;
|
|
120
|
+
description?: string;
|
|
121
|
+
content?: string;
|
|
122
|
+
/** HTTP method for API calls (only used when action is 'api'). Defaults to 'GET' */
|
|
123
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
124
|
+
/** Request body for API calls (only used when action is 'api' with POST/PUT/PATCH) */
|
|
125
|
+
body?: Record<string, unknown>;
|
|
126
|
+
}
|
|
127
|
+
export interface DocsToolsOptions {
|
|
128
|
+
getToKnowWixEnabled?: boolean;
|
|
129
|
+
createWixBusinessGuideEnabled?: boolean;
|
|
130
|
+
disableTools?: string[];
|
|
131
|
+
/** Custom descriptions for tools, keyed by tool name */
|
|
132
|
+
toolDescriptions?: Record<string, string>;
|
|
133
|
+
/** Custom list of docs that compose the WixREADME tool output */
|
|
134
|
+
readmeDocs?: ReadmeDocConfig[];
|
|
135
|
+
/** Authentication strategy for API calls (required if using 'api' action in readmeDocs) */
|
|
136
|
+
authStrategy?: McpAuthenticationStrategy;
|
|
137
|
+
/** Override base URL for skills docs (e.g., "http://localhost:4000" for local dev) */
|
|
138
|
+
skillsPortalUrl?: string;
|
|
139
|
+
/** GitHub repo (e.g. "wix-private/docs") to fetch skill overrides from a PR */
|
|
140
|
+
skillsRepo?: string;
|
|
141
|
+
/** GitHub repo (e.g. "wix-private/docs") to fetch skill overrides from. Preferred alias for `skillsRepo`; takes precedence when both are supplied. */
|
|
142
|
+
repo?: string;
|
|
143
|
+
/** PR number to fetch skill content overrides from */
|
|
144
|
+
skillsPr?: string;
|
|
145
|
+
/** Commit hash to fetch content overrides from. Preferred alias for `skillsPr`; takes precedence when both are supplied. */
|
|
146
|
+
commitHash?: string;
|
|
147
|
+
/** Tags to filter skills by (e.g. ['velo', 'cms']) */
|
|
148
|
+
skillsTags?: string[];
|
|
149
|
+
/** Enable dynamic context fetch */
|
|
150
|
+
dynamicContextEnabled?: boolean;
|
|
151
|
+
/** Enable partner context section in dynamic context output */
|
|
152
|
+
partnerContextEnabled?: boolean;
|
|
153
|
+
/** Whether the client is a CLI environment (e.g. Claude Code) where users can run terminal commands.
|
|
154
|
+
* Accepts a boolean or a function for lazy evaluation (useful when client name is only known after MCP init). */
|
|
155
|
+
cliEnabled?: boolean | (() => boolean);
|
|
156
|
+
/** Use the new platformized semantic search API (POST /v1/docs/search) instead of the legacy GET endpoint */
|
|
157
|
+
usePlatformizedSearch?: boolean;
|
|
158
|
+
/** Use the platformized menu browse API (POST /v1/docs/menu/browse) instead of scraping the legacy get-menu-content markdown. Falls back to legacy on transport errors. */
|
|
159
|
+
usePlatformizedBrowse?: boolean;
|
|
160
|
+
}
|
|
161
|
+
export interface ToolHintsConfig {
|
|
162
|
+
readOnlyHint?: boolean;
|
|
163
|
+
destructiveHint?: boolean;
|
|
164
|
+
openWorldHint?: boolean;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Safely extract all text content from a WixToolCallResult.
|
|
168
|
+
* Filters out non-text content blocks (images, audio, resources)
|
|
169
|
+
* and concatenates text blocks with newlines.
|
|
170
|
+
*/
|
|
171
|
+
export declare function extractText(result: WixToolCallResult): string;
|
|
172
|
+
export declare function formatToolResultAdditionalFields(result: WixToolCallResult): string | undefined;
|
|
173
|
+
/** A single tool extracted from @wix/mcp, ready to execute. */
|
|
174
|
+
export interface WixTool {
|
|
175
|
+
/** Tool name (e.g. 'CallWixSiteAPI', 'SearchWixRESTDocumentation') */
|
|
176
|
+
name: string;
|
|
177
|
+
/** Tool description for the LLM */
|
|
178
|
+
description: string;
|
|
179
|
+
/** Zod schema for tool input parameters */
|
|
180
|
+
inputSchema: z.ZodObject<any>;
|
|
181
|
+
/**
|
|
182
|
+
* JSON Schema for tool input parameters — for consumers that speak JSON
|
|
183
|
+
* Schema rather than Zod (WebMCP's `document.modelContext`, OpenAI tool
|
|
184
|
+
* definitions, etc.). Computed lazily from `inputSchema` on first access;
|
|
185
|
+
* `$ref`s are inlined so the object is self-contained.
|
|
186
|
+
*/
|
|
187
|
+
readonly inputJsonSchema: Record<string, unknown>;
|
|
188
|
+
/** MCP tool annotations (readOnlyHint, destructiveHint, etc.) */
|
|
189
|
+
annotations?: WixToolAnnotations;
|
|
190
|
+
/** Execute the tool with the given arguments. Returns native MCP WixToolCallResult. */
|
|
191
|
+
execute(args: Record<string, any>): Promise<WixToolCallResult>;
|
|
192
|
+
}
|
|
193
|
+
/** The toolkit object returned by createWixToolkit. */
|
|
194
|
+
export interface WixToolkit {
|
|
195
|
+
/** All registered tools as plain objects */
|
|
196
|
+
getTools(): WixTool[];
|
|
197
|
+
/** Get a single tool by name */
|
|
198
|
+
getTool(name: string): WixTool | undefined;
|
|
199
|
+
/** Just the tool names */
|
|
200
|
+
getToolNames(): string[];
|
|
201
|
+
/** Pre-load WixREADME content (calls the WixREADME tool internally).
|
|
202
|
+
* Site context is resolved from `defaults` passed to createWixToolkit. */
|
|
203
|
+
preloadReadme(): Promise<string | null>;
|
|
204
|
+
/** Pre-load dynamic context (site info, installed apps, etc.).
|
|
205
|
+
* Site context is resolved from `defaults` passed to createWixToolkit. */
|
|
206
|
+
preloadDynamicContext(): Promise<string | null>;
|
|
207
|
+
}
|
|
208
|
+
/** Lifecycle hooks for consumer-side observability. */
|
|
209
|
+
export interface WixToolkitHooks {
|
|
210
|
+
/** Called before a tool callback is invoked */
|
|
211
|
+
beforeExecute?: (toolName: string, args: Record<string, any>) => void;
|
|
212
|
+
/** Called after a tool callback returns (success or isError) */
|
|
213
|
+
afterExecute?: (toolName: string, result: WixToolCallResult, durationMs: number) => void;
|
|
214
|
+
/** Called when a tool callback throws an exception */
|
|
215
|
+
onError?: (toolName: string, error: Error, durationMs: number) => void;
|
|
216
|
+
}
|
|
217
|
+
/** Auth configuration -- either a full McpAuthenticationStrategy or token functions. */
|
|
218
|
+
export type WixToolkitAuth = McpAuthenticationStrategy | {
|
|
219
|
+
siteToken: (siteId: string) => Promise<McpHeaders> | McpHeaders;
|
|
220
|
+
accountToken: () => Promise<McpHeaders> | McpHeaders;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Docs tools configuration.
|
|
224
|
+
*
|
|
225
|
+
* Note: `WixREADME` and `GetSiteContext` register only when
|
|
226
|
+
* `getToKnowWixEnabled: true` is set here — it defaults to false and is
|
|
227
|
+
* independent of `readmeDocs` and of which API tools are requested.
|
|
228
|
+
*/
|
|
229
|
+
export interface WixToolkitDocsConfig extends DocsToolsOptions {
|
|
230
|
+
/** Which doc sources to register (default: all) */
|
|
231
|
+
tools?: DocsTool[];
|
|
232
|
+
}
|
|
233
|
+
/** API tools configuration. */
|
|
234
|
+
export interface WixToolkitApiConfig {
|
|
235
|
+
/** Which API tools to register (default: all three) */
|
|
236
|
+
tools?: string[];
|
|
237
|
+
/** Disable specific tools by name */
|
|
238
|
+
disableTools?: string[];
|
|
239
|
+
/** Enable additional tools */
|
|
240
|
+
enableTools?: string[];
|
|
241
|
+
/** Custom descriptions per tool */
|
|
242
|
+
toolDescriptions?: Record<string, string>;
|
|
243
|
+
/** Tool hint overrides */
|
|
244
|
+
toolHints?: Record<string, ToolHintsConfig>;
|
|
245
|
+
/**
|
|
246
|
+
* Max response size in chars before truncation. Applies to CallWixSiteAPI/
|
|
247
|
+
* ListWixSites/ManageWixSite (default: 50,000) and to ExecuteWixAPI/
|
|
248
|
+
* SearchWixAPISpec (default: 24,000). Always clamped to a hard ceiling
|
|
249
|
+
* regardless of what's requested here — see MAX_ALLOWED_RESPONSE_CHARS.
|
|
250
|
+
*/
|
|
251
|
+
maxResponseSize?: number;
|
|
252
|
+
/** Base URL for code-mode tools such as ExecuteWixAPI */
|
|
253
|
+
codeModeBaseUrl?: string;
|
|
254
|
+
}
|
|
255
|
+
/** Options for createWixToolkit. */
|
|
256
|
+
export interface WixToolkitOptions {
|
|
257
|
+
/** Authentication -- required for API call tools */
|
|
258
|
+
auth: WixToolkitAuth;
|
|
259
|
+
/** Docs tools configuration */
|
|
260
|
+
docs?: WixToolkitDocsConfig;
|
|
261
|
+
/** API tools configuration */
|
|
262
|
+
api?: WixToolkitApiConfig;
|
|
263
|
+
/**
|
|
264
|
+
* Default values to inject at execute time.
|
|
265
|
+
* Fields listed here are removed from the tool's inputSchema and
|
|
266
|
+
* automatically merged into args when execute() is called.
|
|
267
|
+
*
|
|
268
|
+
* Common use: `defaults: { siteId: 'my-site-id' }` to hide siteId from
|
|
269
|
+
* the LLM's schema and auto-inject it on every tool execution.
|
|
270
|
+
*/
|
|
271
|
+
defaults?: Record<string, any>;
|
|
272
|
+
/** Tool names to exclude after registration */
|
|
273
|
+
exclude?: string[];
|
|
274
|
+
/** Consumer name -- shows up in BI events for tracking usage per consumer */
|
|
275
|
+
clientName?: string;
|
|
276
|
+
/**
|
|
277
|
+
* Environment name (DEV/TEST/LOCAL/REMOTE/PICASSO/VISITOR_MCP). Defaults to
|
|
278
|
+
* `process.env.NODE_ENV` where a `process` global exists; pass explicitly in
|
|
279
|
+
* browsers. Unknown/absent values resolve to LOCAL (telemetry on).
|
|
280
|
+
*/
|
|
281
|
+
nodeEnv?: string;
|
|
282
|
+
/** Consumer-side observability hooks (separate from library Panorama/BI telemetry) */
|
|
283
|
+
hooks?: WixToolkitHooks;
|
|
284
|
+
/** Conversation ID — passed to BI events for tracking */
|
|
285
|
+
conversationId?: string;
|
|
286
|
+
/**
|
|
287
|
+
* Keep WixREADME mentions in tool descriptions. Defaults to `false` (mentions
|
|
288
|
+
* scrubbed, for consumers that don't expose WixREADME); set `true` for the live
|
|
289
|
+
* MCP server's text. Only affects description text — never the tool set itself.
|
|
290
|
+
*/
|
|
291
|
+
includeReadmeMentions?: boolean;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Create a WixToolkit that provides pre-wired tool objects for in-process use.
|
|
295
|
+
*
|
|
296
|
+
* This is the recommended way to use @wix/mcp tools outside of a full MCP server.
|
|
297
|
+
* It handles tool registration, context building, Panorama/BI telemetry, and
|
|
298
|
+
* schema manipulation (defaults) internally.
|
|
299
|
+
*/
|
|
300
|
+
export declare function createWixToolkit(options: WixToolkitOptions): WixToolkit;
|
|
301
|
+
export declare class WixFetchError extends Error {
|
|
302
|
+
readonly status: number;
|
|
303
|
+
readonly response: {
|
|
304
|
+
status: number;
|
|
305
|
+
data: string;
|
|
306
|
+
};
|
|
307
|
+
constructor(status: number, statusText: string, body: string);
|
|
308
|
+
}
|
|
309
|
+
export declare const EXECUTE_FUNCTION_EXPRESSION_HINT: string;
|
|
310
|
+
export interface CodeValidationResult {
|
|
311
|
+
isValid: boolean;
|
|
312
|
+
error?: string;
|
|
313
|
+
}
|
|
314
|
+
export declare function validateExecuteCode(code: string): CodeValidationResult;
|
|
315
|
+
/** URL for the management recipes index article */
|
|
316
|
+
export declare const RECIPES_INDEX_URL = "https://dev.wix.com/docs/api-reference/articles/ai-tools/wix-mcp/skills/wix-management-recipes-index";
|
|
317
|
+
/**
|
|
318
|
+
* Fetch the management recipes index content from the public rawdocs API.
|
|
319
|
+
* Returns the recipes index as a string (markdown).
|
|
320
|
+
*
|
|
321
|
+
* No authentication required -- creates its own HttpClient.
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
* ```typescript
|
|
325
|
+
* import { fetchRecipesIndex } from '@wix/mcp';
|
|
326
|
+
*
|
|
327
|
+
* const recipes = await fetchRecipesIndex();
|
|
328
|
+
* console.log(recipes);
|
|
329
|
+
* ```
|
|
330
|
+
*/
|
|
331
|
+
export declare function fetchRecipesIndex(): Promise<string>;
|
|
332
|
+
/**
|
|
333
|
+
* Fetch any Wix documentation article by its URL.
|
|
334
|
+
* Returns the article content as a string (markdown).
|
|
335
|
+
*
|
|
336
|
+
* No authentication required -- creates its own HttpClient.
|
|
337
|
+
*
|
|
338
|
+
* @param articleUrl - Full URL to a dev.wix.com docs article
|
|
339
|
+
*
|
|
340
|
+
* @example
|
|
341
|
+
* ```typescript
|
|
342
|
+
* import { fetchArticle } from '@wix/mcp';
|
|
343
|
+
*
|
|
344
|
+
* const article = await fetchArticle(
|
|
345
|
+
* 'https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/products/query-products'
|
|
346
|
+
* );
|
|
347
|
+
* console.log(article);
|
|
348
|
+
* ```
|
|
349
|
+
*/
|
|
350
|
+
export declare function fetchArticle(articleUrl: string): Promise<string>;
|
|
351
|
+
interface ReadmeDocConfig$1 {
|
|
352
|
+
url?: string;
|
|
353
|
+
action: "include" | "index" | "text" | "api";
|
|
354
|
+
title?: string;
|
|
355
|
+
description?: string;
|
|
356
|
+
content?: string;
|
|
357
|
+
/** HTTP method for API calls (only used when action is 'api'). Defaults to 'GET' */
|
|
358
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
359
|
+
/** Request body for API calls (only used when action is 'api' with POST/PUT/PATCH) */
|
|
360
|
+
body?: Record<string, unknown>;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Configuration structure for MCP modes
|
|
364
|
+
*/
|
|
365
|
+
export interface ModeDefaultConfig {
|
|
366
|
+
toolDescriptions: Record<string, string>;
|
|
367
|
+
disableTools: string[];
|
|
368
|
+
enableTools: string[];
|
|
369
|
+
readmeDocs: ReadmeDocConfig$1[];
|
|
370
|
+
toolHints?: Record<string, ToolHintsConfig>;
|
|
371
|
+
docsTools?: DocsTool[];
|
|
372
|
+
getToKnowWixEnabled?: boolean;
|
|
373
|
+
createWixBusinessGuideEnabled?: boolean;
|
|
374
|
+
codeModeEnabled?: boolean;
|
|
375
|
+
maxResponseSize?: number;
|
|
376
|
+
dynamicContextEnabled?: boolean;
|
|
377
|
+
partnerContextEnabled?: boolean;
|
|
378
|
+
usePlatformizedSearch?: boolean;
|
|
379
|
+
skillsPrOverrideEnabled?: boolean;
|
|
380
|
+
}
|
|
381
|
+
export declare const SYSTEM_REMINDER_GUIDELINES: string;
|
|
382
|
+
export declare const SYSTEM_REMINDER: string;
|
|
383
|
+
/**
|
|
384
|
+
* Canonical (README-inclusive) tool descriptions used by the live MCP server and
|
|
385
|
+
* all existing importers.
|
|
386
|
+
*/
|
|
387
|
+
export declare const defaultToolDescriptions: Record<string, string>;
|
|
388
|
+
export declare const executeCodeModeToolDescriptions: Record<string, string>;
|
|
389
|
+
/**
|
|
390
|
+
* Default readme docs - content for WixREADME tool response.
|
|
391
|
+
* Assumes both ExecuteWixAPI and SearchWixAPISpec are available (execute-and-search mode).
|
|
392
|
+
*
|
|
393
|
+
* Joined rather than interpolated into one `dedent` — `dedent` reads indentation from the literal
|
|
394
|
+
* parts only, so a multi-line interpolation gets flattened.
|
|
395
|
+
*/
|
|
396
|
+
export declare const defaultReadmeDocs: ReadmeDocConfig$1[];
|
|
397
|
+
/**
|
|
398
|
+
* Merge base config with overrides
|
|
399
|
+
* @param base - Base configuration
|
|
400
|
+
* @param overrides - Partial overrides to apply
|
|
401
|
+
* @returns Merged configuration
|
|
402
|
+
*/
|
|
403
|
+
export declare function mergeConfig(base: ModeDefaultConfig, overrides: Partial<ModeDefaultConfig>): ModeDefaultConfig;
|
|
404
|
+
/**
|
|
405
|
+
* Default config - used by both /mcp and /v2 endpoints
|
|
406
|
+
* All tools enabled, all descriptions, good readmeDocs
|
|
407
|
+
*/
|
|
408
|
+
export declare const defaultConfig: ModeDefaultConfig;
|
|
409
|
+
|
|
410
|
+
export {};
|