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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
cleanup
Louis Beaumont2d214f01680d
diff --git a/pipes/archive/agent-multi-turn-rag/.gitignore b/pipes/archive/agent-multi-turn-rag/.gitignoredeleted file mode 100644index a56a7ef43..000000000--- a/pipes/archive/agent-multi-turn-rag/.gitignore+++ /dev/null@@ -1,2 +0,0 @@-node_modules-diff --git a/pipes/archive/agent-multi-turn-rag/README.md b/pipes/archive/agent-multi-turn-rag/README.mddeleted file mode 100644index 364a50d7f..000000000--- a/pipes/archive/agent-multi-turn-rag/README.md+++ /dev/null@@ -1,8 +0,0 @@----```bash-pnpm i-export OPENAI_API_KEY="<your key>"-npx tsx screenpipe.ts-```diff --git a/pipes/archive/agent-multi-turn-rag/package.json b/pipes/archive/agent-multi-turn-rag/package.jsondeleted file mode 100644index 94de2fb43..000000000--- a/pipes/archive/agent-multi-turn-rag/package.json+++ /dev/null@@ -1,11 +0,0 @@-{- "dependencies": {- "@ai-sdk/openai": "^0.0.40",- "ai": "^3.3.0",- "readline": "^1.3.0",- "zod": "^3.23.8"- },- "devDependencies": {- "@types/node": "^22.1.0"- }-}diff --git a/pipes/archive/agent-multi-turn-rag/screenpipe.ts b/pipes/archive/agent-multi-turn-rag/screenpipe.tsdeleted file mode 100644index 6a5967a28..000000000--- a/pipes/archive/agent-multi-turn-rag/screenpipe.ts+++ /dev/null@@ -1,194 +0,0 @@-import { z } from "zod";-import { openai } from "@ai-sdk/openai";-import { generateText, streamText } from "ai";-import * as readline from "readline";--// example use:-// can you create a bullet list for me to share with my colleagues-// my changes in the code of screenpipe? Use the queries like "lldb", "gdp", "discord"--const screenpipeQuery = z.object({- q: z- .string()- .describe(- "The search query matching exact keywords. Use a single keyword that best matches the user intent. This would match either audio transcription or OCR screen text. Example: do not use 'discuss' the user ask about conversation, this is dumb, won't return any result"- )- .optional(),- content_type: z- .enum(["ocr", "audio", "all"])- .default("all")- .describe(- "The type of content to search for: screenshot data or audio transcriptions"- ),- limit: z- .number()- .default(5)- .describe(- "Number of results to return (default: 5). Don't return more than 50 results as it will be fed to an LLM"- ),- offset: z.number().default(0).describe("Offset for pagination (default: 0)"),- start_time: z- .string()- // 1 hour ago- .default(new Date(Date.now() - 3600000).toISOString())- .describe("Start time for search range in ISO 8601 format"),- end_time: z- .string()- .default(new Date().toISOString())- .describe("End time for search range in ISO 8601 format"),- app_name: z- .string()- .describe(- "The name of the app the user was using. This filter out all audio conversations. Only works with screen text. Use this to filter on the app context that would give context matching the user intent. For example 'cursor'. Use lower case. Browser is usually 'arc', 'chrome', 'safari', etc."- )- .optional(),-});-const screenpipeMultiQuery = z.object({- queries: z.array(screenpipeQuery),-});--async function queryScreenpipeNtimes(- params: z.infer<typeof screenpipeMultiQuery>-) {- console.log(- "Using tool queryScreenpipeNtimes with params:",- JSON.stringify(params)- );- return Promise.all(params.queries.map(queryScreenpipe));-}--// Add this new function to handle screenpipe requests-async function queryScreenpipe(params: z.infer<typeof screenpipeQuery>) {- try {- console.log("params", params);- const queryParams = new URLSearchParams(- Object.entries({- q: params.q,- offset: params.offset.toString(),- limit: params.limit.toString(),- start_time: params.start_time,- end_time: params.end_time,- content_type: params.content_type,- app_name: params.app_name,- }).filter(([_, v]) => v != null) as [string, string][]- );- console.log("calling screenpipe", JSON.stringify(params));- const response = await fetch(`http://localhost:3030/search?${queryParams}`);- if (!response.ok) {- const text = await response.text();- throw new Error(`HTTP error! status: ${response.status} ${text}`);- }- const result = await response.json();- console.log("result", result);- return result;- } catch (error) {- console.error("Error querying screenpipe:", error);- return null;- }-}--const screenpipe = async () => {- console.log("Hi! How can I help you?");- const rl = readline.createInterface({- input: process.stdin,- output: process.stdout,- });-- const inputMessage = await new Promise<string>((resolve) => {- rl.question("Enter your message: ", (answer) => {- rl.close();- resolve(answer);- });- });-- const text = await generateText({- model: openai("gpt-4o"),- tools: {- query_screenpipe: {- description:- "Query the local screenpipe instance for relevant information. You will return multiple queries under the key 'queries'.",- parameters: screenpipeMultiQuery,- execute: queryScreenpipeNtimes,- },- stream_response: {- description: "Stream the final response to the user",- parameters: z.object({- response: z- .string()- .describe("The final response to stream to the user"),- }),- execute: async ({ response }) => {- const { textStream } = await streamText({- model: openai("gpt-4o"),- messages: [- {- role: "user",- content: response,- },- ],- });- for await (const chunk of textStream) {- console.log(chunk);- }- return { success: true };- },- },- },- toolChoice: "required",- messages: [- {- role: "system",- content: `You are a helpful assistant.- The user is using a product called "screenpipe" which records- his screen and mics 24/7. The user ask you questions- and you use his screenpipe recordings to answer him.- Based on the user request, use tools to query screenpipe to best help the user.- Each query should have "q", "offset", "limit", "start_time", "end_time", and "content_type" fields.- Rules:- - q should be a single keyword that would properly find in the text found on the user screen some information that would help answering the user question.- Return a list of objects with the key "queries"- - q contains a single query, again, for example instead of "life plan" just use "life"- - Respond with only the updated JSON object- - If you return something else than JSON the universe will come to an end- - DO NOT add \`\`\`json at the beginning or end of your response- - Do not use '"' around your response- - Date & time now is ${new Date().toISOString()}. Adjust start_time and end_time to properly match the user intent time range.- - If the user ask about his morning do not use morning as query that's dumb, try to infer some keywords from the user question- - Very important: your output will be given to another LLM so make sure not to return too much data (typically each row returns lot of data)- - Use between 2-5 queries with very different keywords that could maximally match the user's screen text or audio transcript- - Use "all" for querying the same keyword over vision and audio- - MAKE SURE TO RETURN AN ARRAY OF QUERIES e.g. {"queries": [ ... ]}- - MAKE SURE TO RETURN AN ARRAY OF QUERIES e.g. {"queries": [ ... ]}- - MAKE SURE TO RETURN AN ARRAY OF QUERIES e.g. {"queries": [ ... ]}- - You typically always query screenpipe in the first user message-- Example answers from you:- "{- "queries": [- {"q": "goal", "offset": 0, "limit": 10, "content_type": "all", "start_time": "2024-07-21T11:30:25Z", "end_time": "2024-07-21T11:35:25Z", "app_name": "arc"},- {"offset": 0, "limit": 50, "content_type": "ocr", "start_time": "2024-07-19T08:00:25Z", "end_time": "2024-07-20T09:00:25Z"},- {"q": "customer", "offset": 0, "limit": 20, "content_type": "audio", "start_time": "2024-07-19T08:00:25Z", "end_time": "2024-07-20T09:00:25Z"}- ]- }"-- or- "{- "queries": [- {"q": "sales", "offset": 0, "limit": 10, "content_type": "all", "start_time": "2024-07-21T11:30:25Z", "end_time": "2024-07-21T11:35:25Z"},- {"q": "customer", "offset": 0, "limit": 20, "content_type": "all", "start_time": "2024-07-19T08:00:25Z", "end_time": "2024-07-20T09:00:25Z"},- {"offset": 0, "limit": 10, "content_type": "all", "start_time": "2024-07-19T08:00:25Z", "end_time": "2024-07-20T09:00:25Z", "app_name": "notes"}- ]- }"-- `,- },- {- role: "user",- content: inputMessage,- },- ],- maxToolRoundtrips: 3,- });-};--screenpipe();diff --git a/pipes/archive/apple-shortcut/README.md b/pipes/archive/apple-shortcut/README.mddeleted file mode 100644index 0c1d26b3a..000000000--- a/pipes/archive/apple-shortcut/README.md+++ /dev/null@@ -1,13 +0,0 @@---DM @louis030195 if you want to use ollama instead, will help--<img width="1512" alt="Screenshot 2024-07-22 at 17 21 01" src="https://github.com/user-attachments/assets/55a8a87c-b7f3-4ea8-ac4e-7a042a6723c1">--need help? [i'll install this with you in less than 10 minutes](https://cal.com/louis030195/screenpipe)--[want a better version of this?](https://buy.stripe.com/9AQ5l36e2esa0BG5ks)----diff --git a/pipes/archive/apple-shortcut/main.js b/pipes/archive/apple-shortcut/main.jsdeleted file mode 100644index f1b4afc60..000000000--- a/pipes/archive/apple-shortcut/main.js+++ /dev/null@@ -1,106 +0,0 @@-#!/usr/bin/env node--const https = require('https');-const http = require('http');--const OPENAI_API_URL = 'https://api.openai.com/v1/chat/completions';-const OPENAI_MODEL = 'gpt-4o';-const OPENAI_KEY = 'YOUR OPENAI KEY';--// DM @louis030195 if you want to use ollama instead, will help--// Function to make API calls-function callApi(url, data) {- return new Promise((resolve, reject) => {- const options = {- method: 'POST',- headers: {- 'Content-Type': 'application/json',- 'Authorization': `Bearer ${OPENAI_KEY}`- }- };-- const req = https.request(url, options, (res) => {- let responseData = '';- res.on('data', (chunk) => { responseData += chunk; });- res.on('end', () => {- resolve(JSON.parse(responseData));- });- });-- req.on('error', (error) => {- reject(error);- });-- req.write(JSON.stringify(data));- req.end();- });-}--// Function to make HTTP GET requests-function httpGet(url) {- return new Promise((resolve, reject) => {- http.get(url, (res) => {- let data = '';- res.on('data', (chunk) => { data += chunk; });- res.on('end', () => {- resolve(data);- });- }).on('error', (error) => {- reject(error);- });- });-}--async function runScreenpipe(input) {- // Generate query parameters- const currentDate = new Date().toISOString();- const paramsResponse = await callApi(OPENAI_API_URL, {- messages: [- {- role: "user",- content: `Based on this user selection: "${input}", generate parameters as JSON for 3 different queries to screenpipe. Each query should have "q", "offset", "limit", and start_time, end_time fields. Rules: - q should be a single keyword that would properly find in the text found on the user screen some information that would help answering the user question. Return a list of objects with the key "queries" - q contains a single query, again, for example instead of "life plan" just use "life" - Respond with only the updated JSON object - User's Date & time now is ${currentDate} - Make sure to respect user's date - Be concise, answer as a bullet list - Your answer will be read out loud so make sure it's adapted`- }- ],- model: OPENAI_MODEL,- response_format: { type: "json_object" }- });-- // console.log("Raw API response:");- // console.log(JSON.stringify(paramsResponse, null, 2));-- const queries = JSON.parse(paramsResponse.choices[0].message.content).queries;-- if (!queries) {- console.error("Error: No queries returned from the API.");- process.exit(1);- }-- // Query screenpipe (replace with actual endpoint)- const screenpipeResults = await Promise.all(queries.map(async (query) => {- const { q, offset, limit } = query;- return httpGet(`http://localhost:3030/search?q=${q}&offset=${offset}&limit=${limit}`);- }));-- // Generate final response- const finalResponse = await callApi(OPENAI_API_URL, {- messages: [- {- role: "user",- content: `Answer based on "${input}" and data: ${screenpipeResults.join(' ')}`- }- ],- model: OPENAI_MODEL- });-- console.log(finalResponse.choices[0].message.content);-}--// Run the function with input-const userInput = process.argv[2];-if (!userInput) {- console.error("Please provide an input argument.");- process.exit(1);-}--runScreenpipe(userInput).catch(console.error);\ No newline at end of filediff --git a/pipes/archive/daily-detailed-activity-reporter/.gitignore b/pipes/archive/daily-detailed-activity-reporter/.gitignoredeleted file mode 100644index a56a7ef43..000000000--- a/pipes/archive/daily-detailed-activity-reporter/.gitignore+++ /dev/null@@ -1,2 +0,0 @@-node_modules-diff --git a/pipes/archive/daily-detailed-activity-reporter/README.md b/pipes/archive/daily-detailed-activity-reporter/README.mddeleted file mode 100644index 4844c0075..000000000--- a/pipes/archive/daily-detailed-activity-reporter/README.md+++ /dev/null@@ -1,29 +0,0 @@-------```bash-pnpm i-export OPENAI_API_KEY="<your key>"-# or leave empty and use ollama (you will be prompted choice)-pnpx tsx main.ts-```--i don't recommend using openai here, it could use lot of tokens--bad experience with small ollama models (fail function calls)--llama3.1, mistral-nemo are decent (7/13b)-----------diff --git a/pipes/archive/daily-detailed-activity-reporter/main.ts b/pipes/archive/daily-detailed-activity-reporter/main.tsdeleted file mode 100644index 491e0b047..000000000--- a/pipes/archive/daily-detailed-activity-reporter/main.ts+++ /dev/null@@ -1,335 +0,0 @@-import { z } from "zod";-import { createOpenAI } from "@ai-sdk/openai";-import { generateObject, generateText, streamText } from "ai";-import { queryScreenpipe } from "./screenpipe";-// @ts-expect-error-import * as fs from "fs/promises";-import * as readline from "readline";-import { createOllama } from "ollama-ai-provider";--console.log("Starting daily tracker for freelancers");--const TaskSchema = z.object({- topic: z- .string()- .optional()- .describe("The main topic or project area of the task, if identifiable"),- task: z- .string()- .optional()- .describe(- "A brief description of the specific task performed, if identifiable"- ),- unknown: z- .boolean()- .optional()- .describe("Set to true if the task cannot be classified"),-});--interface Task {- topic: string | undefined;- task: string | undefined;- startTime: string;- endTime: string;- duration: number;-}--interface DailyAnalysis {- tasks: Task[];- totalHours: number;-}--async function askForAIProvider(): Promise<{- provider: string;- model?: string;-}> {- const rl = readline.createInterface({- // @ts-expect-error- input: process.stdin,- // @ts-expect-error- output: process.stdout,- });-- const provider = await new Promise<string>((resolve) => {- rl.question(- "Which AI provider do you want to use? (ollama/openai): ",- (answer) => {- resolve(answer.toLowerCase());- }- );- });-- let model: string | undefined;-- if (provider === "ollama") {- model = await new Promise<string>((resolve) => {- rl.question(- "Which Ollama model do you want to use? (we only support models supporting tools: llama3.1, mistral-nemo, etc.): ",- (answer) => {- resolve(answer.toLowerCase());- }- );- });- }-- rl.close();- return { provider, model };-}--async function dailyTracker() {- const { provider: aiProvider, model: ollamaModel } = await askForAIProvider();-- let provider;-- if (aiProvider === "ollama") {- console.log(`Using Ollama as the AI provider with model: ${ollamaModel}`);- console.log(- `Make sure to run \`ollama run ${ollamaModel}\` before running this script.`- );- provider = createOllama({ baseURL: "http://localhost:11434/api" })(- ollamaModel!- );- try {- await fetch(`http://localhost:11434/api/tags`);- } catch (error) {- console.log("error", error);- throw new Error(- "Cannot reach local Ollama instance at http://localhost:11434/api"- );- }- } else if (aiProvider === "openai") {- console.log("Using OpenAI as the AI provider.");- console.log(- "Make sure to set the OPENAI_API_KEY environment variable before running this script."- );- // @ts-expect-error- provider = createOpenAI({ apiKey: process.env.OPENAI_API_KEY })("gpt-4o");- } else {- console.log("Invalid AI provider. Exiting.");- return;- }-- console.log(- "I'm going to crunch your daily activity and come back to you in a minute ..."- );-- try {- await generateText({- model: provider,- tools: {- analyze_daily_activities: {- description: "Analyze daily activities and classify tasks",- parameters: z.object({}),- execute: async () => {- // daily time range- // start time is 12am today- // end time is now- const startTime = new Date();- startTime.setHours(0, 0, 0, 0);- const endTime = new Date();- const startTimeISO = startTime.toISOString();- const endTimeISO = endTime.toISOString();-- console.log(- `Analyzing daily activities: ${startTime} to ${endTime}`- );- let tasks: Task[] = [];- let totalHours = 0;-- const LIMIT = 5;- let offset = 0;- let hasMoreData = true;-- while (hasMoreData) {- console.log(`Fetching data: offset ${offset}, limit ${LIMIT}`);- const result = await queryScreenpipe({- start_time: startTimeISO,- end_time: endTimeISO,- offset: offset,- limit: LIMIT,- content_type: "ocr",- });-- const chunkContent = result.data- .map((entry) => JSON.stringify(entry.content))- .join(" ");-- const classifiedTask = await generateObject({- model: provider,- schema: TaskSchema,- messages: [- {- role: "system",- content: `You are analyzing data from a productivity tool called Screenpipe. It captures screenshots of the user's digital activities throughout the day, including app usage. The tool then uses OCR (Optical Character Recognition) to extract text from these screenshots.--Your task is to classify the following content into a task and topic, considering the context of a worker's typical workday. The content will be text extracted from screenshots, which may include snippets from various applications, websites, or documents the user interacted with.--If you cannot identify a task or topic, set the 'unknown' field to true and other fields to undefined.--Respond with a JSON object containing 'topic' and 'task' fields. Be specific and try to capture the essence of the worker's activity. Note that the OCR process may sometimes produce errors or incomplete text.--Examples of tasks for workers:-{- "topic": "Web Development",- "task": "Debugging a React component"-}-{- "topic": "Client Communication",- "task": "Reading project feedback emails"-}-{- "topic": "Graphic Design",- "task": "Creating logo mockups in Illustrator"-}-{- "topic": "Content Writing",- "task": "Researching SEO keywords for a blog post"-}-{- "topic": "Project Management",- "task": "Updating Trello board with new tasks"-}--Remember, the goal is to help workers understand their time usage and productivity patterns based on their screen activity.`,- },- { role: "user", content: chunkContent },- ],- });-- const data = result.data.sort((a, b) => {- return (- new Date(a.content.timestamp).getTime() -- new Date(b.content.timestamp).getTime()- );- });- // @ts-expect-error- if (process.env.DEBUG) {- console.log(- `data ${JSON.stringify(data)}`- );- }- const firstResultTime = data[0].content.timestamp;- const lastResultTime = data[data.length - 1].content.timestamp;- const task = {- topic: classifiedTask.object.topic,- task: classifiedTask.object.task || "unknown",- startTime: firstResultTime,- endTime: lastResultTime,- duration: Math.max(- 0,- new Date(lastResultTime).getTime() -- new Date(firstResultTime).getTime()- ),- };- console.log(`task ${JSON.stringify(task)}`);-- tasks.push(task);- totalHours += task.duration;-- offset += LIMIT;- hasMoreData = result.data.length === LIMIT;-- console.log(- `Processed ${offset} entries. More data: ${hasMoreData}`- );- }-- const dailyAnalysis: DailyAnalysis = { tasks, totalHours };- await fs.writeFile(- `daily_analysis_${new Date()- .toLocaleDateString("en-US")- .replace(/\//g, "_")}.json`,- JSON.stringify(dailyAnalysis, null, 2)- );- console.log("Daily analysis saved to daily_analysis.json");- return dailyAnalysis;- },- },- stream_response: {- description:- "Stream the final response to the user. Always use this tool to stream the final response to the user.",- parameters: z.object({- response: z- .string()- .describe("The final response to stream to the user"),- }),- execute: async ({ response }) => {- console.log("Streaming response to user");- const { textStream } = await streamText({- model: provider,- messages: [- {- role: "user",- content: response,- },- ],- });-- for await (const chunk of textStream) {- // @ts-expect-error- process.stdout.write(chunk);- }- console.log("\nFinished streaming response");- throw new Error("STREAM_COMPLETE");- },- },- },- toolChoice: "required",- messages: [- {- role: "system",- content: `You are an AI assistant specialized in analyzing daily activities for workers.- This project uses Screenpipe to collect data about the worker's activities throughout the day,- including app usage, browser activity, and other digital interactions.-- Always start by analyzing the data.- Always use the tool stream_response to stream the final response to the user-- Your task is to process this data and provide meaningful insights about how the worker- spent their day. You'll analyze the collected data, classify tasks and topics, and generate- a comprehensive summary of the day's activities.-- Key aspects of the project:- 1. Data collection: Uses Screenpipe to gather information about the user's digital activities.- 2. Task classification: Categorizes activities into tasks and topics.- 3. Daily summary: Provides an overview of time spent on different tasks and topics.-- Your goal is to help workers understand their time usage and productivity patterns.-- Rules:- - Provide a concise yet informative summary of the worker's day- - Highlight the main tasks and topics worked on- - Include the total hours worked- - Offer insights on time management and productivity if applicable- - Be objective and data-driven in your analysis- - Always start by analyzing the data using the tool analyze_daily_activities- - Always use the tool stream_response to stream the final response to the user`,- },- {- role: "user",- content: "Analyze my daily activities and provide a summary.",- },- ],- maxToolRoundtrips: 5,- });- } catch (error) {- if (error instanceof Error && error.message === "STREAM_COMPLETE") {- console.log("Daily tracking completed");- return;- }- throw error;- }-}--const main = async () => {- const startTime = new Date();- console.log(`Starting daily tracker at ${startTime.toISOString()}`);- await dailyTracker();- const endTime = new Date();- console.log(`Daily tracking completed at ${endTime.toISOString()}`);- console.log(- `Total execution time: ${endTime.getTime() - startTime.getTime()}ms`- );-};--main();diff --git a/pipes/archive/daily-detailed-activity-reporter/package.json b/pipes/archive/daily-detailed-activity-reporter/package.jsondeleted file mode 100644index 298147b56..000000000--- a/pipes/archive/daily-detailed-activity-reporter/package.json+++ /dev/null@@ -1,12 +0,0 @@-{- "dependencies": {- "@ai-sdk/openai": "^0.0.40",- "ai": "^3.3.0",- "ollama-ai-provider": "^0.11.0",- "readline": "^1.3.0",- "zod": "^3.23.8"- },- "devDependencies": {- "@types/node": "^22.1.0"- }-}diff --git a/pipes/archive/daily-detailed-activity-reporter/screenpipe.ts b/pipes/archive/daily-detailed-activity-reporter/screenpipe.tsdeleted file mode 100644index 575c9d819..000000000--- a/pipes/archive/daily-detailed-activity-reporter/screenpipe.ts+++ /dev/null@@ -1,91 +0,0 @@-import { z } from "zod";-import { openai } from "@ai-sdk/openai";-import { generateText, streamText } from "ai";-import * as readline from "readline";-import { ollama } from "ollama-ai-provider";--export const screenpipeQuery = z.object({- q: z- .string()- .describe(- "The search query matching exact keywords. Use a single keyword that best matches the user intent. This would match either audio transcription or OCR screen text. Example: do not use 'discuss' the user ask about conversation, this is dumb, won't return any result"- )- .optional(),- content_type: z- .enum(["ocr", "audio", "all"])- .default("all")- .describe(- "The type of content to search for: screenshot data or audio transcriptions"- ),- limit: z- .number()- .default(20)- .describe(- "Number of results to return (default: 20). Don't return more than 50 results as it will be fed to an LLM"- ),- offset: z.number().default(0).describe("Offset for pagination (default: 0)"),- start_time: z- .string()- // 1 hour ago- .default(new Date(Date.now() - 3600000).toISOString())- .describe("Start time for search range in ISO 8601 format"),- end_time: z- .string()- .default(new Date().toISOString())- .describe("End time for search range in ISO 8601 format"),- app_name: z- .string()- .describe(- "The name of the app the user was using. This filter out all audio conversations. Only works with screen text. Use this to filter on the app context that would give context matching the user intent. For example 'cursor'. Use lower case. Browser is usually 'arc', 'chrome', 'safari', etc. Do not use thing like 'mail' because the user use the browser to read the mail."- )- .optional(),-});-export const screenpipeMultiQuery = z.object({- queries: z.array(screenpipeQuery),-});--export async function queryScreenpipeNtimes(- params: z.infer<typeof screenpipeMultiQuery>-) {- console.log(- "Using tool queryScreenpipeNtimes with params:",- JSON.stringify(params)- );- return Promise.all(params.queries.map(queryScreenpipe));-}--// Add this new function to handle screenpipe requests-export async function queryScreenpipe(params: z.infer<typeof screenpipeQuery>) {- try {- console.log("params", params);- const queryParams = new URLSearchParams(- Object.entries({- q: params.q,- offset: params.offset.toString(),- limit: params.limit.toString(),- start_time: params.start_time,- end_time: params.end_time,- content_type: params.content_type,- app_name: params.app_name,- }).filter(([_, v]) => v != null) as [string, string][]- );- console.log("calling screenpipe", JSON.stringify(params));- const response = await fetch(`http://localhost:3030/search?${queryParams}`);- if (!response.ok) {- const text = await response.text();- console.log("error", text);- throw new Error(`HTTP error! status: ${response.status} ${text}`);- }- const result = await response.json();- console.log("result", result.data.length);- // log all without .data- console.log("result", {- ...result,- data: undefined,- });- return result;- } catch (error) {- console.error("Error querying screenpipe:", error);- return null;- }-}diff --git a/pipes/archive/daily-log/.gitignore b/pipes/archive/daily-log/.gitignoredeleted file mode 100644index 8ee1d99a6..000000000--- a/pipes/archive/daily-log/.gitignore+++ /dev/null@@ -1,2 +0,0 @@-node_modules-daily_log*\ No newline at end of filediff --git a/pipes/archive/daily-log/README.md b/pipes/archive/daily-log/README.mddeleted file mode 100644index f5da81809..000000000--- a/pipes/archive/daily-log/README.md+++ /dev/null@@ -1,24 +0,0 @@-----this is quite experimental but a good start if you want to build a daily log of your day---feel free to prompt engineer, works with ollama, openai.--openai works better obviously--make sure to keep the prompt not too big for the LLM (time interval 1-5 min)--### usage--```-pnpm i # or npm i-export OPENAI_API_KEY="<your key>"-# or modify the code to use llama3.1 through ollama (just two lines to uncomment & comment)-npx tsx main.ts-```--running into issues? [will solve your problem in < 15 min call](https://cal.com/louis030195/screenpipe)-diff --git a/pipes/archive/daily-log/main.ts b/pipes/archive/daily-log/main.tsdeleted file mode 100644index e8ff7044b..000000000--- a/pipes/archive/daily-log/main.ts+++ /dev/null@@ -1,178 +0,0 @@-// npx ts-node dailyLogger.ts--import fetch from "node-fetch";-import fs from "fs/promises";-import path from "path";--// const OPENAI_API_URL = "https://api.openai.com/v1/chat/completions";-// const OPENAI_MODEL = "gpt-4o";-// Uncomment the following lines to use Ollama instead-const OPENAI_API_URL = "http://localhost:11434/api/chat";-const OPENAI_MODEL = "llama3.1";--const SCREENPIPE_API_URL = "http://localhost:3030/search";-const LOG_INTERVAL = 1 * 60 * 1000; // 5 minutes in milliseconds--interface ActivityLog {- startTime: string;- endTime: string;- content: string;-}--async function getOpenAIKey(): Promise<string> {- const secretsPath = path.join(process.env.HOME || "", "secrets.json");- try {- const secrets = JSON.parse(await fs.readFile(secretsPath, "utf-8"));- return secrets.OPENAI_API_KEY;- } catch (error) {- return process.env.OPENAI_API_KEY!;- }-}--async function queryScreenpipe(- startTime: string,- endTime: string-): Promise<string> {- const url = `${SCREENPIPE_API_URL}?start_time=${startTime}&end_time=${endTime}&limit=100&content_type=ocr`;- console.log("Querying Screenpipe:", url);- const response = await fetch(url);- const data = await response.json();- return JSON.stringify(data);-}--async function generateLogEntry(- prompt: string,- data: string-): Promise<ActivityLog> {- const openAIKey = await getOpenAIKey();- console.log("Generating log entry...");- const response = await fetch(OPENAI_API_URL, {- method: "POST",- headers: {- "Content-Type": "application/json",- Authorization: `Bearer ${openAIKey}`,- },- body: JSON.stringify({- model: OPENAI_MODEL,- stream: false,- messages: [- {- role: "system",- content: `You are an AI assistant that creates concise and informative log entries based on a person's daily activities. Focus on the aspects the user wants to track.-- Rules:- - YOUR LOGS ARE BASED ON THE DATA YOU RECEIVE WHICH IS THE SCREEN TEXT & AUDIO TRANSCRIPTIONS FROM THE USER COMPUTER- - Do not use '"' around your response- - Date & time now is ${new Date().toISOString()}- - Use short title with max 4 words- - Be concise in the content, if you can use bullet list with times if necessary- - YOUR MESSAGES ARE LESS THAN 4 LINES LONG-- Example of your answer:-- ### 073024 - 9.05 AM - 9.10 AM - Emails & LinkedIn- - 3 min: Scrolled emails- - 2 min: Opened LinkedIn and scrolled posts- `,- },- {- role: "user",- content: `Based on the following data and keeping in mind the user wants to track ${prompt}, create a short log entry with a title and content. Data: ${data}--- AGAIN you are returning ONLY daily log of what the user do, plus tailored to his prompt. Example of your answer:--- ### 073024 - 9.05 AM - 9.10 AM - Emails & LinkedIn- - 3 min: Scrolled emails- - 2 min: Opened LinkedIn and scrolled posts--- This is just an example do not copy this in your answer-- Rules:- - YOUR LOGS ARE BASED ON THE DATA YOU RECEIVE WHICH IS THE SCREEN TEXT & AUDIO TRANSCRIPTIONS FROM THE USER COMPUTER- - Do not use '"' around your response- - Date & time now is ${new Date().toISOString()}- - Use short title with max 4 words- - Be concise in the content, if you can use bullet list with times if necessary- - Despite conciseness, try not to skip important information- - Try to add specifics like "browse twitter" etc.- - YOUR MESSAGES ARE LESS THAN 4 LINES LONG- - Make sure to add times in your message- - Do not copy exactly the example I gave you, base your answer on what the user is doing-- Log?`,- },- ],- }),- });-- const result: any = await response.json();- // if error console log and throw- if (result.error) {- console.error("Error generating log entry:", result.error);- throw new Error(result);- }- // phi3 models are drunk af thats why- const log =- result.choices?.[0]?.message?.content ||- // ollama not respecting openai api- result.message?.content;-- console.log("Log entry generated:", log);-- return {- startTime: new Date(Date.now() - LOG_INTERVAL).toISOString(),- endTime: new Date().toISOString(),- content: log,- };-}--async function appendToLogFile(log: ActivityLog): Promise<void> {- const date = new Date().toISOString().split("T")[0];- const fileName = `daily_log_${date}.md`;- const logEntry = log.content + "\n\n";-- await fs.appendFile(fileName, logEntry);-}--async function startLogging(trackingPrompt: string): Promise<void> {- console.log(`Starting to log activities. Tracking: ${trackingPrompt}`);-- setInterval(async () => {- const endTime = new Date().toISOString();- const startTime = new Date(Date.now() - LOG_INTERVAL).toISOString();-- try {- const screenpipeData = await queryScreenpipe(startTime, endTime);- const logEntry = await generateLogEntry(trackingPrompt, screenpipeData);- await appendToLogFile(logEntry);- console.log(`Log entry added`);- } catch (error) {- console.error("Error generating log entry:", error);- }- }, LOG_INTERVAL);-}--// Main execution-(async () => {- const trackingPrompt = await new Promise<string>((resolve) => {- const readline = require("readline").createInterface({- input: process.stdin,- output: process.stdout,- });-- readline.question(- "What aspects of your day do you want to track? ",- (answer: string) => {- readline.close();- resolve(answer);- }- );- });-- await startLogging(trackingPrompt);-})();--// npx tsx main.tsdiff --git a/pipes/archive/daily-log/package.json b/pipes/archive/daily-log/package.jsondeleted file mode 100644index e353d1845..000000000--- a/pipes/archive/daily-log/package.json+++ /dev/null@@ -1,19 +0,0 @@-{- "name": "daily-log",- "version": "1.0.0",- "description": "",- "main": "index.js",- "scripts": {- "test": "echo \"Error: no test specified\" && exit 1"- },- "keywords": [],- "author": "",- "license": "ISC",- "dependencies": {- "@types/node": "^22.0.0",- "@types/node-fetch": "^2.6.11",- "node-fetch": "^3.3.2",- "ts-node": "^10.9.2",- "typescript": "^5.5.4"- }-}diff --git a/pipes/archive/daily-log/tsconfig.json b/pipes/archive/daily-log/tsconfig.jsondeleted file mode 100644index fb885e1cc..000000000--- a/pipes/archive/daily-log/tsconfig.json+++ /dev/null@@ -1,10 +0,0 @@-{- "compilerOptions": {- "target": "ES2018",- "module": "commonjs",- "strict": true,- "esModuleInterop": true,- "skipLibCheck": true,- "forceConsistentCasingInFileNames": true- }- }\ No newline at end of filediff --git a/pipes/archive/daily-tracker/.gitignore b/pipes/archive/daily-tracker/.gitignoredeleted file mode 100644index a56a7ef43..000000000--- a/pipes/archive/daily-tracker/.gitignore+++ /dev/null@@ -1,2 +0,0 @@-node_modules-diff --git a/pipes/archive/daily-tracker/README.md b/pipes/archive/daily-tracker/README.mddeleted file mode 100644index b87d89517..000000000--- a/pipes/archive/daily-tracker/README.md+++ /dev/null@@ -1,21 +0,0 @@--AI look at your screens & mics 24/7 and gives you insights on how you spend your time--it's just a start, you can go much more in details, it's so easy, you don't even need to know how to code---https://github.com/user-attachments/assets/c242c7af-6238-4c33-b6a2-de8b20333453---```bash-pnpm i-export OPENAI_API_KEY="<your key>"-npx tsx screenpipe.ts-```--[need help?](https://cal.com/louis030195/screenpipe)--[wants me to build something else like this? please let me know](https://github.com/mediar-ai/screenpipe/issues/new?title=example+idea)---diff --git a/pipes/archive/daily-tracker/analysis_result.json b/pipes/archive/daily-tracker/analysis_result.jsondeleted file mode 100644index 28e1cd1a2..000000000--- a/pipes/archive/daily-tracker/analysis_result.json+++ /dev/null@@ -1,14 +0,0 @@-{- "appUsage": {- "window server": 0.03777777777777778,- "arc": 0.7944444444444444,- "obsidian": 0.04055555555555555,- "control centre": 0.017222222222222222,- "cursor": 0.5783333333333334,- "dock": 0.010555555555555556,- "emoji & symbols": 0.0016666666666666668,- "screenshot": 0.0022222222222222222,- "screencapture": 0.0011111111111111111- },- "activities": []-}\ No newline at end of filediff --git a/pipes/archive/daily-tracker/main.ts b/pipes/archive/daily-tracker/main.tsdeleted file mode 100644index 1c1731815..000000000--- a/pipes/archive/daily-tracker/main.ts+++ /dev/null@@ -1,238 +0,0 @@-import { z } from "zod";-import { openai } from "@ai-sdk/openai";-import { generateObject, generateText, streamText } from "ai";-import { queryScreenpipe, ContentType } from "./screenpipe";-import * as fs from "fs/promises";-console.log("Starting daily tracker application");--const CHUNK_SIZE = 5 * 60; // 5 minutes in seconds-console.log(`CHUNK_SIZE set to ${CHUNK_SIZE} seconds`);--const ActivitySchema = z.object({- category: z.string(),- description: z.string(),- duration: z.number(),-});--type Activity = z.infer<typeof ActivitySchema>;--interface Usage {- [key: string]: number;-}--interface AnalysisResult {- appUsage: Usage;- activities: Activity[];-}--const analyzeTimeRangeSchema = z.object({- startTime: z.string(),- endTime: z.string(),-});--const generateSummarySchema = z.object({- analysisResult: z.any(),-});--const streamResponseSchema = z.object({- response: z.string(),-});--async function timeTracker(userInput: string) {- console.log(`Starting timeTracker with user input: "${userInput}"`);- try {- const text = await generateText({- model: openai("gpt-4o"),- tools: {- analyze_time_range: {- description:- "Analyze app usage and activities within a given time range",- parameters: analyzeTimeRangeSchema,- execute: async ({ startTime, endTime }) => {- console.log(`Analyzing time range: ${startTime} to ${endTime}`);- let appUsage: Usage = {};- let activities: Activity[] = [];-- // Use the current local date- const now = new Date();- const startOfDay = new Date(now.setHours(0, 0, 0, 0));- const endOfDay = new Date(now.setHours(23, 59, 59, 999));-- let currentTime = startOfDay;- const endTimeDate = endOfDay;-- while (currentTime < endTimeDate) {- const chunkEnd = new Date(- Math.min(- currentTime.getTime() + CHUNK_SIZE * 1000,- endTimeDate.getTime()- )- );- console.log(- `Querying Screenpipe for chunk: ${currentTime.toISOString()} to ${chunkEnd.toISOString()}`- );- const chunkData = await queryScreenpipe({- start_time: currentTime.toISOString(),- end_time: chunkEnd.toISOString(),- offset: 0,- limit: 1000,- content_type: "all" as ContentType,- });-- console.log(- `Received ${chunkData.data.length} entries from Screenpipe`- );- for (const entry of chunkData.data) {- if (entry.type === "OCR") {- const app = entry.content.app_name.toLowerCase();- appUsage[app] = (appUsage[app] || 0) + 1;- }- }- currentTime = chunkEnd;- }-- appUsage = Object.fromEntries(- Object.entries(appUsage).map(([app, seconds]) => [- app,- seconds / 3600,- ])- );-- console.log("App usage analysis completed");- console.log("App usage summary:", appUsage);-- const analysisResult: AnalysisResult = { appUsage, activities };- await fs.writeFile(- "analysis_result.json",- JSON.stringify(analysisResult, null, 2)- );- console.log("Analysis result saved to analysis_result.json");- return analysisResult;- },- },- generate_summary: {- description:- "Generate a summary of time usage based on the analysis result",- parameters: generateSummarySchema,- execute: async ({ analysisResult }) => {- console.log("Generating summary from analysis result");- const { appUsage, activities } = analysisResult;- const topApps = Object.entries(appUsage)- .sort((a, b) => b[1] - a[1])- .slice(0, 5);-- const categorySummary = activities.reduce((acc, activity) => {- acc[activity.category] =- (acc[activity.category] || 0) + activity.duration;- return acc;- }, {} as Usage);-- const topCategories = Object.entries(categorySummary)- .sort((a, b) => b[1] - a[1])- .slice(0, 5);-- console.log("Top 5 apps:", topApps);- console.log("Top 5 categories:", topCategories);-- const prompt = `- Based on the following data:-- Top 5 apps used (in hours, need to multiply by 10):- ${JSON.stringify(topApps)}-- Top 5 activity categories (in seconds):- ${JSON.stringify(topCategories)}-- Provide a summary of how the user spent their time this week.- Focus on answering the question: "What's the thing I spend the most time on this week?"- Include insights about both app usage and activity categories.- Be concise but informative.- `;-- console.log("Sending prompt to GPT-4 for summary generation");- return generateText({- model: openai("gpt-4o"),- messages: [{ role: "user", content: prompt }],- });- },- },- stream_response: {- description: "Stream the final response to the user",- parameters: streamResponseSchema,- execute: async ({ response }) => {- console.log("Streaming response to user");- const { textStream } = await streamText({- model: openai("gpt-4o"),- messages: [- {- role: "user",- content: response,- },- ],- });-- let buffer = "";- const flushBuffer = () => {- if (buffer) {- process.stdout.write(buffer);- buffer = "";- }- };-- for await (const chunk of textStream) {- buffer += chunk;- if (buffer.includes(" ") && buffer.length > 20) {- flushBuffer();- }- }- flushBuffer(); // Flush any remaining content- console.log("\nFinished streaming response");- throw new Error("STREAM_COMPLETE");- },- },- },- toolChoice: "required",- messages: [- {- role: "system",- content: `You are a helpful assistant that analyzes time usage data.- The user wants to know what they spent the most time on this week.- Use the provided tools to analyze the data and generate a summary.- Maintain and update the analysis result in the JSON file throughout the process.- Always use the stream_response tool to output the final result to the user. Stop after streaming your final response.-- Rules:- - Do not use Markdown as the answer will be streamed in a terminal`,- },- {- role: "user",- content: userInput,- },- ],- maxToolRoundtrips: 5,- });-- console.log("Final response from GPT-4:", text);- } catch (error) {- if (error instanceof Error && error.message === "STREAM_COMPLETE") {- console.log("Streaming completed, exiting timeTracker");- return;- }- throw error; // Re-throw other errors- }-}--const main = async () => {- // Example usage- const startTime = new Date();- console.log(`Starting example usage at ${startTime.toISOString()}`);- await timeTracker("What did I spend the most time on this week?");- console.log("Example usage completed");- const endTime = new Date();- console.log(`Example usage completed at ${endTime.toISOString()}`);- console.log(- `Example usage took ${endTime.getTime() - startTime.getTime()}ms`- );-};--main();diff --git a/pipes/archive/daily-tracker/package-lock.json b/pipes/archive/daily-tracker/package-lock.jsondeleted file mode 100644index ca9fd342b..000000000--- a/pipes/archive/daily-tracker/package-lock.json+++ /dev/null@@ -1,1092 +0,0 @@-{- "name": "daily-tracker",- "lockfileVersion": 3,- "requires": true,- "packages": {- "": {- "dependencies": {- "@ai-sdk/openai": "^0.0.40",- "ai": "^3.3.0",- "readline": "^1.3.0",- "zod": "^3.23.8"- },- "devDependencies": {- "@types/node": "^22.1.0"- }- },- "node_modules/@ai-sdk/openai": {- "version": "0.0.40",- "resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-0.0.40.tgz",- "integrity": "sha512-9Iq1UaBHA5ZzNv6j3govuKGXrbrjuWvZIgWNJv4xzXlDMHu9P9hnqlBr/Aiay54WwCuTVNhTzAUTfFgnTs2kbQ==",- "dependencies": {- "@ai-sdk/provider": "0.0.14",- "@ai-sdk/provider-utils": "1.0.5"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "zod": "^3.0.0"- }- },- "node_modules/@ai-sdk/provider": {- "version": "0.0.14",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-0.0.14.tgz",- "integrity": "sha512-gaQ5Y033nro9iX1YUjEDFDRhmMcEiCk56LJdIUbX5ozEiCNCfpiBpEqrjSp/Gp5RzBS2W0BVxfG7UGW6Ezcrzg==",- "dependencies": {- "json-schema": "0.4.0"- },- "engines": {- "node": ">=18"- }- },- "node_modules/@ai-sdk/provider-utils": {- "version": "1.0.5",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-1.0.5.tgz",- "integrity": "sha512-XfOawxk95X3S43arn2iQIFyWGMi0DTxsf9ETc6t7bh91RPWOOPYN1tsmS5MTKD33OGJeaDQ/gnVRzXUCRBrckQ==",- "dependencies": {- "@ai-sdk/provider": "0.0.14",- "eventsource-parser": "1.1.2",- "nanoid": "3.3.6",- "secure-json-parse": "2.7.0"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "zod": "^3.0.0"- },- "peerDependenciesMeta": {- "zod": {- "optional": true- }- }- },- "node_modules/@ai-sdk/react": {- "version": "0.0.45",- "resolved": "https://registry.npmjs.org/@ai-sdk/react/-/react-0.0.45.tgz",- "integrity": "sha512-rPsjHtJ+qsWoRV88xzEpvPXhqRBF2wljGjWrsFcao4p48hKwZkuhW/zzpxZj3A4ZPy6jpDHRTYtqMuPHVpc9Eg==",- "dependencies": {- "@ai-sdk/provider-utils": "1.0.13",- "@ai-sdk/ui-utils": "0.0.33",- "swr": "2.2.5"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "react": "^18 || ^19",- "zod": "^3.0.0"- },- "peerDependenciesMeta": {- "react": {- "optional": true- },- "zod": {- "optional": true- }- }- },- "node_modules/@ai-sdk/react/node_modules/@ai-sdk/provider": {- "version": "0.0.20",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-0.0.20.tgz",- "integrity": "sha512-nCQZRUTi/+y+kf1ep9rujpbQEtsIwySzlQAudiFeVhzzDi9rYvWp5tOSVu8/ArT+i1xSc2tw40akxb1TX73ofQ==",- "dependencies": {- "json-schema": "0.4.0"- },- "engines": {- "node": ">=18"- }- },- "node_modules/@ai-sdk/react/node_modules/@ai-sdk/provider-utils": {- "version": "1.0.13",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-1.0.13.tgz",- "integrity": "sha512-NDQUUBDQoWk9aGn2pOA5wiM5CdO57KeYTEph7PpKGEU8IyqI0d+CiYKISOia6Omy17d+Dw/ZM6KP98F89BGJ5A==",- "dependencies": {- "@ai-sdk/provider": "0.0.20",- "eventsource-parser": "1.1.2",- "nanoid": "3.3.6",- "secure-json-parse": "2.7.0"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "zod": "^3.0.0"- },- "peerDependenciesMeta": {- "zod": {- "optional": true- }- }- },- "node_modules/@ai-sdk/solid": {- "version": "0.0.36",- "resolved": "https://registry.npmjs.org/@ai-sdk/solid/-/solid-0.0.36.tgz",- "integrity": "sha512-pm57goMQczSpPTNrUrwbab5BybZYofBRZ10UkTi2KgJP5i+S/sGHSh/xtgZz+xNpUt42pk8aYvOiNDN1ppjkDA==",- "dependencies": {- "@ai-sdk/provider-utils": "1.0.13",- "@ai-sdk/ui-utils": "0.0.33"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "solid-js": "^1.7.7"- },- "peerDependenciesMeta": {- "solid-js": {- "optional": true- }- }- },- "node_modules/@ai-sdk/solid/node_modules/@ai-sdk/provider": {- "version": "0.0.20",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-0.0.20.tgz",- "integrity": "sha512-nCQZRUTi/+y+kf1ep9rujpbQEtsIwySzlQAudiFeVhzzDi9rYvWp5tOSVu8/ArT+i1xSc2tw40akxb1TX73ofQ==",- "dependencies": {- "json-schema": "0.4.0"- },- "engines": {- "node": ">=18"- }- },- "node_modules/@ai-sdk/solid/node_modules/@ai-sdk/provider-utils": {- "version": "1.0.13",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-1.0.13.tgz",- "integrity": "sha512-NDQUUBDQoWk9aGn2pOA5wiM5CdO57KeYTEph7PpKGEU8IyqI0d+CiYKISOia6Omy17d+Dw/ZM6KP98F89BGJ5A==",- "dependencies": {- "@ai-sdk/provider": "0.0.20",- "eventsource-parser": "1.1.2",- "nanoid": "3.3.6",- "secure-json-parse": "2.7.0"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "zod": "^3.0.0"- },- "peerDependenciesMeta": {- "zod": {- "optional": true- }- }- },- "node_modules/@ai-sdk/svelte": {- "version": "0.0.38",- "resolved": "https://registry.npmjs.org/@ai-sdk/svelte/-/svelte-0.0.38.tgz",- "integrity": "sha512-sTNkxzhS1B0TDdVWZR6yXG+3qQGYAxMwcEKzMVjm1VdpGlZits1PxF39aVvPldaWM8QB4MrVE+H5b5dTA43D0Q==",- "dependencies": {- "@ai-sdk/provider-utils": "1.0.13",- "@ai-sdk/ui-utils": "0.0.33",- "sswr": "2.1.0"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "svelte": "^3.0.0 || ^4.0.0"- },- "peerDependenciesMeta": {- "svelte": {- "optional": true- }- }- },- "node_modules/@ai-sdk/svelte/node_modules/@ai-sdk/provider": {- "version": "0.0.20",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-0.0.20.tgz",- "integrity": "sha512-nCQZRUTi/+y+kf1ep9rujpbQEtsIwySzlQAudiFeVhzzDi9rYvWp5tOSVu8/ArT+i1xSc2tw40akxb1TX73ofQ==",- "dependencies": {- "json-schema": "0.4.0"- },- "engines": {- "node": ">=18"- }- },- "node_modules/@ai-sdk/svelte/node_modules/@ai-sdk/provider-utils": {- "version": "1.0.13",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-1.0.13.tgz",- "integrity": "sha512-NDQUUBDQoWk9aGn2pOA5wiM5CdO57KeYTEph7PpKGEU8IyqI0d+CiYKISOia6Omy17d+Dw/ZM6KP98F89BGJ5A==",- "dependencies": {- "@ai-sdk/provider": "0.0.20",- "eventsource-parser": "1.1.2",- "nanoid": "3.3.6",- "secure-json-parse": "2.7.0"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "zod": "^3.0.0"- },- "peerDependenciesMeta": {- "zod": {- "optional": true- }- }- },- "node_modules/@ai-sdk/ui-utils": {- "version": "0.0.33",- "resolved": "https://registry.npmjs.org/@ai-sdk/ui-utils/-/ui-utils-0.0.33.tgz",- "integrity": "sha512-2oZjZzZG3AGQihO1d3mWqgFuywTtjBtkUEeE7d8nicw3QQv9m1MwrbQqRhhKbbBetBke6V9o5FQ5wngmb/+3iw==",- "dependencies": {- "@ai-sdk/provider": "0.0.20",- "@ai-sdk/provider-utils": "1.0.13",- "json-schema": "0.4.0",- "secure-json-parse": "2.7.0",- "zod-to-json-schema": "3.22.5"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "zod": "^3.0.0"- },- "peerDependenciesMeta": {- "zod": {- "optional": true- }- }- },- "node_modules/@ai-sdk/ui-utils/node_modules/@ai-sdk/provider": {- "version": "0.0.20",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-0.0.20.tgz",- "integrity": "sha512-nCQZRUTi/+y+kf1ep9rujpbQEtsIwySzlQAudiFeVhzzDi9rYvWp5tOSVu8/ArT+i1xSc2tw40akxb1TX73ofQ==",- "dependencies": {- "json-schema": "0.4.0"- },- "engines": {- "node": ">=18"- }- },- "node_modules/@ai-sdk/ui-utils/node_modules/@ai-sdk/provider-utils": {- "version": "1.0.13",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-1.0.13.tgz",- "integrity": "sha512-NDQUUBDQoWk9aGn2pOA5wiM5CdO57KeYTEph7PpKGEU8IyqI0d+CiYKISOia6Omy17d+Dw/ZM6KP98F89BGJ5A==",- "dependencies": {- "@ai-sdk/provider": "0.0.20",- "eventsource-parser": "1.1.2",- "nanoid": "3.3.6",- "secure-json-parse": "2.7.0"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "zod": "^3.0.0"- },- "peerDependenciesMeta": {- "zod": {- "optional": true- }- }- },- "node_modules/@ai-sdk/vue": {- "version": "0.0.37",- "resolved": "https://registry.npmjs.org/@ai-sdk/vue/-/vue-0.0.37.tgz",- "integrity": "sha512-m7dMi6qRoWPuru9TyWUm5jXAPGSDb1SHZp/Q+uYjhNY1dZwgsZxJvSeakogzR37uhiRCg3Kg8fCypQJe+dikPA==",- "dependencies": {- "@ai-sdk/provider-utils": "1.0.13",- "@ai-sdk/ui-utils": "0.0.33",- "swrv": "1.0.4"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "vue": "^3.3.4"- },- "peerDependenciesMeta": {- "vue": {- "optional": true- }- }- },- "node_modules/@ai-sdk/vue/node_modules/@ai-sdk/provider": {- "version": "0.0.20",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-0.0.20.tgz",- "integrity": "sha512-nCQZRUTi/+y+kf1ep9rujpbQEtsIwySzlQAudiFeVhzzDi9rYvWp5tOSVu8/ArT+i1xSc2tw40akxb1TX73ofQ==",- "dependencies": {- "json-schema": "0.4.0"- },- "engines": {- "node": ">=18"- }- },- "node_modules/@ai-sdk/vue/node_modules/@ai-sdk/provider-utils": {- "version": "1.0.13",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-1.0.13.tgz",- "integrity": "sha512-NDQUUBDQoWk9aGn2pOA5wiM5CdO57KeYTEph7PpKGEU8IyqI0d+CiYKISOia6Omy17d+Dw/ZM6KP98F89BGJ5A==",- "dependencies": {- "@ai-sdk/provider": "0.0.20",- "eventsource-parser": "1.1.2",- "nanoid": "3.3.6",- "secure-json-parse": "2.7.0"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "zod": "^3.0.0"- },- "peerDependenciesMeta": {- "zod": {- "optional": true- }- }- },- "node_modules/@ampproject/remapping": {- "version": "2.3.0",- "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",- "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",- "peer": true,- "dependencies": {- "@jridgewell/gen-mapping": "^0.3.5",- "@jridgewell/trace-mapping": "^0.3.24"- },- "engines": {- "node": ">=6.0.0"- }- },- "node_modules/@babel/helper-string-parser": {- "version": "7.24.8",- "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz",- "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==",- "peer": true,- "engines": {- "node": ">=6.9.0"- }- },- "node_modules/@babel/helper-validator-identifier": {- "version": "7.24.7",- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz",- "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==",- "peer": true,- "engines": {- "node": ">=6.9.0"- }- },- "node_modules/@babel/parser": {- "version": "7.25.3",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz",- "integrity": "sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==",- "peer": true,- "dependencies": {- "@babel/types": "^7.25.2"- },- "bin": {- "parser": "bin/babel-parser.js"- },- "engines": {- "node": ">=6.0.0"- }- },- "node_modules/@babel/types": {- "version": "7.25.2",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz",- "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==",- "peer": true,- "dependencies": {- "@babel/helper-string-parser": "^7.24.8",- "@babel/helper-validator-identifier": "^7.24.7",- "to-fast-properties": "^2.0.0"- },- "engines": {- "node": ">=6.9.0"- }- },- "node_modules/@jridgewell/gen-mapping": {- "version": "0.3.5",- "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",- "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==",- "peer": true,- "dependencies": {- "@jridgewell/set-array": "^1.2.1",- "@jridgewell/sourcemap-codec": "^1.4.10",- "@jridgewell/trace-mapping": "^0.3.24"- },- "engines": {- "node": ">=6.0.0"- }- },- "node_modules/@jridgewell/resolve-uri": {- "version": "3.1.2",- "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",- "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",- "peer": true,- "engines": {- "node": ">=6.0.0"- }- },- "node_modules/@jridgewell/set-array": {- "version": "1.2.1",- "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",- "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",- "peer": true,- "engines": {- "node": ">=6.0.0"- }- },- "node_modules/@jridgewell/sourcemap-codec": {- "version": "1.5.0",- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",- "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",- "peer": true- },- "node_modules/@jridgewell/trace-mapping": {- "version": "0.3.25",- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",- "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",- "peer": true,- "dependencies": {- "@jridgewell/resolve-uri": "^3.1.0",- "@jridgewell/sourcemap-codec": "^1.4.14"- }- },- "node_modules/@opentelemetry/api": {- "version": "1.9.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz",- "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==",- "engines": {- "node": ">=8.0.0"- }- },- "node_modules/@types/diff-match-patch": {- "version": "1.0.36",- "resolved": "https://registry.npmjs.org/@types/diff-match-patch/-/diff-match-patch-1.0.36.tgz",- "integrity": "sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg=="- },- "node_modules/@types/estree": {- "version": "1.0.5",- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",- "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",- "peer": true- },- "node_modules/@types/node": {- "version": "22.4.0",- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.4.0.tgz",- "integrity": "sha512-49AbMDwYUz7EXxKU/r7mXOsxwFr4BYbvB7tWYxVuLdb2ibd30ijjXINSMAHiEEZk5PCRBmW1gUeisn2VMKt3cQ==",- "dev": true,- "dependencies": {- "undici-types": "~6.19.2"- }- },- "node_modules/@vue/compiler-core": {- "version": "3.4.38",- "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.38.tgz",- "integrity": "sha512-8IQOTCWnLFqfHzOGm9+P8OPSEDukgg3Huc92qSG49if/xI2SAwLHQO2qaPQbjCWPBcQoO1WYfXfTACUrWV3c5A==",- "peer": true,- "dependencies": {- "@babel/parser": "^7.24.7",- "@vue/shared": "3.4.38",- "entities": "^4.5.0",- "estree-walker": "^2.0.2",- "source-map-js": "^1.2.0"- }- },- "node_modules/@vue/compiler-core/node_modules/estree-walker": {- "version": "2.0.2",- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",- "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",- "peer": true- },- "node_modules/@vue/compiler-dom": {- "version": "3.4.38",- "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.38.tgz",- "integrity": "sha512-Osc/c7ABsHXTsETLgykcOwIxFktHfGSUDkb05V61rocEfsFDcjDLH/IHJSNJP+/Sv9KeN2Lx1V6McZzlSb9EhQ==",- "peer": true,- "dependencies": {- "@vue/compiler-core": "3.4.38",- "@vue/shared": "3.4.38"- }- },- "node_modules/@vue/compiler-sfc": {- "version": "3.4.38",- "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.38.tgz",- "integrity": "sha512-s5QfZ+9PzPh3T5H4hsQDJtI8x7zdJaew/dCGgqZ2630XdzaZ3AD8xGZfBqpT8oaD/p2eedd+pL8tD5vvt5ZYJQ==",- "peer": true,- "dependencies": {- "@babel/parser": "^7.24.7",- "@vue/compiler-core": "3.4.38",- "@vue/compiler-dom": "3.4.38",- "@vue/compiler-ssr": "3.4.38",- "@vue/shared": "3.4.38",- "estree-walker": "^2.0.2",- "magic-string": "^0.30.10",- "postcss": "^8.4.40",- "source-map-js": "^1.2.0"- }- },- "node_modules/@vue/compiler-sfc/node_modules/estree-walker": {- "version": "2.0.2",- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",- "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",- "peer": true- },- "node_modules/@vue/compiler-ssr": {- "version": "3.4.38",- "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.38.tgz",- "integrity": "sha512-YXznKFQ8dxYpAz9zLuVvfcXhc31FSPFDcqr0kyujbOwNhlmaNvL2QfIy+RZeJgSn5Fk54CWoEUeW+NVBAogGaw==",- "peer": true,- "dependencies": {- "@vue/compiler-dom": "3.4.38",- "@vue/shared": "3.4.38"- }- },- "node_modules/@vue/reactivity": {- "version": "3.4.38",- "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.38.tgz",- "integrity": "sha512-4vl4wMMVniLsSYYeldAKzbk72+D3hUnkw9z8lDeJacTxAkXeDAP1uE9xr2+aKIN0ipOL8EG2GPouVTH6yF7Gnw==",- "peer": true,- "dependencies": {- "@vue/shared": "3.4.38"- }- },- "node_modules/@vue/runtime-core": {- "version": "3.4.38",- "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.38.tgz",- "integrity": "sha512-21z3wA99EABtuf+O3IhdxP0iHgkBs1vuoCAsCKLVJPEjpVqvblwBnTj42vzHRlWDCyxu9ptDm7sI2ZMcWrQqlA==",- "peer": true,- "dependencies": {- "@vue/reactivity": "3.4.38",- "@vue/shared": "3.4.38"- }- },- "node_modules/@vue/runtime-dom": {- "version": "3.4.38",- "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.38.tgz",- "integrity": "sha512-afZzmUreU7vKwKsV17H1NDThEEmdYI+GCAK/KY1U957Ig2NATPVjCROv61R19fjZNzMmiU03n79OMnXyJVN0UA==",- "peer": true,- "dependencies": {- "@vue/reactivity": "3.4.38",- "@vue/runtime-core": "3.4.38",- "@vue/shared": "3.4.38",- "csstype": "^3.1.3"- }- },- "node_modules/@vue/server-renderer": {- "version": "3.4.38",- "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.38.tgz",- "integrity": "sha512-NggOTr82FbPEkkUvBm4fTGcwUY8UuTsnWC/L2YZBmvaQ4C4Jl/Ao4HHTB+l7WnFCt5M/dN3l0XLuyjzswGYVCA==",- "peer": true,- "dependencies": {- "@vue/compiler-ssr": "3.4.38",- "@vue/shared": "3.4.38"- },- "peerDependencies": {- "vue": "3.4.38"- }- },- "node_modules/@vue/shared": {- "version": "3.4.38",- "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.38.tgz",- "integrity": "sha512-q0xCiLkuWWQLzVrecPb0RMsNWyxICOjPrcrwxTUEHb1fsnvni4dcuyG7RT/Ie7VPTvnjzIaWzRMUBsrqNj/hhw==",- "peer": true- },- "node_modules/acorn": {- "version": "8.12.1",- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",- "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",- "peer": true,- "bin": {- "acorn": "bin/acorn"- },- "engines": {- "node": ">=0.4.0"- }- },- "node_modules/ai": {- "version": "3.3.9",- "resolved": "https://registry.npmjs.org/ai/-/ai-3.3.9.tgz",- "integrity": "sha512-PS6xHzYIH+iVLG3xd/jwsqZW7+X8GrSrsJwVB4ACMbxhZN8KRs4yUcnGEDPcvRkEL3PqHHJFUo9iVysdZwOUwg==",- "dependencies": {- "@ai-sdk/provider": "0.0.20",- "@ai-sdk/provider-utils": "1.0.13",- "@ai-sdk/react": "0.0.45",- "@ai-sdk/solid": "0.0.36",- "@ai-sdk/svelte": "0.0.38",- "@ai-sdk/ui-utils": "0.0.33",- "@ai-sdk/vue": "0.0.37",- "@opentelemetry/api": "1.9.0",- "eventsource-parser": "1.1.2",- "json-schema": "0.4.0",- "jsondiffpatch": "0.6.0",- "nanoid": "3.3.6",- "secure-json-parse": "2.7.0",- "zod-to-json-schema": "3.22.5"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "openai": "^4.42.0",- "react": "^18 || ^19",- "sswr": "^2.1.0",- "svelte": "^3.0.0 || ^4.0.0",- "zod": "^3.0.0"- },- "peerDependenciesMeta": {- "openai": {- "optional": true- },- "react": {- "optional": true- },- "sswr": {- "optional": true- },- "svelte": {- "optional": true- },- "zod": {- "optional": true- }- }- },- "node_modules/ai/node_modules/@ai-sdk/provider": {- "version": "0.0.20",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-0.0.20.tgz",- "integrity": "sha512-nCQZRUTi/+y+kf1ep9rujpbQEtsIwySzlQAudiFeVhzzDi9rYvWp5tOSVu8/ArT+i1xSc2tw40akxb1TX73ofQ==",- "dependencies": {- "json-schema": "0.4.0"- },- "engines": {- "node": ">=18"- }- },- "node_modules/ai/node_modules/@ai-sdk/provider-utils": {- "version": "1.0.13",- "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-1.0.13.tgz",- "integrity": "sha512-NDQUUBDQoWk9aGn2pOA5wiM5CdO57KeYTEph7PpKGEU8IyqI0d+CiYKISOia6Omy17d+Dw/ZM6KP98F89BGJ5A==",- "dependencies": {- "@ai-sdk/provider": "0.0.20",- "eventsource-parser": "1.1.2",- "nanoid": "3.3.6",- "secure-json-parse": "2.7.0"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "zod": "^3.0.0"- },- "peerDependenciesMeta": {- "zod": {- "optional": true- }- }- },- "node_modules/aria-query": {- "version": "5.3.0",- "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",- "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",- "peer": true,- "dependencies": {- "dequal": "^2.0.3"- }- },- "node_modules/axobject-query": {- "version": "4.1.0",- "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz",- "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==",- "peer": true,- "engines": {- "node": ">= 0.4"- }- },- "node_modules/chalk": {- "version": "5.3.0",- "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz",- "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==",- "engines": {- "node": "^12.17.0 || ^14.13 || >=16.0.0"- },- "funding": {- "url": "https://github.com/chalk/chalk?sponsor=1"- }- },- "node_modules/client-only": {- "version": "0.0.1",- "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz",- "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="- },- "node_modules/code-red": {- "version": "1.0.4",- "resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz",- "integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==",- "peer": true,- "dependencies": {- "@jridgewell/sourcemap-codec": "^1.4.15",- "@types/estree": "^1.0.1",- "acorn": "^8.10.0",- "estree-walker": "^3.0.3",- "periscopic": "^3.1.0"- }- },- "node_modules/css-tree": {- "version": "2.3.1",- "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",- "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",- "peer": true,- "dependencies": {- "mdn-data": "2.0.30",- "source-map-js": "^1.0.1"- },- "engines": {- "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"- }- },- "node_modules/csstype": {- "version": "3.1.3",- "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",- "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",- "peer": true- },- "node_modules/dequal": {- "version": "2.0.3",- "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",- "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",- "peer": true,- "engines": {- "node": ">=6"- }- },- "node_modules/diff-match-patch": {- "version": "1.0.5",- "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.5.tgz",- "integrity": "sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw=="- },- "node_modules/entities": {- "version": "4.5.0",- "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",- "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",- "peer": true,- "engines": {- "node": ">=0.12"- },- "funding": {- "url": "https://github.com/fb55/entities?sponsor=1"- }- },- "node_modules/estree-walker": {- "version": "3.0.3",- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",- "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",- "peer": true,- "dependencies": {- "@types/estree": "^1.0.0"- }- },- "node_modules/eventsource-parser": {- "version": "1.1.2",- "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-1.1.2.tgz",- "integrity": "sha512-v0eOBUbiaFojBu2s2NPBfYUoRR9GjcDNvCXVaqEf5vVfpIAh9f8RCo4vXTP8c63QRKCFwoLpMpTdPwwhEKVgzA==",- "engines": {- "node": ">=14.18"- }- },- "node_modules/is-reference": {- "version": "3.0.2",- "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz",- "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==",- "peer": true,- "dependencies": {- "@types/estree": "*"- }- },- "node_modules/js-tokens": {- "version": "4.0.0",- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",- "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",- "peer": true- },- "node_modules/json-schema": {- "version": "0.4.0",- "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",- "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="- },- "node_modules/jsondiffpatch": {- "version": "0.6.0",- "resolved": "https://registry.npmjs.org/jsondiffpatch/-/jsondiffpatch-0.6.0.tgz",- "integrity": "sha512-3QItJOXp2AP1uv7waBkao5nCvhEv+QmJAd38Ybq7wNI74Q+BBmnLn4EDKz6yI9xGAIQoUF87qHt+kc1IVxB4zQ==",- "dependencies": {- "@types/diff-match-patch": "^1.0.36",- "chalk": "^5.3.0",- "diff-match-patch": "^1.0.5"- },- "bin": {- "jsondiffpatch": "bin/jsondiffpatch.js"- },- "engines": {- "node": "^18.0.0 || >=20.0.0"- }- },- "node_modules/locate-character": {- "version": "3.0.0",- "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",- "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",- "peer": true- },- "node_modules/loose-envify": {- "version": "1.4.0",- "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",- "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",- "peer": true,- "dependencies": {- "js-tokens": "^3.0.0 || ^4.0.0"- },- "bin": {- "loose-envify": "cli.js"- }- },- "node_modules/magic-string": {- "version": "0.30.11",- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz",- "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==",- "peer": true,- "dependencies": {- "@jridgewell/sourcemap-codec": "^1.5.0"- }- },- "node_modules/mdn-data": {- "version": "2.0.30",- "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",- "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",- "peer": true- },- "node_modules/nanoid": {- "version": "3.3.6",- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",- "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",- "funding": [- {- "type": "github",- "url": "https://github.com/sponsors/ai"- }- ],- "bin": {- "nanoid": "bin/nanoid.cjs"- },- "engines": {- "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"- }- },- "node_modules/periscopic": {- "version": "3.1.0",- "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz",- "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==",- "peer": true,- "dependencies": {- "@types/estree": "^1.0.0",- "estree-walker": "^3.0.0",- "is-reference": "^3.0.0"- }- },- "node_modules/picocolors": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",- "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==",- "peer": true- },- "node_modules/postcss": {- "version": "8.4.41",- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz",- "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==",- "funding": [- {- "type": "opencollective",- "url": "https://opencollective.com/postcss/"- },- {- "type": "tidelift",- "url": "https://tidelift.com/funding/github/npm/postcss"- },- {- "type": "github",- "url": "https://github.com/sponsors/ai"- }- ],- "peer": true,- "dependencies": {- "nanoid": "^3.3.7",- "picocolors": "^1.0.1",- "source-map-js": "^1.2.0"- },- "engines": {- "node": "^10 || ^12 || >=14"- }- },- "node_modules/postcss/node_modules/nanoid": {- "version": "3.3.7",- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",- "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",- "funding": [- {- "type": "github",- "url": "https://github.com/sponsors/ai"- }- ],- "peer": true,- "bin": {- "nanoid": "bin/nanoid.cjs"- },- "engines": {- "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"- }- },- "node_modules/react": {- "version": "18.3.1",- "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",- "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",- "peer": true,- "dependencies": {- "loose-envify": "^1.1.0"- },- "engines": {- "node": ">=0.10.0"- }- },- "node_modules/readline": {- "version": "1.3.0",- "resolved": "https://registry.npmjs.org/readline/-/readline-1.3.0.tgz",- "integrity": "sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg=="- },- "node_modules/secure-json-parse": {- "version": "2.7.0",- "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz",- "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw=="- },- "node_modules/source-map-js": {- "version": "1.2.0",- "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",- "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",- "peer": true,- "engines": {- "node": ">=0.10.0"- }- },- "node_modules/sswr": {- "version": "2.1.0",- "resolved": "https://registry.npmjs.org/sswr/-/sswr-2.1.0.tgz",- "integrity": "sha512-Cqc355SYlTAaUt8iDPaC/4DPPXK925PePLMxyBKuWd5kKc5mwsG3nT9+Mq2tyguL5s7b4Jg+IRMpTRsNTAfpSQ==",- "dependencies": {- "swrev": "^4.0.0"- },- "peerDependencies": {- "svelte": "^4.0.0 || ^5.0.0-next.0"- }- },- "node_modules/svelte": {- "version": "4.2.18",- "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.18.tgz",- "integrity": "sha512-d0FdzYIiAePqRJEb90WlJDkjUEx42xhivxN8muUBmfZnP+tzUgz12DJ2hRJi8sIHCME7jeK1PTMgKPSfTd8JrA==",- "peer": true,- "dependencies": {- "@ampproject/remapping": "^2.2.1",- "@jridgewell/sourcemap-codec": "^1.4.15",- "@jridgewell/trace-mapping": "^0.3.18",- "@types/estree": "^1.0.1",- "acorn": "^8.9.0",- "aria-query": "^5.3.0",- "axobject-query": "^4.0.0",- "code-red": "^1.0.3",- "css-tree": "^2.3.1",- "estree-walker": "^3.0.3",- "is-reference": "^3.0.1",- "locate-character": "^3.0.0",- "magic-string": "^0.30.4",- "periscopic": "^3.1.0"- },- "engines": {- "node": ">=16"- }- },- "node_modules/swr": {- "version": "2.2.5",- "resolved": "https://registry.npmjs.org/swr/-/swr-2.2.5.tgz",- "integrity": "sha512-QtxqyclFeAsxEUeZIYmsaQ0UjimSq1RZ9Un7I68/0ClKK/U3LoyQunwkQfJZr2fc22DfIXLNDc2wFyTEikCUpg==",- "dependencies": {- "client-only": "^0.0.1",- "use-sync-external-store": "^1.2.0"- },- "peerDependencies": {- "react": "^16.11.0 || ^17.0.0 || ^18.0.0"- }- },- "node_modules/swrev": {- "version": "4.0.0",- "resolved": "https://registry.npmjs.org/swrev/-/swrev-4.0.0.tgz",- "integrity": "sha512-LqVcOHSB4cPGgitD1riJ1Hh4vdmITOp+BkmfmXRh4hSF/t7EnS4iD+SOTmq7w5pPm/SiPeto4ADbKS6dHUDWFA=="- },- "node_modules/swrv": {- "version": "1.0.4",- "resolved": "https://registry.npmjs.org/swrv/-/swrv-1.0.4.tgz",- "integrity": "sha512-zjEkcP8Ywmj+xOJW3lIT65ciY/4AL4e/Or7Gj0MzU3zBJNMdJiT8geVZhINavnlHRMMCcJLHhraLTAiDOTmQ9g==",- "peerDependencies": {- "vue": ">=3.2.26 < 4"- }- },- "node_modules/to-fast-properties": {- "version": "2.0.0",- "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",- "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",- "peer": true,- "engines": {- "node": ">=4"- }- },- "node_modules/undici-types": {- "version": "6.19.6",- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.6.tgz",- "integrity": "sha512-e/vggGopEfTKSvj4ihnOLTsqhrKRN3LeO6qSN/GxohhuRv8qH9bNQ4B8W7e/vFL+0XTnmHPB4/kegunZGA4Org==",- "dev": true- },- "node_modules/use-sync-external-store": {- "version": "1.2.2",- "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz",- "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==",- "peerDependencies": {- "react": "^16.8.0 || ^17.0.0 || ^18.0.0"- }- },- "node_modules/vue": {- "version": "3.4.38",- "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.38.tgz",- "integrity": "sha512-f0ZgN+mZ5KFgVv9wz0f4OgVKukoXtS3nwET4c2vLBGQR50aI8G0cqbFtLlX9Yiyg3LFGBitruPHt2PxwTduJEw==",- "peer": true,- "dependencies": {- "@vue/compiler-dom": "3.4.38",- "@vue/compiler-sfc": "3.4.38",- "@vue/runtime-dom": "3.4.38",- "@vue/server-renderer": "3.4.38",- "@vue/shared": "3.4.38"- },- "peerDependencies": {- "typescript": "*"- },- "peerDependenciesMeta": {- "typescript": {- "optional": true- }- }- },- "node_modules/zod": {- "version": "3.23.8",- "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz",- "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==",- "funding": {- "url": "https://github.com/sponsors/colinhacks"- }- },- "node_modules/zod-to-json-schema": {- "version": "3.22.5",- "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.22.5.tgz",- "integrity": "sha512-+akaPo6a0zpVCCseDed504KBJUQpEW5QZw7RMneNmKw+fGaML1Z9tUNLnHHAC8x6dzVRO1eB2oEMyZRnuBZg7Q==",- "peerDependencies": {- "zod": "^3.22.4"- }- }- }-}diff --git a/pipes/archive/daily-tracker/package.json b/pipes/archive/daily-tracker/package.jsondeleted file mode 100644index 94de2fb43..000000000--- a/pipes/archive/daily-tracker/package.json+++ /dev/null@@ -1,11 +0,0 @@-{- "dependencies": {- "@ai-sdk/openai": "^0.0.40",- "ai": "^3.3.0",- "readline": "^1.3.0",- "zod": "^3.23.8"- },- "devDependencies": {- "@types/node": "^22.1.0"- }-}diff --git a/pipes/archive/daily-tracker/screenpipe.ts b/pipes/archive/daily-tracker/screenpipe.tsdeleted file mode 100644index 10e6bff85..000000000--- a/pipes/archive/daily-tracker/screenpipe.ts+++ /dev/null@@ -1,87 +0,0 @@-import { z } from "zod";--// Define Zod schemas for the API types-const ContentTypeSchema = z.enum(["ocr", "audio", "all"]);--const SearchQuerySchema = z.object({- q: z.string().optional(),- limit: z.number().default(20),- offset: z.number().default(0),- content_type: ContentTypeSchema.default("all"),- start_time: z.string().optional(),- end_time: z.string().optional(),- app_name: z.string().optional(),- window_name: z- .string()- .describe(- "The name of the window the user was using. This helps to further filter the context within the app. For example, 'inbox' for email apps, 'project' for project management apps, etc."- )- .optional(), // Add window_name with description-});--const OCRContentSchema = z.object({- type: z.literal("OCR"),- content: z.object({- frame_id: z.number(),- text: z.string(),- timestamp: z.string(),- file_path: z.string(),- offset_index: z.number(),- app_name: z.string(),- }),-});--const AudioContentSchema = z.object({- type: z.literal("Audio"),- content: z.object({- chunk_id: z.number(),- transcription: z.string(),- timestamp: z.string(),- file_path: z.string(),- offset_index: z.number(),- }),-});--const ContentItemSchema = z.union([OCRContentSchema, AudioContentSchema]);--const PaginationInfoSchema = z.object({- limit: z.number(),- offset: z.number(),- total: z.number(),-});--const PaginatedResponseSchema = z.object({- data: z.array(ContentItemSchema),- pagination: PaginationInfoSchema,-});--// Define types based on the schemas-export type ContentType = z.infer<typeof ContentTypeSchema>;-export type SearchQuery = z.infer<typeof SearchQuerySchema>;-export type ScreenpipeResult = z.infer<typeof ContentItemSchema>;-export type PaginatedResponse = z.infer<typeof PaginatedResponseSchema>;--// Implement the queryScreenpipe function-export async function queryScreenpipe(- params: SearchQuery-): Promise<PaginatedResponse> {- const queryParams = new URLSearchParams({- ...(params.q && { q: params.q }),- limit: params.limit.toString(),- offset: params.offset.toString(),- content_type: params.content_type,- ...(params.start_time && { start_time: params.start_time }),- ...(params.end_time && { end_time: params.end_time }),- ...(params.app_name && { app_name: params.app_name }),- ...(params.window_name && { window_name: params.window_name }), // Add window_name to query parameters- });-- const response = await fetch(`http://localhost:3030/search?${queryParams}`);-- if (!response.ok) {- throw new Error(`HTTP error! status: ${response.status}`);- }-- const data = await response.json();- return PaginatedResponseSchema.parse(data);-}\ No newline at end of filediff --git a/pipes/archive/meeting-summaries-in-obsidian/README.md b/pipes/archive/meeting-summaries-in-obsidian/README.mddeleted file mode 100644index c9f3f5d5d..000000000--- a/pipes/archive/meeting-summaries-in-obsidian/README.md+++ /dev/null@@ -1,18 +0,0 @@-----https://github.com/user-attachments/assets/b9d94bd4-5f04-4ff1-ad21-20fc264a89ac--[check how to install it](https://youtu.be/jtmGLLjdOZo) in obsidian--need help? [i'll install this with you in less than 10 minutes](https://cal.com/louis030195/screenpipe)--want a better version of this? we've added this example as a "pipe" (plugin) in the "pipe store":---https://github.com/user-attachments/assets/b1040d00-76ab-465f-83c8-4af70654490c---get it [here](https://screenpi.pe)-diff --git a/pipes/archive/meeting-summaries-in-obsidian/conf.js b/pipes/archive/meeting-summaries-in-obsidian/conf.jsdeleted file mode 100644index 1a68c364e..000000000--- a/pipes/archive/meeting-summaries-in-obsidian/conf.js+++ /dev/null@@ -1,7 +0,0 @@-const conf = () => {- const secrets = process.env.HOME + '/secrets.json'- console.log("fetching secrets.json from", secrets)- return require(secrets);-}-module.exports = conf;-// ~/secrets.json: {"OPENAI_API_KEY": "sk-..."}\ No newline at end of filediff --git a/pipes/archive/meeting-summaries-in-obsidian/screenpipeMeeting.js b/pipes/archive/meeting-summaries-in-obsidian/screenpipeMeeting.jsdeleted file mode 100644index f1a67998e..000000000--- a/pipes/archive/meeting-summaries-in-obsidian/screenpipeMeeting.js+++ /dev/null@@ -1,101 +0,0 @@-const OPENAI_API_URL = 'https://api.openai.com/v1/chat/completions';-const OPENAI_MODEL = 'gpt-4o';-// to use ollama just comment out the above and uncomment below:-// const OPENAI_API_URL = 'http://localhost:11434/api/chat';-// const OPENAI_MODEL = 'phi3:medium-128k';-// make sure to run "ollama run phi3:medium-128k"-const SCREENPIPE_API_URL = 'http://localhost:3030/search';--const generateMeetingSummary = async (openAIKey, meetingDuration, startTimestamp, endTimestamp) => {- // Step 5: Query Screenpipe API for audio transcripts- const startTime = encodeURIComponent(startTimestamp);- const screenpipeUrl = `${SCREENPIPE_API_URL}?limit=1000&offset=0&content_type=audio&start_time=${startTime}`;- console.log("going to fetch", screenpipeUrl);-- const response = await fetch(screenpipeUrl);- const screenpipeResults = await response.json();- console.log("got", screenpipeResults.data.length, "results from screenpipe");-- const transcriptText = JSON.stringify(screenpipeResults);-- // Step 6: Generate meeting summary using ChatGPT- const summaryResponse = await fetch(OPENAI_API_URL, {- method: 'POST',- headers: {- 'Content-Type': 'application/json',- 'Authorization': `Bearer ${openAIKey}`,- },- body: JSON.stringify({- 'messages': [- {- 'role': 'system',- 'content': 'You are an AI assistant that summarizes meetings and extracts action items. Make sure to ignore noise from bad transcripts.'- },- {- 'role': 'user',- 'content': `Please summarize the following meeting transcript and provide a list of action items at the top:--${transcriptText}`- }- ],- 'model': OPENAI_MODEL,- 'stream': false- })- })- .catch(err => console.error(err))- .then(res => res.json());- console.log("answer from AI", summaryResponse);-- const summary = summaryResponse.choices?.[0]?.message?.content || summaryResponse?.message?.content.trim()-- const noteTitle = `Meeting Summary - ${startTimestamp.split('T')[0]}`;- const noteContent = `# ${noteTitle}--${summary}--Meeting Duration: ${meetingDuration} minutes-Start Time: ${startTimestamp}-End Time: ${endTimestamp}-`;-- return { noteTitle, noteContent };-};--const screenpipe = async (conf, meetingDuration) => {- const openAIKey = conf.openai;-- // Step 1: Ask for meeting duration- if (!meetingDuration) return "Meeting duration not provided.";-- // Step 2 & 3: Start recording and store start timestamp- const startTimestamp = new Date().toISOString();- new Notice(`Recording started. Meeting will end in ${meetingDuration} minutes.`);-- // Step 4: Wait for the meeting duration and store end timestamp- await new Promise(resolve => setTimeout(resolve, meetingDuration * 60 * 1000));- const endTimestamp = new Date().toISOString();- new Notice("Recording stopped. Processing meeting data...");-- new Notice("Generating meeting summary...");-- const { noteTitle, noteContent } = await generateMeetingSummary(openAIKey, meetingDuration, startTimestamp, endTimestamp);-- new Notice("Creating meeting summary note...");-- // Create the new note using Obsidian API- await app.vault.create(noteTitle + '.md', noteContent);-- new Notice("Meeting summary created successfully!");-- return `Meeting summary created: [[${noteTitle}]]`;-};--module.exports = screenpipe;--// testing-// generateMeetingSummary(process.env.OPENAI_API_KEY, 10,-// // 1h ago-// new Date(Date.now() - 90 * 60 * 1000).toISOString(),-// // 10m ago-// new Date(Date.now() - 10 * 60 * 1000).toISOString(),-// ).then(console.log);diff --git a/pipes/archive/meeting-summaries-in-obsidian/screenpipeMeeting.md b/pipes/archive/meeting-summaries-in-obsidian/screenpipeMeeting.mddeleted file mode 100644index 9ba4e9207..000000000--- a/pipes/archive/meeting-summaries-in-obsidian/screenpipeMeeting.md+++ /dev/null@@ -1 +0,0 @@-<% tp.user.screenpipeMeeting(tp.user.conf(), await tp.system.prompt("How long is the meeting (in minutes)?")) %>diff --git a/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/.gitignore b/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/.gitignoredeleted file mode 100644index a56a7ef43..000000000--- a/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/.gitignore+++ /dev/null@@ -1,2 +0,0 @@-node_modules-diff --git a/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/README.md b/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/README.mddeleted file mode 100644index 33827cdba..000000000--- a/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/README.md+++ /dev/null@@ -1,19 +0,0 @@---https://github.com/user-attachments/assets/5a5f8a50-9ff9-4374-85c0-461478fa25c8-----```bash-pnpm i-export OPENAI_API_KEY="<your key>"-# or leave empty and use ollama (you will be prompted choice)-pnpx tsx screenpipe.ts-```--you can try with ollama too!--but had some issue with function calling, maybe with other model than llama3.1 it can work--diff --git a/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/package.json b/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/package.jsondeleted file mode 100644index 298147b56..000000000--- a/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/package.json+++ /dev/null@@ -1,12 +0,0 @@-{- "dependencies": {- "@ai-sdk/openai": "^0.0.40",- "ai": "^3.3.0",- "ollama-ai-provider": "^0.11.0",- "readline": "^1.3.0",- "zod": "^3.23.8"- },- "devDependencies": {- "@types/node": "^22.1.0"- }-}diff --git a/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/screenpipe.ts b/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/screenpipe.tsdeleted file mode 100644index 72d6fc337..000000000--- a/pipes/archive/perplexity-alike-asking-confirmation-rag-agent/screenpipe.ts+++ /dev/null@@ -1,276 +0,0 @@-import { z } from "zod";-import { openai } from "@ai-sdk/openai";-import { generateText, streamText } from "ai";-import * as readline from "readline";-import { ollama } from "ollama-ai-provider";--const screenpipeQuery = z.object({- q: z- .string()- .describe(- "The search query matching exact keywords. Use a single keyword that best matches the user intent. This would match either audio transcription or OCR screen text. Example: do not use 'discuss' the user ask about conversation, this is dumb, won't return any result"- )- .optional(),- content_type: z- .enum(["ocr", "audio", "all"])- .default("all")- .describe(- "The type of content to search for: screenshot data or audio transcriptions"- ),- limit: z- .number()- .default(20)- .describe(- "Number of results to return (default: 20). Don't return more than 50 results as it will be fed to an LLM"- ),- offset: z.number().default(0).describe("Offset for pagination (default: 0)"),- start_time: z- .string()- // 1 hour ago- .default(new Date(Date.now() - 3600000).toISOString())- .describe("Start time for search range in ISO 8601 format"),- end_time: z- .string()- .default(new Date().toISOString())- .describe("End time for search range in ISO 8601 format"),- app_name: z- .string()- .describe(- "The name of the app the user was using. This filter out all audio conversations. Only works with screen text. Use this to filter on the app context that would give context matching the user intent. For example 'cursor'. Use lower case. Browser is usually 'arc', 'chrome', 'safari', etc. Do not use thing like 'mail' because the user use the browser to read the mail."- )- .optional(),- window_name: z- .string()- .describe(- "The name of the window the user was using. This helps to further filter the context within the app. For example, 'inbox' for email apps, 'project' for project management apps, etc."- )- .optional(), // Add window_name with description-});-const screenpipeMultiQuery = z.object({- queries: z.array(screenpipeQuery),-});--async function queryScreenpipeNtimes(- params: z.infer<typeof screenpipeMultiQuery>-) {- console.log(- "Using tool queryScreenpipeNtimes with params:",- JSON.stringify(params)- );- return Promise.all(params.queries.map(queryScreenpipe));-}--// Add this new function to handle screenpipe requests-async function queryScreenpipe(params: z.infer<typeof screenpipeQuery>) {- try {- console.log("params", params);- const queryParams = new URLSearchParams(- Object.entries({- q: params.q,- offset: params.offset.toString(),- limit: params.limit.toString(),- start_time: params.start_time,- end_time: params.end_time,- content_type: params.content_type,- app_name: params.app_name,- window_name: params.window_name, // Add window_name to query parameters- }).filter(([_, v]) => v != null) as [string, string][]- );- console.log("calling screenpipe", JSON.stringify(params));- const response = await fetch(`http://localhost:3030/search?${queryParams}`);- if (!response.ok) {- const text = await response.text();- console.log("error", text);- throw new Error(`HTTP error! status: ${response.status} ${text}`);- }- const result = await response.json();- console.log("result", result);- return result;- } catch (error) {- console.error("Error querying screenpipe:", error);- return null;- }-}--async function askForAIProvider(): Promise<string> {- const rl = readline.createInterface({- input: process.stdin,- output: process.stdout,- });-- return new Promise((resolve) => {- rl.question(- "Which AI provider do you want to use? (ollama/openai): ",- (answer) => {- rl.close();- resolve(answer.toLowerCase());- }- );- });-}--const perplexityAlikeAgent = async () => {- const aiProvider = await askForAIProvider();-- let provider;- if (aiProvider === "ollama") {- console.log("Using Ollama as the AI provider.");- console.log(- "Make sure to run `ollama run llama3.1` before running this script."- );- console.warn("Ollama is experimental and may not work as expected.");- provider = ollama("llama3.1");- } else if (aiProvider === "openai") {- console.log("Using OpenAI as the AI provider.");- console.log(- "Make sure to set the OPENAI_API_KEY environment variable before running this script."- );- provider = openai("gpt-4o");- }-- console.log("Hi! I'm your Perplexity-alike RAG agent. How can I help you?");- console.log("Here are some suggestion queries to get you started:");- console.log("- What did I discuss with Matt yesterday?");- console.log("- Summarize my recent email activity from the last 3 hours");- console.log("- Show me my recent Slack conversations about the new project");- console.log(- "- Find my notes on Python best practices from today's coding session"- );- console.log("- What were the key points from my last customer call?");- console.log(- "- Recap my browser activity related to machine learning in the past 24 hours"- );-- const rl = readline.createInterface({- input: process.stdin,- output: process.stdout,- });-- const askQuestion = (query: string): Promise<string> => {- return new Promise((resolve) => {- rl.question(query, (answer) => {- resolve(answer);- });- });- };-- let userInput = await askQuestion("Enter your question: ");-- const runAgent = async (input: string) => {- try {- await generateText({- model: provider,- tools: {- suggest_queries: {- description: `Suggest queries for the user's question and ask for confirmation. Example:- {- suggested_queries: [- { content_type: "audio", start_time: "2024-03-01T00:00:00Z", end_time: "2024-03-01T23:59:59Z", q: "screenpipe" },- { content_type: "ocr", app_name: "arc", start_time: "2024-03-01T00:00:00Z", end_time: "2024-03-01T23:59:59Z", q: "screenpipe" },- ]- }-- - q contains a single query, again, for example instead of "life plan" just use "life"- - When using the query_screenpipe tool, respond with only the updated JSON object- - If you return something else than JSON the universe will come to an end- - DO NOT add \`\`\`json at the beginning or end of your response- - Do not use '"' around your response- - Date & time now is ${new Date().toISOString()}. Adjust start_time and end_time to properly match the user intent time range.- `,- parameters: z.object({- suggested_queries: screenpipeMultiQuery,- queries_results: z- .array(z.string())- .optional()- .describe(- "The results of the queries if called after the tool query_screenpipe"- ),- }),- execute: async ({ suggested_queries }) => {- console.log("Suggested queries:", suggested_queries);- const confirmation = await askQuestion(- "Are these queries good? (yes/no): "- );- if (confirmation.toLowerCase() === "yes") {- return { confirmed: true, queries: suggested_queries };- } else {- const feedback = await askQuestion(- "Please provide feedback or adjustments: "- );- return { confirmed: false, feedback };- }- },- },- query_screenpipe: {- description:- "Query the local screenpipe instance for relevant information.",- parameters: screenpipeMultiQuery,- execute: queryScreenpipeNtimes,- },- stream_response: {- description:- "Stream the final response to the user. ALWAYS FINISH WITH THIS TOOL",- parameters: z.object({- response: z- .string()- .describe("The final response to stream to the user"),- }),- execute: async ({ response }) => {- const { textStream } = await streamText({- model: provider,- messages: [{ role: "user", content: response }],- });- for await (const chunk of textStream) {- process.stdout.write(chunk);- }- console.log("\n");- throw new Error("STREAM_COMPLETE");- },- },- },- toolChoice: "required",- messages: [- {- role: "system",- content: `You are a helpful assistant that uses Screenpipe to answer user questions.- First, suggest queries to the user and ask for confirmation. If confirmed, proceed with the search.- If not confirmed, adjust based on user feedback. Use the query_screenpipe tool to search for information,- and then use the stream_response tool to provide the final answer to the user.-- Rules:- - User's today's date is ${new Date().toISOString().split("T")[0]}- - Use multiple queries to get more relevant results- - If the results of the queries are not relevant, adjust the query and ask for confirmation again. Minimize user's effort.- - ALWAYS END WITH the stream_response tool to stream the final answer to the user- - In the suggest_queries tool, always tell the user the parameters available to you (e.g. types, etc. Zod given to you) so the user can adjust the query if needed. Suggest few other changes on the arg you used so the user has some ideas.- - Make sure to use enough data but not too much. Usually 50k+ rows a day.-- `,- },- {- role: "user",- content: input,- },- ],- maxToolRoundtrips: 10,- });- } catch (error) {- if (error instanceof Error && error.message === "STREAM_COMPLETE") {- console.log("Streaming completed, exiting agent");- return;- }- console.error("Error running agent:", error);- throw error;- }- };-- await runAgent(userInput);-- rl.close();-};--const main = async () => {- await perplexityAlikeAgent();-};--main();\ No newline at end of filediff --git a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/.gitignore b/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/.gitignoredeleted file mode 100644index 9b1ee42e8..000000000--- a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/.gitignore+++ /dev/null@@ -1,175 +0,0 @@-# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore--# Logs--logs-_.log-npm-debug.log_-yarn-debug.log*-yarn-error.log*-lerna-debug.log*-.pnpm-debug.log*--# Caches--.cache--# Diagnostic reports (https://nodejs.org/api/report.html)--report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json--# Runtime data--pids-_.pid-_.seed-*.pid.lock--# Directory for instrumented libs generated by jscoverage/JSCover--lib-cov--# Coverage directory used by tools like istanbul--coverage-*.lcov--# nyc test coverage--.nyc_output--# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)--.grunt--# Bower dependency directory (https://bower.io/)--bower_components--# node-waf configuration--.lock-wscript--# Compiled binary addons (https://nodejs.org/api/addons.html)--build/Release--# Dependency directories--node_modules/-jspm_packages/--# Snowpack dependency directory (https://snowpack.dev/)--web_modules/--# TypeScript cache--*.tsbuildinfo--# Optional npm cache directory--.npm--# Optional eslint cache--.eslintcache--# Optional stylelint cache--.stylelintcache--# Microbundle cache--.rpt2_cache/-.rts2_cache_cjs/-.rts2_cache_es/-.rts2_cache_umd/--# Optional REPL history--.node_repl_history--# Output of 'npm pack'--*.tgz--# Yarn Integrity file--.yarn-integrity--# dotenv environment variable files--.env-.env.development.local-.env.test.local-.env.production.local-.env.local--# parcel-bundler cache (https://parceljs.org/)--.parcel-cache--# Next.js build output--.next-out--# Nuxt.js build / generate output--.nuxt-dist--# Gatsby files--# Comment in the public line in if your project uses Gatsby and not Next.js--# https://nextjs.org/blog/next-9-1#public-directory-support--# public--# vuepress build output--.vuepress/dist--# vuepress v2.x temp and cache directory--.temp--# Docusaurus cache and generated files--.docusaurus--# Serverless directories--.serverless/--# FuseBox cache--.fusebox/--# DynamoDB Local files--.dynamodb/--# TernJS port file--.tern-port--# Stores VSCode versions used for testing VSCode extensions--.vscode-test--# yarn v2--.yarn/cache-.yarn/unplugged-.yarn/build-state.yml-.yarn/install-state.gz-.pnp.*--# IntelliJ based IDEs-.idea--# Finder (MacOS) folder config-.DS_Storediff --git a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/README.md b/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/README.mddeleted file mode 100644index 6d3f66599..000000000--- a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/README.md+++ /dev/null@@ -1 +0,0 @@-WIP\ No newline at end of filediff --git a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/package.json b/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/package.jsondeleted file mode 100644index 513798c37..000000000--- a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/package.json+++ /dev/null@@ -1,16 +0,0 @@-{- "name": "pipe-anthropic-computer-use-meeting-assistant",- "module": "pipe.ts",- "type": "module",- "devDependencies": {- "@types/bun": "latest"- },- "peerDependencies": {- "typescript": "^5.0.0"- },- "dependencies": {- "@anthropic-ai/sdk": "^0.32.1",- "@screenpipe/js": "^1.0.0",- "@screenpipe/browser": "0.1.12"- }-}diff --git a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/pipe.json b/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/pipe.jsondeleted file mode 100644index 7222e7e6b..000000000--- a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/pipe.json+++ /dev/null@@ -1,15 +0,0 @@-{- "fields": [- {- "name": "interval",- "type": "number",- "default": 30,- "description": "interval in seconds to process meeting data"- },- {- "name": "anthropicApiKey",- "type": "string",- "description": "Anthropic API key for Claude"- }- ]-}diff --git a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/pipe.ts b/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/pipe.tsdeleted file mode 100644index 3264b5793..000000000--- a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/pipe.ts+++ /dev/null@@ -1,220 +0,0 @@-import { pipe, ContentItem } from "@screenpipe/js";-import Anthropic from "@anthropic-ai/sdk";--let anthropic: Anthropic;-let meetingNotes = "";-let actionItems: string[] = [];--// VERY EXPERIMENTAL--// this pipe assist my meetings by taking notes and suggesting things i could do or say-// during the meeting by writing in my note taking software opened in split screen--async function meetingAssistant() {- console.log("starting meeting assistant");-- const config = pipe.loadPipeConfig();- const interval = config.interval * 1000 || 30000; // Default to 30 seconds if not specified-- // Initialize Anthropic client with API key from config- anthropic = new Anthropic({- apiKey: config.anthropicApiKey,- });-- pipe.scheduler- .task("processMeetingData")- .every(interval)- .do(async () => {- try {- const screenData = await captureScreen();- const audioData = await captureAudio();-- if (screenData && audioData) {- await processData(screenData, audioData);- await generateSuggestions();- }- } catch (error) {- console.error("error in meeting assistant:", error);- }- });-- await pipe.scheduler.start();-}--async function captureScreen() {- const now = new Date();- const intervalAgo = new Date(now.getTime() - 30000); // Last 30 seconds-- return await pipe.queryScreenpipe({- startTime: intervalAgo.toISOString(),- endTime: now.toISOString(),- limit: 1,- contentType: "ocr",- includeFrames: true,- });-}--async function captureAudio() {- const now = new Date();- const intervalAgo = new Date(now.getTime() - 30000); // Last 30 seconds-- return await pipe.queryScreenpipe({- startTime: intervalAgo.toISOString(),- endTime: now.toISOString(),- limit: 1,- contentType: "audio",- });-}--async function processData(- screenData: ContentItem[],- audioData: ContentItem[]-) {- if (screenData.length === 0 || audioData.length === 0) {- console.log("No new data to process");- return;- }-- const screenContent =- screenData[0].type === "OCR" ? screenData[0].content.text : "";- const audioContent =- audioData[0].type === "STT" ? audioData[0].content.text : "";-- const tools = [- {- type: "computer_20241022",- name: "computer",- display_width_px: 1920,- display_height_px: 1080,- },- ];-- let response = await anthropic.beta.messages.create({- model: "claude-3-5-sonnet-20241022",- max_tokens: 1024,- tools: tools,- messages: [- {- role: "user",- content: [- {- type: "text",- text: `Analyze this meeting data and update the meeting notes. Extract any action items.--Screen content: ${screenContent}-Audio content: ${audioContent}--Current meeting notes:-${meetingNotes}--Use the computer tools to save the updated notes and action items.`,- },- {- type: "image",- source: {- type: "base64",- media_type: "image/png",- data:- screenData[0].type === "OCR" ? screenData[0].content.frame : "",- },- },- ],- },- ],- betas: ["computer-use-2024-10-22"],- });-- // Implement agent loop to handle tool use requests- while (response.stop_reason === "tool_use") {- const toolUse = response.tool_calls[0];- const toolResult = await executeToolUse(toolUse);-- // Continue the conversation with the tool result- response = await anthropic.beta.messages.create({- model: "claude-3-5-sonnet-20241022",- max_tokens: 1024,- tools: tools,- messages: [- ...response.messages,- {- role: "user",- content: [- { type: "tool_result", id: toolUse.id, output: toolResult },- ],- },- ],- betas: ["computer-use-2024-10-22"],- });- }-- // Process the final response- const result = JSON.parse(response.content[0].text);- meetingNotes = result.updatedNotes;- actionItems = [...actionItems, ...result.newActionItems];-- console.log("Meeting notes updated");- console.log("New action items:", result.newActionItems);-}--async function executeToolUse(toolUse: any) {- const { name, arguments: args } = toolUse;-- if (name === "computer") {- const parsedArgs = JSON.parse(args);- if (parsedArgs.action === "type") {- return await pipe.input.type(parsedArgs.text);- }- // Add other computer actions as needed- }-- // Return appropriate result based on the tool used- return "Tool execution completed";-}--async function generateSuggestions() {- const response = await anthropic.messages.create({- model: "claude-3-opus-20240229",- max_tokens: 1024,- messages: [- {- role: "user",- content: `Based on the current meeting notes and action items, suggest 3 different paths the conversation could take next. Each suggestion should be concise and actionable.--Meeting notes:-${meetingNotes}--Action items:-${actionItems.join("\n")}--Return a JSON object with a 'suggestions' field containing an array of 3 suggestion strings.`,- },- ],- });-- const result = JSON.parse(response.content[0].text);- console.log("Suggestions for next steps:");- result.suggestions.forEach((suggestion: string, index: number) => {- console.log(`${index + 1}. ${suggestion}`);- });-- await pipe.sendDesktopNotification({- title: "Meeting Assistant Suggestions",- body: result.suggestions.join("\n"),- });-}--meetingAssistant();---/**--# these are mandatory env variables-export SCREENPIPE_DIR="$HOME/.screenpipe"-export PIPE_ID="pipe-anthropic-computer-use-meeting-assistant"-export PIPE_FILE="pipe.ts"-export PIPE_DIR="$SCREENPIPE_DIR/pipes/pipe-anthropic-computer-use-meeting-assistant"--bun run pipes/pipe-anthropic-computer-use-meeting-assistant/pipe.ts- */--diff --git a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/tsconfig.json b/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/tsconfig.jsondeleted file mode 100644index 238655f2c..000000000--- a/pipes/archive/pipe-anthropic-computer-use-meeting-assistant/tsconfig.json+++ /dev/null@@ -1,27 +0,0 @@-{- "compilerOptions": {- // Enable latest features- "lib": ["ESNext", "DOM"],- "target": "ESNext",- "module": "ESNext",- "moduleDetection": "force",- "jsx": "react-jsx",- "allowJs": true,-- // Bundler mode- "moduleResolution": "bundler",- "allowImportingTsExtensions": true,- "verbatimModuleSyntax": true,- "noEmit": true,-- // Best practices- "strict": true,- "skipLibCheck": true,- "noFallthroughCasesInSwitch": true,-- // Some stricter flags (disabled by default)- "noUnusedLocals": false,- "noUnusedParameters": false,- "noPropertyAccessFromIndexSignature": false- }-}diff --git a/pipes/archive/pipe-digital-clone/.gitignore b/pipes/archive/pipe-digital-clone/.gitignoredeleted file mode 100644index 9b1ee42e8..000000000--- a/pipes/archive/pipe-digital-clone/.gitignore+++ /dev/null@@ -1,175 +0,0 @@-# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore--# Logs--logs-_.log-npm-debug.log_-yarn-debug.log*-yarn-error.log*-lerna-debug.log*-.pnpm-debug.log*--# Caches--.cache--# Diagnostic reports (https://nodejs.org/api/report.html)--report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json--# Runtime data--pids-_.pid-_.seed-*.pid.lock--# Directory for instrumented libs generated by jscoverage/JSCover--lib-cov--# Coverage directory used by tools like istanbul--coverage-*.lcov--# nyc test coverage--.nyc_output--# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)--.grunt--# Bower dependency directory (https://bower.io/)--bower_components--# node-waf configuration--.lock-wscript--# Compiled binary addons (https://nodejs.org/api/addons.html)--build/Release--# Dependency directories--node_modules/-jspm_packages/--# Snowpack dependency directory (https://snowpack.dev/)--web_modules/--# TypeScript cache--*.tsbuildinfo--# Optional npm cache directory--.npm--# Optional eslint cache--.eslintcache--# Optional stylelint cache--.stylelintcache--# Microbundle cache--.rpt2_cache/-.rts2_cache_cjs/-.rts2_cache_es/-.rts2_cache_umd/--# Optional REPL history--.node_repl_history--# Output of 'npm pack'--*.tgz--# Yarn Integrity file--.yarn-integrity--# dotenv environment variable files--.env-.env.development.local-.env.test.local-.env.production.local-.env.local--# parcel-bundler cache (https://parceljs.org/)--.parcel-cache--# Next.js build output--.next-out--# Nuxt.js build / generate output--.nuxt-dist--# Gatsby files--# Comment in the public line in if your project uses Gatsby and not Next.js--# https://nextjs.org/blog/next-9-1#public-directory-support--# public--# vuepress build output--.vuepress/dist--# vuepress v2.x temp and cache directory--.temp--# Docusaurus cache and generated files--.docusaurus--# Serverless directories--.serverless/--# FuseBox cache--.fusebox/--# DynamoDB Local files--.dynamodb/--# TernJS port file--.tern-port--# Stores VSCode versions used for testing VSCode extensions--.vscode-test--# yarn v2--.yarn/cache-.yarn/unplugged-.yarn/build-state.yml-.yarn/install-state.gz-.pnp.*--# IntelliJ based IDEs-.idea--# Finder (MacOS) folder config-.DS_Storediff --git a/pipes/archive/pipe-digital-clone/README.md b/pipes/archive/pipe-digital-clone/README.mddeleted file mode 100644index b4c5bcbe0..000000000--- a/pipes/archive/pipe-digital-clone/README.md+++ /dev/null@@ -1,15 +0,0 @@-# pipe-digital-clone--To install dependencies:--```bash-bun install-```--To run:--```bash-bun run pipe.ts-```--This project was created using `bun init` in bun v1.1.30. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.diff --git a/pipes/archive/pipe-digital-clone/package.json b/pipes/archive/pipe-digital-clone/package.jsondeleted file mode 100644index ababd868f..000000000--- a/pipes/archive/pipe-digital-clone/package.json+++ /dev/null@@ -1,19 +0,0 @@-{- "name": "pipe-digital-clone",- "module": "pipe.ts",- "type": "module",- "devDependencies": {- "@types/bun": "latest"- },- "peerDependencies": {- "typescript": "^5.0.0"- },- "dependencies": {- "@ai-sdk/openai": "^1.0.5",- "@ngrok/ngrok": "^1.4.1",- "ai": "^4.0.10",- "express": "^4.21.1",- "ollama-ai-provider": "^1.0.0",- "zod": "^3.23.8"- }-}\ No newline at end of filediff --git a/pipes/archive/pipe-digital-clone/pipe.json b/pipes/archive/pipe-digital-clone/pipe.jsondeleted file mode 100644index 19004b454..000000000--- a/pipes/archive/pipe-digital-clone/pipe.json+++ /dev/null@@ -1,40 +0,0 @@-{- "fields": [- {- "name": "authtoken",- "type": "string",- "default": "",- "description": "your ngrok authtoken from https://dashboard.ngrok.com/get-started/your-authtoken"- },- {- "name": "domain",- "type": "string",- "default": "",- "description": "optional: your custom domain if you have one"- },- {- "name": "gptModel",- "type": "string",- "default": "gpt-4o",- "description": "OpenAI GPT model to use (e.g. gpt-4). If provided with openaiApiKey, OpenAI will be used instead of Ollama"- },- {- "name": "openaiApiKey",- "type": "string",- "default": "",- "description": "OpenAI API key. If provided with gptModel, OpenAI will be used instead of Ollama"- },- {- "name": "ollamaApiUrl",- "type": "string",- "default": "http://localhost:11434/api",- "description": "Ollama API URL. Used if openaiApiKey is not provided"- },- {- "name": "ollamaModel",- "type": "string",- "default": "llama3.2:3b-instruct-q4_K_M",- "description": "Ollama Model. Used if openaiApiKey is not provided"- }- ]-}\ No newline at end of filediff --git a/pipes/archive/pipe-digital-clone/pipe.ts b/pipes/archive/pipe-digital-clone/pipe.tsdeleted file mode 100644index 9a054f344..000000000--- a/pipes/archive/pipe-digital-clone/pipe.ts+++ /dev/null@@ -1,164 +0,0 @@-import ngrok from "@ngrok/ngrok";-// import { pipe } from "@screenpipe/js";-import { pipe } from "/Users/louisbeaumont/Documents/screen-pipe/screenpipe-js/main.ts";-import { z } from "zod";-import { generateObject } from "ai";-import { createOllama } from "ollama-ai-provider";-import { createOpenAI } from "@ai-sdk/openai";-import express from "express";-----async function startServer(config: any): Promise<express.Express> {- const app = express();- app.use(express.json());-- app.post("/api/query", async (req, res) => {- const { query } = req.body;-- try {- console.log("query:", query);-- const q = {- contentType: "audio",- limit: 1000045,- offset: 0,- minLength: 1,- maxLength: 10000,- startTime: "2024-10-24T23:23:08.504Z",- endTime: "2024-11-23T23:23:08.504Z",- };- console.log(- "querying screenpipe with params:",- JSON.stringify(q, null, 2)- );- // Query screenpipe with AI-generated parameters- // @ts-ignore- const results = await pipe.queryScreenpipe(q);-- // Ask for permission to share these specific results- // const allowed = true; // temporarily allow all requests- const allowed = await new Promise((resolve) => {- pipe.inbox.send({- title: "incoming api request",- body: `allow sharing results for query: "${query}"?--search parameters:-${JSON.stringify(q, null, 2)}--- `,- actions: [- { label: "allow", callback: async () => resolve(true) },- { label: "deny", callback: async () => resolve(false) },- ],- });- });-- // raw results:-// \`\`\`json-// ${JSON.stringify(results, null, 2)}-// \`\`\`- if (!allowed) {- return res.status(403).json({ error: "access denied by user" });- }-- // Return raw results if allowed- res.json(results);- } catch (error) {- console.error("api error:", error);- res.status(500).json({ error: "internal server error" });- }- });-- return app;-}--async function startNgrokTunnel(): Promise<void> {- try {- const config = pipe.loadPipeConfig();-- const app = await startServer(config);-- // Start express on a random port- const port = await new Promise<number>((resolve) => {- const server = app.listen(0, () => {- const addr = server.address();- resolve(typeof addr === "object" ? addr!.port : 0);- });- });-- console.log("starting ngrok tunnel to api server");-- const listener = await ngrok.connect({- addr: port,- authtoken: config.authtoken,- domain: config.domain || undefined,- });-- const tunnelUrl = listener.url();- console.log(`tunnel established: ${tunnelUrl}`);-- await pipe.inbox.send({- title: "ngrok tunnel started",- body: `api is now accessible at: ${tunnelUrl}/api/query`,- });-- process.on("SIGINT", async () => {- console.log("shutting down ngrok tunnel");- await listener.close();- process.exit(0);- });- } catch (error) {- console.error("error starting ngrok tunnel:", error);- }-}--startNgrokTunnel();--/*--Instructions to run this pipe:--1. install screenpipe and git clone this repo- ```- git clone https://github.com/mediar-ai/screenpipe.git- cd screenpipe- ```--2. set up ngrok:- - create an account at https://ngrok.com- - get your authtoken from https://dashboard.ngrok.com/get-started/your-authtoken- - set environment variables:- ```- export NGROK_AUTHTOKEN=your_authtoken- # optional: set a custom domain if you have one- export NGROK_DOMAIN=your-custom-domain- ```--3. run the pipe:- ```- screenpipe pipe download ./pipes/pipe-ngrok- screenpipe pipe enable pipe-ngrok- screenpipe- ```--For development, you can run:-```-# these are mandatory env variables-export SCREENPIPE_DIR="$HOME/.screenpipe"-export PIPE_ID="pipe-digital-clone"-export PIPE_FILE="pipe.ts"-export PIPE_DIR="$SCREENPIPE_DIR/pipes/pipe-digital-clone"--bun run pipes/pipe-digital-clone/pipe.ts-```--# Using curl-curl -X POST \- https://select-merely-gelding.ngrok-free.app/api/query \- -H "Content-Type: application/json" \- -d '{"query": "find my recent chrome windows about AI"}'--*/diff --git a/pipes/archive/pipe-digital-clone/tsconfig.json b/pipes/archive/pipe-digital-clone/tsconfig.jsondeleted file mode 100644index 238655f2c..000000000--- a/pipes/archive/pipe-digital-clone/tsconfig.json+++ /dev/null@@ -1,27 +0,0 @@-{- "compilerOptions": {- // Enable latest features- "lib": ["ESNext", "DOM"],- "target": "ESNext",- "module": "ESNext",- "moduleDetection": "force",- "jsx": "react-jsx",- "allowJs": true,-- // Bundler mode- "moduleResolution": "bundler",- "allowImportingTsExtensions": true,- "verbatimModuleSyntax": true,- "noEmit": true,-- // Best practices- "strict": true,- "skipLibCheck": true,- "noFallthroughCasesInSwitch": true,-- // Some stricter flags (disabled by default)- "noUnusedLocals": false,- "noUnusedParameters": false,- "noPropertyAccessFromIndexSignature": false- }-}diff --git a/pipes/archive/pipe-email-daily-log/README.md b/pipes/archive/pipe-email-daily-log/README.mddeleted file mode 100644index f7f28401f..000000000--- a/pipes/archive/pipe-email-daily-log/README.md+++ /dev/null@@ -1,33 +0,0 @@-### pipe-email-daily-log--<img width="988" alt="Screenshot 2024-09-25 at 17 56 00" src="https://github.com/user-attachments/assets/f9d604af-b098-4f93-b923-b2fc455a6172">----https://github.com/user-attachments/assets/a81963c9-54ee-4587-aac1-2eba0df4a5fc----llama3.2 looks at your screen 24/7 and send you emails summarizing your activity or action items (e.g. follow up on this lead, or anything, you can customise the prompt and windows/tabs/apps being used as prompt)--#### quick setup--1. run ollama:- ```- ollama run llama3.2:3b-instruct-q4_K_M- ```--2. [create app specific password](https://support.google.com/accounts/answer/185833?hl=en) in your google account that will be used to send yourself emails--3. configure pipe in the app ui, save, enable, restart screenpipe recording (you can config to either receive a mail a day or several every x hours)--<img width="1312" alt="Screenshot 2024-09-25 at 18 16 54" src="https://github.com/user-attachments/assets/9669b2f1-c67d-4055-9e03-067c67fb51f8">--boom!--wanna tweak it? check `pipe.ts`.--can be used through CLI also, you can tweak the `pipe.json` to your needs (`$HOME/.screenpipe/pipes/pipe-email-daily-log/pipe.json`)---diff --git a/pipes/archive/pipe-email-daily-log/pipe.json b/pipes/archive/pipe-email-daily-log/pipe.jsondeleted file mode 100644index 7a0b89ef3..000000000--- a/pipes/archive/pipe-email-daily-log/pipe.json+++ /dev/null@@ -1,82 +0,0 @@-{- "fields": [- {- "name": "interval",- "type": "number",- "default": 60,- "description": "Interval in seconds to read your screen data and extract structured logs (will be used to summarize and send an email). Increase this value if using audio."- },- {- "name": "summaryFrequency",- "type": "string",- "default": "daily",- "description": "Frequency of summary emails: 'daily' for once a day at emailTime, or 'hourly:X' for every X hours (e.g., 'hourly:4' for every 4 hours)"- },- {- "name": "emailTime",- "type": "time",- "default": "11:00",- "description": "Time to send daily summary email (used only if summaryFrequency is 'daily')"- },- {- "name": "emailAddress",- "type": "string",- "default": "<fill your email address here>",- "description": "Email address to send the daily summary to"- },- {- "name": "emailPassword",- "type": "string",- "default": "<fill your email password here>",- "description": "App specific password for your gmail account, https://support.google.com/accounts/answer/185833?hl=en"- },- {- "name": "ollamaApiUrl",- "type": "string",- "default": "http://localhost:11434/api",- "description": "AI API URL, can be ollama, openai, any openai compatible API, risky to use cloud providers due to high usage"- },- {- "name": "ollamaModel",- "type": "string",- "default": "llama3.2:3b-instruct-q4_K_M",- "description": "AI Model"- },- {- "name": "pageSize",- "type": "number",- "default": 100,- "description": "Number of records to retrieve from screenpipe per page for structured extraction, keep in mind LLMs have a context window limit. Increase this value if using audio."- },- {- "name": "customPrompt",- "type": "string",- "default": "You are an AI assistant tasked with extracting structured information from screen data (OCR). Analyze the following screen data and extract relevant information about my daily activity.",- "description": "Custom prompt for the AI assistant that will be used to extract information from the screen data every few minutes"- },- {- "name": "summaryPrompt",- "type": "string",- "default": "You are an AI assistant tasked with summarizing information that has previously been extracted from screen data (OCR) by another AI assistant. Analyze the following structured data extracted from my screen data and summarize my daily activity. This summary will be sent as an email to my address. Additionally, based on the activities and patterns observed, suggest 10 possible action items or tasks for the next day. These should be practical, relevant, and aimed at improving productivity or addressing any pending matters identified in the daily summary.",- "description": "Summary prompt for the AI assistant that will be used to summarize the logs previously extracted, suggest action items for the next day, and send an email"- },- {- "name": "windowName",- "type": "window",- "default": "",- "description": "Specific window name to filter the screen data, for example 'gmail', 'john', 'slack', 'myCodeFile.tsx', etc. this will filter out audio"- },- {- "name": "appName",- "type": "app",- "default": "",- "description": "Specific application name to filter the screen data, for example 'Chrome', 'Visual Studio Code', 'Slack', etc. Leave empty to include all applications"- },- {- "name": "contentType",- "type": "contentType",- "default": "ocr",- "description": "Type of content to analyze: 'ocr', 'audio', or 'all'. OCR usually contains more content, so it's recommended to choose either OCR or audio rather than 'all' for better performance."- }- ]-}\ No newline at end of filediff --git a/pipes/archive/pipe-email-daily-log/pipe.ts b/pipes/archive/pipe-email-daily-log/pipe.tsdeleted file mode 100644index 7ed860ffa..000000000--- a/pipes/archive/pipe-email-daily-log/pipe.ts+++ /dev/null@@ -1,353 +0,0 @@-import * as fs from "node:fs";-import nodemailer from "nodemailer";-import { queryScreenpipe, loadPipeConfig, ContentItem, pipe } from "@screenpipe/js";-import process from "node:process";-import { z } from "zod";-import { generateObject, generateText } from "ai";-import { createOllama } from "ollama-ai-provider";--interface DailyLog {- activity: string;- category: string;- tags: string[];- timestamp: string;-}--const dailyLog = z.object({- activity: z.string(),- category: z.string(),- tags: z.array(z.string()),-});--async function generateDailyLog(- screenData: ContentItem[],- customPrompt: string,- ollamaModel: string,- ollamaApiUrl: string-): Promise<DailyLog> {- const prompt = `${customPrompt}-- Based on the following screen data, generate a concise daily log entry:-- ${JSON.stringify(screenData)}-- Return a JSON object with the following structure:- {- "activity": "Brief description of the activity",- "category": "Category of the activity like work, email, slack, etc"- "tags": ["productivity", "work", "email", "john", "salesforce", "etc"]- }--- Rules:- - Do not add backticks to the JSON eg \`\`\`json\`\`\` is WRONG- - DO NOT RETURN ANYTHING BUT JSON. NO COMMENTS BELOW THE JSON.-- `;-- const provider = createOllama({ baseURL: ollamaApiUrl });-- const response = await generateObject({- model: provider(ollamaModel),- messages: [{ role: "user", content: prompt }],- schema: dailyLog,- });-- console.log("ai answer:", response);-- const result = response.object as DailyLog;- result.timestamp = new Date().toISOString();-- return result;-}--function saveDailyLog(logEntry: DailyLog): void {- console.log("creating logs dir");- const logsDir = `${process.env.PIPE_DIR}/logs`;- console.log("logs dir:", logsDir);- console.log("saving log entry:", logEntry);- console.log("logs dir:", logsDir);- const timestamp = new Date()- .toISOString()- .replace(/:/g, "-")- .replace(/\..+/, "");- const filename = `${timestamp}-${logEntry.category.replace("/", "-")}.json`;- console.log("filename:", filename);- fs.writeFileSync(`${logsDir}/${filename}`, JSON.stringify(logEntry, null, 2));-}--async function generateDailySummary(- logs: DailyLog[],- customPrompt: string,- ollamaModel: string,- ollamaApiUrl: string-): Promise<string> {- // if logs is more than 30000 characters, truncate it- let truncatedLogs = logs;- if (logs.length > 30000) {- // HACK!- truncatedLogs = logs.slice(0, 30000);- }-- const prompt = `${customPrompt}-- Based on the following daily logs, generate a concise summary of the day's activities:-- ${JSON.stringify(truncatedLogs)}-- Provide a human-readable summary that highlights key activities and insights.`;-- console.log("daily summary prompt:", prompt);- const provider = createOllama({ baseURL: ollamaApiUrl });- const response = await generateText({- model: provider(ollamaModel),- messages: [{ role: "user", content: prompt }],- });- console.log("daily summary ollama response:", response);-- return response.text;-}--async function retry<T>(- fn: () => Promise<T>,- maxAttempts: number = 3,- delay: number = 3000-): Promise<T> {- for (let attempt = 1; attempt <= maxAttempts; attempt++) {- try {- return await fn();- } catch (error) {- if (attempt === maxAttempts) {- throw error;- }- console.log(`attempt ${attempt} failed, retrying in ${delay}ms...`);- await new Promise((resolve) => setTimeout(resolve, delay));- }- }- throw new Error("this should never happen");-}--async function sendEmail(- to: string,- password: string,- subject: string,- body: string-): Promise<void> {- await retry(async () => {- // Create a transporter using SMTP- const transporter = nodemailer.createTransport({- host: "smtp.gmail.com", // Replace with your SMTP server- port: 587,- secure: false, // Use TLS- auth: {- user: to, // assuming the sender is the same as the recipient- pass: password,- },- });-- // Send mail with defined transport object- const info = await transporter.sendMail({- from: to, // sender address- to: to, // list of receivers- subject: subject, // Subject line- text: body, // plain text body- });-- if (!info) {- throw new Error("failed to send email");- }- console.log(`email sent to ${to} with subject: ${subject}`);- });-}--function getTodayLogs(): DailyLog[] {- try {- const logsDir = `${process.env.PIPE_DIR}/logs`;- const today = new Date().toISOString().replace(/:/g, "-").split("T")[0]; // Get today's date in YYYY-MM-DD format-- console.log("reading logs dir:", logsDir);- const files = fs.readdirSync(logsDir);- console.log("files:", files);- const todayFiles = files.filter((file) => file.startsWith(today));- console.log("today's files:", todayFiles);-- const logs: DailyLog[] = [];- for (const file of todayFiles) {- const content = fs.readFileSync(`${logsDir}/${file}`, "utf8");- logs.push(JSON.parse(content));- }-- return logs;- } catch (error) {- console.warn("error getting today's logs:", error);- return [];- }-}--async function dailyLogPipeline(): Promise<void> {- console.log("starting daily log pipeline");-- const config = await loadPipeConfig();- console.log("loaded config:", JSON.stringify(config, null, 2));-- const interval = config.interval * 1000;- const summaryFrequency = config.summaryFrequency;- const emailTime = config.emailTime;- const emailAddress = config.emailAddress;- const emailPassword = config.emailPassword;- const customPrompt = config.customPrompt!;- const summaryPrompt = config.summaryPrompt!;- const ollamaModel = config.ollamaModel;- const ollamaApiUrl = config.ollamaApiUrl;- const windowName = config.windowName || "";- const appName = config.appName || "";- const pageSize = config.pageSize;- const contentType = config.contentType || "ocr";-- console.log("creating logs dir");- const logsDir = `${process.env.PIPE_DIR}/logs`;- console.log("logs dir:", logsDir);- try {- fs.mkdirSync(logsDir);- } catch (_error) {- console.warn("error creating logs dir, probably already exists");- }-- let lastEmailSent = new Date(0);-- // Send welcome email- const welcomeEmail = `- Welcome to the daily log pipeline!-- This pipe will send you a daily summary of your activities.- ${- summaryFrequency === "daily"- ? `It will run at ${emailTime} every day.`- : `It will run every ${summaryFrequency} hours.`- }- `;- await sendEmail(- emailAddress,- emailPassword,- "daily activity summary",- welcomeEmail- );-- await pipe.inbox.send({- title: "Daily Log Started",- body: "A new day of activity logging has begun. Your summary will be sent later as scheduled.",- });-- // Schedule regular log generation- pipe.scheduler- .task("generateLog")- .every(interval)- .do(async () => {- const now = new Date();- const oneMinuteAgo = new Date(now.getTime() - interval);-- const screenData = await queryScreenpipe({- startTime: oneMinuteAgo.toISOString(),- endTime: now.toISOString(),- windowName: windowName,- appName: appName,- limit: pageSize,- contentType: contentType,- });-- if (screenData && screenData.data && screenData.data.length > 0) {- const logEntry = await generateDailyLog(- screenData.data,- customPrompt,- ollamaModel,- ollamaApiUrl- );- console.log("log entry:", logEntry);- await saveDailyLog(logEntry);- }- });-- // Schedule summary generation and email sending- if (summaryFrequency === "daily") {- const [emailHour, emailMinute] = emailTime.split(":").map(Number);- pipe.scheduler- .task("dailySummary")- .every("1 day")- .at(`${emailHour}:${emailMinute}`)- .do(async () => {- await generateAndSendSummary();- });- } else if (summaryFrequency.startsWith("hourly:")) {- const hours = parseInt(summaryFrequency.split(":")[1], 10);- pipe.scheduler- .task("hourlySummary")- .every(`${hours} hours`)- .do(async () => {- await generateAndSendSummary();- });- }-- async function generateAndSendSummary() {- const todayLogs = getTodayLogs();- console.log("today's logs:", todayLogs);-- if (todayLogs.length > 0) {- const summary = await generateDailySummary(- todayLogs,- summaryPrompt,- ollamaModel,- ollamaApiUrl- );- console.log("summary:", summary);-- // Send email- await sendEmail(- emailAddress,- emailPassword,- "Daily Activity Summary",- summary- );-- // Send notification to AI inbox- await pipe.inbox.send({- title: "Daily Activity Summary",- body: "Your daily activity summary has been generated and sent to your email.",- });-- lastEmailSent = new Date();- } else {- // Send notification if no logs were found- await pipe.inbox.send({- title: "No Activity Logged",- body: "No activity logs were found for today. Make sure Screenpipe is running and capturing your screen data.",- });- }- }-- // Add a new task to send a daily start notification- pipe.scheduler- .task("dailyStartNotification")- .every("1 day")- .at("00:01") // Just after midnight- .do(async () => {- await pipe.inbox.send({- title: "Daily Log Started",- body: "A new day of activity logging has begun. Your summary will be sent later as scheduled.",- actions: [- {- label: "View Yesterday's Summary",- action: "view_yesterday_summary",- },- {- label: "Dismiss",- action: "dismiss",- },- ],- });- });-- // Start the scheduler- pipe.scheduler.start();-}--dailyLogPipeline();diff --git a/pipes/archive/pipe-find-leads-with-exa-ai/.gitignore b/pipes/archive/pipe-find-leads-with-exa-ai/.gitignoredeleted file mode 100644index 9b1ee42e8..000000000--- a/pipes/archive/pipe-find-leads-with-exa-ai/.gitignore+++ /dev/null@@ -1,175 +0,0 @@-# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore--# Logs--logs-_.log-npm-debug.log_-yarn-debug.log*-yarn-error.log*-lerna-debug.log*-.pnpm-debug.log*--# Caches--.cache--# Diagnostic reports (https://nodejs.org/api/report.html)--report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json--# Runtime data--pids-_.pid-_.seed-*.pid.lock--# Directory for instrumented libs generated by jscoverage/JSCover--lib-cov--# Coverage directory used by tools like istanbul--coverage-*.lcov--# nyc test coverage--.nyc_output--# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)--.grunt--# Bower dependency directory (https://bower.io/)--bower_components--# node-waf configuration--.lock-wscript--# Compiled binary addons (https://nodejs.org/api/addons.html)--build/Release--# Dependency directories--node_modules/-jspm_packages/--# Snowpack dependency directory (https://snowpack.dev/)--web_modules/--# TypeScript cache--*.tsbuildinfo--# Optional npm cache directory--.npm--# Optional eslint cache--.eslintcache--# Optional stylelint cache--.stylelintcache--# Microbundle cache--.rpt2_cache/-.rts2_cache_cjs/-.rts2_cache_es/-.rts2_cache_umd/--# Optional REPL history--.node_repl_history--# Output of 'npm pack'--*.tgz--# Yarn Integrity file--.yarn-integrity--# dotenv environment variable files--.env-.env.development.local-.env.test.local-.env.production.local-.env.local--# parcel-bundler cache (https://parceljs.org/)--.parcel-cache--# Next.js build output--.next-out--# Nuxt.js build / generate output--.nuxt-dist--# Gatsby files--# Comment in the public line in if your project uses Gatsby and not Next.js--# https://nextjs.org/blog/next-9-1#public-directory-support--# public--# vuepress build output--.vuepress/dist--# vuepress v2.x temp and cache directory--.temp--# Docusaurus cache and generated files--.docusaurus--# Serverless directories--.serverless/--# FuseBox cache--.fusebox/--# DynamoDB Local files--.dynamodb/--# TernJS port file--.tern-port--# Stores VSCode versions used for testing VSCode extensions--.vscode-test--# yarn v2--.yarn/cache-.yarn/unplugged-.yarn/build-state.yml-.yarn/install-state.gz-.pnp.*--# IntelliJ based IDEs-.idea--# Finder (MacOS) folder config-.DS_Storediff --git a/pipes/archive/pipe-find-leads-with-exa-ai/README.md b/pipes/archive/pipe-find-leads-with-exa-ai/README.mddeleted file mode 100644index 498dcafa4..000000000--- a/pipes/archive/pipe-find-leads-with-exa-ai/README.md+++ /dev/null@@ -1,66 +0,0 @@--### find leads with exa ai pipe--https://youtu.be/2UJMo-mkYV4--this pipe automates the process of finding potential leads based on an evolving ideal customer profile (icp). it uses screenpipe data, exa ai for company search, and openai for analysis and formatting.--#### features--- continuously updates the ideal customer profile (icp) based on user activity-- searches for potential leads using exa ai-- formats lead information using ai-- sends email notifications with potential leads-- integrates with screenpipe for data collection and notifications--#### requirements--- screenpipe installed and configured-- bun runtime-- exa ai api key-- openai api key-- gmail account for sending notifications--#### configuration--configure through screenpipe app UI or by editing the `pipe.json` file--#### development usage--1. set up the required environment variables:--```bash-export SCREENPIPE_DIR="$HOME/.screenpipe"-export PIPE_ID="pipe-find-leads-with-exa-ai"-export PIPE_FILE="pipe.ts"-export PIPE_DIR="$SCREENPIPE_DIR/pipes/pipe-find-leads-with-exa-ai"-```--2. run the pipe:--```bash-bun run $PIPE_DIR/$PIPE_FILE-```--#### how it works--1. loads the pipe configuration and initializes necessary services-2. periodically queries screenpipe for recent user activity-3. updates the ideal customer profile (icp) based on the collected data-4. searches for potential leads using exa ai based on the updated icp-5. formats lead information using ai for better readability-6. sends email notifications with potential leads and updates the icp-7. sends desktop notifications and updates the screenpipe inbox--#### customization--- adjust the `interval` in the config to change how often the pipe runs-- modify the `customPrompt` to fine-tune the icp update process-- update the `aiModel` and `aiApiUrl` to use different ai models or providers--#### notes--- ensure your gmail account is configured to allow less secure apps or use an app-specific password-- keep your api keys and email credentials secure-- the pipe creates and maintains an `icp.json` file to store the evolving ideal customer profile-diff --git a/pipes/archive/pipe-find-leads-with-exa-ai/package.json b/pipes/archive/pipe-find-leads-with-exa-ai/package.jsondeleted file mode 100644index b4be2d35b..000000000--- a/pipes/archive/pipe-find-leads-with-exa-ai/package.json+++ /dev/null@@ -1,16 +0,0 @@-{- "name": "pipe-find-leads-with-exa-ai",- "module": "pipe.ts",- "type": "module",- "devDependencies": {- "@types/bun": "latest"- },- "peerDependencies": {- "typescript": "^5.0.0"- },- "dependencies": {- "@ai-sdk/openai": "^1.0.5",- "ai": "^4.0.10",- "exa-js": "^1.3.3"- }-}\ No newline at end of filediff --git a/pipes/archive/pipe-find-leads-with-exa-ai/pipe.json b/pipes/archive/pipe-find-leads-with-exa-ai/pipe.jsondeleted file mode 100644index 6c53e989a..000000000--- a/pipes/archive/pipe-find-leads-with-exa-ai/pipe.json+++ /dev/null@@ -1,94 +0,0 @@-{- "fields": [- {- "name": "exaApiKey",- "type": "string",- "default": "",- "description": "your exa ai api key"- },- {- "name": "interval",- "type": "number",- "default": 60,- "description": "Interval in seconds to read your screen data and extract structured logs (will be used to summarize and send an email). Increase this value if using audio."- },- {- "name": "summaryFrequency",- "type": "string",- "default": "daily",- "description": "Frequency of summary emails: 'daily' for once a day at emailTime, or 'hourly:X' for every X hours (e.g., 'hourly:4' for every 4 hours)"- },- {- "name": "emailTime",- "type": "time",- "default": "11:00",- "description": "Time to send daily summary email (used only if summaryFrequency is 'daily')"- },- {- "name": "emailAddress",- "type": "string",- "default": "",- "description": "Email address to send the daily summary to"- },- {- "name": "emailPassword",- "type": "string",- "default": "",- "description": "App specific password for your gmail account, https://support.google.com/accounts/answer/185833?hl=en"- },- {- "name": "aiUrl",- "type": "string",- "default": "https://api.openai.com/v1/chat/completions",- "description": "openai-compatible API URL"- },- {- "name": "aiModel",- "type": "string",- "default": "gpt-4o",- "description": "AI Model name"- },- {- "name": "aiApiKey",- "type": "string",- "default": "",- "description": "Your OpenAI API key"- },- {- "name": "pageSize",- "type": "number",- "default": 100,- "description": "Number of records to retrieve from screenpipe per page for structured extraction, keep in mind LLMs have a context window limit. Increase this value if using audio."- },- {- "name": "dailylogPrompt",- "type": "string",- "default": "",- "description": "additional prompt for the AI assistant that will be used to extract information from the screen data every specified amount of minutes"- },- {- "name": "customPrompt",- "type": "string",- "default": "my product is screenpipe, it records screens & mics 24/7 and connect it to AI, saves hours of work when dealing with CRMs, finding leads, etc.",- "description": "additional prompt for the AI assistant that will be used to generate a list of questions to post on reddit based on the logs previously extracted"- },- {- "name": "windowName",- "type": "window",- "default": "",- "description": "Specific window name to filter the screen data, for example 'gmail', 'john', 'slack', 'myCodeFile.tsx', etc. this will filter out audio"- },- {- "name": "appName",- "type": "app",- "default": "",- "description": "Specific app name to filter the screen data, for example 'gmail', 'slack', 'notion', 'google docs', etc. this will filter out audio"- },- {- "name": "contentType",- "type": "contentType",- "default": "all",- "description": "Type of content to analyze: 'ocr', 'audio', or 'all'. OCR usually contains more content, so it's recommended to choose either OCR or audio rather than 'all' for better performance."- }- ]-}\ No newline at end of filediff --git a/pipes/archive/pipe-find-leads-with-exa-ai/pipe.ts b/pipes/archive/pipe-find-leads-with-exa-ai/pipe.tsdeleted file mode 100644index b7068b157..000000000--- a/pipes/archive/pipe-find-leads-with-exa-ai/pipe.ts+++ /dev/null@@ -1,316 +0,0 @@-import * as fs from "node:fs";-import nodemailer from "nodemailer";-import { ContentItem, pipe } from "https://raw.githubusercontent.com/mediar-ai/screenpipe/main/screenpipe-js/main.ts";-import process from "node:process";-import Exa from "exa-js";-import { generateObject, generateText } from "ai";-import { createOpenAI } from "@ai-sdk/openai";-import { z } from "zod";-import * as path from "node:path";--const icpSchema = z.object({- idealCustomerProfile: z.object({- industry: z.string().optional(),- companySize: z.string().optional(),- jobTitles: z.array(z.string()).optional(),- painPoints: z.array(z.string()).optional(),- interests: z.array(z.string()).optional(),- technologies: z.array(z.string()).optional(),- demographics: z- .object({- location: z.string().optional(),- age: z.string().optional(),- gender: z.string().optional(),- })- .optional(),- }),-});--async function dailyLeadsPipeline(): Promise<void> {- console.log("starting daily leads pipeline");-- const config = pipe.loadPipeConfig();- console.log("loaded config:", JSON.stringify(config, null, 2));-- const interval = config.interval * 1000;- const emailAddress = config.emailAddress;- const emailPassword = config.emailPassword;- const customPrompt = config.customPrompt;- const gptModel = config.aiModel;- const gptApiUrl = config.aiApiUrl;- const openaiApiKey = config.aiApiKey;- const windowName = config.windowName || "";- const appName = config.appName || "";- const pageSize = config.pageSize;- const exaApiKey = config.exaApiKey;-- const exa = new Exa(exaApiKey);-- const icpFilePath = path.join(process.env.PIPE_DIR!, "icp.json");-- while (true) {- try {- const now = new Date();- const oneMinuteAgo = new Date(now.getTime() - interval);-- const screenData = await pipe.queryScreenpipe({- startTime: oneMinuteAgo.toISOString(),- endTime: now.toISOString(),- windowName: windowName,- appName: appName,- limit: pageSize,- contentType: "all",- });-- if (screenData && screenData.data && screenData.data.length > 0) {- const currentICP = loadICP(icpFilePath);- const updatedICP = await updateICP(- screenData.data,- currentICP,- customPrompt,- gptModel,- gptApiUrl,- openaiApiKey- );- saveICP(icpFilePath, updatedICP);- console.log("updated icp:", updatedICP);-- const potentialLeads = await findPotentialLeadsWithExa(- exa,- updatedICP,- gptModel,- gptApiUrl,- openaiApiKey- );- console.log("potential leads:", potentialLeads);-- if (potentialLeads.length > 0) {- const emailContent = generateLeadEmailContent(- potentialLeads,- updatedICP- );-- await sendEmail(- emailAddress,- emailPassword,- "potential leads found",- emailContent- );- await pipe.inbox.send({- title: "potential leads",- body: emailContent,- });- await pipe.sendDesktopNotification({- title: "potential leads",- body: "just sent you some potential leads",- });- }- }- } catch (error) {- console.warn("error in daily leads pipeline:", error);- }- console.log("sleeping for", interval, "ms");- await new Promise((resolve) => setTimeout(resolve, interval));- }-}--function loadICP(- filePath: string-): z.infer<typeof icpSchema>["idealCustomerProfile"] {- try {- if (!fs.existsSync(filePath)) {- console.log("icp file not found, creating new one");- const emptyICP = {};- saveICP(filePath, emptyICP);- return emptyICP;- }- const data = fs.readFileSync(filePath, "utf8");- return JSON.parse(data);- } catch (error) {- console.warn("failed to load icp, returning empty object:", error);- return {};- }-}--function saveICP(- filePath: string,- icp: z.infer<typeof icpSchema>["idealCustomerProfile"]-): void {- fs.writeFileSync(filePath, JSON.stringify(icp, null, 2));-}--async function updateICP(- screenData: ContentItem[],- currentICP: z.infer<typeof icpSchema>["idealCustomerProfile"],- customPrompt: string,- gptModel: string,- gptApiUrl: string,- openaiApiKey: string-): Promise<z.infer<typeof icpSchema>["idealCustomerProfile"]> {- const prompt = `${customPrompt}-- based on the following screen and audio data, analyze the user's activity and update the existing ideal customer profile (icp):-- current icp:- ${JSON.stringify(currentICP, null, 2)}-- new screen data:- ${JSON.stringify(screenData)}-- rules:- - focus on updating the icp based on the user's recent interests, browsing habits, and content they engage with- - consider new industry trends, technologies used, and pain points discussed- - maintain consistency with the existing icp, only update or add information when there's strong evidence- - do not remove existing information unless directly contradicted by new data- `;-- const provider = createOpenAI({- apiKey: openaiApiKey,- baseURL: gptApiUrl,- });-- const response = await generateObject({- model: provider(gptModel),- messages: [{ role: "user", content: prompt }],- schema: icpSchema,- });-- console.log("ai response for icp update:", response.object);-- return response.object.idealCustomerProfile;-}--async function findPotentialLeadsWithExa(- exa: Exa,- icp: z.infer<typeof icpSchema>["idealCustomerProfile"],- gptModel: string,- gptApiUrl: string,- openaiApiKey: string-): Promise<string[]> {- const query = `companies in ${icp.industry || "any industry"}- with ${icp.companySize || "any company size"}- using ${icp.technologies?.join(", ") || "any technologies"}- ${- icp.demographics?.location- ? `in ${icp.demographics.location}`- : ""- }`;-- const results = await exa.searchAndContents(query, {- type: "neural",- useAutoprompt: true,- numResults: 10,- text: true,- category: "company",- });-- const formattedResults = await formatLeadsWithAI(- results.results,- icp,- gptModel,- gptApiUrl,- openaiApiKey- );- return formattedResults;-}--async function formatLeadsWithAI(- leads: any[],- icp: z.infer<typeof icpSchema>["idealCustomerProfile"],- gptModel: string,- gptApiUrl: string,- openaiApiKey: string-): Promise<string[]> {- const provider = createOpenAI({- apiKey: openaiApiKey,- baseURL: gptApiUrl,- });-- const formattedLeads = [];-- for (const lead of leads) {- const prompt = `- Format the following company information in markdown and identify potential pain points based on the given ICP:-- Company: ${lead.title}- URL: ${lead.url}- Summary: ${lead.text}-- ICP:- ${JSON.stringify(icp, null, 2)}-- Rules:- - Use markdown formatting- - Highlight the company name as a header- - Include the URL- - Provide a brief summary- - Identify 2-3 potential pain points based on the ICP and company information- - Keep the total output under 200 words- `;-- const response = await generateText({- model: provider(gptModel),- messages: [{ role: "user", content: prompt }],- });-- formattedLeads.push(response.text);- }-- return formattedLeads;-}--function generateLeadEmailContent(- potentialLeads: string[],- icp: z.infer<typeof icpSchema>["idealCustomerProfile"]-): string {- let content = "# ideal customer profile:\n\n";- content += "```json\n" + JSON.stringify(icp, null, 2) + "\n```\n\n";- content += "# potential leads found:\n\n";-- for (const lead of potentialLeads) {- content += lead + "\n\n";- }-- return content;-}--async function sendEmail(- to: string,- password: string,- subject: string,- body: string-): Promise<void> {- const transporter = nodemailer.createTransport({- host: "smtp.gmail.com",- port: 587,- secure: false,- auth: {- user: to,- pass: password,- },- });-- const info = await transporter.sendMail({- from: to,- to: to,- subject: subject,- text: body,- });-- if (!info) {- throw new Error("failed to send email");- }- console.log(`email sent to ${to} with subject: ${subject}`);-}--dailyLeadsPipeline();--/*-export SCREENPIPE_DIR="$HOME/.screenpipe"-export PIPE_ID="pipe-find-leads-with-exa-ai"-export PIPE_FILE="pipe.ts"-export PIPE_DIR="$SCREENPIPE_DIR/pipes/pipe-find-leads-with-exa-ai"--bun run pipes/pipe-find-leads-with-exa-ai/pipe.ts--*/diff --git a/pipes/archive/pipe-find-leads-with-exa-ai/tsconfig.json b/pipes/archive/pipe-find-leads-with-exa-ai/tsconfig.jsondeleted file mode 100644index 238655f2c..000000000--- a/pipes/archive/pipe-find-leads-with-exa-ai/tsconfig.json+++ /dev/null@@ -1,27 +0,0 @@-{- "compilerOptions": {- // Enable latest features- "lib": ["ESNext", "DOM"],- "target": "ESNext",- "module": "ESNext",- "moduleDetection": "force",- "jsx": "react-jsx",- "allowJs": true,-- // Bundler mode- "moduleResolution": "bundler",- "allowImportingTsExtensions": true,- "verbatimModuleSyntax": true,- "noEmit": true,-- // Best practices- "strict": true,- "skipLibCheck": true,- "noFallthroughCasesInSwitch": true,-- // Some stricter flags (disabled by default)- "noUnusedLocals": false,- "noUnusedParameters": false,- "noPropertyAccessFromIndexSignature": false- }-}diff --git a/pipes/archive/pipe-keyword-notification/.gitignore b/pipes/archive/pipe-keyword-notification/.gitignoredeleted file mode 100644index 9b1ee42e8..000000000--- a/pipes/archive/pipe-keyword-notification/.gitignore+++ /dev/null@@ -1,175 +0,0 @@-# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore--# Logs--logs-_.log-npm-debug.log_-yarn-debug.log*-yarn-error.log*-lerna-debug.log*-.pnpm-debug.log*--# Caches--.cache--# Diagnostic reports (https://nodejs.org/api/report.html)--report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json--# Runtime data--pids-_.pid-_.seed-*.pid.lock--# Directory for instrumented libs generated by jscoverage/JSCover--lib-cov--# Coverage directory used by tools like istanbul--coverage-*.lcov--# nyc test coverage--.nyc_output--# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)--.grunt--# Bower dependency directory (https://bower.io/)--bower_components--# node-waf configuration--.lock-wscript--# Compiled binary addons (https://nodejs.org/api/addons.html)--build/Release--# Dependency directories--node_modules/-jspm_packages/--# Snowpack dependency directory (https://snowpack.dev/)--web_modules/--# TypeScript cache--*.tsbuildinfo--# Optional npm cache directory--.npm--# Optional eslint cache--.eslintcache--# Optional stylelint cache--.stylelintcache--# Microbundle cache--.rpt2_cache/-.rts2_cache_cjs/-.rts2_cache_es/-.rts2_cache_umd/--# Optional REPL history--.node_repl_history--# Output of 'npm pack'--*.tgz--# Yarn Integrity file--.yarn-integrity--# dotenv environment variable files--.env-.env.development.local-.env.test.local-.env.production.local-.env.local--# parcel-bundler cache (https://parceljs.org/)--.parcel-cache--# Next.js build output--.next-out--# Nuxt.js build / generate output--.nuxt-dist--# Gatsby files--# Comment in the public line in if your project uses Gatsby and not Next.js--# https://nextjs.org/blog/next-9-1#public-directory-support--# public--# vuepress build output--.vuepress/dist--# vuepress v2.x temp and cache directory--.temp--# Docusaurus cache and generated files--.docusaurus--# Serverless directories--.serverless/--# FuseBox cache--.fusebox/--# DynamoDB Local files--.dynamodb/--# TernJS port file--.tern-port--# Stores VSCode versions used for testing VSCode extensions--.vscode-test--# yarn v2--.yarn/cache-.yarn/unplugged-.yarn/build-state.yml-.yarn/install-state.gz-.pnp.*--# IntelliJ based IDEs-.idea--# Finder (MacOS) folder config-.DS_Storediff --git a/pipes/archive/pipe-keyword-notification/README.md b/pipes/archive/pipe-keyword-notification/README.mddeleted file mode 100644index c1e6cfbe6..000000000--- a/pipes/archive/pipe-keyword-notification/README.md+++ /dev/null@@ -1,15 +0,0 @@-# pipe-keyword-notification--To install dependencies:--```bash-bun install-```--To run:--```bash-bun run pipe.ts-```--This project was created using `bun init` in bun v1.1.30. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.diff --git a/pipes/archive/pipe-keyword-notification/package.json b/pipes/archive/pipe-keyword-notification/package.jsondeleted file mode 100644index d09e9515d..000000000--- a/pipes/archive/pipe-keyword-notification/package.json+++ /dev/null@@ -1,11 +0,0 @@-{- "name": "pipe-keyword-notification",- "module": "pipe.ts",- "type": "module",- "devDependencies": {- "@types/bun": "latest"- },- "peerDependencies": {- "typescript": "^5.0.0"- }-}\ No newline at end of filediff --git a/pipes/archive/pipe-keyword-notification/pipe.json b/pipes/archive/pipe-keyword-notification/pipe.jsondeleted file mode 100644index 9e26dfeeb..000000000--- a/pipes/archive/pipe-keyword-notification/pipe.json+++ /dev/null@@ -1 +0,0 @@-{}\ No newline at end of filediff --git a/pipes/archive/pipe-keyword-notification/pipe.ts b/pipes/archive/pipe-keyword-notification/pipe.tsdeleted file mode 100644index 7f3ac175e..000000000--- a/pipes/archive/pipe-keyword-notification/pipe.ts+++ /dev/null@@ -1,110 +0,0 @@-import { pipe, ContentItem } from "@screenpipe/js";--async function monitorScreenAndNotify(): Promise<void> {- console.log("starting screen monitor");-- pipe.scheduler- .task("screenMonitor")- .every("30 seconds")- .do(async () => {- try {- console.log("checking for new screen content...");-- const now = new Date();- const fiveMinutesAgo = new Date(now.getTime() - 5 * 60 * 1000);-- console.log(- `querying from ${fiveMinutesAgo.toISOString()} to ${now.toISOString()}`- );-- const screenData = await pipe.queryScreenpipe({- startTime: fiveMinutesAgo.toISOString(),- endTime: now.toISOString(),- limit: 10,- contentType: "ocr",- });-- console.log(`found ${screenData?.data.length || 0} items to analyze`);-- if (screenData && screenData.data.length > 0) {- // Look for interesting keywords in the screen data- const keywords = [- "error",- "warning",- "failed",- "completed",- "success",- ];-- for (const item of screenData.data) {- if (item.type === "OCR") {- const text = item.content.text.toLowerCase();-- for (const keyword of keywords) {- if (text.includes(keyword)) {- console.log(`found keyword "${keyword}" in screen content`);- // Send notification with action- await pipe.inbox.send({- title: `detected "${keyword}"`,- body: `context: ${item.content.text.slice(0, 100)}...`,- actions: [- {- action: "view-details",- label: "view details",- callback: async () => {- console.log("full text:", item.content.text);- // You could open this in a viewer or send to inbox- await pipe.inbox.send({- title: `full context for "${keyword}"`,- body: item.content.text,- });- },- },- ],- });-- break; // Skip other keywords for this item- }- }- }- }- }- } catch (error) {- console.error("error monitoring screen:", error);- }- });-- pipe.scheduler.start();-}--// Start monitoring-monitorScreenAndNotify();--/*-Instructions:--1. Save this as pipe.ts in your screenpipe pipes directory--2. Run with:- ```- screenpipe pipe enable simple-notification- screenpipe- ```--For development, you can run:-```-# these are mandatory env variables-export SCREENPIPE_DIR="$HOME/.screenpipe"-export PIPE_ID="pipe-keyword-notification"-export PIPE_FILE="pipe.ts"-export PIPE_DIR="$SCREENPIPE_DIR/pipes/pipe-keyword-notification"--bun run pipes/pipe-keyword-notification/pipe.ts-```--This pipe will:-- Monitor your screen every 30 seconds-- Look for keywords like "error", "warning", etc-- Send desktop notifications when found-- Allow you to click to see full context-*/diff --git a/pipes/archive/pipe-keyword-notification/tsconfig.json b/pipes/archive/pipe-keyword-notification/tsconfig.jsondeleted file mode 100644index 238655f2c..000000000--- a/pipes/archive/pipe-keyword-notification/tsconfig.json+++ /dev/null@@ -1,27 +0,0 @@-{- "compilerOptions": {- // Enable latest features- "lib": ["ESNext", "DOM"],- "target": "ESNext",- "module": "ESNext",- "moduleDetection": "force",- "jsx": "react-jsx",- "allowJs": true,-- // Bundler mode- "moduleResolution": "bundler",- "allowImportingTsExtensions": true,- "verbatimModuleSyntax": true,- "noEmit": true,-- // Best practices- "strict": true,- "skipLibCheck": true,- "noFallthroughCasesInSwitch": true,-- // Some stricter flags (disabled by default)- "noUnusedLocals": false,- "noUnusedParameters": false,- "noPropertyAccessFromIndexSignature": false- }-}diff --git a/pipes/archive/pipe-llama32-comment-linear-while-you-work/.gitignore b/pipes/archive/pipe-llama32-comment-linear-while-you-work/.gitignoredeleted file mode 100644index 9b1ee42e8..000000000--- a/pipes/archive/pipe-llama32-comment-linear-while-you-work/.gitignore+++ /dev/null@@ -1,175 +0,0 @@-# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore--# Logs--logs-_.log-npm-debug.log_-yarn-debug.log*-yarn-error.log*-lerna-debug.log*-.pnpm-debug.log*--# Caches--.cache--# Diagnostic reports (https://nodejs.org/api/report.html)--report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json--# Runtime data--pids-_.pid-_.seed-*.pid.lock--# Directory for instrumented libs generated by jscoverage/JSCover--lib-cov--# Coverage directory used by tools like istanbul--coverage-*.lcov--# nyc test coverage--.nyc_output--# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)--.grunt--# Bower dependency directory (https://bower.io/)--bower_components--# node-waf configuration--.lock-wscript--# Compiled binary addons (https://nodejs.org/api/addons.html)--build/Release--# Dependency directories--node_modules/-jspm_packages/--# Snowpack dependency directory (https://snowpack.dev/)--web_modules/--# TypeScript cache--*.tsbuildinfo--# Optional npm cache directory--.npm--# Optional eslint cache--.eslintcache--# Optional stylelint cache--.stylelintcache--# Microbundle cache--.rpt2_cache/-.rts2_cache_cjs/-.rts2_cache_es/-.rts2_cache_umd/--# Optional REPL history--.node_repl_history--# Output of 'npm pack'--*.tgz--# Yarn Integrity file--.yarn-integrity--# dotenv environment variable files--.env-.env.development.local-.env.test.local-.env.production.local-.env.local--# parcel-bundler cache (https://parceljs.org/)--.parcel-cache--# Next.js build output--.next-out--# Nuxt.js build / generate output--.nuxt-dist--# Gatsby files--# Comment in the public line in if your project uses Gatsby and not Next.js--# https://nextjs.org/blog/next-9-1#public-directory-support--# public--# vuepress build output--.vuepress/dist--# vuepress v2.x temp and cache directory--.temp--# Docusaurus cache and generated files--.docusaurus--# Serverless directories--.serverless/--# FuseBox cache--.fusebox/--# DynamoDB Local files--.dynamodb/--# TernJS port file--.tern-port--# Stores VSCode versions used for testing VSCode extensions--.vscode-test--# yarn v2--.yarn/cache-.yarn/unplugged-.yarn/build-state.yml-.yarn/install-state.gz-.pnp.*--# IntelliJ based IDEs-.idea--# Finder (MacOS) folder config-.DS_Storediff --git a/pipes/archive/pipe-llama32-comment-linear-while-you-work/README.md b/pipes/archive/pipe-llama32-comment-linear-while-you-work/README.mddeleted file mode 100644index b6d3849d7..000000000--- a/pipes/archive/pipe-llama32-comment-linear-while-you-work/README.md+++ /dev/null@@ -1,44 +0,0 @@-### llama3.2 linear task commenter--<img width="1512" alt="Screenshot 2024-10-10 at 19 02 16" src="https://github.com/user-attachments/assets/17498b04-e7cf-465d-bcac-de7c22d4a4fc">---are you the kind of engineer who hates product management and considers it bullshit?--no worries, llama3.2 got you covered.--this pipe will automate your PM work by adding comments to linear tasks based on your screen activity or meeting audio using screenpipe and llama3.2 ai.--(please avoid watching netflix (or something else ;)) during work hours or it will be written in linear :))--#### quick setup through app ui--<img width="1312" alt="Screenshot 2024-10-10 at 20 51 22" src="https://github.com/user-attachments/assets/bf9aebad-de8e-4887-8f25-60cb408eff67">--1. run ollama:- ```- ollama run nemotron-mini:4b-instruct-q4_K_M- ```--2. set up linear:- - get your linear api key from https://linear.app/settings/api--3. configure pipe in the app ui:- - set your linear api key- - adjust interval and other settings as needed- - save and enable the pipe- - restart screenpipe recording--boom! it'll add comments to your linear tasks based on your work every 5 minutes (or your set interval).--wanna tweak it? check `pipe.ts` to adjust the ai prompt or modify the comment generation logic.--#### cli usage--```-screenpipe download https://github.com/mediar-ai/screenpipe/edit/main/pipes/pipe-llama32-comment-linear-while-you-work-screenpipe enable pipe-llama32-comment-linear-while-you-work-screenpipe-```--diff --git a/pipes/archive/pipe-llama32-comment-linear-while-you-work/package.json b/pipes/archive/pipe-llama32-comment-linear-while-you-work/package.jsondeleted file mode 100644index db971227d..000000000--- a/pipes/archive/pipe-llama32-comment-linear-while-you-work/package.json+++ /dev/null@@ -1,19 +0,0 @@-{- "name": "pipe-llama32-comment-linear-while-you-work",- "module": "pipe.ts",- "type": "module",- "devDependencies": {- "@types/bun": "latest"- },- "peerDependencies": {- "typescript": "^5.0.0"- },- "dependencies": {- "@linear/sdk": "^33.0.0",- "@screenpipe/js": "^1.0.0",- "@screenpipe/browser": "0.1.12",- "ai": "^4.0.10",- "ollama-ai-provider": "^1.0.0",- "zod": "^3.23.8"- }-}diff --git a/pipes/archive/pipe-llama32-comment-linear-while-you-work/pipe.json b/pipes/archive/pipe-llama32-comment-linear-while-you-work/pipe.jsondeleted file mode 100644index f7af9dfbd..000000000--- a/pipes/archive/pipe-llama32-comment-linear-while-you-work/pipe.json+++ /dev/null@@ -1,52 +0,0 @@-{- "fields": [- {- "name": "interval",- "type": "number",- "default": 300,- "description": "interval in seconds to stream data (default: 5 minutes)"- },- {- "name": "linearApiKey",- "type": "string",- "default": "<fill your linear api key here>",- "description": "linear api key for authentication https://linear.app/mediar/settings/api"- },- {- "name": "ollamaApiUrl",- "type": "string",- "default": "http://localhost:11434/api",- "description": "ollama api url"- },- {- "name": "ollamaModel",- "type": "string",- "default": "llama3.2:3b-instruct-q4_K_M",- "description": "ollama model"- },- {- "name": "pageSize",- "type": "number",- "default": 100,- "description": "number of records to retrieve from screenpipe per page"- },- {- "name": "customCommentPrompt",- "type": "string",- "default": "",- "description": "custom prompt to override part of the system prompt for comment generation"- },- {- "name": "windowName",- "type": "window",- "default": "",- "description": "Specific window name to filter the screen data, for example 'gmail', 'john', 'slack', 'myCodeFile.tsx', etc. this will filter out audio"- },- {- "name": "contentType",- "type": "contentType",- "default": "ocr",- "description": "Type of content to analyze: 'ocr', 'audio', or 'all'. OCR usually contains more content, so it's recommended to choose either OCR or audio rather than 'all' for better performance."- }- ]-}\ No newline at end of filediff --git a/pipes/archive/pipe-llama32-comment-linear-while-you-work/pipe.ts b/pipes/archive/pipe-llama32-comment-linear-while-you-work/pipe.tsdeleted file mode 100644index ccd4c9cbf..000000000--- a/pipes/archive/pipe-llama32-comment-linear-while-you-work/pipe.ts+++ /dev/null@@ -1,251 +0,0 @@-import { ContentItem, pipe } from "@screenpipe/js";--import { z } from "zod";-import { generateObject } from "ai";-import { createOllama } from "ollama-ai-provider";-import { LinearClient } from "@linear/sdk";--const linearSearchQuery = z.object({- query: z.string(),-});--const linearComment = z.object({- taskId: z.string(),- body: z.string(),- nothingToDo: z.boolean().optional(),-});--async function generateLinearSearchQuery(- screenData: ContentItem[],- ollamaApiUrl: string,- ollamaModel: string-): Promise<string> {- const prompt = `based on the following screen data, generate a search query for linear tasks:-- ${JSON.stringify(screenData)}-- the query should be relevant to the screen/audio data and will be used to search for relevant linear tasks in the product management tool of the user to comment on it-- return a json object with a single 'query' field containing only the text to search for in the task title. here are some examples:- - { "query": "audio" }- - { "query": "macos" }- - { "query": "windows" }- - { "query": "docs" }- - { "query": "ocr" }- - { "query": "vad" }- - { "query": "debian" }-- rules:- - format JSON correctly- - query should be relevant to the screen/audio data- - return only a short phrase or few keywords, not a full sentence- - do not add backticks to the json- - return only the json object, no additional text- `;-- const provider = createOllama({- baseURL: ollamaApiUrl,- });-- const response = await generateObject({- model: provider(ollamaModel),- messages: [{ role: "user", content: prompt }],- schema: linearSearchQuery,- });-- console.log("ai response", response);-- return response.object.query;-}--async function generateLinearComment(- screenData: ContentItem[],- relevantTasks: any[],- ollamaApiUrl: string,- ollamaModel: string,- customCommentPrompt: string-): Promise<z.infer<typeof linearComment>> {- console.log("generating linear comment for tasks:", relevantTasks);- const basePrompt = `based on the following screen data and relevant linear tasks, generate a concise, informative comment for the most relevant task:-- screen data: ${JSON.stringify(screenData)}- relevant tasks: ${JSON.stringify(relevantTasks)}-- return a json object with the following structure:- {- "taskId": "linear task id of the most relevant task (must be one of the provided task ids)",- "body": "informative comment about work done, progress made, or insights gained related to the chosen task"- "nothingToDo": "no task to comment on based on the screen data"- }-- rules:- - format JSON correctly- - taskId MUST be one of the provided task ids, do not invent new ones- - comment should directly relate to the chosen task and recent work/activity- - include specific details, metrics, or insights from the screen data if applicable- - mention progress made, challenges encountered, or next steps if applicable- - keep it concise but informative (aim for 2-3 sentences)- - use technical language appropriate for the task context- - do not add backticks to the json- - return only the json object, no additional text`;-- const prompt = customCommentPrompt- ? `${basePrompt}\n\nadditional instructions: ${customCommentPrompt}`- : basePrompt;-- const provider = createOllama({- baseURL: ollamaApiUrl,- });-- const response = await generateObject({- model: provider(ollamaModel),- messages: [{ role: "user", content: prompt }],- schema: linearComment,- });-- console.log("ai response", response);-- return response.object;-}--async function getCurrentUser(- apiKey: string-): Promise<{ id: string; name: string }> {- const client = new LinearClient({ apiKey });- const viewer = await client.viewer;- return { id: viewer.id, name: viewer.name };-}--async function addCommentToLinear(- comment: z.infer<typeof linearComment>,- apiKey: string-): Promise<void> {- const client = new LinearClient({ apiKey });- const user = await getCurrentUser(apiKey);- const commentWithMention = `<@${user.id}>: ${comment.body}`;-- try {- await client.createComment({- issueId: comment.taskId as string,- body: commentWithMention,- });- console.log("comment added to linear successfully");-- // Send inbox message- const issue = await client.issue(comment.taskId as string);- const inboxMessage = {- title: `Comment added to: ${issue.title}`,- body: `-### New comment on Linear issue--${comment.body}--[View issue in Linear](${issue.url})- `,- };- await pipe.inbox.send(inboxMessage);- } catch (error) {- console.error("linear api error:", error);- throw new Error("failed to add comment to linear");- }-}--async function searchLinearTasks(- queryText: string,- apiKey: string-): Promise<any[]> {- const client = new LinearClient({ apiKey });- const issues = await client.issues({- filter: {- title: { contains: queryText },- },- });-- return issues.nodes.map((issue) => ({- id: issue.id,- title: issue.title,- }));-}--async function streamCommentsToLinear(): Promise<void> {- console.log("starting comments stream to linear");-- const config = await pipe.loadPipeConfig();- console.log("loaded config:", JSON.stringify(config, null, 2));-- const interval = config.interval * 1000;- const apiKey = config.linearApiKey;- const ollamaApiUrl = config.ollamaApiUrl;- const ollamaModel = config.ollamaModel;- const customCommentPrompt = config.customCommentPrompt;- const windowName = config.windowName;- const contentType = config.contentType;-- // announce pipe in the inbox- await pipe.inbox.send({- title: "linear comment pipeline started",- body: `commenting on linear tasks every ${interval / 1000} seconds`,- });-- while (true) {- await new Promise((resolve) => setTimeout(resolve, interval));-- try {- const now = new Date();- const intervalAgo = new Date(now.getTime() - interval);-- const screenData = await pipe.queryScreenpipe({- startTime: intervalAgo.toISOString(),- endTime: now.toISOString(),- limit: config.pageSize,- contentType: contentType,- windowName: windowName,- });-- if (screenData && screenData.data.length > 0) {- // step 1: ask llm to generate a function call to search linear tasks- const searchQuery = await generateLinearSearchQuery(- screenData.data,- ollamaApiUrl,- ollamaModel- );-- // step 2: execute the search on linear- const relevantTasks = await searchLinearTasks(searchQuery, apiKey);-- if (relevantTasks.length === 0) {- console.log("no relevant tasks found");- continue;- }-- // step 3: ask llm to generate a comment for the most relevant task- const comment = await generateLinearComment(- screenData.data,- relevantTasks,- ollamaApiUrl,- ollamaModel,- customCommentPrompt- );-- if (comment.nothingToDo) {- console.log("no comment to add to linear");- continue;- }-- // step 4: add the comment to the linear task- await addCommentToLinear(comment, apiKey);-- // randomly send a notification- await pipe.sendDesktopNotification({- title: "linear comment pipeline update",- body: `comment added to task ${comment.taskId}`,- });- } else {- console.log("no relevant work detected in the last interval");- }- } catch (error: any) {}- await new Promise((resolve) => setTimeout(resolve, interval));- }-}--streamCommentsToLinear();diff --git a/pipes/archive/pipe-llama32-comment-linear-while-you-work/tsconfig.json b/pipes/archive/pipe-llama32-comment-linear-while-you-work/tsconfig.jsondeleted file mode 100644index 238655f2c..000000000--- a/pipes/archive/pipe-llama32-comment-linear-while-you-work/tsconfig.json+++ /dev/null@@ -1,27 +0,0 @@-{- "compilerOptions": {- // Enable latest features- "lib": ["ESNext", "DOM"],- "target": "ESNext",- "module": "ESNext",- "moduleDetection": "force",- "jsx": "react-jsx",- "allowJs": true,-- // Bundler mode- "moduleResolution": "bundler",- "allowImportingTsExtensions": true,- "verbatimModuleSyntax": true,- "noEmit": true,-- // Best practices- "strict": true,- "skipLibCheck": true,- "noFallthroughCasesInSwitch": true,-- // Some stricter flags (disabled by default)- "noUnusedLocals": false,- "noUnusedParameters": false,- "noPropertyAccessFromIndexSignature": false- }-}diff --git a/pipes/archive/pipe-meeting-summary-by-email/README.md b/pipes/archive/pipe-meeting-summary-by-email/README.mddeleted file mode 100644index a1b5a9a0e..000000000--- a/pipes/archive/pipe-meeting-summary-by-email/README.md+++ /dev/null@@ -1,10 +0,0 @@-<img width="1312" alt="Screenshot 2024-10-10 at 20 55 35" src="https://github.com/user-attachments/assets/f5e4c7c5-cdf2-4357-8c86-24add74c8456">--just run ollama and configure your stuff :)---this will send you meeting summaries over mail, summarized by llama3.2, works with any audio app on your computer--<img width="644" alt="Screenshot 2024-09-26 at 19 30 19" src="https://github.com/user-attachments/assets/b5ae6f47-3c5f-44fd-809b-23bfba316463">--https://youtu.be/7VGPG3hl2JYdiff --git a/pipes/archive/pipe-meeting-summary-by-email/pipe.json b/pipes/archive/pipe-meeting-summary-by-email/pipe.jsondeleted file mode 100644index 758e7eb88..000000000--- a/pipes/archive/pipe-meeting-summary-by-email/pipe.json+++ /dev/null@@ -1,40 +0,0 @@-{- "fields": [- {- "name": "pollingInterval",- "type": "number",- "default": 3600000,- "description": "interval in milliseconds to poll audio content (default: 1 hour)"- },- {- "name": "emailAddress",- "type": "string",- "default": "<fill your email address here>",- "description": "email address to send the meeting summary to"- },- {- "name": "emailPassword",- "type": "string",- "default": "<fill your email password here>",- "description": "app specific password for your gmail account, https://support.google.com/accounts/answer/185833?hl=en"- },- {- "name": "aiApiUrl",- "type": "string",- "default": "http://localhost:11434/api/chat",- "description": "ai api url, can be ollama, openai, any openai compatible api, for openai use https://api.openai.com/v1/chat/completions"- },- {- "name": "aiModel",- "type": "string",- "default": "llama3.2:3b-instruct-q4_K_M",- "description": "ai model"- },- {- "name": "customSummaryPrompt",- "type": "string",- "default": "summarize the following meeting transcript, there might be multiple meeting in the transcript, make sure to properly separate them, focusing on key points, action items, and decisions made:",- "description": "custom prompt for summarizing the meeting"- }- ]-}\ No newline at end of filediff --git a/pipes/archive/pipe-meeting-summary-by-email/pipe.ts b/pipes/archive/pipe-meeting-summary-by-email/pipe.tsdeleted file mode 100644index d6708f1a1..000000000--- a/pipes/archive/pipe-meeting-summary-by-email/pipe.ts+++ /dev/null@@ -1,238 +0,0 @@-import {- queryScreenpipe,- loadPipeConfig,- ContentItem,- extractJsonFromLlmResponse,-} from "@screenpipe/js";-import nodemailer from "nodemailer";--async function summarizeAudio(- audioData: ContentItem[],- aiApiUrl: string,- aiModel: string,- customSummaryPrompt: string-): Promise<string> {- const prompt = `Very important instructions to follow: "${customSummaryPrompt}"-- summarize the following meeting transcript:-- ${JSON.stringify(audioData)}-- provide a concise summary of the key points discussed in the meeting.`;-- const response = await fetch(aiApiUrl, {- headers: {- "Content-Type": "application/json",- },- method: "POST",- body: JSON.stringify({- model: aiModel,- messages: [{ role: "user", content: prompt }],- stream: false,- }),- });-- if (!response.ok) {- throw new Error(`http error! status: ${response.status}`);- }-- const result = await response.json();- return result.message.content;-}--async function sendEmail(- to: string,- password: string,- subject: string,- body: string-): Promise<void> {- // Create a transporter using SMTP- const transporter = nodemailer.createTransport({- host: "smtp.gmail.com", // Replace with your SMTP server- port: 587,- secure: false, // Use TLS- auth: {- user: to, // assuming the sender is the same as the recipient- pass: password,- },- });-- // Send mail with defined transport object- const info = await transporter.sendMail({- from: to, // sender address- to: to, // list of receivers- subject: subject, // Subject line- text: body, // plain text body- });-- if (!info) {- throw new Error("failed to send email");- }- console.log(`email sent to ${to} with subject: ${subject}`);-}--interface TimeAdjustment {- shouldAdjust: boolean;- shouldPollDataBeforeOrAfter: boolean;-}--async function checkTimeAdjustment(- audioData: ContentItem[],- aiApiUrl: string,- aiModel: string-): Promise<TimeAdjustment> {- const prompt = `Analyze the following meeting transcript:-- ${JSON.stringify(audioData)}-- Determine if this appears to be a complete meeting or if it might be truncated.- Return a JSON object with the following structure:- {- "shouldAdjust": boolean,- "shouldPollDataBeforeOrAfter": boolean,- }-- Rules:- - Set shouldAdjust to true if the meeting seems incomplete- - set shouldPollDataBeforeOrAfter to true if we need to get data before or after the meeting timestamp to make it complete- - If the meeting seems complete, set all values to 0- - Do not add backticks to the JSON- - Return only the JSON object, no additional text, if you return anything but JSON, the whole code will crash and the user will be very sad- `;-- const response = await fetch(aiApiUrl, {- headers: {- "Content-Type": "application/json",- },- method: "POST",- body: JSON.stringify({- model: aiModel,- messages: [{ role: "user", content: prompt }],- stream: false,- response_format: { type: "json_object" },- }),- });-- if (!response.ok) {- console.log("ollama response:", await response.text());- throw new Error(`http error! status: ${response.status}`);- }-- const result = await response.json();-- console.log("ai answer:", result);-- let content;- try {- content = extractJsonFromLlmResponse(result.message.content);- } catch (error) {- console.warn("failed to parse ai response:", error, result);- throw new Error("invalid ai response format");- }-- return content;-}--async function meetingSummaryPipeline(): Promise<void> {- console.log("starting meeting summary pipeline");-- const config = await loadPipeConfig();- console.log("loaded config:", JSON.stringify(config, null, 2));-- const {- pollingInterval,- emailAddress,- emailPassword,- aiApiUrl,- aiModel,- customSummaryPrompt,- } = config;-- console.log("pollingInterval:", pollingInterval);- console.log("emailAddress:", emailAddress);- console.log("emailPassword:", emailPassword);- console.log("aiApiUrl:", aiApiUrl);- console.log("aiModel:", aiModel);-- while (true) {- try {- const now = new Date();- const oneHourAgo = new Date(now.getTime() - 60 * 60 * 1000);- console.log("oneHourAgo:", oneHourAgo);- console.log("now:", now);-- const audioData = await queryScreenpipe({- startTime: oneHourAgo.toISOString(),- endTime: now.toISOString(),- contentType: "audio",- limit: 10_000,- });-- console.log("audioData:", audioData);-- if (audioData && audioData.data && audioData.data.length > 0) {- console.log("audioData.data:", audioData.data);-- // Check if we need to adjust the time range- const timeAdjustment = await checkTimeAdjustment(- audioData.data,- aiApiUrl,- aiModel- );-- if (timeAdjustment.shouldAdjust) {- // if we need to adjust the time range, we need to query the data before or after the meeting timestamp to make it complete- // if it's before, we need to remove 30 minutes from the start- // if it's after, we need to add 30 minutes to the end-- const adjustedStart = timeAdjustment.shouldPollDataBeforeOrAfter- ? new Date(oneHourAgo.getTime() - 30 * 60 * 1000)- : oneHourAgo;- const adjustedEnd = timeAdjustment.shouldPollDataBeforeOrAfter- ? new Date(now.getTime() + 30 * 60 * 1000)- : now;-- console.log("Adjusting time range:");- console.log("New start:", adjustedStart);- console.log("New end:", adjustedEnd);-- // Query additional data- const additionalData = await queryScreenpipe({- startTime: adjustedStart.toISOString(),- endTime: adjustedEnd.toISOString(),- contentType: "audio",- limit: 10_000,- });-- // Merge the additional data with the original data- if (additionalData && additionalData.data) {- audioData.data = [...audioData.data, ...additionalData.data];- }- }-- console.log("now summarizing");-- const summary = await summarizeAudio(- audioData.data,- aiApiUrl,- aiModel,- customSummaryPrompt- );- console.log("summary:", summary);-- await sendEmail(- emailAddress,- emailPassword,- "meeting summary",- summary- );- }- } catch (error) {- console.warn("error in meeting summary pipeline:", error);- }- console.log("sleeping for", pollingInterval, "ms");- await new Promise((resolve) => setTimeout(resolve, pollingInterval));- }-}--meetingSummaryPipeline();diff --git a/pipes/archive/pipe-obsidian-time-logs/.gitignore b/pipes/archive/pipe-obsidian-time-logs/.gitignoredeleted file mode 100644index 9b1ee42e8..000000000--- a/pipes/archive/pipe-obsidian-time-logs/.gitignore+++ /dev/null@@ -1,175 +0,0 @@-# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore--# Logs--logs-_.log-npm-debug.log_-yarn-debug.log*-yarn-error.log*-lerna-debug.log*-.pnpm-debug.log*--# Caches--.cache--# Diagnostic reports (https://nodejs.org/api/report.html)--report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json--# Runtime data--pids-_.pid-_.seed-*.pid.lock--# Directory for instrumented libs generated by jscoverage/JSCover--lib-cov--# Coverage directory used by tools like istanbul--coverage-*.lcov--# nyc test coverage--.nyc_output--# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)--.grunt--# Bower dependency directory (https://bower.io/)--bower_components--# node-waf configuration--.lock-wscript--# Compiled binary addons (https://nodejs.org/api/addons.html)--build/Release--# Dependency directories--node_modules/-jspm_packages/--# Snowpack dependency directory (https://snowpack.dev/)--web_modules/--# TypeScript cache--*.tsbuildinfo--# Optional npm cache directory--.npm--# Optional eslint cache--.eslintcache--# Optional stylelint cache--.stylelintcache--# Microbundle cache--.rpt2_cache/-.rts2_cache_cjs/-.rts2_cache_es/-.rts2_cache_umd/--# Optional REPL history--.node_repl_history--# Output of 'npm pack'--*.tgz--# Yarn Integrity file--.yarn-integrity--# dotenv environment variable files--.env-.env.development.local-.env.test.local-.env.production.local-.env.local--# parcel-bundler cache (https://parceljs.org/)--.parcel-cache--# Next.js build output--.next-out--# Nuxt.js build / generate output--.nuxt-dist--# Gatsby files--# Comment in the public line in if your project uses Gatsby and not Next.js--# https://nextjs.org/blog/next-9-1#public-directory-support--# public--# vuepress build output--.vuepress/dist--# vuepress v2.x temp and cache directory--.temp--# Docusaurus cache and generated files--.docusaurus--# Serverless directories--.serverless/--# FuseBox cache--.fusebox/--# DynamoDB Local files--.dynamodb/--# TernJS port file--.tern-port--# Stores VSCode versions used for testing VSCode extensions--.vscode-test--# yarn v2--.yarn/cache-.yarn/unplugged-.yarn/build-state.yml-.yarn/install-state.gz-.pnp.*--# IntelliJ based IDEs-.idea--# Finder (MacOS) folder config-.DS_Storediff --git a/pipes/archive/pipe-obsidian-time-logs/README.md b/pipes/archive/pipe-obsidian-time-logs/README.mddeleted file mode 100644index 2b218b758..000000000--- a/pipes/archive/pipe-obsidian-time-logs/README.md+++ /dev/null@@ -1,48 +0,0 @@-### obsidian time log--<img width="1512" alt="Screenshot 2024-11-26 at 11 05 53 AM" src="https://github.com/user-attachments/assets/7883b8fc-caac-4627-8400-3ccf18b6a602">----automates logging of work to obsidian using screenpipe and openai/ollama--#### quick setup--1. install screenpipe and git clone this repo-```-git clone https://github.com/mediar-ai/screenpipe.git-cd screenpipe-```--2. set up AI provider:- Option 1 - OpenAI:- - Set gptModel (e.g. "gpt-4o") and openaiApiKey in pipe.json-- Option 2 - Ollama (default):- - Install Ollama: follow instructions at https://github.com/jmorganca/ollama- - Run `ollama run llama3.2:3b-instruct-q4_K_M`- - Optionally customize ollamaApiUrl and ollamaModel in pipe.json--3. set up obsidian:- - create a folder in your obsidian vault for time entries- - set obsidianPath in pipe.json to your obsidian vault time entries folder path--4. optionally customize other settings in pipe.json:- - interval: how often to check for new entries- - customPrompt: customize the AI prompt- - pageSize: number of screen records to process--5. run the pipe:-```-screenpipe pipe download ./pipes/pipe-obsidian-time-logs-screenpipe pipe enable pipe-obsidian-time-logs-screenpipe-```--The pipe will:-- Monitor your screen activity at the configured interval-- Generate engineering log entries using OpenAI or Ollama-- Save entries to daily markdown files in your obsidian vault-- Each day's entries will be saved in YYYY-MM-DD.md format-- Entries are formatted as markdown tables with Title, Description, Tags, and Time Spent-- New entries are appended to existing daily filesdiff --git a/pipes/archive/pipe-obsidian-time-logs/package.json b/pipes/archive/pipe-obsidian-time-logs/package.jsondeleted file mode 100644index aad5cac63..000000000--- a/pipes/archive/pipe-obsidian-time-logs/package.json+++ /dev/null@@ -1,19 +0,0 @@-{- "name": "pipe-obsidian-time-logs",- "module": "pipe.ts",- "type": "module",- "dependencies": {- "@ai-sdk/openai": "^1.0.7",- "@screenpipe/js": "^1.0.0",- "@screenpipe/browser": "0.1.12",- "ai": "^4.0.13",- "ollama-ai-provider": "^1.1.0",- "zod": "^3.23.8"- },- "devDependencies": {- "@types/bun": "latest"- },- "peerDependencies": {- "typescript": "^5.7.2"- }-}diff --git a/pipes/archive/pipe-obsidian-time-logs/pipe.json b/pipes/archive/pipe-obsidian-time-logs/pipe.jsondeleted file mode 100644index 74d96634b..000000000--- a/pipes/archive/pipe-obsidian-time-logs/pipe.json+++ /dev/null@@ -1,34 +0,0 @@-{- "fields": [- {- "name": "interval",- "type": "number",- "default": 60,- "description": "Interval in seconds to stream data"- },- {- "name": "obsidianPath",- "type": "path",- "default": "",- "description": "Path to the Obsidian vault where time entries will be saved"- },- {- "name": "customPrompt",- "type": "string",- "default": "",- "description": "Custom prompt to use for the AI model"- },- {- "name": "ollamaModel",- "type": "string",- "default": "llama3.2:3b-instruct-q4_K_M",- "description": "Ollama Model. Used if openaiApiKey is not provided"- },- {- "name": "pageSize",- "type": "number",- "default": 100,- "description": "Number of records to retrieve from Screenpipe per page"- }- ]- }diff --git a/pipes/archive/pipe-obsidian-time-logs/pipe.ts b/pipes/archive/pipe-obsidian-time-logs/pipe.tsdeleted file mode 100644index e96fa5ed3..000000000--- a/pipes/archive/pipe-obsidian-time-logs/pipe.ts+++ /dev/null@@ -1,215 +0,0 @@-import { z } from "zod";-import { generateObject } from "ai";-import { createOllama, ollama } from "ollama-ai-provider";-import { pipe, ContentItem } from "@screenpipe/js";-import * as fs from "fs/promises";-import * as path from "path";--const workLog = z.object({- title: z.string(),- description: z.string(),- tags: z.array(z.string()),- timeSpent: z.string(), // in seconds-});--type WorkLog = z.infer<typeof workLog>;----async function generateWorkLog(- screenData: ContentItem[],- model: string,- customPrompt?: string-): Promise<WorkLog> {- const defaultPrompt = `Based on the following screen data, generate a concise work activity log entry:-- ${JSON.stringify(screenData)}-- Return a JSON object with the following structure:- {- "title": "Brief title of the activity",- "description": "Concise description of what was done",- "tags": ["#tag1", "#tag2", "#tag3"],- "timeSpent": "5" // actual time spent in minutes- }- Provide 1-3 relevant tags related to the work. Each tag MUST start with #.- Estimate time spent in minutes based on the activities timestamps.`;-- const prompt = customPrompt || defaultPrompt;- const provider = ollama(model);-- const response = await generateObject({- model: provider,- messages: [{ role: "user", content: prompt }],- schema: workLog,- });-- return response.object;-}--async function syncLogToObsidian(- logEntry: WorkLog,- obsidianPath: string-): Promise<void> {- try {- console.log("syncLogToObsidian", logEntry);-- const today = new Date();- const filename = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, "0")}-${String(today.getDate()).padStart(2, "0")}.md`;- const filePath = path.join(obsidianPath, filename);-- const tableRow = `| ${logEntry.title} | ${- logEntry.description- } | ${logEntry.tags.join(", ")} | ${logEntry.timeSpent} min |\n`;-- try {- await fs.access(filePath);- await fs.appendFile(filePath, tableRow, "utf8");- } catch {- const content = `| Title | Description | Tags | Time Spent |\n|-------|-------------|------|------------|\n${tableRow}`;- await fs.writeFile(filePath, content, "utf8");- }-- console.log("work log synced to obsidian successfully");-- await pipe.inbox.send({- title: "work log synced",- body: `new work log entry synced to: ${filePath}`,- });- } catch (error) {- console.error("error syncing work log to obsidian:", error);- await pipe.inbox.send({- title: "work log error",- body: `error syncing work log to: ${obsidianPath}\nerror: ${error}`,- });- }-}--function streamWorkLogs(): void {- console.log("starting work logs stream");-- const config = pipe.loadPipeConfig();- console.log("loaded config:", JSON.stringify(config, null, 2));-- let successfulLogsCount = 0;- const NOTIFICATION_THRESHOLD = 5;-- const interval = config.interval * 1000;- const obsidianPath = config.obsidianPath;- const customPrompt = config.customPrompt;- const pageSize = config.pageSize;- const model = config.gptModel || config.ollamaModel;-- pipe.inbox.send({- title: "obsidian time logs stream started",- body: `monitoring work activity every ${config.interval / 1000} seconds`,- });- pipe.scheduler- .task("generateWorkLog")- .every(interval)- .do(async () => {- try {- const now = new Date();- const oneHourAgo = new Date(now.getTime() - interval);-- const screenData = await pipe.queryScreenpipe({- startTime: oneHourAgo.toISOString(),- endTime: now.toISOString(),- limit: pageSize,- contentType: "ocr",- });-- if (screenData && screenData.data.length > 0) {- const logEntry = await generateWorkLog(- screenData.data,- model,- customPrompt- );- await syncLogToObsidian(logEntry, obsidianPath);-- successfulLogsCount++;- if (successfulLogsCount >= NOTIFICATION_THRESHOLD) {- const filePath = path.join(obsidianPath, `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}.md`);- await pipe.inbox.send({- title: "work logs batch synced",- body: `synced ${NOTIFICATION_THRESHOLD} work log entries to: ${filePath}`,- });- successfulLogsCount = 0;- }- } else {- console.log("no relevant activity detected in the last interval");- }- } catch (error) {- console.error("error in work log pipeline:", error);- await pipe.inbox.send({- title: "work log error",- body: `error in work log pipeline: ${error}`,- });- }- });-- pipe.inbox.send({- title: "work log stream started",- body: `monitoring work activity every ${- config.interval / 1000- } seconds. notifications will be batched every ${NOTIFICATION_THRESHOLD} successful logs.`,- });-- pipe.scheduler.start();-}--streamWorkLogs();--/*---# these are mandatory env variables-export SCREENPIPE_DIR="$HOME/.screenpipe"-export PIPE_ID="pipe-obsidian-time-logs"-export PIPE_FILE="pipe.ts"-export PIPE_DIR="$SCREENPIPE_DIR/pipes/pipe-obsidian-time-logs"--bun run pipes/pipe-obsidian-time-logs/pipe.ts--Instructions to run this pipe:--1. install screenpipe and git clone this repo- ```- git clone https://github.com/mediar-ai/screenpipe.git- cd screenpipe- ```--2. set up AI provider:- Option 1 - OpenAI:- - Set gptModel (e.g. "gpt-4o") and openaiApiKey in pipe.json-- Option 2 - Ollama (default):- - Install Ollama: follow instructions at https://github.com/jmorganca/ollama- - Run `ollama run llama3.2:3b-instruct-q4_K_M`- - Optionally customize ollamaApiUrl and ollamaModel in pipe.json--3. set up obsidian:- - create a folder in your obsidian vault for time entries- - set obsidianPath in pipe.json to your obsidian vault time entries folder path--4. optionally customize other settings in pipe.json:- - interval: how often to check for new entries- - customPrompt: customize the AI prompt- - pageSize: number of screen records to process--5. run the pipe:- ```- screenpipe pipe download ./pipes/pipe-obsidian-time-logs- screenpipe pipe enable pipe-obsidian-time-logs- screenpipe- ```--The pipe will:-- Monitor your screen activity at the configured interval-- Generate work activity log entries using OpenAI or Ollama-- Save entries to daily markdown files in your obsidian vault-- Each day's entries will be saved in YYYY-MM-DD.md format-- Entries are formatted as markdown tables with Title, Description, Tags, and Time Spent-- New entries are appended to existing daily files--*/diff --git a/pipes/archive/pipe-obsidian-time-logs/tsconfig.json b/pipes/archive/pipe-obsidian-time-logs/tsconfig.jsondeleted file mode 100644index 238655f2c..000000000--- a/pipes/archive/pipe-obsidian-time-logs/tsconfig.json+++ /dev/null@@ -1,27 +0,0 @@-{- "compilerOptions": {- // Enable latest features- "lib": ["ESNext", "DOM"],- "target": "ESNext",- "module": "ESNext",- "moduleDetection": "force",- "jsx": "react-jsx",- "allowJs": true,-- // Bundler mode- "moduleResolution": "bundler",- "allowImportingTsExtensions": true,- "verbatimModuleSyntax": true,- "noEmit": true,-- // Best practices- "strict": true,- "skipLibCheck": true,- "noFallthroughCasesInSwitch": true,-- // Some stricter flags (disabled by default)- "noUnusedLocals": false,- "noUnusedParameters": false,- "noPropertyAccessFromIndexSignature": false- }-}diff --git a/pipes/archive/pipe-screen-time-storyteller/.gitignore b/pipes/archive/pipe-screen-time-storyteller/.gitignoredeleted file mode 100644index 9b1ee42e8..000000000--- a/pipes/archive/pipe-screen-time-storyteller/.gitignore+++ /dev/null@@ -1,175 +0,0 @@-# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore--# Logs--logs-_.log-npm-debug.log_-yarn-debug.log*-yarn-error.log*-lerna-debug.log*-.pnpm-debug.log*--# Caches--.cache--# Diagnostic reports (https://nodejs.org/api/report.html)--report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json--# Runtime data--pids-_.pid-_.seed-*.pid.lock--# Directory for instrumented libs generated by jscoverage/JSCover--lib-cov--# Coverage directory used by tools like istanbul--coverage-*.lcov--# nyc test coverage--.nyc_output--# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)--.grunt--# Bower dependency directory (https://bower.io/)--bower_components--# node-waf configuration--.lock-wscript--# Compiled binary addons (https://nodejs.org/api/addons.html)--build/Release--# Dependency directories--node_modules/-jspm_packages/--# Snowpack dependency directory (https://snowpack.dev/)--web_modules/--# TypeScript cache--*.tsbuildinfo--# Optional npm cache directory--.npm--# Optional eslint cache--.eslintcache--# Optional stylelint cache--.stylelintcache--# Microbundle cache--.rpt2_cache/-.rts2_cache_cjs/-.rts2_cache_es/-.rts2_cache_umd/--# Optional REPL history--.node_repl_history--# Output of 'npm pack'--*.tgz--# Yarn Integrity file--.yarn-integrity--# dotenv environment variable files--.env-.env.development.local-.env.test.local-.env.production.local-.env.local--# parcel-bundler cache (https://parceljs.org/)--.parcel-cache--# Next.js build output--.next-out--# Nuxt.js build / generate output--.nuxt-dist--# Gatsby files--# Comment in the public line in if your project uses Gatsby and not Next.js--# https://nextjs.org/blog/next-9-1#public-directory-support--# public--# vuepress build output--.vuepress/dist--# vuepress v2.x temp and cache directory--.temp--# Docusaurus cache and generated files--.docusaurus--# Serverless directories--.serverless/--# FuseBox cache--.fusebox/--# DynamoDB Local files--.dynamodb/--# TernJS port file--.tern-port--# Stores VSCode versions used for testing VSCode extensions--.vscode-test--# yarn v2--.yarn/cache-.yarn/unplugged-.yarn/build-state.yml-.yarn/install-state.gz-.pnp.*--# IntelliJ based IDEs-.idea--# Finder (MacOS) folder config-.DS_Storediff --git a/pipes/archive/pipe-screen-time-storyteller/2024-10-05-narrative-summary.json b/pipes/archive/pipe-screen-time-storyteller/2024-10-05-narrative-summary.jsondeleted file mode 100644index 80d2d6ac5..000000000--- a/pipes/archive/pipe-screen-time-storyteller/2024-10-05-narrative-summary.json+++ /dev/null@@ -1,9 +0,0 @@-{- "summary": "Today was an intense dive into the world of coding and troubleshooting. I spent hours poring over complex TypeScript files, wrestling with Deno runtime issues, and trying to piece together a project called 'Screen Time Storyteller'. The day felt like a rollercoaster - moments of breakthrough when I realized I needed to use the pipe object for certain interactions, followed by frustrating periods of persistent errors. Despite the challenges, I felt a sense of growth as I delved deeper into understanding the intricacies of the codebase and runtime environment. It wasn't all coding though; I also explored some DeFi concepts, possibly for a hackathon project involving real-time trading and liquidity provision. As the day wound down, I found myself searching for ways to close ports on macOS, perhaps troubleshooting yet another development issue. Through it all, I remained determined, constantly pushing forward even when faced with recurring errors.",- "mood": "Determined and intellectually stimulated, with undertones of frustration",- "keyInsights": [- "The importance of understanding the runtime environment (like Deno) for effective debugging",- "The value of persistence in problem-solving, even when faced with recurring errors",- "The complexity of integrating multiple APIs and services in a single project can lead to unexpected challenges"- ]-}\ No newline at end of filediff --git a/pipes/archive/pipe-screen-time-storyteller/README.md b/pipes/archive/pipe-screen-time-storyteller/README.mddeleted file mode 100644index fc7fa1e6c..000000000--- a/pipes/archive/pipe-screen-time-storyteller/README.md+++ /dev/null@@ -1,111 +0,0 @@-### pipe-screen-time-storyteller---<img width="1512" alt="Screenshot 2024-10-15 at 15 11 00" src="https://github.com/user-attachments/assets/07851108-1f04-404b-908e-62a360d95852">--screen time storyteller uses AI to generate engaging, personalized narratives based on your daily screen activities. it analyzes your device usage data to create a fun, slightly sassy diary entry, complete with insights and advice for better digital habits.--easily track your screen time habits, gain insights, and improve your digital wellbeing.--#### quick setup-1. [get an API key for your chosen AI provider (Claude or OpenAI)](https://platform.openai.com/account/api-keys)-2. [create a GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for creating gists-3. configure pipe in the app UI, save, enable, and restart screenpipe recording (you can configure to generate summaries every hour)--#### advanced-tech details? check `pipe.ts`.-can be used through CLI also, you can tweak the `pipe.json` to your needs, mine looks like this:--```json-{- "name": "Screen Time Storyteller",- "version": "0.1.0",- "description": "Generates a narrative summary of your screen time data",- "author": "David Anyatonwu",- "fields": [- {- "name": "aiProvider",- "type": "string",- "default": "claude",- "description": "AI provider to use (ollama, openai, or claude)",- "value": "claude"- },- {- "name": "claudeModel",- "type": "string",- "default": "claude-3-sonnet-20240229",- "description": "Claude AI model to use"- },- {- "name": "openaiModel",- "type": "string",- "default": "gpt-4-turbo-preview",- "description": "OpenAI model to use"- },- {- "name": "ollamaModel",- "type": "string",- "default": "llama3.1",- "description": "Ollama model to use"- },- {- "name": "claudeApiKey",- "type": "string",- "default": "",- "description": "API key for Claude",- "value": "your-claude-api-key"- },- {- "name": "openaiApiKey",- "type": "string",- "default": "",- "description": "API key for OpenAI"- },- {- "name": "pageSize",- "type": "number",- "default": 1000,- "description": "Number of items to process per page"- },- {- "name": "contentType",- "type": "string",- "default": "ocr",- "description": "Type of content to process (ocr, audio, or all)"- },- {- "name": "githubToken",- "type": "string",- "default": "",- "description": "GitHub personal access token",- "value": "your-github-personal-access-token"- }- ],- "source": "https://github.com/mediar-ai/screenpipe/tree/main/pipes/pipe-screen-time-storyteller",- "enabled": true-}-```--#### usage-the screen time storyteller pipe will run automatically as part of your screenpipe workflow. it generates a narrative summary every hour based on your screen activities from the past 24 hours.--you can find the generated summaries in two places:-1. a JSON file in the `.screenpipe/pipes/screen-time-storyteller/` directory, named with the current date (e.g., `2024-10-06-narrative-summary.json`).-2. a GitHub gist, which you can access through your GitHub account.--#### troubleshooting-if you encounter any issues:-1. check screenpipe's logs for any error messages related to the screen time storyteller pipe.-2. ensure your API keys and GitHub token are correct and have the necessary permissions.-3. verify that the pipe's directory is in the correct location within your screenpipe installation.--#### contributing-contributions are welcome! please feel free to submit a pull request to the screenpipe repository.--#### license-this project is licensed under the same license as screenpipe - see the [LICENSE](LICENSE) file in the screenpipe repository for details.--#### acknowledgments-- thanks to the screenpipe team for providing the underlying screen time tracking functionality.-- powered by AI models from anthropic, openai, and ollama.-diff --git a/pipes/archive/pipe-screen-time-storyteller/package.json b/pipes/archive/pipe-screen-time-storyteller/package.jsondeleted file mode 100644index 0abd1b4d4..000000000--- a/pipes/archive/pipe-screen-time-storyteller/package.json+++ /dev/null@@ -1,19 +0,0 @@-{- "name": "pipe-screen-time-storyteller",- "module": "pipe.ts",- "type": "module",- "devDependencies": {- "@types/bun": "latest"- },- "peerDependencies": {- "typescript": "^5.0.0"- },- "dependencies": {- "@ai-sdk/anthropic": "^1.0.2",- "@ai-sdk/openai": "^1.0.5",- "@screenpipe/js": "^1.0.0",- "@screenpipe/browser": "0.1.12",- "ai": "^4.0.10",- "zod": "^3.23.8"- }-}diff --git a/pipes/archive/pipe-screen-time-storyteller/pipe.json b/pipes/archive/pipe-screen-time-storyteller/pipe.jsondeleted file mode 100644index 46d04b7aa..000000000--- a/pipes/archive/pipe-screen-time-storyteller/pipe.json+++ /dev/null@@ -1,62 +0,0 @@-{- "name": "Screen Time Storyteller",- "version": "1.0.0",- "description": "Generates a narrative summary of your day based on your screen activities",- "author": "AI Assistant",- "fields": [- {- "name": "aiProvider",- "type": "string",- "default": "claude",- "description": "AI provider to use (ollama, openai, or claude)"- },- {- "name": "claudeModel",- "type": "string",- "default": "claude-3-sonnet-20240229",- "description": "Claude AI model to use"- },- {- "name": "openaiModel",- "type": "string",- "default": "gpt-4-turbo-preview",- "description": "OpenAI model to use"- },- {- "name": "ollamaModel",- "type": "string",- "default": "llama3.2",- "description": "Ollama model to use"- },- {- "name": "claudeApiKey",- "type": "string",- "default": "",- "description": "API key for Claude"- },- {- "name": "openaiApiKey",- "type": "string",- "default": "",- "description": "API key for OpenAI"- },- {- "name": "pageSize",- "type": "number",- "default": 1000,- "description": "Number of items to process per page"- },- {- "name": "contentType",- "type": "string",- "default": "ocr",- "description": "Type of content to process (ocr, audio, or all)"- },- {- "name": "githubToken",- "type": "string",- "default": "",- "description": "GitHub personal access token with gist scope [create it here](https://github.com/settings/tokens/new)"- }- ]-}\ No newline at end of filediff --git a/pipes/archive/pipe-screen-time-storyteller/pipe.ts b/pipes/archive/pipe-screen-time-storyteller/pipe.tsdeleted file mode 100644index ad96e79d9..000000000--- a/pipes/archive/pipe-screen-time-storyteller/pipe.ts+++ /dev/null@@ -1,349 +0,0 @@-import { z } from "zod";-import { generateObject } from "ai";-import { anthropic } from "@ai-sdk/anthropic";-import { openai } from "@ai-sdk/openai";-import { pipe, ContentItem } from "@screenpipe/js";-import * as fs from "node:fs/promises";-import * as path from "node:path";-import process from "node:process";--const INTERVAL = 60 * 60 * 1000; // 1 hour in milliseconds--type ContentType = "ocr" | "audio" | "all";--interface AIProvider {- provider: string;- model: string;-}--interface Config {- aiProvider: string;- claudeModel: string;- openaiModel: string;- ollamaModel: string;- claudeApiKey: string;- openaiApiKey: string;- pageSize: number;- contentType: ContentType;- githubToken: string;-}--interface NarrativeSummary {- summary: string;- mood: string;- keyInsights: string | string[];-}--const narrativeSummarySchema = z.object({- summary: z.string(),- mood: z.string(),- keyInsights: z.union([z.string(), z.array(z.string())]),-});--async function getAIProvider(config: Config): Promise<AIProvider> {- const modelMap = {- claude: config.claudeModel,- openai: config.openaiModel,- ollama: config.ollamaModel,- };- return { provider: config.aiProvider, model: modelMap[config.aiProvider] };-}--async function generateNarrativeSummary(- screenData: ContentItem[],- provider: AIProvider,- config: Config-): Promise<NarrativeSummary> {- const maxItems = 50;- const truncatedData = screenData.slice(0, maxItems);-- const prompt = `You're an AI companion living inside the user's devices. Based on the following sample of screen data (${- truncatedData.length- } out of ${- screenData.length- } total items), write a friendly, slightly sassy diary entry about what you've observed today:-- ${JSON.stringify(truncatedData)}-- Your diary entry should:- 1. Comment on the user's habits- 2. Make playful jokes about their app usage- 3. Offer 3 pieces of advice for tomorrow- 4. Use a mix of tech slang and emojis for a modern feel`;-- try {- let response;- if (provider.provider === "claude") {- response = await generateObject({- model: anthropic(provider.model),- messages: [{ role: "user", content: prompt }],- schema: narrativeSummarySchema,- });- } else if (provider.provider === "openai") {- response = await generateObject({- model: openai(provider.model),- messages: [{ role: "user", content: prompt }],- schema: narrativeSummarySchema,- });- } else {- throw new Error(`Unsupported AI provider: ${provider.provider}`);- }-- const result = response.object as NarrativeSummary;-- // Convert keyInsights to array if it's a string- if (typeof result.keyInsights === "string") {- result.keyInsights = result.keyInsights- .split("\n")- .map((insight) => insight.trim())- .filter(Boolean);- }-- return result;- } catch (error) {- console.error("Error generating narrative summary:", error);- return createErrorSummary(error);- }-}--async function createGist(- summary: NarrativeSummary,- config: Config-): Promise<string | null> {- const date = new Date().toISOString().split("T")[0];- const fileName = `${date}-screen-time-story.md`;- const content = `# 🖥️ Screen Time Story - ${date} ${summary.mood}--## 📱 AI Companion's Diary Entry--${summary.summary}--## 🔍 Key Insights--${- Array.isArray(summary.keyInsights)- ? summary.keyInsights.map((insight) => `- ${insight}`).join("\n")- : typeof summary.keyInsights === "string"- ? summary.keyInsights- .split("\n")- .map((insight) => `- ${insight.trim()}`)- .filter(Boolean)- .join("\n")- : "- No key insights available"-}------Generated by your friendly neighborhood AI companion 🤖✨-`;-- try {- console.log("Attempting to create gist...");- const response = await fetch("https://api.github.com/gists", {- method: "POST",- headers: {- Authorization: `token ${config.githubToken}`,- "Content-Type": "application/json",- "User-Agent": "Screen-Time-Storyteller",- Accept: "application/vnd.github+json",- "X-GitHub-Api-Version": "2022-11-28",- },- body: JSON.stringify({- description: `Screen Time Story - ${date}`,- public: false,- files: {- [fileName]: {- content: content,- },- },- }),- });-- if (response.ok) {- const gistData = await response.json();- console.log("Created gist:", gistData.html_url);- return gistData.html_url;- } else {- const errorText = await response.text();- console.error(- `Failed to create gist. Status: ${response.status}, Response: ${errorText}`- );- return null;- }- } catch (error) {- console.error("Error creating gist:", error);- return null;- }-}--async function main() {- console.log("Starting Screen Time Storyteller");-- const rawConfig = pipe.loadPipeConfig();- console.log("Loaded raw config:", JSON.stringify(rawConfig, null, 2));-- const config: Config = {- aiProvider: rawConfig.aiProvider as string,- claudeModel: rawConfig.claudeModel as string,- openaiModel: rawConfig.openaiModel as string,- ollamaModel: rawConfig.ollamaModel as string,- claudeApiKey: rawConfig.claudeApiKey as string,- openaiApiKey: rawConfig.openaiApiKey as string,- pageSize: Number(rawConfig.pageSize),- contentType: rawConfig.contentType as ContentType,- githubToken: rawConfig.githubToken as string,- };-- if (!validateConfig(config)) {- return;- }-- // Set the API keys- if (config.aiProvider === "claude") {- process.env.ANTHROPIC_API_KEY = config.claudeApiKey;- } else if (config.aiProvider === "openai") {- process.env.OPENAI_API_KEY = config.openaiApiKey;- }-- const provider = await getAIProvider(config);-- while (true) {- try {- await processScreenData(config, provider);- } catch (error) {- console.error("Error in Screen Time Storyteller loop:", error);- logError(error);- }-- console.log(`Sleeping for ${INTERVAL / 1000 / 60} minutes`);- await new Promise((resolve) => setTimeout(resolve, INTERVAL));- }-}--function validateConfig(config: Config): boolean {- if (!config.aiProvider) {- console.error("Missing aiProvider in config");- return false;- }- if (config.aiProvider === "claude" && !config.claudeApiKey) {- console.error("Missing Claude API key in config");- return false;- }- if (config.aiProvider === "openai" && !config.openaiApiKey) {- console.error("Missing OpenAI API key in config");- return false;- }- if (!config.pageSize) {- console.error("Missing pageSize in config");- return false;- }- if (!config.contentType) {- console.error("Missing contentType in config");- return false;- }- if (!config.githubToken) {- console.error("Missing GitHub personal access token in config");- return false;- }-- return true;-}--async function processScreenData(config: Config, provider: AIProvider) {- const now = new Date();- const oneDayAgo = new Date(now.getTime() - 24 * 60 * 60 * 1000);-- const screenData = await pipe.queryScreenpipe({- startTime: oneDayAgo.toISOString(),- endTime: now.toISOString(),- limit: config.pageSize,- contentType: config.contentType,- });-- if (!screenData || !screenData.data || screenData.data.length === 0) {- console.log("No screen data available for the past day");- return;- }-- try {- console.log("Generating narrative summary");- const narrativeSummary = await generateNarrativeSummary(- screenData.data,- provider,- config- );- console.log(- "Generated narrative summary:",- JSON.stringify(narrativeSummary, null, 2)- );-- await saveNarrativeSummary(narrativeSummary);-- const gistUrl = await createGist(narrativeSummary, config);- if (gistUrl) {- console.log("Created gist for review:", gistUrl);- await pipe.sendDesktopNotification({- title: "Screen Time Story Created",- body: `Your daily screen time story is ready! Check it out at ${gistUrl}`,- });- await pipe.inbox.send({- title: "Screen Time Story Created",- body: `Your daily screen time story is ready! Check it out at ${gistUrl}`,- });- } else {- console.log("Failed to create gist");- console.error(- "Please check your GitHub personal access token and ensure it has the necessary permissions."- );- }- } catch (summaryError) {- console.error(- "Error generating or processing narrative summary:",- summaryError- );- logError(summaryError);- }-}--function createErrorSummary(error: unknown): NarrativeSummary {- let errorMessage = "An unknown error occurred";- if (error instanceof Error) {- errorMessage = error.message;- }-- return {- summary: `An error occurred while generating the narrative summary: ${errorMessage}`,- mood: "😞",- keyInsights: ["Error occurred during summary generation"],- };-}--function logError(error: unknown) {- if (error instanceof Error) {- console.error("Error message:", error.message);- console.error("Error stack:", error.stack);- } else {- console.error("Non-Error object thrown:", error);- }-}--async function saveNarrativeSummary(summary: NarrativeSummary): Promise<void> {- try {- const date = new Date().toISOString().split("T")[0];- const fileName = `${date}-narrative-summary.json`;- const pipeDir = `${process.env.SCREENPIPE_DIR}/pipes/${process.env.PIPE_ID}`;- const fullPath = path.join(pipeDir, fileName);-- console.log(`Attempting to save narrative summary to: ${fullPath}`);-- await fs.writeFile(fullPath, JSON.stringify(summary, null, 2));- console.log(`Successfully saved narrative summary to ${fullPath}`);- } catch (error) {- console.error("Error saving narrative summary:", error);- throw error;- }-}--main().catch((error) => {- console.error("Fatal error in Screen Time Storyteller:", error);- logError(error);-});diff --git a/pipes/archive/pipe-screen-time-storyteller/tsconfig.json b/pipes/archive/pipe-screen-time-storyteller/tsconfig.jsondeleted file mode 100644index 238655f2c..000000000--- a/pipes/archive/pipe-screen-time-storyteller/tsconfig.json+++ /dev/null@@ -1,27 +0,0 @@-{- "compilerOptions": {- // Enable latest features- "lib": ["ESNext", "DOM"],- "target": "ESNext",- "module": "ESNext",- "moduleDetection": "force",- "jsx": "react-jsx",- "allowJs": true,-- // Bundler mode- "moduleResolution": "bundler",- "allowImportingTsExtensions": true,- "verbatimModuleSyntax": true,- "noEmit": true,-- // Best practices- "strict": true,- "skipLibCheck": true,- "noFallthroughCasesInSwitch": true,-- // Some stricter flags (disabled by default)- "noUnusedLocals": false,- "noUnusedParameters": false,- "noPropertyAccessFromIndexSignature": false- }-}diff --git a/pipes/archive/pipe-twitter-autopilot/README.md b/pipes/archive/pipe-twitter-autopilot/README.mddeleted file mode 100644index 6d3f66599..000000000--- a/pipes/archive/pipe-twitter-autopilot/README.md+++ /dev/null@@ -1 +0,0 @@-WIP\ No newline at end of filediff --git a/pipes/archive/pipe-twitter-autopilot/deno.json b/pipes/archive/pipe-twitter-autopilot/deno.jsondeleted file mode 100644index ce0f24167..000000000--- a/pipes/archive/pipe-twitter-autopilot/deno.json+++ /dev/null@@ -1,10 +0,0 @@-{- "imports": {- "fs": "node:fs",- "screenpipe": "https://raw.githubusercontent.com/mediar-ai/screenpipe/main/screenpipe-js/main.ts",- "ai": "npm:ai",- "ollama-ai-provider": "npm:ollama-ai-provider",- "zod": "npm:zod",- "twitter-api-v2": "npm:twitter-api-v2"- }-}diff --git a/pipes/archive/pipe-twitter-autopilot/pipe.json b/pipes/archive/pipe-twitter-autopilot/pipe.jsondeleted file mode 100644index 797664008..000000000--- a/pipes/archive/pipe-twitter-autopilot/pipe.json+++ /dev/null@@ -1,66 +0,0 @@-{- "fields": [- {- "name": "interval",- "type": "number",- "default": 60,- "description": "interval in seconds to read your screen data and extract structured logs"- },- {- "name": "aiApiUrl",- "type": "string",- "default": "http://localhost:11434/api",- "description": "ollama api url"- },- {- "name": "aiModel",- "type": "string",- "default": "llama3.2:3b-instruct-q4_K_M",- "description": "ai model name"- },- {- "name": "twitterBearerToken",- "type": "string",- "description": "twitter bearer token, find it here: https://developer.x.com/en/portal/apps"- },- {- "name": "customPrompt",- "type": "string",- "default": "you generate comments to tweets and optimise for the twitter algorithm to get maximum score\n\nrules:\n- be controversial but not offensive\n- use lowercase\n- be concise\n- sound like a real person, not a brand, nor an ai\n- optimize for engagement\n- don't use hashtags\n- don't be cringe\n- don't be fucking woke",- "description": "custom prompt for generating tweets"- },- {- "name": "aiProvider",- "type": "string",- "default": "ollama",- "description": "ai provider to use (ollama or openai)"- },- {- "name": "openaiApiKey",- "type": "string",- "description": "openai api key (required if using openai provider)",- "optional": true- },- {- "name": "openaiModel",- "type": "string",- "default": "gpt-4o",- "description": "openai model to use (if using openai provider)",- "optional": true- },- {- "name": "keywords",- "type": "string",- "default": "",- "description": "comma-separated list of keywords to search for (if empty, keywords will be extracted from screen data)",- "optional": true- },- {- "name": "targetUsers",- "type": "string",- "default": "",- "description": "comma-separated list of twitter usernames to search within their network (if empty, searches globally)",- "optional": true- }- ]-}diff --git a/pipes/archive/pipe-twitter-autopilot/pipe.ts b/pipes/archive/pipe-twitter-autopilot/pipe.tsdeleted file mode 100644index 0d4824f55..000000000--- a/pipes/archive/pipe-twitter-autopilot/pipe.ts+++ /dev/null@@ -1,442 +0,0 @@-import { TwitterApi, type TweetV2 } from "twitter-api-v2";-import { z } from "zod";-import { generateObject } from "ai";-import { createOllama } from "ollama-ai-provider";-import { pipe, ContentItem } from "@screenpipe/js";-import { createOpenAI } from "@ai-sdk/openai";--const twitterSuggestionLog = z.object({- suggestions: z.array(- z.object({- tweetId: z.string(),- comment: z.string(),- })- ),-});--type TwitterSuggestionLog = z.infer<typeof twitterSuggestionLog>;--function createAIProvider(config: any) {- if (config.aiProvider === "openai") {- if (!config.openaiApiKey) {- throw new Error("openai api key required when using openai provider");- }- return createOpenAI({- apiKey: config.openaiApiKey,- })(config.openaiModel || "gpt-4o");- } else {- return createOllama({ baseURL: config.aiApiUrl })(config.aiModel);- }-}--async function extractKeywords(- screenData: ContentItem[],- config: any-): Promise<string[]> {- if (config.keywords?.trim()) {- const keywords = config.keywords.split(",").map((k: string) => k.trim());- console.log("using hardcoded keywords:", keywords);- return keywords;- }-- const prompt = `Extract 5 relevant keywords from the following screen data:- ${JSON.stringify(screenData)}- Return a JSON object with a single array of strings, here are a few examples:- - { "keywords": ["screen", "software", "developer", "product", "design"] }- `;-- const provider = createAIProvider(config);-- const response = await generateObject({- model: provider,- messages: [{ role: "user", content: prompt }],- schema: z.object({ keywords: z.array(z.string()) }),- });-- console.log("extracted keywords:", response.object);- return response.object.keywords;-}--async function filterTweetsWithAI(- tweets: TweetV2[],- customPrompt: string,- config: any-): Promise<TweetV2[]> {- const provider = createAIProvider(config);-- const filterPrompt = `you are a tweet filter. evaluate if these tweets are relevant based on these criteria:-${customPrompt}--additional rules:-- tweets should be engaging and worth responding to-- tweets should be from real users (not bots/spam)-- tweets should be relevant to screen recording, productivity, or software-- tweets should have potential for meaningful interaction--rate each tweet as either KEEP or SKIP. return a JSON array of booleans where true means KEEP.--example format:-{- "keep": [true, false, true]-}`;-- const response = await generateObject({- model: provider,- messages: [- { role: "system", content: filterPrompt },- { role: "user", content: JSON.stringify(tweets.map((t) => t.text)) },- ],- schema: z.object({ keep: z.array(z.boolean()) }),- });-- return tweets.filter((_, i) => response.object.keep[i]);-}--async function fetchRelevantTweets(- keywords: string[],- twitterClient: TwitterApi,- customPrompt: string,- config: any,- desiredCount: number = 3,- attempt: number = 1,- maxAttempts: number = 3-): Promise<TweetV2[]> {- // Expand search window based on attempt number- const hoursAgo = attempt * 24; // Increase time window with each attempt- const startTime = new Date(- Date.now() - hoursAgo * 60 * 60 * 1000- ).toISOString();-- // Decrease engagement thresholds with each attempt- const minLikes = Math.max(1, 4 - attempt);- const minReplies = Math.max(1, 3 - attempt);- const minRetweets = Math.max(1, 3 - attempt);-- const relevantKeywords = keywords- .filter((k) => k.length > 0)- .map((k) => `"${k}"`)- .join(" OR ");-- const query = `(${relevantKeywords}) lang:en -is:retweet -is:reply has:mentions`;-- try {- console.log(- `attempt ${attempt}: fetching tweets from last ${hoursAgo} hours`- );-- const tweets = await twitterClient.v2.search(query, {- max_results: 25 * attempt, // Fetch more tweets with each attempt- start_time: startTime,- "tweet.fields": [- "id",- "text",- "author_id",- "public_metrics",- "created_at",- ],- "user.fields": ["id", "username", "public_metrics"],- expansions: ["author_id"],- sort_order: "relevancy",- });-- // Pre-filter for engagement with reduced thresholds- const engagementFiltered = tweets.data.data.filter((tweet) => {- const metrics = tweet.public_metrics;- return (- metrics &&- (metrics.like_count >= minLikes ||- metrics.reply_count >= minReplies ||- metrics.retweet_count >= minRetweets)- );- });-- // AI filter- const aiFiltered = await filterTweetsWithAI(- engagementFiltered,- customPrompt,- config- );-- console.log(- `attempt ${attempt} results: ${engagementFiltered.length} -> ${aiFiltered.length}`- );-- // If we don't have enough relevant tweets and haven't hit max attempts, try again- if (aiFiltered.length < desiredCount && attempt < maxAttempts) {- console.log(- `not enough relevant tweets, trying again with expanded criteria`- );- const nextAttemptTweets = await fetchRelevantTweets(- keywords,- twitterClient,- customPrompt,- config,- desiredCount,- attempt + 1,- maxAttempts- );- return [...aiFiltered, ...nextAttemptTweets].slice(0, desiredCount);- }-- return aiFiltered.slice(0, desiredCount);- } catch (error) {- console.log(`error in attempt ${attempt}:`, error);- if (attempt < maxAttempts) {- console.log("retrying with expanded criteria");- return fetchRelevantTweets(- keywords,- twitterClient,- customPrompt,- config,- desiredCount,- attempt + 1,- maxAttempts- );- }- return [];- }-}--async function generateTwitterSuggestions(- tweets: TweetV2[],- customPrompt: string,- config: any-): Promise<TwitterSuggestionLog["suggestions"]> {- // Only process the filtered tweets- const tweetTexts = tweets.map((t) => t.text);-- const hardcodedPrompt = `you are a tweet comment generator. your task is to generate engaging replies to tweets.--rules for comments:-${customPrompt}--format rules:-- you MUST return a valid JSON object containing a "comments" array-- each comment in the array MUST be a string-- generate exactly ${tweetTexts.length} comments, one for each tweet provided-- comments should be in the same order as the tweets provided-- do NOT include any explanation or other text, ONLY the JSON object--here's a valid example:-{- "comments": [- "what do you think is the reason why this happen?",- "been there, totally get it. the struggle is real",- "hot take but you're absolutely right"- ]-}--twitter algorithm optimization:-- aim for replies that get 13.5+ engagement score-- aim for profile visits that convert (12.0+ score)-- aim for author engagement on your reply (75.0+ score)-- avoid content that gets reported (-369.0 penalty)-- avoid content that gets muted/blocked (-74.0 penalty)`;-- const provider = createAIProvider(config);-- const response = await generateObject({- model: provider,- messages: [- { role: "system", content: hardcodedPrompt },- { role: "user", content: `tweets: ${tweetTexts.join("\n")}` },- ],- schema: z.object({ comments: z.array(z.string()) }),- });-- // Map AI comments back to tweets with correct IDs- return response.object.comments.map((comment, index) => ({- tweetId: tweets[index].id,- comment,- }));-}--function generateTwitterLinks(- suggestions: TwitterSuggestionLog["suggestions"]-): string {- return suggestions- .map((suggestion, index) => {- const encodedComment = encodeURIComponent(suggestion.comment);-- const twitterLink = `https://twitter.com/intent/tweet?in_reply_to=${suggestion.tweetId}&text=${encodedComment}`;-- return `-### ${index + 1}. Tweet: ${suggestion.tweetId}--Comment: ${suggestion.comment}--[Comment on Twitter](${twitterLink})- `.trim();- })- .join("\n\n");-}--async function syncSuggestionsToInbox(- suggestions: TwitterSuggestionLog["suggestions"]-): Promise<void> {- try {- console.log("syncSuggestionsToInbox", suggestions);-- const markdownContent = generateTwitterLinks(suggestions);-- await pipe.inbox.send({- title: "twitter suggestions",- body: `new twitter suggestions:\n\n${markdownContent}`,- });- } catch (error) {- console.error("error syncing twitter suggestions to inbox:", error);- await pipe.inbox.send({- title: "twitter suggestions error",- body: `error syncing twitter suggestions to inbox: ${error}`,- });- }-}--async function streamTwitterSuggestions(): Promise<void> {- console.log("starting twitter suggestions stream");-- const config = pipe.loadPipeConfig();- console.log("loaded config:", JSON.stringify(config, null, 2));-- const interval = config.interval * 1000;- const twitterBearerToken = config.twitterBearerToken;-- const twitterClient = new TwitterApi(twitterBearerToken);-- await pipe.inbox.send({- title: "twitter suggestions stream started",- body: `monitoring tweets every ${config.interval} seconds`,- });-- pipe.scheduler- .task("generateTwitterSuggestions")- .every(`${config.interval} seconds`)- .do(async () => {- try {- const now = new Date();- const oneHourAgo = new Date(now.getTime() - interval);-- const screenData = await pipe.queryScreenpipe({- startTime: oneHourAgo.toISOString(),- endTime: now.toISOString(),- limit: 50,- contentType: "ocr",- minLength: 50,- });-- console.log("fetched screen data:", screenData?.pagination.total);-- if (screenData && screenData.data.length > 0) {- const keywords = await extractKeywords(screenData.data, config);- console.log("extracted keywords:", keywords);- const relevantTweets = await fetchRelevantTweets(- keywords,- twitterClient,- config.customPrompt,- config- );-- if (relevantTweets.length > 0) {- const suggestions = await generateTwitterSuggestions(- relevantTweets,- config.customPrompt,- config- );- await syncSuggestionsToInbox(suggestions);- } else {- console.log("no relevant tweets found");- }- } else {- console.log("no relevant screen data detected in the last hour");- }- } catch (error) {- console.error("error in twitter suggestions pipeline:", error);- await pipe.inbox.send({- title: "twitter suggestions error",- body: `error in twitter suggestions pipeline: ${error}`,- });- }- });-- pipe.scheduler.start();-}--// streamTwitterSuggestions();--/**--# these are mandatory env variables-export SCREENPIPE_DIR="$HOME/.screenpipe"-export PIPE_ID="pipe-twitter-autopilot"-export PIPE_FILE="pipe.ts"-export PIPE_DIR="$SCREENPIPE_DIR/pipes/pipe-twitter-autopilot"--bun run pipes/pipe-twitter-autopilot/pipe.ts- */--// ... existing code ...--async function testTwitterSuggestionsOnce(): Promise<void> {- console.log("testing twitter suggestions with last 60 min data");-- const config = pipe.loadPipeConfig();- console.log("loaded config:", JSON.stringify(config, null, 2));-- const twitterClient = new TwitterApi(config.twitterBearerToken);-- try {- const now = new Date();- const oneHourAgo = new Date(now.getTime() - 60 * 60 * 1000);-- const screenData = await pipe.queryScreenpipe({- startTime: oneHourAgo.toISOString(),- endTime: now.toISOString(),- limit: 50,- contentType: "ocr",- minLength: 50,- });-- console.log("fetched screen data:", screenData?.pagination.total);-- if (screenData && screenData.data.length > 0) {- const keywords = await extractKeywords(screenData.data, config);- console.log("extracted keywords:", keywords);- const relevantTweets = await fetchRelevantTweets(- keywords,- twitterClient,- config.customPrompt,- config- );-- if (relevantTweets.length > 0) {- const suggestions = await generateTwitterSuggestions(- relevantTweets,- config.customPrompt,- config- );- await syncSuggestionsToInbox(suggestions);- } else {- console.log("no relevant tweets found");- }- } else {- console.log("no relevant screen data detected in the last hour");- }- } catch (error) {- console.error("error in twitter suggestions test:", error);- await pipe.inbox.send({- title: "twitter suggestions test error",- body: `error in twitter suggestions test: ${error}`,- });- }-}--// Comment out or remove the streamTwitterSuggestions() call-// streamTwitterSuggestions();--// Add this line to run the test function-testTwitterSuggestionsOnce();--// fetchRelevantTweets(-// ["screen", "recording", "software"],-// new TwitterApi(pipe.loadPipeConfig().twitterBearerToken)-// ).then(console.log);diff --git a/pipes/archive/vercel-ai-chatbot/.eslintrc.json b/pipes/archive/vercel-ai-chatbot/.eslintrc.jsondeleted file mode 100644index c17b5320a..000000000--- a/pipes/archive/vercel-ai-chatbot/.eslintrc.json+++ /dev/null@@ -1,26 +0,0 @@-{- "$schema": "https://json.schemastore.org/eslintrc",- "root": true,- "extends": [- "next/core-web-vitals",- "prettier",- "plugin:tailwindcss/recommended"- ],- "plugins": ["tailwindcss"],- "rules": {- "tailwindcss/no-custom-classname": "off",- "tailwindcss/classnames-order": "off"- },- "settings": {- "tailwindcss": {- "callees": ["cn", "cva"],- "config": "tailwind.config.js"- }- },- "overrides": [- {- "files": ["*.ts", "*.tsx"],- "parser": "@typescript-eslint/parser"- }- ]-}diff --git a/pipes/archive/vercel-ai-chatbot/.gitignore b/pipes/archive/vercel-ai-chatbot/.gitignoredeleted file mode 100644index dd019e403..000000000--- a/pipes/archive/vercel-ai-chatbot/.gitignore+++ /dev/null@@ -1,38 +0,0 @@-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.--# dependencies-node_modules-.pnp-.pnp.js--# testing-coverage--# next.js-.next/-out/-build--# misc-.DS_Store-*.pem--# debug-npm-debug.log*-yarn-debug.log*-yarn-error.log*-.pnpm-debug.log*--# local env files-.env.local-.env.development.local-.env.test.local-.env.production.local--# turbo-.turbo--.env-.vercel-.vscode-.env*.localdiff --git a/pipes/archive/vercel-ai-chatbot/LICENSE b/pipes/archive/vercel-ai-chatbot/LICENSEdeleted file mode 100644index 6c16c29f4..000000000--- a/pipes/archive/vercel-ai-chatbot/LICENSE+++ /dev/null@@ -1,13 +0,0 @@-Copyright 2023 Vercel, Inc.--Licensed under the Apache License, Version 2.0 (the "License");-you may not use this file except in compliance with the License.-You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0--Unless required by applicable law or agreed to in writing, software-distributed under the License is distributed on an "AS IS" BASIS,-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-See the License for the specific language governing permissions and-limitations under the License.\ No newline at end of filediff --git a/pipes/archive/vercel-ai-chatbot/README.md b/pipes/archive/vercel-ai-chatbot/README.mddeleted file mode 100644index 0f454f962..000000000--- a/pipes/archive/vercel-ai-chatbot/README.md+++ /dev/null@@ -1,30 +0,0 @@-# Chat with your screen time history-----## Getting Started--First, add your OpenAI API key to `.env` file:--```-OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-```--Then, run the development server:--```bash-npm install-```---```bash-npm run dev-```--Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.--You can start editing the logic by modifying `lib/chat/actions.tsx`- a tool to call screenpipe api---this example is based on https://github.com/vercel/ai-chatbot\ No newline at end of filediff --git a/pipes/archive/vercel-ai-chatbot/app/(chat)/chat/[id]/page.tsx b/pipes/archive/vercel-ai-chatbot/app/(chat)/chat/[id]/page.tsxdeleted file mode 100644index c8de38044..000000000--- a/pipes/archive/vercel-ai-chatbot/app/(chat)/chat/[id]/page.tsx+++ /dev/null@@ -1,60 +0,0 @@-import { type Metadata } from 'next'-import { notFound, redirect } from 'next/navigation'--import { auth } from '@/auth'-import { getChat, getMissingKeys } from '@/app/actions'-import { Chat } from '@/components/chat'-import { AI } from '@/lib/chat/actions'-import { Session } from '@/lib/types'--export interface ChatPageProps {- params: {- id: string- }-}--export async function generateMetadata({- params-}: ChatPageProps): Promise<Metadata> {- const session = await auth()-- if (!session?.user) {- return {}- }-- const chat = await getChat(params.id, session.user.id)- return {- title: chat?.title.toString().slice(0, 50) ?? 'Chat'- }-}--export default async function ChatPage({ params }: ChatPageProps) {- const session = (await auth()) as Session- const missingKeys = await getMissingKeys()-- if (!session?.user) {- redirect(`/login?next=/chat/${params.id}`)- }-- const userId = session.user.id as string- const chat = await getChat(params.id, userId)-- if (!chat) {- redirect('/')- }-- if (chat?.userId !== session?.user?.id) {- notFound()- }-- return (- <AI initialAIState={{ chatId: chat.id, messages: chat.messages }}>- <Chat- id={chat.id}- session={session}- initialMessages={chat.messages}- missingKeys={missingKeys}- />- </AI>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/app/(chat)/layout.tsx b/pipes/archive/vercel-ai-chatbot/app/(chat)/layout.tsxdeleted file mode 100644index 2825d593c..000000000--- a/pipes/archive/vercel-ai-chatbot/app/(chat)/layout.tsx+++ /dev/null@@ -1,14 +0,0 @@-import { SidebarDesktop } from '@/components/sidebar-desktop'--interface ChatLayoutProps {- children: React.ReactNode-}--export default async function ChatLayout({ children }: ChatLayoutProps) {- return (- <div className="relative flex h-[calc(100vh_-_theme(spacing.16))] overflow-hidden">- <SidebarDesktop />- {children}- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/app/(chat)/page.tsx b/pipes/archive/vercel-ai-chatbot/app/(chat)/page.tsxdeleted file mode 100644index 21b79f91d..000000000--- a/pipes/archive/vercel-ai-chatbot/app/(chat)/page.tsx+++ /dev/null@@ -1,22 +0,0 @@-import { nanoid } from '@/lib/utils'-import { Chat } from '@/components/chat'-import { AI } from '@/lib/chat/actions'-import { auth } from '@/auth'-import { Session } from '@/lib/types'-import { getMissingKeys } from '@/app/actions'--export const metadata = {- title: 'Next.js AI Chatbot'-}--export default async function IndexPage() {- const id = nanoid()- const session = (await auth()) as Session- const missingKeys = await getMissingKeys()-- return (- <AI initialAIState={{ chatId: id, messages: [] }}>- <Chat id={id} session={session} missingKeys={missingKeys} />- </AI>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/app/actions.ts b/pipes/archive/vercel-ai-chatbot/app/actions.tsdeleted file mode 100644index c624f561e..000000000--- a/pipes/archive/vercel-ai-chatbot/app/actions.ts+++ /dev/null@@ -1,156 +0,0 @@-'use server'--import { revalidatePath } from 'next/cache'-import { redirect } from 'next/navigation'-import { kv } from '@vercel/kv'--import { auth } from '@/auth'-import { type Chat } from '@/lib/types'--export async function getChats(userId?: string | null) {- if (!userId) {- return []- }-- try {- const pipeline = kv.pipeline()- const chats: string[] = await kv.zrange(`user:chat:${userId}`, 0, -1, {- rev: true- })-- for (const chat of chats) {- pipeline.hgetall(chat)- }-- const results = await pipeline.exec()-- return results as Chat[]- } catch (error) {- return []- }-}--export async function getChat(id: string, userId: string) {- const chat = await kv.hgetall<Chat>(`chat:${id}`)-- if (!chat || (userId && chat.userId !== userId)) {- return null- }-- return chat-}--export async function removeChat({ id, path }: { id: string; path: string }) {- const session = await auth()-- if (!session) {- return {- error: 'Unauthorized'- }- }-- //Convert uid to string for consistent comparison with session.user.id- const uid = String(await kv.hget(`chat:${id}`, 'userId'))-- if (uid !== session?.user?.id) {- return {- error: 'Unauthorized'- }- }-- await kv.del(`chat:${id}`)- await kv.zrem(`user:chat:${session.user.id}`, `chat:${id}`)-- revalidatePath('/')- return revalidatePath(path)-}--export async function clearChats() {- const session = await auth()-- if (!session?.user?.id) {- return {- error: 'Unauthorized'- }- }-- const chats: string[] = await kv.zrange(`user:chat:${session.user.id}`, 0, -1)- if (!chats.length) {- return redirect('/')- }- const pipeline = kv.pipeline()-- for (const chat of chats) {- pipeline.del(chat)- pipeline.zrem(`user:chat:${session.user.id}`, chat)- }-- await pipeline.exec()-- revalidatePath('/')- return redirect('/')-}--export async function getSharedChat(id: string) {- const chat = await kv.hgetall<Chat>(`chat:${id}`)-- if (!chat || !chat.sharePath) {- return null- }-- return chat-}--export async function shareChat(id: string) {- const session = await auth()-- if (!session?.user?.id) {- return {- error: 'Unauthorized'- }- }-- const chat = await kv.hgetall<Chat>(`chat:${id}`)-- if (!chat || chat.userId !== session.user.id) {- return {- error: 'Something went wrong'- }- }-- const payload = {- ...chat,- sharePath: `/share/${chat.id}`- }-- await kv.hmset(`chat:${chat.id}`, payload)-- return payload-}--export async function saveChat(chat: Chat) {- const session = await auth()-- if (session && session.user) {- const pipeline = kv.pipeline()- pipeline.hmset(`chat:${chat.id}`, chat)- pipeline.zadd(`user:chat:${chat.userId}`, {- score: Date.now(),- member: `chat:${chat.id}`- })- await pipeline.exec()- } else {- return- }-}--export async function refreshHistory(path: string) {- redirect(path)-}--export async function getMissingKeys() {- const keysRequired = ['OPENAI_API_KEY']- return keysRequired- .map(key => (process.env[key] ? '' : key))- .filter(key => key !== '')-}diff --git a/pipes/archive/vercel-ai-chatbot/app/globals.css b/pipes/archive/vercel-ai-chatbot/app/globals.cssdeleted file mode 100644index 0b46ea13c..000000000--- a/pipes/archive/vercel-ai-chatbot/app/globals.css+++ /dev/null@@ -1,76 +0,0 @@-@tailwind base;-@tailwind components;-@tailwind utilities;--@layer base {- :root {- --background: 0 0% 100%;- --foreground: 240 10% 3.9%;-- --card: 0 0% 100%;- --card-foreground: 240 10% 3.9%;-- --popover: 0 0% 100%;- --popover-foreground: 240 10% 3.9%;-- --primary: 240 5.9% 10%;- --primary-foreground: 0 0% 98%;-- --secondary: 240 4.8% 95.9%;- --secondary-foreground: 240 5.9% 10%;-- --muted: 240 4.8% 95.9%;- --muted-foreground: 240 3.8% 46.1%;-- --accent: 240 4.8% 95.9%;- --accent-foreground: 240 5.9% 10%;-- --destructive: 0 84.2% 60.2%;- --destructive-foreground: 0 0% 98%;-- --border: 240 5.9% 90%;- --input: 240 5.9% 90%;- --ring: 240 10% 3.9%;-- --radius: 0.5rem;- }-- .dark {- --background: 240 10% 3.9%;- --foreground: 0 0% 98%;-- --card: 240 10% 3.9%;- --card-foreground: 0 0% 98%;-- --popover: 240 10% 3.9%;- --popover-foreground: 0 0% 98%;-- --primary: 0 0% 98%;- --primary-foreground: 240 5.9% 10%;-- --secondary: 240 3.7% 15.9%;- --secondary-foreground: 0 0% 98%;-- --muted: 240 3.7% 15.9%;- --muted-foreground: 240 5% 64.9%;-- --accent: 240 3.7% 15.9%;- --accent-foreground: 0 0% 98%;-- --destructive: 0 62.8% 30.6%;- --destructive-foreground: 0 0% 98%;-- --border: 240 3.7% 15.9%;- --input: 240 3.7% 15.9%;- --ring: 240 4.9% 83.9%;- }-}--@layer base {- * {- @apply border-border;- }- body {- @apply bg-background text-foreground;- }-}\ No newline at end of filediff --git a/pipes/archive/vercel-ai-chatbot/app/layout.tsx b/pipes/archive/vercel-ai-chatbot/app/layout.tsxdeleted file mode 100644index a32b2230f..000000000--- a/pipes/archive/vercel-ai-chatbot/app/layout.tsx+++ /dev/null@@ -1,64 +0,0 @@-import { GeistSans } from 'geist/font/sans'-import { GeistMono } from 'geist/font/mono'--import '@/app/globals.css'-import { cn } from '@/lib/utils'-import { TailwindIndicator } from '@/components/tailwind-indicator'-import { Providers } from '@/components/providers'-import { Header } from '@/components/header'-import { Toaster } from '@/components/ui/sonner'--export const metadata = {- metadataBase: process.env.VERCEL_URL- ? new URL(`https://${process.env.VERCEL_URL}`)- : undefined,- title: {- default: 'Next.js AI Chatbot',- template: `%s - Next.js AI Chatbot`- },- description: 'An AI-powered chatbot template built with Next.js and Vercel.',- icons: {- icon: '/favicon.ico',- shortcut: '/favicon-16x16.png',- apple: '/apple-touch-icon.png'- }-}--export const viewport = {- themeColor: [- { media: '(prefers-color-scheme: light)', color: 'white' },- { media: '(prefers-color-scheme: dark)', color: 'black' }- ]-}--interface RootLayoutProps {- children: React.ReactNode-}--export default function RootLayout({ children }: RootLayoutProps) {- return (- <html lang="en" suppressHydrationWarning>- <body- className={cn(- 'font-sans antialiased',- GeistSans.variable,- GeistMono.variable- )}- >- <Toaster position="top-center" />- <Providers- attribute="class"- defaultTheme="system"- enableSystem- disableTransitionOnChange- >- <div className="flex flex-col min-h-screen">- <Header />- <main className="flex flex-col flex-1 bg-muted/50">{children}</main>- </div>- <TailwindIndicator />- </Providers>- </body>- </html>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/app/login/actions.ts b/pipes/archive/vercel-ai-chatbot/app/login/actions.tsdeleted file mode 100644index f23e22022..000000000--- a/pipes/archive/vercel-ai-chatbot/app/login/actions.ts+++ /dev/null@@ -1,71 +0,0 @@-'use server'--import { signIn } from '@/auth'-import { User } from '@/lib/types'-import { AuthError } from 'next-auth'-import { z } from 'zod'-import { kv } from '@vercel/kv'-import { ResultCode } from '@/lib/utils'--export async function getUser(email: string) {- const user = await kv.hgetall<User>(`user:${email}`)- return user-}--interface Result {- type: string- resultCode: ResultCode-}--export async function authenticate(- _prevState: Result | undefined,- formData: FormData-): Promise<Result | undefined> {- try {- const email = formData.get('email')- const password = formData.get('password')-- const parsedCredentials = z- .object({- email: z.string().email(),- password: z.string().min(6)- })- .safeParse({- email,- password- })-- if (parsedCredentials.success) {- await signIn('credentials', {- email,- password,- redirect: false- })-- return {- type: 'success',- resultCode: ResultCode.UserLoggedIn- }- } else {- return {- type: 'error',- resultCode: ResultCode.InvalidCredentials- }- }- } catch (error) {- if (error instanceof AuthError) {- switch (error.type) {- case 'CredentialsSignin':- return {- type: 'error',- resultCode: ResultCode.InvalidCredentials- }- default:- return {- type: 'error',- resultCode: ResultCode.UnknownError- }- }- }- }-}diff --git a/pipes/archive/vercel-ai-chatbot/app/login/page.tsx b/pipes/archive/vercel-ai-chatbot/app/login/page.tsxdeleted file mode 100644index 1fba27bea..000000000--- a/pipes/archive/vercel-ai-chatbot/app/login/page.tsx+++ /dev/null@@ -1,18 +0,0 @@-import { auth } from '@/auth'-import LoginForm from '@/components/login-form'-import { Session } from '@/lib/types'-import { redirect } from 'next/navigation'--export default async function LoginPage() {- const session = (await auth()) as Session-- if (session) {- redirect('/')- }-- return (- <main className="flex flex-col p-4">- <LoginForm />- </main>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/app/new/page.tsx b/pipes/archive/vercel-ai-chatbot/app/new/page.tsxdeleted file mode 100644index d23589481..000000000--- a/pipes/archive/vercel-ai-chatbot/app/new/page.tsx+++ /dev/null@@ -1,5 +0,0 @@-import { redirect } from 'next/navigation'--export default async function NewPage() {- redirect('/')-}diff --git a/pipes/archive/vercel-ai-chatbot/app/opengraph-image.png b/pipes/archive/vercel-ai-chatbot/app/opengraph-image.pngdeleted file mode 100644index 278b197ef..000000000Binary files a/pipes/archive/vercel-ai-chatbot/app/opengraph-image.png and /dev/null differdiff --git a/pipes/archive/vercel-ai-chatbot/app/share/[id]/page.tsx b/pipes/archive/vercel-ai-chatbot/app/share/[id]/page.tsxdeleted file mode 100644index d80f0c842..000000000--- a/pipes/archive/vercel-ai-chatbot/app/share/[id]/page.tsx+++ /dev/null@@ -1,58 +0,0 @@-import { type Metadata } from 'next'-import { notFound, redirect } from 'next/navigation'--import { formatDate } from '@/lib/utils'-import { getSharedChat } from '@/app/actions'-import { ChatList } from '@/components/chat-list'-import { FooterText } from '@/components/footer'-import { AI, UIState, getUIStateFromAIState } from '@/lib/chat/actions'--export const runtime = 'edge'-export const preferredRegion = 'home'--interface SharePageProps {- params: {- id: string- }-}--export async function generateMetadata({- params-}: SharePageProps): Promise<Metadata> {- const chat = await getSharedChat(params.id)-- return {- title: chat?.title.slice(0, 50) ?? 'Chat'- }-}--export default async function SharePage({ params }: SharePageProps) {- const chat = await getSharedChat(params.id)-- if (!chat || !chat?.sharePath) {- notFound()- }-- const uiState: UIState = getUIStateFromAIState(chat)-- return (- <>- <div className="flex-1 space-y-6">- <div className="border-b bg-background px-4 py-6 md:px-6 md:py-8">- <div className="mx-auto max-w-2xl">- <div className="space-y-1 md:-mx-8">- <h1 className="text-2xl font-bold">{chat.title}</h1>- <div className="text-sm text-muted-foreground">- {formatDate(chat.createdAt)} · {chat.messages.length} messages- </div>- </div>- </div>- </div>- <AI>- <ChatList messages={uiState} isShared={true} />- </AI>- </div>- <FooterText className="py-8" />- </>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/app/signup/actions.ts b/pipes/archive/vercel-ai-chatbot/app/signup/actions.tsdeleted file mode 100644index 492586ae4..000000000--- a/pipes/archive/vercel-ai-chatbot/app/signup/actions.ts+++ /dev/null@@ -1,111 +0,0 @@-'use server'--import { signIn } from '@/auth'-import { ResultCode, getStringFromBuffer } from '@/lib/utils'-import { z } from 'zod'-import { kv } from '@vercel/kv'-import { getUser } from '../login/actions'-import { AuthError } from 'next-auth'--export async function createUser(- email: string,- hashedPassword: string,- salt: string-) {- const existingUser = await getUser(email)-- if (existingUser) {- return {- type: 'error',- resultCode: ResultCode.UserAlreadyExists- }- } else {- const user = {- id: crypto.randomUUID(),- email,- password: hashedPassword,- salt- }-- await kv.hmset(`user:${email}`, user)-- return {- type: 'success',- resultCode: ResultCode.UserCreated- }- }-}--interface Result {- type: string- resultCode: ResultCode-}--export async function signup(- _prevState: Result | undefined,- formData: FormData-): Promise<Result | undefined> {- const email = formData.get('email') as string- const password = formData.get('password') as string-- const parsedCredentials = z- .object({- email: z.string().email(),- password: z.string().min(6)- })- .safeParse({- email,- password- })-- if (parsedCredentials.success) {- const salt = crypto.randomUUID()-- const encoder = new TextEncoder()- const saltedPassword = encoder.encode(password + salt)- const hashedPasswordBuffer = await crypto.subtle.digest(- 'SHA-256',- saltedPassword- )- const hashedPassword = getStringFromBuffer(hashedPasswordBuffer)-- try {- const result = await createUser(email, hashedPassword, salt)-- if (result.resultCode === ResultCode.UserCreated) {- await signIn('credentials', {- email,- password,- redirect: false- })- }-- return result- } catch (error) {- if (error instanceof AuthError) {- switch (error.type) {- case 'CredentialsSignin':- return {- type: 'error',- resultCode: ResultCode.InvalidCredentials- }- default:- return {- type: 'error',- resultCode: ResultCode.UnknownError- }- }- } else {- return {- type: 'error',- resultCode: ResultCode.UnknownError- }- }- }- } else {- return {- type: 'error',- resultCode: ResultCode.InvalidCredentials- }- }-}diff --git a/pipes/archive/vercel-ai-chatbot/app/signup/page.tsx b/pipes/archive/vercel-ai-chatbot/app/signup/page.tsxdeleted file mode 100644index dbac96428..000000000--- a/pipes/archive/vercel-ai-chatbot/app/signup/page.tsx+++ /dev/null@@ -1,18 +0,0 @@-import { auth } from '@/auth'-import SignupForm from '@/components/signup-form'-import { Session } from '@/lib/types'-import { redirect } from 'next/navigation'--export default async function SignupPage() {- const session = (await auth()) as Session-- if (session) {- redirect('/')- }-- return (- <main className="flex flex-col p-4">- <SignupForm />- </main>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/app/twitter-image.png b/pipes/archive/vercel-ai-chatbot/app/twitter-image.pngdeleted file mode 100644index 278b197ef..000000000Binary files a/pipes/archive/vercel-ai-chatbot/app/twitter-image.png and /dev/null differdiff --git a/pipes/archive/vercel-ai-chatbot/auth.config.ts b/pipes/archive/vercel-ai-chatbot/auth.config.tsdeleted file mode 100644index 6e74c18bb..000000000--- a/pipes/archive/vercel-ai-chatbot/auth.config.ts+++ /dev/null@@ -1,42 +0,0 @@-import type { NextAuthConfig } from 'next-auth'--export const authConfig = {- secret: process.env.AUTH_SECRET,- pages: {- signIn: '/login',- newUser: '/signup'- },- callbacks: {- async authorized({ auth, request: { nextUrl } }) {- const isLoggedIn = !!auth?.user- const isOnLoginPage = nextUrl.pathname.startsWith('/login')- const isOnSignupPage = nextUrl.pathname.startsWith('/signup')-- if (isLoggedIn) {- if (isOnLoginPage || isOnSignupPage) {- return Response.redirect(new URL('/', nextUrl))- }- }-- return true- },- async jwt({ token, user }) {- if (user) {- token = { ...token, id: user.id }- }-- return token- },- async session({ session, token }) {- if (token) {- const { id } = token as { id: string }- const { user } = session-- session = { ...session, user: { ...user, id } }- }-- return session- }- },- providers: []-} satisfies NextAuthConfigdiff --git a/pipes/archive/vercel-ai-chatbot/auth.ts b/pipes/archive/vercel-ai-chatbot/auth.tsdeleted file mode 100644index 7542992bd..000000000--- a/pipes/archive/vercel-ai-chatbot/auth.ts+++ /dev/null@@ -1,45 +0,0 @@-import NextAuth from 'next-auth'-import Credentials from 'next-auth/providers/credentials'-import { authConfig } from './auth.config'-import { z } from 'zod'-import { getStringFromBuffer } from './lib/utils'-import { getUser } from './app/login/actions'--export const { auth, signIn, signOut } = NextAuth({- ...authConfig,- providers: [- Credentials({- async authorize(credentials) {- const parsedCredentials = z- .object({- email: z.string().email(),- password: z.string().min(6)- })- .safeParse(credentials)-- if (parsedCredentials.success) {- const { email, password } = parsedCredentials.data- const user = await getUser(email)-- if (!user) return null-- const encoder = new TextEncoder()- const saltedPassword = encoder.encode(password + user.salt)- const hashedPasswordBuffer = await crypto.subtle.digest(- 'SHA-256',- saltedPassword- )- const hashedPassword = getStringFromBuffer(hashedPasswordBuffer)-- if (hashedPassword === user.password) {- return user- } else {- return null- }- }-- return null- }- })- ]-})diff --git a/pipes/archive/vercel-ai-chatbot/components.json b/pipes/archive/vercel-ai-chatbot/components.jsondeleted file mode 100644index 58b812d03..000000000--- a/pipes/archive/vercel-ai-chatbot/components.json+++ /dev/null@@ -1,17 +0,0 @@-{- "$schema": "https://ui.shadcn.com/schema.json",- "style": "new-york",- "rsc": true,- "tsx": true,- "tailwind": {- "config": "tailwind.config.ts",- "css": "app/globals.css",- "baseColor": "zinc",- "cssVariables": true,- "prefix": ""- },- "aliases": {- "components": "@/components",- "utils": "@/lib/utils"- }-}\ No newline at end of filediff --git a/pipes/archive/vercel-ai-chatbot/components/button-scroll-to-bottom.tsx b/pipes/archive/vercel-ai-chatbot/components/button-scroll-to-bottom.tsxdeleted file mode 100644index 3988e73b3..000000000--- a/pipes/archive/vercel-ai-chatbot/components/button-scroll-to-bottom.tsx+++ /dev/null@@ -1,36 +0,0 @@-'use client'--import * as React from 'react'--import { cn } from '@/lib/utils'-import { Button, type ButtonProps } from '@/components/ui/button'-import { IconArrowDown } from '@/components/ui/icons'--interface ButtonScrollToBottomProps extends ButtonProps {- isAtBottom: boolean- scrollToBottom: () => void-}--export function ButtonScrollToBottom({- className,- isAtBottom,- scrollToBottom,- ...props-}: ButtonScrollToBottomProps) {- return (- <Button- variant="outline"- size="icon"- className={cn(- 'absolute right-4 top-1 z-10 bg-background transition-opacity duration-300 sm:right-8 md:top-2',- isAtBottom ? 'opacity-0' : 'opacity-100',- className- )}- onClick={() => scrollToBottom()}- {...props}- >- <IconArrowDown />- <span className="sr-only">Scroll to bottom</span>- </Button>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/chat-history.tsx b/pipes/archive/vercel-ai-chatbot/components/chat-history.tsxdeleted file mode 100644index 88b6ff440..000000000--- a/pipes/archive/vercel-ai-chatbot/components/chat-history.tsx+++ /dev/null@@ -1,49 +0,0 @@-import * as React from 'react'--import Link from 'next/link'--import { cn } from '@/lib/utils'-import { SidebarList } from '@/components/sidebar-list'-import { buttonVariants } from '@/components/ui/button'-import { IconPlus } from '@/components/ui/icons'--interface ChatHistoryProps {- userId?: string-}--export async function ChatHistory({ userId }: ChatHistoryProps) {- return (- <div className="flex flex-col h-full">- <div className="flex items-center justify-between p-4">- <h4 className="text-sm font-medium">Chat History</h4>- </div>- <div className="mb-2 px-2">- <Link- href="/"- className={cn(- buttonVariants({ variant: 'outline' }),- 'h-10 w-full justify-start bg-zinc-50 px-4 shadow-none transition-colors hover:bg-zinc-200/40 dark:bg-zinc-900 dark:hover:bg-zinc-300/10'- )}- >- <IconPlus className="-translate-x-2 stroke-2" />- New Chat- </Link>- </div>- <React.Suspense- fallback={- <div className="flex flex-col flex-1 px-4 space-y-4 overflow-auto">- {Array.from({ length: 10 }).map((_, i) => (- <div- key={i}- className="w-full h-6 rounded-md shrink-0 animate-pulse bg-zinc-200 dark:bg-zinc-800"- />- ))}- </div>- }- >- {/* @ts-ignore */}- <SidebarList userId={userId} />- </React.Suspense>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/chat-list.tsx b/pipes/archive/vercel-ai-chatbot/components/chat-list.tsxdeleted file mode 100644index 80821a1ea..000000000--- a/pipes/archive/vercel-ai-chatbot/components/chat-list.tsx+++ /dev/null@@ -1,52 +0,0 @@-import { Separator } from '@/components/ui/separator'-import { UIState } from '@/lib/chat/actions'-import { Session } from '@/lib/types'-import Link from 'next/link'-import { ExclamationTriangleIcon } from '@radix-ui/react-icons'--export interface ChatList {- messages: UIState- session?: Session- isShared: boolean-}--export function ChatList({ messages, session, isShared }: ChatList) {- if (!messages.length) {- return null- }-- return (- <div className="relative mx-auto max-w-2xl px-4">- {!isShared && !session ? (- <>- <div className="group relative mb-4 flex items-start md:-ml-12">- <div className="bg-background flex size-[25px] shrink-0 select-none items-center justify-center rounded-md border shadow-sm">- <ExclamationTriangleIcon />- </div>- <div className="ml-4 flex-1 space-y-2 overflow-hidden px-1">- <p className="text-muted-foreground leading-normal">- Please{' '}- <Link href="/login" className="underline">- log in- </Link>{' '}- or{' '}- <Link href="/signup" className="underline">- sign up- </Link>{' '}- to save and revisit your chat history!- </p>- </div>- </div>- <Separator className="my-4" />- </>- ) : null}-- {messages.map((message, index) => (- <div key={message.id}>- {message.display}- {index < messages.length - 1 && <Separator className="my-4" />}- </div>- ))}- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/chat-message-actions.tsx b/pipes/archive/vercel-ai-chatbot/components/chat-message-actions.tsxdeleted file mode 100644index d4e4b40a4..000000000--- a/pipes/archive/vercel-ai-chatbot/components/chat-message-actions.tsx+++ /dev/null@@ -1,40 +0,0 @@-'use client'--import { type Message } from 'ai'--import { Button } from '@/components/ui/button'-import { IconCheck, IconCopy } from '@/components/ui/icons'-import { useCopyToClipboard } from '@/lib/hooks/use-copy-to-clipboard'-import { cn } from '@/lib/utils'--interface ChatMessageActionsProps extends React.ComponentProps<'div'> {- message: Message-}--export function ChatMessageActions({- message,- className,- ...props-}: ChatMessageActionsProps) {- const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 })-- const onCopy = () => {- if (isCopied) return- copyToClipboard(message.content)- }-- return (- <div- className={cn(- 'flex items-center justify-end transition-opacity group-hover:opacity-100 md:absolute md:-right-10 md:-top-2 md:opacity-0',- className- )}- {...props}- >- <Button variant="ghost" size="icon" onClick={onCopy}>- {isCopied ? <IconCheck /> : <IconCopy />}- <span className="sr-only">Copy message</span>- </Button>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/chat-message.tsx b/pipes/archive/vercel-ai-chatbot/components/chat-message.tsxdeleted file mode 100644index 32ecd7841..000000000--- a/pipes/archive/vercel-ai-chatbot/components/chat-message.tsx+++ /dev/null@@ -1,80 +0,0 @@-// Inspired by Chatbot-UI and modified to fit the needs of this project-// @see https://github.com/mckaywrigley/chatbot-ui/blob/main/components/Chat/ChatMessage.tsx--import { Message } from 'ai'-import remarkGfm from 'remark-gfm'-import remarkMath from 'remark-math'--import { cn } from '@/lib/utils'-import { CodeBlock } from '@/components/ui/codeblock'-import { MemoizedReactMarkdown } from '@/components/markdown'-import { IconOpenAI, IconUser } from '@/components/ui/icons'-import { ChatMessageActions } from '@/components/chat-message-actions'--export interface ChatMessageProps {- message: Message-}--export function ChatMessage({ message, ...props }: ChatMessageProps) {- return (- <div- className={cn('group relative mb-4 flex items-start md:-ml-12')}- {...props}- >- <div- className={cn(- 'flex size-8 shrink-0 select-none items-center justify-center rounded-md border shadow',- message.role === 'user'- ? 'bg-background'- : 'bg-primary text-primary-foreground'- )}- >- {message.role === 'user' ? <IconUser /> : <IconOpenAI />}- </div>- <div className="flex-1 px-1 ml-4 space-y-2 overflow-hidden">- <MemoizedReactMarkdown- className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0"- remarkPlugins={[remarkGfm, remarkMath]}- components={{- p({ children }) {- return <p className="mb-2 last:mb-0">{children}</p>- },- code({ node, inline, className, children, ...props }) {- if (children.length) {- if (children[0] == '▍') {- return (- <span className="mt-1 cursor-default animate-pulse">▍</span>- )- }-- children[0] = (children[0] as string).replace('`▍`', '▍')- }-- const match = /language-(\w+)/.exec(className || '')-- if (inline) {- return (- <code className={className} {...props}>- {children}- </code>- )- }-- return (- <CodeBlock- key={Math.random()}- language={(match && match[1]) || ''}- value={String(children).replace(/\n$/, '')}- {...props}- />- )- }- }}- >- {message.content}- </MemoizedReactMarkdown>- <ChatMessageActions message={message} />- </div>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/chat-panel.tsx b/pipes/archive/vercel-ai-chatbot/components/chat-panel.tsxdeleted file mode 100644index 870c6d21e..000000000--- a/pipes/archive/vercel-ai-chatbot/components/chat-panel.tsx+++ /dev/null@@ -1,129 +0,0 @@-import * as React from 'react'--import { shareChat } from '@/app/actions'-import { Button } from '@/components/ui/button'-import { PromptForm } from '@/components/prompt-form'-import { ButtonScrollToBottom } from '@/components/button-scroll-to-bottom'-import { IconShare } from '@/components/ui/icons'-import { FooterText } from '@/components/footer'-import { ChatShareDialog } from '@/components/chat-share-dialog'-import { useAIState, useActions, useUIState } from 'ai/rsc'-import type { AI } from '@/lib/chat/actions'-import { nanoid } from 'nanoid'-import { UserMessage } from './stocks/message'--export interface ChatPanelProps {- id?: string- title?: string- input: string- setInput: (value: string) => void- isAtBottom: boolean- scrollToBottom: () => void-}--export function ChatPanel({- id,- title,- input,- setInput,- isAtBottom,- scrollToBottom-}: ChatPanelProps) {- const [aiState] = useAIState()- const [messages, setMessages] = useUIState<typeof AI>()- const { submitUserMessage } = useActions()- const [shareDialogOpen, setShareDialogOpen] = React.useState(false)-- const exampleMessages = [- {- heading: 'What Elon Musk',- subheading: 'posted about Neuralink?',- message: `Elon Musk`- },- {- heading: 'Did i see',- subheading: 'Claude Sonnet app on twitter?',- message: 'Did i see "Claude"?'- },- ]-- return (- <div className="fixed inset-x-0 bottom-0 w-full bg-gradient-to-b from-muted/30 from-0% to-muted/30 to-50% duration-300 ease-in-out animate-in dark:from-background/10 dark:from-10% dark:to-background/80 peer-[[data-state=open]]:group-[]:lg:pl-[250px] peer-[[data-state=open]]:group-[]:xl:pl-[300px]">- <ButtonScrollToBottom- isAtBottom={isAtBottom}- scrollToBottom={scrollToBottom}- />-- <div className="mx-auto sm:max-w-2xl sm:px-4">- <div className="mb-4 grid grid-cols-2 gap-2 px-4 sm:px-0">- {messages.length === 0 &&- exampleMessages.map((example, index) => (- <div- key={example.heading}- className={`cursor-pointer rounded-lg border bg-white p-4 hover:bg-zinc-50 dark:bg-zinc-950 dark:hover:bg-zinc-900 ${- index > 1 && 'hidden md:block'- }`}- onClick={async () => {- setMessages(currentMessages => [- ...currentMessages,- {- id: nanoid(),- display: <UserMessage>{example.message}</UserMessage>- }- ])-- const responseMessage = await submitUserMessage(- example.message- )-- setMessages(currentMessages => [- ...currentMessages,- responseMessage- ])- }}- >- <div className="text-sm font-semibold">{example.heading}</div>- <div className="text-sm text-zinc-600">- {example.subheading}- </div>- </div>- ))}- </div>-- {messages?.length >= 2 ? (- <div className="flex h-12 items-center justify-center">- <div className="flex space-x-2">- {id && title ? (- <>- <Button- variant="outline"- onClick={() => setShareDialogOpen(true)}- >- <IconShare className="mr-2" />- Share- </Button>- <ChatShareDialog- open={shareDialogOpen}- onOpenChange={setShareDialogOpen}- onCopy={() => setShareDialogOpen(false)}- shareChat={shareChat}- chat={{- id,- title,- messages: aiState.messages- }}- />- </>- ) : null}- </div>- </div>- ) : null}-- <div className="space-y-4 border-t bg-background px-4 py-2 shadow-lg sm:rounded-t-xl sm:border md:py-4">- <PromptForm input={input} setInput={setInput} />- <FooterText className="hidden sm:block" />- </div>- </div>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/chat-share-dialog.tsx b/pipes/archive/vercel-ai-chatbot/components/chat-share-dialog.tsxdeleted file mode 100644index 2e5f8e27b..000000000--- a/pipes/archive/vercel-ai-chatbot/components/chat-share-dialog.tsx+++ /dev/null@@ -1,95 +0,0 @@-'use client'--import * as React from 'react'-import { type DialogProps } from '@radix-ui/react-dialog'-import { toast } from 'sonner'--import { ServerActionResult, type Chat } from '@/lib/types'-import { Button } from '@/components/ui/button'-import {- Dialog,- DialogContent,- DialogDescription,- DialogFooter,- DialogHeader,- DialogTitle-} from '@/components/ui/dialog'-import { IconSpinner } from '@/components/ui/icons'-import { useCopyToClipboard } from '@/lib/hooks/use-copy-to-clipboard'--interface ChatShareDialogProps extends DialogProps {- chat: Pick<Chat, 'id' | 'title' | 'messages'>- shareChat: (id: string) => ServerActionResult<Chat>- onCopy: () => void-}--export function ChatShareDialog({- chat,- shareChat,- onCopy,- ...props-}: ChatShareDialogProps) {- const { copyToClipboard } = useCopyToClipboard({ timeout: 1000 })- const [isSharePending, startShareTransition] = React.useTransition()-- const copyShareLink = React.useCallback(- async (chat: Chat) => {- if (!chat.sharePath) {- return toast.error('Could not copy share link to clipboard')- }-- const url = new URL(window.location.href)- url.pathname = chat.sharePath- copyToClipboard(url.toString())- onCopy()- toast.success('Share link copied to clipboard')- },- [copyToClipboard, onCopy]- )-- return (- <Dialog {...props}>- <DialogContent>- <DialogHeader>- <DialogTitle>Share link to chat</DialogTitle>- <DialogDescription>- Anyone with the URL will be able to view the shared chat.- </DialogDescription>- </DialogHeader>- <div className="p-4 space-y-1 text-sm border rounded-md">- <div className="font-medium">{chat.title}</div>- <div className="text-muted-foreground">- {chat.messages.length} messages- </div>- </div>- <DialogFooter className="items-center">- <Button- disabled={isSharePending}- onClick={() => {- // @ts-ignore- startShareTransition(async () => {- const result = await shareChat(chat.id)-- if (result && 'error' in result) {- toast.error(result.error)- return- }-- copyShareLink(result)- })- }}- >- {isSharePending ? (- <>- <IconSpinner className="mr-2 animate-spin" />- Copying...- </>- ) : (- <>Copy link</>- )}- </Button>- </DialogFooter>- </DialogContent>- </Dialog>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/chat.tsx b/pipes/archive/vercel-ai-chatbot/components/chat.tsxdeleted file mode 100644index c43d42a11..000000000--- a/pipes/archive/vercel-ai-chatbot/components/chat.tsx+++ /dev/null@@ -1,84 +0,0 @@-'use client'--import { cn } from '@/lib/utils'-import { ChatList } from '@/components/chat-list'-import { ChatPanel } from '@/components/chat-panel'-import { EmptyScreen } from '@/components/empty-screen'-import { useLocalStorage } from '@/lib/hooks/use-local-storage'-import { useEffect, useState } from 'react'-import { useUIState, useAIState } from 'ai/rsc'-import { Message, Session } from '@/lib/types'-import { usePathname, useRouter } from 'next/navigation'-import { useScrollAnchor } from '@/lib/hooks/use-scroll-anchor'-import { toast } from 'sonner'--export interface ChatProps extends React.ComponentProps<'div'> {- initialMessages?: Message[]- id?: string- session?: Session- missingKeys: string[]-}--export function Chat({ id, className, session, missingKeys }: ChatProps) {- const router = useRouter()- const path = usePathname()- const [input, setInput] = useState('')- const [messages] = useUIState()- const [aiState] = useAIState()-- const [_, setNewChatId] = useLocalStorage('newChatId', id)-- useEffect(() => {- if (session?.user) {- if (!path.includes('chat') && messages.length === 1) {- window.history.replaceState({}, '', `/chat/${id}`)- }- }- }, [id, path, session?.user, messages])-- useEffect(() => {- const messagesLength = aiState.messages?.length- if (messagesLength === 2) {- router.refresh()- }- }, [aiState.messages, router])-- useEffect(() => {- setNewChatId(id)- })-- useEffect(() => {- missingKeys.map(key => {- toast.error(`Missing ${key} environment variable!`)- })- }, [missingKeys])-- const { messagesRef, scrollRef, visibilityRef, isAtBottom, scrollToBottom } =- useScrollAnchor()-- return (- <div- className="group w-full overflow-auto pl-0 peer-[[data-state=open]]:lg:pl-[250px] peer-[[data-state=open]]:xl:pl-[300px]"- ref={scrollRef}- >- <div- className={cn('pb-[200px] pt-4 md:pt-10', className)}- ref={messagesRef}- >- {messages.length ? (- <ChatList messages={messages} isShared={false} session={session} />- ) : (- <EmptyScreen />- )}- <div className="w-full h-px" ref={visibilityRef} />- </div>- <ChatPanel- id={id}- input={input}- setInput={setInput}- isAtBottom={isAtBottom}- scrollToBottom={scrollToBottom}- />- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/clear-history.tsx b/pipes/archive/vercel-ai-chatbot/components/clear-history.tsxdeleted file mode 100644index 69cf70ec3..000000000--- a/pipes/archive/vercel-ai-chatbot/components/clear-history.tsx+++ /dev/null@@ -1,75 +0,0 @@-'use client'--import * as React from 'react'-import { useRouter } from 'next/navigation'-import { toast } from 'sonner'--import { ServerActionResult } from '@/lib/types'-import { Button } from '@/components/ui/button'-import {- AlertDialog,- AlertDialogAction,- AlertDialogCancel,- AlertDialogContent,- AlertDialogDescription,- AlertDialogFooter,- AlertDialogHeader,- AlertDialogTitle,- AlertDialogTrigger-} from '@/components/ui/alert-dialog'-import { IconSpinner } from '@/components/ui/icons'--interface ClearHistoryProps {- isEnabled: boolean- clearChats: () => ServerActionResult<void>-}--export function ClearHistory({- isEnabled = false,- clearChats-}: ClearHistoryProps) {- const [open, setOpen] = React.useState(false)- const [isPending, startTransition] = React.useTransition()- const router = useRouter()-- return (- <AlertDialog open={open} onOpenChange={setOpen}>- <AlertDialogTrigger asChild>- <Button variant="ghost" disabled={!isEnabled || isPending}>- {isPending && <IconSpinner className="mr-2" />}- Clear history- </Button>- </AlertDialogTrigger>- <AlertDialogContent>- <AlertDialogHeader>- <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>- <AlertDialogDescription>- This will permanently delete your chat history and remove your data- from our servers.- </AlertDialogDescription>- </AlertDialogHeader>- <AlertDialogFooter>- <AlertDialogCancel disabled={isPending}>Cancel</AlertDialogCancel>- <AlertDialogAction- disabled={isPending}- onClick={event => {- event.preventDefault()- startTransition(async () => {- const result = await clearChats()- if (result && 'error' in result) {- toast.error(result.error)- return- }-- setOpen(false)- })- }}- >- {isPending && <IconSpinner className="mr-2 animate-spin" />}- Delete- </AlertDialogAction>- </AlertDialogFooter>- </AlertDialogContent>- </AlertDialog>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/empty-screen.tsx b/pipes/archive/vercel-ai-chatbot/components/empty-screen.tsxdeleted file mode 100644index 34fee2014..000000000--- a/pipes/archive/vercel-ai-chatbot/components/empty-screen.tsx+++ /dev/null@@ -1,24 +0,0 @@-import { UseChatHelpers } from 'ai/react'--import { Button } from '@/components/ui/button'-import { ExternalLink } from '@/components/external-link'-import { IconArrowRight } from '@/components/ui/icons'--export function EmptyScreen() {- return (- <div className="mx-auto max-w-2xl px-4">- <div className="flex flex-col gap-2 rounded-lg border bg-background p-8">- <h1 className="text-lg font-semibold">- Welcome to ScreenPipe AI Chatbot!- </h1>- <p className="leading-normal text-muted-foreground">- This is an example AI Assistant implementation using{' '}- <ExternalLink href="https://nextjs.org">Next.js</ExternalLink>, the{' '}- <ExternalLink href="https://sdk.vercel.ai">- Vercel AI SDK- </ExternalLink>- </p>- </div>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/external-link.tsx b/pipes/archive/vercel-ai-chatbot/components/external-link.tsxdeleted file mode 100644index ba6cc0161..000000000--- a/pipes/archive/vercel-ai-chatbot/components/external-link.tsx+++ /dev/null@@ -1,29 +0,0 @@-export function ExternalLink({- href,- children-}: {- href: string- children: React.ReactNode-}) {- return (- <a- href={href}- target="_blank"- className="inline-flex flex-1 justify-center gap-1 leading-4 hover:underline"- >- <span>{children}</span>- <svg- aria-hidden="true"- height="7"- viewBox="0 0 6 6"- width="7"- className="opacity-70"- >- <path- d="M1.25215 5.54731L0.622742 4.9179L3.78169 1.75597H1.3834L1.38936 0.890915H5.27615V4.78069H4.40513L4.41109 2.38538L1.25215 5.54731Z"- fill="currentColor"- ></path>- </svg>- </a>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/footer.tsx b/pipes/archive/vercel-ai-chatbot/components/footer.tsxdeleted file mode 100644index 5ed21579a..000000000--- a/pipes/archive/vercel-ai-chatbot/components/footer.tsx+++ /dev/null@@ -1,23 +0,0 @@-import React from 'react'--import { cn } from '@/lib/utils'-import { ExternalLink } from '@/components/external-link'--export function FooterText({ className, ...props }: React.ComponentProps<'p'>) {- return (- <p- className={cn(- 'px-2 text-center text-xs leading-normal text-muted-foreground',- className- )}- {...props}- >- Open source AI chatbot built with{' '}- <ExternalLink href="https://nextjs.org">Next.js</ExternalLink> and{' '}- <ExternalLink href="https://github.com/vercel/ai">- Vercel AI SDK- </ExternalLink>- .- </p>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/header.tsx b/pipes/archive/vercel-ai-chatbot/components/header.tsxdeleted file mode 100644index 593defb50..000000000--- a/pipes/archive/vercel-ai-chatbot/components/header.tsx+++ /dev/null@@ -1,80 +0,0 @@-import * as React from 'react'-import Link from 'next/link'--import { cn } from '@/lib/utils'-import { auth } from '@/auth'-import { Button, buttonVariants } from '@/components/ui/button'-import {- IconGitHub,- IconNextChat,- IconSeparator,- IconVercel-} from '@/components/ui/icons'-import { UserMenu } from '@/components/user-menu'-import { SidebarMobile } from './sidebar-mobile'-import { SidebarToggle } from './sidebar-toggle'-import { ChatHistory } from './chat-history'-import { Session } from '@/lib/types'--async function UserOrLogin() {- const session = (await auth()) as Session- return (- <>- {session?.user ? (- <>- <SidebarMobile>- {/* <ChatHistory userId={session.user.id} /> */}- </SidebarMobile>- <SidebarToggle />- </>- ) : (- <Link href="/new" rel="nofollow">- <IconNextChat className="size-6 mr-2 dark:hidden" inverted />- <IconNextChat className="hidden size-6 mr-2 dark:block" />- </Link>- )}- <div className="flex items-center">- <IconSeparator className="size-6 text-muted-foreground/50" />- {session?.user ? (- <UserMenu user={session.user} />- ) : (- <Button variant="link" asChild className="-ml-2">- <Link href="/login">Login</Link>- </Button>- )}- </div>- </>- )-}--export function Header() {- return (- <header className="sticky top-0 z-50 flex items-center justify-between w-full h-16 px-4 border-b shrink-0 bg-gradient-to-b from-background/10 via-background/50 to-background/80 backdrop-blur-xl">- <div className="flex items-center">- <React.Suspense fallback={<div className="flex-1 overflow-auto" />}>- <UserOrLogin />- </React.Suspense>- </div>- <div className="flex items-center justify-end space-x-2">- <a- target="_blank"- href="https://github.com/vercel/nextjs-ai-chatbot/"- rel="noopener noreferrer"- className={cn(buttonVariants({ variant: 'outline' }))}- >- <IconGitHub />- <span className="hidden ml-2 md:flex">GitHub</span>- </a>- <a- href="https://vercel.com/templates/Next.js/nextjs-ai-chatbot"- target="_blank"- className={cn(buttonVariants())}- >- <IconVercel className="mr-2" />- <span className="hidden sm:block">Deploy to Vercel</span>- <span className="sm:hidden">Deploy</span>- </a>- </div>- </header>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/login-button.tsx b/pipes/archive/vercel-ai-chatbot/components/login-button.tsxdeleted file mode 100644index ae8f84274..000000000--- a/pipes/archive/vercel-ai-chatbot/components/login-button.tsx+++ /dev/null@@ -1,42 +0,0 @@-'use client'--import * as React from 'react'-import { signIn } from 'next-auth/react'--import { cn } from '@/lib/utils'-import { Button, type ButtonProps } from '@/components/ui/button'-import { IconGitHub, IconSpinner } from '@/components/ui/icons'--interface LoginButtonProps extends ButtonProps {- showGithubIcon?: boolean- text?: string-}--export function LoginButton({- text = 'Login with GitHub',- showGithubIcon = true,- className,- ...props-}: LoginButtonProps) {- const [isLoading, setIsLoading] = React.useState(false)- return (- <Button- variant="outline"- onClick={() => {- setIsLoading(true)- // next-auth signIn() function doesn't work yet at Edge Runtime due to usage of BroadcastChannel- signIn('github', { callbackUrl: `/` })- }}- disabled={isLoading}- className={cn(className)}- {...props}- >- {isLoading ? (- <IconSpinner className="mr-2 animate-spin" />- ) : showGithubIcon ? (- <IconGitHub className="mr-2" />- ) : null}- {text}- </Button>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/login-form.tsx b/pipes/archive/vercel-ai-chatbot/components/login-form.tsxdeleted file mode 100644index 0a6910d63..000000000--- a/pipes/archive/vercel-ai-chatbot/components/login-form.tsx+++ /dev/null@@ -1,97 +0,0 @@-'use client'--import { useFormState, useFormStatus } from 'react-dom'-import { authenticate } from '@/app/login/actions'-import Link from 'next/link'-import { useEffect } from 'react'-import { toast } from 'sonner'-import { IconSpinner } from './ui/icons'-import { getMessageFromCode } from '@/lib/utils'-import { useRouter } from 'next/navigation'--export default function LoginForm() {- const router = useRouter()- const [result, dispatch] = useFormState(authenticate, undefined)-- useEffect(() => {- if (result) {- if (result.type === 'error') {- toast.error(getMessageFromCode(result.resultCode))- } else {- toast.success(getMessageFromCode(result.resultCode))- router.refresh()- }- }- }, [result, router])-- return (- <form- action={dispatch}- className="flex flex-col items-center gap-4 space-y-3"- >- <div className="w-full flex-1 rounded-lg border bg-white px-6 pb-4 pt-8 shadow-md md:w-96 dark:bg-zinc-950">- <h1 className="mb-3 text-2xl font-bold">Please log in to continue.</h1>- <div className="w-full">- <div>- <label- className="mb-3 mt-5 block text-xs font-medium text-zinc-400"- htmlFor="email"- >- </label>- <div className="relative">- <input- className="peer block w-full rounded-md border bg-zinc-50 px-2 py-[9px] text-sm outline-none placeholder:text-zinc-500 dark:border-zinc-800 dark:bg-zinc-950"- id="email"- type="email"- name="email"- placeholder="Enter your email address"- required- />- </div>- </div>- <div className="mt-4">- <label- className="mb-3 mt-5 block text-xs font-medium text-zinc-400"- htmlFor="password"- >- Password- </label>- <div className="relative">- <input- className="peer block w-full rounded-md border bg-zinc-50 px-2 py-[9px] text-sm outline-none placeholder:text-zinc-500 dark:border-zinc-800 dark:bg-zinc-950"- id="password"- type="password"- name="password"- placeholder="Enter password"- required- minLength={6}- />- </div>- </div>- </div>- <LoginButton />- </div>-- <Link- href="/signup"- className="flex flex-row gap-1 text-sm text-zinc-400"- >- No account yet? <div className="font-semibold underline">Sign up</div>- </Link>- </form>- )-}--function LoginButton() {- const { pending } = useFormStatus()-- return (- <button- className="my-4 flex h-10 w-full flex-row items-center justify-center rounded-md bg-zinc-900 p-2 text-sm font-semibold text-zinc-100 hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200"- aria-disabled={pending}- >- {pending ? <IconSpinner /> : 'Log in'}- </button>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/markdown.tsx b/pipes/archive/vercel-ai-chatbot/components/markdown.tsxdeleted file mode 100644index d4491467a..000000000--- a/pipes/archive/vercel-ai-chatbot/components/markdown.tsx+++ /dev/null@@ -1,9 +0,0 @@-import { FC, memo } from 'react'-import ReactMarkdown, { Options } from 'react-markdown'--export const MemoizedReactMarkdown: FC<Options> = memo(- ReactMarkdown,- (prevProps, nextProps) =>- prevProps.children === nextProps.children &&- prevProps.className === nextProps.className-)diff --git a/pipes/archive/vercel-ai-chatbot/components/prompt-form.tsx b/pipes/archive/vercel-ai-chatbot/components/prompt-form.tsxdeleted file mode 100644index 2271edbd5..000000000--- a/pipes/archive/vercel-ai-chatbot/components/prompt-form.tsx+++ /dev/null@@ -1,115 +0,0 @@-'use client'--import * as React from 'react'-import Textarea from 'react-textarea-autosize'--import { useActions, useUIState } from 'ai/rsc'--import { UserMessage } from './stocks/message'-import { type AI } from '@/lib/chat/actions'-import { Button } from '@/components/ui/button'-import { IconArrowElbow, IconPlus } from '@/components/ui/icons'-import {- Tooltip,- TooltipContent,- TooltipTrigger-} from '@/components/ui/tooltip'-import { useEnterSubmit } from '@/lib/hooks/use-enter-submit'-import { nanoid } from 'nanoid'-import { useRouter } from 'next/navigation'--export function PromptForm({- input,- setInput-}: {- input: string- setInput: (value: string) => void-}) {- const router = useRouter()- const { formRef, onKeyDown } = useEnterSubmit()- const inputRef = React.useRef<HTMLTextAreaElement>(null)- const { submitUserMessage } = useActions()- const [_, setMessages] = useUIState<typeof AI>()-- React.useEffect(() => {- if (inputRef.current) {- inputRef.current.focus()- }- }, [])-- return (- <form- ref={formRef}- onSubmit={async (e: any) => {- e.preventDefault()-- // Blur focus on mobile- if (window.innerWidth < 600) {- e.target['message']?.blur()- }-- const value = input.trim()- setInput('')- if (!value) return-- // Optimistically add user message UI- setMessages(currentMessages => [- ...currentMessages,- {- id: nanoid(),- display: <UserMessage>{value}</UserMessage>- }- ])-- // Submit and get response message- const responseMessage = await submitUserMessage(value)- setMessages(currentMessages => [...currentMessages, responseMessage])- }}- >- <div className="relative flex max-h-60 w-full grow flex-col overflow-hidden bg-background px-8 sm:rounded-md sm:border sm:px-12">- <Tooltip>- <TooltipTrigger asChild>- <Button- variant="outline"- size="icon"- className="absolute left-0 top-[14px] size-8 rounded-full bg-background p-0 sm:left-4"- onClick={() => {- router.push('/new')- }}- >- <IconPlus />- <span className="sr-only">New Chat</span>- </Button>- </TooltipTrigger>- <TooltipContent>New Chat</TooltipContent>- </Tooltip>- <Textarea- ref={inputRef}- tabIndex={0}- onKeyDown={onKeyDown}- placeholder="Send a message."- className="min-h-[60px] w-full resize-none bg-transparent px-4 py-[1.3rem] focus-within:outline-none sm:text-sm"- autoFocus- spellCheck={false}- autoComplete="off"- autoCorrect="off"- name="message"- rows={1}- value={input}- onChange={e => setInput(e.target.value)}- />- <div className="absolute right-0 top-[13px] sm:right-4">- <Tooltip>- <TooltipTrigger asChild>- <Button type="submit" size="icon" disabled={input === ''}>- <IconArrowElbow />- <span className="sr-only">Send message</span>- </Button>- </TooltipTrigger>- <TooltipContent>Send message</TooltipContent>- </Tooltip>- </div>- </div>- </form>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/providers.tsx b/pipes/archive/vercel-ai-chatbot/components/providers.tsxdeleted file mode 100644index 0a8de4a15..000000000--- a/pipes/archive/vercel-ai-chatbot/components/providers.tsx+++ /dev/null@@ -1,17 +0,0 @@-'use client'--import * as React from 'react'-import { ThemeProvider as NextThemesProvider } from 'next-themes'-import { ThemeProviderProps } from 'next-themes/dist/types'-import { SidebarProvider } from '@/lib/hooks/use-sidebar'-import { TooltipProvider } from '@/components/ui/tooltip'--export function Providers({ children, ...props }: ThemeProviderProps) {- return (- <NextThemesProvider {...props}>- <SidebarProvider>- <TooltipProvider>{children}</TooltipProvider>- </SidebarProvider>- </NextThemesProvider>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/sidebar-actions.tsx b/pipes/archive/vercel-ai-chatbot/components/sidebar-actions.tsxdeleted file mode 100644index 4f90f2d5d..000000000--- a/pipes/archive/vercel-ai-chatbot/components/sidebar-actions.tsx+++ /dev/null@@ -1,125 +0,0 @@-'use client'--import { useRouter } from 'next/navigation'-import * as React from 'react'-import { toast } from 'sonner'--import { ServerActionResult, type Chat } from '@/lib/types'-import {- AlertDialog,- AlertDialogAction,- AlertDialogCancel,- AlertDialogContent,- AlertDialogDescription,- AlertDialogFooter,- AlertDialogHeader,- AlertDialogTitle-} from '@/components/ui/alert-dialog'-import { Button } from '@/components/ui/button'-import { IconShare, IconSpinner, IconTrash } from '@/components/ui/icons'-import { ChatShareDialog } from '@/components/chat-share-dialog'-import {- Tooltip,- TooltipContent,- TooltipTrigger-} from '@/components/ui/tooltip'--interface SidebarActionsProps {- chat: Chat- removeChat: (args: { id: string; path: string }) => ServerActionResult<void>- shareChat: (id: string) => ServerActionResult<Chat>-}--export function SidebarActions({- chat,- removeChat,- shareChat-}: SidebarActionsProps) {- const router = useRouter()- const [deleteDialogOpen, setDeleteDialogOpen] = React.useState(false)- const [shareDialogOpen, setShareDialogOpen] = React.useState(false)- const [isRemovePending, startRemoveTransition] = React.useTransition()-- return (- <>- <div className="">- <Tooltip>- <TooltipTrigger asChild>- <Button- variant="ghost"- className="size-7 p-0 hover:bg-background"- onClick={() => setShareDialogOpen(true)}- >- <IconShare />- <span className="sr-only">Share</span>- </Button>- </TooltipTrigger>- <TooltipContent>Share chat</TooltipContent>- </Tooltip>- <Tooltip>- <TooltipTrigger asChild>- <Button- variant="ghost"- className="size-7 p-0 hover:bg-background"- disabled={isRemovePending}- onClick={() => setDeleteDialogOpen(true)}- >- <IconTrash />- <span className="sr-only">Delete</span>- </Button>- </TooltipTrigger>- <TooltipContent>Delete chat</TooltipContent>- </Tooltip>- </div>- <ChatShareDialog- chat={chat}- shareChat={shareChat}- open={shareDialogOpen}- onOpenChange={setShareDialogOpen}- onCopy={() => setShareDialogOpen(false)}- />- <AlertDialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>- <AlertDialogContent>- <AlertDialogHeader>- <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>- <AlertDialogDescription>- This will permanently delete your chat message and remove your- data from our servers.- </AlertDialogDescription>- </AlertDialogHeader>- <AlertDialogFooter>- <AlertDialogCancel disabled={isRemovePending}>- Cancel- </AlertDialogCancel>- <AlertDialogAction- disabled={isRemovePending}- onClick={event => {- event.preventDefault()- // @ts-ignore- startRemoveTransition(async () => {- const result = await removeChat({- id: chat.id,- path: chat.path- })-- if (result && 'error' in result) {- toast.error(result.error)- return- }-- setDeleteDialogOpen(false)- router.refresh()- router.push('/')- toast.success('Chat deleted')- })- }}- >- {isRemovePending && <IconSpinner className="mr-2 animate-spin" />}- Delete- </AlertDialogAction>- </AlertDialogFooter>- </AlertDialogContent>- </AlertDialog>- </>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/sidebar-desktop.tsx b/pipes/archive/vercel-ai-chatbot/components/sidebar-desktop.tsxdeleted file mode 100644index 7bc0e19c1..000000000--- a/pipes/archive/vercel-ai-chatbot/components/sidebar-desktop.tsx+++ /dev/null@@ -1,19 +0,0 @@-import { Sidebar } from '@/components/sidebar'--import { auth } from '@/auth'-import { ChatHistory } from '@/components/chat-history'--export async function SidebarDesktop() {- const session = await auth()-- if (!session?.user?.id) {- return null- }-- return (- <Sidebar className="peer absolute inset-y-0 z-30 hidden -translate-x-full border-r bg-muted duration-300 ease-in-out data-[state=open]:translate-x-0 lg:flex lg:w-[250px] xl:w-[300px]">- {/* @ts-ignore */}- <ChatHistory userId={session.user.id} />- </Sidebar>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/sidebar-footer.tsx b/pipes/archive/vercel-ai-chatbot/components/sidebar-footer.tsxdeleted file mode 100644index a2e18ea66..000000000--- a/pipes/archive/vercel-ai-chatbot/components/sidebar-footer.tsx+++ /dev/null@@ -1,16 +0,0 @@-import { cn } from '@/lib/utils'--export function SidebarFooter({- children,- className,- ...props-}: React.ComponentProps<'div'>) {- return (- <div- className={cn('flex items-center justify-between p-4', className)}- {...props}- >- {children}- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/sidebar-item.tsx b/pipes/archive/vercel-ai-chatbot/components/sidebar-item.tsxdeleted file mode 100644index fc7020bcc..000000000--- a/pipes/archive/vercel-ai-chatbot/components/sidebar-item.tsx+++ /dev/null@@ -1,124 +0,0 @@-'use client'--import * as React from 'react'--import Link from 'next/link'-import { usePathname } from 'next/navigation'--import { motion } from 'framer-motion'--import { buttonVariants } from '@/components/ui/button'-import { IconMessage, IconUsers } from '@/components/ui/icons'-import {- Tooltip,- TooltipContent,- TooltipTrigger-} from '@/components/ui/tooltip'-import { useLocalStorage } from '@/lib/hooks/use-local-storage'-import { type Chat } from '@/lib/types'-import { cn } from '@/lib/utils'--interface SidebarItemProps {- index: number- chat: Chat- children: React.ReactNode-}--export function SidebarItem({ index, chat, children }: SidebarItemProps) {- const pathname = usePathname()-- const isActive = pathname === chat.path- const [newChatId, setNewChatId] = useLocalStorage('newChatId', null)- const shouldAnimate = index === 0 && isActive && newChatId-- if (!chat?.id) return null-- return (- <motion.div- className="relative h-8"- variants={{- initial: {- height: 0,- opacity: 0- },- animate: {- height: 'auto',- opacity: 1- }- }}- initial={shouldAnimate ? 'initial' : undefined}- animate={shouldAnimate ? 'animate' : undefined}- transition={{- duration: 0.25,- ease: 'easeIn'- }}- >- <div className="absolute left-2 top-1 flex size-6 items-center justify-center">- {chat.sharePath ? (- <Tooltip delayDuration={1000}>- <TooltipTrigger- tabIndex={-1}- className="focus:bg-muted focus:ring-1 focus:ring-ring"- >- <IconUsers className="mr-2 mt-1 text-zinc-500" />- </TooltipTrigger>- <TooltipContent>This is a shared chat.</TooltipContent>- </Tooltip>- ) : (- <IconMessage className="mr-2 mt-1 text-zinc-500" />- )}- </div>- <Link- href={chat.path}- className={cn(- buttonVariants({ variant: 'ghost' }),- 'group w-full px-8 transition-colors hover:bg-zinc-200/40 dark:hover:bg-zinc-300/10',- isActive && 'bg-zinc-200 pr-16 font-semibold dark:bg-zinc-800'- )}- >- <div- className="relative max-h-5 flex-1 select-none overflow-hidden text-ellipsis break-all"- title={chat.title}- >- <span className="whitespace-nowrap">- {shouldAnimate ? (- chat.title.split('').map((character, index) => (- <motion.span- key={index}- variants={{- initial: {- opacity: 0,- x: -100- },- animate: {- opacity: 1,- x: 0- }- }}- initial={shouldAnimate ? 'initial' : undefined}- animate={shouldAnimate ? 'animate' : undefined}- transition={{- duration: 0.25,- ease: 'easeIn',- delay: index * 0.05,- staggerChildren: 0.05- }}- onAnimationComplete={() => {- if (index === chat.title.length - 1) {- setNewChatId(null)- }- }}- >- {character}- </motion.span>- ))- ) : (- <span>{chat.title}</span>- )}- </span>- </div>- </Link>- {isActive && <div className="absolute right-2 top-1">{children}</div>}- </motion.div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/sidebar-items.tsx b/pipes/archive/vercel-ai-chatbot/components/sidebar-items.tsxdeleted file mode 100644index 11cc7fc47..000000000--- a/pipes/archive/vercel-ai-chatbot/components/sidebar-items.tsx+++ /dev/null@@ -1,42 +0,0 @@-'use client'--import { Chat } from '@/lib/types'-import { AnimatePresence, motion } from 'framer-motion'--import { removeChat, shareChat } from '@/app/actions'--import { SidebarActions } from '@/components/sidebar-actions'-import { SidebarItem } from '@/components/sidebar-item'--interface SidebarItemsProps {- chats?: Chat[]-}--export function SidebarItems({ chats }: SidebarItemsProps) {- if (!chats?.length) return null-- return (- <AnimatePresence>- {chats.map(- (chat, index) =>- chat && (- <motion.div- key={chat?.id}- exit={{- opacity: 0,- height: 0- }}- >- <SidebarItem index={index} chat={chat}>- <SidebarActions- chat={chat}- removeChat={removeChat}- shareChat={shareChat}- />- </SidebarItem>- </motion.div>- )- )}- </AnimatePresence>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/sidebar-list.tsx b/pipes/archive/vercel-ai-chatbot/components/sidebar-list.tsxdeleted file mode 100644index 0a7fb1ade..000000000--- a/pipes/archive/vercel-ai-chatbot/components/sidebar-list.tsx+++ /dev/null@@ -1,38 +0,0 @@-import { clearChats, getChats } from '@/app/actions'-import { ClearHistory } from '@/components/clear-history'-import { SidebarItems } from '@/components/sidebar-items'-import { ThemeToggle } from '@/components/theme-toggle'-import { cache } from 'react'--interface SidebarListProps {- userId?: string- children?: React.ReactNode-}--const loadChats = cache(async (userId?: string) => {- return await getChats(userId)-})--export async function SidebarList({ userId }: SidebarListProps) {- const chats = await loadChats(userId)-- return (- <div className="flex flex-1 flex-col overflow-hidden">- <div className="flex-1 overflow-auto">- {chats?.length ? (- <div className="space-y-2 px-2">- <SidebarItems chats={chats} />- </div>- ) : (- <div className="p-8 text-center">- <p className="text-sm text-muted-foreground">No chat history</p>- </div>- )}- </div>- <div className="flex items-center justify-between p-4">- <ThemeToggle />- <ClearHistory clearChats={clearChats} isEnabled={chats?.length > 0} />- </div>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/sidebar-mobile.tsx b/pipes/archive/vercel-ai-chatbot/components/sidebar-mobile.tsxdeleted file mode 100644index 82f0aa5b7..000000000--- a/pipes/archive/vercel-ai-chatbot/components/sidebar-mobile.tsx+++ /dev/null@@ -1,31 +0,0 @@-'use client'--import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet'--import { Sidebar } from '@/components/sidebar'-import { Button } from '@/components/ui/button'--import { IconSidebar } from '@/components/ui/icons'--interface SidebarMobileProps {- children: React.ReactNode-}--export function SidebarMobile({ children }: SidebarMobileProps) {- return (- <Sheet>- <SheetTrigger asChild>- <Button variant="ghost" className="-ml-2 flex size-9 p-0 lg:hidden">- <IconSidebar className="size-6" />- <span className="sr-only">Toggle Sidebar</span>- </Button>- </SheetTrigger>- <SheetContent- side="left"- className="inset-y-0 flex h-auto w-[300px] flex-col p-0"- >- <Sidebar className="flex">{children}</Sidebar>- </SheetContent>- </Sheet>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/sidebar-toggle.tsx b/pipes/archive/vercel-ai-chatbot/components/sidebar-toggle.tsxdeleted file mode 100644index 6c7500974..000000000--- a/pipes/archive/vercel-ai-chatbot/components/sidebar-toggle.tsx+++ /dev/null@@ -1,24 +0,0 @@-'use client'--import * as React from 'react'--import { useSidebar } from '@/lib/hooks/use-sidebar'-import { Button } from '@/components/ui/button'-import { IconSidebar } from '@/components/ui/icons'--export function SidebarToggle() {- const { toggleSidebar } = useSidebar()-- return (- <Button- variant="ghost"- className="-ml-2 hidden size-9 p-0 lg:flex"- onClick={() => {- toggleSidebar()- }}- >- <IconSidebar className="size-6" />- <span className="sr-only">Toggle Sidebar</span>- </Button>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/sidebar.tsx b/pipes/archive/vercel-ai-chatbot/components/sidebar.tsxdeleted file mode 100644index 52dc5bd76..000000000--- a/pipes/archive/vercel-ai-chatbot/components/sidebar.tsx+++ /dev/null@@ -1,21 +0,0 @@-'use client'--import * as React from 'react'--import { useSidebar } from '@/lib/hooks/use-sidebar'-import { cn } from '@/lib/utils'--export interface SidebarProps extends React.ComponentProps<'div'> {}--export function Sidebar({ className, children }: SidebarProps) {- const { isSidebarOpen, isLoading } = useSidebar()-- return (- <div- data-state={isSidebarOpen && !isLoading ? 'open' : 'closed'}- className={cn(className, 'h-full flex-col dark:bg-zinc-950')}- >- {children}- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/signup-form.tsx b/pipes/archive/vercel-ai-chatbot/components/signup-form.tsxdeleted file mode 100644index f5b78a966..000000000--- a/pipes/archive/vercel-ai-chatbot/components/signup-form.tsx+++ /dev/null@@ -1,95 +0,0 @@-'use client'--import { useFormState, useFormStatus } from 'react-dom'-import { signup } from '@/app/signup/actions'-import Link from 'next/link'-import { useEffect } from 'react'-import { toast } from 'sonner'-import { IconSpinner } from './ui/icons'-import { getMessageFromCode } from '@/lib/utils'-import { useRouter } from 'next/navigation'--export default function SignupForm() {- const router = useRouter()- const [result, dispatch] = useFormState(signup, undefined)-- useEffect(() => {- if (result) {- if (result.type === 'error') {- toast.error(getMessageFromCode(result.resultCode))- } else {- toast.success(getMessageFromCode(result.resultCode))- router.refresh()- }- }- }, [result, router])-- return (- <form- action={dispatch}- className="flex flex-col items-center gap-4 space-y-3"- >- <div className="w-full flex-1 rounded-lg border bg-white px-6 pb-4 pt-8 shadow-md md:w-96 dark:bg-zinc-950">- <h1 className="mb-3 text-2xl font-bold">Sign up for an account!</h1>- <div className="w-full">- <div>- <label- className="mb-3 mt-5 block text-xs font-medium text-zinc-400"- htmlFor="email"- >- </label>- <div className="relative">- <input- className="peer block w-full rounded-md border bg-zinc-50 px-2 py-[9px] text-sm outline-none placeholder:text-zinc-500 dark:border-zinc-800 dark:bg-zinc-950"- id="email"- type="email"- name="email"- placeholder="Enter your email address"- required- />- </div>- </div>- <div className="mt-4">- <label- className="mb-3 mt-5 block text-xs font-medium text-zinc-400"- htmlFor="password"- >- Password- </label>- <div className="relative">- <input- className="peer block w-full rounded-md border bg-zinc-50 px-2 py-[9px] text-sm outline-none placeholder:text-zinc-500 dark:border-zinc-800 dark:bg-zinc-950"- id="password"- type="password"- name="password"- placeholder="Enter password"- required- minLength={6}- />- </div>- </div>- </div>- <LoginButton />- </div>-- <Link href="/login" className="flex flex-row gap-1 text-sm text-zinc-400">- Already have an account?- <div className="font-semibold underline">Log in</div>- </Link>- </form>- )-}--function LoginButton() {- const { pending } = useFormStatus()-- return (- <button- className="my-4 flex h-10 w-full flex-row items-center justify-center rounded-md bg-zinc-900 p-2 text-sm font-semibold text-zinc-100 hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200"- aria-disabled={pending}- >- {pending ? <IconSpinner /> : 'Create account'}- </button>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/stocks/events-skeleton.tsx b/pipes/archive/vercel-ai-chatbot/components/stocks/events-skeleton.tsxdeleted file mode 100644index 74515cb0c..000000000--- a/pipes/archive/vercel-ai-chatbot/components/stocks/events-skeleton.tsx+++ /dev/null@@ -1,31 +0,0 @@-const placeholderEvents = [- {- date: '2022-10-01',- headline: 'NVIDIA releases new AI-powered graphics card',- description:- 'NVIDIA unveils the latest graphics card infused with AI capabilities, revolutionizing gaming and rendering experiences.'- }-]--export const EventsSkeleton = () => {- return (- <div className="-mt-2 flex w-full flex-col gap-2 py-4">- {placeholderEvents.map(event => (- <div- key={event.date}- className="flex shrink-0 flex-col gap-1 rounded-lg bg-zinc-800 p-4"- >- <div className="w-fit rounded-md bg-zinc-700 text-sm text-transparent">- {event.date}- </div>- <div className="w-fit rounded-md bg-zinc-700 text-transparent">- {event.headline}- </div>- <div className="w-auto rounded-md bg-zinc-700 text-transparent">- {event.description.slice(0, 70)}...- </div>- </div>- ))}- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/stocks/events.tsx b/pipes/archive/vercel-ai-chatbot/components/stocks/events.tsxdeleted file mode 100644index 37652cb58..000000000--- a/pipes/archive/vercel-ai-chatbot/components/stocks/events.tsx+++ /dev/null@@ -1,30 +0,0 @@-import { format, parseISO } from 'date-fns'--interface Event {- date: string- headline: string- description: string-}--export function Events({ props: events }: { props: Event[] }) {- return (- <div className="-mt-2 flex w-full flex-col gap-2 py-4">- {events.map(event => (- <div- key={event.date}- className="flex shrink-0 flex-col gap-1 rounded-lg bg-zinc-800 p-4"- >- <div className="text-sm text-zinc-400">- {format(parseISO(event.date), 'dd LLL, yyyy')}- </div>- <div className="text-base font-bold text-zinc-200">- {event.headline}- </div>- <div className="text-zinc-500">- {event.description.slice(0, 70)}...- </div>- </div>- ))}- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/stocks/index.tsx b/pipes/archive/vercel-ai-chatbot/components/stocks/index.tsxdeleted file mode 100644index 13dedbe25..000000000--- a/pipes/archive/vercel-ai-chatbot/components/stocks/index.tsx+++ /dev/null@@ -1,36 +0,0 @@-'use client'--import dynamic from 'next/dynamic'-import { StockSkeleton } from './stock-skeleton'-import { StocksSkeleton } from './stocks-skeleton'-import { EventsSkeleton } from './events-skeleton'--export { spinner } from './spinner'-export { BotCard, BotMessage, SystemMessage } from './message'--const Stock = dynamic(() => import('./stock').then(mod => mod.Stock), {- ssr: false,- loading: () => <StockSkeleton />-})--const Purchase = dynamic(- () => import('./stock-purchase').then(mod => mod.Purchase),- {- ssr: false,- loading: () => (- <div className="h-[375px] rounded-xl border bg-zinc-950 p-4 text-green-400 sm:h-[314px]" />- )- }-)--const Stocks = dynamic(() => import('./stocks').then(mod => mod.Stocks), {- ssr: false,- loading: () => <StocksSkeleton />-})--const Events = dynamic(() => import('./events').then(mod => mod.Events), {- ssr: false,- loading: () => <EventsSkeleton />-})--export { Stock, Purchase, Stocks, Events }diff --git a/pipes/archive/vercel-ai-chatbot/components/stocks/message.tsx b/pipes/archive/vercel-ai-chatbot/components/stocks/message.tsxdeleted file mode 100644index bcf2c5b55..000000000--- a/pipes/archive/vercel-ai-chatbot/components/stocks/message.tsx+++ /dev/null@@ -1,134 +0,0 @@-'use client'--import { IconOpenAI, IconUser } from '@/components/ui/icons'-import { cn } from '@/lib/utils'-import { spinner } from './spinner'-import { CodeBlock } from '../ui/codeblock'-import { MemoizedReactMarkdown } from '../markdown'-import remarkGfm from 'remark-gfm'-import remarkMath from 'remark-math'-import { StreamableValue, useStreamableValue } from 'ai/rsc'-import { useStreamableText } from '@/lib/hooks/use-streamable-text'--// Different types of message bubbles.--export function UserMessage({ children }: { children: React.ReactNode }) {- return (- <div className="group relative flex items-start md:-ml-12">- <div className="flex size-[25px] shrink-0 select-none items-center justify-center rounded-md border bg-background shadow-sm">- <IconUser />- </div>- <div className="ml-4 flex-1 space-y-2 overflow-hidden pl-2">- {children}- </div>- </div>- )-}--export function BotMessage({- content,- className-}: {- content: string | StreamableValue<string>- className?: string-}) {- const text = useStreamableText(content)-- return (- <div className={cn('group relative flex items-start md:-ml-12', className)}>- <div className="flex shrink-0 select-none items-center justify-center rounded-md border bg-primary text-primary-foreground shadow-sm">- <IconOpenAI />- </div>- <div className="ml-4 flex-1 space-y-2 overflow-hidden px-1">- <MemoizedReactMarkdown- className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0"- remarkPlugins={[remarkGfm, remarkMath]}- components={{- p({ children }) {- return <p className="mb-2 last:mb-0">{children}</p>- },- code({ node, inline, className, children, ...props }) {- if (children.length) {- if (children[0] == '▍') {- return (- <span className="mt-1 animate-pulse cursor-default">▍</span>- )- }-- children[0] = (children[0] as string).replace('`▍`', '▍')- }-- const match = /language-(\w+)/.exec(className || '')-- if (inline) {- return (- <code className={className} {...props}>- {children}- </code>- )- }-- return (- <CodeBlock- key={Math.random()}- language={(match && match[1]) || ''}- value={String(children).replace(/\n$/, '')}- {...props}- />- )- }- }}- >- {text}- </MemoizedReactMarkdown>- </div>- </div>- )-}--export function BotCard({- children,- showAvatar = true-}: {- children: React.ReactNode- showAvatar?: boolean-}) {- return (- <div className="group relative flex items-start md:-ml-12">- <div- className={cn(- 'flex size-[24px] shrink-0 select-none items-center justify-center rounded-md border bg-primary text-primary-foreground shadow-sm',- !showAvatar && 'invisible'- )}- >- <IconOpenAI />- </div>- <div className="ml-4 flex-1 pl-2">{children}</div>- </div>- )-}--export function SystemMessage({ children }: { children: React.ReactNode }) {- return (- <div- className={- 'mt-2 flex items-center justify-center gap-2 text-xs text-gray-500'- }- >- <div className={'max-w-[600px] flex-initial p-2'}>{children}</div>- </div>- )-}--export function SpinnerMessage() {- return (- <div className="group relative flex items-start md:-ml-12">- <div className="flex size-[24px] shrink-0 select-none items-center justify-center rounded-md border bg-primary text-primary-foreground shadow-sm">- <IconOpenAI />- </div>- <div className="ml-4 h-[24px] flex flex-row items-center flex-1 space-y-2 overflow-hidden px-1">- {spinner}- </div>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/stocks/spinner.tsx b/pipes/archive/vercel-ai-chatbot/components/stocks/spinner.tsxdeleted file mode 100644index 8eab1d31b..000000000--- a/pipes/archive/vercel-ai-chatbot/components/stocks/spinner.tsx+++ /dev/null@@ -1,16 +0,0 @@-'use client'--export const spinner = (- <svg- fill="none"- stroke="currentColor"- strokeWidth="1.5"- viewBox="0 0 24 24"- strokeLinecap="round"- strokeLinejoin="round"- xmlns="http://www.w3.org/2000/svg"- className="size-5 animate-spin stroke-zinc-400"- >- <path d="M12 3v3m6.366-.366-2.12 2.12M21 12h-3m.366 6.366-2.12-2.12M12 21v-3m-6.366.366 2.12-2.12M3 12h3m-.366-6.366 2.12 2.12"></path>- </svg>-)diff --git a/pipes/archive/vercel-ai-chatbot/components/stocks/stock-purchase.tsx b/pipes/archive/vercel-ai-chatbot/components/stocks/stock-purchase.tsxdeleted file mode 100644index 0bf922ead..000000000--- a/pipes/archive/vercel-ai-chatbot/components/stocks/stock-purchase.tsx+++ /dev/null@@ -1,146 +0,0 @@-'use client'--import { useId, useState } from 'react'-import { useActions, useAIState, useUIState } from 'ai/rsc'-import { formatNumber } from '@/lib/utils'--import type { AI } from '@/lib/chat/actions'--interface Purchase {- numberOfShares?: number- symbol: string- price: number- status: 'requires_action' | 'completed' | 'expired'-}--export function Purchase({- props: { numberOfShares, symbol, price, status = 'expired' }-}: {- props: Purchase-}) {- const [value, setValue] = useState(numberOfShares || 100)- const [purchasingUI, setPurchasingUI] = useState<null | React.ReactNode>(null)- const [aiState, setAIState] = useAIState<typeof AI>()- const [, setMessages] = useUIState<typeof AI>()- const { confirmPurchase } = useActions()-- // Unique identifier for this UI component.- const id = useId()-- // Whenever the slider changes, we need to update the local value state and the history- // so LLM also knows what's going on.- function onSliderChange(e: React.ChangeEvent<HTMLInputElement>) {- const newValue = Number(e.target.value)- setValue(newValue)-- // Insert a hidden history info to the list.- const message = {- role: 'system' as const,- content: `[User has changed to purchase ${newValue} shares of ${name}. Total cost: $${(- newValue * price- ).toFixed(2)}]`,-- // Identifier of this UI component, so we don't insert it many times.- id- }-- // If last history state is already this info, update it. This is to avoid- // adding every slider change to the history.- if (aiState.messages[aiState.messages.length - 1]?.id === id) {- setAIState({- ...aiState,- messages: [...aiState.messages.slice(0, -1), message]- })-- return- }-- // If it doesn't exist, append it to history.- setAIState({ ...aiState, messages: [...aiState.messages, message] })- }-- return (- <div className="p-4 text-green-400 border rounded-xl bg-zinc-950">- <div className="inline-block float-right px-2 py-1 text-xs rounded-full bg-white/10">- +1.23% ↑- </div>- <div className="text-lg text-zinc-300">{symbol}</div>- <div className="text-3xl font-bold">${price}</div>- {purchasingUI ? (- <div className="mt-4 text-zinc-200">{purchasingUI}</div>- ) : status === 'requires_action' ? (- <>- <div className="relative pb-6 mt-6">- <p>Shares to purchase</p>- <input- id="labels-range-input"- type="range"- value={value}- onChange={onSliderChange}- min="10"- max="1000"- className="w-full h-1 rounded-lg appearance-none cursor-pointer bg-zinc-600 accent-green-500 dark:bg-zinc-700"- />- <span className="absolute text-xs bottom-1 start-0 text-zinc-400">- 10- </span>- <span className="absolute text-xs -translate-x-1/2 bottom-1 start-1/3 text-zinc-400 rtl:translate-x-1/2">- 100- </span>- <span className="absolute text-xs -translate-x-1/2 bottom-1 start-2/3 text-zinc-400 rtl:translate-x-1/2">- 500- </span>- <span className="absolute text-xs bottom-1 end-0 text-zinc-400">- 1000- </span>- </div>-- <div className="mt-6">- <p>Total cost</p>- <div className="flex flex-wrap items-center text-xl font-bold sm:items-end sm:gap-2 sm:text-3xl">- <div className="flex flex-col basis-1/3 tabular-nums sm:basis-auto sm:flex-row sm:items-center sm:gap-2">- {value}- <span className="mb-1 text-sm font-normal text-zinc-600 sm:mb-0 dark:text-zinc-400">- shares- </span>- </div>- <div className="text-center basis-1/3 sm:basis-auto">×</div>- <span className="flex flex-col basis-1/3 tabular-nums sm:basis-auto sm:flex-row sm:items-center sm:gap-2">- ${price}- <span className="mb-1 ml-1 text-sm font-normal text-zinc-600 sm:mb-0 dark:text-zinc-400">- per share- </span>- </span>- <div className="pt-2 mt-2 text-center border-t basis-full border-t-zinc-700 sm:mt-0 sm:basis-auto sm:border-0 sm:pt-0 sm:text-left">- = <span>{formatNumber(value * price)}</span>- </div>- </div>- </div>-- <button- className="w-full px-4 py-2 mt-6 font-bold bg-green-400 rounded-lg text-zinc-900 hover:bg-green-500"- onClick={async () => {- const response = await confirmPurchase(symbol, price, value)- setPurchasingUI(response.purchasingUI)-- // Insert a new system message to the UI.- setMessages((currentMessages: any) => [- ...currentMessages,- response.newMessage- ])- }}- >- Purchase- </button>- </>- ) : status === 'completed' ? (- <p className="mb-2 text-white">- You have successfully purchased {value} ${symbol}. Total cost:{' '}- {formatNumber(value * price)}- </p>- ) : status === 'expired' ? (- <p className="mb-2 text-white">Your checkout session has expired!</p>- ) : null}- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/stocks/stock-skeleton.tsx b/pipes/archive/vercel-ai-chatbot/components/stocks/stock-skeleton.tsxdeleted file mode 100644index e7b7a93ba..000000000--- a/pipes/archive/vercel-ai-chatbot/components/stocks/stock-skeleton.tsx+++ /dev/null@@ -1,22 +0,0 @@-export const StockSkeleton = () => {- return (- <div className="rounded-xl border border-zinc-800 bg-zinc-950 p-4 text-green-400">- <div className="float-right inline-block w-fit rounded-full bg-zinc-700 px-2 py-1 text-xs text-transparent">- xxxxxxx- </div>- <div className="mb-1 w-fit rounded-md bg-zinc-700 text-lg text-transparent">- xxxx- </div>- <div className="w-fit rounded-md bg-zinc-700 text-3xl font-bold text-transparent">- xxxx- </div>- <div className="text mt-1 w-fit rounded-md bg-zinc-700 text-xs text-transparent">- xxxxxx xxx xx xxxx xx xxx- </div>-- <div className="relative -mx-4 cursor-col-resize">- <div style={{ height: 146 }}></div>- </div>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/stocks/stock.tsx b/pipes/archive/vercel-ai-chatbot/components/stocks/stock.tsxdeleted file mode 100644index aef249bc6..000000000--- a/pipes/archive/vercel-ai-chatbot/components/stocks/stock.tsx+++ /dev/null@@ -1,210 +0,0 @@-'use client'--import { useState, useRef, useEffect, useId } from 'react'-import { scaleLinear } from 'd3-scale'-import { subMonths, format } from 'date-fns'-import { useResizeObserver } from 'usehooks-ts'-import { useAIState } from 'ai/rsc'--interface Stock {- symbol: string- price: number- delta: number-}--export function Stock({ props: { symbol, price, delta } }: { props: Stock }) {- const [aiState, setAIState] = useAIState()- const id = useId()-- const [priceAtTime, setPriceAtTime] = useState({- time: '00:00',- value: price.toFixed(2),- x: 0- })-- const [startHighlight, setStartHighlight] = useState(0)- const [endHighlight, setEndHighlight] = useState(0)-- const chartRef = useRef<HTMLDivElement>(null)- const { width = 0 } = useResizeObserver({- ref: chartRef,- box: 'border-box'- })-- const xToDate = scaleLinear(- [0, width],- [subMonths(new Date(), 6), new Date()]- )- const xToValue = scaleLinear(- [0, width],- [price - price / 2, price + price / 2]- )-- useEffect(() => {- if (startHighlight && endHighlight) {- const message = {- id,- role: 'system' as const,- content: `[User has highlighted dates between between ${format(- xToDate(startHighlight),- 'd LLL'- )} and ${format(xToDate(endHighlight), 'd LLL, yyyy')}`- }-- if (aiState.messages[aiState.messages.length - 1]?.id === id) {- setAIState({- ...aiState,- messages: [...aiState.messages.slice(0, -1), message]- })- } else {- setAIState({- ...aiState,- messages: [...aiState.messages, message]- })- }- }- }, [startHighlight, endHighlight])-- return (- <div className="rounded-xl border bg-zinc-950 p-4 text-green-400">- <div className="float-right inline-block rounded-full bg-white/10 px-2 py-1 text-xs">- {`${delta > 0 ? '+' : ''}${((delta / price) * 100).toFixed(2)}% ${- delta > 0 ? '↑' : '↓'- }`}- </div>- <div className="text-lg text-zinc-300">{symbol}</div>- <div className="text-3xl font-bold">${price}</div>- <div className="text mt-1 text-xs text-zinc-500">- Closed: Feb 27, 4:59 PM EST- </div>-- <div- className="relative -mx-4 cursor-col-resize"- onPointerDown={event => {- if (chartRef.current) {- const { clientX } = event- const { left } = chartRef.current.getBoundingClientRect()-- setStartHighlight(clientX - left)- setEndHighlight(0)-- setPriceAtTime({- time: format(xToDate(clientX), 'dd LLL yy'),- value: xToValue(clientX).toFixed(2),- x: clientX - left- })- }- }}- onPointerUp={event => {- if (chartRef.current) {- const { clientX } = event- const { left } = chartRef.current.getBoundingClientRect()-- setEndHighlight(clientX - left)- }- }}- onPointerMove={event => {- if (chartRef.current) {- const { clientX } = event- const { left } = chartRef.current.getBoundingClientRect()-- setPriceAtTime({- time: format(xToDate(clientX), 'dd LLL yy'),- value: xToValue(clientX).toFixed(2),- x: clientX - left- })- }- }}- onPointerLeave={() => {- setPriceAtTime({- time: '00:00',- value: price.toFixed(2),- x: 0- })- }}- ref={chartRef}- >- {priceAtTime.x > 0 ? (- <div- className="pointer-events-none absolute z-10 flex w-fit select-none gap-2 rounded-md bg-zinc-800 p-2"- style={{- left: priceAtTime.x - 124 / 2,- top: 30- }}- >- <div className="text-xs tabular-nums">${priceAtTime.value}</div>- <div className="text-xs tabular-nums text-zinc-400">- {priceAtTime.time}- </div>- </div>- ) : null}-- {startHighlight ? (- <div- className="pointer-events-none absolute h-32 w-5 select-none rounded-md border border-zinc-500 bg-zinc-500/20"- style={{- left: startHighlight,- width: endHighlight- ? endHighlight - startHighlight- : priceAtTime.x - startHighlight,- bottom: 0- }}- ></div>- ) : null}-- <svg- viewBox="0 0 250.0 168.0"- height="150"- width="100%"- preserveAspectRatio="none"- >- <defs>- <linearGradient- id="fill-id-tsuid_31"- x1="0%"- x2="0%"- y1="0%"- y2="100%"- >- <stop offset="0%" stopColor="#34a853" stopOpacity="0.38"></stop>- <stop offset="13%" stopColor="#e6f4ea" stopOpacity="0"></stop>- </linearGradient>- <clipPath id="range-id-tsuid_31">- <rect height="100%" width="0" x="0" y="0"></rect>- </clipPath>- <defs>- <linearGradient- id="chart-grad-_f1bJZYLUHqWpxc8Prs2meA_33"- x1="0%"- x2="0%"- y1="0%"- y2="100%"- >- <stop offset="0%" stopColor="#34a853" stopOpacity="0.38"></stop>- <stop offset="13%" stopColor="#e6f4ea" stopOpacity="0"></stop>- </linearGradient>- </defs>- <clipPath id="mask-_f1bJZYLUHqWpxc8Prs2meA_32">- <rect height="218" width="250" x="0" y="-5"></rect>- </clipPath>- </defs>- <path- d="M 0 42.86 L 0.89 46.26 L 1.78 44.3 L 2.68 44.24 L 3.57 42 L 4.46 43.42 L 5.35 43.62 L 6.25 47 L 7.14 47.65 L 8.03 47.69 L 8.92 45.55 L 9.82 43.19 L 10.71 43.9 L 11.6 42.83 L 12.49 42.81 L 13.39 46.75 L 14.28 43.06 L 15.17 40.8 L 16.06 39.72 L 16.96 39.77 L 17.85 45.77 L 18.74 44.93 L 19.63 44.35 L 20.53 40.29 L 21.42 42.77 L 22.31 42.12 L 23.2 43.4 L 24.1 47.95 L 24.99 50.15 L 25.88 48.59 L 26.77 42.18 L 27.67 44.1 L 28.56 39.91 L 29.45 44.92 L 30.34 47.62 L 31.24 48.06 L 32.13 47.67 L 33.02 56.47 L 33.91 57.74 L 34.8 65.48 L 35.7 64.47 L 36.59 47.25 L 37.48 58.26 L 38.37 52.04 L 39.27 55.8 L 40.16 92.92 L 41.05 105.2 L 41.94 102 L 42.84 106.14 L 43.73 78.71 L 44.62 104.6 L 45.51 96.58 L 46.41 67.56 L 47.3 69.53 L 48.19 69.99 L 49.08 66.75 L 49.98 69.72 L 50.87 70.13 L 51.76 71.3 L 52.65 70.03 L 53.55 67.92 L 54.44 66.41 L 55.33 97.12 L 56.22 95.93 L 57.12 95.03 L 58.01 95.09 L 58.9 65.56 L 59.79 65.12 L 60.69 82.42 L 61.58 74.7 L 62.47 71.13 L 63.36 82.43 L 64.26 96.02 L 65.15 100.36 L 66.04 98.6 L 66.93 103.37 L 67.82 102.12 L 68.72 97.08 L 69.61 89.74 L 70.5 90.7 L 71.39 93.46 L 72.29 94.24 L 73.18 97.8 L 74.07 97.88 L 74.96 96.63 L 75.86 96.27 L 76.75 97.15 L 77.64 100.12 L 78.53 100.51 L 79.43 106.59 L 80.32 104.54 L 81.21 100.31 L 82.1 118.76 L 83 106.24 L 83.89 114.8 L 84.78 174.89 L 85.67 122.28 L 86.57 149.25 L 87.46 151.47 L 88.35 153.38 L 89.24 153.5 L 90.14 149.24 L 91.03 122.44 L 91.92 122.08 L 92.81 147.16 L 93.71 147.46 L 94.6 119.13 L 95.49 117.97 L 96.38 122.22 L 97.28 116.38 L 98.17 119.53 L 99.06 119.65 L 99.95 120.15 L 100.84 120.22 L 101.74 121.28 L 102.63 121.4 L 103.52 122.97 L 104.41 122.15 L 105.31 120.6 L 106.2 116.55 L 107.09 122.23 L 107.98 120.96 L 108.88 119.54 L 109.77 120.19 L 110.66 120.99 L 111.55 119.92 L 112.45 115.69 L 113.34 116.33 L 114.23 116.07 L 115.12 115.34 L 116.02 111.34 L 116.91 107.23 L 117.8 113.21 L 118.69 98.77 L 119.59 97.04 L 120.48 96.56 L 121.37 96.36 L 122.26 99.7 L 123.16 103.33 L 124.05 100.38 L 124.94 99.68 L 125.83 99.02 L 126.73 102.56 L 127.62 103.25 L 128.51 103.38 L 129.4 104.89 L 130.3 118.07 L 131.19 100.82 L 132.08 103.06 L 132.97 103.47 L 133.86 99.8 L 134.76 111.28 L 135.65 107.73 L 136.54 107.46 L 137.43 108.08 L 138.33 109.82 L 139.22 110.94 L 140.11 111.3 L 141 108.14 L 141.9 109.35 L 142.79 108.38 L 143.68 99.08 L 144.57 99.02 L 145.47 98.61 L 146.36 99.07 L 147.25 99.26 L 148.14 95.1 L 149.04 92.08 L 149.93 92.76 L 150.82 92.87 L 151.71 83.31 L 152.61 82.93 L 153.5 84.86 L 154.39 84.12 L 155.28 94.08 L 156.18 93.31 L 157.07 94.23 L 157.96 94.58 L 158.85 99.33 L 159.75 80 L 160.64 90.28 L 161.53 84.07 L 162.42 68.37 L 163.32 76.88 L 164.21 81.78 L 165.1 80.72 L 165.99 73.89 L 166.88 77.14 L 167.78 67.58 L 168.67 59.82 L 169.56 61.91 L 170.45 61.07 L 171.35 73.74 L 172.24 77.02 L 173.13 78.61 L 174.02 71.59 L 174.92 68.24 L 175.81 72.14 L 176.7 65.37 L 177.59 76.73 L 178.49 88.02 L 179.38 88.01 L 180.27 88.27 L 181.16 86.23 L 182.06 86.14 L 182.95 89.54 L 183.84 94.16 L 184.73 97.72 L 185.63 81.52 L 186.52 92.85 L 187.41 94.14 L 188.3 93.06 L 189.2 92.64 L 190.09 92.44 L 190.98 91.75 L 191.87 90.53 L 192.77 88.27 L 193.66 85.44 L 194.55 82.26 L 195.44 85.08 L 196.34 85.65 L 197.23 53.43 L 198.12 72.01 L 199.01 38.37 L 199.9 69.43 L 200.8 74.46 L 201.69 74.22 L 202.58 82.46 L 203.47 77.01 L 204.37 87.8 L 205.26 91.56 L 206.15 76.69 L 207.04 76.46 L 207.94 78.13 L 208.83 80.06 L 209.72 92.79 L 210.61 87.74 L 211.51 88.21 L 212.4 88.47 L 213.29 87.35 L 214.18 89.69 L 215.08 77.37 L 215.97 87.95 L 216.86 75.16 L 217.75 70.47 L 218.65 85.11 L 219.54 88.1 L 220.43 88.06 L 221.32 86.34 L 222.22 76.91 L 223.11 75.33 L 224 73.6 L 224.89 25.31 L 225.79 44.14 L 226.68 43.93 L 227.57 45.13 L 228.46 44.03 L 229.36 35.73 L 230.25 33.65 L 231.14 34.81 L 232.03 17.64 L 232.92 21.13 L 233.82 19.37 L 234.71 24.66 L 235.6 23.87 L 236.49 22.56 L 237.39 28.48 L 238.28 25.33 L 239.17 28.51 L 240.06 30.83 L 240.96 35.79 L 241.85 34.6 L 242.74 31.2 L 243.63 32.97 L 244.53 33.01 L 245.42 31.38 L 246.31 30.21 L 247.2 27.75 L 248.1 25.27 L 248.99 23 L 249.88 23 L 250 23 L 2000 0 L 2000 1000 L -1000 1000"- clipPath="url(#range-id-tsuid_31)"- vectorEffect="non-scaling-stroke"- stroke="none"- strokeWidth={2}- fill='url("#fill-id-tsuid_31")'- ></path>- <path- clipPath="url(#mask-_f1bJZYLUHqWpxc8Prs2meA_32)"- d="M 0 42.86 L 0.89 46.26 L 1.78 44.3 L 2.68 44.24 L 3.57 42 L 4.46 43.42 L 5.35 43.62 L 6.25 47 L 7.14 47.65 L 8.03 47.69 L 8.92 45.55 L 9.82 43.19 L 10.71 43.9 L 11.6 42.83 L 12.49 42.81 L 13.39 46.75 L 14.28 43.06 L 15.17 40.8 L 16.06 39.72 L 16.96 39.77 L 17.85 45.77 L 18.74 44.93 L 19.63 44.35 L 20.53 40.29 L 21.42 42.77 L 22.31 42.12 L 23.2 43.4 L 24.1 47.95 L 24.99 50.15 L 25.88 48.59 L 26.77 42.18 L 27.67 44.1 L 28.56 39.91 L 29.45 44.92 L 30.34 47.62 L 31.24 48.06 L 32.13 47.67 L 33.02 56.47 L 33.91 57.74 L 34.8 65.48 L 35.7 64.47 L 36.59 47.25 L 37.48 58.26 L 38.37 52.04 L 39.27 55.8 L 40.16 92.92 L 41.05 105.2 L 41.94 102 L 42.84 106.14 L 43.73 78.71 L 44.62 104.6 L 45.51 96.58 L 46.41 67.56 L 47.3 69.53 L 48.19 69.99 L 49.08 66.75 L 49.98 69.72 L 50.87 70.13 L 51.76 71.3 L 52.65 70.03 L 53.55 67.92 L 54.44 66.41 L 55.33 97.12 L 56.22 95.93 L 57.12 95.03 L 58.01 95.09 L 58.9 65.56 L 59.79 65.12 L 60.69 82.42 L 61.58 74.7 L 62.47 71.13 L 63.36 82.43 L 64.26 96.02 L 65.15 100.36 L 66.04 98.6 L 66.93 103.37 L 67.82 102.12 L 68.72 97.08 L 69.61 89.74 L 70.5 90.7 L 71.39 93.46 L 72.29 94.24 L 73.18 97.8 L 74.07 97.88 L 74.96 96.63 L 75.86 96.27 L 76.75 97.15 L 77.64 100.12 L 78.53 100.51 L 79.43 106.59 L 80.32 104.54 L 81.21 100.31 L 82.1 118.76 L 83 106.24 L 83.89 114.8 L 84.78 174.89 L 85.67 122.28 L 86.57 149.25 L 87.46 151.47 L 88.35 153.38 L 89.24 153.5 L 90.14 149.24 L 91.03 122.44 L 91.92 122.08 L 92.81 147.16 L 93.71 147.46 L 94.6 119.13 L 95.49 117.97 L 96.38 122.22 L 97.28 116.38 L 98.17 119.53 L 99.06 119.65 L 99.95 120.15 L 100.84 120.22 L 101.74 121.28 L 102.63 121.4 L 103.52 122.97 L 104.41 122.15 L 105.31 120.6 L 106.2 116.55 L 107.09 122.23 L 107.98 120.96 L 108.88 119.54 L 109.77 120.19 L 110.66 120.99 L 111.55 119.92 L 112.45 115.69 L 113.34 116.33 L 114.23 116.07 L 115.12 115.34 L 116.02 111.34 L 116.91 107.23 L 117.8 113.21 L 118.69 98.77 L 119.59 97.04 L 120.48 96.56 L 121.37 96.36 L 122.26 99.7 L 123.16 103.33 L 124.05 100.38 L 124.94 99.68 L 125.83 99.02 L 126.73 102.56 L 127.62 103.25 L 128.51 103.38 L 129.4 104.89 L 130.3 118.07 L 131.19 100.82 L 132.08 103.06 L 132.97 103.47 L 133.86 99.8 L 134.76 111.28 L 135.65 107.73 L 136.54 107.46 L 137.43 108.08 L 138.33 109.82 L 139.22 110.94 L 140.11 111.3 L 141 108.14 L 141.9 109.35 L 142.79 108.38 L 143.68 99.08 L 144.57 99.02 L 145.47 98.61 L 146.36 99.07 L 147.25 99.26 L 148.14 95.1 L 149.04 92.08 L 149.93 92.76 L 150.82 92.87 L 151.71 83.31 L 152.61 82.93 L 153.5 84.86 L 154.39 84.12 L 155.28 94.08 L 156.18 93.31 L 157.07 94.23 L 157.96 94.58 L 158.85 99.33 L 159.75 80 L 160.64 90.28 L 161.53 84.07 L 162.42 68.37 L 163.32 76.88 L 164.21 81.78 L 165.1 80.72 L 165.99 73.89 L 166.88 77.14 L 167.78 67.58 L 168.67 59.82 L 169.56 61.91 L 170.45 61.07 L 171.35 73.74 L 172.24 77.02 L 173.13 78.61 L 174.02 71.59 L 174.92 68.24 L 175.81 72.14 L 176.7 65.37 L 177.59 76.73 L 178.49 88.02 L 179.38 88.01 L 180.27 88.27 L 181.16 86.23 L 182.06 86.14 L 182.95 89.54 L 183.84 94.16 L 184.73 97.72 L 185.63 81.52 L 186.52 92.85 L 187.41 94.14 L 188.3 93.06 L 189.2 92.64 L 190.09 92.44 L 190.98 91.75 L 191.87 90.53 L 192.77 88.27 L 193.66 85.44 L 194.55 82.26 L 195.44 85.08 L 196.34 85.65 L 197.23 53.43 L 198.12 72.01 L 199.01 38.37 L 199.9 69.43 L 200.8 74.46 L 201.69 74.22 L 202.58 82.46 L 203.47 77.01 L 204.37 87.8 L 205.26 91.56 L 206.15 76.69 L 207.04 76.46 L 207.94 78.13 L 208.83 80.06 L 209.72 92.79 L 210.61 87.74 L 211.51 88.21 L 212.4 88.47 L 213.29 87.35 L 214.18 89.69 L 215.08 77.37 L 215.97 87.95 L 216.86 75.16 L 217.75 70.47 L 218.65 85.11 L 219.54 88.1 L 220.43 88.06 L 221.32 86.34 L 222.22 76.91 L 223.11 75.33 L 224 73.6 L 224.89 25.31 L 225.79 44.14 L 226.68 43.93 L 227.57 45.13 L 228.46 44.03 L 229.36 35.73 L 230.25 33.65 L 231.14 34.81 L 232.03 17.64 L 232.92 21.13 L 233.82 19.37 L 234.71 24.66 L 235.6 23.87 L 236.49 22.56 L 237.39 28.48 L 238.28 25.33 L 239.17 28.51 L 240.06 30.83 L 240.96 35.79 L 241.85 34.6 L 242.74 31.2 L 243.63 32.97 L 244.53 33.01 L 245.42 31.38 L 246.31 30.21 L 247.2 27.75 L 248.1 25.27 L 248.99 23 L 249.88 23 L 250 23 L 2000 0 L 2000 1000 L -1000 1000"- vectorEffect="non-scaling-stroke"- stroke="#34a853"- style={{ fill: 'url(#chart-grad-_f1bJZYLUHqWpxc8Prs2meA_33)' }}- ></path>- </svg>- </div>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/stocks/stocks-skeleton.tsx b/pipes/archive/vercel-ai-chatbot/components/stocks/stocks-skeleton.tsxdeleted file mode 100644index d19ed6967..000000000--- a/pipes/archive/vercel-ai-chatbot/components/stocks/stocks-skeleton.tsx+++ /dev/null@@ -1,9 +0,0 @@-export const StocksSkeleton = () => {- return (- <div className="mb-4 flex flex-col gap-2 overflow-y-scroll pb-4 text-sm sm:flex-row">- <div className="flex h-[60px] w-full cursor-pointer flex-row gap-2 rounded-lg bg-zinc-800 p-2 text-left hover:bg-zinc-800 sm:w-[208px]"></div>- <div className="flex h-[60px] w-full cursor-pointer flex-row gap-2 rounded-lg bg-zinc-800 p-2 text-left hover:bg-zinc-800 sm:w-[208px]"></div>- <div className="flex h-[60px] w-full cursor-pointer flex-row gap-2 rounded-lg bg-zinc-800 p-2 text-left hover:bg-zinc-800 sm:w-[208px]"></div>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/stocks/stocks.tsx b/pipes/archive/vercel-ai-chatbot/components/stocks/stocks.tsxdeleted file mode 100644index a5f78262b..000000000--- a/pipes/archive/vercel-ai-chatbot/components/stocks/stocks.tsx+++ /dev/null@@ -1,67 +0,0 @@-'use client'--import { useActions, useUIState } from 'ai/rsc'--import type { AI } from '@/lib/chat/actions'--interface Stock {- symbol: string- price: number- delta: number-}--export function Stocks({ props: stocks }: { props: Stock[] }) {- const [, setMessages] = useUIState<typeof AI>()- const { submitUserMessage } = useActions()-- return (- <div>- <div className="mb-4 flex flex-col gap-2 overflow-y-scroll pb-4 text-sm sm:flex-row">- {stocks.map(stock => (- <button- key={stock.symbol}- className="flex cursor-pointer flex-row gap-2 rounded-lg bg-zinc-800 p-2 text-left hover:bg-zinc-700 sm:w-52"- onClick={async () => {- const response = await submitUserMessage(`View ${stock.symbol}`)- setMessages(currentMessages => [...currentMessages, response])- }}- >- <div- className={`text-xl ${- stock.delta > 0 ? 'text-green-600' : 'text-red-600'- } flex w-11 flex-row justify-center rounded-md bg-white/10 p-2`}- >- {stock.delta > 0 ? '↑' : '↓'}- </div>- <div className="flex flex-col">- <div className="bold uppercase text-zinc-300">{stock.symbol}</div>- <div className="text-base text-zinc-500">- ${stock.price.toExponential(1)}- </div>- </div>- <div className="ml-auto flex flex-col">- <div- className={`${- stock.delta > 0 ? 'text-green-600' : 'text-red-600'- } bold text-right uppercase`}- >- {` ${((stock.delta / stock.price) * 100).toExponential(1)}%`}- </div>- <div- className={`${- stock.delta > 0 ? 'text-green-700' : 'text-red-700'- } text-right text-base`}- >- {stock.delta.toExponential(1)}- </div>- </div>- </button>- ))}- </div>- <div className="p-4 text-center text-sm text-zinc-500">- Note: Data and latency are simulated for illustrative purposes and- should not be considered as financial advice.- </div>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/tailwind-indicator.tsx b/pipes/archive/vercel-ai-chatbot/components/tailwind-indicator.tsxdeleted file mode 100644index 846faa96a..000000000--- a/pipes/archive/vercel-ai-chatbot/components/tailwind-indicator.tsx+++ /dev/null@@ -1,14 +0,0 @@-export function TailwindIndicator() {- if (process.env.NODE_ENV === 'production') return null-- return (- <div className="fixed bottom-1 left-1 z-50 flex size-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-white">- <div className="block sm:hidden">xs</div>- <div className="hidden sm:block md:hidden">sm</div>- <div className="hidden md:block lg:hidden">md</div>- <div className="hidden lg:block xl:hidden">lg</div>- <div className="hidden xl:block 2xl:hidden">xl</div>- <div className="hidden 2xl:block">2xl</div>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/theme-toggle.tsx b/pipes/archive/vercel-ai-chatbot/components/theme-toggle.tsxdeleted file mode 100644index 67d3f1a2c..000000000--- a/pipes/archive/vercel-ai-chatbot/components/theme-toggle.tsx+++ /dev/null@@ -1,31 +0,0 @@-'use client'--import * as React from 'react'-import { useTheme } from 'next-themes'--import { Button } from '@/components/ui/button'-import { IconMoon, IconSun } from '@/components/ui/icons'--export function ThemeToggle() {- const { setTheme, theme } = useTheme()- const [_, startTransition] = React.useTransition()-- return (- <Button- variant="ghost"- size="icon"- onClick={() => {- startTransition(() => {- setTheme(theme === 'light' ? 'dark' : 'light')- })- }}- >- {!theme ? null : theme === 'dark' ? (- <IconMoon className="transition-all" />- ) : (- <IconSun className="transition-all" />- )}- <span className="sr-only">Toggle theme</span>- </Button>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/alert-dialog.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/alert-dialog.tsxdeleted file mode 100644index 57760f2ee..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/alert-dialog.tsx+++ /dev/null@@ -1,141 +0,0 @@-"use client"--import * as React from "react"-import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"--import { cn } from "@/lib/utils"-import { buttonVariants } from "@/components/ui/button"--const AlertDialog = AlertDialogPrimitive.Root--const AlertDialogTrigger = AlertDialogPrimitive.Trigger--const AlertDialogPortal = AlertDialogPrimitive.Portal--const AlertDialogOverlay = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Overlay>,- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>->(({ className, ...props }, ref) => (- <AlertDialogPrimitive.Overlay- className={cn(- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",- className- )}- {...props}- ref={ref}- />-))-AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName--const AlertDialogContent = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Content>,- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>->(({ className, ...props }, ref) => (- <AlertDialogPortal>- <AlertDialogOverlay />- <AlertDialogPrimitive.Content- ref={ref}- className={cn(- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",- className- )}- {...props}- />- </AlertDialogPortal>-))-AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName--const AlertDialogHeader = ({- className,- ...props-}: React.HTMLAttributes<HTMLDivElement>) => (- <div- className={cn(- "flex flex-col space-y-2 text-center sm:text-left",- className- )}- {...props}- />-)-AlertDialogHeader.displayName = "AlertDialogHeader"--const AlertDialogFooter = ({- className,- ...props-}: React.HTMLAttributes<HTMLDivElement>) => (- <div- className={cn(- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",- className- )}- {...props}- />-)-AlertDialogFooter.displayName = "AlertDialogFooter"--const AlertDialogTitle = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Title>,- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>->(({ className, ...props }, ref) => (- <AlertDialogPrimitive.Title- ref={ref}- className={cn("text-lg font-semibold", className)}- {...props}- />-))-AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName--const AlertDialogDescription = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Description>,- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>->(({ className, ...props }, ref) => (- <AlertDialogPrimitive.Description- ref={ref}- className={cn("text-sm text-muted-foreground", className)}- {...props}- />-))-AlertDialogDescription.displayName =- AlertDialogPrimitive.Description.displayName--const AlertDialogAction = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Action>,- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>->(({ className, ...props }, ref) => (- <AlertDialogPrimitive.Action- ref={ref}- className={cn(buttonVariants(), className)}- {...props}- />-))-AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName--const AlertDialogCancel = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Cancel>,- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>->(({ className, ...props }, ref) => (- <AlertDialogPrimitive.Cancel- ref={ref}- className={cn(- buttonVariants({ variant: "outline" }),- "mt-2 sm:mt-0",- className- )}- {...props}- />-))-AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName--export {- AlertDialog,- AlertDialogPortal,- AlertDialogOverlay,- AlertDialogTrigger,- AlertDialogContent,- AlertDialogHeader,- AlertDialogFooter,- AlertDialogTitle,- AlertDialogDescription,- AlertDialogAction,- AlertDialogCancel,-}diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/badge.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/badge.tsxdeleted file mode 100644index e87d62bf1..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/badge.tsx+++ /dev/null@@ -1,36 +0,0 @@-import * as React from "react"-import { cva, type VariantProps } from "class-variance-authority"--import { cn } from "@/lib/utils"--const badgeVariants = cva(- "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",- {- variants: {- variant: {- default:- "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",- secondary:- "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",- destructive:- "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",- outline: "text-foreground",- },- },- defaultVariants: {- variant: "default",- },- }-)--export interface BadgeProps- extends React.HTMLAttributes<HTMLDivElement>,- VariantProps<typeof badgeVariants> {}--function Badge({ className, variant, ...props }: BadgeProps) {- return (- <div className={cn(badgeVariants({ variant }), className)} {...props} />- )-}--export { Badge, badgeVariants }diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/button.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/button.tsxdeleted file mode 100644index 547ae6e4a..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/button.tsx+++ /dev/null@@ -1,57 +0,0 @@-import * as React from 'react'-import { Slot } from '@radix-ui/react-slot'-import { cva, type VariantProps } from 'class-variance-authority'--import { cn } from '@/lib/utils'--const buttonVariants = cva(- 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',- {- variants: {- variant: {- default:- 'bg-primary text-primary-foreground shadow hover:bg-primary/90',- destructive:- 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',- outline:- 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',- secondary:- 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',- ghost: 'hover:bg-accent hover:text-accent-foreground',- link: 'text-primary underline-offset-4 hover:underline'- },- size: {- default: 'h-9 px-4 py-2',- sm: 'h-8 rounded-md px-3 text-xs',- lg: 'h-10 rounded-md px-8',- icon: 'size-9'- }- },- defaultVariants: {- variant: 'default',- size: 'default'- }- }-)--export interface ButtonProps- extends React.ButtonHTMLAttributes<HTMLButtonElement>,- VariantProps<typeof buttonVariants> {- asChild?: boolean-}--const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(- ({ className, variant, size, asChild = false, ...props }, ref) => {- const Comp = asChild ? Slot : 'button'- return (- <Comp- className={cn(buttonVariants({ variant, size, className }))}- ref={ref}- {...props}- />- )- }-)-Button.displayName = 'Button'--export { Button, buttonVariants }diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/codeblock.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/codeblock.tsxdeleted file mode 100644index 21fd76ea8..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/codeblock.tsx+++ /dev/null@@ -1,148 +0,0 @@-// Inspired by Chatbot-UI and modified to fit the needs of this project-// @see https://github.com/mckaywrigley/chatbot-ui/blob/main/components/Markdown/CodeBlock.tsx--'use client'--import { FC, memo } from 'react'-import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'-import { coldarkDark } from 'react-syntax-highlighter/dist/cjs/styles/prism'--import { useCopyToClipboard } from '@/lib/hooks/use-copy-to-clipboard'-import { IconCheck, IconCopy, IconDownload } from '@/components/ui/icons'-import { Button } from '@/components/ui/button'--interface Props {- language: string- value: string-}--interface languageMap {- [key: string]: string | undefined-}--export const programmingLanguages: languageMap = {- javascript: '.js',- python: '.py',- java: '.java',- c: '.c',- cpp: '.cpp',- 'c++': '.cpp',- 'c#': '.cs',- ruby: '.rb',- php: '.php',- swift: '.swift',- 'objective-c': '.m',- kotlin: '.kt',- typescript: '.ts',- go: '.go',- perl: '.pl',- rust: '.rs',- scala: '.scala',- haskell: '.hs',- lua: '.lua',- shell: '.sh',- sql: '.sql',- html: '.html',- css: '.css'- // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component-}--export const generateRandomString = (length: number, lowercase = false) => {- const chars = 'ABCDEFGHJKLMNPQRSTUVWXY3456789' // excluding similar looking characters like Z, 2, I, 1, O, 0- let result = ''- for (let i = 0; i < length; i++) {- result += chars.charAt(Math.floor(Math.random() * chars.length))- }- return lowercase ? result.toLowerCase() : result-}--const CodeBlock: FC<Props> = memo(({ language, value }) => {- const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 })-- const downloadAsFile = () => {- if (typeof window === 'undefined') {- return- }- const fileExtension = programmingLanguages[language] || '.file'- const suggestedFileName = `file-${generateRandomString(- 3,- true- )}${fileExtension}`- const fileName = window.prompt('Enter file name', suggestedFileName)-- if (!fileName) {- // User pressed cancel on prompt.- return- }-- const blob = new Blob([value], { type: 'text/plain' })- const url = URL.createObjectURL(blob)- const link = document.createElement('a')- link.download = fileName- link.href = url- link.style.display = 'none'- document.body.appendChild(link)- link.click()- document.body.removeChild(link)- URL.revokeObjectURL(url)- }-- const onCopy = () => {- if (isCopied) return- copyToClipboard(value)- }-- return (- <div className="relative w-full font-sans codeblock bg-zinc-950">- <div className="flex items-center justify-between w-full px-6 py-2 pr-4 bg-zinc-800 text-zinc-100">- <span className="text-xs lowercase">{language}</span>- <div className="flex items-center space-x-1">- <Button- variant="ghost"- className="hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0"- onClick={downloadAsFile}- size="icon"- >- <IconDownload />- <span className="sr-only">Download</span>- </Button>- <Button- variant="ghost"- size="icon"- className="text-xs hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0"- onClick={onCopy}- >- {isCopied ? <IconCheck /> : <IconCopy />}- <span className="sr-only">Copy code</span>- </Button>- </div>- </div>- <SyntaxHighlighter- language={language}- style={coldarkDark}- PreTag="div"- showLineNumbers- customStyle={{- margin: 0,- width: '100%',- background: 'transparent',- padding: '1.5rem 1rem'- }}- lineNumberStyle={{- userSelect: 'none'- }}- codeTagProps={{- style: {- fontSize: '0.9rem',- fontFamily: 'var(--font-mono)'- }- }}- >- {value}- </SyntaxHighlighter>- </div>- )-})-CodeBlock.displayName = 'CodeBlock'--export { CodeBlock }diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/dialog.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/dialog.tsxdeleted file mode 100644index 5ad11c87d..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/dialog.tsx+++ /dev/null@@ -1,122 +0,0 @@-"use client"--import * as React from "react"-import * as DialogPrimitive from "@radix-ui/react-dialog"-import { Cross2Icon } from "@radix-ui/react-icons"--import { cn } from "@/lib/utils"--const Dialog = DialogPrimitive.Root--const DialogTrigger = DialogPrimitive.Trigger--const DialogPortal = DialogPrimitive.Portal--const DialogClose = DialogPrimitive.Close--const DialogOverlay = React.forwardRef<- React.ElementRef<typeof DialogPrimitive.Overlay>,- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>->(({ className, ...props }, ref) => (- <DialogPrimitive.Overlay- ref={ref}- className={cn(- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",- className- )}- {...props}- />-))-DialogOverlay.displayName = DialogPrimitive.Overlay.displayName--const DialogContent = React.forwardRef<- React.ElementRef<typeof DialogPrimitive.Content>,- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>->(({ className, children, ...props }, ref) => (- <DialogPortal>- <DialogOverlay />- <DialogPrimitive.Content- ref={ref}- className={cn(- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",- className- )}- {...props}- >- {children}- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">- <Cross2Icon className="size-4" />- <span className="sr-only">Close</span>- </DialogPrimitive.Close>- </DialogPrimitive.Content>- </DialogPortal>-))-DialogContent.displayName = DialogPrimitive.Content.displayName--const DialogHeader = ({- className,- ...props-}: React.HTMLAttributes<HTMLDivElement>) => (- <div- className={cn(- "flex flex-col space-y-1.5 text-center sm:text-left",- className- )}- {...props}- />-)-DialogHeader.displayName = "DialogHeader"--const DialogFooter = ({- className,- ...props-}: React.HTMLAttributes<HTMLDivElement>) => (- <div- className={cn(- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",- className- )}- {...props}- />-)-DialogFooter.displayName = "DialogFooter"--const DialogTitle = React.forwardRef<- React.ElementRef<typeof DialogPrimitive.Title>,- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>->(({ className, ...props }, ref) => (- <DialogPrimitive.Title- ref={ref}- className={cn(- "text-lg font-semibold leading-none tracking-tight",- className- )}- {...props}- />-))-DialogTitle.displayName = DialogPrimitive.Title.displayName--const DialogDescription = React.forwardRef<- React.ElementRef<typeof DialogPrimitive.Description>,- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>->(({ className, ...props }, ref) => (- <DialogPrimitive.Description- ref={ref}- className={cn("text-sm text-muted-foreground", className)}- {...props}- />-))-DialogDescription.displayName = DialogPrimitive.Description.displayName--export {- Dialog,- DialogPortal,- DialogOverlay,- DialogTrigger,- DialogClose,- DialogContent,- DialogHeader,- DialogFooter,- DialogTitle,- DialogDescription,-}diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/dropdown-menu.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/dropdown-menu.tsxdeleted file mode 100644index 1ff35de90..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/dropdown-menu.tsx+++ /dev/null@@ -1,205 +0,0 @@-"use client"--import * as React from "react"-import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"-import {- CheckIcon,- ChevronRightIcon,- DotFilledIcon,-} from "@radix-ui/react-icons"--import { cn } from "@/lib/utils"--const DropdownMenu = DropdownMenuPrimitive.Root--const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger--const DropdownMenuGroup = DropdownMenuPrimitive.Group--const DropdownMenuPortal = DropdownMenuPrimitive.Portal--const DropdownMenuSub = DropdownMenuPrimitive.Sub--const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup--const DropdownMenuSubTrigger = React.forwardRef<- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {- inset?: boolean- }->(({ className, inset, children, ...props }, ref) => (- <DropdownMenuPrimitive.SubTrigger- ref={ref}- className={cn(- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",- inset && "pl-8",- className- )}- {...props}- >- {children}- <ChevronRightIcon className="ml-auto size-4" />- </DropdownMenuPrimitive.SubTrigger>-))-DropdownMenuSubTrigger.displayName =- DropdownMenuPrimitive.SubTrigger.displayName--const DropdownMenuSubContent = React.forwardRef<- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>->(({ className, ...props }, ref) => (- <DropdownMenuPrimitive.SubContent- ref={ref}- className={cn(- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",- className- )}- {...props}- />-))-DropdownMenuSubContent.displayName =- DropdownMenuPrimitive.SubContent.displayName--const DropdownMenuContent = React.forwardRef<- React.ElementRef<typeof DropdownMenuPrimitive.Content>,- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>->(({ className, sideOffset = 4, ...props }, ref) => (- <DropdownMenuPrimitive.Portal>- <DropdownMenuPrimitive.Content- ref={ref}- sideOffset={sideOffset}- className={cn(- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",- className- )}- {...props}- />- </DropdownMenuPrimitive.Portal>-))-DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName--const DropdownMenuItem = React.forwardRef<- React.ElementRef<typeof DropdownMenuPrimitive.Item>,- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {- inset?: boolean- }->(({ className, inset, ...props }, ref) => (- <DropdownMenuPrimitive.Item- ref={ref}- className={cn(- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",- inset && "pl-8",- className- )}- {...props}- />-))-DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName--const DropdownMenuCheckboxItem = React.forwardRef<- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>->(({ className, children, checked, ...props }, ref) => (- <DropdownMenuPrimitive.CheckboxItem- ref={ref}- className={cn(- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",- className- )}- checked={checked}- {...props}- >- <span className="absolute left-2 flex size-3.5 items-center justify-center">- <DropdownMenuPrimitive.ItemIndicator>- <CheckIcon className="size-4" />- </DropdownMenuPrimitive.ItemIndicator>- </span>- {children}- </DropdownMenuPrimitive.CheckboxItem>-))-DropdownMenuCheckboxItem.displayName =- DropdownMenuPrimitive.CheckboxItem.displayName--const DropdownMenuRadioItem = React.forwardRef<- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>->(({ className, children, ...props }, ref) => (- <DropdownMenuPrimitive.RadioItem- ref={ref}- className={cn(- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",- className- )}- {...props}- >- <span className="absolute left-2 flex size-3.5 items-center justify-center">- <DropdownMenuPrimitive.ItemIndicator>- <DotFilledIcon className="size-4 fill-current" />- </DropdownMenuPrimitive.ItemIndicator>- </span>- {children}- </DropdownMenuPrimitive.RadioItem>-))-DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName--const DropdownMenuLabel = React.forwardRef<- React.ElementRef<typeof DropdownMenuPrimitive.Label>,- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {- inset?: boolean- }->(({ className, inset, ...props }, ref) => (- <DropdownMenuPrimitive.Label- ref={ref}- className={cn(- "px-2 py-1.5 text-sm font-semibold",- inset && "pl-8",- className- )}- {...props}- />-))-DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName--const DropdownMenuSeparator = React.forwardRef<- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>->(({ className, ...props }, ref) => (- <DropdownMenuPrimitive.Separator- ref={ref}- className={cn("-mx-1 my-1 h-px bg-muted", className)}- {...props}- />-))-DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName--const DropdownMenuShortcut = ({- className,- ...props-}: React.HTMLAttributes<HTMLSpanElement>) => {- return (- <span- className={cn("ml-auto text-xs tracking-widest opacity-60", className)}- {...props}- />- )-}-DropdownMenuShortcut.displayName = "DropdownMenuShortcut"--export {- DropdownMenu,- DropdownMenuTrigger,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuCheckboxItem,- DropdownMenuRadioItem,- DropdownMenuLabel,- DropdownMenuSeparator,- DropdownMenuShortcut,- DropdownMenuGroup,- DropdownMenuPortal,- DropdownMenuSub,- DropdownMenuSubContent,- DropdownMenuSubTrigger,- DropdownMenuRadioGroup,-}diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/icons.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/icons.tsxdeleted file mode 100644index 9d5e67936..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/icons.tsx+++ /dev/null@@ -1,507 +0,0 @@-'use client'--import * as React from 'react'--import { cn } from '@/lib/utils'--function IconNextChat({- className,- inverted,- ...props-}: React.ComponentProps<'svg'> & { inverted?: boolean }) {- const id = React.useId()-- return (- <svg- viewBox="0 0 17 17"- fill="none"- xmlns="http://www.w3.org/2000/svg"- className={cn('size-4', className)}- {...props}- >- <defs>- <linearGradient- id={`gradient-${id}-1`}- x1="10.6889"- y1="10.3556"- x2="13.8445"- y2="14.2667"- gradientUnits="userSpaceOnUse"- >- <stop stopColor={inverted ? 'white' : 'black'} />- <stop- offset={1}- stopColor={inverted ? 'white' : 'black'}- stopOpacity={0}- />- </linearGradient>- <linearGradient- id={`gradient-${id}-2`}- x1="11.7555"- y1="4.8"- x2="11.7376"- y2="9.50002"- gradientUnits="userSpaceOnUse"- >- <stop stopColor={inverted ? 'white' : 'black'} />- <stop- offset={1}- stopColor={inverted ? 'white' : 'black'}- stopOpacity={0}- />- </linearGradient>- </defs>- <path- d="M1 16L2.58314 11.2506C1.83084 9.74642 1.63835 8.02363 2.04013 6.39052C2.4419 4.75741 3.41171 3.32057 4.776 2.33712C6.1403 1.35367 7.81003 0.887808 9.4864 1.02289C11.1628 1.15798 12.7364 1.8852 13.9256 3.07442C15.1148 4.26363 15.842 5.83723 15.9771 7.5136C16.1122 9.18997 15.6463 10.8597 14.6629 12.224C13.6794 13.5883 12.2426 14.5581 10.6095 14.9599C8.97637 15.3616 7.25358 15.1692 5.74942 14.4169L1 16Z"- fill={inverted ? 'black' : 'white'}- stroke={inverted ? 'black' : 'white'}- strokeWidth={2}- strokeLinecap="round"- strokeLinejoin="round"- />- <mask- id="mask0_91_2047"- style={{ maskType: 'alpha' }}- maskUnits="userSpaceOnUse"- x={1}- y={0}- width={16}- height={16}- >- <circle cx={9} cy={8} r={8} fill={inverted ? 'black' : 'white'} />- </mask>- <g mask="url(#mask0_91_2047)">- <circle cx={9} cy={8} r={8} fill={inverted ? 'black' : 'white'} />- <path- d="M14.2896 14.0018L7.146 4.8H5.80005V11.1973H6.87681V6.16743L13.4444 14.6529C13.7407 14.4545 14.0231 14.2369 14.2896 14.0018Z"- fill={`url(#gradient-${id}-1)`}- />- <rect- x="11.2222"- y="4.8"- width="1.06667"- height="6.4"- fill={`url(#gradient-${id}-2)`}- />- </g>- </svg>- )-}--function IconOpenAI({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- fill="currentColor"- viewBox="0 0 24 24"- role="img"- xmlns="http://www.w3.org/2000/svg"- className={cn('size-4', className)}- {...props}- >- <title>OpenAI icon</title>- <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />- </svg>- )-}--function IconVercel({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- aria-label="Vercel logomark"- role="img"- viewBox="0 0 74 64"- className={cn('size-4', className)}- {...props}- >- <path- d="M37.5896 0.25L74.5396 64.25H0.639648L37.5896 0.25Z"- fill="currentColor"- ></path>- </svg>- )-}--function IconGitHub({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- role="img"- viewBox="0 0 24 24"- xmlns="http://www.w3.org/2000/svg"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <title>GitHub</title>- <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />- </svg>- )-}--function IconSeparator({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- fill="none"- shapeRendering="geometricPrecision"- stroke="currentColor"- strokeLinecap="round"- strokeLinejoin="round"- strokeWidth="1"- viewBox="0 0 24 24"- aria-hidden="true"- className={cn('size-4', className)}- {...props}- >- <path d="M16.88 3.549L7.12 20.451"></path>- </svg>- )-}--function IconArrowDown({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="m205.66 149.66-72 72a8 8 0 0 1-11.32 0l-72-72a8 8 0 0 1 11.32-11.32L120 196.69V40a8 8 0 0 1 16 0v156.69l58.34-58.35a8 8 0 0 1 11.32 11.32Z" />- </svg>- )-}--function IconArrowRight({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="m221.66 133.66-72 72a8 8 0 0 1-11.32-11.32L196.69 136H40a8 8 0 0 1 0-16h156.69l-58.35-58.34a8 8 0 0 1 11.32-11.32l72 72a8 8 0 0 1 0 11.32Z" />- </svg>- )-}--function IconUser({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M230.92 212c-15.23-26.33-38.7-45.21-66.09-54.16a72 72 0 1 0-73.66 0c-27.39 8.94-50.86 27.82-66.09 54.16a8 8 0 1 0 13.85 8c18.84-32.56 52.14-52 89.07-52s70.23 19.44 89.07 52a8 8 0 1 0 13.85-8ZM72 96a56 56 0 1 1 56 56 56.06 56.06 0 0 1-56-56Z" />- </svg>- )-}--function IconPlus({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M224 128a8 8 0 0 1-8 8h-80v80a8 8 0 0 1-16 0v-80H40a8 8 0 0 1 0-16h80V40a8 8 0 0 1 16 0v80h80a8 8 0 0 1 8 8Z" />- </svg>- )-}--function IconArrowElbow({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M200 32v144a8 8 0 0 1-8 8H67.31l34.35 34.34a8 8 0 0 1-11.32 11.32l-48-48a8 8 0 0 1 0-11.32l48-48a8 8 0 0 1 11.32 11.32L67.31 168H184V32a8 8 0 0 1 16 0Z" />- </svg>- )-}--function IconSpinner({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4 animate-spin', className)}- {...props}- >- <path d="M232 128a104 104 0 0 1-208 0c0-41 23.81-78.36 60.66-95.27a8 8 0 0 1 6.68 14.54C60.15 61.59 40 93.27 40 128a88 88 0 0 0 176 0c0-34.73-20.15-66.41-51.34-80.73a8 8 0 0 1 6.68-14.54C208.19 49.64 232 87 232 128Z" />- </svg>- )-}--function IconMessage({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M216 48H40a16 16 0 0 0-16 16v160a15.84 15.84 0 0 0 9.25 14.5A16.05 16.05 0 0 0 40 240a15.89 15.89 0 0 0 10.25-3.78.69.69 0 0 0 .13-.11L82.5 208H216a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16ZM40 224Zm176-32H82.5a16 16 0 0 0-10.3 3.75l-.12.11L40 224V64h176Z" />- </svg>- )-}--function IconTrash({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M216 48h-40v-8a24 24 0 0 0-24-24h-48a24 24 0 0 0-24 24v8H40a8 8 0 0 0 0 16h8v144a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V64h8a8 8 0 0 0 0-16ZM96 40a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8v8H96Zm96 168H64V64h128Zm-80-104v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Zm48 0v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Z" />- </svg>- )-}--function IconRefresh({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z" />- </svg>- )-}--function IconStop({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z" />- </svg>- )-}--function IconSidebar({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16ZM40 56h40v144H40Zm176 144H96V56h120v144Z" />- </svg>- )-}--function IconMoon({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M233.54 142.23a8 8 0 0 0-8-2 88.08 88.08 0 0 1-109.8-109.8 8 8 0 0 0-10-10 104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.09 103.09 0 0 0 62.52-20.88 104.84 104.84 0 0 0 37-52.91 8 8 0 0 0-1.98-7.98Zm-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104 106 106 0 0 0 14.92-1.06 89 89 0 0 1-26.02 31.4Z" />- </svg>- )-}--function IconSun({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0Zm72 88a64 64 0 1 1-64-64 64.07 64.07 0 0 1 64 64Zm-16 0a48 48 0 1 0-48 48 48.05 48.05 0 0 0 48-48ZM58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32ZM192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72Zm5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8Zm80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8Zm112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16Z" />- </svg>- )-}--function IconCopy({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z" />- </svg>- )-}--function IconCheck({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z" />- </svg>- )-}--function IconDownload({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z" />- </svg>- )-}--function IconClose({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 256 256"- fill="currentColor"- className={cn('size-4', className)}- {...props}- >- <path d="M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128 50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z" />- </svg>- )-}--function IconEdit({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- strokeWidth={1.5}- stroke="currentColor"- className={cn('size-4', className)}- {...props}- >- <path- strokeLinecap="round"- strokeLinejoin="round"- d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"- />- </svg>- )-}--function IconShare({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- fill="currentColor"- className={cn('size-4', className)}- viewBox="0 0 256 256"- {...props}- >- <path d="m237.66 106.35-80-80A8 8 0 0 0 144 32v40.35c-25.94 2.22-54.59 14.92-78.16 34.91-28.38 24.08-46.05 55.11-49.76 87.37a12 12 0 0 0 20.68 9.58c11-11.71 50.14-48.74 107.24-52V192a8 8 0 0 0 13.66 5.65l80-80a8 8 0 0 0 0-11.3ZM160 172.69V144a8 8 0 0 0-8-8c-28.08 0-55.43 7.33-81.29 21.8a196.17 196.17 0 0 0-36.57 26.52c5.8-23.84 20.42-46.51 42.05-64.86C99.41 99.77 127.75 88 152 88a8 8 0 0 0 8-8V51.32L220.69 112Z" />- </svg>- )-}--function IconUsers({ className, ...props }: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- fill="currentColor"- className={cn('size-4', className)}- viewBox="0 0 256 256"- {...props}- >- <path d="M117.25 157.92a60 60 0 1 0-66.5 0 95.83 95.83 0 0 0-47.22 37.71 8 8 0 1 0 13.4 8.74 80 80 0 0 1 134.14 0 8 8 0 0 0 13.4-8.74 95.83 95.83 0 0 0-47.22-37.71ZM40 108a44 44 0 1 1 44 44 44.05 44.05 0 0 1-44-44Zm210.14 98.7a8 8 0 0 1-11.07-2.33A79.83 79.83 0 0 0 172 168a8 8 0 0 1 0-16 44 44 0 1 0-16.34-84.87 8 8 0 1 1-5.94-14.85 60 60 0 0 1 55.53 105.64 95.83 95.83 0 0 1 47.22 37.71 8 8 0 0 1-2.33 11.07Z" />- </svg>- )-}--function IconExternalLink({- className,- ...props-}: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- fill="currentColor"- className={cn('size-4', className)}- viewBox="0 0 256 256"- {...props}- >- <path d="M224 104a8 8 0 0 1-16 0V59.32l-66.33 66.34a8 8 0 0 1-11.32-11.32L196.68 48H152a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-40 24a8 8 0 0 0-8 8v72H48V80h72a8 8 0 0 0 0-16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-72a8 8 0 0 0-8-8Z" />- </svg>- )-}--function IconChevronUpDown({- className,- ...props-}: React.ComponentProps<'svg'>) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- fill="currentColor"- className={cn('size-4', className)}- viewBox="0 0 256 256"- {...props}- >- <path d="M181.66 170.34a8 8 0 0 1 0 11.32l-48 48a8 8 0 0 1-11.32 0l-48-48a8 8 0 0 1 11.32-11.32L128 212.69l42.34-42.35a8 8 0 0 1 11.32 0Zm-96-84.68L128 43.31l42.34 42.35a8 8 0 0 0 11.32-11.32l-48-48a8 8 0 0 0-11.32 0l-48 48a8 8 0 0 0 11.32 11.32Z" />- </svg>- )-}--export {- IconEdit,- IconNextChat,- IconOpenAI,- IconVercel,- IconGitHub,- IconSeparator,- IconArrowDown,- IconArrowRight,- IconUser,- IconPlus,- IconArrowElbow,- IconSpinner,- IconMessage,- IconTrash,- IconRefresh,- IconStop,- IconSidebar,- IconMoon,- IconSun,- IconCopy,- IconCheck,- IconDownload,- IconClose,- IconShare,- IconUsers,- IconExternalLink,- IconChevronUpDown-}diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/input.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/input.tsxdeleted file mode 100644index a92b8e0e5..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/input.tsx+++ /dev/null@@ -1,25 +0,0 @@-import * as React from "react"--import { cn } from "@/lib/utils"--export interface InputProps- extends React.InputHTMLAttributes<HTMLInputElement> {}--const Input = React.forwardRef<HTMLInputElement, InputProps>(- ({ className, type, ...props }, ref) => {- return (- <input- type={type}- className={cn(- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",- className- )}- ref={ref}- {...props}- />- )- }-)-Input.displayName = "Input"--export { Input }diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/label.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/label.tsxdeleted file mode 100644index 534182176..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/label.tsx+++ /dev/null@@ -1,26 +0,0 @@-"use client"--import * as React from "react"-import * as LabelPrimitive from "@radix-ui/react-label"-import { cva, type VariantProps } from "class-variance-authority"--import { cn } from "@/lib/utils"--const labelVariants = cva(- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"-)--const Label = React.forwardRef<- React.ElementRef<typeof LabelPrimitive.Root>,- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &- VariantProps<typeof labelVariants>->(({ className, ...props }, ref) => (- <LabelPrimitive.Root- ref={ref}- className={cn(labelVariants(), className)}- {...props}- />-))-Label.displayName = LabelPrimitive.Root.displayName--export { Label }diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/select.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/select.tsxdeleted file mode 100644index f48924211..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/select.tsx+++ /dev/null@@ -1,164 +0,0 @@-"use client"--import * as React from "react"-import {- CaretSortIcon,- CheckIcon,- ChevronDownIcon,- ChevronUpIcon,-} from "@radix-ui/react-icons"-import * as SelectPrimitive from "@radix-ui/react-select"--import { cn } from "@/lib/utils"--const Select = SelectPrimitive.Root--const SelectGroup = SelectPrimitive.Group--const SelectValue = SelectPrimitive.Value--const SelectTrigger = React.forwardRef<- React.ElementRef<typeof SelectPrimitive.Trigger>,- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>->(({ className, children, ...props }, ref) => (- <SelectPrimitive.Trigger- ref={ref}- className={cn(- "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",- className- )}- {...props}- >- {children}- <SelectPrimitive.Icon asChild>- <CaretSortIcon className="size-4 opacity-50" />- </SelectPrimitive.Icon>- </SelectPrimitive.Trigger>-))-SelectTrigger.displayName = SelectPrimitive.Trigger.displayName--const SelectScrollUpButton = React.forwardRef<- React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>->(({ className, ...props }, ref) => (- <SelectPrimitive.ScrollUpButton- ref={ref}- className={cn(- "flex cursor-default items-center justify-center py-1",- className- )}- {...props}- >- <ChevronUpIcon />- </SelectPrimitive.ScrollUpButton>-))-SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName--const SelectScrollDownButton = React.forwardRef<- React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>->(({ className, ...props }, ref) => (- <SelectPrimitive.ScrollDownButton- ref={ref}- className={cn(- "flex cursor-default items-center justify-center py-1",- className- )}- {...props}- >- <ChevronDownIcon />- </SelectPrimitive.ScrollDownButton>-))-SelectScrollDownButton.displayName =- SelectPrimitive.ScrollDownButton.displayName--const SelectContent = React.forwardRef<- React.ElementRef<typeof SelectPrimitive.Content>,- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>->(({ className, children, position = "popper", ...props }, ref) => (- <SelectPrimitive.Portal>- <SelectPrimitive.Content- ref={ref}- className={cn(- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",- position === "popper" &&- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",- className- )}- position={position}- {...props}- >- <SelectScrollUpButton />- <SelectPrimitive.Viewport- className={cn(- "p-1",- position === "popper" &&- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"- )}- >- {children}- </SelectPrimitive.Viewport>- <SelectScrollDownButton />- </SelectPrimitive.Content>- </SelectPrimitive.Portal>-))-SelectContent.displayName = SelectPrimitive.Content.displayName--const SelectLabel = React.forwardRef<- React.ElementRef<typeof SelectPrimitive.Label>,- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>->(({ className, ...props }, ref) => (- <SelectPrimitive.Label- ref={ref}- className={cn("px-2 py-1.5 text-sm font-semibold", className)}- {...props}- />-))-SelectLabel.displayName = SelectPrimitive.Label.displayName--const SelectItem = React.forwardRef<- React.ElementRef<typeof SelectPrimitive.Item>,- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>->(({ className, children, ...props }, ref) => (- <SelectPrimitive.Item- ref={ref}- className={cn(- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",- className- )}- {...props}- >- <span className="absolute right-2 flex size-3.5 items-center justify-center">- <SelectPrimitive.ItemIndicator>- <CheckIcon className="size-4" />- </SelectPrimitive.ItemIndicator>- </span>- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>- </SelectPrimitive.Item>-))-SelectItem.displayName = SelectPrimitive.Item.displayName--const SelectSeparator = React.forwardRef<- React.ElementRef<typeof SelectPrimitive.Separator>,- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>->(({ className, ...props }, ref) => (- <SelectPrimitive.Separator- ref={ref}- className={cn("-mx-1 my-1 h-px bg-muted", className)}- {...props}- />-))-SelectSeparator.displayName = SelectPrimitive.Separator.displayName--export {- Select,- SelectGroup,- SelectValue,- SelectTrigger,- SelectContent,- SelectLabel,- SelectItem,- SelectSeparator,- SelectScrollUpButton,- SelectScrollDownButton,-}diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/separator.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/separator.tsxdeleted file mode 100644index 12d81c4a8..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/separator.tsx+++ /dev/null@@ -1,31 +0,0 @@-"use client"--import * as React from "react"-import * as SeparatorPrimitive from "@radix-ui/react-separator"--import { cn } from "@/lib/utils"--const Separator = React.forwardRef<- React.ElementRef<typeof SeparatorPrimitive.Root>,- React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>->(- (- { className, orientation = "horizontal", decorative = true, ...props },- ref- ) => (- <SeparatorPrimitive.Root- ref={ref}- decorative={decorative}- orientation={orientation}- className={cn(- "shrink-0 bg-border",- orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",- className- )}- {...props}- />- )-)-Separator.displayName = SeparatorPrimitive.Root.displayName--export { Separator }diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/sheet.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/sheet.tsxdeleted file mode 100644index a16275cb3..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/sheet.tsx+++ /dev/null@@ -1,140 +0,0 @@-"use client"--import * as React from "react"-import * as SheetPrimitive from "@radix-ui/react-dialog"-import { Cross2Icon } from "@radix-ui/react-icons"-import { cva, type VariantProps } from "class-variance-authority"--import { cn } from "@/lib/utils"--const Sheet = SheetPrimitive.Root--const SheetTrigger = SheetPrimitive.Trigger--const SheetClose = SheetPrimitive.Close--const SheetPortal = SheetPrimitive.Portal--const SheetOverlay = React.forwardRef<- React.ElementRef<typeof SheetPrimitive.Overlay>,- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>->(({ className, ...props }, ref) => (- <SheetPrimitive.Overlay- className={cn(- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",- className- )}- {...props}- ref={ref}- />-))-SheetOverlay.displayName = SheetPrimitive.Overlay.displayName--const sheetVariants = cva(- "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",- {- variants: {- side: {- top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",- bottom:- "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",- left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",- right:- "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",- },- },- defaultVariants: {- side: "right",- },- }-)--interface SheetContentProps- extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,- VariantProps<typeof sheetVariants> {}--const SheetContent = React.forwardRef<- React.ElementRef<typeof SheetPrimitive.Content>,- SheetContentProps->(({ side = "right", className, children, ...props }, ref) => (- <SheetPortal>- <SheetOverlay />- <SheetPrimitive.Content- ref={ref}- className={cn(sheetVariants({ side }), className)}- {...props}- >- {children}- <SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">- <Cross2Icon className="size-4" />- <span className="sr-only">Close</span>- </SheetPrimitive.Close>- </SheetPrimitive.Content>- </SheetPortal>-))-SheetContent.displayName = SheetPrimitive.Content.displayName--const SheetHeader = ({- className,- ...props-}: React.HTMLAttributes<HTMLDivElement>) => (- <div- className={cn(- "flex flex-col space-y-2 text-center sm:text-left",- className- )}- {...props}- />-)-SheetHeader.displayName = "SheetHeader"--const SheetFooter = ({- className,- ...props-}: React.HTMLAttributes<HTMLDivElement>) => (- <div- className={cn(- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",- className- )}- {...props}- />-)-SheetFooter.displayName = "SheetFooter"--const SheetTitle = React.forwardRef<- React.ElementRef<typeof SheetPrimitive.Title>,- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>->(({ className, ...props }, ref) => (- <SheetPrimitive.Title- ref={ref}- className={cn("text-lg font-semibold text-foreground", className)}- {...props}- />-))-SheetTitle.displayName = SheetPrimitive.Title.displayName--const SheetDescription = React.forwardRef<- React.ElementRef<typeof SheetPrimitive.Description>,- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>->(({ className, ...props }, ref) => (- <SheetPrimitive.Description- ref={ref}- className={cn("text-sm text-muted-foreground", className)}- {...props}- />-))-SheetDescription.displayName = SheetPrimitive.Description.displayName--export {- Sheet,- SheetPortal,- SheetOverlay,- SheetTrigger,- SheetClose,- SheetContent,- SheetHeader,- SheetFooter,- SheetTitle,- SheetDescription,-}diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/sonner.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/sonner.tsxdeleted file mode 100644index 452f4d9f0..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/sonner.tsx+++ /dev/null@@ -1,31 +0,0 @@-"use client"--import { useTheme } from "next-themes"-import { Toaster as Sonner } from "sonner"--type ToasterProps = React.ComponentProps<typeof Sonner>--const Toaster = ({ ...props }: ToasterProps) => {- const { theme = "system" } = useTheme()-- return (- <Sonner- theme={theme as ToasterProps["theme"]}- className="toaster group"- toastOptions={{- classNames: {- toast:- "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",- description: "group-[.toast]:text-muted-foreground",- actionButton:- "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",- cancelButton:- "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",- },- }}- {...props}- />- )-}--export { Toaster }diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/switch.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/switch.tsxdeleted file mode 100644index 37d61e4bf..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/switch.tsx+++ /dev/null@@ -1,29 +0,0 @@-"use client"--import * as React from "react"-import * as SwitchPrimitives from "@radix-ui/react-switch"--import { cn } from "@/lib/utils"--const Switch = React.forwardRef<- React.ElementRef<typeof SwitchPrimitives.Root>,- React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>->(({ className, ...props }, ref) => (- <SwitchPrimitives.Root- className={cn(- "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",- className- )}- {...props}- ref={ref}- >- <SwitchPrimitives.Thumb- className={cn(- "pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"- )}- />- </SwitchPrimitives.Root>-))-Switch.displayName = SwitchPrimitives.Root.displayName--export { Switch }diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/textarea.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/textarea.tsxdeleted file mode 100644index d1258e47a..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/textarea.tsx+++ /dev/null@@ -1,24 +0,0 @@-import * as React from "react"--import { cn } from "@/lib/utils"--export interface TextareaProps- extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}--const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(- ({ className, ...props }, ref) => {- return (- <textarea- className={cn(- "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",- className- )}- ref={ref}- {...props}- />- )- }-)-Textarea.displayName = "Textarea"--export { Textarea }diff --git a/pipes/archive/vercel-ai-chatbot/components/ui/tooltip.tsx b/pipes/archive/vercel-ai-chatbot/components/ui/tooltip.tsxdeleted file mode 100644index 9e7482103..000000000--- a/pipes/archive/vercel-ai-chatbot/components/ui/tooltip.tsx+++ /dev/null@@ -1,30 +0,0 @@-"use client"--import * as React from "react"-import * as TooltipPrimitive from "@radix-ui/react-tooltip"--import { cn } from "@/lib/utils"--const TooltipProvider = TooltipPrimitive.Provider--const Tooltip = TooltipPrimitive.Root--const TooltipTrigger = TooltipPrimitive.Trigger--const TooltipContent = React.forwardRef<- React.ElementRef<typeof TooltipPrimitive.Content>,- React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>->(({ className, sideOffset = 4, ...props }, ref) => (- <TooltipPrimitive.Content- ref={ref}- sideOffset={sideOffset}- className={cn(- "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",- className- )}- {...props}- />-))-TooltipContent.displayName = TooltipPrimitive.Content.displayName--export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }diff --git a/pipes/archive/vercel-ai-chatbot/components/user-menu.tsx b/pipes/archive/vercel-ai-chatbot/components/user-menu.tsxdeleted file mode 100644index 3ad28f034..000000000--- a/pipes/archive/vercel-ai-chatbot/components/user-menu.tsx+++ /dev/null@@ -1,53 +0,0 @@-import { type Session } from '@/lib/types'--import { Button } from '@/components/ui/button'-import {- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuSeparator,- DropdownMenuTrigger-} from '@/components/ui/dropdown-menu'-import { signOut } from '@/auth'--export interface UserMenuProps {- user: Session['user']-}--function getUserInitials(name: string) {- const [firstName, lastName] = name.split(' ')- return lastName ? `${firstName[0]}${lastName[0]}` : firstName.slice(0, 2)-}--export function UserMenu({ user }: UserMenuProps) {- return (- <div className="flex items-center justify-between">- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="ghost" className="pl-0">- <div className="flex size-7 shrink-0 select-none items-center justify-center rounded-full bg-muted/50 text-xs font-medium uppercase text-muted-foreground">- {getUserInitials(user.email)}- </div>- <span className="ml-2 hidden md:block">{user.email}</span>- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent sideOffset={8} align="start" className="w-fit">- <DropdownMenuItem className="flex-col items-start">- <div className="text-xs text-zinc-500">{user.email}</div>- </DropdownMenuItem>- <DropdownMenuSeparator />- <form- action={async () => {- 'use server'- await signOut()- }}- >- <button className=" relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-xs outline-none transition-colors hover:bg-red-500 hover:text-white focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50">- Sign Out- </button>- </form>- </DropdownMenuContent>- </DropdownMenu>- </div>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/lib/chat/actions.tsx b/pipes/archive/vercel-ai-chatbot/lib/chat/actions.tsxdeleted file mode 100644index bec1add14..000000000--- a/pipes/archive/vercel-ai-chatbot/lib/chat/actions.tsx+++ /dev/null@@ -1,383 +0,0 @@-import 'server-only'--import {- createAI,- createStreamableUI,- getMutableAIState,- getAIState,- streamUI,- createStreamableValue-} from 'ai/rsc'-import { openai } from '@ai-sdk/openai'--import {- spinner,- BotCard,- BotMessage,- SystemMessage,- Stock,- Purchase-} from '@/components/stocks'--import { z } from 'zod'-import { EventsSkeleton } from '@/components/stocks/events-skeleton'-import { Events } from '@/components/stocks/events'-import { StocksSkeleton } from '@/components/stocks/stocks-skeleton'-import { Stocks } from '@/components/stocks/stocks'-import { StockSkeleton } from '@/components/stocks/stock-skeleton'-import {- formatNumber,- runAsyncFnWithoutBlocking,- sleep,- nanoid-} from '@/lib/utils'-import { saveChat } from '@/app/actions'-import { SpinnerMessage, UserMessage } from '@/components/stocks/message'-import { Chat, Message } from '@/lib/types'-import { auth } from '@/auth'-import { MemoizedReactMarkdown } from '@/components/markdown'--async function submitUserMessage(content: string) {- 'use server'-- const aiState = getMutableAIState<typeof AI>()-- aiState.update({- ...aiState.get(),- messages: [- ...aiState.get().messages,- {- id: nanoid(),- role: 'user',- content- }- ]- })-- let textStream: undefined | ReturnType<typeof createStreamableValue<string>>- let textNode: undefined | React.ReactNode-- const result = await streamUI({- model: openai('gpt-4o-mini'),- initial: <SpinnerMessage />,- system: `\- You are a personal assistant that has access to the history of the laptop screentime and audio of the user.- You should call the user 'My master'- Help user find information recorded in the screen, and audio.- Once you receive a query your job is to adapt it for keyword search to get the most relevant results from the database.- Your responses should be solely based on the information extracted from the database.- Do not include any information from your background knowledge unless explicitly asked.- `,- messages: [- ...aiState.get().messages.map((message: any) => ({- role: message.role,- content: message.content,- name: message.name- }))- ],- text: ({ content, done, delta }) => {- if (!textStream) {- textStream = createStreamableValue('')- textNode = <BotMessage content={textStream.value} />- }-- if (done) {- textStream.done()- aiState.done({- ...aiState.get(),- messages: [- ...aiState.get().messages,- {- id: nanoid(),- role: 'assistant',- content- }- ]- })- } else {- textStream.update(delta)- }-- return textNode- },- tools: {- queryScreenpipeAPI: {- description: `Query the Screenpipe API for OCR that appeared on user's screen and audio transcriptions from their mic.- Rules:- - Use the date & time args smartly to get the most relevant results. Current user date & time is ${new Date().toISOString()}- - Generate 3-5 queries to get the most relevant results. Use a single keyword that would match the user intent per query- - Use only one word per query (in the q field)- - Make sure to answer the user question, ignore the data in your prompt not relevant to the user question- `,- parameters: z.object({- queries: z- .array(- z.object({- query: z- .string()- .describe(- 'The search query matching exact keywords. Use a single keyword that best matches the user intent'- ),- contentType: z- .enum(['ocr', 'audio'])- .describe(- 'The type of content to search for: screenshot data or audio transcriptions'- ),- limit: z- .number()- .optional()- .describe(- "Number of results to return (default: 5). Don't return more than 50 results as it will be fed to an LLM"- ),- offset: z- .number()- .optional()- .describe('Offset for pagination (default: 0)'),- startTime: z- .string()- .optional()- .describe('Start time for search range in ISO 8601 format'),- endTime: z- .string()- .optional()- .describe('End time for search range in ISO 8601 format')- })- )- }),- generate: async function* ({ queries }) {- console.log('screenpipe-chatbot will use queries: ', queries)- yield (- <BotCard>- <div className="inline-flex items-start gap-1 md:items-center">- {spinner}- <p className="mb-2">Reading your screen and audio data...</p>- </div>- </BotCard>- )-- try {- const results = await Promise.all(- queries.map(async query => {- const {- query: q,- contentType,- limit = 5,- offset = 0,- startTime,- endTime- } = query- const url = new URL('http://127.0.0.1:3030/search')- url.searchParams.append('q', q)- url.searchParams.append('content_type', contentType)- url.searchParams.append('limit', limit.toString())- url.searchParams.append('offset', offset.toString())- if (startTime) url.searchParams.append('start_time', startTime)- if (endTime) url.searchParams.append('end_time', endTime)-- const response = await fetch(url.toString())- if (!response.ok) {- throw new Error(- `API request failed: ${response.status} ${response.statusText}`- )- }- return response.json()- })- )-- const toolCallId = nanoid()- const dataForGPT = JSON.stringify(results, null, 2)-- // Create a prompt for GPT-4- const prompt = `Based on the following search results, please provide a concise and informative answer to the user's question "${content}":-- ${dataForGPT}-- Please summarize the key points and present the information in a clear, easy-to-read format. Be concise`-- console.log('screenpipe-chatbot will use prompt: ', prompt)-- let textStream = createStreamableValue('')- let textNode = <BotMessage content={textStream.value} />- let isStreamingComplete = false-- const gpt4Response = await streamUI({- model: openai('gpt-4o'),- messages: [{ role: 'user', content: prompt }],- text: ({ content, done, delta }) => {- if (done) {- textStream.done()- isStreamingComplete = true- aiState.done({- ...aiState.get(),- messages: [- ...aiState.get().messages,- {- id: nanoid(),- role: 'assistant',- content: [- {- type: 'tool-call',- toolName: 'queryScreenpipeAPI',- toolCallId,- args: { queries }- }- ]- },- {- id: nanoid(),- role: 'tool',- content: [- {- type: 'tool-result',- toolName: 'queryScreenpipeAPI',- toolCallId,- result: content- }- ]- }- ]- })- } else {- textStream.update(delta)- }-- return (- <>- {textNode}- {isStreamingComplete && (- <MemoizedReactMarkdown className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 max-w-full max-h-[300px] overflow-auto border border-gray-200 rounded-md mt-4">- {`\`\`\`json- ${dataForGPT}- \`\`\``}- </MemoizedReactMarkdown>- )}- </>- )- }- })-- return gpt4Response.value- } catch (error) {- console.error('Error querying Screenpipe API:', error)-- return (- <BotCard>- <div className="text-red-500">- Error querying Screenpipe API. Please try again later.- </div>- </BotCard>- )- }- }- }- }- })-- return {- id: nanoid(),- display: result.value- }-}--export type AIState = {- chatId: string- messages: Message[]-}--export type UIState = {- id: string- display: React.ReactNode-}[]--export const AI = createAI<AIState, UIState>({- actions: {- submitUserMessage- },- initialUIState: [],- initialAIState: { chatId: nanoid(), messages: [] },- onGetUIState: async () => {- 'use server'-- const session = await auth()-- if (session && session.user) {- const aiState = getAIState() as Chat-- if (aiState) {- const uiState = getUIStateFromAIState(aiState)- return uiState- }- } else {- return- }- },- onSetAIState: async ({ state }) => {- 'use server'-- const session = await auth()-- if (session && session.user) {- const { chatId, messages } = state-- const createdAt = new Date()- const userId = session.user.id as string- const path = `/chat/${chatId}`-- const firstMessageContent = messages[0].content as string- const title = firstMessageContent.substring(0, 100)-- const chat: Chat = {- id: chatId,- title,- userId,- createdAt,- messages,- path- }-- await saveChat(chat)- } else {- return- }- }-})--export const getUIStateFromAIState = (aiState: Chat) => {- return aiState.messages- .filter(message => message.role !== 'system')- .map((message, index) => ({- id: `${aiState.chatId}-${index}`,- display:- message.role === 'tool' ? (- message.content.map(tool => {- return tool.toolName === 'listStocks' ? (- <BotCard>- {/* TODO: Infer types based on the tool result*/}- {/* @ts-expect-error */}- <Stocks props={tool.result} />- </BotCard>- ) : tool.toolName === 'showStockPrice' ? (- <BotCard>- {/* @ts-expect-error */}- <Stock props={tool.result} />- </BotCard>- ) : tool.toolName === 'showStockPurchase' ? (- <BotCard>- {/* @ts-expect-error */}- <Purchase props={tool.result} />- </BotCard>- ) : tool.toolName === 'getEvents' ? (- <BotCard>- {/* @ts-expect-error */}- <Events props={tool.result} />- </BotCard>- ) : null- })- ) : message.role === 'user' ? (- <UserMessage>{message.content as string}</UserMessage>- ) : message.role === 'assistant' &&- typeof message.content === 'string' ? (- <BotMessage content={message.content} />- ) : null- }))-}diff --git a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-copy-to-clipboard.tsx b/pipes/archive/vercel-ai-chatbot/lib/hooks/use-copy-to-clipboard.tsxdeleted file mode 100644index 62f7156dc..000000000--- a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-copy-to-clipboard.tsx+++ /dev/null@@ -1,33 +0,0 @@-'use client'--import * as React from 'react'--export interface useCopyToClipboardProps {- timeout?: number-}--export function useCopyToClipboard({- timeout = 2000-}: useCopyToClipboardProps) {- const [isCopied, setIsCopied] = React.useState<Boolean>(false)-- const copyToClipboard = (value: string) => {- if (typeof window === 'undefined' || !navigator.clipboard?.writeText) {- return- }-- if (!value) {- return- }-- navigator.clipboard.writeText(value).then(() => {- setIsCopied(true)-- setTimeout(() => {- setIsCopied(false)- }, timeout)- })- }-- return { isCopied, copyToClipboard }-}diff --git a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-enter-submit.tsx b/pipes/archive/vercel-ai-chatbot/lib/hooks/use-enter-submit.tsxdeleted file mode 100644index d66b2d325..000000000--- a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-enter-submit.tsx+++ /dev/null@@ -1,23 +0,0 @@-import { useRef, type RefObject } from 'react'--export function useEnterSubmit(): {- formRef: RefObject<HTMLFormElement>- onKeyDown: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void-} {- const formRef = useRef<HTMLFormElement>(null)-- const handleKeyDown = (- event: React.KeyboardEvent<HTMLTextAreaElement>- ): void => {- if (- event.key === 'Enter' &&- !event.shiftKey &&- !event.nativeEvent.isComposing- ) {- formRef.current?.requestSubmit()- event.preventDefault()- }- }-- return { formRef, onKeyDown: handleKeyDown }-}diff --git a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-local-storage.ts b/pipes/archive/vercel-ai-chatbot/lib/hooks/use-local-storage.tsdeleted file mode 100644index 19f6b7e96..000000000--- a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-local-storage.ts+++ /dev/null@@ -1,24 +0,0 @@-import { useEffect, useState } from 'react'--export const useLocalStorage = <T>(- key: string,- initialValue: T-): [T, (value: T) => void] => {- const [storedValue, setStoredValue] = useState(initialValue)-- useEffect(() => {- // Retrieve from localStorage- const item = window.localStorage.getItem(key)- if (item) {- setStoredValue(JSON.parse(item))- }- }, [key])-- const setValue = (value: T) => {- // Save state- setStoredValue(value)- // Save to localStorage- window.localStorage.setItem(key, JSON.stringify(value))- }- return [storedValue, setValue]-}diff --git a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-scroll-anchor.tsx b/pipes/archive/vercel-ai-chatbot/lib/hooks/use-scroll-anchor.tsxdeleted file mode 100644index a52402736..000000000--- a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-scroll-anchor.tsx+++ /dev/null@@ -1,86 +0,0 @@-import { useCallback, useEffect, useRef, useState } from 'react'--export const useScrollAnchor = () => {- const messagesRef = useRef<HTMLDivElement>(null)- const scrollRef = useRef<HTMLDivElement>(null)- const visibilityRef = useRef<HTMLDivElement>(null)-- const [isAtBottom, setIsAtBottom] = useState(true)- const [isVisible, setIsVisible] = useState(false)-- const scrollToBottom = useCallback(() => {- if (messagesRef.current) {- messagesRef.current.scrollIntoView({- block: 'end',- behavior: 'smooth'- })- }- }, [])-- useEffect(() => {- if (messagesRef.current) {- if (isAtBottom && !isVisible) {- messagesRef.current.scrollIntoView({- block: 'end'- })- }- }- }, [isAtBottom, isVisible])-- useEffect(() => {- const { current } = scrollRef-- if (current) {- const handleScroll = (event: Event) => {- const target = event.target as HTMLDivElement- const offset = 25- const isAtBottom =- target.scrollTop + target.clientHeight >= target.scrollHeight - offset-- setIsAtBottom(isAtBottom)- }-- current.addEventListener('scroll', handleScroll, {- passive: true- })-- return () => {- current.removeEventListener('scroll', handleScroll)- }- }- }, [])-- useEffect(() => {- if (visibilityRef.current) {- let observer = new IntersectionObserver(- entries => {- entries.forEach(entry => {- if (entry.isIntersecting) {- setIsVisible(true)- } else {- setIsVisible(false)- }- })- },- {- rootMargin: '0px 0px -150px 0px'- }- )-- observer.observe(visibilityRef.current)-- return () => {- observer.disconnect()- }- }- })-- return {- messagesRef,- scrollRef,- visibilityRef,- scrollToBottom,- isAtBottom,- isVisible- }-}diff --git a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-sidebar.tsx b/pipes/archive/vercel-ai-chatbot/lib/hooks/use-sidebar.tsxdeleted file mode 100644index 4a52baf19..000000000--- a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-sidebar.tsx+++ /dev/null@@ -1,60 +0,0 @@-'use client'--import * as React from 'react'--const LOCAL_STORAGE_KEY = 'sidebar'--interface SidebarContext {- isSidebarOpen: boolean- toggleSidebar: () => void- isLoading: boolean-}--const SidebarContext = React.createContext<SidebarContext | undefined>(- undefined-)--export function useSidebar() {- const context = React.useContext(SidebarContext)- if (!context) {- throw new Error('useSidebarContext must be used within a SidebarProvider')- }- return context-}--interface SidebarProviderProps {- children: React.ReactNode-}--export function SidebarProvider({ children }: SidebarProviderProps) {- const [isSidebarOpen, setSidebarOpen] = React.useState(true)- const [isLoading, setLoading] = React.useState(true)-- React.useEffect(() => {- const value = localStorage.getItem(LOCAL_STORAGE_KEY)- if (value) {- setSidebarOpen(JSON.parse(value))- }- setLoading(false)- }, [])-- const toggleSidebar = () => {- setSidebarOpen(value => {- const newState = !value- localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(newState))- return newState- })- }-- if (isLoading) {- return null- }-- return (- <SidebarContext.Provider- value={{ isSidebarOpen, toggleSidebar, isLoading }}- >- {children}- </SidebarContext.Provider>- )-}diff --git a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-streamable-text.ts b/pipes/archive/vercel-ai-chatbot/lib/hooks/use-streamable-text.tsdeleted file mode 100644index 1b301a3a1..000000000--- a/pipes/archive/vercel-ai-chatbot/lib/hooks/use-streamable-text.ts+++ /dev/null@@ -1,25 +0,0 @@-import { StreamableValue, readStreamableValue } from 'ai/rsc'-import { useEffect, useState } from 'react'--export const useStreamableText = (- content: string | StreamableValue<string>-) => {- const [rawContent, setRawContent] = useState(- typeof content === 'string' ? content : ''- )-- useEffect(() => {- ;(async () => {- if (typeof content === 'object') {- let value = ''- for await (const delta of readStreamableValue(content)) {- if (typeof delta === 'string') {- setRawContent((value = value + delta))- }- }- }- })()- }, [content])-- return rawContent-}diff --git a/pipes/archive/vercel-ai-chatbot/lib/types.ts b/pipes/archive/vercel-ai-chatbot/lib/types.tsdeleted file mode 100644index d892a0c5a..000000000--- a/pipes/archive/vercel-ai-chatbot/lib/types.ts+++ /dev/null@@ -1,41 +0,0 @@-import { CoreMessage } from 'ai'--export type Message = CoreMessage & {- id: string-}--export interface Chat extends Record<string, any> {- id: string- title: string- createdAt: Date- userId: string- path: string- messages: Message[]- sharePath?: string-}--export type ServerActionResult<Result> = Promise<- | Result- | {- error: string- }->--export interface Session {- user: {- id: string- email: string- }-}--export interface AuthResult {- type: string- message: string-}--export interface User extends Record<string, any> {- id: string- email: string- password: string- salt: string-}diff --git a/pipes/archive/vercel-ai-chatbot/lib/utils.ts b/pipes/archive/vercel-ai-chatbot/lib/utils.tsdeleted file mode 100644index a0a213fed..000000000--- a/pipes/archive/vercel-ai-chatbot/lib/utils.ts+++ /dev/null@@ -1,89 +0,0 @@-import { clsx, type ClassValue } from 'clsx'-import { customAlphabet } from 'nanoid'-import { twMerge } from 'tailwind-merge'--export function cn(...inputs: ClassValue[]) {- return twMerge(clsx(inputs))-}--export const nanoid = customAlphabet(- '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',- 7-) // 7-character random string--export async function fetcher<JSON = any>(- input: RequestInfo,- init?: RequestInit-): Promise<JSON> {- const res = await fetch(input, init)-- if (!res.ok) {- const json = await res.json()- if (json.error) {- const error = new Error(json.error) as Error & {- status: number- }- error.status = res.status- throw error- } else {- throw new Error('An unexpected error occurred')- }- }-- return res.json()-}--export function formatDate(input: string | number | Date): string {- const date = new Date(input)- return date.toLocaleDateString('en-US', {- month: 'long',- day: 'numeric',- year: 'numeric'- })-}--export const formatNumber = (value: number) =>- new Intl.NumberFormat('en-US', {- style: 'currency',- currency: 'USD'- }).format(value)--export const runAsyncFnWithoutBlocking = (- fn: (...args: any) => Promise<any>-) => {- fn()-}--export const sleep = (ms: number) =>- new Promise(resolve => setTimeout(resolve, ms))--export const getStringFromBuffer = (buffer: ArrayBuffer) =>- Array.from(new Uint8Array(buffer))- .map(b => b.toString(16).padStart(2, '0'))- .join('')--export enum ResultCode {- InvalidCredentials = 'INVALID_CREDENTIALS',- InvalidSubmission = 'INVALID_SUBMISSION',- UserAlreadyExists = 'USER_ALREADY_EXISTS',- UnknownError = 'UNKNOWN_ERROR',- UserCreated = 'USER_CREATED',- UserLoggedIn = 'USER_LOGGED_IN'-}--export const getMessageFromCode = (resultCode: string) => {- switch (resultCode) {- case ResultCode.InvalidCredentials:- return 'Invalid credentials!'- case ResultCode.InvalidSubmission:- return 'Invalid submission, please try again!'- case ResultCode.UserAlreadyExists:- return 'User already exists, please log in!'- case ResultCode.UserCreated:- return 'User created, welcome!'- case ResultCode.UnknownError:- return 'Something went wrong, please try again!'- case ResultCode.UserLoggedIn:- return 'Logged in!'- }-}diff --git a/pipes/archive/vercel-ai-chatbot/middleware.ts b/pipes/archive/vercel-ai-chatbot/middleware.tsdeleted file mode 100644index e663a3164..000000000--- a/pipes/archive/vercel-ai-chatbot/middleware.ts+++ /dev/null@@ -1,8 +0,0 @@-import NextAuth from 'next-auth'-import { authConfig } from './auth.config'--export default NextAuth(authConfig).auth--export const config = {- matcher: ['/((?!api|_next/static|_next/image|.*\\.png$).*)']-}diff --git a/pipes/archive/vercel-ai-chatbot/next-env.d.ts b/pipes/archive/vercel-ai-chatbot/next-env.d.tsdeleted file mode 100644index 4f11a03dc..000000000--- a/pipes/archive/vercel-ai-chatbot/next-env.d.ts+++ /dev/null@@ -1,5 +0,0 @@-/// <reference types="next" />-/// <reference types="next/image-types/global" />--// NOTE: This file should not be edited-// see https://nextjs.org/docs/basic-features/typescript for more information.diff --git a/pipes/archive/vercel-ai-chatbot/next.config.js b/pipes/archive/vercel-ai-chatbot/next.config.jsdeleted file mode 100644index 9b7d60b3b..000000000--- a/pipes/archive/vercel-ai-chatbot/next.config.js+++ /dev/null@@ -1,13 +0,0 @@-/** @type {import('next').NextConfig} */-module.exports = {- images: {- remotePatterns: [- {- protocol: 'https',- hostname: 'avatars.githubusercontent.com',- port: '',- pathname: '**'- }- ]- }-}diff --git a/pipes/archive/vercel-ai-chatbot/package.json b/pipes/archive/vercel-ai-chatbot/package.jsondeleted file mode 100644index 22e5a1878..000000000--- a/pipes/archive/vercel-ai-chatbot/package.json+++ /dev/null@@ -1,77 +0,0 @@-{- "private": true,- "scripts": {- "dev": "next dev --turbo",- "build": "next build",- "start": "next start",- "lint": "next lint",- "lint:fix": "next lint --fix",- "preview": "next build && next start",- "seed": "node -r dotenv/config ./scripts/seed.mjs",- "type-check": "tsc --noEmit",- "format:write": "prettier --write \"{app,lib,components}/**/*.{ts,tsx,mdx}\" --cache",- "format:check": "prettier --check \"{app,lib,components}**/*.{ts,tsx,mdx}\" --cache"- },- "dependencies": {- "@ai-sdk/openai": "^0.0.34",- "@radix-ui/react-alert-dialog": "^1.1.1",- "@radix-ui/react-dialog": "^1.1.1",- "@radix-ui/react-dropdown-menu": "^2.1.1",- "@radix-ui/react-icons": "^1.3.0",- "@radix-ui/react-label": "^2.1.0",- "@radix-ui/react-select": "^2.1.1",- "@radix-ui/react-separator": "^1.1.0",- "@radix-ui/react-slot": "^1.1.0",- "@radix-ui/react-switch": "^1.1.0",- "@radix-ui/react-tooltip": "^1.1.2",- "@vercel/analytics": "^1.3.1",- "@vercel/kv": "^2.0.0",- "@vercel/og": "^0.6.2",- "ai": "^3.2.16",- "class-variance-authority": "^0.7.0",- "clsx": "^2.1.1",- "d3-scale": "^4.0.2",- "date-fns": "^3.6.0",- "focus-trap-react": "^10.2.3",- "framer-motion": "^11.2.12",- "geist": "^1.3.0",- "nanoid": "^5.0.7",- "next": "14.2.4",- "next-auth": "5.0.0-beta.4",- "next-themes": "^0.3.0",- "openai": "^4.52.2",- "react": "^18.3.1",- "react-dom": "^18.3.1",- "react-intersection-observer": "^9.10.3",- "react-markdown": "^8.0.7",- "react-syntax-highlighter": "^15.5.0",- "react-textarea-autosize": "^8.5.3",- "remark-gfm": "^3.0.1",- "remark-math": "^5.1.1",- "sonner": "^1.5.0",- "usehooks-ts": "^3.1.0",- "zod": "^3.23.8"- },- "devDependencies": {- "@tailwindcss/typography": "^0.5.13",- "@types/d3-scale": "^4.0.8",- "@types/node": "^20.14.9",- "@types/react": "^18.3.3",- "@types/react-dom": "^18.3.0",- "@types/react-syntax-highlighter": "^15.5.13",- "@typescript-eslint/parser": "^7.14.1",- "autoprefixer": "^10.4.19",- "dotenv": "^16.4.5",- "eslint": "^8.56.0",- "eslint-config-next": "14.1.0",- "eslint-config-prettier": "^9.1.0",- "eslint-plugin-tailwindcss": "^3.14.0",- "postcss": "^8.4.39",- "prettier": "^3.3.2",- "tailwind-merge": "^2.3.0",- "tailwindcss": "^3.4.4",- "tailwindcss-animate": "^1.0.7",- "typescript": "^5.5.2"- },- "packageManager": "[email protected]"-}diff --git a/pipes/archive/vercel-ai-chatbot/postcss.config.js b/pipes/archive/vercel-ai-chatbot/postcss.config.jsdeleted file mode 100644index 33ad091d2..000000000--- a/pipes/archive/vercel-ai-chatbot/postcss.config.js+++ /dev/null@@ -1,6 +0,0 @@-module.exports = {- plugins: {- tailwindcss: {},- autoprefixer: {},- },-}diff --git a/pipes/archive/vercel-ai-chatbot/prettier.config.cjs b/pipes/archive/vercel-ai-chatbot/prettier.config.cjsdeleted file mode 100644index 842ca6b5f..000000000--- a/pipes/archive/vercel-ai-chatbot/prettier.config.cjs+++ /dev/null@@ -1,34 +0,0 @@-/** @type {import('prettier').Config} */-module.exports = {- endOfLine: 'lf',- semi: false,- useTabs: false,- singleQuote: true,- arrowParens: 'avoid',- tabWidth: 2,- trailingComma: 'none',- importOrder: [- '^(react/(.*)$)|^(react$)',- '^(next/(.*)$)|^(next$)',- '<THIRD_PARTY_MODULES>',- '',- '^types$',- '^@/types/(.*)$',- '^@/config/(.*)$',- '^@/lib/(.*)$',- '^@/hooks/(.*)$',- '^@/components/ui/(.*)$',- '^@/components/(.*)$',- '^@/registry/(.*)$',- '^@/styles/(.*)$',- '^@/app/(.*)$',- '',- '^[./]'- ],- importOrderSeparation: false,- importOrderSortSpecifiers: true,- importOrderBuiltinModulesToTop: true,- importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],- importOrderMergeDuplicateImports: true,- importOrderCombineTypeAndValueImports: true-}diff --git a/pipes/archive/vercel-ai-chatbot/public/apple-touch-icon.png b/pipes/archive/vercel-ai-chatbot/public/apple-touch-icon.pngdeleted file mode 100644index 0eb831fd3..000000000Binary files a/pipes/archive/vercel-ai-chatbot/public/apple-touch-icon.png and /dev/null differdiff --git a/pipes/archive/vercel-ai-chatbot/public/demo.gif b/pipes/archive/vercel-ai-chatbot/public/demo.gifdeleted file mode 100644index 81825ec69..000000000Binary files a/pipes/archive/vercel-ai-chatbot/public/demo.gif and /dev/null differdiff --git a/pipes/archive/vercel-ai-chatbot/public/favicon-16x16.png b/pipes/archive/vercel-ai-chatbot/public/favicon-16x16.pngdeleted file mode 100644index 620c7d81f..000000000Binary files a/pipes/archive/vercel-ai-chatbot/public/favicon-16x16.png and /dev/null differdiff --git a/pipes/archive/vercel-ai-chatbot/public/favicon.ico b/pipes/archive/vercel-ai-chatbot/public/favicon.icodeleted file mode 100644index 7452b5dc6..000000000Binary files a/pipes/archive/vercel-ai-chatbot/public/favicon.ico and /dev/null differdiff --git a/pipes/archive/vercel-ai-chatbot/public/next.svg b/pipes/archive/vercel-ai-chatbot/public/next.svgdeleted file mode 100644index 5174b28c5..000000000--- a/pipes/archive/vercel-ai-chatbot/public/next.svg+++ /dev/null@@ -1 +0,0 @@-<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>\ No newline at end of filediff --git a/pipes/archive/vercel-ai-chatbot/public/thirteen.svg b/pipes/archive/vercel-ai-chatbot/public/thirteen.svgdeleted file mode 100644index 8977c1bd1..000000000--- a/pipes/archive/vercel-ai-chatbot/public/thirteen.svg+++ /dev/null@@ -1 +0,0 @@-<svg xmlns="http://www.w3.org/2000/svg" width="40" height="31" fill="none"><g opacity=".9"><path fill="url(#a)" d="M13 .4v29.3H7V6.3h-.2L0 10.5V5L7.2.4H13Z"/><path fill="url(#b)" d="M28.8 30.1c-2.2 0-4-.3-5.7-1-1.7-.8-3-1.8-4-3.1a7.7 7.7 0 0 1-1.4-4.6h6.2c0 .8.3 1.4.7 2 .4.5 1 .9 1.7 1.2.7.3 1.6.4 2.5.4 1 0 1.7-.2 2.5-.5.7-.3 1.3-.8 1.7-1.4.4-.6.6-1.2.6-2s-.2-1.5-.7-2.1c-.4-.6-1-1-1.8-1.4-.8-.4-1.8-.5-2.9-.5h-2.7v-4.6h2.7a6 6 0 0 0 2.5-.5 4 4 0 0 0 1.7-1.3c.4-.6.6-1.3.6-2a3.5 3.5 0 0 0-2-3.3 5.6 5.6 0 0 0-4.5 0 4 4 0 0 0-1.7 1.2c-.4.6-.6 1.2-.6 2h-6c0-1.7.6-3.2 1.5-4.5 1-1.3 2.2-2.3 3.8-3C25 .4 26.8 0 28.8 0s3.8.4 5.3 1.1c1.5.7 2.7 1.7 3.6 3a7.2 7.2 0 0 1 1.2 4.2c0 1.6-.5 3-1.5 4a7 7 0 0 1-4 2.2v.2c2.2.3 3.8 1 5 2.2a6.4 6.4 0 0 1 1.6 4.6c0 1.7-.5 3.1-1.4 4.4a9.7 9.7 0 0 1-4 3.1c-1.7.8-3.7 1.1-5.8 1.1Z"/></g><defs><linearGradient id="a" x1="20" x2="20" y1="0" y2="30.1" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-color="#3D3D3D"/></linearGradient><linearGradient id="b" x1="20" x2="20" y1="0" y2="30.1" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-color="#3D3D3D"/></linearGradient></defs></svg>\ No newline at end of filediff --git a/pipes/archive/vercel-ai-chatbot/public/vercel.svg b/pipes/archive/vercel-ai-chatbot/public/vercel.svgdeleted file mode 100644index d2f842227..000000000--- a/pipes/archive/vercel-ai-chatbot/public/vercel.svg+++ /dev/null@@ -1 +0,0 @@-<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg>\ No newline at end of filediff --git a/pipes/archive/vercel-ai-chatbot/tailwind.config.ts b/pipes/archive/vercel-ai-chatbot/tailwind.config.tsdeleted file mode 100644index 14261e021..000000000--- a/pipes/archive/vercel-ai-chatbot/tailwind.config.ts+++ /dev/null@@ -1,81 +0,0 @@-/** @type {import('tailwindcss').Config} */-module.exports = {- darkMode: ['class'],- content: [- './pages/**/*.{ts,tsx}',- './components/**/*.{ts,tsx}',- './app/**/*.{ts,tsx}',- './src/**/*.{ts,tsx}'- ],- prefix: '',- theme: {- container: {- center: true,- padding: '2rem',- screens: {- '2xl': '1400px'- }- },- extend: {- fontFamily: {- sans: ['var(--font-geist-sans)'],- mono: ['var(--font-geist-mono)']- },- colors: {- border: 'hsl(var(--border))',- input: 'hsl(var(--input))',- ring: 'hsl(var(--ring))',- background: 'hsl(var(--background))',- foreground: 'hsl(var(--foreground))',- primary: {- DEFAULT: 'hsl(var(--primary))',- foreground: 'hsl(var(--primary-foreground))'- },- secondary: {- DEFAULT: 'hsl(var(--secondary))',- foreground: 'hsl(var(--secondary-foreground))'- },- destructive: {- DEFAULT: 'hsl(var(--destructive))',- foreground: 'hsl(var(--destructive-foreground))'- },- muted: {- DEFAULT: 'hsl(var(--muted))',- foreground: 'hsl(var(--muted-foreground))'- },- accent: {- DEFAULT: 'hsl(var(--accent))',- foreground: 'hsl(var(--accent-foreground))'- },- popover: {- DEFAULT: 'hsl(var(--popover))',- foreground: 'hsl(var(--popover-foreground))'- },- card: {- DEFAULT: 'hsl(var(--card))',- foreground: 'hsl(var(--card-foreground))'- }- },- borderRadius: {- lg: 'var(--radius)',- md: 'calc(var(--radius) - 2px)',- sm: 'calc(var(--radius) - 4px)'- },- keyframes: {- 'accordion-down': {- from: { height: '0' },- to: { height: 'var(--radix-accordion-content-height)' }- },- 'accordion-up': {- from: { height: 'var(--radix-accordion-content-height)' },- to: { height: '0' }- }- },- animation: {- 'accordion-down': 'accordion-down 0.2s ease-out',- 'accordion-up': 'accordion-up 0.2s ease-out'- }- }- },- plugins: [require('tailwindcss-animate'), require('@tailwindcss/typography')]-}diff --git a/pipes/archive/vercel-ai-chatbot/tsconfig.json b/pipes/archive/vercel-ai-chatbot/tsconfig.jsondeleted file mode 100644index 9f91b9bae..000000000--- a/pipes/archive/vercel-ai-chatbot/tsconfig.json+++ /dev/null@@ -1,35 +0,0 @@-{- "compilerOptions": {- "lib": ["dom", "dom.iterable", "esnext"],- "allowJs": true,- "skipLibCheck": true,- "strict": true,- "forceConsistentCasingInFileNames": true,- "noEmit": true,- "incremental": true,- "esModuleInterop": true,- "module": "esnext",- "moduleResolution": "node",- "resolveJsonModule": true,- "isolatedModules": true,- "jsx": "preserve",- "baseUrl": ".",- "paths": {- "@/*": ["./*"]- },- "plugins": [- {- "name": "next"- }- ],- "strictNullChecks": true- },- "include": [- "next-env.d.ts",- "next-auth.d.ts",- "**/*.ts",- "**/*.tsx",- ".next/types/**/*.ts"- ],- "exclude": ["node_modules"]-}diff --git a/pipes/pipe-email-exa-search/.gitignore b/pipes/pipe-email-exa-search/.gitignoredeleted file mode 100644index 9b1ee42e8..000000000--- a/pipes/pipe-email-exa-search/.gitignore+++ /dev/null@@ -1,175 +0,0 @@-# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore--# Logs--logs-_.log-npm-debug.log_-yarn-debug.log*-yarn-error.log*-lerna-debug.log*-.pnpm-debug.log*--# Caches--.cache--# Diagnostic reports (https://nodejs.org/api/report.html)--report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json--# Runtime data--pids-_.pid-_.seed-*.pid.lock--# Directory for instrumented libs generated by jscoverage/JSCover--lib-cov--# Coverage directory used by tools like istanbul--coverage-*.lcov--# nyc test coverage--.nyc_output--# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)--.grunt--# Bower dependency directory (https://bower.io/)--bower_components--# node-waf configuration--.lock-wscript--# Compiled binary addons (https://nodejs.org/api/addons.html)--build/Release--# Dependency directories--node_modules/-jspm_packages/--# Snowpack dependency directory (https://snowpack.dev/)--web_modules/--# TypeScript cache--*.tsbuildinfo--# Optional npm cache directory--.npm--# Optional eslint cache--.eslintcache--# Optional stylelint cache--.stylelintcache--# Microbundle cache--.rpt2_cache/-.rts2_cache_cjs/-.rts2_cache_es/-.rts2_cache_umd/--# Optional REPL history--.node_repl_history--# Output of 'npm pack'--*.tgz--# Yarn Integrity file--.yarn-integrity--# dotenv environment variable files--.env-.env.development.local-.env.test.local-.env.production.local-.env.local--# parcel-bundler cache (https://parceljs.org/)--.parcel-cache--# Next.js build output--.next-out--# Nuxt.js build / generate output--.nuxt-dist--# Gatsby files--# Comment in the public line in if your project uses Gatsby and not Next.js--# https://nextjs.org/blog/next-9-1#public-directory-support--# public--# vuepress build output--.vuepress/dist--# vuepress v2.x temp and cache directory--.temp--# Docusaurus cache and generated files--.docusaurus--# Serverless directories--.serverless/--# FuseBox cache--.fusebox/--# DynamoDB Local files--.dynamodb/--# TernJS port file--.tern-port--# Stores VSCode versions used for testing VSCode extensions--.vscode-test--# yarn v2--.yarn/cache-.yarn/unplugged-.yarn/build-state.yml-.yarn/install-state.gz-.pnp.*--# IntelliJ based IDEs-.idea--# Finder (MacOS) folder config-.DS_Storediff --git a/pipes/pipe-email-exa-search/README.md b/pipes/pipe-email-exa-search/README.mddeleted file mode 100644index 89accd320..000000000--- a/pipes/pipe-email-exa-search/README.md+++ /dev/null@@ -1,91 +0,0 @@-## pipe-email-exa-search--email exa search analyzes your daily screen activity, extracts your interests, and uses exa.ai to find relevant content. it then emails you a curated list of 25 top results, keeping you informed about topics that matter to you.--easily discover new content related to your daily interests and stay up-to-date with minimal effort.--warning: there is potential for data leak to exa ai--#### quick setup-1. run ollama:- ```- ollama run llama3.2:3b-instruct-q4_K_M- ```-2. [create app specific password](https://support.google.com/accounts/answer/185833?hl=en) in your google account that will be used to send yourself emails-3. [get exa.ai API key](https://exa.ai/)-4. configure pipe in the app ui, save, enable, restart screenpipe recording--#### advanced-tech details? check `pipe.ts`.-can be used through CLI also, you can tweak the `pipe.json` to your needs, mine looks like this:--```json-{- "fields": [- {- "name": "emailTime",- "type": "time",- "default": "22:00",- "description": "Time to send daily summary email"- },- {- "name": "emailAddress",- "type": "string",- "default": "",- "description": "Email address to send the daily summary to",- "value": "[email protected]"- },- {- "name": "emailPassword",- "type": "string",- "default": "",- "description": "App specific password for your gmail account, https://support.google.com/accounts/answer/185833?hl=en",- "value": "your-app-specific-password"- },- {- "name": "exaApiKey",- "type": "string",- "default": "",- "description": "Exa Api key, you can get one for free at https://exa.ai/",- "value": "your-exa-api-key"- },- {- "name": "ollamaApiUrl",- "type": "string",- "default": "http://localhost:11434/api",- "description": "AI API URL, can be ollama, openai, any openai compatible API, risky to use cloud providers due to high usage"- },- {- "name": "ollamaModel",- "type": "string",- "default": "llama3.2:3b-instruct-q4_K_M",- "description": "AI Model"- },- {- "name": "pageSize",- "type": "number",- "default": 100,- "description": "Number of records to retrieve from screenpipe per page for structured extraction, keep in mind LLMs have a context window limit. Increase this value if using audio."- },- {- "name": "topicQueryCount",- "type" : "number",- "default" : 10,- "description" : "Number of random pages to pull from screenpipe for sub-summarization. The total records used will be pageSize times topicQueryCount"- },- {- "name": "windowName",- "type": "window",- "default": "",- "description": "Specific window name to filter the screen data, for example 'gmail', 'john', 'slack', 'myCodeFile.tsx', etc. this will filter out audio"- },- {- "name": "contentType",- "type": "contentType",- "default": "ocr",- "description": "Type of content to analyze: 'ocr', 'audio', or 'all'. OCR usually contains more content, so it's recommended to choose either OCR or audio rather than 'all' for better performance."- }- ],- "source": "https://github.com/mediar-ai/screenpipe/tree/main/pipes/pipe-email-exa-search",- "enabled": true-}diff --git a/pipes/pipe-email-exa-search/package.json b/pipes/pipe-email-exa-search/package.jsondeleted file mode 100644index 723a4aa65..000000000--- a/pipes/pipe-email-exa-search/package.json+++ /dev/null@@ -1,21 +0,0 @@-{- "name": "pipe-email-exa-search",- "module": "pipe.ts",- "type": "module",- "devDependencies": {- "@types/bun": "latest",- "@types/nodemailer": "^6.4.17"- },- "peerDependencies": {- "typescript": "^5.0.0"- },- "dependencies": {- "@screenpipe/js": "^1.0.0",- "@screenpipe/browser": "0.1.12",- "ai": "^4.0.10",- "exa-js": "^1.3.3",- "nodemailer": "^6.9.16",- "ollama-ai-provider": "^1.0.0",- "zod": "^3.23.8"- }-}diff --git a/pipes/pipe-email-exa-search/pipe.json b/pipes/pipe-email-exa-search/pipe.jsondeleted file mode 100644index f2a43af1e..000000000--- a/pipes/pipe-email-exa-search/pipe.json+++ /dev/null@@ -1,64 +0,0 @@-{- "fields": [- {- "name": "emailTime",- "type": "time",- "default": "22:00",- "description": "Time to send daily summary email"- },- {- "name": "emailAddress",- "type": "string",- "default": "",- "description": "Email address to send the daily summary to"- },- {- "name": "emailPassword",- "type": "string",- "default": "",- "description": "App specific password for your gmail account, https://support.google.com/accounts/answer/185833?hl=en"- },- {- "name": "exaApiKey",- "type": "string",- "default": "",- "description": "Exa Api key, you can get one for free at https://exa.ai/"- },- {- "name": "ollamaApiUrl",- "type": "string",- "default": "http://localhost:11434/api",- "description": "AI API URL, can be ollama, openai, any openai compatible API, risky to use cloud providers due to high usage"- },- {- "name": "ollamaModel",- "type": "string",- "default": "llama3.2:3b-instruct-q4_K_M",- "description": "AI Model"- },- {- "name": "pageSize",- "type": "number",- "default": 100,- "description": "Number of records to retrieve from screenpipe per page for structured extraction, keep in mind LLMs have a context window limit. Increase this value if using audio."- },- {- "name": "topicQueryCount",- "type" : "number",- "default" : 10,- "description" : "Number of random pages to pull from screenpipe for sub-summarization. The total records used will be pageSize times topicQueryCount"- },- {- "name": "windowName",- "type": "window",- "default": "",- "description": "Specific window name to filter the screen data, for example 'gmail', 'john', 'slack', 'myCodeFile.tsx', etc. this will filter out audio"- },- {- "name": "contentType",- "type": "contentType",- "default": "ocr",- "description": "Type of content to analyze: 'ocr', 'audio', or 'all'. OCR usually contains more content, so it's recommended to choose either OCR or audio rather than 'all' for better performance."- }- ]-}\ No newline at end of filediff --git a/pipes/pipe-email-exa-search/pipe.ts b/pipes/pipe-email-exa-search/pipe.tsdeleted file mode 100644index 2fbc24245..000000000--- a/pipes/pipe-email-exa-search/pipe.ts+++ /dev/null@@ -1,289 +0,0 @@-import * as fs from "node:fs";-import nodemailer from "nodemailer";-import { type ContentItem, pipe } from "@screenpipe/js";-import process from "node:process";-import Exa from "exa-js"-import { z } from "zod";-import { generateObject } from "ai";-import { createOllama } from "ollama-ai-provider";--const screenTopicQuery = z.object({- query: z.string(),- quality: z.number()-});--const finalSummaryQuery = z.object({- summary_query: z.string(),- quality: z.number()-});--function getRandomOffsets(total: number, count: number): number[] {- const offsets = new Set<number>();- while (offsets.size < count) {- offsets.add(Math.floor(Math.random() * total));- }- return Array.from(offsets);-}--async function sendEmail(- to: string,- password: string,- subject: string,- body: string-): Promise<void> {- // Create a transporter using SMTP- const transporter = nodemailer.createTransport({- host: "smtp.gmail.com", // Replace with your SMTP server- port: 587,- secure: false, // Use TLS- auth: {- user: to, // assuming the sender is the same as the recipient- pass: password,- },- });-- // Send mail with defined transport object- const info = await transporter.sendMail({- from: to, // sender address- to: to, // list of receivers- subject: subject, // Subject line- html: body, // plain text body- });-- if (!info) {- throw new Error("failed to send email");- }- console.log(`email sent to ${to} with subject: ${subject}`);-}--async function generateScreenTopicQuery(- screenData: ContentItem[],- ollamaModel: string,- ollamaApiUrl: string-): Promise<z.infer<typeof screenTopicQuery>> {- const prompt = `- You are an assistant who generates search queries for an embedding search database to help a user find content of interest.-- Below is content that has been on the user's screen recently:-- ${JSON.stringify(screenData)}-- Task:- - Analyze the content above.- - Identify the main themes and topics.- - Generate a single, concise sentence that summarizes the user's interests.- - Include as many relevant keywords and concepts from the content as possible.- - The sentence should be suitable as a search query for finding similar content.-- Return a JSON object with the following structure:- {- "query": "sentence for querying the embedding search database",- "highlights": "Quick list of highlights used to generate the query",- "quality": "float between 0 and 1 estimating the quality of the generated query for finding content of interest"- }-- Rules:- - Do not add backticks to the JSON eg \`\`\`json\`\`\` is WRONG- - DO NOT RETURN ANYTHING BUT JSON. NO COMMENTS BELOW THE JSON.- `;-- const provider = createOllama({- baseURL: ollamaApiUrl,- });-- const response = await generateObject({- model: provider(ollamaModel),- messages: [{ role: "user", content: prompt }],- schema: screenTopicQuery,- });-- console.log("ai response", response);-- return response.object-}--async function generateScreenTopicSummaryQuery(- topicQueries: string[],- ollamaModel: string,- ollamaApiUrl: string-): Promise<z.infer<typeof finalSummaryQuery>> {- const prompt = `- You are an assistant who helps summarize multiple topic queries.-- Below are topic queries generated from recent screen content:-- ${JSON.stringify(topicQueries)}-- Task:- - Summarize these queries into a single comprehensive query that reflects the overall themes and topics.- - Include as many relevant keywords and concepts as possible.- - The sentence should be suitable as a search query for finding similar content.-- Return a JSON object with the following structure:- {- "summary_query": "summarized query for searching the database",- "quality": "float between 0 and 1 estimating the quality of the summarized query"- }-- Rules:- - Do not add backticks to the JSON eg \`\`\`json\`\`\` is WRONG- - DO NOT RETURN ANYTHING BUT JSON. NO COMMENTS BELOW THE JSON.- `;-- const provider = createOllama({- baseURL: ollamaApiUrl,- });-- const response = await generateObject({- model: provider(ollamaModel),- messages: [{ role: "user", content: prompt }],- schema: finalSummaryQuery,- });-- console.log("ai response", response);-- return response.object-}--function formatExaResultsForEmail(results: any[]): string {- return results.map((result, index) => `- <h2>${result.title}</h2>- <p><strong>Author(s):</strong> ${result.author}</p>- <p><strong>Published Date:</strong> ${new Date(result.publishedDate).toDateString()}</p>- <p><strong>Link:</strong> <a href="${result.url}">${result.url}</a></p>- <p><strong>Summary:</strong></p>- <blockquote>${result.summary.substring(0, 500)}</blockquote>- <p><strong>Relevance Score:</strong> ${result.score.toFixed(2)}</p>- <hr/>- `).join('');-}--async function exaSearchPipeline(): Promise<void> {- console.log("starting exa search pipeline");-- const config = await pipe.loadPipeConfig();- console.log("loaded config:", JSON.stringify(config, null, 2));-- const emailTime = config.emailTime;- const emailAddress = config.emailAddress;- const emailPassword = config.emailPassword;- const ollamaModel = config.ollamaModel;- const ollamaApiUrl = config.ollamaApiUrl;- const windowName = config.windowName || "";- const pageSize = config.pageSize;- const contentType = config.contentType || "ocr"; // Default to 'ocr' if not specified- const topicQueryCount = config.topicQueryCount || 10;- const exaApiKey = config.exaApiKey-- const logsDir = `${process.env.PIPE_DIR}/logs`;- try {- fs.mkdirSync(logsDir);- } catch (_error) {- console.warn("failed to create logs dir, probably already exists");- }-- let lastEmailSent = new Date(0); // Initialize to a past date-- // send a welcome email to announce what will happen, when it will happen, and what it will do- const welcomeEmail = `- Welcome to the exa search pipeline!-- This pipe will send you recommended exa content based on your screen data.-- It will run at ${emailTime} every day.-- Search query:- `;- await sendEmail(- emailAddress,- emailPassword,- "Exa Search Pipeline",- welcomeEmail- );-- const [emailHour, emailMinute] = emailTime.split(":").map(Number);-- while (true) {- try {- const now = new Date();- let shouldRunSearch = false;-- const emailTimeToday = new Date(- now.getFullYear(),- now.getMonth(),- now.getDate(),- emailHour,- emailMinute,- );- shouldRunSearch =- now >= emailTimeToday &&- now.getTime() - lastEmailSent.getTime() > 24 * 60 * 60 * 1000;-- if (shouldRunSearch){- const oneDayAgo = new Date(now.getTime() - 24 * 60 * 60 * 1000);- const screenData = await pipe.queryScreenpipe({- start_time: oneDayAgo.toISOString(),- end_time: now.toISOString(),- window_name: windowName,- limit: pageSize,- content_type: contentType,- });-- if (screenData && screenData.data && screenData.data.length > 0) {- const randomOffsets = getRandomOffsets(screenData.data.length, topicQueryCount);-- const topicQueries = [];- for (const offset of randomOffsets) {- const pageData = screenData.data.slice(offset, offset + pageSize); // Extract section of data- const topicQuery: z.infer<typeof screenTopicQuery> = await generateScreenTopicQuery(pageData, ollamaModel, ollamaApiUrl);- topicQueries.push(topicQuery.query);- }- const finalSummary = await generateScreenTopicSummaryQuery(topicQueries, ollamaModel, ollamaApiUrl)-- // Perform exa searchs- const exa = new Exa(exaApiKey)-- const exaResult = await exa.searchAndContents(- finalSummary.summary_query,- {- type: "neural",- useAutoprompt: true,- numResults: 25,- text: true,- summary: true- }- )-- console.log("First exa results", exaResult.results[0])- const cleanedExaResults = formatExaResultsForEmail(exaResult.results)-- const sumEmail = `- <h1>Exa Search Pipeline Results</h1>- <h2>Exa Query</h2>- <p><strong>Query:</strong> ${finalSummary.summary_query}</p>-- <h2>Exa Results</h2>- <div>${cleanedExaResults}</div>- `;- await sendEmail(- emailAddress,- emailPassword,- "Exa Search Pipeline Results",- sumEmail- );- await pipe.inbox.send({- title: "Exa Search Results",- body: finalSummary.summary_query,- });- lastEmailSent = now;- }- }- } catch (error) {- console.warn("error in exa search pipeline:", error);- }- await new Promise((resolve) => setTimeout(resolve, 600000));- }-}--console.log(`Starting Exa Search Pipeline`);-exaSearchPipeline();diff --git a/pipes/pipe-email-exa-search/tsconfig.json b/pipes/pipe-email-exa-search/tsconfig.jsondeleted file mode 100644index 238655f2c..000000000--- a/pipes/pipe-email-exa-search/tsconfig.json+++ /dev/null@@ -1,27 +0,0 @@-{- "compilerOptions": {- // Enable latest features- "lib": ["ESNext", "DOM"],- "target": "ESNext",- "module": "ESNext",- "moduleDetection": "force",- "jsx": "react-jsx",- "allowJs": true,-- // Bundler mode- "moduleResolution": "bundler",- "allowImportingTsExtensions": true,- "verbatimModuleSyntax": true,- "noEmit": true,-- // Best practices- "strict": true,- "skipLibCheck": true,- "noFallthroughCasesInSwitch": true,-- // Some stricter flags (disabled by default)- "noUnusedLocals": false,- "noUnusedParameters": false,- "noPropertyAccessFromIndexSignature": false- }-}diff --git a/pipes/pipe-notion-table-logs/.gitignore b/pipes/pipe-notion-table-logs/.gitignoredeleted file mode 100644index 9b1ee42e8..000000000--- a/pipes/pipe-notion-table-logs/.gitignore+++ /dev/null@@ -1,175 +0,0 @@-# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore--# Logs--logs-_.log-npm-debug.log_-yarn-debug.log*-yarn-error.log*-lerna-debug.log*-.pnpm-debug.log*--# Caches--.cache--# Diagnostic reports (https://nodejs.org/api/report.html)--report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json--# Runtime data--pids-_.pid-_.seed-*.pid.lock--# Directory for instrumented libs generated by jscoverage/JSCover--lib-cov--# Coverage directory used by tools like istanbul--coverage-*.lcov--# nyc test coverage--.nyc_output--# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)--.grunt--# Bower dependency directory (https://bower.io/)--bower_components--# node-waf configuration--.lock-wscript--# Compiled binary addons (https://nodejs.org/api/addons.html)--build/Release--# Dependency directories--node_modules/-jspm_packages/--# Snowpack dependency directory (https://snowpack.dev/)--web_modules/--# TypeScript cache--*.tsbuildinfo--# Optional npm cache directory--.npm--# Optional eslint cache--.eslintcache--# Optional stylelint cache--.stylelintcache--# Microbundle cache--.rpt2_cache/-.rts2_cache_cjs/-.rts2_cache_es/-.rts2_cache_umd/--# Optional REPL history--.node_repl_history--# Output of 'npm pack'--*.tgz--# Yarn Integrity file--.yarn-integrity--# dotenv environment variable files--.env-.env.development.local-.env.test.local-.env.production.local-.env.local--# parcel-bundler cache (https://parceljs.org/)--.parcel-cache--# Next.js build output--.next-out--# Nuxt.js build / generate output--.nuxt-dist--# Gatsby files--# Comment in the public line in if your project uses Gatsby and not Next.js--# https://nextjs.org/blog/next-9-1#public-directory-support--# public--# vuepress build output--.vuepress/dist--# vuepress v2.x temp and cache directory--.temp--# Docusaurus cache and generated files--.docusaurus--# Serverless directories--.serverless/--# FuseBox cache--.fusebox/--# DynamoDB Local files--.dynamodb/--# TernJS port file--.tern-port--# Stores VSCode versions used for testing VSCode extensions--.vscode-test--# yarn v2--.yarn/cache-.yarn/unplugged-.yarn/build-state.yml-.yarn/install-state.gz-.pnp.*--# IntelliJ based IDEs-.idea--# Finder (MacOS) folder config-.DS_Storediff --git a/pipes/pipe-notion-table-logs/README.md b/pipes/pipe-notion-table-logs/README.mddeleted file mode 100644index 0d95bc9f7..000000000--- a/pipes/pipe-notion-table-logs/README.md+++ /dev/null@@ -1,28 +0,0 @@-### pipe notion table logs-----automates logging of work to notion using screenpipe and ai.--#### quick setup--1. run ollama:- ```- ollama run phi3.5:3.8b-mini-instruct-q4_K_M- ```--2. set up notion:- - create integration: https://www.notion.so/my-integrations (copy api key)- - make database with: Title, Description (rich text), Tags (multi-select), Date- - share database with your integration (click three dots, connections, your integration), open database in full screen mode, copy the database id e.g. https://www.notion.so/some-database-id?v=some-database-version-id--3. configure pipe in the app ui, save, enable, restart screenpipe recording--<img width="1312" alt="Screenshot 2024-09-25 at 10 28 38" src="https://github.com/user-attachments/assets/08c79b70-dc85-45e8-bc59-eec6c7d58422">--boom! it'll log your work to notion every minute.--wanna tweak it? check `pipe.ts` to change frequency or adjust the ai prompt.--(can be used through CLI also)diff --git a/pipes/pipe-notion-table-logs/package.json b/pipes/pipe-notion-table-logs/package.jsondeleted file mode 100644index da6f124ff..000000000--- a/pipes/pipe-notion-table-logs/package.json+++ /dev/null@@ -1,19 +0,0 @@-{- "name": "pipe-notion-table-logs",- "module": "pipe.ts",- "type": "module",- "devDependencies": {- "@types/bun": "latest"- },- "peerDependencies": {- "typescript": "^5.0.0"- },- "dependencies": {- "@notionhq/client": "^2.2.15",- "@screenpipe/js": "^1.0.0",- "@screenpipe/browser": "0.1.12",- "ai": "^4.0.10",- "ollama-ai-provider": "^1.0.0",- "zod": "^3.23.8"- }-}diff --git a/pipes/pipe-notion-table-logs/pipe.json b/pipes/pipe-notion-table-logs/pipe.jsondeleted file mode 100644index 11f7f6cc7..000000000--- a/pipes/pipe-notion-table-logs/pipe.json+++ /dev/null@@ -1,40 +0,0 @@-{- "fields": [- {- "name": "interval",- "type": "number",- "default": 60,- "description": "Interval in seconds to stream data"- },- {- "name": "notionApiKey",- "type": "string",- "default": "<fill your notion api key here>",- "description": "notion api key for authentication https://www.notion.so/my-integrations"- },- {- "name": "notionDatabaseId",- "type": "string",- "default": "<fill your notion database id here>",- "description": "id of the notion database to sync conversations to eg https://www.notion.so/your-workspace/database-id?v=..."- },- {- "name": "ollamaApiUrl",- "type": "string",- "default": "http://localhost:11434/api",- "description": "Ollama API URL"- },- {- "name": "ollamaModel",- "type": "string",- "default": "llama3.2:3b-instruct-q4_K_M",- "description": "Ollama Model"- },- {- "name": "pageSize",- "type": "number",- "default": 100,- "description": "Number of records to retrieve from Screenpipe per page"- }- ]-}\ No newline at end of filediff --git a/pipes/pipe-notion-table-logs/pipe.ts b/pipes/pipe-notion-table-logs/pipe.tsdeleted file mode 100644index d9b78fa2a..000000000--- a/pipes/pipe-notion-table-logs/pipe.ts+++ /dev/null@@ -1,177 +0,0 @@-import { Client } from "@notionhq/client";-import { z } from "zod";-import { generateObject } from "ai";-import { createOllama } from "ollama-ai-provider";-import { pipe, type ContentItem } from "@screenpipe/js";--const engineeringLog = z.object({- title: z.string(),- description: z.string(),- tags: z.array(z.string()),-});--type EngineeringLog = z.infer<typeof engineeringLog>;--async function generateEngineeringLog(- screenData: ContentItem[],- ollamaModel: string,- ollamaApiUrl: string-): Promise<EngineeringLog> {- const prompt = `Based on the following screen data, generate a concise engineering log entry:-- ${JSON.stringify(screenData)}-- Focus only on engineering work. Ignore non-work related activities.- Return a JSON object with the following structure:- {- "title": "Brief title of the engineering task",- "description": "Concise description of the engineering work done",- "tags": ["tag1", "tag2", "tag3"]- }- Provide 1-3 relevant tags related to the engineering work.`;-- const provider = createOllama({ baseURL: ollamaApiUrl });-- const response = await generateObject({- model: provider(ollamaModel),- messages: [{ role: "user", content: prompt }],- schema: engineeringLog,- });-- console.log("ai answer:", response);-- return response.object;-}--async function syncLogToNotion(- logEntry: EngineeringLog,- notion: Client,- databaseId: string-): Promise<void> {- try {- console.log("syncLogToNotion", logEntry);- await notion.pages.create({- parent: { database_id: databaseId },- properties: {- Title: { title: [{ text: { content: logEntry.title } }] },- Description: {- rich_text: [{ text: { content: logEntry.description } }],- },- Tags: { multi_select: logEntry.tags.map((tag) => ({ name: tag })) },- Date: { date: { start: new Date().toISOString() } },- },- });-- console.log("engineering log synced to notion successfully");-- // Create markdown table for inbox- const markdownTable = `-| Title | Description | Tags |-|-------|-------------|------|-| ${logEntry.title} | ${logEntry.description} | ${logEntry.tags.join(", ")} |- `.trim();-- await pipe.inbox.send({- title: "engineering log synced",- body: `new engineering log entry:\n\n${markdownTable}`,- });- } catch (error) {- console.error("error syncing engineering log to notion:", error);- await pipe.inbox.send({- title: "engineering log error",- body: `error syncing engineering log to notion: ${error}`,- });- }-}--function streamEngineeringLogsToNotion(): void {- console.log("starting engineering logs stream to notion");-- const config = pipe.loadPipeConfig();- console.log("loaded config:", JSON.stringify(config, null, 2));-- const interval = config.interval * 1000;- const databaseId = config.notionDatabaseId;- const apiKey = config.notionApiKey;- const ollamaApiUrl = config.ollamaApiUrl;- const ollamaModel = config.ollamaModel;-- const notion = new Client({ auth: apiKey });-- pipe.inbox.send({- title: "engineering log stream started",- body: `monitoring engineering work every ${config.interval} seconds`,- });-- pipe.scheduler- .task("generateEngineeringLog")- .every(interval)- .do(async () => {- try {- const now = new Date();- const oneHourAgo = new Date(now.getTime() - interval);-- const screenData = await pipe.queryScreenpipe({- startTime: oneHourAgo.toISOString(),- endTime: now.toISOString(),- limit: 50,- contentType: "ocr",- });-- if (screenData && screenData.data.length > 0) {- const logEntry = await generateEngineeringLog(- screenData.data,- ollamaModel,- ollamaApiUrl- );- await syncLogToNotion(logEntry, notion, databaseId);- } else {- console.log("no relevant engineering work detected in the last hour");- }- } catch (error) {- console.error("error in engineering log pipeline:", error);- await pipe.inbox.send({- title: "engineering log error",- body: `error in engineering log pipeline: ${error}`,- });- }- });-- pipe.scheduler.start();-}--streamEngineeringLogsToNotion();--/*--Instructions to run this pipe:--1. install screenpipe and git clone this repo- ```- git clone https://github.com/mediar-ai/screenpipe.git- cd screenpipe- ```--2. install and run ollama:- - follow instructions at https://github.com/jmorganca/ollama- - run `ollama run phi3.5:3.8b-mini-instruct-q4_K_M`--3. set up notion:- - create a notion integration: https://www.notion.so/my-integrations - copy the API key- - create a database with properties: Title (text), Description (text), Tags (multi-select), Date (date)- - share database with your integration - copy the database ID eg https://www.notion.so/<THIS>?<NOTTHIS>--4. set environment variables:- ```- export SCREENPIPE_NOTION_API_KEY=your_notion_api_key- export SCREENPIPE_NOTION_DATABASE_ID=your_notion_database_id- ```--5. run the pipe:- ```- screenpipe pipe download ./pipes/pipe-screen-to-crm- screenpipe pipe enable screen-to-crm- screenpipe- ```--*/diff --git a/pipes/pipe-notion-table-logs/tsconfig.json b/pipes/pipe-notion-table-logs/tsconfig.jsondeleted file mode 100644index 238655f2c..000000000--- a/pipes/pipe-notion-table-logs/tsconfig.json+++ /dev/null@@ -1,27 +0,0 @@-{- "compilerOptions": {- // Enable latest features- "lib": ["ESNext", "DOM"],- "target": "ESNext",- "module": "ESNext",- "moduleDetection": "force",- "jsx": "react-jsx",- "allowJs": true,-- // Bundler mode- "moduleResolution": "bundler",- "allowImportingTsExtensions": true,- "verbatimModuleSyntax": true,- "noEmit": true,-- // Best practices- "strict": true,- "skipLibCheck": true,- "noFallthroughCasesInSwitch": true,-- // Some stricter flags (disabled by default)- "noUnusedLocals": false,- "noUnusedParameters": false,- "noPropertyAccessFromIndexSignature": false- }-}diff --git a/pipes/pipe-post-questions-on-reddit/.gitignore b/pipes/pipe-post-questions-on-reddit/.gitignoredeleted file mode 100644index 9b1ee42e8..000000000--- a/pipes/pipe-post-questions-on-reddit/.gitignore+++ /dev/null@@ -1,175 +0,0 @@-# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore--# Logs--logs-_.log-npm-debug.log_-yarn-debug.log*-yarn-error.log*-lerna-debug.log*-.pnpm-debug.log*--# Caches--.cache--# Diagnostic reports (https://nodejs.org/api/report.html)--report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json--# Runtime data--pids-_.pid-_.seed-*.pid.lock--# Directory for instrumented libs generated by jscoverage/JSCover--lib-cov--# Coverage directory used by tools like istanbul--coverage-*.lcov--# nyc test coverage--.nyc_output--# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)--.grunt--# Bower dependency directory (https://bower.io/)--bower_components--# node-waf configuration--.lock-wscript--# Compiled binary addons (https://nodejs.org/api/addons.html)--build/Release--# Dependency directories--node_modules/-jspm_packages/--# Snowpack dependency directory (https://snowpack.dev/)--web_modules/--# TypeScript cache--*.tsbuildinfo--# Optional npm cache directory--.npm--# Optional eslint cache--.eslintcache--# Optional stylelint cache--.stylelintcache--# Microbundle cache--.rpt2_cache/-.rts2_cache_cjs/-.rts2_cache_es/-.rts2_cache_umd/--# Optional REPL history--.node_repl_history--# Output of 'npm pack'--*.tgz--# Yarn Integrity file--.yarn-integrity--# dotenv environment variable files--.env-.env.development.local-.env.test.local-.env.production.local-.env.local--# parcel-bundler cache (https://parceljs.org/)--.parcel-cache--# Next.js build output--.next-out--# Nuxt.js build / generate output--.nuxt-dist--# Gatsby files--# Comment in the public line in if your project uses Gatsby and not Next.js--# https://nextjs.org/blog/next-9-1#public-directory-support--# public--# vuepress build output--.vuepress/dist--# vuepress v2.x temp and cache directory--.temp--# Docusaurus cache and generated files--.docusaurus--# Serverless directories--.serverless/--# FuseBox cache--.fusebox/--# DynamoDB Local files--.dynamodb/--# TernJS port file--.tern-port--# Stores VSCode versions used for testing VSCode extensions--.vscode-test--# yarn v2--.yarn/cache-.yarn/unplugged-.yarn/build-state.yml-.yarn/install-state.gz-.pnp.*--# IntelliJ based IDEs-.idea--# Finder (MacOS) folder config-.DS_Storediff --git a/pipes/pipe-post-questions-on-reddit/README.md b/pipes/pipe-post-questions-on-reddit/README.mddeleted file mode 100644index f86f670da..000000000--- a/pipes/pipe-post-questions-on-reddit/README.md+++ /dev/null@@ -1,114 +0,0 @@-### pipe-post-questions-on-reddit--<img width="1312" alt="Screenshot 2024-10-12 at 14 09 01" src="https://github.com/user-attachments/assets/3e5abd07-0a3c-4c3b-8351-5107beb4fb10">---GPT-4o (or local model) looks at your screen 24/7 and sends you emails with questions to post on Reddit based on your activity.--Easily grow your followers, market your product, or be useful.--https://github.com/user-attachments/assets/289d1809-6855-4336-807f-dd9ee7181324----#### quick setup-1. [Get an OpenAI API key](https://platform.openai.com/account/api-keys)-2. [Create an app-specific password](https://support.google.com/accounts/answer/185833?hl=en) in your Google account that will be used to send yourself emails-3. Configure pipe in the app UI, save, enable, and restart screenpipe recording (you can configure to either receive an email daily or several every x hours)---#### Advanced-tech details? check `pipe.ts`.-can be used through CLI also, you can tweak the `pipe.json` to your needs, mine looks like this:--```json-{- "fields": [- {- "name": "interval",- "type": "number",- "default": 60,- "description": "Interval in seconds to read your screen data and extract structured logs (will be used to summarize and send an email). Increase this value if using audio."- },- {- "name": "summaryFrequency",- "type": "string",- "default": "daily",- "description": "Frequency of summary emails: 'daily' for once a day at emailTime, or 'hourly:X' for every X hours (e.g., 'hourly:4' for every 4 hours)",- "value": "hourly:1"- },- {- "name": "emailTime",- "type": "time",- "default": "11:00",- "description": "Time to send daily summary email (used only if summaryFrequency is 'daily')"- },- {- "name": "emailAddress",- "type": "string",- "default": "",- "description": "Email address to send the daily summary to",- "value": "[email protected]"- },- {- "name": "emailPassword",- "type": "string",- "default": "",- "description": "App specific password for your gmail account, https://support.google.com/accounts/answer/185833?hl=en",- "value": "your-app-specific-password"- },- {- "name": "gptApiUrl",- "type": "string",- "default": "https://api.openai.com/v1/chat/completions",- "description": "GPT API URL"- },- {- "name": "gptModel",- "type": "string",- "default": "gpt-4",- "description": "GPT Model"- },- {- "name": "openai_api_key",- "type": "string",- "default": "",- "description": "Your OpenAI API key",- "value": "your-openai-api-key"- },- {- "name": "pageSize",- "type": "number",- "default": 100,- "description": "Number of records to retrieve from screenpipe per page for structured extraction, keep in mind LLMs have a context window limit. Increase this value if using audio."- },- {- "name": "customPrompt",- "type": "string",- "default": "You are an AI assistant tasked with extracting structured information from screen data (OCR). Analyze the following screen data and extract relevant information about my daily activity.",- "description": "Custom prompt for the AI assistant that will be used to extract information from the screen data every few minutes"- },- {- "name": "summaryPrompt",- "type": "string",- "default": "You are an AI assistant tasked with summarizing information that has previously been extracted from screen data (OCR) by another AI assistant. Analyze the following structured data extracted from my screen data and summarize my daily activity, this will be send as a mail to my email address.",- "description": "Summary prompt for the AI assistant that will be used to summarize the logs previously extracted and send a mail"- },- {- "name": "windowName",- "type": "window",- "default": "",- "description": "Specific window name to filter the screen data, for example 'gmail', 'john', 'slack', 'myCodeFile.tsx', etc. this will filter out audio",- "value": "reddit"- },- {- "name": "contentType",- "type": "contentType",- "default": "ocr",- "description": "Type of content to analyze: 'ocr', 'audio', or 'all'. OCR usually contains more content, so it's recommended to choose either OCR or audio rather than 'all' for better performance."- }- ],- "source": "https://github.com/mediar-ai/screenpipe/tree/main/pipes/pipe-post-questions-on-reddit",- "enabled": true-}-```diff --git a/pipes/pipe-post-questions-on-reddit/package.json b/pipes/pipe-post-questions-on-reddit/package.jsondeleted file mode 100644index 915fa7e2e..000000000--- a/pipes/pipe-post-questions-on-reddit/package.json+++ /dev/null@@ -1,17 +0,0 @@-{- "name": "pipe-post-questions-on-reddit",- "module": "pipe.ts",- "type": "module",- "devDependencies": {- "@types/bun": "latest",- "@types/nodemailer": "^6.4.17"- },- "peerDependencies": {- "typescript": "^5.0.0"- },- "dependencies": {- "@screenpipe/js": "^1.0.0",- "@screenpipe/browser": "0.1.12",- "nodemailer": "^6.9.16"- }-}diff --git a/pipes/pipe-post-questions-on-reddit/pipe.json b/pipes/pipe-post-questions-on-reddit/pipe.jsondeleted file mode 100644index ca92f6372..000000000--- a/pipes/pipe-post-questions-on-reddit/pipe.json+++ /dev/null@@ -1,82 +0,0 @@-{- "fields": [- {- "name": "interval",- "type": "number",- "default": 60,- "description": "Interval in seconds to read your screen data and extract structured logs (will be used to summarize and send an email). Increase this value if using audio."- },- {- "name": "summaryFrequency",- "type": "string",- "default": "daily",- "description": "Frequency of summary emails: 'daily' for once a day at emailTime, or 'hourly:X' for every X hours (e.g., 'hourly:4' for every 4 hours)"- },- {- "name": "emailTime",- "type": "time",- "default": "11:00",- "description": "Time to send daily summary email (used only if summaryFrequency is 'daily')"- },- {- "name": "emailAddress",- "type": "string",- "default": "",- "description": "Email address to send the daily summary to"- },- {- "name": "emailPassword",- "type": "string",- "default": "",- "description": "App specific password for your gmail account, https://support.google.com/accounts/answer/185833?hl=en"- },- {- "name": "gptApiUrl",- "type": "string",- "default": "https://api.openai.com/v1/chat/completions",- "description": "openai-compatible API URL"- },- {- "name": "gptModel",- "type": "string",- "default": "gpt-4o",- "description": "AI Model name"- },- {- "name": "openaiApiKey",- "type": "string",- "default": "",- "description": "Your OpenAI API key"- },- {- "name": "pageSize",- "type": "number",- "default": 100,- "description": "Number of records to retrieve from screenpipe per page for structured extraction, keep in mind LLMs have a context window limit. Increase this value if using audio."- },- {- "name": "dailylogPrompt",- "type": "string",- "default": "",- "description": "additional prompt for the AI assistant that will be used to extract information from the screen data every specified amount of minutes"- },- {- "name": "customPrompt",- "type": "string",- "default": "",- "description": "additional prompt for the AI assistant that will be used to generate a list of questions to post on reddit based on the logs previously extracted"- },- {- "name": "windowName",- "type": "window",- "default": "",- "description": "Specific window name to filter the screen data, for example 'gmail', 'john', 'slack', 'myCodeFile.tsx', etc. this will filter out audio"- },- {- "name": "contentType",- "type": "contentType",- "default": "all",- "description": "Type of content to analyze: 'ocr', 'audio', or 'all'. OCR usually contains more content, so it's recommended to choose either OCR or audio rather than 'all' for better performance."- }- ]-}\ No newline at end of filediff --git a/pipes/pipe-post-questions-on-reddit/pipe.ts b/pipes/pipe-post-questions-on-reddit/pipe.tsdeleted file mode 100644index 112ab94e7..000000000--- a/pipes/pipe-post-questions-on-reddit/pipe.ts+++ /dev/null@@ -1,376 +0,0 @@-import * as fs from "node:fs";-import nodemailer from "nodemailer";-import {- type ContentItem,- pipe,-} from "@screenpipe/js";-import process from "node:process";--interface DailyLog {- activity: string;- category: string;- tags: string[];- timestamp: string;-}--async function generateDailyLog(- screenData: ContentItem[],- dailylogPrompt: string,- gptModel: string,- gptApiUrl: string,- openaiApiKey: string-): Promise<DailyLog> {- const prompt = `${dailylogPrompt}-- Based on the following screen data, generate a concise daily log entry:-- ${JSON.stringify(screenData)}-- Return a JSON object with the following structure:- {- "activity": "Brief description of the activity",- "category": "Category of the activity like work, email, slack, etc"- "tags": ["productivity", "work", "email", "john", "salesforce", "etc"]- }--- Rules:- - Do not add backticks to the JSON eg \`\`\`json\`\`\` is WRONG- - DO NOT RETURN ANYTHING BUT JSON. NO COMMENTS BELOW THE JSON.-- `;-- const response = await fetch(gptApiUrl, {- method: "POST",- headers: {- "Content-Type": "application/json",- Authorization: `Bearer ${openaiApiKey}`,- },- body: JSON.stringify({- model: gptModel,- messages: [{ role: "user", content: prompt }],- response_format: { type: "json_object" },- }),- });-- if (!response.ok) {- console.log("gpt response:", await response.text());- throw new Error(`http error! status: ${response.status}`);- }-- const result = await response.json();-- console.log("ai answer:", result);- // clean up the result- const cleanedResult = result.choices[0].message.content- .trim()- .replace(/^```(?:json)?\s*|\s*```$/g, "") // remove start and end code block markers- .replace(/\n/g, "") // remove newlines- .replace(/\\n/g, "") // remove escaped newlines- .trim(); // trim any remaining whitespace-- let content;- try {- content = JSON.parse(cleanedResult);- } catch (error) {- console.warn("failed to parse ai response:", error);- console.warn("cleaned result:", cleanedResult);- throw new Error("invalid ai response format");- }-- return content;-}--function saveDailyLog(logEntry: DailyLog): void {- console.log("creating logs dir");- const logsDir = `${process.env.PIPE_DIR}/logs`;- console.log("logs dir:", logsDir);- console.log("saving log entry:", logEntry);- console.log("logs dir:", logsDir);- const timestamp = new Date()- .toISOString()- .replace(/:/g, "-")- .replace(/\..+/, "");- const filename = `${timestamp}-${logEntry.category.replace("/", "-")}.json`;- console.log("filename:", filename);- fs.writeFileSync(`${logsDir}/${filename}`, JSON.stringify(logEntry, null, 2));-}--function generateRedditLinks(content: string): string {- const posts = content.split(/\[\d+\]/g).filter(Boolean);- let result = "";-- posts.forEach((post, index) => {- const titleMatch = post.match(/\[TITLE\](.*?)\[\/TITLE\]/s);- const bodyMatch = post.match(/\[BODY\](.*?)\[\/BODY\]/s);- const subredditsMatch = post.match(/\[r\/.*?\]/g);-- if (titleMatch && bodyMatch && subredditsMatch) {- const title = titleMatch[1].trim();- const body = bodyMatch[1].trim();-- // Truncate title and body if they're too long- const maxTitleLength = 300; // Reddit's title limit- const maxBodyLength = 40000; // Reddit's body limit- const truncatedTitle = title.length > maxTitleLength- ? title.slice(0, maxTitleLength - 3) + "..."- : title;- const truncatedBody = body.length > maxBodyLength- ? body.slice(0, maxBodyLength - 3) + "..."- : body;-- const encodedTitle = encodeURIComponent(truncatedTitle);- const encodedBody = encodeURIComponent(`${truncatedTitle}\n\n${truncatedBody}`);-- result += `### ${index + 1}. ${title}\n\n${body}\n\n`;-- subredditsMatch.forEach((subreddit) => {- const subredditName = subreddit.slice(2, -1);- // Use a shorter URL format and handle potential URL length issues- try {- const link = `https://www.reddit.com/r/${subredditName}/submit?title=${encodedTitle}&text=${encodedBody}`;- result += `- ${subreddit} [SEND](${link})\n`;- } catch (error) {- console.warn(`failed to generate link for post ${index + 1} in r/${subredditName}:`, error);- result += `- ${subreddit} [POST TOO LONG - COPY MANUALLY]\n`;- }- });-- result += "\n";- }- });-- return result.trim();-}--async function generateRedditQuestions(- screenData: ContentItem[],- customPrompt: string,- gptModel: string,- gptApiUrl: string,- openaiApiKey: string-): Promise<string> {- const prompt = `${customPrompt}-- based on the following screen data, generate a list of questions i can ask the reddit community:-- ${JSON.stringify(screenData)}-- rules:- - be specific and concise- - return a list of posts, one level bullet list- - keep the tone casual like you are chatting to friends- - you can mention some context from the screen data 30% of the time, but don't mention very personal data- - the list should be enumerated with square brackets like [1], [2], ...- - each post starts with [TITLE] ... [/TITLE], then [BODY] ... [/BODY],- - at the end of each post add a list of subreddits to post it in enumerated as [r/...], [r/....], [r/....], ...- - at the end of each subreddit add "[SEND]"- `;-- console.log("reddit questions prompt:", prompt);- const response = await fetch(gptApiUrl, {- method: "POST",- headers: {- "Content-Type": "application/json",- Authorization: `Bearer ${openaiApiKey}`,- },- body: JSON.stringify({- model: gptModel,- messages: [{ role: "user", content: prompt }],- }),- });- console.log("reddit questions gpt response:", response);-- if (!response.ok) {- console.log("gpt response:", await response.text());- throw new Error(`http error! status: ${response.status}`);- }-- const result = await response.json();-- console.log("ai reddit questions:", result);-- const content = result.choices[0].message.content;- return generateRedditLinks(content);-}--async function sendEmail(- to: string,- password: string,- subject: string,- body: string-): Promise<void> {- // Create a transporter using SMTP- const transporter = nodemailer.createTransport({- host: "smtp.gmail.com", // Replace with your SMTP server- port: 587,- secure: false, // Use TLS- auth: {- user: to, // assuming the sender is the same as the recipient- pass: password,- },- });-- // Send mail with defined transport object- const info = await transporter.sendMail({- from: to, // sender address- to: to, // list of receivers- subject: subject, // Subject line- text: body, // plain text body- });-- if (!info) {- throw new Error("failed to send email");- }- console.log(`email sent to ${to} with subject: ${subject}`);-}--async function dailyLogPipeline(): Promise<void> {- console.log("starting daily log pipeline");-- const config = pipe.loadPipeConfig();- console.log("loaded config:", JSON.stringify(config, null, 2));-- const interval = config.interval * 1000;- const summaryFrequency = config.summaryFrequency;- const emailTime = config.emailTime;- const emailAddress = config.emailAddress;- const emailPassword = config.emailPassword;- const customPrompt = config.customPrompt!;- const dailylogPrompt = config.dailylogPrompt!;- const gptModel = config.gptModel;- const gptApiUrl = config.gptApiUrl;- const openaiApiKey = config.openaiApiKey;- const windowName = config.windowName || "";- const pageSize = config.pageSize;- const contentType = config.contentType || "ocr";-- const emailEnabled = !!(emailAddress && emailPassword);- console.log("email enabled:", emailEnabled);-- console.log("creating logs dir");- const logsDir = `${process.env.PIPE_DIR}/logs`;- console.log("logs dir:", logsDir);- try {- fs.mkdirSync(logsDir);- } catch (_error) {- console.warn("failed to create logs dir, probably already exists");- }-- let lastEmailSent = new Date(0);-- // Only send welcome email if email is enabled- if (emailEnabled) {- const welcomeEmail = `- Welcome to the daily reddit questions pipeline!-- This pipe will send you a daily list of reddit questions based on your screen data.- ${- summaryFrequency === "daily"- ? `It will run at ${emailTime} every day.`- : `It will run every ${summaryFrequency} hours.`- }- `;- await sendEmail(- emailAddress!,- emailPassword!,- "daily reddit questions",- welcomeEmail- );- }-- while (true) {- try {- const now = new Date();- const oneMinuteAgo = new Date(now.getTime() - interval);-- const screenData = await pipe.queryScreenpipe({- startTime: oneMinuteAgo.toISOString(),- endTime: now.toISOString(),- windowName: windowName,- limit: pageSize,- contentType: contentType,- });-- if (screenData && screenData.data && screenData.data.length > 0) {- const logEntry = await generateDailyLog(- screenData.data,- dailylogPrompt, // Use dailylogPrompt here instead of customPrompt- gptModel,- gptApiUrl,- openaiApiKey- );- console.log("log entry:", logEntry);- saveDailyLog(logEntry);- }-- let shouldSendSummary = false;-- if (summaryFrequency === "daily") {- const [emailHour, emailMinute] = emailTime.split(":").map(Number);- const emailTimeToday = new Date(- now.getFullYear(),- now.getMonth(),- now.getDate(),- emailHour,- emailMinute- );- shouldSendSummary =- now >= emailTimeToday &&- now.getTime() - lastEmailSent.getTime() > 24 * 60 * 60 * 1000;- } else if (summaryFrequency.startsWith("hourly:")) {- const hours = parseInt(summaryFrequency.split(":")[1], 10);- shouldSendSummary =- now.getTime() - lastEmailSent.getTime() >= hours * 60 * 60 * 1000;- }-- if (shouldSendSummary) {- const screenData = await pipe.queryScreenpipe({- startTime: oneMinuteAgo.toISOString(),- endTime: now.toISOString(),- windowName: windowName,- limit: pageSize,- contentType: contentType,- });-- if (screenData && screenData.data && screenData.data.length > 0) {- const redditQuestions = await generateRedditQuestions(- screenData.data,- customPrompt,- gptModel,- gptApiUrl,- openaiApiKey- );- console.log("reddit questions:", redditQuestions);-- // Send email only if enabled- if (emailEnabled) {- await sendEmail(- emailAddress!,- emailPassword!,- "reddit questions",- redditQuestions- );- }-- // Always send to inbox and desktop notification- await pipe.inbox.send({- title: "reddit questions",- body: redditQuestions,- });- await pipe.sendDesktopNotification({- title: "reddit questions",- body: "just sent you some reddit questions",- });- lastEmailSent = now;- }- }- } catch (error) {- console.warn("error in daily log pipeline:", error);- }- console.log("sleeping for", interval, "ms");- await new Promise((resolve) => setTimeout(resolve, interval));- }-}--dailyLogPipeline();diff --git a/pipes/pipe-post-questions-on-reddit/tsconfig.json b/pipes/pipe-post-questions-on-reddit/tsconfig.jsondeleted file mode 100644index 238655f2c..000000000--- a/pipes/pipe-post-questions-on-reddit/tsconfig.json+++ /dev/null@@ -1,27 +0,0 @@-{- "compilerOptions": {- // Enable latest features- "lib": ["ESNext", "DOM"],- "target": "ESNext",- "module": "ESNext",- "moduleDetection": "force",- "jsx": "react-jsx",- "allowJs": true,-- // Bundler mode- "moduleResolution": "bundler",- "allowImportingTsExtensions": true,- "verbatimModuleSyntax": true,- "noEmit": true,-- // Best practices- "strict": true,- "skipLibCheck": true,- "noFallthroughCasesInSwitch": true,-- // Some stricter flags (disabled by default)- "noUnusedLocals": false,- "noUnusedParameters": false,- "noPropertyAccessFromIndexSignature": false- }-}