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

feat: auto-update store pipes + bump app v2.3.30, CLI v0.3.265

Louis Beaumontdb3ead5c37dc
diff --git a/Cargo.lock b/Cargo.lock
index f08c0001a..2f083700a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6737,7 +6737,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.263"
+version = "0.3.265"
dependencies = [
"anyhow",
"audiopipe",
@@ -6797,7 +6797,7 @@ dependencies = [
[[package]]
name = "screenpipe-config"
-version = "0.3.263"
+version = "0.3.265"
dependencies = [
"dirs 6.0.0",
"serde",
@@ -6810,7 +6810,7 @@ dependencies = [
[[package]]
name = "screenpipe-connect"
-version = "0.3.263"
+version = "0.3.265"
dependencies = [
"anyhow",
"async-trait",
@@ -6839,7 +6839,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.263"
+version = "0.3.265"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -6885,7 +6885,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.263"
+version = "0.3.265"
dependencies = [
"anyhow",
"chrono",
@@ -6911,7 +6911,7 @@ dependencies = [
[[package]]
name = "screenpipe-engine"
-version = "0.3.263"
+version = "0.3.265"
dependencies = [
"anyhow",
"async-trait",
@@ -6981,7 +6981,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.263"
+version = "0.3.265"
dependencies = [
"anyhow",
"chrono",
@@ -6999,7 +6999,7 @@ dependencies = [
[[package]]
name = "screenpipe-screen"
-version = "0.3.263"
+version = "0.3.265"
dependencies = [
"accessibility-sys",
"anyhow",
@@ -7039,7 +7039,7 @@ dependencies = [
[[package]]
name = "screenpipe-vault"
-version = "0.3.263"
+version = "0.3.265"
dependencies = [
"argon2",
"chacha20poly1305",
diff --git a/Cargo.toml b/Cargo.toml
index 962b93a42..d56ba7bd5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,7 @@ exclude = ["apps/screenpipe-app-tauri/src-tauri", "crates/screenpipe-integration
resolver = "2"
[workspace.package]
-version = "0.3.264"
+version = "0.3.265"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/screenpipe/screenpipe"
diff --git a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
index 4fb5013d2..0edeedc7c 100644
--- a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
@@ -163,6 +163,28 @@ export default function GeneralSettings() {
</Card>
)}
+ <Card className="border-border bg-card">
+ <CardContent className="px-3 py-2.5">
+ <div className="flex items-center justify-between">
+ <div className="flex items-center space-x-2.5">
+ <RefreshCw className="h-4 w-4 text-muted-foreground shrink-0" />
+ <div>
+ <h3 className="text-sm font-medium text-foreground">Auto-update pipes</h3>
+ <p className="text-xs text-muted-foreground">Update store pipes you haven&apos;t modified</p>
+ </div>
+ </div>
+ <Switch
+ id="auto-update-pipes-toggle"
+ checked={settings?.autoUpdatePipes ?? true}
+ onCheckedChange={(checked) =>
+ handleSettingsChange({ autoUpdatePipes: checked })
+ }
+ className="ml-4"
+ />
+ </div>
+ </CardContent>
+ </Card>
+
{!isEnterprise && (
<Card className="border-border bg-card">
<CardContent className="px-3 py-2.5">
diff --git a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
index fb38240a7..fd75feb37 100644
--- a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
@@ -73,6 +73,14 @@ import { pipeExecutionToConversation } from "@/lib/pipe-ndjson-to-chat";
import { saveConversationFile } from "@/lib/chat-storage";
import { UpgradeDialog } from "@/components/upgrade-dialog";
import { PublishDialog } from "@/components/pipe-store";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/ui/dialog";
import { PostInstallConnectionsModal } from "@/components/post-install-connections-modal";
import posthog from "posthog-js";
import { MemoizedReactMarkdown } from "@/components/markdown";
@@ -722,6 +730,12 @@ export function PipesSection() {
const [connectionModal, setConnectionModal] = useState<{ pipeName: string; connections: string[] } | null>(null);
const [availableUpdates, setAvailableUpdates] = useState<Record<string, { latest_version: number; installed_version: number; locally_modified: boolean }>>({});
const [updatingPipe, setUpdatingPipe] = useState<string | null>(null);
+ const [updateDialog, setUpdateDialog] = useState<{
+ pipeName: string;
+ slug: string;
+ installedVersion: number;
+ latestVersion: number;
+ } | null>(null);
// Live streaming output for running executions: key = "pipeName:executionId"
const [liveOutput, setLiveOutput] = useState<Record<string, string[]>>({});
const liveOutputRef = useRef<Record<string, string[]>>({});
@@ -947,9 +961,37 @@ export function PipesSection() {
};
const trackedPipesView = useRef(false);
+ const autoUpdateRan = useRef(false);
useEffect(() => {
fetchConnections();
checkForUpdates();
+
+ // Auto-update unmodified pipes
+ if (settings?.autoUpdatePipes !== false && !autoUpdateRan.current) {
+ autoUpdateRan.current = true;
+ (async () => {
+ try {
+ const res = await fetch(`${apiBase}/pipes/store/auto-update`, { method: "POST" });
+ if (res.ok) {
+ const data = await res.json();
+ const updated = data.auto_updated || [];
+ if (updated.length > 0) {
+ for (const u of updated) {
+ toast({
+ title: `${u.pipe_name} auto-updated`,
+ description: `v${u.from_version} → v${u.to_version}`,
+ });
+ }
+ // Refresh updates map and pipes list
+ await Promise.all([checkForUpdates(), fetchPipes()]);
+ }
+ }
+ } catch {
+ // silently fail — not critical
+ }
+ })();
+ }
+
fetchPipes().then(() => {
if (!trackedPipesView.current) {
trackedPipesView.current = true;
@@ -1558,9 +1600,12 @@ export function PipesSection() {
const update = availableUpdates[pipe.config.name];
const slug = (pipe.config as any).config?.source_slug as string || pipe.source_slug || pipe.config.name;
if (update.locally_modified) {
- if (confirm(`you have local changes to this pipe. updating to v${update.latest_version} will overwrite them. continue?`)) {
- updatePipe(pipe.config.name, slug);
- }
+ setUpdateDialog({
+ pipeName: pipe.config.name,
+ slug,
+ installedVersion: update.installed_version,
+ latestVersion: update.latest_version,
+ });
} else {
updatePipe(pipe.config.name, slug);
}
@@ -2619,6 +2664,45 @@ export function PipesSection() {
defaultPipe={publishPipeName || undefined}
/>
+ <Dialog open={!!updateDialog} onOpenChange={(open) => !open && setUpdateDialog(null)}>
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>update {updateDialog?.pipeName}?</DialogTitle>
+ <DialogDescription>
+ <span className="inline-flex items-center gap-2 mt-2">
+ <Badge variant="outline">v{updateDialog?.installedVersion}</Badge>
+ <span>→</span>
+ <Badge variant="outline">v{updateDialog?.latestVersion}</Badge>
+ </span>
+ </DialogDescription>
+ </DialogHeader>
+ <div className="flex items-start gap-2 p-3 rounded-md bg-destructive/10 border border-destructive/20">
+ <AlertCircle className="h-4 w-4 text-destructive mt-0.5 shrink-0" />
+ <p className="text-sm text-muted-foreground">
+ you have local edits to this pipe. updating will overwrite your prompt changes.
+ a backup will be saved as <code className="text-xs">pipe.md.bak</code>.
+ your schedule, model, and enabled state will be preserved.
+ </p>
+ </div>
+ <DialogFooter className="gap-2 sm:gap-0">
+ <Button variant="ghost" onClick={() => setUpdateDialog(null)}>
+ skip
+ </Button>
+ <Button
+ variant="destructive"
+ onClick={() => {
+ if (updateDialog) {
+ updatePipe(updateDialog.pipeName, updateDialog.slug);
+ setUpdateDialog(null);
+ }
+ }}
+ >
+ update & discard my edits
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+
</div>
);
}
diff --git a/apps/screenpipe-app-tauri/lib/utils/tauri.ts b/apps/screenpipe-app-tauri/lib/utils/tauri.ts
index c6967af74..deb9d4ec2 100644
--- a/apps/screenpipe-app-tauri/lib/utils/tauri.ts
+++ b/apps/screenpipe-app-tauri/lib/utils/tauri.ts
@@ -1320,7 +1320,9 @@ deviceId?: string;
* Auto-install updates and restart when a new version is available.
* When disabled, users must click "update now" in the tray menu.
*/
-autoUpdate?: boolean;
+autoUpdate?: boolean;
+/** Auto-update store-installed pipes that haven't been locally modified. */
+autoUpdatePipes?: boolean;
/**
* Timeline overlay mode: "fullscreen" (floating panel above everything) or
* "window" (normal resizable window with title bar).
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 86b75e899..cedaf3812 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.3.29"
+version = "2.3.30"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/store.rs b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
index b2354f03a..99faf7015 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/store.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
@@ -195,6 +195,9 @@ pub struct SettingsStore {
/// When disabled, users must click "update now" in the tray menu.
#[serde(rename = "autoUpdate", default = "default_true")]
pub auto_update: bool,
+ /// Auto-update store-installed pipes that haven't been locally modified.
+ #[serde(rename = "autoUpdatePipes", default = "default_true")]
+ pub auto_update_pipes: bool,
/// Timeline overlay mode: "fullscreen" (floating panel above everything) or
/// "window" (normal resizable window with title bar).
#[serde(rename = "overlayMode", default = "default_overlay_mode")]
@@ -517,6 +520,7 @@ Rules:
show_shortcut_overlay: true,
device_id: uuid::Uuid::new_v4().to_string(),
auto_update: true,
+ auto_update_pipes: true,
#[cfg(target_os = "macos")]
overlay_mode: "fullscreen".to_string(),
#[cfg(not(target_os = "macos"))]
diff --git a/crates/screenpipe-core/src/pipes/mod.rs b/crates/screenpipe-core/src/pipes/mod.rs
index 2799c02e4..b03955675 100644
--- a/crates/screenpipe-core/src/pipes/mod.rs
+++ b/crates/screenpipe-core/src/pipes/mod.rs
@@ -1337,8 +1337,13 @@ impl PipeManager {
let locally_modified = config.source_hash.as_ref().map(|expected_hash| {
let pipe_path = self.pipes_dir.join(name).join("pipe.md");
if let Ok(content) = std::fs::read_to_string(&pipe_path) {
- let actual_hash = simple_hash(&content);
- actual_hash != *expected_hash
+ // Hash only the body (prompt) so config changes (schedule,
+ // preset, etc.) don't trigger locally_modified.
+ if let Ok((_, file_body)) = parse_frontmatter(&content) {
+ simple_hash(&file_body) != *expected_hash
+ } else {
+ simple_hash(&content) != *expected_hash
+ }
} else {
false
}
@@ -1398,8 +1403,13 @@ impl PipeManager {
let locally_modified = config.source_hash.as_ref().map(|expected_hash| {
let pipe_path = self.pipes_dir.join(name).join("pipe.md");
if let Ok(content) = std::fs::read_to_string(&pipe_path) {
- let actual_hash = simple_hash(&content);
- actual_hash != *expected_hash
+ // Hash only the body (prompt) so config changes don't
+ // trigger locally_modified.
+ if let Ok((_, file_body)) = parse_frontmatter(&content) {
+ simple_hash(&file_body) != *expected_hash
+ } else {
+ simple_hash(&content) != *expected_hash
+ }
} else {
false
}
@@ -2652,9 +2662,8 @@ impl PipeManager {
config.source_slug = Some(slug.to_string());
config.installed_version = Some(version);
- // Hash the source_md content
- let source_hash = simple_hash(source_md);
- config.source_hash = Some(source_hash);
+ // Hash only the body (prompt) so config changes don't trigger locally_modified
+ config.source_hash = Some(simple_hash(&body));
// Derive name from slug
let name = slug.to_string();
@@ -2686,21 +2695,31 @@ impl PipeManager {
let (mut config, body) = parse_frontmatter(source_md)?;
- // Preserve user's enabled state and schedule from current config
+ // Preserve user's enabled state, schedule, preset, and connections from current config
let current_path = dest_dir.join("pipe.md");
if let Ok(current_content) = std::fs::read_to_string(&current_path) {
+ // Backup existing pipe.md before overwriting
+ let backup_path = dest_dir.join("pipe.md.bak");
+ if let Err(e) = std::fs::copy(&current_path, &backup_path) {
+ warn!("failed to backup pipe.md for '{}': {}", name, e);
+ }
+
if let Ok((current_config, _)) = parse_frontmatter(&current_content) {
config.enabled = current_config.enabled;
config.preset = current_config.preset.clone();
+ config.schedule = current_config.schedule.clone();
+ config.connections = current_config.connections.clone();
}
}
config.source_slug = Some(slug.to_string());
config.installed_version = Some(version);
- config.source_hash = Some(simple_hash(source_md));
+ // Hash only the prompt body so config changes (schedule, preset, etc.)
+ // don't trigger locally_modified — only actual prompt edits do.
+ config.source_hash = Some(simple_hash(&body));
let content = serialize_pipe(&config, &body)?;
- std::fs::write(current_path, &content)?;
+ std::fs::write(&current_path, &content)?;
self.load_pipes().await?;
info!("updated pipe '{}' to store v{}", name, version);
diff --git a/crates/screenpipe-engine/src/routes/pipe_store.rs b/crates/screenpipe-engine/src/routes/pipe_store.rs
index 6c7c361cb..06efc552a 100644
--- a/crates/screenpipe-engine/src/routes/pipe_store.rs
+++ b/crates/screenpipe-engine/src/routes/pipe_store.rs
@@ -367,6 +367,129 @@ pub async fn pipe_store_check_updates(State(pm): State<SharedPipeManager>) -> Js
Json(json!({ "data": updates }))
}
+/// POST /pipes/store/auto-update
+///
+/// Automatically update all store-installed pipes that have not been locally modified.
+/// Returns which pipes were auto-updated, which were skipped (modified), and any errors.
+///
+/// Uses a static flag to prevent concurrent auto-update requests from duplicating work.
+pub async fn pipe_store_auto_update(State(pm): State<SharedPipeManager>) -> Json<Value> {
+ use std::sync::atomic::{AtomicBool, Ordering};
+ static AUTO_UPDATING: AtomicBool = AtomicBool::new(false);
+
+ // Prevent concurrent auto-update requests
+ if AUTO_UPDATING
+ .compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst)
+ .is_err()
+ {
+ return Json(json!({
+ "auto_updated": [],
+ "skipped_modified": [],
+ "errors": [{"error": "auto-update already in progress"}],
+ }));
+ }
+
+ let result = pipe_store_auto_update_inner(&pm).await;
+ AUTO_UPDATING.store(false, Ordering::SeqCst);
+ result
+}
+
+async fn pipe_store_auto_update_inner(pm: &SharedPipeManager) -> Json<Value> {
+ let mgr = pm.lock().await;
+ let pipes = mgr.list_pipes().await;
+ drop(mgr);
+
+ let base = api_base_url();
+ let client = &*REGISTRY_CLIENT;
+
+ let mut auto_updated: Vec<Value> = Vec::new();
+ let mut skipped_modified: Vec<Value> = Vec::new();
+ let mut errors: Vec<Value> = Vec::new();
+
+ for pipe in &pipes {
+ let slug = match &pipe.source_slug {
+ Some(s) => s.clone(),
+ None => continue,
+ };
+ let installed_version = pipe.installed_version.unwrap_or(0);
+ let is_modified = pipe.locally_modified.unwrap_or(false);
+
+ // Fetch latest version from registry
+ let detail_url = format!("{}/api/pipes/store/{}", base, slug);
+ let detail = match client.get(&detail_url).send().await {
+ Ok(resp) => match resp.json::<Value>().await {
+ Ok(v) => v,
+ Err(e) => {
+ errors.push(json!({ "slug": slug, "error": format!("parse error: {}", e) }));
+ continue;
+ }
+ },
+ Err(e) => {
+ errors.push(json!({ "slug": slug, "error": format!("network error: {}", e) }));
+ continue;
+ }
+ };
+
+ let latest_version = detail
+ .get("version")
+ .or_else(|| detail.get("data").and_then(|d| d.get("version")))
+ .and_then(|v| v.as_i64())
+ .unwrap_or(0);
+
+ if latest_version <= installed_version {
+ continue;
+ }
+
+ if is_modified {
+ skipped_modified.push(json!({
+ "slug": slug,
+ "pipe_name": pipe.config.name,
+ "installed_version": installed_version,
+ "latest_version": latest_version,
+ }));
+ continue;
+ }
+
+ // Get source_md for the update
+ let source_md = match detail
+ .get("source_md")
+ .or_else(|| detail.get("data").and_then(|d| d.get("source_md")))
+ .and_then(|v| v.as_str())
+ {
+ Some(md) => md.to_string(),
+ None => {
+ errors.push(json!({ "slug": slug, "error": "missing source_md" }));
+ continue;
+ }
+ };
+
+ let mgr = pm.lock().await;
+ match mgr
+ .update_pipe_from_store(&slug, &source_md, &slug, latest_version)
+ .await
+ {
+ Ok(()) => {
+ auto_updated.push(json!({
+ "slug": slug,
+ "pipe_name": pipe.config.name,
+ "from_version": installed_version,
+ "to_version": latest_version,
+ }));
+ }
+ Err(e) => {
+ errors.push(json!({ "slug": slug, "error": e.to_string() }));
+ }
+ }
+ drop(mgr);
+ }
+
+ Json(json!({
+ "auto_updated": auto_updated,
+ "skipped_modified": skipped_modified,
+ "errors": errors,
+ }))
+}
+
/// POST /pipes/store/:slug/review
///
/// Submit a review for a pipe. Requires auth (Bearer token).
diff --git a/crates/screenpipe-engine/src/server.rs b/crates/screenpipe-engine/src/server.rs
index 597af7ca1..4262f5522 100644
--- a/crates/screenpipe-engine/src/server.rs
+++ b/crates/screenpipe-engine/src/server.rs
@@ -675,6 +675,10 @@ impl SCServer {
"/store/check-updates",
axum::routing::get(crate::routes::pipe_store::pipe_store_check_updates),
)
+ .route(
+ "/store/auto-update",
+ axum::routing::post(crate::routes::pipe_store::pipe_store_auto_update),
+ )
.route(
"/store/:slug",
axum::routing::get(crate::routes::pipe_store::pipe_store_detail)