omnish 2.1.6 → 2.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.
- package/CHANGELOG.md +26 -0
- package/README.md +12 -4
- package/contrib/install-omnish.sh +185 -0
- package/dist/downloads/omnish-claude.tar.gz +0 -0
- package/dist/downloads/omnish-cursor.tar.gz +0 -0
- package/dist/index.js +187 -187
- package/package.json +7 -4
- package/scripts/baileys-version.cjs +65 -0
- package/scripts/check-baileys-dep.mjs +28 -0
- package/scripts/node-version.cjs +51 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnish",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.8",
|
|
4
4
|
"description": "omnish — allowlisted inbox → your real shell (WhatsApp, Telegram, Discord, Slack, and 20+ channels). No AI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -17,18 +17,21 @@
|
|
|
17
17
|
],
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/
|
|
20
|
+
"url": "git+https://github.com/labKnowledge/omnish.git"
|
|
21
21
|
},
|
|
22
22
|
"bugs": {
|
|
23
|
-
"url": "https://github.com/
|
|
23
|
+
"url": "https://github.com/labKnowledge/omnish/issues"
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://omnish.dev",
|
|
26
26
|
"files": [
|
|
27
27
|
"dist",
|
|
28
|
+
"scripts/baileys-version.cjs",
|
|
29
|
+
"scripts/check-baileys-dep.mjs",
|
|
28
30
|
"scripts/check-native-modules.mjs",
|
|
29
31
|
"scripts/check-node-version.cjs",
|
|
30
32
|
"scripts/node-version.cjs",
|
|
31
33
|
"scripts/fix-node-pty-perms.mjs",
|
|
34
|
+
"contrib/install-omnish.sh",
|
|
32
35
|
"README.md",
|
|
33
36
|
"CHANGELOG.md",
|
|
34
37
|
"LICENSE",
|
|
@@ -81,7 +84,7 @@
|
|
|
81
84
|
"scripts": {
|
|
82
85
|
"reinstall": "rm -rf node_modules && pnpm install",
|
|
83
86
|
"preinstall": "node scripts/check-node-version.cjs",
|
|
84
|
-
"postinstall": "node scripts/check-native-modules.mjs && node scripts/fix-node-pty-perms.mjs",
|
|
87
|
+
"postinstall": "node scripts/check-baileys-dep.mjs && node scripts/check-native-modules.mjs && node scripts/fix-node-pty-perms.mjs",
|
|
85
88
|
"build": "node scripts/build-bundle.mjs",
|
|
86
89
|
"build:doc-index": "node scripts/build-doc-index.mjs",
|
|
87
90
|
"typecheck": "tsc --noEmit",
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Baileys version policy for CVE-2026-48063 (GHSA-qvv5-jq5g-4cgg).
|
|
3
|
+
* Safe: 6.7.22+ or 7.0.0-rc12+ (handles rc.9 vs rc13 naming).
|
|
4
|
+
*/
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
/** Minimum pinned Baileys for omnish publishes. */
|
|
8
|
+
var EXPECTED_BAILEYS_PIN = "7.0.0-rc13";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Parse 7.0.0-rcN or 7.0.0-rc.N into N, or null if not an RC.
|
|
12
|
+
* @param {string} version
|
|
13
|
+
* @returns {number | null}
|
|
14
|
+
*/
|
|
15
|
+
function parseBaileysRcNumber(version) {
|
|
16
|
+
var m = /^7\.0\.0-rc\.?(\d+)/.exec(String(version).trim());
|
|
17
|
+
if (!m) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return Number(m[1]);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @param {string} version Installed or declared Baileys version.
|
|
25
|
+
* @returns {boolean}
|
|
26
|
+
*/
|
|
27
|
+
function isBaileysVersionSafe(version) {
|
|
28
|
+
var v = String(version).trim();
|
|
29
|
+
|
|
30
|
+
var rc = parseBaileysRcNumber(v);
|
|
31
|
+
if (rc !== null) {
|
|
32
|
+
return rc >= 12;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var m6 = /^6\.(\d+)\.(\d+)/.exec(v);
|
|
36
|
+
if (m6) {
|
|
37
|
+
var minor = Number(m6[1]);
|
|
38
|
+
var patch = Number(m6[2]);
|
|
39
|
+
if (minor > 7) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
if (minor === 7 && patch >= 22) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var m7 = /^7\.(\d+)\.(\d+)/.exec(v);
|
|
49
|
+
if (m7) {
|
|
50
|
+
var majorMinor = Number(m7[1]);
|
|
51
|
+
var patch7 = Number(m7[2]);
|
|
52
|
+
if (majorMinor > 0) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
return patch7 > 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = {
|
|
62
|
+
EXPECTED_BAILEYS_PIN,
|
|
63
|
+
parseBaileysRcNumber,
|
|
64
|
+
isBaileysVersionSafe,
|
|
65
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Postinstall guard: fail if installed Baileys is vulnerable (CVE-2026-48063).
|
|
3
|
+
*/
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const { isBaileysVersionSafe } = require("./baileys-version.cjs");
|
|
8
|
+
|
|
9
|
+
let version;
|
|
10
|
+
try {
|
|
11
|
+
version = require("@whiskeysockets/baileys/package.json").version;
|
|
12
|
+
} catch {
|
|
13
|
+
process.exit(0);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (!isBaileysVersionSafe(version)) {
|
|
17
|
+
console.error(
|
|
18
|
+
`omnish: vulnerable @whiskeysockets/baileys@${version} is installed.`,
|
|
19
|
+
);
|
|
20
|
+
console.error(
|
|
21
|
+
" CVE-2026-48063 (message spoofing) affects this version. See:",
|
|
22
|
+
);
|
|
23
|
+
console.error(
|
|
24
|
+
" https://github.com/WhiskeySockets/Baileys/security/advisories/GHSA-qvv5-jq5g-4cgg",
|
|
25
|
+
);
|
|
26
|
+
console.error(" Fix: npm install -g omnish@latest");
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
package/scripts/node-version.cjs
CHANGED
|
@@ -11,18 +11,30 @@ var path = require("path");
|
|
|
11
11
|
var DEFAULT_ENGINES_NODE = ">=22.13";
|
|
12
12
|
var RECOMMENDED_NODE = "22";
|
|
13
13
|
|
|
14
|
-
function
|
|
14
|
+
function readPackageJson() {
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
return JSON.parse(
|
|
17
17
|
fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"),
|
|
18
18
|
);
|
|
19
|
-
if (pkg.engines && typeof pkg.engines.node === "string") {
|
|
20
|
-
return pkg.engines.node;
|
|
21
|
-
}
|
|
22
|
-
return DEFAULT_ENGINES_NODE;
|
|
23
19
|
} catch (err) {
|
|
24
|
-
return
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function readEnginesNode() {
|
|
25
|
+
var pkg = readPackageJson();
|
|
26
|
+
if (pkg && pkg.engines && typeof pkg.engines.node === "string") {
|
|
27
|
+
return pkg.engines.node;
|
|
25
28
|
}
|
|
29
|
+
return DEFAULT_ENGINES_NODE;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Public bootstrap script URL (served from npm via unpkg — works without GitHub access). */
|
|
33
|
+
function readBootstrapInstallScriptUrl() {
|
|
34
|
+
var pkg = readPackageJson();
|
|
35
|
+
var name = (pkg && pkg.name) || "omnish";
|
|
36
|
+
var version = (pkg && pkg.version) || "latest";
|
|
37
|
+
return "https://unpkg.com/" + name + "@" + version + "/contrib/install-omnish.sh";
|
|
26
38
|
}
|
|
27
39
|
|
|
28
40
|
function parseSemver(version) {
|
|
@@ -124,101 +136,75 @@ function formatNodeUpgradeHelp(result, platform) {
|
|
|
124
136
|
if (platform === undefined) {
|
|
125
137
|
platform = os.platform();
|
|
126
138
|
}
|
|
139
|
+
var bootstrap = readBootstrapInstallScriptUrl();
|
|
127
140
|
var lines = [];
|
|
128
141
|
var c = shellComment(platform);
|
|
129
142
|
lines.push("");
|
|
130
|
-
lines.push(
|
|
143
|
+
lines.push(
|
|
144
|
+
"=== omnish: Node " + result.required + " required (you have " + result.current + ") ===",
|
|
145
|
+
);
|
|
146
|
+
lines.push("");
|
|
147
|
+
lines.push("npm install -g omnish cannot finish on this Node version.");
|
|
148
|
+
lines.push(
|
|
149
|
+
"(EBADENGINE warnings above are expected on old Node — ignore them; the blocker is below.)",
|
|
150
|
+
);
|
|
131
151
|
lines.push("");
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
lines.push(" curl -fsSL https://deb.nodesource.com/setup_22.x | bash -");
|
|
135
|
-
lines.push(" apt-get install -y nodejs");
|
|
136
|
-
lines.push(" node -v");
|
|
137
|
-
lines.push(" npm i -g omnish");
|
|
138
|
-
lines.push("");
|
|
139
|
-
}
|
|
140
|
-
lines.push("omnish needs a newer Node.js to install and run.");
|
|
141
|
-
lines.push(" Required : Node " + result.required + " (see package.json engines)");
|
|
142
|
-
lines.push(" You have : " + result.current);
|
|
143
|
-
lines.push(" Recommend: Node " + result.recommended + " (matches .nvmrc in the repo)");
|
|
152
|
+
lines.push("RUN THIS INSTEAD — upgrades Node 22+ and installs omnish:");
|
|
153
|
+
lines.push(" curl -fsSL " + bootstrap + " | bash");
|
|
144
154
|
lines.push("");
|
|
145
|
-
lines.push("
|
|
146
|
-
lines.push("
|
|
155
|
+
lines.push("Required: Node " + result.required + " | You have: " + result.current);
|
|
156
|
+
lines.push("Recommend: Node " + result.recommended + " (matches .nvmrc in the repo)");
|
|
147
157
|
lines.push("");
|
|
148
|
-
lines.push("
|
|
149
|
-
lines.push(" npm i -g omnish");
|
|
158
|
+
lines.push("Why: native addons (better-sqlite3, node-pty) and deps need Node 22+.");
|
|
150
159
|
lines.push("");
|
|
151
160
|
|
|
152
161
|
if (platform === "win32") {
|
|
153
|
-
lines.push("Windows — nvm-windows
|
|
162
|
+
lines.push("Windows — nvm-windows:");
|
|
154
163
|
lines.push(" nvm i 22");
|
|
155
164
|
lines.push(" nvm use 22");
|
|
156
165
|
lines.push(" node -v");
|
|
157
166
|
lines.push(" npm i -g omnish");
|
|
158
167
|
lines.push("");
|
|
159
|
-
lines.push("Windows —
|
|
168
|
+
lines.push("Windows — winget:");
|
|
160
169
|
lines.push(" winget install OpenJS.NodeJS.LTS");
|
|
161
170
|
lines.push(" node -v");
|
|
162
171
|
lines.push(" npm i -g omnish");
|
|
163
172
|
lines.push("");
|
|
164
|
-
lines.push("If npm still uses
|
|
173
|
+
lines.push("If npm still uses old Node, open a new terminal after upgrading.");
|
|
165
174
|
return lines.join("\n");
|
|
166
175
|
}
|
|
167
176
|
|
|
168
177
|
if (platform === "darwin") {
|
|
169
|
-
lines.push("macOS —
|
|
170
|
-
lines.push(c + " install nvm: https://github.com/nvm-sh/nvm#installing-and-updating");
|
|
171
|
-
lines.push(
|
|
172
|
-
" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash",
|
|
173
|
-
);
|
|
174
|
-
lines.push(c + " restart your shell, then:");
|
|
175
|
-
lines.push(" nvm i 22");
|
|
176
|
-
lines.push(" nvm alias default 22");
|
|
177
|
-
lines.push(" node -v");
|
|
178
|
-
lines.push(" npm i -g omnish");
|
|
179
|
-
lines.push("");
|
|
180
|
-
lines.push("macOS — Homebrew:");
|
|
178
|
+
lines.push("macOS — Homebrew (fastest):");
|
|
181
179
|
lines.push(" brew install node@22");
|
|
182
180
|
lines.push(" brew link --overwrite --force node@22");
|
|
183
181
|
lines.push(" node -v");
|
|
184
182
|
lines.push(" npm i -g omnish");
|
|
185
183
|
lines.push("");
|
|
186
|
-
lines.push("macOS —
|
|
187
|
-
lines.push("
|
|
188
|
-
lines.push(
|
|
184
|
+
lines.push("macOS — nvm:");
|
|
185
|
+
lines.push(c + " https://github.com/nvm-sh/nvm#installing-and-updating");
|
|
186
|
+
lines.push(
|
|
187
|
+
" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash",
|
|
188
|
+
);
|
|
189
|
+
lines.push(c + " restart shell, then:");
|
|
190
|
+
lines.push(" nvm i 22");
|
|
191
|
+
lines.push(" nvm alias default 22");
|
|
189
192
|
lines.push(" npm i -g omnish");
|
|
190
193
|
return lines.join("\n");
|
|
191
194
|
}
|
|
192
195
|
|
|
193
|
-
lines.push("Linux VPS
|
|
196
|
+
lines.push("Linux VPS — Debian/Ubuntu (replaces old apt Node, e.g. v12):");
|
|
194
197
|
lines.push(" curl -fsSL https://deb.nodesource.com/setup_22.x | bash -");
|
|
195
|
-
lines.push(" apt-get install -y nodejs");
|
|
198
|
+
lines.push(" apt-get install -y nodejs build-essential python3");
|
|
196
199
|
lines.push(" node -v");
|
|
197
200
|
lines.push(" npm i -g omnish");
|
|
198
201
|
lines.push("");
|
|
199
|
-
lines.push("Linux — nvm
|
|
200
|
-
lines.push(c + " install nvm: https://github.com/nvm-sh/nvm#installing-and-updating");
|
|
202
|
+
lines.push("Linux — nvm:");
|
|
201
203
|
lines.push(
|
|
202
204
|
" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash",
|
|
203
205
|
);
|
|
204
|
-
lines.push(c + " restart
|
|
205
|
-
lines.push(" nvm i 22");
|
|
206
|
-
lines.push(" nvm alias default 22");
|
|
207
|
-
lines.push(" node -v");
|
|
208
|
-
lines.push(" npm i -g omnish");
|
|
209
|
-
lines.push("");
|
|
210
|
-
lines.push("Linux — fnm:");
|
|
211
|
-
lines.push(" fnm use --install-if-missing 22");
|
|
212
|
-
lines.push(" fnm default 22");
|
|
213
|
-
lines.push(" npm i -g omnish");
|
|
214
|
-
lines.push("");
|
|
215
|
-
lines.push("Linux — official builds:");
|
|
216
|
-
lines.push(" https://nodejs.org/en/download (pick 22.x)");
|
|
217
|
-
lines.push("");
|
|
218
|
-
lines.push("One-liner bootstrap (tries nvm/fnm, then installs omnish):");
|
|
219
|
-
lines.push(
|
|
220
|
-
" curl -fsSL https://raw.githubusercontent.com/labKnowledge/omnish/main/contrib/install-omnish.sh | bash",
|
|
221
|
-
);
|
|
206
|
+
lines.push(c + " restart shell:");
|
|
207
|
+
lines.push(" nvm i 22 && nvm alias default 22 && npm i -g omnish");
|
|
222
208
|
return lines.join("\n");
|
|
223
209
|
}
|
|
224
210
|
|
|
@@ -250,4 +236,5 @@ module.exports = {
|
|
|
250
236
|
checkNodeVersion: checkNodeVersion,
|
|
251
237
|
formatNodeUpgradeHelp: formatNodeUpgradeHelp,
|
|
252
238
|
formatNativeModuleNodeHint: formatNativeModuleNodeHint,
|
|
239
|
+
readBootstrapInstallScriptUrl: readBootstrapInstallScriptUrl,
|
|
253
240
|
};
|