Expand description
Plugin SDK for the tau agent.
This crate provides everything a plugin author needs in one place:
- The
ToolExecutortrait (the tool execution abstraction) - The
tunnelmodule for plugin ↔ server communication - Re-exports of all plugin-relevant types from
tau-agent-base
Re-exports§
pub use executor::ToolExecutor;
Modules§
Structs§
- Assistant
Message - Cancel
Token - Shared cancellation flag for tool execution.
- Compaction
Summary Message - Context
- Cost
- Hook
Message - Hook
Result - Image
Content - Info
Message - Model
- Model
Cost - Plugin
Command - Plugin
Registration - Plugin
Tool Def - Plugin
Tool Result - Session
Info - Stream
Options - Text
Content - Thinking
Content - Tool
- Tool
Call - Tool
Prompt - A tool’s contribution to the system prompt.
- Tool
Result Message - Usage
- User
Message
Enums§
- Agent
Phase - Current phase of the agent loop, broadcast to subscribers for UI display.
The TUI also derives phase implicitly from certain stream events
(see
App::update_phase_from_eventin tau-agent-tui). - Assistant
Content - Cache
Retention - Prompt-cache retention hint. Mirrors pi-ai’s
CacheRetention. - Error
- Message
- Plugin
Message - Plugin
Request - Post
Idle Action - Tier-3 actions the server performs after the calling session’s lock is released — i.e. after the agent loop exits. Used for side effects that need exclusive access to the caller’s session or its subtree.
- Post
Persist Action - Tier-2 actions the server performs after persisting a tool result, still inside the calling session’s agent loop (lock held).
- Request
- Response
- Stop
Reason - Stream
Event - Thinking
Display - How thinking content is returned in the response.
- Thinking
Effort - Effort level for adaptive thinking (Anthropic Opus 4.6+, Sonnet 4.6).
- Thinking
Style - How the model supports extended thinking/reasoning.
- Tool
Result Content - User
Content
Functions§
- data_
dir - Returns the tau data directory (
$XDG_DATA_HOME/tauor~/.local/share/tau). - default_
tool_ prompts - Built-in tool prompts for the default tools (bash, read, edit, write).
- read_
json_ line - Read a single JSON line (sync). Returns
Ok(None)on EOF. - timestamp_
ms - write_
json_ line - Serialize
valas a single JSON line and flush the writer (sync).