Skip to main content

Module prelude

Module prelude 

Source
Expand description

Common type re-exports.

Import everything with use echo_agent::prelude::*.

Re-exports§

pub use crate::agent::AgentConfig;
pub use crate::agent::AgentRole;
pub use crate::agent::ReactAgent;
pub use crate::agent::ReactAgentBuilder;
pub use crate::agent::Runner;
pub use crate::agent::StructuredAgent;
pub use crate::config::AppConfig;
pub use crate::tools::builtin::think::ThinkTool;
pub use crate::workflow::WorkflowDefinition;

Structs§

ActivateSkillTool
Tool for model-driven skill activation.
AnthropicClient
AuditCallback
基于 AgentCallback 的审计日志自动记录器
AuditEvent
Audit event
AuditFilter
审计查询过滤器
CancellationToken
A token which can be used to signal a cancellation request to one or more tasks.
ChatChunk
Streaming response chunk
ChatRequest
Chat request parameters
ChatResponse
Chat response
CircuitBreaker
Circuit Breaker
CircuitBreakerConfig
Circuit breaker configuration
CompressionInput
Compression pipeline input
CompressionOutput
Compression pipeline output
ConcurrentWorkflow
Concurrent workflow: all registered agents execute in parallel; results are merged via a merge function.
ContextManager
Context manager: maintains full conversation history and automatically triggers compression when tokens exceed the limit.
DagWorkflow
DAG workflow: nodes execute in topological order; independent nodes run concurrently.
DefaultPermissionPolicy
Default permission policy (retains backward compatibility)
DockerSandbox
Docker 容器沙箱
EmbeddingStore
向量增强 Store:在任意 Store 外包装余弦相似度语义检索
FileAuditLogger
文件审计日志记录器
FileCheckpointer
JSON file-based persistent Checkpointer
FileStore
JSON file-based persistent Store
FileSystemSkill
Filesystem skill
ForceCompressStats
Compression statistics returned by force_compress()
Graph
Compiled graph workflow (immutable)
GraphBuilder
Graph workflow builder
GraphResult
Graph execution result
GuardManager
Guard manager
HeuristicTokenizer
Heuristic Tokenizer that estimates token count using character weights.
HookRegistry
Registry of hooks from all activated skills.
HookResult
Result of executing a hook.
HookRule
A hook rule: a matcher pattern + one or more actions.
HooksDefinition
Complete hooks definition from a skill’s frontmatter.
HttpEmbedder
OpenAI-compatible HTTP embedding client
HybridCompressor
混合压缩:将多个 ContextCompressor 串联为有序管道
ImageFetchToolmedia
Image fetch tool
ImageUrl
Image URL or Base64 data
InMemoryAuditLogger
内存审计日志记录器
InMemoryCheckpointer
In-process memory Checkpointer, state is lost on restart, suitable for tests
InMemoryStore
In-process memory Store, no persistence, suitable for testing and short-lived use
JsonSchemaSpec
JSON Schema spec for structured output
K8sSandbox
Kubernetes Pod 沙箱
LlmConfig
LLM 运行时配置(依赖注入模式)
LlmGuardcontent-guard
LLM guard
LocalSandbox
本地沙箱执行器
Message
Conversation message
OllamaClient
OpenAiClient
OpenAI-compatible client.
PrepareResult
Result of ContextManager::prepare() — includes the prepared messages and optional compression stats if auto-compression was triggered.
PromptContext
Context for variable substitution and command execution.
ProviderFactory
Provider 工厂:通过配置字符串自动实例化 LLM 客户端
ReadSkillResourceTool
Tool for reading resource files from activated skill directories.
ResourceLimits
Resource limits
RetryPolicy
Unified retry policy configuration
RuleGuardcontent-guard
Rule guard
RuleGuardBuildercontent-guard
RuleGuard builder
RunSkillScriptTool
Tool for executing scripts from activated skill directories.
SandboxCommand
Sandbox execution command
SandboxManager
沙箱管理器:统一调度三层沙箱
SandboxPolicy
沙箱策略:根据命令和上下文决定所需隔离级别
SandboxResult
Execution result
SequentialWorkflow
Sequential workflow: each agent runs in registration order; the former’s output flows into the latter’s input.
SharedState
Shared state for graph workflows
ShellSkill
Shell command execution skill
SimpleTokenizer
Simple Tokenizer: byte_count / 4 + 1 (backward compatible with old behavior)
SkillContent
Full skill content returned when a skill is activated (Tier 2).
SkillDescriptor
Lightweight skill metadata loaded at discovery time (Tier 1).
SkillInfo
Metadata snapshot for an installed code-based skill.
SkillLoader
Multi-scope skill loader with agentskills.io-compliant parsing.
SkillRegistry
Central skill lifecycle manager.
SkillResourceEntry
A bundled resource file discovered in the skill directory.
SlidingWindowCompressor
滑动窗口压缩:保留最近 window_size 条非 system 消息,裁掉更早的部分。
SnapshotManager
管理状态快照的环形缓冲区
SqliteStoresqlite
SQLite persistent Store with FTS5 full-text search and optional vector search
StateSnapshot
单次状态快照,记录某一时刻的完整对话历史
StepOutput
Detailed output of a single step execution
StoreItem
A single record in the Store
SummaryCompressor
LLM 摘要压缩策略。
ToolCall
A single tool call initiated by the LLM
ToolDefinition
Tool definition sent to the LLM
ToolExecutionConfig
Tool execution config: timeout, retry, concurrency
ToolResult
工具执行结果
WebFetchToolweb
Web page fetching tool
WebFetchToolEnhancedmedia
Enhanced web fetch tool with image download support
WebSearchToolweb
Web search tool
WorkflowOutput
Complete output of a workflow execution

Enums§

AgentEvent
Events produced during Agent execution
AuditEventType
Audit event types
ContentPart
A single component of message content (multimodal)
DiscoveryScope
Where to scan for skills.
GuardDirection
Guard check direction
GuardResult
Guard check result
HookAction
A single hook action.
HookEvent
When a hook fires relative to tool execution.
IsolationLevel
Isolation level
LlmProvider
LLM 供应商类型
MessageContent
Message content: compatible with both plain text and multimodal parts forms.
PermissionDecision
Permission decision
ResponseFormat
Response format control
SecurityLevel
安全级别
SkillResourceKind
Classification of a bundled resource file.
SkillSource
Source of a skill (affects security policy).
SnapshotPolicy
自动快照策略
StepType
Parsed step type from LLM response
ToolPermission
Tool permission types
WorkflowEvent
Step-by-step events emitted during workflow execution.

Traits§

Agent
Unified Agent execution interface
AgentCallback
Agent lifecycle callback interface
AuditLogger
审计日志记录器 trait
Checkpointer
Persistence interface for short-term conversation memory
ContextCompressor
Unified interface for all compression strategies (async, supports dyn trait object)
Embedder
Text embedding interface: maps text to dense float vectors
Guard
Guard trait
LlmClient
LLM client unified interface
PermissionPolicy
Permission policy trait
SandboxExecutor
Sandbox executor unified interface.
Skill
Agent skill – a higher-level capability unit that bundles related tools with an optional system-prompt injection.
Store
Unified storage interface for long-term memory
Tokenizer
Token counter abstraction
Tool
Tool interface trait
Workflow
Unified workflow execution interface

Functions§

default_summary_prompt
使用内置中文模板生成默认摘要提示词。
shared_agent
Wrap arbitrary impl Agent as a SharedAgent
with_retry
Execute an async operation with the given retry policy (all errors are considered retryable).
with_retry_if
Execute an async operation with the given retry policy.

Type Aliases§

AgentBuilder
Alias for backward compatibility.
Result
Convenience Result alias
SharedAgent
Shareable agent handle for safe access across async tasks
ToolParameters
Tool parameter type