Skip to main content

Crate tau_agent_plugin

Crate tau_agent_plugin 

Source
Expand description

Plugin SDK for the tau agent.

This crate provides everything a plugin author needs in one place:

  • The ToolExecutor trait (the tool execution abstraction)
  • The tunnel module for plugin ↔ server communication
  • Re-exports of all plugin-relevant types from tau-agent-base

Re-exports§

pub use executor::ToolExecutor;

Modules§

executor
Tool execution abstraction.
tunnel
Plugin ↔ server tunnel helpers.

Structs§

AssistantMessage
CancelToken
Shared cancellation flag for tool execution.
CompactionSummaryMessage
Context
Cost
HookMessage
HookResult
ImageContent
InfoMessage
Model
ModelCost
PluginCommand
PluginRegistration
PluginToolDef
PluginToolResult
SessionInfo
StreamOptions
TextContent
ThinkingContent
Tool
ToolCall
ToolPrompt
A tool’s contribution to the system prompt.
ToolResultMessage
Usage
UserMessage

Enums§

AgentPhase
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_event in tau-agent-tui).
AssistantContent
CacheRetention
Prompt-cache retention hint. Mirrors pi-ai’s CacheRetention.
Error
Message
PluginMessage
PluginRequest
PostIdleAction
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.
PostPersistAction
Tier-2 actions the server performs after persisting a tool result, still inside the calling session’s agent loop (lock held).
Request
Response
StopReason
StreamEvent
ThinkingDisplay
How thinking content is returned in the response.
ThinkingEffort
Effort level for adaptive thinking (Anthropic Opus 4.6+, Sonnet 4.6).
ThinkingStyle
How the model supports extended thinking/reasoning.
ToolResultContent
UserContent

Functions§

data_dir
Returns the tau data directory ($XDG_DATA_HOME/tau or ~/.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 val as a single JSON line and flush the writer (sync).

Type Aliases§

Result