omnish 2.1.7 → 2.1.9

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.
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Canonical public URL for the omnish bootstrap installer (tunnel-relay /action route).
3
+ */
4
+ "use strict";
5
+
6
+ const INSTALL_SCRIPT_URL = "https://platform.omnish.dev/action/install-omnish.sh";
7
+
8
+ /** @param {string} [fallbackVersion] npm package version for unpkg fallback */
9
+ function readBootstrapInstallScriptUrl(fallbackVersion) {
10
+ return INSTALL_SCRIPT_URL;
11
+ }
12
+
13
+ /** unpkg fallback when platform host is unreachable */
14
+ function readBootstrapInstallScriptUnpkgUrl(pkg) {
15
+ const name = (pkg && pkg.name) || "omnish";
16
+ const version = (pkg && pkg.version) || "latest";
17
+ return "https://unpkg.com/" + name + "@" + version + "/contrib/install-omnish.sh";
18
+ }
19
+
20
+ module.exports = {
21
+ INSTALL_SCRIPT_URL,
22
+ readBootstrapInstallScriptUrl,
23
+ readBootstrapInstallScriptUnpkgUrl,
24
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnish",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
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,10 +17,10 @@
17
17
  ],
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "git+https://github.com/eligapris/omnish.git"
20
+ "url": "git+https://github.com/labKnowledge/omnish.git"
21
21
  },
22
22
  "bugs": {
23
- "url": "https://github.com/eligapris/omnish/issues"
23
+ "url": "https://github.com/labKnowledge/omnish/issues"
24
24
  },
25
25
  "homepage": "https://omnish.dev",
26
26
  "files": [
@@ -29,8 +29,10 @@
29
29
  "scripts/check-baileys-dep.mjs",
30
30
  "scripts/check-native-modules.mjs",
31
31
  "scripts/check-node-version.cjs",
32
+ "scripts/install-script-url.cjs",
32
33
  "scripts/node-version.cjs",
33
34
  "scripts/fix-node-pty-perms.mjs",
35
+ "contrib/install-omnish.sh",
34
36
  "README.md",
35
37
  "CHANGELOG.md",
36
38
  "LICENSE",
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Canonical public URL for the omnish bootstrap installer (tunnel-relay /action route).
3
+ */
4
+ "use strict";
5
+
6
+ const INSTALL_SCRIPT_URL = "https://platform.omnish.dev/action/install-omnish.sh";
7
+
8
+ /** @param {string} [fallbackVersion] npm package version for unpkg fallback */
9
+ function readBootstrapInstallScriptUrl(fallbackVersion) {
10
+ return INSTALL_SCRIPT_URL;
11
+ }
12
+
13
+ /** unpkg fallback when platform host is unreachable */
14
+ function readBootstrapInstallScriptUnpkgUrl(pkg) {
15
+ const name = (pkg && pkg.name) || "omnish";
16
+ const version = (pkg && pkg.version) || "latest";
17
+ return "https://unpkg.com/" + name + "@" + version + "/contrib/install-omnish.sh";
18
+ }
19
+
20
+ module.exports = {
21
+ INSTALL_SCRIPT_URL,
22
+ readBootstrapInstallScriptUrl,
23
+ readBootstrapInstallScriptUnpkgUrl,
24
+ };
@@ -7,24 +7,35 @@
7
7
  var fs = require("fs");
8
8
  var os = require("os");
9
9
  var path = require("path");
10
+ var installUrl = require("./install-script-url.cjs");
10
11
 
11
12
  var DEFAULT_ENGINES_NODE = ">=22.13";
12
13
  var RECOMMENDED_NODE = "22";
13
14
 
14
- function readEnginesNode() {
15
+ function readPackageJson() {
15
16
  try {
16
- var pkg = JSON.parse(
17
+ return JSON.parse(
17
18
  fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"),
18
19
  );
19
- if (pkg.engines && typeof pkg.engines.node === "string") {
20
- return pkg.engines.node;
21
- }
22
- return DEFAULT_ENGINES_NODE;
23
20
  } catch (err) {
24
- return DEFAULT_ENGINES_NODE;
21
+ return null;
25
22
  }
26
23
  }
27
24
 
25
+ function readEnginesNode() {
26
+ var pkg = readPackageJson();
27
+ if (pkg && pkg.engines && typeof pkg.engines.node === "string") {
28
+ return pkg.engines.node;
29
+ }
30
+ return DEFAULT_ENGINES_NODE;
31
+ }
32
+
33
+ /** Public bootstrap script URL (platform.omnish.dev). */
34
+ function readBootstrapInstallScriptUrl() {
35
+ var pkg = readPackageJson();
36
+ return installUrl.readBootstrapInstallScriptUrl(pkg && pkg.version);
37
+ }
38
+
28
39
  function parseSemver(version) {
29
40
  var raw = String(version).trim().replace(/^v/, "");
30
41
  var m = /^(\d+)\.(\d+)\.(\d+)/.exec(raw);
@@ -124,101 +135,78 @@ function formatNodeUpgradeHelp(result, platform) {
124
135
  if (platform === undefined) {
125
136
  platform = os.platform();
126
137
  }
138
+ var bootstrap = readBootstrapInstallScriptUrl();
127
139
  var lines = [];
128
140
  var c = shellComment(platform);
129
141
  lines.push("");
130
- lines.push("=== omnish: upgrade Node to 22.13+ (you have " + result.current + ") ===");
142
+ lines.push(
143
+ "=== omnish: Node " + result.required + " required (you have " + result.current + ") ===",
144
+ );
131
145
  lines.push("");
132
- if (platform !== "win32" && platform !== "darwin") {
133
- lines.push("QUICK FIX — Debian/Ubuntu VPS (replaces old apt Node 12):");
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)");
146
+ lines.push("npm install -g omnish cannot finish on this Node version.");
147
+ lines.push(
148
+ "(EBADENGINE warnings above are expected on old Node — ignore them; the blocker is below.)",
149
+ );
144
150
  lines.push("");
145
- lines.push("Why: omnish ships native addons (better-sqlite3, node-pty) and depends on");
146
- lines.push("packages that require Node 22+. Older Node cannot install or run omnish.");
151
+ lines.push("RUN THIS INSTEAD one command upgrades Node + installs omnish:");
152
+ lines.push(" curl -fsSL " + bootstrap + " | bash");
147
153
  lines.push("");
148
- lines.push("Pick one upgrade path, then re-run:");
149
- lines.push(" npm i -g omnish");
154
+ lines.push("Fallback (npm mirror):");
155
+ lines.push(" curl -fsSL " + installUrl.readBootstrapInstallScriptUnpkgUrl(readPackageJson()) + " | bash");
156
+ lines.push("");
157
+ lines.push("Required: Node " + result.required + " | You have: " + result.current);
158
+ lines.push("Recommend: Node " + result.recommended + " (matches .nvmrc in the repo)");
159
+ lines.push("");
160
+ lines.push("Why: native addons (better-sqlite3, node-pty) and deps need Node 22+.");
150
161
  lines.push("");
151
162
 
152
163
  if (platform === "win32") {
153
- lines.push("Windows — nvm-windows (recommended if you use nvm):");
164
+ lines.push("Windows — nvm-windows:");
154
165
  lines.push(" nvm i 22");
155
166
  lines.push(" nvm use 22");
156
167
  lines.push(" node -v");
157
168
  lines.push(" npm i -g omnish");
158
169
  lines.push("");
159
- lines.push("Windows — official installer / winget:");
170
+ lines.push("Windows — winget:");
160
171
  lines.push(" winget install OpenJS.NodeJS.LTS");
161
172
  lines.push(" node -v");
162
173
  lines.push(" npm i -g omnish");
163
174
  lines.push("");
164
- lines.push("If npm still uses an old Node, open a new terminal after upgrading.");
175
+ lines.push("If npm still uses old Node, open a new terminal after upgrading.");
165
176
  return lines.join("\n");
166
177
  }
167
178
 
168
179
  if (platform === "darwin") {
169
- lines.push("macOS — nvm (install + set default + install omnish):");
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:");
180
+ lines.push("macOS — Homebrew (fastest):");
181
181
  lines.push(" brew install node@22");
182
182
  lines.push(" brew link --overwrite --force node@22");
183
183
  lines.push(" node -v");
184
184
  lines.push(" npm i -g omnish");
185
185
  lines.push("");
186
- lines.push("macOS — fnm:");
187
- lines.push(" fnm use --install-if-missing 22");
188
- lines.push(" fnm default 22");
186
+ lines.push("macOS — nvm:");
187
+ lines.push(c + " https://github.com/nvm-sh/nvm#installing-and-updating");
188
+ lines.push(
189
+ " curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash",
190
+ );
191
+ lines.push(c + " restart shell, then:");
192
+ lines.push(" nvm i 22");
193
+ lines.push(" nvm alias default 22");
189
194
  lines.push(" npm i -g omnish");
190
195
  return lines.join("\n");
191
196
  }
192
197
 
193
- lines.push("Linux VPS / server — Debian or Ubuntu (replaces old apt node, e.g. v12):");
198
+ lines.push("Linux VPS — Debian/Ubuntu (replaces old apt Node, e.g. v12):");
194
199
  lines.push(" curl -fsSL https://deb.nodesource.com/setup_22.x | bash -");
195
- lines.push(" apt-get install -y nodejs");
200
+ lines.push(" apt-get install -y nodejs build-essential python3");
196
201
  lines.push(" node -v");
197
202
  lines.push(" npm i -g omnish");
198
203
  lines.push("");
199
- lines.push("Linux — nvm (install + set default + install omnish):");
200
- lines.push(c + " install nvm: https://github.com/nvm-sh/nvm#installing-and-updating");
204
+ lines.push("Linux — nvm:");
201
205
  lines.push(
202
206
  " curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash",
203
207
  );
204
- lines.push(c + " restart your shell, then:");
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
- );
208
+ lines.push(c + " restart shell:");
209
+ lines.push(" nvm i 22 && nvm alias default 22 && npm i -g omnish");
222
210
  return lines.join("\n");
223
211
  }
224
212
 
@@ -250,4 +238,5 @@ module.exports = {
250
238
  checkNodeVersion: checkNodeVersion,
251
239
  formatNodeUpgradeHelp: formatNodeUpgradeHelp,
252
240
  formatNativeModuleNodeHint: formatNativeModuleNodeHint,
241
+ readBootstrapInstallScriptUrl: readBootstrapInstallScriptUrl,
253
242
  };