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
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
gyandoot-release/
|
||||||
179
README.md
Normal file
179
README.md
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
# 🚀 GyanDoot v2.0 — AI Agent Platform
|
||||||
|
|
||||||
|
> **GyanDoot (ज्ञानदूत)** — *"Knowledge Messenger"* — your AI agent that searches, browses, and executes tasks autonomously.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📦 Quick Install
|
||||||
|
|
||||||
|
### 🐧 Linux / 🍎 macOS / WSL
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/install.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
### 🪟 Windows (PowerShell)
|
||||||
|
```powershell
|
||||||
|
iwr -useb https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/windows/install.ps1 | iex
|
||||||
|
```
|
||||||
|
|
||||||
|
### 🍺 macOS (Homebrew)
|
||||||
|
```bash
|
||||||
|
brew tap gnpl_admin/gyandoot
|
||||||
|
brew install gyandoot
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🖥️ Platform Support
|
||||||
|
|
||||||
|
| OS | Architecture | Status |
|
||||||
|
|----|-------------|--------|
|
||||||
|
| **macOS** | arm64 (M1/M2/M3/M4), x86_64 | ✅ |
|
||||||
|
| **Linux** | x86_64, aarch64, i686 | ✅ |
|
||||||
|
| **WSL (Windows)** | x86_64, aarch64 | ✅ |
|
||||||
|
| **Windows (native)** | x86_64 | ✅ (Git Bash / MSYS2) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Prerequisites
|
||||||
|
|
||||||
|
| Dependency | Why | Install |
|
||||||
|
|-----------|-----|---------|
|
||||||
|
| **Rust** (cargo ≥ 1.70) | Build GyanDoot binary | `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` |
|
||||||
|
| **Node.js** (≥ 20) | Camoufox browser daemon | `nvm install 22` or [nodejs.org](https://nodejs.org) |
|
||||||
|
| **Linux deps** | Camoufox browser engine | See [Linux Dependencies](#linux-dependencies) section |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔧 Manual Installation
|
||||||
|
|
||||||
|
### Step 1: Clone & Build
|
||||||
|
```bash
|
||||||
|
git clone https://git.gyannetra.in/gnpl_admin/gyandoot-release.git
|
||||||
|
cd gyandoot-release
|
||||||
|
./install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 2: Verify Installation
|
||||||
|
```bash
|
||||||
|
gyandoot --help
|
||||||
|
gyandoot setup # Interactive config wizard
|
||||||
|
gyandoot run # Start the agent
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 3: Browser Setup (Anti-Detection)
|
||||||
|
```bash
|
||||||
|
# Download Camoufox browser binary (~311MB)
|
||||||
|
npx --yes camoufox-js@0.11.0 fetch
|
||||||
|
|
||||||
|
# macOS only — remove Gatekeeper quarantine
|
||||||
|
xattr -dr com.apple.quarantine ~/Library/Caches/camoufox
|
||||||
|
|
||||||
|
# Verify
|
||||||
|
ls ~/Library/Caches/camoufox/version.json
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🐧 Linux Dependencies
|
||||||
|
|
||||||
|
Camoufox (Playwright-based) needs system libraries. Install with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Debian / Ubuntu / WSL
|
||||||
|
sudo apt-get update && sudo apt-get install -y \
|
||||||
|
libgtk-3-0 libnss3 libnspr4 libatk1.0-0t64 \
|
||||||
|
libatk-bridge2.0-0t64 libcups2t64 libdrm2 \
|
||||||
|
libxkbcommon0 libxcomposite1 libxdamage1 \
|
||||||
|
libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 \
|
||||||
|
libcairo2 libasound2t64 libxcb-shm0
|
||||||
|
|
||||||
|
# Fedora / RHEL
|
||||||
|
sudo dnf install -y nss nspr atk at-spi2-atk cups-libs \
|
||||||
|
libdrm libXcomposite libXdamage libXrandr \
|
||||||
|
mesa-libgbm pango alsa-lib libxkbcommon
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🪟 Windows (Native)
|
||||||
|
|
||||||
|
### Using Git Bash / MSYS2
|
||||||
|
```bash
|
||||||
|
# Install Rust
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
|
|
||||||
|
# Install Node.js
|
||||||
|
# Download from: https://nodejs.org (v20+)
|
||||||
|
|
||||||
|
# Build & install
|
||||||
|
git clone https://git.gyannetra.in/gnpl_admin/gyandoot-release.git
|
||||||
|
cd gyandoot-release
|
||||||
|
./install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using PowerShell
|
||||||
|
```powershell
|
||||||
|
# Run as Administrator
|
||||||
|
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||||
|
iex ((New-Object System.Net.WebClient).DownloadString('https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/windows/install.ps1'))
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🍺 macOS Homebrew
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Tap the repository
|
||||||
|
brew tap gnpl_admin/gyandoot
|
||||||
|
|
||||||
|
# Install
|
||||||
|
brew install gyandoot
|
||||||
|
|
||||||
|
# Upgrade
|
||||||
|
brew upgrade gyandoot
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚦 Getting Started
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. Configure your LLM provider
|
||||||
|
gyandoot setup
|
||||||
|
|
||||||
|
# 2. Start interactive session
|
||||||
|
gyandoot run
|
||||||
|
|
||||||
|
# 3. Browser-based tasks (with anti-detection)
|
||||||
|
gyandoot browser search "latest AI research papers"
|
||||||
|
gyandoot browser browse https://example.com
|
||||||
|
|
||||||
|
# 4. Service management (auto-start on boot)
|
||||||
|
gyandoot service install # optional
|
||||||
|
gyandoot service status
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🏗️ Architecture
|
||||||
|
|
||||||
|
```
|
||||||
|
gyandoot run
|
||||||
|
├── Agent Loop (LLM-powered)
|
||||||
|
├── Browser Manager (Camoufox daemon)
|
||||||
|
│ ├── camoufox-js@0.11.0 → fetches browser binary
|
||||||
|
│ └── camoufox-browser@0.1.0 → daemon IPC (Unix socket)
|
||||||
|
├── Memory Palace (Persistent recall)
|
||||||
|
│ └── Vector-search memory at ~/.gyandoot/palace/
|
||||||
|
└── Tool Executor
|
||||||
|
├── web_search / web_browse (Camoufox browser)
|
||||||
|
├── file_ops, code_exec
|
||||||
|
└── subagent delegation
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📜 License
|
||||||
|
|
||||||
|
MIT — Gyannetra Pvt Ltd
|
||||||
461
install.sh
Normal file
461
install.sh
Normal file
@@ -0,0 +1,461 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# ═══════════════════════════════════════════════════════════════════════════
|
||||||
|
# GyanDoot v2.0 — Cross-Platform Universal Installer
|
||||||
|
# ═══════════════════════════════════════════════════════════════════════════
|
||||||
|
#
|
||||||
|
# Detects: macOS (arm64/x86_64), Linux (x86_64/aarch64/i686),
|
||||||
|
# WSL (Windows Subsystem for Linux), Windows (Git Bash/MSYS2)
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# curl -fsSL https://git.gyannetra.in/gnpl_admin/gyandoot-release/raw/main/install.sh | bash
|
||||||
|
#
|
||||||
|
# Or locally:
|
||||||
|
# ./install.sh
|
||||||
|
# ═══════════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# ─── Colors ──────────────────────────────────────────────────────────────
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
BLUE='\033[0;34m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
RED='\033[0;31m'
|
||||||
|
CYAN='\033[0;36m'
|
||||||
|
NC='\033[0m'
|
||||||
|
|
||||||
|
info() { echo -e "${BLUE}[INFO]${NC} $*"; }
|
||||||
|
ok() { echo -e "${GREEN}[OK]${NC} $*"; }
|
||||||
|
warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
|
||||||
|
err() { echo -e "${RED}[ERR]${NC} $*" >&2; exit 1; }
|
||||||
|
banner() {
|
||||||
|
echo -e "${CYAN}"
|
||||||
|
echo ' ____ _ _ _ '
|
||||||
|
echo ' / ___|_ _ __ _ __| | | |_ ___ __| | ___ '
|
||||||
|
echo '| | _| | | |/ _` |/ _` | | __/ _ \ / _` |/ _ \ '
|
||||||
|
echo '| |_| | |_| | (_| | (_| | | |_ (_) | (_| | (_) | '
|
||||||
|
echo ' \____|\__, |\__,_|\__,_| \__\___/ \__,_|\___/ '
|
||||||
|
echo ' |___/ '
|
||||||
|
echo -e "${NC}"
|
||||||
|
echo -e "${GREEN} GyanDoot v2.0 — Knowledge Messenger${NC}"
|
||||||
|
echo " Cross-Platform Universal Installer"
|
||||||
|
echo ""
|
||||||
|
}
|
||||||
|
|
||||||
|
# ─── Platform Detection ──────────────────────────────────────────────────
|
||||||
|
detect_architecture() {
|
||||||
|
local arch
|
||||||
|
arch="$(uname -m)"
|
||||||
|
case "$arch" in
|
||||||
|
x86_64|amd64) echo "x86_64" ;;
|
||||||
|
aarch64|arm64) echo "aarch64" ;;
|
||||||
|
i686|i386) echo "i686" ;;
|
||||||
|
*) err "Unsupported architecture: $arch" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
detect_os() {
|
||||||
|
local os
|
||||||
|
os="$(uname -s)"
|
||||||
|
case "$os" in
|
||||||
|
Linux) echo "linux" ;;
|
||||||
|
Darwin) echo "darwin" ;;
|
||||||
|
CYGWIN*|MINGW*|MSYS*) echo "windows" ;;
|
||||||
|
*) err "Unsupported OS: $os" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
detect_wsl() {
|
||||||
|
if [ -f /proc/version ] && grep -qiE 'microsoft|wsl' /proc/version 2>/dev/null; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
get_shell_profile() {
|
||||||
|
case "$SHELL" in
|
||||||
|
*/zsh) echo "$HOME/.zshrc" ;;
|
||||||
|
*/bash) echo "$HOME/.bashrc" ;;
|
||||||
|
*/fish) echo "$HOME/.config/fish/config.fish" ;;
|
||||||
|
*) echo "$HOME/.profile" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# ─── Dependency Installers ───────────────────────────────────────────────
|
||||||
|
|
||||||
|
install_rust_if_needed() {
|
||||||
|
if ! command -v cargo &>/dev/null; then
|
||||||
|
info "Rust toolchain not found. Installing..."
|
||||||
|
if [ "$(uname -s)" = "Darwin" ] || [ "$(uname -s)" = "Linux" ]; then
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
|
source "$HOME/.cargo/env"
|
||||||
|
elif [[ "$(uname -s)" =~ ^(CYGWIN|MINGW|MSYS) ]]; then
|
||||||
|
# Windows: download rustup-init.exe
|
||||||
|
powershell -Command "& {Invoke-WebRequest -Uri https://win.rustup.rs -OutFile '%TEMP%\rustup-init.exe'; Start-Process '%TEMP%\rustup-init.exe' -Wait -ArgumentList '-y'}"
|
||||||
|
export PATH="$PATH:$HOME/.cargo/bin"
|
||||||
|
else
|
||||||
|
err "No Rust install method for this platform"
|
||||||
|
fi
|
||||||
|
ok "Rust installed ($(cargo --version))"
|
||||||
|
else
|
||||||
|
ok "Rust already installed ($(cargo --version))"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_node_if_needed() {
|
||||||
|
if ! command -v node &>/dev/null; then
|
||||||
|
info "Node.js not found. Installing..."
|
||||||
|
if command -v nvm &>/dev/null || [ -s "$HOME/.nvm/nvm.sh" ]; then
|
||||||
|
[ -s "$HOME/.nvm/nvm.sh" ] && \. "$HOME/.nvm/nvm.sh"
|
||||||
|
nvm install 22 2>/dev/null || nvm install node
|
||||||
|
elif [ "$(uname -s)" = "Darwin" ]; then
|
||||||
|
if command -v brew &>/dev/null; then
|
||||||
|
brew install node
|
||||||
|
else
|
||||||
|
warn "Install Node.js manually: https://nodejs.org"
|
||||||
|
fi
|
||||||
|
elif [[ "$(uname -s)" =~ ^(CYGWIN|MINGW|MSYS) ]]; then
|
||||||
|
warn "Install Node.js from: https://nodejs.org"
|
||||||
|
else
|
||||||
|
# Linux: use nvm
|
||||||
|
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
|
||||||
|
[ -s "$HOME/.nvm/nvm.sh" ] && \. "$HOME/.nvm/nvm.sh"
|
||||||
|
nvm install 22
|
||||||
|
fi
|
||||||
|
ok "Node.js installed ($(node --version))"
|
||||||
|
else
|
||||||
|
ok "Node.js already installed ($(node --version))"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure npx is available
|
||||||
|
if ! command -v npx &>/dev/null; then
|
||||||
|
warn "npx not found. Installing corepack..."
|
||||||
|
npm install -g npx 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# ─── Linux System Dependencies ───────────────────────────────────────────
|
||||||
|
# Camoufox (Playwright-based) needs these on Linux/WSL
|
||||||
|
CAMOUFOX_LINUX_DEPS=(
|
||||||
|
libgtk-3-0 libnss3 libnspr4 libatk1.0-0t64
|
||||||
|
libatk-bridge2.0-0t64 libcups2t64 libdrm2
|
||||||
|
libxkbcommon0 libxcomposite1 libxdamage1
|
||||||
|
libxfixes3 libxrandr2 libgbm1 libpango-1.0-0
|
||||||
|
libcairo2 libasound2t64 libxcb-shm0
|
||||||
|
libx11-xcb1 libx11-6 libxcb1 libxext6
|
||||||
|
libxcursor1 libxi6 libfreetype6 libfontconfig1
|
||||||
|
libxshmfence1 libxrender1 libdbus-1-3
|
||||||
|
)
|
||||||
|
|
||||||
|
install_linux_deps() {
|
||||||
|
if [ "$(uname -s)" != "Linux" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if detect_wsl; then
|
||||||
|
info "WSL detected. Installing Linux system dependencies..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
local missing=()
|
||||||
|
if command -v dpkg-query &>/dev/null; then
|
||||||
|
for pkg in "${CAMOUFOX_LINUX_DEPS[@]}"; do
|
||||||
|
if ! dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -q "install ok installed"; then
|
||||||
|
local alt_pkg="${pkg%t64}"
|
||||||
|
if [ "$alt_pkg" != "$pkg" ] && dpkg-query -W -f='${Status}' "$alt_pkg" 2>/dev/null | grep -q "install ok installed"; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
missing+=("$pkg")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
missing=("${CAMOUFOX_LINUX_DEPS[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ${#missing[@]} -eq 0 ]; then
|
||||||
|
info "All Linux system dependencies already installed"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
info "Installing ${#missing[@]} missing Linux system dependencies..."
|
||||||
|
if command -v apt-get &>/dev/null; then
|
||||||
|
if command -v sudo &>/dev/null; then
|
||||||
|
sudo apt-get update -qq 2>/dev/null || true
|
||||||
|
sudo apt-get install -y -qq "${missing[@]}" 2>/dev/null || {
|
||||||
|
warn "Some packages failed. Retrying with fix..."
|
||||||
|
sudo apt-get --fix-broken install -y -qq 2>/dev/null || true
|
||||||
|
local fallback=()
|
||||||
|
for pkg in "${missing[@]}"; do
|
||||||
|
local alt="${pkg%t64}"
|
||||||
|
[ "$alt" != "$pkg" ] && fallback+=("$alt")
|
||||||
|
done
|
||||||
|
[ ${#fallback[@]} -gt 0 ] && sudo apt-get install -y -qq "${fallback[@]}" 2>/dev/null || true
|
||||||
|
}
|
||||||
|
else
|
||||||
|
apt-get update -qq 2>/dev/null || true
|
||||||
|
apt-get install -y -qq "${missing[@]}" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
ok "Linux system dependencies installed"
|
||||||
|
elif command -v dnf &>/dev/null; then
|
||||||
|
sudo dnf install -y nss nspr atk at-spi2-atk cups-libs \
|
||||||
|
libdrm libXcomposite libXdamage libXrandr mesa-libgbm \
|
||||||
|
pango alsa-lib libxkbcommon libxcb libX11-xcb libX11 \
|
||||||
|
libXext libXcursor libXfixes libXi gtk3 cairo-gobject 2>/dev/null || true
|
||||||
|
ok "Linux system dependencies installed"
|
||||||
|
elif command -v yum &>/dev/null; then
|
||||||
|
sudo yum install -y nss nspr atk at-spi2-atk cups-libs \
|
||||||
|
libdrm libXcomposite libXdamage libXrandr mesa-libgbm \
|
||||||
|
pango alsa-lib libxkbcommon 2>/dev/null || true
|
||||||
|
ok "Linux system dependencies installed"
|
||||||
|
else
|
||||||
|
warn "No supported package manager. Install deps manually."
|
||||||
|
warn "Required: ${CAMOUFOX_LINUX_DEPS[*]}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# ─── Camoufox Browser Installer ──────────────────────────────────────────
|
||||||
|
install_camoufox_browser() {
|
||||||
|
info "Installing Camoufox browser (anti-detection engine)..."
|
||||||
|
|
||||||
|
install_linux_deps
|
||||||
|
|
||||||
|
if ! command -v npx &>/dev/null && ! command -v npm &>/dev/null; then
|
||||||
|
warn "Node.js not found. Skipping Camoufox install."
|
||||||
|
warn "Install Node.js and re-run: npm install -g camoufox-browser@0.1.0"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Step 1: Install npm package
|
||||||
|
info "Installing npm package (camoufox-browser@0.1.0)..."
|
||||||
|
npm install -g camoufox-browser@0.1.0 2>&1 | tail -3 || {
|
||||||
|
warn "npm install failed. Try manually: npm install -g camoufox-browser@0.1.0"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 2: Download browser binary
|
||||||
|
info "Downloading Camoufox browser binary (~311MB)..."
|
||||||
|
npx --yes camoufox-js@0.11.0 fetch 2>&1 || {
|
||||||
|
warn "Download failed. Try manually: npx --yes camoufox-js@0.11.0 fetch"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 3: macOS — remove Gatekeeper quarantine
|
||||||
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
|
if command -v xattr &>/dev/null; then
|
||||||
|
info "Removing macOS quarantine from Camoufox..."
|
||||||
|
xattr -dr com.apple.quarantine ~/Library/Caches/camoufox 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Step 4: Verify
|
||||||
|
local cache_dir
|
||||||
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
|
cache_dir="$HOME/Library/Caches/camoufox"
|
||||||
|
else
|
||||||
|
cache_dir="$HOME/.cache/camoufox"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$cache_dir/version.json" ]; then
|
||||||
|
ok "Camoufox browser installed ($(du -sh "$cache_dir" 2>/dev/null | cut -f1))"
|
||||||
|
else
|
||||||
|
warn "Browser binary not found. Run manually: npx --yes camoufox-js@0.11.0 fetch"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# ─── Build GyanDoot ──────────────────────────────────────────────────────
|
||||||
|
build_gyandoot() {
|
||||||
|
local root_dir
|
||||||
|
root_dir="$(cd "$(dirname "$0")" 2>/dev/null && pwd || echo "$PWD")"
|
||||||
|
|
||||||
|
# Find workspace root (where Cargo.toml with [workspace] is)
|
||||||
|
cd "$root_dir"
|
||||||
|
while [ "$PWD" != "/" ]; do
|
||||||
|
if [ -f "Cargo.toml" ] && grep -q '\[workspace\]' Cargo.toml 2>/dev/null; then
|
||||||
|
info "Found workspace root at $PWD"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$PWD" = "/" ]; then
|
||||||
|
err "Could not find Cargo workspace. Make sure you're in the gyandoot-v2 directory."
|
||||||
|
fi
|
||||||
|
|
||||||
|
info "Building GyanDoot v2.0 (release mode)..."
|
||||||
|
cargo build --release 2>&1 | tail -5
|
||||||
|
ok "Build complete ($(du -sh target/release/gyandoot* 2>/dev/null | cut -f1))"
|
||||||
|
}
|
||||||
|
|
||||||
|
# ─── Install Binary ──────────────────────────────────────────────────────
|
||||||
|
install_binary() {
|
||||||
|
local target_dir="$PWD/target/release"
|
||||||
|
local bin_name="gyandoot"
|
||||||
|
|
||||||
|
if [ -f "$target_dir/gyandoot.exe" ]; then
|
||||||
|
bin_name="gyandoot.exe"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$target_dir/$bin_name" ]; then
|
||||||
|
err "Binary not found at $target_dir/$bin_name"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local os
|
||||||
|
os="$(uname -s)"
|
||||||
|
local install_dir=""
|
||||||
|
local installed_to=""
|
||||||
|
|
||||||
|
case "$os" in
|
||||||
|
Darwin|Linux)
|
||||||
|
# Priority: ~/.cargo/bin/ → /usr/local/bin → ~/.local/bin/
|
||||||
|
if [ -d "$HOME/.cargo/bin" ] && echo "$PATH" | grep -q "$HOME/.cargo/bin"; then
|
||||||
|
install_dir="$HOME/.cargo/bin"
|
||||||
|
elif [ -d "/usr/local/bin" ]; then
|
||||||
|
if [ -w "/usr/local/bin" ]; then
|
||||||
|
install_dir="/usr/local/bin"
|
||||||
|
else
|
||||||
|
info "Need sudo to install to /usr/local/bin"
|
||||||
|
sudo cp "$target_dir/$bin_name" "/usr/local/bin/$bin_name"
|
||||||
|
sudo chmod +x "/usr/local/bin/$bin_name"
|
||||||
|
install_dir="/usr/local/bin"
|
||||||
|
fi
|
||||||
|
elif [ -d "$HOME/.local/bin" ] && echo "$PATH" | grep -q "$HOME/.local/bin"; then
|
||||||
|
install_dir="$HOME/.local/bin"
|
||||||
|
else
|
||||||
|
mkdir -p "$HOME/.cargo/bin"
|
||||||
|
install_dir="$HOME/.cargo/bin"
|
||||||
|
if ! echo "$PATH" | grep -q "$HOME/.cargo/bin"; then
|
||||||
|
warn "Add ~/.cargo/bin to your PATH in $(get_shell_profile):"
|
||||||
|
echo " export PATH=\"\$HOME/.cargo/bin:\$PATH\""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$install_dir" ]; then
|
||||||
|
cp "$target_dir/$bin_name" "$install_dir/$bin_name"
|
||||||
|
chmod +x "$install_dir/$bin_name"
|
||||||
|
installed_to="$install_dir/$bin_name"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
CYGWIN*|MINGW*|MSYS*)
|
||||||
|
install_dir="/usr/local/bin"
|
||||||
|
cp "$target_dir/$bin_name" "$install_dir/$bin_name"
|
||||||
|
chmod +x "$install_dir/$bin_name"
|
||||||
|
installed_to="$install_dir/$bin_name"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
err "Unsupported OS: $os"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
ok "Installed to $installed_to"
|
||||||
|
|
||||||
|
# ── Verify PATH resolution ──────────────────────────────────────────
|
||||||
|
local cmd_path
|
||||||
|
cmd_path="$(command -v gyandoot 2>/dev/null || true)"
|
||||||
|
if [ -z "$cmd_path" ]; then
|
||||||
|
warn "'gyandoot' not found in PATH. Use: $installed_to"
|
||||||
|
elif [ "$cmd_path" != "$installed_to" ]; then
|
||||||
|
warn "OLD binary at '$cmd_path' takes priority over '$installed_to'."
|
||||||
|
warn "Remove old: sudo rm $cmd_path || rm $cmd_path"
|
||||||
|
warn "Then 'gyandoot run' will use the new version."
|
||||||
|
else
|
||||||
|
ok "'gyandoot' resolves to the newly installed binary."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# ─── Post-Install Summary ────────────────────────────────────────────────
|
||||||
|
print_post_install() {
|
||||||
|
echo ""
|
||||||
|
ok "GyanDoot v2.0 installed successfully!"
|
||||||
|
echo ""
|
||||||
|
echo "╔═══════════════════════════════════════════════════════════╗"
|
||||||
|
echo "║ Quick Start ║"
|
||||||
|
echo "╠═══════════════════════════════════════════════════════════╣"
|
||||||
|
echo "║ gyandoot --help Show all commands ║"
|
||||||
|
echo "║ gyandoot setup Interactive config wizard ║"
|
||||||
|
echo "║ gyandoot run Start interactive agent ║"
|
||||||
|
echo "╠═══════════════════════════════════════════════════════════╣"
|
||||||
|
echo "║ Browser Tools (anti-detection): ║"
|
||||||
|
echo "║ gyandoot browser health Check Camoufox status ║"
|
||||||
|
echo "║ gyandoot browser search Search the web ║"
|
||||||
|
echo "║ gyandoot browser browse Visit a website ║"
|
||||||
|
echo "╠═══════════════════════════════════════════════════════════╣"
|
||||||
|
echo "║ Service Management: ║"
|
||||||
|
echo "║ gyandoot service install Auto-start on boot ║"
|
||||||
|
echo "║ gyandoot service status Check service status ║"
|
||||||
|
echo "╚═══════════════════════════════════════════════════════════╝"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
|
echo " 🍎 macOS — Camoufox Gatekeeper (one-time):"
|
||||||
|
echo " xattr -dr com.apple.quarantine ~/Library/Caches/camoufox"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if detect_wsl; then
|
||||||
|
echo " ⚠️ WSL detected — Node.js must be installed INSIDE WSL."
|
||||||
|
echo " (The Windows-side Node.js is not accessible from WSL.)"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# ─── Service Installation Prompt ─────────────────────────────────────────
|
||||||
|
prompt_service_install() {
|
||||||
|
echo "────────────────────────────────────────────"
|
||||||
|
echo " Optional: Auto-start GyanDoot on Boot?"
|
||||||
|
echo "────────────────────────────────────────────"
|
||||||
|
echo " GyanDoot can run as a system service and"
|
||||||
|
echo " start automatically when your computer boots."
|
||||||
|
echo ""
|
||||||
|
echo " (You can also do this later: gyandoot service install)"
|
||||||
|
echo ""
|
||||||
|
read -r -p " Install system service? [y/N]: " response
|
||||||
|
case "$response" in
|
||||||
|
[yY]|[yY][eE][sS])
|
||||||
|
info "Installing GyanDoot system service..."
|
||||||
|
gyandoot service install 2>&1 || warn "Service install failed (run later: gyandoot service install)"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
info "Skipping service install"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# ═══════════════════════════════════════════════════════════════════════════
|
||||||
|
# MAIN
|
||||||
|
# ═══════════════════════════════════════════════════════════════════════════
|
||||||
|
main() {
|
||||||
|
banner
|
||||||
|
|
||||||
|
local os arch
|
||||||
|
os=$(detect_os)
|
||||||
|
arch=$(detect_architecture)
|
||||||
|
info "Detected: $os / $arch"
|
||||||
|
|
||||||
|
if detect_wsl; then
|
||||||
|
info "WSL (Windows Subsystem for Linux) detected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ── Install dependencies ───────────────────────────────────────────
|
||||||
|
info "Phase 1: Checking prerequisites..."
|
||||||
|
install_rust_if_needed
|
||||||
|
install_node_if_needed
|
||||||
|
|
||||||
|
# ── Install Camoufox browser ───────────────────────────────────────
|
||||||
|
info "Phase 2: Installing Camoufox browser..."
|
||||||
|
install_camoufox_browser
|
||||||
|
|
||||||
|
# ── Build from source ──────────────────────────────────────────────
|
||||||
|
info "Phase 3: Building GyanDoot..."
|
||||||
|
build_gyandoot
|
||||||
|
|
||||||
|
# ── Install binary ─────────────────────────────────────────────────
|
||||||
|
info "Phase 4: Installing binary..."
|
||||||
|
install_binary
|
||||||
|
|
||||||
|
# ── Optional: system service ───────────────────────────────────────
|
||||||
|
info "Phase 5: Service setup..."
|
||||||
|
prompt_service_install
|
||||||
|
|
||||||
|
# ── Done ───────────────────────────────────────────────────────────
|
||||||
|
print_post_install
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
BIN
linux/gyandoot
Executable file
BIN
linux/gyandoot
Executable file
Binary file not shown.
49
macos/gyandoot.rb
Normal file
49
macos/gyandoot.rb
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# typed: true
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# GyanDoot v2.0 — Homebrew Formula
|
||||||
|
# Usage:
|
||||||
|
# brew tap gnpl_admin/gyandoot
|
||||||
|
# brew install gyandoot
|
||||||
|
#
|
||||||
|
# For the latest version, run:
|
||||||
|
# brew upgrade gyandoot
|
||||||
|
|
||||||
|
class Gyandoot < Formula
|
||||||
|
desc "GyanDoot — AI Agent Platform: search, browse, and automate"
|
||||||
|
homepage "https://git.gyannetra.in/gnpl_admin/gyandoot-v2"
|
||||||
|
url "https://git.gyannetra.in/gnpl_admin/gyandoot-v2.git",
|
||||||
|
tag: "v2.0.0",
|
||||||
|
revision: "3b5b995fcec8f11bdb9d7e0fb24c50f20c2d9d38"
|
||||||
|
license "MIT"
|
||||||
|
head "https://git.gyannetra.in/gnpl_admin/gyandoot-v2.git", branch: "main"
|
||||||
|
|
||||||
|
depends_on "rust" => :build
|
||||||
|
depends_on "node" => :recommended
|
||||||
|
|
||||||
|
def install
|
||||||
|
system "cargo", "install", "--locked", "--root", prefix,
|
||||||
|
"--path", "."
|
||||||
|
|
||||||
|
# Generate shell completions
|
||||||
|
bash_completion.install "completions/gyandoot.bash" => "gyandoot"
|
||||||
|
zsh_completion.install "completions/gyandoot.zsh" => "_gyandoot"
|
||||||
|
fish_completion.install "completions/gyandoot.fish" => "gyandoot.fish"
|
||||||
|
end
|
||||||
|
|
||||||
|
def post_install
|
||||||
|
ohai "GyanDoot installed! Quick start:"
|
||||||
|
puts " gyandoot setup # Configure LLM provider"
|
||||||
|
puts " gyandoot run # Start interactive agent"
|
||||||
|
puts ""
|
||||||
|
ohai "Optional — Install Camoufox Browser for web search:"
|
||||||
|
puts " npx --yes camoufox-js@0.11.0 fetch"
|
||||||
|
puts ""
|
||||||
|
ohai "macOS Gatekeeper fix (required on Apple Silicon):"
|
||||||
|
puts " xattr -dr com.apple.quarantine ~/Library/Caches/camoufox"
|
||||||
|
end
|
||||||
|
|
||||||
|
test do
|
||||||
|
assert_match "GyanDoot", shell_output("#{bin}/gyandoot --version")
|
||||||
|
end
|
||||||
|
end
|
||||||
121
windows/install.bat
Normal file
121
windows/install.bat
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
@echo off
|
||||||
|
REM ═══════════════════════════════════════════════════════════════════════════
|
||||||
|
REM GyanDoot v2.0 — Windows Installer (Git Bash / MSYS2)
|
||||||
|
REM ═══════════════════════════════════════════════════════════════════════════
|
||||||
|
REM This script installs GyanDoot on Windows via Git Bash or MSYS2.
|
||||||
|
REM For PowerShell, use: install.ps1
|
||||||
|
REM ═══════════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ╔═══════════════════════════════════════╗
|
||||||
|
echo ║ GyanDoot v2.0 — Windows Installer ║
|
||||||
|
echo ╚═══════════════════════════════════════╝
|
||||||
|
echo.
|
||||||
|
|
||||||
|
REM ── Check if running in Git Bash / MSYS2 ──────────────────────────────
|
||||||
|
if not defined MSYSTEM (
|
||||||
|
echo [WARN] This script requires Git Bash or MSYS2.
|
||||||
|
echo For PowerShell, use: install.ps1
|
||||||
|
echo.
|
||||||
|
echo Or download from: https://git.gyannetra.in/gnpl_admin/gyandoot-release
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
REM ── Check prerequisites ───────────────────────────────────────────────
|
||||||
|
echo [CHECK] Rust...
|
||||||
|
where cargo >nul 2>&1
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo [INFO] Rust not found. Installing Rust...
|
||||||
|
powershell -Command "& {Invoke-WebRequest -Uri https://win.rustup.rs -OutFile '%TEMP%\rustup-init.exe'; Start-Process '%TEMP%\rustup-init.exe' -Wait -ArgumentList '-y'}"
|
||||||
|
call "%USERPROFILE%\.cargo\env"
|
||||||
|
echo [OK] Rust installed
|
||||||
|
) else (
|
||||||
|
for /f "tokens=*" %%i in ('cargo --version') do echo [OK] %%i
|
||||||
|
)
|
||||||
|
|
||||||
|
echo [CHECK] Node.js...
|
||||||
|
where node >nul 2>&1
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo [WARN] Node.js is required for browser features.
|
||||||
|
echo Download from: https://nodejs.org (v20+)
|
||||||
|
echo Or: winget install OpenJS.NodeJS
|
||||||
|
) else (
|
||||||
|
for /f "tokens=*" %%i in ('node --version') do echo [OK] Node.js %%i
|
||||||
|
)
|
||||||
|
|
||||||
|
REM ── Build ──────────────────────────────────────────────────────────────
|
||||||
|
echo.
|
||||||
|
echo [BUILD] Compiling GyanDoot (this may take a few minutes)...
|
||||||
|
cd /d "%~dp0.." 2>nul || (
|
||||||
|
echo [ERR] Could not find project root.
|
||||||
|
echo Make sure you're running this from the release directory.
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
cargo build --release
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo [ERR] Build failed. Check the error above.
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
echo [OK] Build complete
|
||||||
|
|
||||||
|
REM ── Install binary ────────────────────────────────────────────────────
|
||||||
|
set "INSTALL_DIR=%USERPROFILE%\.cargo\bin"
|
||||||
|
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"
|
||||||
|
|
||||||
|
copy /Y "target\release\gyandoot.exe" "%INSTALL_DIR%\gyandoot.exe" >nul
|
||||||
|
echo [OK] Installed to %INSTALL_DIR%\gyandoot.exe
|
||||||
|
|
||||||
|
REM ── Check PATH ────────────────────────────────────────────────────────
|
||||||
|
echo !PATH! | findstr /C:"%USERPROFILE%\.cargo\bin" >nul
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo [WARN] %USERPROFILE%\.cargo\bin is not in your PATH.
|
||||||
|
echo Add it manually to your PATH environment variable.
|
||||||
|
echo Or run: setx PATH "%%USERPROFILE%%\.cargo\bin;%%PATH%%"
|
||||||
|
echo.
|
||||||
|
echo Then restart your terminal.
|
||||||
|
)
|
||||||
|
|
||||||
|
REM ── Verify ────────────────────────────────────────────────────────────
|
||||||
|
echo.
|
||||||
|
echo [VERIFY] Checking installation...
|
||||||
|
"%INSTALL_DIR%\gyandoot.exe" --help >nul 2>&1
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo [WARN] Installation verification failed.
|
||||||
|
) else (
|
||||||
|
echo [OK] GyanDoot installed successfully!
|
||||||
|
)
|
||||||
|
|
||||||
|
REM ── Optional: Camoufox browser ────────────────────────────────────────
|
||||||
|
echo.
|
||||||
|
echo ────────────────────────────────────────────
|
||||||
|
echo Optional: Install Camoufox Browser?
|
||||||
|
echo Required for: web_search, web_browse tools
|
||||||
|
echo ────────────────────────────────────────────
|
||||||
|
set /p INSTALL_CAMOUFOX="Install Camoufox browser? [y/N]: "
|
||||||
|
if /i "!INSTALL_CAMOUFOX!"=="y" (
|
||||||
|
echo [INFO] Installing camoufox-browser npm package...
|
||||||
|
npm install -g camoufox-browser@0.1.0
|
||||||
|
echo [INFO] Downloading browser binary (~311MB)...
|
||||||
|
npx --yes camoufox-js@0.11.0 fetch
|
||||||
|
echo [OK] Camoufox browser installed
|
||||||
|
)
|
||||||
|
|
||||||
|
REM ── Done ──────────────────────────────────────────────────────────────
|
||||||
|
echo.
|
||||||
|
echo ╔═══════════════════════════════════════╗
|
||||||
|
echo ║ GyanDoot v2.0 installed! ║
|
||||||
|
echo ╚═══════════════════════════════════════╝
|
||||||
|
echo.
|
||||||
|
echo Quick start:
|
||||||
|
echo gyandoot --help
|
||||||
|
echo gyandoot setup
|
||||||
|
echo gyandoot run
|
||||||
|
echo.
|
||||||
|
pause
|
||||||
153
windows/install.ps1
Normal file
153
windows/install.ps1
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
GyanDoot v2.0 — Windows Installer (PowerShell)
|
||||||
|
.DESCRIPTION
|
||||||
|
Installs GyanDoot AI Agent on Windows 10/11 via PowerShell.
|
||||||
|
Requires: Rust (auto-installed), Git Bash recommended.
|
||||||
|
#>
|
||||||
|
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
$ProgressPreference = "SilentlyContinue"
|
||||||
|
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "╔═══════════════════════════════════════╗" -ForegroundColor Cyan
|
||||||
|
Write-Host "║ GyanDoot v2.0 — Windows Installer ║" -ForegroundColor Cyan
|
||||||
|
Write-Host "╚═══════════════════════════════════════╝" -ForegroundColor Cyan
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
# ── Helper functions ─────────────────────────────────────────────────────
|
||||||
|
function Write-OK($msg) { Write-Host " [OK] $msg" -ForegroundColor Green }
|
||||||
|
function Write-Info($msg) { Write-Host " [..] $msg" -ForegroundColor Cyan }
|
||||||
|
function Write-Warn($msg) { Write-Host " [!] $msg" -ForegroundColor Yellow }
|
||||||
|
function Write-Err($msg) { Write-Host " [ERR] $msg" -ForegroundColor Red }
|
||||||
|
|
||||||
|
# ── Detect OS Architecture ───────────────────────────────────────────────
|
||||||
|
$arch = (Get-WmiObject Win32_Processor).Architecture
|
||||||
|
$archName = switch ($arch) {
|
||||||
|
0 { "x86" }
|
||||||
|
9 { "x64" }
|
||||||
|
12 { "arm64" }
|
||||||
|
default { "unknown" }
|
||||||
|
}
|
||||||
|
Write-Info "Detected: Windows / $archName"
|
||||||
|
|
||||||
|
# ── Check if running in PowerShell only ──────────────────────────────────
|
||||||
|
Write-Warn "For best results, use Git Bash and run: install.bat"
|
||||||
|
Write-Warn "PowerShell support is limited on Windows."
|
||||||
|
|
||||||
|
# ── Check / Install Rust ─────────────────────────────────────────────────
|
||||||
|
Write-Info "Checking Rust..."
|
||||||
|
$haveRust = $false
|
||||||
|
try {
|
||||||
|
$rustVer = cargo --version 2>$null
|
||||||
|
if ($rustVer) {
|
||||||
|
Write-OK "Rust already installed ($rustVer)"
|
||||||
|
$haveRust = $true
|
||||||
|
}
|
||||||
|
} catch { }
|
||||||
|
|
||||||
|
if (-not $haveRust) {
|
||||||
|
Write-Info "Rust not found. Installing Rust..."
|
||||||
|
$rustupUrl = "https://win.rustup.rs"
|
||||||
|
$rustupPath = "$env:TEMP\rustup-init.exe"
|
||||||
|
|
||||||
|
try {
|
||||||
|
Invoke-WebRequest -Uri $rustupUrl -OutFile $rustupPath -UseBasicParsing
|
||||||
|
Start-Process -FilePath $rustupPath -ArgumentList "-y" -Wait -NoNewWindow
|
||||||
|
# Reload PATH
|
||||||
|
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
|
||||||
|
Write-OK "Rust installed"
|
||||||
|
} catch {
|
||||||
|
Write-Err "Failed to install Rust: $_"
|
||||||
|
Write-Warn "Download manually from: https://rustup.rs"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Check Node.js ────────────────────────────────────────────────────────
|
||||||
|
Write-Info "Checking Node.js..."
|
||||||
|
try {
|
||||||
|
$nodeVer = node --version 2>$null
|
||||||
|
if ($nodeVer) {
|
||||||
|
Write-OK "Node.js $nodeVer"
|
||||||
|
} else {
|
||||||
|
throw "not found"
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Warn "Node.js not found (required for browser features)"
|
||||||
|
Write-Warn "Download from: https://nodejs.org (v20+)"
|
||||||
|
Write-Warn "Or run: winget install OpenJS.NodeJS"
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Determine script directory ──────────────────────────────────────────
|
||||||
|
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
||||||
|
$projectRoot = Resolve-Path "$scriptDir/.."
|
||||||
|
|
||||||
|
# ── Build ────────────────────────────────────────────────────────────────
|
||||||
|
Write-Info "Building GyanDoot release (this may take a few minutes)..."
|
||||||
|
Set-Location $projectRoot
|
||||||
|
|
||||||
|
try {
|
||||||
|
$buildOutput = cargo build --release 2>&1
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw $buildOutput
|
||||||
|
}
|
||||||
|
Write-OK "Build complete"
|
||||||
|
} catch {
|
||||||
|
Write-Err "Build failed: $_"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Install binary ──────────────────────────────────────────────────────
|
||||||
|
$installDir = "$env:USERPROFILE\.cargo\bin"
|
||||||
|
if (-not (Test-Path $installDir)) {
|
||||||
|
New-Item -ItemType Directory -Path $installDir -Force | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
|
Copy-Item -Path "$projectRoot\target\release\gyandoot.exe" -Destination "$installDir\gyandoot.exe" -Force
|
||||||
|
Write-OK "Installed to $installDir\gyandoot.exe"
|
||||||
|
|
||||||
|
# ── Check PATH ──────────────────────────────────────────────────────────
|
||||||
|
$paths = $env:Path -split ';'
|
||||||
|
if ($paths -notcontains $installDir) {
|
||||||
|
Write-Warn "$installDir is not in your PATH!"
|
||||||
|
Write-Warn "Run this to add it permanently:"
|
||||||
|
Write-Host ' [Environment]::SetEnvironmentVariable("Path", "$env:USERPROFILE\.cargo\bin;$env:Path", "User")' -ForegroundColor Gray
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Verify ───────────────────────────────────────────────────────────────
|
||||||
|
try {
|
||||||
|
$helpOutput = & "$installDir\gyandoot.exe" --help 2>&1
|
||||||
|
Write-OK "GyanDoot installed successfully!" -ForegroundColor Green
|
||||||
|
} catch {
|
||||||
|
Write-Warn "Verification failed: $_"
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Optional: Camoufox ───────────────────────────────────────────────────
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "────────────────────────────────────────────" -ForegroundColor Yellow
|
||||||
|
Write-Host " Optional: Install Camoufox Browser?" -ForegroundColor Yellow
|
||||||
|
Write-Host " Required for: web_search, web_browse tools" -ForegroundColor Yellow
|
||||||
|
Write-Host "────────────────────────────────────────────" -ForegroundColor Yellow
|
||||||
|
$installCamoufox = Read-Host "Install Camoufox? [y/N]"
|
||||||
|
|
||||||
|
if ($installCamoufox -eq "y") {
|
||||||
|
Write-Info "Installing camoufox-browser npm package..."
|
||||||
|
npm install -g camoufox-browser@0.1.0 2>$null
|
||||||
|
Write-Info "Downloading Camoufox browser binary (~311MB)..."
|
||||||
|
npx --yes camoufox-js@0.11.0 fetch 2>$null
|
||||||
|
Write-OK "Camoufox browser installed"
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Done ─────────────────────────────────────────────────────────────────
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "╔═══════════════════════════════════════╗" -ForegroundColor Green
|
||||||
|
Write-Host "║ GyanDoot v2.0 installed! ║" -ForegroundColor Green
|
||||||
|
Write-Host "╚═══════════════════════════════════════╝" -ForegroundColor Green
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host " Quick start:" -ForegroundColor Gray
|
||||||
|
Write-Host " gyandoot --help" -ForegroundColor White
|
||||||
|
Write-Host " gyandoot setup" -ForegroundColor White
|
||||||
|
Write-Host " gyandoot run" -ForegroundColor White
|
||||||
|
Write-Host ""
|
||||||
|
Read-Host "Press Enter to exit"
|
||||||
Reference in New Issue
Block a user