Commit Graph

43 Commits

Author SHA1 Message Date
ff290a2915 fix(banner): corrected ASCII art — now spells GYANDOOT properly
The old banner was a handwritten ASCII art that didn't actually
spell 'GYANDOOT'. Replaced with proper figlet 'standard' font
output so the banner is readable and correct.
2026-06-13 18:42:10 +05:30
667336bcb9 release(v2.0.0): cross-platform release — Linux/macOS/Windows/WSL
Creates full release package with:
- release/install.sh (universal cross-platform installer)
- release/windows/install.bat (Git Bash/MSYS2)
- release/windows/install.ps1 (PowerShell)
- release/homebrew/gyandoot.rb (Homebrew formula)
- release/archives/ prebuilt binary archives
- release/README.md (platform-specific install guide)
- install.sh updated with same cross-platform logic
- README.md updated
2026-06-13 18:35:14 +05:30
3b5b995af8 fix(install): cross-platform binary install + PATH conflict detection
install_binary() now:
1. Automatically picks best location per platform:
   - macOS: ~/.cargo/bin/ (no sudo, in PATH for Rust users)
   - Linux: ~/.cargo/bin/ → /usr/local/bin → ~/.local/bin/
   - Windows: /usr/local/bin (Git Bash/MSYS2)
2. Detects if old binary exists at a different PATH location
   and warns the user: 'There is ANOTHER gyandoot at ...'
3. Verifies 'command -v gyandoot' resolves correctly after install
4. Shows shell profile instructions if PATH needs updating

Previous issue: always installed to /usr/local/bin with sudo,
overwriting the old binary from install.sh but not warning if
another copy existed elsewhere in PATH.
2026-06-13 18:26:39 +05:30
febc4b02c7 fix(browser): spawn daemon directly with node instead of npx wrapper
Root cause: camoufox-browser@0.1.0's CLI wrapper spawns the daemon
with stdio: 'ignore' and only waits 5 seconds. If the daemon crashes
(silent better-sqlite3 native binding error, etc.), the error is
swallowed and we see 'Failed to connect: No such file or directory'.

Fix:
1. find_daemon_js() — locates daemon.js in global node_modules via
   'npm root -g' with fallbacks for common nvm/homebrew paths
2. trigger_daemon_start() — spawns daemon.js directly with 'node',
   captures stderr to ~/.gyandoot/camoufox-daemon-stderr.log
3. Uses spawn() + std::mem::forget (background daemon) instead of
   .output() (which would wait forever since daemon never exits)
4. kill_on_drop(false) — prevents killing daemon when child drops
5. Poll loop in wait_for_socket() still works as before (30s timeout)
2026-06-13 17:57:04 +05:30
9851e41182 fix(browser): robust fetch with incomplete-cache cleanup + retry + binary verification
Root cause: camoufox-js@0.11.0 fetch can exit 0 but silently fail
to download the browser binary when:
1. A partial/incomplete cache from a previous run exists
2. GitHub API rate-limits the unauthenticated release query
3. Network drops mid-download

Fix:
1. run_fetch() now DELETE incomplete cache (dir exists but no
   version.json) before fetching — prevents 'already cached' no-op
2. After fetch, VERIFY version.json exists — if missing, RETRY once
3. After retry, verify Camoufox.app/Contents/MacOS/camoufox exists
4. Log stdout and stderr in INFO traces for debugging
2026-06-13 08:17:38 +05:30
68f7629f6f fix(browser): auto-remove macOS Gatekeeper quarantine — prevent SIGKILL
Root cause: On Apple Silicon macOS, the Camoufox browser binary
inherits com.apple.quarantine from npm download. When camoufox-browser
launches it headlessly, Gatekeeper silently kills the process with
SIGKILL (exitCode=null, signal=SIGKILL) before it can run.

Fix:
1. remove_macos_quarantine() — runs 'xattr -dr com.apple.quarantine'
   on the Camoufox cache directory after every fetch and on every
   subsequent startup (in case cache was from a prior npx run)
2. check_known_errors() — detects 'sigkill' in daemon stderr and
   shows the exact fix command to the user
3. Runs quarantine removal in TWO places:
   - Immediately after camoufox-js fetch downloads the binary
   - Always, even when binary already exists in cache
2026-06-13 07:58:05 +05:30
0334cad50e fix(install): add --yes flag to npx so it doesn't hang waiting for prompt
Root cause: 'npx camoufox-js@0.11.0 fetch' on a fresh install prompts
'Ok to proceed? (y/N)' and pipes it through 'tail -5', hiding it. User
sees nothing happening while script waits for input.

Fix:
1. npx --yes — auto-confirms the install prompt, no more silent hang
2. Removed | tail -5 — full output visible so user sees progress bar
3. macOS cache path (~/Library/Caches/) vs Linux (~/.cache/) in verify step
4. Also checks version.json as fallback (binary can be named differently)
2026-06-13 07:31:51 +05:30
b1f38da3d8 fix(browser): pin camoufox-js@0.11.0 and camoufox-browser@0.1.0 — no more @latest
Root cause: camoufox-browser@0.1.0 bundles camoufox-js@0.9.3 which downloads
a BROKEN alpha binary (v150.0.2-alpha.26, missing libmozglue.dylib) on macOS.
The newer camoufox-js@0.11.0 (Jun 4 2026) downloads STABLE builds.

Changes:
1. PINNED VERSIONS (constants at top of file):
   - CAMOUFOX_JS_VERSION = "0.11.0" — for fetching browser binary
   - CAMOUFOX_BROWSER_VERSION = "0.1.0" — for daemon IPC protocol
2. run_fetch() — uses 'npx --yes camoufox-js@0.11.0 fetch' instead of
   'camoufox-browser@latest install' (which called old camoufox-js)
3. Both packages share ~/Library/Caches/camoufox/ — fetch writes correct
   binary + version.json, daemon reads same cache
4. Removed Docker HTTP transport — no longer needed, daemon works on macOS
5. Removed reqwest dep from gyandoot-agent + gyandoot-browser
6. install.sh updated: uses camoufox-js@0.11.0 fetch + pinned npm package
7. install.sh verifies version.json exists, not just binary

Clean build: 0 errors, 0 warnings
No Docker dependency. No @latest. Pinned and stable.
2026-06-12 20:00:53 +05:30
71cf7c8830 fix(browser): dual transport — Unix socket + HTTP Docker + binary corruption detection
Root cause on macOS: camoufox-browser@0.1.0 downloads an alpha binary
(v150.0.2-alpha.26) from daijro/camoufox that has a broken macOS build
(missing libmozglue.dylib). Binary crashes with SIGABRT/SIGKILL.

Changes:
1. gyandoot-browser client now supports TWO transports:
   - Transport::UnixSocket (existing — daemon IPC)
   - Transport::Http (new — Docker REST API on port 9377)
2. init_browser() tries Docker HTTP first, falls back to npx daemon
3. HTTP transport maps browser actions to Docker REST endpoints
   (/navigate, /tabs, /health, etc.) with correct userId params
4. check_known_errors() detects libmozglue.dylib + SIGKILL patterns
5. Browser cache check works for both macOS and Linux paths
6. Error messages correctly say 'Use Docker' on corrupted binary
7. Added reqwest dep to gyandoot-agent for Docker health check

Clean build: 0 errors
2026-06-12 19:49:16 +05:30
495893c1de fix(browser): clean reimplementation — detect corrupted dl + Docker check
Clean build: 0 errors, 0 warnings
2026-06-12 19:17:13 +05:30
17f828f159 fix(browser): platform-aware error messages + corrupted download detection
Root cause on macOS: 'camoufox-browser install' downloaded v150.0.2-alpha.26
instead of the stable browser binary. This alpha version is missing
libmozglue.dylib, causing dyld to crash immediately.

Changes:
1. detect_os() — returns Mac/Linux/Wsl/Windows enum for platform-aware logic
2. check_known_errors() — parses daemon stderr for known failures (missing
   libmozglue.dylib on macOS, missing libgtk/libnss on Linux, code-signing)
3. platform_fix_instructions() — returns OS-specific recovery steps:
   - macOS: rm -rf ~/Library/Caches/camoufox, reinstall, or Docker fallback
   - WSL/Linux: correct apt-get install commands (with t64 package variants)
4. Browser cache detection now checks Camoufox.app on macOS, camoufox on Linux
5. All error messages use detect_os() — no more Linux apt-get on macOS
6. Corrupted download detected automatically, user told to clear cache + retry

Clean build: 0 errors, 0 warnings
2026-06-12 19:05:35 +05:30
cd0e58be82 feat(install): auto-detect WSL + install Linux system deps for camoufox
The Camoufox browser (Playwright-based) needs ~30 Linux system libraries
to run. On fresh WSL/Ubuntu, these are not pre-installed, causing the
browser daemon to crash silently with only a cryptic 'No such file or
directory' error.

Changes:
1. Add detect_wsl() — reads /proc/version for 'microsoft'/'wsl'
2. Add install_linux_deps() — installs all 30+ Playwright deps via
   apt-get/dnf/yum before installing camoufox-browser
3. Handles t64 package name variants (libasound2t64 vs libasound2)
4. Shows WSL-specific note at end of install
5. npm install -g camoufox-browser + install now run with better output
6. Verifies browser binary exists at ~/.cache/camoufox/ post-install
7. Install now fully automatic on fresh WSL — no manual apt-get needed
2026-06-12 18:25:09 +05:30
ff2e6b45e1 fix(browser): auto-install camoufox browser binary + WSL system deps guide
Root cause: 'camoufox-browser tab_list' triggers daemon which immediately
crashes because the ~662MB Camoufox browser binary was never downloaded
('camoufox-browser install' was never run). Additionally, on fresh WSL,
Linux system libraries (libgtk-3, libnss3, libatk, etc.) are missing.

Changes:
1. Add is_browser_installed() check — looks for ~/.cache/camoufox/camoufox
2. Add run_install() — runs 'camoufox-browser install' before starting daemon
3. init_browser() now auto-runs install if browser binary is missing
4. WSL-specific error message shows exact apt-get command for missing deps
5. Daemon timeout message lists all 30+ required Linux packages
6. Manual 'npx camoufox-browser@latest tab_list' command shown for debugging

Clean build: 0 errors, 0 warnings
2026-06-12 18:17:08 +05:30
b5a5784707 fix(browser): platform-aware error messages with WSL detection
- Add is_wsl() detection via /proc/version
- Add example_npx_path() returning platform-appropriate example path
- Replace all hardcoded macOS paths in error messages with dynamic ones
- Add WSL-specific hints: Node.js must be installed inside WSL, not Windows
- WSL hint includes nvm install instructions
- Clean build: 0 errors, 0 warnings
2026-06-12 17:22:06 +05:30
9954f28aa6 feat(platform): interactive wizard to configure Telegram + Discord bots
New command: 'gyandoot platform configure'

Walks users through:
1. Telegram bot token input (from @BotFather)
2. Discord bot token + guild ID input
3. Summary showing which platforms are configured
4. Saves [platform] section to config.toml

Existing 'gyandoot setup' and flat config parser also handle
the new [platform] section format.
2026-06-12 17:09:36 +05:30
a694757b6f feat(gateway): full Telegram+Discord integration with agent loop
Complete multi-platform gateway wiring:

config:
- [platform.telegram] section with bot_token
- [platform.discord] section with bot_token + guild_id
- Threaded through GyandootConfig → AgentConfig via typed structs

gateway:
- GatewayRunner::new(platforms) takes Vec<Box<dyn Platform>>
- start() spawns all platform pollers, merges receivers
- serve(agent) runs full message loop: receive → access control →
  typing indicator → session_turn() → platform.send()
- Ctrl+C graceful shutdown via tokio::select!

cmd_serve now:
1. Loads config, creates agent
2. Builds Telegram + Discord adapters from config
3. Starts gateway pollers
4. Enters serve loop until Ctrl+C
2026-06-12 16:52:28 +05:30
07a14e2d7b fix(browser): surface actual camoufox-bridge error on daemon start failure
trigger_daemon_start now captures stdout/stderr and exit code instead
of silently redirecting to a log file. On failure it prints the actual
error, making it obvious what went wrong (npm install issue, node
version mismatch, etc.).
2026-06-12 16:32:45 +05:30
cc0ff65e89 feat(setup): auto-detect npx path during installation
The setup wizard now auto-detects the npx/npx.cmd path via
`which npx` (Unix) or `where npx.cmd` (Windows) and writes it
to [browser].node_path in config.toml.

Changes:
- detect_npx_path(): cross-platform detection using which/where
- SerializedConfig now includes optional [browser] section
- Flat config parser (main.rs) handles [browser] section
- browser: BrowserSection threaded through AgentConfig everywhere
- init_browser() accepts node_path parameter with proper fallback
2026-06-12 16:19:44 +05:30
697c2c63b2 feat(browser): cross-platform node_path config for npx resolution
Adds [browser].node_path config option so camoufox-browser can use
an explicit npx path (essential for nvm/fnm/asdf users).

Resolution order (cross-platform):
1. config.browser.node_path — explicit user override
2. 'npx.cmd' on Windows, 'npx' on Linux/macOS — PATH lookup

Changes:
- BrowserSection config: added node_path: Option<String>
- AgentConfig: now carries browser section (was dropped in From<GyandootConfig>)
- browser_manager::init_browser(node_path): accepts optional path
- All call sites updated (run(), init_session(), subagents, tests)
- Error messages now hint at browser.node_path config
2026-06-12 16:08:37 +05:30
3030f6eadf fix(tui): stateful session with identity, memory, banner
Two fixes for the TUI:

1. **Raw LLM responses** —  was stateless, creating
   fresh messages every turn. Added  +
   methods that accumulate conversation history, inject identity, load
   past memory, run browser init, and compress context — identical to
   the interactive  loop but designed for external callers.

2. **Banner flash** — removed  call that fired to stdout
   *before* TUI entered alternate screen. TUI already shows the robot
   head via  as initial chat content.

Also added  getter and  field to AgentLoop.
2026-06-12 13:00:20 +05:30
93040d4fb0 Fix TUI: show GyanDoot banner + wire live agent responses
Two bugs fixed:

1. Banner not shown: TUI default output was a plain welcome text
   instead of the actual GyanDoot banner. Fixed by using
   banner::banner_plain() as initial TUI output content.

2. No agent responses: TUI was a standalone shell with no connection
   to the agent loop. Now uses mpsc channels:
   - user_tx: TUI → agent (user sends messages)
   - event_rx: agent → TUI (agent sends responses + telemetry)
   - TuiEvent::Response / Status / Telemetry enum for structured
     communication
   - tokio::spawn runs agent in background processing messages
   - poll_events() in render loop drains channel every frame tick

Also updated cmd_tui() in main to create channels + spawn agent.
2026-06-12 12:47:26 +05:30
73bd24dcfb Futuristic holographic TUI dashboard
Complete visual redesign of the TUI with a cyberpunk/holographic aesthetic:

Layout:
- Top header: GyanDoot logo (neon robot head) + 6 telemetry cards (3x2 grid)
- Middle: Chat interface area with message count
- Bottom: Mode-aware status bar (NORMAL/INPUT/CMD)

Telemetry Cards (live real-time dashboard):
1. PROVIDER — LLM provider name (neon cyan)
2. MODEL — Model name (neon green)
3. CLOCK — Live HH:MM:SS (neon amber)
4. TOKENS — Total/Max token count (neon magenta)
5. USAGE — Gauge bar with % (green→amber→red gradient)
6. MESSAGES — Total message count

Color Palette (holographic):
- BG: Deep violet-black (#0A0214)
- Cards: Neon cyan/magenta/green/amber/red
- Borders: Dim purple, rounded box-drawing
- Status bar: Glowing border per mode (cyan/green/amber)

Controls: / or : → command mode, i → input, q → quit
2026-06-12 12:35:08 +05:30
8c9a32075d Slash commands (/quit, /help) + zero compiler warnings
1. /quit and /help commands restored:
   - /quit: exits the interactive loop
   - /help: shows formatted help box with available commands & tips
   - Unknown commands get a friendly error pointing to /help
   - Slash commands intercepted before LLM processing (no token waste)

2. Zero warnings across entire workspace (13 files fixed):
   - Fixed ambiguous glob re-exports in gyandoot-core
   - Added #[allow(dead_code)] on intentional dead fields
   - Fixed unused imports, variables, and macros
   - Fixed unused assignments in subagents
   - cleaned up service.rs, profile, kanban warnings

install.sh now produces a completely clean build with zero warnings.
2026-06-12 12:15:01 +05:30
366d93443b CLI UX: Add blank line gap between output and next prompt
Fixes the cramped terminal output. Two changes:
1. display_output: trailing \n after G> text for spacing
2. read_input: leading \n before » prompt + 30ms delay after spinner clear
   to prevent \r overlap with prompt character

Before: G> response...» Hi (no gap, overlapping)
After:  G> response...
        (blank line)
        » Hi  (clean, separated)
2026-06-12 12:04:59 +05:30
1d8e26e683 CLI UX: Input prompt (»), G> output prefix, answering spinner
Three UX improvements for interactive mode:

1. Input prompt: Shows '»' (bold cyan) on stdin before reading user input
2. Output prefix: Agent responses prefixed with 'G>' (bold green)
3. Thinking indicator: Animated spinner on stderr showing 'answering (N.Ns)'
   with braille frame characters, auto-clears when response arrives
   - Start/stop via tokio::sync::watch channel + tokio::spawn
   - Only shows when interactive (atty detection)
   - Does not affect gateway/sub-agent modes
2026-06-12 11:56:10 +05:30
e06094c0a2 Option C: Rewrite gyandoot-browser for camoufox-browser@0.1.0 daemon IPC
Complete rewrite removing old HTTP REST client. The latest camoufox-browser
npm package (v0.1.0) uses Unix socket JSON-line IPC, not HTTP REST on :9377.

Changes:
- gyandoot-browser/client.rs: Full daemon IPC via Unix socket (~/.camoufox-browser/*.sock)
  - JSON-line protocol matching ensureDaemonRunning + daemon.js
  - Auto-launches browser on first command (daemon manages lifecycle)
  - Supports navigate, click, type, scroll, snapshot, search macros, tab management
  - Proper HeathResponse, NavigationResult, PageSnapshot types
- gyandoot-browser/lib.rs: Exports new client API (no SearchMacro enum, no SessionManager)
- gyandoot-browser/Cargo.toml: reqwest -> tokio Unix socket deps
- Removed: macros.rs, session.rs, snapshot.rs (all merged into client.rs)
- browser_manager.rs: Triggers daemon via npx, waits for Unix socket
- browser_tools.rs: Simplified API (no tab_id, no create_tab/close_tab)

Fix: camoufox-browser process exited with status 1 error on fresh install
2026-06-12 11:12:51 +05:30
b2650a569c feat: system service management (gyandoot service install|remove|status)
- Create systemd + launchd service templates in resources/
- Add gyandoot-core/src/service.rs module with full lifecycle
  - systemd: user service, daemon-reload, enable, start, stop, disable
  - launchd: macOS plist, load/unload, start/stop (launchctl)
- Add 'gyandoot service install|remove|status' CLI subcommand
- Update setup wizard: prompts 'Install system service? [y/N]'
- Update install.sh: prompts user for service install after binary
- Browser auto-starts at runtime (browser_manager), no separate service needed
- Camoufox installed via npm, auto-started by GyanDoot agent loop
2026-06-11 23:23:49 +05:30
f2d612bd28 🚀 Camoufox default web engine — auto-install + auto-start
Full integration:
- install.sh now installs camoufox-browser via npm (preferred) or Docker
- install.sh creates systemd/launchd auto-start service on Linux/macOS
- New browser_manager.rs — health-check, auto-start, wait-for-ready
- AgentLoop::run() auto-inits Camoufox and registers web_search/web_browse
- System prompt tells LLM to use web_search/web_browse as PRIMARY tools
- Graceful fallback: if Camoufox unavailable, logs warning, uses bash tools
- ToolExecutor is now Arc<Mutex<>> for runtime tool registration

GyanDoot v2 now: install → Camoufox auto-starts → web tools available →
"search NSE India" uses Camoufox with anti-detection 🎯
2026-06-11 23:12:57 +05:30
59ef28ffab 🔧 Fix tool calling + capability awareness
Three fixes:
1. OllamaProvider now sends tools[] in native /api/chat requests
2. OllamaProvider parses tool_calls from response (OpenAI-compatible
   format with function.name, function.arguments)
3. System prompt now lists available tools so LLM knows it can use
   bash, curl, read/write files — stops saying "I cannot do that"
2026-06-11 22:55:19 +05:30
5eb86e066b ⚡ Reduce dialogue memory injection from 8000 to 2000 chars for faster startup 2026-06-11 22:45:37 +05:30
a0dc5bdad6 🐛 Fix identity always-available fallback chain
- Agent name now falls back to config.name if [identity] section is empty
- Agent role defaults to "AI Assistant built by Gyannetra"
- User name defaults to "the User" if not set
- Removes dependency on identity_setup being completed
- Every session gets identity+memory injected into system prompt
2026-06-11 22:37:50 +05:30
c135ee811d ✨ Identity onboarding + Verbatim dialogue memory
- Added [identity] config section (agent_name, agent_role, user_name,
  user_role, setup_complete) to GyandootConfig and AgentConfig
- Agent loop now injects identity into system prompt on startup
- Agent loop injects past verbatim dialogue memory into system prompt
- Added dialogue_append() / dialogue_read() to MemPalace
  - Word-by-word, line-by-line verbatim record in dialogue.md
  - No compression, no truncation — every message preserved
- Agent loop writes to BOTH daily transcript AND verbatim dialogue
  on every turn
- All config paths pass identity through (flat converter, subagents)
2026-06-11 22:31:20 +05:30
e309d5e2cc 🐛 Fix max_tokens=0 bug — build_context now takes max_tokens from config 2026-06-11 22:22:03 +05:30
fef7e71387 🐛 Fix Ollama cloud detection — ollama.com uses native /api/chat + Bearer auth 2026-06-11 22:18:09 +05:30
b75fe44b98 🐛 Fix config format detection — raw content check before deser 2026-06-11 22:13:21 +05:30
81d539cfee 🐛 Fix Ollama auth + config format
Fixes:
1. Added  to  (config.rs)
2. Rewrote  with dual-mode logic:
   - OpenAI-compatible mode (api_key set OR non-localhost URL):
     uses /chat/completions + Bearer auth
   - Native mode: uses /api/chat (no auth)
3. Updated  in agent_loop.rs to pass api_key
4. Updated  to pass api_key
5. Added  in main.rs — parses
   flat  format AND canonical  format
6. Added  dependency to root Cargo.toml

The
                                 o
                                 |
               - - - - - -     .---.     - - - - - -
          - - - - - - - - -  [ ^   ^ ]  - - - - - - - - -
             - - - - - - -   |  ___  |   - - - - - - -
                              `-----'
           ____ __   __  ___   _   _  ____   ___   ___  _____
          / ___|\ \ / / / _ \ | \ | ||  _ \ / _ \ / _ \|_   _|
         | |  _  \ V / / /_\ \|  \| || | | | | | | | | | | |
         | |_| |  | |  |  _  || |\  || |_| | |_| | |_| | | |
          \____/  |_|  |_| |_||_| \_||____/ \___/ \___/  |_|

        o - - - - - - -  knowledge. delivered. - - - - - - - o

  ╔══════════════════════════════════════════════╗
  ║   ज्ञानदूत GyanDoot — Setup Wizard    ║
  ╚══════════════════════════════════════════════╝

  Configure your AI provider in 4 simple steps

  This wizard will help you configure GyanDoot to connect
  to your preferred LLM provider. You can re-run this anytime.

  Select a provider:
  ────────────────────────────────────────────────────────────
   1. Alibaba (Qwen)             (alibaba)
   2. Anthropic                  (anthropic)
   3. Azure OpenAI               (azure)
   4. Amazon Bedrock             (bedrock)
   5. DeepSeek                   (deepseek)
   6. Google Gemini              (gemini)
   7. Groq                       (groq)
   8. HuggingFace                (huggingface)
   9. Kilocode                   (kilocode)
  10. MiniMax                    (minimax)
  11. Novita AI                  (novita)
  12. Ollama (Local or Cloud)    (ollama)
  13. OpenAI                     (openai)
  14. OpenRouter                 (openrouter)
  15. StepFun                    (stepfun)
  16. Together AI                (together)
  17. xAI / Grok                 (xai)
  18. Xiaomi (MiLM)              (xiaomi)
  19. ZAI (01.AI / Yi)           (zai)
  20. Custom / Other

  Enter number (1-20):  wizard writes  (singular) but
the config loader only parsed  (plural). Now both
formats work. Ollama cloud endpoints (ollama.com/v1) get proper
Bearer auth with the API key from the setup wizard.
2026-06-11 22:05:02 +05:30
bff44b8b59 Fix config loading priority: check ~/.config/ first on all platforms
On macOS, dirs::config_dir() returns ~/Library/Application Support/,
NOT ~/.config/. This caused the loader to skip the actual config
file at ~/.config/gyandoot/config.toml and fall through to a stale
~/.gyandoot/config.yaml (which has no API keys).

Fix: Check ~/.config/gyandoot/config.toml explicitly FIRST via
home_dir(). This works identically on Linux and macOS.
2026-06-11 21:49:06 +05:30
fb01b2595a Fix: banner on launch, config file loading, 7 providers match setup wizard
BUGFIXES:
- Banner now displays on 'gyandoot run' via gyandoot_tui::banner::print_banner()
- Config now loads from ~/.config/gyandoot/config.toml with fallback chain
  (XDG -> ~/.gyandoot/config.yaml -> hardcoded defaults), fixing 401 errors
- gyandoot init now writes visible placeholder api_key for users to edit

NEW PROVIDERS (4 added, now 7 total matching setup wizard):
- Google Gemini: Native API with x-goog-api-key auth, streamingGenerateContent
- DeepSeek: OpenAI-compatible wrapper at api.deepseek.com/v1
- OpenRouter: With HTTP-Referer/X-Title headers, model routing
- Groq: OpenAI-compatible wrapper at api.groq.com/openai/v1

All compile with 0 errors.
2026-06-11 21:40:34 +05:30
dd21654555 P1 deep-dive: platform, security, subagents, skills, profile + installer fix
PLATFORM (gyandoot-platform):
- Telegram adapter: Long-polling, sendMessage, sendDocument, chat actions
- Discord adapter: REST polling, Bearer auth, channel discovery
- Webhook adapter: Hyper v1 HTTP server, HMAC-SHA256 verification
- CLI UX: Robot head banner, spinner, confirm prompts, colored output

SECURITY (gyandoot-security):
- CredentialVault: AES-256-GCM encrypted per-key files in ~/.gyandoot/vault/
- Sanitizer: PII redaction (email, phone, API keys, IPs), control char stripping
- ThreatDetector: Prompt injection, jailbreak, exfiltration detection with severity

SUBAGENTS (gyandoot-subagents):
- SubAgentWorker: Isolated agent loop with tool filtering and workdir
- SubAgentManager: Bounded concurrency via tokio::Semaphore
- Full lifecycle tracking and result collection

SKILLS (gyandoot-skills):
- SkillsManager: scan, load, inject_skills with YAML frontmatter parsing
- Preprocessor:  template resolution
- SkillBundle: JSON bundle serialization

PROFILE (gyandoot-profile):
- Profile struct with builder and validation
- ConfigResolver: env > symlink > profile > default chain
- ProfileManager: create, list, switch, delete, CRUD with real filesystem ops

INSTALLER FIX: Fixed camofox-browser directory escaping bug that caused
'could not find Cargo.toml' on macOS. Always CD back to project root.
2026-06-11 21:18:42 +05:30
54d8ca3774 P0 deep-dive: core, providers, agent, memory, TUI, setup wizard
DEEP DIVE — Agent Loop (gyandoot-agent):
- Real conversation loop with interactive (run()) and non-interactive
  (run_conversation()) modes
- Retry logic with exponential backoff and error classification
  (RateLimit, Auth, Timeout, ServerError, ContextOverflow)
- Context window management — token estimation, 75% threshold compression
- 7 built-in tools: Read, Write, Edit, Bash, Grep, Find, Ls
- BashTool with destructive-command security blocks
- ContextCompressor — prune tool results, summarize middle messages

DEEP DIVE — Memory (gyandoot-memory):
- Real MemPalace with ~/.gyandoot/palace/wings/<wing>/ directory tree
- Daily transcript files (YYYY-MM-DD_transcript.md) with append-only format
- L0/L1 identity persistence (< 157 tokens for L0)
- Session digest to drawer.md
- File persistence support for transcripts and identity store

DEEP DIVE — Core (gyandoot-core):
- GyandootConfig with TOML deserialization for all sections
- ConfigLoader with env > profile > file > default chain
- Rich types: Message, ToolCall, ToolResult, SessionId
- Comprehensive error types with thiserror derive

DEEP DIVE — Providers (gyandoot-providers):
- Provider trait with chat/chat_stream/models
- OpenAI provider with streaming SSE and function calling
- Anthropic provider with Messages API + tool use
- Ollama provider with merge_system/no_tools auto-detect
- SseParser, StreamEvent, TokenStream for SSE parsing
- ProviderFactory for creation from config

NEW — TUI crate (gyandoot-tui):
- Banner: Kapil-approved robot head ASCII art with ANSI colors
- Setup wizard: 7 providers, interactive config, connection test
- Terminal helpers: spinner, confirm, text input, selection menu
- Ratatui TUI: keyboard input, commands, status display

All 12 crates + CLI binary compile with 0 errors.
2026-06-11 20:53:38 +05:30
03c103061a Update KANBAN.md: Mark browser module as Done (P0) 2026-06-11 20:25:39 +05:30
605747023b Add camofox-browser integration: gyandoot-browser crate + agent tools
New crate: crates/gyandoot-browser/
  - client.rs: Full REST client for camofox-browser API (health, tabs,
    navigation, snapshots, click/type/scroll, search macros)
  - macros.rs: 14 SearchMacro enum (Google, YouTube, Amazon, Reddit,
    Wikipedia, Twitter, Yelp, Spotify, Netflix, LinkedIn, Instagram,
    TikTok, Twitch) with parse/display
  - snapshot.rs: PageSnapshot, PageLinks, NavigationResult, HealthResponse
  - session.rs: BrowserSession, SessionManager with idle cleanup

New module: crates/gyandoot-agent/src/browser_tools.rs
  - WebSearchTool: Search the web using anti-detection browser
  - WebBrowseTool: Browse URLs, click, type, scroll with element refs
  - register_browser_tools(): Wire both tools into ToolExecutor

CLI: Added
                                 o
                                 |
               - - - - - -     .---.     - - - - - -
          - - - - - - - - -  [ ^   ^ ]  - - - - - - - - -
             - - - - - - -   |  ___  |   - - - - - - -
                              `-----'
           ____ __   __  ___   _   _  ____   ___   ___  _____
          / ___|\ \ / / / _ \ | \ | ||  _ \ / _ \ / _ \|_   _|
         | |  _  \ V / / /_\ \|  \| || | | | | | | | | | | |
         | |_| |  | |  |  _  || |\  || |_| | |_| | |_| | | |
          \____/  |_|  |_| |_||_| \_||____/ \___/ \___/  |_|

        o - - - - - - -  knowledge. delivered. - - - - - - - o

Unknown command: browser
Run 'gyandoot help' for usage. subcommand with health/search/browse actions

Installer: Updated install.sh with camofox-browser cloning, Node.js
detection, npm dependency install, and systemd service setup

Camofox-browser running at http://localhost:9377 (Docker, verified working)

Workspace: 12 crates + CLI binary — cargo check passes with 0 errors.
2026-06-11 20:23:35 +05:30
851c838ca5 Initial scaffold: GyanDoot v2.0 in Rust
Full Cargo workspace with 11 crates:
- gyandoot-core: Shared types, config, error types
- gyandoot-agent: 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, sanitizer, threat detector
- gyandoot-kanban: Task decomposition, swarm orchestration, diagnostics
- gyandoot-subagents: Sub-agent spawning and orchestration
- gyandoot-skills: Skills discovery, loading, preprocessing, bundles
- gyandoot-profile: Multi-agent profile manager
- gyandoot-gateway: Gateway sessions, routing, access control

Plus: CLI entry point with clap, cross-platform installer script,
KANBAN.md, .gnpl/AGENTS.md

Workspace compiles clean: cargo check passes with 0 errors.
2026-06-11 20:04:12 +05:30