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

style: align pipe store with brand — sharp corners, grayscale, no shadows

Louis Beaumontf8dab6f9ba76
diff --git a/Cargo.lock b/Cargo.lock
index dd25b4ad0..75c6ef945 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,6 +2,12 @@
# It is not intended for manual editing.
version = 4
+[[package]]
+name = "Inflector"
+version = "0.11.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
+
[[package]]
name = "ab_glyph"
version = "0.2.32"
@@ -726,7 +732,7 @@ dependencies = [
"bitflags 2.11.0",
"cexpr",
"clang-sys",
- "itertools 0.10.5",
+ "itertools 0.12.1",
"lazy_static",
"lazycell",
"log",
@@ -749,7 +755,7 @@ dependencies = [
"bitflags 2.11.0",
"cexpr",
"clang-sys",
- "itertools 0.10.5",
+ "itertools 0.12.1",
"log",
"prettyplease",
"proc-macro2",
@@ -770,7 +776,7 @@ dependencies = [
"bitflags 2.11.0",
"cexpr",
"clang-sys",
- "itertools 0.10.5",
+ "itertools 0.12.1",
"proc-macro2",
"quote",
"regex",
@@ -1916,7 +1922,7 @@ dependencies = [
"libc",
"option-ext",
"redox_users 0.5.2",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -2195,7 +2201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -3161,7 +3167,7 @@ dependencies = [
"hyper",
"libc",
"pin-project-lite",
- "socket2 0.5.10",
+ "socket2 0.6.3",
"tokio",
"tower-service",
"tracing",
@@ -3494,7 +3500,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46"
dependencies = [
"hermit-abi",
"libc",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -4324,7 +4330,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -5580,7 +5586,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d"
dependencies = [
"anyhow",
- "itertools 0.10.5",
+ "itertools 0.14.0",
"proc-macro2",
"quote",
"syn 2.0.117",
@@ -5667,7 +5673,7 @@ dependencies = [
"quinn-udp",
"rustc-hash 2.1.1",
"rustls",
- "socket2 0.5.10",
+ "socket2 0.6.3",
"thiserror 2.0.18",
"tokio",
"tracing",
@@ -5704,9 +5710,9 @@ dependencies = [
"cfg_aliases",
"libc",
"once_cell",
- "socket2 0.5.10",
+ "socket2 0.6.3",
"tracing",
- "windows-sys 0.59.0",
+ "windows-sys 0.60.2",
]
[[package]]
@@ -6304,7 +6310,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys 0.12.1",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -6557,11 +6563,12 @@ dependencies = [
[[package]]
name = "screenpipe-config"
-version = "0.3.184"
+version = "0.3.185"
dependencies = [
"dirs 6.0.0",
"serde",
"serde_json",
+ "specta",
"tempfile",
"toml 0.8.23",
"tracing",
@@ -6700,6 +6707,7 @@ dependencies = [
"screenpipe-a11y",
"screenpipe-apple-intelligence",
"screenpipe-audio",
+ "screenpipe-config",
"screenpipe-connect",
"screenpipe-core",
"screenpipe-db",
@@ -7319,6 +7327,28 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "specta"
+version = "2.0.0-rc.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ccbb212565d2dc177bc15ecb7b039d66c4490da892436a4eee5b394d620c9bc"
+dependencies = [
+ "specta-macros",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "specta-macros"
+version = "2.0.0-rc.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "68999d29816965eb9e5201f60aec02a76512139811661a7e8e653abc810b8f72"
+dependencies = [
+ "Inflector",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.117",
+]
+
[[package]]
name = "spin"
version = "0.9.8"
@@ -7988,7 +8018,7 @@ dependencies = [
"getrandom 0.4.2",
"once_cell",
"rustix 1.1.4",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -8617,7 +8647,7 @@ checksum = "51b70b87d15e91f553711b40df3048faf27a7a04e01e0ddc0cf9309f0af7c2ca"
dependencies = [
"memoffset",
"tempfile",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
diff --git a/apps/screenpipe-app-tauri/components/pipe-store.tsx b/apps/screenpipe-app-tauri/components/pipe-store.tsx
index d7cca7169..05b4b1817 100644
--- a/apps/screenpipe-app-tauri/components/pipe-store.tsx
+++ b/apps/screenpipe-app-tauri/components/pipe-store.tsx
@@ -197,7 +197,7 @@ function StarRating({
className={cn(
iconSize,
filled
- ? "fill-yellow-500 text-yellow-500"
+ ? "fill-foreground text-foreground"
: "text-muted-foreground/30"
)}
/>
@@ -571,14 +571,14 @@ function DiscoverView() {
{/* Header */}
<div className="flex items-center justify-between">
<div>
- <h3 className="text-xl font-semibold tracking-tight">Discover Pipes</h3>
+ <h3 className="text-xl font-semibold tracking-tight">discover pipes</h3>
<p className="text-sm text-muted-foreground mt-0.5">
browse, install, and review community pipes
</p>
</div>
<Button variant="outline" size="sm" onClick={() => setPublishOpen(true)}>
<Upload className="h-4 w-4 mr-1.5" />
- publish
+ PUBLISH
</Button>
</div>
@@ -615,7 +615,7 @@ function DiscoverView() {
key={c}
onClick={() => setCategory(c)}
className={cn(
- "px-3 py-1.5 rounded-full text-xs font-medium transition-colors whitespace-nowrap",
+ "px-3 py-1.5 rounded-none text-xs font-medium transition-colors duration-150 whitespace-nowrap",
category === c
? "bg-foreground text-background"
: "bg-muted text-muted-foreground hover:text-foreground"
@@ -655,7 +655,7 @@ function DiscoverView() {
<Card key={i} className="overflow-hidden">
<CardContent className="p-5 space-y-3">
<div className="flex items-center gap-3">
- <Skeleton className="h-10 w-10 rounded-xl" />
+ <Skeleton className="h-10 w-10 rounded-none" />
<div className="space-y-1.5 flex-1">
<Skeleton className="h-4 w-2/3" />
<Skeleton className="h-3 w-1/3" />
@@ -725,10 +725,10 @@ function FeaturedCard({
className="flex-shrink-0 w-[300px] snap-start group cursor-pointer"
onClick={onClick}
>
- <div className="border border-border bg-card hover:bg-accent/50 transition-all duration-200 rounded-xl p-5 space-y-3 h-full">
+ <div className="border border-border bg-card hover:bg-accent/50 transition-colors duration-150 rounded-none p-5 space-y-3 h-full">
<div className="flex items-start justify-between">
<div className="flex items-start gap-3">
- <div className="text-3xl bg-muted rounded-xl h-12 w-12 flex items-center justify-center flex-shrink-0">
+ <div className="text-3xl bg-muted rounded-none h-12 w-12 flex items-center justify-center flex-shrink-0">
{pipe.icon || "🔧"}
</div>
<div className="min-w-0">
@@ -738,7 +738,7 @@ function FeaturedCard({
<div className="flex items-center gap-1 text-xs text-muted-foreground mt-0.5">
<span className="truncate">{pipe.author}</span>
{pipe.author_verified && (
- <BadgeCheck className="h-3 w-3 text-blue-500 flex-shrink-0" />
+ <BadgeCheck className="h-3 w-3 text-foreground flex-shrink-0" />
)}
</div>
</div>
@@ -747,7 +747,7 @@ function FeaturedCard({
size="sm"
variant={isInstalled ? "outline" : "default"}
className={cn(
- "h-7 px-3 text-xs font-semibold rounded-full flex-shrink-0",
+ "h-7 px-3 text-xs font-semibold rounded-none uppercase tracking-wide flex-shrink-0",
isInstalled && "pointer-events-none"
)}
disabled={installing || isInstalled}
@@ -759,9 +759,9 @@ function FeaturedCard({
{installing ? (
<Loader2 className="h-3 w-3 animate-spin" />
) : isInstalled ? (
- "Installed"
+ "INSTALLED"
) : (
- "Get"
+ "GET"
)}
</Button>
</div>
@@ -771,7 +771,7 @@ function FeaturedCard({
</p>
<div className="flex items-center justify-between">
- <Badge variant="secondary" className="text-[10px] px-2 py-0.5 font-normal rounded-full">
+ <Badge variant="secondary" className="text-[10px] px-2 py-0.5 font-normal rounded-none">
{pipe.category}
</Badge>
<div className="flex items-center gap-3 text-xs text-muted-foreground">
@@ -811,10 +811,10 @@ function PipeCard({
return (
<div
onClick={onClick}
- className="border border-border bg-card hover:bg-accent/50 transition-all duration-200 rounded-xl p-5 cursor-pointer group"
+ className="border border-border bg-card hover:bg-accent/50 transition-colors duration-150 rounded-none p-5 cursor-pointer group"
>
<div className="flex items-start gap-3">
- <div className="text-2xl bg-muted rounded-xl h-11 w-11 flex items-center justify-center flex-shrink-0">
+ <div className="text-2xl bg-muted rounded-none h-11 w-11 flex items-center justify-center flex-shrink-0">
{pipe.icon || "🔧"}
</div>
<div className="min-w-0 flex-1">
@@ -824,7 +824,7 @@ function PipeCard({
<div className="flex items-center gap-1 text-xs text-muted-foreground mt-0.5">
<span className="truncate">{pipe.author}</span>
{pipe.author_verified && (
- <BadgeCheck className="h-3 w-3 text-blue-500 flex-shrink-0" />
+ <BadgeCheck className="h-3 w-3 text-foreground flex-shrink-0" />
)}
</div>
</div>
@@ -832,7 +832,7 @@ function PipeCard({
size="sm"
variant={isInstalled ? "outline" : "default"}
className={cn(
- "h-7 px-3 text-xs font-semibold rounded-full flex-shrink-0",
+ "h-7 px-3 text-xs font-semibold rounded-none uppercase tracking-wide flex-shrink-0",
isInstalled && "pointer-events-none"
)}
disabled={installing || isInstalled}
@@ -844,9 +844,9 @@ function PipeCard({
{installing ? (
<Loader2 className="h-3 w-3 animate-spin" />
) : isInstalled ? (
- "Installed"
+ "INSTALLED"
) : (
- "Get"
+ "GET"
)}
</Button>
</div>
@@ -863,14 +863,14 @@ function PipeCard({
<Badge
key={p.key}
variant="outline"
- className="text-[10px] px-1.5 py-0 gap-0.5 font-normal rounded-full"
+ className="text-[10px] px-1.5 py-0 gap-0.5 font-normal rounded-none"
>
{p.icon}
{p.label}
</Badge>
))}
{permissionPills.length > 3 && (
- <Badge variant="outline" className="text-[10px] px-1.5 py-0 font-normal rounded-full">
+ <Badge variant="outline" className="text-[10px] px-1.5 py-0 font-normal rounded-none">
+{permissionPills.length - 3}
</Badge>
)}
@@ -962,7 +962,7 @@ function PipeDetailPanel({
<div className="flex items-center gap-1 text-sm text-muted-foreground">
<span>{pipe.author}</span>
{pipe.author_verified && (
- <BadgeCheck className="h-3.5 w-3.5 text-blue-500" />
+ <BadgeCheck className="h-3.5 w-3.5 text-foreground" />
)}
</div>
) : null}
@@ -1004,17 +1004,17 @@ function PipeDetailPanel({
<Button
size="sm"
variant="destructive"
- className="h-9 px-4 text-sm font-semibold rounded-none"
+ className="h-9 px-4 text-sm font-semibold rounded-none uppercase tracking-wide"
disabled={unpublishing}
onClick={() => onUnpublish(pipe.slug)}
>
{unpublishing ? (
<>
<Loader2 className="h-4 w-4 animate-spin mr-1.5" />
- unpublishing...
+ UNPUBLISHING...
</>
) : (
- "unpublish"
+ "UNPUBLISH"
)}
</Button>
)}
@@ -1022,7 +1022,7 @@ function PipeDetailPanel({
size="sm"
variant={isInstalled ? "outline" : "default"}
className={cn(
- "h-9 px-5 text-sm font-semibold rounded-none flex-shrink-0",
+ "h-9 px-5 text-sm font-semibold rounded-none uppercase tracking-wide flex-shrink-0",
isInstalled && "pointer-events-none"
)}
disabled={
@@ -1033,14 +1033,14 @@ function PipeDetailPanel({
{installing === pipe.slug ? (
<>
<Loader2 className="h-4 w-4 animate-spin mr-1.5" />
- installing...
+ INSTALLING...
</>
) : isInstalled ? (
- "Installed"
+ "INSTALLED"
) : (
<>
<Download className="h-4 w-4 mr-1.5" />
- Get
+ GET
</>
)}
</Button>
@@ -1073,11 +1073,11 @@ function PipeDetailPanel({
code: ({ className, children, ...props }) => {
const isInline = !className;
return isInline ? (
- <code className="bg-muted px-1.5 py-0.5 rounded text-xs" {...props}>
+ <code className="bg-muted px-1.5 py-0.5 rounded-none text-xs" {...props}>
{children}
</code>
) : (
- <pre className="bg-muted p-4 rounded-lg overflow-x-auto text-xs">
+ <pre className="bg-muted p-4 rounded-none overflow-x-auto text-xs">
<code className={className} {...props}>
{children}
</code>
@@ -1109,9 +1109,9 @@ function PipeDetailPanel({
className="flex items-center gap-2 text-sm py-1.5"
>
{status === "allowed" ? (
- <CheckCircle2 className="h-4 w-4 text-green-500 flex-shrink-0" />
+ <CheckCircle2 className="h-4 w-4 text-foreground flex-shrink-0" />
) : status === "denied" ? (
- <XCircle className="h-4 w-4 text-red-500 flex-shrink-0" />
+ <XCircle className="h-4 w-4 text-muted-foreground flex-shrink-0" />
) : (
<div className="h-4 w-4 rounded-full border-2 border-muted-foreground/30 flex-shrink-0" />
)}
@@ -1140,8 +1140,8 @@ function PipeDetailPanel({
{/* Unrestricted warning */}
{unrestricted && (
- <div className="border border-orange-500/50 bg-orange-500/5 rounded-none p-4 space-y-2">
- <div className="flex items-center gap-2 text-sm font-medium text-orange-600 dark:text-orange-400">
+ <div className="border border-foreground bg-muted/50 rounded-none p-4 space-y-2">
+ <div className="flex items-center gap-2 text-sm font-medium text-foreground">
<AlertTriangle className="h-4 w-4" />
unrestricted data access
</div>
@@ -1234,10 +1234,10 @@ function PipeDetailPanel({
{submittingReview ? (
<>
<Loader2 className="h-3 w-3 animate-spin mr-1.5" />
- submitting...
+ SUBMITTING...
</>
) : (
- "submit review"
+ "SUBMIT REVIEW"
)}
</Button>
</div>
@@ -1503,7 +1503,7 @@ function PublishDialog({
onClick={() => onOpenChange(false)}
className="text-xs"
>
- cancel
+ CANCEL
</Button>
{token && (
<Button
@@ -1515,10 +1515,10 @@ function PublishDialog({
{publishing ? (
<>
<Loader2 className="h-3 w-3 animate-spin mr-1" />
- publishing...
+ PUBLISHING...
</>
) : (
- "publish"
+ "PUBLISH"
)}
</Button>
)}
@@ -1541,7 +1541,7 @@ export function PermissionsReview({
return (
<div className="space-y-3">
- <div className="border border-border rounded-xl p-4 space-y-2">
+ <div className="border border-border rounded-none p-4 space-y-2">
<div className="flex items-center gap-1.5 text-sm font-medium">
<Shield className="h-4 w-4" />
data access
@@ -1555,9 +1555,9 @@ export function PermissionsReview({
className="flex items-center gap-2 text-xs py-1"
>
{status === "allowed" ? (
- <CheckCircle2 className="h-3.5 w-3.5 text-green-500 flex-shrink-0" />
+ <CheckCircle2 className="h-3.5 w-3.5 text-foreground flex-shrink-0" />
) : status === "denied" ? (
- <XCircle className="h-3.5 w-3.5 text-red-500 flex-shrink-0" />
+ <XCircle className="h-3.5 w-3.5 text-muted-foreground flex-shrink-0" />
) : (
<div className="h-3.5 w-3.5 rounded-full border border-muted-foreground/30 flex-shrink-0" />
)}
@@ -1572,8 +1572,8 @@ export function PermissionsReview({
</div>
{unrestricted && (
- <div className="border border-orange-500/50 bg-orange-500/5 rounded-xl p-4">
- <div className="flex items-center gap-2 text-xs font-medium text-orange-600 dark:text-orange-400">
+ <div className="border border-foreground bg-muted/50 rounded-none p-4">
+ <div className="flex items-center gap-2 text-xs font-medium text-foreground">
<AlertTriangle className="h-3.5 w-3.5" />
unrestricted data access — this pipe can read all your data
</div>
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 154757cb9..1a5e726b3 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9203,7 +9203,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.2.159"
+version = "2.2.162"
dependencies = [
"anyhow",
"arboard",
@@ -9242,6 +9242,7 @@ dependencies = [
"resvg",
"screenpipe-a11y",
"screenpipe-audio",
+ "screenpipe-config",
"screenpipe-connect",
"screenpipe-core",
"screenpipe-db",
@@ -9355,6 +9356,18 @@ dependencies = [
"windows 0.58.0",
]
+[[package]]
+name = "screenpipe-config"
+version = "0.3.185"
+dependencies = [
+ "dirs 6.0.0",
+ "serde",
+ "serde_json",
+ "specta",
+ "toml 0.8.2",
+ "tracing",
+]
+
[[package]]
name = "screenpipe-connect"
version = "0.3.185"
@@ -9484,6 +9497,7 @@ dependencies = [
"screenpipe-a11y",
"screenpipe-apple-intelligence",
"screenpipe-audio",
+ "screenpipe-config",
"screenpipe-connect",
"screenpipe-core",
"screenpipe-db",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 6c091a0d2..1c4d4dcc9 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -110,6 +110,7 @@ hostname = "0.4"
screenpipe-core = { path = "../../../crates/screenpipe-core", features = ["cloud-sync"] }
# Embedded screenpipe server
+screenpipe-config = { path = "../../../crates/screenpipe-config", features = ["specta"] }
screenpipe-engine = { path = "../../../crates/screenpipe-engine", default-features = false }
screenpipe-screen = { path = "../../../crates/screenpipe-screen" }
screenpipe-a11y = { path = "../../../crates/screenpipe-a11y" }
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
index f8c868d94..c068ed59e 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
@@ -1336,6 +1336,7 @@ pub async fn perform_ocr_on_image(
.unwrap_or_default();
let languages: Vec<screenpipe_core::Language> = store
+ .recording
.languages
.iter()
.filter(|s| s != &"default")
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/health.rs b/apps/screenpipe-app-tauri/src-tauri/src/health.rs
index 280fbbe54..32b66e5c4 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/health.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/health.rs
@@ -371,12 +371,12 @@ pub async fn start_health_check(app: tauri::AppHandle) -> Result<()> {
// Filter monitors to only show actively recording ones
if let Ok(Some(store)) = crate::store::SettingsStore::get(&app) {
- if !store.use_all_monitors && !store.monitor_ids.is_empty()
- && store.monitor_ids != vec!["default".to_string()]
+ if !store.recording.use_all_monitors && !store.recording.monitor_ids.is_empty()
+ && store.recording.monitor_ids != vec!["default".to_string()]
{
devices.retain(|d| {
if d.kind != DeviceKind::Monitor { return true; }
- store.monitor_ids.iter().any(|allowed| {
+ store.recording.monitor_ids.iter().any(|allowed| {
// Stable ID format: "Display 3_1920x1080_0,0"
// Extract name prefix before last '_' (position coords)
let allowed_name = allowed.rsplitn(2, '_').last().unwrap_or(allowed);
@@ -474,7 +474,7 @@ pub async fn start_health_check(app: tauri::AppHandle) -> Result<()> {
.map(|t| t.elapsed() < NOTIFICATION_COOLDOWN)
.unwrap_or(false);
if status == RecordingStatus::Recording
- && start_time.elapsed() > Duration::from_secs(120)
+ && start_time.elapsed() > NOTIFICATION_COOLDOWN
&& !in_restart_grace
{
if let Ok(ref health) = health_result {
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
index d9af610b1..be87310a2 100755
--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
@@ -280,7 +280,7 @@ async fn upload_file_to_s3(file_path: &str, signed_url: &str) -> Result<bool, St
#[allow(dead_code)]
async fn is_server_running(app: AppHandle) -> Result<bool, String> {
let store = app.state::<store::SettingsStore>();
- let port = store.port;
+ let port = store.recording.port;
let client = reqwest::Client::new();
let response = client
.get(format!("http://localhost:{}", port))
@@ -1018,7 +1018,7 @@ async fn main() {
app.manage(store.clone());
// Set Chinese HuggingFace mirror early — before any model downloads
- if store.use_chinese_mirror {
+ if store.recording.use_chinese_mirror {
std::env::set_var("HF_ENDPOINT", "https://hf-mirror.com");
info!("Chinese HuggingFace mirror enabled (HF_ENDPOINT set early)");
}
@@ -1041,34 +1041,34 @@ async fn main() {
// Set user.id to the persistent analytics UUID
// This links Sentry errors to PostHog sessions and feedback reports
scope.set_user(Some(sentry::protocol::User {
- id: Some(store.analytics_id.clone()),
+ id: Some(store.recording.analytics_id.clone()),
..Default::default()
}));
scope.set_context("app_settings", sentry::protocol::Context::Other({
let mut map = std::collections::BTreeMap::new();
- map.insert("fps".into(), serde_json::json!(store.fps));
- map.insert("adaptive_fps".into(), serde_json::json!(store.adaptive_fps));
- map.insert("audio_chunk_duration".into(), serde_json::json!(store.audio_chunk_duration));
- map.insert("port".into(), serde_json::json!(store.port));
- map.insert("disable_audio".into(), serde_json::json!(store.disable_audio));
- map.insert("audio_transcription_engine".into(), serde_json::json!(store.audio_transcription_engine));
+ map.insert("fps".into(), serde_json::json!(store.recording.fps));
+ map.insert("adaptive_fps".into(), serde_json::json!(store.recording.adaptive_fps));
+ map.insert("audio_chunk_duration".into(), serde_json::json!(store.recording.audio_chunk_duration));
+ map.insert("port".into(), serde_json::json!(store.recording.port));
+ map.insert("disable_audio".into(), serde_json::json!(store.recording.disable_audio));
+ map.insert("audio_transcription_engine".into(), serde_json::json!(store.recording.audio_transcription_engine));
map.insert("ocr_engine".into(), serde_json::json!(store.ocr_engine));
- map.insert("monitor_ids".into(), serde_json::json!(store.monitor_ids));
- map.insert("use_all_monitors".into(), serde_json::json!(store.use_all_monitors));
- map.insert("languages".into(), serde_json::json!(store.languages));
- map.insert("use_pii_removal".into(), serde_json::json!(store.use_pii_removal));
- map.insert("disable_vision".into(), serde_json::json!(store.disable_vision));
- map.insert("enable_input_capture".into(), serde_json::json!(store.enable_input_capture));
- map.insert("enable_accessibility".into(), serde_json::json!(store.enable_accessibility));
+ map.insert("monitor_ids".into(), serde_json::json!(store.recording.monitor_ids));
+ map.insert("use_all_monitors".into(), serde_json::json!(store.recording.use_all_monitors));
+ map.insert("languages".into(), serde_json::json!(store.recording.languages));
+ map.insert("use_pii_removal".into(), serde_json::json!(store.recording.use_pii_removal));
+ map.insert("disable_vision".into(), serde_json::json!(store.recording.disable_vision));
+ map.insert("enable_input_capture".into(), serde_json::json!(store.recording.enable_input_capture));
+ map.insert("enable_accessibility".into(), serde_json::json!(store.recording.enable_accessibility));
map.insert("auto_start_enabled".into(), serde_json::json!(store.auto_start_enabled));
map.insert("platform".into(), serde_json::json!(store.platform));
map.insert("embedded_llm_enabled".into(), serde_json::json!(store.embedded_llm.enabled));
map.insert("embedded_llm_model".into(), serde_json::json!(store.embedded_llm.model));
// Only send counts for privacy-sensitive lists (not actual values)
- map.insert("audio_device_count".into(), serde_json::json!(store.audio_devices.len()));
- map.insert("ignored_windows_count".into(), serde_json::json!(store.ignored_windows.len()));
- map.insert("included_windows_count".into(), serde_json::json!(store.included_windows.len()));
- map.insert("ignored_urls_count".into(), serde_json::json!(store.ignored_urls.len()));
+ map.insert("audio_device_count".into(), serde_json::json!(store.recording.audio_devices.len()));
+ map.insert("ignored_windows_count".into(), serde_json::json!(store.recording.ignored_windows.len()));
+ map.insert("included_windows_count".into(), serde_json::json!(store.recording.included_windows.len()));
+ map.insert("ignored_urls_count".into(), serde_json::json!(store.recording.ignored_urls.len()));
map.insert("ai_preset_count".into(), serde_json::json!(store.ai_presets.len()));
map
}));
@@ -1099,16 +1099,16 @@ async fn main() {
{
let store_for_download = store.clone();
tauri::async_runtime::spawn(async move {
- if store_for_download.disable_audio {
+ if store_for_download.recording.disable_audio {
info!("audio disabled — skipping model pre-downloads");
return;
}
// Determine which whisper model the user's config needs
- let engine = match store_for_download.audio_transcription_engine.as_str() {
+ let engine = match store_for_download.recording.audio_transcription_engine.as_str() {
"deepgram" | "screenpipe-cloud" => None, // Cloud engines don't need local model
_ => {
use screenpipe_audio::core::engine::AudioTranscriptionEngine;
- Some(std::sync::Arc::new(match store_for_download.audio_transcription_engine.as_str() {
+ Some(std::sync::Arc::new(match store_for_download.recording.audio_transcription_engine.as_str() {
"whisper-tiny" => AudioTranscriptionEngine::WhisperTiny,
"whisper-tiny-quantized" => AudioTranscriptionEngine::WhisperTinyQuantized,
"whisper-large-v3" => AudioTranscriptionEngine::WhisperLargeV3,
@@ -1330,7 +1330,7 @@ async fn main() {
// Check permissions before starting
let permissions_check = permissions::do_permissions_check(false);
- let disable_audio = store_clone.disable_audio;
+ let disable_audio = store_clone.recording.disable_audio;
if !permissions_check.screen_recording.permitted() {
warn!("Screen recording permission not granted: {:?}. Server will not start.", permissions_check.screen_recording);
@@ -1402,7 +1402,7 @@ async fn main() {
// Check analytics settings from store
let is_analytics_enabled = store
- .analytics_enabled;
+ .recording.analytics_enabled;
let is_autostart_enabled = store
.auto_start_enabled;
@@ -1419,7 +1419,7 @@ async fn main() {
);
// Use persistent analytics_id for PostHog (consistent across frontend and backend)
- let unique_id = store.analytics_id.clone();
+ let unique_id = store.recording.analytics_id.clone();
let email = store.user.email.unwrap_or_default();
if is_analytics_enabled {
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/recording.rs b/apps/screenpipe-app-tauri/src-tauri/src/recording.rs
index ce831b9ad..417d2961e 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/recording.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/recording.rs
@@ -165,7 +165,7 @@ pub async fn spawn_screenpipe(
}
let store = SettingsStore::get(&app).ok().flatten().unwrap_or_default();
- let port = store.port;
+ let port = store.recording.port;
let health_url = format!("http://localhost:{}/health", port);
// Check if another start is already in progress (race between main.rs boot and frontend)
@@ -270,7 +270,7 @@ pub async fn spawn_screenpipe(
// Check permissions before starting
let permissions_check = do_permissions_check(false);
let store = SettingsStore::get(&app).ok().flatten().unwrap_or_default();
- let disable_audio = store.disable_audio;
+ let disable_audio = store.recording.disable_audio;
// Screen recording permission is required
if !permissions_check.screen_recording.permitted() {
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/store.rs b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
index 36c4980f8..2ad9b6ddf 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/store.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
@@ -102,64 +102,25 @@ impl OnboardingStore {
#[derive(Serialize, Deserialize, Type, Clone)]
#[serde(default)]
pub struct SettingsStore {
+ // ── Recording settings (shared source of truth) ──────────────────────
+ /// All recording/capture config lives here. Flattened so the JSON shape
+ /// is unchanged — `disableAudio`, `port`, `fps`, etc. stay at the top level.
+ #[serde(flatten)]
+ pub recording: screenpipe_config::RecordingSettings,
+
+ // ── App-only fields (UI, shortcuts, metadata) ────────────────────────
#[serde(rename = "aiPresets")]
pub ai_presets: Vec<AIPreset>,
- #[serde(rename = "deepgramApiKey")]
- pub deepgram_api_key: String,
#[serde(rename = "isLoading")]
pub is_loading: bool,
- #[serde(rename = "userId")]
- pub user_id: String,
-
- /// Persistent analytics ID used for PostHog tracking (both frontend and backend)
- #[serde(rename = "analyticsId")]
- pub analytics_id: String,
-
#[serde(rename = "devMode")]
pub dev_mode: bool,
- #[serde(rename = "audioTranscriptionEngine")]
- pub audio_transcription_engine: String,
#[serde(rename = "ocrEngine")]
pub ocr_engine: String,
- #[serde(rename = "monitorIds")]
- pub monitor_ids: Vec<String>,
- #[serde(rename = "audioDevices")]
- pub audio_devices: Vec<String>,
- /// When true, automatically follow system default audio devices
- #[serde(rename = "useSystemDefaultAudio", default = "default_true")]
- pub use_system_default_audio: bool,
- #[serde(rename = "usePiiRemoval")]
- pub use_pii_removal: bool,
- /// Filter music-dominant audio before transcription using spectral analysis
- #[serde(rename = "filterMusic", default)]
- pub filter_music: bool,
- #[serde(rename = "port")]
- pub port: u16,
#[serde(rename = "dataDir")]
pub data_dir: String,
- #[serde(rename = "disableAudio")]
- pub disable_audio: bool,
- #[serde(rename = "ignoredWindows")]
- pub ignored_windows: Vec<String>,
- #[serde(rename = "includedWindows")]
- pub included_windows: Vec<String>,
- #[serde(rename = "ignoredUrls", default)]
- pub ignored_urls: Vec<String>,
-
- #[serde(rename = "fps")]
- pub fps: f32,
- #[serde(rename = "vadSensitivity")]
- pub vad_sensitivity: String,
- #[serde(rename = "analyticsEnabled")]
- pub analytics_enabled: bool,
- #[serde(rename = "audioChunkDuration")]
- pub audio_chunk_duration: i32,
- #[serde(rename = "useChineseMirror")]
- pub use_chinese_mirror: bool,
- #[serde(rename = "languages")]
- pub languages: Vec<String>,
#[serde(rename = "embeddedLLM")]
pub embedded_llm: EmbeddedLLM,
#[serde(rename = "autoStartEnabled")]
@@ -188,33 +149,15 @@ pub struct SettingsStore {
pub lock_vault_shortcut: String,
#[serde(rename = "realtimeAudioTranscriptionEngine")]
pub realtime_audio_transcription_engine: String,
- #[serde(rename = "disableVision")]
- pub disable_vision: bool,
/// When true, screen capture continues but OCR text extraction is skipped.
/// Reduces CPU usage significantly while still recording video.
#[serde(rename = "disableOcr", default)]
pub disable_ocr: bool,
- #[serde(rename = "useAllMonitors")]
- pub use_all_monitors: bool,
- #[serde(rename = "adaptiveFps", default)]
- pub adaptive_fps: bool,
#[serde(rename = "showShortcutOverlay", default = "default_true")]
pub show_shortcut_overlay: bool,
/// Unique device ID for AI usage tracking (generated on first launch)
#[serde(rename = "deviceId", default = "generate_device_id")]
pub device_id: String,
- /// Enable input event capture (keyboard, mouse, clipboard).
- /// Requires input monitoring permission on macOS.
- #[serde(rename = "enableInputCapture", default)]
- pub enable_input_capture: bool,
- /// Enable accessibility text capture (AX tree walker).
- /// Requires accessibility permission on macOS.
- #[serde(
- rename = "enableAccessibility",
- alias = "enableUiEvents",
- default = "default_true"
- )]
- pub enable_accessibility: bool,
/// Auto-install updates and restart when a new version is available.
/// When disabled, users must click "update now" in the tray menu.
#[serde(rename = "autoUpdate", default = "default_true")]
@@ -227,38 +170,23 @@ pub struct SettingsStore {
/// Disabled by default so the overlay doesn't appear in screenpipe's own recordings.
#[serde(rename = "showOverlayInScreenRecording", default)]
pub show_overlay_in_screen_recording: bool,
- /// Video quality preset controlling storage vs quality tradeoff.
- /// Affects H.265 CRF during recording and JPEG quality during frame extraction.
- /// Values: "low", "balanced", "high", "max". Default: "balanced".
- #[serde(rename = "videoQuality", default = "default_video_quality")]
- pub video_quality: String,
/// When true, the chat window stays above all other windows (default: true).
#[serde(rename = "chatAlwaysOnTop", default = "default_true")]
pub chat_always_on_top: bool,
- /// Automatically detect and skip incognito / private browsing windows.
- /// Uses localized title matching (20+ languages) and on macOS, native
- /// AppleScript detection for Chromium browsers.
- #[serde(rename = "ignoreIncognitoWindows", default = "default_true")]
- pub ignore_incognito_windows: bool,
-
/// Show restart notifications when audio/vision capture stalls.
/// Disable to suppress all capture-stall notification popups.
#[serde(rename = "showRestartNotifications", default = "default_true")]
pub show_restart_notifications: bool,
- /// Catch-all for fields added by the frontend (e.g. chatHistory, deviceId)
+ /// Catch-all for fields added by the frontend (e.g. chatHistory)
/// that the Rust struct doesn't know about. Without this, `save()` would
/// serialize only known fields and silently wipe frontend-only data.
#[serde(flatten)]
pub extra: std::collections::HashMap<String, serde_json::Value>,
}
-fn default_video_quality() -> String {
- "balanced".to_string()
-}
-
fn generate_device_id() -> String {
uuid::Uuid::new_v4().to_string()
}
@@ -429,9 +357,6 @@ impl Default for SettingsStore {
"screenpipe".to_string(),
];
- // Add platform-specific ignored windows
- // Note: In a real implementation, you'd detect the actual platform
- // For now, we'll include common ones or you can detect platform here
#[cfg(target_os = "macos")]
ignored_windows.extend([
".env".to_string(),
@@ -486,60 +411,32 @@ impl Default for SettingsStore {
};
Self {
+ // App-specific defaults override RecordingSettings::default() where needed
+ recording: screenpipe_config::RecordingSettings {
+ audio_transcription_engine: "whisper-large-v3-turbo-quantized".to_string(),
+ monitor_ids: vec!["default".to_string()],
+ audio_devices: vec!["default".to_string()],
+ use_pii_removal: true,
+ vad_sensitivity: "medium".to_string(),
+ analytics_id: uuid::Uuid::new_v4().to_string(),
+ ignored_windows,
+ ..screenpipe_config::RecordingSettings::default()
+ },
ai_presets: vec![default_free_preset],
- deepgram_api_key: "".to_string(),
is_loading: false,
- user_id: "".to_string(),
- analytics_id: uuid::Uuid::new_v4().to_string(),
-
dev_mode: false,
- audio_transcription_engine: "whisper-large-v3-turbo-quantized".to_string(),
#[cfg(target_os = "macos")]
ocr_engine: "apple-native".to_string(),
#[cfg(target_os = "windows")]
ocr_engine: "windows-native".to_string(),
#[cfg(target_os = "linux")]
ocr_engine: "tesseract".to_string(),
- monitor_ids: vec!["default".to_string()],
- audio_devices: vec!["default".to_string()],
- use_system_default_audio: true,
- use_pii_removal: true,
- filter_music: false,
- port: 3030,
data_dir: "default".to_string(),
- disable_audio: false,
- ignored_windows,
- included_windows: vec![],
- ignored_urls: vec![],
-
- fps: 0.5,
- vad_sensitivity: "medium".to_string(),
- analytics_enabled: true,
- audio_chunk_duration: 30,
- use_chinese_mirror: false,
- languages: vec![],
embedded_llm: EmbeddedLLM::default(),
auto_start_enabled: true,
platform: "unknown".to_string(),
disabled_shortcuts: vec![],
- user: User {
- id: None,
- name: None,
- email: None,
- image: None,
- token: None,
- clerk_id: None,
- api_key: None,
- credits: None,
- stripe_connected: None,
- stripe_account_status: None,
- github_username: None,
- bio: None,
- website: None,
- contact: None,
- cloud_subscribed: None,
- credits_balance: None,
- },
+ user: User::default(),
#[cfg(target_os = "windows")]
show_screenpipe_shortcut: "Alt+S".to_string(),
#[cfg(not(target_os = "windows"))]
@@ -573,23 +470,16 @@ impl Default for SettingsStore {
#[cfg(not(target_os = "windows"))]
lock_vault_shortcut: "Super+Shift+L".to_string(),
realtime_audio_transcription_engine: "deepgram".to_string(),
- disable_vision: false,
disable_ocr: false,
- use_all_monitors: true, // Match CLI default - dynamic monitor detection
show_shortcut_overlay: true,
device_id: uuid::Uuid::new_v4().to_string(),
- adaptive_fps: false,
- enable_input_capture: true,
- enable_accessibility: true,
auto_update: true,
#[cfg(target_os = "macos")]
overlay_mode: "fullscreen".to_string(),
#[cfg(not(target_os = "macos"))]
overlay_mode: "window".to_string(),
show_overlay_in_screen_recording: false,
- video_quality: "balanced".to_string(),
chat_always_on_top: true,
- ignore_incognito_windows: true,
show_restart_notifications: true,
extra: std::collections::HashMap::new(),
}
@@ -663,112 +553,53 @@ impl SettingsStore {
}
}
+ /// Build a `RecordingSettings` from this settings store.
+ ///
+ /// Since RecordingSettings is now embedded via flatten, this is mostly a
+ /// clone with overrides for fields that need special handling (e.g. user_id
+ /// comes from the User auth object, user_name has a fallback chain).
+ pub fn to_recording_settings(&self) -> screenpipe_config::RecordingSettings {
+ let mut settings = self.recording.clone();
+ // Override user_id from auth user object (not the flat userId field)
+ settings.user_id = self
+ .user
+ .id
+ .as_ref()
+ .filter(|id| !id.is_empty())
+ .cloned()
+ .unwrap_or_default();
+ // Fallback chain: userName setting → cloud name → cloud email
+ settings.user_name = settings
+ .user_name
+ .filter(|s| !s.trim().is_empty())
+ .or_else(|| self.user.name.clone().filter(|s| !s.trim().is_empty()))
+ .or_else(|| self.user.email.clone().filter(|s| !s.trim().is_empty()));
+ // Always force these on for the engine
+ settings.enable_input_capture = true;
+ settings.enable_accessibility = true;
+ settings
+ }
+
/// Build a unified `RecordingConfig` from this settings store.
pub fn to_recording_config(
&self,
data_dir: std::path::PathBuf,
) -> screenpipe_engine::RecordingConfig {
- use screenpipe_audio::audio_manager::builder::TranscriptionMode;
- use screenpipe_audio::core::engine::AudioTranscriptionEngine;
- let audio_engine_str = self.resolve_audio_engine();
-
- screenpipe_engine::RecordingConfig {
- audio_chunk_duration: self.audio_chunk_duration as u64,
- port: self.port,
+ let resolved_engine = self.resolve_audio_engine();
+ let settings = self.to_recording_settings();
+ screenpipe_engine::RecordingConfig::from_settings(
+ &settings,
data_dir,
- disable_audio: self.disable_audio,
- disable_vision: self.disable_vision,
- use_pii_removal: self.use_pii_removal,
- filter_music: self.filter_music,
- enable_input_capture: true, // always enabled, setting removed from UI
- enable_accessibility: true, // always enabled, setting removed from UI
- audio_transcription_engine: audio_engine_str
- .parse()
- .unwrap_or(AudioTranscriptionEngine::WhisperLargeV3Turbo),
- transcription_mode: match self.extra.get("transcriptionMode").and_then(|v| v.as_str()) {
- Some("smart") | Some("batch") => TranscriptionMode::Batch,
- _ => TranscriptionMode::Realtime,
- },
- audio_devices: self.audio_devices.clone(),
- use_system_default_audio: self.use_system_default_audio,
- monitor_ids: self.monitor_ids.clone(),
- use_all_monitors: self.use_all_monitors,
- ignored_windows: self.ignored_windows.clone(),
- included_windows: self.included_windows.clone(),
- ignored_urls: self.ignored_urls.clone(),
- ignore_incognito_windows: self.ignore_incognito_windows,
- languages: self
- .languages
- .iter()
- .filter(|s| s != &"default")
- .filter_map(|s| s.parse().ok())
- .collect(),
- deepgram_api_key: if self.deepgram_api_key.is_empty()
- || self.deepgram_api_key == "default"
- {
- None
- } else {
- Some(self.deepgram_api_key.clone())
- },
- user_id: self.user.id.as_ref().filter(|id| !id.is_empty()).cloned(),
- // OpenAI Compatible transcription
- openai_compatible_endpoint: self
- .extra
- .get("openaiCompatibleEndpoint")
- .and_then(|v| v.as_str())
- .map(|s| s.to_string()),
- openai_compatible_api_key: self
- .extra
- .get("openaiCompatibleApiKey")
- .and_then(|v| v.as_str())
- .map(|s| s.to_string()),
- openai_compatible_model: self
- .extra
- .get("openaiCompatibleModel")
- .and_then(|v| v.as_str())
- .map(|s| s.to_string()),
- // Fallback chain for speaker identification: userName setting → cloud name → cloud email
- user_name: self
- .extra
- .get("userName")
- .and_then(|v| v.as_str())
- .map(|s| s.to_string())
- .filter(|s| !s.trim().is_empty())
- .or_else(|| self.user.name.clone().filter(|s| !s.trim().is_empty()))
- .or_else(|| self.user.email.clone().filter(|s| !s.trim().is_empty())),
- video_quality: self.video_quality.clone(),
- use_chinese_mirror: self.use_chinese_mirror,
- analytics_enabled: self.analytics_enabled,
- analytics_id: self.analytics_id.clone(),
- vocabulary: self
- .extra
- .get("vocabularyWords")
- .and_then(|v| {
- serde_json::from_value::<Vec<screenpipe_audio::transcription::VocabularyEntry>>(
- v.clone(),
- )
- .ok()
- })
- .unwrap_or_default(),
- batch_max_duration_secs: self
- .extra
- .get("batchMaxDurationSecs")
- .and_then(|v| v.as_u64())
- .filter(|&v| v > 0),
- power_mode: self
- .extra
- .get("powerMode")
- .and_then(|v| v.as_str())
- .map(|s| s.to_string()),
- }
+ Some(&resolved_engine),
+ )
}
fn resolve_audio_engine(&self) -> String {
- let engine = self.audio_transcription_engine.clone();
+ let engine = self.recording.audio_transcription_engine.clone();
let has_user_id = self.user.id.as_ref().map_or(false, |id| !id.is_empty());
let is_subscribed = self.user.cloud_subscribed == Some(true);
- let has_deepgram_key =
- !self.deepgram_api_key.is_empty() && self.deepgram_api_key != "default";
+ let has_deepgram_key = !self.recording.deepgram_api_key.is_empty()
+ && self.recording.deepgram_api_key != "default";
match engine.as_str() {
"screenpipe-cloud" if !has_user_id => {
tracing::warn!("screenpipe-cloud selected but user not logged in, falling back to whisper-large-v3-turbo-quantized");
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/voice_training.rs b/apps/screenpipe-app-tauri/src-tauri/src/voice_training.rs
index 753c36513..2912beedc 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/voice_training.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/voice_training.rs
@@ -30,12 +30,12 @@ pub async fn train_voice(
.ok()
.flatten()
.unwrap_or_default();
- if store.disable_audio {
+ if store.recording.disable_audio {
return Err(
"voice training requires audio recording, but audio is disabled in settings".into(),
);
}
- let port = store.port;
+ let port = store.recording.port;
if TRAINING_IN_PROGRESS.swap(true, Ordering::SeqCst) {
return Err("voice training already in progress".into());
diff --git a/crates/screenpipe-config/Cargo.toml b/crates/screenpipe-config/Cargo.toml
index dd21ab4de..c1144b76d 100644
--- a/crates/screenpipe-config/Cargo.toml
+++ b/crates/screenpipe-config/Cargo.toml
@@ -13,6 +13,11 @@ serde_json = "1"
toml = "0.8"
tracing = { workspace = true }
dirs = "6"
+specta = { version = "=2.0.0-rc.20", features = ["derive"], optional = true }
+
+[features]
+default = []
+specta = ["dep:specta"]
[dev-dependencies]
serde_json = "1"
diff --git a/crates/screenpipe-config/src/recording.rs b/crates/screenpipe-config/src/recording.rs
index 282b8c0df..aec02754d 100644
--- a/crates/screenpipe-config/src/recording.rs
+++ b/crates/screenpipe-config/src/recording.rs
@@ -8,6 +8,7 @@ use serde::{Deserialize, Serialize};
/// Custom vocabulary entry for transcription biasing and word replacement.
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq)]
+#[cfg_attr(feature = "specta", derive(specta::Type))]
pub struct VocabEntry {
/// The word or phrase to bias toward during transcription.
pub word: String,
@@ -27,6 +28,7 @@ pub struct VocabEntry {
/// JSON schema (store.bin). This ensures backwards compatibility — existing
/// `store.bin` files deserialize without migration.
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
+#[cfg_attr(feature = "specta", derive(specta::Type))]
#[serde(default)]
pub struct RecordingSettings {
// ── Audio ──────────────────────────────────────────────────────────
diff --git a/crates/screenpipe-engine/Cargo.toml b/crates/screenpipe-engine/Cargo.toml
index 253137059..81434fd5f 100644
--- a/crates/screenpipe-engine/Cargo.toml
+++ b/crates/screenpipe-engine/Cargo.toml
@@ -22,6 +22,7 @@ screenpipe-core = { path = "../screenpipe-core", features = ["security", "cloud-
screenpipe-db = { path = "../screenpipe-db" }
screenpipe-a11y = { path = "../screenpipe-a11y", features = ["db"] }
screenpipe-apple-intelligence = { path = "../screenpipe-apple-intelligence", optional = true }
+screenpipe-config = { path = "../screenpipe-config" }
screenpipe-connect = { path = "../screenpipe-connect" }
screenpipe-vault = { path = "../screenpipe-vault" }
diff --git a/crates/screenpipe-engine/src/recording_config.rs b/crates/screenpipe-engine/src/recording_config.rs
index 6a923ff4a..8b9e42097 100644
--- a/crates/screenpipe-engine/src/recording_config.rs
+++ b/crates/screenpipe-engine/src/recording_config.rs
@@ -89,6 +89,76 @@ pub struct RecordingConfig {
}
impl RecordingConfig {
+ /// Build a `RecordingConfig` from the shared `RecordingSettings` type.
+ ///
+ /// This is the **single conversion point** from the flat, serde-friendly
+ /// `RecordingSettings` (strings, sentinels) to the typed engine config
+ /// (enums, `Option`, `PathBuf`).
+ ///
+ /// `audio_engine_override`: if provided, overrides `settings.audio_transcription_engine`.
+ /// The caller is responsible for engine-fallback logic (e.g. checking subscription status).
+ pub fn from_settings(
+ settings: &screenpipe_config::RecordingSettings,
+ data_dir: std::path::PathBuf,
+ audio_engine_override: Option<&str>,
+ ) -> Self {
+ let engine_str = audio_engine_override
+ .unwrap_or(&settings.audio_transcription_engine);
+
+ Self {
+ audio_chunk_duration: settings.audio_chunk_duration.max(0) as u64,
+ port: settings.port,
+ data_dir,
+ disable_audio: settings.disable_audio,
+ disable_vision: settings.disable_vision,
+ use_pii_removal: settings.use_pii_removal,
+ filter_music: settings.filter_music,
+ enable_input_capture: settings.enable_input_capture,
+ enable_accessibility: settings.enable_accessibility,
+ audio_transcription_engine: engine_str
+ .parse()
+ .unwrap_or(AudioTranscriptionEngine::WhisperLargeV3Turbo),
+ transcription_mode: match settings.transcription_mode.as_str() {
+ "smart" | "batch" => TranscriptionMode::Batch,
+ _ => TranscriptionMode::Realtime,
+ },
+ audio_devices: settings.audio_devices.clone(),
+ use_system_default_audio: settings.use_system_default_audio,
+ monitor_ids: settings.monitor_ids.clone(),
+ use_all_monitors: settings.use_all_monitors,
+ ignored_windows: settings.ignored_windows.clone(),
+ included_windows: settings.included_windows.clone(),
+ ignored_urls: settings.ignored_urls.clone(),
+ ignore_incognito_windows: settings.ignore_incognito_windows,
+ languages: settings
+ .languages
+ .iter()
+ .filter(|s| s.as_str() != "default")
+ .filter_map(|s| s.parse().ok())
+ .collect(),
+ deepgram_api_key: settings.effective_deepgram_key().map(|s| s.to_string()),
+ user_id: settings.effective_user_id().map(|s| s.to_string()),
+ openai_compatible_endpoint: settings.openai_compatible_endpoint.clone(),
+ openai_compatible_api_key: settings.openai_compatible_api_key.clone(),
+ openai_compatible_model: settings.openai_compatible_model.clone(),
+ user_name: settings.user_name.clone(),
+ video_quality: settings.video_quality.clone(),
+ use_chinese_mirror: settings.use_chinese_mirror,
+ analytics_enabled: settings.analytics_enabled,
+ analytics_id: settings.analytics_id.clone(),
+ vocabulary: settings
+ .vocabulary
+ .iter()
+ .map(|v| VocabularyEntry {
+ word: v.word.clone(),
+ replacement: v.replace_with.clone(),
+ })
+ .collect(),
+ batch_max_duration_secs: settings.batch_max_duration_secs.filter(|&v| v > 0),
+ power_mode: settings.power_mode.clone(),
+ }
+ }
+
/// Build a `UiRecorderConfig` from this recording config.
pub fn to_ui_recorder_config(&self) -> crate::ui_recorder::UiRecorderConfig {
crate::ui_recorder::UiRecorderConfig {