Skip to content

feat: add send_file built-in tool to send files from sandbox to Telegram#42

Merged
chinkan merged 16 commits into
mainfrom
feat/send-file-from-sandbox
Jun 15, 2026
Merged

feat: add send_file built-in tool to send files from sandbox to Telegram#42
chinkan merged 16 commits into
mainfrom
feat/send-file-from-sandbox

Conversation

@chinkan

@chinkan chinkan commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a send_file built-in tool allowing the AI agent to send files from the sandbox to the Telegram user
  • Follows the existing tool-based pattern — agent calls an explicit tool when it wants to send a file
  • Sandbox path validation reused via validate_sandbox_path()
  • File size checked before reading (50 MB Telegram limit)
  • Friendly status message: "📤 Sending a file"
  • Embed skills and agents at compile time via include_dir crate (no more CWD-relative path issues for systemd service)
  • Remove two-layer SkillRegistry (instance + bundled with SkillSource) — simplified to single-layer
  • Remove src/bin/setup.rs and setup.sh — use rustfox --setup instead
  • Fix web wizard JS to only emit [skills]/[agents] sections when user provides non-empty values
  • Fix /update-skills to backup modified files before overwriting (creates .bak)
  • Remove bundled_directory from SkillsConfig/AgentsConfig — paths resolve under home by Config::resolve

What Changed

File Change
src/tools.rs Made validate_sandbox_path pub; added send_file ToolDefinition
src/agent.rs Added send_file execution arm with Telegram send_document API call, ChatId plumbing; simplified SkillRegistry to single-layer; unified Available Agents section
src/platform/tool_notifier.rs Added "📤 Sending a file" friendly name
src/skills/mod.rs Removed SkillSource enum; simplified SkillRegistry to single skills HashMap; extracted shared preamble helper
src/skills/embed.rs New — embedded skills/agents via include_dir! with seed + overwrite (backup) support
src/skills/loader.rs Simplified to single-dir loading (no more SkillSource)
src/skills/seed.rs Removed two-layer seed logic
src/skills/update.rs Removed lock-file-based update logic
src/config.rs Removed bundled_directory from SkillsConfig/AgentsConfig
src/main.rs Replaced two-layer skill/agent loading with single-dir; uses embed::seed_* instead of seed::seed_dir_if_empty
src/platform/telegram.rs /update-skills uses embed::overwrite_* with backup report
src/learning.rs Updated load_skills_from_dir calls to single-dir signature
src/supervisor/classifier.rs Updated SkillRegistry::register call (no SkillSource)
tests/supervisor_skill_packs.rs Updated load_skills_from_dir call (no SkillSource)
src/setup/wizard.rs Removed hardcoded [skills] directory = "skills"; updated default model to kimi-k2.6
src/setup/service.rs Added {{RUSTFOX_PATH}} placeholder for systemd template
setup.sh Removed — use rustfox --setup
src/bin/setup.rs Removed — use rustfox --setup
skills-lock.json Removed — replaced by embedded seed
Cargo.toml Added include_dir dependency
config.example.toml Removed bundled_directory references
scripts/services/rustfox.service.template Added PATH environment variable
setup/index.html Fixed to only emit [skills]/[agents] when user provides non-empty values
skills/news-fetcher/SKILL.md Fixed stale invoke_subagentinvoke_agent references
skills/problem-solver/SKILL.md Fixed stale invoke_subagentinvoke_agent references

Test Plan

  • cargo build --release — builds clean
  • cargo clippy -- -D warnings — no warnings
  • cargo fmt --check — formatting clean
  • cargo test — 378 tests pass

chinkan added 13 commits June 12, 2026 16:40
…d(0), Context import, optional caption, tool ordering
- Remove two-layer SkillRegistry (instance + bundled with SkillSource)
- Embed skills/ and agents/ at compile time via include_dir crate
- Simplify SkillRegistry to single-layer skills map
- Remove src/bin/setup.rs and setup.sh (use rustfox --setup instead)
- Fix web wizard JS to only emit [skills]/[agents] when user provides values
- Fix /update-skills to backup modified files before overwriting
- Remove bundled_directory from SkillsConfig/AgentsConfig
- Fix all reload handlers to use full registry replacement
- Extract format_listed_section() shared preamble helper used by both
  build_context() (skills) and the new Available Agents section builder.
- Rename build_subagent_context -> build_subagent_lines for accuracy.
- Extract format_available_agents_section() pure function with 5 unit tests.
- Remove redundant early return in build_agents_context().
- Update invoke_agent tool description to reference unified section.
- Fix stale invoke_subagent references in news-fetcher/problem-solver skills.
chinkan added 3 commits June 15, 2026 16:58
…re into docs/

- README.md: trimmed 449→135 lines — hero, 8 feature bullets, 4-step quick
  start, key config, tool overview, architecture link, contributing footer
- docs/GUIDE.md (new): full reference — all config settings, MCP servers,
  7 tool categories, wired commands, skills/agents, advanced features,
  roadmap, dependencies
- docs/ARCHITECTURE.md (new): source tree, data flow diagram, component
  table, agentic loop explanation
- Fixed config key: memory.user_model_path → learning.user_model_path
- Added memory tools (remember, recall, search_memory) to tool reference
- Supervisor commands correctly marked as 'Planned' (not yet dispatched)
- Spec doc reviewed and approved via spec-document-reviewer subagent
…hotai/kimi-k2.6

The actual default model in config.rs is moonshotai/kimi-k2.6.
qwen/qwen3-embedding-8b references are correct (embedding model).
Replaces the one-liner with a structured problem/solution
description following Option D per user's choice.
@chinkan chinkan merged commit 83793a0 into main Jun 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant