8 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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