Expand description
Claude-Code-shaped agent loop for DeepSeek.
See https://code.claude.com/docs/en/agent-sdk/agent-loop. The crate-level re-exports give you:
run— the core function that returns a stream ofSdkMessage.AgentBuilder/DeepSeekAgent— back-compat builder API.Tool/ToolDefinition— extend with custom tools.RunOptions,PermissionMode,PreToolHook— control the loop.
With the builtin-tools feature enabled, builtin_tools::default_tools
returns Read / Write / Edit / Glob / Grep / Bash ready to plug in.
Re-exports§
pub use builder::AgentBuilder;pub use builder::DeepSeekAgent;pub use loop_runner::run;pub use messages::ContentBlock;pub use messages::ResultSubtype;pub use messages::SdkMessage;pub use messages::SystemSubtype;pub use options::CompactionConfig;pub use options::RunOptions;pub use permissions::PermissionDecision;pub use permissions::PermissionMode;pub use permissions::PreToolHook;pub use tool::Tool;pub use tool::ToolDefinition;
Modules§
- builder
- Back-compatible
AgentBuilder/DeepSeekAgentover the new streaming loop. Existing callers (e.g.crates/research,crates/genesis) keep working unchanged. - builtin_
tools - Built-in tools — same names and rough semantics as the Claude Agent SDK
built-ins. The
builtin-toolsfeature gives you Read/Write/Edit/Glob/ Grep/Bash. Theschedulerfeature adds CronCreate/CronList/CronDelete/ Monitor. - loop_
runner - Claude-Code-shaped streaming agent loop.
- messages
- SDK message types — mirrors the Claude Agent SDK message stream.
- options
- Options passed into
crate::agent::run. - permissions
- Permission gating for tool calls.
- pricing
- Per-model USD pricing for cost reporting.
- scheduler
- Session-scoped cron scheduler matching Claude Code’s
/loopsemantics. - tool
Tooltrait andToolDefinitionschema — verbatim from the originalagent.rs, extended withTool::read_only_hintused by the loop’s parallel-dispatch and permission logic.