driftnet 0.8.0 → 0.10.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/.env.example +5 -0
- package/README.md +224 -57
- package/README.zh-TW.md +209 -51
- package/dist/driftnet.mjs +4168 -434
- package/examples/plugins/rainbow-judge.mjs +25 -0
- package/package.json +2 -1
- package/public/index.html +359 -19
- package/skills/driftnet/SKILL.md +57 -0
package/.env.example
CHANGED
|
@@ -50,6 +50,11 @@ DRIFTNET_ALLOW_PRIVATE_URLS=
|
|
|
50
50
|
# ── Your rules (also on the page under ⚙ Settings) ─────────────────────
|
|
51
51
|
# Extra instructions for every summary, e.g. "Say whether it is free. Mention if it needs a GPU."
|
|
52
52
|
DRIFTNET_SUMMARY_RULES=
|
|
53
|
+
# Who you are and what you care about (600 characters at most). Used to judge worth and write each "why".
|
|
54
|
+
# e.g. Backend engineer, Odoo and TypeScript; collecting AI coding tools and MCP servers; not interested in crypto.
|
|
55
|
+
DRIFTNET_PROFILE=
|
|
56
|
+
# 1: check npm once a day for a newer driftnet (the "new version" notice); off unless set to 1
|
|
57
|
+
DRIFTNET_UPDATE_CHECK=
|
|
53
58
|
# Domains never catalogued (subdomains included), comma separated
|
|
54
59
|
DRIFTNET_BLOCK_DOMAINS=
|
|
55
60
|
# Extractor plugins (.js / .mjs); default ~/.driftnet/plugins. See examples/plugins.
|
package/README.md
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
[📖 What it is](#-what-it-is) · [🎥 See it work](#-see-it-work) · [✨ Core features](#-core-features) · [🚀 Quick start](#-quick-start) · [How links are handled](#how-your-links-are-handled) · [Ways in](#ways-in) · [Command line](#command-line) · [Web page](#the-web-page) · [Models](#models) · [Agents](#agents) · [Settings](#settings) · [Online](#putting-it-online-optional) · [Your data](#where-your-data-goes) · [Contributing](#contributing)
|
|
11
11
|
|
|
12
|
+
[](https://kevinchu1110.github.io/driftnet/) **[Try the demo](https://kevinchu1110.github.io/driftnet/)**: the real page with sample cards, right in your browser. Nothing to install, nothing leaves your machine.
|
|
13
|
+
|
|
12
14
|
[](https://github.com/KevinChu1110/driftnet/blob/main/LICENSE)
|
|
13
15
|
[](https://www.npmjs.com/package/driftnet)
|
|
14
16
|
[](https://github.com/KevinChu1110/driftnet/actions/workflows/ci.yml)
|
|
@@ -23,15 +25,15 @@
|
|
|
23
25
|
|
|
24
26
|
## 📖 What it is
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
later"
|
|
28
|
+
Every day your feed carries great articles, open-source repos and tools past you. You paste them
|
|
29
|
+
into a chat "for later", and like everything else in the current, they drift out of sight.
|
|
28
30
|
|
|
29
|
-
**driftnet
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
**driftnet is the net you leave in that current.** Drop links in a group chat (LINE, Slack, Discord,
|
|
32
|
+
Telegram), click the Chrome button, import your old bookmarks or use the command line. driftnet
|
|
33
|
+
catches each one, follows a post to the project it is really about, boils it down to a short summary
|
|
34
|
+
in your language, and files it in your own folders, in a local catalogue with full-text search
|
|
35
|
+
(Chinese included). Your agents haul in the same catalogue over MCP. It runs on your own computer
|
|
36
|
+
and works with any model, or none.
|
|
35
37
|
|
|
36
38
|
## 🎥 See it work
|
|
37
39
|
|
|
@@ -82,19 +84,49 @@ bot ▸ 📌 This week in AI (3/11)|News + Paperclip, RealWonder
|
|
|
82
84
|
|
|
83
85
|
## 🚀 Quick start
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
Everything runs on your own computer: no server to rent, no account. Want a look first?
|
|
88
|
+
**[Try the demo](https://kevinchu1110.github.io/driftnet/)** runs the real page in your browser.
|
|
89
|
+
|
|
90
|
+
### Easiest: let your AI agent install it
|
|
91
|
+
|
|
92
|
+
Copy this into Claude Code, Cursor, Codex or any agent that can run commands on your computer:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
Read https://raw.githubusercontent.com/KevinChu1110/driftnet/main/docs/llms-install.txt and set up driftnet for me.
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
It checks Node.js, starts driftnet, connects itself over MCP and tells you when it is done.
|
|
99
|
+
|
|
100
|
+
### Or run one command yourself
|
|
86
101
|
|
|
87
|
-
|
|
102
|
+
You need [Node.js](https://nodejs.org) 22.13 or newer. Then, in a terminal:
|
|
88
103
|
|
|
89
104
|
```bash
|
|
90
|
-
npx driftnet
|
|
105
|
+
npx driftnet
|
|
91
106
|
```
|
|
92
107
|
|
|
93
|
-
|
|
108
|
+
Your browser opens **http://localhost:8787**: that is driftnet's page, served by your own computer
|
|
109
|
+
(*localhost* means "this machine"; nobody else can see it). ⚙ Settings walks you through picking a
|
|
110
|
+
model, or skip it and start without one. To connect the AI apps on this computer (Claude Code,
|
|
111
|
+
Claude Desktop, Cursor, Windsurf, Codex) in one go: `npx driftnet init`.
|
|
94
112
|
|
|
95
|
-
|
|
113
|
+
Your settings live in `~/.driftnet/.env` and the catalogue in `~/.driftnet/driftnet.db`.
|
|
96
114
|
|
|
97
|
-
|
|
115
|
+
### Add your first link
|
|
116
|
+
|
|
117
|
+
Any of these works:
|
|
118
|
+
|
|
119
|
+
- **On the page:** paste a link into the box and press Add.
|
|
120
|
+
- **In a terminal:** `npx driftnet add https://github.com/paperclipai/paperclip`
|
|
121
|
+
- **From the browser:** the [Chrome extension](#chrome-extension) sends the page you are looking at.
|
|
122
|
+
- **From a chat:** connect a [Discord, Telegram, Slack or LINE bot](#ways-in) and drop links there.
|
|
123
|
+
|
|
124
|
+
A card shows up within 5–30 seconds: what it is, why it might matter to you, and where it was filed.
|
|
125
|
+
|
|
126
|
+
<details>
|
|
127
|
+
<summary><b>Other ways to run it: from source, Docker</b></summary>
|
|
128
|
+
|
|
129
|
+
From source, to hack on it or run it as a login service:
|
|
98
130
|
|
|
99
131
|
```bash
|
|
100
132
|
git clone https://github.com/KevinChu1110/driftnet && cd driftnet
|
|
@@ -103,9 +135,7 @@ pnpm start # http://localhost:87
|
|
|
103
135
|
pnpm service:install # optional: start at login (macOS / Linux)
|
|
104
136
|
```
|
|
105
137
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
Nothing to install but Docker:
|
|
138
|
+
With Docker:
|
|
109
139
|
|
|
110
140
|
```bash
|
|
111
141
|
docker build -t driftnet https://github.com/KevinChu1110/driftnet.git
|
|
@@ -113,15 +143,9 @@ docker run -d -p 127.0.0.1:8787:8787 -v driftnet:/data -e DRIFTNET_HOST=0.0.0.0
|
|
|
113
143
|
```
|
|
114
144
|
|
|
115
145
|
Without `start`, the container is the MCP server over stdio (`docker run -i --rm -v driftnet:/data driftnet`).
|
|
146
|
+
`DRIFTNET_HOME` moves the settings and the catalogue somewhere else.
|
|
116
147
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
curl -X POST localhost:8787/api/chat -H 'content-type: application/json' \
|
|
121
|
-
-d '{"text": "look at this https://github.com/paperclipai/paperclip"}'
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
You get the reply a chat would get, as JSON, after 5–30 seconds; the card is already on the page.
|
|
148
|
+
</details>
|
|
125
149
|
|
|
126
150
|
<details>
|
|
127
151
|
<summary><b>Not working?</b></summary>
|
|
@@ -154,6 +178,8 @@ Most links never reach a model; the ones that do arrive as a short outline.
|
|
|
154
178
|
6. **Filed in your folders.** The AI uses each folder's path and description; new links wait in the Inbox with two or three suggested folders, and one tap files them.
|
|
155
179
|
7. **Shown, and offered to agents.** It appears on the web page, and agents get it over MCP, `/llms.txt`, `/feed.xml` or the outgoing webhook. Export takes it all with you.
|
|
156
180
|
|
|
181
|
+
**Reels and shorts.** All optional: with none of the tools below installed, driftnet simply reads the post's title and caption as before. Many shared reels only say the tool's name out loud. When a link on Instagram, Facebook, Threads, TikTok, YouTube Shorts or X is a video whose page text says almost nothing, driftnet reads the video itself with tools already on your machine, cheapest first and stopping as soon as there is enough text: (1) captions, title and description from `yt-dlp`, no download; (2) the video at low quality (at most 60 MB and the first 3 minutes), one frame every 2 seconds, read by `tesseract` (English and Chinese if installed); (3) only if still thin, the audio through `whisper` (`whisper-cli` from whisper.cpp also works, with `DRIFTNET_WHISPER_MODEL` set). What it finds is added to the text as labelled `[captions]`, `[on-screen text]` and `[speech]` sections (6,000 characters at most) and goes through the same guard as page text; the card gets a "read from video" mark. Whatever is missing is skipped. On a laptop battery, `DRIFTNET_VIDEO=captions` stops after step 1 (no download, no OCR, no speech model); `off` turns it all off. Tools run without a shell, in a private temp folder that is always deleted, with your driftnet secrets removed from their environment, a time limit per step, links to private or local addresses refused, and one video at a time.
|
|
182
|
+
|
|
157
183
|
<details>
|
|
158
184
|
<summary><b>All eight steps</b></summary>
|
|
159
185
|
|
|
@@ -177,21 +203,59 @@ without running one: on real links, a Chinese article went from 831 to 404 token
|
|
|
177
203
|
|
|
178
204
|
Links rot and repos get archived. Set `DRIFTNET_HEALTH=weekly` (recommended; it is off by default because it makes network requests) and driftnet re-checks each card about once a week, a few at a time. GitHub repos go through the API (stars, archived, last push; set `GITHUB_TOKEN` for a higher limit, and it pauses on a rate limit); other links get a quiet `HEAD` through the same private-address guard. A card is marked `dead` (404 / gone, or a name that no longer resolves), `archived`, `stale` (no push for 18 months) or `moved` (repo renamed); server errors and timeouts change nothing and are retried. Marked cards show a badge, appear under **Needs review** on the page and in `driftnet_search_items` with `view=needs_review`, and the card's check button (or `POST /api/items/:id/health`) tests one link right now.
|
|
179
205
|
|
|
206
|
+
## Search by meaning
|
|
207
|
+
|
|
208
|
+
Optional. With an embedding model, search also finds cards by what they are about, not only by the words in them: "login" finds an OAuth kit, "scanned documents" finds an OCR tool. It is off until a local model is found (or you name a provider), costs **no summary tokens**, and when it is off, slow or down, search is exactly the keyword search it always was.
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
ollama pull nomic-embed-text # that's it: restart driftnet and the startup line says "semantic search: on"
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
- **What is embedded.** A few hundred characters per card: its name, one-liner, tags, highlights, title and the link's host, the same fields the summarizer already saw. Chat text is never embedded; your own notes only if the model runs on this machine. Cards are embedded in the background after they are saved (one request at a time), and existing cards are filled in after you turn it on; saving a link never waits for it.
|
|
215
|
+
- **Where it goes.** `ollama` and a local `DRIFTNET_EMBED_BASE_URL` keep everything on your machine. `openai` and `gemini` send each card's text above, and each search query, to that provider, so name them only if you are fine with that. A key is sent only to that provider's own address (or the base URL you typed), and the summary model's key is reused only for the same vendor.
|
|
216
|
+
- **Speed.** Vectors are stored compactly and compared in memory (about 12 ms for 10,000 cards). A search waits at most 1.5 s for its query vector, then falls back to keywords; after a failure it stops trying for 30 s. Repeated queries are cached.
|
|
217
|
+
- **Related cards.** A card's detail shows up to 5 similar cards (vectors when available, otherwise shared tags and name words). The same list is in `GET /api/items/:id` and in the `driftnet_get_item` tool.
|
|
218
|
+
|
|
219
|
+
| Variable | Default | Purpose |
|
|
220
|
+
|---|---|---|
|
|
221
|
+
| `DRIFTNET_EMBED` | `auto` | `auto`: on when a local Ollama has the embedding model, or when `DRIFTNET_EMBED_PROVIDER` is set. `off`: never |
|
|
222
|
+
| `DRIFTNET_EMBED_PROVIDER` | *(auto)* | `ollama`, `openai` (also any OpenAI-compatible `/embeddings`, including Ollama's `/v1`) or `gemini` |
|
|
223
|
+
| `DRIFTNET_EMBED_MODEL` | per provider | `nomic-embed-text` (Ollama), `text-embedding-3-small` (OpenAI), `gemini-embedding-001` (Gemini). Changing it re-embeds everything in the background |
|
|
224
|
+
| `DRIFTNET_EMBED_BASE_URL` | Ollama `http://127.0.0.1:11434`, OpenAI's own | Endpoint for `ollama` / `openai` |
|
|
225
|
+
| `DRIFTNET_EMBED_API_KEY` | — | Key for `openai` / `gemini` (not needed locally) |
|
|
226
|
+
| `DRIFTNET_EMBED_FLOOR` | `0.55` for nomic; `0.3` OpenAI; `0.5` Gemini | Cosine a card needs to appear with no matching word; raise it for fewer matches. Only nomic-embed-text was measured |
|
|
227
|
+
|
|
180
228
|
## Ways in
|
|
181
229
|
|
|
182
230
|
| | Set up | On a laptop? | Sent while it was off |
|
|
183
231
|
|---|---|---|---|
|
|
184
|
-
| **Chrome extension** | Load `apps/chrome-extension` | ✅ | — |
|
|
232
|
+
| **Chrome extension** | Load `apps/chrome-extension`, or the zip from `pnpm build:extension` | ✅ | — |
|
|
185
233
|
| Telegram | `TELEGRAM_BOT_TOKEN`; privacy mode off for groups (`/setprivacy`) | ✅ | caught up on start (24 h) |
|
|
186
234
|
| Discord | `DISCORD_BOT_TOKEN`; Message Content intent on | ✅ | read back per channel, quietly |
|
|
187
|
-
| Slack | `SLACK_APP_TOKEN` (Socket Mode) + `SLACK_BOT_TOKEN` | ✅ | missed |
|
|
235
|
+
| Slack | `SLACK_APP_TOKEN` (Socket Mode) + `SLACK_BOT_TOKEN` (+ `reactions:read` and the `reaction_added` event for voting) | ✅ | missed |
|
|
188
236
|
| LINE | `LINE_CHANNEL_SECRET` + `LINE_CHANNEL_ACCESS_TOKEN`, webhook `/webhooks/line` | needs a [public URL](#putting-it-online-optional) | missed |
|
|
189
237
|
| Your agent | MCP, OpenAPI or `/llms.txt`, see [Agents](#agents) | ✅ | — |
|
|
190
238
|
| Anything else | `POST /api/chat {"text": "…"}` returns the reply | ✅ | — |
|
|
191
239
|
|
|
192
|
-
**In a chat**, messages without a link are ignored. Each link gets
|
|
193
|
-
|
|
194
|
-
|
|
240
|
+
**In a chat**, messages without a link are ignored. Each link gets a reply that says what it is and where to read it on the web page,
|
|
241
|
+
shaped for the platform (`DRIFTNET_REPLY_STYLE=rich`, the default): a Discord embed per item, Slack Block Kit, a LINE Flex card (one bubble, or a
|
|
242
|
+
carousel of up to 12) and a Telegram message with links. Pictures appear only when a public `DRIFTNET_PUBLIC_URL` is set (never a localhost or
|
|
243
|
+
private address, and never with the share key). Want the summary in the chat instead, or no reply at all? Set `DRIFTNET_REPLY=full` or `off`;
|
|
244
|
+
`DRIFTNET_REPLY_STYLE=text` brings back plain messages. If a platform refuses the rich message (a missing permission), driftnet sends the plain
|
|
245
|
+
text and logs it once.
|
|
246
|
+
|
|
247
|
+
**Vote** with `👍12` or `👎12 reason` (`+#12` / `-#12` work too; a message with a link is never a vote), or with one tap:
|
|
248
|
+
|
|
249
|
+
| | How | Needs |
|
|
250
|
+
|---|---|---|
|
|
251
|
+
| Discord | React 👍 / 👎 on the bot's reply (it adds both for you; 👍 or 👎 votes on every card in that reply) | Message Reactions intent (not privileged; discord.js asks for it); *Embed Links* and *Add Reactions* in the channel |
|
|
252
|
+
| Slack | React 👍 / 👎 (`+1`, `-1`) on the bot's reply | Scope `reactions:read`; event subscription `reaction_added` |
|
|
253
|
+
| Telegram | Tap 👍 / 👎 under a card (a toast confirms), or react to the bot's message | Nothing extra for buttons; for emoji reactions the bot must be an admin of the group |
|
|
254
|
+
| LINE | Tap 👍 / 👎 on the card (LINE has no reactions API) | Rich reply style |
|
|
255
|
+
|
|
256
|
+
One vote per person per card; voting again changes it. Removing a reaction does **not** take the vote back (react with the other emoji instead).
|
|
257
|
+
Driftnet remembers which cards a Discord, Slack or Telegram reply was about for 30 days.
|
|
258
|
+
|
|
195
259
|
**Weekly digest.** Set `DRIFTNET_DIGEST=weekly` (or `daily`) and `DRIFTNET_DIGEST_TO` (or use ⚙ Settings → General) and driftnet posts one short
|
|
196
260
|
message at the chosen time: how many cards are new, how many wait in the Inbox, the five best new cards (worth, then shares) and what was shared
|
|
197
261
|
2+ times. Nothing new, nothing sent. Times are the **server's local time** (set `TZ` to change it). If driftnet was off at the scheduled time it
|
|
@@ -205,7 +269,7 @@ Bot tokens are read when driftnet starts: put them in `~/.driftnet/.env`, then s
|
|
|
205
269
|
|
|
206
270
|
## Command line
|
|
207
271
|
|
|
208
|
-
With driftnet running (`npx driftnet`), the same command talks to it. `search` and `
|
|
272
|
+
With driftnet running (`npx driftnet`), the same command talks to it. `search`, `export` and `backup` also work when it is not running (they read `~/.driftnet/driftnet.db` directly); `restore` only works when it is *not* running; `add` and `import` need it running.
|
|
209
273
|
|
|
210
274
|
| Command | Example |
|
|
211
275
|
|---|---|
|
|
@@ -213,9 +277,12 @@ With driftnet running (`npx driftnet`), the same command talks to it. `search` a
|
|
|
213
277
|
| `driftnet search [query…] [--folder id] [--kind …] [--view inbox\|favorites\|trash] [--limit N] [--json]` | `npx driftnet search vector database --kind repo --limit 5` |
|
|
214
278
|
| `driftnet open [id]` | `npx driftnet open 12` |
|
|
215
279
|
| `driftnet export [--format json\|md\|vault] [-o file]` | `npx driftnet export --format vault -o links.zip` |
|
|
216
|
-
| `driftnet import <file> [--keep-folders] [--yes]` | `npx driftnet import bookmarks.html --keep-folders` |
|
|
217
|
-
| `driftnet
|
|
280
|
+
| `driftnet import <file or pack link> [--keep-folders] [--yes]` | `npx driftnet import bookmarks.html --keep-folders` |
|
|
281
|
+
| `driftnet backup [-o file] [--secrets]` | `npx driftnet backup -o driftnet.zip` |
|
|
282
|
+
| `driftnet restore <file> [--print-settings]` | `npx driftnet restore driftnet.zip` |
|
|
283
|
+
| `driftnet status` (also says when a newer version is out) | `npx driftnet status` |
|
|
218
284
|
| `driftnet completion bash\|zsh` | `eval "$(driftnet completion zsh)"` |
|
|
285
|
+
| `driftnet init [--client claude-code\|claude-desktop\|cursor\|windsurf\|codex\|all] [--remote URL --token T] [--yes] [--dry-run]` | `npx driftnet init --yes` |
|
|
219
286
|
|
|
220
287
|
For a server elsewhere, add `--url http://host:8787 --token <password>` (or set `DRIFTNET_URL` and `DRIFTNET_TOKEN`; the password is also read from `~/.driftnet/.env`).
|
|
221
288
|
|
|
@@ -264,6 +331,12 @@ phone the sidebar folds into a ☰ drawer, and a line under the search box says
|
|
|
264
331
|
now comes back empty, the old summary is kept.
|
|
265
332
|
- **Undo** right after removing, or restore anything later from **Trash**. Trashed links disappear from
|
|
266
333
|
agents and `/llms.txt` too; if someone shares one again, it comes back.
|
|
334
|
+
- **Every change can be undone.** Open a card and press **History**: its last 20 changes (note, summary,
|
|
335
|
+
title, folder, star, trash; up to 180 days) are listed with who made them and what the card said before,
|
|
336
|
+
and **Restore** puts one back as a new change, so a restore can be undone too. Anyone who can read the
|
|
337
|
+
card can see its history (the old text of your private note is shown to the admin only); restoring needs
|
|
338
|
+
write access and passes the same checks as a normal edit. **Forget history** (admin) erases one card's list.
|
|
339
|
+
An agent can do the same with `restore_version` on `driftnet_update_item`.
|
|
267
340
|
- **Notes.** 📝 on any card for your own note (tried it? needs a GPU?). What people wrote with the link
|
|
268
341
|
in chat shows on the card too (💬), and both are searchable. **📝 Notes** in the sidebar holds
|
|
269
342
|
free-standing Markdown notes; `#12` links card 12.
|
|
@@ -278,6 +351,15 @@ phone the sidebar folds into a ☰ drawer, and a line under the search box says
|
|
|
278
351
|
folders* to mirror them under an **Imported** folder, otherwise the classifier sorts as usual. Links you
|
|
279
352
|
already have, repeats, non-web and private addresses are skipped, up to 5,000 per import. With a model
|
|
280
353
|
set up, each new link is one model call, so hundreds of links mean hundreds of calls.
|
|
354
|
+
- **Share a folder.** A folder's ⋯ menu → *Share as pack…* turns that folder, its sub-folders and the cards
|
|
355
|
+
in them into one JSON file (`"driftnet_pack": 1`, at most 1,000 cards and 2 MB): links, summaries, tags
|
|
356
|
+
and original picture URLs. Your notes, chat text, who shared what, counters, tokens and the share key never
|
|
357
|
+
go in, and neither do trashed or flagged cards. Download it, or copy a link (needs `DRIFTNET_PUBLIC_URL` or a
|
|
358
|
+
tunnel); on a private catalogue the link is signed for that one pack, so it opens without the share key and
|
|
359
|
+
shows nothing else. To pull one in, use Settings → Import → *From a pack link* (or `driftnet import <link>`,
|
|
360
|
+
or import the file): the folders are recreated under a top-level folder named after the pack and the cards
|
|
361
|
+
are stored as summarised, with no model call. Cards you already have keep your summary, text that looks like
|
|
362
|
+
instructions to an AI drops the card, and importing the same pack twice adds nothing.
|
|
281
363
|
- **Shared links open read-only.** A card link from a chat bot or an agent carries the read-only share
|
|
282
364
|
key, so it opens on a phone without a password; edit buttons appear after **Unlock** with the admin
|
|
283
365
|
password. Forgot it? Open driftnet on the computer it runs on: Settings there sets a new one.
|
|
@@ -323,9 +405,24 @@ comments, and a reel's "link in the comments" turned into its GitHub repo.
|
|
|
323
405
|
- **Right-click a link**: send it with the text of the post around it.
|
|
324
406
|
- **Right-click a selection**: send just that.
|
|
325
407
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
408
|
+
**What it reads on Threads, X and Instagram.** Only on your click, only what is on screen, never a
|
|
409
|
+
fetch on the side; if a site's markup changes it falls back to the generic reader above.
|
|
410
|
+
|
|
411
|
+
| Site | Captured |
|
|
412
|
+
|---|---|
|
|
413
|
+
| **Threads** | The post and its author, quoted / reposted posts, up to 20 replies (it opens "View replies", 3 s at most), and the links in them with redirects removed |
|
|
414
|
+
| **X / Twitter** | The tweet with `t.co` links shown as their real targets (from the link's own title, never fetched), the quoted tweet, the card link, and the author's own thread (their later tweets; other people's replies are left out) |
|
|
415
|
+
| **Instagram** (`/p/`, `/reel/`) | The caption ("more" expanded), the author, the first 20 comments and the links in them. Links in bio and Story link stickers are not on the page, so they are skipped; a "link in comments" is found |
|
|
416
|
+
|
|
417
|
+
**Install**
|
|
418
|
+
|
|
419
|
+
- **Chrome Web Store**: coming soon.
|
|
420
|
+
- **From the zip** (a [release build](https://github.com/KevinChu1110/driftnet/actions/workflows/extension.yml), or `pnpm build:extension` → `dist/driftnet-extension-<version>.zip`): unzip it, open `chrome://extensions`, turn on Developer mode, **Load unpacked**, pick the unzipped folder.
|
|
421
|
+
- **From the source**: the same, picking `apps/chrome-extension`.
|
|
422
|
+
|
|
423
|
+
It talks to `http://localhost:8787`; for a remote server, set the URL and token in its settings. It
|
|
424
|
+
reads a tab only when you click, and sends only to your own server. See the
|
|
425
|
+
[privacy policy](https://github.com/KevinChu1110/driftnet/blob/main/apps/chrome-extension/store/PRIVACY.md).
|
|
329
426
|
|
|
330
427
|
## Models
|
|
331
428
|
|
|
@@ -334,21 +431,45 @@ driftnet asks a model for one thing: fill in a JSON schema. Pick who answers.
|
|
|
334
431
|
| `DRIFTNET_LLM_PROVIDER` | Uses | Key |
|
|
335
432
|
|---|---|---|
|
|
336
433
|
| `anthropic` | Claude through the official SDK | `DRIFTNET_LLM_API_KEY` |
|
|
337
|
-
| `openai` | Anything OpenAI-compatible: OpenAI,
|
|
434
|
+
| `openai` | Anything OpenAI-compatible: OpenAI, Grok, DeepSeek, OpenRouter, LiteLLM, **Ollama / LM Studio** | `DRIFTNET_LLM_API_KEY` (none for local) |
|
|
435
|
+
| `gemini` | Google's Gemini API directly (JSON-schema output) | `DRIFTNET_LLM_API_KEY` or `GEMINI_API_KEY` |
|
|
436
|
+
| `bedrock` | Amazon Bedrock, Converse API, signed with SigV4 (no AWS SDK) | `AWS_ACCESS_KEY_ID` + `AWS_SECRET_ACCESS_KEY` (+ `AWS_SESSION_TOKEN`), or `AWS_BEARER_TOKEN_BEDROCK` |
|
|
437
|
+
| `vertex` | Gemini on Google Cloud (Vertex AI) | A service-account JSON file (`GOOGLE_APPLICATION_CREDENTIALS`), or an access token in `DRIFTNET_LLM_API_KEY` |
|
|
338
438
|
| `claude-cli` | **Your Claude subscription**, via Claude Code logged in on the same machine | none |
|
|
339
439
|
| `gemini-cli` | **Your Google account**, via Gemini CLI logged in on the same machine | none |
|
|
340
440
|
| *(empty)* | No model. Links are still extracted and listed (judged too if Jev is on), and wait in the [agent queue](#let-your-agent-do-the-reading) | none |
|
|
341
441
|
|
|
342
442
|
```bash
|
|
343
|
-
|
|
344
|
-
|
|
443
|
+
# Gemini API. The model is optional (default: gemini-flash-latest, which tracks the current Flash model)
|
|
444
|
+
DRIFTNET_LLM_PROVIDER=gemini
|
|
345
445
|
DRIFTNET_LLM_API_KEY=...
|
|
346
|
-
|
|
446
|
+
|
|
447
|
+
# Amazon Bedrock: a model or inference-profile id from your Bedrock console, in a region you have access to
|
|
448
|
+
DRIFTNET_LLM_PROVIDER=bedrock
|
|
449
|
+
DRIFTNET_LLM_MODEL=<model id>
|
|
450
|
+
DRIFTNET_LLM_REGION=us-east-1 # or AWS_REGION
|
|
451
|
+
AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... # + AWS_SESSION_TOKEN for temporary credentials
|
|
452
|
+
# …or, instead of the three AWS variables: AWS_BEARER_TOKEN_BEDROCK=<Bedrock API key>
|
|
453
|
+
|
|
454
|
+
# Google Vertex AI: a Gemini model id that exists in your region
|
|
455
|
+
DRIFTNET_LLM_PROVIDER=vertex
|
|
456
|
+
DRIFTNET_LLM_MODEL=<model id>
|
|
457
|
+
DRIFTNET_LLM_REGION=us-central1 # default; "global" also works
|
|
458
|
+
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
|
|
459
|
+
GOOGLE_CLOUD_PROJECT=my-project # optional if the key file names its project
|
|
347
460
|
```
|
|
348
461
|
|
|
349
462
|
> [!NOTE]
|
|
350
463
|
> driftnet never reads `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`. Exporting those changes how other
|
|
351
|
-
> tools bill you: Claude Code, for one, switches from your subscription to API billing.
|
|
464
|
+
> tools bill you: Claude Code, for one, switches from your subscription to API billing. The cloud
|
|
465
|
+
> providers do read their own cloud's standard variables (`AWS_*`, `GOOGLE_*`, `GEMINI_API_KEY`),
|
|
466
|
+
> because that is where those credentials live.
|
|
467
|
+
|
|
468
|
+
`gemini`, `bedrock` and `vertex` talk to fixed vendor hosts, sign and cache tokens themselves (no
|
|
469
|
+
cloud SDK is installed), time out after 30 s, retry 429 / 5xx once, and show the vendor's own error
|
|
470
|
+
message without ever printing a key. Bedrock has no schema-enforced output that every model supports,
|
|
471
|
+
so the schema goes in the prompt and the reply is validated like any other. driftnet keeps no count
|
|
472
|
+
of tokens or spend, whichever provider you pick.
|
|
352
473
|
|
|
353
474
|
Whatever the provider, replies are validated against the schema; truncated or refused answers are
|
|
354
475
|
retried once, and a link the model gives is kept only if it appears in what was fetched.
|
|
@@ -377,10 +498,43 @@ plan's limits.
|
|
|
377
498
|
|
|
378
499
|
</details>
|
|
379
500
|
|
|
501
|
+
### Judges
|
|
502
|
+
|
|
503
|
+
A judge files each link (folder, kind, worth) before the model is asked. `DRIFTNET_JUDGE` picks one:
|
|
504
|
+
|
|
505
|
+
| `DRIFTNET_JUDGE` | Does |
|
|
506
|
+
|---|---|
|
|
507
|
+
| *(empty)* | [Jev](https://console.typesafe.ai) if a TypeSafe key is set, otherwise the model files it |
|
|
508
|
+
| `jev` | Jev only |
|
|
509
|
+
| `rules` | **Free, no model.** Your rules file first, then word overlap with your folder names and descriptions. When it isn't sure it steps aside and the model (or "other") decides |
|
|
510
|
+
| `llm` / `heuristic` / `off` | No separate judge: the model files it, or "other" when there is no model |
|
|
511
|
+
| *a name* | A judge added by a plugin |
|
|
512
|
+
|
|
513
|
+
The rules file is `DRIFTNET_JUDGE_RULES`, one rule per line, first match wins:
|
|
514
|
+
|
|
515
|
+
```text
|
|
516
|
+
# pattern -> folder (an id or the folder's name)
|
|
517
|
+
github.com/* -> coding # host + path, * matches anything
|
|
518
|
+
youtube.com -> videos # a bare host also covers its subdomains
|
|
519
|
+
kind:repo -> coding # repo, product, video, article, post or other
|
|
520
|
+
contains:sourdough -> cooking # a word in the title or text
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
### Plugins
|
|
524
|
+
|
|
525
|
+
A file in `~/.driftnet/plugins` may export `{ extractors, providers, judges }` (all optional; a lone
|
|
526
|
+
extractor or a list of extractors still works). A provider is `name: (env) => ({ label, complete })`
|
|
527
|
+
and is chosen with `DRIFTNET_LLM_PROVIDER=name`; a judge is `name: (env) => ({ name, judge })` chosen
|
|
528
|
+
with `DRIFTNET_JUDGE=name`. See [`examples/plugins/rainbow-judge.mjs`](https://github.com/KevinChu1110/driftnet/blob/main/examples/plugins/rainbow-judge.mjs).
|
|
529
|
+
|
|
380
530
|
## Agents
|
|
381
531
|
|
|
382
532
|
### Read, save and vote
|
|
383
533
|
|
|
534
|
+
<a href="https://glama.ai/mcp/servers/KevinChu1110/driftnet"><img src="https://glama.ai/mcp/servers/KevinChu1110/driftnet/badges/card.svg" alt="driftnet on Glama: tool definitions rated A, 14 tools, maintenance rated A" width="380"></a>
|
|
535
|
+
|
|
536
|
+
Rated A on [Glama](https://glama.ai/mcp/servers/KevinChu1110/driftnet) for every tool definition, the tool set as a whole, maintenance and license.
|
|
537
|
+
|
|
384
538
|
In Claude Code, the plugin brings the skill and a local MCP server in one step:
|
|
385
539
|
|
|
386
540
|
```bash
|
|
@@ -481,9 +635,15 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
481
635
|
|
|
482
636
|
| Variable | Default | Purpose |
|
|
483
637
|
|---|---|---|
|
|
484
|
-
| `DRIFTNET_LLM_PROVIDER` | *(off)* | `anthropic`, `openai`, `claude-cli`, `gemini-cli
|
|
485
|
-
| `DRIFTNET_LLM_MODEL` | — | Model name. Required for `anthropic` and `
|
|
486
|
-
| `DRIFTNET_LLM_API_KEY` | — | Key for that provider (none for Ollama / LM Studio) |
|
|
638
|
+
| `DRIFTNET_LLM_PROVIDER` | *(off)* | `anthropic`, `openai`, `gemini`, `bedrock`, `vertex`, `claude-cli`, `gemini-cli`, a plugin's name, or empty |
|
|
639
|
+
| `DRIFTNET_LLM_MODEL` | — | Model name. Required for `anthropic`, `openai`, `bedrock` and `vertex`; `gemini` defaults to `gemini-flash-latest`; `claude-cli` to `haiku` |
|
|
640
|
+
| `DRIFTNET_LLM_API_KEY` | — | Key for that provider (none for Ollama / LM Studio; for `vertex`, an access token instead of a key file) |
|
|
641
|
+
| `DRIFTNET_LLM_REGION` | `us-central1` (vertex) | Region for `bedrock` (falls back to `AWS_REGION`) and `vertex` |
|
|
642
|
+
| `AWS_ACCESS_KEY_ID` · `AWS_SECRET_ACCESS_KEY` · `AWS_SESSION_TOKEN` | — | `bedrock` credentials |
|
|
643
|
+
| `AWS_BEARER_TOKEN_BEDROCK` | — | `bedrock` with a Bedrock API key instead of the three above |
|
|
644
|
+
| `GOOGLE_APPLICATION_CREDENTIALS` · `DRIFTNET_VERTEX_CREDENTIALS` | — | `vertex`: service-account key file (or its JSON text in the second) |
|
|
645
|
+
| `GOOGLE_CLOUD_PROJECT` | from the key file | `vertex` project |
|
|
646
|
+
| `GEMINI_API_KEY` | — | `gemini` key when `DRIFTNET_LLM_API_KEY` is empty |
|
|
487
647
|
| `DRIFTNET_LLM_BASE_URL` | OpenAI | Endpoint for the `openai` provider |
|
|
488
648
|
| `DRIFTNET_LLM_EFFORT` | `anthropic`: `low` | `anthropic`: `low`–`xhigh`; `openai`: `reasoning_effort`; `claude-cli`: `--effort` |
|
|
489
649
|
| `DRIFTNET_CLI_PATH` | `claude` / `gemini` | CLI binary for `claude-cli` / `gemini-cli` |
|
|
@@ -492,7 +652,10 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
492
652
|
| `DRIFTNET_SUMMARY_DEPTH` | `standard` | How much each card says: `brief`, `standard` or `detailed` |
|
|
493
653
|
| `DRIFTNET_LOCALE` | from `DRIFTNET_LANGUAGE` | Force the bot's own words to `en` or `zh-TW` |
|
|
494
654
|
| `DRIFTNET_REPLY` | `link` | Chat replies: `link` (one line + web link), `full` (the summary in chat) or `off` |
|
|
655
|
+
| `DRIFTNET_REPLY_STYLE` | `rich` | `rich` (embeds, Block Kit, Flex cards, vote buttons) or `text` (plain messages) |
|
|
495
656
|
| `TYPESAFE_API_KEY` | `~/.typesafe/api_key` | Enables the Jev judge; `DRIFTNET_JUDGE=off` disables it |
|
|
657
|
+
| `DRIFTNET_JUDGE` | Jev if keyed | `jev`, `rules`, `llm`, `heuristic`, `off` or a plugin's judge ([Judges](#judges)) |
|
|
658
|
+
| `DRIFTNET_JUDGE_RULES` | — | Rules file for the `rules` judge |
|
|
496
659
|
| `DRIFTNET_MIN_CONFIDENCE` | `0.4` | Below this, the model classifies instead of Jev |
|
|
497
660
|
| `DRIFTNET_DIGEST_TOKENS` | `350` | Token budget of the page outline |
|
|
498
661
|
| `DRIFTNET_FOLDERS` | `ai` | Starting folder template on a new database: `ai` (AI & coding), `research` (papers, articles, datasets…) or `everyday` (cooking, travel, money…). An empty catalogue also offers the choice on the page |
|
|
@@ -506,9 +669,13 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
506
669
|
| `DRIFTNET_CATEGORIES` | built-in | JSON file of starting folders, `{ "id": "description" }`, used once on a new database; after that, edit folders on the page |
|
|
507
670
|
| `GITHUB_TOKEN` | — | GitHub API limit from 60 to 5,000 requests per hour |
|
|
508
671
|
| `DRIFTNET_SUMMARY_RULES` | — | Your own instructions for every summary, e.g. “Say whether it is free.” Agents get them too |
|
|
672
|
+
| `DRIFTNET_PROFILE` | — | Who you are and what you care about, 600 characters at most (⚙ Settings › AI › About you). The model uses it to judge what is worth your time and to write each card's “why” line; agents get it too. It sits once in the model's system prompt (about 150 tokens, so prompt caching still hits) and is never copied into cards |
|
|
673
|
+
| `DRIFTNET_UPDATE_CHECK` | off | If `1`, once a day driftnet asks `registry.npmjs.org` for the latest version number and shows a small “driftnet x.y.z is out” notice in the page header (and in `driftnet status`). Nothing about you is sent. Off unless you set `1` |
|
|
509
674
|
| `DRIFTNET_BLOCK_DOMAINS` | — | Domains never catalogued (subdomains included), comma separated |
|
|
510
675
|
| `DRIFTNET_HEALTH` | `off` | `weekly` re-checks links about once a week and marks dead, archived and stale cards (see Link health). Off by default: it makes network requests |
|
|
511
|
-
| `
|
|
676
|
+
| `DRIFTNET_VIDEO` | `auto` | `auto` uses whichever of `yt-dlp`, `ffmpeg`, `tesseract` and `whisper` are installed; `captions` only reads captions and descriptions (light on battery); `off` never reads videos (see Reels and shorts) |
|
|
677
|
+
| `DRIFTNET_YTDLP`, `DRIFTNET_FFMPEG`, `DRIFTNET_TESSERACT`, `DRIFTNET_WHISPER` | found on `PATH` | Full path of a tool that is not on `PATH` (`whisper` may also be `whisper-cli`; whisper.cpp needs `DRIFTNET_WHISPER_MODEL`, a model file) |
|
|
678
|
+
| `DRIFTNET_PLUGINS` | `~/.driftnet/plugins` | Folder of plugins: extractors, providers, judges (`.js` / `.mjs`), see [`examples/plugins`](https://github.com/KevinChu1110/driftnet/blob/main/examples/plugins) |
|
|
512
679
|
| `DRIFTNET_TOKEN` | — | Admin password: writes, settings, agent tokens, MCP with every tool, the agent queue. Settable on the page |
|
|
513
680
|
| `DRIFTNET_READ_KEY` | — | Read-only share key (header or `?key=`): reading and the read-only MCP tools |
|
|
514
681
|
| `DRIFTNET_ACCESS` | `public` | `public`: anyone can read. `private`: reads need the password, the share key or an agent token |
|
|
@@ -530,10 +697,10 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
530
697
|
| `LINE_CHANNEL_SECRET` · `LINE_CHANNEL_ACCESS_TOKEN` | — | LINE |
|
|
531
698
|
|
|
532
699
|
**HTTP:** `GET /` · `GET /api/items[/:id]` (`?view=favorites|trash`) · `POST /api/items/:id/feedback` ·
|
|
533
|
-
`POST /api/items/:id/{trash,restore,favorite,unfavorite,move}` · `GET|POST /api/folders` · `PATCH|DELETE /api/folders/:id` · `POST /api/ingest` ·
|
|
700
|
+
`POST /api/items/:id/{trash,restore,favorite,unfavorite,move}` · `GET|POST /api/folders` · `PATCH|DELETE /api/folders/:id` · `GET /api/folders/:id/pack` (`?s=` signed link) · `GET /api/folders/:id/pack-link` · `POST /api/ingest` ·
|
|
534
701
|
`POST /api/chat` · `POST /api/digest/send` (`{"dryRun": true}` shows the text) · `POST /api/pending` · `POST /api/items/:id/enrich` · `GET /api/stats` ·
|
|
535
|
-
`PUT /api/items/:id/note` · `GET|POST /api/notes` · `PUT|DELETE /api/notes/:id` · `GET /api/export` (`?format=vault`) · `POST /api/import` · `GET /api/import/:job` ·
|
|
536
|
-
`GET|PUT /api/settings` (this machine, or with the token) · `GET|POST /api/agent-tokens` · `DELETE /api/agent-tokens/:id[?purge=1]` (revoke, or remove a revoked one; admin password only) · `GET /api/categories` · `POST /api/items/:id/refresh` · `POST /api/items/:id/health` · `POST /api/folders/template` · `GET /llms.txt` · `GET /feed.xml` · `GET /openapi.json` · `/mcp`
|
|
702
|
+
`PUT /api/items/:id/note` · `GET|DELETE /api/items/:id/history` · `POST /api/items/:id/history/:v/restore` · `GET|POST /api/notes` · `PUT|DELETE /api/notes/:id` · `GET /api/export` (`?format=vault`) · `POST /api/import` (`{content}` or `{url}` of a pack) · `GET /api/import/:job` ·
|
|
703
|
+
`GET|PUT /api/settings` (this machine, or with the token) · `GET /api/backup` (`?secrets=1` plus the password again in `X-Driftnet-Confirm`) · `POST /api/backup/restore` (a zip body; both admin password only) · `GET|POST /api/agent-tokens` · `DELETE /api/agent-tokens/:id[?purge=1]` (revoke, or remove a revoked one; admin password only) · `GET /api/categories` · `POST /api/items/:id/refresh` · `POST /api/items/:id/health` · `POST /api/folders/template` · `GET /llms.txt` · `GET /feed.xml` · `GET /openapi.json` · `/mcp`
|
|
537
704
|
|
|
538
705
|
</details>
|
|
539
706
|
|
|
@@ -585,7 +752,13 @@ driftnet.example.com {
|
|
|
585
752
|
> (title, outline, the chat text it was shared with) to **TypeSafe** if Jev is on and to **your
|
|
586
753
|
> model provider** if one is set. Chat messages without a link are never processed or stored. With
|
|
587
754
|
> Ollama and `DRIFTNET_JUDGE=off`, nothing leaves your machine. Take it all with you any time: export
|
|
588
|
-
> to Markdown or an Obsidian / Notion vault from the sidebar, or `GET /api/export`.
|
|
755
|
+
> to Markdown or an Obsidian / Notion vault from the sidebar, or `GET /api/export`. If you turn it on
|
|
756
|
+
> (`DRIFTNET_UPDATE_CHECK=1`), the only other call driftnet makes on its own is the once-a-day check for
|
|
757
|
+
> a new version (a plain request to the npm registry); it is off unless turned on.
|
|
758
|
+
|
|
759
|
+
### Backup and restore
|
|
760
|
+
|
|
761
|
+
**⚙ Settings › General › Backup** downloads one zip: `driftnet.db` (a consistent snapshot, made while driftnet runs), `settings.env` and `manifest.json` (driftnet version, schema version, date, number of cards). **Passwords, keys and tokens are left out of `settings.env`**; tick “Include passwords and keys” and type the admin password again to keep them. Restoring from a file checks it first (it must be a driftnet backup with an intact database, not from a newer driftnet), keeps your current data as `driftnet.db.before-restore-<time>`, and swaps the backup in the next time driftnet starts, so the page asks you to restart. Settings inside a backup are shown but never applied; copy what you want. Only the admin password can back up or restore, never a share key or agent token. From a terminal: `npx driftnet backup -o driftnet.zip` (works while stopped too) and `npx driftnet restore driftnet.zip` (driftnet must be stopped).
|
|
589
762
|
|
|
590
763
|
## Contributing
|
|
591
764
|
|
|
@@ -613,14 +786,8 @@ Extend it: a site (a plugin file in `~/.driftnet/plugins`, like
|
|
|
613
786
|
[`examples/plugins/hackernews.mjs`](https://github.com/KevinChu1110/driftnet/blob/main/examples/plugins/hackernews.mjs), or `registerExtractor()`), a model (`LlmProvider`), a judge (`Judge`), a chat
|
|
614
787
|
platform (`handleChatText()`), browser capture (`collect.js`), or a bot language (`i18n.ts`).
|
|
615
788
|
|
|
616
|
-
**
|
|
617
|
-
|
|
618
|
-
- [ ] **Video.** Captions and on-screen text with local OCR first, local speech-to-text second; many
|
|
619
|
-
reels only say the tool's name out loud.
|
|
620
|
-
- [ ] **Rich replies.** LINE Flex, Slack Block Kit, Discord embeds, voting by reaction.
|
|
621
|
-
- [ ] **Weekly digest** posted back to the chat.
|
|
622
|
-
- [ ] **Extension polish.** Threads / X / Instagram capture, a Chrome Web Store build.
|
|
623
|
-
- [ ] **More adapters.** Native Gemini, Bedrock, Vertex; more judges.
|
|
789
|
+
**Want to help?** Look for [`good first issue`](https://github.com/KevinChu1110/driftnet/labels/good%20first%20issue) on GitHub, or open an issue with
|
|
790
|
+
a link driftnet handled badly: real links people share are how every feature here was found.
|
|
624
791
|
|
|
625
792
|
## Support
|
|
626
793
|
|