@wix/mcp 1.0.75 → 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.
Files changed (277) hide show
  1. package/build/bin-standalone.js +83486 -12285
  2. package/build/dts/index.d.ts +1 -0
  3. package/build/dts/index.js +0 -1
  4. package/build/dts/infra/tool-bi.d.ts +4 -4
  5. package/build/dts/infra/tool-bi.js +1 -1
  6. package/build/dts/toolkit-entry.d.cts +410 -0
  7. package/build/dts/toolkit-entry.d.ts +409 -19
  8. package/build/dts/toolkit-entry.js +0 -1
  9. package/build/dts/toolkit-types.d.ts +31 -0
  10. package/build/dts/toolkit-types.js +12 -0
  11. package/build/dts/toolkit.d.ts +5 -5
  12. package/package.json +26 -19
  13. package/build/bin-standalone.js.map +0 -7
  14. package/build/cjs/index.cjs.map +0 -7
  15. package/build/cjs/toolkit.cjs.map +0 -7
  16. package/build/dts/api-call/index.d.ts.map +0 -1
  17. package/build/dts/api-call/index.js.map +0 -1
  18. package/build/dts/api-call/upload-image-tool.d.ts.map +0 -1
  19. package/build/dts/api-call/upload-image-tool.js.map +0 -1
  20. package/build/dts/api-call/upload-image-tool.test.d.ts +0 -2
  21. package/build/dts/api-call/upload-image-tool.test.d.ts.map +0 -1
  22. package/build/dts/api-call/upload-image-tool.test.js +0 -217
  23. package/build/dts/api-call/upload-image-tool.test.js.map +0 -1
  24. package/build/dts/api-call/upload-image-utils.d.ts.map +0 -1
  25. package/build/dts/api-call/upload-image-utils.js.map +0 -1
  26. package/build/dts/api-call/upload-image-utils.test.d.ts +0 -2
  27. package/build/dts/api-call/upload-image-utils.test.d.ts.map +0 -1
  28. package/build/dts/api-call/upload-image-utils.test.js +0 -121
  29. package/build/dts/api-call/upload-image-utils.test.js.map +0 -1
  30. package/build/dts/api-call/validation.d.ts.map +0 -1
  31. package/build/dts/api-call/validation.js.map +0 -1
  32. package/build/dts/api-call/validation.test.d.ts +0 -2
  33. package/build/dts/api-call/validation.test.d.ts.map +0 -1
  34. package/build/dts/api-call/validation.test.js +0 -42
  35. package/build/dts/api-call/validation.test.js.map +0 -1
  36. package/build/dts/auth/auth-error-handling.test.d.ts +0 -2
  37. package/build/dts/auth/auth-error-handling.test.d.ts.map +0 -1
  38. package/build/dts/auth/auth-error-handling.test.js +0 -347
  39. package/build/dts/auth/auth-error-handling.test.js.map +0 -1
  40. package/build/dts/auth/index.d.ts.map +0 -1
  41. package/build/dts/auth/index.js.map +0 -1
  42. package/build/dts/bin.d.ts.map +0 -1
  43. package/build/dts/bin.js.map +0 -1
  44. package/build/dts/cli-tools/account-auth-strategy.d.ts.map +0 -1
  45. package/build/dts/cli-tools/account-auth-strategy.js.map +0 -1
  46. package/build/dts/cli-tools/account-token-store.d.ts.map +0 -1
  47. package/build/dts/cli-tools/account-token-store.js.map +0 -1
  48. package/build/dts/cli-tools/cli.d.ts.map +0 -1
  49. package/build/dts/cli-tools/cli.js.map +0 -1
  50. package/build/dts/cli-tools/utils.d.ts.map +0 -1
  51. package/build/dts/cli-tools/utils.js.map +0 -1
  52. package/build/dts/code-mode/index.d.ts.map +0 -1
  53. package/build/dts/code-mode/index.js.map +0 -1
  54. package/build/dts/code-mode/index.test.d.ts +0 -2
  55. package/build/dts/code-mode/index.test.d.ts.map +0 -1
  56. package/build/dts/code-mode/index.test.js +0 -342
  57. package/build/dts/code-mode/index.test.js.map +0 -1
  58. package/build/dts/code-mode/truncate-response.d.ts.map +0 -1
  59. package/build/dts/code-mode/truncate-response.js.map +0 -1
  60. package/build/dts/code-mode/truncate-response.test.d.ts +0 -2
  61. package/build/dts/code-mode/truncate-response.test.d.ts.map +0 -1
  62. package/build/dts/code-mode/truncate-response.test.js +0 -32
  63. package/build/dts/code-mode/truncate-response.test.js.map +0 -1
  64. package/build/dts/code-mode/validation.d.ts.map +0 -1
  65. package/build/dts/code-mode/validation.js.map +0 -1
  66. package/build/dts/code-mode/validation.test.d.ts +0 -2
  67. package/build/dts/code-mode/validation.test.d.ts.map +0 -1
  68. package/build/dts/code-mode/validation.test.js +0 -72
  69. package/build/dts/code-mode/validation.test.js.map +0 -1
  70. package/build/dts/config/default-config.bulk-preference.test.d.ts +0 -2
  71. package/build/dts/config/default-config.bulk-preference.test.d.ts.map +0 -1
  72. package/build/dts/config/default-config.bulk-preference.test.js +0 -42
  73. package/build/dts/config/default-config.bulk-preference.test.js.map +0 -1
  74. package/build/dts/config/default-config.d.ts.map +0 -1
  75. package/build/dts/config/default-config.execute-orchestration.test.d.ts +0 -2
  76. package/build/dts/config/default-config.execute-orchestration.test.d.ts.map +0 -1
  77. package/build/dts/config/default-config.execute-orchestration.test.js +0 -40
  78. package/build/dts/config/default-config.execute-orchestration.test.js.map +0 -1
  79. package/build/dts/config/default-config.js.map +0 -1
  80. package/build/dts/config/default-config.readme.test.d.ts +0 -2
  81. package/build/dts/config/default-config.readme.test.d.ts.map +0 -1
  82. package/build/dts/config/default-config.readme.test.js +0 -84
  83. package/build/dts/config/default-config.readme.test.js.map +0 -1
  84. package/build/dts/config/default-config.searchspec-goal.test.d.ts +0 -2
  85. package/build/dts/config/default-config.searchspec-goal.test.d.ts.map +0 -1
  86. package/build/dts/config/default-config.searchspec-goal.test.js +0 -30
  87. package/build/dts/config/default-config.searchspec-goal.test.js.map +0 -1
  88. package/build/dts/config/param-descriptions.d.ts.map +0 -1
  89. package/build/dts/config/param-descriptions.js.map +0 -1
  90. package/build/dts/constants.d.ts.map +0 -1
  91. package/build/dts/constants.js.map +0 -1
  92. package/build/dts/docs/browse-menu.d.ts.map +0 -1
  93. package/build/dts/docs/browse-menu.js.map +0 -1
  94. package/build/dts/docs/browse-menu.test.d.ts +0 -2
  95. package/build/dts/docs/browse-menu.test.d.ts.map +0 -1
  96. package/build/dts/docs/browse-menu.test.js +0 -66
  97. package/build/dts/docs/browse-menu.test.js.map +0 -1
  98. package/build/dts/docs/browse-tool.test.d.ts +0 -2
  99. package/build/dts/docs/browse-tool.test.d.ts.map +0 -1
  100. package/build/dts/docs/browse-tool.test.js +0 -77
  101. package/build/dts/docs/browse-tool.test.js.map +0 -1
  102. package/build/dts/docs/create-site-guide.d.ts.map +0 -1
  103. package/build/dts/docs/create-site-guide.js.map +0 -1
  104. package/build/dts/docs/docs.d.ts.map +0 -1
  105. package/build/dts/docs/docs.js.map +0 -1
  106. package/build/dts/docs/fetch-article.d.ts.map +0 -1
  107. package/build/dts/docs/fetch-article.js.map +0 -1
  108. package/build/dts/docs/fetch-article.test.d.ts +0 -2
  109. package/build/dts/docs/fetch-article.test.d.ts.map +0 -1
  110. package/build/dts/docs/fetch-article.test.js +0 -93
  111. package/build/dts/docs/fetch-article.test.js.map +0 -1
  112. package/build/dts/docs/fetch-skills.d.ts.map +0 -1
  113. package/build/dts/docs/fetch-skills.js.map +0 -1
  114. package/build/dts/docs/fetch-skills.test.d.ts +0 -2
  115. package/build/dts/docs/fetch-skills.test.d.ts.map +0 -1
  116. package/build/dts/docs/fetch-skills.test.js +0 -140
  117. package/build/dts/docs/fetch-skills.test.js.map +0 -1
  118. package/build/dts/docs/get-to-know.d.ts.map +0 -1
  119. package/build/dts/docs/get-to-know.js.map +0 -1
  120. package/build/dts/docs/get-to-know.test.d.ts +0 -2
  121. package/build/dts/docs/get-to-know.test.d.ts.map +0 -1
  122. package/build/dts/docs/get-to-know.test.js +0 -152
  123. package/build/dts/docs/get-to-know.test.js.map +0 -1
  124. package/build/dts/docs/long-content.d.ts.map +0 -1
  125. package/build/dts/docs/long-content.js.map +0 -1
  126. package/build/dts/docs/normalize-menu-content.d.ts.map +0 -1
  127. package/build/dts/docs/normalize-menu-content.js.map +0 -1
  128. package/build/dts/docs/searchFormatting.d.ts.map +0 -1
  129. package/build/dts/docs/searchFormatting.js.map +0 -1
  130. package/build/dts/docs/searchFormatting.test.d.ts +0 -2
  131. package/build/dts/docs/searchFormatting.test.d.ts.map +0 -1
  132. package/build/dts/docs/searchFormatting.test.js +0 -102
  133. package/build/dts/docs/searchFormatting.test.js.map +0 -1
  134. package/build/dts/docs/semanticSearch.d.ts.map +0 -1
  135. package/build/dts/docs/semanticSearch.js.map +0 -1
  136. package/build/dts/docs/semanticSearch.test.d.ts +0 -2
  137. package/build/dts/docs/semanticSearch.test.d.ts.map +0 -1
  138. package/build/dts/docs/semanticSearch.test.js +0 -923
  139. package/build/dts/docs/semanticSearch.test.js.map +0 -1
  140. package/build/dts/docs/velo-readme.d.ts.map +0 -1
  141. package/build/dts/docs/velo-readme.js.map +0 -1
  142. package/build/dts/import-claude-design-tool/banner.d.ts.map +0 -1
  143. package/build/dts/import-claude-design-tool/banner.js.map +0 -1
  144. package/build/dts/import-claude-design-tool/constants.d.ts.map +0 -1
  145. package/build/dts/import-claude-design-tool/constants.js.map +0 -1
  146. package/build/dts/import-claude-design-tool/index.d.ts.map +0 -1
  147. package/build/dts/import-claude-design-tool/index.js.map +0 -1
  148. package/build/dts/import-claude-design-tool/index.test.d.ts +0 -2
  149. package/build/dts/import-claude-design-tool/index.test.d.ts.map +0 -1
  150. package/build/dts/import-claude-design-tool/index.test.js +0 -329
  151. package/build/dts/import-claude-design-tool/index.test.js.map +0 -1
  152. package/build/dts/import-claude-design-tool/sanitize.d.ts.map +0 -1
  153. package/build/dts/import-claude-design-tool/sanitize.js.map +0 -1
  154. package/build/dts/import-claude-design-tool/wixstro-client.d.ts.map +0 -1
  155. package/build/dts/import-claude-design-tool/wixstro-client.js.map +0 -1
  156. package/build/dts/index.d.ts.map +0 -1
  157. package/build/dts/index.js.map +0 -1
  158. package/build/dts/infra/bi-logger.d.ts.map +0 -1
  159. package/build/dts/infra/bi-logger.js.map +0 -1
  160. package/build/dts/infra/environment.d.ts.map +0 -1
  161. package/build/dts/infra/environment.js.map +0 -1
  162. package/build/dts/infra/file-logger.d.ts.map +0 -1
  163. package/build/dts/infra/file-logger.js.map +0 -1
  164. package/build/dts/infra/logger.d.ts.map +0 -1
  165. package/build/dts/infra/logger.js.map +0 -1
  166. package/build/dts/infra/panorama.d.ts.map +0 -1
  167. package/build/dts/infra/panorama.js.map +0 -1
  168. package/build/dts/infra/response-size-limits.d.ts.map +0 -1
  169. package/build/dts/infra/response-size-limits.js.map +0 -1
  170. package/build/dts/infra/sentry.d.ts.map +0 -1
  171. package/build/dts/infra/sentry.js.map +0 -1
  172. package/build/dts/infra/tool-bi.d.ts.map +0 -1
  173. package/build/dts/infra/tool-bi.js.map +0 -1
  174. package/build/dts/infra/widget-payload.d.ts.map +0 -1
  175. package/build/dts/infra/widget-payload.js.map +0 -1
  176. package/build/dts/resources/docs.d.ts.map +0 -1
  177. package/build/dts/resources/docs.js.map +0 -1
  178. package/build/dts/site-widget-tools/claim-site-tool/index.d.ts.map +0 -1
  179. package/build/dts/site-widget-tools/claim-site-tool/index.js.map +0 -1
  180. package/build/dts/site-widget-tools/constants.d.ts.map +0 -1
  181. package/build/dts/site-widget-tools/constants.js.map +0 -1
  182. package/build/dts/site-widget-tools/create-site-from-template-tool/index.d.ts.map +0 -1
  183. package/build/dts/site-widget-tools/create-site-from-template-tool/index.js.map +0 -1
  184. package/build/dts/site-widget-tools/edit-site-tool/index.d.ts.map +0 -1
  185. package/build/dts/site-widget-tools/edit-site-tool/index.js.map +0 -1
  186. package/build/dts/site-widget-tools/index.d.ts.map +0 -1
  187. package/build/dts/site-widget-tools/index.js.map +0 -1
  188. package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.d.ts.map +0 -1
  189. package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.js.map +0 -1
  190. package/build/dts/site-widget-tools/search-site-templates-tool/index.d.ts.map +0 -1
  191. package/build/dts/site-widget-tools/search-site-templates-tool/index.js.map +0 -1
  192. package/build/dts/site-widget-tools/site-builder-tool/index.d.ts.map +0 -1
  193. package/build/dts/site-widget-tools/site-builder-tool/index.js.map +0 -1
  194. package/build/dts/site-widget-tools/site-builder-tool/index.test.d.ts +0 -2
  195. package/build/dts/site-widget-tools/site-builder-tool/index.test.d.ts.map +0 -1
  196. package/build/dts/site-widget-tools/site-builder-tool/index.test.js +0 -46
  197. package/build/dts/site-widget-tools/site-builder-tool/index.test.js.map +0 -1
  198. package/build/dts/site-widget-tools/site-creation-tool/index.d.ts.map +0 -1
  199. package/build/dts/site-widget-tools/site-creation-tool/index.js.map +0 -1
  200. package/build/dts/site-widget-tools/site-creation-tool/index.test.d.ts +0 -2
  201. package/build/dts/site-widget-tools/site-creation-tool/index.test.d.ts.map +0 -1
  202. package/build/dts/site-widget-tools/site-creation-tool/index.test.js +0 -57
  203. package/build/dts/site-widget-tools/site-creation-tool/index.test.js.map +0 -1
  204. package/build/dts/site-widget-tools/suggested-domain-tool/index.d.ts.map +0 -1
  205. package/build/dts/site-widget-tools/suggested-domain-tool/index.js.map +0 -1
  206. package/build/dts/site-widget-tools/types.d.ts.map +0 -1
  207. package/build/dts/site-widget-tools/types.js.map +0 -1
  208. package/build/dts/site-widget-tools/utils.d.ts.map +0 -1
  209. package/build/dts/site-widget-tools/utils.js.map +0 -1
  210. package/build/dts/support/index.d.ts.map +0 -1
  211. package/build/dts/support/index.js.map +0 -1
  212. package/build/dts/tool-bi-reporting.test.d.ts +0 -2
  213. package/build/dts/tool-bi-reporting.test.d.ts.map +0 -1
  214. package/build/dts/tool-bi-reporting.test.js +0 -219
  215. package/build/dts/tool-bi-reporting.test.js.map +0 -1
  216. package/build/dts/tool-utils.d.ts.map +0 -1
  217. package/build/dts/tool-utils.js.map +0 -1
  218. package/build/dts/tool-utils.spec.d.ts +0 -2
  219. package/build/dts/tool-utils.spec.d.ts.map +0 -1
  220. package/build/dts/tool-utils.spec.js +0 -98
  221. package/build/dts/tool-utils.spec.js.map +0 -1
  222. package/build/dts/toolkit-entry.d.ts.map +0 -1
  223. package/build/dts/toolkit-entry.js.map +0 -1
  224. package/build/dts/toolkit-json-schema.test.d.ts +0 -2
  225. package/build/dts/toolkit-json-schema.test.d.ts.map +0 -1
  226. package/build/dts/toolkit-json-schema.test.js +0 -36
  227. package/build/dts/toolkit-json-schema.test.js.map +0 -1
  228. package/build/dts/toolkit.d.ts.map +0 -1
  229. package/build/dts/toolkit.js.map +0 -1
  230. package/build/dts/toolkit.test.d.ts +0 -2
  231. package/build/dts/toolkit.test.d.ts.map +0 -1
  232. package/build/dts/toolkit.test.js +0 -691
  233. package/build/dts/toolkit.test.js.map +0 -1
  234. package/build/dts/widget-manifest.d.ts.map +0 -1
  235. package/build/dts/widget-manifest.js.map +0 -1
  236. package/build/dts/wix-fetch-error.d.ts.map +0 -1
  237. package/build/dts/wix-fetch-error.js.map +0 -1
  238. package/build/dts/wix-mcp-server.d.ts.map +0 -1
  239. package/build/dts/wix-mcp-server.js.map +0 -1
  240. package/build/dts/wixel/api.d.ts.map +0 -1
  241. package/build/dts/wixel/api.js.map +0 -1
  242. package/build/dts/wixel/constants.d.ts.map +0 -1
  243. package/build/dts/wixel/constants.js.map +0 -1
  244. package/build/dts/wixel/external-agent-api.d.ts.map +0 -1
  245. package/build/dts/wixel/external-agent-api.js.map +0 -1
  246. package/build/dts/wixel/get-wixel-asset-tool.d.ts.map +0 -1
  247. package/build/dts/wixel/get-wixel-asset-tool.js.map +0 -1
  248. package/build/dts/wixel/get-wixel-job-status-tool.d.ts.map +0 -1
  249. package/build/dts/wixel/get-wixel-job-status-tool.js.map +0 -1
  250. package/build/dts/wixel/get-wixel-project-assets-tool.d.ts.map +0 -1
  251. package/build/dts/wixel/get-wixel-project-assets-tool.js.map +0 -1
  252. package/build/dts/wixel/index.d.ts.map +0 -1
  253. package/build/dts/wixel/index.js.map +0 -1
  254. package/build/dts/wixel/mark-wixel-job-as-fulfilled-tool.d.ts.map +0 -1
  255. package/build/dts/wixel/mark-wixel-job-as-fulfilled-tool.js.map +0 -1
  256. package/build/dts/wixel/open-headless-wixel-project-tool.d.ts.map +0 -1
  257. package/build/dts/wixel/open-headless-wixel-project-tool.js.map +0 -1
  258. package/build/dts/wixel/pull-headless-wixel-job-tool.d.ts.map +0 -1
  259. package/build/dts/wixel/pull-headless-wixel-job-tool.js.map +0 -1
  260. package/build/dts/wixel/update-headless-wixel-job-tool.d.ts.map +0 -1
  261. package/build/dts/wixel/update-headless-wixel-job-tool.js.map +0 -1
  262. package/build/dts/wixel/utils.d.ts.map +0 -1
  263. package/build/dts/wixel/utils.js.map +0 -1
  264. package/build/dts/wixel/wixel-bi.d.ts.map +0 -1
  265. package/build/dts/wixel/wixel-bi.js.map +0 -1
  266. package/build/dts/wixel/wixel-bi.test.d.ts +0 -2
  267. package/build/dts/wixel/wixel-bi.test.d.ts.map +0 -1
  268. package/build/dts/wixel/wixel-bi.test.js +0 -35
  269. package/build/dts/wixel/wixel-bi.test.js.map +0 -1
  270. package/build/dts/wixel/wixel-session-tools.d.ts.map +0 -1
  271. package/build/dts/wixel/wixel-session-tools.js.map +0 -1
  272. package/build/dts/wixel/wixel-session-tools.test.d.ts +0 -2
  273. package/build/dts/wixel/wixel-session-tools.test.d.ts.map +0 -1
  274. package/build/dts/wixel/wixel-session-tools.test.js +0 -143
  275. package/build/dts/wixel/wixel-session-tools.test.js.map +0 -1
  276. package/build/esm/index.js.map +0 -7
  277. package/build/esm/toolkit.js.map +0 -7
@@ -16,6 +16,7 @@ export type { Logger } from './infra/logger.js';
16
16
  export { attachConsoleLogger } from './infra/logger.js';
17
17
  export { createBiLogger } from './infra/bi-logger.js';
18
18
  export { createToolBiEvent, createExecuteWixAPICallToolBiEvent } from './infra/tool-bi.js';
19
+ export type { WixToolCallResult, WixToolContentBlock, WixToolAnnotations } from './toolkit-types.js';
19
20
  export { createWixToolkit, extractText, type WixTool, type WixToolkit, type WixToolkitOptions, type WixToolkitHooks, type WixToolkitAuth, type WixToolkitDocsConfig, type WixToolkitApiConfig } from './toolkit.js';
20
21
  export { fetchRecipesIndex, fetchArticle, RECIPES_INDEX_URL } from './docs/fetch-article.js';
21
22
  export { generateDocsNavigationTree, fetchMenuContent, MENU_CONTENT_THRESHOLD, normalizeMenuContent, summarizeLargeMenu, parseDirectChildren } from './docs/normalize-menu-content.js';
@@ -18,7 +18,6 @@ export { attachConsoleLogger } from './infra/logger.js';
18
18
  // logger defaults instead of wiring their own.
19
19
  export { createBiLogger } from './infra/bi-logger.js';
20
20
  export { createToolBiEvent, createExecuteWixAPICallToolBiEvent } from './infra/tool-bi.js';
21
- // Toolkit exports
22
21
  export { createWixToolkit, extractText } from './toolkit.js';
23
22
  // Docs fetch utilities
24
23
  export { fetchRecipesIndex, fetchArticle, RECIPES_INDEX_URL } from './docs/fetch-article.js';
@@ -1,12 +1,12 @@
1
- import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
1
+ import type { WixToolCallResult } from '../toolkit-types.js';
2
2
  import { wixMcpRequestSrc39Evid1607, executeWixApiToolRequestSrc39Evid1612 } from '@wix/bi-logger-api-infra-data/v2';
3
3
  /**
4
- * Safely extract all text content from a CallToolResult.
4
+ * Safely extract all text content from a WixToolCallResult.
5
5
  * Filters out non-text content blocks (images, audio, resources)
6
6
  * and concatenates text blocks with newlines.
7
7
  */
8
- export declare function extractText(result: CallToolResult): string;
9
- export declare function formatToolResultAdditionalFields(result: CallToolResult): string | undefined;
8
+ export declare function extractText(result: WixToolCallResult): string;
9
+ export declare function formatToolResultAdditionalFields(result: WixToolCallResult): string | undefined;
10
10
  export declare function createToolBiEvent(params: Parameters<typeof wixMcpRequestSrc39Evid1607>[0]): import("@wix/bi-logger-api-infra-data/v2/types").LogObject<import("@wix/bi-logger-api-infra-data/v2/types").wixMcpRequestSrc39Evid1607Params>;
11
11
  export declare function createExecuteWixAPICallToolBiEvent(params: Parameters<typeof executeWixApiToolRequestSrc39Evid1612>[0]): import("@wix/bi-logger-api-infra-data/v2/types").LogObject<import("@wix/bi-logger-api-infra-data/v2/types").executeWixApiToolRequestSrc39Evid1612Params>;
12
12
  //# sourceMappingURL=tool-bi.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { wixMcpRequestSrc39Evid1607, executeWixApiToolRequestSrc39Evid1612 } from '@wix/bi-logger-api-infra-data/v2';
2
2
  /**
3
- * Safely extract all text content from a CallToolResult.
3
+ * Safely extract all text content from a WixToolCallResult.
4
4
  * Filters out non-text content blocks (images, audio, resources)
5
5
  * and concatenates text blocks with newlines.
6
6
  */
@@ -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 {};