dissentry 0.2.1 → 0.3.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 +67 -72
- package/dist/web/apple-touch-icon.png +0 -0
- package/dist/web/assets/index-CTGjBAR1.js +208 -0
- package/dist/web/assets/index-DiCqStFK.css +2 -0
- package/dist/web/icon-192.png +0 -0
- package/dist/web/icon-512.png +0 -0
- package/dist/web/index.html +23 -5
- package/dist/web/landing/share-card.webp +0 -0
- package/dist/web/landing/thread.webp +0 -0
- package/dist/web/manifest.webmanifest +14 -0
- package/dist/web/og.png +0 -0
- package/package.json +2 -1
- package/dist/web/assets/index-B-8w7SLR.css +0 -2
- package/dist/web/assets/index-DLO79jMf.js +0 -184
package/README.md
CHANGED
|
@@ -1,114 +1,109 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/Lihaila/dissentry/main/public/og.png" alt="Dissentry: don't take one AI's word for it" width="800" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">Dissentry</h1>
|
|
6
|
+
<p align="center"><b>Don’t take one AI’s word for it.</b><br/>Ask one model. The others fact-check it, and add a note only when it’s wrong.</p>
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://dissentry.lihaila.com"><b>Try it →</b></a> ·
|
|
10
|
+
<a href="https://www.npmjs.com/package/dissentry"><img src="https://img.shields.io/npm/v/dissentry?color=0f172a&label=npm" alt="npm" /></a>
|
|
11
|
+
<a href="https://github.com/Lihaila/dissentry/actions/workflows/ci.yml"><img src="https://github.com/Lihaila/dissentry/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
12
|
+
<img src="https://img.shields.io/badge/license-MIT-f59e0b" alt="MIT" />
|
|
13
|
+
</p>
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
---
|
|
8
16
|
|
|
9
|
-
|
|
10
|
-
@llama Is the Great Wall visible from space?
|
|
11
|
-
└─ Local Llama: Yes, it's the only man-made structure visible from the Moon…
|
|
17
|
+
Dissentry is an X-style timeline for AI models. You `@mention` a model to ask it something, and the other models you follow act as **checkers**: they read every answer and attach a **dissent note** only when they find a real problem (a wrong fact, broken code, outdated info or a dangerous step). The disputed sentence is underlined in the answer, and when several checkers flag the same claim their notes merge (“@claude · @qwen · @gemini agree”).
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
[Note is right] [Not helpful] [Ask @llama to respond]
|
|
17
|
-
```
|
|
19
|
+
You decide whether each note is right, and the **Trust** page shows which models get corrected and whose notes hold up, on *your* questions.
|
|
20
|
+
|
|
21
|
+
<p align="center"><img src="https://raw.githubusercontent.com/Lihaila/dissentry/main/docs/screenshots/thread.jpg" alt="An answer from DeepSeek with a dissent note that Claude, Qwen and Gemini agree on" width="900" /></p>
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
- **Four languages.** English, 简体中文, 日本語 and 한국어; follows your browser, switch any time (or link with `?lang=zh|ja|ko`).
|
|
21
|
-
- **Works behind proxies.** HTTP, HTTPS and SOCKS5 proxies, with a bypass list, set in the app.
|
|
22
|
-
- **Local-first.** Posts, notes and API keys live in your browser (IndexedDB). There are no accounts, no telemetry and no server-side storage.
|
|
23
|
-
- **Saves money.** Let a cheap or local model answer and a strong model check. A "looks fine" verdict costs a few tokens; you only pay for a long reply when something is wrong.
|
|
24
|
-
- **X-style threads.** Reply to a model to continue with it, `@mention` others to bring them in, or **quote-repost** any answer with a note (e.g. `@gemini is this right?`). The quoted exchange becomes context for the reply.
|
|
23
|
+
## Features
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
- **Community notes for AI answers**: checkers speak up only when something is wrong; duplicate notes merge into a consensus.
|
|
26
|
+
- **Sign in with OpenRouter**: one login for Claude, GPT, Gemini, DeepSeek, Qwen, Grok and hundreds more, billed to your own account. No keys to copy.
|
|
27
|
+
- **Or bring your own keys**: OpenAI, Anthropic, Gemini, DeepSeek, Qwen, xAI, Mistral, Groq, any OpenAI-compatible endpoint, plus **Ollama** and **LM Studio** for local models.
|
|
28
|
+
- **Share as image**: turn any answer and its notes into a polished card for X, in one click.
|
|
29
|
+
- **Token usage**: tokens and estimated cost per answer, per model, and how much checking costs compared with answering.
|
|
30
|
+
- **Trust scores**: built from your own verdicts, not someone else’s benchmark.
|
|
31
|
+
- **Private by design**: keys and chats live in your browser (IndexedDB). No accounts, no telemetry.
|
|
32
|
+
- **Four languages**: English, 简体中文, 日本語, 한국어.
|
|
33
|
+
- **Works behind proxies**: HTTP, HTTPS and SOCKS5 with a bypass list (local version).
|
|
27
34
|
|
|
28
|
-
|
|
35
|
+
<table>
|
|
36
|
+
<tr>
|
|
37
|
+
<td width="50%"><img src="https://raw.githubusercontent.com/Lihaila/dissentry/main/docs/screenshots/share-card.jpg" alt="Share-as-image card" /></td>
|
|
38
|
+
<td width="50%"><img src="https://raw.githubusercontent.com/Lihaila/dissentry/main/docs/screenshots/timeline-zh.jpg" alt="The timeline in Chinese" /><br/><br/><img src="https://raw.githubusercontent.com/Lihaila/dissentry/main/docs/screenshots/landing.jpg" alt="Landing page" /></td>
|
|
39
|
+
</tr>
|
|
40
|
+
<tr>
|
|
41
|
+
<td align="center"><sub>Share as image: a 2400px card ready for X</sub></td>
|
|
42
|
+
<td align="center"><sub>Full UI in Chinese, Japanese and Korean · landing page</sub></td>
|
|
43
|
+
</tr>
|
|
44
|
+
</table>
|
|
29
45
|
|
|
30
|
-
|
|
46
|
+
## Get started
|
|
31
47
|
|
|
32
|
-
|
|
48
|
+
**Hosted:** open **https://dissentry.lihaila.com**, click *Sign in with OpenRouter* (or add a model with your API key), turn on **Checker** for two or three models, and ask something. Requests go straight from your browser to each provider and never touch our server.
|
|
49
|
+
|
|
50
|
+
**Local** (recommended for local models and maximum privacy; needs Node.js 20+):
|
|
33
51
|
|
|
34
52
|
```bash
|
|
35
53
|
npx dissentry
|
|
36
54
|
```
|
|
37
55
|
|
|
38
|
-
This opens http://localhost:4317.
|
|
39
|
-
|
|
40
|
-
Requires Node.js 20+.
|
|
56
|
+
This opens http://localhost:4317. The local version adds a built-in pass-through proxy, so every provider works and local models need no CORS setup.
|
|
41
57
|
|
|
42
|
-
|
|
58
|
+
**Docker:**
|
|
43
59
|
|
|
44
|
-
|
|
60
|
+
```bash
|
|
61
|
+
docker build -t dissentry . && docker run -p 4317:4317 dissentry
|
|
62
|
+
```
|
|
45
63
|
|
|
46
|
-
|
|
47
|
-
- **No proxy**: connect to every provider directly
|
|
48
|
-
- **Custom proxy**: `http://`, `https://` or `socks5://` (e.g. your Clash / V2Ray client at `socks5://127.0.0.1:1080`), with optional `user:pass@`. Add a bypass list such as `.aliyuncs.com, api.deepseek.com` to reach some providers directly.
|
|
64
|
+
Inside Docker, reach Ollama on the host at `http://host.docker.internal:11434/v1`.
|
|
49
65
|
|
|
50
|
-
|
|
66
|
+
### Using a proxy (mainland China, company networks)
|
|
51
67
|
|
|
52
|
-
|
|
68
|
+
Local version: **Settings → Network proxy**: *System* (uses `HTTPS_PROXY` / `NO_PROXY`), *No proxy*, or *Custom* (`http://`, `https://` or `socks5://`, optional `user:pass@`, bypass list such as `.aliyuncs.com, api.deepseek.com`). **Test connection** checks reachability. Hosted version: requests use your browser’s / system proxy or VPN.
|
|
53
69
|
|
|
54
|
-
|
|
55
|
-
docker build -t dissentry .
|
|
56
|
-
docker run -p 4317:4317 dissentry
|
|
57
|
-
```
|
|
70
|
+
### Can I use my ChatGPT Plus or Claude Pro subscription?
|
|
58
71
|
|
|
59
|
-
|
|
72
|
+
No. Providers don’t allow third-party apps to use consumer subscriptions (Anthropic explicitly banned it in 2026), and accounts that try can be suspended. *Sign in with OpenRouter* is the supported one-login alternative.
|
|
60
73
|
|
|
61
|
-
|
|
74
|
+
## How it works
|
|
62
75
|
|
|
63
|
-
|
|
76
|
+
- React single-page app; all data in the browser. `npx dissentry` adds a tiny local server that serves the app and a stateless pass-through proxy, bound to `127.0.0.1`, rejecting requests whose `Host`/`Origin` aren’t local (blocks other sites and DNS rebinding).
|
|
77
|
+
- Checkers get the conversation plus the answer and must return strict JSON (`{"verdict":"ok"}` or notes with claim, correction and severity). Notes from different checkers merge by claim similarity (CJK-aware), and the disputed sentence is located in the answer even when paraphrased.
|
|
78
|
+
- Token usage comes from each provider’s response; costs use prices you set (auto-filled for OpenRouter).
|
|
64
79
|
|
|
65
|
-
##
|
|
80
|
+
## Self-hosting
|
|
66
81
|
|
|
67
|
-
|
|
68
|
-
- `npx dissentry` runs a tiny local server that serves the app and a **pass-through proxy**. Browsers block many AI APIs (CORS), so requests go `browser → localhost → provider`. The proxy streams the response back and stores and logs nothing.
|
|
69
|
-
- The server binds to `127.0.0.1` and rejects requests whose `Host` or `Origin` isn't local, so other websites can't use it as a proxy (including through DNS rebinding).
|
|
70
|
-
- Checkers get the conversation plus the answer and must return strict JSON (`{"verdict":"ok"}` or a list of notes with claim, correction and severity). Notes from different checkers are merged by claim similarity, which also works for Chinese, Japanese and Korean.
|
|
82
|
+
`npm run build:web` and serve `dist/web` from any static host. See [`deploy/Caddyfile.example`](deploy/Caddyfile.example) for a config with a strict Content-Security-Policy, and host it on its **own origin** (a subdomain), because browser storage, including API keys, is shared by everything on the same origin.
|
|
71
83
|
|
|
72
84
|
## Development
|
|
73
85
|
|
|
74
86
|
```bash
|
|
75
87
|
npm install
|
|
76
88
|
npm run dev # Vite dev server with the proxy built in
|
|
77
|
-
npm test # unit tests
|
|
78
|
-
DISSENTRY_LIVE=1 OPENAI_API_KEY=… DEEPSEEK_API_KEY=… npx vitest run tests/live.test.ts
|
|
79
|
-
# optional live test against real providers via the proxy (small models, < 1¢)
|
|
89
|
+
npm test # unit tests
|
|
80
90
|
npm run build # typecheck + web build + server bundle
|
|
81
|
-
|
|
91
|
+
DISSENTRY_LIVE=1 OPENAI_API_KEY=… npx vitest run tests/live.test.ts # optional live provider test
|
|
82
92
|
```
|
|
83
93
|
|
|
84
|
-
Code map:
|
|
85
|
-
|
|
86
94
|
| Path | What |
|
|
87
95
|
|---|---|
|
|
88
|
-
| `src/lib/engine.ts` | posting, parallel streaming replies, checkers, note merging |
|
|
89
|
-
| `src/lib/context.ts` |
|
|
90
|
-
| `src/lib/notes.ts` | checker JSON parsing
|
|
91
|
-
| `src/lib/providers.ts` | provider adapters
|
|
92
|
-
| `src/
|
|
93
|
-
| `server
|
|
96
|
+
| `src/lib/engine.ts` | posting, parallel streaming replies, checkers, note merging, usage |
|
|
97
|
+
| `src/lib/context.ts` | thread → model messages; checker prompt |
|
|
98
|
+
| `src/lib/notes.ts`, `src/lib/claims.ts` | checker JSON parsing, note merging, disputed-claim highlighting |
|
|
99
|
+
| `src/lib/providers.ts`, `src/lib/openrouter.ts` | provider adapters, OpenRouter sign-in (OAuth PKCE) |
|
|
100
|
+
| `src/i18n/` | UI strings in four languages |
|
|
101
|
+
| `server/` | local proxy and static server |
|
|
94
102
|
|
|
95
|
-
##
|
|
96
|
-
|
|
97
|
-
- Share a post and its notes as an image
|
|
98
|
-
- Web search / citations for checkers
|
|
99
|
-
- Per-topic trust stats
|
|
100
|
-
- Optional sync between devices
|
|
101
|
-
- Desktop app
|
|
103
|
+
## Releasing (maintainers)
|
|
102
104
|
|
|
103
|
-
|
|
105
|
+
`npm version patch` (or `minor`), then `git push --follow-tags`. GitHub Actions tests and publishes to npm through trusted publishing, with provenance.
|
|
104
106
|
|
|
105
107
|
## License
|
|
106
108
|
|
|
107
|
-
MIT. Provider logos come from [@lobehub/icons](https://github.com/lobehub/lobe-icons) (MIT); they are trademarks of their owners and are used only to show which model wrote a post.
|
|
108
|
-
|
|
109
|
-
## Releasing (maintainers)
|
|
110
|
-
|
|
111
|
-
1. Bump the version: `npm version patch` (or `minor`), which commits and creates the `vX.Y.Z` tag.
|
|
112
|
-
2. `git push --follow-tags`
|
|
113
|
-
|
|
114
|
-
GitHub Actions runs the tests and publishes to npm through trusted publishing (no tokens), with provenance.
|
|
109
|
+
MIT © Lihai La LLC. Provider logos come from [@lobehub/icons](https://github.com/lobehub/lobe-icons) (MIT); they are trademarks of their owners and are used only to show which model wrote a post.
|
|
Binary file
|