diff --git a/README.md b/README.md index 16790b9..aa3801e 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file +## ๐ŸชŸ 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 \ No newline at end of file diff --git a/install.sh b/install.sh index 968d482..9b3e893 100755 --- a/install.sh +++ b/install.sh @@ -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 " - echo " gyandoot browser browse " - 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 } diff --git a/release/README.md b/release/README.md new file mode 100644 index 0000000..aa3801e --- /dev/null +++ b/release/README.md @@ -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 \ No newline at end of file diff --git a/release/archives/gyandoot-v2.0.0-linux-x86_64.tar.gz b/release/archives/gyandoot-v2.0.0-linux-x86_64.tar.gz new file mode 100644 index 0000000..fb93162 Binary files /dev/null and b/release/archives/gyandoot-v2.0.0-linux-x86_64.tar.gz differ diff --git a/release/archives/gyandoot-v2.0.0-windows-x86_64.zip b/release/archives/gyandoot-v2.0.0-windows-x86_64.zip new file mode 100644 index 0000000..e9649e5 Binary files /dev/null and b/release/archives/gyandoot-v2.0.0-windows-x86_64.zip differ diff --git a/release/homebrew/gyandoot.rb b/release/homebrew/gyandoot.rb new file mode 100644 index 0000000..2ab1d7b --- /dev/null +++ b/release/homebrew/gyandoot.rb @@ -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 \ No newline at end of file diff --git a/release/install.sh b/release/install.sh new file mode 100644 index 0000000..9b3e893 --- /dev/null +++ b/release/install.sh @@ -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 "$@" \ No newline at end of file diff --git a/release/windows/install.bat b/release/windows/install.bat new file mode 100644 index 0000000..0683d82 --- /dev/null +++ b/release/windows/install.bat @@ -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 \ No newline at end of file diff --git a/release/windows/install.ps1 b/release/windows/install.ps1 new file mode 100644 index 0000000..8b8d6b4 --- /dev/null +++ b/release/windows/install.ps1 @@ -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" \ No newline at end of file