@iamtrask/om-bridge 1.2.0 → 1.3.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.
- package/bridge.js +1 -1
- package/package.json +1 -1
- package/setup.sh +42 -14
package/bridge.js
CHANGED
|
@@ -42,7 +42,7 @@ async function start() {
|
|
|
42
42
|
sock.ev.on("connection.update", async ({ connection, lastDisconnect, qr }) => {
|
|
43
43
|
if (qr) {
|
|
44
44
|
console.log("\nScan this QR code with WhatsApp:\n");
|
|
45
|
-
console.log(await QRCode.toString(qr, { type: "terminal"
|
|
45
|
+
console.log(await QRCode.toString(qr, { type: "terminal" }));
|
|
46
46
|
}
|
|
47
47
|
if (connection === "open") {
|
|
48
48
|
console.log("Connected to WhatsApp!");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iamtrask/om-bridge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "The Open Mind — an AI auto-responder for WhatsApp. When someone texts you a message starting with \"om\", a local model replies on your behalf using only the files in that person's folder.",
|
|
5
5
|
"main": "bridge.js",
|
|
6
6
|
"bin": {
|
package/setup.sh
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
3
|
# OMBox Setup — installs dependencies, pulls the model, and starts the bridge
|
|
4
|
+
# Usage: curl -fsSL https://raw.githubusercontent.com/.../setup.sh | bash
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
echo "=== OMBox Setup ==="
|
|
9
|
+
echo ""
|
|
4
10
|
|
|
5
11
|
# Install Node.js if missing
|
|
6
12
|
if ! command -v node &> /dev/null; then
|
|
@@ -10,33 +16,55 @@ if ! command -v node &> /dev/null; then
|
|
|
10
16
|
elif command -v apt-get &> /dev/null; then
|
|
11
17
|
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
|
|
12
18
|
sudo apt-get install -y nodejs
|
|
19
|
+
elif command -v dnf &> /dev/null; then
|
|
20
|
+
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
|
|
21
|
+
sudo dnf install -y nodejs
|
|
22
|
+
elif command -v pacman &> /dev/null; then
|
|
23
|
+
sudo pacman -S --noconfirm nodejs npm
|
|
13
24
|
else
|
|
14
|
-
echo "
|
|
15
|
-
|
|
25
|
+
echo "Could not auto-install Node.js. Trying nvm..."
|
|
26
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
|
|
27
|
+
export NVM_DIR="$HOME/.nvm"
|
|
28
|
+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
|
29
|
+
nvm install --lts
|
|
16
30
|
fi
|
|
17
31
|
fi
|
|
18
32
|
|
|
33
|
+
# Verify node is available
|
|
34
|
+
if ! command -v node &> /dev/null; then
|
|
35
|
+
echo "ERROR: Node.js installation failed. Please install manually from https://nodejs.org"
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
echo "Node.js: $(node --version)"
|
|
39
|
+
|
|
19
40
|
# Install Ollama if missing
|
|
20
41
|
if ! command -v ollama &> /dev/null; then
|
|
21
42
|
echo "Ollama not found. Installing..."
|
|
22
|
-
|
|
23
|
-
brew install ollama
|
|
24
|
-
else
|
|
25
|
-
curl -fsSL https://ollama.com/install.sh | sh
|
|
26
|
-
fi
|
|
43
|
+
curl -fsSL https://ollama.com/install.sh | sh
|
|
27
44
|
fi
|
|
28
|
-
|
|
29
|
-
# Pull the model
|
|
30
|
-
echo "Pulling gemma4 (swap with e.g. qwen2.5:0.5b if low on memory)..."
|
|
31
|
-
ollama pull gemma4
|
|
45
|
+
echo "Ollama: $(ollama --version)"
|
|
32
46
|
|
|
33
47
|
# Start Ollama in the background if not already running
|
|
34
48
|
if ! curl -s http://localhost:11434/api/tags &> /dev/null; then
|
|
35
|
-
echo "Starting Ollama..."
|
|
49
|
+
echo "Starting Ollama server..."
|
|
36
50
|
ollama serve &> /dev/null &
|
|
37
|
-
sleep
|
|
51
|
+
sleep 3
|
|
38
52
|
fi
|
|
39
53
|
|
|
54
|
+
# Pull the model
|
|
55
|
+
echo ""
|
|
56
|
+
echo "Pulling gemma4 (~9GB). If that's too big, ctrl-c and run:"
|
|
57
|
+
echo " ollama pull qwen3.5:0.8b"
|
|
58
|
+
echo " (then update MODEL in your Python code to match)"
|
|
59
|
+
echo ""
|
|
60
|
+
ollama pull gemma4
|
|
61
|
+
|
|
62
|
+
echo ""
|
|
63
|
+
echo "=== Setup complete! ==="
|
|
64
|
+
echo ""
|
|
65
|
+
echo "Starting WhatsApp bridge... scan the QR code with your phone."
|
|
66
|
+
echo "(WhatsApp > Settings > Linked Devices > Link a Device)"
|
|
67
|
+
echo ""
|
|
68
|
+
|
|
40
69
|
# Start the WhatsApp bridge
|
|
41
|
-
echo "Starting WhatsApp bridge — scan the QR code with your phone..."
|
|
42
70
|
npx @iamtrask/om-bridge
|