@paretools/python 0.3.0 → 0.5.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/README.md +43 -10
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/formatters.d.ts +13 -1
- package/dist/lib/formatters.d.ts.map +1 -1
- package/dist/lib/formatters.js +66 -0
- package/dist/lib/formatters.js.map +1 -1
- package/dist/lib/parsers.d.ts +13 -1
- package/dist/lib/parsers.d.ts.map +1 -1
- package/dist/lib/parsers.js +175 -4
- package/dist/lib/parsers.js.map +1 -1
- package/dist/lib/python-runner.d.ts +3 -0
- package/dist/lib/python-runner.d.ts.map +1 -1
- package/dist/lib/python-runner.js +9 -0
- package/dist/lib/python-runner.js.map +1 -1
- package/dist/schemas/index.d.ts +79 -195
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +49 -4
- package/dist/schemas/index.js.map +1 -1
- package/dist/tools/black.d.ts +3 -0
- package/dist/tools/black.d.ts.map +1 -0
- package/dist/tools/black.js +35 -0
- package/dist/tools/black.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/pytest.d.ts +3 -0
- package/dist/tools/pytest.d.ts.map +1 -0
- package/dist/tools/pytest.js +38 -0
- package/dist/tools/pytest.js.map +1 -0
- package/dist/tools/uv-install.d.ts +3 -0
- package/dist/tools/uv-install.d.ts.map +1 -0
- package/dist/tools/uv-install.js +34 -0
- package/dist/tools/uv-install.js.map +1 -0
- package/dist/tools/uv-run.d.ts +3 -0
- package/dist/tools/uv-run.d.ts.map +1 -0
- package/dist/tools/uv-run.js +29 -0
- package/dist/tools/uv-run.js.map +1 -0
- package/package.json +19 -7
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { dualOutput } from "@paretools/shared";
|
|
3
|
+
import { uv } from "../lib/python-runner.js";
|
|
4
|
+
import { parseUvRun } from "../lib/parsers.js";
|
|
5
|
+
import { formatUvRun } from "../lib/formatters.js";
|
|
6
|
+
import { UvRunSchema } from "../schemas/index.js";
|
|
7
|
+
export function registerUvRunTool(server) {
|
|
8
|
+
server.registerTool("uv-run", {
|
|
9
|
+
title: "uv Run",
|
|
10
|
+
description: "Runs a command in a uv-managed environment and returns structured output. Use instead of running `uv run` in the terminal.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
path: z.string().optional().describe("Working directory (default: cwd)"),
|
|
13
|
+
command: z
|
|
14
|
+
.array(z.string())
|
|
15
|
+
.min(1)
|
|
16
|
+
.describe("Command and arguments to run (e.g. ['python', 'script.py'])"),
|
|
17
|
+
},
|
|
18
|
+
outputSchema: UvRunSchema,
|
|
19
|
+
}, async ({ path, command }) => {
|
|
20
|
+
const cwd = path || process.cwd();
|
|
21
|
+
const args = ["run", ...command];
|
|
22
|
+
const start = Date.now();
|
|
23
|
+
const result = await uv(args, cwd);
|
|
24
|
+
const elapsed = Date.now() - start;
|
|
25
|
+
const data = parseUvRun(result.stdout, result.stderr, result.exitCode, elapsed);
|
|
26
|
+
return dualOutput(data, formatUvRun);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=uv-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uv-run.js","sourceRoot":"","sources":["../../src/tools/uv-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,MAAM,CAAC,YAAY,CACjB,QAAQ,EACR;QACE,KAAK,EAAE,QAAQ;QACf,WAAW,EACT,4HAA4H;QAC9H,WAAW,EAAE;YACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;YACxE,OAAO,EAAE,CAAC;iBACP,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;iBACjB,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,6DAA6D,CAAC;SAC3E;QACD,YAAY,EAAE,WAAW;KAC1B,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1B,MAAM,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,CAAC;QAEjC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;QAEnC,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAChF,OAAO,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACvC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paretools/python",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"mcpName": "io.github.Dave-London/python",
|
|
5
5
|
"description": "MCP server for Python tools (pip, mypy, ruff) with structured, token-efficient output",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,13 +9,25 @@
|
|
|
9
9
|
"mcp-server",
|
|
10
10
|
"model-context-protocol",
|
|
11
11
|
"structured-output",
|
|
12
|
+
"ai",
|
|
13
|
+
"ai-agent",
|
|
14
|
+
"claude",
|
|
15
|
+
"cursor",
|
|
16
|
+
"copilot",
|
|
17
|
+
"token-efficient",
|
|
18
|
+
"devtools",
|
|
19
|
+
"cli",
|
|
12
20
|
"python",
|
|
13
21
|
"mypy",
|
|
14
|
-
"ruff"
|
|
22
|
+
"ruff",
|
|
23
|
+
"pytest",
|
|
24
|
+
"uv",
|
|
25
|
+
"black",
|
|
26
|
+
"pip"
|
|
15
27
|
],
|
|
16
28
|
"homepage": "https://github.com/Dave-London/pare/tree/main/packages/server-python",
|
|
17
29
|
"engines": {
|
|
18
|
-
"node": ">=
|
|
30
|
+
"node": ">=20"
|
|
19
31
|
},
|
|
20
32
|
"type": "module",
|
|
21
33
|
"bin": {
|
|
@@ -40,13 +52,13 @@
|
|
|
40
52
|
],
|
|
41
53
|
"dependencies": {
|
|
42
54
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
43
|
-
"zod": "^3.
|
|
44
|
-
"@paretools/shared": "0.
|
|
55
|
+
"zod": "^4.3.6",
|
|
56
|
+
"@paretools/shared": "0.5.0"
|
|
45
57
|
},
|
|
46
58
|
"devDependencies": {
|
|
47
|
-
"@types/node": "^
|
|
59
|
+
"@types/node": "^25.2.3",
|
|
48
60
|
"typescript": "^5.7.0",
|
|
49
|
-
"vitest": "^
|
|
61
|
+
"vitest": "^4.0.18",
|
|
50
62
|
"@paretools/tsconfig": "0.0.0"
|
|
51
63
|
},
|
|
52
64
|
"scripts": {
|