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
fix: bun build type errors and specta bindings path
Louis Beaumont9ce03e55a8f5
diff --git a/apps/screenpipe-app-tauri/app/home/page.tsx b/apps/screenpipe-app-tauri/app/home/page.tsxindex 43b246a72..1ee603608 100644--- a/apps/screenpipe-app-tauri/app/home/page.tsx+++ b/apps/screenpipe-app-tauri/app/home/page.tsx@@ -83,6 +83,13 @@ type SettingsModalSection =| "notifications"| "referral";+type SettingsModalSectionItem = {+ id: SettingsModalSection;+ label: string;+ icon: React.ReactNode;+ group?: string;+};+// All valid URL sections (main + modal)const ALL_SECTIONS = ["home", "timeline", "pipes", "help",@@ -319,7 +326,7 @@ function SettingsPageContent() {].filter((s) => !isSectionHidden(s.id));// Settings modal sidebar items (filtered by enterprise policy)- const settingsModalSections: { id: SettingsModalSection; label: string; icon: React.ReactNode; group?: string }[] = [+ const settingsModalSections = ([{ id: "display", label: "Display", icon: <Layout className="h-4 w-4" />, group: "app" },{ id: "general", label: "General", icon: <SettingsIcon className="h-4 w-4" />, group: "app" },{ id: "ai", label: "AI models", icon: <Brain className="h-4 w-4" />, group: "app" },@@ -332,9 +339,9 @@ function SettingsPageContent() {{ id: "memories", label: "Memories", icon: <Sparkles className="h-4 w-4" />, group: "data" },{ id: "connections", label: "Connections", icon: <Plug className="h-4 w-4" />, group: "data" },{ id: "team", label: "Team", icon: <Users className="h-4 w-4" />, group: "account" },- { id: "account" as SettingsModalSection, label: "Account", icon: <User className="h-4 w-4" />, group: "account" },- { id: "referral" as SettingsModalSection, label: "Get free month", icon: <Gift className="h-4 w-4" />, group: "account" },- ].filter((s) => !isSectionHidden(s.id));+ { id: "account", label: "Account", icon: <User className="h-4 w-4" />, group: "account" },+ { id: "referral", label: "Get free month", icon: <Gift className="h-4 w-4" />, group: "account" },+ ] satisfies SettingsModalSectionItem[]).filter((s) => !isSectionHidden(s.id));const appGroup = settingsModalSections.filter(s => s.group === "app");const dataGroup = settingsModalSections.filter(s => s.group === "data");diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.ts b/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.tsindex 26211aee2..22161a9ff 100644--- a/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.ts+++ b/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.ts@@ -49,8 +49,8 @@ export function useEnterprisePolicy() {let licenseKey: string | null = null;try {const res = await commands.getEnterpriseLicenseKey();- if (res.status === "ok" && res.data) {- licenseKey = res.data;+ if (res) {+ licenseKey = res;}} catch {// no enterprise.json — use defaults onlydiff --git a/apps/screenpipe-app-tauri/src-tauri/lib/utils/tauri.ts b/apps/screenpipe-app-tauri/src-tauri/lib/utils/tauri.tsdeleted file mode 100644index 2a5a4e331..000000000--- a/apps/screenpipe-app-tauri/src-tauri/lib/utils/tauri.ts+++ /dev/null@@ -1,1291 +0,0 @@--// This file was generated by [tauri-specta](https://github.com/oscartbeaumont/tauri-specta). Do not edit this file manually.--/** user-defined commands **/---export const commands = {-async openPermissionSettings(permission: OSPermission) : Promise<void> {- await TAURI_INVOKE("open_permission_settings", { permission });-},-async requestPermission(permission: OSPermission) : Promise<void> {- await TAURI_INVOKE("request_permission", { permission });-},-/**- * Reset a permission using tccutil and re-request it- * This removes the app from the TCC database and triggers a fresh permission request- */-async resetAndRequestPermission(permission: OSPermission) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("reset_and_request_permission", { permission }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async doPermissionsCheck(initialCheck: boolean) : Promise<OSPermissionsCheck> {- return await TAURI_INVOKE("do_permissions_check", { initialCheck });-},-/**- * Check only microphone permission (no screen recording check)- * Use this for polling to avoid triggering macOS screen capture permission dialogs- */-async checkMicrophonePermission() : Promise<OSPermissionStatus> {- return await TAURI_INVOKE("check_microphone_permission");-},-/**- * Check only screen recording permission (no dialog trigger)- * Uses CGPreflightScreenCaptureAccess which is safe to poll repeatedly- */-async checkScreenRecordingPermission() : Promise<OSPermissionStatus> {- return await TAURI_INVOKE("check_screen_recording_permission");-},-/**- * Check only accessibility permission- * Use this for polling to check if user has granted accessibility permission- */-async checkAccessibilityPermissionCmd() : Promise<OSPermissionStatus> {- return await TAURI_INVOKE("check_accessibility_permission_cmd");-},-/**- * Check if Arc browser is installed (macOS only)- */-async checkArcInstalled() : Promise<boolean> {- return await TAURI_INVOKE("check_arc_installed");-},-/**- * Check if Automation permission for Arc is already granted.- * In production (.app bundle): uses direct FFI check (correct identity, no Terminal).- * In dev mode: runs the binary itself via launchctl (detached from Terminal) so- * macOS TCC checks the binary's own identity, not Terminal's.- */-async checkArcAutomationPermission() : Promise<boolean> {- return await TAURI_INVOKE("check_arc_automation_permission");-},-/**- * Request macOS Automation permission for Arc browser.- * In production: triggers "screenpipe wants to control Arc" prompt via direct FFI.- * In dev mode: runs the binary itself via launchctl to trigger the prompt with- * the correct binary identity (not Terminal's). Also opens System Settings as fallback.- */-async requestArcAutomationPermission() : Promise<boolean> {- return await TAURI_INVOKE("request_arc_automation_permission");-},-/**- * Returns the names of installed Chromium browsers that need Automation permission- */-async getInstalledBrowsers() : Promise<string[]> {- return await TAURI_INVOKE("get_installed_browsers");-},-/**- * Check if Automation permission is granted for all installed Chromium browsers.- * Returns true only if ALL installed browsers have automation granted.- */-async checkBrowsersAutomationPermission() : Promise<boolean> {- return await TAURI_INVOKE("check_browsers_automation_permission");-},-/**- * Request Automation permission for installed Chromium browsers that are already running.- * Never force-launches browsers — only prompts for ones the user already has open.- * Opens System Settings > Automation as fallback for browsers not running.- */-async requestBrowsersAutomationPermission() : Promise<boolean> {- return await TAURI_INVOKE("request_browsers_automation_permission");-},-async getEnv(name: string) : Promise<string> {- return await TAURI_INVOKE("get_env", { name });-},-/**- * Returns which E2E seeds are requested (env SCREENPIPE_E2E_SEED, comma-separated).- * Rust uses "onboarding" in setup to complete onboarding at startup.- */-async getE2eSeedFlags() : Promise<string[]> {- return await TAURI_INVOKE("get_e2e_seed_flags");-},-/**- * Check vault lock state from filesystem (no server needed).- */-async vaultStatus() : Promise<Result<string, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("vault_status") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Fast unlock: verify password, decrypt DB only, remove sentinel.- * Data files are decrypted in background — server can start immediately.- */-async vaultUnlock(password: string) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("vault_unlock", { password }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async getLogFiles() : Promise<Result<LogFile[], string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("get_log_files") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async getMediaFile(filePath: string) : Promise<Result<JsonValue, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("get_media_file", { filePath }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async uploadFileToS3(filePath: string, signedUrl: string) : Promise<Result<boolean, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("upload_file_to_s3", { filePath, signedUrl }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async updateGlobalShortcuts(showShortcut: string, startShortcut: string, stopShortcut: string, startAudioShortcut: string, stopAudioShortcut: string, profileShortcuts: { [key in string]: string }) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("update_global_shortcuts", { showShortcut, startShortcut, stopShortcut, startAudioShortcut, stopAudioShortcut, profileShortcuts }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async spawnScreenpipe(overrideArgs: string[] | null) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("spawn_screenpipe", { overrideArgs }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async stopScreenpipe() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("stop_screenpipe") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async getMonitors() : Promise<Result<MonitorDevice[], string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("get_monitors") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async getAudioDevices() : Promise<Result<AudioDeviceInfo[], string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("get_audio_devices") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async isEnterpriseBuildCmd() : Promise<boolean> {- return await TAURI_INVOKE("is_enterprise_build_cmd");-},-/**- * Read the enterprise license key from `enterprise.json` next to the executable.- * Admins push this file via Intune/MDM to a protected directory (e.g. Program Files)- * that employees cannot modify. Returns None if the file doesn't exist or is invalid.- */-async getEnterpriseLicenseKey() : Promise<string | null> {- return await TAURI_INVOKE("get_enterprise_license_key");-},-async getDiskUsage(forceRefresh: boolean | null, dataDir: string | null) : Promise<Result<JsonValue, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("get_disk_usage", { forceRefresh, dataDir }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async openPipeWindow(port: number, title: string) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("open_pipe_window", { port, title }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async updateShowScreenpipeShortcut(newShortcut: string, enabled: boolean) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("update_show_screenpipe_shortcut", { newShortcut, enabled }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async showWindow(window: ShowRewindWindow) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("show_window", { window }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Open the screenpi.pe login page.- * On Windows, opens in the system browser (WebView2 has issues with some auth- * providers; the registered deep-link scheme handles the redirect back).- * On macOS/Linux, uses an in-app WebView that intercepts the screenpipe://- * deep-link redirect (Safari blocks custom-scheme redirects).- */-async openLoginWindow() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("open_login_window") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Open Google Calendar OAuth inside an in-app WebView.- * Same pattern as `open_login_window` — intercepts the screenpipe:// deep-link- * redirect so we don't rely on Safari custom-scheme support.- */-async openGoogleCalendarAuthWindow(authUrl: string) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("open_google_calendar_auth_window", { authUrl }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Re-assert the WKWebView as first responder for the current key panel.- * Called from JS on pointer enter / window focus to ensure trackpad pinch- * gestures (magnifyWithEvent:) reach the WKWebView for zoom handling.- */-async ensureWebviewFocus() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("ensure_webview_focus") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async closeWindow(window: ShowRewindWindow) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("close_window", { window }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Resize the Search NSPanel. Regular Tauri setSize doesn't work on NSPanels.- */-async resizeSearchWindow(width: number, height: number) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("resize_search_window", { width, height }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Navigate from Search to a timestamp on the Main timeline.- * Shows Main, emits the navigation event from the app handle (not a webview),- * then closes the Search window.- */-async searchNavigateToTimeline(timestamp: string, frameId: bigint | null, searchTerms: string[] | null, searchResultsJson: string | null, searchQuery: string | null) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("search_navigate_to_timeline", { timestamp, frameId, searchTerms, searchResultsJson, searchQuery }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Hide the Main panel so the next shortcut press reconfigures it for the new mode.- */-async resetMainWindow() : Promise<void> {- await TAURI_INVOKE("reset_main_window");-},-async setWindowSize(window: ShowRewindWindow, width: number, height: number) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("set_window_size", { window, width, height }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async getOnboardingStatus() : Promise<Result<OnboardingStore, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("get_onboarding_status") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async completeOnboarding() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("complete_onboarding") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async resetOnboarding() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("reset_onboarding") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async setOnboardingStep(step: string) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("set_onboarding_step", { step }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async showOnboardingWindow() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("show_onboarding_window") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async openSearchWindow(query: string | null) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("open_search_window", { query }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async showShortcutReminder(shortcut: string) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("show_shortcut_reminder", { shortcut }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async hideShortcutReminder() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("hide_shortcut_reminder") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async showNotificationPanel(payload: string) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("show_notification_panel", { payload }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async hideNotificationPanel() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("hide_notification_panel") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Register window-specific shortcuts (Escape, search shortcut) when main window is visible- * These should only be active when the overlay is open to avoid blocking other apps- */-async registerWindowShortcuts() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("register_window_shortcuts") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Unregister window-specific shortcuts when main window is hidden.- * Only unregisters Escape and arrow keys. Global shortcuts (search, show, chat)- * are NOT touched here — they must persist across window show/hide cycles.- */-async unregisterWindowShortcuts() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("unregister_window_shortcuts") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Copy a frame image to the system clipboard (native API, works in Tauri webview).- * Fetches the frame from the local server and uses arboard for clipboard access.- */-async copyFrameToClipboard(frameId: bigint) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("copy_frame_to_clipboard", { frameId }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Copy a frame deeplink (screenpipe://frame/N) to clipboard. Native API only.- */-async copyDeeplinkToClipboard(frameId: bigint) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("copy_deeplink_to_clipboard", { frameId }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Copy arbitrary text to the system clipboard (native API, works in Tauri webview).- * Use this instead of navigator.clipboard.writeText() which fails after async operations.- */-async copyTextToClipboard(text: string) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("copy_text_to_clipboard", { text }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Install a specific older version from R2. Downloads and installs via Tauri updater,- * then restarts the app.- */-async rollbackToVersion(version: string) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("rollback_to_version", { version }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async setTrayUnhealthIcon() : Promise<void> {- await TAURI_INVOKE("set_tray_unhealth_icon");-},-async setTrayHealthIcon() : Promise<void> {- await TAURI_INVOKE("set_tray_health_icon");-},-async writeBrowserLog(level: string, message: string) : Promise<void> {- await TAURI_INVOKE("write_browser_log", { level, message });-},-async writeBrowserLogs(entries: BrowserLogEntry[]) : Promise<void> {- await TAURI_INVOKE("write_browser_logs", { entries });-},-/**- * Get current sync status.- */-async getSyncStatus() : Promise<Result<SyncStatusResponse, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("get_sync_status") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Enable or disable sync.- */-async setSyncEnabled(enabled: boolean) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("set_sync_enabled", { enabled }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Trigger an immediate sync via the screenpipe server.- */-async triggerSync() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("trigger_sync") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Get sync configuration.- */-async getSyncConfig() : Promise<Result<SyncConfig, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("get_sync_config") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Update sync configuration.- */-async updateSyncConfig(config: SyncConfig) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("update_sync_config", { config }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Get list of registered devices.- */-async getSyncDevices() : Promise<Result<SyncDeviceInfo[], string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("get_sync_devices") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Remove a device from sync.- */-async removeSyncDevice(deviceId: string) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("remove_sync_device", { deviceId }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Delete all locally-stored data that was synced from a specific remote device.- * This calls the local screenpipe server's /data/delete-device endpoint.- * Refuses to delete data for the current device as a safety guard.- */-async deleteDeviceLocalData(machineId: string) : Promise<Result<string, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("delete_device_local_data", { machineId }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Initialize sync with password.- * This initializes both the local SyncManager (for device queries) and- * the server's SyncService (for actual data sync).- */-async initSync(password: string) : Promise<Result<boolean, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("init_sync", { password }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Lock sync (clear keys from memory and stop server sync service).- */-async lockSync() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("lock_sync") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Delete all cloud data.- */-async deleteCloudData() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("delete_cloud_data") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Get Pi info- */-async piInfo(sessionId: string | null) : Promise<Result<PiInfo, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("pi_info", { sessionId }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Start the Pi sidecar in RPC mode (Tauri command wrapper)- */-async piStart(sessionId: string | null, projectDir: string, userToken: string | null, providerConfig: PiProviderConfig | null) : Promise<Result<PiInfo, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("pi_start", { sessionId, projectDir, userToken, providerConfig }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Stop the Pi sidecar- */-async piStop(sessionId: string | null) : Promise<Result<PiInfo, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("pi_stop", { sessionId }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Check if pi is available- */-async piCheck() : Promise<Result<PiCheckResult, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("pi_check") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Install pi via bun- */-async piInstall() : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("pi_install") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Send a prompt to Pi, optionally with images.- * The command is serialized through the queue — it will wait for any prior- * command (new_session, abort) to fully complete before being written to stdin.- */-async piPrompt(sessionId: string | null, message: string, images: PiImageContent[] | null) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("pi_prompt", { sessionId, message, images }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Abort current Pi operation. Priority command — cancels all pending commands- * in the queue and sends abort directly. Waits for the SDK's done event.- */-async piAbort(sessionId: string | null) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("pi_abort", { sessionId }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Start a new Pi session (clears conversation history).- * Serialized through the queue — waits for any in-flight work to complete,- * then sends new_session and waits for the SDK's done event before returning.- */-async piNewSession(sessionId: string | null) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("pi_new_session", { sessionId }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Update Pi config and restart the chat session so the new model takes effect.- * Without restart, Pi keeps using the provider/model from its original CLI args.- */-async piUpdateConfig(userToken: string | null, providerConfig: PiProviderConfig | null) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("pi_update_config", { userToken, providerConfig }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async chatgptOauthLogin() : Promise<Result<boolean, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("chatgpt_oauth_login") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async chatgptOauthStatus() : Promise<Result<ChatGptOAuthStatus, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("chatgpt_oauth_status") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Return the current valid access token (auto-refreshing if needed).- * Used by the frontend to call OpenAI APIs directly (e.g. /v1/models).- */-async chatgptOauthGetToken() : Promise<Result<string, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("chatgpt_oauth_get_token") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async chatgptOauthLogout() : Promise<Result<boolean, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("chatgpt_oauth_logout") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Fetch available models from OpenAI using the stored OAuth token.- */-async chatgptOauthModels() : Promise<Result<string[], string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("chatgpt_oauth_models") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Get current pipe suggestions settings.- */-async pipeSuggestionsGetSettings() : Promise<Result<PipeSuggestionsSettings, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("pipe_suggestions_get_settings") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Update pipe suggestions settings and restart the scheduler.- */-async pipeSuggestionsUpdateSettings(enabled: boolean, frequencyHours: number) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("pipe_suggestions_update_settings", { enabled, frequencyHours }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Check Calendar authorization status (no popup).- */-async calendarStatus() : Promise<Result<CalendarStatus, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("calendar_status") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Request Calendar permission (shows one-time macOS popup).- * Returns "granted", "denied", or an error message.- */-async calendarAuthorize() : Promise<Result<string, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("calendar_authorize") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Get calendar events in a time window.- */-async calendarGetEvents(hoursBack: bigint | null, hoursAhead: bigint | null) : Promise<Result<CalendarEventItem[], string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("calendar_get_events", { hoursBack, hoursAhead }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Get events happening right now.- */-async calendarGetCurrentMeeting() : Promise<Result<CalendarEventItem[], string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("calendar_get_current_meeting") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async icsCalendarGetEntries() : Promise<Result<IcsCalendarEntry[], string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("ics_calendar_get_entries") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async icsCalendarSaveEntries(entries: IcsCalendarEntry[]) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("ics_calendar_save_entries", { entries }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async icsCalendarTestUrl(url: string) : Promise<Result<number, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("ics_calendar_test_url", { url }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async icsCalendarGetUpcoming() : Promise<Result<CalendarEventItem[], string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("ics_calendar_get_upcoming") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Tauri command: start voice training. Spawns a background task that polls- * until audio is transcribed, then assigns the speaker. Returns immediately.- */-async trainVoice(name: string, startTime: string, endTime: string) : Promise<Result<string, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("train_voice", { name, startTime, endTime }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Return cached suggestions or default idle suggestions if cache is empty.- */-async getCachedSuggestions() : Promise<Result<CachedSuggestions, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("get_cached_suggestions") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Force-regenerate suggestions immediately, bypassing the scheduler's- * CPU/power guards. Returns the fresh suggestions and updates the cache.- */-async forceRegenerateSuggestions() : Promise<Result<CachedSuggestions, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("force_regenerate_suggestions") };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-/**- * Tauri command: validate that a path is usable as a data directory.- * Called from the frontend before saving the setting.- */-async validateDataDir(path: string) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("validate_data_dir", { path }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},-async getHardwareCapability() : Promise<HardwareCapability> {- return await TAURI_INVOKE("get_hardware_capability");-}-}--/** user-defined events **/----/** user-defined constants **/----/** user-defined types **/--export type AIPreset = { id: string; prompt: string; provider: AIProviderType; url?: string; model?: string; defaultPreset: boolean; apiKey: string | null; maxContextChars: number; maxTokens?: number }-export type AIProviderType = "openai" | "openai-chatgpt" | "native-ollama" | "custom" | "screenpipe-cloud" | "pi" | "anthropic"-export type AudioDeviceInfo = { name: string; isDefault: boolean }-export type BrowserLogEntry = { level: string; message: string }-export type CachedSuggestions = { suggestions: Suggestion[]; generatedAt: string; mode: string; aiGenerated: boolean; tags: string[] }-export type CalendarEventItem = { id: string; title: string;-/**- * RFC3339 in UTC — for meeting detection / comparisons.- */-start: string;-/**- * RFC3339 in UTC — for meeting detection / comparisons.- */-end: string;-/**- * Pre-formatted local time, e.g. "3:30 PM" — for display.- */-startDisplay: string;-/**- * Pre-formatted local time, e.g. "5:00 PM" — for display.- */-endDisplay: string; attendees: string[]; location: string | null; calendarName: string; isAllDay: boolean;-/**- * Source identifier: "native" for OS calendar, "ics" for ICS feeds.- * Used by meeting detector to merge events from multiple publishers.- */-source?: string }-export type CalendarStatus = { available: boolean; authorized: boolean; authorizationStatus: string; calendarCount: number }-export type ChatGptOAuthStatus = { logged_in: boolean }-export type Credits = { amount: number }-export type EmbeddedLLM = { enabled: boolean; model: string; port: number }-export type HardwareCapability = { hasGpu: boolean; cpuCores: bigint; totalMemoryGb: number; isWeakForLargeModel: boolean; recommendedEngine: string; reason: string }-export type IcsCalendarEntry = { name: string; url: string; enabled: boolean }-export type JsonValue = null | boolean | number | string | JsonValue[] | { [key in string]: JsonValue }-export type LogFile = { name: string; path: string; modified_at: bigint }-export type MonitorDevice = { id: number; stableId: string; name: string; isDefault: boolean; width: number; height: number }-export type OSPermission = "screenRecording" | "microphone" | "accessibility" | "automation"-export type OSPermissionStatus = "notNeeded" | "empty" | "granted" | "denied"-export type OSPermissionsCheck = { screenRecording: OSPermissionStatus; microphone: OSPermissionStatus; accessibility: OSPermissionStatus }-export type OnboardingStore = { isCompleted: boolean; completedAt: string | null;-/**- * Current step in onboarding flow (login, intro, usecases, status)- * Used to resume after app restart (e.g., after granting permissions)- */-currentStep?: string | null }-export type PiCheckResult = { available: boolean; path: string | null }-/**- * Image content for Pi RPC protocol (pi-ai ImageContent format)- */-export type PiImageContent = { type: string; mimeType: string; data: string }-export type PiInfo = { running: boolean; projectDir: string | null; pid: number | null; sessionId: string | null }-/**- * Configuration for which AI provider Pi should use- */-export type PiProviderConfig = {-/**- * Provider type: "openai", "native-ollama", "custom", "screenpipe-cloud"- */-provider: string;-/**- * Base URL for the provider API- */-url: string;-/**- * Model ID to use- */-model: string;-/**- * Optional API key for the provider- */-apiKey: string | null;-/**- * Max output tokens (default 4096)- */-maxTokens?: number;-/**- * Optional system prompt from AI preset (appended to Pi's built-in system prompt)- */-systemPrompt?: string | null }-export type PipeSuggestionsSettings = { enabled: boolean; frequencyHours: number }-export type SettingsStore =-/**- * All recording/capture config lives here. Flattened so the JSON shape- * is unchanged — `disableAudio`, `port`, `fps`, etc. stay at the top level.- */-({-/**- * Disable all audio capture and transcription.- */-disableAudio: boolean;-/**- * Audio transcription engine identifier.- * Values: "whisper-large-v3-turbo", "whisper-large-v3-turbo-quantized",- * "deepgram", "screenpipe-cloud", etc.- */-audioTranscriptionEngine: string;-/**- * Transcription mode: "realtime" or "batch".- * Previously stored in SettingsStore.extra["transcriptionMode"].- */-transcriptionMode: string;-/**- * Audio device names/IDs to capture from.- */-audioDevices: string[];-/**- * Automatically follow the system default audio devices.- */-useSystemDefaultAudio: boolean;-/**- * Duration of each audio chunk in seconds before transcription.- * Stored as i32 to match existing store.bin schema (cast to u64 by engine).- */-audioChunkDuration: number;-/**- * Deepgram API key for cloud transcription.- * Empty string or "default" means not configured.- * Kept as String (not Option) to match existing store.bin schema.- */-deepgramApiKey: string;-/**- * VAD sensitivity level: "low", "medium", "high".- */-vadSensitivity: string;-/**- * Filter music-dominant audio before transcription using spectral analysis.- */-filterMusic: boolean;-/**- * Maximum batch duration in seconds for batch transcription.- * None = use engine-aware defaults (Deepgram=3600s, Whisper/OpenAI=600s).- * Previously stored in SettingsStore.extra["batchMaxDurationSecs"].- */-batchMaxDurationSecs?: bigint | null;-/**- * Custom vocabulary for transcription biasing and word replacement.- * Previously stored in SettingsStore.extra["vocabularyWords"].- */-vocabularyWords?: VocabEntry[];-/**- * Disable all screen capture.- */-disableVision: boolean;-/**- * Specific monitor IDs to capture.- */-monitorIds: string[];-/**- * Capture from all connected monitors.- */-useAllMonitors: boolean;-/**- * Target frames per second for screen capture.- */-fps: number;-/**- * Dynamically adjust FPS based on screen content changes.- */-adaptiveFps: boolean;-/**- * Video quality preset: "low", "balanced", "high", "max".- */-videoQuality: string;-/**- * Window titles to exclude from capture.- */-ignoredWindows: string[];-/**- * Window titles to exclusively capture (empty = capture all).- */-includedWindows: string[];-/**- * URLs to exclude from capture.- */-ignoredUrls?: string[];-/**- * Automatically detect and skip incognito / private browsing windows.- */-ignoreIncognitoWindows: boolean;-/**- * Languages for transcription (ISO 639-1 codes).- */-languages: string[];-/**- * Redact personally identifiable information from transcriptions.- */-usePiiRemoval: boolean;-/**- * Screenpipe cloud user ID. Empty string means not logged in.- * Kept as String (not Option) to match existing store.bin schema.- */-userId: string;-/**- * Display name for speaker identification.- * Fallback chain: this field → cloud auth name → cloud auth email.- * Previously stored in SettingsStore.extra["userName"].- */-userName?: string | null;-/**- * OpenAI-compatible transcription endpoint URL.- * Previously stored in SettingsStore.extra["openaiCompatibleEndpoint"].- */-openaiCompatibleEndpoint?: string | null;-/**- * OpenAI-compatible transcription API key.- * Previously stored in SettingsStore.extra["openaiCompatibleApiKey"].- */-openaiCompatibleApiKey?: string | null;-/**- * OpenAI-compatible transcription model name.- * Previously stored in SettingsStore.extra["openaiCompatibleModel"].- */-openaiCompatibleModel?: string | null;-/**- * HTTP server port for the screenpipe API.- */-port: number;-/**- * Power mode preference: "auto", "performance", "battery_saver".- * Previously stored in SettingsStore.extra["powerMode"].- */-powerMode?: string | null;-/**- * Use Chinese mirror for Hugging Face model downloads.- */-useChineseMirror: boolean;-/**- * Enable anonymous analytics (PostHog).- */-analyticsEnabled: boolean;-/**- * Persistent analytics ID (UUID, stable across sessions).- */-analyticsId: string;-/**- * Enable input event capture (keyboard, mouse, clipboard).- */-enableInputCapture: boolean;-/**- * Enable accessibility text capture (AX tree walker).- */-enableAccessibility: boolean }) &-/**- * 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.- */-({ [key in string]: null | boolean | number | string | JsonValue[] | { [key in string]: JsonValue } }) & { aiPresets: AIPreset[]; isLoading: boolean; devMode: boolean; ocrEngine: string; dataDir: string; embeddedLLM: EmbeddedLLM; autoStartEnabled: boolean; platform: string; disabledShortcuts: string[]; user: User; showScreenpipeShortcut: string; startRecordingShortcut: string; stopRecordingShortcut: string; startAudioShortcut: string; stopAudioShortcut: string; showChatShortcut: string; searchShortcut: string; lockVaultShortcut?: string; realtimeAudioTranscriptionEngine: string;-/**- * When true, screen capture continues but OCR text extraction is skipped.- * Reduces CPU usage significantly while still recording video.- */-disableOcr?: boolean; showShortcutOverlay?: boolean;-/**- * Unique device ID for AI usage tracking (generated on first launch)- */-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;-/**- * Timeline overlay mode: "fullscreen" (floating panel above everything) or- * "window" (normal resizable window with title bar).- */-overlayMode?: string;-/**- * Allow screen recording apps to capture the overlay.- * Disabled by default so the overlay doesn't appear in screenpipe's own recordings.- */-showOverlayInScreenRecording?: boolean;-/**- * When true, the chat window stays above all other windows (default: true).- */-chatAlwaysOnTop?: boolean;-/**- * Show restart notifications when audio/vision capture stalls.- * Disabled by default for now until the stall detector is more reliable.- */-showRestartNotifications?: boolean }-export type ShowRewindWindow = "Main" | { Home: { page: string | null } } | { Search: { query: string | null } } | "Onboarding" | "Chat" | "PermissionRecovery"-export type Suggestion = { text: string }-/**- * Sync configuration.- */-export type SyncConfig = { enabled: boolean; syncIntervalMinutes: number; syncTranscripts: boolean; syncOcr: boolean; syncAudio: boolean; syncFrames: boolean }-/**- * Device information.- */-export type SyncDeviceInfo = { id: string; deviceId: string; deviceName: string | null; deviceOs: string; lastSyncAt: string | null; createdAt: string; isCurrent: boolean }-/**- * Sync status response.- */-export type SyncStatusResponse = { enabled: boolean; isSyncing: boolean; lastSync: string | null; lastError: string | null; storageUsed: bigint | null; storageLimit: bigint | null; deviceCount: number | null; deviceLimit: number | null; syncTier: string | null; machineId: string }-export type User = { id: string | null; name: string | null; email: string | null; image: string | null; token: string | null; clerk_id: string | null; api_key: string | null; credits: Credits | null; stripe_connected: boolean | null; stripe_account_status: string | null; github_username: string | null; bio: string | null; website: string | null; contact: string | null; cloud_subscribed: boolean | null; credits_balance: number | null }-/**- * Custom vocabulary entry for transcription biasing and word replacement.- */-export type VocabEntry = {-/**- * The word or phrase to bias toward during transcription.- */-word: string;-/**- * Optional replacement — if set, the transcribed `word` is replaced with this.- */-replace_with?: string | null }--/** tauri-specta globals **/--import {- invoke as TAURI_INVOKE,- Channel as TAURI_CHANNEL,-} from "@tauri-apps/api/core";-import * as TAURI_API_EVENT from "@tauri-apps/api/event";-import { type WebviewWindow as __WebviewWindow__ } from "@tauri-apps/api/webviewWindow";--type __EventObj__<T> = {- listen: (- cb: TAURI_API_EVENT.EventCallback<T>,- ) => ReturnType<typeof TAURI_API_EVENT.listen<T>>;- once: (- cb: TAURI_API_EVENT.EventCallback<T>,- ) => ReturnType<typeof TAURI_API_EVENT.once<T>>;- emit: null extends T- ? (payload?: T) => ReturnType<typeof TAURI_API_EVENT.emit>- : (payload: T) => ReturnType<typeof TAURI_API_EVENT.emit>;-};--export type Result<T, E> =- | { status: "ok"; data: T }- | { status: "error"; error: E };--function __makeEvents__<T extends Record<string, any>>(- mappings: Record<keyof T, string>,-) {- return new Proxy(- {} as unknown as {- [K in keyof T]: __EventObj__<T[K]> & {- (handle: __WebviewWindow__): __EventObj__<T[K]>;- };- },- {- get: (_, event) => {- const name = mappings[event as keyof T];-- return new Proxy((() => {}) as any, {- apply: (_, __, [window]: [__WebviewWindow__]) => ({- listen: (arg: any) => window.listen(name, arg),- once: (arg: any) => window.once(name, arg),- emit: (arg: any) => window.emit(name, arg),- }),- get: (_, command: keyof __EventObj__<any>) => {- switch (command) {- case "listen":- return (arg: any) => TAURI_API_EVENT.listen(name, arg);- case "once":- return (arg: any) => TAURI_API_EVENT.once(name, arg);- case "emit":- return (arg: any) => TAURI_API_EVENT.emit(name, arg);- }- },- });- },- },- );-}diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rsindex 58f593013..e67e53c50 100755--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs@@ -647,7 +647,7 @@ async fn main() {// Export to a temp file first, then only overwrite if content changed.// This avoids triggering the Tauri dev watcher on every launch which// causes an infinite rebuild loop.- let bindings_path = "lib/utils/tauri.ts";+ let bindings_path = "../lib/utils/tauri.ts";let tmp_path = format!("{}.tmp", bindings_path);if let Err(e) = builder.export(Typescript::default().bigint(specta_typescript::BigIntExportBehavior::BigInt),