driftnet 0.8.0 → 0.9.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 +148 -37
- package/README.zh-TW.md +136 -31
- package/dist/driftnet.mjs +2431 -348
- package/examples/plugins/rainbow-judge.mjs +25 -0
- package/package.json +2 -1
- package/public/index.html +166 -16
- package/skills/driftnet/SKILL.md +57 -0
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,7 +84,15 @@ bot ▸ 📌 This week in AI (3/11)|News + Paperclip, RealWonder
|
|
|
82
84
|
|
|
83
85
|
## 🚀 Quick start
|
|
84
86
|
|
|
85
|
-
No server, no cloud account. Needs Node.js 22.13+.
|
|
87
|
+
No server, no cloud account. Needs Node.js 22.13+. Want a look first? **[Try the demo](https://kevinchu1110.github.io/driftnet/)** runs the real page in your browser, no install.
|
|
88
|
+
|
|
89
|
+
### Let your agent set it up
|
|
90
|
+
|
|
91
|
+
Paste this to Claude Code, Cursor, Codex or any agent that can run commands:
|
|
92
|
+
|
|
93
|
+
> Read https://raw.githubusercontent.com/KevinChu1110/driftnet/main/docs/llms-install.txt and set up driftnet for me.
|
|
94
|
+
|
|
95
|
+
Or do it yourself: `npx driftnet` to start, then `npx driftnet init` to connect the agents on this machine.
|
|
86
96
|
|
|
87
97
|
### 1. One command
|
|
88
98
|
|
|
@@ -154,6 +164,8 @@ Most links never reach a model; the ones that do arrive as a short outline.
|
|
|
154
164
|
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
165
|
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
166
|
|
|
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. Every tool is optional: whatever is missing is skipped, and `DRIFTNET_VIDEO=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.
|
|
168
|
+
|
|
157
169
|
<details>
|
|
158
170
|
<summary><b>All eight steps</b></summary>
|
|
159
171
|
|
|
@@ -181,17 +193,33 @@ Links rot and repos get archived. Set `DRIFTNET_HEALTH=weekly` (recommended; it
|
|
|
181
193
|
|
|
182
194
|
| | Set up | On a laptop? | Sent while it was off |
|
|
183
195
|
|---|---|---|---|
|
|
184
|
-
| **Chrome extension** | Load `apps/chrome-extension` | ✅ | — |
|
|
196
|
+
| **Chrome extension** | Load `apps/chrome-extension`, or the zip from `pnpm build:extension` | ✅ | — |
|
|
185
197
|
| Telegram | `TELEGRAM_BOT_TOKEN`; privacy mode off for groups (`/setprivacy`) | ✅ | caught up on start (24 h) |
|
|
186
198
|
| Discord | `DISCORD_BOT_TOKEN`; Message Content intent on | ✅ | read back per channel, quietly |
|
|
187
|
-
| Slack | `SLACK_APP_TOKEN` (Socket Mode) + `SLACK_BOT_TOKEN` | ✅ | missed |
|
|
199
|
+
| Slack | `SLACK_APP_TOKEN` (Socket Mode) + `SLACK_BOT_TOKEN` (+ `reactions:read` and the `reaction_added` event for voting) | ✅ | missed |
|
|
188
200
|
| LINE | `LINE_CHANNEL_SECRET` + `LINE_CHANNEL_ACCESS_TOKEN`, webhook `/webhooks/line` | needs a [public URL](#putting-it-online-optional) | missed |
|
|
189
201
|
| Your agent | MCP, OpenAPI or `/llms.txt`, see [Agents](#agents) | ✅ | — |
|
|
190
202
|
| Anything else | `POST /api/chat {"text": "…"}` returns the reply | ✅ | — |
|
|
191
203
|
|
|
192
|
-
**In a chat**, messages without a link are ignored. Each link gets
|
|
193
|
-
|
|
194
|
-
|
|
204
|
+
**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,
|
|
205
|
+
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
|
|
206
|
+
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
|
|
207
|
+
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`;
|
|
208
|
+
`DRIFTNET_REPLY_STYLE=text` brings back plain messages. If a platform refuses the rich message (a missing permission), driftnet sends the plain
|
|
209
|
+
text and logs it once.
|
|
210
|
+
|
|
211
|
+
**Vote** with `👍12` or `👎12 reason` (`+#12` / `-#12` work too; a message with a link is never a vote), or with one tap:
|
|
212
|
+
|
|
213
|
+
| | How | Needs |
|
|
214
|
+
|---|---|---|
|
|
215
|
+
| 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 |
|
|
216
|
+
| Slack | React 👍 / 👎 (`+1`, `-1`) on the bot's reply | Scope `reactions:read`; event subscription `reaction_added` |
|
|
217
|
+
| 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 |
|
|
218
|
+
| LINE | Tap 👍 / 👎 on the card (LINE has no reactions API) | Rich reply style |
|
|
219
|
+
|
|
220
|
+
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).
|
|
221
|
+
Driftnet remembers which cards a Discord, Slack or Telegram reply was about for 30 days.
|
|
222
|
+
|
|
195
223
|
**Weekly digest.** Set `DRIFTNET_DIGEST=weekly` (or `daily`) and `DRIFTNET_DIGEST_TO` (or use ⚙ Settings → General) and driftnet posts one short
|
|
196
224
|
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
225
|
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
|
|
@@ -213,9 +241,10 @@ With driftnet running (`npx driftnet`), the same command talks to it. `search` a
|
|
|
213
241
|
| `driftnet search [query…] [--folder id] [--kind …] [--view inbox\|favorites\|trash] [--limit N] [--json]` | `npx driftnet search vector database --kind repo --limit 5` |
|
|
214
242
|
| `driftnet open [id]` | `npx driftnet open 12` |
|
|
215
243
|
| `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` |
|
|
244
|
+
| `driftnet import <file or pack link> [--keep-folders] [--yes]` | `npx driftnet import bookmarks.html --keep-folders` |
|
|
217
245
|
| `driftnet status` | `npx driftnet status` |
|
|
218
246
|
| `driftnet completion bash\|zsh` | `eval "$(driftnet completion zsh)"` |
|
|
247
|
+
| `driftnet init [--client claude-code\|claude-desktop\|cursor\|windsurf\|codex\|all] [--remote URL --token T] [--yes] [--dry-run]` | `npx driftnet init --yes` |
|
|
219
248
|
|
|
220
249
|
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
250
|
|
|
@@ -278,6 +307,15 @@ phone the sidebar folds into a ☰ drawer, and a line under the search box says
|
|
|
278
307
|
folders* to mirror them under an **Imported** folder, otherwise the classifier sorts as usual. Links you
|
|
279
308
|
already have, repeats, non-web and private addresses are skipped, up to 5,000 per import. With a model
|
|
280
309
|
set up, each new link is one model call, so hundreds of links mean hundreds of calls.
|
|
310
|
+
- **Share a folder.** A folder's ⋯ menu → *Share as pack…* turns that folder, its sub-folders and the cards
|
|
311
|
+
in them into one JSON file (`"driftnet_pack": 1`, at most 1,000 cards and 2 MB): links, summaries, tags
|
|
312
|
+
and original picture URLs. Your notes, chat text, who shared what, counters, tokens and the share key never
|
|
313
|
+
go in, and neither do trashed or flagged cards. Download it, or copy a link (needs `DRIFTNET_PUBLIC_URL` or a
|
|
314
|
+
tunnel); on a private catalogue the link is signed for that one pack, so it opens without the share key and
|
|
315
|
+
shows nothing else. To pull one in, use Settings → Import → *From a pack link* (or `driftnet import <link>`,
|
|
316
|
+
or import the file): the folders are recreated under a top-level folder named after the pack and the cards
|
|
317
|
+
are stored as summarised, with no model call. Cards you already have keep your summary, text that looks like
|
|
318
|
+
instructions to an AI drops the card, and importing the same pack twice adds nothing.
|
|
281
319
|
- **Shared links open read-only.** A card link from a chat bot or an agent carries the read-only share
|
|
282
320
|
key, so it opens on a phone without a password; edit buttons appear after **Unlock** with the admin
|
|
283
321
|
password. Forgot it? Open driftnet on the computer it runs on: Settings there sets a new one.
|
|
@@ -323,9 +361,24 @@ comments, and a reel's "link in the comments" turned into its GitHub repo.
|
|
|
323
361
|
- **Right-click a link**: send it with the text of the post around it.
|
|
324
362
|
- **Right-click a selection**: send just that.
|
|
325
363
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
364
|
+
**What it reads on Threads, X and Instagram.** Only on your click, only what is on screen, never a
|
|
365
|
+
fetch on the side; if a site's markup changes it falls back to the generic reader above.
|
|
366
|
+
|
|
367
|
+
| Site | Captured |
|
|
368
|
+
|---|---|
|
|
369
|
+
| **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 |
|
|
370
|
+
| **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) |
|
|
371
|
+
| **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 |
|
|
372
|
+
|
|
373
|
+
**Install**
|
|
374
|
+
|
|
375
|
+
- **Chrome Web Store**: coming soon.
|
|
376
|
+
- **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.
|
|
377
|
+
- **From the source**: the same, picking `apps/chrome-extension`.
|
|
378
|
+
|
|
379
|
+
It talks to `http://localhost:8787`; for a remote server, set the URL and token in its settings. It
|
|
380
|
+
reads a tab only when you click, and sends only to your own server. See the
|
|
381
|
+
[privacy policy](https://github.com/KevinChu1110/driftnet/blob/main/apps/chrome-extension/store/PRIVACY.md).
|
|
329
382
|
|
|
330
383
|
## Models
|
|
331
384
|
|
|
@@ -334,21 +387,45 @@ driftnet asks a model for one thing: fill in a JSON schema. Pick who answers.
|
|
|
334
387
|
| `DRIFTNET_LLM_PROVIDER` | Uses | Key |
|
|
335
388
|
|---|---|---|
|
|
336
389
|
| `anthropic` | Claude through the official SDK | `DRIFTNET_LLM_API_KEY` |
|
|
337
|
-
| `openai` | Anything OpenAI-compatible: OpenAI,
|
|
390
|
+
| `openai` | Anything OpenAI-compatible: OpenAI, Grok, DeepSeek, OpenRouter, LiteLLM, **Ollama / LM Studio** | `DRIFTNET_LLM_API_KEY` (none for local) |
|
|
391
|
+
| `gemini` | Google's Gemini API directly (JSON-schema output) | `DRIFTNET_LLM_API_KEY` or `GEMINI_API_KEY` |
|
|
392
|
+
| `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` |
|
|
393
|
+
| `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
394
|
| `claude-cli` | **Your Claude subscription**, via Claude Code logged in on the same machine | none |
|
|
339
395
|
| `gemini-cli` | **Your Google account**, via Gemini CLI logged in on the same machine | none |
|
|
340
396
|
| *(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
397
|
|
|
342
398
|
```bash
|
|
343
|
-
|
|
344
|
-
|
|
399
|
+
# Gemini API. The model is optional (default: gemini-flash-latest, which tracks the current Flash model)
|
|
400
|
+
DRIFTNET_LLM_PROVIDER=gemini
|
|
345
401
|
DRIFTNET_LLM_API_KEY=...
|
|
346
|
-
|
|
402
|
+
|
|
403
|
+
# Amazon Bedrock: a model or inference-profile id from your Bedrock console, in a region you have access to
|
|
404
|
+
DRIFTNET_LLM_PROVIDER=bedrock
|
|
405
|
+
DRIFTNET_LLM_MODEL=<model id>
|
|
406
|
+
DRIFTNET_LLM_REGION=us-east-1 # or AWS_REGION
|
|
407
|
+
AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... # + AWS_SESSION_TOKEN for temporary credentials
|
|
408
|
+
# …or, instead of the three AWS variables: AWS_BEARER_TOKEN_BEDROCK=<Bedrock API key>
|
|
409
|
+
|
|
410
|
+
# Google Vertex AI: a Gemini model id that exists in your region
|
|
411
|
+
DRIFTNET_LLM_PROVIDER=vertex
|
|
412
|
+
DRIFTNET_LLM_MODEL=<model id>
|
|
413
|
+
DRIFTNET_LLM_REGION=us-central1 # default; "global" also works
|
|
414
|
+
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
|
|
415
|
+
GOOGLE_CLOUD_PROJECT=my-project # optional if the key file names its project
|
|
347
416
|
```
|
|
348
417
|
|
|
349
418
|
> [!NOTE]
|
|
350
419
|
> 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.
|
|
420
|
+
> tools bill you: Claude Code, for one, switches from your subscription to API billing. The cloud
|
|
421
|
+
> providers do read their own cloud's standard variables (`AWS_*`, `GOOGLE_*`, `GEMINI_API_KEY`),
|
|
422
|
+
> because that is where those credentials live.
|
|
423
|
+
|
|
424
|
+
`gemini`, `bedrock` and `vertex` talk to fixed vendor hosts, sign and cache tokens themselves (no
|
|
425
|
+
cloud SDK is installed), time out after 30 s, retry 429 / 5xx once, and show the vendor's own error
|
|
426
|
+
message without ever printing a key. Bedrock has no schema-enforced output that every model supports,
|
|
427
|
+
so the schema goes in the prompt and the reply is validated like any other. driftnet keeps no count
|
|
428
|
+
of tokens or spend, whichever provider you pick.
|
|
352
429
|
|
|
353
430
|
Whatever the provider, replies are validated against the schema; truncated or refused answers are
|
|
354
431
|
retried once, and a link the model gives is kept only if it appears in what was fetched.
|
|
@@ -377,6 +454,35 @@ plan's limits.
|
|
|
377
454
|
|
|
378
455
|
</details>
|
|
379
456
|
|
|
457
|
+
### Judges
|
|
458
|
+
|
|
459
|
+
A judge files each link (folder, kind, worth) before the model is asked. `DRIFTNET_JUDGE` picks one:
|
|
460
|
+
|
|
461
|
+
| `DRIFTNET_JUDGE` | Does |
|
|
462
|
+
|---|---|
|
|
463
|
+
| *(empty)* | [Jev](https://console.typesafe.ai) if a TypeSafe key is set, otherwise the model files it |
|
|
464
|
+
| `jev` | Jev only |
|
|
465
|
+
| `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 |
|
|
466
|
+
| `llm` / `heuristic` / `off` | No separate judge: the model files it, or "other" when there is no model |
|
|
467
|
+
| *a name* | A judge added by a plugin |
|
|
468
|
+
|
|
469
|
+
The rules file is `DRIFTNET_JUDGE_RULES`, one rule per line, first match wins:
|
|
470
|
+
|
|
471
|
+
```text
|
|
472
|
+
# pattern -> folder (an id or the folder's name)
|
|
473
|
+
github.com/* -> coding # host + path, * matches anything
|
|
474
|
+
youtube.com -> videos # a bare host also covers its subdomains
|
|
475
|
+
kind:repo -> coding # repo, product, video, article, post or other
|
|
476
|
+
contains:sourdough -> cooking # a word in the title or text
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
### Plugins
|
|
480
|
+
|
|
481
|
+
A file in `~/.driftnet/plugins` may export `{ extractors, providers, judges }` (all optional; a lone
|
|
482
|
+
extractor or a list of extractors still works). A provider is `name: (env) => ({ label, complete })`
|
|
483
|
+
and is chosen with `DRIFTNET_LLM_PROVIDER=name`; a judge is `name: (env) => ({ name, judge })` chosen
|
|
484
|
+
with `DRIFTNET_JUDGE=name`. See [`examples/plugins/rainbow-judge.mjs`](https://github.com/KevinChu1110/driftnet/blob/main/examples/plugins/rainbow-judge.mjs).
|
|
485
|
+
|
|
380
486
|
## Agents
|
|
381
487
|
|
|
382
488
|
### Read, save and vote
|
|
@@ -481,9 +587,15 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
481
587
|
|
|
482
588
|
| Variable | Default | Purpose |
|
|
483
589
|
|---|---|---|
|
|
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) |
|
|
590
|
+
| `DRIFTNET_LLM_PROVIDER` | *(off)* | `anthropic`, `openai`, `gemini`, `bedrock`, `vertex`, `claude-cli`, `gemini-cli`, a plugin's name, or empty |
|
|
591
|
+
| `DRIFTNET_LLM_MODEL` | — | Model name. Required for `anthropic`, `openai`, `bedrock` and `vertex`; `gemini` defaults to `gemini-flash-latest`; `claude-cli` to `haiku` |
|
|
592
|
+
| `DRIFTNET_LLM_API_KEY` | — | Key for that provider (none for Ollama / LM Studio; for `vertex`, an access token instead of a key file) |
|
|
593
|
+
| `DRIFTNET_LLM_REGION` | `us-central1` (vertex) | Region for `bedrock` (falls back to `AWS_REGION`) and `vertex` |
|
|
594
|
+
| `AWS_ACCESS_KEY_ID` · `AWS_SECRET_ACCESS_KEY` · `AWS_SESSION_TOKEN` | — | `bedrock` credentials |
|
|
595
|
+
| `AWS_BEARER_TOKEN_BEDROCK` | — | `bedrock` with a Bedrock API key instead of the three above |
|
|
596
|
+
| `GOOGLE_APPLICATION_CREDENTIALS` · `DRIFTNET_VERTEX_CREDENTIALS` | — | `vertex`: service-account key file (or its JSON text in the second) |
|
|
597
|
+
| `GOOGLE_CLOUD_PROJECT` | from the key file | `vertex` project |
|
|
598
|
+
| `GEMINI_API_KEY` | — | `gemini` key when `DRIFTNET_LLM_API_KEY` is empty |
|
|
487
599
|
| `DRIFTNET_LLM_BASE_URL` | OpenAI | Endpoint for the `openai` provider |
|
|
488
600
|
| `DRIFTNET_LLM_EFFORT` | `anthropic`: `low` | `anthropic`: `low`–`xhigh`; `openai`: `reasoning_effort`; `claude-cli`: `--effort` |
|
|
489
601
|
| `DRIFTNET_CLI_PATH` | `claude` / `gemini` | CLI binary for `claude-cli` / `gemini-cli` |
|
|
@@ -492,7 +604,10 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
492
604
|
| `DRIFTNET_SUMMARY_DEPTH` | `standard` | How much each card says: `brief`, `standard` or `detailed` |
|
|
493
605
|
| `DRIFTNET_LOCALE` | from `DRIFTNET_LANGUAGE` | Force the bot's own words to `en` or `zh-TW` |
|
|
494
606
|
| `DRIFTNET_REPLY` | `link` | Chat replies: `link` (one line + web link), `full` (the summary in chat) or `off` |
|
|
607
|
+
| `DRIFTNET_REPLY_STYLE` | `rich` | `rich` (embeds, Block Kit, Flex cards, vote buttons) or `text` (plain messages) |
|
|
495
608
|
| `TYPESAFE_API_KEY` | `~/.typesafe/api_key` | Enables the Jev judge; `DRIFTNET_JUDGE=off` disables it |
|
|
609
|
+
| `DRIFTNET_JUDGE` | Jev if keyed | `jev`, `rules`, `llm`, `heuristic`, `off` or a plugin's judge ([Judges](#judges)) |
|
|
610
|
+
| `DRIFTNET_JUDGE_RULES` | — | Rules file for the `rules` judge |
|
|
496
611
|
| `DRIFTNET_MIN_CONFIDENCE` | `0.4` | Below this, the model classifies instead of Jev |
|
|
497
612
|
| `DRIFTNET_DIGEST_TOKENS` | `350` | Token budget of the page outline |
|
|
498
613
|
| `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 |
|
|
@@ -508,7 +623,9 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
508
623
|
| `DRIFTNET_SUMMARY_RULES` | — | Your own instructions for every summary, e.g. “Say whether it is free.” Agents get them too |
|
|
509
624
|
| `DRIFTNET_BLOCK_DOMAINS` | — | Domains never catalogued (subdomains included), comma separated |
|
|
510
625
|
| `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
|
-
| `
|
|
626
|
+
| `DRIFTNET_VIDEO` | `auto` | `off` never reads videos; `auto` uses whichever of `yt-dlp`, `ffmpeg`, `tesseract` and `whisper` are installed (see Reels and shorts) |
|
|
627
|
+
| `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
|
+
| `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
629
|
| `DRIFTNET_TOKEN` | — | Admin password: writes, settings, agent tokens, MCP with every tool, the agent queue. Settable on the page |
|
|
513
630
|
| `DRIFTNET_READ_KEY` | — | Read-only share key (header or `?key=`): reading and the read-only MCP tools |
|
|
514
631
|
| `DRIFTNET_ACCESS` | `public` | `public`: anyone can read. `private`: reads need the password, the share key or an agent token |
|
|
@@ -530,9 +647,9 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
530
647
|
| `LINE_CHANNEL_SECRET` · `LINE_CHANNEL_ACCESS_TOKEN` | — | LINE |
|
|
531
648
|
|
|
532
649
|
**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` ·
|
|
650
|
+
`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
651
|
`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` ·
|
|
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` ·
|
|
536
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`
|
|
537
654
|
|
|
538
655
|
</details>
|
|
@@ -613,14 +730,8 @@ Extend it: a site (a plugin file in `~/.driftnet/plugins`, like
|
|
|
613
730
|
[`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
731
|
platform (`handleChatText()`), browser capture (`collect.js`), or a bot language (`i18n.ts`).
|
|
615
732
|
|
|
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.
|
|
733
|
+
**Want to help?** Look for [`good first issue`](https://github.com/KevinChu1110/driftnet/labels/good%20first%20issue) on GitHub, or open an issue with
|
|
734
|
+
a link driftnet handled badly: real links people share are how every feature here was found.
|
|
624
735
|
|
|
625
736
|
## Support
|
|
626
737
|
|
package/README.zh-TW.md
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
[📖 這是什麼](#-這是什麼) · [🎥 實際看看](#-實際看看) · [✨ 核心功能](#-核心功能) · [🚀 開始使用](#-開始使用) · [連結怎麼被處理](#連結怎麼被處理) · [接法](#接法) · [指令列](#指令列) · [網頁](#網頁) · [模型](#模型) · [Agent](#agent) · [設定](#設定) · [放上網路](#放上網路選用) · [資料去哪裡](#資料去哪裡) · [參與開發](#參與開發)
|
|
11
11
|
|
|
12
|
+
[](https://kevinchu1110.github.io/driftnet/) **[線上試玩](https://kevinchu1110.github.io/driftnet/)**:真正的網頁加上範例卡片,直接在瀏覽器裡玩,免安裝,資料不會離開你的電腦。
|
|
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,12 +25,13 @@
|
|
|
23
25
|
|
|
24
26
|
## 📖 這是什麼
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
每天,社群動態像浪潮一樣捲過無數好文章、開源專案和好工具。你隨手貼進聊天室說「之後再看」,
|
|
29
|
+
結果它們跟著浪潮漂走,再也沒看過。
|
|
27
30
|
|
|
28
|
-
**driftnet
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
**driftnet 是你放進這片資訊海裡的漂流網。** 丟進群組(LINE、Slack、Discord、Telegram)、按一下 Chrome 擴充、
|
|
32
|
+
匯入舊書籤,或用指令列都可以。driftnet 攔下每個漂過的連結,追到貼文真正介紹的專案本體,濾掉雜訊、用你的語言寫成精簡摘要,
|
|
33
|
+
歸進你自己的資料夾,放進支援中文全文搜尋的本機知識庫。你的 AI agent 也能透過 MCP 隨時來收網。
|
|
34
|
+
它跑在你自己的電腦上,可以接任何模型,也可以完全不接。
|
|
32
35
|
|
|
33
36
|
## 🎥 實際看看
|
|
34
37
|
|
|
@@ -79,7 +82,15 @@ bot ▸ 📌 本週 AI 大事彙整(3/11)|新聞動態 + Paperclip、Rea
|
|
|
79
82
|
|
|
80
83
|
## 🚀 開始使用
|
|
81
84
|
|
|
82
|
-
不需要伺服器,也不需要雲端帳號。需要 Node.js 22.13
|
|
85
|
+
不需要伺服器,也不需要雲端帳號。需要 Node.js 22.13 以上。想先看看?**[線上試玩](https://kevinchu1110.github.io/driftnet/)** 直接在瀏覽器跑真正的網頁,免安裝。
|
|
86
|
+
|
|
87
|
+
### 讓 agent 幫你裝
|
|
88
|
+
|
|
89
|
+
把這句話貼給 Claude Code、Cursor、Codex 或任何能執行指令的 agent:
|
|
90
|
+
|
|
91
|
+
> Read https://raw.githubusercontent.com/KevinChu1110/driftnet/main/docs/llms-install.txt and set up driftnet for me.
|
|
92
|
+
|
|
93
|
+
或自己來:先 `npx driftnet` 啟動,再 `npx driftnet init` 把這台機器上的 agent 都接起來。
|
|
83
94
|
|
|
84
95
|
### 1. 一行指令
|
|
85
96
|
|
|
@@ -151,6 +162,8 @@ curl -X POST localhost:8787/api/chat -H 'content-type: application/json' \
|
|
|
151
162
|
6. **放進你的資料夾。** AI 照資料夾的路徑和說明分類;新連結會放在收件匣,附兩、三個建議資料夾,點一下就歸檔。
|
|
152
163
|
7. **顯示在網頁上,也提供給 agent。** 網頁上看得到,agent 可以走 MCP、`/llms.txt`、`/feed.xml` 或對外 Webhook 取得。匯出可以整包帶走。
|
|
153
164
|
|
|
165
|
+
**Reels 與 Shorts。** 很多分享的 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=off` 可全部關閉。工具不經過 shell、在一定會刪除的私有暫存資料夾裡執行、環境變數中拿掉 driftnet 的機密、每個步驟都有時間上限、拒絕私有或本機位址的連結,而且一次只處理一支影片。
|
|
166
|
+
|
|
154
167
|
<details>
|
|
155
168
|
<summary><b>八個步驟的完整說明</b></summary>
|
|
156
169
|
|
|
@@ -177,16 +190,30 @@ curl -X POST localhost:8787/api/chat -H 'content-type: application/json' \
|
|
|
177
190
|
|
|
178
191
|
| | 設定 | 筆電上能用? | 關機期間的訊息 |
|
|
179
192
|
|---|---|---|---|
|
|
180
|
-
| **Chrome 擴充** | 載入 `apps/chrome-extension` | ✅ | — |
|
|
193
|
+
| **Chrome 擴充** | 載入 `apps/chrome-extension`,或 `pnpm build:extension` 產生的 zip | ✅ | — |
|
|
181
194
|
| Telegram | `TELEGRAM_BOT_TOKEN`;群組要先用 `/setprivacy` 關閉隱私模式 | ✅ | 啟動時補上(24 小時內) |
|
|
182
195
|
| Discord | `DISCORD_BOT_TOKEN`;開啟 Message Content intent | ✅ | 逐頻道補讀,不回覆 |
|
|
183
|
-
| Slack | `SLACK_APP_TOKEN`(Socket Mode)+ `SLACK_BOT_TOKEN` | ✅ | 漏掉 |
|
|
196
|
+
| Slack | `SLACK_APP_TOKEN`(Socket Mode)+ `SLACK_BOT_TOKEN`(要投票另需 `reactions:read` 與 `reaction_added` 事件) | ✅ | 漏掉 |
|
|
184
197
|
| LINE | `LINE_CHANNEL_SECRET`+`LINE_CHANNEL_ACCESS_TOKEN`,webhook `/webhooks/line` | 要[公開網址](#放上網路選用) | 漏掉 |
|
|
185
198
|
| 你的 agent | MCP、OpenAPI 或 `/llms.txt`,見 [Agent](#agent) | ✅ | — |
|
|
186
199
|
| 其他 | `POST /api/chat {"text": "…"}` 會回傳回覆 | ✅ | — |
|
|
187
200
|
|
|
188
|
-
|
|
189
|
-
|
|
201
|
+
**在聊天室裡**,沒有連結的訊息一律忽略。每個連結會回覆它是什麼,以及在網頁上的哪裡看,並依平台呈現
|
|
202
|
+
(`DRIFTNET_REPLY_STYLE=rich`,預設):Discord 每個項目一張 embed、Slack Block Kit、LINE Flex 卡片(單張或最多 12 張的輪播)、Telegram 帶連結的訊息。
|
|
203
|
+
只有設了公開的 `DRIFTNET_PUBLIC_URL` 才會附圖片(絕不用 localhost 或內網位址,也不帶分享金鑰)。想在聊天室直接看摘要,或完全不回?
|
|
204
|
+
設 `DRIFTNET_REPLY=full` 或 `off`;`DRIFTNET_REPLY_STYLE=text` 則改回純文字。若平台拒絕豐富訊息(例如缺少權限),driftnet 會改送純文字並只記錄一次。
|
|
205
|
+
|
|
206
|
+
**投票**:打 `👍12` 或 `👎12 原因`(也可用 `+#12`/`-#12`;含連結的訊息一定不會被當成投票),或一鍵完成:
|
|
207
|
+
|
|
208
|
+
| | 做法 | 需要 |
|
|
209
|
+
|---|---|---|
|
|
210
|
+
| Discord | 在機器人的回覆上按 👍/👎(它會先幫你放好;會對該則回覆裡的每張卡片投票) | Message Reactions intent(非特權,discord.js 自動要求);頻道內的「嵌入連結」與「新增反應」權限 |
|
|
211
|
+
| Slack | 在機器人的回覆上按 👍/👎(`+1`、`-1`) | scope `reactions:read`;事件訂閱 `reaction_added` |
|
|
212
|
+
| Telegram | 點卡片下方的 👍/👎(會跳出提示),或直接對機器人的訊息按表情 | 按鈕不需額外設定;要收到表情反應,機器人必須是群組管理員 |
|
|
213
|
+
| LINE | 點卡片上的 👍/👎(LINE 沒有表情反應 API) | 豐富回覆樣式 |
|
|
214
|
+
|
|
215
|
+
每人每張卡片一票,再投一次會改票。取消表情**不會**收回投票(改按另一個表情即可)。driftnet 會記住 Discord、Slack、Telegram 的回覆對應哪些卡片,保留 30 天。
|
|
216
|
+
|
|
190
217
|
**每週摘要。** 設 `DRIFTNET_DIGEST=weekly`(或 `daily`)和 `DRIFTNET_DIGEST_TO`(也可在 ⚙ 設定 → 一般 設定),driftnet 會在指定時間貼一則簡短訊息:
|
|
191
218
|
新增幾張卡片、收件匣還有幾張待整理、最好的五張新卡片(依價值、再依分享次數)、以及被分享 2 次以上的項目。沒有新內容就不發。時間用**伺服器的本地時間**
|
|
192
219
|
(要改就設 `TZ`)。排定時間 driftnet 剛好沒開的話,下次啟動會補發一則,不會多發。內文連結一律是公開網址(`DRIFTNET_PUBLIC_URL`),
|
|
@@ -207,9 +234,10 @@ driftnet 在跑的時候(`npx driftnet`),同一個指令就能跟它說話
|
|
|
207
234
|
| `driftnet search [關鍵字…] [--folder id] [--kind …] [--view inbox\|favorites\|trash] [--limit N] [--json]` | `npx driftnet search 向量資料庫 --kind repo --limit 5` |
|
|
208
235
|
| `driftnet open [id]` | `npx driftnet open 12` |
|
|
209
236
|
| `driftnet export [--format json\|md\|vault] [-o 檔案]` | `npx driftnet export --format vault -o links.zip` |
|
|
210
|
-
| `driftnet import
|
|
237
|
+
| `driftnet import <檔案或資料夾包連結> [--keep-folders] [--yes]` | `npx driftnet import bookmarks.html --keep-folders` |
|
|
211
238
|
| `driftnet status` | `npx driftnet status` |
|
|
212
239
|
| `driftnet completion bash\|zsh` | `eval "$(driftnet completion zsh)"` |
|
|
240
|
+
| `driftnet init [--client claude-code\|claude-desktop\|cursor\|windsurf\|codex\|all] [--remote URL --token T] [--yes] [--dry-run]` | `npx driftnet init --yes` |
|
|
213
241
|
|
|
214
242
|
連到別台機器:加 `--url http://host:8787 --token <密碼>`(或設 `DRIFTNET_URL`、`DRIFTNET_TOKEN`;密碼也會從 `~/.driftnet/.env` 讀)。
|
|
215
243
|
|
|
@@ -254,6 +282,12 @@ driftnet 在跑的時候(`npx driftnet`),同一個指令就能跟它說話
|
|
|
254
282
|
Raindrop CSV、JSON 連結清單,或任何含連結的文字/Markdown。開始前會先告訴你有多少是新的;勾選「保留我的書籤資料夾」會照原樣放進
|
|
255
283
|
**Imported** 資料夾,不勾就交給分類器照常整理。已經有的、重複的、非網頁與內網位址會略過,一次最多 5,000 個。
|
|
256
284
|
若已設定模型,每個新連結都會呼叫一次模型,幾百個連結就是幾百次。
|
|
285
|
+
- **分享資料夾。**資料夾的 ⋯ 選單 →「分享成資料夾包…」會把該資料夾、底下的子資料夾和裡面的卡片包成一個 JSON 檔
|
|
286
|
+
(`"driftnet_pack": 1`,最多 1,000 張卡片、2 MB):連結、摘要、標籤與圖片原始網址。你的筆記、聊天內容、誰分享了什麼、各種計數、
|
|
287
|
+
token 與分享碼都不會放進去,已丟垃圾桶或被標記的卡片也不會。可以直接下載,或複製連結(需要設定 `DRIFTNET_PUBLIC_URL` 或通道);
|
|
288
|
+
私人目錄的連結是針對這一個資料夾包簽名的,不用分享碼就能開,而且看不到其他東西。要匯入別人的,用設定 → 匯入 →「從資料夾包連結匯入」
|
|
289
|
+
(或 `driftnet import <連結>`,或直接匯入檔案):資料夾會重建在以包名命名的頂層資料夾底下,卡片照原摘要存入,不會呼叫模型。
|
|
290
|
+
你已經有的卡片保留你自己的摘要,含有「像在對 AI 下指令」文字的卡片會被丟掉,同一個包匯入兩次不會多出東西。
|
|
257
291
|
- **分享出去的連結是唯讀的。**聊天機器人和 agent 給你的卡片連結帶著唯讀分享碼,手機點開不用密碼;按「解鎖編輯」輸入管理密碼後,
|
|
258
292
|
才會出現編輯按鈕。忘記密碼的話,到跑 driftnet 的那台電腦打開網頁,設定裡可以直接設新的。
|
|
259
293
|
- **鍵盤。**`⌘K`/`Ctrl+K` 開指令面板(跳到資料夾或卡片、切換檢視、匯出、設定……)。`j`/`k` 上下一張、`f` 最愛、`m` 移動(打字找資料夾)、`n` 筆記、`#` 垃圾桶、`x` 選取、`z` 復原、`/` 搜尋、`g m` 樹狀圖、`?` 看全部快捷鍵。
|
|
@@ -294,8 +328,23 @@ driftnet 在跑的時候(`npx driftnet`),同一個指令就能跟它說話
|
|
|
294
328
|
- **在連結上按右鍵**:送出那個連結,加上它所在那則貼文的文字。
|
|
295
329
|
- **選取文字後按右鍵**:只送選取的內容。
|
|
296
330
|
|
|
297
|
-
|
|
298
|
-
|
|
331
|
+
**在 Threads、X、Instagram 讀什麼。** 只在你按下時、只讀畫面上有的,不會另外去抓;網站改版讀不懂時,
|
|
332
|
+
會退回上面的通用讀法。
|
|
333
|
+
|
|
334
|
+
| 網站 | 擷取內容 |
|
|
335
|
+
|---|---|
|
|
336
|
+
| **Threads** | 貼文與作者、引用/轉發的貼文、最多 20 則回覆(會按開「查看回覆」,最多 3 秒),以及其中去掉轉址的連結 |
|
|
337
|
+
| **X / Twitter** | 把 `t.co` 短網址換成真正目標的推文(取自連結本身的 title,不會另外抓)、引用推文、卡片連結,以及作者自己串的討論串(作者後面的推文;別人的回覆不收) |
|
|
338
|
+
| **Instagram**(`/p/`、`/reel/`) | 說明(展開「更多」)、作者、前 20 則留言和其中的連結。個人簡介連結和限時動態連結貼紙不在貼文頁上,所以略過;「連結在留言」找得到 |
|
|
339
|
+
|
|
340
|
+
**安裝**
|
|
341
|
+
|
|
342
|
+
- **Chrome 線上應用程式商店**:即將上架。
|
|
343
|
+
- **用 zip**([建置產物](https://github.com/KevinChu1110/driftnet/actions/workflows/extension.yml),或 `pnpm build:extension` → `dist/driftnet-extension-<版本>.zip`):解壓縮,開 `chrome://extensions` → 開發人員模式 → **載入未封裝項目** → 選解壓縮後的資料夾。
|
|
344
|
+
- **用原始碼**:同上,選 `apps/chrome-extension`。
|
|
345
|
+
|
|
346
|
+
預設連 `http://localhost:8787`;用遠端伺服器的話,到擴充的設定填網址和 token。只有你按下時才讀取該分頁,內容只送到你自己的伺服器。
|
|
347
|
+
見[隱私權政策](https://github.com/KevinChu1110/driftnet/blob/main/apps/chrome-extension/store/PRIVACY.md)。
|
|
299
348
|
|
|
300
349
|
## 模型
|
|
301
350
|
|
|
@@ -304,21 +353,42 @@ driftnet 只要模型做一件事:把 JSON schema 填好。由你決定誰來
|
|
|
304
353
|
| `DRIFTNET_LLM_PROVIDER` | 使用 | 金鑰 |
|
|
305
354
|
|---|---|---|
|
|
306
355
|
| `anthropic` | Claude(官方 SDK) | `DRIFTNET_LLM_API_KEY` |
|
|
307
|
-
| `openai` | 所有相容 OpenAI 格式的服務:OpenAI、
|
|
356
|
+
| `openai` | 所有相容 OpenAI 格式的服務:OpenAI、Grok、DeepSeek、OpenRouter、LiteLLM、**Ollama/LM Studio** | `DRIFTNET_LLM_API_KEY`(本機不用) |
|
|
357
|
+
| `gemini` | 直接接 Google 的 Gemini API(JSON schema 輸出) | `DRIFTNET_LLM_API_KEY` 或 `GEMINI_API_KEY` |
|
|
358
|
+
| `bedrock` | Amazon Bedrock,Converse API,用 SigV4 簽章(不裝 AWS SDK) | `AWS_ACCESS_KEY_ID` + `AWS_SECRET_ACCESS_KEY`(+`AWS_SESSION_TOKEN`),或 `AWS_BEARER_TOKEN_BEDROCK` |
|
|
359
|
+
| `vertex` | Google Cloud 上的 Gemini(Vertex AI) | 服務帳戶 JSON 檔(`GOOGLE_APPLICATION_CREDENTIALS`),或把存取權杖填在 `DRIFTNET_LLM_API_KEY` |
|
|
308
360
|
| `claude-cli` | **你的 Claude 訂閱**,透過同一台機器上已登入的 Claude Code | 不用 |
|
|
309
361
|
| `gemini-cli` | **你的 Google 帳號**,透過同一台機器上已登入的 Gemini CLI | 不用 |
|
|
310
362
|
| *(不填)* | 不用模型:照樣擷取、列出(有開 Jev 也會判斷),並排進 [agent 佇列](#讓你的-agent-來讀) | 不用 |
|
|
311
363
|
|
|
312
364
|
```bash
|
|
313
|
-
|
|
314
|
-
|
|
365
|
+
# Gemini API。模型可不填(預設 gemini-flash-latest,永遠指向目前的 Flash 模型)
|
|
366
|
+
DRIFTNET_LLM_PROVIDER=gemini
|
|
315
367
|
DRIFTNET_LLM_API_KEY=...
|
|
316
|
-
|
|
368
|
+
|
|
369
|
+
# Amazon Bedrock:填 Bedrock 主控台上的模型或推論設定檔 ID,且該區域你有權限
|
|
370
|
+
DRIFTNET_LLM_PROVIDER=bedrock
|
|
371
|
+
DRIFTNET_LLM_MODEL=<模型 ID>
|
|
372
|
+
DRIFTNET_LLM_REGION=us-east-1 # 或 AWS_REGION
|
|
373
|
+
AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... # 臨時憑證再加 AWS_SESSION_TOKEN
|
|
374
|
+
# ……或不用上面三個 AWS 變數,改設 AWS_BEARER_TOKEN_BEDROCK=<Bedrock API 金鑰>
|
|
375
|
+
|
|
376
|
+
# Google Vertex AI:填你那個區域有的 Gemini 模型 ID
|
|
377
|
+
DRIFTNET_LLM_PROVIDER=vertex
|
|
378
|
+
DRIFTNET_LLM_MODEL=<模型 ID>
|
|
379
|
+
DRIFTNET_LLM_REGION=us-central1 # 預設;也可填 global
|
|
380
|
+
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
|
|
381
|
+
GOOGLE_CLOUD_PROJECT=my-project # 金鑰檔裡有寫專案就可以不填
|
|
317
382
|
```
|
|
318
383
|
|
|
319
384
|
> [!NOTE]
|
|
320
385
|
> driftnet **刻意不讀** `ANTHROPIC_API_KEY`、`OPENAI_API_KEY`。這些變數一旦 export,會改變其他工具的計費方式,
|
|
321
|
-
> 例如 Claude Code 會從訂閱額度改走 API
|
|
386
|
+
> 例如 Claude Code 會從訂閱額度改走 API 計費。雲端供應商則會讀各自雲端的標準變數
|
|
387
|
+
> (`AWS_*`、`GOOGLE_*`、`GEMINI_API_KEY`),因為憑證本來就放在那裡。
|
|
388
|
+
|
|
389
|
+
`gemini`、`bedrock`、`vertex` 只連固定的供應商網址,簽章和權杖快取都自己做(不裝任何雲端 SDK),逾時 30 秒,
|
|
390
|
+
429/5xx 重試一次,錯誤會顯示供應商原本的訊息,但絕不印出金鑰。Bedrock 沒有每個模型都支援的強制 schema 輸出,
|
|
391
|
+
所以 schema 放在提示裡,回覆照樣用 schema 驗證。不管選哪個供應商,driftnet 都不統計 token 或花費。
|
|
322
392
|
|
|
323
393
|
不論哪家模型,回覆都會照 schema 驗證;被截斷或拒答時重試一次;模型給的連結,只有真的出現在抓到的內容裡才會保留。
|
|
324
394
|
|
|
@@ -344,6 +414,35 @@ DRIFTNET_LLM_BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai
|
|
|
344
414
|
|
|
345
415
|
</details>
|
|
346
416
|
|
|
417
|
+
### 判斷器
|
|
418
|
+
|
|
419
|
+
判斷器在問模型之前,先決定每個連結的資料夾、類型和值不值得看。用 `DRIFTNET_JUDGE` 選:
|
|
420
|
+
|
|
421
|
+
| `DRIFTNET_JUDGE` | 做什麼 |
|
|
422
|
+
|---|---|
|
|
423
|
+
| *(不填)* | 有 TypeSafe 金鑰就用 [Jev](https://console.typesafe.ai),否則交給模型 |
|
|
424
|
+
| `jev` | 只用 Jev |
|
|
425
|
+
| `rules` | **免費,不用模型。** 先看你的規則檔,再看頁面用字和資料夾名稱、說明的重疊。沒把握就讓位,由模型(或「other」)決定 |
|
|
426
|
+
| `llm`/`heuristic`/`off` | 不用獨立的判斷器:交給模型,沒有模型就放「other」 |
|
|
427
|
+
| *名稱* | 外掛新增的判斷器 |
|
|
428
|
+
|
|
429
|
+
規則檔用 `DRIFTNET_JUDGE_RULES` 指定,一行一條,由上往下第一條符合的生效:
|
|
430
|
+
|
|
431
|
+
```text
|
|
432
|
+
# 樣式 -> 資料夾(ID 或資料夾名稱)
|
|
433
|
+
github.com/* -> coding # 網域+路徑,* 代表任意字元
|
|
434
|
+
youtube.com -> videos # 只寫網域時,子網域也算
|
|
435
|
+
kind:repo -> coding # repo、product、video、article、post 或 other
|
|
436
|
+
contains:酸種 -> cooking # 標題或內文裡出現這個詞
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
### 外掛
|
|
440
|
+
|
|
441
|
+
`~/.driftnet/plugins` 裡的檔案可以匯出 `{ extractors, providers, judges }`(都是選填;單一擷取器或擷取器清單仍然可用)。
|
|
442
|
+
供應商寫成 `名稱: (env) => ({ label, complete })`,用 `DRIFTNET_LLM_PROVIDER=名稱` 選;判斷器寫成
|
|
443
|
+
`名稱: (env) => ({ name, judge })`,用 `DRIFTNET_JUDGE=名稱` 選。範例見
|
|
444
|
+
[`examples/plugins/rainbow-judge.mjs`](https://github.com/KevinChu1110/driftnet/blob/main/examples/plugins/rainbow-judge.mjs)。
|
|
445
|
+
|
|
347
446
|
## Agent
|
|
348
447
|
|
|
349
448
|
### 查詢、收錄、投票
|
|
@@ -441,9 +540,15 @@ agent 寫回來的內容跟其他不可信的輸入一樣要檢查:格式、
|
|
|
441
540
|
|
|
442
541
|
| 變數 | 預設 | 用途 |
|
|
443
542
|
|---|---|---|
|
|
444
|
-
| `DRIFTNET_LLM_PROVIDER` | *(關閉)* | `anthropic`、`openai`、`claude-cli`、`gemini-cli
|
|
445
|
-
| `DRIFTNET_LLM_MODEL` | — | 模型名稱。`anthropic`、`openai` 必填;`claude-cli` 預設 `haiku` |
|
|
446
|
-
| `DRIFTNET_LLM_API_KEY` | — | 該供應商的金鑰(Ollama/LM Studio
|
|
543
|
+
| `DRIFTNET_LLM_PROVIDER` | *(關閉)* | `anthropic`、`openai`、`gemini`、`bedrock`、`vertex`、`claude-cli`、`gemini-cli`、外掛名稱,或留空 |
|
|
544
|
+
| `DRIFTNET_LLM_MODEL` | — | 模型名稱。`anthropic`、`openai`、`bedrock`、`vertex` 必填;`gemini` 預設 `gemini-flash-latest`;`claude-cli` 預設 `haiku` |
|
|
545
|
+
| `DRIFTNET_LLM_API_KEY` | — | 該供應商的金鑰(Ollama/LM Studio 不用;`vertex` 可填存取權杖代替金鑰檔) |
|
|
546
|
+
| `DRIFTNET_LLM_REGION` | `vertex`:`us-central1` | `bedrock`(沒填時用 `AWS_REGION`)和 `vertex` 的區域 |
|
|
547
|
+
| `AWS_ACCESS_KEY_ID` · `AWS_SECRET_ACCESS_KEY` · `AWS_SESSION_TOKEN` | — | `bedrock` 的憑證 |
|
|
548
|
+
| `AWS_BEARER_TOKEN_BEDROCK` | — | `bedrock` 改用 Bedrock API 金鑰,不用上面三個 |
|
|
549
|
+
| `GOOGLE_APPLICATION_CREDENTIALS` · `DRIFTNET_VERTEX_CREDENTIALS` | — | `vertex`:服務帳戶金鑰檔(第二個也可以直接放 JSON 內容) |
|
|
550
|
+
| `GOOGLE_CLOUD_PROJECT` | 取自金鑰檔 | `vertex` 的專案 |
|
|
551
|
+
| `GEMINI_API_KEY` | — | `DRIFTNET_LLM_API_KEY` 沒填時,`gemini` 用這個 |
|
|
447
552
|
| `DRIFTNET_LLM_BASE_URL` | OpenAI | `openai` 供應商的端點 |
|
|
448
553
|
| `DRIFTNET_LLM_EFFORT` | `anthropic`:`low` | `anthropic`:`low`~`xhigh`;`openai`:`reasoning_effort`;`claude-cli`:`--effort` |
|
|
449
554
|
| `DRIFTNET_CLI_PATH` | `claude`/`gemini` | `claude-cli`/`gemini-cli` 使用的執行檔 |
|
|
@@ -452,7 +557,10 @@ agent 寫回來的內容跟其他不可信的輸入一樣要檢查:格式、
|
|
|
452
557
|
| `DRIFTNET_SUMMARY_DEPTH` | `standard` | 每張卡片寫多少:`brief`、`standard` 或 `detailed` |
|
|
453
558
|
| `DRIFTNET_LOCALE` | 跟 `DRIFTNET_LANGUAGE` | 強制 bot 自己的用語用 `en` 或 `zh-TW` |
|
|
454
559
|
| `DRIFTNET_REPLY` | `link` | 聊天回覆:`link`(一行+網頁連結)、`full`(摘要直接貼在聊天室)或 `off` |
|
|
560
|
+
| `DRIFTNET_REPLY_STYLE` | `rich` | `rich`(embed、Block Kit、Flex 卡片、投票按鈕)或 `text`(純文字) |
|
|
455
561
|
| `TYPESAFE_API_KEY` | `~/.typesafe/api_key` | 啟用 Jev 判斷;`DRIFTNET_JUDGE=off` 可關閉 |
|
|
562
|
+
| `DRIFTNET_JUDGE` | 有金鑰就 Jev | `jev`、`rules`、`llm`、`heuristic`、`off` 或外掛的判斷器(見[判斷器](#判斷器)) |
|
|
563
|
+
| `DRIFTNET_JUDGE_RULES` | — | `rules` 判斷器的規則檔 |
|
|
456
564
|
| `DRIFTNET_MIN_CONFIDENCE` | `0.4` | Jev 信心低於此值時改由模型分類 |
|
|
457
565
|
| `DRIFTNET_DIGEST_TOKENS` | `350` | 頁面大綱的 token 預算 |
|
|
458
566
|
| `DRIFTNET_FOLDERS` | `ai` | 新資料庫的起始資料夾樣板:`ai`(AI 與程式)、`research`(論文、文章、資料集……)或 `everyday`(料理、旅行、理財……)。清單還是空的時候,網頁上也能選 |
|
|
@@ -468,7 +576,9 @@ agent 寫回來的內容跟其他不可信的輸入一樣要檢查:格式、
|
|
|
468
576
|
| `DRIFTNET_SUMMARY_RULES` | — | 每次摘要都要遵守的自訂規則,例如「說明是否免費」;agent 也會收到 |
|
|
469
577
|
| `DRIFTNET_BLOCK_DOMAINS` | — | 永遠不收錄的網域(含子網域),用逗號分隔 |
|
|
470
578
|
| `DRIFTNET_HEALTH` | `off` | `weekly` 約每週重新檢查連結,並標記失效、封存、久未更新的卡片(見「連結健康檢查」)。預設關閉:會對外發送請求 |
|
|
471
|
-
| `
|
|
579
|
+
| `DRIFTNET_VIDEO` | `auto` | `off` 完全不讀影片;`auto` 使用已安裝的 `yt-dlp`、`ffmpeg`、`tesseract`、`whisper`(見「Reels 與 Shorts」) |
|
|
580
|
+
| `DRIFTNET_YTDLP`、`DRIFTNET_FFMPEG`、`DRIFTNET_TESSERACT`、`DRIFTNET_WHISPER` | 從 `PATH` 找 | 不在 `PATH` 的工具的完整路徑(`whisper` 也可指向 `whisper-cli`;whisper.cpp 還需要 `DRIFTNET_WHISPER_MODEL`,指向模型檔) |
|
|
581
|
+
| `DRIFTNET_PLUGINS` | `~/.driftnet/plugins` | 外掛(擷取器、供應商、判斷器;`.js`/`.mjs`)的資料夾,範例見 [`examples/plugins`](https://github.com/KevinChu1110/driftnet/blob/main/examples/plugins) |
|
|
472
582
|
| `DRIFTNET_TOKEN` | — | 管理密碼:寫入、改設定、管理 agent 金鑰、完整的 MCP 工具、agent 佇列。可以在網頁上設定 |
|
|
473
583
|
| `DRIFTNET_READ_KEY` | — | 唯讀分享碼(放 header 或 `?key=`):只能讀,MCP 也只有讀取類工具 |
|
|
474
584
|
| `DRIFTNET_ACCESS` | `public` | `public`:任何人都能讀。`private`:讀取要密碼、分享碼或 agent 金鑰 |
|
|
@@ -490,9 +600,9 @@ agent 寫回來的內容跟其他不可信的輸入一樣要檢查:格式、
|
|
|
490
600
|
| `LINE_CHANNEL_SECRET` · `LINE_CHANNEL_ACCESS_TOKEN` | — | LINE |
|
|
491
601
|
|
|
492
602
|
**HTTP:** `GET /` · `GET /api/items[/:id]`(`?view=favorites|trash`)· `POST /api/items/:id/feedback` ·
|
|
493
|
-
`POST /api/items/:id/{trash,restore,favorite,unfavorite,move}` · `GET|POST /api/folders` · `PATCH|DELETE /api/folders/:id` · `POST /api/ingest` ·
|
|
603
|
+
`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` ·
|
|
494
604
|
`POST /api/chat` · `POST /api/digest/send`(`{"dryRun": true}` 只顯示內容)· `POST /api/pending` · `POST /api/items/:id/enrich` · `GET /api/stats` ·
|
|
495
|
-
`PUT /api/items/:id/note` · `GET|POST /api/notes` · `PUT|DELETE /api/notes/:id` · `GET /api/export`(`?format=vault`)· `POST /api/import`
|
|
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` ·
|
|
496
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`
|
|
497
607
|
|
|
498
608
|
</details>
|
|
@@ -565,13 +675,8 @@ pnpm demo -- --many --private --password demo-pass-123 --read-key demo-share-key
|
|
|
565
675
|
[`examples/plugins/hackernews.mjs`](https://github.com/KevinChu1110/driftnet/blob/main/examples/plugins/hackernews.mjs),或用 `registerExtractor()`)、模型(`LlmProvider`)、判斷器(`Judge`)、聊天平台(`handleChatText()`)、
|
|
566
676
|
瀏覽器擷取(`collect.js`)、bot 介面語言(`i18n.ts`)。
|
|
567
677
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
- [ ] **影片。** 先用字幕和本機 OCR 讀畫面上的字,再用本機語音轉文字;很多 reels 只用講的報工具名稱。
|
|
571
|
-
- [ ] **豐富回覆。** LINE Flex、Slack Block Kit、Discord embed、用表情符號投票。
|
|
572
|
-
- [ ] **每週摘要**推回聊天室。
|
|
573
|
-
- [ ] **擴充打磨。** Threads/X/Instagram 專屬擷取、上架 Chrome 線上應用程式商店。
|
|
574
|
-
- [ ] **更多轉接。** 原生 Gemini、Bedrock、Vertex,以及更多判斷器。
|
|
678
|
+
**想幫忙?** 到 GitHub 找標著 [`good first issue`](https://github.com/KevinChu1110/driftnet/labels/good%20first%20issue) 的題目,或開一個 issue,
|
|
679
|
+
附上 driftnet 處理得不好的連結:這裡每個功能,都是拿大家真正會分享的連結實測後發現的。
|
|
575
680
|
|
|
576
681
|
## 支持
|
|
577
682
|
|