@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.
- package/CHANGELOG.md +89 -0
- package/README.md +31 -3
- package/dist/{archive-project-4EQGLBJJ.js → archive-project-W3IKI7UL.js} +3 -3
- package/dist/archive-run-plan-474OKHHU.js +16 -0
- package/dist/{archive-scenario-W6BXYDZ3.js → archive-scenario-V5UNYK26.js} +3 -3
- package/dist/archive-test-suite-O7FLDMXK.js +16 -0
- package/dist/{assign-prompt-tag-VLXUWEKU.js → assign-prompt-tag-Q46WRB6P.js} +2 -2
- package/dist/chunk-56OGTS24.js +44 -0
- package/dist/chunk-6DJDEXET.js +63 -0
- package/dist/chunk-7E4FZIYJ.js +15 -0
- package/dist/{chunk-77BNWQ3U.js → chunk-AN4OUA4D.js} +2 -2
- package/dist/chunk-CKNAH5TG.js +74 -0
- package/dist/{chunk-TOXJQDIZ.js → chunk-EYXMLE5X.js} +85 -10
- package/dist/{chunk-7RHG56OH.js → chunk-G4ZAZTZW.js} +2 -2
- package/dist/{chunk-A2LEVYQ5.js → chunk-GELJ2MQR.js} +11 -2
- package/dist/chunk-HV4DWKBI.js +46 -0
- package/dist/chunk-JR6DJZOU.js +49 -0
- package/dist/{chunk-SFB4MU6H.js → chunk-JTQJRNFJ.js} +2 -2
- package/dist/{chunk-TJCXFNDT.js → chunk-K37ZNPXK.js} +2 -2
- package/dist/{chunk-CDYQOY5U.js → chunk-OJLYYJWI.js} +2 -2
- package/dist/{chunk-ZWIL4EFL.js → chunk-QAMP3CGR.js} +2 -2
- package/dist/{chunk-4QC7SA2L.js → chunk-QRO35SOM.js} +345 -144
- package/dist/{chunk-J42FWRJ2.js → chunk-RVAE2MEA.js} +2 -2
- package/dist/{chunk-AQJO2EI5.js → chunk-S4GVX36W.js} +2 -2
- package/dist/{chunk-YX3A3CFM.js → chunk-SR6QPRIE.js} +2 -2
- package/dist/chunk-UF6XIGYR.js +58 -0
- package/dist/{chunk-5CCZFUXS.js → chunk-UFOYFYI7.js} +2 -2
- package/dist/{create-agent-7XHO6UIS.js → create-agent-JFJ2K6X3.js} +3 -3
- package/dist/{create-annotation-YQXRQC6A.js → create-annotation-EUXXQ6NS.js} +3 -3
- package/dist/{create-api-key-YUS36KBU.js → create-api-key-BGBB76JX.js} +3 -3
- package/dist/{create-dashboard-4Z5JO5LB.js → create-dashboard-Z76AIPLS.js} +3 -3
- package/dist/{create-dataset-E6NMSVX7.js → create-dataset-FD5VAXU4.js} +3 -3
- package/dist/{create-dataset-records-SKHPRD2K.js → create-dataset-records-WQUXXOHI.js} +3 -3
- package/dist/{create-evaluator-JXF5PF33.js → create-evaluator-6NV33Z52.js} +3 -3
- package/dist/create-mcp-server.js +7 -2
- package/dist/{create-project-CS2CB57Y.js → create-project-ZQ7TFIO2.js} +3 -3
- package/dist/{create-prompt-F5RMX3L3.js → create-prompt-BS6QRCUU.js} +2 -2
- package/dist/{create-prompt-tag-GMRWTEFR.js → create-prompt-tag-FCQ5ELSQ.js} +2 -2
- package/dist/{create-scenario-JDR2VB2H.js → create-scenario-DRPTPXU3.js} +10 -3
- package/dist/create-test-suite-ZIZCCFJ4.js +37 -0
- package/dist/{delete-agent-O3EEH4S5.js → delete-agent-SA4JMUZF.js} +3 -3
- package/dist/{delete-annotation-XP6FQM7A.js → delete-annotation-X3KKK7QY.js} +3 -3
- package/dist/{delete-dashboard-RFUNYCNP.js → delete-dashboard-LYMRPF27.js} +3 -3
- package/dist/{delete-dataset-3MJFRDLP.js → delete-dataset-W6EZ44HY.js} +3 -3
- package/dist/{delete-dataset-records-WPMU5GL5.js → delete-dataset-records-7CNOTALB.js} +3 -3
- package/dist/{delete-evaluator-33SP2JFX.js → delete-evaluator-RKYC4TNB.js} +3 -3
- package/dist/{delete-prompt-tag-KNMZVSPB.js → delete-prompt-tag-QB3OCZUV.js} +2 -2
- package/dist/{delete-workflow-3NUXO46U.js → delete-workflow-NG2VXYYM.js} +3 -3
- package/dist/{discover-evaluator-schema-XTAD4X7D.js → discover-evaluator-schema-ESSHQGPY.js} +7 -286
- package/dist/{discover-scenario-schema-FE64QK2D.js → discover-scenario-schema-W7KBXA4J.js} +53 -1
- package/dist/get-agent-7THF7HCU.js +66 -0
- package/dist/{get-analytics-TETCSOK6.js → get-analytics-R6AZD3AW.js} +2 -2
- package/dist/{get-dashboard-KHBEGZGL.js → get-dashboard-P4WWVHFU.js} +3 -3
- package/dist/{get-dataset-RCMU5VAH.js → get-dataset-AKTYSQDI.js} +3 -3
- package/dist/{get-evaluator-ADMKVWYZ.js → get-evaluator-RZ44UIN6.js} +3 -3
- package/dist/{get-project-RAK7URQJ.js → get-project-QSQEAB33.js} +3 -3
- package/dist/get-prompt-GVKXF5NL.js +100 -0
- package/dist/get-run-plan-NY7J5GRE.js +61 -0
- package/dist/{get-scenario-ZTAJJL5T.js → get-scenario-Q3LLQE4T.js} +7 -3
- package/dist/{get-simulation-run-T2ZQWYH2.js → get-simulation-run-WINEYDMK.js} +12 -3
- package/dist/get-test-suite-4HKA7OKS.js +49 -0
- package/dist/{get-trace-K7U234Q4.js → get-trace-RCUV7N4O.js} +2 -2
- package/dist/{get-workflow-L5L2PSK3.js → get-workflow-EEOC7Y45.js} +3 -3
- package/dist/{http-server-YXHFPPGA.js → http-server-WCDUARTH.js} +8 -3
- package/dist/index.js +3366 -1910
- package/dist/{langwatch-api-annotations-FDAS6NQ7.js → langwatch-api-annotations-6DHVZWUK.js} +3 -3
- package/dist/{langwatch-api-dashboards-JTVCS7ZJ.js → langwatch-api-dashboards-2KJL2M42.js} +3 -3
- package/dist/{langwatch-api-monitors-3J7UIQME.js → langwatch-api-monitors-6ISFJ7WX.js} +2 -2
- package/dist/{langwatch-api-secrets-BUBSNCNO.js → langwatch-api-secrets-OEBD6GBU.js} +2 -2
- package/dist/{langwatch-api-triggers-EDFUCJN6.js → langwatch-api-triggers-5E6DDGX6.js} +2 -2
- package/dist/{langwatch-api-workflows-NBJX5KOG.js → langwatch-api-workflows-6UJL5U4Z.js} +3 -3
- package/dist/list-agents-AMVDQPQL.js +43 -0
- package/dist/{list-annotations-ZTVP4EEL.js → list-annotations-6PR5NLIC.js} +3 -3
- package/dist/{list-api-keys-CWD4UQT5.js → list-api-keys-GVPNBIHQ.js} +3 -3
- package/dist/{list-dashboards-PWG6P6KR.js → list-dashboards-Z3BZKDGF.js} +3 -3
- package/dist/{list-dataset-records-IOE7LQXS.js → list-dataset-records-O67HZ35Y.js} +3 -3
- package/dist/{list-datasets-ZT4JYUDT.js → list-datasets-WXZL6UMP.js} +3 -3
- package/dist/{list-evaluators-SJHC7VBH.js → list-evaluators-PAX72WCN.js} +3 -3
- package/dist/{list-model-providers-PPD2WPD2.js → list-model-providers-VVLZMLCX.js} +3 -3
- package/dist/{list-projects-K7QAIX2I.js → list-projects-AQVI6SUK.js} +3 -3
- package/dist/{list-prompt-tags-FOO6TNHB.js → list-prompt-tags-WZFBJOHG.js} +2 -2
- package/dist/{list-prompts-SC2HAUFG.js → list-prompts-BQOHRHYT.js} +2 -2
- package/dist/list-run-plans-UBAU2DGH.js +46 -0
- package/dist/{list-scenarios-F2WYNRIE.js → list-scenarios-MS4IUIVM.js} +8 -5
- package/dist/{list-simulation-runs-KF5THG5H.js → list-simulation-runs-D6YF4ZOU.js} +11 -5
- package/dist/list-test-suites-L7R2O6DR.js +35 -0
- package/dist/{list-workflows-QSJWURCK.js → list-workflows-6MV4XJHF.js} +3 -3
- package/dist/{rename-prompt-tag-EKWU5QF3.js → rename-prompt-tag-K5LQ4CY6.js} +2 -2
- package/dist/rename-test-suite-NTYHAO5X.js +21 -0
- package/dist/report-issue-RHZZ33IS.js +885 -0
- package/dist/rerun-run-plan-MUDWJBE4.js +22 -0
- package/dist/{revoke-api-key-FTRTZMOF.js → revoke-api-key-6LAZ3QZZ.js} +3 -3
- package/dist/run-agent-CAGWGTYT.js +72 -0
- package/dist/run-plan-T4ZYOZGA.js +39 -0
- package/dist/run-test-suite-L4MZ7G4D.js +26 -0
- package/dist/{run-workflow-QPXC627O.js → run-workflow-DFIS23AP.js} +3 -3
- package/dist/{search-traces-A6HFKPLJ.js → search-traces-4XTJYXIK.js} +2 -2
- package/dist/{set-model-provider-3WKT63ZN.js → set-model-provider-XRNMFOVR.js} +3 -3
- package/dist/{update-agent-SMAEHLXH.js → update-agent-DUWNYBNA.js} +3 -3
- package/dist/{update-dataset-BDUK7TUO.js → update-dataset-YSOMDCOB.js} +3 -3
- package/dist/{update-dataset-record-4ZSDRBSW.js → update-dataset-record-DEA2ITYR.js} +3 -3
- package/dist/{update-evaluator-LS6TIBY7.js → update-evaluator-NH7Q5GWV.js} +3 -3
- package/dist/{update-project-LKVYXENH.js → update-project-Q26FBSYH.js} +3 -3
- package/dist/update-prompt-ZQQ2C3KU.js +143 -0
- package/dist/{update-scenario-NEXCAQI7.js → update-scenario-WUX34JAR.js} +10 -3
- package/package.json +8 -9
- package/pyproject.toml +4 -4
- package/src/__tests__/agent-tools.unit.test.ts +257 -0
- package/src/__tests__/all-tools.integration.test.ts +321 -75
- package/src/__tests__/integration.integration.test.ts +7 -11
- package/src/__tests__/prompt-response-types.unit.test.ts +51 -0
- package/src/__tests__/prompts.integration.test.ts +736 -0
- package/src/__tests__/run-plan-tools.unit.test.ts +565 -0
- package/src/__tests__/scenario-tools.unit.test.ts +19 -0
- package/src/__tests__/simulation-run-tools.unit.test.ts +116 -0
- package/src/__tests__/test-suite-tools.unit.test.ts +615 -0
- package/src/__tests__/{tools.unit.test.ts → tools.integration.test.ts} +31 -59
- package/src/create-mcp-server.ts +334 -55
- package/src/langwatch-api-agents.ts +196 -12
- package/src/langwatch-api-run-plans.ts +157 -0
- package/src/langwatch-api-scenarios.ts +9 -0
- package/src/langwatch-api-simulation-runs.ts +5 -0
- package/src/langwatch-api-test-suites.ts +135 -0
- package/src/langwatch-api.ts +62 -12
- package/src/schemas/index.ts +5 -0
- package/src/schemas/run-plan.ts +92 -0
- package/src/schemas/suite-fields.ts +149 -0
- package/src/tools/archive-run-plan.ts +12 -0
- package/src/tools/archive-test-suite.ts +12 -0
- package/src/tools/create-scenario.ts +8 -0
- package/src/tools/create-test-suite.ts +43 -0
- package/src/tools/discover-scenario-schema.ts +54 -0
- package/src/tools/format-run-plan.ts +68 -0
- package/src/tools/format-scenario.ts +14 -0
- package/src/tools/format-suite-details.ts +96 -0
- package/src/tools/get-agent.ts +45 -3
- package/src/tools/get-prompt.ts +108 -24
- package/src/tools/get-run-plan.ts +62 -0
- package/src/tools/get-scenario.ts +3 -0
- package/src/tools/get-simulation-run.ts +9 -0
- package/src/tools/get-test-suite.ts +49 -0
- package/src/tools/list-agents.ts +20 -3
- package/src/tools/list-run-plans.ts +47 -0
- package/src/tools/list-scenarios.ts +12 -2
- package/src/tools/list-simulation-runs.ts +6 -2
- package/src/tools/list-test-suites.ts +35 -0
- package/src/tools/rename-test-suite.ts +18 -0
- package/src/tools/rerun-run-plan.ts +21 -0
- package/src/tools/run-agent.ts +54 -6
- package/src/tools/run-plan.ts +49 -0
- package/src/tools/run-test-suite.ts +30 -0
- package/src/tools/test-agent.ts +18 -0
- package/src/tools/update-prompt.ts +195 -10
- package/src/tools/update-scenario.ts +8 -0
- package/src/tools/update-test-suite.ts +45 -0
- package/tsconfig.json +5 -0
- package/uv.lock +416 -296
- package/dist/archive-suite-4T6BSRS7.js +0 -16
- package/dist/chunk-YZLYHLLI.js +0 -48
- package/dist/create-suite-LZS6QIAF.js +0 -39
- package/dist/get-agent-Y7MWZ65F.js +0 -29
- package/dist/get-prompt-OY5B7TRI.js +0 -46
- package/dist/get-suite-J7JVWO6O.js +0 -45
- package/dist/list-agents-KFHKGPXV.js +0 -33
- package/dist/list-suites-CRY4VWW6.js +0 -43
- package/dist/report-issue-XYVAPAYJ.js +0 -412
- package/dist/run-agent-6SM4XNA7.js +0 -37
- package/dist/run-suite-NKZCJ2IN.js +0 -30
- package/dist/update-prompt-ODCRQRN6.js +0 -25
- package/dist/update-suite-SNO3GS7T.js +0 -40
- package/src/langwatch-api-suites.ts +0 -118
- package/src/tools/archive-suite.ts +0 -12
- package/src/tools/create-suite.ts +0 -42
- package/src/tools/get-suite.ts +0 -47
- package/src/tools/list-suites.ts +0 -43
- package/src/tools/run-suite.ts +0 -28
- package/src/tools/update-suite.ts +0 -44
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatRunPlanRun
|
|
3
|
+
} from "./chunk-JR6DJZOU.js";
|
|
4
|
+
import {
|
|
5
|
+
rerunRunPlan
|
|
6
|
+
} from "./chunk-56OGTS24.js";
|
|
7
|
+
import "./chunk-GELJ2MQR.js";
|
|
8
|
+
import "./chunk-WT4PO4A3.js";
|
|
9
|
+
import "./chunk-SAS5OB7F.js";
|
|
10
|
+
|
|
11
|
+
// src/tools/rerun-run-plan.ts
|
|
12
|
+
async function handleRerunRunPlan(params) {
|
|
13
|
+
const result = await rerunRunPlan(params.id, {
|
|
14
|
+
parameters: params.parameters,
|
|
15
|
+
note: params.note
|
|
16
|
+
});
|
|
17
|
+
return formatRunPlanRun(result);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
handleRerunRunPlan
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=rerun-run-plan-MUDWJBE4.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
revokeApiKey
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-K37ZNPXK.js";
|
|
4
|
+
import "./chunk-GELJ2MQR.js";
|
|
5
5
|
import "./chunk-WT4PO4A3.js";
|
|
6
6
|
import "./chunk-SAS5OB7F.js";
|
|
7
7
|
|
|
@@ -13,4 +13,4 @@ async function handleRevokeApiKey(params) {
|
|
|
13
13
|
export {
|
|
14
14
|
handleRevokeApiKey
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=revoke-api-key-
|
|
16
|
+
//# sourceMappingURL=revoke-api-key-6LAZ3QZZ.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runAgent
|
|
3
|
+
} from "./chunk-EYXMLE5X.js";
|
|
4
|
+
import "./chunk-GELJ2MQR.js";
|
|
5
|
+
import "./chunk-WT4PO4A3.js";
|
|
6
|
+
import "./chunk-SAS5OB7F.js";
|
|
7
|
+
|
|
8
|
+
// src/tools/run-agent.ts
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
var jsonObjectSchema = z.looseObject({});
|
|
11
|
+
async function handleRunAgent({
|
|
12
|
+
id,
|
|
13
|
+
input,
|
|
14
|
+
message,
|
|
15
|
+
parameters,
|
|
16
|
+
threadId
|
|
17
|
+
}) {
|
|
18
|
+
let parsedInput = {};
|
|
19
|
+
if (input) {
|
|
20
|
+
let decoded;
|
|
21
|
+
try {
|
|
22
|
+
decoded = JSON.parse(input);
|
|
23
|
+
} catch {
|
|
24
|
+
return "Error: `input` must be a valid JSON object.";
|
|
25
|
+
}
|
|
26
|
+
const result2 = jsonObjectSchema.safeParse(decoded);
|
|
27
|
+
if (!result2.success) {
|
|
28
|
+
return "Error: `input` must be a valid JSON object.";
|
|
29
|
+
}
|
|
30
|
+
parsedInput = result2.data;
|
|
31
|
+
}
|
|
32
|
+
const { agentType, result } = await runAgent({
|
|
33
|
+
id,
|
|
34
|
+
input: parsedInput,
|
|
35
|
+
message,
|
|
36
|
+
parameters,
|
|
37
|
+
threadId
|
|
38
|
+
});
|
|
39
|
+
const lines = [];
|
|
40
|
+
lines.push(`Agent executed successfully (type: ${agentType}).
|
|
41
|
+
`);
|
|
42
|
+
if (typeof result === "object" && result !== null) {
|
|
43
|
+
const output = result.output;
|
|
44
|
+
if (output !== void 0) {
|
|
45
|
+
lines.push("**Output:**");
|
|
46
|
+
lines.push(typeof output === "string" ? output : JSON.stringify(output, null, 2));
|
|
47
|
+
} else {
|
|
48
|
+
lines.push("**Result:**");
|
|
49
|
+
lines.push(JSON.stringify(result, null, 2));
|
|
50
|
+
}
|
|
51
|
+
if (agentType === "connected") {
|
|
52
|
+
const instance = result.instance;
|
|
53
|
+
const durationMs = result.durationMs;
|
|
54
|
+
if (instance?.hostname) {
|
|
55
|
+
const label = instance.label ? ` (${instance.label})` : "";
|
|
56
|
+
lines.push(`
|
|
57
|
+
**Instance:** ${instance.hostname}${label}`);
|
|
58
|
+
}
|
|
59
|
+
if (typeof durationMs === "number") lines.push(`**Duration:** ${durationMs} ms`);
|
|
60
|
+
const session = result.session;
|
|
61
|
+
if (session !== void 0 && session !== null) {
|
|
62
|
+
lines.push("**Session:**");
|
|
63
|
+
lines.push(JSON.stringify(session, null, 2));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return lines.join("\n");
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
handleRunAgent
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=run-agent-CAGWGTYT.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatRunPlanRun
|
|
3
|
+
} from "./chunk-JR6DJZOU.js";
|
|
4
|
+
import {
|
|
5
|
+
runRunPlan
|
|
6
|
+
} from "./chunk-56OGTS24.js";
|
|
7
|
+
import {
|
|
8
|
+
toWireTargets
|
|
9
|
+
} from "./chunk-HV4DWKBI.js";
|
|
10
|
+
import {
|
|
11
|
+
toWireAttachments
|
|
12
|
+
} from "./chunk-CKNAH5TG.js";
|
|
13
|
+
import "./chunk-GELJ2MQR.js";
|
|
14
|
+
import "./chunk-WT4PO4A3.js";
|
|
15
|
+
import "./chunk-SAS5OB7F.js";
|
|
16
|
+
|
|
17
|
+
// src/tools/run-plan.ts
|
|
18
|
+
async function handleRunPlan(params) {
|
|
19
|
+
const result = await runRunPlan({
|
|
20
|
+
name: params.name,
|
|
21
|
+
config: {
|
|
22
|
+
scope: params.scope,
|
|
23
|
+
targets: toWireTargets(params.targets),
|
|
24
|
+
repeatCount: params.repeatCount,
|
|
25
|
+
simulatorModel: params.simulatorModel,
|
|
26
|
+
judgeModel: params.judgeModel,
|
|
27
|
+
scenarioIds: params.scenarioIds,
|
|
28
|
+
...params.evaluators !== void 0 ? { evaluators: toWireAttachments(params.evaluators) } : {}
|
|
29
|
+
},
|
|
30
|
+
idempotencyKey: params.idempotencyKey,
|
|
31
|
+
parameters: params.parameters,
|
|
32
|
+
note: params.note
|
|
33
|
+
});
|
|
34
|
+
return formatRunPlanRun(result);
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
handleRunPlan
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=run-plan-T4ZYOZGA.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatRunPlanRun
|
|
3
|
+
} from "./chunk-JR6DJZOU.js";
|
|
4
|
+
import {
|
|
5
|
+
toWireTargets
|
|
6
|
+
} from "./chunk-HV4DWKBI.js";
|
|
7
|
+
import {
|
|
8
|
+
runTestSuite
|
|
9
|
+
} from "./chunk-6DJDEXET.js";
|
|
10
|
+
import "./chunk-GELJ2MQR.js";
|
|
11
|
+
import "./chunk-WT4PO4A3.js";
|
|
12
|
+
import "./chunk-SAS5OB7F.js";
|
|
13
|
+
|
|
14
|
+
// src/tools/run-test-suite.ts
|
|
15
|
+
async function handleRunTestSuite(params) {
|
|
16
|
+
const { targets, ...rest } = params;
|
|
17
|
+
const result = await runTestSuite({
|
|
18
|
+
...rest,
|
|
19
|
+
targets: toWireTargets(targets)
|
|
20
|
+
});
|
|
21
|
+
return formatRunPlanRun(result);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
handleRunTestSuite
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=run-test-suite-L4MZ7G4D.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runWorkflow
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-UFOYFYI7.js";
|
|
4
|
+
import "./chunk-GELJ2MQR.js";
|
|
5
5
|
import "./chunk-WT4PO4A3.js";
|
|
6
6
|
import "./chunk-SAS5OB7F.js";
|
|
7
7
|
|
|
@@ -34,4 +34,4 @@ async function handleRunWorkflow(params) {
|
|
|
34
34
|
export {
|
|
35
35
|
handleRunWorkflow
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=run-workflow-
|
|
37
|
+
//# sourceMappingURL=run-workflow-DFIS23AP.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-ZXKLPC2E.js";
|
|
7
7
|
import {
|
|
8
8
|
searchTraces
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GELJ2MQR.js";
|
|
10
10
|
import "./chunk-WT4PO4A3.js";
|
|
11
11
|
import "./chunk-SAS5OB7F.js";
|
|
12
12
|
|
|
@@ -76,4 +76,4 @@ async function handleSearchTraces(params) {
|
|
|
76
76
|
export {
|
|
77
77
|
handleSearchTraces
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=search-traces-
|
|
79
|
+
//# sourceMappingURL=search-traces-4XTJYXIK.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
setModelProvider
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JTQJRNFJ.js";
|
|
4
|
+
import "./chunk-GELJ2MQR.js";
|
|
5
5
|
import "./chunk-WT4PO4A3.js";
|
|
6
6
|
import "./chunk-SAS5OB7F.js";
|
|
7
7
|
|
|
@@ -31,4 +31,4 @@ async function handleSetModelProvider(params) {
|
|
|
31
31
|
export {
|
|
32
32
|
handleSetModelProvider
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=set-model-provider-
|
|
34
|
+
//# sourceMappingURL=set-model-provider-XRNMFOVR.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateAgent
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-EYXMLE5X.js";
|
|
4
|
+
import "./chunk-GELJ2MQR.js";
|
|
5
5
|
import "./chunk-WT4PO4A3.js";
|
|
6
6
|
import "./chunk-SAS5OB7F.js";
|
|
7
7
|
|
|
@@ -18,4 +18,4 @@ async function handleUpdateAgent(params) {
|
|
|
18
18
|
export {
|
|
19
19
|
handleUpdateAgent
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=update-agent-
|
|
21
|
+
//# sourceMappingURL=update-agent-DUWNYBNA.js.map
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
import "./chunk-NUFPTHKU.js";
|
|
5
5
|
import {
|
|
6
6
|
updateDataset
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-AN4OUA4D.js";
|
|
8
|
+
import "./chunk-GELJ2MQR.js";
|
|
9
9
|
import "./chunk-WT4PO4A3.js";
|
|
10
10
|
import "./chunk-SAS5OB7F.js";
|
|
11
11
|
|
|
@@ -20,4 +20,4 @@ async function handleUpdateDataset(params) {
|
|
|
20
20
|
export {
|
|
21
21
|
handleUpdateDataset
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=update-dataset-
|
|
23
|
+
//# sourceMappingURL=update-dataset-YSOMDCOB.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateDatasetRecord
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-AN4OUA4D.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 handleUpdateDatasetRecord(params) {
|
|
|
17
17
|
export {
|
|
18
18
|
handleUpdateDatasetRecord
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=update-dataset-record-
|
|
20
|
+
//# sourceMappingURL=update-dataset-record-DEA2ITYR.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getEvaluatorType,
|
|
3
3
|
updateEvaluator
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-OJLYYJWI.js";
|
|
5
|
+
import "./chunk-GELJ2MQR.js";
|
|
6
6
|
import "./chunk-WT4PO4A3.js";
|
|
7
7
|
import "./chunk-SAS5OB7F.js";
|
|
8
8
|
|
|
@@ -22,4 +22,4 @@ async function handleUpdateEvaluator(params) {
|
|
|
22
22
|
export {
|
|
23
23
|
handleUpdateEvaluator
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=update-evaluator-
|
|
25
|
+
//# sourceMappingURL=update-evaluator-NH7Q5GWV.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateProject
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-G4ZAZTZW.js";
|
|
4
|
+
import "./chunk-GELJ2MQR.js";
|
|
5
5
|
import "./chunk-WT4PO4A3.js";
|
|
6
6
|
import "./chunk-SAS5OB7F.js";
|
|
7
7
|
|
|
@@ -22,4 +22,4 @@ async function handleUpdateProject(params) {
|
|
|
22
22
|
export {
|
|
23
23
|
handleUpdateProject
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=update-project-
|
|
25
|
+
//# sourceMappingURL=update-project-Q26FBSYH.js.map
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getPrompt,
|
|
3
|
+
getPromptVersions,
|
|
4
|
+
updatePrompt
|
|
5
|
+
} from "./chunk-GELJ2MQR.js";
|
|
6
|
+
import "./chunk-WT4PO4A3.js";
|
|
7
|
+
import "./chunk-SAS5OB7F.js";
|
|
8
|
+
|
|
9
|
+
// src/tools/update-prompt.ts
|
|
10
|
+
async function handleUpdatePrompt(params) {
|
|
11
|
+
const { idOrHandle, ...data } = params;
|
|
12
|
+
let updated;
|
|
13
|
+
try {
|
|
14
|
+
updated = await updatePrompt(idOrHandle, data);
|
|
15
|
+
} catch (err) {
|
|
16
|
+
if (params.tags && params.tags.length > 0) {
|
|
17
|
+
return renderTagFailure({ idOrHandle, params });
|
|
18
|
+
}
|
|
19
|
+
throw err;
|
|
20
|
+
}
|
|
21
|
+
return renderUpdateSuccess({ idOrHandle, params, updated });
|
|
22
|
+
}
|
|
23
|
+
async function identifyNewVersion({
|
|
24
|
+
idOrHandle,
|
|
25
|
+
prompt,
|
|
26
|
+
commitMessage
|
|
27
|
+
}) {
|
|
28
|
+
if (prompt.commitMessage === commitMessage) {
|
|
29
|
+
return { version: prompt.version, versionId: prompt.versionId };
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const versions = await getPromptVersions(idOrHandle);
|
|
33
|
+
const match = (Array.isArray(versions) ? versions : []).find(
|
|
34
|
+
(v) => v.commitMessage === commitMessage
|
|
35
|
+
);
|
|
36
|
+
if (match) return { version: match.version, versionId: match.versionId };
|
|
37
|
+
} catch {
|
|
38
|
+
}
|
|
39
|
+
return void 0;
|
|
40
|
+
}
|
|
41
|
+
function deploymentTagsOf(prompt) {
|
|
42
|
+
return (prompt.tags ?? []).filter((tag) => tag?.name !== "latest");
|
|
43
|
+
}
|
|
44
|
+
async function renderUpdateSuccess({
|
|
45
|
+
idOrHandle,
|
|
46
|
+
params,
|
|
47
|
+
updated
|
|
48
|
+
}) {
|
|
49
|
+
let prompt;
|
|
50
|
+
try {
|
|
51
|
+
prompt = await getPrompt(idOrHandle, {
|
|
52
|
+
version: void 0,
|
|
53
|
+
tag: void 0
|
|
54
|
+
});
|
|
55
|
+
} catch {
|
|
56
|
+
const lines2 = [];
|
|
57
|
+
lines2.push("Prompt updated successfully!\n");
|
|
58
|
+
if (updated?.id) lines2.push(`**ID**: ${updated.id}`);
|
|
59
|
+
if (updated?.handle) lines2.push(`**Handle**: ${updated.handle}`);
|
|
60
|
+
lines2.push(`**Commit**: ${params.commitMessage}`);
|
|
61
|
+
lines2.push(
|
|
62
|
+
`**Note**: the update succeeded, but version and deployment details are unavailable (confirmation read failed). Run platform_get_prompt to inspect the current state. Do not retry the update.`
|
|
63
|
+
);
|
|
64
|
+
return lines2.join("\n");
|
|
65
|
+
}
|
|
66
|
+
const newVersion = await identifyNewVersion({
|
|
67
|
+
idOrHandle,
|
|
68
|
+
prompt,
|
|
69
|
+
commitMessage: params.commitMessage
|
|
70
|
+
});
|
|
71
|
+
const lines = [];
|
|
72
|
+
lines.push("Prompt updated successfully!\n");
|
|
73
|
+
if (prompt.id) lines.push(`**ID**: ${prompt.id}`);
|
|
74
|
+
if (prompt.handle) lines.push(`**Handle**: ${prompt.handle}`);
|
|
75
|
+
if (newVersion?.version != null)
|
|
76
|
+
lines.push(`**Version**: v${newVersion.version}`);
|
|
77
|
+
if (newVersion?.versionId)
|
|
78
|
+
lines.push(`**Version ID**: ${newVersion.versionId}`);
|
|
79
|
+
lines.push(`**Commit**: ${params.commitMessage}`);
|
|
80
|
+
if (!newVersion) {
|
|
81
|
+
lines.push(
|
|
82
|
+
`**Note**: update succeeded, but the new version could not be identified in the re-fetched prompt \u2014 version and deployment details are unavailable. Run platform_get_prompt to inspect the current state.`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
if (newVersion) {
|
|
86
|
+
const allDeployments = deploymentTagsOf(prompt);
|
|
87
|
+
const newTags = allDeployments.filter(
|
|
88
|
+
(tag) => newVersion.versionId != null && tag.versionId === newVersion.versionId
|
|
89
|
+
).map((tag) => tag.name);
|
|
90
|
+
if (newTags.length > 0) {
|
|
91
|
+
lines.push(`**Deployed to**: ${newTags.join(", ")}`);
|
|
92
|
+
} else {
|
|
93
|
+
lines.push(`**Deployment**: not deployed`);
|
|
94
|
+
const otherTags = Array.from(
|
|
95
|
+
new Set(
|
|
96
|
+
allDeployments.filter((tag) => tag.versionId !== newVersion.versionId).map((tag) => tag.name)
|
|
97
|
+
)
|
|
98
|
+
);
|
|
99
|
+
if (otherTags.length > 0) {
|
|
100
|
+
lines.push(
|
|
101
|
+
`**Existing deployments (untouched)**: ${otherTags.join(", ")}`
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return lines.join("\n");
|
|
107
|
+
}
|
|
108
|
+
async function renderTagFailure({
|
|
109
|
+
idOrHandle,
|
|
110
|
+
params
|
|
111
|
+
}) {
|
|
112
|
+
const failedTags = params.tags?.join(", ") ?? "";
|
|
113
|
+
let prompt;
|
|
114
|
+
try {
|
|
115
|
+
prompt = await getPrompt(idOrHandle, {
|
|
116
|
+
version: void 0,
|
|
117
|
+
tag: void 0
|
|
118
|
+
});
|
|
119
|
+
} catch {
|
|
120
|
+
return `Prompt update failed: could not assign tag(s) ${failedTags} to "${idOrHandle}". Whether a new version was created could not be confirmed (confirmation read failed) \u2014 run platform_get_prompt before retrying.`;
|
|
121
|
+
}
|
|
122
|
+
const matched = await identifyNewVersion({
|
|
123
|
+
idOrHandle,
|
|
124
|
+
prompt,
|
|
125
|
+
commitMessage: params.commitMessage
|
|
126
|
+
});
|
|
127
|
+
if (matched) {
|
|
128
|
+
const lines = [];
|
|
129
|
+
lines.push("Prompt update partially failed.\n");
|
|
130
|
+
lines.push(
|
|
131
|
+
"A new version was created, but assigning the requested tag(s) failed."
|
|
132
|
+
);
|
|
133
|
+
if (matched.versionId) lines.push(`**Version ID**: ${matched.versionId}`);
|
|
134
|
+
lines.push(`**Status**: created, untagged`);
|
|
135
|
+
lines.push(`**Failed tag(s)**: ${failedTags}`);
|
|
136
|
+
return lines.join("\n");
|
|
137
|
+
}
|
|
138
|
+
return `Prompt update failed: could not assign tag(s) ${failedTags} to "${idOrHandle}".`;
|
|
139
|
+
}
|
|
140
|
+
export {
|
|
141
|
+
handleUpdatePrompt
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=update-prompt-ZQQ2C3KU.js.map
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatScenarioFields
|
|
3
|
+
} from "./chunk-7E4FZIYJ.js";
|
|
1
4
|
import {
|
|
2
5
|
updateScenario
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-RVAE2MEA.js";
|
|
7
|
+
import "./chunk-GELJ2MQR.js";
|
|
5
8
|
import "./chunk-WT4PO4A3.js";
|
|
6
9
|
import "./chunk-SAS5OB7F.js";
|
|
7
10
|
|
|
@@ -20,9 +23,13 @@ async function handleUpdateScenario(params) {
|
|
|
20
23
|
if (Array.isArray(result.labels) && result.labels.length > 0) {
|
|
21
24
|
lines.push(`**Labels**: ${result.labels.join(", ")}`);
|
|
22
25
|
}
|
|
26
|
+
if (result.testSuiteId) {
|
|
27
|
+
lines.push(`**Test suite**: ${result.testSuiteId}`);
|
|
28
|
+
}
|
|
29
|
+
lines.push(...formatScenarioFields(result.fields));
|
|
23
30
|
return lines.join("\n");
|
|
24
31
|
}
|
|
25
32
|
export {
|
|
26
33
|
handleUpdateScenario
|
|
27
34
|
};
|
|
28
|
-
//# sourceMappingURL=update-scenario-
|
|
35
|
+
//# sourceMappingURL=update-scenario-WUX34JAR.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langwatch/mcp-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "An MCP server for Langwatch.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,18 +36,17 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@ai-sdk/anthropic": "^3.0.44",
|
|
39
|
-
"@anthropic-ai/claude-code": "2.1.
|
|
39
|
+
"@anthropic-ai/claude-code": "2.1.228",
|
|
40
40
|
"@eslint/js": "^10.0.1",
|
|
41
41
|
"@langwatch/scenario": "^0.4.6",
|
|
42
42
|
"@opentelemetry/context-async-hooks": "^2.1.0",
|
|
43
|
-
"@opentelemetry/sdk-node": "^0.
|
|
43
|
+
"@opentelemetry/sdk-node": "^0.221.0",
|
|
44
44
|
"@types/debug": "^4.1.13",
|
|
45
45
|
"@types/express": "^5.0.6",
|
|
46
|
-
"@types/node": "^
|
|
46
|
+
"@types/node": "^26.2.0",
|
|
47
47
|
"@types/yargs": "^17.0.33",
|
|
48
|
-
"@typescript/native-preview": "7.0.0-dev.20260705.1",
|
|
49
48
|
"ai": "^6.0.161",
|
|
50
|
-
"chalk": "^
|
|
49
|
+
"chalk": "^6.0.0",
|
|
51
50
|
"date-fns": "^4.1.0",
|
|
52
51
|
"dotenv": "^17.2.2",
|
|
53
52
|
"esbuild": "^0.28.1",
|
|
@@ -56,14 +55,14 @@
|
|
|
56
55
|
"node-pty": "^1.0.0",
|
|
57
56
|
"tsup": "^8.1.0",
|
|
58
57
|
"tsx": "^4.20.5",
|
|
59
|
-
"typescript": "^
|
|
58
|
+
"typescript": "^6.0.3",
|
|
60
59
|
"typescript-eslint": "^8.55.0",
|
|
61
60
|
"vitest": "^4.1.8",
|
|
62
61
|
"yargs": "^18.0.0",
|
|
63
62
|
"zod-validation-error": "^5.0.0",
|
|
64
|
-
"@langwatch/
|
|
63
|
+
"@langwatch/handled-error": "0.1.0",
|
|
65
64
|
"@langwatch/ssrf": "0.0.1",
|
|
66
|
-
"@langwatch/
|
|
65
|
+
"@langwatch/redaction": "0.0.1"
|
|
67
66
|
},
|
|
68
67
|
"dependencies": {
|
|
69
68
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
package/pyproject.toml
CHANGED
|
@@ -5,12 +5,12 @@ description = "Add your description here"
|
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
7
7
|
dependencies = [
|
|
8
|
-
"ipykernel>=
|
|
8
|
+
"ipykernel>=7.3.0",
|
|
9
9
|
"langwatch",
|
|
10
|
-
"litellm>=1.
|
|
11
|
-
"mcp[cli]>=
|
|
10
|
+
"litellm>=1.96.0",
|
|
11
|
+
"mcp[cli]>=2.0.0",
|
|
12
12
|
"pandas>=2.3.2",
|
|
13
|
-
"tenacity>=9.1.
|
|
13
|
+
"tenacity>=9.1.4",
|
|
14
14
|
]
|
|
15
15
|
|
|
16
16
|
[tool.uv]
|