@tasksai/install 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -2
  2. package/src/index.js +23 -16
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@tasksai/install",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Shared TasksAI MCP installer CLI",
5
5
  "type": "module",
6
6
  "bin": {
7
- "install": "src/index.js",
8
7
  "tasksai-install": "src/index.js"
9
8
  },
10
9
  "files": [
package/src/index.js CHANGED
@@ -9,7 +9,7 @@ import readline from "node:readline/promises";
9
9
  import { spawnSync } from "node:child_process";
10
10
  import { stdin as input, stdout as output } from "node:process";
11
11
 
12
- const INSTALLER_VERSION = "0.1.5";
12
+ const INSTALLER_VERSION = "0.1.8";
13
13
  const DEFAULT_SOURCES = {
14
14
  lawtasksai: "https://github.com/laudoluxDev/lawtasksai-mcp",
15
15
  farmer: "https://github.com/laudoluxDev/farmertasksai-mcp",
@@ -477,19 +477,23 @@ function formatPermissionRecovery({ operation, failures, options, vertical, sour
477
477
  }
478
478
 
479
479
  function buildInstallCommand({ options, source }) {
480
- const parts = ["npx", "@tasksai/install", options.productId];
480
+ const cliParts = ["tasksai-install", options.productId];
481
481
  const sourceUrl = source?.repoUrl || options.source;
482
- if (sourceUrl) parts.push("--source", sourceUrl);
483
- if (options.client) parts.push("--client", options.client);
484
- if (options.installDir) parts.push("--install-dir", resolveUserPath(options.installDir));
485
- return parts.map(shellToken).join(" ");
482
+ if (sourceUrl) cliParts.push("--source", sourceUrl);
483
+ if (options.client) cliParts.push("--client", options.client);
484
+ if (options.installDir) cliParts.push("--install-dir", resolveUserPath(options.installDir));
485
+ return buildNpmCallCommand(cliParts);
486
486
  }
487
487
 
488
488
  function buildDoctorCommand(options) {
489
- const parts = ["npx", "@tasksai/install", options.productId, "doctor"];
490
- if (options.client) parts.push("--client", options.client);
491
- if (options.installDir) parts.push("--install-dir", resolveUserPath(options.installDir));
492
- return parts.map(shellToken).join(" ");
489
+ const cliParts = ["tasksai-install", options.productId, "doctor"];
490
+ if (options.client) cliParts.push("--client", options.client);
491
+ if (options.installDir) cliParts.push("--install-dir", resolveUserPath(options.installDir));
492
+ return buildNpmCallCommand(cliParts);
493
+ }
494
+
495
+ function buildNpmCallCommand(cliParts) {
496
+ return ["npm", "exec", "--package=@tasksai/install", "--call", cliParts.map(shellToken).join(" ")].map(shellToken).join(" ");
493
497
  }
494
498
 
495
499
  function shellToken(value) {
@@ -663,15 +667,18 @@ function verifySource({ options, source, manifest, vertical }) {
663
667
  if (!manifest.official_domain || !vertical.website_url?.includes(manifest.official_domain)) {
664
668
  throw new Error("Manifest official domain does not match vertical website URL.");
665
669
  }
666
- const npxInstaller = getNpxInstaller(manifest);
667
- const command = npxInstaller?.command;
668
- const args = npxInstaller?.args || [];
669
- if (command !== "npx" || !Array.isArray(args) || args[0] !== "@tasksai/install") {
670
- throw new Error("Manifest installer command is not the approved @tasksai/install npx command.");
670
+ const installer = getInstaller(manifest);
671
+ const command = installer?.command;
672
+ const args = installer?.args || [];
673
+ const isLegacyNpx = command === "npx" && Array.isArray(args) && args[0] === "@tasksai/install";
674
+ const isNpmExec = command === "npm" && Array.isArray(args) && args.includes("--package=@tasksai/install") && (args.includes("tasksai-install") || args.includes("--call"));
675
+ if (!isLegacyNpx && !isNpmExec) {
676
+ throw new Error("Manifest installer command is not an approved @tasksai/install command.");
671
677
  }
672
678
  }
673
679
 
674
- function getNpxInstaller(manifest) {
680
+ function getInstaller(manifest) {
681
+ if (manifest.installer?.npm_exec) return manifest.installer.npm_exec;
675
682
  if (manifest.installer?.npx) return manifest.installer.npx;
676
683
  return manifest.installer;
677
684
  }