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

refactor: replace sidecar with in-process recording, build improvements

Louis Beaumont94312ef1a947
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index fa49c399c..f368fa56f 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -251,7 +251,6 @@ jobs:
apps/screenpipe-app-tauri/src-tauri/ffmpeg-*
# Platform specific bins
apps/screenpipe-app-tauri/src-tauri/bun-*
- apps/screenpipe-app-tauri/src-tauri/screenpipe-*
key: ${{ matrix.platform }}-${{ matrix.target }}-pre-build-${{ hashFiles('**/Cargo.lock', '**/bun.lockb') }}
restore-keys: |
${{ matrix.platform }}-${{ matrix.target }}-pre-build-
@@ -426,40 +425,6 @@ jobs:
run: bun ./scripts/pre_build.js ${{ matrix.pre-build-args }}
working-directory: ${{ github.workspace }}/apps/screenpipe-app-tauri
- - name: Build CLI
- if: matrix.os_type != 'windows'
- shell: bash
- run: |
- if [[ "${{ matrix.os_type }}" == "macos" ]]; then
- export PKG_CONFIG_PATH="/usr/local/opt/ffmpeg/lib/pkgconfig:$PKG_CONFIG_PATH"
- export PKG_CONFIG_ALLOW_CROSS=1
- # Fix i8mm build error - force M1 compatible architecture
- # M1 = armv8.4-a (no i8mm), M2+ = armv8.5-a+ (has i8mm)
- # -U__ARM_FEATURE_MATMUL_INT8 undefines the i8mm macro to prevent
- # the code from using i8mm intrinsics that aren't available on M1
- # See: https://github.com/ggml-org/whisper.cpp/issues/3427
- if [[ "${{ matrix.target }}" == "aarch64-apple-darwin" ]]; then
- export CFLAGS="-mcpu=apple-m1 -U__ARM_FEATURE_MATMUL_INT8"
- export CXXFLAGS="-mcpu=apple-m1 -U__ARM_FEATURE_MATMUL_INT8"
- fi
- fi
- cargo build --release -p screenpipe-server ${{ matrix.args }}
-
- - name: Build CLI on Windows
- if: matrix.os_type == 'windows'
- shell: powershell
- env:
- CARGO_PROFILE_RELEASE_STRIP: none
- CARGO_PROFILE_RELEASE_PANIC: abort
- CARGO_PROFILE_RELEASE_INCREMENTAL: false
- run: cargo build --release -p screenpipe-server ${{ matrix.args }}
-
- # Run pre build again to copy the CLI into app
- - name: Run pre_build.js
- run: |
- bun ./scripts/pre_build.js ${{ matrix.pre-build-args }}
- working-directory: ${{ github.workspace }}/apps/screenpipe-app-tauri
-
- uses: actions/setup-python@v5
if: matrix.os_type == 'windows'
with:
@@ -592,11 +557,8 @@ jobs:
# Install sentry-cli
Invoke-WebRequest -Uri "https://release-registry.services.sentry.io/apps/sentry-cli/latest?response=download&arch=x86_64&platform=Windows&package=sentry-cli" -OutFile sentry-cli.exe
- # Upload debug symbols (.pdb files) for screenpipe-cli project
+ # Upload debug symbols (.pdb files) for the app
Write-Host "Uploading debug symbols to Sentry..."
- .\sentry-cli.exe debug-files upload --org $env:SENTRY_ORG --project screenpipe-cli target/x86_64-pc-windows-msvc/release/
-
- # Also upload for the app
.\sentry-cli.exe debug-files upload --org $env:SENTRY_ORG --project screenpipe-app apps/screenpipe-app-tauri/src-tauri/target/release/
- name: Upload debug symbols to Sentry (macOS)
@@ -610,11 +572,8 @@ jobs:
# Install sentry-cli
curl -sL https://sentry.io/get-cli/ | bash
- # Upload debug symbols (dSYM files) for screenpipe-cli project
+ # Upload debug symbols (dSYM files) for the app
echo "Uploading debug symbols to Sentry..."
- sentry-cli debug-files upload --org $SENTRY_ORG --project screenpipe-cli target/${{ matrix.target }}/release/
-
- # Also upload for the app
sentry-cli debug-files upload --org $SENTRY_ORG --project screenpipe-app apps/screenpipe-app-tauri/src-tauri/target/${{ matrix.target }}/release/
- name: Download and Run CLI Manually (Windows)
diff --git a/Cargo.toml b/Cargo.toml
index ca9046120..aeb0d107d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,7 @@ exclude = ["apps/screenpipe-app-tauri/src-tauri"]
resolver = "2"
[workspace.package]
-version = "0.3.47"
+version = "0.3.48"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/screenpipe/screenpipe"
diff --git a/apps/screenpipe-app-tauri/scripts/pre_build.js b/apps/screenpipe-app-tauri/scripts/pre_build.js
index d3674c696..1d5fe656f 100644
--- a/apps/screenpipe-app-tauri/scripts/pre_build.js
+++ b/apps/screenpipe-app-tauri/scripts/pre_build.js
@@ -236,42 +236,6 @@ if (platform == 'linux') {
}
- // Copy screenpipe binary
- console.log('copying screenpipe binary for linux...');
- const potentialPaths = [
- path.join(__dirname, '..', '..', '..', '..', 'target', 'release', 'screenpipe'),
- path.join(__dirname, '..', '..', '..', '..', 'target', 'x86_64-unknown-linux-gnu', 'release', 'screenpipe'),
- path.join(__dirname, '..', '..', 'target', 'x86_64-unknown-linux-gnu', 'release', 'screenpipe'),
- path.join(__dirname, '..', '..', '..', 'target', 'release', 'screenpipe'),
- path.join(__dirname, '..', '..', 'target', 'release', 'screenpipe'),
- path.join(__dirname, '..', 'target', 'release', 'screenpipe'),
- '/home/runner/work/screenpipe/screenpipe/target/release/screenpipe',
- ];
-
- let copied = false;
- for (const screenpipeSrc of potentialPaths) {
- if (process.env['SKIP_SCREENPIPE_SETUP']) {
- copied = true;
- break;
- }
- const screenpipeDest = path.join(cwd, 'screenpipe-x86_64-unknown-linux-gnu');
- try {
- await fs.copyFile(screenpipeSrc, screenpipeDest);
- console.log(`screenpipe binary copied successfully from ${screenpipeSrc}`);
- copied = true;
- break;
- } catch (error) {
- console.warn(`failed to copy screenpipe binary from ${screenpipeSrc}:`, error);
- }
- }
-
- if (!copied) {
- console.error("failed to copy screenpipe binary from any potential path.");
- // uncomment the following line if you want the script to exit on failure
- // process.exit(1);
- }
-
-
// Setup FFMPEG
if (!(await fs.exists(config.ffmpegRealname))) {
await $`wget --no-config -nc ${config.linux.ffmpegUrl} -O ${config.linux.ffmpegName}.tar.xz`
@@ -294,41 +258,6 @@ if (platform == 'linux') {
if (platform == 'windows') {
const wgetPath = await findWget();
- console.log('Copying screenpipe binary...');
-
- const potentialPaths = [
- path.join(__dirname, '..', '..', '..', 'target', 'release', 'screenpipe.exe'),
- path.join(__dirname, '..', '..', '..', 'target', 'x86_64-pc-windows-msvc', 'release', 'screenpipe.exe'),
- path.join(__dirname, '..', '..', 'target', 'release', 'screenpipe.exe'),
- path.join(__dirname, '..', '..', 'target', 'x86_64-pc-windows-msvc', 'release', 'screenpipe.exe'),
- path.join(__dirname, '..', 'target', 'release', 'screenpipe.exe'),
- path.join(__dirname, '..', '..', 'target', 'release', 'screenpipe.exe'),
- 'D:\\a\\screenpipe\\screenpipe\\target\\release\\screenpipe.exe',
- ];
-
- let copied = false;
- for (const screenpipeSrc of potentialPaths) {
- if (process.env['SKIP_SCREENPIPE_SETUP']) {
- copied = true;
- break;
- }
- const screenpipeDest = path.join(cwd, 'screenpipe-x86_64-pc-windows-msvc.exe');
- try {
- await fs.copyFile(screenpipeSrc, screenpipeDest);
- console.log(`Screenpipe binary copied successfully from ${screenpipeSrc}`);
- copied = true;
- break;
- } catch (error) {
- console.warn(`Failed to copy screenpipe binary from ${screenpipeSrc}:`, error);
- }
- }
-
- if (!copied) {
- console.error("Failed to copy screenpipe binary from any potential path.");
- // Uncomment the following line if you want the script to exit on failure
- // process.exit(1);
- }
-
// Setup FFMPEG
if (!(await fs.exists(config.ffmpegRealname))) {
await $`${wgetPath} --no-config --tries=10 --retry-connrefused --waitretry=10 --secure-protocol=auto --no-check-certificate --show-progress ${config.windows.ffmpegUrl} -O ${config.windows.ffmpegName}.7z`
@@ -342,71 +271,8 @@ if (platform == 'windows') {
// await $`SystemDrive=${process.env.SYSTEMDRIVE} SystemRoot=${process.env.SYSTEMROOT} windir=${process.env.WINDIR} ${process.env.VCPKG_ROOT}\\vcpkg.exe install ${config.windows.vcpkgPackages}`.quiet()
}
-async function getMostRecentBinaryPath(targetArch, paths) {
- const validPaths = await Promise.all(paths.map(async (path) => {
- if (await fs.exists(path)) {
- const { stdout } = await $`file ${path}`.quiet();
- const binaryArch = stdout.includes('arm64') ? 'arm64' :
- stdout.includes('x86_64') ? 'x86_64' : null;
- if (binaryArch === targetArch) {
- const stat = await fs.stat(path);
- return { path, mtime: stat.mtime };
- }
- }
- return null;
- }));
-
- const filteredPaths = validPaths.filter(Boolean);
-
- if (filteredPaths.length === 0) {
- return null;
- }
-
- return filteredPaths.reduce((mostRecent, current) =>
- current.mtime > mostRecent.mtime ? current : mostRecent
- ).path;
-}
/* ########## macOS ########## */
if (platform == 'macos') {
- const architectures = ['arm64', 'x86_64'];
- for (const arch of architectures) {
- if (process.env['SKIP_SCREENPIPE_SETUP']) {
- break;
- }
- console.log(`Setting up screenpipe bin for ${arch}...`);
- if (arch === 'arm64') {
- const paths = [
- "../../../target/aarch64-apple-darwin/release/screenpipe",
- "../../../target/release/screenpipe",
- "../../target/aarch64-apple-darwin/release/screenpipe",
- "../../target/release/screenpipe"
- ];
- const mostRecentPath = await getMostRecentBinaryPath('arm64', paths);
- if (mostRecentPath) {
- await $`cp ${mostRecentPath} screenpipe-aarch64-apple-darwin`;
- console.log(`Copied most recent arm64 screenpipe binary from ${mostRecentPath}`);
- } else {
- console.error("No suitable arm64 screenpipe binary found");
- }
- } else if (arch === 'x86_64') {
- // copy screenpipe binary (more recent one)
- const paths = [
- "../../../target/x86_64-apple-darwin/release/screenpipe",
- "../../../target/release/screenpipe",
- "../../target/x86_64-apple-darwin/release/screenpipe",
- "../../target/release/screenpipe"
- ];
- const mostRecentPath = await getMostRecentBinaryPath('x86_64', paths);
- if (mostRecentPath) {
- await $`cp ${mostRecentPath} screenpipe-x86_64-apple-darwin`;
- console.log(`Copied most recent x86_64 screenpipe binary from ${mostRecentPath}`);
- } else {
- console.error("No suitable x86_64 screenpipe binary found");
- }
- }
- console.log(`screenpipe for ${arch} set up successfully.`);
- }
-
// Setup ffmpeg and ffprobe for both arm64 and x86_64
// ref: https://github.com/nathanbabcock/ffmpeg-sidecar/blob/b0ab2e1233451f219e302bf78cbbb6a5a8e85aa4/src/download.rs#L31
if (!(await fs.exists(`ffmpeg-aarch64-apple-darwin`))) {
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 400d9dd96..112220778 100755
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9007,7 +9007,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.0.252"
+version = "2.0.254"
dependencies = [
"anyhow",
"async-stream",
@@ -9089,7 +9089,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.46"
+version = "0.3.47"
dependencies = [
"anyhow",
"bytemuck",
@@ -9137,7 +9137,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.46"
+version = "0.3.47"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -9188,7 +9188,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.46"
+version = "0.3.47"
dependencies = [
"anyhow",
"chrono",
@@ -9212,7 +9212,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.46"
+version = "0.3.47"
dependencies = [
"anyhow",
"chrono",
@@ -9228,7 +9228,7 @@ dependencies = [
[[package]]
name = "screenpipe-integrations"
-version = "0.3.46"
+version = "0.3.47"
dependencies = [
"anyhow",
"image 0.25.9",
@@ -9243,7 +9243,7 @@ dependencies = [
[[package]]
name = "screenpipe-server"
-version = "0.3.46"
+version = "0.3.47"
dependencies = [
"anyhow",
"async-trait",
@@ -9307,7 +9307,7 @@ dependencies = [
[[package]]
name = "screenpipe-vision"
-version = "0.3.46"
+version = "0.3.47"
dependencies = [
"accessibility-sys",
"anyhow",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index c8a1b6f5c..bf66742a3 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.0.253"
+version = "2.0.254"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
index 2cd79fe1d..a9def7c43 100755
--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
@@ -41,7 +41,7 @@ mod commands;
mod disk_usage;
mod permissions;
mod server;
-mod sidecar;
+mod recording;
mod store;
mod tray;
mod updates;
@@ -57,7 +57,7 @@ mod embedded_server;
pub use server::*;
-pub use sidecar::*;
+pub use recording::*;
pub use icons::*;
pub use store::get_store;
@@ -69,8 +69,8 @@ pub use commands::set_tray_health_icon;
pub use commands::set_tray_unhealth_icon;
pub use commands::write_browser_log;
pub use server::spawn_server;
-pub use sidecar::spawn_screenpipe;
-pub use sidecar::stop_screenpipe;
+pub use recording::spawn_screenpipe;
+pub use recording::stop_screenpipe;
// Removed: pub use store::get_profiles_store; // Profile functionality has been removed
use crate::commands::hide_main_window;
@@ -804,8 +804,8 @@ async fn main() {
update_global_shortcuts,
spawn_screenpipe,
stop_screenpipe,
- sidecar::get_monitors,
- sidecar::get_audio_devices,
+ recording::get_monitors,
+ recording::get_audio_devices,
// Commands from commands.rs
commands::get_disk_usage,
commands::open_pipe_window,
@@ -876,7 +876,7 @@ async fn main() {
.expect("Failed to export TypeScript bindings");
}
- let sidecar_state = SidecarState(Arc::new(tokio::sync::Mutex::new(None)));
+ let recording_state = RecordingState(Arc::new(tokio::sync::Mutex::new(None)));
let pi_state = pi::PiState(Arc::new(tokio::sync::Mutex::new(None)));
let obsidian_sync_state = obsidian_sync::ObsidianSyncState::new();
#[allow(clippy::single_match)]
@@ -930,14 +930,14 @@ async fn main() {
#[cfg(target_os = "macos")]
let app = app.plugin(tauri_nspanel::init());
- let app = app.manage(sidecar_state)
+ let app = app.manage(recording_state)
.manage(pi_state)
.manage(obsidian_sync_state)
.invoke_handler(tauri::generate_handler![
spawn_screenpipe,
stop_screenpipe,
- sidecar::get_monitors,
- sidecar::get_audio_devices,
+ recording::get_monitors,
+ recording::get_audio_devices,
permissions::open_permission_settings,
permissions::request_permission,
permissions::do_permissions_check,
@@ -1224,8 +1224,8 @@ async fn main() {
if !use_dev_mode {
let store_clone = store.clone();
let base_dir_clone = base_dir.clone();
- let sidecar_state = app_handle.state::<SidecarState>();
- let sidecar_state_inner = sidecar_state.0.clone();
+ let recording_state = app_handle.state::<RecordingState>();
+ let recording_state_inner = recording_state.0.clone();
// Spawn a dedicated thread for the server with its own runtime
// This prevents CPU contention between UI and recording workloads
@@ -1283,7 +1283,7 @@ async fn main() {
info!("Embedded screenpipe server started successfully on dedicated runtime");
// Store handle in state so it can be stopped/restarted later
{
- let mut guard = sidecar_state_inner.lock().await;
+ let mut guard = recording_state_inner.lock().await;
*guard = Some(handle);
}
@@ -1293,7 +1293,7 @@ async fn main() {
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
// Check if handle was taken (indicating shutdown requested)
- let guard = sidecar_state_inner.lock().await;
+ let guard = recording_state_inner.lock().await;
if guard.is_none() {
info!("Server handle removed from state, shutting down server thread");
break;
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/sidecar.rs b/apps/screenpipe-app-tauri/src-tauri/src/recording.rs
similarity index 96%
rename from apps/screenpipe-app-tauri/src-tauri/src/sidecar.rs
rename to apps/screenpipe-app-tauri/src-tauri/src/recording.rs
index 2d23a8b57..f0f3d0447 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/sidecar.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/recording.rs
@@ -9,7 +9,7 @@ use tokio::sync::Mutex;
use tracing::{debug, error, info, warn};
/// State holding the embedded server handle
-pub struct SidecarState(pub Arc<Mutex<Option<EmbeddedServerHandle>>>);
+pub struct RecordingState(pub Arc<Mutex<Option<EmbeddedServerHandle>>>);
#[derive(Debug, Serialize, Deserialize, Clone, specta::Type)]
#[serde(rename_all = "camelCase")]
@@ -101,7 +101,7 @@ pub async fn get_monitors() -> Result<Vec<MonitorDevice>, String> {
#[tauri::command]
#[specta::specta]
pub async fn stop_screenpipe(
- state: State<'_, SidecarState>,
+ state: State<'_, RecordingState>,
_app: tauri::AppHandle,
) -> Result<(), String> {
info!("Stopping screenpipe server");
@@ -122,7 +122,7 @@ pub async fn stop_screenpipe(
#[tauri::command]
#[specta::specta]
pub async fn spawn_screenpipe(
- state: State<'_, SidecarState>,
+ state: State<'_, RecordingState>,
app: tauri::AppHandle,
_override_args: Option<Vec<String>>,
) -> Result<(), String> {
@@ -200,7 +200,7 @@ pub async fn spawn_screenpipe(
// Build config from store
let config = EmbeddedServerConfig::from_store(&store, base_dir);
- let sidecar_state_inner = state.0.clone();
+ let recording_state_inner = state.0.clone();
// Use a oneshot channel to report success/failure from the dedicated runtime
let (result_tx, result_rx) = tokio::sync::oneshot::channel::<Result<(), String>>();
@@ -228,7 +228,7 @@ pub async fn spawn_screenpipe(
Ok(handle) => {
info!("Embedded screenpipe server started successfully on dedicated runtime");
{
- let mut guard = sidecar_state_inner.lock().await;
+ let mut guard = recording_state_inner.lock().await;
*guard = Some(handle);
}
// Signal success to the caller
@@ -237,7 +237,7 @@ pub async fn spawn_screenpipe(
// Keep the runtime alive until the handle is taken (shutdown requested)
loop {
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
- let guard = sidecar_state_inner.lock().await;
+ let guard = recording_state_inner.lock().await;
if guard.is_none() {
info!("Server handle removed from state, shutting down server thread");
break;
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/server.rs b/apps/screenpipe-app-tauri/src-tauri/src/server.rs
index af0514db2..4eef12e08 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/server.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/server.rs
@@ -172,8 +172,11 @@ pub async fn run_server(app_handle: tauri::AppHandle, port: u16) {
.route("/app-icon", axum::routing::get(get_app_icon_handler))
.route("/window-size", axum::routing::post(set_window_size))
.route("/sse/settings", axum::routing::get(settings_stream))
- .route("/sidecar/start", axum::routing::post(start_sidecar))
- .route("/sidecar/stop", axum::routing::post(stop_sidecar))
+ .route("/recording/start", axum::routing::post(start_recording))
+ .route("/recording/stop", axum::routing::post(stop_recording))
+ // Keep old routes for backward compatibility
+ .route("/sidecar/start", axum::routing::post(start_recording))
+ .route("/sidecar/stop", axum::routing::post(stop_recording))
.route("/window", axum::routing::post(show_specific_window))
.route("/window/close", axum::routing::post(close_window))
.route(
@@ -374,14 +377,14 @@ async fn set_window_size(
}
}
-async fn start_sidecar(
+async fn start_recording(
State(state): State<ServerState>,
) -> Result<Json<ApiResponse>, (StatusCode, String)> {
info!("received request to start screenpipe server");
let app_handle = state.app_handle.clone();
- match crate::sidecar::spawn_screenpipe(
- app_handle.clone().state::<crate::SidecarState>(),
+ match crate::recording::spawn_screenpipe(
+ app_handle.clone().state::<crate::RecordingState>(),
app_handle,
None,
)
@@ -401,14 +404,14 @@ async fn start_sidecar(
}
}
-async fn stop_sidecar(
+async fn stop_recording(
State(state): State<ServerState>,
) -> Result<Json<ApiResponse>, (StatusCode, String)> {
info!("received request to stop screenpipe server");
let app_handle = state.app_handle.clone();
- match crate::sidecar::stop_screenpipe(
- app_handle.clone().state::<crate::SidecarState>(),
+ match crate::recording::stop_screenpipe(
+ app_handle.clone().state::<crate::RecordingState>(),
app_handle,
)
.await
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/tray.rs b/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
index 15ee3f39f..e9ff773f9 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
@@ -1,6 +1,6 @@
use crate::commands::show_main_window;
use crate::health::{get_recording_status, RecordingStatus};
-use crate::sidecar::SidecarState;
+use crate::recording::RecordingState;
use crate::store::{get_store, OnboardingStore};
use crate::updates::is_source_build;
use crate::window_api::ShowRewindWindow;
@@ -252,18 +252,17 @@ fn handle_menu_event(app_handle: &AppHandle, event: tauri::menu::MenuEvent) {
"quit" => {
debug!("Quit requested");
- // Stop the sidecar before exiting
+ // Stop recording before exiting
let app_handle_clone = app_handle.clone();
tauri::async_runtime::spawn(async move {
- info!("Stopping screenpipe sidecar before quit...");
- if let Some(sidecar_state) = app_handle_clone.try_state::<SidecarState>() {
- // Access the inner Arc<Mutex<...>> directly instead of calling the tauri command
- let mut handle_guard = sidecar_state.0.lock().await;
+ info!("Stopping screenpipe recording before quit...");
+ if let Some(recording_state) = app_handle_clone.try_state::<RecordingState>() {
+ let mut handle_guard = recording_state.0.lock().await;
if let Some(handle) = handle_guard.take() {
handle.shutdown();
- info!("Screenpipe sidecar stopped successfully");
+ info!("Screenpipe recording stopped successfully");
} else {
- debug!("No sidecar running to stop");
+ debug!("No recording running to stop");
}
}
app_handle_clone.exit(0);
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/updates.rs b/apps/screenpipe-app-tauri/src-tauri/src/updates.rs
index fe432bb57..fa77a597f 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/updates.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/updates.rs
@@ -1,5 +1,5 @@
use crate::stop_screenpipe;
-use crate::SidecarState;
+use crate::RecordingState;
use anyhow::Error;
use dark_light::Mode;
use log::{error, info};
@@ -157,10 +157,10 @@ impl UpdatesManager {
.set_text("downloading latest version of screenpipe")?;
if let Err(err) =
- stop_screenpipe(self.app.state::<SidecarState>(), self.app.clone())
+ stop_screenpipe(self.app.state::<RecordingState>(), self.app.clone())
.await
{
- error!("Failed to kill sidecar: {}", err);
+ error!("Failed to stop recording: {}", err);
}
update.download_and_install(|_, _| {}, || {}).await?;
@@ -171,16 +171,13 @@ impl UpdatesManager {
}
// Proceed with the update
- // i think it shouldn't kill if we're in dev mode (on macos, windows need to kill)
- // bad UX: i use CLI and it kills my CLI because i updated app
-
#[cfg(not(target_os = "windows"))]
{
if let Err(err) =
- stop_screenpipe(self.app.state::<SidecarState>(), self.app.clone())
+ stop_screenpipe(self.app.state::<RecordingState>(), self.app.clone())
.await
{
- error!("Failed to kill sidecar: {}", err);
+ error!("Failed to stop recording: {}", err);
}
}
self.update_screenpipe();
diff --git a/apps/screenpipe-app-tauri/src-tauri/tauri.linux.conf.json b/apps/screenpipe-app-tauri/src-tauri/tauri.linux.conf.json
index f61cfd75b..5d72ab25d 100644
--- a/apps/screenpipe-app-tauri/src-tauri/tauri.linux.conf.json
+++ b/apps/screenpipe-app-tauri/src-tauri/tauri.linux.conf.json
@@ -1,7 +1,6 @@
{
"bundle": {
"externalBin": [
- "screenpipe",
"bun"
],
"linux": {
diff --git a/apps/screenpipe-app-tauri/src-tauri/tauri.macos.conf.json b/apps/screenpipe-app-tauri/src-tauri/tauri.macos.conf.json
index 2cf020465..bd48b8812 100644
--- a/apps/screenpipe-app-tauri/src-tauri/tauri.macos.conf.json
+++ b/apps/screenpipe-app-tauri/src-tauri/tauri.macos.conf.json
@@ -10,7 +10,6 @@
}
},
"externalBin": [
- "screenpipe",
"bun",
"ui_monitor",
"ffmpeg",
diff --git a/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json b/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
index 2b6f6d235..51d3a428c 100644
--- a/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
+++ b/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
@@ -9,7 +9,6 @@
}
},
"externalBin": [
- "screenpipe",
"bun"
],
"targets": [