@langwatch/mcp-server 2.0.0 → 2.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 (177) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/README.md +31 -3
  3. package/dist/{archive-project-4EQGLBJJ.js → archive-project-W3IKI7UL.js} +3 -3
  4. package/dist/archive-run-plan-474OKHHU.js +16 -0
  5. package/dist/{archive-scenario-W6BXYDZ3.js → archive-scenario-V5UNYK26.js} +3 -3
  6. package/dist/archive-test-suite-O7FLDMXK.js +16 -0
  7. package/dist/{assign-prompt-tag-VLXUWEKU.js → assign-prompt-tag-Q46WRB6P.js} +2 -2
  8. package/dist/chunk-56OGTS24.js +44 -0
  9. package/dist/chunk-6DJDEXET.js +63 -0
  10. package/dist/chunk-7E4FZIYJ.js +15 -0
  11. package/dist/{chunk-77BNWQ3U.js → chunk-AN4OUA4D.js} +2 -2
  12. package/dist/chunk-CKNAH5TG.js +74 -0
  13. package/dist/{chunk-TOXJQDIZ.js → chunk-EYXMLE5X.js} +85 -10
  14. package/dist/{chunk-7RHG56OH.js → chunk-G4ZAZTZW.js} +2 -2
  15. package/dist/{chunk-A2LEVYQ5.js → chunk-GELJ2MQR.js} +11 -2
  16. package/dist/chunk-HV4DWKBI.js +46 -0
  17. package/dist/chunk-JR6DJZOU.js +49 -0
  18. package/dist/{chunk-SFB4MU6H.js → chunk-JTQJRNFJ.js} +2 -2
  19. package/dist/{chunk-TJCXFNDT.js → chunk-K37ZNPXK.js} +2 -2
  20. package/dist/{chunk-CDYQOY5U.js → chunk-OJLYYJWI.js} +2 -2
  21. package/dist/{chunk-ZWIL4EFL.js → chunk-QAMP3CGR.js} +2 -2
  22. package/dist/{chunk-4QC7SA2L.js → chunk-QRO35SOM.js} +345 -144
  23. package/dist/{chunk-J42FWRJ2.js → chunk-RVAE2MEA.js} +2 -2
  24. package/dist/{chunk-AQJO2EI5.js → chunk-S4GVX36W.js} +2 -2
  25. package/dist/{chunk-YX3A3CFM.js → chunk-SR6QPRIE.js} +2 -2
  26. package/dist/chunk-UF6XIGYR.js +58 -0
  27. package/dist/{chunk-5CCZFUXS.js → chunk-UFOYFYI7.js} +2 -2
  28. package/dist/{create-agent-7XHO6UIS.js → create-agent-JFJ2K6X3.js} +3 -3
  29. package/dist/{create-annotation-YQXRQC6A.js → create-annotation-EUXXQ6NS.js} +3 -3
  30. package/dist/{create-api-key-YUS36KBU.js → create-api-key-BGBB76JX.js} +3 -3
  31. package/dist/{create-dashboard-4Z5JO5LB.js → create-dashboard-Z76AIPLS.js} +3 -3
  32. package/dist/{create-dataset-E6NMSVX7.js → create-dataset-FD5VAXU4.js} +3 -3
  33. package/dist/{create-dataset-records-SKHPRD2K.js → create-dataset-records-WQUXXOHI.js} +3 -3
  34. package/dist/{create-evaluator-JXF5PF33.js → create-evaluator-6NV33Z52.js} +3 -3
  35. package/dist/create-mcp-server.js +7 -2
  36. package/dist/{create-project-CS2CB57Y.js → create-project-ZQ7TFIO2.js} +3 -3
  37. package/dist/{create-prompt-F5RMX3L3.js → create-prompt-BS6QRCUU.js} +2 -2
  38. package/dist/{create-prompt-tag-GMRWTEFR.js → create-prompt-tag-FCQ5ELSQ.js} +2 -2
  39. package/dist/{create-scenario-JDR2VB2H.js → create-scenario-DRPTPXU3.js} +10 -3
  40. package/dist/create-test-suite-ZIZCCFJ4.js +37 -0
  41. package/dist/{delete-agent-O3EEH4S5.js → delete-agent-SA4JMUZF.js} +3 -3
  42. package/dist/{delete-annotation-XP6FQM7A.js → delete-annotation-X3KKK7QY.js} +3 -3
  43. package/dist/{delete-dashboard-RFUNYCNP.js → delete-dashboard-LYMRPF27.js} +3 -3
  44. package/dist/{delete-dataset-3MJFRDLP.js → delete-dataset-W6EZ44HY.js} +3 -3
  45. package/dist/{delete-dataset-records-WPMU5GL5.js → delete-dataset-records-7CNOTALB.js} +3 -3
  46. package/dist/{delete-evaluator-33SP2JFX.js → delete-evaluator-RKYC4TNB.js} +3 -3
  47. package/dist/{delete-prompt-tag-KNMZVSPB.js → delete-prompt-tag-QB3OCZUV.js} +2 -2
  48. package/dist/{delete-workflow-3NUXO46U.js → delete-workflow-NG2VXYYM.js} +3 -3
  49. package/dist/{discover-evaluator-schema-XTAD4X7D.js → discover-evaluator-schema-ESSHQGPY.js} +7 -286
  50. package/dist/{discover-scenario-schema-FE64QK2D.js → discover-scenario-schema-W7KBXA4J.js} +53 -1
  51. package/dist/get-agent-7THF7HCU.js +66 -0
  52. package/dist/{get-analytics-TETCSOK6.js → get-analytics-R6AZD3AW.js} +2 -2
  53. package/dist/{get-dashboard-KHBEGZGL.js → get-dashboard-P4WWVHFU.js} +3 -3
  54. package/dist/{get-dataset-RCMU5VAH.js → get-dataset-AKTYSQDI.js} +3 -3
  55. package/dist/{get-evaluator-ADMKVWYZ.js → get-evaluator-RZ44UIN6.js} +3 -3
  56. package/dist/{get-project-RAK7URQJ.js → get-project-QSQEAB33.js} +3 -3
  57. package/dist/get-prompt-GVKXF5NL.js +100 -0
  58. package/dist/get-run-plan-NY7J5GRE.js +61 -0
  59. package/dist/{get-scenario-ZTAJJL5T.js → get-scenario-Q3LLQE4T.js} +7 -3
  60. package/dist/{get-simulation-run-T2ZQWYH2.js → get-simulation-run-WINEYDMK.js} +12 -3
  61. package/dist/get-test-suite-4HKA7OKS.js +49 -0
  62. package/dist/{get-trace-K7U234Q4.js → get-trace-RCUV7N4O.js} +2 -2
  63. package/dist/{get-workflow-L5L2PSK3.js → get-workflow-EEOC7Y45.js} +3 -3
  64. package/dist/{http-server-YXHFPPGA.js → http-server-WCDUARTH.js} +8 -3
  65. package/dist/index.js +3366 -1910
  66. package/dist/{langwatch-api-annotations-FDAS6NQ7.js → langwatch-api-annotations-6DHVZWUK.js} +3 -3
  67. package/dist/{langwatch-api-dashboards-JTVCS7ZJ.js → langwatch-api-dashboards-2KJL2M42.js} +3 -3
  68. package/dist/{langwatch-api-monitors-3J7UIQME.js → langwatch-api-monitors-6ISFJ7WX.js} +2 -2
  69. package/dist/{langwatch-api-secrets-BUBSNCNO.js → langwatch-api-secrets-OEBD6GBU.js} +2 -2
  70. package/dist/{langwatch-api-triggers-EDFUCJN6.js → langwatch-api-triggers-5E6DDGX6.js} +2 -2
  71. package/dist/{langwatch-api-workflows-NBJX5KOG.js → langwatch-api-workflows-6UJL5U4Z.js} +3 -3
  72. package/dist/list-agents-AMVDQPQL.js +43 -0
  73. package/dist/{list-annotations-ZTVP4EEL.js → list-annotations-6PR5NLIC.js} +3 -3
  74. package/dist/{list-api-keys-CWD4UQT5.js → list-api-keys-GVPNBIHQ.js} +3 -3
  75. package/dist/{list-dashboards-PWG6P6KR.js → list-dashboards-Z3BZKDGF.js} +3 -3
  76. package/dist/{list-dataset-records-IOE7LQXS.js → list-dataset-records-O67HZ35Y.js} +3 -3
  77. package/dist/{list-datasets-ZT4JYUDT.js → list-datasets-WXZL6UMP.js} +3 -3
  78. package/dist/{list-evaluators-SJHC7VBH.js → list-evaluators-PAX72WCN.js} +3 -3
  79. package/dist/{list-model-providers-PPD2WPD2.js → list-model-providers-VVLZMLCX.js} +3 -3
  80. package/dist/{list-projects-K7QAIX2I.js → list-projects-AQVI6SUK.js} +3 -3
  81. package/dist/{list-prompt-tags-FOO6TNHB.js → list-prompt-tags-WZFBJOHG.js} +2 -2
  82. package/dist/{list-prompts-SC2HAUFG.js → list-prompts-BQOHRHYT.js} +2 -2
  83. package/dist/list-run-plans-UBAU2DGH.js +46 -0
  84. package/dist/{list-scenarios-F2WYNRIE.js → list-scenarios-MS4IUIVM.js} +8 -5
  85. package/dist/{list-simulation-runs-KF5THG5H.js → list-simulation-runs-D6YF4ZOU.js} +11 -5
  86. package/dist/list-test-suites-L7R2O6DR.js +35 -0
  87. package/dist/{list-workflows-QSJWURCK.js → list-workflows-6MV4XJHF.js} +3 -3
  88. package/dist/{rename-prompt-tag-EKWU5QF3.js → rename-prompt-tag-K5LQ4CY6.js} +2 -2
  89. package/dist/rename-test-suite-NTYHAO5X.js +21 -0
  90. package/dist/report-issue-RHZZ33IS.js +885 -0
  91. package/dist/rerun-run-plan-MUDWJBE4.js +22 -0
  92. package/dist/{revoke-api-key-FTRTZMOF.js → revoke-api-key-6LAZ3QZZ.js} +3 -3
  93. package/dist/run-agent-CAGWGTYT.js +72 -0
  94. package/dist/run-plan-T4ZYOZGA.js +39 -0
  95. package/dist/run-test-suite-L4MZ7G4D.js +26 -0
  96. package/dist/{run-workflow-QPXC627O.js → run-workflow-DFIS23AP.js} +3 -3
  97. package/dist/{search-traces-A6HFKPLJ.js → search-traces-4XTJYXIK.js} +2 -2
  98. package/dist/{set-model-provider-3WKT63ZN.js → set-model-provider-XRNMFOVR.js} +3 -3
  99. package/dist/{update-agent-SMAEHLXH.js → update-agent-DUWNYBNA.js} +3 -3
  100. package/dist/{update-dataset-BDUK7TUO.js → update-dataset-YSOMDCOB.js} +3 -3
  101. package/dist/{update-dataset-record-4ZSDRBSW.js → update-dataset-record-DEA2ITYR.js} +3 -3
  102. package/dist/{update-evaluator-LS6TIBY7.js → update-evaluator-NH7Q5GWV.js} +3 -3
  103. package/dist/{update-project-LKVYXENH.js → update-project-Q26FBSYH.js} +3 -3
  104. package/dist/update-prompt-ZQQ2C3KU.js +143 -0
  105. package/dist/{update-scenario-NEXCAQI7.js → update-scenario-WUX34JAR.js} +10 -3
  106. package/package.json +8 -9
  107. package/pyproject.toml +4 -4
  108. package/src/__tests__/agent-tools.unit.test.ts +257 -0
  109. package/src/__tests__/all-tools.integration.test.ts +321 -75
  110. package/src/__tests__/integration.integration.test.ts +7 -11
  111. package/src/__tests__/prompt-response-types.unit.test.ts +51 -0
  112. package/src/__tests__/prompts.integration.test.ts +736 -0
  113. package/src/__tests__/run-plan-tools.unit.test.ts +565 -0
  114. package/src/__tests__/scenario-tools.unit.test.ts +19 -0
  115. package/src/__tests__/simulation-run-tools.unit.test.ts +116 -0
  116. package/src/__tests__/test-suite-tools.unit.test.ts +615 -0
  117. package/src/__tests__/{tools.unit.test.ts → tools.integration.test.ts} +31 -59
  118. package/src/create-mcp-server.ts +334 -55
  119. package/src/langwatch-api-agents.ts +196 -12
  120. package/src/langwatch-api-run-plans.ts +157 -0
  121. package/src/langwatch-api-scenarios.ts +9 -0
  122. package/src/langwatch-api-simulation-runs.ts +5 -0
  123. package/src/langwatch-api-test-suites.ts +135 -0
  124. package/src/langwatch-api.ts +62 -12
  125. package/src/schemas/index.ts +5 -0
  126. package/src/schemas/run-plan.ts +92 -0
  127. package/src/schemas/suite-fields.ts +149 -0
  128. package/src/tools/archive-run-plan.ts +12 -0
  129. package/src/tools/archive-test-suite.ts +12 -0
  130. package/src/tools/create-scenario.ts +8 -0
  131. package/src/tools/create-test-suite.ts +43 -0
  132. package/src/tools/discover-scenario-schema.ts +54 -0
  133. package/src/tools/format-run-plan.ts +68 -0
  134. package/src/tools/format-scenario.ts +14 -0
  135. package/src/tools/format-suite-details.ts +96 -0
  136. package/src/tools/get-agent.ts +45 -3
  137. package/src/tools/get-prompt.ts +108 -24
  138. package/src/tools/get-run-plan.ts +62 -0
  139. package/src/tools/get-scenario.ts +3 -0
  140. package/src/tools/get-simulation-run.ts +9 -0
  141. package/src/tools/get-test-suite.ts +49 -0
  142. package/src/tools/list-agents.ts +20 -3
  143. package/src/tools/list-run-plans.ts +47 -0
  144. package/src/tools/list-scenarios.ts +12 -2
  145. package/src/tools/list-simulation-runs.ts +6 -2
  146. package/src/tools/list-test-suites.ts +35 -0
  147. package/src/tools/rename-test-suite.ts +18 -0
  148. package/src/tools/rerun-run-plan.ts +21 -0
  149. package/src/tools/run-agent.ts +54 -6
  150. package/src/tools/run-plan.ts +49 -0
  151. package/src/tools/run-test-suite.ts +30 -0
  152. package/src/tools/test-agent.ts +18 -0
  153. package/src/tools/update-prompt.ts +195 -10
  154. package/src/tools/update-scenario.ts +8 -0
  155. package/src/tools/update-test-suite.ts +45 -0
  156. package/tsconfig.json +5 -0
  157. package/uv.lock +416 -296
  158. package/dist/archive-suite-4T6BSRS7.js +0 -16
  159. package/dist/chunk-YZLYHLLI.js +0 -48
  160. package/dist/create-suite-LZS6QIAF.js +0 -39
  161. package/dist/get-agent-Y7MWZ65F.js +0 -29
  162. package/dist/get-prompt-OY5B7TRI.js +0 -46
  163. package/dist/get-suite-J7JVWO6O.js +0 -45
  164. package/dist/list-agents-KFHKGPXV.js +0 -33
  165. package/dist/list-suites-CRY4VWW6.js +0 -43
  166. package/dist/report-issue-XYVAPAYJ.js +0 -412
  167. package/dist/run-agent-6SM4XNA7.js +0 -37
  168. package/dist/run-suite-NKZCJ2IN.js +0 -30
  169. package/dist/update-prompt-ODCRQRN6.js +0 -25
  170. package/dist/update-suite-SNO3GS7T.js +0 -40
  171. package/src/langwatch-api-suites.ts +0 -118
  172. package/src/tools/archive-suite.ts +0 -12
  173. package/src/tools/create-suite.ts +0 -42
  174. package/src/tools/get-suite.ts +0 -47
  175. package/src/tools/list-suites.ts +0 -43
  176. package/src/tools/run-suite.ts +0 -28
  177. package/src/tools/update-suite.ts +0 -44
package/CHANGELOG.md CHANGED
@@ -1,5 +1,94 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.0](https://github.com/langwatch/langwatch/compare/mcp-server@v2.0.0...mcp-server@v2.1.0) (2026-09-12)
4
+
5
+
6
+ ### Features
7
+
8
+ * **agent-testing:** compare agents in one run ([#7654](https://github.com/langwatch/langwatch/issues/7654)) ([3e73916](https://github.com/langwatch/langwatch/commit/3e7391698f5e9b1cac2f8c5f0d0cacc9dec4d02a))
9
+ * **agent-testing:** suite fields and evaluators on scenario runs ([#7867](https://github.com/langwatch/langwatch/issues/7867)) ([0bcf01e](https://github.com/langwatch/langwatch/commit/0bcf01edb3d8cc36aa62cd48e6ee147a7b01b45b))
10
+ * **agent-testing:** v2 polish round 6 ([#7590](https://github.com/langwatch/langwatch/issues/7590)) ([1f9efad](https://github.com/langwatch/langwatch/commit/1f9efad30ab94e86d00f57ea478bf0685b437f23))
11
+ * **agents:** connected agents, a decorated function is a simulation target ([#7655](https://github.com/langwatch/langwatch/issues/7655)) ([56922c0](https://github.com/langwatch/langwatch/commit/56922c0ee429bd5a38717960c09ede0d1905c0c3))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **agents:** a finished connected-agent run reaches its verdict, and the transcript stays whole ([#7696](https://github.com/langwatch/langwatch/issues/7696)) ([4f7b665](https://github.com/langwatch/langwatch/commit/4f7b665623e1e453e8f505c259f2351bd074ad72))
17
+ * **agents:** a key waits for its grants, and a listing shows who holds each agent ([#7907](https://github.com/langwatch/langwatch/issues/7907)) ([654e82a](https://github.com/langwatch/langwatch/commit/654e82ae9f53c98c0cc710dc9c0c520a87e2c6cb))
18
+ * **mcp:** stop prompt tools dropping fields in both directions ([#7712](https://github.com/langwatch/langwatch/issues/7712)) ([a97c378](https://github.com/langwatch/langwatch/commit/a97c378d8ee9c3613c2235738e0ea4085b45684e))
19
+ * optional legacy answer fields, one vocabulary for test suites and run plans, and named targets for runs from code ([#7638](https://github.com/langwatch/langwatch/issues/7638)) ([6fd37f3](https://github.com/langwatch/langwatch/commit/6fd37f30428c9fc468230fa9e4a79e3dee8cc58f))
20
+
21
+
22
+ ### Miscellaneous
23
+
24
+ * **deps-dev:** bump @anthropic-ai/claude-code ([aac07f5](https://github.com/langwatch/langwatch/commit/aac07f53aa0c7fa4cc988cb365865ff521a0922a))
25
+ * **deps-dev:** bump @anthropic-ai/claude-code ([fbc7dcf](https://github.com/langwatch/langwatch/commit/fbc7dcf5f18f9be74ed7d1a390f922d3c9db7ea8))
26
+ * **deps-dev:** bump @anthropic-ai/claude-code from 2.1.202 to 2.1.226 in the anthropic group across 1 directory ([#6546](https://github.com/langwatch/langwatch/issues/6546)) ([fbc7dcf](https://github.com/langwatch/langwatch/commit/fbc7dcf5f18f9be74ed7d1a390f922d3c9db7ea8))
27
+ * **deps-dev:** bump @anthropic-ai/claude-code from 2.1.226 to 2.1.228 in the anthropic group across 1 directory ([#7264](https://github.com/langwatch/langwatch/issues/7264)) ([aac07f5](https://github.com/langwatch/langwatch/commit/aac07f53aa0c7fa4cc988cb365865ff521a0922a))
28
+ * **deps-dev:** bump the types group across 1 directory with 2 updates ([#6789](https://github.com/langwatch/langwatch/issues/6789)) ([7be2d04](https://github.com/langwatch/langwatch/commit/7be2d04c798b46a29b9b5b046dbb28a1e6c369e7))
29
+ * **deps-dev:** update black requirement from >=26.3.1 to >=26.5.1 in /mcp/typescript ([#7232](https://github.com/langwatch/langwatch/issues/7232)) ([1444629](https://github.com/langwatch/langwatch/commit/14446291f6eafddd99463e7ee83288653ba62346))
30
+ * **deps-dev:** update black requirement in /mcp/typescript ([1444629](https://github.com/langwatch/langwatch/commit/14446291f6eafddd99463e7ee83288653ba62346))
31
+ * **deps-dev:** update cloudpickle requirement from >=3.1.1 to >=3.1.2 in /mcp/typescript ([#7209](https://github.com/langwatch/langwatch/issues/7209)) ([bc02a83](https://github.com/langwatch/langwatch/commit/bc02a8309ad0f69ce350557b35c1bc7d9ea1777b))
32
+ * **deps-dev:** update cloudpickle requirement in /mcp/typescript ([bc02a83](https://github.com/langwatch/langwatch/commit/bc02a8309ad0f69ce350557b35c1bc7d9ea1777b))
33
+ * **deps-dev:** update dspy-ai requirement from <4,>=3.0.3 to >=3.3.0,<4 in /mcp/typescript ([#7225](https://github.com/langwatch/langwatch/issues/7225)) ([81f1590](https://github.com/langwatch/langwatch/commit/81f1590cc08af237d6b6b4fbb81e814ebddbb893))
34
+ * **deps-dev:** update dspy-ai requirement in /mcp/typescript ([81f1590](https://github.com/langwatch/langwatch/commit/81f1590cc08af237d6b6b4fbb81e814ebddbb893))
35
+ * **deps-dev:** update faiss-cpu requirement from <2.0.0,>=1.8.0 to >=1.15.0,<2.0.0 in /mcp/typescript ([#7227](https://github.com/langwatch/langwatch/issues/7227)) ([80b6ae4](https://github.com/langwatch/langwatch/commit/80b6ae45742964508f0a5b44015b433c4887ee19))
36
+ * **deps-dev:** update faiss-cpu requirement in /mcp/typescript ([80b6ae4](https://github.com/langwatch/langwatch/commit/80b6ae45742964508f0a5b44015b433c4887ee19))
37
+ * **deps-dev:** update fastapi requirement from >=0.115.12 to >=0.141.1 in /mcp/typescript ([#7226](https://github.com/langwatch/langwatch/issues/7226)) ([62b3bbf](https://github.com/langwatch/langwatch/commit/62b3bbf4bee00c51316c1e06b3c67788013d8bdb))
38
+ * **deps-dev:** update fastapi requirement in /mcp/typescript ([62b3bbf](https://github.com/langwatch/langwatch/commit/62b3bbf4bee00c51316c1e06b3c67788013d8bdb))
39
+ * **deps-dev:** update fonttools requirement from >=4.62.0 to >=4.63.0 in /mcp/typescript ([#7235](https://github.com/langwatch/langwatch/issues/7235)) ([573fc99](https://github.com/langwatch/langwatch/commit/573fc997c07fbbfbe1dc71acb78635c2c329497c))
40
+ * **deps-dev:** update fonttools requirement in /mcp/typescript ([573fc99](https://github.com/langwatch/langwatch/commit/573fc997c07fbbfbe1dc71acb78635c2c329497c))
41
+ * **deps-dev:** update haystack-ai requirement from <4.0.0,>=2.13.2 to >=3.0.0,<4.0.0 in /mcp/typescript ([#7248](https://github.com/langwatch/langwatch/issues/7248)) ([72df892](https://github.com/langwatch/langwatch/commit/72df892f20134b0a335f3783ef9caa26141888f7))
42
+ * **deps-dev:** update haystack-ai requirement in /mcp/typescript ([72df892](https://github.com/langwatch/langwatch/commit/72df892f20134b0a335f3783ef9caa26141888f7))
43
+ * **deps-dev:** update json-repair requirement from >=0.42.0 to >=0.63.0 in /mcp/typescript ([#7247](https://github.com/langwatch/langwatch/issues/7247)) ([6376930](https://github.com/langwatch/langwatch/commit/6376930151c7d995264c6e1480c08091ecd5830d))
44
+ * **deps-dev:** update json-repair requirement in /mcp/typescript ([6376930](https://github.com/langwatch/langwatch/commit/6376930151c7d995264c6e1480c08091ecd5830d))
45
+ * **deps-dev:** update jupyter requirement from <2.0.0,>=1.0.0 to >=1.1.1,<2.0.0 in /mcp/typescript ([#7243](https://github.com/langwatch/langwatch/issues/7243)) ([7f39887](https://github.com/langwatch/langwatch/commit/7f3988779cc72824bbe3dc5b30c4f0ffbb5bab1c))
46
+ * **deps-dev:** update jupyter requirement in /mcp/typescript ([7f39887](https://github.com/langwatch/langwatch/commit/7f3988779cc72824bbe3dc5b30c4f0ffbb5bab1c))
47
+ * **deps-dev:** update jupyterlab requirement from >=4.5.6 to >=4.6.3 in /mcp/typescript ([#7242](https://github.com/langwatch/langwatch/issues/7242)) ([d714c43](https://github.com/langwatch/langwatch/commit/d714c436982dbda46ce714a4664fa6eb10e47122))
48
+ * **deps-dev:** update jupyterlab requirement in /mcp/typescript ([d714c43](https://github.com/langwatch/langwatch/commit/d714c436982dbda46ce714a4664fa6eb10e47122))
49
+ * **deps-dev:** update langchain-community requirement ([d63a5a8](https://github.com/langwatch/langwatch/commit/d63a5a85e6124030729111f98a4de516f10162bf))
50
+ * **deps-dev:** update langchain-community requirement from <1.0.0,>=0.3.0 to >=0.4.2,<1.0.0 in /mcp/typescript ([#7222](https://github.com/langwatch/langwatch/issues/7222)) ([d63a5a8](https://github.com/langwatch/langwatch/commit/d63a5a85e6124030729111f98a4de516f10162bf))
51
+ * **deps-dev:** update langchain-openai requirement from <2.0.0,>=1.1.14 to >=1.4.3,<2.0.0 in /mcp/typescript ([#7218](https://github.com/langwatch/langwatch/issues/7218)) ([d62efb1](https://github.com/langwatch/langwatch/commit/d62efb14d5cdaf9345a213f86f21804d00890833))
52
+ * **deps-dev:** update langchain-openai requirement in /mcp/typescript ([d62efb1](https://github.com/langwatch/langwatch/commit/d62efb14d5cdaf9345a213f86f21804d00890833))
53
+ * **deps-dev:** update langsmith requirement from >=0.8.0 to >=0.10.18 in /mcp/typescript ([#7230](https://github.com/langwatch/langwatch/issues/7230)) ([f0e1d71](https://github.com/langwatch/langwatch/commit/f0e1d717a416e45f916bd2f777abb5c26598a4d4))
54
+ * **deps-dev:** update langsmith requirement in /mcp/typescript ([f0e1d71](https://github.com/langwatch/langwatch/commit/f0e1d717a416e45f916bd2f777abb5c26598a4d4))
55
+ * **deps-dev:** update nltk requirement from >=3.9.4 to >=3.10.2 in /mcp/typescript ([#7215](https://github.com/langwatch/langwatch/issues/7215)) ([61e9f51](https://github.com/langwatch/langwatch/commit/61e9f515d026cc71f48bffe56f0debff5621f741))
56
+ * **deps-dev:** update nltk requirement in /mcp/typescript ([61e9f51](https://github.com/langwatch/langwatch/commit/61e9f515d026cc71f48bffe56f0debff5621f741))
57
+ * **deps-dev:** update openinference-instrumentation-dspy requirement ([2926e6e](https://github.com/langwatch/langwatch/commit/2926e6efc2aa44faf231c8ed87d26f9f4e588523))
58
+ * **deps-dev:** update openinference-instrumentation-dspy requirement from <0.2.0,>=0.1.23 to >=0.1.39,<0.2.0 in /mcp/typescript ([#7224](https://github.com/langwatch/langwatch/issues/7224)) ([2926e6e](https://github.com/langwatch/langwatch/commit/2926e6efc2aa44faf231c8ed87d26f9f4e588523))
59
+ * **deps-dev:** update openinference-instrumentation-litellm requirement ([8e55d60](https://github.com/langwatch/langwatch/commit/8e55d60f32982070202c61ef53886fb22a74f931))
60
+ * **deps-dev:** update openinference-instrumentation-litellm requirement from >=0.1.19 to >=0.1.36 in /mcp/typescript ([#7250](https://github.com/langwatch/langwatch/issues/7250)) ([8e55d60](https://github.com/langwatch/langwatch/commit/8e55d60f32982070202c61ef53886fb22a74f931))
61
+ * **deps-dev:** update opentelemetry-instrumentation-fastapi requirement ([7a17c8e](https://github.com/langwatch/langwatch/commit/7a17c8edc72629b1500f2f5ee02e398d874d0cb0))
62
+ * **deps-dev:** update opentelemetry-instrumentation-fastapi requirement from >=0.53b1 to >=0.65b0 in /mcp/typescript ([#7228](https://github.com/langwatch/langwatch/issues/7228)) ([7a17c8e](https://github.com/langwatch/langwatch/commit/7a17c8edc72629b1500f2f5ee02e398d874d0cb0))
63
+ * **deps-dev:** update opentelemetry-instrumentation-langchain requirement ([d779795](https://github.com/langwatch/langwatch/commit/d7797954d2099355c3f342cc7a2d580e81926ab0))
64
+ * **deps-dev:** update opentelemetry-instrumentation-langchain requirement from >=0.40.4 to >=0.62.3 in /mcp/typescript ([#7241](https://github.com/langwatch/langwatch/issues/7241)) ([d779795](https://github.com/langwatch/langwatch/commit/d7797954d2099355c3f342cc7a2d580e81926ab0))
65
+ * **deps-dev:** update pypdf requirement from >=6.8.0 to >=6.15.0 in /mcp/typescript ([#7213](https://github.com/langwatch/langwatch/issues/7213)) ([f5160d6](https://github.com/langwatch/langwatch/commit/f5160d686e0d488afc4e6da02e58fc7e973272c2))
66
+ * **deps-dev:** update pypdf requirement in /mcp/typescript ([f5160d6](https://github.com/langwatch/langwatch/commit/f5160d686e0d488afc4e6da02e58fc7e973272c2))
67
+ * **deps-dev:** update pytest requirement from <10.0.0,>=7.4.2 to >=9.1.1,<10.0.0 in /mcp/typescript ([#7211](https://github.com/langwatch/langwatch/issues/7211)) ([d30d016](https://github.com/langwatch/langwatch/commit/d30d0165f77dbd035e25c3fe2ae93ac23d438378))
68
+ * **deps-dev:** update pytest requirement in /mcp/typescript ([d30d016](https://github.com/langwatch/langwatch/commit/d30d0165f77dbd035e25c3fe2ae93ac23d438378))
69
+ * **deps-dev:** update pytest-asyncio requirement from <1.5.0,>=0.21.1 to >=1.4.0,<1.5.0 in /mcp/typescript ([#7231](https://github.com/langwatch/langwatch/issues/7231)) ([752f2f9](https://github.com/langwatch/langwatch/commit/752f2f9e638b5ea98bf6d2d7a4cfc58a67dde7d1))
70
+ * **deps-dev:** update pytest-asyncio requirement in /mcp/typescript ([752f2f9](https://github.com/langwatch/langwatch/commit/752f2f9e638b5ea98bf6d2d7a4cfc58a67dde7d1))
71
+ * **deps-dev:** update strands-agents[otel] requirement ([fd972d9](https://github.com/langwatch/langwatch/commit/fd972d99251385b4dcd16e72a8a444cd4483944b))
72
+ * **deps-dev:** update strands-agents[otel] requirement from <2.0.0,>=1.14.0 to >=1.51.0,<2.0.0 in /mcp/typescript ([#7246](https://github.com/langwatch/langwatch/issues/7246)) ([fd972d9](https://github.com/langwatch/langwatch/commit/fd972d99251385b4dcd16e72a8a444cd4483944b))
73
+ * **deps-dev:** update streamlit requirement from <2.0.0,>=1.37.1 to >=1.61.1,<2.0.0 in /mcp/typescript ([#7233](https://github.com/langwatch/langwatch/issues/7233)) ([042aa3a](https://github.com/langwatch/langwatch/commit/042aa3aa875389929d85cd0896d04ae57490ca43))
74
+ * **deps-dev:** update streamlit requirement in /mcp/typescript ([042aa3a](https://github.com/langwatch/langwatch/commit/042aa3aa875389929d85cd0896d04ae57490ca43))
75
+ * **deps:** bump aiohttp from 3.14.1 to 3.14.3 in /mcp/typescript ([#7216](https://github.com/langwatch/langwatch/issues/7216)) ([590fa78](https://github.com/langwatch/langwatch/commit/590fa78069af737cddfe527f9665fd392355b07f))
76
+ * **deps:** bump attrs from 25.3.0 to 26.1.0 in /mcp/typescript ([#7234](https://github.com/langwatch/langwatch/issues/7234)) ([040afbd](https://github.com/langwatch/langwatch/commit/040afbd9d4292d6ae0ef1da958137e7a32873fc3))
77
+ * **deps:** bump chalk from 5.6.2 to 6.0.0 ([#6803](https://github.com/langwatch/langwatch/issues/6803)) ([82c62ea](https://github.com/langwatch/langwatch/commit/82c62eacb15d9a9ae33e5f4a14da82feaf1de033))
78
+ * **deps:** bump coolname from 2.2.0 to 5.0.0 in /mcp/typescript ([#7240](https://github.com/langwatch/langwatch/issues/7240)) ([0b7d6fa](https://github.com/langwatch/langwatch/commit/0b7d6fa30305ee1ca4d02b0a483593f0792a16dd))
79
+ * **deps:** bump cryptography from 48.0.1 to 50.0.0 in /mcp/typescript ([#7217](https://github.com/langwatch/langwatch/issues/7217)) ([dda8dad](https://github.com/langwatch/langwatch/commit/dda8dad79090bffbed3ed01870e24ee94990dde8))
80
+ * **deps:** bump ipykernel from 6.30.1 to 7.3.0 in /mcp/typescript ([#7221](https://github.com/langwatch/langwatch/issues/7221)) ([8d8442b](https://github.com/langwatch/langwatch/commit/8d8442bb5072ef8b684c17403440efc99bf00470))
81
+ * **deps:** bump mcp from 1.23.0 to 1.28.1 in /mcp/typescript ([#7219](https://github.com/langwatch/langwatch/issues/7219)) ([c243b25](https://github.com/langwatch/langwatch/commit/c243b259905caa263adc530a7a804c7eb9268321))
82
+ * **deps:** bump the minor-and-patch group ([8976b2f](https://github.com/langwatch/langwatch/commit/8976b2f420dc9b9eefd5584465b611b9064bf79e))
83
+ * **deps:** bump the minor-and-patch group in /mcp/typescript with 2 updates ([#7208](https://github.com/langwatch/langwatch/issues/7208)) ([8976b2f](https://github.com/langwatch/langwatch/commit/8976b2f420dc9b9eefd5584465b611b9064bf79e))
84
+ * **deps:** bump the opentelemetry group across 1 directory with 25 updates ([#7296](https://github.com/langwatch/langwatch/issues/7296)) ([12615f1](https://github.com/langwatch/langwatch/commit/12615f1fc27dfc26063d4135f3f322f7c71c7f01))
85
+ * **deps:** update langchain-core requirement from <2.0.0,>=0.3.0 to >=1.5.4,<2.0.0 in /mcp/typescript ([#7239](https://github.com/langwatch/langwatch/issues/7239)) ([ed9ba32](https://github.com/langwatch/langwatch/commit/ed9ba32c4851339a45c3914eb28da8a2ffaf040a))
86
+ * **deps:** update langchain-core requirement in /mcp/typescript ([ed9ba32](https://github.com/langwatch/langwatch/commit/ed9ba32c4851339a45c3914eb28da8a2ffaf040a))
87
+ * **deps:** update mcp[cli] requirement from >=1.13.1 to >=2.0.0 in /mcp/typescript ([#7212](https://github.com/langwatch/langwatch/issues/7212)) ([32859df](https://github.com/langwatch/langwatch/commit/32859dfc457260f098274d0f7df070b2cd9b489e))
88
+ * **deps:** update mcp[cli] requirement in /mcp/typescript ([32859df](https://github.com/langwatch/langwatch/commit/32859dfc457260f098274d0f7df070b2cd9b489e))
89
+ * **deps:** update ruff requirement from >=0.11.1 to >=0.16.2 in /mcp/typescript ([#7244](https://github.com/langwatch/langwatch/issues/7244)) ([5e33035](https://github.com/langwatch/langwatch/commit/5e33035b20bceb14c7c541d784c79d3817f35540))
90
+ * **deps:** update ruff requirement in /mcp/typescript ([5e33035](https://github.com/langwatch/langwatch/commit/5e33035b20bceb14c7c541d784c79d3817f35540))
91
+
3
92
  ## [2.0.0](https://github.com/langwatch/langwatch/compare/mcp-server@v1.0.0...mcp-server@v2.0.0) (2026-08-07)
4
93
 
5
94
 
package/README.md CHANGED
@@ -125,12 +125,40 @@ gets in. A spoofable rate limit does not let anyone authenticate.
125
125
 
126
126
  | Tool | Description |
127
127
  |------|-------------|
128
- | `platform_list_scenarios` | List all scenarios |
128
+ | `platform_list_scenarios` | List all scenarios, or only the ones filed in a test suite |
129
129
  | `platform_get_scenario` | Get scenario details |
130
- | `platform_create_scenario` | Create a new scenario |
131
- | `platform_update_scenario` | Update a scenario |
130
+ | `platform_create_scenario` | Create a new scenario, optionally filed in a test suite |
131
+ | `platform_update_scenario` | Update a scenario, or file it in another test suite |
132
132
  | `platform_archive_scenario` | Archive a scenario |
133
133
 
134
+ ### Test suites and run plans (requires API key)
135
+
136
+ A test suite is a folder of scenarios. A run plan is what you run, and its
137
+ name identifies it: running a name that exists replaces that plan's
138
+ configuration, running a new name creates the plan. Running a test suite is
139
+ sugar over a run plan, and creates or joins the plan `<suite name> <target name>`.
140
+
141
+ | Tool | Description |
142
+ |------|-------------|
143
+ | `platform_run_plan` | Run scenarios against targets, by plan name |
144
+ | `platform_list_run_plans` | List the run plans of the project |
145
+ | `platform_get_run_plan` | Get the full configuration of a run plan |
146
+ | `platform_rerun_run_plan` | Run a plan again with the configuration it holds |
147
+ | `platform_archive_run_plan` | Archive a run plan |
148
+ | `platform_list_test_suites` | List the test suites of the project |
149
+ | `platform_create_test_suite` | Create a test suite |
150
+ | `platform_get_test_suite` | Get a test suite and the scenarios filed in it |
151
+ | `platform_rename_test_suite` | Rename a test suite |
152
+ | `platform_archive_test_suite` | Archive a test suite and the scenarios filed in it |
153
+ | `platform_run_test_suite` | Run every scenario of a test suite against targets |
154
+
155
+ ### Simulation runs (requires API key)
156
+
157
+ | Tool | Description |
158
+ |------|-------------|
159
+ | `platform_list_simulation_runs` | List simulation run results |
160
+ | `platform_get_simulation_run` | Get one run with its conversation and verdict |
161
+
134
162
  ### Evaluators (requires API key)
135
163
 
136
164
  | Tool | Description |
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  archiveProject
3
- } from "./chunk-7RHG56OH.js";
4
- import "./chunk-A2LEVYQ5.js";
3
+ } from "./chunk-G4ZAZTZW.js";
4
+ import "./chunk-GELJ2MQR.js";
5
5
  import "./chunk-WT4PO4A3.js";
6
6
  import "./chunk-SAS5OB7F.js";
7
7
 
@@ -17,4 +17,4 @@ async function handleArchiveProject(params) {
17
17
  export {
18
18
  handleArchiveProject
19
19
  };
20
- //# sourceMappingURL=archive-project-4EQGLBJJ.js.map
20
+ //# sourceMappingURL=archive-project-W3IKI7UL.js.map
@@ -0,0 +1,16 @@
1
+ import {
2
+ archiveRunPlan
3
+ } from "./chunk-56OGTS24.js";
4
+ import "./chunk-GELJ2MQR.js";
5
+ import "./chunk-WT4PO4A3.js";
6
+ import "./chunk-SAS5OB7F.js";
7
+
8
+ // src/tools/archive-run-plan.ts
9
+ async function handleArchiveRunPlan(params) {
10
+ const result = await archiveRunPlan(params.id);
11
+ return `Run plan ${result.id} is archived. Its past runs stay readable, and the name is free for a new plan.`;
12
+ }
13
+ export {
14
+ handleArchiveRunPlan
15
+ };
16
+ //# sourceMappingURL=archive-run-plan-474OKHHU.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  archiveScenario
3
- } from "./chunk-J42FWRJ2.js";
4
- import "./chunk-A2LEVYQ5.js";
3
+ } from "./chunk-RVAE2MEA.js";
4
+ import "./chunk-GELJ2MQR.js";
5
5
  import "./chunk-WT4PO4A3.js";
6
6
  import "./chunk-SAS5OB7F.js";
7
7
 
@@ -17,4 +17,4 @@ async function handleArchiveScenario(params) {
17
17
  export {
18
18
  handleArchiveScenario
19
19
  };
20
- //# sourceMappingURL=archive-scenario-W6BXYDZ3.js.map
20
+ //# sourceMappingURL=archive-scenario-V5UNYK26.js.map
@@ -0,0 +1,16 @@
1
+ import {
2
+ archiveTestSuite
3
+ } from "./chunk-6DJDEXET.js";
4
+ import "./chunk-GELJ2MQR.js";
5
+ import "./chunk-WT4PO4A3.js";
6
+ import "./chunk-SAS5OB7F.js";
7
+
8
+ // src/tools/archive-test-suite.ts
9
+ async function handleArchiveTestSuite(params) {
10
+ const result = await archiveTestSuite(params.id);
11
+ return `Test suite ${result.id} is archived, and the scenarios filed in it are archived with it.`;
12
+ }
13
+ export {
14
+ handleArchiveTestSuite
15
+ };
16
+ //# sourceMappingURL=archive-test-suite-O7FLDMXK.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  assignPromptTag
3
- } from "./chunk-A2LEVYQ5.js";
3
+ } from "./chunk-GELJ2MQR.js";
4
4
  import "./chunk-WT4PO4A3.js";
5
5
  import "./chunk-SAS5OB7F.js";
6
6
 
@@ -17,4 +17,4 @@ async function handleAssignPromptTag(params) {
17
17
  export {
18
18
  handleAssignPromptTag
19
19
  };
20
- //# sourceMappingURL=assign-prompt-tag-VLXUWEKU.js.map
20
+ //# sourceMappingURL=assign-prompt-tag-Q46WRB6P.js.map
@@ -0,0 +1,44 @@
1
+ import {
2
+ makeRequest
3
+ } from "./chunk-GELJ2MQR.js";
4
+
5
+ // src/langwatch-api-run-plans.ts
6
+ async function listRunPlans(params) {
7
+ const query = params?.includeArchived ? "?includeArchived=true" : "";
8
+ return makeRequest("GET", `/api/v1/run-plans${query}`);
9
+ }
10
+ async function getRunPlan(id) {
11
+ return makeRequest(
12
+ "GET",
13
+ `/api/v1/run-plans/${encodeURIComponent(id)}`
14
+ );
15
+ }
16
+ async function runRunPlan(data) {
17
+ return makeRequest(
18
+ "POST",
19
+ "/api/v1/run-plans/run",
20
+ data
21
+ );
22
+ }
23
+ async function rerunRunPlan(id, data) {
24
+ return makeRequest(
25
+ "POST",
26
+ `/api/v1/run-plans/${encodeURIComponent(id)}/run`,
27
+ data ?? {}
28
+ );
29
+ }
30
+ async function archiveRunPlan(id) {
31
+ return makeRequest(
32
+ "DELETE",
33
+ `/api/v1/run-plans/${encodeURIComponent(id)}`
34
+ );
35
+ }
36
+
37
+ export {
38
+ listRunPlans,
39
+ getRunPlan,
40
+ runRunPlan,
41
+ rerunRunPlan,
42
+ archiveRunPlan
43
+ };
44
+ //# sourceMappingURL=chunk-56OGTS24.js.map
@@ -0,0 +1,63 @@
1
+ import {
2
+ makeRequest
3
+ } from "./chunk-GELJ2MQR.js";
4
+
5
+ // src/langwatch-api-test-suites.ts
6
+ async function listTestSuites() {
7
+ return makeRequest("GET", "/api/v1/test-suites");
8
+ }
9
+ async function createTestSuite(data) {
10
+ return makeRequest(
11
+ "POST",
12
+ "/api/v1/test-suites",
13
+ data
14
+ );
15
+ }
16
+ async function getTestSuite(id) {
17
+ return makeRequest(
18
+ "GET",
19
+ `/api/v1/test-suites/${encodeURIComponent(id)}`
20
+ );
21
+ }
22
+ async function updateTestSuite(params) {
23
+ const { id, ...data } = params;
24
+ return makeRequest(
25
+ "PATCH",
26
+ `/api/v1/test-suites/${encodeURIComponent(id)}`,
27
+ data
28
+ );
29
+ }
30
+ async function renameTestSuite(params) {
31
+ return makeRequest(
32
+ "PATCH",
33
+ `/api/v1/test-suites/${encodeURIComponent(params.id)}`,
34
+ { name: params.name }
35
+ );
36
+ }
37
+ async function archiveTestSuite(id) {
38
+ return makeRequest(
39
+ "DELETE",
40
+ `/api/v1/test-suites/${encodeURIComponent(id)}`
41
+ );
42
+ }
43
+ async function runTestSuite({
44
+ id,
45
+ ...data
46
+ }) {
47
+ return makeRequest(
48
+ "POST",
49
+ `/api/v1/test-suites/${encodeURIComponent(id)}/run`,
50
+ data
51
+ );
52
+ }
53
+
54
+ export {
55
+ listTestSuites,
56
+ createTestSuite,
57
+ getTestSuite,
58
+ updateTestSuite,
59
+ renameTestSuite,
60
+ archiveTestSuite,
61
+ runTestSuite
62
+ };
63
+ //# sourceMappingURL=chunk-6DJDEXET.js.map
@@ -0,0 +1,15 @@
1
+ // src/tools/format-scenario.ts
2
+ function formatScenarioFields(fields) {
3
+ if (!fields || Object.keys(fields).length === 0) return [];
4
+ return [
5
+ "\n## Fields",
6
+ ...Object.entries(fields).map(
7
+ ([identifier, value]) => `- ${identifier}: ${JSON.stringify(value)}`
8
+ )
9
+ ];
10
+ }
11
+
12
+ export {
13
+ formatScenarioFields
14
+ };
15
+ //# sourceMappingURL=chunk-7E4FZIYJ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  makeRequest
3
- } from "./chunk-A2LEVYQ5.js";
3
+ } from "./chunk-GELJ2MQR.js";
4
4
 
5
5
  // src/langwatch-api-datasets.ts
6
6
  async function listDatasets(params) {
@@ -83,4 +83,4 @@ export {
83
83
  deleteDatasetRecords,
84
84
  listDatasetRecords
85
85
  };
86
- //# sourceMappingURL=chunk-77BNWQ3U.js.map
86
+ //# sourceMappingURL=chunk-AN4OUA4D.js.map
@@ -0,0 +1,74 @@
1
+ // src/schemas/suite-fields.ts
2
+ import { z } from "zod";
3
+ var SUITE_FIELD_TYPES = ["text", "number", "boolean"];
4
+ var suiteFieldSchema = z.object({
5
+ identifier: z.string().min(1).max(64).regex(
6
+ /^[a-z][a-z0-9_]*$/,
7
+ "Lowercase letters, digits and underscores, starting with a letter"
8
+ ).describe(
9
+ "The field name, as scenarios and evaluator mappings address it, for example golden_sql. Lowercase letters, digits and underscores, starting with a letter. situation, criteria, name, input and output are reserved."
10
+ ),
11
+ type: z.enum(SUITE_FIELD_TYPES).describe("The value type every scenario carries for this field.")
12
+ });
13
+ var suiteFieldsSchema = z.array(suiteFieldSchema).max(30).describe(
14
+ "The fields the test suite declares, in order. Up to 30. Every scenario filed in the suite carries one value per field, and an evaluator attached to the suite reads them through its mappings."
15
+ );
16
+ var SCENARIO_MAPPING_SOURCE_IDS = [
17
+ "conversation",
18
+ "scenario",
19
+ "trace"
20
+ ];
21
+ var scenarioMappingSchema = z.discriminatedUnion("type", [
22
+ z.object({
23
+ type: z.literal("source"),
24
+ sourceId: z.enum(SCENARIO_MAPPING_SOURCE_IDS).describe(
25
+ "conversation, scenario or trace. See discover_schema({ category: 'scenarios' }) for the paths each one offers."
26
+ ),
27
+ path: z.array(z.string().min(1).max(256)).min(1).max(3).describe(
28
+ "The path inside the source. conversation: [first_user_message] | [last_agent_message] | [transcript] | [messages]. scenario: [situation] | [criteria] | [fields, <identifier>]. trace: [contexts] | [tool_calls, <toolName>, input|output]."
29
+ )
30
+ }),
31
+ z.object({
32
+ type: z.literal("value"),
33
+ value: z.string().max(65536).describe("A literal the input reads.")
34
+ })
35
+ ]).describe(
36
+ "Where one evaluator input reads its value: a path into the conversation, the scenario or the trace, or a literal value."
37
+ );
38
+ var evaluatorAttachmentSchema = z.object({
39
+ id: z.string().min(1).max(64).optional().describe(
40
+ "The attachment id, stable across edits. Leave it out on a new attachment and one is generated."
41
+ ),
42
+ evaluatorId: z.string().min(1).describe(
43
+ "The id of the saved evaluator to run. Read it from platform_list_evaluators or platform_get_evaluator."
44
+ ),
45
+ required: z.boolean().optional().describe(
46
+ "Whether a failing result fails the scenario. Defaults to true. A score-only evaluator reports and never gates, whatever this says."
47
+ ),
48
+ mappings: z.record(z.string().min(1).max(128), scenarioMappingSchema).describe(
49
+ "Where each evaluator input reads its value, keyed by input name. Read the inputs from platform_get_evaluator. A required input with no mapping makes the platform refuse the run until it is set."
50
+ )
51
+ });
52
+ var evaluatorAttachmentsSchema = z.array(evaluatorAttachmentSchema).max(20).describe(
53
+ "The evaluators that run after every scenario run, with their mappings. Up to 20. A required evaluator that fails fails the scenario; a score-only one reports beside the verdict."
54
+ );
55
+ var scenarioFieldValuesSchema = z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).describe(
56
+ "The scenario's value for each field its test suite declares, by identifier, for example { golden_sql: 'SELECT ...' }. A text field takes a string, a number field a number and a boolean field true or false. A field the suite does not declare is refused. On update, an empty object clears the values."
57
+ );
58
+ var newAttachmentId = () => `att_${crypto.randomUUID().replace(/-/g, "").slice(0, 21)}`;
59
+ function toWireAttachments(attachments) {
60
+ return attachments.map((attachment) => ({
61
+ id: attachment.id ?? newAttachmentId(),
62
+ evaluatorId: attachment.evaluatorId,
63
+ required: attachment.required ?? true,
64
+ mappings: attachment.mappings
65
+ }));
66
+ }
67
+
68
+ export {
69
+ suiteFieldsSchema,
70
+ evaluatorAttachmentsSchema,
71
+ scenarioFieldValuesSchema,
72
+ toWireAttachments
73
+ };
74
+ //# sourceMappingURL=chunk-CKNAH5TG.js.map
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  makeRequest
3
- } from "./chunk-A2LEVYQ5.js";
3
+ } from "./chunk-GELJ2MQR.js";
4
+
5
+ // src/langwatch-api-agents.ts
6
+ import { z } from "zod";
4
7
 
5
8
  // src/public-http-request.ts
6
9
  import { lookup as dnsLookup } from "dns/promises";
@@ -365,33 +368,104 @@ async function requestPublicJson(input, options = {}, redirectCount = 0) {
365
368
  }
366
369
 
367
370
  // src/langwatch-api-agents.ts
371
+ var agentCallParamsSchema = z.record(
372
+ z.string(),
373
+ z.union([z.string(), z.number(), z.boolean()])
374
+ );
368
375
  async function listAgents(params) {
369
376
  const query = new URLSearchParams();
370
377
  if (params?.page) query.set("page", String(params.page));
371
378
  if (params?.limit) query.set("limit", String(params.limit));
372
379
  const qs = query.toString() ? `?${query}` : "";
373
- return makeRequest("GET", `/api/agents${qs}`);
380
+ return makeRequest("GET", `/api/v1/agents${qs}`);
374
381
  }
375
382
  async function getAgent(id) {
376
383
  return makeRequest(
377
384
  "GET",
378
- `/api/agents/${encodeURIComponent(id)}`
385
+ `/api/v1/agents/${encodeURIComponent(id)}`
379
386
  );
380
387
  }
381
388
  async function createAgent(data) {
382
- return makeRequest("POST", "/api/agents", data);
389
+ return makeRequest("POST", "/api/v1/agents", data);
383
390
  }
384
391
  async function updateAgent(params) {
385
392
  const { id, ...data } = params;
386
393
  return makeRequest(
387
394
  "PATCH",
388
- `/api/agents/${encodeURIComponent(id)}`,
395
+ `/api/v1/agents/${encodeURIComponent(id)}`,
389
396
  data
390
397
  );
391
398
  }
392
- async function runAgent(id, input) {
399
+ async function callAgent({
400
+ id,
401
+ body
402
+ }) {
403
+ return makeRequest(
404
+ "POST",
405
+ `/api/v1/agents/${encodeURIComponent(id)}/call`,
406
+ body
407
+ );
408
+ }
409
+ async function testAgent(id) {
410
+ return makeRequest(
411
+ "POST",
412
+ `/api/v1/agents/${encodeURIComponent(id)}/test`,
413
+ {}
414
+ );
415
+ }
416
+ var isMessageList = (value) => Array.isArray(value) && value.every(
417
+ (item) => typeof item === "object" && item !== null && typeof item.role === "string"
418
+ );
419
+ function buildRelayBody({
420
+ input,
421
+ message,
422
+ parameters,
423
+ threadId
424
+ }) {
425
+ let messages;
426
+ if (message !== void 0) {
427
+ messages = [{ role: "user", content: message }];
428
+ } else if (isMessageList(input.messages)) {
429
+ messages = input.messages;
430
+ } else {
431
+ return "a connected agent takes a conversation: give `message`, or `input` with a `messages` list.";
432
+ }
433
+ const body = { messages };
434
+ const thread = threadId ?? (typeof input.threadId === "string" ? input.threadId : void 0);
435
+ if (thread) body.threadId = thread;
436
+ if (isMessageList(input.newMessages)) body.newMessages = input.newMessages;
437
+ if (input.session !== void 0) body.session = input.session;
438
+ let inputParams;
439
+ if (input.params !== void 0) {
440
+ const parsed = agentCallParamsSchema.safeParse(input.params);
441
+ if (!parsed.success) {
442
+ return "`params` takes one flat object of string, number or boolean values. Nested objects and arrays are not run parameters.";
443
+ }
444
+ inputParams = parsed.data;
445
+ }
446
+ if (inputParams || parameters) body.params = { ...inputParams ?? {}, ...parameters ?? {} };
447
+ return body;
448
+ }
449
+ async function runAgent({
450
+ id,
451
+ input,
452
+ message,
453
+ parameters,
454
+ threadId
455
+ }) {
393
456
  const agent = await getAgent(id);
394
457
  const config = agent.config ?? {};
458
+ if (agent.type === "connected") {
459
+ const body = buildRelayBody({ input: input ?? {}, message, parameters, threadId });
460
+ if (typeof body === "string") throw new Error(body);
461
+ if (agent.status === "offline") {
462
+ throw new Error(
463
+ `Agent "${agent.name}" is offline. Start the process that calls connectAgent (or connect_agent) and try again.`
464
+ );
465
+ }
466
+ const result2 = await callAgent({ id: agent.id, body });
467
+ return { agentType: "connected", result: result2 };
468
+ }
395
469
  if (agent.type === "http") {
396
470
  const url = config.url;
397
471
  if (!url) {
@@ -407,17 +481,17 @@ async function runAgent(id, input) {
407
481
  const workflowId = config.workflowId;
408
482
  if (!workflowId) {
409
483
  throw new Error(
410
- `Agent "${agent.name}" (type: ${agent.type}) cannot be executed directly. Only HTTP agents and workflow-linked agents can be run.`
484
+ `Agent "${agent.name}" (type: ${agent.type}) cannot be executed directly. Only connected agents, HTTP agents and workflow-linked agents can be run.`
411
485
  );
412
486
  }
413
- const { runWorkflow } = await import("./langwatch-api-workflows-NBJX5KOG.js");
487
+ const { runWorkflow } = await import("./langwatch-api-workflows-6UJL5U4Z.js");
414
488
  const result = await runWorkflow(workflowId, input);
415
489
  return { agentType: agent.type, result };
416
490
  }
417
491
  async function deleteAgent(id) {
418
492
  return makeRequest(
419
493
  "DELETE",
420
- `/api/agents/${encodeURIComponent(id)}`
494
+ `/api/v1/agents/${encodeURIComponent(id)}`
421
495
  );
422
496
  }
423
497
 
@@ -426,7 +500,8 @@ export {
426
500
  getAgent,
427
501
  createAgent,
428
502
  updateAgent,
503
+ testAgent,
429
504
  runAgent,
430
505
  deleteAgent
431
506
  };
432
- //# sourceMappingURL=chunk-TOXJQDIZ.js.map
507
+ //# sourceMappingURL=chunk-EYXMLE5X.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  makeRequest
3
- } from "./chunk-A2LEVYQ5.js";
3
+ } from "./chunk-GELJ2MQR.js";
4
4
 
5
5
  // src/langwatch-api-projects.ts
6
6
  async function listProjects(params) {
@@ -41,4 +41,4 @@ export {
41
41
  updateProject,
42
42
  archiveProject
43
43
  };
44
- //# sourceMappingURL=chunk-7RHG56OH.js.map
44
+ //# sourceMappingURL=chunk-G4ZAZTZW.js.map