omnish 2.1.8 → 2.2.0

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,31 @@
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
+ const INSTALL_SCRIPT_PS1_URL = "https://platform.omnish.dev/action/install-omnish.ps1";
8
+
9
+ /** @param {string} [fallbackVersion] npm package version for unpkg fallback */
10
+ function readBootstrapInstallScriptUrl(fallbackVersion) {
11
+ return INSTALL_SCRIPT_URL;
12
+ }
13
+
14
+ function readBootstrapInstallScriptPs1Url() {
15
+ return INSTALL_SCRIPT_PS1_URL;
16
+ }
17
+
18
+ /** unpkg fallback when platform host is unreachable */
19
+ function readBootstrapInstallScriptUnpkgUrl(pkg) {
20
+ const name = (pkg && pkg.name) || "omnish";
21
+ const version = (pkg && pkg.version) || "latest";
22
+ return "https://unpkg.com/" + name + "@" + version + "/contrib/install-omnish.sh";
23
+ }
24
+
25
+ module.exports = {
26
+ INSTALL_SCRIPT_URL,
27
+ INSTALL_SCRIPT_PS1_URL,
28
+ readBootstrapInstallScriptUrl,
29
+ readBootstrapInstallScriptPs1Url,
30
+ readBootstrapInstallScriptUnpkgUrl,
31
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnish",
3
- "version": "2.1.8",
3
+ "version": "2.2.0",
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",
@@ -29,9 +29,11 @@
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",
34
35
  "contrib/install-omnish.sh",
36
+ "contrib/install-omnish.ps1",
35
37
  "README.md",
36
38
  "CHANGELOG.md",
37
39
  "LICENSE",
@@ -0,0 +1,31 @@
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
+ const INSTALL_SCRIPT_PS1_URL = "https://platform.omnish.dev/action/install-omnish.ps1";
8
+
9
+ /** @param {string} [fallbackVersion] npm package version for unpkg fallback */
10
+ function readBootstrapInstallScriptUrl(fallbackVersion) {
11
+ return INSTALL_SCRIPT_URL;
12
+ }
13
+
14
+ function readBootstrapInstallScriptPs1Url() {
15
+ return INSTALL_SCRIPT_PS1_URL;
16
+ }
17
+
18
+ /** unpkg fallback when platform host is unreachable */
19
+ function readBootstrapInstallScriptUnpkgUrl(pkg) {
20
+ const name = (pkg && pkg.name) || "omnish";
21
+ const version = (pkg && pkg.version) || "latest";
22
+ return "https://unpkg.com/" + name + "@" + version + "/contrib/install-omnish.sh";
23
+ }
24
+
25
+ module.exports = {
26
+ INSTALL_SCRIPT_URL,
27
+ INSTALL_SCRIPT_PS1_URL,
28
+ readBootstrapInstallScriptUrl,
29
+ readBootstrapInstallScriptPs1Url,
30
+ readBootstrapInstallScriptUnpkgUrl,
31
+ };
@@ -7,6 +7,7 @@
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";
@@ -29,12 +30,10 @@ function readEnginesNode() {
29
30
  return DEFAULT_ENGINES_NODE;
30
31
  }
31
32
 
32
- /** Public bootstrap script URL (served from npm via unpkg — works without GitHub access). */
33
+ /** Public bootstrap script URL (platform.omnish.dev). */
33
34
  function readBootstrapInstallScriptUrl() {
34
35
  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";
36
+ return installUrl.readBootstrapInstallScriptUrl(pkg && pkg.version);
38
37
  }
39
38
 
40
39
  function parseSemver(version) {
@@ -149,8 +148,15 @@ function formatNodeUpgradeHelp(result, platform) {
149
148
  "(EBADENGINE warnings above are expected on old Node — ignore them; the blocker is below.)",
150
149
  );
151
150
  lines.push("");
152
- lines.push("RUN THIS INSTEAD — upgrades Node 22+ and installs omnish:");
153
- lines.push(" curl -fsSL " + bootstrap + " | bash");
151
+ lines.push("RUN THIS INSTEAD — one command upgrades Node + installs omnish:");
152
+ if (platform === "win32") {
153
+ lines.push(" irm " + installUrl.readBootstrapInstallScriptPs1Url() + " | iex");
154
+ } else {
155
+ lines.push(" curl -fsSL " + bootstrap + " | bash");
156
+ }
157
+ lines.push("");
158
+ lines.push("Fallback (npm mirror):");
159
+ lines.push(" curl -fsSL " + installUrl.readBootstrapInstallScriptUnpkgUrl(readPackageJson()) + " | bash");
154
160
  lines.push("");
155
161
  lines.push("Required: Node " + result.required + " | You have: " + result.current);
156
162
  lines.push("Recommend: Node " + result.recommended + " (matches .nvmrc in the repo)");
@@ -159,8 +165,11 @@ function formatNodeUpgradeHelp(result, platform) {
159
165
  lines.push("");
160
166
 
161
167
  if (platform === "win32") {
168
+ lines.push("Windows — guided installer (PowerShell):");
169
+ lines.push(" irm " + installUrl.readBootstrapInstallScriptPs1Url() + " | iex");
170
+ lines.push("");
162
171
  lines.push("Windows — nvm-windows:");
163
- lines.push(" nvm i 22");
172
+ lines.push(" nvm install 22");
164
173
  lines.push(" nvm use 22");
165
174
  lines.push(" node -v");
166
175
  lines.push(" npm i -g omnish");