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
feat(presets): seed pro vs non-pro defaults the first time we know the user
Louis Beaumont87fe0832c666
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsxindex 9f8cb350b..bb5ff8d9c 100644--- a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx+++ b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx@@ -323,26 +323,45 @@ const DEFAULT_IGNORED_WINDOWS_PER_OS: Record<string, string[]> = {const CHAT_PRESET_ID = "chat";const PIPES_PRESET_ID = "pipes";+// Pro users get the chat / pipes pair (opus for interactive chat, auto for+// pipe runs that pick the cheapest model that fits the task).+// Non-pro users get a single "screenpipe" preset on auto — auto handles+// model routing without needing the user to know what to pick.+const SCREENPIPE_PRESET_ID = "screenpipe";+export function makeDefaultPresets(isPro: boolean): AIPreset[] {+ if (isPro) {+ return [+ {+ id: CHAT_PRESET_ID,+ provider: "screenpipe-cloud",+ url: "",+ model: "claude-opus-4-7",+ maxContextChars: 200000,+ defaultPreset: true,+ prompt: "",+ },+ {+ id: PIPES_PRESET_ID,+ provider: "screenpipe-cloud",+ url: "",+ model: "auto",+ maxContextChars: 200000,+ defaultPreset: false,+ prompt: "",+ },+ ];+ }return [{- id: CHAT_PRESET_ID,+ id: SCREENPIPE_PRESET_ID,provider: "screenpipe-cloud",url: "",- model: isPro ? "claude-opus-4-7" : "claude-sonnet-4-5",+ model: "auto",maxContextChars: 200000,defaultPreset: true,prompt: "",},- {- id: PIPES_PRESET_ID,- provider: "screenpipe-cloud",- url: "",- model: "claude-haiku-4-5",- maxContextChars: 200000,- defaultPreset: false,- prompt: "",- },];}@@ -539,6 +558,25 @@ function createSettingsStore() {needsUpdate = true;}+ // b2 seed: the first time we see a logged-in user, replace the anonymous+ // "screenpipe" placeholder with the pro pair (chat + pipes) IF they're pro.+ // Anonymous users keep the placeholder forever (which is correct — non-pro+ // stays on the single "screenpipe" auto preset). Existing users with their+ // own presets are untouched. Runs exactly once per install.+ if (!(settings as any)._presetsSeededForUser && settings.user?.token) {+ const isPro = settings.user?.cloud_subscribed === true;+ const presets = settings.aiPresets ?? [];+ const isAnonymousPlaceholder =+ presets.length === 1 &&+ (presets[0] as any)?.id === SCREENPIPE_PRESET_ID &&+ (presets[0] as any)?.provider === "screenpipe-cloud";+ if (isPro && isAnonymousPlaceholder) {+ settings.aiPresets = makeDefaultPresets(true) as any;+ }+ (settings as any)._presetsSeededForUser = true;+ needsUpdate = true;+ }+// Migration: Rename "pi" provider to "screenpipe-cloud" for clarityif (settings.aiPresets?.some((p: any) => p.provider === "pi")) {settings.aiPresets = settings.aiPresets.map((p: any) =>