Expand description
§Spider Agent Types
Pure data types and constants for spider_agent automation.
This crate contains all the type definitions, system prompts, and helper
utilities extracted from spider_agent that have minimal dependencies.
Use this crate when you need automation types without the full agent runtime.
§Dependencies
Only serde, serde_json, aho-corasick, and llm_models_spider — no heavy
runtime deps like tokio, reqwest, dashmap, or chromey.
§Feature Highlights
- Action types and results
- Page observation and interactive element types
- Chain execution types (sync data structures)
- Confidence tracking
- Configuration types (AutomationConfig, RemoteMultimodalConfig)
- Content analysis (with aho-corasick)
- HTML diff types
- Memory operations
- Planning types
- System prompt constants
- Schema generation types
- Self-healing selector types
- Synthesis types
- Tool calling types
- JSON/text helper utilities
Modules§
- categories
- URL category constants.
Structs§
- ActResult
- Result of a single action execution via
act(). - Action
Record - Record of an action taken during automation.
- Action
Result - Result of an action execution.
- Action
Tool Schemas - Generator for automation action tool schemas.
- Alternative
- An alternative action with its confidence score.
- Automation
Config - Main automation configuration.
- Automation
Memory - In-memory storage for agentic automation sessions.
- Automation
Result - Result of an automation operation.
- Automation
Usage - Token usage tracking for automation operations with granular call tracking.
- Capture
Profile - Capture profile for screenshots and HTML.
- Chain
Builder - Builder for creating action chains.
- Chain
Context - Context for evaluating chain conditions.
- Chain
Result - Result of an action chain execution.
- Chain
Step - A single step in an action chain.
- Chain
Step Result - Result of a single step in an action chain.
- Checkpoint
- A checkpoint condition to verify after a step.
- Checkpoint
Result - Result of a checkpoint verification.
- Clip
Viewport - Clip viewport for screenshots.
- Concurrent
Chain Config - Configuration for concurrent chain execution.
- Concurrent
Chain Result - Result of executing a concurrent chain.
- Confidence
Retry Strategy - Strategy for retrying based on confidence.
- Confidence
Summary - Summary of confidence statistics.
- Confidence
Tracker - Tracker for confidence statistics across an automation session.
- Confident
Step - A step with confidence score and alternatives.
- Content
Analysis - Result of analyzing HTML content.
- Dependency
Graph - Dependency graph for managing step execution order.
- Dependent
Step - A step in a dependency chain.
- Diff
Stats - Statistics about HTML diff performance.
- Discovered
Url - A discovered URL with AI-generated metadata.
- Element
Change - A single element change.
- Execution
Plan - An execution plan from the LLM.
- Extraction
Schema - Schema for structured data extraction.
- Form
Field - A field in a form.
- Form
Info - Information about a form on the page.
- Function
Call - A function call from the LLM.
- Function
Definition - OpenAI-compatible function definition.
- Generated
Schema - A generated JSON schema.
- Healed
Selector Cache - Cache for healed selectors.
- Healing
Diagnosis - Diagnosis and suggested fix from the LLM.
- Healing
Request - A request to heal a failed selector.
- Healing
Result - Result of a healing attempt.
- Healing
Stats - Statistics about healing operations.
- Html
Diff Result - Result of computing an HTML diff.
- Interactive
Element - An interactive element on the page.
- MapResult
- Result of the
map()API call for page discovery. - Model
Capabilities - Re-exports from llm_models_spider for auto-updated model intelligence.
- Model
Endpoint - A model endpoint override for dual-model routing.
- Model
Info Entry - Re-exports from llm_models_spider for auto-updated model intelligence.
- Model
Policy - Policy for selecting models based on cost/quality tradeoffs.
- Model
Pricing - Re-exports from llm_models_spider for auto-updated model intelligence.
- Model
Profile - Re-exports from llm_models_spider for auto-updated model intelligence.
- Model
Ranks - Re-exports from llm_models_spider for auto-updated model intelligence.
- Multi
Page Context - Multi-page context for synthesis.
- Navigation
Option - A navigation option on the page.
- Page
Context - Context for a single page in multi-page synthesis.
- Page
Contribution - Contribution of a single page to the synthesis.
- Page
Observation - Observation of a page’s current state.
- Page
State - Current page state for re-planning context.
- Page
State Diff - Tracker for page state changes across rounds.
- Plan
Execution State - State of plan execution.
- Planned
Step - A single step in an execution plan.
- Planning
Mode Config - Configuration for planning mode.
- Prompt
UrlGate - URL-based prompt gating for per-URL config overrides.
- Remote
Multimodal Config - Runtime configuration for
RemoteMultimodalEngine. - Replan
Context - Context for re-planning after a failure.
- Retry
Policy - Retry policy for automation operations.
- Schema
Cache - Cache for generated schemas.
- Schema
Generation Request - Request to generate a schema from examples.
- Selector
Cache - Self-healing selector cache.
- Selector
Cache Entry - A single entry in the selector cache.
- Self
Healing Config - Configuration for self-healing behavior.
- Step
Result - Result of executing a single step.
- Structured
Output Config - Configuration for structured output mode.
- Synthesis
Config - Configuration for multi-page synthesis.
- Synthesis
Result - Result of multi-page synthesis.
- Tool
Call - A tool call from the LLM response.
- Tool
Definition - OpenAI-compatible tool definition.
- Verification
- Verification to run after an action.
Enums§
- Action
Type - Types of actions that can be performed.
- Chain
Condition - Condition for conditional execution in action chains.
- Change
Type - Type of change to an element.
- Checkpoint
Type - Type of checkpoint verification.
- Cleaning
Intent - Intent for HTML cleaning decisions.
- Cost
Tier - Cost tier for model selection.
- Html
Cleaning Profile - HTML cleaning profile for content processing.
- Html
Diff Mode - Mode for HTML diffing.
- Memory
Operation - Memory operation requested by the LLM.
- Reasoning
Effort - Reasoning effort level for models that support explicit reasoning controls.
- Recovery
Strategy - Recovery strategy for handling failures during automation.
- Selector
Issue Type - Types of selector issues.
- Tool
Calling Mode - Mode for how actions should be formatted in LLM requests.
- Verification
Type - Types of verification checks.
- Vision
Route Mode - Routing mode that decides when to use the vision vs text model.
Constants§
- ACT_
SYSTEM_ PROMPT - System prompt for the
act()single-action API. - CHROME_
AI_ SYSTEM_ PROMPT - Compact system prompt for Chrome’s built-in LanguageModel (Gemini Nano).
- CONFIGURATION_
SYSTEM_ PROMPT - System prompt for configuring a web crawler from natural language.
- DEFAULT_
SYSTEM_ PROMPT - Default system prompt for web automation (iterative). This is the foundation for all web automation tasks - kept lean with core action bindings and agentic reasoning only. Challenge-specific strategies should be injected via system_prompt_extra or skill modules.
- EXTRACTION_
ONLY_ SYSTEM_ PROMPT - Focused system prompt for extraction-only mode (
extra_ai_data=true,max_rounds<=1). - EXTRACT_
SYSTEM_ PROMPT - System prompt for the
extract()data extraction API. - MAP_
SYSTEM_ PROMPT - System prompt for the
map()URL discovery API. - MODEL_
INFO - Re-exports from llm_models_spider for auto-updated model intelligence.
- OBSERVE_
SYSTEM_ PROMPT - System prompt for the
observe()page understanding API.
Functions§
- arena_
rank - Re-exports from llm_models_spider for auto-updated model intelligence.
- build_
schema_ generation_ prompt - Build a prompt for LLM-assisted schema generation.
- extract_
assistant_ content - Extract the assistant’s text content from an OpenAI-compatible response.
- extract_
html_ context - Extract HTML context around a selector’s expected location.
- extract_
last_ code_ block - Extract the LAST
jsonor ``` code block from text. - extract_
last_ json_ array - Extract the last JSON array from text with proper brace matching.
- extract_
last_ json_ boundaries - Extract the last balanced JSON object or array from text.
- extract_
last_ json_ object - Extract the last JSON object from text with proper brace matching.
- extract_
usage - Extract token usage from an OpenAI-compatible response.
- fnv1a64
- FNV-1a 64-bit hash function for cheap content hashing.
- generate_
schema - Generate a schema from a request.
- infer_
schema - Infer a JSON schema from a value.
- infer_
schema_ from_ examples - Infer a schema from multiple examples, merging field information.
- is_
url_ allowed - Check if a URL is allowed by the gate.
- merged_
config - Merge a base config with an override config.
- model_
profile - Re-exports from llm_models_spider for auto-updated model intelligence.
- parse_
tool_ calls - Parse tool calls from an OpenAI-compatible response.
- reasoning_
payload - Build a provider-compatible reasoning payload when configured.
- refine_
schema - Refine a schema by adding more examples.
- supports_
pdf - Re-exports from llm_models_spider for auto-updated model intelligence.
- supports_
video - Re-exports from llm_models_spider for auto-updated model intelligence.
- supports_
vision - Re-exports from llm_models_spider for auto-updated model intelligence.
- tool_
calls_ to_ steps - Convert tool calls to automation step actions.
- truncate_
utf8_ tail - Take the last
max_bytesof a UTF-8 string without splitting code points.