Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

release-app make click/pixel API publicly available

Louis Beaumont872a5ee6b38f
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index fab874f28..757a00929 100644
--- a/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "0.42.8"
+version = "0.42.9"
description = ""
authors = ["you"]
license = ""
diff --git a/screenpipe-server/Cargo.toml b/screenpipe-server/Cargo.toml
index 74980b1b5..f18ef2883 100644
--- a/screenpipe-server/Cargo.toml
+++ b/screenpipe-server/Cargo.toml
@@ -97,7 +97,7 @@ tempfile = "3.3.0"
url = { version = "2.2.0", optional = true }
-enigo = { version = "0.3", optional = true }
+enigo = "0.3"
# Bincode for serializing hot cache
bincode = "1.3.3"
@@ -131,7 +131,7 @@ metal = ["candle/metal", "candle-nn/metal", "candle-transformers/metal"]
cuda = ["candle/cuda", "candle-nn/cuda", "candle-transformers/cuda"]
mkl = ["candle/mkl", "candle-nn/mkl", "candle-transformers/mkl"]
llm = []
-experimental = ["enigo"]
+experimental = []
debug-console = ["console-subscriber"]
[[bin]]
diff --git a/screenpipe-server/src/server.rs b/screenpipe-server/src/server.rs
index 215651e6c..33dfc197a 100644
--- a/screenpipe-server/src/server.rs
+++ b/screenpipe-server/src/server.rs
@@ -72,8 +72,6 @@ use tokio::{
use tower_http::{cors::Any, trace::TraceLayer};
use tower_http::{cors::CorsLayer, trace::DefaultMakeSpan};
-// At the top of the file, add:
-#[cfg(feature = "experimental")]
use enigo::{Enigo, Key, Settings};
use std::str::FromStr;
@@ -1069,9 +1067,6 @@ impl SCServer {
// Create the OpenAPI server
let app = self.create_router(enable_frame_cache).await;
- #[cfg(feature = "experimental")]
- let app = app.route("/experimental/input_control", post(input_control_handler));
-
// Create the listener
let listener = TcpListener::bind(&self.addr).await?;
info!("Server listening on {}", self.addr);
@@ -1155,6 +1150,7 @@ impl SCServer {
.post("/experimental/operator", find_elements_handler)
.post("/experimental/operator/click", click_element_handler)
.post("/experimental/operator/type", type_text_handler)
+ .post("/experimental/input_control", input_control_handler)
.post("/audio/start", start_audio)
.post("/audio/stop", stop_audio)
.get("/semantic-search", semantic_search_handler)
@@ -1477,7 +1473,6 @@ pub(crate) async fn add_to_database(
}))
}
-#[cfg(feature = "experimental")]
async fn input_control_handler(
JsonResponse(payload): JsonResponse<InputControlRequest>,
) -> Result<JsonResponse<InputControlResponse>, (StatusCode, JsonResponse<Value>)> {
@@ -1512,7 +1507,6 @@ async fn input_control_handler(
Ok(JsonResponse(InputControlResponse { success: true }))
}
-#[cfg(feature = "experimental")]
fn key_from_string(key: &str) -> Result<Key, (StatusCode, JsonResponse<Value>)> {
match key {
"enter" => Ok(Key::Return),
@@ -1525,7 +1519,6 @@ fn key_from_string(key: &str) -> Result<Key, (StatusCode, JsonResponse<Value>)>
}
}
-#[cfg(feature = "experimental")]
fn mouse_button_from_string(
button: &str,
) -> Result<enigo::Button, (StatusCode, JsonResponse<Value>)> {
@@ -1541,13 +1534,11 @@ fn mouse_button_from_string(
}
// Add these new structs:
-#[cfg(feature = "experimental")]
#[derive(Deserialize, Debug)]
struct InputControlRequest {
action: InputAction,
}
-#[cfg(feature = "experimental")]
#[derive(Deserialize, Debug)]
#[serde(tag = "type", content = "data")]
enum InputAction {
@@ -1557,7 +1548,6 @@ enum InputAction {
WriteText(String),
}
-#[cfg(feature = "experimental")]
#[derive(Serialize)]
struct InputControlResponse {
success: bool,
@@ -2519,11 +2509,11 @@ async fn get_pipe_build_status(
let pipe_dir = state.screenpipe_dir.join("pipes").join(&pipe_id);
let update_temp_dir = std::env::temp_dir().join(format!("{}_update", pipe_id));
let temp_dir = pipe_dir.with_extension("_temp");
-
+
// 1. First check if the update temp directory exists
if update_temp_dir.exists() {
debug!("Update temp directory exists for pipe: {}", pipe_id);
-
+
// Check if there's a pipe.json in the update temp directory
let update_pipe_json_path = update_temp_dir.join("pipe.json");
if update_pipe_json_path.exists() {
@@ -2539,17 +2529,22 @@ async fn get_pipe_build_status(
let pipe_config: Value = serde_json::from_str(&pipe_json).map_err(|e| {
(
StatusCode::INTERNAL_SERVER_ERROR,
- JsonResponse(json!({"error": format!("Failed to parse update temp pipe config: {}", e)})),
+ JsonResponse(
+ json!({"error": format!("Failed to parse update temp pipe config: {}", e)}),
+ ),
)
})?;
// Return the buildStatus if it exists
if let Some(build_status) = pipe_config.get("buildStatus") {
- debug!("Found build status in update temp directory for pipe: {}", pipe_id);
+ debug!(
+ "Found build status in update temp directory for pipe: {}",
+ pipe_id
+ );
return Ok(JsonResponse(build_status.clone()));
}
}
-
+
// If no buildStatus found in update temp directory, return a default in_progress status
return Ok(JsonResponse(json!({
"status": "in_progress",
@@ -2568,7 +2563,9 @@ async fn get_pipe_build_status(
.map_err(|e| {
(
StatusCode::INTERNAL_SERVER_ERROR,
- JsonResponse(json!({"error": format!("Failed to read pipe config: {}", e)})),
+ JsonResponse(
+ json!({"error": format!("Failed to read pipe config: {}", e)}),
+ ),
)
})?;
@@ -2587,7 +2584,10 @@ async fn get_pipe_build_status(
} else {
// Pipe directory exists but pipe.json doesn't exist yet
// This likely means the pipe is still being created
- debug!("Pipe directory exists but pipe.json not found for pipe: {}", pipe_id);
+ debug!(
+ "Pipe directory exists but pipe.json not found for pipe: {}",
+ pipe_id
+ );
return Ok(JsonResponse(json!({
"status": "in_progress",
"step": "creating_config",
@@ -2624,7 +2624,7 @@ async fn get_pipe_build_status(
return Ok(JsonResponse(build_status.clone()));
}
}
-
+
// Temp directory exists but no pipe.json or no buildStatus
return Ok(JsonResponse(json!({
"status": "in_progress",
@@ -2632,7 +2632,7 @@ async fn get_pipe_build_status(
"message": "Initializing pipe"
})));
}
-
+
// If neither pipe directory nor temp directory exists, return not found
return Err((
StatusCode::NOT_FOUND,