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

fix(ui): improve audio indicator visibility in timeline

Louis Beaumont1d881cd5b2d3
diff --git a/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx b/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx
index fe63e4f8d..8c0eba4bf 100644
--- a/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx
+++ b/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx
@@ -522,9 +522,9 @@ export const TimelineSlider = ({
}}
onMouseLeave={() => setHoveredTimestamp(null)}
>
- {/* Audio indicator - subtle dot at top of bar */}
+ {/* Audio indicator - visible line at top of bar */}
{hasAudio && (
- <div className="absolute top-0.5 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-foreground/60" />
+ <div className="absolute top-0 left-0 right-0 h-1 bg-foreground/80 rounded-t" />
)}
{/* Time marker below frame */}
@@ -580,7 +580,9 @@ export const TimelineSlider = ({
<span>current</span>
</span>
<span className="flex items-center gap-1">
- <Mic className="w-3 h-3 text-muted-foreground" />
+ <div className="w-3 h-3 rounded bg-muted-foreground/50 relative">
+ <div className="absolute top-0 left-0 right-0 h-0.5 bg-foreground rounded-t" />
+ </div>
<span>has audio</span>
</span>
<span className="opacity-60">scroll to navigate • pinch to zoom</span>
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index e7b705e1f..58fa327df 100644
--- a/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.0.118"
+version = "2.0.119"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/screenpipe-js/ai-proxy/.dev.vars.example b/screenpipe-js/ai-proxy/.dev.vars.example
index c037609a7..76396f7ab 100644
--- a/screenpipe-js/ai-proxy/.dev.vars.example
+++ b/screenpipe-js/ai-proxy/.dev.vars.example
@@ -1,6 +1,9 @@
# Copy this file to .dev.vars and fill in your values
# These are used for local development with `wrangler dev`
+# Sentry error tracking (get DSN from sentry.io > Project Settings > Client Keys)
+SENTRY_DSN=https://[email protected]/xxx
+
# Existing API keys
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
diff --git a/screenpipe-js/ai-proxy/src/index.ts b/screenpipe-js/ai-proxy/src/index.ts
index 9f2a025eb..bdf3a2582 100644
--- a/screenpipe-js/ai-proxy/src/index.ts
+++ b/screenpipe-js/ai-proxy/src/index.ts
@@ -1,4 +1,4 @@
-// import * as Sentry from '@sentry/cloudflare';
+import { captureException, wrapRequestHandler } from '@sentry/cloudflare';
import { Env, RequestBody, AuthResult } from './types';
import { handleOptions, createSuccessResponse, createErrorResponse, addCorsHeaders } from './utils/cors';
import { validateAuth } from './utils/auth';
@@ -14,128 +14,144 @@ import { handleVertexProxy, handleVertexModels } from './handlers/vertex-proxy';
export { RateLimiter };
-// Temporarily disabled Sentry to debug production issues
-export default {
- async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
- const url = new URL(request.url);
- const path = url.pathname;
+// Handler function for the worker
+async function handleRequest(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
+ const url = new URL(request.url);
+ const path = url.pathname;
- // Early test endpoint - before any initialization
- if (path === '/test') {
- return new Response('ai proxy is working!', { status: 200 });
+ // Early test endpoint - before any initialization
+ if (path === '/test') {
+ return new Response('ai proxy is working!', { status: 200 });
+ }
+
+ const langfuse = setupAnalytics(env);
+
+ try {
+ if (request.method === 'OPTIONS') {
+ return handleOptions(request);
+ }
+
+ console.log('path', path);
+
+ // Handle WebSocket upgrade for real-time transcription (no auth required)
+ const upgradeHeader = request.headers.get('upgrade')?.toLowerCase();
+ if (path === '/v1/listen' && upgradeHeader === 'websocket') {
+ console.log('websocket request to /v1/listen detected, bypassing auth');
+ return await handleWebSocketUpgrade(request, env);
+ }
+
+ // Authenticate and get tier info for all other endpoints
+ const authResult = await validateAuth(request, env);
+ console.log('auth result:', { tier: authResult.tier, deviceId: authResult.deviceId });
+
+ // Check rate limit with tier info
+ const rateLimit = await checkRateLimit(request, env, authResult);
+ if (!rateLimit.allowed && rateLimit.response) {
+ return rateLimit.response;
+ }
+
+ // Usage status endpoint - returns current usage without incrementing
+ if (path === '/v1/usage' && request.method === 'GET') {
+ const status = await getUsageStatus(env, authResult.deviceId, authResult.tier);
+ return addCorsHeaders(createSuccessResponse(status));
+ }
+
+ // Chat completions - main AI endpoint
+ if (path === '/v1/chat/completions' && request.method === 'POST') {
+ const body = (await request.json()) as RequestBody;
+
+ // Check if model is allowed for this tier
+ if (!isModelAllowed(body.model, authResult.tier)) {
+ const allowedModels = TIER_CONFIG[authResult.tier].allowedModels;
+ return addCorsHeaders(createErrorResponse(403, JSON.stringify({
+ error: 'model_not_allowed',
+ message: `Model "${body.model}" is not available for your tier (${authResult.tier}). Available models: ${allowedModels.join(', ')}`,
+ tier: authResult.tier,
+ allowed_models: allowedModels,
+ })));
}
- const langfuse = setupAnalytics(env);
-
- try {
- if (request.method === 'OPTIONS') {
- return handleOptions(request);
- }
-
- console.log('path', path);
-
- // Handle WebSocket upgrade for real-time transcription (no auth required)
- const upgradeHeader = request.headers.get('upgrade')?.toLowerCase();
- if (path === '/v1/listen' && upgradeHeader === 'websocket') {
- console.log('websocket request to /v1/listen detected, bypassing auth');
- return await handleWebSocketUpgrade(request, env);
- }
-
- // Authenticate and get tier info for all other endpoints
- const authResult = await validateAuth(request, env);
- console.log('auth result:', { tier: authResult.tier, deviceId: authResult.deviceId });
-
- // Check rate limit with tier info
- const rateLimit = await checkRateLimit(request, env, authResult);
- if (!rateLimit.allowed && rateLimit.response) {
- return rateLimit.response;
- }
-
- // Usage status endpoint - returns current usage without incrementing
- if (path === '/v1/usage' && request.method === 'GET') {
- const status = await getUsageStatus(env, authResult.deviceId, authResult.tier);
- return addCorsHeaders(createSuccessResponse(status));
- }
-
- // Chat completions - main AI endpoint
- if (path === '/v1/chat/completions' && request.method === 'POST') {
- const body = (await request.json()) as RequestBody;
-
- // Check if model is allowed for this tier
- if (!isModelAllowed(body.model, authResult.tier)) {
- const allowedModels = TIER_CONFIG[authResult.tier].allowedModels;
- return addCorsHeaders(createErrorResponse(403, JSON.stringify({
- error: 'model_not_allowed',
- message: `Model "${body.model}" is not available for your tier (${authResult.tier}). Available models: ${allowedModels.join(', ')}`,
- tier: authResult.tier,
- allowed_models: allowedModels,
- })));
- }
-
- // Track usage and check daily limit (includes IP-based abuse prevention)
- const ipAddress = request.headers.get('cf-connecting-ip') || undefined;
- const usage = await trackUsage(env, authResult.deviceId, authResult.tier, authResult.userId, ipAddress);
- if (!usage.allowed) {
- return addCorsHeaders(createErrorResponse(429, JSON.stringify({
- error: 'daily_limit_exceeded',
- message: `You've used all ${usage.limit} free AI queries for today. Resets at ${usage.resetsAt}`,
- used_today: usage.used,
- limit_today: usage.limit,
- resets_at: usage.resetsAt,
- tier: authResult.tier,
- upgrade_options: authResult.tier === 'anonymous'
- ? { login: { benefit: '+25 daily queries, more models' }, subscribe: { benefit: 'Unlimited queries, all models' } }
- : { subscribe: { benefit: 'Unlimited queries, all models' } },
- })));
- }
-
- return await handleChatCompletions(body, env, langfuse);
- }
-
- if (path === '/v1/listen' && request.method === 'POST') {
- return await handleFileTranscription(request, env);
- }
-
- if (path === '/v1/models' && request.method === 'GET') {
- // Return tier-filtered models for non-subscribed users
- return await handleModelListing(env, authResult.tier);
- }
-
- if (path === '/v1/voice/transcribe' && request.method === 'POST') {
- return await handleVoiceTranscription(request, env);
- }
-
- if (path === '/v1/voice/query' && request.method === 'POST') {
- return await handleVoiceQuery(request, env, langfuse);
- }
-
- if (path === '/v1/text-to-speech' && request.method === 'POST') {
- return await handleTextToSpeech(request, env, langfuse);
- }
-
- if (path === '/v1/voice/chat' && request.method === 'POST') {
- return await handleVoiceChat(request, env, langfuse);
- }
-
- // //TODO:
- // if (path === '/v1/tts-ws' && upgradeHeader === 'websocket') {
- // return await handleTTSWebSocketUpgrade(request, env);
- // }
-
- // Vertex AI proxy for Agent SDK
- // The Agent SDK sends requests to ANTHROPIC_VERTEX_BASE_URL/v1/messages
- if (path === '/v1/messages' && request.method === 'POST') {
- console.log('Vertex AI proxy request to /v1/messages');
- return await handleVertexProxy(request, env);
- }
-
- return createErrorResponse(404, 'not found');
- } catch (error: any) {
- console.error('error in fetch:', error?.message, error?.stack);
- return createErrorResponse(500, error?.message || 'an error occurred');
- } finally {
- await langfuse.shutdownAsync();
+ // Track usage and check daily limit (includes IP-based abuse prevention)
+ const ipAddress = request.headers.get('cf-connecting-ip') || undefined;
+ const usage = await trackUsage(env, authResult.deviceId, authResult.tier, authResult.userId, ipAddress);
+ if (!usage.allowed) {
+ return addCorsHeaders(createErrorResponse(429, JSON.stringify({
+ error: 'daily_limit_exceeded',
+ message: `You've used all ${usage.limit} free AI queries for today. Resets at ${usage.resetsAt}`,
+ used_today: usage.used,
+ limit_today: usage.limit,
+ resets_at: usage.resetsAt,
+ tier: authResult.tier,
+ upgrade_options: authResult.tier === 'anonymous'
+ ? { login: { benefit: '+25 daily queries, more models' }, subscribe: { benefit: 'Unlimited queries, all models' } }
+ : { subscribe: { benefit: 'Unlimited queries, all models' } },
+ })));
}
+
+ return await handleChatCompletions(body, env, langfuse);
+ }
+
+ if (path === '/v1/listen' && request.method === 'POST') {
+ return await handleFileTranscription(request, env);
+ }
+
+ if (path === '/v1/models' && request.method === 'GET') {
+ // Return tier-filtered models for non-subscribed users
+ return await handleModelListing(env, authResult.tier);
+ }
+
+ if (path === '/v1/voice/transcribe' && request.method === 'POST') {
+ return await handleVoiceTranscription(request, env);
+ }
+
+ if (path === '/v1/voice/query' && request.method === 'POST') {
+ return await handleVoiceQuery(request, env, langfuse);
+ }
+
+ if (path === '/v1/text-to-speech' && request.method === 'POST') {
+ return await handleTextToSpeech(request, env, langfuse);
+ }
+
+ if (path === '/v1/voice/chat' && request.method === 'POST') {
+ return await handleVoiceChat(request, env, langfuse);
+ }
+
+ // //TODO:
+ // if (path === '/v1/tts-ws' && upgradeHeader === 'websocket') {
+ // return await handleTTSWebSocketUpgrade(request, env);
+ // }
+
+ // Vertex AI proxy for Agent SDK
+ // The Agent SDK sends requests to ANTHROPIC_VERTEX_BASE_URL/v1/messages
+ if (path === '/v1/messages' && request.method === 'POST') {
+ console.log('Vertex AI proxy request to /v1/messages');
+ return await handleVertexProxy(request, env);
+ }
+
+ return createErrorResponse(404, 'not found');
+ } catch (error: any) {
+ console.error('error in fetch:', error?.message, error?.stack);
+ captureException(error);
+ return createErrorResponse(500, error?.message || 'an error occurred');
+ } finally {
+ await langfuse.shutdownAsync();
+ }
+}
+
+// Wrap with Sentry for error tracking
+export default {
+ async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
+ return wrapRequestHandler(
+ {
+ options: {
+ dsn: env.SENTRY_DSN,
+ tracesSampleRate: 0.1,
+ },
+ request: request as any,
+ context: ctx,
+ },
+ () => handleRequest(request, env, ctx)
+ );
},
} satisfies ExportedHandler<Env>;
diff --git a/screenpipe-js/ai-proxy/src/types.ts b/screenpipe-js/ai-proxy/src/types.ts
index 53a7f09dd..3523dca6f 100644
--- a/screenpipe-js/ai-proxy/src/types.ts
+++ b/screenpipe-js/ai-proxy/src/types.ts
@@ -130,6 +130,8 @@ export interface Env {
VERTEX_REGION: string;
// D1 database for usage tracking
DB: D1Database;
+ // Sentry error tracking
+ SENTRY_DSN: string;
}
// User tier for rate limiting and model access