release(v2.0.0): cross-platform release — Linux/macOS/Windows/WSL

Creates full release package with:
- release/install.sh (universal cross-platform installer)
- release/windows/install.bat (Git Bash/MSYS2)
- release/windows/install.ps1 (PowerShell)
- release/homebrew/gyandoot.rb (Homebrew formula)
- release/archives/ prebuilt binary archives
- release/README.md (platform-specific install guide)
- install.sh updated with same cross-platform logic
- README.md updated
This commit is contained in:
2026-06-13 18:35:14 +05:30
parent 3b5b995af8
commit 667336bcb9
9 changed files with 1372 additions and 247 deletions

189
README.md
View File

@@ -1,30 +1,179 @@
# GyanDoot v2.0 — AI Agent Platform
# 🚀 GyanDoot v2.0 — AI Agent Platform
A next-generation AI Agent Platform rewritten in Rust for performance, safety, and extensibility.
> **GyanDoot (ज्ञानदूत)** — *"Knowledge Messenger"* — your AI agent that searches, browses, and executes tasks autonomously.
## Architecture
---
```
gyandoot-core — Shared types, config, error types
gyandoot-agent — Core agent loop, tool execution, context compression
gyandoot-providers — LLM provider abstraction (OpenAI, Anthropic, Ollama)
gyandoot-memory — MemPalace persistent memory system
gyandoot-platform — Platform adapters (Telegram, Discord, Webhook, CLI)
gyandoot-security — Credential vault, encryption, threat detection
gyandoot-kanban — Kanban task system (decomposition, swarm, diagnostics)
gyandoot-subagents — Sub-agent spawning and orchestration
gyandoot-skills — Skills system (discovery, loading, preprocessing, bundles)
gyandoot-profile — Multi-agent profile manager
gyandoot-gateway — Gateway for platform sessions, routing, streaming
## 📦 Quick Install
### 🐧 Linux / 🍎 macOS / WSL
```bash
curl -fsSL https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/install.sh | bash
```
## Quick Start
### 🪟 Windows (PowerShell)
```powershell
iwr -useb https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/windows/install.ps1 | iex
```
### 🍺 macOS (Homebrew)
```bash
brew tap gnpl_admin/gyandoot
brew install gyandoot
```
---
## 🖥️ Platform Support
| OS | Architecture | Status |
|----|-------------|--------|
| **macOS** | arm64 (M1/M2/M3/M4), x86_64 | ✅ |
| **Linux** | x86_64, aarch64, i686 | ✅ |
| **WSL (Windows)** | x86_64, aarch64 | ✅ |
| **Windows (native)** | x86_64 | ✅ (Git Bash / MSYS2) |
---
## 📋 Prerequisites
| Dependency | Why | Install |
|-----------|-----|---------|
| **Rust** (cargo ≥ 1.70) | Build GyanDoot binary | `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` |
| **Node.js** (≥ 20) | Camoufox browser daemon | `nvm install 22` or [nodejs.org](https://nodejs.org) |
| **Linux deps** | Camoufox browser engine | See [Linux Dependencies](#linux-dependencies) section |
---
## 🔧 Manual Installation
### Step 1: Clone & Build
```bash
git clone https://git.gyannetra.in/gnpl_admin/gyandoot-release.git
cd gyandoot-release
./install.sh
```
### Step 2: Verify Installation
```bash
gyandoot --help
gyandoot setup # Interactive config wizard
gyandoot run # Start the agent
```
### Step 3: Browser Setup (Anti-Detection)
```bash
# Download Camoufox browser binary (~311MB)
npx --yes camoufox-js@0.11.0 fetch
# macOS only — remove Gatekeeper quarantine
xattr -dr com.apple.quarantine ~/Library/Caches/camoufox
# Verify
ls ~/Library/Caches/camoufox/version.json
```
---
## 🐧 Linux Dependencies
Camoufox (Playwright-based) needs system libraries. Install with:
```bash
./install.sh
gyandoot --help
# Debian / Ubuntu / WSL
sudo apt-get update && sudo apt-get install -y \
libgtk-3-0 libnss3 libnspr4 libatk1.0-0t64 \
libatk-bridge2.0-0t64 libcups2t64 libdrm2 \
libxkbcommon0 libxcomposite1 libxdamage1 \
libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 \
libcairo2 libasound2t64 libxcb-shm0
# Fedora / RHEL
sudo dnf install -y nss nspr atk at-spi2-atk cups-libs \
libdrm libXcomposite libXdamage libXrandr \
mesa-libgbm pango alsa-lib libxkbcommon
```
## License
---
MIT
## 🪟 Windows (Native)
### Using Git Bash / MSYS2
```bash
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install Node.js
# Download from: https://nodejs.org (v20+)
# Build & install
git clone https://git.gyannetra.in/gnpl_admin/gyandoot-release.git
cd gyandoot-release
./install.sh
```
### Using PowerShell
```powershell
# Run as Administrator
Set-ExecutionPolicy Bypass -Scope Process -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/windows/install.ps1'))
```
---
## 🍺 macOS Homebrew
```bash
# Tap the repository
brew tap gnpl_admin/gyandoot
# Install
brew install gyandoot
# Upgrade
brew upgrade gyandoot
```
---
## 🚦 Getting Started
```bash
# 1. Configure your LLM provider
gyandoot setup
# 2. Start interactive session
gyandoot run
# 3. Browser-based tasks (with anti-detection)
gyandoot browser search "latest AI research papers"
gyandoot browser browse https://example.com
# 4. Service management (auto-start on boot)
gyandoot service install # optional
gyandoot service status
```
---
## 🏗️ Architecture
```
gyandoot run
├── Agent Loop (LLM-powered)
├── Browser Manager (Camoufox daemon)
│ ├── camoufox-js@0.11.0 → fetches browser binary
│ └── camoufox-browser@0.1.0 → daemon IPC (Unix socket)
├── Memory Palace (Persistent recall)
│ └── Vector-search memory at ~/.gyandoot/palace/
└── Tool Executor
├── web_search / web_browse (Camoufox browser)
├── file_ops, code_exec
└── subagent delegation
```
---
## 📜 License
MIT — Gyannetra Pvt Ltd

View File

@@ -1,27 +1,54 @@
#!/usr/bin/env bash
# ═══════════════════════════════════════════════════════════════════════════
# GyanDoot v2.0 — Cross-Platform Universal Installer
# ═══════════════════════════════════════════════════════════════════════════
#
# Detects: macOS (arm64/x86_64), Linux (x86_64/aarch64/i686),
# WSL (Windows Subsystem for Linux), Windows (Git Bash/MSYS2)
#
# Usage:
# curl -fsSL https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/install.sh | bash
#
# Or locally:
# ./install.sh
# ═══════════════════════════════════════════════════════════════════════════
set -euo pipefail
# GyanDoot v2.0 — Cross-platform installer
# Detects OS, architecture, and installs the gyandoot binary + camofox-browser.
# For full documentation, visit: https://git.gyannetra.in/gnpl_admin/gyandoot-v2
# ─── Colors ──────────────────────────────────────────────────────────────
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
CYAN='\033[0;36m'
NC='\033[0m'
info() { echo -e "${BLUE}[INFO]${NC} $*"; }
ok() { echo -e "${GREEN}[OK]${NC} $*"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
err() { echo -e "${RED}[ERR]${NC} $*" >&2; exit 1; }
banner() {
echo -e "${CYAN}"
echo ' ____ _ _ _ '
echo ' / ___|_ _ __ _ __| | | |_ ___ __| | ___ '
echo '| | _| | | |/ _` |/ _` | | __/ _ \ / _` |/ _ \ '
echo '| |_| | |_| | (_| | (_| | | |_ (_) | (_| | (_) | '
echo ' \____|\__, |\__,_|\__,_| \__\___/ \__,_|\___/ '
echo ' |___/ '
echo -e "${NC}"
echo -e "${GREEN} GyanDoot v2.0 — Knowledge Messenger${NC}"
echo " Cross-Platform Universal Installer"
echo ""
}
# ─── Platform Detection ──────────────────────────────────────────────────
detect_architecture() {
local arch
arch="$(uname -m)"
case "$arch" in
x86_64|amd64) echo "x86_64" ;;
aarch64|arm64) echo "aarch64" ;;
i686|i386) echo "i686" ;;
*) err "Unsupported architecture: $arch" ;;
esac
}
@@ -37,58 +64,38 @@ detect_os() {
esac
}
# ── WSL Detection ──────────────────────────────────────────────────────────
# Detect if we're running inside Windows Subsystem for Linux.
# /proc/version contains "microsoft" or "wsl" (case-insensitive) on WSL.
detect_wsl() {
if [ -f /proc/version ] && grep -qiE 'microsoft|wsl' /proc/version 2>/dev/null; then
return 0 # true — we are in WSL
return 0
fi
return 1
}
# ── Linux System Dependencies ──────────────────────────────────────────────
# Camoufox (Playwright-based) needs ~30 system libraries on Linux/WSL.
# Without these, the browser daemon crashes silently with
# "Failed to connect: No such file or directory (os error 2)".
# See: https://playwright.dev/docs/troubleshooting#system-dependencies
CAMOUFOX_LINUX_DEPS=(
libgtk-3-0
libnss3
libnspr4
libatk1.0-0t64
libatk-bridge2.0-0t64
libcups2t64
libdrm2
libxkbcommon0
libxcomposite1
libxdamage1
libxfixes3
libxrandr2
libgbm1
libpango-1.0-0
libcairo2
libasound2t64
libxcb-shm0
libx11-xcb1
libx11-6
libxcb1
libxext6
libxcursor1
libxi6
libfreetype6
libfontconfig1
libxshmfence1
libxrender1
libdbus-1-3
)
get_shell_profile() {
case "$SHELL" in
*/zsh) echo "$HOME/.zshrc" ;;
*/bash) echo "$HOME/.bashrc" ;;
*/fish) echo "$HOME/.config/fish/config.fish" ;;
*) echo "$HOME/.profile" ;;
esac
}
# ─── Dependency Installers ───────────────────────────────────────────────
install_rust_if_needed() {
if ! command -v cargo &>/dev/null; then
info "Rust toolchain not found. Installing..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
ok "Rust installed"
if [ "$(uname -s)" = "Darwin" ] || [ "$(uname -s)" = "Linux" ]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
elif [[ "$(uname -s)" =~ ^(CYGWIN|MINGW|MSYS) ]]; then
# Windows: download rustup-init.exe
powershell -Command "& {Invoke-WebRequest -Uri https://win.rustup.rs -OutFile '%TEMP%\rustup-init.exe'; Start-Process '%TEMP%\rustup-init.exe' -Wait -ArgumentList '-y'}"
export PATH="$PATH:$HOME/.cargo/bin"
else
err "No Rust install method for this platform"
fi
ok "Rust installed ($(cargo --version))"
else
ok "Rust already installed ($(cargo --version))"
fi
@@ -96,43 +103,70 @@ install_rust_if_needed() {
install_node_if_needed() {
if ! command -v node &>/dev/null; then
info "Node.js not found. Installing via nvm..."
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
[ -s "$HOME/.nvm/nvm.sh" ] && \. "$HOME/.nvm/nvm.sh"
nvm install 22
info "Node.js not found. Installing..."
if command -v nvm &>/dev/null || [ -s "$HOME/.nvm/nvm.sh" ]; then
[ -s "$HOME/.nvm/nvm.sh" ] && \. "$HOME/.nvm/nvm.sh"
nvm install 22 2>/dev/null || nvm install node
elif [ "$(uname -s)" = "Darwin" ]; then
if command -v brew &>/dev/null; then
brew install node
else
warn "Install Node.js manually: https://nodejs.org"
fi
elif [[ "$(uname -s)" =~ ^(CYGWIN|MINGW|MSYS) ]]; then
warn "Install Node.js from: https://nodejs.org"
else
# Linux: use nvm
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
[ -s "$HOME/.nvm/nvm.sh" ] && \. "$HOME/.nvm/nvm.sh"
nvm install 22
fi
ok "Node.js installed ($(node --version))"
else
ok "Node.js already installed ($(node --version))"
fi
# Ensure npx is available
if ! command -v npx &>/dev/null; then
warn "npx not found. Installing corepack..."
npm install -g npx 2>/dev/null || true
fi
}
# ── Linux System Deps Installer ────────────────────────────────────────────
# ─── Linux System Dependencies ───────────────────────────────────────────
# Camoufox (Playwright-based) needs these on Linux/WSL
CAMOUFOX_LINUX_DEPS=(
libgtk-3-0 libnss3 libnspr4 libatk1.0-0t64
libatk-bridge2.0-0t64 libcups2t64 libdrm2
libxkbcommon0 libxcomposite1 libxdamage1
libxfixes3 libxrandr2 libgbm1 libpango-1.0-0
libcairo2 libasound2t64 libxcb-shm0
libx11-xcb1 libx11-6 libxcb1 libxext6
libxcursor1 libxi6 libfreetype6 libfontconfig1
libxshmfence1 libxrender1 libdbus-1-3
)
install_linux_deps() {
if [ "$(uname -s)" != "Linux" ]; then
return 0 # Not Linux, skip
return 0
fi
# Check if we're in WSL (Windows Subsystem for Linux)
if detect_wsl; then
info "WSL detected. Checking Linux system dependencies..."
info "WSL detected. Installing Linux system dependencies..."
fi
# Check which packages are already installed
local missing=()
if command -v dpkg-query &>/dev/null; then
for pkg in "${CAMOUFOX_LINUX_DEPS[@]}"; do
if ! dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -q "install ok installed"; then
# Handle libasound2 vs libasound2t64 and similar t64 variants
# Try without 't64' suffix as fallback
local alt_pkg="${pkg%t64}"
if [ "$alt_pkg" != "$pkg" ] && dpkg-query -W -f='${Status}' "$alt_pkg" 2>/dev/null | grep -q "install ok installed"; then
continue # alt version is already installed
continue
fi
missing+=("$pkg")
fi
done
else
# Can't check, just try to install all
missing=("${CAMOUFOX_LINUX_DEPS[@]}")
fi
@@ -146,20 +180,14 @@ install_linux_deps() {
if command -v sudo &>/dev/null; then
sudo apt-get update -qq 2>/dev/null || true
sudo apt-get install -y -qq "${missing[@]}" 2>/dev/null || {
# If some packages failed, retry with auto-detected alternatives
warn "Some packages had issues. Retrying with apt --fix..."
warn "Some packages failed. Retrying with fix..."
sudo apt-get --fix-broken install -y -qq 2>/dev/null || true
# Try installing without t64 variants as fallback
local fallback=()
for pkg in "${missing[@]}"; do
local alt="${pkg%t64}"
if [ "$alt" != "$pkg" ]; then
fallback+=("$alt")
fi
[ "$alt" != "$pkg" ] && fallback+=("$alt")
done
if [ ${#fallback[@]} -gt 0 ]; then
sudo apt-get install -y -qq "${fallback[@]}" 2>/dev/null || true
fi
[ ${#fallback[@]} -gt 0 ] && sudo apt-get install -y -qq "${fallback[@]}" 2>/dev/null || true
}
else
apt-get update -qq 2>/dev/null || true
@@ -167,165 +195,149 @@ install_linux_deps() {
fi
ok "Linux system dependencies installed"
elif command -v dnf &>/dev/null; then
info "Detected dnf package manager"
sudo dnf install -y nss nspr atk at-spi2-atk cups-libs libdrm libXcomposite \
libXdamage libXrandr mesa-libgbm pango alsa-lib libxkbcommon libxcb \
libX11-xcb libX11 libXext libXcursor libXfixes libXi gtk3 cairo-gobject 2>/dev/null || true
sudo dnf install -y nss nspr atk at-spi2-atk cups-libs \
libdrm libXcomposite libXdamage libXrandr mesa-libgbm \
pango alsa-lib libxkbcommon libxcb libX11-xcb libX11 \
libXext libXcursor libXfixes libXi gtk3 cairo-gobject 2>/dev/null || true
ok "Linux system dependencies installed"
elif command -v yum &>/dev/null; then
info "Detected yum package manager"
sudo yum install -y nss nspr atk at-spi2-atk cups-libs libdrm libXcomposite \
libXdamage libXrandr mesa-libgbm pango alsa-lib libxkbcommon 2>/dev/null || true
sudo yum install -y nss nspr atk at-spi2-atk cups-libs \
libdrm libXcomposite libXdamage libXrandr mesa-libgbm \
pango alsa-lib libxkbcommon 2>/dev/null || true
ok "Linux system dependencies installed"
else
warn "No supported package manager (apt-get/dnf/yum). You may need to install system dependencies manually."
warn "Required packages: ${CAMOUFOX_LINUX_DEPS[*]}"
warn "No supported package manager. Install deps manually."
warn "Required: ${CAMOUFOX_LINUX_DEPS[*]}"
fi
}
install_camofox_browser() {
info "Installing camofox-browser (anti-detection browser)..."
# ─── Camoufox Browser Installer ──────────────────────────────────────────
install_camoufox_browser() {
info "Installing Camoufox browser (anti-detection engine)..."
# Step 1: Install Linux system dependencies (needed by Playwright/Camoufox)
install_linux_deps
# Step 2: Install the npm package
if command -v npx &>/dev/null || command -v npm &>/dev/null; then
info "Installing npm package..."
npm install -g camoufox-browser@0.1.0 2>&1 | tail -3
if ! command -v npx &>/dev/null && ! command -v npm &>/dev/null; then
warn "Node.js not found. Skipping Camoufox install."
warn "Install Node.js and re-run: npm install -g camoufox-browser@0.1.0"
return 0
fi
info "Downloading Camoufox browser binary (this may take a while, ~662MB)..."
info "Running: npx --yes camoufox-js@0.11.0 fetch"
npx --yes camoufox-js@0.11.0 fetch 2>&1
# Step 1: Install npm package
info "Installing npm package (camoufox-browser@0.1.0)..."
npm install -g camoufox-browser@0.1.0 2>&1 | tail -3 || {
warn "npm install failed. Try manually: npm install -g camoufox-browser@0.1.0"
return 0
}
# Verify the browser binary was actually downloaded
# macOS: ~/Library/Caches/camoufox/ | Linux: ~/.cache/camoufox/
local cache_dir
if [ "$(uname -s)" = "Darwin" ]; then
cache_dir="$HOME/Library/Caches/camoufox"
else
cache_dir="$HOME/.cache/camoufox"
# Step 2: Download browser binary
info "Downloading Camoufox browser binary (~311MB)..."
npx --yes camoufox-js@0.11.0 fetch 2>&1 || {
warn "Download failed. Try manually: npx --yes camoufox-js@0.11.0 fetch"
return 0
}
# Step 3: macOS — remove Gatekeeper quarantine
if [ "$(uname -s)" = "Darwin" ]; then
if command -v xattr &>/dev/null; then
info "Removing macOS quarantine from Camoufox..."
xattr -dr com.apple.quarantine ~/Library/Caches/camoufox 2>/dev/null || true
fi
fi
if [ -f "$cache_dir/camoufox" ]; then
ok "Camoufox browser binary downloaded ($cache_dir/)"
elif [ -f "$cache_dir/version.json" ]; then
ok "Camoufox browser cache found at $cache_dir/ (binary downloaded)"
else
warn "Browser binary not found at $cache_dir/. May need manual 'npx --yes camoufox-js@0.11.0 fetch'"
fi
ok "Camoufox browser npm package installed"
elif command -v docker &>/dev/null; then
info "Installing via Docker..."
docker run -d --name camoufox -p 9377:9377 \
-e CAMOUFOX_WS_PORT=9377 \
--restart unless-stopped \
ghcr.io/nousresearch/camoufox-browser:latest 2>&1 | tail -3
ok "Camoufox browser installed (Docker)"
# Step 4: Verify
local cache_dir
if [ "$(uname -s)" = "Darwin" ]; then
cache_dir="$HOME/Library/Caches/camoufox"
else
warn "Neither npm nor docker found. Install manually: npm install -g camoufox-browser@0.1.0"
cache_dir="$HOME/.cache/camoufox"
fi
if [ -f "$cache_dir/version.json" ]; then
ok "Camoufox browser installed ($(du -sh "$cache_dir" 2>/dev/null | cut -f1))"
else
warn "Browser binary not found. Run manually: npx --yes camoufox-js@0.11.0 fetch"
fi
}
build_release() {
# ─── Build GyanDoot ──────────────────────────────────────────────────────
build_gyandoot() {
local root_dir
root_dir="$(cd "$(dirname "$0")" && pwd)"
info "Building GyanDoot v2.0 in release mode..."
root_dir="$(cd "$(dirname "$0")" 2>/dev/null && pwd || echo "$PWD")"
# Find workspace root (where Cargo.toml with [workspace] is)
cd "$root_dir"
if [ ! -f "$root_dir/Cargo.toml" ]; then
local probe
probe="$(pwd)"
while [ "$probe" != "/" ]; do
if [ -f "$probe/Cargo.toml" ] && grep -q '\[workspace\]' "$probe/Cargo.toml" 2>/dev/null; then
root_dir="$probe"
cd "$root_dir"
info "Found workspace root at $root_dir"
break
fi
probe="$(dirname "$probe")"
done
while [ "$PWD" != "/" ]; do
if [ -f "Cargo.toml" ] && grep -q '\[workspace\]' Cargo.toml 2>/dev/null; then
info "Found workspace root at $PWD"
break
fi
cd ..
done
if [ "$PWD" = "/" ]; then
err "Could not find Cargo workspace. Make sure you're in the gyandoot-v2 directory."
fi
cargo build --release
ok "Build complete ($(du -sh target/release/gyandoot | cut -f1))"
info "Building GyanDoot v2.0 (release mode)..."
cargo build --release 2>&1 | tail -5
ok "Build complete ($(du -sh target/release/gyandoot* 2>/dev/null | cut -f1))"
}
# ─── Install Binary ──────────────────────────────────────────────────────
install_binary() {
local root_dir
root_dir="$(cd "$(dirname "$0")" && pwd)"
local target_dir="$root_dir/target/release"
local target_dir="$PWD/target/release"
local bin_name="gyandoot"
if [ -f "$target_dir/gyandoot.exe" ]; then
bin_name="gyandoot.exe"
fi
if [ ! -f "$target_dir/$bin_name" ]; then
err "Binary not found at $target_dir/$bin_name"
fi
# ── Detect best install location per platform ─────────────────────
# Priority:
# 1. ~/.cargo/bin/ — always in PATH for Rust users, no sudo
# 2. /usr/local/bin/ — standard Unix location, may need sudo
# 3. Windows: use a standard PATH location or just warn
#
local os
os="$(uname -s)"
local install_dir=""
local installed_to=""
# Detect WSL (Windows Subsystem for Linux)
local is_wsl=false
if [ -f /proc/version ] && grep -qiE 'microsoft|wsl' /proc/version 2>/dev/null; then
is_wsl=true
fi
case "$os" in
Darwin|Linux)
# Option A: ~/.cargo/bin/ (no sudo needed, always in PATH for Rust users)
# Priority: ~/.cargo/bin/ → /usr/local/bin → ~/.local/bin/
if [ -d "$HOME/.cargo/bin" ] && echo "$PATH" | grep -q "$HOME/.cargo/bin"; then
install_dir="$HOME/.cargo/bin"
cp "$target_dir/$bin_name" "$install_dir/$bin_name"
chmod +x "$install_dir/$bin_name"
installed_to="$install_dir/$bin_name"
# Option B: /usr/local/bin/ (standard, may need sudo)
elif [ -d "/usr/local/bin" ]; then
if [ -w "/usr/local/bin" ]; then
install_dir="/usr/local/bin"
cp "$target_dir/$bin_name" "$install_dir/$bin_name"
chmod +x "$install_dir/$bin_name"
else
info "Need sudo to install to /usr/local/bin"
sudo cp "$target_dir/$bin_name" "/usr/local/bin/$bin_name"
sudo chmod +x "/usr/local/bin/$bin_name"
install_dir="/usr/local/bin"
fi
installed_to="$install_dir/$bin_name"
# Option C: ~/.local/bin/ (XDG, common on modern Linux)
elif [ -d "$HOME/.local/bin" ] && echo "$PATH" | grep -q "$HOME/.local/bin"; then
install_dir="$HOME/.local/bin"
cp "$target_dir/$bin_name" "$install_dir/$bin_name"
chmod +x "$install_dir/$bin_name"
installed_to="$install_dir/$bin_name"
else
# Fallback: just copy to ~/.cargo/bin and create it
mkdir -p "$HOME/.cargo/bin"
cp "$target_dir/$bin_name" "$HOME/.cargo/bin/$bin_name"
chmod +x "$HOME/.cargo/bin/$bin_name"
install_dir="$HOME/.cargo/bin"
installed_to="$install_dir/$bin_name"
if ! echo "$PATH" | grep -q "$HOME/.cargo/bin"; then
warn "$HOME/.cargo/bin is not in your PATH."
warn "Add this to your shell profile (~/.zshrc, ~/.bashrc, etc.):"
warn "Add ~/.cargo/bin to your PATH in $(get_shell_profile):"
echo " export PATH=\"\$HOME/.cargo/bin:\$PATH\""
fi
fi
if [ -n "$install_dir" ]; then
cp "$target_dir/$bin_name" "$install_dir/$bin_name"
chmod +x "$install_dir/$bin_name"
installed_to="$install_dir/$bin_name"
fi
;;
CYGWIN*|MINGW*|MSYS*)
# Windows / Git Bash / MSYS2
install_dir="/usr/local/bin"
cp "$target_dir/$bin_name" "$install_dir/$bin_name"
chmod +x "$install_dir/$bin_name"
installed_to="$install_dir/$bin_name"
warn "Windows detected. Make sure '$install_dir' is in your PATH."
;;
*)
err "Unsupported OS: $os"
@@ -334,65 +346,49 @@ install_binary() {
ok "Installed to $installed_to"
# ── Verify it's usable via PATH ──────────────────────────────────
# ── Verify PATH resolution ──────────────────────────────────────────
local cmd_path
cmd_path="$(command -v gyandoot 2>/dev/null || true)"
if [ -z "$cmd_path" ]; then
warn "'gyandoot' not found in PATH after install."
warn "The install directory may not be in your PATH."
warn "Try running with: $installed_to"
if [ -n "$install_dir" ]; then
case "$os" in
Darwin)
echo ""
echo " Add to your ~/.zshrc:"
echo " export PATH=\"$install_dir:\$PATH\""
echo " Then: source ~/.zshrc"
;;
Linux)
echo ""
echo " Add to your ~/.bashrc:"
echo " export PATH=\"$install_dir:\$PATH\""
echo " Then: source ~/.bashrc"
;;
esac
fi
warn "'gyandoot' not found in PATH. Use: $installed_to"
elif [ "$cmd_path" != "$installed_to" ]; then
warn "There's ANOTHER 'gyandoot' at '$cmd_path' that takes priority over '$installed_to'."
warn "That binary is from a PREVIOUS installation and may be outdated."
warn ""
warn " ▶ To use the NEW version, run: $installed_to"
warn " ▶ Or remove the old one: sudo rm $cmd_path"
warn " ▶ Then 'gyandoot run' will pick up the new one."
warn "OLD binary at '$cmd_path' takes priority over '$installed_to'."
warn "Remove old: sudo rm $cmd_path || rm $cmd_path"
warn "Then 'gyandoot run' will use the new version."
else
ok "PATH resolves to the newly installed binary."
ok "'gyandoot' resolves to the newly installed binary."
fi
}
# ─── Post-Install Summary ────────────────────────────────────────────────
print_post_install() {
echo ""
ok "GyanDoot v2.0 installed successfully!"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo " Quick Start:"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo " gyandoot --help Show all commands"
echo " gyandoot init Create config"
echo " gyandoot setup Interactive setup wizard"
echo " gyandoot run Start interactive agent"
echo ""
echo " Browser Tools (anti-detection browsing):"
echo " gyandoot browser health Check camofox status"
echo " gyandoot browser search <query>"
echo " gyandoot browser browse <url>"
echo ""
echo " Service Management:"
echo " gyandoot service install Auto-start on boot"
echo " gyandoot service remove Remove system service"
echo " gyandoot service status Check service status"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "╔═══════════════════════════════════════════════════════════╗"
echo "║ Quick Start ║"
echo "╠═══════════════════════════════════════════════════════════╣"
echo "║ gyandoot --help Show all commands ║"
echo "║ gyandoot setup Interactive config wizard ║"
echo "║ gyandoot run Start interactive agent ║"
echo "╠═══════════════════════════════════════════════════════════╣"
echo "║ Browser Tools (anti-detection): ║"
echo "║ gyandoot browser health Check Camoufox status ║"
echo "║ gyandoot browser search Search the web ║"
echo "║ gyandoot browser browse Visit a website ║"
echo "╠═══════════════════════════════════════════════════════════╣"
echo "║ Service Management: ║"
echo "║ gyandoot service install Auto-start on boot ║"
echo "║ gyandoot service status Check service status ║"
echo "╚═══════════════════════════════════════════════════════════╝"
echo ""
if [ "$(uname -s)" = "Darwin" ]; then
echo " 🍎 macOS — Camoufox Gatekeeper (one-time):"
echo " xattr -dr com.apple.quarantine ~/Library/Caches/camoufox"
echo ""
fi
if detect_wsl; then
echo " ⚠️ WSL detected — Node.js must be installed INSIDE WSL."
echo " (The Windows-side Node.js is not accessible from WSL.)"
@@ -400,48 +396,65 @@ print_post_install() {
fi
}
# ─── Service Installation Prompt ─────────────────────────────────────────
prompt_service_install() {
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "────────────────────────────────────────────"
echo " Optional: Auto-start GyanDoot on Boot?"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "────────────────────────────────────────────"
echo " GyanDoot can run as a system service and"
echo " start automatically when your computer boots."
echo " This keeps the gateway server running in the background."
echo ""
echo " (You can also do this later with: gyandoot service install)"
echo " (You can also do this later: gyandoot service install)"
echo ""
read -r -p " Install system service? [y/N]: " response
case "$response" in
[yY]|[yY][eE][sS])
info "Installing GyanDoot system service..."
gyandoot service install 2>&1 || warn "Service install failed (run later: gyandoot service install)"
;;
*)
info "Skipping service install"
;;
esac
}
# ═══════════════════════════════════════════════════════════════════════════
# MAIN
# ═══════════════════════════════════════════════════════════════════════════
main() {
banner
local os arch
os=$(detect_os)
arch=$(detect_architecture)
info "Detected: $os / $arch"
if detect_wsl; then
info "WSL (Windows Subsystem for Linux) detected — will install Linux dependencies"
info "WSL (Windows Subsystem for Linux) detected"
fi
# ── Install dependencies ───────────────────────────────────────────
info "Phase 1: Checking prerequisites..."
install_rust_if_needed
install_node_if_needed
install_camofox_browser
build_release
# ── Install Camoufox browser ───────────────────────────────────────
info "Phase 2: Installing Camoufox browser..."
install_camoufox_browser
# ── Build from source ──────────────────────────────────────────────
info "Phase 3: Building GyanDoot..."
build_gyandoot
# ── Install binary ─────────────────────────────────────────────────
info "Phase 4: Installing binary..."
install_binary
# Optional: install GyanDoot system service (auto-start on boot)
# ── Optional: system service ───────────────────────────────────────
info "Phase 5: Service setup..."
prompt_service_install
case "$response" in
[yY]|[yY][eE][sS])
info "Installing GyanDoot system service..."
gyandoot service install 2>&1 || warn "Service install failed (run 'gyandoot service install' later)"
;;
*)
info "Skipping service install (use 'gyandoot service install' later)"
;;
esac
# ── Done ───────────────────────────────────────────────────────────
print_post_install
}

179
release/README.md Normal file
View File

@@ -0,0 +1,179 @@
# 🚀 GyanDoot v2.0 — AI Agent Platform
> **GyanDoot (ज्ञानदूत)** — *"Knowledge Messenger"* — your AI agent that searches, browses, and executes tasks autonomously.
---
## 📦 Quick Install
### 🐧 Linux / 🍎 macOS / WSL
```bash
curl -fsSL https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/install.sh | bash
```
### 🪟 Windows (PowerShell)
```powershell
iwr -useb https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/windows/install.ps1 | iex
```
### 🍺 macOS (Homebrew)
```bash
brew tap gnpl_admin/gyandoot
brew install gyandoot
```
---
## 🖥️ Platform Support
| OS | Architecture | Status |
|----|-------------|--------|
| **macOS** | arm64 (M1/M2/M3/M4), x86_64 | ✅ |
| **Linux** | x86_64, aarch64, i686 | ✅ |
| **WSL (Windows)** | x86_64, aarch64 | ✅ |
| **Windows (native)** | x86_64 | ✅ (Git Bash / MSYS2) |
---
## 📋 Prerequisites
| Dependency | Why | Install |
|-----------|-----|---------|
| **Rust** (cargo ≥ 1.70) | Build GyanDoot binary | `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` |
| **Node.js** (≥ 20) | Camoufox browser daemon | `nvm install 22` or [nodejs.org](https://nodejs.org) |
| **Linux deps** | Camoufox browser engine | See [Linux Dependencies](#linux-dependencies) section |
---
## 🔧 Manual Installation
### Step 1: Clone & Build
```bash
git clone https://git.gyannetra.in/gnpl_admin/gyandoot-release.git
cd gyandoot-release
./install.sh
```
### Step 2: Verify Installation
```bash
gyandoot --help
gyandoot setup # Interactive config wizard
gyandoot run # Start the agent
```
### Step 3: Browser Setup (Anti-Detection)
```bash
# Download Camoufox browser binary (~311MB)
npx --yes camoufox-js@0.11.0 fetch
# macOS only — remove Gatekeeper quarantine
xattr -dr com.apple.quarantine ~/Library/Caches/camoufox
# Verify
ls ~/Library/Caches/camoufox/version.json
```
---
## 🐧 Linux Dependencies
Camoufox (Playwright-based) needs system libraries. Install with:
```bash
# Debian / Ubuntu / WSL
sudo apt-get update && sudo apt-get install -y \
libgtk-3-0 libnss3 libnspr4 libatk1.0-0t64 \
libatk-bridge2.0-0t64 libcups2t64 libdrm2 \
libxkbcommon0 libxcomposite1 libxdamage1 \
libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 \
libcairo2 libasound2t64 libxcb-shm0
# Fedora / RHEL
sudo dnf install -y nss nspr atk at-spi2-atk cups-libs \
libdrm libXcomposite libXdamage libXrandr \
mesa-libgbm pango alsa-lib libxkbcommon
```
---
## 🪟 Windows (Native)
### Using Git Bash / MSYS2
```bash
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install Node.js
# Download from: https://nodejs.org (v20+)
# Build & install
git clone https://git.gyannetra.in/gnpl_admin/gyandoot-release.git
cd gyandoot-release
./install.sh
```
### Using PowerShell
```powershell
# Run as Administrator
Set-ExecutionPolicy Bypass -Scope Process -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/windows/install.ps1'))
```
---
## 🍺 macOS Homebrew
```bash
# Tap the repository
brew tap gnpl_admin/gyandoot
# Install
brew install gyandoot
# Upgrade
brew upgrade gyandoot
```
---
## 🚦 Getting Started
```bash
# 1. Configure your LLM provider
gyandoot setup
# 2. Start interactive session
gyandoot run
# 3. Browser-based tasks (with anti-detection)
gyandoot browser search "latest AI research papers"
gyandoot browser browse https://example.com
# 4. Service management (auto-start on boot)
gyandoot service install # optional
gyandoot service status
```
---
## 🏗️ Architecture
```
gyandoot run
├── Agent Loop (LLM-powered)
├── Browser Manager (Camoufox daemon)
│ ├── camoufox-js@0.11.0 → fetches browser binary
│ └── camoufox-browser@0.1.0 → daemon IPC (Unix socket)
├── Memory Palace (Persistent recall)
│ └── Vector-search memory at ~/.gyandoot/palace/
└── Tool Executor
├── web_search / web_browse (Camoufox browser)
├── file_ops, code_exec
└── subagent delegation
```
---
## 📜 License
MIT — Gyannetra Pvt Ltd

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,49 @@
# typed: true
# frozen_string_literal: true
# GyanDoot v2.0 — Homebrew Formula
# Usage:
# brew tap gnpl_admin/gyandoot
# brew install gyandoot
#
# For the latest version, run:
# brew upgrade gyandoot
class Gyandoot < Formula
desc "GyanDoot — AI Agent Platform: search, browse, and automate"
homepage "https://git.gyannetra.in/gnpl_admin/gyandoot-v2"
url "https://git.gyannetra.in/gnpl_admin/gyandoot-v2.git",
tag: "v2.0.0",
revision: "3b5b995fcec8f11bdb9d7e0fb24c50f20c2d9d38"
license "MIT"
head "https://git.gyannetra.in/gnpl_admin/gyandoot-v2.git", branch: "main"
depends_on "rust" => :build
depends_on "node" => :recommended
def install
system "cargo", "install", "--locked", "--root", prefix,
"--path", "."
# Generate shell completions
bash_completion.install "completions/gyandoot.bash" => "gyandoot"
zsh_completion.install "completions/gyandoot.zsh" => "_gyandoot"
fish_completion.install "completions/gyandoot.fish" => "gyandoot.fish"
end
def post_install
ohai "GyanDoot installed! Quick start:"
puts " gyandoot setup # Configure LLM provider"
puts " gyandoot run # Start interactive agent"
puts ""
ohai "Optional — Install Camoufox Browser for web search:"
puts " npx --yes camoufox-js@0.11.0 fetch"
puts ""
ohai "macOS Gatekeeper fix (required on Apple Silicon):"
puts " xattr -dr com.apple.quarantine ~/Library/Caches/camoufox"
end
test do
assert_match "GyanDoot", shell_output("#{bin}/gyandoot --version")
end
end

461
release/install.sh Normal file
View File

@@ -0,0 +1,461 @@
#!/usr/bin/env bash
# ═══════════════════════════════════════════════════════════════════════════
# GyanDoot v2.0 — Cross-Platform Universal Installer
# ═══════════════════════════════════════════════════════════════════════════
#
# Detects: macOS (arm64/x86_64), Linux (x86_64/aarch64/i686),
# WSL (Windows Subsystem for Linux), Windows (Git Bash/MSYS2)
#
# Usage:
# curl -fsSL https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/install.sh | bash
#
# Or locally:
# ./install.sh
# ═══════════════════════════════════════════════════════════════════════════
set -euo pipefail
# ─── Colors ──────────────────────────────────────────────────────────────
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
CYAN='\033[0;36m'
NC='\033[0m'
info() { echo -e "${BLUE}[INFO]${NC} $*"; }
ok() { echo -e "${GREEN}[OK]${NC} $*"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
err() { echo -e "${RED}[ERR]${NC} $*" >&2; exit 1; }
banner() {
echo -e "${CYAN}"
echo ' ____ _ _ _ '
echo ' / ___|_ _ __ _ __| | | |_ ___ __| | ___ '
echo '| | _| | | |/ _` |/ _` | | __/ _ \ / _` |/ _ \ '
echo '| |_| | |_| | (_| | (_| | | |_ (_) | (_| | (_) | '
echo ' \____|\__, |\__,_|\__,_| \__\___/ \__,_|\___/ '
echo ' |___/ '
echo -e "${NC}"
echo -e "${GREEN} GyanDoot v2.0 — Knowledge Messenger${NC}"
echo " Cross-Platform Universal Installer"
echo ""
}
# ─── Platform Detection ──────────────────────────────────────────────────
detect_architecture() {
local arch
arch="$(uname -m)"
case "$arch" in
x86_64|amd64) echo "x86_64" ;;
aarch64|arm64) echo "aarch64" ;;
i686|i386) echo "i686" ;;
*) err "Unsupported architecture: $arch" ;;
esac
}
detect_os() {
local os
os="$(uname -s)"
case "$os" in
Linux) echo "linux" ;;
Darwin) echo "darwin" ;;
CYGWIN*|MINGW*|MSYS*) echo "windows" ;;
*) err "Unsupported OS: $os" ;;
esac
}
detect_wsl() {
if [ -f /proc/version ] && grep -qiE 'microsoft|wsl' /proc/version 2>/dev/null; then
return 0
fi
return 1
}
get_shell_profile() {
case "$SHELL" in
*/zsh) echo "$HOME/.zshrc" ;;
*/bash) echo "$HOME/.bashrc" ;;
*/fish) echo "$HOME/.config/fish/config.fish" ;;
*) echo "$HOME/.profile" ;;
esac
}
# ─── Dependency Installers ───────────────────────────────────────────────
install_rust_if_needed() {
if ! command -v cargo &>/dev/null; then
info "Rust toolchain not found. Installing..."
if [ "$(uname -s)" = "Darwin" ] || [ "$(uname -s)" = "Linux" ]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
elif [[ "$(uname -s)" =~ ^(CYGWIN|MINGW|MSYS) ]]; then
# Windows: download rustup-init.exe
powershell -Command "& {Invoke-WebRequest -Uri https://win.rustup.rs -OutFile '%TEMP%\rustup-init.exe'; Start-Process '%TEMP%\rustup-init.exe' -Wait -ArgumentList '-y'}"
export PATH="$PATH:$HOME/.cargo/bin"
else
err "No Rust install method for this platform"
fi
ok "Rust installed ($(cargo --version))"
else
ok "Rust already installed ($(cargo --version))"
fi
}
install_node_if_needed() {
if ! command -v node &>/dev/null; then
info "Node.js not found. Installing..."
if command -v nvm &>/dev/null || [ -s "$HOME/.nvm/nvm.sh" ]; then
[ -s "$HOME/.nvm/nvm.sh" ] && \. "$HOME/.nvm/nvm.sh"
nvm install 22 2>/dev/null || nvm install node
elif [ "$(uname -s)" = "Darwin" ]; then
if command -v brew &>/dev/null; then
brew install node
else
warn "Install Node.js manually: https://nodejs.org"
fi
elif [[ "$(uname -s)" =~ ^(CYGWIN|MINGW|MSYS) ]]; then
warn "Install Node.js from: https://nodejs.org"
else
# Linux: use nvm
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
[ -s "$HOME/.nvm/nvm.sh" ] && \. "$HOME/.nvm/nvm.sh"
nvm install 22
fi
ok "Node.js installed ($(node --version))"
else
ok "Node.js already installed ($(node --version))"
fi
# Ensure npx is available
if ! command -v npx &>/dev/null; then
warn "npx not found. Installing corepack..."
npm install -g npx 2>/dev/null || true
fi
}
# ─── Linux System Dependencies ───────────────────────────────────────────
# Camoufox (Playwright-based) needs these on Linux/WSL
CAMOUFOX_LINUX_DEPS=(
libgtk-3-0 libnss3 libnspr4 libatk1.0-0t64
libatk-bridge2.0-0t64 libcups2t64 libdrm2
libxkbcommon0 libxcomposite1 libxdamage1
libxfixes3 libxrandr2 libgbm1 libpango-1.0-0
libcairo2 libasound2t64 libxcb-shm0
libx11-xcb1 libx11-6 libxcb1 libxext6
libxcursor1 libxi6 libfreetype6 libfontconfig1
libxshmfence1 libxrender1 libdbus-1-3
)
install_linux_deps() {
if [ "$(uname -s)" != "Linux" ]; then
return 0
fi
if detect_wsl; then
info "WSL detected. Installing Linux system dependencies..."
fi
local missing=()
if command -v dpkg-query &>/dev/null; then
for pkg in "${CAMOUFOX_LINUX_DEPS[@]}"; do
if ! dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -q "install ok installed"; then
local alt_pkg="${pkg%t64}"
if [ "$alt_pkg" != "$pkg" ] && dpkg-query -W -f='${Status}' "$alt_pkg" 2>/dev/null | grep -q "install ok installed"; then
continue
fi
missing+=("$pkg")
fi
done
else
missing=("${CAMOUFOX_LINUX_DEPS[@]}")
fi
if [ ${#missing[@]} -eq 0 ]; then
info "All Linux system dependencies already installed"
return 0
fi
info "Installing ${#missing[@]} missing Linux system dependencies..."
if command -v apt-get &>/dev/null; then
if command -v sudo &>/dev/null; then
sudo apt-get update -qq 2>/dev/null || true
sudo apt-get install -y -qq "${missing[@]}" 2>/dev/null || {
warn "Some packages failed. Retrying with fix..."
sudo apt-get --fix-broken install -y -qq 2>/dev/null || true
local fallback=()
for pkg in "${missing[@]}"; do
local alt="${pkg%t64}"
[ "$alt" != "$pkg" ] && fallback+=("$alt")
done
[ ${#fallback[@]} -gt 0 ] && sudo apt-get install -y -qq "${fallback[@]}" 2>/dev/null || true
}
else
apt-get update -qq 2>/dev/null || true
apt-get install -y -qq "${missing[@]}" 2>/dev/null || true
fi
ok "Linux system dependencies installed"
elif command -v dnf &>/dev/null; then
sudo dnf install -y nss nspr atk at-spi2-atk cups-libs \
libdrm libXcomposite libXdamage libXrandr mesa-libgbm \
pango alsa-lib libxkbcommon libxcb libX11-xcb libX11 \
libXext libXcursor libXfixes libXi gtk3 cairo-gobject 2>/dev/null || true
ok "Linux system dependencies installed"
elif command -v yum &>/dev/null; then
sudo yum install -y nss nspr atk at-spi2-atk cups-libs \
libdrm libXcomposite libXdamage libXrandr mesa-libgbm \
pango alsa-lib libxkbcommon 2>/dev/null || true
ok "Linux system dependencies installed"
else
warn "No supported package manager. Install deps manually."
warn "Required: ${CAMOUFOX_LINUX_DEPS[*]}"
fi
}
# ─── Camoufox Browser Installer ──────────────────────────────────────────
install_camoufox_browser() {
info "Installing Camoufox browser (anti-detection engine)..."
install_linux_deps
if ! command -v npx &>/dev/null && ! command -v npm &>/dev/null; then
warn "Node.js not found. Skipping Camoufox install."
warn "Install Node.js and re-run: npm install -g camoufox-browser@0.1.0"
return 0
fi
# Step 1: Install npm package
info "Installing npm package (camoufox-browser@0.1.0)..."
npm install -g camoufox-browser@0.1.0 2>&1 | tail -3 || {
warn "npm install failed. Try manually: npm install -g camoufox-browser@0.1.0"
return 0
}
# Step 2: Download browser binary
info "Downloading Camoufox browser binary (~311MB)..."
npx --yes camoufox-js@0.11.0 fetch 2>&1 || {
warn "Download failed. Try manually: npx --yes camoufox-js@0.11.0 fetch"
return 0
}
# Step 3: macOS — remove Gatekeeper quarantine
if [ "$(uname -s)" = "Darwin" ]; then
if command -v xattr &>/dev/null; then
info "Removing macOS quarantine from Camoufox..."
xattr -dr com.apple.quarantine ~/Library/Caches/camoufox 2>/dev/null || true
fi
fi
# Step 4: Verify
local cache_dir
if [ "$(uname -s)" = "Darwin" ]; then
cache_dir="$HOME/Library/Caches/camoufox"
else
cache_dir="$HOME/.cache/camoufox"
fi
if [ -f "$cache_dir/version.json" ]; then
ok "Camoufox browser installed ($(du -sh "$cache_dir" 2>/dev/null | cut -f1))"
else
warn "Browser binary not found. Run manually: npx --yes camoufox-js@0.11.0 fetch"
fi
}
# ─── Build GyanDoot ──────────────────────────────────────────────────────
build_gyandoot() {
local root_dir
root_dir="$(cd "$(dirname "$0")" 2>/dev/null && pwd || echo "$PWD")"
# Find workspace root (where Cargo.toml with [workspace] is)
cd "$root_dir"
while [ "$PWD" != "/" ]; do
if [ -f "Cargo.toml" ] && grep -q '\[workspace\]' Cargo.toml 2>/dev/null; then
info "Found workspace root at $PWD"
break
fi
cd ..
done
if [ "$PWD" = "/" ]; then
err "Could not find Cargo workspace. Make sure you're in the gyandoot-v2 directory."
fi
info "Building GyanDoot v2.0 (release mode)..."
cargo build --release 2>&1 | tail -5
ok "Build complete ($(du -sh target/release/gyandoot* 2>/dev/null | cut -f1))"
}
# ─── Install Binary ──────────────────────────────────────────────────────
install_binary() {
local target_dir="$PWD/target/release"
local bin_name="gyandoot"
if [ -f "$target_dir/gyandoot.exe" ]; then
bin_name="gyandoot.exe"
fi
if [ ! -f "$target_dir/$bin_name" ]; then
err "Binary not found at $target_dir/$bin_name"
fi
local os
os="$(uname -s)"
local install_dir=""
local installed_to=""
case "$os" in
Darwin|Linux)
# Priority: ~/.cargo/bin/ → /usr/local/bin → ~/.local/bin/
if [ -d "$HOME/.cargo/bin" ] && echo "$PATH" | grep -q "$HOME/.cargo/bin"; then
install_dir="$HOME/.cargo/bin"
elif [ -d "/usr/local/bin" ]; then
if [ -w "/usr/local/bin" ]; then
install_dir="/usr/local/bin"
else
info "Need sudo to install to /usr/local/bin"
sudo cp "$target_dir/$bin_name" "/usr/local/bin/$bin_name"
sudo chmod +x "/usr/local/bin/$bin_name"
install_dir="/usr/local/bin"
fi
elif [ -d "$HOME/.local/bin" ] && echo "$PATH" | grep -q "$HOME/.local/bin"; then
install_dir="$HOME/.local/bin"
else
mkdir -p "$HOME/.cargo/bin"
install_dir="$HOME/.cargo/bin"
if ! echo "$PATH" | grep -q "$HOME/.cargo/bin"; then
warn "Add ~/.cargo/bin to your PATH in $(get_shell_profile):"
echo " export PATH=\"\$HOME/.cargo/bin:\$PATH\""
fi
fi
if [ -n "$install_dir" ]; then
cp "$target_dir/$bin_name" "$install_dir/$bin_name"
chmod +x "$install_dir/$bin_name"
installed_to="$install_dir/$bin_name"
fi
;;
CYGWIN*|MINGW*|MSYS*)
install_dir="/usr/local/bin"
cp "$target_dir/$bin_name" "$install_dir/$bin_name"
chmod +x "$install_dir/$bin_name"
installed_to="$install_dir/$bin_name"
;;
*)
err "Unsupported OS: $os"
;;
esac
ok "Installed to $installed_to"
# ── Verify PATH resolution ──────────────────────────────────────────
local cmd_path
cmd_path="$(command -v gyandoot 2>/dev/null || true)"
if [ -z "$cmd_path" ]; then
warn "'gyandoot' not found in PATH. Use: $installed_to"
elif [ "$cmd_path" != "$installed_to" ]; then
warn "OLD binary at '$cmd_path' takes priority over '$installed_to'."
warn "Remove old: sudo rm $cmd_path || rm $cmd_path"
warn "Then 'gyandoot run' will use the new version."
else
ok "'gyandoot' resolves to the newly installed binary."
fi
}
# ─── Post-Install Summary ────────────────────────────────────────────────
print_post_install() {
echo ""
ok "GyanDoot v2.0 installed successfully!"
echo ""
echo "╔═══════════════════════════════════════════════════════════╗"
echo "║ Quick Start ║"
echo "╠═══════════════════════════════════════════════════════════╣"
echo "║ gyandoot --help Show all commands ║"
echo "║ gyandoot setup Interactive config wizard ║"
echo "║ gyandoot run Start interactive agent ║"
echo "╠═══════════════════════════════════════════════════════════╣"
echo "║ Browser Tools (anti-detection): ║"
echo "║ gyandoot browser health Check Camoufox status ║"
echo "║ gyandoot browser search Search the web ║"
echo "║ gyandoot browser browse Visit a website ║"
echo "╠═══════════════════════════════════════════════════════════╣"
echo "║ Service Management: ║"
echo "║ gyandoot service install Auto-start on boot ║"
echo "║ gyandoot service status Check service status ║"
echo "╚═══════════════════════════════════════════════════════════╝"
echo ""
if [ "$(uname -s)" = "Darwin" ]; then
echo " 🍎 macOS — Camoufox Gatekeeper (one-time):"
echo " xattr -dr com.apple.quarantine ~/Library/Caches/camoufox"
echo ""
fi
if detect_wsl; then
echo " ⚠️ WSL detected — Node.js must be installed INSIDE WSL."
echo " (The Windows-side Node.js is not accessible from WSL.)"
echo ""
fi
}
# ─── Service Installation Prompt ─────────────────────────────────────────
prompt_service_install() {
echo "────────────────────────────────────────────"
echo " Optional: Auto-start GyanDoot on Boot?"
echo "────────────────────────────────────────────"
echo " GyanDoot can run as a system service and"
echo " start automatically when your computer boots."
echo ""
echo " (You can also do this later: gyandoot service install)"
echo ""
read -r -p " Install system service? [y/N]: " response
case "$response" in
[yY]|[yY][eE][sS])
info "Installing GyanDoot system service..."
gyandoot service install 2>&1 || warn "Service install failed (run later: gyandoot service install)"
;;
*)
info "Skipping service install"
;;
esac
}
# ═══════════════════════════════════════════════════════════════════════════
# MAIN
# ═══════════════════════════════════════════════════════════════════════════
main() {
banner
local os arch
os=$(detect_os)
arch=$(detect_architecture)
info "Detected: $os / $arch"
if detect_wsl; then
info "WSL (Windows Subsystem for Linux) detected"
fi
# ── Install dependencies ───────────────────────────────────────────
info "Phase 1: Checking prerequisites..."
install_rust_if_needed
install_node_if_needed
# ── Install Camoufox browser ───────────────────────────────────────
info "Phase 2: Installing Camoufox browser..."
install_camoufox_browser
# ── Build from source ──────────────────────────────────────────────
info "Phase 3: Building GyanDoot..."
build_gyandoot
# ── Install binary ─────────────────────────────────────────────────
info "Phase 4: Installing binary..."
install_binary
# ── Optional: system service ───────────────────────────────────────
info "Phase 5: Service setup..."
prompt_service_install
# ── Done ───────────────────────────────────────────────────────────
print_post_install
}
main "$@"

121
release/windows/install.bat Normal file
View File

@@ -0,0 +1,121 @@
@echo off
REM ═══════════════════════════════════════════════════════════════════════════
REM GyanDoot v2.0 — Windows Installer (Git Bash / MSYS2)
REM ═══════════════════════════════════════════════════════════════════════════
REM This script installs GyanDoot on Windows via Git Bash or MSYS2.
REM For PowerShell, use: install.ps1
REM ═══════════════════════════════════════════════════════════════════════════
setlocal enabledelayedexpansion
echo.
echo ╔═══════════════════════════════════════╗
echo ║ GyanDoot v2.0 — Windows Installer ║
echo ╚═══════════════════════════════════════╝
echo.
REM ── Check if running in Git Bash / MSYS2 ──────────────────────────────
if not defined MSYSTEM (
echo [WARN] This script requires Git Bash or MSYS2.
echo For PowerShell, use: install.ps1
echo.
echo Or download from: https://git.gyannetra.in/gnpl_admin/gyandoot-release
pause
exit /b 1
)
REM ── Check prerequisites ───────────────────────────────────────────────
echo [CHECK] Rust...
where cargo >nul 2>&1
if errorlevel 1 (
echo [INFO] Rust not found. Installing Rust...
powershell -Command "& {Invoke-WebRequest -Uri https://win.rustup.rs -OutFile '%TEMP%\rustup-init.exe'; Start-Process '%TEMP%\rustup-init.exe' -Wait -ArgumentList '-y'}"
call "%USERPROFILE%\.cargo\env"
echo [OK] Rust installed
) else (
for /f "tokens=*" %%i in ('cargo --version') do echo [OK] %%i
)
echo [CHECK] Node.js...
where node >nul 2>&1
if errorlevel 1 (
echo [WARN] Node.js is required for browser features.
echo Download from: https://nodejs.org (v20+)
echo Or: winget install OpenJS.NodeJS
) else (
for /f "tokens=*" %%i in ('node --version') do echo [OK] Node.js %%i
)
REM ── Build ──────────────────────────────────────────────────────────────
echo.
echo [BUILD] Compiling GyanDoot (this may take a few minutes)...
cd /d "%~dp0.." 2>nul || (
echo [ERR] Could not find project root.
echo Make sure you're running this from the release directory.
pause
exit /b 1
)
cargo build --release
if errorlevel 1 (
echo [ERR] Build failed. Check the error above.
pause
exit /b 1
)
echo [OK] Build complete
REM ── Install binary ────────────────────────────────────────────────────
set "INSTALL_DIR=%USERPROFILE%\.cargo\bin"
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"
copy /Y "target\release\gyandoot.exe" "%INSTALL_DIR%\gyandoot.exe" >nul
echo [OK] Installed to %INSTALL_DIR%\gyandoot.exe
REM ── Check PATH ────────────────────────────────────────────────────────
echo !PATH! | findstr /C:"%USERPROFILE%\.cargo\bin" >nul
if errorlevel 1 (
echo [WARN] %USERPROFILE%\.cargo\bin is not in your PATH.
echo Add it manually to your PATH environment variable.
echo Or run: setx PATH "%%USERPROFILE%%\.cargo\bin;%%PATH%%"
echo.
echo Then restart your terminal.
)
REM ── Verify ────────────────────────────────────────────────────────────
echo.
echo [VERIFY] Checking installation...
"%INSTALL_DIR%\gyandoot.exe" --help >nul 2>&1
if errorlevel 1 (
echo [WARN] Installation verification failed.
) else (
echo [OK] GyanDoot installed successfully!
)
REM ── Optional: Camoufox browser ────────────────────────────────────────
echo.
echo ────────────────────────────────────────────
echo Optional: Install Camoufox Browser?
echo Required for: web_search, web_browse tools
echo ────────────────────────────────────────────
set /p INSTALL_CAMOUFOX="Install Camoufox browser? [y/N]: "
if /i "!INSTALL_CAMOUFOX!"=="y" (
echo [INFO] Installing camoufox-browser npm package...
npm install -g camoufox-browser@0.1.0
echo [INFO] Downloading browser binary (~311MB)...
npx --yes camoufox-js@0.11.0 fetch
echo [OK] Camoufox browser installed
)
REM ── Done ──────────────────────────────────────────────────────────────
echo.
echo ╔═══════════════════════════════════════╗
echo ║ GyanDoot v2.0 installed! ║
echo ╚═══════════════════════════════════════╝
echo.
echo Quick start:
echo gyandoot --help
echo gyandoot setup
echo gyandoot run
echo.
pause

153
release/windows/install.ps1 Normal file
View File

@@ -0,0 +1,153 @@
<#
.SYNOPSIS
GyanDoot v2.0 — Windows Installer (PowerShell)
.DESCRIPTION
Installs GyanDoot AI Agent on Windows 10/11 via PowerShell.
Requires: Rust (auto-installed), Git Bash recommended.
#>
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
Write-Host ""
Write-Host "╔═══════════════════════════════════════╗" -ForegroundColor Cyan
Write-Host "║ GyanDoot v2.0 — Windows Installer ║" -ForegroundColor Cyan
Write-Host "╚═══════════════════════════════════════╝" -ForegroundColor Cyan
Write-Host ""
# ── Helper functions ─────────────────────────────────────────────────────
function Write-OK($msg) { Write-Host " [OK] $msg" -ForegroundColor Green }
function Write-Info($msg) { Write-Host " [..] $msg" -ForegroundColor Cyan }
function Write-Warn($msg) { Write-Host " [!] $msg" -ForegroundColor Yellow }
function Write-Err($msg) { Write-Host " [ERR] $msg" -ForegroundColor Red }
# ── Detect OS Architecture ───────────────────────────────────────────────
$arch = (Get-WmiObject Win32_Processor).Architecture
$archName = switch ($arch) {
0 { "x86" }
9 { "x64" }
12 { "arm64" }
default { "unknown" }
}
Write-Info "Detected: Windows / $archName"
# ── Check if running in PowerShell only ──────────────────────────────────
Write-Warn "For best results, use Git Bash and run: install.bat"
Write-Warn "PowerShell support is limited on Windows."
# ── Check / Install Rust ─────────────────────────────────────────────────
Write-Info "Checking Rust..."
$haveRust = $false
try {
$rustVer = cargo --version 2>$null
if ($rustVer) {
Write-OK "Rust already installed ($rustVer)"
$haveRust = $true
}
} catch { }
if (-not $haveRust) {
Write-Info "Rust not found. Installing Rust..."
$rustupUrl = "https://win.rustup.rs"
$rustupPath = "$env:TEMP\rustup-init.exe"
try {
Invoke-WebRequest -Uri $rustupUrl -OutFile $rustupPath -UseBasicParsing
Start-Process -FilePath $rustupPath -ArgumentList "-y" -Wait -NoNewWindow
# Reload PATH
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
Write-OK "Rust installed"
} catch {
Write-Err "Failed to install Rust: $_"
Write-Warn "Download manually from: https://rustup.rs"
exit 1
}
}
# ── Check Node.js ────────────────────────────────────────────────────────
Write-Info "Checking Node.js..."
try {
$nodeVer = node --version 2>$null
if ($nodeVer) {
Write-OK "Node.js $nodeVer"
} else {
throw "not found"
}
} catch {
Write-Warn "Node.js not found (required for browser features)"
Write-Warn "Download from: https://nodejs.org (v20+)"
Write-Warn "Or run: winget install OpenJS.NodeJS"
}
# ── Determine script directory ──────────────────────────────────────────
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
$projectRoot = Resolve-Path "$scriptDir/.."
# ── Build ────────────────────────────────────────────────────────────────
Write-Info "Building GyanDoot release (this may take a few minutes)..."
Set-Location $projectRoot
try {
$buildOutput = cargo build --release 2>&1
if ($LASTEXITCODE -ne 0) {
throw $buildOutput
}
Write-OK "Build complete"
} catch {
Write-Err "Build failed: $_"
exit 1
}
# ── Install binary ──────────────────────────────────────────────────────
$installDir = "$env:USERPROFILE\.cargo\bin"
if (-not (Test-Path $installDir)) {
New-Item -ItemType Directory -Path $installDir -Force | Out-Null
}
Copy-Item -Path "$projectRoot\target\release\gyandoot.exe" -Destination "$installDir\gyandoot.exe" -Force
Write-OK "Installed to $installDir\gyandoot.exe"
# ── Check PATH ──────────────────────────────────────────────────────────
$paths = $env:Path -split ';'
if ($paths -notcontains $installDir) {
Write-Warn "$installDir is not in your PATH!"
Write-Warn "Run this to add it permanently:"
Write-Host ' [Environment]::SetEnvironmentVariable("Path", "$env:USERPROFILE\.cargo\bin;$env:Path", "User")' -ForegroundColor Gray
}
# ── Verify ───────────────────────────────────────────────────────────────
try {
$helpOutput = & "$installDir\gyandoot.exe" --help 2>&1
Write-OK "GyanDoot installed successfully!" -ForegroundColor Green
} catch {
Write-Warn "Verification failed: $_"
}
# ── Optional: Camoufox ───────────────────────────────────────────────────
Write-Host ""
Write-Host "────────────────────────────────────────────" -ForegroundColor Yellow
Write-Host " Optional: Install Camoufox Browser?" -ForegroundColor Yellow
Write-Host " Required for: web_search, web_browse tools" -ForegroundColor Yellow
Write-Host "────────────────────────────────────────────" -ForegroundColor Yellow
$installCamoufox = Read-Host "Install Camoufox? [y/N]"
if ($installCamoufox -eq "y") {
Write-Info "Installing camoufox-browser npm package..."
npm install -g camoufox-browser@0.1.0 2>$null
Write-Info "Downloading Camoufox browser binary (~311MB)..."
npx --yes camoufox-js@0.11.0 fetch 2>$null
Write-OK "Camoufox browser installed"
}
# ── Done ─────────────────────────────────────────────────────────────────
Write-Host ""
Write-Host "╔═══════════════════════════════════════╗" -ForegroundColor Green
Write-Host "║ GyanDoot v2.0 installed! ║" -ForegroundColor Green
Write-Host "╚═══════════════════════════════════════╝" -ForegroundColor Green
Write-Host ""
Write-Host " Quick start:" -ForegroundColor Gray
Write-Host " gyandoot --help" -ForegroundColor White
Write-Host " gyandoot setup" -ForegroundColor White
Write-Host " gyandoot run" -ForegroundColor White
Write-Host ""
Read-Host "Press Enter to exit"