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: track Apple Intelligence usage in PostHog
Louis Beaumont1b69e82111f7
diff --git a/apps/screenpipe-app-tauri/components/rewind/daily-summary.tsx b/apps/screenpipe-app-tauri/components/rewind/daily-summary.tsxindex 3280d8d89..c524f03f2 100644--- a/apps/screenpipe-app-tauri/components/rewind/daily-summary.tsx+++ b/apps/screenpipe-app-tauri/components/rewind/daily-summary.tsx@@ -18,6 +18,7 @@ import {} from "@/components/ui/tooltip";import { platform } from "@tauri-apps/plugin-os";import { Command } from "@tauri-apps/plugin-shell";+import posthog from "posthog-js";const API = "http://localhost:3030";@@ -279,6 +280,11 @@ export function DailySummaryCard({saveSummary(newSummary);setSummary(newSummary);setIsExpanded(true);+ posthog.capture("apple_intelligence_summary_generated", {+ key_moments: newSummary.keyMoments.length,+ action_items: newSummary.actionItems.length,+ people_mentioned: newSummary.peopleMentioned.length,+ });} catch (e) {setError(e instanceof Error ? e.message : "Failed to generate summary");} finally {diff --git a/apps/screenpipe-app-tauri/components/settings/apple-intelligence-card.tsx b/apps/screenpipe-app-tauri/components/settings/apple-intelligence-card.tsxindex 2c28dea17..4657ff2a3 100644--- a/apps/screenpipe-app-tauri/components/settings/apple-intelligence-card.tsx+++ b/apps/screenpipe-app-tauri/components/settings/apple-intelligence-card.tsx@@ -6,6 +6,7 @@ import { Switch } from "@/components/ui/switch";import { Label } from "@/components/ui/label";import { AlertCircle } from "lucide-react";import { platform } from "@tauri-apps/plugin-os";+import posthog from "posthog-js";const API = "http://localhost:3030";@@ -34,8 +35,11 @@ export function AppleIntelligenceCard() {try {localStorage?.setItem("apple-intelligence-enabled", String(val));} catch {}+ posthog.capture(val ? "apple_intelligence_enabled" : "apple_intelligence_disabled");};+ const statusCapturedRef = React.useRef(false);+// Check AI availabilityconst checkStatus = useCallback(async () => {try {@@ -44,14 +48,22 @@ export function AppleIntelligenceCard() {});if (resp.ok) {const data = await resp.json();- setAiStatus(data.available ? "available" : "unavailable");+ const available = data.available ? "available" : "unavailable";+ setAiStatus(available as any);+ if (!statusCapturedRef.current) {+ statusCapturedRef.current = true;+ posthog.capture("apple_intelligence_status", {+ available: data.available,+ enabled,+ });+ }} else {setAiStatus("unavailable");}} catch {setAiStatus("unavailable");}- }, []);+ }, [enabled]);useEffect(() => {checkStatus();