screenpipe-sync 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -0
- package/bun.lock +97 -0
- package/dist/index.js +9961 -0
- package/package.json +37 -0
- package/src/index.ts +496 -0
- package/tsconfig.json +14 -0
package/README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# @screenpipe/sync
|
|
2
|
+
|
|
3
|
+
**Extract structured daily summaries from your Screenpipe history.**
|
|
4
|
+
|
|
5
|
+
Turn hours of screen recordings into actionable context: todos, goals, decisions, and AI insights.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# One-liner - outputs to stdout
|
|
11
|
+
bunx @screenpipe/sync
|
|
12
|
+
|
|
13
|
+
# Save to a folder (creates YYYY-MM-DD.md files)
|
|
14
|
+
bunx @screenpipe/sync --output ~/Documents/brain/context
|
|
15
|
+
|
|
16
|
+
# Auto commit and push
|
|
17
|
+
bunx @screenpipe/sync --output ~/notes --git
|
|
18
|
+
|
|
19
|
+
# Sync to remote server (e.g., Clawdbot)
|
|
20
|
+
bunx @screenpipe/sync --remote user@host:~/brain/context
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## What It Extracts
|
|
24
|
+
|
|
25
|
+
| Category | Description |
|
|
26
|
+
|----------|-------------|
|
|
27
|
+
| **Todos** | Action items visible on screen or mentioned |
|
|
28
|
+
| **Goals** | Objectives, intentions, targets mentioned |
|
|
29
|
+
| **Decisions** | Choices made or discussed |
|
|
30
|
+
| **Activities** | Key tasks worked on, by app |
|
|
31
|
+
| **Meetings** | Calls, conversations, collaborations |
|
|
32
|
+
| **Blockers** | Problems, frustrations, obstacles |
|
|
33
|
+
| **Insights** | AI observations about work patterns |
|
|
34
|
+
|
|
35
|
+
## Example Output
|
|
36
|
+
|
|
37
|
+
```markdown
|
|
38
|
+
# Daily Context - 2026-01-29
|
|
39
|
+
|
|
40
|
+
> Analyzed 480 minutes of screen activity
|
|
41
|
+
|
|
42
|
+
## 📱 Apps Used
|
|
43
|
+
- **VS Code**: ~180 min
|
|
44
|
+
- **Chrome**: ~120 min
|
|
45
|
+
- **Slack**: ~60 min
|
|
46
|
+
|
|
47
|
+
## ✅ Todos Extracted
|
|
48
|
+
- Fix authentication bug in login.ts
|
|
49
|
+
- Review PR #234 for payment integration
|
|
50
|
+
- Send weekly update to investors
|
|
51
|
+
|
|
52
|
+
## 🎯 Goals Mentioned
|
|
53
|
+
- Ship v2.9 by Friday
|
|
54
|
+
- Reach 50% activation rate
|
|
55
|
+
|
|
56
|
+
## 💡 AI Insights
|
|
57
|
+
- Heavy context switching between Slack and VS Code (17 switches/hour)
|
|
58
|
+
- Deep focus block from 2-4pm on auth refactor
|
|
59
|
+
- Late session (after 10pm) - consider sleep impact
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Options
|
|
63
|
+
|
|
64
|
+
| Flag | Description | Default |
|
|
65
|
+
|------|-------------|---------|
|
|
66
|
+
| `-o, --output <dir>` | Save to directory | stdout |
|
|
67
|
+
| `-h, --hours <n>` | Hours to analyze | 12 |
|
|
68
|
+
| `-g, --git` | Auto commit & push | false |
|
|
69
|
+
| `-r, --remote <host>` | Sync via SSH | - |
|
|
70
|
+
| `--json` | JSON output | markdown |
|
|
71
|
+
| `-v, --verbose` | Debug output | false |
|
|
72
|
+
|
|
73
|
+
## Environment Variables
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# AI Provider (uses first available)
|
|
77
|
+
export ANTHROPIC_API_KEY="sk-..." # Claude (recommended)
|
|
78
|
+
export OPENAI_API_KEY="sk-..." # OpenAI fallback
|
|
79
|
+
export OLLAMA_URL="http://localhost:11434" # Local Ollama
|
|
80
|
+
export OLLAMA_MODEL="llama3.2" # Ollama model
|
|
81
|
+
|
|
82
|
+
# Screenpipe
|
|
83
|
+
export SCREENPIPE_URL="http://localhost:3030" # Default
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**AI Priority:** Claude → OpenAI → Ollama → No AI (basic summary)
|
|
87
|
+
|
|
88
|
+
## Use Cases
|
|
89
|
+
|
|
90
|
+
### Daily Journaling
|
|
91
|
+
```bash
|
|
92
|
+
# Run at end of day
|
|
93
|
+
bunx @screenpipe/sync --output ~/journal --hours 16
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Sync to Remote AI Assistant
|
|
97
|
+
```bash
|
|
98
|
+
# Sync context to Clawdbot/Moltbot instance
|
|
99
|
+
bunx @screenpipe/sync --output ~/brain/context --git
|
|
100
|
+
# Remote pulls via cron
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Weekly Review Prep
|
|
104
|
+
```bash
|
|
105
|
+
# Get full week
|
|
106
|
+
bunx @screenpipe/sync --hours 168 --json > week.json
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Automated Daily Sync (cron)
|
|
110
|
+
```bash
|
|
111
|
+
# Add to crontab
|
|
112
|
+
0 22 * * * ANTHROPIC_API_KEY=sk-... bunx @screenpipe/sync -o ~/context -g
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## How It Works
|
|
116
|
+
|
|
117
|
+
1. **Query** - Fetches OCR data from local Screenpipe API
|
|
118
|
+
2. **Dedupe** - Removes duplicate/similar screen captures
|
|
119
|
+
3. **Extract** - Claude analyzes content for structured data
|
|
120
|
+
4. **Format** - Outputs markdown or JSON
|
|
121
|
+
5. **Sync** - Optionally git pushes or SCPs to remote
|
|
122
|
+
|
|
123
|
+
## Requirements
|
|
124
|
+
|
|
125
|
+
- [Screenpipe](https://github.com/mediar-ai/screenpipe) running locally
|
|
126
|
+
- [Bun](https://bun.sh) runtime
|
|
127
|
+
- Anthropic API key for AI extraction (optional but recommended)
|
|
128
|
+
|
|
129
|
+
## Privacy
|
|
130
|
+
|
|
131
|
+
All processing happens locally. Screen data never leaves your machine unless you explicitly sync to a remote.
|
|
132
|
+
|
|
133
|
+
## License
|
|
134
|
+
|
|
135
|
+
MIT - Part of the [Screenpipe](https://github.com/mediar-ai/screenpipe) project.
|
package/bun.lock
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lockfileVersion": 1,
|
|
3
|
+
"configVersion": 1,
|
|
4
|
+
"workspaces": {
|
|
5
|
+
"": {
|
|
6
|
+
"name": "@screenpipe/sync",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@anthropic-ai/sdk": "^0.39.0",
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@types/bun": "latest",
|
|
12
|
+
"typescript": "^5.0.0",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
"packages": {
|
|
17
|
+
"@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.39.0", "", { "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7" } }, "sha512-eMyDIPRZbt1CCLErRCi3exlAvNkBtRe+kW5vvJyef93PmNr/clstYgHhtvmkxN82nlKgzyGPCyGxrm0JQ1ZIdg=="],
|
|
18
|
+
|
|
19
|
+
"@types/bun": ["@types/bun@1.3.8", "", { "dependencies": { "bun-types": "1.3.8" } }, "sha512-3LvWJ2q5GerAXYxO2mffLTqOzEu5qnhEAlh48Vnu8WQfnmSwbgagjGZV6BoHKJztENYEDn6QmVd949W4uESRJA=="],
|
|
20
|
+
|
|
21
|
+
"@types/node": ["@types/node@18.19.130", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg=="],
|
|
22
|
+
|
|
23
|
+
"@types/node-fetch": ["@types/node-fetch@2.6.13", "", { "dependencies": { "@types/node": "*", "form-data": "^4.0.4" } }, "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw=="],
|
|
24
|
+
|
|
25
|
+
"abort-controller": ["abort-controller@3.0.0", "", { "dependencies": { "event-target-shim": "^5.0.0" } }, "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg=="],
|
|
26
|
+
|
|
27
|
+
"agentkeepalive": ["agentkeepalive@4.6.0", "", { "dependencies": { "humanize-ms": "^1.2.1" } }, "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ=="],
|
|
28
|
+
|
|
29
|
+
"asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="],
|
|
30
|
+
|
|
31
|
+
"bun-types": ["bun-types@1.3.8", "", { "dependencies": { "@types/node": "*" } }, "sha512-fL99nxdOWvV4LqjmC+8Q9kW3M4QTtTR1eePs94v5ctGqU8OeceWrSUaRw3JYb7tU3FkMIAjkueehrHPPPGKi5Q=="],
|
|
32
|
+
|
|
33
|
+
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
|
|
34
|
+
|
|
35
|
+
"combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="],
|
|
36
|
+
|
|
37
|
+
"delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="],
|
|
38
|
+
|
|
39
|
+
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
|
|
40
|
+
|
|
41
|
+
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
|
|
42
|
+
|
|
43
|
+
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
|
|
44
|
+
|
|
45
|
+
"es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="],
|
|
46
|
+
|
|
47
|
+
"es-set-tostringtag": ["es-set-tostringtag@2.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="],
|
|
48
|
+
|
|
49
|
+
"event-target-shim": ["event-target-shim@5.0.1", "", {}, "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="],
|
|
50
|
+
|
|
51
|
+
"form-data": ["form-data@4.0.5", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.2", "mime-types": "^2.1.12" } }, "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w=="],
|
|
52
|
+
|
|
53
|
+
"form-data-encoder": ["form-data-encoder@1.7.2", "", {}, "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A=="],
|
|
54
|
+
|
|
55
|
+
"formdata-node": ["formdata-node@4.4.1", "", { "dependencies": { "node-domexception": "1.0.0", "web-streams-polyfill": "4.0.0-beta.3" } }, "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ=="],
|
|
56
|
+
|
|
57
|
+
"function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
|
|
58
|
+
|
|
59
|
+
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
|
60
|
+
|
|
61
|
+
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
|
|
62
|
+
|
|
63
|
+
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
|
64
|
+
|
|
65
|
+
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
|
|
66
|
+
|
|
67
|
+
"has-tostringtag": ["has-tostringtag@1.0.2", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="],
|
|
68
|
+
|
|
69
|
+
"hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="],
|
|
70
|
+
|
|
71
|
+
"humanize-ms": ["humanize-ms@1.2.1", "", { "dependencies": { "ms": "^2.0.0" } }, "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ=="],
|
|
72
|
+
|
|
73
|
+
"math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
|
|
74
|
+
|
|
75
|
+
"mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],
|
|
76
|
+
|
|
77
|
+
"mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
|
|
78
|
+
|
|
79
|
+
"ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
|
|
80
|
+
|
|
81
|
+
"node-domexception": ["node-domexception@1.0.0", "", {}, "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="],
|
|
82
|
+
|
|
83
|
+
"node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="],
|
|
84
|
+
|
|
85
|
+
"tr46": ["tr46@0.0.3", "", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="],
|
|
86
|
+
|
|
87
|
+
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
|
88
|
+
|
|
89
|
+
"undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
|
|
90
|
+
|
|
91
|
+
"web-streams-polyfill": ["web-streams-polyfill@4.0.0-beta.3", "", {}, "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug=="],
|
|
92
|
+
|
|
93
|
+
"webidl-conversions": ["webidl-conversions@3.0.1", "", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="],
|
|
94
|
+
|
|
95
|
+
"whatwg-url": ["whatwg-url@5.0.0", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="],
|
|
96
|
+
}
|
|
97
|
+
}
|