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

example pipe update

Louis Beaumontc0875430d87d
diff --git a/Cargo.lock b/Cargo.lock
index 2813d40c0..e66a43809 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5877,7 +5877,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "screenpipe-audio"
-version = "0.2.73"
+version = "0.2.74"
dependencies = [
"anyhow",
"bytemuck",
@@ -5930,7 +5930,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.2.73"
+version = "0.2.74"
dependencies = [
"accessibility",
"accessibility-sys 0.2.0",
@@ -5972,7 +5972,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.2.73"
+version = "0.2.74"
dependencies = [
"anyhow",
"chrono",
@@ -5994,7 +5994,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.2.73"
+version = "0.2.74"
dependencies = [
"anyhow",
"chrono",
@@ -6012,7 +6012,7 @@ dependencies = [
[[package]]
name = "screenpipe-integrations"
-version = "0.2.73"
+version = "0.2.74"
dependencies = [
"anyhow",
"image",
@@ -6027,7 +6027,7 @@ dependencies = [
[[package]]
name = "screenpipe-server"
-version = "0.2.73"
+version = "0.2.74"
dependencies = [
"anyhow",
"axum",
@@ -6089,7 +6089,7 @@ dependencies = [
[[package]]
name = "screenpipe-vision"
-version = "0.2.73"
+version = "0.2.74"
dependencies = [
"accessibility-sys 0.1.3",
"anyhow",
diff --git a/pipes/example-pipe/bun.lockb b/pipes/example-pipe/bun.lockb
index 08a1594be..2c7b9f721 100755
Binary files a/pipes/example-pipe/bun.lockb and b/pipes/example-pipe/bun.lockb differ
diff --git a/pipes/example-pipe/components/ready-to-use-examples/move-mouse-click.tsx b/pipes/example-pipe/components/ready-to-use-examples/move-mouse-click.tsx
new file mode 100644
index 000000000..f29cf41de
--- /dev/null
+++ b/pipes/example-pipe/components/ready-to-use-examples/move-mouse-click.tsx
@@ -0,0 +1,26 @@
+import React from "react";
+import { pipe } from "@screenpipe/browser";
+
+const MoveMouseClick = () => {
+ const handleMoveAndClick = async () => {
+ try {
+ // Move mouse to coordinates (500, 500)
+ await pipe.operator.pixel.moveMouse(500, 400);
+ console.log("Mouse moved to (500, 400)");
+
+ // Click the left mouse button
+ await pipe.operator.pixel.click("left");
+ console.log("Mouse clicked");
+ } catch (error) {
+ console.error("Error in moving mouse and clicking:", error);
+ }
+ };
+
+ return (
+ <div>
+ <button onClick={handleMoveAndClick}>Move Mouse and Click</button>
+ </div>
+ );
+};
+
+export default MoveMouseClick;
diff --git a/pipes/example-pipe/components/ready-to-use-examples/open-app-get-text.tsx b/pipes/example-pipe/components/ready-to-use-examples/open-app-get-text.tsx
new file mode 100644
index 000000000..c2bec7bf4
--- /dev/null
+++ b/pipes/example-pipe/components/ready-to-use-examples/open-app-get-text.tsx
@@ -0,0 +1,63 @@
+import React, { useState } from "react";
+import { pipe } from "@screenpipe/browser";
+
+const getBrowserName = () => {
+ if (
+ getComputedStyle(document.documentElement).getPropertyValue(
+ "--arc-palette-title"
+ )
+ )
+ return "arc";
+ const userAgent = window.navigator.userAgent;
+
+ if (userAgent.includes("Firefox")) return "firefox";
+ if (userAgent.includes("Edge") || userAgent.includes("Edg")) return "edge";
+ if (userAgent.includes("Chrome") && !userAgent.includes("Edg"))
+ return "chrome";
+ if (userAgent.includes("Safari") && !userAgent.includes("Chrome"))
+ return "safari";
+ if (userAgent.includes("Opera") || userAgent.includes("OPR")) return "opera";
+
+ return "unknown";
+};
+
+const OpenAppGetText = () => {
+ const [text, setText] = useState("");
+ const handleOpenAppAndGetText = async () => {
+ try {
+ const browserName = getBrowserName();
+ console.log("Browser name:", browserName);
+ // Open an application, e.g., 'TextEdit' on macOS
+ // await pipe.operator.openApplication("TextEdit").catch((error) => {
+ // console.warn("Error in opening application:", error);
+ // });
+ // console.log("Application opened");
+
+ // Assuming we have an element ID to get text from
+ const element = await pipe.operator
+ .getByRole("AXWebArea", {
+ app: browserName,
+ activateApp: true,
+ useBackgroundApps: true,
+ })
+ .first();
+
+ const text = element?.text;
+ setText(text || "");
+ console.log("Retrieved text:", text);
+
+ // await pipe.operator.openApplication(browserName);
+ } catch (error) {
+ console.error("Error in opening app and getting text:", error);
+ }
+ };
+
+ return (
+ <div>
+ <button onClick={handleOpenAppAndGetText}>Open App and Get Text</button>
+ <p>text scraped: {text}</p>
+ </div>
+ );
+};
+
+export default OpenAppGetText;
diff --git a/pipes/example-pipe/content/components-list.json b/pipes/example-pipe/content/components-list.json
index 92fbc4db7..a4ee87934 100644
--- a/pipes/example-pipe/content/components-list.json
+++ b/pipes/example-pipe/content/components-list.json
@@ -46,5 +46,21 @@
"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"
+ },
+ {
+ "componentPath": "/pipes/example-pipe/components/ready-to-use-examples/move-mouse-click.tsx",
+ "endpoint_optional": "SDK: pipe.operator",
+ "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"
+ },
+ {
+ "componentPath": "/pipes/example-pipe/components/ready-to-use-examples/open-app-get-text.tsx",
+ "endpoint_optional": "SDK: pipe.operator",
+ "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"
}
]
diff --git a/pipes/example-pipe/package.json b/pipes/example-pipe/package.json
index 4fd476484..95dfbeb84 100644
--- a/pipes/example-pipe/package.json
+++ b/pipes/example-pipe/package.json
@@ -24,8 +24,8 @@
"@radix-ui/react-tabs": "^1.1.3",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/react-tooltip": "^1.1.8",
- "@screenpipe/browser": "0.1.26",
- "@screenpipe/js": "1.0.18",
+ "@screenpipe/browser": "0.1.40",
+ "@screenpipe/js": "1.0.21",
"@types/lodash": "^4.17.13",
"@types/nodemailer": "^6.4.17",
"ai": "^4.0.18",