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

docs: update release skill with changelog generation and no-auto-publish behavior

Louis Beaumont2e16d45c252d
diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.md
index b3596f29f..8bd3cc744 100644
--- a/.claude/skills/release/SKILL.md
+++ b/.claude/skills/release/SKILL.md
@@ -19,88 +19,81 @@ Automate releasing all components of the screenpipe monorepo.
| JS Node SDK | `screenpipe-js/node-sdk/package.json` | `"version": "X.Y.Z"` | npm publish |
| JS CLI | `screenpipe-js/cli/package.json` | `"version": "X.Y.Z"` | npm publish |
-## Release Commands
+## Release Workflow
### 1. Check Current Versions
```bash
echo "=== App ===" && grep '^version' screenpipe-app-tauri/src-tauri/Cargo.toml | head -1
echo "=== CLI ===" && grep '^version' Cargo.toml | head -1
-echo "=== MCP ===" && grep '"version"' screenpipe-integrations/screenpipe-mcp/package.json
-echo "=== JS Browser ===" && grep '"version"' screenpipe-js/browser-sdk/package.json
-echo "=== JS Node ===" && grep '"version"' screenpipe-js/node-sdk/package.json
-echo "=== JS CLI ===" && grep '"version"' screenpipe-js/cli/package.json
+echo "=== MCP ===" && grep '"version"' screenpipe-integrations/screenpipe-mcp/package.json | head -1
+echo "=== JS Browser ===" && grep '"version"' screenpipe-js/browser-sdk/package.json | head -1
+echo "=== JS Node ===" && grep '"version"' screenpipe-js/node-sdk/package.json | head -1
+echo "=== JS CLI ===" && grep '"version"' screenpipe-js/cli/package.json | head -1
```
-### 2. Bump Versions (edit files)
-Use Edit tool to update version strings in the files listed above.
+### 2. Bump Version
+Use Edit tool to update version in the appropriate file.
### 3. Commit & Push
```bash
-git add -A
-git commit -m "Bump versions: App vX.Y.Z, CLI v0.2.X, MCP vX.Y.Z"
-git pull --rebase
-git push
+git add -A && git commit -m "Bump app to vX.Y.Z" && git pull --rebase && git push
```
-### 4. Trigger Releases
-
-**Desktop App (macOS + Windows):**
+### 4. Trigger Release (Draft Only)
```bash
gh workflow run release-app.yml
```
-**CLI (all platforms):**
-```bash
-gh workflow run release-cli.yml
-```
-
-**MCP:**
-```bash
-gh workflow run release-mcp.yml
-```
+**Important**: `workflow_dispatch` creates a **draft only** - does NOT auto-publish. This allows manual testing before publishing.
### 5. Monitor Build Status
```bash
-# List recent runs
-gh run list --limit 5
+# Get latest run ID
+gh run list --workflow=release-app.yml --limit=1
-# Check specific run
+# Check status
gh run view <RUN_ID> --json status,conclusion,jobs --jq '{status: .status, conclusion: .conclusion, jobs: [.jobs[] | {name: (.name | split(",")[0]), status: .status, conclusion: .conclusion}]}'
```
-## Quick Release (App Only)
-
-Most common release - just the desktop app:
+### 6. Test the Draft Release
+- Download from CrabNebula Cloud: https://web.crabnebula.cloud/mediar/screenpipe/releases
+- Test on macOS and Windows
+- Verify updater artifacts exist (.tar.gz, .sig files)
+### 7. Publish Release
+After testing, publish manually via CrabNebula Cloud dashboard, OR commit with magic words:
```bash
-# 1. Bump app version (edit Cargo.toml)
-# 2. Commit and push
-git add -A && git commit -m "Bump app to vX.Y.Z" && git pull --rebase && git push
+git commit --allow-empty -m "release-app-publish" && git push
+```
-# 3. Trigger release
-gh workflow run release-app.yml
+## Changelog Generation
-# 4. Monitor
-sleep 5 && gh run list --workflow=release-app.yml --limit=1
-```
+Changelogs are **automatically generated** during the release workflow using OpenAI GPT-4o-mini:
+
+1. Gets commits between last published release and current
+2. Sends to OpenAI to categorize into: New Features, Improvements, Fixes
+3. Saves to `content/changelogs/vX.Y.Z.md`
+4. Copies to `screenpipe-app-tauri/public/CHANGELOG.md`
-## Full Monorepo Release
+Script: `.github/scripts/generate_changelog_md.sh`
-Release everything:
+## Quick Release (App Only)
```bash
-# Trigger all release workflows
+# 1. Bump version
+# Edit screenpipe-app-tauri/src-tauri/Cargo.toml
+
+# 2. Commit and push
+git add -A && git commit -m "Bump app to vX.Y.Z" && git push
+
+# 3. Trigger release (draft)
gh workflow run release-app.yml
-gh workflow run release-cli.yml
-gh workflow run release-mcp.yml
-# Monitor all
-gh run list --limit 10
+# 4. Monitor
+sleep 5 && gh run list --workflow=release-app.yml --limit=1
```
-## Build Status Table Format
-
-When reporting status, use this format:
+## Build Status Format
```
Build <RUN_ID>:
@@ -115,11 +108,7 @@ Build <RUN_ID>:
### Build Failed
```bash
-# Get failed job logs
-gh run view <RUN_ID> --log-failed
-
-# Or check specific job
-gh run view --job=<JOB_ID> 2>&1 | tail -50
+gh run view <RUN_ID> --log-failed 2>&1 | tail -100
```
### Cancel Running Build
@@ -132,10 +121,27 @@ gh run cancel <RUN_ID>
gh run rerun <RUN_ID> --failed
```
+### Missing Updater Artifacts (.tar.gz, .sig)
+The CI copies `tauri.prod.conf.json` to `tauri.conf.json` before building. If artifacts are missing:
+1. Check `tauri.prod.conf.json` has `"createUpdaterArtifacts": true`
+2. Check the "Use production config" step ran successfully
+
+## Configuration
+
+### Dev vs Prod Configs
+- `tauri.conf.json` - Dev config (identifier: `screenpi.pe.dev`)
+- `tauri.prod.conf.json` - Prod config (identifier: `screenpi.pe`, updater enabled)
+
+CI automatically uses prod config for releases by copying it before build.
+
+### Auto-Publish Behavior
+- `workflow_dispatch` (manual trigger) → Draft only, no publish
+- Commit with "release-app-publish" → Auto-publish after successful build
+
## Notes
- Linux desktop app is disabled (bundling issues)
- App builds take ~25-35 minutes
- CLI builds take ~15-20 minutes
- Always pull before push to avoid conflicts
-- Sentry DSNs are configured for: app, cli, ai-proxy
+- Updater artifacts: macOS uses `.tar.gz`/`.sig`, Windows uses `.nsis.zip`/`.sig`
diff --git a/screenpipe-app-tauri/app/layout.tsx b/screenpipe-app-tauri/app/layout.tsx
index 381df5152..789a6b5ee 100644
--- a/screenpipe-app-tauri/app/layout.tsx
+++ b/screenpipe-app-tauri/app/layout.tsx
@@ -6,6 +6,7 @@ import { Toaster } from "@/components/ui/toaster";
import { useEffect } from "react";
import { DeeplinkHandler } from "@/components/deeplink-handler";
import { ShortcutTracker } from "@/components/shortcut-reminder";
+import { ScreenpipeChat } from "@/components/screenpipe-chat";
const inter = Inter({ subsets: ["latin"] });
@@ -88,6 +89,7 @@ export default function RootLayout({
<DeeplinkHandler />
<ShortcutTracker />
{children}
+ <ScreenpipeChat />
<Toaster />
</body>
</Providers>
diff --git a/screenpipe-app-tauri/components/screenpipe-chat/chat-message.tsx b/screenpipe-app-tauri/components/screenpipe-chat/chat-message.tsx
new file mode 100644
index 000000000..e2f3f5596
--- /dev/null
+++ b/screenpipe-app-tauri/components/screenpipe-chat/chat-message.tsx
@@ -0,0 +1,84 @@
+"use client";
+
+import { cn } from "@/lib/utils";
+import ReactMarkdown from "react-markdown";
+import { User, Bot } from "lucide-react";
+
+interface Message {
+ id: string;
+ role: "user" | "assistant";
+ content: string;
+}
+
+interface ChatMessageProps {
+ message: Message;
+}
+
+export function ChatMessage({ message }: ChatMessageProps) {
+ const isUser = message.role === "user";
+
+ return (
+ <div
+ className={cn(
+ "flex gap-3",
+ isUser ? "flex-row-reverse" : "flex-row"
+ )}
+ >
+ <div
+ className={cn(
+ "flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-full",
+ isUser
+ ? "bg-primary text-primary-foreground"
+ : "bg-muted text-muted-foreground"
+ )}
+ >
+ {isUser ? <User className="h-4 w-4" /> : <Bot className="h-4 w-4" />}
+ </div>
+ <div
+ className={cn(
+ "flex-1 space-y-2 overflow-hidden rounded-lg px-4 py-3",
+ isUser
+ ? "bg-primary text-primary-foreground"
+ : "bg-muted"
+ )}
+ >
+ <ReactMarkdown
+ className={cn(
+ "prose prose-sm max-w-none break-words",
+ isUser
+ ? "prose-invert"
+ : "dark:prose-invert"
+ )}
+ components={{
+ pre: ({ children }) => (
+ <pre className="overflow-x-auto rounded bg-background/50 p-2 text-xs">
+ {children}
+ </pre>
+ ),
+ code: ({ children, className }) => {
+ const isInline = !className;
+ return isInline ? (
+ <code className="rounded bg-background/50 px-1 py-0.5 text-xs">
+ {children}
+ </code>
+ ) : (
+ <code className="text-xs">{children}</code>
+ );
+ },
+ p: ({ children }) => (
+ <p className="mb-2 last:mb-0">{children}</p>
+ ),
+ ul: ({ children }) => (
+ <ul className="mb-2 ml-4 list-disc last:mb-0">{children}</ul>
+ ),
+ ol: ({ children }) => (
+ <ol className="mb-2 ml-4 list-decimal last:mb-0">{children}</ol>
+ ),
+ }}
+ >
+ {message.content}
+ </ReactMarkdown>
+ </div>
+ </div>
+ );
+}
diff --git a/screenpipe-app-tauri/components/screenpipe-chat/index.tsx b/screenpipe-app-tauri/components/screenpipe-chat/index.tsx
new file mode 100644
index 000000000..7c5f78ab0
--- /dev/null
+++ b/screenpipe-app-tauri/components/screenpipe-chat/index.tsx
@@ -0,0 +1,421 @@
+"use client";
+
+import { useState, useRef, useEffect } from "react";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { Card } from "@/components/ui/card";
+import {
+ Send,
+ Loader2,
+ Square,
+ MessageSquare,
+ X,
+ Minimize2,
+ Maximize2,
+} from "lucide-react";
+import { ChatMessage } from "./chat-message";
+import { useSettings } from "@/lib/hooks/use-settings";
+import { cn } from "@/lib/utils";
+
+const SCREENPIPE_API = "http://localhost:3030";
+const VERTEX_PROXY = "https://ai-proxy.i-f9f.workers.dev";
+
+// Tool definitions for Claude
+const TOOLS = [
+ {
+ name: "search_screenpipe",
+ description:
+ "Search through the user's screen recordings, audio transcriptions, and UI elements. " +
+ "Returns timestamped results with app context. Use this to find what the user was doing, " +
+ "what they saw on screen, what was said in meetings, etc.",
+ input_schema: {
+ type: "object" as const,
+ properties: {
+ q: {
+ type: "string",
+ description: "Search query text. Optional - omit to get recent activity.",
+ },
+ content_type: {
+ type: "string",
+ enum: ["all", "ocr", "audio", "ui"],
+ description: "Type of content to search. 'ocr' for screen text, 'audio' for transcriptions, 'ui' for UI elements. Default: 'all'",
+ },
+ limit: {
+ type: "integer",
+ description: "Maximum number of results to return. Default: 10",
+ },
+ start_time: {
+ type: "string",
+ description: "ISO 8601 UTC start time filter (e.g., 2024-01-15T10:00:00Z)",
+ },
+ end_time: {
+ type: "string",
+ description: "ISO 8601 UTC end time filter (e.g., 2024-01-15T18:00:00Z)",
+ },
+ app_name: {
+ type: "string",
+ description: "Filter by application name (e.g., 'Google Chrome', 'Slack', 'zoom.us')",
+ },
+ },
+ },
+ },
+];
+
+interface Message {
+ id: string;
+ role: "user" | "assistant";
+ content: string;
+}
+
+interface ScreenpipeChatProps {
+ className?: string;
+ defaultOpen?: boolean;
+}
+
+export function ScreenpipeChat({ className, defaultOpen = false }: ScreenpipeChatProps) {
+ const { settings } = useSettings();
+ const user = settings.user;
+ const [isOpen, setIsOpen] = useState(defaultOpen);
+ const [isMinimized, setIsMinimized] = useState(false);
+ const [messages, setMessages] = useState<Message[]>([]);
+ const [input, setInput] = useState("");
+ const [isLoading, setIsLoading] = useState(false);
+ const [isStreaming, setIsStreaming] = useState(false);
+ const messagesEndRef = useRef<HTMLDivElement>(null);
+ const inputRef = useRef<HTMLInputElement>(null);
+ const abortControllerRef = useRef<AbortController | null>(null);
+
+ // Scroll to bottom when messages change
+ useEffect(() => {
+ messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
+ }, [messages]);
+
+ // Focus input when opening
+ useEffect(() => {
+ if (isOpen && !isMinimized) {
+ setTimeout(() => inputRef.current?.focus(), 100);
+ }
+ }, [isOpen, isMinimized]);
+
+ // Execute search tool
+ async function executeSearchTool(args: Record<string, unknown>): Promise<string> {
+ try {
+ const params = new URLSearchParams();
+ if (args.q) params.append("q", String(args.q));
+ if (args.content_type && args.content_type !== "all") {
+ params.append("content_type", String(args.content_type));
+ }
+ if (args.limit) params.append("limit", String(args.limit));
+ else params.append("limit", "10");
+ if (args.start_time) params.append("start_time", String(args.start_time));
+ if (args.end_time) params.append("end_time", String(args.end_time));
+ if (args.app_name) params.append("app_name", String(args.app_name));
+
+ const response = await fetch(`${SCREENPIPE_API}/search?${params.toString()}`);
+ if (!response.ok) {
+ throw new Error(`Search failed: ${response.status}`);
+ }
+
+ const data = await response.json();
+ const results = data.data || [];
+
+ if (results.length === 0) {
+ return "No results found. Try broader search terms or a wider time range.";
+ }
+
+ // Format results
+ const formatted = results.map((result: any) => {
+ const content = result.content;
+ if (!content) return null;
+
+ if (result.type === "OCR") {
+ return `[Screen - ${content.app_name || "Unknown"}] ${content.timestamp}\n${content.text || ""}`;
+ } else if (result.type === "Audio") {
+ return `[Audio - ${content.device_name || "Unknown"}] ${content.timestamp}\n${content.transcription || ""}`;
+ } else if (result.type === "UI") {
+ return `[UI - ${content.app_name || "Unknown"}] ${content.timestamp}\n${content.text || ""}`;
+ }
+ return null;
+ }).filter(Boolean);
+
+ return `Found ${results.length} results:\n\n${formatted.join("\n\n---\n\n")}`;
+ } catch (error) {
+ console.error("Search error:", error);
+ return `Search failed: ${error instanceof Error ? error.message : "Unknown error"}`;
+ }
+ }
+
+ // Send message to Claude via Vertex proxy
+ async function sendMessage(userMessage: string) {
+ if (!user?.token) {
+ setMessages((prev) => [
+ ...prev,
+ {
+ id: Date.now().toString(),
+ role: "assistant",
+ content: "Please sign in to use the AI chat feature.",
+ },
+ ]);
+ return;
+ }
+
+ const newUserMessage: Message = {
+ id: Date.now().toString(),
+ role: "user",
+ content: userMessage,
+ };
+ setMessages((prev) => [...prev, newUserMessage]);
+ setInput("");
+ setIsLoading(true);
+ setIsStreaming(true);
+
+ abortControllerRef.current = new AbortController();
+
+ try {
+ // Build conversation history
+ const conversationMessages = [
+ ...messages.map((m) => ({
+ role: m.role,
+ content: m.content,
+ })),
+ { role: "user" as const, content: userMessage },
+ ];
+
+ // Initial request with tools
+ let response = await fetch(`${VERTEX_PROXY}/v1/messages`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${user.token}`,
+ },
+ body: JSON.stringify({
+ model: "claude-sonnet-4@20250514",
+ max_tokens: 4096,
+ system: `You are a helpful AI assistant that can search through the user's Screenpipe data - their screen recordings, audio transcriptions, and UI interactions.
+
+When users ask about what they did, saw, or heard, use the search_screenpipe tool to find relevant information. Be concise in your responses and cite timestamps when relevant.
+
+Current time: ${new Date().toISOString()}`,
+ messages: conversationMessages,
+ tools: TOOLS,
+ }),
+ signal: abortControllerRef.current.signal,
+ });
+
+ if (!response.ok) {
+ const error = await response.text();
+ throw new Error(`API error: ${error}`);
+ }
+
+ let result = await response.json();
+
+ // Handle tool use loop
+ while (result.stop_reason === "tool_use") {
+ const toolUseBlocks = result.content.filter(
+ (block: any) => block.type === "tool_use"
+ );
+
+ const toolResults = [];
+ for (const toolUse of toolUseBlocks) {
+ if (toolUse.name === "search_screenpipe") {
+ const searchResult = await executeSearchTool(toolUse.input);
+ toolResults.push({
+ type: "tool_result",
+ tool_use_id: toolUse.id,
+ content: searchResult,
+ });
+ }
+ }
+
+ // Continue conversation with tool results
+ response = await fetch(`${VERTEX_PROXY}/v1/messages`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${user.token}`,
+ },
+ body: JSON.stringify({
+ model: "claude-sonnet-4@20250514",
+ max_tokens: 4096,
+ system: `You are a helpful AI assistant that can search through the user's Screenpipe data. Current time: ${new Date().toISOString()}`,
+ messages: [
+ ...conversationMessages,
+ { role: "assistant", content: result.content },
+ { role: "user", content: toolResults },
+ ],
+ tools: TOOLS,
+ }),
+ signal: abortControllerRef.current.signal,
+ });
+
+ if (!response.ok) {
+ const error = await response.text();
+ throw new Error(`API error: ${error}`);
+ }
+
+ result = await response.json();
+ }
+
+ // Extract text response
+ const textContent = result.content
+ ?.filter((block: any) => block.type === "text")
+ .map((block: any) => block.text)
+ .join("\n");
+
+ setMessages((prev) => [
+ ...prev,
+ {
+ id: Date.now().toString(),
+ role: "assistant",
+ content: textContent || "I couldn't generate a response.",
+ },
+ ]);
+ } catch (error) {
+ if (error instanceof Error && error.name === "AbortError") {
+ return;
+ }
+ console.error("Chat error:", error);
+ setMessages((prev) => [
+ ...prev,
+ {
+ id: Date.now().toString(),
+ role: "assistant",
+ content: `Error: ${error instanceof Error ? error.message : "Something went wrong"}`,
+ },
+ ]);
+ } finally {
+ setIsLoading(false);
+ setIsStreaming(false);
+ abortControllerRef.current = null;
+ }
+ }
+
+ const handleSubmit = (e: React.FormEvent) => {
+ e.preventDefault();
+ if (!input.trim() || isLoading) return;
+ sendMessage(input.trim());
+ };
+
+ const handleStop = () => {
+ if (abortControllerRef.current) {
+ abortControllerRef.current.abort();
+ setIsLoading(false);
+ setIsStreaming(false);
+ }
+ };
+
+ if (!isOpen) {
+ return (
+ <Button
+ onClick={() => setIsOpen(true)}
+ className={cn(
+ "fixed bottom-4 right-4 h-14 w-14 rounded-full shadow-lg",
+ className
+ )}
+ size="icon"
+ >
+ <MessageSquare className="h-6 w-6" />
+ </Button>
+ );
+ }
+
+ return (
+ <Card
+ className={cn(
+ "fixed bottom-4 right-4 flex flex-col shadow-2xl border-border bg-background",
+ isMinimized ? "w-80 h-14" : "w-96 h-[500px]",
+ className
+ )}
+ >
+ {/* Header */}
+ <div className="flex items-center justify-between p-3 border-b border-border">
+ <div className="flex items-center gap-2">
+ <MessageSquare className="h-5 w-5 text-primary" />
+ <span className="font-medium">Ask Screenpipe</span>
+ </div>
+ <div className="flex items-center gap-1">
+ <Button
+ variant="ghost"
+ size="icon"
+ className="h-8 w-8"
+ onClick={() => setIsMinimized(!isMinimized)}
+ >
+ {isMinimized ? (
+ <Maximize2 className="h-4 w-4" />
+ ) : (
+ <Minimize2 className="h-4 w-4" />
+ )}
+ </Button>
+ <Button
+ variant="ghost"
+ size="icon"
+ className="h-8 w-8"
+ onClick={() => {
+ setIsOpen(false);
+ setMessages([]);
+ }}
+ >
+ <X className="h-4 w-4" />
+ </Button>
+ </div>
+ </div>
+
+ {!isMinimized && (
+ <>
+ {/* Messages */}
+ <div className="flex-1 overflow-y-auto p-4 space-y-4">
+ {messages.length === 0 && (
+ <div className="text-center text-muted-foreground py-8">
+ <p className="text-sm">Ask me anything about your Screenpipe data!</p>
+ <p className="text-xs mt-2">
+ Try: &quot;What did I do in the last hour?&quot; or &quot;Find my Slack messages&quot;
+ </p>
+ </div>
+ )}
+ {messages.map((message) => (
+ <ChatMessage key={message.id} message={message} />
+ ))}
+ {isLoading && (
+ <div className="flex items-center gap-2 text-muted-foreground">
+ <Loader2 className="h-4 w-4 animate-spin" />
+ <span className="text-sm">Searching your data...</span>
+ </div>
+ )}
+ <div ref={messagesEndRef} />
+ </div>
+
+ {/* Input */}
+ <form onSubmit={handleSubmit} className="p-3 border-t border-border">
+ <div className="flex gap-2">
+ <Input
+ ref={inputRef}
+ value={input}
+ onChange={(e) => setInput(e.target.value)}
+ placeholder="Ask about your screen activity..."
+ disabled={isLoading}
+ className="flex-1"
+ />
+ <Button
+ type={isStreaming ? "button" : "submit"}
+ size="icon"
+ disabled={!input.trim() && !isStreaming}
+ onClick={isStreaming ? handleStop : undefined}
+ >
+ {isStreaming ? (
+ <Square className="h-4 w-4" />
+ ) : (
+ <Send className="h-4 w-4" />
+ )}
+ </Button>
+ </div>
+ {!user?.token && (
+ <p className="text-xs text-muted-foreground mt-2">
+ Sign in to use AI chat
+ </p>
+ )}
+ </form>
+ </>
+ )}
+ </Card>
+ );
+}
diff --git a/screenpipe-app-tauri/components/settings/connections-section.tsx b/screenpipe-app-tauri/components/settings/connections-section.tsx
index 028c77737..4ff84c5a3 100644
--- a/screenpipe-app-tauri/components/settings/connections-section.tsx
+++ b/screenpipe-app-tauri/components/settings/connections-section.tsx
@@ -10,7 +10,7 @@ import { writeFile } from "@tauri-apps/plugin-fs";
import { fetch as tauriFetch } from "@tauri-apps/plugin-http";
import { platform } from "@tauri-apps/plugin-os";
import { tempDir, join } from "@tauri-apps/api/path";
-import { useUser } from "@clerk/clerk-react";
+import { useSettings } from "@/lib/hooks/use-settings";
const GITHUB_RELEASES_API = "https://api.github.com/repos/mediar-ai/screenpipe/releases";
@@ -56,12 +56,13 @@ async function getLatestMcpbUrl(): Promise<string> {
export function ConnectionsSection() {
const [downloadState, setDownloadState] = useState<"idle" | "downloading" | "downloaded">("idle");
const [copiedEnv, setCopiedEnv] = useState(false);
- const { user } = useUser();
+ const { settings } = useSettings();
+ const user = settings.user;
const agentSdkEnvVars = `export CLAUDE_CODE_USE_VERTEX=1
export ANTHROPIC_VERTEX_BASE_URL=https://ai-proxy.i-f9f.workers.dev
export CLAUDE_CODE_SKIP_VERTEX_AUTH=1
-export ANTHROPIC_API_KEY=${user?.id || "your-user-id"}`;
+export ANTHROPIC_API_KEY=${user?.token || "your-user-token"}`;
const copyEnvVars = async () => {
try {
@@ -284,7 +285,7 @@ export ANTHROPIC_API_KEY=${user?.id || "your-user-id"}`;
screen recordings programmatically. Powered by Screenpipe&apos;s Vertex AI credits.
</p>
- {!user?.id ? (
+ {!user?.token ? (
<div className="p-3 bg-yellow-500/10 border border-yellow-500/20 rounded-lg mb-4">
<p className="text-sm text-yellow-600 dark:text-yellow-400">
<strong>Sign in required:</strong> Please sign in to use the Agent SDK with Screenpipe Cloud.
diff --git a/screenpipe-js/ai-proxy/src/utils/subscription.ts b/screenpipe-js/ai-proxy/src/utils/subscription.ts
index 79cb7b0b0..0aa7bd28b 100644
--- a/screenpipe-js/ai-proxy/src/utils/subscription.ts
+++ b/screenpipe-js/ai-proxy/src/utils/subscription.ts
@@ -85,5 +85,32 @@ export async function validateSubscription(env: Env, userId: string): Promise<bo
return true;
}
+ // Check for JWT token (from screenpipe desktop app) - validate against screenpipe API
+ if (userId.startsWith('eyJ')) {
+ try {
+ const response = await fetch('https://screenpi.pe/api/user', {
+ method: 'GET',
+ headers: {
+ Authorization: `Bearer ${userId}`,
+ 'Content-Type': 'application/json',
+ },
+ });
+
+ if (response.ok) {
+ const userData = await response.json();
+ console.log('Valid screenpipe user token, user:', userData?.email);
+ subscriptionCache.set(userId, true);
+ return true;
+ } else {
+ console.log('Invalid screenpipe user token');
+ subscriptionCache.set(userId, false);
+ return false;
+ }
+ } catch (error) {
+ console.error('Error validating screenpipe token:', error);
+ return false;
+ }
+ }
+
return false;
}
\ No newline at end of file