-
Notifications
You must be signed in to change notification settings - Fork 879
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release-app - make streamVision use 0 GB down from 15 gb, and stream …
…browser url, and add example next js to use it and fix linux build
- Loading branch information
1 parent
2e27e84
commit 3ab702a
Showing
33 changed files
with
1,351 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ exclude = ["screenpipe-app-tauri/src-tauri"] | |
resolver = "2" | ||
|
||
[workspace.package] | ||
version = "0.2.57" | ||
version = "0.2.58" | ||
authors = ["louis030195 <[email protected]>"] | ||
description = "" | ||
repository = "https://github.com/mediar-ai/screenpipe" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/versions | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# env files (can opt-in for committing if needed) | ||
.env* | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
# or | ||
bun dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. | ||
|
||
## Learn More | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! | ||
|
||
## Deploy on Vercel | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
:root { | ||
--background: #ffffff; | ||
--foreground: #171717; | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
:root { | ||
--background: #0a0a0a; | ||
--foreground: #ededed; | ||
} | ||
} | ||
|
||
body { | ||
color: var(--foreground); | ||
background: var(--background); | ||
font-family: Arial, Helvetica, sans-serif; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type { Metadata } from "next"; | ||
import { Geist, Geist_Mono } from "next/font/google"; | ||
import "./globals.css"; | ||
|
||
const geistSans = Geist({ | ||
variable: "--font-geist-sans", | ||
subsets: ["latin"], | ||
}); | ||
|
||
const geistMono = Geist_Mono({ | ||
variable: "--font-geist-mono", | ||
subsets: ["latin"], | ||
}); | ||
|
||
export const metadata: Metadata = { | ||
title: "Create Next App", | ||
description: "Generated by create next app", | ||
}; | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}>) { | ||
return ( | ||
<html lang="en"> | ||
<body | ||
className={`${geistSans.variable} ${geistMono.variable} antialiased`} | ||
> | ||
{children} | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
"use client"; | ||
|
||
import Image from "next/image"; | ||
import { useEffect, useState } from "react"; | ||
import { pipe } from "@screenpipe/browser"; | ||
import { VisionEvent } from "@screenpipe/browser"; | ||
|
||
export default function Home() { | ||
const [visionEvent, setVisionEvent] = useState<VisionEvent | null>(null); | ||
|
||
useEffect(() => { | ||
const streamVision = async () => { | ||
try { | ||
for await (const event of pipe.streamVision(true)) { | ||
setVisionEvent(event.data); | ||
console.log("vision event received"); | ||
} | ||
} catch (error) { | ||
console.error("vision stream error:", error); | ||
} | ||
}; | ||
|
||
streamVision(); | ||
|
||
return () => { | ||
pipe.disconnect(); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div className="min-h-screen flex flex-col items-center justify-center bg-transparent gap-4"> | ||
{visionEvent?.image ? ( | ||
<div className="space-y-4"> | ||
<Image | ||
src={`data:image/jpeg;base64,${visionEvent.image}`} | ||
alt="streamed content" | ||
width={500} | ||
height={300} | ||
style={{ objectFit: "contain" }} | ||
className="rounded-lg" | ||
/> | ||
<div className="space-y-2 font-mono text-sm"> | ||
<a href={visionEvent.browser_url} target="_blank"> | ||
<p className="text-gray-500"> | ||
{visionEvent.browser_url || "unknown"} | ||
</p> | ||
</a> | ||
<p className="text-gray-500"> | ||
app: {visionEvent.app_name || "unknown"} | ||
</p> | ||
<p className="text-gray-500"> | ||
window: {visionEvent.window_name || "unknown"} | ||
</p> | ||
<p className="text-gray-500"> | ||
time: {new Date(visionEvent.timestamp).toLocaleTimeString()} | ||
</p> | ||
{visionEvent.text && ( | ||
<p className="text-gray-500 max-w-[500px] break-words"> | ||
text: {visionEvent.text} | ||
</p> | ||
)} | ||
</div> | ||
</div> | ||
) : ( | ||
<div className="animate-pulse bg-gray-200 rounded-lg w-[500px] h-[300px]" /> | ||
)} | ||
|
||
<div className="fixed bottom-4 right-4 text-sm text-gray-500 font-mono"> | ||
{visionEvent ? "streaming..." : "waiting for stream..."} | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.