Spider Agent Types
Pure data types and constants for spider_agent automation with zero heavy runtime dependencies.
Overview
This crate extracts all type definitions, system prompts, and helper utilities from spider_agent into a lightweight, dependency-minimal package. Use it when you need automation types without the full agent runtime (no tokio, reqwest, dashmap, or chromey).
Installation
[]
= "0.1"
What's Included
- Action Types —
ActionType(30+ variants),ActionResult,ActionRecord - Chain Execution —
ChainStep,ChainCondition,ChainBuilderfor sequential action chains - Concurrent Chains —
DependencyGraph,DependentStepfor parallel execution with dependency ordering - Confidence Tracking —
ConfidenceTracker,ConfidenceRetryStrategyfor smarter retry decisions - Configuration —
RemoteMultimodalConfig,AutomationConfig,ModelProfile,ModelCapabilities - Content Analysis —
ContentAnalysiswith aho-corasick for fast HTML structure detection - HTML Diff —
PageStateDiff,HtmlDiffResultfor 50-70% token reduction between rounds - Memory Operations —
AutomationMemory,MemoryOperationfor session state - Page Observation —
PageObservation,InteractiveElement,FormInfo - Planning —
PlanningModeConfig,ExecutionPlan,PlannedStepwith checkpoints - System Prompts —
DEFAULT_SYSTEM_PROMPT,CHROME_AI_SYSTEM_PROMPT, and 6 more - Schema Generation —
generate_schema(),infer_schema(),SchemaCache - Selector Cache —
SelectorCachewith LRU eviction and reliability scoring - Self-Healing —
SelfHealingConfig,HealingRequest,HealedSelectorCache - Synthesis —
SynthesisConfig,MultiPageContextfor multi-page analysis - Tool Calling —
ToolCallingMode,ToolDefinition,parse_tool_calls()for OpenAI-compatible function calling - Helpers — JSON extraction, LLM response parsing, FNV hashing, UTF-8 truncation
Quick Start
use ;
// Create automation config
let config = new;
// Analyze HTML content
let analysis = analyze;
println!;
println!;
// Parse LLM responses
use ;
let json = extract_last_json_object;
Model Registry
Built-in model profiles for 40+ models with capabilities and pricing:
use ;
if let Some = model_profile
Dependencies
| Crate | Purpose |
|---|---|
serde + serde_json |
Serialization |
aho-corasick |
Fast multi-pattern matching for content analysis |
llm_models_spider |
Model capabilities detection |
License
MIT