omnish 2.0.0 → 2.1.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.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnish",
3
- "version": "2.0.0",
3
+ "version": "2.1.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",
@@ -25,6 +25,7 @@
25
25
  "homepage": "https://omnish.dev",
26
26
  "files": [
27
27
  "dist",
28
+ "scripts/check-native-modules.mjs",
28
29
  "scripts/fix-node-pty-perms.mjs",
29
30
  "README.md",
30
31
  "CHANGELOG.md",
@@ -37,6 +38,27 @@
37
38
  "bin": {
38
39
  "omnish": "dist/index.js"
39
40
  },
41
+ "scripts": {
42
+ "reinstall": "rm -rf node_modules && pnpm install",
43
+ "postinstall": "node scripts/check-native-modules.mjs && node scripts/fix-node-pty-perms.mjs",
44
+ "prepack": "npm run build",
45
+ "build": "node scripts/build-bundle.mjs",
46
+ "build:doc-index": "node scripts/build-doc-index.mjs",
47
+ "typecheck": "tsc --noEmit",
48
+ "pretypecheck": "node scripts/build-doc-index.mjs",
49
+ "pretest": "node scripts/build-doc-index.mjs",
50
+ "format": "prettier --write .",
51
+ "format:check": "prettier --check .",
52
+ "test": "tsx --test 'src/**/*.test.ts'",
53
+ "arch:check": "depcruise src --config .dependency-cruiser.cjs",
54
+ "channel:parity": "tsx scripts/channel-parity.mjs",
55
+ "omnish": "tsx src/index.ts",
56
+ "link": "tsx src/index.ts link",
57
+ "run": "tsx src/index.ts run",
58
+ "local": "omnish stop || true; node scripts/build-bundle.mjs && npm link && omnish start",
59
+ "logout": "tsx src/index.ts logout"
60
+ },
61
+ "packageManager": "pnpm@11.3.0+sha512.2c403d6594527287672b1f7056343a1f7c3634036a67ffabfcc2b3d7595d843768f8787148d1b57cf7956c90606bbd192857c363af19e96d2d0ec9ec5741d215",
40
62
  "engines": {
41
63
  "node": ">=22.13"
42
64
  },
@@ -47,6 +69,7 @@
47
69
  "better-sqlite3": "^12.9.0",
48
70
  "discord.js": "^14.22.1",
49
71
  "grammy": "^1.42.0",
72
+ "link-preview-js": "^3.0.0",
50
73
  "matrix-js-sdk": "^41.4.0",
51
74
  "node-pty": "^1.1.0",
52
75
  "nostr-tools": "^2.17.0",
@@ -66,6 +89,14 @@
66
89
  "tsx": "^4.19.2",
67
90
  "typescript": "^5.7.2"
68
91
  },
92
+ "pnpm": {
93
+ "onlyBuiltDependencies": [
94
+ "@parcel/watcher",
95
+ "better-sqlite3",
96
+ "esbuild",
97
+ "node-pty"
98
+ ]
99
+ },
69
100
  "allowScripts": {
70
101
  "@parcel/watcher": true,
71
102
  "@whiskeysockets/baileys": true,
@@ -73,24 +104,5 @@
73
104
  "node-pty": true,
74
105
  "sharp": true,
75
106
  "protobufjs": true
76
- },
77
- "scripts": {
78
- "reinstall": "rm -rf node_modules && pnpm install",
79
- "postinstall": "node scripts/check-native-modules.mjs && node scripts/fix-node-pty-perms.mjs",
80
- "build": "node scripts/build-bundle.mjs",
81
- "build:doc-index": "node scripts/build-doc-index.mjs",
82
- "typecheck": "tsc --noEmit",
83
- "pretypecheck": "node scripts/build-doc-index.mjs",
84
- "pretest": "node scripts/build-doc-index.mjs",
85
- "format": "prettier --write .",
86
- "format:check": "prettier --check .",
87
- "test": "tsx --test 'src/**/*.test.ts'",
88
- "arch:check": "depcruise src --config .dependency-cruiser.cjs",
89
- "channel:parity": "tsx scripts/channel-parity.mjs",
90
- "omnish": "tsx src/index.ts",
91
- "link": "tsx src/index.ts link",
92
- "run": "tsx src/index.ts run",
93
- "local": "omnish stop || true; node scripts/build-bundle.mjs && npm link && omnish start",
94
- "logout": "tsx src/index.ts logout"
95
107
  }
96
- }
108
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Verify native addons load under the current Node ABI (postinstall guard).
3
+ */
4
+ import { createRequire } from "node:module";
5
+
6
+ const require = createRequire(import.meta.url);
7
+
8
+ const modules = ["better-sqlite3", "node-pty", "@parcel/watcher"];
9
+
10
+ let failed = false;
11
+ for (const name of modules) {
12
+ try {
13
+ require(name);
14
+ } catch (err) {
15
+ failed = true;
16
+ console.error(
17
+ `omnish: native module "${name}" failed to load for Node ${process.version} (ABI ${process.versions.modules}).`,
18
+ );
19
+ console.error(` ${err instanceof Error ? err.message : String(err)}`);
20
+ console.error(
21
+ " Fix: use the Node version in .nvmrc (nvm use) and run: pnpm rebuild better-sqlite3 node-pty @parcel/watcher",
22
+ );
23
+ }
24
+ }
25
+
26
+ if (failed) {
27
+ process.exit(1);
28
+ }