webmcp-cli 1.0.0 → 1.1.0

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 (347) hide show
  1. package/dist/agent/features/agent-simulator.d.ts +67 -0
  2. package/dist/agent/features/agent-simulator.js +368 -0
  3. package/dist/agent/features/agent-simulator.js.map +1 -0
  4. package/dist/agent/features/index.d.ts +8 -0
  5. package/dist/agent/features/index.js +9 -0
  6. package/dist/agent/features/index.js.map +1 -0
  7. package/dist/agent/features/simulation-judge.d.ts +78 -0
  8. package/dist/agent/features/simulation-judge.js +275 -0
  9. package/dist/agent/features/simulation-judge.js.map +1 -0
  10. package/dist/agent/features/test-case-generator.d.ts +35 -0
  11. package/dist/agent/features/test-case-generator.js +256 -0
  12. package/dist/agent/features/test-case-generator.js.map +1 -0
  13. package/dist/agent/index.d.ts +7 -0
  14. package/dist/agent/index.js +10 -0
  15. package/dist/agent/index.js.map +1 -0
  16. package/dist/agent/llm-client.d.ts +76 -0
  17. package/dist/agent/llm-client.js +186 -0
  18. package/dist/agent/llm-client.js.map +1 -0
  19. package/dist/audit/run-single-page-audit.d.ts +41 -0
  20. package/dist/audit/run-single-page-audit.js +103 -0
  21. package/dist/audit/run-single-page-audit.js.map +1 -0
  22. package/dist/bin/agentready.d.ts +5 -0
  23. package/dist/bin/agentready.js +10 -0
  24. package/dist/bin/agentready.js.map +1 -0
  25. package/dist/bin/webmcp.d.ts +5 -0
  26. package/dist/bin/webmcp.js +10 -0
  27. package/dist/bin/webmcp.js.map +1 -0
  28. package/dist/browser/audit-runner.d.ts +30 -0
  29. package/dist/browser/audit-runner.js +74 -0
  30. package/dist/browser/audit-runner.js.map +1 -0
  31. package/dist/browser/index.d.ts +6 -0
  32. package/dist/browser/index.js +7 -0
  33. package/dist/browser/index.js.map +1 -0
  34. package/dist/browser/interceptor.d.ts +68 -0
  35. package/dist/browser/interceptor.js +257 -0
  36. package/dist/browser/interceptor.js.map +1 -0
  37. package/dist/browser/playwright.d.ts +98 -0
  38. package/dist/browser/playwright.js +158 -0
  39. package/dist/browser/playwright.js.map +1 -0
  40. package/dist/cli/commands/audit.d.ts +12 -0
  41. package/dist/cli/commands/audit.js +340 -0
  42. package/dist/cli/commands/audit.js.map +1 -0
  43. package/dist/cli/commands/interactive.d.ts +10 -0
  44. package/dist/cli/commands/interactive.js +38 -0
  45. package/dist/cli/commands/interactive.js.map +1 -0
  46. package/dist/cli/index.d.ts +17 -0
  47. package/dist/cli/index.js +84 -0
  48. package/dist/cli/index.js.map +1 -0
  49. package/dist/cli/options/parse-audit-options.d.ts +12 -0
  50. package/dist/cli/options/parse-audit-options.js +39 -0
  51. package/dist/cli/options/parse-audit-options.js.map +1 -0
  52. package/dist/cli/utils/errors.d.ts +53 -0
  53. package/dist/cli/utils/errors.js +87 -0
  54. package/dist/cli/utils/errors.js.map +1 -0
  55. package/dist/core/constants.d.ts +102 -0
  56. package/dist/core/constants.js +214 -0
  57. package/dist/core/constants.js.map +1 -0
  58. package/dist/core/types/audit.d.ts +260 -0
  59. package/dist/core/types/audit.js +5 -0
  60. package/dist/core/types/audit.js.map +1 -0
  61. package/dist/core/types/index.d.ts +6 -0
  62. package/dist/core/types/index.js +7 -0
  63. package/dist/core/types/index.js.map +1 -0
  64. package/dist/core/types/rule.d.ts +190 -0
  65. package/dist/core/types/rule.js +26 -0
  66. package/dist/core/types/rule.js.map +1 -0
  67. package/dist/core/types/tool.d.ts +312 -0
  68. package/dist/core/types/tool.js +6 -0
  69. package/dist/core/types/tool.js.map +1 -0
  70. package/dist/detection/declarative.d.ts +27 -0
  71. package/dist/detection/declarative.js +339 -0
  72. package/dist/detection/declarative.js.map +1 -0
  73. package/dist/detection/imperative.d.ts +38 -0
  74. package/dist/detection/imperative.js +103 -0
  75. package/dist/detection/imperative.js.map +1 -0
  76. package/dist/detection/index.d.ts +5 -0
  77. package/dist/detection/index.js +6 -0
  78. package/dist/detection/index.js.map +1 -0
  79. package/dist/index.d.ts +12 -0
  80. package/dist/index.js +19 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/llm/advice-service.d.ts +41 -0
  83. package/dist/llm/advice-service.js +286 -0
  84. package/dist/llm/advice-service.js.map +1 -0
  85. package/dist/llm/evaluator.d.ts +89 -0
  86. package/dist/llm/evaluator.js +274 -0
  87. package/dist/llm/evaluator.js.map +1 -0
  88. package/dist/llm/index.d.ts +11 -0
  89. package/dist/llm/index.js +15 -0
  90. package/dist/llm/index.js.map +1 -0
  91. package/dist/llm/json-response.d.ts +12 -0
  92. package/dist/llm/json-response.js +67 -0
  93. package/dist/llm/json-response.js.map +1 -0
  94. package/dist/llm/providers/mock.d.ts +29 -0
  95. package/dist/llm/providers/mock.js +324 -0
  96. package/dist/llm/providers/mock.js.map +1 -0
  97. package/dist/llm/providers/openrouter.d.ts +53 -0
  98. package/dist/llm/providers/openrouter.js +321 -0
  99. package/dist/llm/providers/openrouter.js.map +1 -0
  100. package/dist/llm/request-cache.d.ts +28 -0
  101. package/dist/llm/request-cache.js +99 -0
  102. package/dist/llm/request-cache.js.map +1 -0
  103. package/dist/llm/types.d.ts +233 -0
  104. package/dist/llm/types.js +7 -0
  105. package/dist/llm/types.js.map +1 -0
  106. package/dist/rules/best-practices/BP-001.d.ts +11 -0
  107. package/dist/rules/best-practices/BP-001.js +56 -0
  108. package/dist/rules/best-practices/BP-001.js.map +1 -0
  109. package/dist/rules/best-practices/BP-002.d.ts +11 -0
  110. package/dist/rules/best-practices/BP-002.js +63 -0
  111. package/dist/rules/best-practices/BP-002.js.map +1 -0
  112. package/dist/rules/best-practices/BP-003.d.ts +11 -0
  113. package/dist/rules/best-practices/BP-003.js +68 -0
  114. package/dist/rules/best-practices/BP-003.js.map +1 -0
  115. package/dist/rules/coverage/COV-001.d.ts +9 -0
  116. package/dist/rules/coverage/COV-001.js +64 -0
  117. package/dist/rules/coverage/COV-001.js.map +1 -0
  118. package/dist/rules/description/DESC-003.d.ts +13 -0
  119. package/dist/rules/description/DESC-003.js +96 -0
  120. package/dist/rules/description/DESC-003.js.map +1 -0
  121. package/dist/rules/description/DESC-004.d.ts +8 -0
  122. package/dist/rules/description/DESC-004.js +61 -0
  123. package/dist/rules/description/DESC-004.js.map +1 -0
  124. package/dist/rules/description/DESC-005.d.ts +12 -0
  125. package/dist/rules/description/DESC-005.js +70 -0
  126. package/dist/rules/description/DESC-005.js.map +1 -0
  127. package/dist/rules/description/index.d.ts +4 -0
  128. package/dist/rules/description/index.js +5 -0
  129. package/dist/rules/description/index.js.map +1 -0
  130. package/dist/rules/implementation/IMP-001.d.ts +10 -0
  131. package/dist/rules/implementation/IMP-001.js +36 -0
  132. package/dist/rules/implementation/IMP-001.js.map +1 -0
  133. package/dist/rules/implementation/IMP-003.d.ts +9 -0
  134. package/dist/rules/implementation/IMP-003.js +45 -0
  135. package/dist/rules/implementation/IMP-003.js.map +1 -0
  136. package/dist/rules/implementation/IMP-004.d.ts +9 -0
  137. package/dist/rules/implementation/IMP-004.js +48 -0
  138. package/dist/rules/implementation/IMP-004.js.map +1 -0
  139. package/dist/rules/implementation/IMP-005.d.ts +9 -0
  140. package/dist/rules/implementation/IMP-005.js +54 -0
  141. package/dist/rules/implementation/IMP-005.js.map +1 -0
  142. package/dist/rules/implementation/IMP-007.d.ts +8 -0
  143. package/dist/rules/implementation/IMP-007.js +79 -0
  144. package/dist/rules/implementation/IMP-007.js.map +1 -0
  145. package/dist/rules/implementation/IMP-013.d.ts +9 -0
  146. package/dist/rules/implementation/IMP-013.js +55 -0
  147. package/dist/rules/implementation/IMP-013.js.map +1 -0
  148. package/dist/rules/implementation/index.d.ts +9 -0
  149. package/dist/rules/implementation/index.js +10 -0
  150. package/dist/rules/implementation/index.js.map +1 -0
  151. package/dist/rules/index.d.ts +51 -0
  152. package/dist/rules/index.js +100 -0
  153. package/dist/rules/index.js.map +1 -0
  154. package/dist/rules/llm/LLM-001.d.ts +14 -0
  155. package/dist/rules/llm/LLM-001.js +78 -0
  156. package/dist/rules/llm/LLM-001.js.map +1 -0
  157. package/dist/rules/llm/LLM-002.d.ts +14 -0
  158. package/dist/rules/llm/LLM-002.js +77 -0
  159. package/dist/rules/llm/LLM-002.js.map +1 -0
  160. package/dist/rules/llm/LLM-003.d.ts +16 -0
  161. package/dist/rules/llm/LLM-003.js +82 -0
  162. package/dist/rules/llm/LLM-003.js.map +1 -0
  163. package/dist/rules/llm/LLM-004.d.ts +14 -0
  164. package/dist/rules/llm/LLM-004.js +87 -0
  165. package/dist/rules/llm/LLM-004.js.map +1 -0
  166. package/dist/rules/llm/LLM-005.d.ts +16 -0
  167. package/dist/rules/llm/LLM-005.js +105 -0
  168. package/dist/rules/llm/LLM-005.js.map +1 -0
  169. package/dist/rules/llm/index.d.ts +10 -0
  170. package/dist/rules/llm/index.js +11 -0
  171. package/dist/rules/llm/index.js.map +1 -0
  172. package/dist/rules/runner.d.ts +54 -0
  173. package/dist/rules/runner.js +138 -0
  174. package/dist/rules/runner.js.map +1 -0
  175. package/dist/rules/schema/SCHEMA-001.d.ts +9 -0
  176. package/dist/rules/schema/SCHEMA-001.js +57 -0
  177. package/dist/rules/schema/SCHEMA-001.js.map +1 -0
  178. package/dist/rules/schema/SCHEMA-002.d.ts +9 -0
  179. package/dist/rules/schema/SCHEMA-002.js +59 -0
  180. package/dist/rules/schema/SCHEMA-002.js.map +1 -0
  181. package/dist/rules/schema/SCHEMA-003.d.ts +10 -0
  182. package/dist/rules/schema/SCHEMA-003.js +66 -0
  183. package/dist/rules/schema/SCHEMA-003.js.map +1 -0
  184. package/dist/rules/schema/SCHEMA-011.d.ts +10 -0
  185. package/dist/rules/schema/SCHEMA-011.js +62 -0
  186. package/dist/rules/schema/SCHEMA-011.js.map +1 -0
  187. package/dist/rules/security/SEC-001.d.ts +12 -0
  188. package/dist/rules/security/SEC-001.js +66 -0
  189. package/dist/rules/security/SEC-001.js.map +1 -0
  190. package/dist/rules/utils/keywords.d.ts +35 -0
  191. package/dist/rules/utils/keywords.js +100 -0
  192. package/dist/rules/utils/keywords.js.map +1 -0
  193. package/dist/scoring/calculator.d.ts +27 -0
  194. package/dist/scoring/calculator.js +215 -0
  195. package/dist/scoring/calculator.js.map +1 -0
  196. package/dist/scoring/grades.d.ts +34 -0
  197. package/dist/scoring/grades.js +167 -0
  198. package/dist/scoring/grades.js.map +1 -0
  199. package/dist/scoring/index.d.ts +5 -0
  200. package/dist/scoring/index.js +6 -0
  201. package/dist/scoring/index.js.map +1 -0
  202. package/dist/ui/banner.d.ts +21 -0
  203. package/dist/ui/banner.js +60 -0
  204. package/dist/ui/banner.js.map +1 -0
  205. package/dist/ui/findings.d.ts +23 -0
  206. package/dist/ui/findings.js +189 -0
  207. package/dist/ui/findings.js.map +1 -0
  208. package/dist/ui/index.d.ts +7 -0
  209. package/dist/ui/index.js +8 -0
  210. package/dist/ui/index.js.map +1 -0
  211. package/dist/ui/ink/App.d.ts +14 -0
  212. package/dist/ui/ink/App.js +113 -0
  213. package/dist/ui/ink/App.js.map +1 -0
  214. package/dist/ui/ink/FullScreenLayout.d.ts +16 -0
  215. package/dist/ui/ink/FullScreenLayout.js +38 -0
  216. package/dist/ui/ink/FullScreenLayout.js.map +1 -0
  217. package/dist/ui/ink/InteractiveApp.d.ts +28 -0
  218. package/dist/ui/ink/InteractiveApp.js +229 -0
  219. package/dist/ui/ink/InteractiveApp.js.map +1 -0
  220. package/dist/ui/ink/RealAuditApp.d.ts +19 -0
  221. package/dist/ui/ink/RealAuditApp.js +182 -0
  222. package/dist/ui/ink/RealAuditApp.js.map +1 -0
  223. package/dist/ui/ink/components/AnimatedProgressBar.d.ts +20 -0
  224. package/dist/ui/ink/components/AnimatedProgressBar.js +46 -0
  225. package/dist/ui/ink/components/AnimatedProgressBar.js.map +1 -0
  226. package/dist/ui/ink/components/AsciiLogo.d.ts +12 -0
  227. package/dist/ui/ink/components/AsciiLogo.js +35 -0
  228. package/dist/ui/ink/components/AsciiLogo.js.map +1 -0
  229. package/dist/ui/ink/components/CategoryBars.d.ts +18 -0
  230. package/dist/ui/ink/components/CategoryBars.js +18 -0
  231. package/dist/ui/ink/components/CategoryBars.js.map +1 -0
  232. package/dist/ui/ink/components/FindingsTable.d.ts +18 -0
  233. package/dist/ui/ink/components/FindingsTable.js +19 -0
  234. package/dist/ui/ink/components/FindingsTable.js.map +1 -0
  235. package/dist/ui/ink/components/Footer.d.ts +15 -0
  236. package/dist/ui/ink/components/Footer.js +20 -0
  237. package/dist/ui/ink/components/Footer.js.map +1 -0
  238. package/dist/ui/ink/components/Header.d.ts +11 -0
  239. package/dist/ui/ink/components/Header.js +21 -0
  240. package/dist/ui/ink/components/Header.js.map +1 -0
  241. package/dist/ui/ink/components/LinkList.d.ts +17 -0
  242. package/dist/ui/ink/components/LinkList.js +44 -0
  243. package/dist/ui/ink/components/LinkList.js.map +1 -0
  244. package/dist/ui/ink/components/Navigation.d.ts +26 -0
  245. package/dist/ui/ink/components/Navigation.js +62 -0
  246. package/dist/ui/ink/components/Navigation.js.map +1 -0
  247. package/dist/ui/ink/components/ProgressBar.d.ts +15 -0
  248. package/dist/ui/ink/components/ProgressBar.js +14 -0
  249. package/dist/ui/ink/components/ProgressBar.js.map +1 -0
  250. package/dist/ui/ink/components/ScoreCard.d.ts +30 -0
  251. package/dist/ui/ink/components/ScoreCard.js +26 -0
  252. package/dist/ui/ink/components/ScoreCard.js.map +1 -0
  253. package/dist/ui/ink/components/SimulationResults.d.ts +33 -0
  254. package/dist/ui/ink/components/SimulationResults.js +21 -0
  255. package/dist/ui/ink/components/SimulationResults.js.map +1 -0
  256. package/dist/ui/ink/components/Spinner.d.ts +11 -0
  257. package/dist/ui/ink/components/Spinner.js +12 -0
  258. package/dist/ui/ink/components/Spinner.js.map +1 -0
  259. package/dist/ui/ink/components/ToolCard.d.ts +23 -0
  260. package/dist/ui/ink/components/ToolCard.js +18 -0
  261. package/dist/ui/ink/components/ToolCard.js.map +1 -0
  262. package/dist/ui/ink/components/shared/Badge.d.ts +21 -0
  263. package/dist/ui/ink/components/shared/Badge.js +38 -0
  264. package/dist/ui/ink/components/shared/Badge.js.map +1 -0
  265. package/dist/ui/ink/components/shared/Card.d.ts +18 -0
  266. package/dist/ui/ink/components/shared/Card.js +11 -0
  267. package/dist/ui/ink/components/shared/Card.js.map +1 -0
  268. package/dist/ui/ink/components/shared/HelpOverlay.d.ts +10 -0
  269. package/dist/ui/ink/components/shared/HelpOverlay.js +28 -0
  270. package/dist/ui/ink/components/shared/HelpOverlay.js.map +1 -0
  271. package/dist/ui/ink/components/shared/LoadingWithTimeout.d.ts +11 -0
  272. package/dist/ui/ink/components/shared/LoadingWithTimeout.js +21 -0
  273. package/dist/ui/ink/components/shared/LoadingWithTimeout.js.map +1 -0
  274. package/dist/ui/ink/components/shared/Menu.d.ts +23 -0
  275. package/dist/ui/ink/components/shared/Menu.js +43 -0
  276. package/dist/ui/ink/components/shared/Menu.js.map +1 -0
  277. package/dist/ui/ink/components/shared/Table.d.ts +23 -0
  278. package/dist/ui/ink/components/shared/Table.js +40 -0
  279. package/dist/ui/ink/components/shared/Table.js.map +1 -0
  280. package/dist/ui/ink/components/views/CrawlingView.d.ts +12 -0
  281. package/dist/ui/ink/components/views/CrawlingView.js +43 -0
  282. package/dist/ui/ink/components/views/CrawlingView.js.map +1 -0
  283. package/dist/ui/ink/components/views/DashboardView.d.ts +21 -0
  284. package/dist/ui/ink/components/views/DashboardView.js +51 -0
  285. package/dist/ui/ink/components/views/DashboardView.js.map +1 -0
  286. package/dist/ui/ink/components/views/FindingDetailView.d.ts +16 -0
  287. package/dist/ui/ink/components/views/FindingDetailView.js +34 -0
  288. package/dist/ui/ink/components/views/FindingDetailView.js.map +1 -0
  289. package/dist/ui/ink/components/views/FindingsView.d.ts +16 -0
  290. package/dist/ui/ink/components/views/FindingsView.js +79 -0
  291. package/dist/ui/ink/components/views/FindingsView.js.map +1 -0
  292. package/dist/ui/ink/components/views/OnboardingView.d.ts +12 -0
  293. package/dist/ui/ink/components/views/OnboardingView.js +40 -0
  294. package/dist/ui/ink/components/views/OnboardingView.js.map +1 -0
  295. package/dist/ui/ink/components/views/SimulationView.d.ts +17 -0
  296. package/dist/ui/ink/components/views/SimulationView.js +53 -0
  297. package/dist/ui/ink/components/views/SimulationView.js.map +1 -0
  298. package/dist/ui/ink/components/views/TestCaseDetailView.d.ts +11 -0
  299. package/dist/ui/ink/components/views/TestCaseDetailView.js +53 -0
  300. package/dist/ui/ink/components/views/TestCaseDetailView.js.map +1 -0
  301. package/dist/ui/ink/components/views/ToolDetailView.d.ts +15 -0
  302. package/dist/ui/ink/components/views/ToolDetailView.js +25 -0
  303. package/dist/ui/ink/components/views/ToolDetailView.js.map +1 -0
  304. package/dist/ui/ink/components/views/ToolsView.d.ts +15 -0
  305. package/dist/ui/ink/components/views/ToolsView.js +43 -0
  306. package/dist/ui/ink/components/views/ToolsView.js.map +1 -0
  307. package/dist/ui/ink/demo.d.ts +6 -0
  308. package/dist/ui/ink/demo.js +254 -0
  309. package/dist/ui/ink/demo.js.map +1 -0
  310. package/dist/ui/ink/hooks/useAnimation.d.ts +29 -0
  311. package/dist/ui/ink/hooks/useAnimation.js +89 -0
  312. package/dist/ui/ink/hooks/useAnimation.js.map +1 -0
  313. package/dist/ui/ink/hooks/useAudit.d.ts +69 -0
  314. package/dist/ui/ink/hooks/useAudit.js +99 -0
  315. package/dist/ui/ink/hooks/useAudit.js.map +1 -0
  316. package/dist/ui/ink/hooks/useCrawlAnimation.d.ts +19 -0
  317. package/dist/ui/ink/hooks/useCrawlAnimation.js +204 -0
  318. package/dist/ui/ink/hooks/useCrawlAnimation.js.map +1 -0
  319. package/dist/ui/ink/hooks/useKeyboardNav.d.ts +23 -0
  320. package/dist/ui/ink/hooks/useKeyboardNav.js +81 -0
  321. package/dist/ui/ink/hooks/useKeyboardNav.js.map +1 -0
  322. package/dist/ui/ink/hooks/useNavigation.d.ts +16 -0
  323. package/dist/ui/ink/hooks/useNavigation.js +42 -0
  324. package/dist/ui/ink/hooks/useNavigation.js.map +1 -0
  325. package/dist/ui/ink/hooks/useTerminalSize.d.ts +10 -0
  326. package/dist/ui/ink/hooks/useTerminalSize.js +29 -0
  327. package/dist/ui/ink/hooks/useTerminalSize.js.map +1 -0
  328. package/dist/ui/ink/index.d.ts +43 -0
  329. package/dist/ui/ink/index.js +50 -0
  330. package/dist/ui/ink/index.js.map +1 -0
  331. package/dist/ui/ink/render.d.ts +24 -0
  332. package/dist/ui/ink/render.js +14 -0
  333. package/dist/ui/ink/render.js.map +1 -0
  334. package/dist/ui/ink/theme.d.ts +35 -0
  335. package/dist/ui/ink/theme.js +57 -0
  336. package/dist/ui/ink/theme.js.map +1 -0
  337. package/dist/ui/ink/types.d.ts +77 -0
  338. package/dist/ui/ink/types.js +5 -0
  339. package/dist/ui/ink/types.js.map +1 -0
  340. package/dist/ui/score-display.d.ts +16 -0
  341. package/dist/ui/score-display.js +220 -0
  342. package/dist/ui/score-display.js.map +1 -0
  343. package/dist/ui/spinner.d.ts +45 -0
  344. package/dist/ui/spinner.js +110 -0
  345. package/dist/ui/spinner.js.map +1 -0
  346. package/package.json +63 -9
  347. package/index.js +0 -105
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Agent Simulator
3
+ *
4
+ * Simulates AI agent interactions with WebMCP tools using function calling.
5
+ * Tests whether an LLM can correctly route to tools and extract parameters.
6
+ */
7
+ import { LLMClient, type LLMToolCall } from '../llm-client.js';
8
+ import type { DetectedTool } from '../../core/types/tool.js';
9
+ import type { TestCase } from './test-case-generator.js';
10
+ export interface SimulationConfig {
11
+ maxRounds: number;
12
+ mockToolResponses: boolean;
13
+ model: string;
14
+ siteContext: string;
15
+ maxCost?: number;
16
+ }
17
+ export interface SimulationRound {
18
+ roundNumber: number;
19
+ userMessage: string;
20
+ agentResponse: {
21
+ text: string | null;
22
+ toolCalls: LLMToolCall[];
23
+ };
24
+ toolResults: ToolResult[];
25
+ evaluation: RoundEvaluation;
26
+ }
27
+ export interface ToolResult {
28
+ toolName: string;
29
+ input: Record<string, unknown>;
30
+ output: string;
31
+ success: boolean;
32
+ }
33
+ export interface RoundEvaluation {
34
+ correctToolSelected: boolean | null;
35
+ parameterAccuracy: number;
36
+ hallucinatedParams: string[];
37
+ missingRequiredParams: string[];
38
+ unnecessaryRound: boolean;
39
+ }
40
+ export interface SimulationResult {
41
+ testCase: TestCase;
42
+ model: string;
43
+ rounds: SimulationRound[];
44
+ totalRounds: number;
45
+ toolInvocations: number;
46
+ correctToolOnFirstTry: boolean;
47
+ finalSuccess: boolean;
48
+ totalLatencyMs: number;
49
+ totalCost: number;
50
+ evaluation: {
51
+ routingAccuracy: number;
52
+ parameterAccuracy: number;
53
+ hallucinationRate: number;
54
+ roundEfficiency: number;
55
+ overallScore: number;
56
+ failureReason: string | null;
57
+ };
58
+ }
59
+ /**
60
+ * Run a single simulation for a test case
61
+ */
62
+ export declare function runSimulation(testCase: TestCase, tools: DetectedTool[], config: SimulationConfig, llm?: LLMClient): Promise<SimulationResult>;
63
+ /**
64
+ * Run simulations for multiple test cases
65
+ */
66
+ export declare function runSimulations(testCases: TestCase[], tools: DetectedTool[], config: SimulationConfig, onProgress?: (completed: number, total: number) => void): Promise<SimulationResult[]>;
67
+ export default runSimulation;
@@ -0,0 +1,368 @@
1
+ /**
2
+ * Agent Simulator
3
+ *
4
+ * Simulates AI agent interactions with WebMCP tools using function calling.
5
+ * Tests whether an LLM can correctly route to tools and extract parameters.
6
+ */
7
+ import { LLMClient, createLLMClient } from '../llm-client.js';
8
+ // ═══════════════════════════════════════════════════════
9
+ // AGENT SYSTEM PROMPT
10
+ // ═══════════════════════════════════════════════════════
11
+ function buildAgentSystemPrompt(siteContext) {
12
+ return `You are an AI assistant integrated into a web browser. The user is currently viewing a ${siteContext} website. You have access to the website's functionality through the tools provided.
13
+
14
+ BEHAVIOR RULES:
15
+ 1. When the user asks you to do something, check if any of the available tools can help accomplish their goal.
16
+ 2. If a tool can help, invoke it with the correct parameters extracted from the user's request.
17
+ 3. If required parameters are missing from the user's request, ask the user for them — do NOT guess or hallucinate values.
18
+ 4. If optional parameters are missing, you may omit them or use reasonable defaults.
19
+ 5. If no tool matches the user's request, tell them honestly that you can't help with that specific task on this website.
20
+ 6. If the user's request is ambiguous and could match multiple tools, ask for clarification.
21
+ 7. After invoking a tool, summarize the result for the user in natural language.
22
+
23
+ IMPORTANT:
24
+ - Only use the tools you've been given. Do NOT make up tools that don't exist.
25
+ - Use the exact parameter names and types defined in each tool's schema.
26
+ - Do NOT provide parameters that the user didn't mention or that you can't reasonably infer.
27
+ - If a parameter expects specific formats (like airport codes, dates), try to convert the user's input to that format.`;
28
+ }
29
+ // ═══════════════════════════════════════════════════════
30
+ // MOCK RESPONSE GENERATOR
31
+ // ═══════════════════════════════════════════════════════
32
+ function generateMockResponse(toolCall, tools) {
33
+ const tool = tools.find(t => t.name === toolCall.toolName);
34
+ if (!tool) {
35
+ return JSON.stringify({
36
+ error: 'Tool not found',
37
+ message: `Unknown tool: ${toolCall.toolName}`,
38
+ });
39
+ }
40
+ // Generate a plausible mock response based on tool name
41
+ const name = toolCall.toolName.toLowerCase();
42
+ if (name.includes('search') || name.includes('find') || name.includes('list')) {
43
+ return JSON.stringify({
44
+ results: [
45
+ { id: 'result-1', name: 'Example Result 1', description: 'First result' },
46
+ { id: 'result-2', name: 'Example Result 2', description: 'Second result' },
47
+ { id: 'result-3', name: 'Example Result 3', description: 'Third result' },
48
+ ],
49
+ total: 3,
50
+ message: `Found 3 results for your query`,
51
+ });
52
+ }
53
+ if (name.includes('create') || name.includes('add') || name.includes('book')) {
54
+ return JSON.stringify({
55
+ success: true,
56
+ id: 'new-item-123',
57
+ message: 'Successfully created new item',
58
+ details: toolCall.toolInput,
59
+ });
60
+ }
61
+ if (name.includes('get') || name.includes('fetch') || name.includes('retrieve')) {
62
+ return JSON.stringify({
63
+ id: toolCall.toolInput['id'] || 'item-1',
64
+ name: 'Retrieved Item',
65
+ status: 'active',
66
+ createdAt: '2026-01-15T10:00:00Z',
67
+ });
68
+ }
69
+ if (name.includes('update') || name.includes('edit') || name.includes('modify')) {
70
+ return JSON.stringify({
71
+ success: true,
72
+ message: 'Successfully updated item',
73
+ changes: toolCall.toolInput,
74
+ });
75
+ }
76
+ if (name.includes('delete') || name.includes('remove') || name.includes('cancel')) {
77
+ return JSON.stringify({
78
+ success: true,
79
+ message: 'Successfully deleted item',
80
+ id: toolCall.toolInput['id'] || 'deleted-item',
81
+ });
82
+ }
83
+ // Default response
84
+ return JSON.stringify({
85
+ success: true,
86
+ message: `Tool ${toolCall.toolName} executed successfully`,
87
+ input: toolCall.toolInput,
88
+ });
89
+ }
90
+ // ═══════════════════════════════════════════════════════
91
+ // EVALUATION FUNCTIONS
92
+ // ═══════════════════════════════════════════════════════
93
+ function evaluateRound(roundNumber, toolCalls, testCase, _tools) {
94
+ const expected = testCase.expectedBehavior;
95
+ // No tool calls
96
+ if (toolCalls.length === 0) {
97
+ return {
98
+ correctToolSelected: expected.shouldInvokeTool ? false : null,
99
+ parameterAccuracy: 0,
100
+ hallucinatedParams: [],
101
+ missingRequiredParams: Object.keys(expected.expectedParams),
102
+ unnecessaryRound: roundNumber > 1,
103
+ };
104
+ }
105
+ // Check first tool call (primary action)
106
+ const firstCall = toolCalls[0];
107
+ if (!firstCall) {
108
+ return {
109
+ correctToolSelected: expected.shouldInvokeTool ? false : null,
110
+ parameterAccuracy: 0,
111
+ hallucinatedParams: [],
112
+ missingRequiredParams: Object.keys(expected.expectedParams),
113
+ unnecessaryRound: roundNumber > 1,
114
+ };
115
+ }
116
+ const correctTool = firstCall.toolName === expected.toolName;
117
+ // Evaluate parameter accuracy
118
+ const expectedParams = expected.expectedParams;
119
+ const actualParams = firstCall.toolInput;
120
+ let correctParams = 0;
121
+ let totalExpected = Object.keys(expectedParams).length;
122
+ const hallucinatedParams = [];
123
+ const missingParams = [];
124
+ // Check expected params
125
+ for (const [key, value] of Object.entries(expectedParams)) {
126
+ if (key in actualParams) {
127
+ // Simple equality check (could be more sophisticated)
128
+ if (actualParams[key] === value ||
129
+ String(actualParams[key]).toLowerCase() === String(value).toLowerCase()) {
130
+ correctParams++;
131
+ }
132
+ }
133
+ else {
134
+ missingParams.push(key);
135
+ }
136
+ }
137
+ // Check for hallucinated params (params not in expected)
138
+ for (const key of Object.keys(actualParams)) {
139
+ if (!(key in expectedParams)) {
140
+ // Only flag if this param wasn't provided by user
141
+ hallucinatedParams.push(key);
142
+ }
143
+ }
144
+ const paramAccuracy = totalExpected > 0 ? correctParams / totalExpected : 1;
145
+ return {
146
+ correctToolSelected: correctTool,
147
+ parameterAccuracy: paramAccuracy,
148
+ hallucinatedParams,
149
+ missingRequiredParams: missingParams,
150
+ unnecessaryRound: roundNumber > 1 && correctTool && paramAccuracy > 0.8,
151
+ };
152
+ }
153
+ function buildSimulationResult(testCase, model, rounds, totalLatency, totalCost) {
154
+ // Aggregate metrics
155
+ const toolInvocations = rounds.reduce((sum, r) => sum + r.agentResponse.toolCalls.length, 0);
156
+ const correctToolOnFirstTry = rounds[0]?.evaluation.correctToolSelected === true;
157
+ // Check if final result was successful
158
+ const lastRound = rounds[rounds.length - 1];
159
+ const expected = testCase.expectedBehavior;
160
+ let finalSuccess = false;
161
+ let failureReason = null;
162
+ if (!expected.shouldInvokeTool) {
163
+ // Out of scope - success if no tool was called
164
+ finalSuccess = toolInvocations === 0;
165
+ if (!finalSuccess) {
166
+ failureReason = 'Called a tool when none should have been used';
167
+ }
168
+ }
169
+ else {
170
+ // Should invoke tool - check if correct tool was ever called
171
+ const correctToolCalled = rounds.some(r => r.agentResponse.toolCalls.some(tc => tc.toolName === expected.toolName));
172
+ if (!correctToolCalled) {
173
+ failureReason = `Never called expected tool: ${expected.toolName}`;
174
+ }
175
+ else {
176
+ // Check parameter accuracy of the correct call
177
+ const correctCallRound = rounds.find(r => r.agentResponse.toolCalls.some(tc => tc.toolName === expected.toolName));
178
+ if (correctCallRound && correctCallRound.evaluation.parameterAccuracy >= 0.5) {
179
+ finalSuccess = true;
180
+ }
181
+ else {
182
+ failureReason = 'Called correct tool but with wrong parameters';
183
+ }
184
+ }
185
+ }
186
+ // Calculate aggregate scores
187
+ const routingAccuracy = correctToolOnFirstTry ? 1 :
188
+ rounds.some(r => r.evaluation.correctToolSelected) ? 0.5 : 0;
189
+ const avgParamAccuracy = rounds.length > 0
190
+ ? rounds.reduce((sum, r) => sum + r.evaluation.parameterAccuracy, 0) / rounds.length
191
+ : 0;
192
+ const totalHallucinated = rounds.reduce((sum, r) => sum + r.evaluation.hallucinatedParams.length, 0);
193
+ const totalParams = rounds.reduce((sum, r) => sum + Object.keys(r.agentResponse.toolCalls[0]?.toolInput || {}).length, 0);
194
+ const hallucinationRate = totalParams > 0 ? totalHallucinated / totalParams : 0;
195
+ // Round efficiency: 1.0 = solved in 1 round, less for more rounds
196
+ const optimalRounds = 1;
197
+ const roundEfficiency = optimalRounds / Math.max(rounds.length, 1);
198
+ // Overall score (weighted)
199
+ const overallScore = Math.round((routingAccuracy * 40 +
200
+ avgParamAccuracy * 30 +
201
+ (1 - hallucinationRate) * 15 +
202
+ roundEfficiency * 15) * 100 / 100);
203
+ return {
204
+ testCase,
205
+ model,
206
+ rounds,
207
+ totalRounds: rounds.length,
208
+ toolInvocations,
209
+ correctToolOnFirstTry,
210
+ finalSuccess,
211
+ totalLatencyMs: totalLatency,
212
+ totalCost,
213
+ evaluation: {
214
+ routingAccuracy,
215
+ parameterAccuracy: avgParamAccuracy,
216
+ hallucinationRate,
217
+ roundEfficiency,
218
+ overallScore,
219
+ failureReason,
220
+ },
221
+ };
222
+ }
223
+ // ═══════════════════════════════════════════════════════
224
+ // SIMULATION RUNNER
225
+ // ═══════════════════════════════════════════════════════
226
+ /**
227
+ * Run a single simulation for a test case
228
+ */
229
+ export async function runSimulation(testCase, tools, config, llm) {
230
+ const client = llm || createLLMClient({ model: config.model });
231
+ // Convert tools to LLM format
232
+ const llmTools = tools.map(t => ({
233
+ name: t.name,
234
+ description: t.description,
235
+ input_schema: t.inputSchema || { type: 'object', properties: {} },
236
+ }));
237
+ const messages = [
238
+ { role: 'system', content: buildAgentSystemPrompt(config.siteContext) },
239
+ ];
240
+ const rounds = [];
241
+ let currentMessage = testCase.prompt;
242
+ let totalLatency = 0;
243
+ let totalCost = 0;
244
+ let isComplete = false;
245
+ for (let round = 1; round <= config.maxRounds && !isComplete; round++) {
246
+ // Add user message
247
+ messages.push({ role: 'user', content: currentMessage });
248
+ try {
249
+ // Get agent response with tools
250
+ const response = await client.chatWithTools(messages, llmTools);
251
+ totalLatency += response.latencyMs;
252
+ totalCost += response.cost;
253
+ // Check cost limit
254
+ if (config.maxCost && totalCost >= config.maxCost) {
255
+ break;
256
+ }
257
+ // Process tool calls
258
+ const toolResults = [];
259
+ if (response.toolCalls.length > 0) {
260
+ for (const toolCall of response.toolCalls) {
261
+ // Add assistant message with tool call
262
+ messages.push({
263
+ role: 'assistant',
264
+ content: null,
265
+ tool_calls: [{
266
+ id: `call_${round}_${toolCall.toolName}`,
267
+ type: 'function',
268
+ function: {
269
+ name: toolCall.toolName,
270
+ arguments: JSON.stringify(toolCall.toolInput),
271
+ },
272
+ }],
273
+ });
274
+ // Generate mock tool response
275
+ const toolOutput = config.mockToolResponses
276
+ ? generateMockResponse(toolCall, tools)
277
+ : JSON.stringify({ error: 'Real tool execution not implemented' });
278
+ toolResults.push({
279
+ toolName: toolCall.toolName,
280
+ input: toolCall.toolInput,
281
+ output: toolOutput,
282
+ success: true,
283
+ });
284
+ // Add tool result to conversation
285
+ messages.push({
286
+ role: 'tool',
287
+ content: toolOutput,
288
+ tool_call_id: `call_${round}_${toolCall.toolName}`,
289
+ });
290
+ }
291
+ // Get agent's follow-up response
292
+ const followUp = await client.chatWithTools(messages, llmTools);
293
+ totalLatency += followUp.latencyMs;
294
+ totalCost += followUp.cost;
295
+ messages.push({ role: 'assistant', content: followUp.text });
296
+ // Complete if no more tool calls
297
+ if (followUp.toolCalls.length === 0) {
298
+ isComplete = true;
299
+ }
300
+ rounds.push({
301
+ roundNumber: round,
302
+ userMessage: currentMessage,
303
+ agentResponse: { text: followUp.text, toolCalls: response.toolCalls },
304
+ toolResults,
305
+ evaluation: evaluateRound(round, response.toolCalls, testCase, tools),
306
+ });
307
+ }
308
+ else {
309
+ // Agent responded with text only
310
+ messages.push({ role: 'assistant', content: response.text });
311
+ rounds.push({
312
+ roundNumber: round,
313
+ userMessage: currentMessage,
314
+ agentResponse: { text: response.text, toolCalls: [] },
315
+ toolResults: [],
316
+ evaluation: evaluateRound(round, [], testCase, tools),
317
+ });
318
+ // If agent asked a clarifying question, we'd need to respond
319
+ // For now, we complete after text-only response
320
+ isComplete = true;
321
+ }
322
+ }
323
+ catch (error) {
324
+ // Handle API errors gracefully
325
+ rounds.push({
326
+ roundNumber: round,
327
+ userMessage: currentMessage,
328
+ agentResponse: { text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`, toolCalls: [] },
329
+ toolResults: [],
330
+ evaluation: {
331
+ correctToolSelected: null,
332
+ parameterAccuracy: 0,
333
+ hallucinatedParams: [],
334
+ missingRequiredParams: [],
335
+ unnecessaryRound: false,
336
+ },
337
+ });
338
+ isComplete = true;
339
+ }
340
+ }
341
+ return buildSimulationResult(testCase, config.model, rounds, totalLatency, totalCost);
342
+ }
343
+ /**
344
+ * Run simulations for multiple test cases
345
+ */
346
+ export async function runSimulations(testCases, tools, config, onProgress) {
347
+ const results = [];
348
+ const llm = createLLMClient({ model: config.model });
349
+ let totalCost = 0;
350
+ for (let i = 0; i < testCases.length; i++) {
351
+ // Check cost limit
352
+ if (config.maxCost && totalCost >= config.maxCost) {
353
+ break;
354
+ }
355
+ const testCase = testCases[i];
356
+ if (!testCase)
357
+ continue;
358
+ const result = await runSimulation(testCase, tools, config, llm);
359
+ results.push(result);
360
+ totalCost += result.totalCost;
361
+ if (onProgress) {
362
+ onProgress(i + 1, testCases.length);
363
+ }
364
+ }
365
+ return results;
366
+ }
367
+ export default runSimulation;
368
+ //# sourceMappingURL=agent-simulator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-simulator.js","sourceRoot":"","sources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a,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC;QAE9B,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Agent Features Module
3
+ *
4
+ * Exports all agent simulation features.
5
+ */
6
+ export { generateTestCases, type TestCase, type TestCaseCategory, type TestCaseGenerationConfig, } from './test-case-generator.js';
7
+ export { runSimulation, runSimulations, type SimulationConfig, type SimulationResult, type SimulationRound, type ToolResult, type RoundEvaluation, } from './agent-simulator.js';
8
+ export { judgeSimulation, judgeSimulations, type SimulationJudgment, type JudgmentResult, type KeyMoment, type ToolImprovement, type AggregateJudgment, type FailurePattern, } from './simulation-judge.js';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Agent Features Module
3
+ *
4
+ * Exports all agent simulation features.
5
+ */
6
+ export { generateTestCases, } from './test-case-generator.js';
7
+ export { runSimulation, runSimulations, } from './agent-simulator.js';
8
+ export { judgeSimulation, judgeSimulations, } from './simulation-judge.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agent/features/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,iBAAiB,GAIlB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,aAAa,EACb,cAAc,GAMf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,eAAe,EACf,gBAAgB,GAOjB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Simulation Judge
3
+ *
4
+ * Uses LLM to evaluate simulation results and provide structured scoring
5
+ * with actionable improvement suggestions.
6
+ */
7
+ import { LLMClient } from '../llm-client.js';
8
+ import type { DetectedTool } from '../../core/types/tool.js';
9
+ import type { SimulationResult } from './agent-simulator.js';
10
+ export interface JudgmentResult {
11
+ toolSelection: {
12
+ score: number;
13
+ reasoning: string;
14
+ };
15
+ parameterAccuracy: {
16
+ score: number;
17
+ reasoning: string;
18
+ };
19
+ conversationEfficiency: {
20
+ score: number;
21
+ reasoning: string;
22
+ };
23
+ errorHandling: {
24
+ score: number;
25
+ reasoning: string;
26
+ };
27
+ userExperience: {
28
+ score: number;
29
+ reasoning: string;
30
+ };
31
+ toolDefinitionQuality: {
32
+ score: number;
33
+ reasoning: string;
34
+ };
35
+ }
36
+ export interface SimulationJudgment {
37
+ scores: JudgmentResult;
38
+ overallScore: number;
39
+ verdict: 'PASS' | 'PARTIAL' | 'FAIL';
40
+ keyMoments: KeyMoment[];
41
+ toolImprovements: ToolImprovement[];
42
+ summary: string;
43
+ }
44
+ export interface KeyMoment {
45
+ moment: string;
46
+ impact: 'positive' | 'negative' | 'neutral';
47
+ severity: 'minor' | 'major' | 'critical';
48
+ toolFix?: string;
49
+ }
50
+ export interface ToolImprovement {
51
+ tool: string;
52
+ issue: string;
53
+ suggestedFix: string;
54
+ estimatedImpact: string;
55
+ }
56
+ export interface AggregateJudgment {
57
+ totalSimulations: number;
58
+ passRate: number;
59
+ avgScore: number;
60
+ failurePatterns: FailurePattern[];
61
+ topImprovements: ToolImprovement[];
62
+ summary: string;
63
+ }
64
+ export interface FailurePattern {
65
+ pattern: string;
66
+ frequency: number;
67
+ affectedTools: string[];
68
+ suggestedFix: string;
69
+ }
70
+ /**
71
+ * Judge a single simulation result
72
+ */
73
+ export declare function judgeSimulation(simulation: SimulationResult, tools: DetectedTool[], llm?: LLMClient): Promise<SimulationJudgment>;
74
+ /**
75
+ * Judge multiple simulations and provide aggregate analysis
76
+ */
77
+ export declare function judgeSimulations(simulations: SimulationResult[], tools: DetectedTool[], llm?: LLMClient): Promise<AggregateJudgment>;
78
+ export default judgeSimulation;