@wix/mcp 1.0.93 → 1.0.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +2 -2
  2. package/build/bin-standalone.js +1200 -455
  3. package/build/cjs/index.cjs +3237 -1264
  4. package/build/cjs/toolkit.cjs +2177 -469
  5. package/build/dts/api-call/headless-release.d.ts +56 -0
  6. package/build/dts/api-call/headless-release.js +135 -0
  7. package/build/dts/api-call/index.d.ts +9 -1
  8. package/build/dts/api-call/index.js +19 -10
  9. package/build/dts/api-call/site-files.d.ts +42 -0
  10. package/build/dts/api-call/site-files.js +290 -0
  11. package/build/dts/api-call/upload-headless-website-files.d.ts +118 -0
  12. package/build/dts/api-call/upload-headless-website-files.js +624 -0
  13. package/build/dts/api-call/upload-image-tool.d.ts +2 -0
  14. package/build/dts/api-call/upload-image-tool.js +8 -4
  15. package/build/dts/bin.d.ts +1 -1
  16. package/build/dts/bin.js +4 -5
  17. package/build/dts/code-mode/attachments.js +1 -1
  18. package/build/dts/code-mode/index.d.ts +6 -1
  19. package/build/dts/code-mode/index.js +47 -13
  20. package/build/dts/code-mode/truncate-response.js +5 -1
  21. package/build/dts/config/default-config.d.ts +35 -9
  22. package/build/dts/config/default-config.js +348 -207
  23. package/build/dts/config/file-params.d.ts +22 -0
  24. package/build/dts/config/file-params.js +24 -0
  25. package/build/dts/config/param-descriptions.d.ts +14 -2
  26. package/build/dts/config/param-descriptions.js +34 -15
  27. package/build/dts/constants.d.ts +1 -0
  28. package/build/dts/constants.js +1 -0
  29. package/build/dts/docs/docs.d.ts +16 -3
  30. package/build/dts/docs/docs.js +211 -39
  31. package/build/dts/docs/fetch-article.d.ts +21 -0
  32. package/build/dts/docs/fetch-article.js +70 -5
  33. package/build/dts/docs/get-to-know.d.ts +7 -2
  34. package/build/dts/docs/get-to-know.js +37 -15
  35. package/build/dts/docs/mintlify-docs.d.ts +121 -0
  36. package/build/dts/docs/mintlify-docs.js +391 -0
  37. package/build/dts/docs/semanticSearch.d.ts +2 -1
  38. package/build/dts/docs/semanticSearch.js +14 -7
  39. package/build/dts/docs/start-deploy-website.d.ts +7 -6
  40. package/build/dts/docs/start-deploy-website.js +13 -8
  41. package/build/dts/docs/start-headless-build.d.ts +17 -0
  42. package/build/dts/docs/start-headless-build.js +60 -0
  43. package/build/dts/graphql/index.js +3 -1
  44. package/build/dts/import-claude-design-tool/index.js +2 -2
  45. package/build/dts/index.d.ts +3 -2
  46. package/build/dts/index.js +3 -2
  47. package/build/dts/infra/redact-personal-data.d.ts +4 -0
  48. package/build/dts/infra/redact-personal-data.js +79 -0
  49. package/build/dts/site-widget-tools/constants.d.ts +49 -1
  50. package/build/dts/site-widget-tools/constants.js +64 -7
  51. package/build/dts/site-widget-tools/index.d.ts +1 -0
  52. package/build/dts/site-widget-tools/index.js +1 -0
  53. package/build/dts/site-widget-tools/pick-images-tool/index.d.ts +14 -0
  54. package/build/dts/site-widget-tools/pick-images-tool/index.js +138 -0
  55. package/build/dts/site-widget-tools/search-site-templates-tool/index.js +33 -9
  56. package/build/dts/site-widget-tools/site-builder-tool/index.js +22 -2
  57. package/build/dts/site-widget-tools/site-creation-tool/index.d.ts +7 -1
  58. package/build/dts/site-widget-tools/site-creation-tool/index.js +22 -51
  59. package/build/dts/site-widget-tools/suggested-domain-tool/index.js +6 -3
  60. package/build/dts/support/index.d.ts +4 -0
  61. package/build/dts/support/index.js +13 -7
  62. package/build/dts/toolkit-entry.d.cts +19 -12
  63. package/build/dts/toolkit-entry.d.ts +19 -12
  64. package/build/dts/toolkit.d.ts +2 -2
  65. package/build/dts/toolkit.js +23 -7
  66. package/build/dts/wix-mcp-server.d.ts +11 -0
  67. package/build/dts/wix-mcp-server.js +28 -6
  68. package/build/dts/wixel/constants.d.ts +8 -1
  69. package/build/dts/wixel/constants.js +8 -1
  70. package/build/dts/wixel/index.d.ts +1 -1
  71. package/build/dts/wixel/index.js +2 -2
  72. package/build/dts/wixel/wixel-a2a-client.d.ts +83 -0
  73. package/build/dts/wixel/wixel-a2a-client.js +166 -0
  74. package/build/dts/wixel/wixel-bi.d.ts +2 -1
  75. package/build/dts/wixel/wixel-bi.js +2 -1
  76. package/build/dts/wixel/{external-agent-api.d.ts → wixel-session-entries.d.ts} +11 -33
  77. package/build/dts/wixel/{external-agent-api.js → wixel-session-entries.js} +33 -54
  78. package/build/dts/wixel/wixel-session-tools.d.ts +21 -26
  79. package/build/dts/wixel/wixel-session-tools.js +494 -599
  80. package/build/esm/index.js +3335 -1376
  81. package/build/esm/toolkit.js +2273 -565
  82. package/package.json +4 -4
  83. package/build/dts/docs/create-site-guide.d.ts +0 -3
  84. package/build/dts/docs/create-site-guide.js +0 -109
@@ -0,0 +1,118 @@
1
+ import { type SiteFile } from './site-files.js';
2
+ import { WixMcpServer } from '../wix-mcp-server.js';
3
+ import { type McpAuthenticationStrategy } from '../auth/index.js';
4
+ export declare const UPLOAD_HEADLESS_WEBSITE_FILES_TOOL_NAME = "UploadHeadlessWebsiteFiles";
5
+ /** The largest site zip `bundle-upload-url` presigns (headless-business-setup's MAX_BUNDLE_BYTES). */
6
+ export declare const MAX_BUNDLE_BYTES: number;
7
+ /**
8
+ * Attribution the drop endpoint stamps on its upload BI event (`source` from
9
+ * `campaign`, `agent` from `agent`, both ≤ 64 chars) — the same parser as the
10
+ * anonymous route, and what the headless Drop dashboard keys its "MCP API"
11
+ * entry point on. `agent` is the MCP client's name as a lowercase slug.
12
+ */
13
+ export declare function dropAttribution(clientName?: string): string;
14
+ export interface UploadHeadlessWebsiteFilesOptions {
15
+ authStrategy: McpAuthenticationStrategy;
16
+ toolDescriptions?: Record<string, string>;
17
+ /** Test seam; defaults to the global fetch. */
18
+ fetchImpl?: typeof fetch;
19
+ /** Client identity for drop attribution when the server cannot tell (the toolkit's configured name). */
20
+ clientName?: string;
21
+ }
22
+ export declare const UPLOAD_HEADLESS_WEBSITE_FILES_PARAM_DESCRIPTIONS: {
23
+ readonly files: "The site files as text, so file bytes never pass through a code string. Sections delimited by a line `=== FILE: <path> ===` (text, raw) or `=== FILE: <path> base64 ===` (binary, base64); `<path>` is relative to the site root; a static site must include `index.html`. Use base64 for small binaries (icons, logos, fonts); large images/video belong behind a URL in the HTML, not in the bundle. Optional when `attachments` carries the files. A Wix Astro build (`.wix/build-metadata.json` and `dist/` as `astro build` with the Wix hosting adapter wrote them, zipped from the project root) needs no `index.html`: it is released to the site's Wix hosting instead of dropped, and the project's other files in the upload are stored as its source when the site's repository accepts it.";
24
+ readonly attachments: string;
25
+ readonly prepare: "Phase one of the two-call upload of a Wix Astro build, for a shell that reaches the internet and no file handle (a sandbox whose network is limited to a few hosts cannot upload to the URLs): zip the build first, then `true` with its `size` returns presigned upload URLs for the build zip and, when the site's repository takes it, the project source zip, as `curl` commands to run verbatim, with the exact second call. The two calls: {siteId, prepare: true, size}, then {siteId, uploadKey, sourceUploadId?, expectedHeadRevisionId?, releaseNotes?}. No `files`, `attachments`, `uploadKey` or `sourceUploadId` on the first; `expectedHeadRevisionId` and `releaseNotes` given on the first are echoed into the second. Not for a static site: send its files in `files` or `attachments`, or drop them as the StartDeployWebsite recipe shows.";
26
+ readonly size: "Phase one, with `prepare: true` only, and required there: the build zip's length in bytes (`wc -c < build.zip`), 1 to 104857600 (100 MB). The upload URL takes a body of exactly this length; a zip changed after the prepare needs a new prepare.";
27
+ readonly uploadKey: "Phase two of the two-call upload: the `uploadKey` the `prepare` call returned, after the build zip was PUT to its URL. Releases that build to the site: {siteId, uploadKey, sourceUploadId?, expectedHeadRevisionId?, releaseNotes?}. Excludes `files` and `attachments`.";
28
+ readonly sourceUploadId: "Phase two: the `sourceUploadId` the `prepare` call returned, after the source zip was PUT to its URL. Stores the project source with the release. Needs `uploadKey`; leave it out when the prepare returned no source upload.";
29
+ readonly expectedHeadRevisionId: "The repository revision your project started from, so the source replaces only that and a commit made since (another chat, a Dev Machine) is never dropped unseen: the revision you downloaded the project at; for a project started here, the `headRevisionId` the `prepare` call returned. Leave it out only for a repository with nothing in it yet. Goes with `uploadKey`, or with `files`/`attachments` holding a build.";
30
+ readonly releaseNotes: "Optional: one line on what this release changes, at most 200 characters, kept with the deployment of a Wix Astro build, whether it comes in `files`/`attachments` or as the second call with `uploadKey` (given on the `prepare` call it is echoed into the second). A static drop keeps no notes.";
31
+ readonly siteId: "The metaSiteId of the Wix Headless site to upload into: the one returned by the provision call of the StartDeployWebsite recipe for a new site, or of a site deployed earlier to replace its files. Every upload replaces the whole file set, so send all files; the URL stays the same. A build released here replaces static pages dropped earlier, at the same URL.";
32
+ readonly calledStartDeployWebsite: "Whether you called StartDeployWebsite earlier in this conversation and are following the recipe it returned. Answer truthfully; it is recorded, not checked.";
33
+ readonly agentIdentity: "Which agent or product you are, which model if you know it, and the harness you run in. No personal data: no names, emails, phones, passwords, keys or local paths.";
34
+ readonly reason: "One sentence: the user request that led here and what is being published. No personal data: no names, emails, phones, passwords, keys or local paths.";
35
+ };
36
+ export interface DropResult {
37
+ metaSiteId: string;
38
+ siteUrl?: string;
39
+ uploadId?: string;
40
+ files: string[];
41
+ }
42
+ export declare function formatDropResult(r: DropResult): string;
43
+ /** One presigned PUT: where the zip goes and the headers the storage requires on it. */
44
+ interface PresignedPut {
45
+ putUrl: string;
46
+ headers?: Record<string, string>;
47
+ expiresAt?: string;
48
+ }
49
+ /** `POST /{siteId}/bundle-upload-url`: the site half, plus the Code Store half when the site has a source repository. */
50
+ export interface BundleUploadUrls extends PresignedPut {
51
+ uploadKey: string;
52
+ source?: PresignedPut & {
53
+ uploadId: string;
54
+ headRevisionId?: string;
55
+ };
56
+ }
57
+ /** `POST /{siteId}/release-bundle`. */
58
+ /**
59
+ * What the tool BI event records about an upload, beside the result text: the path it
60
+ * took (`drop` static pages, `build` an attached Astro build over the bundle routes,
61
+ * `prepare` and `release-bundle` the two calls) and whether the source was stored.
62
+ */
63
+ export interface UploadBiFields {
64
+ path: 'drop' | 'build' | 'prepare' | 'release-bundle';
65
+ sourceOffered?: boolean;
66
+ sourceStored?: boolean;
67
+ sourceFiles?: number;
68
+ emptyStaticsDropped?: number;
69
+ files?: number;
70
+ }
71
+ export interface BundleReleaseResult {
72
+ deploymentId?: string;
73
+ siteUrl?: string;
74
+ revision?: {
75
+ id?: string;
76
+ };
77
+ }
78
+ /** The prepare reply: what the agent runs, verbatim, and the exact second call. */
79
+ export declare function formatPrepareResult(siteId: string, urls: BundleUploadUrls, size?: number, given?: {
80
+ expectedHeadRevisionId?: string;
81
+ releaseNotes?: string;
82
+ }): string;
83
+ /** The release-bundle reply, for both the two-call form and a build uploaded as files. */
84
+ export declare function formatBundleReleaseResult(siteId: string, r: BundleReleaseResult, notes?: string[]): string;
85
+ /**
86
+ * How the agent starts over: in the two-call form a new `prepare`, after a build
87
+ * uploaded as files the same call again (the tool asks for new URLs itself).
88
+ */
89
+ export type BundleRetry = 'prepare' | 'resend';
90
+ /** The bundle-upload-url route's errors, as the agent should act on them. */
91
+ export declare function describeBundleUploadUrlError(err: unknown): string;
92
+ /** The deployment label the service keeps is 200 characters; longer notes are cut, not refused. */
93
+ export declare const RELEASE_NOTES_MAX_CHARS = 200;
94
+ export declare function releaseNotesForService(notes: string): string;
95
+ /** The release-bundle route's errors, as the agent should act on them. */
96
+ export declare function describeBundleReleaseError(err: unknown, uploadKey: string, retry?: BundleRetry): string;
97
+ /**
98
+ * A build that came as files, released over the bundle routes: an upload URL for the
99
+ * site zip's size, the zip PUT there, the source zip PUT to the repository's URL when
100
+ * the service offered one and the upload holds source files, then the release with
101
+ * the ids. `onStaged` hears the uploadKey once the site zip is staged.
102
+ */
103
+ export declare function releaseBuildByUrl(o: {
104
+ siteId: string;
105
+ siteZip: Uint8Array;
106
+ sourceFiles: SiteFile[];
107
+ siteHeaders: Record<string, string>;
108
+ fetchImpl: typeof fetch;
109
+ /** The revision the agent's project started from; never the head read here, which would replace work committed since. */
110
+ expectedHeadRevisionId?: string;
111
+ /** One line kept with the deployment; cut to the service's limit. */
112
+ releaseNotes?: string;
113
+ onStaged?: (uploadKey: string) => void;
114
+ log?: (line: string) => void;
115
+ }): Promise<BundleReleaseResult>;
116
+ export declare function addUploadHeadlessWebsiteFilesTool(server: WixMcpServer, options: UploadHeadlessWebsiteFilesOptions): void;
117
+ export {};
118
+ //# sourceMappingURL=upload-headless-website-files.d.ts.map