Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# CLAUDE.md - RustBot Development Guide
# CLAUDE.md - RustFox Development Guide

## Project Overview

RustBot is a Telegram AI assistant written in Rust. It connects to Telegram as a bot, uses OpenRouter LLM for inference (default model: `qwen/qwen3-235b-a22b`), provides built-in sandboxed tools (file I/O, command execution), and supports MCP (Model Context Protocol) servers for extensible tool integration. It implements an agentic loop that iterates tool calls until a final text response is produced (max 10 iterations).
RustFox is a Telegram AI assistant written in Rust. It connects to Telegram as a bot, uses OpenRouter LLM for inference (default model: `qwen/qwen3-235b-a22b`), provides built-in sandboxed tools (file I/O, command execution), and supports MCP (Model Context Protocol) servers for extensible tool integration. It implements an agentic loop that iterates tool calls until a final text response is produced (max 10 iterations).

## Build & Run

Expand Down Expand Up @@ -74,7 +74,7 @@ src/
- **Edition**: 2021
- **Async runtime**: Tokio with `full` features
- **Error handling**: `anyhow::Result` throughout, with `.context()` / `.with_context()` for error messages
- **Logging**: `tracing` crate with `tracing-subscriber` (env filter: `RUST_LOG`, default `info,rustbot=debug`)
- **Logging**: `tracing` crate with `tracing-subscriber` (env filter: `RUST_LOG`, default `info,rustfox=debug`)
- **Serialization**: `serde` derive macros with `#[serde(skip_serializing_if = "Option::is_none")]` for optional fields
- **Shared state**: `Arc<AppState>` passed via teloxide's dependency injection (`dptree::deps!`)
- **Concurrency**: `tokio::sync::Mutex` for per-user conversation map (not `std::sync::Mutex`)
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Contributing to RustBot
# Contributing to RustFox

Thanks for your interest in contributing. This project is open source under the [MIT License](LICENSE).

## How to contribute

- **Bugs or feature requests:** Open an [issue](https://github.com/chinkan/RustBot/issues).
- **Bugs or feature requests:** Open an [issue](https://github.com/chinkan/RustFox/issues).
- **Code or docs:** Open a pull request. We’re happy to review and merge improvements.

## Pull requests
Expand All @@ -16,4 +16,4 @@ Thanks for your interest in contributing. This project is open source under the

## Documentation and README

- When adding **screenshots or GIFs** to the README (or other docs), use **descriptive `alt` text** for the image. For example: `![RustBot Telegram chat showing tool use](screenshot.png)`. This helps accessibility and search discoverability.
- When adding **screenshots or GIFs** to the README (or other docs), use **descriptive `alt` text** for the image. For example: `![RustFox Telegram chat showing tool use](screenshot.png)`. This helps accessibility and search discoverability.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "rustbot"
name = "rustfox"
version = "0.1.0"
edition = "2021"

Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# RustBot — Telegram AI Assistant
<p align="center">
<img src="assets/logo.jpeg" alt="RustFox Logo" width="200"/>
</p>

[![CI](https://github.com/chinkan/RustBot/actions/workflows/ci.yml/badge.svg)](https://github.com/chinkan/RustBot/actions)
# RustFox — Telegram AI Assistant

[![CI](https://github.com/chinkan/RustFox/actions/workflows/ci.yml/badge.svg)](https://github.com/chinkan/RustFox/actions)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Buy Me a Coffee](https://img.shields.io/badge/buy%20me%20a%20coffee-%E2%98%95-yellow)](https://buymeacoffee.com/chinkan.ai)

Expand Down Expand Up @@ -50,9 +54,9 @@ The wizard will ask for your:
### 3. Run

```bash
cargo run --bin rustbot
cargo run --bin rustfox
# or with a custom config path:
cargo run --bin rustbot -- /path/to/config.toml
cargo run --bin rustfox -- /path/to/config.toml
```

## Configuration
Expand All @@ -68,15 +72,15 @@ See [`config.example.toml`](config.example.toml) for all options.
| `openrouter.api_key` | OpenRouter API key |
| `openrouter.model` | LLM model ID (default: `moonshotai/kimi-k2.5`) |
| `sandbox.allowed_directory` | Directory for file/command operations |
| `memory.database_path` | SQLite DB path (default: `rustbot.db`) |
| `memory.database_path` | SQLite DB path (default: `rustfox.db`) |
| `embedding` (optional) | Vector search API config (default model: `qwen/qwen3-embedding-8b`) |
| `skills.directory` | Folder of bot skill files (default: `skills/`) |
| `mcp_servers` | List of MCP servers to connect |
| `general.location` | Your location string (under `[general]`), injected into system prompt |

### MCP Server Configuration

RustBot supports the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) — an open standard for connecting AI assistants to external tools and data sources. Any MCP-compatible server can be plugged in via `config.toml`.
RustFox supports the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) — an open standard for connecting AI assistants to external tools and data sources. Any MCP-compatible server can be plugged in via `config.toml`.

#### Prerequisites

Expand Down Expand Up @@ -217,7 +221,7 @@ This project is open source under the [MIT License](LICENSE). Contributions are

## Support

If you find RustBot useful, consider supporting the project:
If you find RustFox useful, consider supporting the project:

[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-%E2%98%95-yellow?style=for-the-badge&logo=buy-me-a-coffee)](https://buymeacoffee.com/chinkan.ai)

Expand Down
Binary file added assets/logo.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions config.example.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RustBot Configuration
# RustFox Configuration

[telegram]
# Get your bot token from @BotFather on Telegram
Expand All @@ -25,12 +25,12 @@ Be concise and helpful."""
[sandbox]
# The directory where file operations and command execution are allowed
# The bot cannot access files outside this directory
allowed_directory = "/tmp/rustbot-sandbox"
allowed_directory = "/tmp/rustfox-sandbox"

[memory]
# Path to the SQLite database file for persistent memory
# Stores conversations, knowledge base, and vector embeddings
database_path = "rustbot.db"
database_path = "rustfox.db"

[skills]
# Directory containing skill markdown files
Expand Down Expand Up @@ -66,7 +66,7 @@ directory = "skills"
# [[mcp_servers]]
# name = "filesystem"
# command = "npx"
# args = ["-y", "@modelcontextprotocol/server-filesystem", "/tmp/rustbot-sandbox"]
# args = ["-y", "@modelcontextprotocol/server-filesystem", "/tmp/rustfox-sandbox"]

# Example: Web search MCP server with environment variables
# [[mcp_servers]]
Expand Down
8 changes: 4 additions & 4 deletions docs/plans/2026-02-16-ai-agent-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.

**Goal:** Transform RustBot from a Telegram-only AI chatbot into a modular AI agent framework with persistent memory, markdown-based skills, multi-platform support, and proactive background task scheduling.
**Goal:** Transform RustFox from a Telegram-only AI chatbot into a modular AI agent framework with persistent memory, markdown-based skills, multi-platform support, and proactive background task scheduling.

**Architecture:** Modular monolith with Cargo feature flags. Core agent logic extracted from `bot.rs` into a platform-agnostic `agent` module. Platform adapters (Telegram first, Discord-ready) implement a `Platform` trait. SQLite with FTS5 provides persistent conversations, knowledge base, and learning. Skills are natural-language markdown files loaded at runtime. Tokio-cron-scheduler handles background tasks.

Expand Down Expand Up @@ -543,7 +543,7 @@ pub struct MemoryConfig {
}

fn default_db_path() -> PathBuf {
PathBuf::from("rustbot.db")
PathBuf::from("rustfox.db")
}
```

Expand All @@ -569,7 +569,7 @@ fn default_memory_config() -> MemoryConfig {
```toml
[memory]
# Path to the SQLite database file for persistent memory
database_path = "rustbot.db"
database_path = "rustfox.db"
```

**Step 3: Verify it compiles**
Expand Down Expand Up @@ -2012,7 +2012,7 @@ async fn main() -> Result<()> {
tracing_subscriber::registry()
.with(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| "info,rustbot=debug".into()),
.unwrap_or_else(|_| "info,rustfox=debug".into()),
)
.with(tracing_subscriber::fmt::layer())
.init();
Expand Down
2 changes: 1 addition & 1 deletion docs/plans/2026-02-17-scheduling-tool-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ git commit -m "chore: cargo fmt and clippy fixes"
## Task 11: Push branch

```bash
git push -u origin claude/rustbot-scheduling-tool-nLhrR
git push -u origin claude/rustfox-scheduling-tool-nLhrR
```

---
Expand Down
12 changes: 6 additions & 6 deletions docs/plans/2026-02-18-update-agent-skills-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Goal:** Update **two** skill directories to fully conform to Anthropic's official Claude agent skills specification:

1. **`skills/`** — RustBot's own bot skills (loaded into the Telegram bot's LLM system prompt by `src/skills/loader.rs`). Currently uses flat `.md` files → convert to `skill-name/SKILL.md` folder format.
1. **`skills/`** — RustFox's own bot skills (loaded into the Telegram bot's LLM system prompt by `src/skills/loader.rs`). Currently uses flat `.md` files → convert to `skill-name/SKILL.md` folder format.
2. **`.claude/skills/`** — Claude Code development skills (used by Claude when working on this project). Already uses folder format but has minor compliance issues to fix.

**Tech Stack:** Plain markdown, YAML frontmatter, Rust (no code changes needed — loader already supports folder format), Git
Expand Down Expand Up @@ -33,9 +33,9 @@ description: Use when... # max 1024 chars; no XML tags; triggering conditions o

---

## Part A: RustBot Bot Skills (`skills/`)
## Part A: RustFox Bot Skills (`skills/`)

### How RustBot Skills Work
### How RustFox Skills Work

`src/skills/loader.rs` loads skills from the directory configured in `config.toml` (`[skills] directory = "skills"`). `src/skills/mod.rs` builds a context string from them, injected into the LLM system prompt as:

Expand All @@ -48,7 +48,7 @@ The loader **already supports both formats**:
- `skills/my-skill.md` — flat file (current, to be replaced)
- `skills/my-skill/SKILL.md` — folder format (target)

RustBot skills also support an optional `tags` field in frontmatter (RustBot extension, not in Claude spec).
RustFox skills also support an optional `tags` field in frontmatter (RustFox extension, not in Claude spec).

### Current State Audit

Expand Down Expand Up @@ -198,7 +198,7 @@ git commit -m "docs: update CLAUDE.md to document folder-based skills format"

## Part B: Claude Code Skills (`.claude/skills/`)

These are used by Claude Code when developing RustBot, not by the bot itself.
These are used by Claude Code when developing RustFox, not by the bot itself.

### Current State Audit

Expand Down Expand Up @@ -325,7 +325,7 @@ Add a `hooks` section to `.claude/settings.json`:
| Format check | `cargo fmt --check` / `prettier --check .` |
| Multiple checks | Chain with `&&` |

## Example: RustBot
## Example: RustFox

```json
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Write the complete new README with these sections (in order):
Full content:

```markdown
# RustBot — Telegram AI Assistant
# RustFox — Telegram AI Assistant

[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Buy Me a Coffee](https://img.shields.io/badge/buy%20me%20a%20coffee-☕-yellow)](https://buymeacoffee.com/chinkan.ai)
Expand Down Expand Up @@ -240,7 +240,7 @@ See [`config.example.toml`](config.example.toml) for all options.
| `openrouter.api_key` | OpenRouter API key |
| `openrouter.model` | LLM model ID (default: `moonshotai/kimi-k2.5`) |
| `sandbox.allowed_directory` | Directory for file/command operations |
| `memory.database_path` | SQLite DB path (default: `rustbot.db`) |
| `memory.database_path` | SQLite DB path (default: `rustfox.db`) |
| `embedding` (optional) | Vector search API config (default model: `qwen/qwen3-embedding-8b`) |
| `skills.directory` | Folder of bot skill files (default: `skills/`) |
| `mcp_servers` | List of MCP servers to connect |
Expand Down Expand Up @@ -337,7 +337,7 @@ Feel free to:

## Support

If you find RustBot useful, consider supporting the project:
If you find RustFox useful, consider supporting the project:

[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-☕-yellow?style=for-the-badge&logo=buy-me-a-coffee)](https://buymeacoffee.com/chinkan.ai)

Expand Down
2 changes: 1 addition & 1 deletion docs/plans/2026-02-20-setup-load-existing-config-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Store `config_path` (already present). The handler reads from the same path.

### `save_config` print fix

Update the success `println!` to say `cargo run --bin rustbot` (already done in prior commit but `setup.rs` still has the old string — fix here).
Update the success `println!` to say `cargo run --bin rustfox` (already done in prior commit but `setup.rs` still has the old string — fix here).

## Frontend Design (`setup/index.html`)

Expand Down
14 changes: 7 additions & 7 deletions docs/plans/2026-02-20-setup-load-existing-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ println!(" Run the bot with: cargo run\n");
```
to:
```rust
println!(" Run the bot with: cargo run --bin rustbot\n");
println!(" Run the bot with: cargo run --bin rustfox\n");
```

### Step 4: Verify
Expand Down Expand Up @@ -417,8 +417,8 @@ const state = {
max_tokens: '4096',
system_prompt: 'You are a helpful AI assistant ...',
location: '',
sandbox_dir: '/tmp/rustbot-sandbox',
db_path: 'rustbot.db',
sandbox_dir: '/tmp/rustfox-sandbox',
db_path: 'rustfox.db',
mcp_selections: {},
custom_mcp_servers: [], // NEW
_loaded: false, // NEW — true when existing config was found
Expand Down Expand Up @@ -497,7 +497,7 @@ In the step-1 template inside `buildSteps()`, add the banner div right before th
**Before:**
```js
c.innerHTML += `<div class="step" id="step-1">
<h1>Welcome to RustBot</h1>
<h1>Welcome to RustFox</h1>
<p class="subtitle">
Your personal AI assistant on Telegram, powered by OpenRouter LLMs and extensible via MCP tools.<br><br>
This wizard creates your <code>config.toml</code> in about 2 minutes.
Expand All @@ -509,7 +509,7 @@ In the step-1 template inside `buildSteps()`, add the banner div right before th
**After:**
```js
c.innerHTML += `<div class="step" id="step-1">
<h1>Welcome to RustBot</h1>
<h1>Welcome to RustFox</h1>
<p class="subtitle">
Your personal AI assistant on Telegram, powered by OpenRouter LLMs and extensible via MCP tools.<br><br>
This wizard creates your <code>config.toml</code> in about 2 minutes.
Expand Down Expand Up @@ -594,9 +594,9 @@ function esc(s) {
### Step 3: Pre-fill step 4 (Sandbox & Memory)

```js
<input type="text" id="f-sandbox-dir" value="${esc(state.sandbox_dir || '/tmp/rustbot-sandbox')}">
<input type="text" id="f-sandbox-dir" value="${esc(state.sandbox_dir || '/tmp/rustfox-sandbox')}">
...
<input type="text" id="f-db-path" value="${esc(state.db_path || 'rustbot.db')}">
<input type="text" id="f-db-path" value="${esc(state.db_path || 'rustfox.db')}">
```

### Step 4: Pre-check catalog MCP checkboxes
Expand Down
26 changes: 13 additions & 13 deletions docs/plans/2026-02-20-setup-wizard-web-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if [[ "${1:-}" == "--cli" ]]; then
exit 0
fi

echo "Starting RustBot setup wizard at http://localhost:$PORT"
echo "Starting RustFox setup wizard at http://localhost:$PORT"
echo "Press Ctrl+C to exit."

python3 "$SCRIPT_DIR/setup/server.py" "$PORT" "$SCRIPT_DIR" &
Expand All @@ -97,7 +97,7 @@ chmod +x setup.sh

```python
#!/usr/bin/env python3
"""Minimal HTTP server for RustBot setup wizard."""
"""Minimal HTTP server for RustFox setup wizard."""
import http.server
import json
import os
Expand Down Expand Up @@ -191,7 +191,7 @@ This task creates the skeleton: header, step container, navigation buttons, CSS.
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RustBot Setup</title>
<title>RustFox Setup</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
Expand Down Expand Up @@ -324,8 +324,8 @@ const state = {
max_tokens: '4096',
system_prompt: `You are a helpful AI assistant with access to tools. Use the available tools to help the user with their tasks. When using file or terminal tools, operate only within the allowed sandbox directory. Be concise and helpful.`,
location: '',
sandbox_dir: '/tmp/rustbot-sandbox',
db_path: 'rustbot.db',
sandbox_dir: '/tmp/rustfox-sandbox',
db_path: 'rustfox.db',
mcp_selections: {}, // { toolName: { selected: bool, env: { KEY: val } } }
};

Expand Down Expand Up @@ -512,7 +512,7 @@ function buildSteps() {
// Step 1: Welcome
container.innerHTML += `
<div class="step" id="step-1">
<h1>Welcome to RustBot</h1>
<h1>Welcome to RustFox</h1>
<p class="subtitle">Your personal AI assistant on Telegram, powered by OpenRouter LLMs and extensible via MCP tools.<br><br>This wizard will guide you through creating your <code>config.toml</code> in about 2 minutes.</p>
</div>`;

Expand Down Expand Up @@ -566,11 +566,11 @@ function buildSteps() {
<h2>Sandbox &amp; Memory</h2>
<div class="field">
<label>Sandbox Directory <span class="hint">— bot's file/command scope</span></label>
<input type="text" id="f-sandbox-dir" value="/tmp/rustbot-sandbox">
<input type="text" id="f-sandbox-dir" value="/tmp/rustfox-sandbox">
</div>
<div class="field">
<label>Memory Database Path</label>
<input type="text" id="f-db-path" value="rustbot.db">
<input type="text" id="f-db-path" value="rustfox.db">
</div>
</div>`;

Expand Down Expand Up @@ -672,18 +672,18 @@ Replace the `--cli` block in `setup.sh`:

```bash
if [[ "${1:-}" == "--cli" ]]; then
echo "=== RustBot CLI Setup ==="
echo "=== RustFox CLI Setup ==="
echo ""

read -rp "Telegram bot token: " TG_TOKEN
read -rp "Allowed user IDs (comma-separated): " USER_IDS
read -rp "OpenRouter API key: " OR_KEY
read -rp "Model [qwen/qwen3-235b-a22b]: " OR_MODEL
OR_MODEL="${OR_MODEL:-qwen/qwen3-235b-a22b}"
read -rp "Sandbox directory [/tmp/rustbot-sandbox]: " SANDBOX
SANDBOX="${SANDBOX:-/tmp/rustbot-sandbox}"
read -rp "Memory DB path [rustbot.db]: " DBPATH
DBPATH="${DBPATH:-rustbot.db}"
read -rp "Sandbox directory [/tmp/rustfox-sandbox]: " SANDBOX
SANDBOX="${SANDBOX:-/tmp/rustfox-sandbox}"
read -rp "Memory DB path [rustfox.db]: " DBPATH
DBPATH="${DBPATH:-rustfox.db}"
read -rp "Your location (optional, e.g. Tokyo, Japan): " LOCATION

IDS_ARR=$(echo "$USER_IDS" | tr ',' '\n' | tr -d ' ' | paste -sd ', ')
Expand Down
Loading