@tasksai/install 0.1.6 → 0.1.7
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 +1 -2
- package/src/index.js +12 -9
package/package.json
CHANGED
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.
|
|
12
|
+
const INSTALLER_VERSION = "0.1.7";
|
|
13
13
|
const DEFAULT_SOURCES = {
|
|
14
14
|
lawtasksai: "https://github.com/laudoluxDev/lawtasksai-mcp",
|
|
15
15
|
farmer: "https://github.com/laudoluxDev/farmertasksai-mcp",
|
|
@@ -477,7 +477,7 @@ function formatPermissionRecovery({ operation, failures, options, vertical, sour
|
|
|
477
477
|
}
|
|
478
478
|
|
|
479
479
|
function buildInstallCommand({ options, source }) {
|
|
480
|
-
const parts = ["
|
|
480
|
+
const parts = ["npm", "exec", "--package=@tasksai/install", "--", "tasksai-install", options.productId];
|
|
481
481
|
const sourceUrl = source?.repoUrl || options.source;
|
|
482
482
|
if (sourceUrl) parts.push("--source", sourceUrl);
|
|
483
483
|
if (options.client) parts.push("--client", options.client);
|
|
@@ -486,7 +486,7 @@ function buildInstallCommand({ options, source }) {
|
|
|
486
486
|
}
|
|
487
487
|
|
|
488
488
|
function buildDoctorCommand(options) {
|
|
489
|
-
const parts = ["
|
|
489
|
+
const parts = ["npm", "exec", "--package=@tasksai/install", "--", "tasksai-install", options.productId, "doctor"];
|
|
490
490
|
if (options.client) parts.push("--client", options.client);
|
|
491
491
|
if (options.installDir) parts.push("--install-dir", resolveUserPath(options.installDir));
|
|
492
492
|
return parts.map(shellToken).join(" ");
|
|
@@ -663,15 +663,18 @@ function verifySource({ options, source, manifest, vertical }) {
|
|
|
663
663
|
if (!manifest.official_domain || !vertical.website_url?.includes(manifest.official_domain)) {
|
|
664
664
|
throw new Error("Manifest official domain does not match vertical website URL.");
|
|
665
665
|
}
|
|
666
|
-
const
|
|
667
|
-
const command =
|
|
668
|
-
const args =
|
|
669
|
-
|
|
670
|
-
|
|
666
|
+
const installer = getInstaller(manifest);
|
|
667
|
+
const command = installer?.command;
|
|
668
|
+
const args = installer?.args || [];
|
|
669
|
+
const isLegacyNpx = command === "npx" && Array.isArray(args) && args[0] === "@tasksai/install";
|
|
670
|
+
const isNpmExec = command === "npm" && Array.isArray(args) && args.includes("--package=@tasksai/install") && args.includes("tasksai-install");
|
|
671
|
+
if (!isLegacyNpx && !isNpmExec) {
|
|
672
|
+
throw new Error("Manifest installer command is not an approved @tasksai/install command.");
|
|
671
673
|
}
|
|
672
674
|
}
|
|
673
675
|
|
|
674
|
-
function
|
|
676
|
+
function getInstaller(manifest) {
|
|
677
|
+
if (manifest.installer?.npm_exec) return manifest.installer.npm_exec;
|
|
675
678
|
if (manifest.installer?.npx) return manifest.installer.npx;
|
|
676
679
|
return manifest.installer;
|
|
677
680
|
}
|