driftnet 0.9.0 → 0.10.1
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 +94 -28
- package/README.zh-TW.md +91 -28
- package/dist/driftnet.mjs +2042 -217
- package/package.json +1 -1
- package/public/index.html +202 -8
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
|
@@ -84,27 +84,49 @@ bot ▸ 📌 This week in AI (3/11)|News + Paperclip, RealWonder
|
|
|
84
84
|
|
|
85
85
|
## 🚀 Quick start
|
|
86
86
|
|
|
87
|
-
|
|
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.
|
|
88
89
|
|
|
89
|
-
###
|
|
90
|
+
### Easiest: let your AI agent install it
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
Copy this into Claude Code, Cursor, Codex or any agent that can run commands on your computer:
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
```text
|
|
95
|
+
Read https://raw.githubusercontent.com/KevinChu1110/driftnet/main/docs/llms-install.txt and set up driftnet for me.
|
|
96
|
+
```
|
|
94
97
|
|
|
95
|
-
|
|
98
|
+
It checks Node.js, starts driftnet, connects itself over MCP and tells you when it is done.
|
|
96
99
|
|
|
97
|
-
###
|
|
100
|
+
### Or run one command yourself
|
|
101
|
+
|
|
102
|
+
You need [Node.js](https://nodejs.org) 22.13 or newer. Then, in a terminal:
|
|
98
103
|
|
|
99
104
|
```bash
|
|
100
|
-
npx driftnet
|
|
105
|
+
npx driftnet
|
|
101
106
|
```
|
|
102
107
|
|
|
103
|
-
|
|
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`.
|
|
112
|
+
|
|
113
|
+
Your settings live in `~/.driftnet/.env` and the catalogue in `~/.driftnet/driftnet.db`.
|
|
114
|
+
|
|
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.
|
|
104
125
|
|
|
105
|
-
|
|
126
|
+
<details>
|
|
127
|
+
<summary><b>Other ways to run it: from source, Docker</b></summary>
|
|
106
128
|
|
|
107
|
-
|
|
129
|
+
From source, to hack on it or run it as a login service:
|
|
108
130
|
|
|
109
131
|
```bash
|
|
110
132
|
git clone https://github.com/KevinChu1110/driftnet && cd driftnet
|
|
@@ -113,9 +135,7 @@ pnpm start # http://localhost:87
|
|
|
113
135
|
pnpm service:install # optional: start at login (macOS / Linux)
|
|
114
136
|
```
|
|
115
137
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
Nothing to install but Docker:
|
|
138
|
+
With Docker:
|
|
119
139
|
|
|
120
140
|
```bash
|
|
121
141
|
docker build -t driftnet https://github.com/KevinChu1110/driftnet.git
|
|
@@ -123,15 +143,9 @@ docker run -d -p 127.0.0.1:8787:8787 -v driftnet:/data -e DRIFTNET_HOST=0.0.0.0
|
|
|
123
143
|
```
|
|
124
144
|
|
|
125
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.
|
|
126
147
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
curl -X POST localhost:8787/api/chat -H 'content-type: application/json' \
|
|
131
|
-
-d '{"text": "look at this https://github.com/paperclipai/paperclip"}'
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
You get the reply a chat would get, as JSON, after 5–30 seconds; the card is already on the page.
|
|
148
|
+
</details>
|
|
135
149
|
|
|
136
150
|
<details>
|
|
137
151
|
<summary><b>Not working?</b></summary>
|
|
@@ -164,7 +178,16 @@ Most links never reach a model; the ones that do arrive as a short outline.
|
|
|
164
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.
|
|
165
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.
|
|
166
180
|
|
|
167
|
-
**Reels and shorts.** 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.
|
|
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
|
+
|
|
183
|
+
Two more steps are **off by default** and opt-in, because they send something to your model. Both run only when everything above still left the item thin, and both ride inside the *same* summary request (never one request per frame, never a separate call): (4) `DRIFTNET_VIDEO=watch` lets a video-capable model watch the video. With `gemini` or `vertex` as the summary provider, a YouTube link goes as the link itself (no download) and a reel from another site goes as the downloaded clip only if it is 14 MB or smaller (Gemini's request limit is 20 MB including encoding); other providers cannot watch, so driftnet falls through to frames. `DRIFTNET_VIDEO_FRAMES=vision` attaches up to 8 distinct frames (about one per 2 seconds, near-duplicates and black frames dropped, at most 768 px wide, JPEG) when your summary model accepts pictures: an OpenAI-compatible endpoint (including Ollama vision models), Claude, Gemini or Vertex. Frames and videos go only to the model you configured. If a model turns out to be text-only, the item is retried once without the frames. (5) If nothing could be read at all (no captions, no OCR, no speech, nothing to watch or show), driftnet does not guess from a title: the card stays pending with a short hint, `video: needs a transcript`, in the agent queue, so an agent with its own video tools can write it up.
|
|
184
|
+
|
|
185
|
+
| Goal | A model to try (check each model card for its video/image and size limits) | Setting |
|
|
186
|
+
|---|---|---|
|
|
187
|
+
| Watch YouTube videos | Gemini Flash (`gemini` or `vertex`) | `DRIFTNET_VIDEO=watch` |
|
|
188
|
+
| Captions or transcripts only | Any small, cheap model | default |
|
|
189
|
+
| Frames, fully local | A vision model on Ollama, e.g. a Qwen-VL or Gemma vision build, through `DRIFTNET_LLM_PROVIDER=openai` + `DRIFTNET_LLM_BASE_URL=http://localhost:11434/v1` | `DRIFTNET_VIDEO_FRAMES=vision` |
|
|
190
|
+
| Frames, hosted | Claude or Gemini | `DRIFTNET_VIDEO_FRAMES=vision` |
|
|
168
191
|
|
|
169
192
|
<details>
|
|
170
193
|
<summary><b>All eight steps</b></summary>
|
|
@@ -189,6 +212,28 @@ without running one: on real links, a Chinese article went from 831 to 404 token
|
|
|
189
212
|
|
|
190
213
|
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.
|
|
191
214
|
|
|
215
|
+
## Search by meaning
|
|
216
|
+
|
|
217
|
+
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.
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
ollama pull nomic-embed-text # that's it: restart driftnet and the startup line says "semantic search: on"
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
- **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.
|
|
224
|
+
- **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.
|
|
225
|
+
- **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.
|
|
226
|
+
- **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.
|
|
227
|
+
|
|
228
|
+
| Variable | Default | Purpose |
|
|
229
|
+
|---|---|---|
|
|
230
|
+
| `DRIFTNET_EMBED` | `auto` | `auto`: on when a local Ollama has the embedding model, or when `DRIFTNET_EMBED_PROVIDER` is set. `off`: never |
|
|
231
|
+
| `DRIFTNET_EMBED_PROVIDER` | *(auto)* | `ollama`, `openai` (also any OpenAI-compatible `/embeddings`, including Ollama's `/v1`) or `gemini` |
|
|
232
|
+
| `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 |
|
|
233
|
+
| `DRIFTNET_EMBED_BASE_URL` | Ollama `http://127.0.0.1:11434`, OpenAI's own | Endpoint for `ollama` / `openai` |
|
|
234
|
+
| `DRIFTNET_EMBED_API_KEY` | — | Key for `openai` / `gemini` (not needed locally) |
|
|
235
|
+
| `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 |
|
|
236
|
+
|
|
192
237
|
## Ways in
|
|
193
238
|
|
|
194
239
|
| | Set up | On a laptop? | Sent while it was off |
|
|
@@ -233,7 +278,7 @@ Bot tokens are read when driftnet starts: put them in `~/.driftnet/.env`, then s
|
|
|
233
278
|
|
|
234
279
|
## Command line
|
|
235
280
|
|
|
236
|
-
With driftnet running (`npx driftnet`), the same command talks to it. `search` and `
|
|
281
|
+
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.
|
|
237
282
|
|
|
238
283
|
| Command | Example |
|
|
239
284
|
|---|---|
|
|
@@ -242,7 +287,9 @@ With driftnet running (`npx driftnet`), the same command talks to it. `search` a
|
|
|
242
287
|
| `driftnet open [id]` | `npx driftnet open 12` |
|
|
243
288
|
| `driftnet export [--format json\|md\|vault] [-o file]` | `npx driftnet export --format vault -o links.zip` |
|
|
244
289
|
| `driftnet import <file or pack link> [--keep-folders] [--yes]` | `npx driftnet import bookmarks.html --keep-folders` |
|
|
245
|
-
| `driftnet
|
|
290
|
+
| `driftnet backup [-o file] [--secrets]` | `npx driftnet backup -o driftnet.zip` |
|
|
291
|
+
| `driftnet restore <file> [--print-settings]` | `npx driftnet restore driftnet.zip` |
|
|
292
|
+
| `driftnet status` (also says when a newer version is out) | `npx driftnet status` |
|
|
246
293
|
| `driftnet completion bash\|zsh` | `eval "$(driftnet completion zsh)"` |
|
|
247
294
|
| `driftnet init [--client claude-code\|claude-desktop\|cursor\|windsurf\|codex\|all] [--remote URL --token T] [--yes] [--dry-run]` | `npx driftnet init --yes` |
|
|
248
295
|
|
|
@@ -293,6 +340,12 @@ phone the sidebar folds into a ☰ drawer, and a line under the search box says
|
|
|
293
340
|
now comes back empty, the old summary is kept.
|
|
294
341
|
- **Undo** right after removing, or restore anything later from **Trash**. Trashed links disappear from
|
|
295
342
|
agents and `/llms.txt` too; if someone shares one again, it comes back.
|
|
343
|
+
- **Every change can be undone.** Open a card and press **History**: its last 20 changes (note, summary,
|
|
344
|
+
title, folder, star, trash; up to 180 days) are listed with who made them and what the card said before,
|
|
345
|
+
and **Restore** puts one back as a new change, so a restore can be undone too. Anyone who can read the
|
|
346
|
+
card can see its history (the old text of your private note is shown to the admin only); restoring needs
|
|
347
|
+
write access and passes the same checks as a normal edit. **Forget history** (admin) erases one card's list.
|
|
348
|
+
An agent can do the same with `restore_version` on `driftnet_update_item`.
|
|
296
349
|
- **Notes.** 📝 on any card for your own note (tried it? needs a GPU?). What people wrote with the link
|
|
297
350
|
in chat shows on the card too (💬), and both are searchable. **📝 Notes** in the sidebar holds
|
|
298
351
|
free-standing Markdown notes; `#12` links card 12.
|
|
@@ -487,6 +540,10 @@ with `DRIFTNET_JUDGE=name`. See [`examples/plugins/rainbow-judge.mjs`](https://g
|
|
|
487
540
|
|
|
488
541
|
### Read, save and vote
|
|
489
542
|
|
|
543
|
+
<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>
|
|
544
|
+
|
|
545
|
+
Rated A on [Glama](https://glama.ai/mcp/servers/KevinChu1110/driftnet) for every tool definition, the tool set as a whole, maintenance and license.
|
|
546
|
+
|
|
490
547
|
In Claude Code, the plugin brings the skill and a local MCP server in one step:
|
|
491
548
|
|
|
492
549
|
```bash
|
|
@@ -621,9 +678,12 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
621
678
|
| `DRIFTNET_CATEGORIES` | built-in | JSON file of starting folders, `{ "id": "description" }`, used once on a new database; after that, edit folders on the page |
|
|
622
679
|
| `GITHUB_TOKEN` | — | GitHub API limit from 60 to 5,000 requests per hour |
|
|
623
680
|
| `DRIFTNET_SUMMARY_RULES` | — | Your own instructions for every summary, e.g. “Say whether it is free.” Agents get them too |
|
|
681
|
+
| `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 |
|
|
682
|
+
| `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` |
|
|
624
683
|
| `DRIFTNET_BLOCK_DOMAINS` | — | Domains never catalogued (subdomains included), comma separated |
|
|
625
684
|
| `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 |
|
|
626
|
-
| `DRIFTNET_VIDEO` | `auto` | `
|
|
685
|
+
| `DRIFTNET_VIDEO` | `auto` | `auto` uses whichever of `yt-dlp`, `ffmpeg`, `tesseract` and `whisper` are installed; `captions` only reads captions and descriptions (light on battery); `watch` is `auto`, then, if the item is still thin, lets Gemini or Vertex watch the video (sends the video or its YouTube link to that model); `off` never reads videos (see Reels and shorts) |
|
|
686
|
+
| `DRIFTNET_VIDEO_FRAMES` | `off` | `vision` attaches up to 8 distinct frames to the same summary request when the item is still thin (only to your configured model, which must accept pictures, e.g. an Ollama vision model) |
|
|
627
687
|
| `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) |
|
|
628
688
|
| `DRIFTNET_PLUGINS` | `~/.driftnet/plugins` | Folder of plugins: extractors, providers, judges (`.js` / `.mjs`), see [`examples/plugins`](https://github.com/KevinChu1110/driftnet/blob/main/examples/plugins) |
|
|
629
689
|
| `DRIFTNET_TOKEN` | — | Admin password: writes, settings, agent tokens, MCP with every tool, the agent queue. Settable on the page |
|
|
@@ -649,8 +709,8 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
649
709
|
**HTTP:** `GET /` · `GET /api/items[/:id]` (`?view=favorites|trash`) · `POST /api/items/:id/feedback` ·
|
|
650
710
|
`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` ·
|
|
651
711
|
`POST /api/chat` · `POST /api/digest/send` (`{"dryRun": true}` shows the text) · `POST /api/pending` · `POST /api/items/:id/enrich` · `GET /api/stats` ·
|
|
652
|
-
`PUT /api/items/:id/note` · `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` ·
|
|
653
|
-
`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`
|
|
712
|
+
`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` ·
|
|
713
|
+
`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`
|
|
654
714
|
|
|
655
715
|
</details>
|
|
656
716
|
|
|
@@ -702,7 +762,13 @@ driftnet.example.com {
|
|
|
702
762
|
> (title, outline, the chat text it was shared with) to **TypeSafe** if Jev is on and to **your
|
|
703
763
|
> model provider** if one is set. Chat messages without a link are never processed or stored. With
|
|
704
764
|
> Ollama and `DRIFTNET_JUDGE=off`, nothing leaves your machine. Take it all with you any time: export
|
|
705
|
-
> to Markdown or an Obsidian / Notion vault from the sidebar, or `GET /api/export`.
|
|
765
|
+
> to Markdown or an Obsidian / Notion vault from the sidebar, or `GET /api/export`. If you turn it on
|
|
766
|
+
> (`DRIFTNET_UPDATE_CHECK=1`), the only other call driftnet makes on its own is the once-a-day check for
|
|
767
|
+
> a new version (a plain request to the npm registry); it is off unless turned on.
|
|
768
|
+
|
|
769
|
+
### Backup and restore
|
|
770
|
+
|
|
771
|
+
**⚙ 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).
|
|
706
772
|
|
|
707
773
|
## Contributing
|
|
708
774
|
|
package/README.zh-TW.md
CHANGED
|
@@ -82,27 +82,48 @@ bot ▸ 📌 本週 AI 大事彙整(3/11)|新聞動態 + Paperclip、Rea
|
|
|
82
82
|
|
|
83
83
|
## 🚀 開始使用
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
全部跑在你自己的電腦上:不用租伺服器,也不用註冊帳號。想先看看?
|
|
86
|
+
**[線上試玩](https://kevinchu1110.github.io/driftnet/)** 直接在瀏覽器跑真正的網頁。
|
|
86
87
|
|
|
87
|
-
###
|
|
88
|
+
### 最簡單:交給你的 AI agent 安裝
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
把下面這句複製給 Claude Code、Cursor、Codex,或任何能在你電腦上執行指令的 agent:
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
```text
|
|
93
|
+
Read https://raw.githubusercontent.com/KevinChu1110/driftnet/main/docs/llms-install.txt and set up driftnet for me.
|
|
94
|
+
```
|
|
92
95
|
|
|
93
|
-
|
|
96
|
+
它會檢查 Node.js、啟動 driftnet、透過 MCP 把自己接上,完成後告訴你。
|
|
94
97
|
|
|
95
|
-
###
|
|
98
|
+
### 或自己跑一行指令
|
|
99
|
+
|
|
100
|
+
需要 [Node.js](https://nodejs.org) 22.13 以上。在終端機輸入:
|
|
96
101
|
|
|
97
102
|
```bash
|
|
98
|
-
npx driftnet
|
|
103
|
+
npx driftnet
|
|
99
104
|
```
|
|
100
105
|
|
|
101
|
-
|
|
106
|
+
瀏覽器會自動打開 **http://localhost:8787**:這是你自己電腦提供的 driftnet 網頁
|
|
107
|
+
(*localhost* 就是「這台電腦」,別人看不到)。⚙ 設定會帶你選模型,也可以先跳過、不接模型直接用。
|
|
108
|
+
想一次接好這台電腦上的 AI 工具(Claude Code、Claude Desktop、Cursor、Windsurf、Codex):`npx driftnet init`。
|
|
109
|
+
|
|
110
|
+
設定存在 `~/.driftnet/.env`,清單存在 `~/.driftnet/driftnet.db`。
|
|
111
|
+
|
|
112
|
+
### 加入第一個連結
|
|
113
|
+
|
|
114
|
+
任選一種:
|
|
115
|
+
|
|
116
|
+
- **在網頁上:** 把連結貼進輸入框,按「收錄」。
|
|
117
|
+
- **在終端機:** `npx driftnet add https://github.com/paperclipai/paperclip`
|
|
118
|
+
- **在瀏覽器:** [Chrome 擴充](#chrome-擴充)會送出你正在看的頁面。
|
|
119
|
+
- **在聊天室:** 接上 [Discord、Telegram、Slack 或 LINE 機器人](#接法),直接把連結丟進去。
|
|
120
|
+
|
|
121
|
+
5~30 秒內就會出現一張卡片:它是什麼、為什麼值得你看、放進了哪個資料夾。
|
|
102
122
|
|
|
103
|
-
|
|
123
|
+
<details>
|
|
124
|
+
<summary><b>其他跑法:從原始碼、Docker</b></summary>
|
|
104
125
|
|
|
105
|
-
|
|
126
|
+
從原始碼跑,想改程式或設成開機自動執行:
|
|
106
127
|
|
|
107
128
|
```bash
|
|
108
129
|
git clone https://github.com/KevinChu1110/driftnet && cd driftnet
|
|
@@ -111,9 +132,7 @@ pnpm start # http://localhost:87
|
|
|
111
132
|
pnpm service:install # 選用:登入後自動執行(macOS/Linux)
|
|
112
133
|
```
|
|
113
134
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
只要裝 Docker:
|
|
135
|
+
用 Docker:
|
|
117
136
|
|
|
118
137
|
```bash
|
|
119
138
|
docker build -t driftnet https://github.com/KevinChu1110/driftnet.git
|
|
@@ -121,15 +140,9 @@ docker run -d -p 127.0.0.1:8787:8787 -v driftnet:/data -e DRIFTNET_HOST=0.0.0.0
|
|
|
121
140
|
```
|
|
122
141
|
|
|
123
142
|
不加 `start` 時,容器就是 stdio 的 MCP 伺服器(`docker run -i --rm -v driftnet:/data driftnet`)。
|
|
143
|
+
用 `DRIFTNET_HOME` 可以把設定和清單一起搬到別的地方。
|
|
124
144
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
curl -X POST localhost:8787/api/chat -H 'content-type: application/json' \
|
|
129
|
-
-d '{"text": "看這個 https://github.com/paperclipai/paperclip"}'
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
5~30 秒後會收到 JSON,內容就是聊天室會收到的回覆;卡片已經出現在網頁上。
|
|
145
|
+
</details>
|
|
133
146
|
|
|
134
147
|
<details>
|
|
135
148
|
<summary><b>沒反應?</b></summary>
|
|
@@ -162,7 +175,16 @@ curl -X POST localhost:8787/api/chat -H 'content-type: application/json' \
|
|
|
162
175
|
6. **放進你的資料夾。** AI 照資料夾的路徑和說明分類;新連結會放在收件匣,附兩、三個建議資料夾,點一下就歸檔。
|
|
163
176
|
7. **顯示在網頁上,也提供給 agent。** 網頁上看得到,agent 可以走 MCP、`/llms.txt`、`/feed.xml` 或對外 Webhook 取得。匯出可以整包帶走。
|
|
164
177
|
|
|
165
|
-
**Reels 與 Shorts。**
|
|
178
|
+
**Reels 與 Shorts。** 全部都是選配:下面這些工具一個都沒裝,driftnet 也照樣讀貼文的標題和說明。很多分享的 reels 只用講的報工具名稱。當 Instagram、Facebook、Threads、TikTok、YouTube Shorts 或 X 的連結是影片,而頁面文字幾乎沒內容時,driftnet 會用你機器上已有的工具讀影片本身,由便宜到貴,文字夠了就停:(1)用 `yt-dlp` 取字幕、標題和說明,不下載影片;(2)以低畫質下載影片(最多 60 MB、前 3 分鐘),每 2 秒取一張畫面,用 `tesseract` 辨識(有裝的話支援英文與中文);(3)還是太少才把音訊交給 `whisper`(也可用 whisper.cpp 的 `whisper-cli`,需設定 `DRIFTNET_WHISPER_MODEL`)。讀到的內容會加上 `[captions]`、`[on-screen text]`、`[speech]` 標籤附在文字後面(最多 6,000 字元),並和頁面文字一樣先過防護;卡片會標示「已從影片讀取」。沒裝的工具就跳過。用筆電電池時可設 `DRIFTNET_VIDEO=captions`,做完第 1 步就停(不下載影片、不跑文字辨識和語音模型);`off` 則全部關閉。工具不經過 shell、在一定會刪除的私有暫存資料夾裡執行、環境變數中拿掉 driftnet 的機密、每個步驟都有時間上限、拒絕私有或本機位址的連結,而且一次只處理一支影片。
|
|
179
|
+
|
|
180
|
+
另外兩個步驟**預設關閉**,要自己打開,因為它們會把東西送給你的模型。兩者都只在前面的步驟做完、內容仍然太少時才執行,而且都附在*同一次*摘要請求裡(不會一張畫面一次請求,也不會另外呼叫):(4)`DRIFTNET_VIDEO=watch` 讓支援影片的模型直接看影片。摘要供應商是 `gemini` 或 `vertex` 時,YouTube 連結直接以連結送出(不下載),其他網站的 reel 則只有在下載的片段不超過 14 MB 時才內嵌送出(Gemini 的請求上限是含編碼共 20 MB);其他供應商不能看影片,driftnet 會改走畫面。`DRIFTNET_VIDEO_FRAMES=vision` 在你的摘要模型看得懂圖片時,附上最多 8 張不重複的畫面(大約每 2 秒一張,相近與全黑的畫面會剔除,寬度最多 768 px,JPEG):OpenAI 相容端點(包含 Ollama 的視覺模型)、Claude、Gemini、Vertex 都可以。畫面和影片只會送給你設定的那個模型。如果模型其實只吃文字,該項目會去掉畫面重試一次。(5)如果什麼都讀不到(沒有字幕、沒有畫面文字、沒有語音、也沒有可看的內容),driftnet 不會只憑標題亂猜:卡片維持待處理,在 agent 佇列裡帶一行提示 `video: needs a transcript`,讓有自己影片工具的 agent 補寫。
|
|
181
|
+
|
|
182
|
+
| 目的 | 可以試的模型(影片/圖片與大小限制請看各模型的 model card) | 設定 |
|
|
183
|
+
|---|---|---|
|
|
184
|
+
| 看 YouTube 影片 | Gemini Flash(`gemini` 或 `vertex`) | `DRIFTNET_VIDEO=watch` |
|
|
185
|
+
| 只用字幕或逐字稿 | 任何小型、便宜的模型 | 預設 |
|
|
186
|
+
| 畫面,完全在本機 | Ollama 上的視覺模型,例如 Qwen-VL 或 Gemma 視覺版,透過 `DRIFTNET_LLM_PROVIDER=openai` 加 `DRIFTNET_LLM_BASE_URL=http://localhost:11434/v1` | `DRIFTNET_VIDEO_FRAMES=vision` |
|
|
187
|
+
| 畫面,雲端 | Claude 或 Gemini | `DRIFTNET_VIDEO_FRAMES=vision` |
|
|
166
188
|
|
|
167
189
|
<details>
|
|
168
190
|
<summary><b>八個步驟的完整說明</b></summary>
|
|
@@ -186,6 +208,28 @@ curl -X POST localhost:8787/api/chat -H 'content-type: application/json' \
|
|
|
186
208
|
|
|
187
209
|
連結會失效、儲存庫會被封存。設定 `DRIFTNET_HEALTH=weekly`(建議開啟;預設關閉,因為會對外發送請求),driftnet 就會每週左右重新檢查每張卡片,一次檢查幾張。GitHub 儲存庫走 API(星數、是否封存、最後推送;可設 `GITHUB_TOKEN` 提高上限,遇到速率限制會自動暫停);其他連結則用同一套私有位址防護發一個輕量的 `HEAD`。卡片會被標成 `dead`(404/已移除,或網域已不存在)、`archived`(已封存)、`stale`(超過 18 個月沒有推送)或 `moved`(儲存庫改名/搬家);伺服器錯誤和逾時不會改變狀態,之後會再試。被標記的卡片會顯示徽章,出現在網頁的「需要檢查」和 `driftnet_search_items` 的 `view=needs_review`,卡片上的「檢查連結」按鈕(或 `POST /api/items/:id/health`)可以立刻測一個連結。
|
|
188
210
|
|
|
211
|
+
## 以語意搜尋
|
|
212
|
+
|
|
213
|
+
選配。有了嵌入模型,搜尋除了比對字,也能依「內容在講什麼」找卡片:搜「登入」會找到 OAuth 工具,搜「掃描文件」會找到 OCR 工具。找不到本機模型(或你沒指定服務)就不會開,**不花摘要的 token**;關閉、太慢或服務掛掉時,搜尋就和以前的關鍵字搜尋完全一樣。
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
ollama pull nomic-embed-text # 這樣就好:重啟 driftnet,啟動訊息會寫「semantic search: on」
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
- **嵌入什麼。**每張卡片幾百個字:名稱、一句話介紹、標籤、重點、標題、連結的網域,也就是摘要模型本來就看過的欄位。聊天內容一律不嵌入;你自己寫的筆記只有在模型跑在這台電腦上時才會用到。卡片存好後在背景嵌入(一次一個請求),開啟後既有的卡片也會慢慢補上;存連結不會等它。
|
|
220
|
+
- **資料去哪。**`ollama` 和本機的 `DRIFTNET_EMBED_BASE_URL` 全程不離開你的電腦。`openai`、`gemini` 會把上述卡片文字和每次搜尋的關鍵字送給該服務,能接受再指定。金鑰只會送到該服務自己的位址(或你填的網址),摘要模型的金鑰只有同一家時才會沿用。
|
|
221
|
+
- **速度。**向量用精簡格式存、在記憶體內比對(一萬張卡片約 12 毫秒)。搜尋最多等 1.5 秒取得關鍵字的向量,等不到就改用關鍵字;失敗後 30 秒內不再嘗試。重複的搜尋有快取。
|
|
222
|
+
- **相關卡片。**卡片詳情最多列 5 張相似的卡片(有向量用向量,否則用共同標籤和名稱字詞)。`GET /api/items/:id` 和 `driftnet_get_item` 工具也會附上同一份清單。
|
|
223
|
+
|
|
224
|
+
| 變數 | 預設 | 用途 |
|
|
225
|
+
|---|---|---|
|
|
226
|
+
| `DRIFTNET_EMBED` | `auto` | `auto`:本機 Ollama 有嵌入模型、或設了 `DRIFTNET_EMBED_PROVIDER` 就開。`off`:一律不開 |
|
|
227
|
+
| `DRIFTNET_EMBED_PROVIDER` | *(自動)* | `ollama`、`openai`(也適用任何相容的 `/embeddings`,包含 Ollama 的 `/v1`)或 `gemini` |
|
|
228
|
+
| `DRIFTNET_EMBED_MODEL` | 依服務 | `nomic-embed-text`(Ollama)、`text-embedding-3-small`(OpenAI)、`gemini-embedding-001`(Gemini)。更換後會在背景重新嵌入全部卡片 |
|
|
229
|
+
| `DRIFTNET_EMBED_BASE_URL` | Ollama `http://127.0.0.1:11434`、OpenAI 官方位址 | `ollama` / `openai` 的端點 |
|
|
230
|
+
| `DRIFTNET_EMBED_API_KEY` | — | `openai` / `gemini` 的金鑰(本機不需要) |
|
|
231
|
+
| `DRIFTNET_EMBED_FLOOR` | nomic `0.55`;OpenAI `0.3`;Gemini `0.5` | 沒有字面相符時,餘弦相似度要多高才會出現;調高則結果變少。只實測過 nomic-embed-text |
|
|
232
|
+
|
|
189
233
|
## 接法
|
|
190
234
|
|
|
191
235
|
| | 設定 | 筆電上能用? | 關機期間的訊息 |
|
|
@@ -226,7 +270,7 @@ curl -X POST localhost:8787/api/chat -H 'content-type: application/json' \
|
|
|
226
270
|
|
|
227
271
|
## 指令列
|
|
228
272
|
|
|
229
|
-
driftnet 在跑的時候(`npx driftnet`),同一個指令就能跟它說話。`search` 和 `
|
|
273
|
+
driftnet 在跑的時候(`npx driftnet`),同一個指令就能跟它說話。`search`、`export` 和 `backup` 在它沒開時也能用(直接讀 `~/.driftnet/driftnet.db`);`restore` 只能在它「沒開」時用;`add` 和 `import` 需要它在跑。
|
|
230
274
|
|
|
231
275
|
| 指令 | 範例 |
|
|
232
276
|
|---|---|
|
|
@@ -235,7 +279,9 @@ driftnet 在跑的時候(`npx driftnet`),同一個指令就能跟它說話
|
|
|
235
279
|
| `driftnet open [id]` | `npx driftnet open 12` |
|
|
236
280
|
| `driftnet export [--format json\|md\|vault] [-o 檔案]` | `npx driftnet export --format vault -o links.zip` |
|
|
237
281
|
| `driftnet import <檔案或資料夾包連結> [--keep-folders] [--yes]` | `npx driftnet import bookmarks.html --keep-folders` |
|
|
238
|
-
| `driftnet
|
|
282
|
+
| `driftnet backup [-o file] [--secrets]` | `npx driftnet backup -o driftnet.zip` |
|
|
283
|
+
| `driftnet restore <file> [--print-settings]` | `npx driftnet restore driftnet.zip` |
|
|
284
|
+
| `driftnet status`(有新版也會告訴你) | `npx driftnet status` |
|
|
239
285
|
| `driftnet completion bash\|zsh` | `eval "$(driftnet completion zsh)"` |
|
|
240
286
|
| `driftnet init [--client claude-code\|claude-desktop\|cursor\|windsurf\|codex\|all] [--remote URL --token T] [--yes] [--dry-run]` | `npx driftnet init --yes` |
|
|
241
287
|
|
|
@@ -272,6 +318,11 @@ driftnet 在跑的時候(`npx driftnet`),同一個指令就能跟它說話
|
|
|
272
318
|
- **重新整理**卡片:重新抓網頁、重寫摘要,適合當初卡在登入牆、或網頁內容已經改了的時候。你的筆記、最愛、分享次數和自己選的資料夾都會保留;
|
|
273
319
|
如果這次抓回來是空的,會保留原本的摘要。
|
|
274
320
|
- 剛移除時可以馬上按**復原**,之後也能隨時從**垃圾桶**還原。移到垃圾桶的連結,agent 和 `/llms.txt` 也看不到;如果有人再次分享,它會自動回來。
|
|
321
|
+
- **每個改動都能復原。**打開卡片按**修改紀錄**,會列出最近 20 次改動(筆記、摘要、標題、資料夾、星號、垃圾桶;最多保留 180 天),
|
|
322
|
+
顯示是誰改的、改之前的內容;按**還原**會把它放回來,而且這次還原本身也是一筆紀錄,所以還原也能再復原。
|
|
323
|
+
看得到卡片的人就看得到它的紀錄(你私人筆記的舊內容只有管理員看得到);還原需要寫入權限,並且和一般編輯一樣要通過同樣的檢查。
|
|
324
|
+
**清除紀錄**(管理員)可以抹掉單張卡片的紀錄。
|
|
325
|
+
agent 也能用 `driftnet_update_item` 的 `restore_version` 做同樣的事。
|
|
275
326
|
- **筆記。**每張卡片都能按 📝 寫自己的筆記(試過了嗎?要 GPU 嗎?)。大家丟連結時在聊天室說的話也會顯示在卡片上(💬),
|
|
276
327
|
兩者都搜尋得到。側邊欄的 **📝 筆記** 可以寫不綁卡片的 Markdown 筆記,寫 `#12` 就會連到第 12 張卡片。
|
|
277
328
|
- 網頁上的 **⚙ 設定**:模型、Jev、摘要語言、聊天室回覆方式、自訂摘要規則、不收錄的網域,存進 `~/.driftnet/.env`,
|
|
@@ -447,6 +498,10 @@ contains:酸種 -> cooking # 標題或內文裡出現這個詞
|
|
|
447
498
|
|
|
448
499
|
### 查詢、收錄、投票
|
|
449
500
|
|
|
501
|
+
<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>
|
|
502
|
+
|
|
503
|
+
在 [Glama](https://glama.ai/mcp/servers/KevinChu1110/driftnet) 上,每支工具的定義、整體工具組合、維護和授權都拿到 A。
|
|
504
|
+
|
|
450
505
|
在 Claude Code 裡,裝插件就一次帶入 skill 和本機 MCP:
|
|
451
506
|
|
|
452
507
|
```bash
|
|
@@ -574,9 +629,12 @@ agent 寫回來的內容跟其他不可信的輸入一樣要檢查:格式、
|
|
|
574
629
|
| `DRIFTNET_CATEGORIES` | 內建 | 起始資料夾的 JSON 檔:`{ "id": "說明" }`,只在新資料庫用一次,之後直接在網頁上改 |
|
|
575
630
|
| `GITHUB_TOKEN` | — | GitHub API 上限從每小時 60 次提高到 5,000 次 |
|
|
576
631
|
| `DRIFTNET_SUMMARY_RULES` | — | 每次摘要都要遵守的自訂規則,例如「說明是否免費」;agent 也會收到 |
|
|
632
|
+
| `DRIFTNET_PROFILE` | — | 你是誰、關心什麼,最多 600 字(⚙ 設定 › AI › 關於你)。模型用它判斷什麼值得你花時間,並寫每張卡片的「為什麼值得看」;agent 也會收到。它只在模型的 system prompt 放一次(約 150 token,所以 prompt caching 照常命中),也不會被抄進卡片 |
|
|
633
|
+
| `DRIFTNET_UPDATE_CHECK` | 關閉 | 設 `1` 才會每天向 `registry.npmjs.org` 查一次最新版本號,有新版就在網頁標題列顯示小提示「driftnet x.y.z 已發布」(`driftnet status` 也會顯示)。不會傳送任何與你有關的資料。預設關閉,設 `1` 才開啟 |
|
|
577
634
|
| `DRIFTNET_BLOCK_DOMAINS` | — | 永遠不收錄的網域(含子網域),用逗號分隔 |
|
|
578
635
|
| `DRIFTNET_HEALTH` | `off` | `weekly` 約每週重新檢查連結,並標記失效、封存、久未更新的卡片(見「連結健康檢查」)。預設關閉:會對外發送請求 |
|
|
579
|
-
| `DRIFTNET_VIDEO` | `auto` | `
|
|
636
|
+
| `DRIFTNET_VIDEO` | `auto` | `auto` 使用已安裝的 `yt-dlp`、`ffmpeg`、`tesseract`、`whisper`;`captions` 只讀字幕和說明(省電);`watch` 在 `auto` 之後,仍太少時讓 Gemini/Vertex 直接看影片(會把影片或 YouTube 連結送給該模型);`off` 完全不讀影片(見「Reels 與 Shorts」) |
|
|
637
|
+
| `DRIFTNET_VIDEO_FRAMES` | `off` | `vision` 在內容仍太少時,把最多 8 張不重複的畫面附在同一次摘要請求裡(只送給你設定的模型,模型必須看得懂圖片,例如 Ollama 的視覺模型) |
|
|
580
638
|
| `DRIFTNET_YTDLP`、`DRIFTNET_FFMPEG`、`DRIFTNET_TESSERACT`、`DRIFTNET_WHISPER` | 從 `PATH` 找 | 不在 `PATH` 的工具的完整路徑(`whisper` 也可指向 `whisper-cli`;whisper.cpp 還需要 `DRIFTNET_WHISPER_MODEL`,指向模型檔) |
|
|
581
639
|
| `DRIFTNET_PLUGINS` | `~/.driftnet/plugins` | 外掛(擷取器、供應商、判斷器;`.js`/`.mjs`)的資料夾,範例見 [`examples/plugins`](https://github.com/KevinChu1110/driftnet/blob/main/examples/plugins) |
|
|
582
640
|
| `DRIFTNET_TOKEN` | — | 管理密碼:寫入、改設定、管理 agent 金鑰、完整的 MCP 工具、agent 佇列。可以在網頁上設定 |
|
|
@@ -602,8 +660,8 @@ agent 寫回來的內容跟其他不可信的輸入一樣要檢查:格式、
|
|
|
602
660
|
**HTTP:** `GET /` · `GET /api/items[/:id]`(`?view=favorites|trash`)· `POST /api/items/:id/feedback` ·
|
|
603
661
|
`POST /api/items/:id/{trash,restore,favorite,unfavorite,move}` · `GET|POST /api/folders` · `PATCH|DELETE /api/folders/:id` · `GET /api/folders/:id/pack`(`?s=` 簽名連結)· `GET /api/folders/:id/pack-link` · `POST /api/ingest` ·
|
|
604
662
|
`POST /api/chat` · `POST /api/digest/send`(`{"dryRun": true}` 只顯示內容)· `POST /api/pending` · `POST /api/items/:id/enrich` · `GET /api/stats` ·
|
|
605
|
-
`PUT /api/items/:id/note` · `GET|POST /api/notes` · `PUT|DELETE /api/notes/:id` · `GET /api/export`(`?format=vault`)· `POST /api/import`(`{content}` 或資料夾包的 `{url}`)· `GET /api/import/:job` ·
|
|
606
|
-
`GET|PUT /api/settings`(限本機,或帶 token)· `GET|POST /api/agent-tokens` · `DELETE /api/agent-tokens/:id[?purge=1]`(撤銷,或移除已撤銷的;限管理密碼)· `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`
|
|
663
|
+
`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}` 或資料夾包的 `{url}`)· `GET /api/import/:job` ·
|
|
664
|
+
`GET|PUT /api/settings`(限本機,或帶 token)· `GET /api/backup`(`?secrets=1` 並在 `X-Driftnet-Confirm` 標頭再送一次密碼)· `POST /api/backup/restore`(body 是 zip;兩者都限管理密碼)· `GET|POST /api/agent-tokens` · `DELETE /api/agent-tokens/:id[?purge=1]`(撤銷,或移除已撤銷的;限管理密碼)· `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`
|
|
607
665
|
|
|
608
666
|
</details>
|
|
609
667
|
|
|
@@ -647,7 +705,12 @@ driftnet.example.com {
|
|
|
647
705
|
> 清單留在你的電腦上。判斷和摘要時,driftnet 會把連結的**摘錄**(標題、大綱、分享時附的聊天文字)送到
|
|
648
706
|
> **TypeSafe**(有開 Jev 時)和**你設定的模型供應商**。沒有連結的聊天訊息不會被處理或儲存。
|
|
649
707
|
> 用 Ollama 並設 `DRIFTNET_JUDGE=off`,就完全不會有資料離開你的電腦。隨時都能整包帶走:側邊欄可以匯出成
|
|
650
|
-
> Markdown 或 Obsidian/Notion 的 vault,也可以用 `GET /api/export
|
|
708
|
+
> Markdown 或 Obsidian/Notion 的 vault,也可以用 `GET /api/export`。若你開啟(`DRIFTNET_UPDATE_CHECK=1`),driftnet 自己主動發出的另一個請求,
|
|
709
|
+
> 只有每天一次的新版本檢查(對 npm registry 的單純請求);預設是關閉的。
|
|
710
|
+
|
|
711
|
+
### 備份與還原
|
|
712
|
+
|
|
713
|
+
**⚙ 設定 › 一般 › 備份** 會下載一個 zip:`driftnet.db`(一致的快照,driftnet 執行中也能做)、`settings.env` 和 `manifest.json`(driftnet 版本、資料庫結構版本、日期、卡片數)。**`settings.env` 不含密碼、金鑰和 token**;勾選「包含密碼和金鑰」並再輸入一次管理員密碼才會保留。從檔案還原時會先檢查(必須是 driftnet 的備份、資料庫完整、不是來自較新版的 driftnet),把目前的資料留成 `driftnet.db.before-restore-<時間>`,並在 driftnet 下次啟動時換上備份,所以頁面會請你重新啟動。備份裡的設定只會顯示、不會自動套用,需要的自己複製。只有管理員密碼能備份或還原,分享金鑰和 agent token 都不行。終端機:`npx driftnet backup -o driftnet.zip`(沒開時也能用)和 `npx driftnet restore driftnet.zip`(driftnet 必須先停掉)。
|
|
651
714
|
|
|
652
715
|
## 參與開發
|
|
653
716
|
|