commit c78a8e82b5b6c07d68bab3227d1bdf15aed9ff26 Author: Tara Menon Date: Sat Jun 13 18:33:38 2026 +0530 Initial release: GyanDoot v2.0.0 Cross-platform AI Agent Platform - Sources: https://git.gyannetra.in/gnpl_admin/gyandoot-v2 - Installer: curl -fsSL https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/install.sh | bash Platforms: - macOS (arm64/x86_64) via Homebrew or install.sh - Linux (x86_64/aarch64/i686) via install.sh - Windows (x86_64) via Git Bash/MSYS2 or PowerShell - WSL via install.sh Includes: - install.sh (cross-platform universal installer) - Windows: install.bat + install.ps1 - macOS: Homebrew formula (homebrew/gyandoot.rb) - Linux: prebuilt binary + install guide - README.md with full documentation diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..416e50a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +gyandoot-release/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..aa3801e --- /dev/null +++ b/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/install.sh b/install.sh new file mode 100644 index 0000000..9b3e893 --- /dev/null +++ b/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/linux/gyandoot b/linux/gyandoot new file mode 100755 index 0000000..84195f7 Binary files /dev/null and b/linux/gyandoot differ diff --git a/macos/gyandoot.rb b/macos/gyandoot.rb new file mode 100644 index 0000000..2ab1d7b --- /dev/null +++ b/macos/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/windows/install.bat b/windows/install.bat new file mode 100644 index 0000000..0683d82 --- /dev/null +++ b/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/windows/install.ps1 b/windows/install.ps1 new file mode 100644 index 0000000..8b8d6b4 --- /dev/null +++ b/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