@langwatch/mcp-server 0.6.1 → 0.8.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 (241) hide show
  1. package/.release-please-shim +1 -0
  2. package/CHANGELOG.md +89 -0
  3. package/README.md +51 -8
  4. package/dist/{archive-scenario-YFD5THOR.js → archive-scenario-YKGLJ4MZ.js} +4 -4
  5. package/dist/archive-suite-QFNDO3Y3.js +15 -0
  6. package/dist/assign-prompt-tag-Y2B4CBBT.js +19 -0
  7. package/dist/chunk-B57MZ4WI.js +1573 -0
  8. package/dist/{chunk-IX6QJKAD.js → chunk-CPUPGDNA.js} +2 -2
  9. package/dist/chunk-FBRKHHJV.js +48 -0
  10. package/dist/{chunk-5UOPNRXW.js → chunk-HDJDFKZR.js} +10 -3
  11. package/dist/chunk-KOO5733S.js +72 -0
  12. package/dist/chunk-KZNBCKWG.js +39 -0
  13. package/dist/chunk-L6QENXYA.js +42 -0
  14. package/dist/{chunk-6U4TCGFC.js → chunk-NACSR6B7.js} +2 -2
  15. package/dist/chunk-NUFPTHKU.js +9 -0
  16. package/dist/chunk-OVQF3D5R.js +86 -0
  17. package/dist/chunk-PO7FM7IX.js +35 -0
  18. package/dist/chunk-PZUWCWOS.js +25 -0
  19. package/dist/chunk-WVI5CJ6S.js +21 -0
  20. package/dist/{chunk-LLRQIF52.js → chunk-YH2IBTEL.js} +54 -6
  21. package/dist/chunk-YI3OG4PI.js +71 -0
  22. package/dist/config.d.ts +17 -0
  23. package/dist/config.js +13 -0
  24. package/dist/create-agent-YRSDH7P7.js +23 -0
  25. package/dist/create-annotation-FYQNKMVJ.js +24 -0
  26. package/dist/create-dashboard-CORBR4YQ.js +18 -0
  27. package/dist/create-dataset-ZC63T6BB.js +22 -0
  28. package/dist/create-dataset-records-ILVNVKVR.js +22 -0
  29. package/dist/{create-evaluator-E5X5ZP3B.js → create-evaluator-2AU3PXFB.js} +4 -4
  30. package/dist/create-mcp-server.d.ts +8 -0
  31. package/dist/create-mcp-server.js +8 -0
  32. package/dist/{create-prompt-7Z35MIL6.js → create-prompt-NKRJ47YY.js} +7 -4
  33. package/dist/create-prompt-tag-S4JX3ULL.js +17 -0
  34. package/dist/{create-scenario-DIMPJRPY.js → create-scenario-BPRF75KF.js} +4 -4
  35. package/dist/create-suite-4YN7D6K2.js +38 -0
  36. package/dist/delete-agent-Y72R2YQA.js +18 -0
  37. package/dist/delete-annotation-UHWDMHSH.js +17 -0
  38. package/dist/delete-dashboard-LPWT36KN.js +18 -0
  39. package/dist/delete-dataset-GGPQRHKX.js +20 -0
  40. package/dist/delete-dataset-records-LTG5LT26.js +21 -0
  41. package/dist/delete-evaluator-F7QLXDHU.js +15 -0
  42. package/dist/delete-prompt-tag-B5UKZL45.js +17 -0
  43. package/dist/delete-workflow-4DGUDIDE.js +17 -0
  44. package/dist/get-agent-YEVICUX4.js +28 -0
  45. package/dist/{get-analytics-4YJW4S5L.js → get-analytics-3W5CMU3F.js} +22 -5
  46. package/dist/get-dashboard-NCQHN6MW.js +29 -0
  47. package/dist/get-dataset-KBK6PH36.js +48 -0
  48. package/dist/{get-evaluator-WDEH2F7M.js → get-evaluator-QDUL5LXR.js} +4 -4
  49. package/dist/{get-prompt-F6PDVC76.js → get-prompt-XCSSNRKR.js} +4 -4
  50. package/dist/{get-scenario-H24ZYNT5.js → get-scenario-FNRKOY7E.js} +4 -4
  51. package/dist/get-simulation-run-WOEKUF7K.js +56 -0
  52. package/dist/get-suite-U5AOD5TC.js +44 -0
  53. package/dist/{get-trace-27USKGO7.js → get-trace-MUWEJM2Z.js} +3 -3
  54. package/dist/get-workflow-SOA7MT7L.js +25 -0
  55. package/dist/http-server-7DMOCB75.js +224 -0
  56. package/dist/index.js +61640 -31868
  57. package/dist/langwatch-api-annotations-Q57NDUVR.js +17 -0
  58. package/dist/langwatch-api-dashboards-VBWWXV3Y.js +17 -0
  59. package/dist/langwatch-api-monitors-L3IY7FDT.js +52 -0
  60. package/dist/langwatch-api-secrets-S5HHF3XR.js +40 -0
  61. package/dist/langwatch-api-triggers-ME33QE26.js +30 -0
  62. package/dist/langwatch-api-workflows-4CJQAYP2.js +15 -0
  63. package/dist/list-agents-3HGIBJFM.js +32 -0
  64. package/dist/list-annotations-KWXYVEPI.js +33 -0
  65. package/dist/list-dashboards-VQ2LH666.js +32 -0
  66. package/dist/list-dataset-records-RNRGROJP.js +39 -0
  67. package/dist/list-datasets-I4A2LT2S.js +60 -0
  68. package/dist/{list-evaluators-KRGI72EH.js → list-evaluators-AKKRJ5MX.js} +4 -4
  69. package/dist/{list-model-providers-A5YCFTPI.js → list-model-providers-DVFEHFHZ.js} +4 -4
  70. package/dist/list-prompt-tags-PL5OISUA.js +23 -0
  71. package/dist/{list-prompts-LKJSE7XN.js → list-prompts-7VTFWE2Z.js} +3 -3
  72. package/dist/{list-scenarios-ZK5CMGC4.js → list-scenarios-5BZWZ6ZN.js} +4 -4
  73. package/dist/list-simulation-runs-WCZ6RLPE.js +43 -0
  74. package/dist/list-suites-RRQ2JX5Y.js +42 -0
  75. package/dist/list-workflows-UQB5FCX5.js +35 -0
  76. package/dist/rename-prompt-tag-TURD6KYU.js +18 -0
  77. package/dist/run-agent-BEJ4K4CM.js +36 -0
  78. package/dist/run-evaluation-AJ7WZNQD.js +64 -0
  79. package/dist/run-suite-U7V432G2.js +29 -0
  80. package/dist/run-workflow-5WX7DK5T.js +36 -0
  81. package/dist/{search-traces-SOKAAMAR.js → search-traces-ZCHNOMTX.js} +3 -3
  82. package/dist/{set-model-provider-7MGULZDH.js → set-model-provider-6CFHMCNE.js} +4 -4
  83. package/dist/update-agent-UE6UWLZP.js +20 -0
  84. package/dist/update-dataset-4XQZZE4S.js +22 -0
  85. package/dist/update-dataset-record-GNNM5TKM.js +19 -0
  86. package/dist/{update-evaluator-A3XINFLJ.js → update-evaluator-LHVDXIZD.js} +4 -4
  87. package/dist/{update-prompt-IW7X2UQM.js → update-prompt-3XEHECJ7.js} +5 -3
  88. package/dist/{update-scenario-ZT7TOBFR.js → update-scenario-DFPREYCD.js} +4 -4
  89. package/dist/update-suite-RATU5THO.js +39 -0
  90. package/package.json +22 -8
  91. package/src/__tests__/all-tools.integration.test.ts +353 -0
  92. package/src/__tests__/config.unit.test.ts +81 -1
  93. package/src/__tests__/datasets.integration.test.ts +620 -0
  94. package/src/__tests__/datasets.unit.test.ts +244 -0
  95. package/src/__tests__/docker.integration.test.ts +234 -0
  96. package/src/__tests__/http-transport.integration.test.ts +397 -0
  97. package/src/__tests__/langwatch-api.unit.test.ts +174 -0
  98. package/src/__tests__/scenario-tools.unit.test.ts +3 -0
  99. package/src/__tests__/tools.unit.test.ts +177 -0
  100. package/src/config.d.ts +15 -0
  101. package/src/config.ts +85 -7
  102. package/src/create-mcp-server.d.ts +6 -0
  103. package/src/create-mcp-server.ts +1799 -0
  104. package/src/http-server.ts +329 -0
  105. package/src/index.ts +22 -593
  106. package/src/langwatch-api-agents.ts +108 -0
  107. package/src/langwatch-api-annotations.ts +49 -0
  108. package/src/langwatch-api-dashboards.ts +48 -0
  109. package/src/langwatch-api-datasets.ts +191 -0
  110. package/src/langwatch-api-evaluators.ts +10 -0
  111. package/src/langwatch-api-monitors.ts +82 -0
  112. package/src/langwatch-api-secrets.ts +48 -0
  113. package/src/langwatch-api-simulation-runs.ts +51 -0
  114. package/src/langwatch-api-suites.ts +118 -0
  115. package/src/langwatch-api-triggers.ts +48 -0
  116. package/src/langwatch-api-workflows.ts +41 -0
  117. package/src/langwatch-api.ts +65 -3
  118. package/src/schemas/create-dataset.ts +48 -0
  119. package/src/schemas/index.ts +1 -0
  120. package/src/tools/archive-suite.ts +12 -0
  121. package/src/tools/assign-prompt-tag.ts +16 -0
  122. package/src/tools/create-agent.ts +15 -0
  123. package/src/tools/create-annotation.ts +18 -0
  124. package/src/tools/create-dashboard.ts +7 -0
  125. package/src/tools/create-dataset-records.ts +23 -0
  126. package/src/tools/create-dataset.ts +22 -0
  127. package/src/tools/create-prompt-tag.ts +12 -0
  128. package/src/tools/create-prompt.ts +4 -0
  129. package/src/tools/create-suite.ts +42 -0
  130. package/src/tools/delete-agent.ts +7 -0
  131. package/src/tools/delete-annotation.ts +7 -0
  132. package/src/tools/delete-dashboard.ts +7 -0
  133. package/src/tools/delete-dataset-records.ts +22 -0
  134. package/src/tools/delete-dataset.ts +20 -0
  135. package/src/tools/delete-evaluator.ts +12 -0
  136. package/src/tools/delete-prompt-tag.ts +12 -0
  137. package/src/tools/delete-workflow.ts +7 -0
  138. package/src/tools/format-dataset-mutation.ts +25 -0
  139. package/src/tools/get-agent.ts +21 -0
  140. package/src/tools/get-analytics.ts +30 -3
  141. package/src/tools/get-dashboard.ts +22 -0
  142. package/src/tools/get-dataset.ts +63 -0
  143. package/src/tools/get-prompt.ts +2 -1
  144. package/src/tools/get-simulation-run.ts +60 -0
  145. package/src/tools/get-suite.ts +47 -0
  146. package/src/tools/get-workflow.ts +17 -0
  147. package/src/tools/list-agents.ts +27 -0
  148. package/src/tools/list-annotations.ts +33 -0
  149. package/src/tools/list-dashboards.ts +27 -0
  150. package/src/tools/list-dataset-records.ts +46 -0
  151. package/src/tools/list-datasets.ts +80 -0
  152. package/src/tools/list-prompt-tags.ts +21 -0
  153. package/src/tools/list-simulation-runs.ts +49 -0
  154. package/src/tools/list-suites.ts +43 -0
  155. package/src/tools/list-workflows.ts +31 -0
  156. package/src/tools/rename-prompt-tag.ts +14 -0
  157. package/src/tools/run-agent.ts +36 -0
  158. package/src/tools/run-evaluation.ts +87 -0
  159. package/src/tools/run-suite.ts +28 -0
  160. package/src/tools/run-workflow.ts +36 -0
  161. package/src/tools/update-agent.ts +13 -0
  162. package/src/tools/update-dataset-record.ts +21 -0
  163. package/src/tools/update-dataset.ts +23 -0
  164. package/src/tools/update-prompt.ts +3 -0
  165. package/src/tools/update-suite.ts +44 -0
  166. package/src/utils/escape-markdown.ts +12 -0
  167. package/uv.lock +188 -530
  168. package/build.js +0 -12
  169. package/dist/archive-scenario-YFD5THOR.js.map +0 -1
  170. package/dist/chunk-5UOPNRXW.js.map +0 -1
  171. package/dist/chunk-6U4TCGFC.js.map +0 -1
  172. package/dist/chunk-AAQNA53E.js +0 -28
  173. package/dist/chunk-AAQNA53E.js.map +0 -1
  174. package/dist/chunk-IX6QJKAD.js.map +0 -1
  175. package/dist/chunk-LLRQIF52.js.map +0 -1
  176. package/dist/chunk-ZXKLPC2E.js.map +0 -1
  177. package/dist/config-FIQWQRUB.js +0 -11
  178. package/dist/config-FIQWQRUB.js.map +0 -1
  179. package/dist/create-evaluator-E5X5ZP3B.js.map +0 -1
  180. package/dist/create-prompt-7Z35MIL6.js.map +0 -1
  181. package/dist/create-scenario-DIMPJRPY.js.map +0 -1
  182. package/dist/discover-evaluator-schema-H23XCLNE.js.map +0 -1
  183. package/dist/discover-scenario-schema-MEEEVND7.js.map +0 -1
  184. package/dist/discover-schema-3T52ORPB.js.map +0 -1
  185. package/dist/get-analytics-4YJW4S5L.js.map +0 -1
  186. package/dist/get-evaluator-WDEH2F7M.js.map +0 -1
  187. package/dist/get-prompt-F6PDVC76.js.map +0 -1
  188. package/dist/get-scenario-H24ZYNT5.js.map +0 -1
  189. package/dist/get-trace-27USKGO7.js.map +0 -1
  190. package/dist/index.js.map +0 -1
  191. package/dist/list-evaluators-KRGI72EH.js.map +0 -1
  192. package/dist/list-model-providers-A5YCFTPI.js.map +0 -1
  193. package/dist/list-prompts-LKJSE7XN.js.map +0 -1
  194. package/dist/list-scenarios-ZK5CMGC4.js.map +0 -1
  195. package/dist/search-traces-SOKAAMAR.js.map +0 -1
  196. package/dist/set-model-provider-7MGULZDH.js.map +0 -1
  197. package/dist/update-evaluator-A3XINFLJ.js.map +0 -1
  198. package/dist/update-prompt-IW7X2UQM.js.map +0 -1
  199. package/dist/update-scenario-ZT7TOBFR.js.map +0 -1
  200. package/tests/evaluations.ipynb +0 -649
  201. package/tests/fixtures/azure/azure_openai_stream_bot_expected.py +0 -102
  202. package/tests/fixtures/azure/azure_openai_stream_bot_input.py +0 -78
  203. package/tests/fixtures/dspy/dspy_bot_expected.py +0 -61
  204. package/tests/fixtures/dspy/dspy_bot_input.py +0 -53
  205. package/tests/fixtures/fastapi/fastapi_app_expected.py +0 -68
  206. package/tests/fixtures/fastapi/fastapi_app_input.py +0 -60
  207. package/tests/fixtures/fastapi/prompt_management_fastapi_expected.py +0 -114
  208. package/tests/fixtures/fastapi/prompt_management_fastapi_input.py +0 -88
  209. package/tests/fixtures/haystack/haystack_bot_expected.py +0 -141
  210. package/tests/fixtures/haystack/haystack_bot_input.py +0 -69
  211. package/tests/fixtures/langchain/langchain_bot_expected.py +0 -53
  212. package/tests/fixtures/langchain/langchain_bot_input.py +0 -45
  213. package/tests/fixtures/langchain/langchain_bot_with_memory_expected.py +0 -69
  214. package/tests/fixtures/langchain/langchain_bot_with_memory_input.py +0 -61
  215. package/tests/fixtures/langchain/langchain_rag_bot_expected.py +0 -97
  216. package/tests/fixtures/langchain/langchain_rag_bot_input.py +0 -77
  217. package/tests/fixtures/langchain/langchain_rag_bot_vertex_ai_expected.py +0 -116
  218. package/tests/fixtures/langchain/langchain_rag_bot_vertex_ai_input.py +0 -81
  219. package/tests/fixtures/langchain/langgraph_rag_bot_with_threads_expected.py +0 -331
  220. package/tests/fixtures/langchain/langgraph_rag_bot_with_threads_input.py +0 -106
  221. package/tests/fixtures/litellm/litellm_bot_expected.py +0 -40
  222. package/tests/fixtures/litellm/litellm_bot_input.py +0 -35
  223. package/tests/fixtures/openai/openai_bot_expected.py +0 -43
  224. package/tests/fixtures/openai/openai_bot_function_call_expected.py +0 -91
  225. package/tests/fixtures/openai/openai_bot_function_call_input.py +0 -82
  226. package/tests/fixtures/openai/openai_bot_input.py +0 -36
  227. package/tests/fixtures/openai/openai_bot_rag_expected.py +0 -73
  228. package/tests/fixtures/openai/openai_bot_rag_input.py +0 -51
  229. package/tests/fixtures/opentelemetry/openinference_dspy_bot_expected.py +0 -63
  230. package/tests/fixtures/opentelemetry/openinference_dspy_bot_input.py +0 -58
  231. package/tests/fixtures/opentelemetry/openinference_langchain_bot_expected.py +0 -53
  232. package/tests/fixtures/opentelemetry/openinference_langchain_bot_input.py +0 -52
  233. package/tests/fixtures/opentelemetry/openinference_openai_bot_expected.py +0 -49
  234. package/tests/fixtures/opentelemetry/openinference_openai_bot_input.py +0 -41
  235. package/tests/fixtures/opentelemetry/openllmetry_openai_bot_expected.py +0 -44
  236. package/tests/fixtures/opentelemetry/openllmetry_openai_bot_input.py +0 -40
  237. package/tests/fixtures/strands/strands_bot_expected.py +0 -84
  238. package/tests/fixtures/strands/strands_bot_input.py +0 -52
  239. package/tests/scenario-openai.test.ts +0 -160
  240. package/tsup.config.ts +0 -10
  241. package/vitest.config.js +0 -7
@@ -0,0 +1,18 @@
1
+ import {
2
+ createDashboard
3
+ } from "./chunk-KZNBCKWG.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/create-dashboard.ts
8
+ async function handleCreateDashboard(params) {
9
+ const dashboard = await createDashboard({ name: params.name });
10
+ return `Dashboard created successfully!
11
+
12
+ **Name**: ${dashboard.name}
13
+ **ID**: ${dashboard.id}`;
14
+ }
15
+ export {
16
+ handleCreateDashboard
17
+ };
18
+ //# sourceMappingURL=create-dashboard-CORBR4YQ.js.map
@@ -0,0 +1,22 @@
1
+ import {
2
+ formatDatasetMutationDetails
3
+ } from "./chunk-WVI5CJ6S.js";
4
+ import "./chunk-NUFPTHKU.js";
5
+ import {
6
+ createDataset
7
+ } from "./chunk-OVQF3D5R.js";
8
+ import "./chunk-YH2IBTEL.js";
9
+ import "./chunk-KOO5733S.js";
10
+
11
+ // src/tools/create-dataset.ts
12
+ async function handleCreateDataset(params) {
13
+ const result = await createDataset(params);
14
+ const lines = [];
15
+ lines.push("Dataset created successfully!\n");
16
+ lines.push(...formatDatasetMutationDetails(result));
17
+ return lines.join("\n");
18
+ }
19
+ export {
20
+ handleCreateDataset
21
+ };
22
+ //# sourceMappingURL=create-dataset-ZC63T6BB.js.map
@@ -0,0 +1,22 @@
1
+ import {
2
+ createDatasetRecords
3
+ } from "./chunk-OVQF3D5R.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/create-dataset-records.ts
8
+ async function handleCreateDatasetRecords(params) {
9
+ const result = await createDatasetRecords(params);
10
+ const count = Array.isArray(result.data) ? result.data.length : 0;
11
+ const lines = [];
12
+ lines.push(`${count} record(s) created successfully!
13
+ `);
14
+ lines.push(
15
+ "> Use `platform_get_dataset` to see the updated dataset with all records."
16
+ );
17
+ return lines.join("\n");
18
+ }
19
+ export {
20
+ handleCreateDatasetRecords
21
+ };
22
+ //# sourceMappingURL=create-dataset-records-ILVNVKVR.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createEvaluator,
3
3
  getEvaluatorType
4
- } from "./chunk-5UOPNRXW.js";
5
- import "./chunk-LLRQIF52.js";
6
- import "./chunk-AAQNA53E.js";
4
+ } from "./chunk-HDJDFKZR.js";
5
+ import "./chunk-YH2IBTEL.js";
6
+ import "./chunk-KOO5733S.js";
7
7
 
8
8
  // src/tools/create-evaluator.ts
9
9
  async function handleCreateEvaluator(params) {
@@ -24,4 +24,4 @@ async function handleCreateEvaluator(params) {
24
24
  export {
25
25
  handleCreateEvaluator
26
26
  };
27
- //# sourceMappingURL=create-evaluator-E5X5ZP3B.js.map
27
+ //# sourceMappingURL=create-evaluator-2AU3PXFB.js.map
@@ -0,0 +1,8 @@
1
+ // Minimal type declaration — avoids pulling mcp-server's full dependency tree
2
+ // into the langwatch app's typecheck scope. The actual return type is McpServer,
3
+ // but we only expose the connect() method that handler.ts uses.
4
+ declare function createMcpServer(): {
5
+ connect(transport: unknown): Promise<void>;
6
+ };
7
+
8
+ export { createMcpServer };
@@ -0,0 +1,8 @@
1
+ import {
2
+ createMcpServer
3
+ } from "./chunk-B57MZ4WI.js";
4
+ import "./chunk-KOO5733S.js";
5
+ export {
6
+ createMcpServer
7
+ };
8
+ //# sourceMappingURL=create-mcp-server.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createPrompt
3
- } from "./chunk-LLRQIF52.js";
4
- import "./chunk-AAQNA53E.js";
3
+ } from "./chunk-YH2IBTEL.js";
4
+ import "./chunk-KOO5733S.js";
5
5
 
6
6
  // src/tools/create-prompt.ts
7
7
  var HANDLE_PATTERN = /^[a-z0-9_-]+(?:\/[a-z0-9_-]+)?$/;
@@ -18,7 +18,8 @@ async function handleCreatePrompt(params) {
18
18
  const result = await createPrompt({
19
19
  handle,
20
20
  messages: params.messages,
21
- model: params.model
21
+ model: params.model,
22
+ ...params.tags ? { tags: params.tags } : {}
22
23
  });
23
24
  const lines = [];
24
25
  lines.push("Prompt created successfully!\n");
@@ -28,9 +29,11 @@ async function handleCreatePrompt(params) {
28
29
  lines.push(`**Model**: ${params.model}`);
29
30
  if (result.latestVersionNumber != null)
30
31
  lines.push(`**Version**: v${result.latestVersionNumber}`);
32
+ if (params.tags && params.tags.length > 0)
33
+ lines.push(`**Tags**: ${params.tags.join(", ")}`);
31
34
  return lines.join("\n");
32
35
  }
33
36
  export {
34
37
  handleCreatePrompt
35
38
  };
36
- //# sourceMappingURL=create-prompt-7Z35MIL6.js.map
39
+ //# sourceMappingURL=create-prompt-NKRJ47YY.js.map
@@ -0,0 +1,17 @@
1
+ import {
2
+ createPromptTag
3
+ } from "./chunk-YH2IBTEL.js";
4
+ import "./chunk-KOO5733S.js";
5
+
6
+ // src/tools/create-prompt-tag.ts
7
+ async function handleCreatePromptTag(params) {
8
+ await createPromptTag(params.name);
9
+ const lines = [];
10
+ lines.push("Tag created successfully!\n");
11
+ lines.push(`**Name**: ${params.name}`);
12
+ return lines.join("\n");
13
+ }
14
+ export {
15
+ handleCreatePromptTag
16
+ };
17
+ //# sourceMappingURL=create-prompt-tag-S4JX3ULL.js.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createScenario
3
- } from "./chunk-6U4TCGFC.js";
4
- import "./chunk-LLRQIF52.js";
5
- import "./chunk-AAQNA53E.js";
3
+ } from "./chunk-NACSR6B7.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
6
 
7
7
  // src/tools/create-scenario.ts
8
8
  async function handleCreateScenario(params) {
@@ -23,4 +23,4 @@ async function handleCreateScenario(params) {
23
23
  export {
24
24
  handleCreateScenario
25
25
  };
26
- //# sourceMappingURL=create-scenario-DIMPJRPY.js.map
26
+ //# sourceMappingURL=create-scenario-BPRF75KF.js.map
@@ -0,0 +1,38 @@
1
+ import {
2
+ createSuite
3
+ } from "./chunk-FBRKHHJV.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/create-suite.ts
8
+ async function handleCreateSuite(params) {
9
+ let parsedTargets;
10
+ try {
11
+ parsedTargets = JSON.parse(params.targets);
12
+ } catch {
13
+ return 'Error: `targets` must be a valid JSON array of objects with `type` and `referenceId` fields.\n\nExample: [{"type": "http", "referenceId": "agent_abc123"}]';
14
+ }
15
+ const suite = await createSuite({
16
+ name: params.name,
17
+ description: params.description,
18
+ scenarioIds: params.scenarioIds,
19
+ targets: parsedTargets,
20
+ repeatCount: params.repeatCount,
21
+ labels: params.labels
22
+ });
23
+ return [
24
+ `Suite "${suite.name}" created successfully.`,
25
+ "",
26
+ `**ID**: ${suite.id}`,
27
+ `**Slug**: ${suite.slug}`,
28
+ `**Scenarios**: ${suite.scenarioIds.length}`,
29
+ `**Targets**: ${suite.targets.length}`,
30
+ `**Repeat**: ${suite.repeatCount}x`,
31
+ "",
32
+ `> Use \`platform_run_suite\` with ID \`${suite.id}\` to trigger execution.`
33
+ ].join("\n");
34
+ }
35
+ export {
36
+ handleCreateSuite
37
+ };
38
+ //# sourceMappingURL=create-suite-4YN7D6K2.js.map
@@ -0,0 +1,18 @@
1
+ import {
2
+ deleteAgent
3
+ } from "./chunk-YI3OG4PI.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/delete-agent.ts
8
+ async function handleDeleteAgent(params) {
9
+ const result = await deleteAgent(params.id);
10
+ return `Agent archived successfully!
11
+
12
+ **Name**: ${result.name}
13
+ **ID**: ${result.id}`;
14
+ }
15
+ export {
16
+ handleDeleteAgent
17
+ };
18
+ //# sourceMappingURL=delete-agent-Y72R2YQA.js.map
@@ -0,0 +1,17 @@
1
+ import {
2
+ deleteAnnotation
3
+ } from "./chunk-L6QENXYA.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/delete-annotation.ts
8
+ async function handleDeleteAnnotation(params) {
9
+ await deleteAnnotation(params.id);
10
+ return `Annotation deleted successfully!
11
+
12
+ **ID**: ${params.id}`;
13
+ }
14
+ export {
15
+ handleDeleteAnnotation
16
+ };
17
+ //# sourceMappingURL=delete-annotation-UHWDMHSH.js.map
@@ -0,0 +1,18 @@
1
+ import {
2
+ deleteDashboard
3
+ } from "./chunk-KZNBCKWG.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/delete-dashboard.ts
8
+ async function handleDeleteDashboard(params) {
9
+ const result = await deleteDashboard(params.id);
10
+ return `Dashboard deleted successfully!
11
+
12
+ **Name**: ${result.name}
13
+ **ID**: ${result.id}`;
14
+ }
15
+ export {
16
+ handleDeleteDashboard
17
+ };
18
+ //# sourceMappingURL=delete-dashboard-LPWT36KN.js.map
@@ -0,0 +1,20 @@
1
+ import {
2
+ deleteDataset
3
+ } from "./chunk-OVQF3D5R.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/delete-dataset.ts
8
+ async function handleDeleteDataset(params) {
9
+ await deleteDataset(params.slugOrId);
10
+ const lines = [];
11
+ lines.push("Dataset deleted successfully!\n");
12
+ lines.push(
13
+ "> The dataset has been archived and will no longer appear in listings."
14
+ );
15
+ return lines.join("\n");
16
+ }
17
+ export {
18
+ handleDeleteDataset
19
+ };
20
+ //# sourceMappingURL=delete-dataset-GGPQRHKX.js.map
@@ -0,0 +1,21 @@
1
+ import {
2
+ deleteDatasetRecords
3
+ } from "./chunk-OVQF3D5R.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/delete-dataset-records.ts
8
+ async function handleDeleteDatasetRecords(params) {
9
+ const result = await deleteDatasetRecords(params);
10
+ const lines = [];
11
+ lines.push(`${result.deletedCount} record(s) deleted successfully!
12
+ `);
13
+ lines.push(
14
+ "> Use `platform_get_dataset` to see the updated dataset."
15
+ );
16
+ return lines.join("\n");
17
+ }
18
+ export {
19
+ handleDeleteDatasetRecords
20
+ };
21
+ //# sourceMappingURL=delete-dataset-records-LTG5LT26.js.map
@@ -0,0 +1,15 @@
1
+ import {
2
+ deleteEvaluator
3
+ } from "./chunk-HDJDFKZR.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/delete-evaluator.ts
8
+ async function handleDeleteEvaluator(params) {
9
+ const result = await deleteEvaluator(params.idOrSlug);
10
+ return `Evaluator ${result.id} has been archived (soft-deleted).`;
11
+ }
12
+ export {
13
+ handleDeleteEvaluator
14
+ };
15
+ //# sourceMappingURL=delete-evaluator-F7QLXDHU.js.map
@@ -0,0 +1,17 @@
1
+ import {
2
+ deletePromptTag
3
+ } from "./chunk-YH2IBTEL.js";
4
+ import "./chunk-KOO5733S.js";
5
+
6
+ // src/tools/delete-prompt-tag.ts
7
+ async function handleDeletePromptTag(params) {
8
+ await deletePromptTag(params.tag);
9
+ const lines = [];
10
+ lines.push("Tag deleted successfully!\n");
11
+ lines.push(`**Tag**: ${params.tag}`);
12
+ return lines.join("\n");
13
+ }
14
+ export {
15
+ handleDeletePromptTag
16
+ };
17
+ //# sourceMappingURL=delete-prompt-tag-B5UKZL45.js.map
@@ -0,0 +1,17 @@
1
+ import {
2
+ deleteWorkflow
3
+ } from "./chunk-PO7FM7IX.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/delete-workflow.ts
8
+ async function handleDeleteWorkflow(params) {
9
+ const result = await deleteWorkflow(params.id);
10
+ return `Workflow archived successfully!
11
+
12
+ **ID**: ${result.id}`;
13
+ }
14
+ export {
15
+ handleDeleteWorkflow
16
+ };
17
+ //# sourceMappingURL=delete-workflow-4DGUDIDE.js.map
@@ -0,0 +1,28 @@
1
+ import {
2
+ getAgent
3
+ } from "./chunk-YI3OG4PI.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/get-agent.ts
8
+ async function handleGetAgent(params) {
9
+ const agent = await getAgent(params.id);
10
+ const lines = [];
11
+ lines.push(`# ${agent.name}
12
+ `);
13
+ lines.push(`**ID**: ${agent.id}`);
14
+ lines.push(`**Type**: ${agent.type}`);
15
+ lines.push(`**Created**: ${agent.createdAt}`);
16
+ lines.push(`**Updated**: ${agent.updatedAt}`);
17
+ if (agent.config && Object.keys(agent.config).length > 0) {
18
+ lines.push("\n## Config\n");
19
+ lines.push("```json");
20
+ lines.push(JSON.stringify(agent.config, null, 2));
21
+ lines.push("```");
22
+ }
23
+ return lines.join("\n");
24
+ }
25
+ export {
26
+ handleGetAgent
27
+ };
28
+ //# sourceMappingURL=get-agent-YEVICUX4.js.map
@@ -3,10 +3,17 @@ import {
3
3
  } from "./chunk-ZXKLPC2E.js";
4
4
  import {
5
5
  getAnalyticsTimeseries
6
- } from "./chunk-LLRQIF52.js";
7
- import "./chunk-AAQNA53E.js";
6
+ } from "./chunk-YH2IBTEL.js";
7
+ import "./chunk-KOO5733S.js";
8
8
 
9
9
  // src/tools/get-analytics.ts
10
+ function getGroupedData(bucket, groupBy) {
11
+ const data = bucket[groupBy];
12
+ if (typeof data === "object" && data !== null && !Array.isArray(data)) {
13
+ return data;
14
+ }
15
+ return void 0;
16
+ }
10
17
  async function handleGetAnalytics(params) {
11
18
  const now = Date.now();
12
19
  const startDate = params.startDate ? parseRelativeDate(params.startDate) : now - 7 * 864e5;
@@ -33,15 +40,25 @@ async function handleGetAnalytics(params) {
33
40
  const currentPeriod = result.currentPeriod ?? [];
34
41
  if (currentPeriod.length === 0) {
35
42
  lines.push("No data available for this period.");
43
+ } else if (params.groupBy && currentPeriod.some((b) => getGroupedData(b, params.groupBy) !== void 0)) {
44
+ lines.push("| Date | Group | Value |");
45
+ lines.push("|------|-------|-------|");
46
+ for (const bucket of currentPeriod) {
47
+ const groups = getGroupedData(bucket, params.groupBy);
48
+ if (!groups) continue;
49
+ for (const [groupKey, metrics] of Object.entries(groups)) {
50
+ const value = Object.values(metrics).find((v) => typeof v === "number") ?? "N/A";
51
+ lines.push(`| ${bucket.date} | ${groupKey} | ${value} |`);
52
+ }
53
+ }
36
54
  } else {
37
55
  lines.push("| Date | Value |");
38
56
  lines.push("|------|-------|");
39
57
  for (const bucket of currentPeriod) {
40
- const date = bucket.date;
41
58
  const value = Object.entries(bucket).find(
42
59
  ([k]) => k !== "date" && typeof bucket[k] === "number"
43
60
  )?.[1] ?? "N/A";
44
- lines.push(`| ${date} | ${value} |`);
61
+ lines.push(`| ${bucket.date} | ${value} |`);
45
62
  }
46
63
  }
47
64
  lines.push(
@@ -52,4 +69,4 @@ async function handleGetAnalytics(params) {
52
69
  export {
53
70
  handleGetAnalytics
54
71
  };
55
- //# sourceMappingURL=get-analytics-4YJW4S5L.js.map
72
+ //# sourceMappingURL=get-analytics-3W5CMU3F.js.map
@@ -0,0 +1,29 @@
1
+ import {
2
+ getDashboard
3
+ } from "./chunk-KZNBCKWG.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/get-dashboard.ts
8
+ async function handleGetDashboard(params) {
9
+ const dashboard = await getDashboard(params.id);
10
+ const lines = [];
11
+ lines.push(`# ${dashboard.name}
12
+ `);
13
+ lines.push(`**ID**: ${dashboard.id}`);
14
+ lines.push(`**Order**: ${dashboard.order}`);
15
+ lines.push(`**Graphs**: ${Array.isArray(dashboard.graphs) ? dashboard.graphs.length : 0}`);
16
+ lines.push(`**Created**: ${dashboard.createdAt}`);
17
+ lines.push(`**Updated**: ${dashboard.updatedAt}`);
18
+ if (Array.isArray(dashboard.graphs) && dashboard.graphs.length > 0) {
19
+ lines.push("\n## Graphs\n");
20
+ lines.push("```json");
21
+ lines.push(JSON.stringify(dashboard.graphs, null, 2));
22
+ lines.push("```");
23
+ }
24
+ return lines.join("\n");
25
+ }
26
+ export {
27
+ handleGetDashboard
28
+ };
29
+ //# sourceMappingURL=get-dashboard-NCQHN6MW.js.map
@@ -0,0 +1,48 @@
1
+ import {
2
+ escapeMarkdown
3
+ } from "./chunk-NUFPTHKU.js";
4
+ import {
5
+ getDataset
6
+ } from "./chunk-OVQF3D5R.js";
7
+ import "./chunk-YH2IBTEL.js";
8
+ import "./chunk-KOO5733S.js";
9
+
10
+ // src/tools/get-dataset.ts
11
+ function formatDatasetResponse(dataset) {
12
+ const lines = [];
13
+ lines.push(`# Dataset: ${escapeMarkdown(dataset.name)}
14
+ `);
15
+ lines.push(`**Slug**: ${escapeMarkdown(dataset.slug)}`);
16
+ lines.push(`**ID**: ${escapeMarkdown(dataset.id)}`);
17
+ if (Array.isArray(dataset.columnTypes) && dataset.columnTypes.length > 0) {
18
+ lines.push("\n## Columns\n");
19
+ lines.push("| Name | Type |");
20
+ lines.push("|------|------|");
21
+ for (const col of dataset.columnTypes) {
22
+ lines.push(`| ${escapeMarkdown(col.name)} | ${escapeMarkdown(col.type)} |`);
23
+ }
24
+ }
25
+ if (Array.isArray(dataset.data) && dataset.data.length > 0) {
26
+ lines.push(`
27
+ ## Records (${dataset.data.length} shown)
28
+ `);
29
+ for (const record of dataset.data) {
30
+ lines.push(`**${escapeMarkdown(record.id)}**: ${escapeMarkdown(JSON.stringify(record.entry))}`);
31
+ }
32
+ } else {
33
+ lines.push("\nNo records in this dataset.");
34
+ }
35
+ return lines.join("\n");
36
+ }
37
+ async function handleGetDataset(params) {
38
+ const dataset = await getDataset(params.slugOrId);
39
+ if (params.format === "json") {
40
+ return JSON.stringify(dataset, null, 2);
41
+ }
42
+ return formatDatasetResponse(dataset);
43
+ }
44
+ export {
45
+ formatDatasetResponse,
46
+ handleGetDataset
47
+ };
48
+ //# sourceMappingURL=get-dataset-KBK6PH36.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getEvaluator,
3
3
  getEvaluatorType
4
- } from "./chunk-5UOPNRXW.js";
5
- import "./chunk-LLRQIF52.js";
6
- import "./chunk-AAQNA53E.js";
4
+ } from "./chunk-HDJDFKZR.js";
5
+ import "./chunk-YH2IBTEL.js";
6
+ import "./chunk-KOO5733S.js";
7
7
 
8
8
  // src/tools/get-evaluator.ts
9
9
  async function handleGetEvaluator(params) {
@@ -44,4 +44,4 @@ async function handleGetEvaluator(params) {
44
44
  export {
45
45
  handleGetEvaluator
46
46
  };
47
- //# sourceMappingURL=get-evaluator-WDEH2F7M.js.map
47
+ //# sourceMappingURL=get-evaluator-QDUL5LXR.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getPrompt
3
- } from "./chunk-LLRQIF52.js";
4
- import "./chunk-AAQNA53E.js";
3
+ } from "./chunk-YH2IBTEL.js";
4
+ import "./chunk-KOO5733S.js";
5
5
 
6
6
  // src/tools/get-prompt.ts
7
7
  async function handleGetPrompt(params) {
8
- const prompt = await getPrompt(params.idOrHandle, params.version);
8
+ const prompt = await getPrompt(params.idOrHandle, { version: params.version, tag: params.tag });
9
9
  const lines = [];
10
10
  lines.push(
11
11
  `# Prompt: ${prompt.name || prompt.handle || prompt.id}
@@ -42,4 +42,4 @@ async function handleGetPrompt(params) {
42
42
  export {
43
43
  handleGetPrompt
44
44
  };
45
- //# sourceMappingURL=get-prompt-F6PDVC76.js.map
45
+ //# sourceMappingURL=get-prompt-XCSSNRKR.js.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  getScenario
3
- } from "./chunk-6U4TCGFC.js";
4
- import "./chunk-LLRQIF52.js";
5
- import "./chunk-AAQNA53E.js";
3
+ } from "./chunk-NACSR6B7.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
6
 
7
7
  // src/tools/get-scenario.ts
8
8
  async function handleGetScenario(params) {
@@ -30,4 +30,4 @@ async function handleGetScenario(params) {
30
30
  export {
31
31
  handleGetScenario
32
32
  };
33
- //# sourceMappingURL=get-scenario-H24ZYNT5.js.map
33
+ //# sourceMappingURL=get-scenario-FNRKOY7E.js.map
@@ -0,0 +1,56 @@
1
+ import {
2
+ getSimulationRun
3
+ } from "./chunk-PZUWCWOS.js";
4
+ import "./chunk-YH2IBTEL.js";
5
+ import "./chunk-KOO5733S.js";
6
+
7
+ // src/tools/get-simulation-run.ts
8
+ async function handleGetSimulationRun(params) {
9
+ const run = await getSimulationRun(params.scenarioRunId);
10
+ if (params.format === "json") {
11
+ return JSON.stringify(run, null, 2);
12
+ }
13
+ const lines = [];
14
+ lines.push(`# Simulation Run: ${run.name ?? run.scenarioRunId}
15
+ `);
16
+ lines.push(`**Run ID**: ${run.scenarioRunId}`);
17
+ lines.push(`**Scenario ID**: ${run.scenarioId}`);
18
+ lines.push(`**Batch ID**: ${run.batchRunId}`);
19
+ lines.push(`**Status**: ${run.status}`);
20
+ const duration = run.durationInMs > 0 ? `${(run.durationInMs / 1e3).toFixed(1)}s` : "\u2014";
21
+ lines.push(`**Duration**: ${duration}`);
22
+ if (run.totalCost) {
23
+ lines.push(`**Cost**: $${run.totalCost.toFixed(4)}`);
24
+ }
25
+ lines.push(`**Started**: ${new Date(run.timestamp).toISOString()}`);
26
+ if (run.results) {
27
+ lines.push("\n## Results");
28
+ if (run.results.verdict) {
29
+ lines.push(`**Verdict**: ${run.results.verdict}`);
30
+ }
31
+ if (run.results.reasoning) {
32
+ lines.push(`**Reasoning**: ${run.results.reasoning}`);
33
+ }
34
+ if (run.results.metCriteria && run.results.metCriteria.length > 0) {
35
+ lines.push(`**Met Criteria**: ${run.results.metCriteria.join(", ")}`);
36
+ }
37
+ if (run.results.unmetCriteria && run.results.unmetCriteria.length > 0) {
38
+ lines.push(`**Unmet Criteria**: ${run.results.unmetCriteria.join(", ")}`);
39
+ }
40
+ if (run.results.error) {
41
+ lines.push(`**Error**: ${run.results.error}`);
42
+ }
43
+ }
44
+ if (run.messages && run.messages.length > 0) {
45
+ lines.push("\n## Conversation");
46
+ for (const msg of run.messages) {
47
+ const content = msg.content.length > 300 ? msg.content.slice(0, 300) + "..." : msg.content;
48
+ lines.push(`**[${msg.role}]**: ${content}`);
49
+ }
50
+ }
51
+ return lines.join("\n");
52
+ }
53
+ export {
54
+ handleGetSimulationRun
55
+ };
56
+ //# sourceMappingURL=get-simulation-run-WOEKUF7K.js.map