Skip to main content

Crate cersei_tools

Crate cersei_tools 

Source
Expand description

cersei-tools: Tool trait, built-in tool implementations, and permission system.

Modules§

apply_patch
ApplyPatch tool: apply unified diff patches to files.
ask_user
AskUserQuestion tool: prompt the user for input during agent execution.
bash
Bash tool: execute shell commands with persistent shell state.
bash_classifier
Bash command risk classification.
code_search
CodeSearch tool: hybrid BM25 + vector semantic search.
config_tool
ConfigTool: read and modify agent configuration.
cron
Cron tools: schedule, list, and delete recurring/one-shot tasks.
exa_search
ExaSearch tool: AI-powered web search via the Exa API (https://exa.ai).
file_edit
File edit tool: performs exact string replacements.
file_history
File history: track which files were accessed during a session.
file_read
File read tool.
file_snapshot
File snapshot system: stores before/after content per tool call for undo.
file_watcher
File watching: detect changes in the project directory.
file_write
File write tool.
git_utils
Git utilities: repo detection, status, diff, and history.
glob_tool
Glob tool: find files by pattern.
grep_tool
Grep tool: search file contents with regex.
lsp_tool
LSP tool: query language servers for code intelligence.
notebook_edit
NotebookEdit tool: edit Jupyter/IPython notebook cells.
permissions
Permission policies for tool execution.
plan_mode
Plan mode tools: enter/exit read-only planning mode.
powershell
PowerShell tool: execute PowerShell commands (Windows/cross-platform).
remote_trigger
RemoteTrigger tool: fire cross-session events.
send_message
SendMessage tool: inter-agent message passing.
skill_tool
Skill tool: load and execute skill prompt templates. Supports:
skills
Skills system: discover, load, and execute skill prompt templates.
sleep
Sleep tool: delay execution for a specified duration.
synthetic_output
SyntheticOutput tool: return structured JSON data for SDK/coordinator sessions.
tasks
Task system: create, track, update, and manage background tasks.
todo_write
TodoWrite tool: structured task list management.
tool_primitives
Tool primitives — low-level building blocks for agent tools.
tool_search
ToolSearch tool: search available tools by name or description.
web_fetch
WebFetch tool: fetch and parse web page content.
web_search
WebSearch tool: search the web via a configurable search API.
worktree
Worktree tools: create/exit isolated git worktrees for parallel work.

Structs§

CostTracker
Tracks cumulative token usage and cost.
Extensions
Type-map for injecting custom data into the tool context.
ShellState
ToolContext
ToolResult

Enums§

PermissionLevel
ToolCategory

Traits§

Tool
ToolExecute
Typed tool execution trait — used with #[derive(Tool)].

Functions§

all
All built-in tools (35 tools).
clear_session_shell_state
coding
All coding-oriented tools (filesystem + shell + web).
estimate_cost
Estimate USD cost from token counts based on model pricing (per 1M tokens).
filesystem
File system tools: Read, Write, Edit, Glob, Grep, NotebookEdit.
none
No tools (for pure chat agents).
orchestration
Orchestration tools: SendMessage, Tasks, Worktree.
planning
Planning tools: EnterPlanMode, ExitPlanMode, TodoWrite.
scheduling
Scheduling tools: Cron (Create/List/Delete), Sleep, RemoteTrigger.
session_shell_state
shell
Shell tools: Bash, PowerShell.
web
Web tools: WebFetch, WebSearch, ExaSearch.