Skip to main content

limit_cli/tools/browser/
types.rs

1//! Data types for browser operations
2
3use serde::{Deserialize, Serialize};
4
5/// Result from snapshot operation
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct SnapshotResult {
8    /// The accessibility tree as markdown
9    pub content: String,
10    /// Page title if available
11    pub title: Option<String>,
12    /// Current URL
13    pub url: Option<String>,
14}
15
16/// Information about a browser tab
17#[derive(Debug, Clone, Serialize, Deserialize)]
18pub struct TabInfo {
19    /// Tab index
20    pub index: usize,
21    /// Tab title
22    pub title: String,
23}
24
25/// Element bounding box
26#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct BoundingBox {
28    /// X coordinate
29    pub x: f64,
30    /// Y coordinate
31    pub y: f64,
32    /// Width
33    pub width: f64,
34    /// Height
35    pub height: f64,
36}
37
38/// Cookie information
39#[derive(Debug, Clone, Serialize, Deserialize)]
40pub struct Cookie {
41    /// Cookie name
42    pub name: String,
43    /// Cookie value
44    pub value: String,
45}
46
47/// Network request information
48#[derive(Debug, Clone, Serialize, Deserialize)]
49pub struct Request {
50    /// HTTP method
51    pub method: String,
52    /// Request URL
53    pub url: String,
54}