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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
release-app attempt fix sideload #1533
Louis Beaumontc39053e98578
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.tomlindex f84632712..22f2618f0 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.39.5"+version = "0.39.6"description = ""authors = ["you"]license = ""diff --git a/screenpipe-core/src/pipes.rs b/screenpipe-core/src/pipes.rsindex f77d04355..5f8ca85d6 100644--- a/screenpipe-core/src/pipes.rs+++ b/screenpipe-core/src/pipes.rs@@ -78,6 +78,20 @@ fn generate_cron_secret() -> String {// Update this function near the top of the filefn sanitize_pipe_name(name: &str) -> String {+ // First check if this is a GitHub URL and extract the repo name+ if let Ok(url) = Url::parse(name) {+ if url.host_str() == Some("github.com") {+ let path_segments: Vec<&str> = url.path_segments().unwrap().collect();+ if path_segments.len() >= 2 {+ // Use the repository name (second segment) instead of branch name+ let repo_name = path_segments[1];+ debug!("Using repository name for pipe: {}", repo_name);+ return repo_name.to_string();+ }+ }+ }++ // Fall back to original sanitization logic for non-GitHub URLslet re = Regex::new(r"[^a-zA-Z0-9_-]").unwrap();let sanitized = re.replace_all(name, "-").to_string();@@ -789,6 +803,19 @@ pub async fn download_pipe(source: &str, screenpipe_dir: PathBuf) -> anyhow::Reslet mut pipe_name =sanitize_pipe_name(Path::new(source).file_name().unwrap().to_str().unwrap());+ // For GitHub URLs, extract the repository name directly+ if !is_local {+ if let Ok(url) = Url::parse(source) {+ if url.host_str() == Some("github.com") {+ let path_segments: Vec<&str> = url.path_segments().unwrap().collect();+ if path_segments.len() >= 2 {+ pipe_name = path_segments[1].to_string();+ debug!("Using repository name for pipe: {}", pipe_name);+ }+ }+ }+ }+// Add _local suffix for local pipesif is_local {pipe_name.push_str("_local");@@ -1047,25 +1074,37 @@ fn download_github_folder(// Extract repo info from URLlet path_segments: Vec<&str> = url.path_segments().unwrap().collect();- let (owner, repo, _, branch) = (- path_segments[0],- path_segments[1],- path_segments[2],- path_segments[3],- );++ // Handle both URL formats: with and without /tree/branch+ let (owner, repo, branch) = if path_segments.contains(&"tree") {+ // Format: /owner/repo/tree/branch+ let tree_pos = path_segments.iter().position(|&s| s == "tree").unwrap();+ (+ path_segments[0],+ path_segments[1],+ path_segments[tree_pos + 1],+ )+ } else {+ // Format: /owner/repo+ (path_segments[0], path_segments[1], "main") // Default to main branch+ };// Extract the base path for subfolder downloads- let base_path = url- .path_segments()- .and_then(|segments| {- let segments: Vec<_> = segments.collect();- if segments.len() >= 5 && segments[2] == "tree" {- Some(segments[4..].join("/"))- } else {- None- }- })- .unwrap_or_default();+ let base_path = if path_segments.contains(&"tree") {+ url.path_segments()+ .and_then(|segments| {+ let segments: Vec<_> = segments.collect();+ if segments.len() >= 5 && segments[2] == "tree" {+ Some(segments[4..].join("/"))+ } else {+ None+ }+ })+ .unwrap_or_default()+ } else {+ // No subfolder for URLs without /tree/branch format+ String::new()+ };debug!("base path for download: {}", base_path);@@ -1078,7 +1117,7 @@ fn download_github_folder(.ok_or_else(|| anyhow::anyhow!("missing path in github response"))?;// Skip if file is not in the target directory- if !path.starts_with(&base_path) {+ if !base_path.is_empty() && !path.starts_with(&base_path) {continue;}@@ -1098,8 +1137,12 @@ fn download_github_folder(if item_type == "blob" {// Calculate relative path from base_path- let relative_path = if let Some(stripped) = path.strip_prefix(&base_path) {- stripped.trim_start_matches('/')+ let relative_path = if !base_path.is_empty() && path.starts_with(&base_path) {+ if let Some(stripped) = path.strip_prefix(&base_path) {+ stripped.trim_start_matches('/')+ } else {+ path+ }} else {path};@@ -1141,6 +1184,25 @@ fn get_raw_github_url(url: &str) -> anyhow::Result<String> {let parsed_url = Url::parse(url)?;if parsed_url.host_str() == Some("github.com") {let path_segments: Vec<&str> = parsed_url.path_segments().unwrap().collect();++ // Handle URLs without /tree/branch format (assume main branch)+ if path_segments.len() >= 2 && !path_segments.contains(&"tree") {+ let owner = path_segments[0];+ let repo = path_segments[1];+ let branch = "main"; // Default to main branch++ let raw_url = format!(+ "https://api.github.com/repos/{}/{}/git/trees/{}?recursive=1",+ owner, repo, branch+ );+ debug!(+ "Converted to GitHub API URL with default branch: {}",+ raw_url+ );+ return Ok(raw_url);+ }++ // Original logic for URLs with /tree/branch formatif path_segments.len() >= 4 && path_segments.contains(&"tree") {// Find the position of "tree" in the pathlet tree_pos = path_segments.iter().position(|&s| s == "tree").unwrap();diff --git a/screenpipe-server/src/pipe_manager.rs b/screenpipe-server/src/pipe_manager.rsindex 3deb19e9f..721bbfa64 100644--- a/screenpipe-server/src/pipe_manager.rs+++ b/screenpipe-server/src/pipe_manager.rs@@ -210,15 +210,12 @@ impl PipeManager {let pipe_dir = download_pipe(&normalized_url, self.screenpipe_dir.clone()).await?;- // Check if the URL is a local path- let is_local = normalized_url.starts_with('/') || normalized_url.starts_with('.');-// update the config with the source urlself.update_config(&pipe_dir.file_name().unwrap().to_string_lossy(),serde_json::json!({"source": normalized_url,- "enabled": is_local,+ "enabled": true, // always enable the pipe}),).await?;