@agenticmail/enterprise 0.5.330 → 0.5.332
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/dist/cli.js +84 -0
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,90 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
__require
|
|
4
|
+
} from "./chunk-KFQGP6VL.js";
|
|
2
5
|
|
|
3
6
|
// src/cli.ts
|
|
7
|
+
var _nodeMajor = parseInt(process.versions.node.split(".")[0]);
|
|
8
|
+
if (_nodeMajor < 20) {
|
|
9
|
+
let _tryExec = function(cmd) {
|
|
10
|
+
try {
|
|
11
|
+
return execSync(cmd, { stdio: "pipe", timeout: 5e3 }).toString().trim();
|
|
12
|
+
} catch {
|
|
13
|
+
return "";
|
|
14
|
+
}
|
|
15
|
+
}, _findNode20 = function() {
|
|
16
|
+
for (const p of ["/opt/homebrew/bin/node", "/usr/local/bin/node"]) {
|
|
17
|
+
const ver = _tryExec(`${p} --version 2>/dev/null`);
|
|
18
|
+
if (ver && parseInt(ver.replace("v", "")) >= 20) return p;
|
|
19
|
+
}
|
|
20
|
+
const nvmDir = `${os.homedir()}/.nvm/versions/node`;
|
|
21
|
+
const dirs = _tryExec(`ls -d ${nvmDir}/v2[0-9]* ${nvmDir}/v3[0-9]* 2>/dev/null`);
|
|
22
|
+
if (dirs) {
|
|
23
|
+
const last = dirs.split("\n").pop();
|
|
24
|
+
if (last) return `${last}/bin/node`;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
};
|
|
28
|
+
_tryExec2 = _tryExec, _findNode202 = _findNode20;
|
|
29
|
+
const { execSync, spawnSync } = __require("child_process");
|
|
30
|
+
const os = __require("os");
|
|
31
|
+
console.log(`
|
|
32
|
+
AgenticMail Enterprise requires Node.js 20+. You have ${process.version}.`);
|
|
33
|
+
const _existingNode = _findNode20();
|
|
34
|
+
if (_existingNode) {
|
|
35
|
+
console.log(` Found Node 20+ at ${_existingNode}. Re-launching...
|
|
36
|
+
`);
|
|
37
|
+
const r = spawnSync(_existingNode, process.argv.slice(1), { stdio: "inherit" });
|
|
38
|
+
process.exit(r.status ?? 1);
|
|
39
|
+
}
|
|
40
|
+
let _installed = false;
|
|
41
|
+
if (os.platform() === "darwin" && _tryExec("which brew")) {
|
|
42
|
+
console.log(" Installing Node.js 22 via Homebrew (this may take a minute)...\n");
|
|
43
|
+
try {
|
|
44
|
+
execSync("brew install node@22", { stdio: "inherit", timeout: 3e5 });
|
|
45
|
+
try {
|
|
46
|
+
execSync("brew link --overwrite node@22", { stdio: "pipe", timeout: 3e4 });
|
|
47
|
+
} catch {
|
|
48
|
+
}
|
|
49
|
+
_installed = true;
|
|
50
|
+
} catch {
|
|
51
|
+
}
|
|
52
|
+
} else if (os.platform() === "linux" && _tryExec("which apt-get")) {
|
|
53
|
+
console.log(" Installing Node.js 22 via apt (this may take a minute)...\n");
|
|
54
|
+
try {
|
|
55
|
+
execSync("curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt-get install -y nodejs", { stdio: "inherit", timeout: 3e5 });
|
|
56
|
+
_installed = true;
|
|
57
|
+
} catch {
|
|
58
|
+
}
|
|
59
|
+
} else if (os.platform() === "linux" && _tryExec("which dnf")) {
|
|
60
|
+
console.log(" Installing Node.js 22 via dnf (this may take a minute)...\n");
|
|
61
|
+
try {
|
|
62
|
+
execSync("curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo bash - && sudo dnf install -y nodejs", { stdio: "inherit", timeout: 3e5 });
|
|
63
|
+
_installed = true;
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (_installed) {
|
|
68
|
+
const newNode = _findNode20() || _tryExec("which node");
|
|
69
|
+
const newVer = _tryExec(`${newNode} --version`);
|
|
70
|
+
if (newNode && parseInt((newVer || "").replace("v", "")) >= 20) {
|
|
71
|
+
console.log(`
|
|
72
|
+
Node.js ${newVer} installed! Re-launching...
|
|
73
|
+
`);
|
|
74
|
+
const r = spawnSync(newNode, process.argv.slice(1), { stdio: "inherit" });
|
|
75
|
+
process.exit(r.status ?? 1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
console.error(`
|
|
79
|
+
Could not auto-install Node.js 20+. Please install manually:`);
|
|
80
|
+
console.error(` brew install node@22 # macOS (Homebrew)`);
|
|
81
|
+
console.error(` nvm install 22 # using nvm`);
|
|
82
|
+
console.error(` curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash - # Linux
|
|
83
|
+
`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
var _tryExec2;
|
|
87
|
+
var _findNode202;
|
|
4
88
|
var args = process.argv.slice(2);
|
|
5
89
|
var command = args[0];
|
|
6
90
|
switch (command) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticmail/enterprise",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.332",
|
|
4
4
|
"description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"postgres": "^3.4.0"
|
|
115
115
|
},
|
|
116
116
|
"engines": {
|
|
117
|
-
"node": ">=
|
|
117
|
+
"node": ">=20.0.0"
|
|
118
118
|
},
|
|
119
119
|
"funding": {
|
|
120
120
|
"type": "individual",
|