1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! Tauri Automation Plugin
//!
//! Provides HTTP API for external automation of Tauri v2 applications.
//! Enables Claude Code and other tools to control Tauri apps for testing.
//!
//! **Note:** Rust crate supports Tauri v2 only. The JavaScript API supports both v1 and v2.
//!
//! ## Usage
//!
//! ```toml
//! tauri-plugin-automation-server = { git = "https://github.com/dcherrera/tauri-plugin-automation" }
//! ```
//!
//! ```rust,ignore
//! tauri::Builder::default()
//! .setup(|app| {
//! tauri_plugin_automation_server::start_server(app.handle().clone());
//! Ok(())
//! })
//! ```
use Mutex;
use AppHandle;
/// Global screenshot data buffer
static SCREENSHOT_DATA: = new;
/// Store screenshot data from JavaScript
/// Take screenshot data (clears buffer)
/// Start the automation HTTP server
///
/// Call this in your Tauri setup to enable external automation.
///
/// # Example
/// ```rust,ignore
/// tauri::Builder::default()
/// .setup(|app| {
/// tauri_plugin_automation_server::start_server(app.handle().clone());
/// Ok(())
/// })
/// ```
/// Receive screenshot data from JavaScript
///
/// Users should create their own command wrapper:
/// ```rust,ignore
/// #[tauri::command]
/// fn automation_screenshot_data(data: String) {
/// tauri_plugin_automation_server::set_screenshot_data(data);
/// }
/// ```