Expand description
LLM session controller and tool execution. LLM session controller and tool execution framework.
Modules§
- session
- Session management and context compaction. LLM session management with automatic context compaction.
- stateless
- Stateless execution support. Stateless LLM execution without session management.
- tools
- Tool execution and user interaction. Tool execution framework with built-in tools.
- types
- Core types for controller communication. Core types for controller communication and message handling.
- usage
- Token usage tracking. Token usage tracking and metrics.
Structs§
- Answer
- Answer to a question - simplified to just question text and answer values.
- AskFor
Permissions Tool - Tool that requests permission from the user for sensitive actions.
- AskUser
Questions Request - Request to ask user questions.
- AskUser
Questions Response - Response containing answers to questions.
- AskUser
Questions Tool - Tool that asks the user structured questions.
- Bash
Tool - Tool that executes bash commands with permission checks.
- Compact
Result - Result of a manual compaction operation.
Used by
force_compact()to report what happened during compaction. - Compaction
Config - Configuration for conversation compaction
- Controller
Input Payload - Payload for input to the controller
- Display
Config - Configuration for how a tool should be displayed in the UI.
- Display
Result - Formatted display result from a tool.
- Edit
File Tool - Tool that performs find-and-replace operations on files.
- FromLLM
Payload - Payload for responses from the LLM
- Glob
Tool - Tool that finds files matching glob patterns with permission checks.
- Grant
- A permission grant combining a target and permission level.
- Grep
Tool - Tool that searches file contents using ripgrep with permission checks.
- LLMController
- The main LLM controller that manages sessions and coordinates communication
- LLMSession
- A session that manages communication with an LLM
- LLMSession
Config - Configuration for creating an LLM session
- LLMSession
Manager - Manages multiple LLM sessions
- LLMTool
- Tool definition for function calling.
- LsTool
- Tool that lists directory contents.
- Multi
Edit Tool - Tool that performs multiple find-and-replace operations atomically.
- Pending
Permission Info - Information about a pending permission request for UI display.
- Pending
Question Info - Information about a pending interaction for UI display.
- Permission
Panel Response - Response from the UI to a permission request.
- Permission
Registry - Registry for managing permission grants and requests.
- Permission
Request - A request for permission to perform an operation.
- Read
File Tool - Tool that reads files from the filesystem.
- Request
Options - Request options that can override config defaults.
- Session
Status - Current status of an LLM session
- Stateless
Config - Configuration for creating a stateless executor.
- Stateless
Executor - Stateless executor for single LLM requests without session state. Safe for concurrent use - multiple tasks can call execute simultaneously.
- Stateless
Result - Result from a stateless execution.
- ToLLM
Payload - Payload for requests sent to the LLM
- Token
Meter - Token meter for tracking input and output tokens.
- Token
Usage - Token usage statistics for the session
- Token
Usage Tracker - Thread-safe token usage tracker. Tracks usage by session, model, and total.
- Tool
Batch Result - Batch result containing all results from parallel tool executions.
- Tool
Context - Context provided to tools during execution.
- Tool
Definition - Tool definition for the LLM.
- Tool
Executor - Manages tool execution with support for parallel batch execution.
- Tool
Registry - Thread-safe registry for managing available tools.
- Tool
Request - Request to execute a tool.
- Tool
Result - Result from a single tool execution.
- Turn
Counter - Thread-safe counter for generating turn numbers
- TurnId
- Identifies a turn in the conversation (e.g., “u1”, “a1”, “u2”, “a2”)
- User
Interaction Registry - Registry for managing pending user interactions.
- Validation
Error - Validation error response.
- Validation
Error Detail - Detail about a single validation error.
- WebSearch
Tool - Tool that performs web searches using Claude’s built-in capability.
- Write
File Tool - Tool that writes files to the filesystem with permission checks.
Enums§
- Content
Block - A content block within a message
- Control
Cmd - Control commands for the controller
- Controller
Error - Error type for controller operations.
- Controller
Event - Event emitted by the controller
- Grant
Target - The target of a permission grant.
- Grep
Output Mode - Output mode for grep results.
- Input
Type - Type of input to the controller
- LLMProvider
- LLM provider type
- LLMRequest
Type - Type of request being sent to the LLM
- LLMResponse
Type - Type of response from the LLM
- Message
- A message in the conversation
- Message
Role - Role of a message in the conversation
- Permission
Error - Error types for permission operations.
- Permission
Level - Permission level that determines what operations are allowed.
- Question
- Question types supported by the tool.
- Result
Content Type - Content type for formatting tool results.
- Stateless
Error - Errors that can occur during stateless execution.
- Tool
Compaction - Defines how tool results are handled during compaction.
- Tool
Result Status - Result status from tool execution.
- Tool
Type - Tool type classification.
- User
Interaction Error - Error types for user interaction operations.
- Validation
Error Code - Error codes for validation failures.
Constants§
- ASK_
FOR_ PERMISSIONS_ TOOL_ DESCRIPTION - AskForPermissions tool description constant.
- ASK_
FOR_ PERMISSIONS_ TOOL_ NAME - AskForPermissions tool name constant.
- ASK_
FOR_ PERMISSIONS_ TOOL_ SCHEMA - AskForPermissions tool JSON schema constant.
- ASK_
USER_ QUESTIONS_ TOOL_ DESCRIPTION - AskUserQuestions tool description constant.
- ASK_
USER_ QUESTIONS_ TOOL_ NAME - AskUserQuestions tool name constant.
- ASK_
USER_ QUESTIONS_ TOOL_ SCHEMA - AskUserQuestions tool JSON schema constant.
- BASH_
TOOL_ DESCRIPTION - Bash tool description constant.
- BASH_
TOOL_ NAME - Bash tool name constant.
- BASH_
TOOL_ SCHEMA - Bash tool JSON schema constant.
- DEFAULT_
CHANNEL_ SIZE - Default channel buffer size for internal communication. This applies to all async channels: LLM responses, tool results, UI events, etc. Can be overridden via AgentConfig::channel_buffer_size().
- EDIT_
FILE_ TOOL_ DESCRIPTION - EditFile tool description constant.
- EDIT_
FILE_ TOOL_ NAME - EditFile tool name constant.
- EDIT_
FILE_ TOOL_ SCHEMA - EditFile tool JSON schema constant.
- GLOB_
TOOL_ DESCRIPTION - Glob tool description constant.
- GLOB_
TOOL_ NAME - Glob tool name constant.
- GLOB_
TOOL_ SCHEMA - Glob tool JSON schema constant.
- GREP_
TOOL_ DESCRIPTION - Grep tool description constant.
- GREP_
TOOL_ NAME - Grep tool name constant.
- GREP_
TOOL_ SCHEMA - Grep tool JSON schema constant.
- LS_
TOOL_ DESCRIPTION - Ls tool description constant.
- LS_
TOOL_ NAME - Ls tool name constant.
- LS_
TOOL_ SCHEMA - Ls tool JSON schema constant.
- MULTI_
EDIT_ TOOL_ DESCRIPTION - MultiEdit tool description constant.
- MULTI_
EDIT_ TOOL_ NAME - MultiEdit tool name constant.
- MULTI_
EDIT_ TOOL_ SCHEMA - MultiEdit tool JSON schema constant.
- READ_
FILE_ TOOL_ DESCRIPTION - ReadFile tool description constant.
- READ_
FILE_ TOOL_ NAME - ReadFile tool name constant.
- READ_
FILE_ TOOL_ SCHEMA - ReadFile tool JSON schema constant.
- WEB_
SEARCH_ TOOL_ DESCRIPTION - Web Search tool description constant.
- WEB_
SEARCH_ TOOL_ NAME - Web Search tool name constant.
- WEB_
SEARCH_ TOOL_ SCHEMA - Web Search tool JSON schema constant.
- WRITE_
FILE_ TOOL_ DESCRIPTION - WriteFile tool description constant.
- WRITE_
FILE_ TOOL_ NAME - WriteFile tool name constant.
- WRITE_
FILE_ TOOL_ SCHEMA - WriteFile tool JSON schema constant.
Traits§
- Executable
- Trait for executable tools.