Skip to content

Commit 9a02266

Browse files
TheStack-aiclaude
andcommitted
fix: harden install scripts and align version across all configs
- Remove npx oh-my-logo from install.sh/install.ps1 (supply chain risk) - Add Python 3.11+ version check before install - Hard fail on dependency install failure instead of false ONLINE status - Fix pyproject.toml dependency: fastmcp → mcp (correct package) - Align Cargo.toml version with tauri.conf.json (0.1.0 → 0.3.2) - Restrict ~/.jarvis-orb/ permissions to owner only (chmod 700) - Set install.ps1 ErrorActionPreference to Stop - Add CONTRIBUTING.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b41749f commit 9a02266

7 files changed

Lines changed: 107 additions & 63 deletions

File tree

CONTRIBUTING.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Contributing to Jarvis Orb
2+
3+
Thanks for your interest in contributing!
4+
5+
## Getting Started
6+
7+
```bash
8+
git clone https://github.com/whynowlab/jarvis-orb.git
9+
cd jarvis-orb
10+
```
11+
12+
### Brain (Python)
13+
14+
```bash
15+
cd brain
16+
uv venv .venv && source .venv/bin/activate
17+
uv pip install aiosqlite websockets mcp pytest pytest-asyncio
18+
python -m pytest tests/ -v
19+
```
20+
21+
### Orb (Tauri + Three.js)
22+
23+
```bash
24+
cd orb
25+
pnpm install
26+
pnpm tauri dev
27+
```
28+
29+
## Pull Requests
30+
31+
1. Fork the repo and create a feature branch
32+
2. Make your changes
33+
3. Run tests: `cd brain && python -m pytest tests/ -v`
34+
4. Submit a PR with a clear description
35+
36+
## Reporting Bugs
37+
38+
Open an issue at [GitHub Issues](https://github.com/whynowlab/jarvis-orb/issues) with:
39+
- Steps to reproduce
40+
- Expected vs actual behavior
41+
- OS and Python version
42+
43+
## License
44+
45+
By contributing, you agree that your contributions will be licensed under the MIT License.

brain/jarvis_brain/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Jarvis Brain Lite — Configuration."""
2+
import os
23
from pathlib import Path
34

45
BRAIN_DIR = Path.home() / ".jarvis-orb"
@@ -9,3 +10,8 @@
910
def ensure_dirs():
1011
"""Create brain directory on demand (not on import)."""
1112
BRAIN_DIR.mkdir(parents=True, exist_ok=True)
13+
# Restrict permissions to owner only
14+
try:
15+
os.chmod(BRAIN_DIR, 0o700)
16+
except OSError:
17+
pass

brain/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Lightweight AI memory brain with MCP server"
55
requires-python = ">=3.11"
66
dependencies = [
77
"aiosqlite>=0.20.0",
8-
"fastmcp>=0.1.0",
8+
"mcp>=1.0.0",
99
"websockets>=12.0,<15.0",
1010
]
1111

install.ps1

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Jarvis Orb — Windows Installer (PowerShell)
22
# Usage: irm https://raw.githubusercontent.com/whynowlab/jarvis-orb/main/install.ps1 | iex
33

4-
$ErrorActionPreference = "Continue"
5-
$Version = "0.3.1"
4+
$ErrorActionPreference = "Stop"
5+
$Version = "0.3.2"
66
$Repo = "whynowlab/jarvis-orb"
77
$BrainDir = "$env:USERPROFILE\.jarvis-orb"
88
$BrainBin = "$BrainDir\bin"
@@ -28,48 +28,43 @@ function Write-Step($msg) {
2828
# ── Header ──
2929
Write-Host ""
3030
Write-Host ""
31-
# Generate logo with oh-my-logo if npx available
32-
$hasNpx = Get-Command npx -ErrorAction SilentlyContinue
33-
if ($hasNpx) {
34-
npx -y oh-my-logo "JARVIS" --palette-colors "#4A9EBF,#8EE4FF,#6B4FA0" --filled --block-font block -d diagonal --color 2>$null
35-
Write-Host " " -NoNewline
36-
Write-Host "◉ ORB" -ForegroundColor Cyan
37-
Write-Host " " -NoNewline
38-
Write-Host "AI Brain + Visualizer · v$Version" -ForegroundColor DarkGray
39-
} else {
40-
Write-Host " J A R V I S" -NoNewline -ForegroundColor Cyan
41-
Write-Host " ◉ ORB" -ForegroundColor White
42-
Write-Host " AI Brain + Visualizer · v$Version" -ForegroundColor DarkGray
43-
}
31+
Write-Host " J A R V I S" -NoNewline -ForegroundColor Cyan
32+
Write-Host " ◉ ORB" -ForegroundColor White
33+
Write-Host " AI Brain + Visualizer · v$Version" -ForegroundColor DarkGray
4434
Write-Host ""
4535

4636
# ── Step 1: Environment ──
4737
Write-Step "Checking environment"
4838
Write-Info "Windows $([System.Environment]::OSVersion.Version)"
4939

5040
$hasPython = Get-Command python -ErrorAction SilentlyContinue
51-
if ($hasPython) {
52-
Write-Ok "Python found: $(python --version 2>&1)"
53-
} else {
54-
Write-Warn "Python not found — Brain Lite requires Python 3.11+"
41+
if (-not $hasPython) {
42+
Write-Host " Python not found. Install Python 3.11+ first." -ForegroundColor Red
43+
exit 1
44+
}
45+
46+
$pyVersion = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" 2>&1
47+
$pyParts = $pyVersion -split '\.'
48+
if ([int]$pyParts[0] -lt 3 -or ([int]$pyParts[0] -eq 3 -and [int]$pyParts[1] -lt 11)) {
49+
Write-Host " Python 3.11+ required (found $pyVersion)." -ForegroundColor Red
50+
exit 1
5551
}
52+
Write-Ok "Python $pyVersion"
5653

5754
# ── Step 2: Brain Lite ──
5855
Write-Step "Installing Brain Lite"
5956

6057
New-Item -ItemType Directory -Force -Path $BrainDir | Out-Null
6158
New-Item -ItemType Directory -Force -Path $BrainBin | Out-Null
6259

63-
if ($hasPython) {
64-
Write-Info "Installing dependencies..."
65-
$pipOutput = python -m pip install --target "$BrainDir\lib" aiosqlite websockets mcp 2>&1
66-
if ($LASTEXITCODE -eq 0) {
67-
Write-Ok "Dependencies installed"
68-
} else {
69-
Write-Warn "Dependency install failed — check Python/pip"
70-
Write-Info ($pipOutput | Out-String)
71-
}
60+
Write-Info "Installing dependencies..."
61+
$pipOutput = python -m pip install --target "$BrainDir\lib" aiosqlite websockets mcp 2>&1
62+
if ($LASTEXITCODE -ne 0) {
63+
Write-Host " Dependency install failed. Check your Python/pip setup." -ForegroundColor Red
64+
Write-Info ($pipOutput | Out-String)
65+
exit 1
7266
}
67+
Write-Ok "Dependencies installed"
7368

7469
# Download Brain source
7570
Write-Info "Downloading Brain Lite..."
@@ -165,15 +160,8 @@ try {
165160
# ── Done ──
166161
Write-Host ""
167162
Write-Host ""
168-
if ($hasNpx) {
169-
npx -y oh-my-logo "JARVIS" --palette-colors "#8EE4FF,#B0F0FF,#8EE4FF" --filled --block-font block -d diagonal --color 2>$null
170-
Write-Host " " -NoNewline
171-
Write-Host "◉ ORB" -NoNewline -ForegroundColor Green
172-
Write-Host " ONLINE" -ForegroundColor Green
173-
} else {
174-
Write-Host " J A R V I S" -NoNewline -ForegroundColor Green
175-
Write-Host " ◉ ORB ONLINE" -ForegroundColor Green
176-
}
163+
Write-Host " J A R V I S" -NoNewline -ForegroundColor Green
164+
Write-Host " ◉ ORB" -ForegroundColor Green
177165
Write-Host ""
178166
Write-Host " I N S T A L L E D" -ForegroundColor Green
179167
Write-Host ""

install.sh

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,22 @@ WHITE='\033[97m'
1616
HOLO='\033[38;2;142;228;255m'
1717

1818
REPO="whynowlab/jarvis-orb"
19-
VERSION="0.3.1"
19+
VERSION="0.3.2"
2020
BRAIN_DIR="$HOME/.jarvis-orb"
2121
BRAIN_BIN="$BRAIN_DIR/bin"
2222

2323
# ── Logo ──
2424
show_logo() {
2525
echo ""
26-
# Generate logo with oh-my-logo if available, else fallback
27-
if command -v npx &>/dev/null; then
28-
npx -y oh-my-logo "JARVIS" --palette-colors "#4A9EBF,#8EE4FF,#6B4FA0" --filled --block-font block -d diagonal --color 2>/dev/null
29-
echo -e " ${HOLO}◉ ORB${R}"
30-
echo -e " ${DIM}AI Brain + Visualizer · v${VERSION}${R}"
31-
else
32-
echo -e " ${CYAN}${B}J A R V I S${R} ${HOLO}◉ ORB${R}"
33-
echo -e " ${DIM}AI Brain + Visualizer · v${VERSION}${R}"
34-
fi
26+
echo -e " ${CYAN}${B}J A R V I S${R} ${HOLO}◉ ORB${R}"
27+
echo -e " ${DIM}AI Brain + Visualizer · v${VERSION}${R}"
3528
echo ""
3629
}
3730

3831
show_logo_done() {
3932
echo ""
40-
if command -v npx &>/dev/null; then
41-
npx -y oh-my-logo "JARVIS" --palette-colors "#8EE4FF,#B0F0FF,#8EE4FF" --filled --block-font block -d diagonal --color 2>/dev/null
42-
echo -e " ${GREEN}${B}◉ ORB${R}"
43-
echo -e " ${GREEN}ONLINE${R} ${DIM}· v${VERSION}${R}"
44-
else
45-
echo -e " ${GREEN}${B}J A R V I S${R} ${GREEN}◉ ORB${R}"
46-
echo -e " ${GREEN}ONLINE${R} ${DIM}· v${VERSION}${R}"
47-
fi
33+
echo -e " ${GREEN}${B}J A R V I S${R} ${GREEN}◉ ORB${R}"
34+
echo -e " ${GREEN}INSTALLED${R} ${DIM}· v${VERSION}${R}"
4835
echo ""
4936
}
5037

@@ -93,26 +80,44 @@ show_logo
9380
step "Checking environment"
9481
info "$OS $ARCH"
9582

83+
# Python version check
84+
if ! command -v python3 &>/dev/null; then
85+
echo -e " ${RED}Python 3 not found. Install Python 3.11+ first.${R}"
86+
exit 1
87+
fi
88+
89+
PY_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2>/dev/null)
90+
PY_MAJOR=$(echo "$PY_VERSION" | cut -d. -f1)
91+
PY_MINOR=$(echo "$PY_VERSION" | cut -d. -f2)
92+
93+
if [ "$PY_MAJOR" -lt 3 ] || ([ "$PY_MAJOR" -eq 3 ] && [ "$PY_MINOR" -lt 11 ]); then
94+
echo -e " ${RED}Python 3.11+ required (found $PY_VERSION).${R}"
95+
exit 1
96+
fi
97+
ok "Python $PY_VERSION"
98+
9699
if command -v uv &>/dev/null; then
97100
ok "uv found"
98101
PIP_CMD="uv pip install"
99102
elif command -v pip3 &>/dev/null; then
100103
ok "pip3 found"
101104
PIP_CMD="pip3 install"
102105
else
103-
warn "No Python package manager"
104-
PIP_CMD=""
106+
echo -e " ${RED}No Python package manager (pip3 or uv) found.${R}"
107+
exit 1
105108
fi
106109

107110
# ── Step 2: Brain Lite ──
108111
step "Installing Brain Lite"
109112

110113
mkdir -p "$BRAIN_DIR" "$BRAIN_BIN"
114+
chmod 700 "$BRAIN_DIR"
111115

112-
if [ -n "$PIP_CMD" ]; then
113-
$PIP_CMD --target "$BRAIN_DIR/lib" aiosqlite websockets mcp >/dev/null 2>&1 && \
114-
ok "Dependencies installed" || warn "Dependency install failed"
116+
if ! $PIP_CMD --target "$BRAIN_DIR/lib" aiosqlite websockets mcp >/dev/null 2>&1; then
117+
echo -e " ${RED}Dependency install failed. Check your Python/pip setup.${R}"
118+
exit 1
115119
fi
120+
ok "Dependencies installed"
116121

117122
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
118123
if [ -d "$SCRIPT_DIR/brain/jarvis_brain" ]; then

orb/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "jarvis-orb"
3-
version = "0.1.0"
3+
version = "0.3.2"
44
edition = "2021"
55

66
[dependencies]

orb/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/nicoptere/tauri/tauri-v2/tooling/cli/schema.json",
33
"productName": "Jarvis Orb",
4-
"version": "0.3.1",
4+
"version": "0.3.2",
55
"identifier": "com.jarvis.orb",
66
"build": {
77
"frontendDist": "../dist",

0 commit comments

Comments
 (0)