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

update example pipe

Louis Beaumont0918e1e06126
diff --git a/pipes/example-pipe/app/page.tsx b/pipes/example-pipe/app/page.tsx
index be7b74728..77b4a276b 100644
--- a/pipes/example-pipe/app/page.tsx
+++ b/pipes/example-pipe/app/page.tsx
@@ -1,19 +1,16 @@
"use client";
import { SettingsProvider } from "@/lib/settings-provider";
-import { LastOcrImage } from "@/components/ready-to-use-examples/last-ocr-image";
-import { HealthStatus } from "@/components/ready-to-use-examples/health-status";
-import { LastUiRecord } from "@/components/ready-to-use-examples/last-ui-record";
import { PlaygroundCard } from "@/components/playground-card";
import { ClientOnly } from "@/lib/client-only";
import { Inter } from "next/font/google";
-import componentsList from '../content/components-list.json';
+import componentsList from "../content/components-list.json";
import { useEffect, useState } from "react";
-const inter = Inter({
- subsets: ['latin'],
- display: 'swap',
- variable: '--font-inter',
+const inter = Inter({
+ subsets: ["latin"],
+ display: "swap",
+ variable: "--font-inter",
});
interface Pipe {
@@ -22,6 +19,10 @@ interface Pipe {
description: string;
}
+function isMacOS() {
+ return navigator.platform.toUpperCase().indexOf("MAC") >= 0;
+}
+
export default function Page() {
const [pipes, setPipes] = useState<Pipe[]>([]);
const [loading, setLoading] = useState(true);
@@ -33,7 +34,7 @@ export default function Page() {
const transformedPipes = data.map((pipe: any) => ({
id: pipe.id,
name: pipe.name,
- description: pipe.description?.split('\n')[0] || ''
+ description: pipe.description?.split("\n")[0] || "",
}));
setPipes(transformedPipes);
setLoading(false);
@@ -47,27 +48,46 @@ export default function Page() {
return (
<SettingsProvider>
<ClientOnly>
- <div className={`flex flex-col gap-6 items-center justify-center h-full mt-12 px-4 pb-12 ${inter.className}`}>
- <h1 className="text-2xl font-bold mb-0">example app (pipe) for developers</h1>
- <p className="text-gray-600 mb-2 -mt-5">ready-to-use components for engineers building apps with screenpipe</p>
- {componentsList.map((cardContent, index) => (
- <PlaygroundCard key={index} content={cardContent} />
- ))}
-
+ <div
+ className={`flex flex-col gap-6 items-center justify-center h-full mt-12 px-4 pb-12 ${inter.className}`}
+ >
+ <h1 className="text-2xl font-bold mb-0">
+ example app (pipe) for developers
+ </h1>
+ <p className="text-gray-600 mb-2 -mt-5">
+ ready-to-use components for engineers building apps with screenpipe
+ </p>
+ {componentsList.map((cardContent, index) => {
+ if (cardContent.macOSOnly && !isMacOS()) {
+ return null; // Skip rendering if it's macOS only and not on macOS
+ }
+ return <PlaygroundCard key={index} content={cardContent} />;
+ })}
+
<div className="w-full max-w-4xl mt-8 font-mono">
- <h2 className="text-xl font-semibold mb-4 text-left">open source pipes</h2>
+ <h2 className="text-xl font-semibold mb-4 text-left">
+ open source pipes
+ </h2>
<p className="mb-6 text-left text-gray-600">
- # All pipes are open source and you can directly fork or reuse pipes or components.
- # Source: <a href="https://github.com/mediar-ai/screenpipe/tree/main/pipes" className="text-blue-500 underline">https://github.com/mediar-ai/screenpipe/tree/main/pipes</a>
+ # All pipes are open source and you can directly fork or reuse
+ pipes or components. # Source:{" "}
+ <a
+ href="https://github.com/mediar-ai/screenpipe/tree/main/pipes"
+ className="text-blue-500 underline"
+ >
+ https://github.com/mediar-ai/screenpipe/tree/main/pipes
+ </a>
</p>
-
+
{loading ? (
<p className="text-gray-500">Loading available pipes...</p>
) : (
<div className="bg-gray-100 p-4 rounded w-full max-w-4xl text-sm border border-gray-200">
{pipes.map((pipe, index) => (
<div key={index} className="mb-2 last:mb-0">
- <span className="font-medium">[{index}]</span> <span className="font-semibold">{pipe.name}</span> - {pipe.description}
+ <span className="font-medium">[{index}]</span>{" "}
+ <span className="font-semibold">{pipe.name}</span> -{" "}
+ {pipe.description}
</div>
))}
</div>
diff --git a/pipes/example-pipe/content/components-list.json b/pipes/example-pipe/content/components-list.json
index a4ee87934..6c242df50 100644
--- a/pipes/example-pipe/content/components-list.json
+++ b/pipes/example-pipe/content/components-list.json
@@ -5,7 +5,8 @@
"llmModel": "claude-3.7-sonnet",
"llmUserPrompt": "can we have another component to call screenpipe health endpoint and render raw json output? can we display the output more user friendly, with some animation (framer motion), etc., keep code short",
"llmContextUrl": "https://docs.screenpi.pe/api-reference",
- "title": "health status check"
+ "title": "health status check",
+ "macOSOnly": false
},
{
"componentPath": "/pipes/example-pipe/components/ready-to-use-examples/last-ui-record.tsx",
@@ -13,7 +14,8 @@
"title": "latest UI record",
"llmModel": "claude-3.7-sonnet",
"llmUserPrompt": "create a component that fetches and displays the latest UI_monitoring record from screenpipe, showing details like app name, window name, timestamp, and text content",
- "llmContextUrl": "https://docs.screenpi.pe/sdk-reference"
+ "llmContextUrl": "https://docs.screenpi.pe/sdk-reference",
+ "macOSOnly": false
},
{
"componentPath": "/pipes/example-pipe/components/ready-to-use-examples/last-ocr-image.tsx",
@@ -21,7 +23,8 @@
"title": "latest OCR record",
"llmModel": "claude-3.7-sonnet",
"llmUserPrompt": "create a component that fetches and displays the latest OCR image from screenpipe, showing the image along with any extracted text and metadata",
- "llmContextUrl": "https://docs.screenpi.pe/sdk-reference"
+ "llmContextUrl": "https://docs.screenpi.pe/sdk-reference",
+ "macOSOnly": false
},
{
"componentPath": "/pipes/example-pipe/components/ready-to-use-examples/last-audio-transcription.tsx",
@@ -29,7 +32,8 @@
"title": "latest audio transcription",
"llmModel": "claude-3.7-sonnet",
"llmUserPrompt": "create a component that fetches and displays the latest audio transcription from screenpipe, showing the transcription text along with metadata like device name, timestamp, and speaker information",
- "llmContextUrl": "https://docs.screenpi.pe/sdk-reference"
+ "llmContextUrl": "https://docs.screenpi.pe/sdk-reference",
+ "macOSOnly": false
},
{
"componentPath": "/pipes/example-pipe/components/ready-to-use-examples/realtime-screen.tsx",
@@ -37,7 +41,8 @@
"title": "screen streaming",
"llmModel": "claude-3.7-sonnet",
"llmUserPrompt": "create a component that streams real-time screen captures with OCR text using the pipe.streamVision API, showing both the screen image and extracted text with appropriate controls to start/stop streaming",
- "llmContextUrl": "https://docs.screenpi.pe/sdk-reference"
+ "llmContextUrl": "https://docs.screenpi.pe/sdk-reference",
+ "macOSOnly": false
},
{
"componentPath": "/pipes/example-pipe/components/ready-to-use-examples/realtime-audio.tsx",
@@ -45,7 +50,8 @@
"title": "audio streaming",
"llmModel": "claude-3.7-sonnet",
"llmUserPrompt": "create a component that streams real-time audio transcriptions using the pipe.streamTranscriptions API, showing both the current transcription and history with appropriate controls to start/stop streaming",
- "llmContextUrl": "https://docs.screenpi.pe/sdk-reference"
+ "llmContextUrl": "https://docs.screenpi.pe/sdk-reference",
+ "macOSOnly": false
},
{
"componentPath": "/pipes/example-pipe/components/ready-to-use-examples/move-mouse-click.tsx",
@@ -53,7 +59,8 @@
"title": "move mouse and click",
"llmModel": "claude-3.7-sonnet",
"llmUserPrompt": "create a component that uses the operator API to move the mouse to specific coordinates and perform a click action, demonstrating basic interaction capabilities",
- "llmContextUrl": "https://docs.screenpi.pe/operator-api"
+ "llmContextUrl": "https://docs.screenpi.pe/operator-api",
+ "macOSOnly": false
},
{
"componentPath": "/pipes/example-pipe/components/ready-to-use-examples/open-app-get-text.tsx",
@@ -61,6 +68,7 @@
"title": "open app and get text",
"llmModel": "claude-3.7-sonnet",
"llmUserPrompt": "create a component that opens an application and retrieves text from a specific element, demonstrating basic interaction capabilities",
- "llmContextUrl": "https://docs.screenpi.pe/operator-api"
+ "llmContextUrl": "https://docs.screenpi.pe/operator-api",
+ "macOSOnly": true
}
]