@tasksai/install 0.1.33 → 0.1.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tasksai/install",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
4
4
  "description": "Shared TasksAI MCP installer CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,3 +2,4 @@ mcp>=1.0.0,<2.0.0
2
2
  httpx>=0.27.0
3
3
  python-dotenv>=1.0.0
4
4
  python-docx>=1.1.2
5
+ pywin32>=311; sys_platform == "win32"
package/src/index.js CHANGED
@@ -475,18 +475,32 @@ async function configureMcpClient({ client, vertical, installDir, runtimeDir, ve
475
475
 
476
476
  function buildMcpServerConfig({ client, vertical, installDir, runtimeDir, vendorDir }) {
477
477
  return {
478
- command: "python3",
478
+ command: pythonCommandForPlatform(),
479
479
  args: [path.join(runtimeDir, "server.py")],
480
480
  env: {
481
481
  TASKSAI_PRODUCT_ID: vertical.product_id,
482
482
  TASKSAI_API_BASE: vertical.api_base_url,
483
483
  TASKSAI_CLIENT: client.id,
484
- PYTHONPATH: vendorDir,
484
+ PYTHONPATH: pythonVendorPaths(vendorDir).join(path.delimiter),
485
485
  DOTENV_PATH: path.join(installDir, ".env")
486
486
  }
487
487
  };
488
488
  }
489
489
 
490
+ function pythonCommandForPlatform(platform = process.platform) {
491
+ return platform === "win32" ? "python" : "python3";
492
+ }
493
+
494
+ function pythonVendorPaths(vendorDir, platform = process.platform) {
495
+ if (platform !== "win32") return [vendorDir];
496
+ return [
497
+ vendorDir,
498
+ path.win32.join(vendorDir, "win32"),
499
+ path.win32.join(vendorDir, "win32", "lib"),
500
+ path.win32.join(vendorDir, "Pythonwin")
501
+ ];
502
+ }
503
+
490
504
  async function jsonConfigHasServer(configPath, productId) {
491
505
  const config = await readJson(configPath);
492
506
  return Boolean(config.mcpServers?.[productId]);
@@ -1171,7 +1185,9 @@ async function safeReportDoctorPassed({
1171
1185
  async function verifyRuntimeHealth({ serverPath, vendorDir }) {
1172
1186
  const python = findPython();
1173
1187
  if (!python) throw new Error("Python 3 is unavailable");
1174
- const pythonPath = [vendorDir, process.env.PYTHONPATH].filter(Boolean).join(path.delimiter);
1188
+ const pythonPath = [...pythonVendorPaths(vendorDir), process.env.PYTHONPATH]
1189
+ .filter(Boolean)
1190
+ .join(path.delimiter);
1175
1191
  const check = [
1176
1192
  "import ast, pathlib, sys",
1177
1193
  "ast.parse(pathlib.Path(sys.argv[1]).read_text(encoding='utf-8'), filename=sys.argv[1])",
@@ -1356,6 +1372,8 @@ export {
1356
1372
  parseArgs,
1357
1373
  parseEnv,
1358
1374
  parseSource,
1375
+ pythonCommandForPlatform,
1376
+ pythonVendorPaths,
1359
1377
  safeReportDoctorPassed,
1360
1378
  verifyProductionSource,
1361
1379
  verifyRuntimeHealth,