@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
@@ -1,923 +0,0 @@
1
- import { describe, test, expect, beforeEach, vi, afterAll } from 'vitest';
2
- import { DEFAULT_MAX_RESULTS, runSemanticSearchAndFormat } from './semanticSearch.js';
3
- import { LONG_KB_CONTENT } from './long-content.js';
4
- const sampleSearchResponse = {
5
- results: {
6
- SDK_DOCS_KB_ID: {
7
- results: [
8
- {
9
- entry: {
10
- content: 'SDK Documentation content 1\nline 2\nline 3',
11
- url: 'https://dev.wix.com/docs/sdk/example'
12
- },
13
- scoresInfo: {
14
- overallMatchScore: 0.95
15
- }
16
- },
17
- {
18
- entry: {
19
- content: 'SDK Documentation content 2'
20
- },
21
- scoresInfo: {
22
- overallMatchScore: 0.85
23
- }
24
- },
25
- {
26
- entry: {
27
- content: LONG_KB_CONTENT,
28
- chunkedContent: ['some-chunked-content']
29
- },
30
- scoresInfo: {
31
- overallMatchScore: 0.83
32
- }
33
- }
34
- ]
35
- },
36
- SDK_SCHEMAS_KB_ID: {
37
- results: [
38
- {
39
- entry: {
40
- content: 'SDK Schema content 1'
41
- },
42
- scoresInfo: {
43
- overallMatchScore: 0.9
44
- }
45
- }
46
- ]
47
- },
48
- BUILD_APPS_KB_ID: {
49
- results: [
50
- {
51
- entry: {
52
- content: 'Build Apps content 1'
53
- },
54
- scoresInfo: {
55
- overallMatchScore: 0.88
56
- }
57
- }
58
- ]
59
- }
60
- // MCP_REST_RECIPES_KB_ID removed - recipes migrated to Picasso docs
61
- }
62
- };
63
- const originalProcessEnv = process.env;
64
- describe('Semantic Search', () => {
65
- let fetchMock;
66
- global.fetch = vi.fn();
67
- beforeEach(() => {
68
- vi.clearAllMocks();
69
- process.env = { ...originalProcessEnv };
70
- fetchMock = global.fetch;
71
- fetchMock.mockReset();
72
- fetchMock.mockResolvedValue({
73
- ok: true,
74
- status: 200,
75
- statusText: 'OK',
76
- json: async () => sampleSearchResponse
77
- });
78
- });
79
- afterAll(() => {
80
- process.env = originalProcessEnv;
81
- });
82
- test('performs SDK semantic search successfully', async () => {
83
- const sdkResponse = {
84
- results: {
85
- SDK_DOCS_KB_ID: {
86
- results: [
87
- {
88
- entry: {
89
- content: 'SDK Documentation content 1'
90
- },
91
- scoresInfo: {
92
- overallMatchScore: 0.95
93
- }
94
- },
95
- {
96
- entry: {
97
- content: 'SDK Documentation content 2'
98
- },
99
- scoresInfo: {
100
- overallMatchScore: 0.85
101
- }
102
- }
103
- ]
104
- },
105
- SDK_SCHEMAS_KB_ID: {
106
- results: [
107
- {
108
- entry: {
109
- content: 'SDK Schema content 1'
110
- },
111
- scoresInfo: {
112
- overallMatchScore: 0.9
113
- }
114
- }
115
- ]
116
- }
117
- }
118
- };
119
- fetchMock.mockResolvedValueOnce({
120
- ok: true,
121
- status: 200,
122
- json: async () => sdkResponse
123
- });
124
- const result = await runSemanticSearchAndFormat({
125
- toolName: 'SDK',
126
- toolParams: {
127
- searchTerm: 'wix-data query'
128
- },
129
- usePlatformizedSearch: false
130
- });
131
- expect(fetchMock).toHaveBeenCalledTimes(1);
132
- const [url] = fetchMock.mock.calls[0];
133
- expect(url).toContain('mcp-docs-search/v1/search');
134
- expect(url).toContain(`maxResults=${DEFAULT_MAX_RESULTS}`);
135
- expect(url).toContain('rerank=false');
136
- expect(url).toContain('kbName=SDK_DOCS_KB_ID');
137
- expect(url).toContain('kbName=SDK_METHODS_KB_ID');
138
- expect(url).toContain('kbName=API_REFERENCE_SDK_KB_ID');
139
- expect(url).toContain('kbName=REST_DOCS_KB_ID');
140
- expect(url).toContain('searchTerm=wix-data+query');
141
- // Results should be sorted by score and limited to 10
142
- expect(result).toBe('SDK Documentation content 1\n\n========================================\n\nSDK Schema content 1\n\n========================================\n\nSDK Documentation content 2');
143
- });
144
- test('performs REST semantic search successfully', async () => {
145
- const restResponse = {
146
- results: {
147
- REST_METHODS_KB_ID: {
148
- results: [
149
- {
150
- entry: {
151
- content: 'REST Methods content'
152
- },
153
- scoresInfo: {
154
- overallMatchScore: 0.98
155
- }
156
- }
157
- ]
158
- },
159
- REST_DOCS_KB_ID: {
160
- results: [
161
- {
162
- entry: {
163
- content: 'REST Documentation content'
164
- },
165
- scoresInfo: {
166
- overallMatchScore: 0.95
167
- }
168
- }
169
- ]
170
- }
171
- }
172
- };
173
- fetchMock.mockResolvedValueOnce({
174
- ok: true,
175
- status: 200,
176
- json: async () => restResponse
177
- });
178
- const result = await runSemanticSearchAndFormat({
179
- toolName: 'REST',
180
- toolParams: {
181
- searchTerm: 'create collection'
182
- },
183
- usePlatformizedSearch: false
184
- });
185
- expect(fetchMock).toHaveBeenCalledTimes(1);
186
- const [url] = fetchMock.mock.calls[0];
187
- expect(url).toContain('kbName=REST_METHODS_KB_ID');
188
- expect(url).toContain('kbName=REST_DOCS_KB_ID');
189
- // MCP_REST_RECIPES_KB_ID disabled - recipes migrated to Picasso docs
190
- expect(url).not.toContain('kbName=MCP_REST_RECIPES_KB_ID');
191
- expect(result).toBe('REST Methods content\n\n========================================\n\nREST Documentation content');
192
- });
193
- test('interleaves REST methods and articles in score order within each bucket', async () => {
194
- const restResponse = {
195
- results: {
196
- REST_DOCS_KB_ID: {
197
- results: [
198
- {
199
- entry: {
200
- content: 'Article 1'
201
- },
202
- scoresInfo: {
203
- overallMatchScore: 0.99
204
- }
205
- },
206
- {
207
- entry: {
208
- content: 'Article 2'
209
- },
210
- scoresInfo: {
211
- overallMatchScore: 0.98
212
- }
213
- },
214
- {
215
- entry: {
216
- content: 'Article 3'
217
- },
218
- scoresInfo: {
219
- overallMatchScore: 0.97
220
- }
221
- },
222
- {
223
- entry: {
224
- content: 'Article 4'
225
- },
226
- scoresInfo: {
227
- overallMatchScore: 0.96
228
- }
229
- }
230
- ]
231
- },
232
- REST_METHODS_KB_ID: {
233
- results: [
234
- {
235
- entry: {
236
- content: 'Method 1'
237
- },
238
- scoresInfo: {
239
- overallMatchScore: 0.75
240
- }
241
- },
242
- {
243
- entry: {
244
- content: 'Method 2'
245
- },
246
- scoresInfo: {
247
- overallMatchScore: 0.7
248
- }
249
- },
250
- {
251
- entry: {
252
- content: 'Method 3'
253
- },
254
- scoresInfo: {
255
- overallMatchScore: 0.65
256
- }
257
- }
258
- ]
259
- }
260
- }
261
- };
262
- fetchMock.mockResolvedValueOnce({
263
- ok: true,
264
- status: 200,
265
- json: async () => restResponse
266
- });
267
- const result = await runSemanticSearchAndFormat({
268
- toolName: 'REST',
269
- toolParams: {
270
- searchTerm: 'create product catalog v3'
271
- },
272
- maxResults: 6,
273
- usePlatformizedSearch: false
274
- });
275
- expect(result).toBe([
276
- 'Method 1',
277
- 'Method 2',
278
- 'Article 1',
279
- 'Article 2',
280
- 'Method 3',
281
- 'Article 3'
282
- ].join('\n\n' + '='.repeat(40) + '\n\n'));
283
- });
284
- test('performs BUSINESS_SOLUTIONS semantic search successfully', async () => {
285
- const restResponse = {
286
- results: {
287
- REST_DOCS_KB_ID: {
288
- results: [
289
- {
290
- entry: {
291
- content: 'REST Documentation content'
292
- },
293
- scoresInfo: {
294
- overallMatchScore: 0.95
295
- }
296
- }
297
- ]
298
- }
299
- }
300
- };
301
- fetchMock.mockResolvedValueOnce({
302
- ok: true,
303
- status: 200,
304
- json: async () => restResponse
305
- });
306
- const result = await runSemanticSearchAndFormat({
307
- toolName: 'BUSINESS_SOLUTIONS',
308
- toolParams: {
309
- searchTerm: 'create collection'
310
- },
311
- usePlatformizedSearch: false
312
- });
313
- expect(fetchMock).toHaveBeenCalledTimes(1);
314
- const [url] = fetchMock.mock.calls[0];
315
- expect(url).not.toContain('kbName=REST_METHODS_KB_ID');
316
- expect(url).toContain('kbName=REST_DOCS_KB_ID');
317
- // MCP_REST_RECIPES_KB_ID disabled - recipes migrated to Picasso docs
318
- expect(url).not.toContain('kbName=MCP_REST_RECIPES_KB_ID');
319
- expect(result).toBe('REST Documentation content');
320
- });
321
- test('performs WDS semantic search successfully', async () => {
322
- const wdsResponse = {
323
- results: {
324
- WDS_DOCS_KB_ID: {
325
- results: [
326
- {
327
- entry: {
328
- content: 'WDS Documentation content'
329
- },
330
- scoresInfo: {
331
- overallMatchScore: 0.95
332
- }
333
- }
334
- ]
335
- }
336
- }
337
- };
338
- fetchMock.mockResolvedValueOnce({
339
- ok: true,
340
- status: 200,
341
- json: async () => wdsResponse
342
- });
343
- const result = await runSemanticSearchAndFormat({
344
- toolName: 'WDS',
345
- toolParams: {
346
- searchTerm: 'Button component'
347
- },
348
- usePlatformizedSearch: false
349
- });
350
- expect(fetchMock).toHaveBeenCalledTimes(1);
351
- const [url] = fetchMock.mock.calls[0];
352
- expect(url).toContain('kbName=WDS_DOCS_KB_ID');
353
- expect(result).toBe('WDS Documentation content');
354
- });
355
- test('performs BUILD_APPS semantic search successfully', async () => {
356
- const buildAppsResponse = {
357
- results: {
358
- BUILD_APPS_KB_ID: {
359
- results: [
360
- {
361
- entry: {
362
- content: 'Build Apps content 1'
363
- },
364
- scoresInfo: {
365
- overallMatchScore: 0.88
366
- }
367
- }
368
- ]
369
- }
370
- }
371
- };
372
- fetchMock.mockResolvedValueOnce({
373
- ok: true,
374
- status: 200,
375
- json: async () => buildAppsResponse
376
- });
377
- const result = await runSemanticSearchAndFormat({
378
- toolName: 'BUILD_APPS',
379
- toolParams: {
380
- searchTerm: 'deploy app'
381
- },
382
- usePlatformizedSearch: false
383
- });
384
- expect(fetchMock).toHaveBeenCalledTimes(1);
385
- const [url] = fetchMock.mock.calls[0];
386
- expect(url).toContain('kbName=BUILD_APPS_KB_ID');
387
- expect(result).toBe('Build Apps content 1');
388
- });
389
- test('performs OVERVIEW semantic search successfully', async () => {
390
- const overviewResponse = {
391
- results: {
392
- OVERVIEW_KB_ID: {
393
- results: [
394
- {
395
- entry: {
396
- content: 'Overview content 1'
397
- },
398
- scoresInfo: {
399
- overallMatchScore: 0.88
400
- }
401
- }
402
- ]
403
- }
404
- }
405
- };
406
- fetchMock.mockResolvedValueOnce({
407
- ok: true,
408
- status: 200,
409
- json: async () => overviewResponse
410
- });
411
- const result = await runSemanticSearchAndFormat({
412
- toolName: 'OVERVIEW',
413
- toolParams: {
414
- searchTerm: 'business overview'
415
- },
416
- usePlatformizedSearch: false
417
- });
418
- expect(fetchMock).toHaveBeenCalledTimes(1);
419
- const [url] = fetchMock.mock.calls[0];
420
- expect(url).toContain('kbName=OVERVIEW_KB_ID');
421
- expect(result).toBe('Overview content 1');
422
- });
423
- test('performs WIX_HEADLESS semantic search successfully', async () => {
424
- const wixHeadlessResponse = {
425
- results: {
426
- WIX_HEADLESS_KB_ID: {
427
- results: [
428
- {
429
- entry: {
430
- content: 'Wix Headless content 1'
431
- },
432
- scoresInfo: {
433
- overallMatchScore: 0.92
434
- }
435
- }
436
- ]
437
- }
438
- }
439
- };
440
- fetchMock.mockResolvedValueOnce({
441
- ok: true,
442
- status: 200,
443
- json: async () => wixHeadlessResponse
444
- });
445
- const result = await runSemanticSearchAndFormat({
446
- toolName: 'WIX_HEADLESS',
447
- toolParams: {
448
- searchTerm: 'query'
449
- },
450
- usePlatformizedSearch: false
451
- });
452
- expect(fetchMock).toHaveBeenCalledTimes(1);
453
- const [url] = fetchMock.mock.calls[0];
454
- expect(url).toContain('kbName=HEADLESS_KB_ID');
455
- expect(result).toBe('Wix Headless content 1');
456
- });
457
- test('performs CLI semantic search successfully', async () => {
458
- const cliResponse = {
459
- results: {
460
- CLI_KB_ID: {
461
- results: [
462
- {
463
- entry: {
464
- content: 'Wix CLI documentation content'
465
- },
466
- scoresInfo: {
467
- overallMatchScore: 0.91
468
- }
469
- }
470
- ]
471
- }
472
- }
473
- };
474
- fetchMock.mockResolvedValueOnce({
475
- ok: true,
476
- status: 200,
477
- json: async () => cliResponse
478
- });
479
- const result = await runSemanticSearchAndFormat({
480
- toolName: 'CLI',
481
- toolParams: {
482
- searchTerm: 'wix cli commands'
483
- },
484
- usePlatformizedSearch: false
485
- });
486
- expect(fetchMock).toHaveBeenCalledTimes(1);
487
- const [url] = fetchMock.mock.calls[0];
488
- expect(url).toContain('kbName=CLI_KB_ID');
489
- expect(result).toBe('Wix CLI documentation content');
490
- });
491
- test('handles API error response', async () => {
492
- fetchMock.mockResolvedValueOnce({
493
- ok: false,
494
- status: 500,
495
- statusText: 'Internal Server Error'
496
- });
497
- await expect(runSemanticSearchAndFormat({
498
- toolName: 'SDK',
499
- toolParams: {
500
- searchTerm: 'query'
501
- },
502
- usePlatformizedSearch: false
503
- })).rejects.toThrow('Failed to run rag search: Internal Server Error');
504
- });
505
- test('handles empty results', async () => {
506
- fetchMock.mockResolvedValueOnce({
507
- ok: true,
508
- status: 200,
509
- json: async () => ({ results: {} })
510
- });
511
- await expect(runSemanticSearchAndFormat({
512
- toolName: 'SDK',
513
- toolParams: {
514
- searchTerm: 'query'
515
- },
516
- usePlatformizedSearch: false
517
- })).rejects.toThrow('No result from search');
518
- });
519
- test('respects maxResults parameter', async () => {
520
- const maxResults = 5;
521
- await runSemanticSearchAndFormat({
522
- toolName: 'SDK',
523
- toolParams: {
524
- searchTerm: 'query'
525
- },
526
- maxResults,
527
- usePlatformizedSearch: false
528
- });
529
- const [url] = fetchMock.mock.calls[0];
530
- expect(url).toContain('maxResults=5');
531
- });
532
- test('respects rerank parameter', async () => {
533
- await runSemanticSearchAndFormat({
534
- toolName: 'SDK',
535
- toolParams: {
536
- searchTerm: 'query'
537
- },
538
- maxResults: 5,
539
- rerank: true,
540
- usePlatformizedSearch: false
541
- });
542
- const [url] = fetchMock.mock.calls[0];
543
- expect(url).toContain('rerank=true');
544
- });
545
- describe('usePlatformizedSearch: true', () => {
546
- const markdownResponse = (content) => ({ content });
547
- test('makes POST request to /markdown endpoint with correct body', async () => {
548
- fetchMock.mockResolvedValueOnce({
549
- ok: true,
550
- status: 200,
551
- json: async () => markdownResponse('some result')
552
- });
553
- await runSemanticSearchAndFormat({
554
- toolName: 'REST',
555
- toolParams: { searchTerm: 'create collection' },
556
- usePlatformizedSearch: true
557
- });
558
- expect(fetchMock).toHaveBeenCalledTimes(1);
559
- const [url, init] = fetchMock.mock.calls[0];
560
- expect(url).toBe('https://www.wixapis.com/mcp-docs-search/v1/docs/search/markdown');
561
- expect(init.method).toBe('POST');
562
- const body = JSON.parse(init.body);
563
- expect(body).toEqual({
564
- search_term: 'create collection',
565
- document_type: 'REST',
566
- maximum_results: DEFAULT_MAX_RESULTS
567
- });
568
- });
569
- test.each([
570
- 'SDK',
571
- 'REST',
572
- 'WDS',
573
- 'BUILD_APPS',
574
- 'WIX_HEADLESS',
575
- 'VELO',
576
- 'CLI',
577
- 'BUSINESS_SOLUTIONS',
578
- 'OVERVIEW'
579
- ])('sends correct document_type for %s', async (toolName) => {
580
- fetchMock.mockResolvedValueOnce({
581
- ok: true,
582
- status: 200,
583
- json: async () => markdownResponse('result')
584
- });
585
- await runSemanticSearchAndFormat({
586
- toolName,
587
- toolParams: { searchTerm: 'test' },
588
- usePlatformizedSearch: true
589
- });
590
- const body = JSON.parse(fetchMock.mock.calls[0][1].body);
591
- expect(body.document_type).toBe(toolName);
592
- });
593
- test('respects maxResults parameter in request body', async () => {
594
- fetchMock.mockResolvedValueOnce({
595
- ok: true,
596
- status: 200,
597
- json: async () => markdownResponse('result')
598
- });
599
- await runSemanticSearchAndFormat({
600
- toolName: 'SDK',
601
- toolParams: { searchTerm: 'query' },
602
- maxResults: 5,
603
- usePlatformizedSearch: true
604
- });
605
- const body = JSON.parse(fetchMock.mock.calls[0][1].body);
606
- expect(body.maximum_results).toBe(5);
607
- });
608
- test('passes linesInEachResult to server in request body', async () => {
609
- fetchMock.mockResolvedValueOnce({
610
- ok: true,
611
- status: 200,
612
- json: async () => markdownResponse('result')
613
- });
614
- await runSemanticSearchAndFormat({
615
- toolName: 'SDK',
616
- toolParams: { searchTerm: 'query' },
617
- linesInEachResult: 20,
618
- usePlatformizedSearch: true
619
- });
620
- const body = JSON.parse(fetchMock.mock.calls[0][1].body);
621
- expect(body.lines_in_each_result).toBe(20);
622
- });
623
- test('handles API error response', async () => {
624
- fetchMock.mockResolvedValueOnce({
625
- ok: false,
626
- status: 500,
627
- statusText: 'Internal Server Error'
628
- });
629
- await expect(runSemanticSearchAndFormat({
630
- toolName: 'SDK',
631
- toolParams: { searchTerm: 'query' },
632
- usePlatformizedSearch: true
633
- })).rejects.toThrow('Failed to run rag search: Internal Server Error');
634
- });
635
- test('throws when server returns empty content', async () => {
636
- fetchMock.mockResolvedValueOnce({
637
- ok: true,
638
- status: 200,
639
- json: async () => markdownResponse('')
640
- });
641
- await expect(runSemanticSearchAndFormat({
642
- toolName: 'SDK',
643
- toolParams: { searchTerm: 'query' },
644
- usePlatformizedSearch: true
645
- })).rejects.toThrow('No result from search');
646
- });
647
- });
648
- describe('light mode and long content', () => {
649
- test('respects no linesInEachResult parameter - default behavior', async () => {
650
- const result = await runSemanticSearchAndFormat({
651
- toolName: 'SDK',
652
- toolParams: {
653
- searchTerm: 'query'
654
- },
655
- maxResults: 5,
656
- rerank: false,
657
- usePlatformizedSearch: false
658
- });
659
- expect(result).toContain('line 3');
660
- });
661
- test('respects linesInEachResult parameter', async () => {
662
- const result = await runSemanticSearchAndFormat({
663
- toolName: 'SDK',
664
- toolParams: {
665
- searchTerm: 'query'
666
- },
667
- maxResults: 5,
668
- rerank: false,
669
- linesInEachResult: 2,
670
- usePlatformizedSearch: false
671
- });
672
- expect(result).toContain('line 2');
673
- expect(result).toContain('... 1 more lines ...');
674
- expect(result).toContain('> Next: read the full article at https://dev.wix.com/docs/sdk/example using the suitable read tool.');
675
- });
676
- test('uses method-specific read guidance for truncated method results', async () => {
677
- fetchMock.mockResolvedValueOnce({
678
- ok: true,
679
- status: 200,
680
- json: async () => ({
681
- results: {
682
- REST_METHODS_KB_ID: {
683
- results: [
684
- {
685
- entry: {
686
- content: 'Method header\ncode example\nschema details',
687
- url: 'https://dev.wix.com/docs/api-reference/example-method'
688
- },
689
- scoresInfo: {
690
- overallMatchScore: 0.95
691
- }
692
- }
693
- ]
694
- }
695
- }
696
- })
697
- });
698
- const result = await runSemanticSearchAndFormat({
699
- toolName: 'REST',
700
- toolParams: {
701
- searchTerm: 'query'
702
- },
703
- maxResults: 5,
704
- rerank: false,
705
- linesInEachResult: 1,
706
- usePlatformizedSearch: false
707
- });
708
- expect(result).toContain('... 2 more lines ...');
709
- expect(result).toContain('> Next: read the full method article at https://dev.wix.com/docs/api-reference/example-method using the suitable read tool to get the complete code examples and method description.\n> If you need more detail about the request or response shape, read the full method schema using the suitable tool.');
710
- expect(result).not.toContain('> Next: read the full article at ');
711
- // Not a query/search method — the capability marker must stay off.
712
- expect(result).not.toContain('closed, endpoint-specific list');
713
- });
714
- test('marks query/search methods with the capability hint', async () => {
715
- fetchMock.mockResolvedValueOnce({
716
- ok: true,
717
- status: 200,
718
- json: async () => ({
719
- results: {
720
- REST_METHODS_KB_ID: {
721
- results: [
722
- {
723
- entry: {
724
- content: '# Method: Query Draft Posts\n# Method API Endpoint: POST https://www.wixapis.com/blog/v3/draft-posts/query\ncode example\nschema details',
725
- url: 'https://dev.wix.com/docs/api-reference/business-solutions/blog/draft-posts/query-draft-posts'
726
- },
727
- scoresInfo: { overallMatchScore: 0.95 }
728
- }
729
- ]
730
- }
731
- }
732
- })
733
- });
734
- const result = await runSemanticSearchAndFormat({
735
- toolName: 'REST',
736
- toolParams: { searchTerm: 'query draft posts' },
737
- maxResults: 5,
738
- rerank: false,
739
- linesInEachResult: 1,
740
- usePlatformizedSearch: false
741
- });
742
- expect(result).toContain('> Query/search: this endpoint declares which fields it can filter and sort by');
743
- expect(result).toContain('closed and covers this endpoint only');
744
- });
745
- test('uses method-specific read guidance for method-shaped content outside method KBs', async () => {
746
- fetchMock.mockResolvedValueOnce({
747
- ok: true,
748
- status: 200,
749
- json: async () => ({
750
- results: {
751
- REST_DOCS_KB_ID: {
752
- results: [
753
- {
754
- entry: {
755
- content: [
756
- '# Package: collectionManagement',
757
- '# Namespace: dataCollections',
758
- '# Method: List Data Collections',
759
- '## Method link: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/list-data-collections',
760
- 'Method details'
761
- ].join('\n')
762
- },
763
- scoresInfo: {
764
- overallMatchScore: 0.95
765
- }
766
- }
767
- ]
768
- }
769
- }
770
- })
771
- });
772
- const result = await runSemanticSearchAndFormat({
773
- toolName: 'REST',
774
- toolParams: {
775
- searchTerm: 'list data collections'
776
- },
777
- maxResults: 5,
778
- rerank: false,
779
- linesInEachResult: 4,
780
- usePlatformizedSearch: false
781
- });
782
- expect(result).toContain('... 1 more lines ...');
783
- expect(result).toContain('> Next: read the full method article at https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/list-data-collections using the suitable read tool to get the complete code examples and method description.\n> If you need more detail about the request or response shape, read the full method schema using the suitable tool.');
784
- });
785
- test('extracts read hint URL from single-hash method link content', async () => {
786
- fetchMock.mockResolvedValueOnce({
787
- ok: true,
788
- status: 200,
789
- json: async () => ({
790
- results: {
791
- REST_METHODS_KB_ID: {
792
- results: [
793
- {
794
- entry: {
795
- content: [
796
- '# Package: catalogV3',
797
- '# Namespace: productsV3',
798
- '# Method: Create Product',
799
- '# Method link: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/create-product',
800
- '# Method API Endpoint: POST https://www.wixapis.com/stores/v3/products',
801
- 'Method details'
802
- ].join('\n')
803
- },
804
- scoresInfo: {
805
- overallMatchScore: 0.95
806
- }
807
- }
808
- ]
809
- }
810
- }
811
- })
812
- });
813
- const result = await runSemanticSearchAndFormat({
814
- toolName: 'REST',
815
- toolParams: {
816
- searchTerm: 'create product'
817
- },
818
- maxResults: 5,
819
- rerank: false,
820
- linesInEachResult: 5,
821
- usePlatformizedSearch: false
822
- });
823
- expect(result).toContain('... 1 more lines ...');
824
- expect(result).toContain('> Next: read the full method article at https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/create-product using the suitable read tool to get the complete code examples and method description.\n> If you need more detail about the request or response shape, read the full method schema using the suitable tool.');
825
- });
826
- test('extracts read hint URL from article link content when entry URL is missing', async () => {
827
- fetchMock.mockResolvedValueOnce({
828
- ok: true,
829
- status: 200,
830
- json: async () => ({
831
- results: {
832
- REST_DOCS_KB_ID: {
833
- results: [
834
- {
835
- entry: {
836
- content: [
837
- '## Article: Catalog Setup',
838
- '## Article Link: https://dev.wix.com/docs/api-reference/example-article',
839
- '# Catalog Setup',
840
- 'Body line'
841
- ].join('\n')
842
- },
843
- scoresInfo: {
844
- overallMatchScore: 0.95
845
- }
846
- }
847
- ]
848
- }
849
- }
850
- })
851
- });
852
- const result = await runSemanticSearchAndFormat({
853
- toolName: 'REST',
854
- toolParams: {
855
- searchTerm: 'query'
856
- },
857
- maxResults: 5,
858
- rerank: false,
859
- linesInEachResult: 2,
860
- usePlatformizedSearch: false
861
- });
862
- expect(result).toContain('... 2 more lines ...');
863
- expect(result).toContain('> Next: read the full article at https://dev.wix.com/docs/api-reference/example-article using the suitable read tool.');
864
- });
865
- test('respects linesInEachResult parameter', async () => {
866
- const result = await runSemanticSearchAndFormat({
867
- toolName: 'SDK',
868
- toolParams: {
869
- searchTerm: 'query'
870
- },
871
- maxResults: 5,
872
- rerank: false,
873
- linesInEachResult: 1,
874
- usePlatformizedSearch: false
875
- });
876
- expect(result).not.toContain('line 2');
877
- });
878
- test('respects linesInEachResult even if content is too long', async () => {
879
- const longContentLines = LONG_KB_CONTENT.split('\n');
880
- const longContentLine1 = longContentLines[0];
881
- const longContentLine16 = longContentLines[16];
882
- const result = await runSemanticSearchAndFormat({
883
- toolName: 'SDK',
884
- toolParams: {
885
- searchTerm: 'query'
886
- },
887
- maxResults: 10,
888
- rerank: false,
889
- linesInEachResult: 15,
890
- usePlatformizedSearch: false
891
- });
892
- expect(result).toContain(longContentLine1);
893
- expect(result).not.toContain('some-chunked-content');
894
- expect(result).not.toContain(longContentLine16);
895
- });
896
- test('uses chunked content if content is too long and linesInEachResult is not set', async () => {
897
- const result = await runSemanticSearchAndFormat({
898
- toolName: 'SDK',
899
- toolParams: {
900
- searchTerm: 'query'
901
- },
902
- maxResults: 10,
903
- rerank: false,
904
- usePlatformizedSearch: false
905
- });
906
- expect(result).toContain('some-chunked-content');
907
- });
908
- test('uses chunked content if content is too long and linesInEachResult is set', async () => {
909
- const result = await runSemanticSearchAndFormat({
910
- toolName: 'SDK',
911
- toolParams: {
912
- searchTerm: 'query'
913
- },
914
- maxResults: 10,
915
- rerank: false,
916
- linesInEachResult: 1500,
917
- usePlatformizedSearch: false
918
- });
919
- expect(result).toContain('some-chunked-content');
920
- });
921
- });
922
- });
923
- //# sourceMappingURL=semanticSearch.test.js.map