@langwatch/mcp-server 0.6.1 → 0.7.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.
- package/CHANGELOG.md +23 -0
- package/Dockerfile +22 -0
- package/README.md +51 -8
- package/dist/{archive-scenario-YFD5THOR.js → archive-scenario-WJ2A7ETN.js} +4 -4
- package/dist/archive-suite-4JOM4SSL.js +15 -0
- package/dist/archive-suite-4JOM4SSL.js.map +1 -0
- package/dist/assign-prompt-tag-GL7EAAF3.js +19 -0
- package/dist/assign-prompt-tag-GL7EAAF3.js.map +1 -0
- package/dist/{chunk-6U4TCGFC.js → chunk-2GT7IFWK.js} +2 -2
- package/dist/{chunk-LLRQIF52.js → chunk-2WPLXEKF.js} +49 -5
- package/dist/chunk-2WPLXEKF.js.map +1 -0
- package/dist/chunk-4AUB2BIA.js +71 -0
- package/dist/chunk-4AUB2BIA.js.map +1 -0
- package/dist/chunk-BWWY5KEF.js +71 -0
- package/dist/chunk-BWWY5KEF.js.map +1 -0
- package/dist/{chunk-IX6QJKAD.js → chunk-CCWCIJJ3.js} +2 -2
- package/dist/chunk-E5JYYU3J.js +1567 -0
- package/dist/chunk-E5JYYU3J.js.map +1 -0
- package/dist/chunk-EGH5RPXM.js +25 -0
- package/dist/chunk-EGH5RPXM.js.map +1 -0
- package/dist/chunk-EUQDVOSU.js +39 -0
- package/dist/chunk-EUQDVOSU.js.map +1 -0
- package/dist/{chunk-5UOPNRXW.js → chunk-HYMIWO3U.js} +10 -3
- package/dist/{chunk-5UOPNRXW.js.map → chunk-HYMIWO3U.js.map} +1 -1
- package/dist/chunk-IE4M5OGE.js +42 -0
- package/dist/chunk-IE4M5OGE.js.map +1 -0
- package/dist/chunk-LUMEZEHL.js +48 -0
- package/dist/chunk-LUMEZEHL.js.map +1 -0
- package/dist/chunk-NUFPTHKU.js +9 -0
- package/dist/chunk-NUFPTHKU.js.map +1 -0
- package/dist/chunk-WQG2DFHX.js +86 -0
- package/dist/chunk-WQG2DFHX.js.map +1 -0
- package/dist/chunk-WVI5CJ6S.js +21 -0
- package/dist/chunk-WVI5CJ6S.js.map +1 -0
- package/dist/chunk-ZVS4UKN2.js +35 -0
- package/dist/chunk-ZVS4UKN2.js.map +1 -0
- package/dist/config.d.ts +17 -0
- package/dist/config.js +13 -0
- package/dist/create-agent-MBOOT3XK.js +23 -0
- package/dist/create-agent-MBOOT3XK.js.map +1 -0
- package/dist/create-annotation-XMV6A7ED.js +24 -0
- package/dist/create-annotation-XMV6A7ED.js.map +1 -0
- package/dist/create-dashboard-VRKLFVZJ.js +18 -0
- package/dist/create-dashboard-VRKLFVZJ.js.map +1 -0
- package/dist/create-dataset-7HQPZCRE.js +22 -0
- package/dist/create-dataset-7HQPZCRE.js.map +1 -0
- package/dist/create-dataset-records-2NIVFYTV.js +22 -0
- package/dist/create-dataset-records-2NIVFYTV.js.map +1 -0
- package/dist/{create-evaluator-E5X5ZP3B.js → create-evaluator-WYFRFLRC.js} +4 -4
- package/dist/create-mcp-server.d.ts +8 -0
- package/dist/create-mcp-server.js +8 -0
- package/dist/create-mcp-server.js.map +1 -0
- package/dist/{create-prompt-7Z35MIL6.js → create-prompt-IEN7O6JT.js} +7 -4
- package/dist/create-prompt-IEN7O6JT.js.map +1 -0
- package/dist/create-prompt-tag-CAEZ45VO.js +17 -0
- package/dist/create-prompt-tag-CAEZ45VO.js.map +1 -0
- package/dist/{create-scenario-DIMPJRPY.js → create-scenario-6YHSMGLP.js} +4 -4
- package/dist/create-suite-H5XOFDE5.js +38 -0
- package/dist/create-suite-H5XOFDE5.js.map +1 -0
- package/dist/delete-agent-JKTNBWAA.js +18 -0
- package/dist/delete-agent-JKTNBWAA.js.map +1 -0
- package/dist/delete-annotation-ACMDV6QO.js +17 -0
- package/dist/delete-annotation-ACMDV6QO.js.map +1 -0
- package/dist/delete-dashboard-VJSR7CRU.js +18 -0
- package/dist/delete-dashboard-VJSR7CRU.js.map +1 -0
- package/dist/delete-dataset-RTTTWP4D.js +20 -0
- package/dist/delete-dataset-RTTTWP4D.js.map +1 -0
- package/dist/delete-dataset-records-KNQTIPQK.js +21 -0
- package/dist/delete-dataset-records-KNQTIPQK.js.map +1 -0
- package/dist/delete-evaluator-7FVC5WM4.js +15 -0
- package/dist/delete-evaluator-7FVC5WM4.js.map +1 -0
- package/dist/delete-prompt-tag-ZMZUAGFW.js +17 -0
- package/dist/delete-prompt-tag-ZMZUAGFW.js.map +1 -0
- package/dist/delete-workflow-EYQ3T4RQ.js +17 -0
- package/dist/delete-workflow-EYQ3T4RQ.js.map +1 -0
- package/dist/get-agent-E3QSTVKG.js +28 -0
- package/dist/get-agent-E3QSTVKG.js.map +1 -0
- package/dist/{get-analytics-4YJW4S5L.js → get-analytics-2OHV763I.js} +22 -5
- package/dist/get-analytics-2OHV763I.js.map +1 -0
- package/dist/get-dashboard-PC7JDHH6.js +29 -0
- package/dist/get-dashboard-PC7JDHH6.js.map +1 -0
- package/dist/get-dataset-H5IK5FVU.js +48 -0
- package/dist/get-dataset-H5IK5FVU.js.map +1 -0
- package/dist/{get-evaluator-WDEH2F7M.js → get-evaluator-UWVUPYTM.js} +4 -4
- package/dist/{get-prompt-F6PDVC76.js → get-prompt-WZUOLLQC.js} +4 -4
- package/dist/get-prompt-WZUOLLQC.js.map +1 -0
- package/dist/{get-scenario-H24ZYNT5.js → get-scenario-Q6LCNUYN.js} +4 -4
- package/dist/get-simulation-run-Z2XKO256.js +56 -0
- package/dist/get-simulation-run-Z2XKO256.js.map +1 -0
- package/dist/get-suite-BXK5TN7P.js +44 -0
- package/dist/get-suite-BXK5TN7P.js.map +1 -0
- package/dist/{get-trace-27USKGO7.js → get-trace-4EJAYVBG.js} +3 -3
- package/dist/get-workflow-O34QJLHD.js +25 -0
- package/dist/get-workflow-O34QJLHD.js.map +1 -0
- package/dist/http-server-ISHF7NJX.js +224 -0
- package/dist/http-server-ISHF7NJX.js.map +1 -0
- package/dist/index.js +61109 -31519
- package/dist/index.js.map +1 -1
- package/dist/langwatch-api-annotations-ERBG27RF.js +17 -0
- package/dist/langwatch-api-annotations-ERBG27RF.js.map +1 -0
- package/dist/langwatch-api-dashboards-G6TR7VVO.js +17 -0
- package/dist/langwatch-api-dashboards-G6TR7VVO.js.map +1 -0
- package/dist/langwatch-api-monitors-WSXZLS2B.js +52 -0
- package/dist/langwatch-api-monitors-WSXZLS2B.js.map +1 -0
- package/dist/langwatch-api-secrets-RR5DKG2X.js +40 -0
- package/dist/langwatch-api-secrets-RR5DKG2X.js.map +1 -0
- package/dist/langwatch-api-triggers-2RTNSWQY.js +30 -0
- package/dist/langwatch-api-triggers-2RTNSWQY.js.map +1 -0
- package/dist/langwatch-api-workflows-VJRIIDZ7.js +15 -0
- package/dist/langwatch-api-workflows-VJRIIDZ7.js.map +1 -0
- package/dist/list-agents-AW3P6FJV.js +32 -0
- package/dist/list-agents-AW3P6FJV.js.map +1 -0
- package/dist/list-annotations-QNCGWPQ3.js +33 -0
- package/dist/list-annotations-QNCGWPQ3.js.map +1 -0
- package/dist/list-dashboards-R7RK2IXL.js +32 -0
- package/dist/list-dashboards-R7RK2IXL.js.map +1 -0
- package/dist/list-dataset-records-WVCSQP7P.js +39 -0
- package/dist/list-dataset-records-WVCSQP7P.js.map +1 -0
- package/dist/list-datasets-KEXRLDEU.js +60 -0
- package/dist/list-datasets-KEXRLDEU.js.map +1 -0
- package/dist/{list-evaluators-KRGI72EH.js → list-evaluators-7R2LB4JH.js} +4 -4
- package/dist/{list-model-providers-A5YCFTPI.js → list-model-providers-OBYJCKBX.js} +4 -4
- package/dist/list-prompt-tags-6LY3ZPYI.js +23 -0
- package/dist/list-prompt-tags-6LY3ZPYI.js.map +1 -0
- package/dist/{list-prompts-LKJSE7XN.js → list-prompts-VWEZ4CDE.js} +3 -3
- package/dist/{list-scenarios-ZK5CMGC4.js → list-scenarios-TXD4W2ZJ.js} +4 -4
- package/dist/list-simulation-runs-RHPOLMFI.js +43 -0
- package/dist/list-simulation-runs-RHPOLMFI.js.map +1 -0
- package/dist/list-suites-FSGBX27Z.js +42 -0
- package/dist/list-suites-FSGBX27Z.js.map +1 -0
- package/dist/list-workflows-VRGEZ3EN.js +35 -0
- package/dist/list-workflows-VRGEZ3EN.js.map +1 -0
- package/dist/rename-prompt-tag-VOJJLX4M.js +18 -0
- package/dist/rename-prompt-tag-VOJJLX4M.js.map +1 -0
- package/dist/run-agent-KTCC7TB7.js +36 -0
- package/dist/run-agent-KTCC7TB7.js.map +1 -0
- package/dist/run-evaluation-2X3V3Q6L.js +64 -0
- package/dist/run-evaluation-2X3V3Q6L.js.map +1 -0
- package/dist/run-suite-BTMHGI2D.js +29 -0
- package/dist/run-suite-BTMHGI2D.js.map +1 -0
- package/dist/run-workflow-IGAYGKJL.js +36 -0
- package/dist/run-workflow-IGAYGKJL.js.map +1 -0
- package/dist/{search-traces-SOKAAMAR.js → search-traces-VYFUIMXH.js} +3 -3
- package/dist/{set-model-provider-7MGULZDH.js → set-model-provider-W5IUI326.js} +4 -4
- package/dist/update-agent-4BB7EYLR.js +20 -0
- package/dist/update-agent-4BB7EYLR.js.map +1 -0
- package/dist/update-dataset-CXBKZ4W3.js +22 -0
- package/dist/update-dataset-CXBKZ4W3.js.map +1 -0
- package/dist/update-dataset-record-HOHAMHXG.js +19 -0
- package/dist/update-dataset-record-HOHAMHXG.js.map +1 -0
- package/dist/{update-evaluator-A3XINFLJ.js → update-evaluator-IVOR6FTR.js} +4 -4
- package/dist/{update-prompt-IW7X2UQM.js → update-prompt-OWQAKE7K.js} +5 -3
- package/dist/update-prompt-OWQAKE7K.js.map +1 -0
- package/dist/{update-scenario-ZT7TOBFR.js → update-scenario-GDFVILPN.js} +4 -4
- package/dist/update-suite-BXYUYSPT.js +39 -0
- package/dist/update-suite-BXYUYSPT.js.map +1 -0
- package/package.json +17 -3
- package/src/__tests__/all-tools.integration.test.ts +344 -0
- package/src/__tests__/config.unit.test.ts +81 -1
- package/src/__tests__/datasets.integration.test.ts +603 -0
- package/src/__tests__/datasets.unit.test.ts +240 -0
- package/src/__tests__/docker.integration.test.ts +234 -0
- package/src/__tests__/http-transport.integration.test.ts +397 -0
- package/src/__tests__/langwatch-api.unit.test.ts +174 -0
- package/src/__tests__/tools.unit.test.ts +177 -0
- package/src/config.d.ts +15 -0
- package/src/config.ts +83 -7
- package/src/create-mcp-server.d.ts +6 -0
- package/src/create-mcp-server.ts +1799 -0
- package/src/http-server.ts +329 -0
- package/src/index.ts +22 -593
- package/src/langwatch-api-agents.ts +108 -0
- package/src/langwatch-api-annotations.ts +49 -0
- package/src/langwatch-api-dashboards.ts +48 -0
- package/src/langwatch-api-datasets.ts +191 -0
- package/src/langwatch-api-evaluators.ts +10 -0
- package/src/langwatch-api-monitors.ts +82 -0
- package/src/langwatch-api-secrets.ts +48 -0
- package/src/langwatch-api-simulation-runs.ts +51 -0
- package/src/langwatch-api-suites.ts +118 -0
- package/src/langwatch-api-triggers.ts +48 -0
- package/src/langwatch-api-workflows.ts +41 -0
- package/src/langwatch-api.ts +60 -2
- package/src/schemas/create-dataset.ts +48 -0
- package/src/schemas/index.ts +1 -0
- package/src/tools/archive-suite.ts +12 -0
- package/src/tools/assign-prompt-tag.ts +16 -0
- package/src/tools/create-agent.ts +15 -0
- package/src/tools/create-annotation.ts +18 -0
- package/src/tools/create-dashboard.ts +7 -0
- package/src/tools/create-dataset-records.ts +23 -0
- package/src/tools/create-dataset.ts +22 -0
- package/src/tools/create-prompt-tag.ts +12 -0
- package/src/tools/create-prompt.ts +4 -0
- package/src/tools/create-suite.ts +42 -0
- package/src/tools/delete-agent.ts +7 -0
- package/src/tools/delete-annotation.ts +7 -0
- package/src/tools/delete-dashboard.ts +7 -0
- package/src/tools/delete-dataset-records.ts +22 -0
- package/src/tools/delete-dataset.ts +20 -0
- package/src/tools/delete-evaluator.ts +12 -0
- package/src/tools/delete-prompt-tag.ts +12 -0
- package/src/tools/delete-workflow.ts +7 -0
- package/src/tools/format-dataset-mutation.ts +25 -0
- package/src/tools/get-agent.ts +21 -0
- package/src/tools/get-analytics.ts +30 -3
- package/src/tools/get-dashboard.ts +22 -0
- package/src/tools/get-dataset.ts +63 -0
- package/src/tools/get-prompt.ts +2 -1
- package/src/tools/get-simulation-run.ts +60 -0
- package/src/tools/get-suite.ts +47 -0
- package/src/tools/get-workflow.ts +17 -0
- package/src/tools/list-agents.ts +27 -0
- package/src/tools/list-annotations.ts +33 -0
- package/src/tools/list-dashboards.ts +27 -0
- package/src/tools/list-dataset-records.ts +46 -0
- package/src/tools/list-datasets.ts +80 -0
- package/src/tools/list-prompt-tags.ts +21 -0
- package/src/tools/list-simulation-runs.ts +49 -0
- package/src/tools/list-suites.ts +43 -0
- package/src/tools/list-workflows.ts +31 -0
- package/src/tools/rename-prompt-tag.ts +14 -0
- package/src/tools/run-agent.ts +36 -0
- package/src/tools/run-evaluation.ts +87 -0
- package/src/tools/run-suite.ts +28 -0
- package/src/tools/run-workflow.ts +36 -0
- package/src/tools/update-agent.ts +13 -0
- package/src/tools/update-dataset-record.ts +21 -0
- package/src/tools/update-dataset.ts +23 -0
- package/src/tools/update-prompt.ts +3 -0
- package/src/tools/update-suite.ts +44 -0
- package/src/utils/escape-markdown.ts +12 -0
- package/tsup.config.ts +5 -1
- package/dist/chunk-AAQNA53E.js +0 -28
- package/dist/chunk-AAQNA53E.js.map +0 -1
- package/dist/chunk-LLRQIF52.js.map +0 -1
- package/dist/config-FIQWQRUB.js +0 -11
- package/dist/create-prompt-7Z35MIL6.js.map +0 -1
- package/dist/get-analytics-4YJW4S5L.js.map +0 -1
- package/dist/get-prompt-F6PDVC76.js.map +0 -1
- package/dist/update-prompt-IW7X2UQM.js.map +0 -1
- /package/dist/{archive-scenario-YFD5THOR.js.map → archive-scenario-WJ2A7ETN.js.map} +0 -0
- /package/dist/{chunk-6U4TCGFC.js.map → chunk-2GT7IFWK.js.map} +0 -0
- /package/dist/{chunk-IX6QJKAD.js.map → chunk-CCWCIJJ3.js.map} +0 -0
- /package/dist/{config-FIQWQRUB.js.map → config.js.map} +0 -0
- /package/dist/{create-evaluator-E5X5ZP3B.js.map → create-evaluator-WYFRFLRC.js.map} +0 -0
- /package/dist/{create-scenario-DIMPJRPY.js.map → create-scenario-6YHSMGLP.js.map} +0 -0
- /package/dist/{get-evaluator-WDEH2F7M.js.map → get-evaluator-UWVUPYTM.js.map} +0 -0
- /package/dist/{get-scenario-H24ZYNT5.js.map → get-scenario-Q6LCNUYN.js.map} +0 -0
- /package/dist/{get-trace-27USKGO7.js.map → get-trace-4EJAYVBG.js.map} +0 -0
- /package/dist/{list-evaluators-KRGI72EH.js.map → list-evaluators-7R2LB4JH.js.map} +0 -0
- /package/dist/{list-model-providers-A5YCFTPI.js.map → list-model-providers-OBYJCKBX.js.map} +0 -0
- /package/dist/{list-prompts-LKJSE7XN.js.map → list-prompts-VWEZ4CDE.js.map} +0 -0
- /package/dist/{list-scenarios-ZK5CMGC4.js.map → list-scenarios-TXD4W2ZJ.js.map} +0 -0
- /package/dist/{search-traces-SOKAAMAR.js.map → search-traces-VYFUIMXH.js.map} +0 -0
- /package/dist/{set-model-provider-7MGULZDH.js.map → set-model-provider-W5IUI326.js.map} +0 -0
- /package/dist/{update-evaluator-A3XINFLJ.js.map → update-evaluator-IVOR6FTR.js.map} +0 -0
- /package/dist/{update-scenario-ZT7TOBFR.js.map → update-scenario-GDFVILPN.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listScenarios
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-2GT7IFWK.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
6
|
|
|
7
7
|
// src/tools/list-scenarios.ts
|
|
8
8
|
async function handleListScenarios(params) {
|
|
@@ -37,4 +37,4 @@ async function handleListScenarios(params) {
|
|
|
37
37
|
export {
|
|
38
38
|
handleListScenarios
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=list-scenarios-
|
|
40
|
+
//# sourceMappingURL=list-scenarios-TXD4W2ZJ.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listSimulationRuns
|
|
3
|
+
} from "./chunk-EGH5RPXM.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/list-simulation-runs.ts
|
|
8
|
+
async function handleListSimulationRuns(params) {
|
|
9
|
+
const result = await listSimulationRuns({
|
|
10
|
+
scenarioSetId: params.scenarioSetId,
|
|
11
|
+
batchRunId: params.batchRunId,
|
|
12
|
+
limit: params.limit
|
|
13
|
+
});
|
|
14
|
+
if (params.format === "json") {
|
|
15
|
+
return JSON.stringify(result, null, 2);
|
|
16
|
+
}
|
|
17
|
+
const { runs } = result;
|
|
18
|
+
if (runs.length === 0) {
|
|
19
|
+
return "No simulation runs found.\n\n> Run a suite first with `platform_run_suite` to create simulation runs.";
|
|
20
|
+
}
|
|
21
|
+
const lines = [];
|
|
22
|
+
lines.push(`# Simulation Runs (${runs.length} results${result.hasMore ? ", more available" : ""})
|
|
23
|
+
`);
|
|
24
|
+
for (const run of runs) {
|
|
25
|
+
const statusIcon = run.status === "SUCCESS" ? "pass" : run.status === "FAILED" ? "FAIL" : run.status;
|
|
26
|
+
const duration = run.durationInMs > 0 ? `${(run.durationInMs / 1e3).toFixed(1)}s` : "\u2014";
|
|
27
|
+
const verdict = run.results?.verdict ?? "";
|
|
28
|
+
lines.push(`## ${run.name ?? run.scenarioId} \u2014 ${statusIcon}${verdict ? ` (${verdict})` : ""}`);
|
|
29
|
+
lines.push(`**Run ID**: ${run.scenarioRunId}`);
|
|
30
|
+
lines.push(`**Batch**: ${run.batchRunId}`);
|
|
31
|
+
lines.push(`**Duration**: ${duration}`);
|
|
32
|
+
if (run.totalCost) {
|
|
33
|
+
lines.push(`**Cost**: $${run.totalCost.toFixed(4)}`);
|
|
34
|
+
}
|
|
35
|
+
lines.push("");
|
|
36
|
+
}
|
|
37
|
+
lines.push("> Use `platform_get_simulation_run` with a run ID to see full details (messages, results).");
|
|
38
|
+
return lines.join("\n");
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
handleListSimulationRuns
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=list-simulation-runs-RHPOLMFI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/list-simulation-runs.ts"],"sourcesContent":["import { listSimulationRuns as apiListSimulationRuns } from \"../langwatch-api-simulation-runs.js\";\n\n/**\n * Handles the platform_list_simulation_runs MCP tool invocation.\n */\nexport async function handleListSimulationRuns(params: {\n scenarioSetId?: string;\n batchRunId?: string;\n limit?: number;\n format?: \"digest\" | \"json\";\n}): Promise<string> {\n const result = await apiListSimulationRuns({\n scenarioSetId: params.scenarioSetId,\n batchRunId: params.batchRunId,\n limit: params.limit,\n });\n\n if (params.format === \"json\") {\n return JSON.stringify(result, null, 2);\n }\n\n const { runs } = result;\n\n if (runs.length === 0) {\n return \"No simulation runs found.\\n\\n> Run a suite first with `platform_run_suite` to create simulation runs.\";\n }\n\n const lines: string[] = [];\n lines.push(`# Simulation Runs (${runs.length} results${result.hasMore ? \", more available\" : \"\"})\\n`);\n\n for (const run of runs) {\n const statusIcon = run.status === \"SUCCESS\" ? \"pass\" : run.status === \"FAILED\" ? \"FAIL\" : run.status;\n const duration = run.durationInMs > 0 ? `${(run.durationInMs / 1000).toFixed(1)}s` : \"—\";\n const verdict = run.results?.verdict ?? \"\";\n\n lines.push(`## ${run.name ?? run.scenarioId} — ${statusIcon}${verdict ? ` (${verdict})` : \"\"}`);\n lines.push(`**Run ID**: ${run.scenarioRunId}`);\n lines.push(`**Batch**: ${run.batchRunId}`);\n lines.push(`**Duration**: ${duration}`);\n if (run.totalCost) {\n lines.push(`**Cost**: $${run.totalCost.toFixed(4)}`);\n }\n lines.push(\"\");\n }\n\n lines.push(\"> Use `platform_get_simulation_run` with a run ID to see full details (messages, results).\");\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAKA,eAAsB,yBAAyB,QAK3B;AAClB,QAAM,SAAS,MAAM,mBAAsB;AAAA,IACzC,eAAe,OAAO;AAAA,IACtB,YAAY,OAAO;AAAA,IACnB,OAAO,OAAO;AAAA,EAChB,CAAC;AAED,MAAI,OAAO,WAAW,QAAQ;AAC5B,WAAO,KAAK,UAAU,QAAQ,MAAM,CAAC;AAAA,EACvC;AAEA,QAAM,EAAE,KAAK,IAAI;AAEjB,MAAI,KAAK,WAAW,GAAG;AACrB,WAAO;AAAA,EACT;AAEA,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,sBAAsB,KAAK,MAAM,WAAW,OAAO,UAAU,qBAAqB,EAAE;AAAA,CAAK;AAEpG,aAAW,OAAO,MAAM;AACtB,UAAM,aAAa,IAAI,WAAW,YAAY,SAAS,IAAI,WAAW,WAAW,SAAS,IAAI;AAC9F,UAAM,WAAW,IAAI,eAAe,IAAI,IAAI,IAAI,eAAe,KAAM,QAAQ,CAAC,CAAC,MAAM;AACrF,UAAM,UAAU,IAAI,SAAS,WAAW;AAExC,UAAM,KAAK,MAAM,IAAI,QAAQ,IAAI,UAAU,WAAM,UAAU,GAAG,UAAU,KAAK,OAAO,MAAM,EAAE,EAAE;AAC9F,UAAM,KAAK,eAAe,IAAI,aAAa,EAAE;AAC7C,UAAM,KAAK,cAAc,IAAI,UAAU,EAAE;AACzC,UAAM,KAAK,iBAAiB,QAAQ,EAAE;AACtC,QAAI,IAAI,WAAW;AACjB,YAAM,KAAK,cAAc,IAAI,UAAU,QAAQ,CAAC,CAAC,EAAE;AAAA,IACrD;AACA,UAAM,KAAK,EAAE;AAAA,EACf;AAEA,QAAM,KAAK,4FAA4F;AAEvG,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listSuites
|
|
3
|
+
} from "./chunk-LUMEZEHL.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/list-suites.ts
|
|
8
|
+
async function handleListSuites(params) {
|
|
9
|
+
const suites = await listSuites();
|
|
10
|
+
if (params.format === "json") {
|
|
11
|
+
return JSON.stringify(suites, null, 2);
|
|
12
|
+
}
|
|
13
|
+
if (!Array.isArray(suites) || suites.length === 0) {
|
|
14
|
+
return "No suites (run plans) found in this project.\n\n> Tip: Use `platform_create_suite` to create your first suite.";
|
|
15
|
+
}
|
|
16
|
+
const lines = [];
|
|
17
|
+
lines.push(`# Suites / Run Plans (${suites.length} total)
|
|
18
|
+
`);
|
|
19
|
+
for (const s of suites) {
|
|
20
|
+
lines.push(`## ${s.name}`);
|
|
21
|
+
lines.push(`**ID**: ${s.id}`);
|
|
22
|
+
lines.push(`**Slug**: ${s.slug}`);
|
|
23
|
+
lines.push(`**Scenarios**: ${s.scenarioIds.length}`);
|
|
24
|
+
lines.push(`**Targets**: ${s.targets.length} (${s.targets.map((t) => `${t.type}:${t.referenceId}`).join(", ")})`);
|
|
25
|
+
lines.push(`**Repeat**: ${s.repeatCount}x`);
|
|
26
|
+
if (s.description) {
|
|
27
|
+
lines.push(`**Description**: ${s.description}`);
|
|
28
|
+
}
|
|
29
|
+
if (Array.isArray(s.labels) && s.labels.length > 0) {
|
|
30
|
+
lines.push(`**Labels**: ${s.labels.join(", ")}`);
|
|
31
|
+
}
|
|
32
|
+
lines.push("");
|
|
33
|
+
}
|
|
34
|
+
lines.push(
|
|
35
|
+
"> Use `platform_get_suite` with the ID to see full details, or `platform_run_suite` to trigger execution."
|
|
36
|
+
);
|
|
37
|
+
return lines.join("\n");
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
handleListSuites
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=list-suites-FSGBX27Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/list-suites.ts"],"sourcesContent":["import { listSuites as apiListSuites } from \"../langwatch-api-suites.js\";\n\n/**\n * Handles the platform_list_suites MCP tool invocation.\n */\nexport async function handleListSuites(params: {\n format?: \"digest\" | \"json\";\n}): Promise<string> {\n const suites = await apiListSuites();\n\n if (params.format === \"json\") {\n return JSON.stringify(suites, null, 2);\n }\n\n if (!Array.isArray(suites) || suites.length === 0) {\n return \"No suites (run plans) found in this project.\\n\\n> Tip: Use `platform_create_suite` to create your first suite.\";\n }\n\n const lines: string[] = [];\n lines.push(`# Suites / Run Plans (${suites.length} total)\\n`);\n\n for (const s of suites) {\n lines.push(`## ${s.name}`);\n lines.push(`**ID**: ${s.id}`);\n lines.push(`**Slug**: ${s.slug}`);\n lines.push(`**Scenarios**: ${s.scenarioIds.length}`);\n lines.push(`**Targets**: ${s.targets.length} (${s.targets.map((t) => `${t.type}:${t.referenceId}`).join(\", \")})`);\n lines.push(`**Repeat**: ${s.repeatCount}x`);\n if (s.description) {\n lines.push(`**Description**: ${s.description}`);\n }\n if (Array.isArray(s.labels) && s.labels.length > 0) {\n lines.push(`**Labels**: ${s.labels.join(\", \")}`);\n }\n lines.push(\"\");\n }\n\n lines.push(\n \"> Use `platform_get_suite` with the ID to see full details, or `platform_run_suite` to trigger execution.\"\n );\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAKA,eAAsB,iBAAiB,QAEnB;AAClB,QAAM,SAAS,MAAM,WAAc;AAEnC,MAAI,OAAO,WAAW,QAAQ;AAC5B,WAAO,KAAK,UAAU,QAAQ,MAAM,CAAC;AAAA,EACvC;AAEA,MAAI,CAAC,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW,GAAG;AACjD,WAAO;AAAA,EACT;AAEA,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,yBAAyB,OAAO,MAAM;AAAA,CAAW;AAE5D,aAAW,KAAK,QAAQ;AACtB,UAAM,KAAK,MAAM,EAAE,IAAI,EAAE;AACzB,UAAM,KAAK,WAAW,EAAE,EAAE,EAAE;AAC5B,UAAM,KAAK,aAAa,EAAE,IAAI,EAAE;AAChC,UAAM,KAAK,kBAAkB,EAAE,YAAY,MAAM,EAAE;AACnD,UAAM,KAAK,gBAAgB,EAAE,QAAQ,MAAM,KAAK,EAAE,QAAQ,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,IAAI,EAAE,WAAW,EAAE,EAAE,KAAK,IAAI,CAAC,GAAG;AAChH,UAAM,KAAK,eAAe,EAAE,WAAW,GAAG;AAC1C,QAAI,EAAE,aAAa;AACjB,YAAM,KAAK,oBAAoB,EAAE,WAAW,EAAE;AAAA,IAChD;AACA,QAAI,MAAM,QAAQ,EAAE,MAAM,KAAK,EAAE,OAAO,SAAS,GAAG;AAClD,YAAM,KAAK,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC,EAAE;AAAA,IACjD;AACA,UAAM,KAAK,EAAE;AAAA,EACf;AAEA,QAAM;AAAA,IACJ;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listWorkflows
|
|
3
|
+
} from "./chunk-ZVS4UKN2.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/list-workflows.ts
|
|
8
|
+
async function handleListWorkflows() {
|
|
9
|
+
const workflows = await listWorkflows();
|
|
10
|
+
if (!Array.isArray(workflows) || workflows.length === 0) {
|
|
11
|
+
return "No workflows found in this project.";
|
|
12
|
+
}
|
|
13
|
+
const lines = [];
|
|
14
|
+
lines.push(`# Workflows (${workflows.length} total)
|
|
15
|
+
`);
|
|
16
|
+
for (const w of workflows) {
|
|
17
|
+
const tags = [];
|
|
18
|
+
if (w.isEvaluator) tags.push("evaluator");
|
|
19
|
+
if (w.isComponent) tags.push("component");
|
|
20
|
+
const tagStr = tags.length > 0 ? ` [${tags.join(", ")}]` : "";
|
|
21
|
+
lines.push(`## ${w.name}${tagStr}`);
|
|
22
|
+
lines.push(`**ID**: ${w.id}`);
|
|
23
|
+
if (w.description) lines.push(`**Description**: ${w.description}`);
|
|
24
|
+
lines.push(`**Updated**: ${w.updatedAt}`);
|
|
25
|
+
lines.push("");
|
|
26
|
+
}
|
|
27
|
+
lines.push(
|
|
28
|
+
"> Use `platform_get_workflow` with the ID to see full workflow details."
|
|
29
|
+
);
|
|
30
|
+
return lines.join("\n");
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
handleListWorkflows
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=list-workflows-VRGEZ3EN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/list-workflows.ts"],"sourcesContent":["import { listWorkflows as apiListWorkflows } from \"../langwatch-api-workflows.js\";\n\nexport async function handleListWorkflows(): Promise<string> {\n const workflows = await apiListWorkflows();\n\n if (!Array.isArray(workflows) || workflows.length === 0) {\n return \"No workflows found in this project.\";\n }\n\n const lines: string[] = [];\n lines.push(`# Workflows (${workflows.length} total)\\n`);\n\n for (const w of workflows) {\n const tags: string[] = [];\n if (w.isEvaluator) tags.push(\"evaluator\");\n if (w.isComponent) tags.push(\"component\");\n const tagStr = tags.length > 0 ? ` [${tags.join(\", \")}]` : \"\";\n\n lines.push(`## ${w.name}${tagStr}`);\n lines.push(`**ID**: ${w.id}`);\n if (w.description) lines.push(`**Description**: ${w.description}`);\n lines.push(`**Updated**: ${w.updatedAt}`);\n lines.push(\"\");\n }\n\n lines.push(\n \"> Use `platform_get_workflow` with the ID to see full workflow details.\",\n );\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAEA,eAAsB,sBAAuC;AAC3D,QAAM,YAAY,MAAM,cAAiB;AAEzC,MAAI,CAAC,MAAM,QAAQ,SAAS,KAAK,UAAU,WAAW,GAAG;AACvD,WAAO;AAAA,EACT;AAEA,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,gBAAgB,UAAU,MAAM;AAAA,CAAW;AAEtD,aAAW,KAAK,WAAW;AACzB,UAAM,OAAiB,CAAC;AACxB,QAAI,EAAE,YAAa,MAAK,KAAK,WAAW;AACxC,QAAI,EAAE,YAAa,MAAK,KAAK,WAAW;AACxC,UAAM,SAAS,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,IAAI,CAAC,MAAM;AAE3D,UAAM,KAAK,MAAM,EAAE,IAAI,GAAG,MAAM,EAAE;AAClC,UAAM,KAAK,WAAW,EAAE,EAAE,EAAE;AAC5B,QAAI,EAAE,YAAa,OAAM,KAAK,oBAAoB,EAAE,WAAW,EAAE;AACjE,UAAM,KAAK,gBAAgB,EAAE,SAAS,EAAE;AACxC,UAAM,KAAK,EAAE;AAAA,EACf;AAEA,QAAM;AAAA,IACJ;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renamePromptTag
|
|
3
|
+
} from "./chunk-2WPLXEKF.js";
|
|
4
|
+
import "./chunk-BWWY5KEF.js";
|
|
5
|
+
|
|
6
|
+
// src/tools/rename-prompt-tag.ts
|
|
7
|
+
async function handleRenamePromptTag(params) {
|
|
8
|
+
await renamePromptTag({ tag: params.tag, name: params.name });
|
|
9
|
+
const lines = [];
|
|
10
|
+
lines.push("Tag renamed successfully!\n");
|
|
11
|
+
lines.push(`**Old name**: ${params.tag}`);
|
|
12
|
+
lines.push(`**New name**: ${params.name}`);
|
|
13
|
+
return lines.join("\n");
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
handleRenamePromptTag
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=rename-prompt-tag-VOJJLX4M.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/rename-prompt-tag.ts"],"sourcesContent":["import { renamePromptTag as apiRenamePromptTag } from \"../langwatch-api.js\";\n\nexport async function handleRenamePromptTag(params: {\n tag: string;\n name: string;\n}): Promise<string> {\n await apiRenamePromptTag({ tag: params.tag, name: params.name });\n\n const lines: string[] = [];\n lines.push(\"Tag renamed successfully!\\n\");\n lines.push(`**Old name**: ${params.tag}`);\n lines.push(`**New name**: ${params.name}`);\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;AAEA,eAAsB,sBAAsB,QAGxB;AAClB,QAAM,gBAAmB,EAAE,KAAK,OAAO,KAAK,MAAM,OAAO,KAAK,CAAC;AAE/D,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,6BAA6B;AACxC,QAAM,KAAK,iBAAiB,OAAO,GAAG,EAAE;AACxC,QAAM,KAAK,iBAAiB,OAAO,IAAI,EAAE;AACzC,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runAgent
|
|
3
|
+
} from "./chunk-4AUB2BIA.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/run-agent.ts
|
|
8
|
+
async function handleRunAgent(params) {
|
|
9
|
+
let parsedInput = {};
|
|
10
|
+
if (params.input) {
|
|
11
|
+
try {
|
|
12
|
+
parsedInput = JSON.parse(params.input);
|
|
13
|
+
} catch {
|
|
14
|
+
return "Error: `input` must be a valid JSON object.";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const { agentType, result } = await runAgent(params.id, parsedInput);
|
|
18
|
+
const lines = [];
|
|
19
|
+
lines.push(`Agent executed successfully (type: ${agentType}).
|
|
20
|
+
`);
|
|
21
|
+
if (typeof result === "object" && result !== null) {
|
|
22
|
+
const output = result.output;
|
|
23
|
+
if (output !== void 0) {
|
|
24
|
+
lines.push("**Output:**");
|
|
25
|
+
lines.push(typeof output === "string" ? output : JSON.stringify(output, null, 2));
|
|
26
|
+
} else {
|
|
27
|
+
lines.push("**Result:**");
|
|
28
|
+
lines.push(JSON.stringify(result, null, 2));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return lines.join("\n");
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
handleRunAgent
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=run-agent-KTCC7TB7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/run-agent.ts"],"sourcesContent":["import { runAgent as apiRunAgent } from \"../langwatch-api-agents.js\";\n\n/**\n * Handles the platform_run_agent MCP tool invocation.\n */\nexport async function handleRunAgent(params: {\n id: string;\n input?: string;\n}): Promise<string> {\n let parsedInput: Record<string, unknown> = {};\n if (params.input) {\n try {\n parsedInput = JSON.parse(params.input) as Record<string, unknown>;\n } catch {\n return \"Error: `input` must be a valid JSON object.\";\n }\n }\n\n const { agentType, result } = await apiRunAgent(params.id, parsedInput);\n\n const lines: string[] = [];\n lines.push(`Agent executed successfully (type: ${agentType}).\\n`);\n\n if (typeof result === \"object\" && result !== null) {\n const output = (result as Record<string, unknown>).output;\n if (output !== undefined) {\n lines.push(\"**Output:**\");\n lines.push(typeof output === \"string\" ? output : JSON.stringify(output, null, 2));\n } else {\n lines.push(\"**Result:**\");\n lines.push(JSON.stringify(result, null, 2));\n }\n }\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAKA,eAAsB,eAAe,QAGjB;AAClB,MAAI,cAAuC,CAAC;AAC5C,MAAI,OAAO,OAAO;AAChB,QAAI;AACF,oBAAc,KAAK,MAAM,OAAO,KAAK;AAAA,IACvC,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AAEA,QAAM,EAAE,WAAW,OAAO,IAAI,MAAM,SAAY,OAAO,IAAI,WAAW;AAEtE,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,sCAAsC,SAAS;AAAA,CAAM;AAEhE,MAAI,OAAO,WAAW,YAAY,WAAW,MAAM;AACjD,UAAM,SAAU,OAAmC;AACnD,QAAI,WAAW,QAAW;AACxB,YAAM,KAAK,aAAa;AACxB,YAAM,KAAK,OAAO,WAAW,WAAW,SAAS,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AAAA,IAClF,OAAO;AACL,YAAM,KAAK,aAAa;AACxB,YAAM,KAAK,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AAAA,IAC5C;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
makeRequest
|
|
3
|
+
} from "./chunk-2WPLXEKF.js";
|
|
4
|
+
import "./chunk-BWWY5KEF.js";
|
|
5
|
+
|
|
6
|
+
// src/tools/run-evaluation.ts
|
|
7
|
+
async function handleRunEvaluation(params) {
|
|
8
|
+
const result = await makeRequest(
|
|
9
|
+
"POST",
|
|
10
|
+
`/api/evaluations/v3/${encodeURIComponent(params.slug)}/run`
|
|
11
|
+
);
|
|
12
|
+
const lines = [];
|
|
13
|
+
lines.push(`Evaluation started!
|
|
14
|
+
`);
|
|
15
|
+
lines.push(`**Run ID**: ${result.runId}`);
|
|
16
|
+
lines.push(`**Status**: ${result.status}`);
|
|
17
|
+
lines.push(`**Total cells**: ${result.total}`);
|
|
18
|
+
if (result.runUrl) lines.push(`**View at**: ${result.runUrl}`);
|
|
19
|
+
lines.push("");
|
|
20
|
+
lines.push(
|
|
21
|
+
`> Use \`platform_evaluation_status\` with run ID "${result.runId}" to check progress.`
|
|
22
|
+
);
|
|
23
|
+
return lines.join("\n");
|
|
24
|
+
}
|
|
25
|
+
async function handleEvaluationStatus(params) {
|
|
26
|
+
const status = await makeRequest(
|
|
27
|
+
"GET",
|
|
28
|
+
`/api/evaluations/v3/runs/${encodeURIComponent(params.runId)}`
|
|
29
|
+
);
|
|
30
|
+
const lines = [];
|
|
31
|
+
lines.push(`# Evaluation Run ${status.runId}
|
|
32
|
+
`);
|
|
33
|
+
lines.push(`**Status**: ${status.status}`);
|
|
34
|
+
lines.push(`**Progress**: ${status.progress}/${status.total} cells`);
|
|
35
|
+
if (status.startedAt) {
|
|
36
|
+
lines.push(`**Started**: ${new Date(status.startedAt).toISOString()}`);
|
|
37
|
+
}
|
|
38
|
+
if (status.finishedAt) {
|
|
39
|
+
lines.push(`**Finished**: ${new Date(status.finishedAt).toISOString()}`);
|
|
40
|
+
}
|
|
41
|
+
if (status.summary) {
|
|
42
|
+
lines.push("\n## Summary\n");
|
|
43
|
+
if (status.summary.completedCells !== void 0) {
|
|
44
|
+
lines.push(`**Completed**: ${status.summary.completedCells}`);
|
|
45
|
+
}
|
|
46
|
+
if (status.summary.failedCells) {
|
|
47
|
+
lines.push(`**Failed**: ${status.summary.failedCells}`);
|
|
48
|
+
}
|
|
49
|
+
if (status.summary.duration) {
|
|
50
|
+
lines.push(
|
|
51
|
+
`**Duration**: ${(status.summary.duration / 1e3).toFixed(1)}s`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
if (status.summary.runUrl) {
|
|
55
|
+
lines.push(`**View results**: ${status.summary.runUrl}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return lines.join("\n");
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
handleEvaluationStatus,
|
|
62
|
+
handleRunEvaluation
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=run-evaluation-2X3V3Q6L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/run-evaluation.ts"],"sourcesContent":["import { makeRequest } from \"../langwatch-api.js\";\n\ninterface EvaluationRunResponse {\n runId: string;\n status: string;\n total: number;\n runUrl?: string;\n}\n\ninterface EvaluationStatusResponse {\n runId: string;\n status: string;\n progress: number;\n total: number;\n startedAt?: number;\n finishedAt?: number;\n summary?: {\n totalCells?: number;\n completedCells?: number;\n failedCells?: number;\n duration?: number;\n runUrl?: string;\n };\n}\n\nexport async function handleRunEvaluation(params: {\n slug: string;\n}): Promise<string> {\n const result = (await makeRequest(\n \"POST\",\n `/api/evaluations/v3/${encodeURIComponent(params.slug)}/run`,\n )) as EvaluationRunResponse;\n\n const lines: string[] = [];\n lines.push(`Evaluation started!\\n`);\n lines.push(`**Run ID**: ${result.runId}`);\n lines.push(`**Status**: ${result.status}`);\n lines.push(`**Total cells**: ${result.total}`);\n if (result.runUrl) lines.push(`**View at**: ${result.runUrl}`);\n lines.push(\"\");\n lines.push(\n `> Use \\`platform_evaluation_status\\` with run ID \"${result.runId}\" to check progress.`,\n );\n\n return lines.join(\"\\n\");\n}\n\nexport async function handleEvaluationStatus(params: {\n runId: string;\n}): Promise<string> {\n const status = (await makeRequest(\n \"GET\",\n `/api/evaluations/v3/runs/${encodeURIComponent(params.runId)}`,\n )) as EvaluationStatusResponse;\n\n const lines: string[] = [];\n lines.push(`# Evaluation Run ${status.runId}\\n`);\n lines.push(`**Status**: ${status.status}`);\n lines.push(`**Progress**: ${status.progress}/${status.total} cells`);\n\n if (status.startedAt) {\n lines.push(`**Started**: ${new Date(status.startedAt).toISOString()}`);\n }\n if (status.finishedAt) {\n lines.push(`**Finished**: ${new Date(status.finishedAt).toISOString()}`);\n }\n\n if (status.summary) {\n lines.push(\"\\n## Summary\\n\");\n if (status.summary.completedCells !== undefined) {\n lines.push(`**Completed**: ${status.summary.completedCells}`);\n }\n if (status.summary.failedCells) {\n lines.push(`**Failed**: ${status.summary.failedCells}`);\n }\n if (status.summary.duration) {\n lines.push(\n `**Duration**: ${(status.summary.duration / 1000).toFixed(1)}s`,\n );\n }\n if (status.summary.runUrl) {\n lines.push(`**View results**: ${status.summary.runUrl}`);\n }\n }\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;AAyBA,eAAsB,oBAAoB,QAEtB;AAClB,QAAM,SAAU,MAAM;AAAA,IACpB;AAAA,IACA,uBAAuB,mBAAmB,OAAO,IAAI,CAAC;AAAA,EACxD;AAEA,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK;AAAA,CAAuB;AAClC,QAAM,KAAK,eAAe,OAAO,KAAK,EAAE;AACxC,QAAM,KAAK,eAAe,OAAO,MAAM,EAAE;AACzC,QAAM,KAAK,oBAAoB,OAAO,KAAK,EAAE;AAC7C,MAAI,OAAO,OAAQ,OAAM,KAAK,gBAAgB,OAAO,MAAM,EAAE;AAC7D,QAAM,KAAK,EAAE;AACb,QAAM;AAAA,IACJ,qDAAqD,OAAO,KAAK;AAAA,EACnE;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;AAEA,eAAsB,uBAAuB,QAEzB;AAClB,QAAM,SAAU,MAAM;AAAA,IACpB;AAAA,IACA,4BAA4B,mBAAmB,OAAO,KAAK,CAAC;AAAA,EAC9D;AAEA,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,oBAAoB,OAAO,KAAK;AAAA,CAAI;AAC/C,QAAM,KAAK,eAAe,OAAO,MAAM,EAAE;AACzC,QAAM,KAAK,iBAAiB,OAAO,QAAQ,IAAI,OAAO,KAAK,QAAQ;AAEnE,MAAI,OAAO,WAAW;AACpB,UAAM,KAAK,gBAAgB,IAAI,KAAK,OAAO,SAAS,EAAE,YAAY,CAAC,EAAE;AAAA,EACvE;AACA,MAAI,OAAO,YAAY;AACrB,UAAM,KAAK,iBAAiB,IAAI,KAAK,OAAO,UAAU,EAAE,YAAY,CAAC,EAAE;AAAA,EACzE;AAEA,MAAI,OAAO,SAAS;AAClB,UAAM,KAAK,gBAAgB;AAC3B,QAAI,OAAO,QAAQ,mBAAmB,QAAW;AAC/C,YAAM,KAAK,kBAAkB,OAAO,QAAQ,cAAc,EAAE;AAAA,IAC9D;AACA,QAAI,OAAO,QAAQ,aAAa;AAC9B,YAAM,KAAK,eAAe,OAAO,QAAQ,WAAW,EAAE;AAAA,IACxD;AACA,QAAI,OAAO,QAAQ,UAAU;AAC3B,YAAM;AAAA,QACJ,kBAAkB,OAAO,QAAQ,WAAW,KAAM,QAAQ,CAAC,CAAC;AAAA,MAC9D;AAAA,IACF;AACA,QAAI,OAAO,QAAQ,QAAQ;AACzB,YAAM,KAAK,qBAAqB,OAAO,QAAQ,MAAM,EAAE;AAAA,IACzD;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runSuite
|
|
3
|
+
} from "./chunk-LUMEZEHL.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/run-suite.ts
|
|
8
|
+
async function handleRunSuite(params) {
|
|
9
|
+
const result = await runSuite(params.id);
|
|
10
|
+
const lines = [];
|
|
11
|
+
lines.push(`Suite run scheduled successfully.`);
|
|
12
|
+
lines.push("");
|
|
13
|
+
lines.push(`**Batch Run ID**: ${result.batchRunId}`);
|
|
14
|
+
lines.push(`**Jobs**: ${result.jobCount}`);
|
|
15
|
+
lines.push(`**Set ID**: ${result.setId}`);
|
|
16
|
+
if (result.skippedArchived.scenarios.length > 0) {
|
|
17
|
+
lines.push(`
|
|
18
|
+
\u26A0\uFE0F Skipped archived scenarios: ${result.skippedArchived.scenarios.join(", ")}`);
|
|
19
|
+
}
|
|
20
|
+
if (result.skippedArchived.targets.length > 0) {
|
|
21
|
+
lines.push(`\u26A0\uFE0F Skipped archived targets: ${result.skippedArchived.targets.join(", ")}`);
|
|
22
|
+
}
|
|
23
|
+
lines.push("\nView results in the LangWatch dashboard under Simulations.");
|
|
24
|
+
return lines.join("\n");
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
handleRunSuite
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=run-suite-BTMHGI2D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/run-suite.ts"],"sourcesContent":["import { runSuite as apiRunSuite } from \"../langwatch-api-suites.js\";\n\n/**\n * Handles the platform_run_suite MCP tool invocation.\n */\nexport async function handleRunSuite(params: {\n id: string;\n}): Promise<string> {\n const result = await apiRunSuite(params.id);\n\n const lines: string[] = [];\n lines.push(`Suite run scheduled successfully.`);\n lines.push(\"\");\n lines.push(`**Batch Run ID**: ${result.batchRunId}`);\n lines.push(`**Jobs**: ${result.jobCount}`);\n lines.push(`**Set ID**: ${result.setId}`);\n\n if (result.skippedArchived.scenarios.length > 0) {\n lines.push(`\\n⚠️ Skipped archived scenarios: ${result.skippedArchived.scenarios.join(\", \")}`);\n }\n if (result.skippedArchived.targets.length > 0) {\n lines.push(`⚠️ Skipped archived targets: ${result.skippedArchived.targets.join(\", \")}`);\n }\n\n lines.push(\"\\nView results in the LangWatch dashboard under Simulations.\");\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAKA,eAAsB,eAAe,QAEjB;AAClB,QAAM,SAAS,MAAM,SAAY,OAAO,EAAE;AAE1C,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,mCAAmC;AAC9C,QAAM,KAAK,EAAE;AACb,QAAM,KAAK,qBAAqB,OAAO,UAAU,EAAE;AACnD,QAAM,KAAK,aAAa,OAAO,QAAQ,EAAE;AACzC,QAAM,KAAK,eAAe,OAAO,KAAK,EAAE;AAExC,MAAI,OAAO,gBAAgB,UAAU,SAAS,GAAG;AAC/C,UAAM,KAAK;AAAA,2CAAoC,OAAO,gBAAgB,UAAU,KAAK,IAAI,CAAC,EAAE;AAAA,EAC9F;AACA,MAAI,OAAO,gBAAgB,QAAQ,SAAS,GAAG;AAC7C,UAAM,KAAK,0CAAgC,OAAO,gBAAgB,QAAQ,KAAK,IAAI,CAAC,EAAE;AAAA,EACxF;AAEA,QAAM,KAAK,8DAA8D;AAEzE,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runWorkflow
|
|
3
|
+
} from "./chunk-ZVS4UKN2.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/run-workflow.ts
|
|
8
|
+
async function handleRunWorkflow(params) {
|
|
9
|
+
let parsedInput = {};
|
|
10
|
+
if (params.input) {
|
|
11
|
+
try {
|
|
12
|
+
parsedInput = JSON.parse(params.input);
|
|
13
|
+
} catch {
|
|
14
|
+
return "Error: `input` must be a valid JSON object.";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const result = await runWorkflow(params.id, parsedInput);
|
|
18
|
+
const lines = [];
|
|
19
|
+
lines.push(`Workflow "${params.id}" executed successfully.
|
|
20
|
+
`);
|
|
21
|
+
if (typeof result === "object" && result !== null) {
|
|
22
|
+
const output = result.output;
|
|
23
|
+
if (output !== void 0) {
|
|
24
|
+
lines.push("**Output:**");
|
|
25
|
+
lines.push(typeof output === "string" ? output : JSON.stringify(output, null, 2));
|
|
26
|
+
} else {
|
|
27
|
+
lines.push("**Result:**");
|
|
28
|
+
lines.push(JSON.stringify(result, null, 2));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return lines.join("\n");
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
handleRunWorkflow
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=run-workflow-IGAYGKJL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/run-workflow.ts"],"sourcesContent":["import { runWorkflow as apiRunWorkflow } from \"../langwatch-api-workflows.js\";\n\n/**\n * Handles the platform_run_workflow MCP tool invocation.\n */\nexport async function handleRunWorkflow(params: {\n id: string;\n input?: string;\n}): Promise<string> {\n let parsedInput: Record<string, unknown> = {};\n if (params.input) {\n try {\n parsedInput = JSON.parse(params.input) as Record<string, unknown>;\n } catch {\n return \"Error: `input` must be a valid JSON object.\";\n }\n }\n\n const result = await apiRunWorkflow(params.id, parsedInput);\n\n const lines: string[] = [];\n lines.push(`Workflow \"${params.id}\" executed successfully.\\n`);\n\n if (typeof result === \"object\" && result !== null) {\n const output = (result as Record<string, unknown>).output;\n if (output !== undefined) {\n lines.push(\"**Output:**\");\n lines.push(typeof output === \"string\" ? output : JSON.stringify(output, null, 2));\n } else {\n lines.push(\"**Result:**\");\n lines.push(JSON.stringify(result, null, 2));\n }\n }\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAKA,eAAsB,kBAAkB,QAGpB;AAClB,MAAI,cAAuC,CAAC;AAC5C,MAAI,OAAO,OAAO;AAChB,QAAI;AACF,oBAAc,KAAK,MAAM,OAAO,KAAK;AAAA,IACvC,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AAEA,QAAM,SAAS,MAAM,YAAe,OAAO,IAAI,WAAW;AAE1D,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,aAAa,OAAO,EAAE;AAAA,CAA4B;AAE7D,MAAI,OAAO,WAAW,YAAY,WAAW,MAAM;AACjD,UAAM,SAAU,OAAmC;AACnD,QAAI,WAAW,QAAW;AACxB,YAAM,KAAK,aAAa;AACxB,YAAM,KAAK,OAAO,WAAW,WAAW,SAAS,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AAAA,IAClF,OAAO;AACL,YAAM,KAAK,aAAa;AACxB,YAAM,KAAK,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AAAA,IAC5C;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "./chunk-ZXKLPC2E.js";
|
|
4
4
|
import {
|
|
5
5
|
searchTraces
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-2WPLXEKF.js";
|
|
7
|
+
import "./chunk-BWWY5KEF.js";
|
|
8
8
|
|
|
9
9
|
// src/tools/search-traces.ts
|
|
10
10
|
async function handleSearchTraces(params) {
|
|
@@ -69,4 +69,4 @@ async function handleSearchTraces(params) {
|
|
|
69
69
|
export {
|
|
70
70
|
handleSearchTraces
|
|
71
71
|
};
|
|
72
|
-
//# sourceMappingURL=search-traces-
|
|
72
|
+
//# sourceMappingURL=search-traces-VYFUIMXH.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
setModelProvider
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CCWCIJJ3.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
6
|
|
|
7
7
|
// src/tools/set-model-provider.ts
|
|
8
8
|
async function handleSetModelProvider(params) {
|
|
@@ -30,4 +30,4 @@ async function handleSetModelProvider(params) {
|
|
|
30
30
|
export {
|
|
31
31
|
handleSetModelProvider
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=set-model-provider-
|
|
33
|
+
//# sourceMappingURL=set-model-provider-W5IUI326.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
updateAgent
|
|
3
|
+
} from "./chunk-4AUB2BIA.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/update-agent.ts
|
|
8
|
+
async function handleUpdateAgent(params) {
|
|
9
|
+
const { id, ...data } = params;
|
|
10
|
+
const agent = await updateAgent({ id, ...data });
|
|
11
|
+
return `Agent updated successfully!
|
|
12
|
+
|
|
13
|
+
**Name**: ${agent.name}
|
|
14
|
+
**ID**: ${agent.id}
|
|
15
|
+
**Type**: ${agent.type}`;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
handleUpdateAgent
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=update-agent-4BB7EYLR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/update-agent.ts"],"sourcesContent":["import { updateAgent as apiUpdateAgent } from \"../langwatch-api-agents.js\";\n\nexport async function handleUpdateAgent(params: {\n id: string;\n name?: string;\n type?: string;\n config?: Record<string, unknown>;\n}): Promise<string> {\n const { id, ...data } = params;\n const agent = await apiUpdateAgent({ id, ...data });\n\n return `Agent updated successfully!\\n\\n**Name**: ${agent.name}\\n**ID**: ${agent.id}\\n**Type**: ${agent.type}`;\n}\n"],"mappings":";;;;;;;AAEA,eAAsB,kBAAkB,QAKpB;AAClB,QAAM,EAAE,IAAI,GAAG,KAAK,IAAI;AACxB,QAAM,QAAQ,MAAM,YAAe,EAAE,IAAI,GAAG,KAAK,CAAC;AAElD,SAAO;AAAA;AAAA,YAA4C,MAAM,IAAI;AAAA,UAAa,MAAM,EAAE;AAAA,YAAe,MAAM,IAAI;AAC7G;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatDatasetMutationDetails
|
|
3
|
+
} from "./chunk-WVI5CJ6S.js";
|
|
4
|
+
import "./chunk-NUFPTHKU.js";
|
|
5
|
+
import {
|
|
6
|
+
updateDataset
|
|
7
|
+
} from "./chunk-WQG2DFHX.js";
|
|
8
|
+
import "./chunk-2WPLXEKF.js";
|
|
9
|
+
import "./chunk-BWWY5KEF.js";
|
|
10
|
+
|
|
11
|
+
// src/tools/update-dataset.ts
|
|
12
|
+
async function handleUpdateDataset(params) {
|
|
13
|
+
const result = await updateDataset(params);
|
|
14
|
+
const lines = [];
|
|
15
|
+
lines.push("Dataset updated successfully!\n");
|
|
16
|
+
lines.push(...formatDatasetMutationDetails(result));
|
|
17
|
+
return lines.join("\n");
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
handleUpdateDataset
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=update-dataset-CXBKZ4W3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/update-dataset.ts"],"sourcesContent":["import { updateDataset as apiUpdateDataset } from \"../langwatch-api-datasets.js\";\nimport type { DatasetColumnType } from \"../langwatch-api-datasets.js\";\nimport { formatDatasetMutationDetails } from \"./format-dataset-mutation.js\";\n\n/**\n * Handles the platform_update_dataset MCP tool invocation.\n *\n * Updates an existing dataset and returns a confirmation\n * with the updated details.\n */\nexport async function handleUpdateDataset(params: {\n slugOrId: string;\n name?: string;\n columnTypes?: DatasetColumnType[];\n}): Promise<string> {\n const result = await apiUpdateDataset(params);\n\n const lines: string[] = [];\n lines.push(\"Dataset updated successfully!\\n\");\n lines.push(...formatDatasetMutationDetails(result));\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;AAUA,eAAsB,oBAAoB,QAItB;AAClB,QAAM,SAAS,MAAM,cAAiB,MAAM;AAE5C,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,iCAAiC;AAC5C,QAAM,KAAK,GAAG,6BAA6B,MAAM,CAAC;AAElD,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
updateDatasetRecord
|
|
3
|
+
} from "./chunk-WQG2DFHX.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/update-dataset-record.ts
|
|
8
|
+
async function handleUpdateDatasetRecord(params) {
|
|
9
|
+
const result = await updateDatasetRecord(params);
|
|
10
|
+
const lines = [];
|
|
11
|
+
lines.push("Record updated successfully!\n");
|
|
12
|
+
lines.push(`**Record ID**: ${result.id}`);
|
|
13
|
+
lines.push(`**Entry**: ${JSON.stringify(result.entry)}`);
|
|
14
|
+
return lines.join("\n");
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
handleUpdateDatasetRecord
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=update-dataset-record-HOHAMHXG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/update-dataset-record.ts"],"sourcesContent":["import { updateDatasetRecord as apiUpdateDatasetRecord } from \"../langwatch-api-datasets.js\";\n\n/**\n * Handles the platform_update_dataset_record MCP tool invocation.\n *\n * Updates a single record in a dataset and returns confirmation.\n */\nexport async function handleUpdateDatasetRecord(params: {\n slugOrId: string;\n recordId: string;\n entry: Record<string, unknown>;\n}): Promise<string> {\n const result = await apiUpdateDatasetRecord(params);\n\n const lines: string[] = [];\n lines.push(\"Record updated successfully!\\n\");\n lines.push(`**Record ID**: ${result.id}`);\n lines.push(`**Entry**: ${JSON.stringify(result.entry)}`);\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAOA,eAAsB,0BAA0B,QAI5B;AAClB,QAAM,SAAS,MAAM,oBAAuB,MAAM;AAElD,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,gCAAgC;AAC3C,QAAM,KAAK,kBAAkB,OAAO,EAAE,EAAE;AACxC,QAAM,KAAK,cAAc,KAAK,UAAU,OAAO,KAAK,CAAC,EAAE;AAEvD,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getEvaluatorType,
|
|
3
3
|
updateEvaluator
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-HYMIWO3U.js";
|
|
5
|
+
import "./chunk-2WPLXEKF.js";
|
|
6
|
+
import "./chunk-BWWY5KEF.js";
|
|
7
7
|
|
|
8
8
|
// src/tools/update-evaluator.ts
|
|
9
9
|
async function handleUpdateEvaluator(params) {
|
|
@@ -21,4 +21,4 @@ async function handleUpdateEvaluator(params) {
|
|
|
21
21
|
export {
|
|
22
22
|
handleUpdateEvaluator
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=update-evaluator-
|
|
24
|
+
//# sourceMappingURL=update-evaluator-IVOR6FTR.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updatePrompt
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-2WPLXEKF.js";
|
|
4
|
+
import "./chunk-BWWY5KEF.js";
|
|
5
5
|
|
|
6
6
|
// src/tools/update-prompt.ts
|
|
7
7
|
async function handleUpdatePrompt(params) {
|
|
@@ -14,9 +14,11 @@ async function handleUpdatePrompt(params) {
|
|
|
14
14
|
if (result.latestVersionNumber != null)
|
|
15
15
|
lines.push(`**Version**: v${result.latestVersionNumber}`);
|
|
16
16
|
lines.push(`**Commit**: ${params.commitMessage}`);
|
|
17
|
+
if (params.tags && params.tags.length > 0)
|
|
18
|
+
lines.push(`**Tags**: ${params.tags.join(", ")}`);
|
|
17
19
|
return lines.join("\n");
|
|
18
20
|
}
|
|
19
21
|
export {
|
|
20
22
|
handleUpdatePrompt
|
|
21
23
|
};
|
|
22
|
-
//# sourceMappingURL=update-prompt-
|
|
24
|
+
//# sourceMappingURL=update-prompt-OWQAKE7K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/update-prompt.ts"],"sourcesContent":["import { updatePrompt as apiUpdatePrompt } from \"../langwatch-api.js\";\n\n/**\n * Handles the platform_update_prompt MCP tool invocation.\n *\n * Updates an existing prompt via the PUT endpoint.\n * Every update with a commitMessage creates a new version automatically.\n */\nexport async function handleUpdatePrompt(params: {\n idOrHandle: string;\n messages?: Array<{ role: string; content: string }>;\n model?: string;\n commitMessage: string;\n tags?: string[];\n}): Promise<string> {\n const { idOrHandle, ...data } = params;\n\n const result = await apiUpdatePrompt(idOrHandle, data);\n\n const lines: string[] = [];\n lines.push(\"Prompt updated successfully!\\n\");\n if (result.id) lines.push(`**ID**: ${result.id}`);\n if (result.handle) lines.push(`**Handle**: ${result.handle}`);\n if (result.latestVersionNumber != null)\n lines.push(`**Version**: v${result.latestVersionNumber}`);\n lines.push(`**Commit**: ${params.commitMessage}`);\n if (params.tags && params.tags.length > 0)\n lines.push(`**Tags**: ${params.tags.join(\", \")}`);\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;AAQA,eAAsB,mBAAmB,QAMrB;AAClB,QAAM,EAAE,YAAY,GAAG,KAAK,IAAI;AAEhC,QAAM,SAAS,MAAM,aAAgB,YAAY,IAAI;AAErD,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,gCAAgC;AAC3C,MAAI,OAAO,GAAI,OAAM,KAAK,WAAW,OAAO,EAAE,EAAE;AAChD,MAAI,OAAO,OAAQ,OAAM,KAAK,eAAe,OAAO,MAAM,EAAE;AAC5D,MAAI,OAAO,uBAAuB;AAChC,UAAM,KAAK,iBAAiB,OAAO,mBAAmB,EAAE;AAC1D,QAAM,KAAK,eAAe,OAAO,aAAa,EAAE;AAChD,MAAI,OAAO,QAAQ,OAAO,KAAK,SAAS;AACtC,UAAM,KAAK,aAAa,OAAO,KAAK,KAAK,IAAI,CAAC,EAAE;AAElD,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateScenario
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-2GT7IFWK.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
6
|
|
|
7
7
|
// src/tools/update-scenario.ts
|
|
8
8
|
async function handleUpdateScenario(params) {
|
|
@@ -24,4 +24,4 @@ async function handleUpdateScenario(params) {
|
|
|
24
24
|
export {
|
|
25
25
|
handleUpdateScenario
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=update-scenario-
|
|
27
|
+
//# sourceMappingURL=update-scenario-GDFVILPN.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
updateSuite
|
|
3
|
+
} from "./chunk-LUMEZEHL.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/update-suite.ts
|
|
8
|
+
async function handleUpdateSuite(params) {
|
|
9
|
+
let parsedTargets;
|
|
10
|
+
if (params.targets) {
|
|
11
|
+
try {
|
|
12
|
+
parsedTargets = JSON.parse(params.targets);
|
|
13
|
+
} catch {
|
|
14
|
+
return "Error: `targets` must be a valid JSON array.";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const suite = await updateSuite({
|
|
18
|
+
id: params.id,
|
|
19
|
+
name: params.name,
|
|
20
|
+
description: params.description,
|
|
21
|
+
scenarioIds: params.scenarioIds,
|
|
22
|
+
targets: parsedTargets,
|
|
23
|
+
repeatCount: params.repeatCount,
|
|
24
|
+
labels: params.labels
|
|
25
|
+
});
|
|
26
|
+
return [
|
|
27
|
+
`Suite "${suite.name}" updated successfully.`,
|
|
28
|
+
"",
|
|
29
|
+
`**ID**: ${suite.id}`,
|
|
30
|
+
`**Slug**: ${suite.slug}`,
|
|
31
|
+
`**Scenarios**: ${suite.scenarioIds.length}`,
|
|
32
|
+
`**Targets**: ${suite.targets.length}`,
|
|
33
|
+
`**Repeat**: ${suite.repeatCount}x`
|
|
34
|
+
].join("\n");
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
handleUpdateSuite
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=update-suite-BXYUYSPT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/update-suite.ts"],"sourcesContent":["import { updateSuite as apiUpdateSuite } from \"../langwatch-api-suites.js\";\nimport type { SuiteTarget } from \"../langwatch-api-suites.js\";\n\n/**\n * Handles the platform_update_suite MCP tool invocation.\n */\nexport async function handleUpdateSuite(params: {\n id: string;\n name?: string;\n description?: string;\n scenarioIds?: string[];\n targets?: string;\n repeatCount?: number;\n labels?: string[];\n}): Promise<string> {\n let parsedTargets: SuiteTarget[] | undefined;\n if (params.targets) {\n try {\n parsedTargets = JSON.parse(params.targets) as SuiteTarget[];\n } catch {\n return \"Error: `targets` must be a valid JSON array.\";\n }\n }\n\n const suite = await apiUpdateSuite({\n id: params.id,\n name: params.name,\n description: params.description,\n scenarioIds: params.scenarioIds,\n targets: parsedTargets,\n repeatCount: params.repeatCount,\n labels: params.labels,\n });\n\n return [\n `Suite \"${suite.name}\" updated successfully.`,\n \"\",\n `**ID**: ${suite.id}`,\n `**Slug**: ${suite.slug}`,\n `**Scenarios**: ${suite.scenarioIds.length}`,\n `**Targets**: ${suite.targets.length}`,\n `**Repeat**: ${suite.repeatCount}x`,\n ].join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAMA,eAAsB,kBAAkB,QAQpB;AAClB,MAAI;AACJ,MAAI,OAAO,SAAS;AAClB,QAAI;AACF,sBAAgB,KAAK,MAAM,OAAO,OAAO;AAAA,IAC3C,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AAEA,QAAM,QAAQ,MAAM,YAAe;AAAA,IACjC,IAAI,OAAO;AAAA,IACX,MAAM,OAAO;AAAA,IACb,aAAa,OAAO;AAAA,IACpB,aAAa,OAAO;AAAA,IACpB,SAAS;AAAA,IACT,aAAa,OAAO;AAAA,IACpB,QAAQ,OAAO;AAAA,EACjB,CAAC;AAED,SAAO;AAAA,IACL,UAAU,MAAM,IAAI;AAAA,IACpB;AAAA,IACA,WAAW,MAAM,EAAE;AAAA,IACnB,aAAa,MAAM,IAAI;AAAA,IACvB,kBAAkB,MAAM,YAAY,MAAM;AAAA,IAC1C,gBAAgB,MAAM,QAAQ,MAAM;AAAA,IACpC,eAAe,MAAM,WAAW;AAAA,EAClC,EAAE,KAAK,IAAI;AACb;","names":[]}
|