Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

chore: remove obsolete examples

Louis Beaumontf5e77b345dfd
diff --git a/examples/ts/automatic-crm/.gitignore b/examples/ts/automatic-crm/.gitignore
deleted file mode 100644
index dfd250cf1..000000000
--- a/examples/ts/automatic-crm/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-node_modules
-pnpm-lock.yaml
-yarn.lock
\ No newline at end of file
diff --git a/examples/ts/automatic-crm/README.md b/examples/ts/automatic-crm/README.md
deleted file mode 100644
index f084da495..000000000
--- a/examples/ts/automatic-crm/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-This example uses a LLM to maintain a CRM of people you've seen daily, like how many times did you see Bob, John, etc.
-
-How to use:
-
-First run screenpipe, then:
-
-```bash
-cd examples/ts/automatic-crm
-```
-
-Make sure to have ollama installed and run:
-
-```bash
-ollama run phi3
-```
-
-```bash
-pnpm i
-npx tsx main.ts
-```
diff --git a/examples/ts/automatic-crm/main.ts b/examples/ts/automatic-crm/main.ts
deleted file mode 100644
index 7c364f000..000000000
--- a/examples/ts/automatic-crm/main.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-import fetch from "cross-fetch";
-// @ts-ignore
-import * as fs from "node:fs/promises";
-
-async function main() {
- // Create file log with empty object
- await fs.writeFile("name_log.json", JSON.stringify({}));
-
- while (true) {
- try {
- // Use the API to get recent OCR text
- const response = await fetch(
- `http://localhost:3030/recent?limit=5&offset=0`
- );
-
- if (!response.ok) {
- const errorData = await response.json();
- throw new Error(`API error: ${errorData.error || response.statusText}`);
- }
-
- const json = await response.json();
-
- // Read current log
- const currentLog = JSON.parse(await fs.readFile("name_log.json", "utf-8"));
-
- const yourLifeContext = JSON.stringify(json);
-
- if (yourLifeContext.length < 50) {
- console.log("Seems like you haven't run screenpipe yet, did you?");
- return;
- }
-
- console.log("Will use your life context to update the name log:");
- console.log(yourLifeContext.substring(0, 1000) + "...");
-
- // Use the LLM to update the log
- const llmResponse = await fetch("http://localhost:11434/api/chat", {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({
- model: "phi3",
- stream: false,
- max_tokens: 4096,
- response_format: { type: "json_object" },
- messages: [
- {
- role: "user",
- content: `You receive a JSON object containing names and their appearance counts on the user's screen.
- This is what has been shown on the user's screen over the past 5 minutes: ${yourLifeContext}
- And this is the current name log: ${JSON.stringify(currentLog)}
-
- Rules:
- - Identify any names mentioned in the screen content
- - Update the name counts in the log
- - If a name is new, add it to the log with a count of 1
- - If a name already exists, increment its count
- - 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
-
- Example of answer from you:
- {
- "John Doe": 1,
- "Jane Doe": 2
- }
-
- Counter-example of answer from you:
- "I'm not sure what you're asking for"
-
- Now update the log based on the user's screen and respond with only the updated JSON object.`,
- },
- ],
- }),
- });
-
- const text = await llmResponse.json();
- let updatedNameLog = text.message.content.trim();
- // remove trimming "
- updatedNameLog = updatedNameLog.replace(/^"|"$/g, "");
-
-
- console.log("Updated name log:");
- console.log(JSON.stringify(updatedNameLog, null, 2));
-
- // Update file
- await fs.writeFile("name_log.json", JSON.stringify(updatedNameLog, null, 2));
- } catch (error) {
- console.error("An error occurred:", error);
- }
-
- // Sleep for a while before checking again
- await new Promise((resolve) => setTimeout(resolve, 5000));
- }
-}
-
-main();
\ No newline at end of file
diff --git a/examples/ts/automatic-crm/name_log.json b/examples/ts/automatic-crm/name_log.json
deleted file mode 100644
index 61e7f14a0..000000000
--- a/examples/ts/automatic-crm/name_log.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "John Doe": 1,
- "Jane Doe": 2,
- "Elon Musk": 5
-}
\ No newline at end of file
diff --git a/examples/ts/automatic-crm/package.json b/examples/ts/automatic-crm/package.json
deleted file mode 100644
index b24ca4312..000000000
--- a/examples/ts/automatic-crm/package.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "dependencies": {
- "cross-fetch": "^4.0.0"
- },
- "devDependencies": {
- "@types/node": "^20.14.9"
- }
-}
diff --git a/examples/ts/maintain-a-log-of-my-day/.gitignore b/examples/ts/maintain-a-log-of-my-day/.gitignore
deleted file mode 100644
index dfd250cf1..000000000
--- a/examples/ts/maintain-a-log-of-my-day/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-node_modules
-pnpm-lock.yaml
-yarn.lock
\ No newline at end of file
diff --git a/examples/ts/maintain-a-log-of-my-day/README.md b/examples/ts/maintain-a-log-of-my-day/README.md
deleted file mode 100644
index a8c85a61d..000000000
--- a/examples/ts/maintain-a-log-of-my-day/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-This example maintain a log of your day, like "9 am: watching cat video, 10 am: coding in c++, 11 am: watching dog videos etc."
-
-How to use:
-
-First run screenpipe, then:
-
-```bash
-cd examples/ts/maintain-a-log-of-my-day
-```
-
-Make sure to have ollama installed and run:
-
-```bash
-ollama run phi3
-```
-
-```bash
-pnpm i
-npx tsx main.ts
-```
diff --git a/examples/ts/maintain-a-log-of-my-day/log.md b/examples/ts/maintain-a-log-of-my-day/log.md
deleted file mode 100644
index 5d551b473..000000000
--- a/examples/ts/maintain-a-log-of-my-day/log.md
+++ /dev/null
@@ -1,22 +0,0 @@
-- **Timestamp**: July 3, 2024, 12:38:55 UTC
-
-- **File Path**: `./data/2024-07-03_12:39:06.361935 UTC.mp4`
-
-- **Content Snippet Update**:
-
- - Initiated TypeScript application to dynamically update daily life log using live screen inputs. Integration of Rust Analyzer confirmed for efficient processing of logs.
-
- - OCR Frame 244 processed, referencing 'maintain-a-log-of-my-day' project and Elm LLM content in line with the user's development activities. Awaiting details from additional OCR data to ensure accurate log update.
-
- - Received chat API JSON payload (`timestamp: 2024-07-03T12:38:49.252479Z`) with relevant screen information and pagination details, which will refine the precision of user activity logs.
-
- - Launched a Bash session to execute development tasks; actions for log maintenance are pending further OCR data analysis.
-
-- **Pending Actions**:
-
- 1. Update log with details from Frame 250 post-processing.
-
- 2. Complete analysis of chat API payload.
-
-
-The updated log reflects the latest activities and planned actions for maintaining a precise daily life log, including technological interactions through TypeScript and Rust Analyzer integration, as well as real-time updates via OCR and chat APIs.
\ No newline at end of file
diff --git a/examples/ts/maintain-a-log-of-my-day/main.ts b/examples/ts/maintain-a-log-of-my-day/main.ts
deleted file mode 100644
index b50f7ab2c..000000000
--- a/examples/ts/maintain-a-log-of-my-day/main.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-import fetch from "cross-fetch";
-// @ts-ignore
-import * as fs from "node:fs/promises";
-
-async function main() {
- // Create file log with empty lines
- await fs.writeFile("log.md", "");
-
- while (true) {
- try {
- // Use the API to get recent OCR text
-
- const response = await fetch(
- `http://localhost:3030/recent?limit=5&offset=0`
- );
-
- if (!response.ok) {
- const errorData = await response.json();
- throw new Error(`API error: ${errorData.error || response.statusText}`);
- }
-
- const json = await response.json();
-
- // Read current log
- const currentLog = await fs.readFile("log.md", "utf-8");
-
- const yourLifeContext = JSON.stringify(json);
-
- if (yourLifeContext.length < 50) {
- console.log("Seems like you haven't run screenpipe yet, did you?");
- return;
- }
-
- console.log("Will use your life context to update the log:");
- console.log(yourLifeContext.substring(0, 1000) + "...");
-
- // Use the LLM to update the log
- const llmResponse = await fetch("http://localhost:11434/api/chat", {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({
- model: "phi3",
- stream: false,
- max_tokens: 4096,
- messages: [
- {
- role: "user", // ! feel free to improve this shitty prompt :P
- content: `you receive a markdown log of what the user has been doing today,
- that you maintain based on the text extracted from the user's screen.
- You can add new categories or update the existing ones. You can also add a new entry to the log.
- This is what has been shown on the user's screen over the past 5 minutes: ${yourLifeContext}
- And this is the current log: ${currentLog}
-
- Rules:
- - Keep the log small and concise, formatted as a bullet list
- - Your responses are NOT in a code block e.g. no \`\`\`plaintext \`\`\`markdown etc.!
- - DO WRITE A LOG OF THE USER'S DAY. NOTHING ELSE
-
- Now update the log based on the user's screen and respond with only the updated log.
- LOG OF THE USER'S DAY:`,
- },
- ],
- }),
- });
-
- const text = await llmResponse.json();
- let llmResponseText = text.message.content.trim().replace(/^"|"$/g, "");
-
- console.log(llmResponseText);
-
- // Replace all \n with \n\n
- llmResponseText = llmResponseText.replace(/\\n/g, "\n\n");
-
- // Update file
- await fs.writeFile("log.md", llmResponseText);
- } catch (error) {
- console.error("An error occurred:", error);
- }
-
- // Sleep for a while before checking again
- await new Promise((resolve) => setTimeout(resolve, 5000));
- }
-}
-
-main();
diff --git a/examples/ts/maintain-a-log-of-my-day/package.json b/examples/ts/maintain-a-log-of-my-day/package.json
deleted file mode 100644
index b24ca4312..000000000
--- a/examples/ts/maintain-a-log-of-my-day/package.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "dependencies": {
- "cross-fetch": "^4.0.0"
- },
- "devDependencies": {
- "@types/node": "^20.14.9"
- }
-}