@tiagojct/subsub 0.10.0 → 0.11.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/README.md +114 -178
- package/dist/bench.js +7 -6
- package/dist/cli.js +34 -1
- package/dist/config.js +21 -13
- package/dist/doctor.js +3 -2
- package/dist/init.js +34 -24
- package/dist/look.js +2 -2
- package/dist/paths.js +20 -0
- package/dist/prompt.js +6 -6
- package/dist/roles.js +12 -12
- package/dist/shortcut.js +2 -2
- package/dist/subsub.js +69 -67
- package/dist/web.js +62 -28
- package/package.json +2 -3
- package/prompts/lit-note.md +1 -1
- package/roles/librarian.md +46 -0
- package/roles/{assistant.md → researcher.md} +4 -5
- package/src/bench.ts +7 -10
- package/src/cli.ts +34 -1
- package/src/config.ts +24 -17
- package/src/doctor.ts +3 -2
- package/src/init.ts +36 -32
- package/src/look.ts +3 -4
- package/src/paths.ts +21 -0
- package/src/prompt.ts +8 -7
- package/src/roles.ts +14 -15
- package/src/shortcut.ts +2 -2
- package/src/subsub.ts +67 -68
- package/src/web.ts +58 -27
- package/templates/Zotero agent.md +2 -2
- package/web/app.css +21 -14
- package/web/app.js +51 -23
- package/web/i18n.js +43 -29
- package/web/index.html +6 -2
- package/docs/Subsub.md +0 -140
package/README.md
CHANGED
|
@@ -1,225 +1,166 @@
|
|
|
1
1
|
# Sub-Sub
|
|
2
2
|
|
|
3
|
-
[](https://nodejs.org)
|
|
7
|
-
[](#requirements)
|
|
3
|
+
[](https://www.npmjs.com/package/@tiagojct/subsub)
|
|
4
|
+
[](https://subsub.tiagojacinto.eu)
|
|
5
|
+
[](LICENSE)
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
Your research assistant, working from your own Zotero library.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
> — Herman Melville, *Moby-Dick* (Extracts)
|
|
9
|
+
Sub-Sub reads what you already have, finds what you are missing in PubMed, Europe PMC and OpenAlex, and writes notes in Markdown. It also keeps the library in order: it imports, tags and repairs references, and shows you each change before it happens. It runs on your computer, in the browser or in the terminal. It is built on the [pi](https://pi.dev) agent and talks to Zotero through Zotero's local API.
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
Website and guide: https://subsub.tiagojacinto.eu
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
> "This mere painstaking burrower and grub-worm of a poor devil of a Sub-Sub appears to have gone through the long Vaticans and street-stalls of the earth, picking up whatever random allusions to whales he could anyways find in any book whatsoever."
|
|
14
|
+
> Herman Melville, Moby-Dick (1851), the Extracts
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
* **Full Journal & Reversible Edits**: Every library modification is recorded with a unique journal ID and can be reverted anytime using `/undo`.
|
|
20
|
-
* **One assistant, one switch**: Sub-Sub reads items, searches PubMed, Europe PMC and OpenAlex, finds gaps, checks citations in manuscripts and writes Markdown notes in your Sub-Sub folder (it can sit inside an Obsidian vault). With **library changes** on (the default), it also tags, imports by DOI, PMID or ISBN, repairs metadata, finds duplicates, attaches open-access PDFs and checks retractions, in the same conversation. Turn library changes off (`/library off`, or the switch in the browser view) to read only.
|
|
21
|
-
* **Local & Private**: Listens strictly on `127.0.0.1` protected by an authenticated single-origin session cookie. Your library contents remain on your computer.
|
|
22
|
-
* **Modern Web Interface & Terminal UI**: Use Sub-Sub in your browser with desktop shortcuts (`~/Applications/Sub-Sub.app`, Start menu, or `.desktop`), or launch it right in your terminal with adaptive color themes.
|
|
16
|
+
## What it does
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
Sub-Sub has two modes.
|
|
19
|
+
|
|
20
|
+
- The Researcher (the default) reads items in your library, searches PubMed, Europe PMC and OpenAlex in one merged search, finds gaps, checks the citations in a manuscript, and writes notes in your Sub-Sub folder. It also does everything the Librarian does, so you can find papers and import and tag them in the same conversation.
|
|
21
|
+
- The Librarian only manages the library: it tags items, imports by DOI, PMID or ISBN, repairs metadata, finds duplicates, attaches open-access PDFs and checks retractions. It has no search tools. Give it a fast, cheap model for long tagging sessions.
|
|
22
|
+
|
|
23
|
+
Each mode can have its own model. Switch with `/researcher` and `/librarian`, or with the buttons in the browser view.
|
|
24
|
+
|
|
25
|
+
Every library change works the same way in both modes:
|
|
26
|
+
|
|
27
|
+
- The Zotero server computes the change first. Sub-Sub shows it to you (added tags in green, removed tags in red) and applies it only when you select Yes. The check is in the program, so the model cannot skip it.
|
|
28
|
+
- Each change sends the item's version, so an edit you make in Zotero at the same time is not overwritten.
|
|
29
|
+
- Every change is journaled. `/undo` reverts it.
|
|
30
|
+
- Nothing is deleted: items go to the Zotero trash. Only tags from your tag list can be added.
|
|
25
31
|
|
|
26
32
|
## Profiles
|
|
27
33
|
|
|
28
|
-
|
|
34
|
+
The profile sets how much Sub-Sub writes for you and which tools it offers. Choose it in `subsub init`, or change it with `/profile`.
|
|
29
35
|
|
|
30
|
-
| Profile |
|
|
36
|
+
| Profile | What Sub-Sub does |
|
|
31
37
|
|---|---|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
37
|
-
> [!NOTE]
|
|
38
|
-
> A profile is your own operational baseline, not a rigid constraint. You can switch between profiles whenever your research focus shifts.
|
|
38
|
+
| Reader | Reading notes with quotations, page numbers and questions for you. No summaries or syntheses unless you ask. No bulk library changes. |
|
|
39
|
+
| Scholar | Literature notes, syntheses, searches, alerts and all library changes. |
|
|
40
|
+
| Author | Scholar, plus manuscript work: citation checks against your library, bibliographies for Pandoc and Quarto, and comments on the argument. It does not write your paragraphs. |
|
|
41
|
+
| Editor | Everything, including drafts of manuscript sections and abstracts when you ask. |
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
The [Profiles page](https://subsub.tiagojacinto.eu/profiles/) lists the tools and commands for each profile and mode.
|
|
41
44
|
|
|
42
45
|
## Requirements
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* **Model Provider Account**: Any provider supported by pi (e.g., OpenCode Go, OpenRouter, Anthropic, OpenAI, Mistral, DeepSeek, Google Gemini, or local Ollama).
|
|
49
|
-
* **OS**: macOS, Linux, or Windows.
|
|
50
|
-
|
|
51
|
-
---
|
|
47
|
+
- Zotero 10 or later, running, with Settings > Advanced > "Allow other applications on this computer to communicate with Zotero" on.
|
|
48
|
+
- Node.js 22.19 or later, and [uv](https://docs.astral.sh/uv/). The installers add both if they are missing.
|
|
49
|
+
- An account with a model provider that pi supports (for example OpenCode Go, OpenRouter, Anthropic, OpenAI, Mistral, Google), or a local model.
|
|
50
|
+
- macOS, Linux or Windows.
|
|
52
51
|
|
|
53
52
|
## Install
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Automated installers handle Node.js, uv, and desktop shortcuts:
|
|
58
|
-
|
|
59
|
-
* **macOS & Linux**:
|
|
60
|
-
```sh
|
|
61
|
-
curl -fsSL https://subsub.tiagojacinto.eu/install.sh | sh
|
|
62
|
-
```
|
|
63
|
-
* **Windows (PowerShell)**:
|
|
64
|
-
```powershell
|
|
65
|
-
powershell -ExecutionPolicy ByPass -c "irm https://subsub.tiagojacinto.eu/install.ps1 | iex"
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Manual Installation
|
|
69
|
-
|
|
70
|
-
1. Install the global package:
|
|
71
|
-
```sh
|
|
72
|
-
npm install -g @tiagojct/subsub
|
|
73
|
-
```
|
|
74
|
-
2. Run setup:
|
|
75
|
-
```sh
|
|
76
|
-
subsub init
|
|
77
|
-
```
|
|
78
|
-
Answer the interactive prompts (press <kbd>Enter</kbd> to accept defaults). This creates your Sub-Sub folder (`~/Documents/Sub-Sub`, or `Sub-Sub` inside your Obsidian vault) with `Inbox/`, `Literature/`, `Syntheses/`, `Research/` and `Zotero/`, sets up a starter tag list (`Zotero/Zotero tags.md`), and writes the note formats (`Zotero/Zotero agent.md`).
|
|
79
|
-
3. Verify your environment:
|
|
80
|
-
```sh
|
|
81
|
-
subsub doctor
|
|
82
|
-
```
|
|
83
|
-
Resolve any items marked with `FIX`.
|
|
84
|
-
4. Install system shortcuts:
|
|
85
|
-
```sh
|
|
86
|
-
subsub shortcut
|
|
87
|
-
```
|
|
88
|
-
Creates `~/Applications/Sub-Sub.app` on macOS, Start menu & desktop shortcuts on Windows, or an application launcher on Linux.
|
|
89
|
-
5. Launch Sub-Sub:
|
|
90
|
-
Open the shortcut or run `subsub web`. Connect your model provider via the **Model** dialog with an API key (or in the terminal via `subsub`, then `/login`).
|
|
91
|
-
|
|
92
|
-
If you already use [pi](https://pi.dev), you can add Sub-Sub as an extension:
|
|
54
|
+
macOS and Linux:
|
|
55
|
+
|
|
93
56
|
```sh
|
|
94
|
-
|
|
57
|
+
curl -fsSL https://subsub.tiagojacinto.eu/install.sh | sh
|
|
95
58
|
```
|
|
96
59
|
|
|
97
|
-
|
|
60
|
+
Windows (PowerShell):
|
|
98
61
|
|
|
99
|
-
|
|
62
|
+
```powershell
|
|
63
|
+
powershell -ExecutionPolicy ByPass -c "irm https://subsub.tiagojacinto.eu/install.ps1 | iex"
|
|
64
|
+
```
|
|
100
65
|
|
|
101
|
-
|
|
66
|
+
The installers put everything in your user folder (`~/.subsub`), run `subsub init`, and add a Sub-Sub shortcut. You do not need administrator rights.
|
|
102
67
|
|
|
103
|
-
|
|
68
|
+
With npm:
|
|
104
69
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
* **Session Search & Markdown Export**: Filter conversation history in real time and download full discussions as Markdown notes.
|
|
111
|
-
* **Local Security**: Binds strictly to `127.0.0.1`. The initial link carries a random token that converts into an `HttpOnly`, `SameSite=Strict` cookie. Protected with strict Content Security Policy (CSP), origin validation, and sanitized output.
|
|
112
|
-
* **Auto-Idle Management**: A single daemon serves requests and stops automatically after 10 minutes of inactivity when no pages remain open. Use `--stay` to keep running indefinitely, or `--idle N` to change the timeout.
|
|
70
|
+
```sh
|
|
71
|
+
npm install -g @tiagojct/subsub
|
|
72
|
+
subsub init
|
|
73
|
+
subsub doctor
|
|
74
|
+
```
|
|
113
75
|
|
|
114
|
-
|
|
76
|
+
`subsub init` asks a few questions. Press Enter to accept the default. It creates the Sub-Sub folder (`~/Documents/Sub-Sub`, or a `Sub-Sub` folder inside your Obsidian vault) with `Inbox/`, `Literature/`, `Syntheses/`, `Research/` and `Zotero/`, a starter tag list (`Zotero/Zotero tags.md`) and the note formats (`Zotero/Zotero agent.md`). `subsub doctor` checks the set-up; each line marked FIX says what to do.
|
|
115
77
|
|
|
116
|
-
|
|
78
|
+
If you already use pi, you can add Sub-Sub to it: `pi install npm:@tiagojct/subsub`.
|
|
117
79
|
|
|
118
|
-
|
|
80
|
+
Sub-Sub runs its Zotero server, [zotero-local-mcp](https://github.com/tiagojct/zotero-local-mcp), from PyPI with uv.
|
|
119
81
|
|
|
120
|
-
|
|
121
|
-
subsub # Start in the terminal
|
|
122
|
-
subsub --read-only # Start with library changes off (this session only)
|
|
123
|
-
subsub web # Start browser view
|
|
124
|
-
subsub -c # Continue the previous session
|
|
125
|
-
subsub -r # Resume an older session
|
|
126
|
-
```
|
|
82
|
+
## Use
|
|
127
83
|
|
|
128
|
-
Commands available within Sub-Sub:
|
|
129
|
-
|
|
130
|
-
* `/library on|off`: Turn library changes on or off (saved). Without an argument, it toggles. `/librarian` and `/researcher`, the two modes before 0.10, still work: on and off.
|
|
131
|
-
* `/profile [name]`: View or change active profile (`reader`, `scholar`, `author`, `editor`).
|
|
132
|
-
* `/subsub`: Display Zotero connection health and library statistics.
|
|
133
|
-
* `/history`: List recent library changes with journal IDs.
|
|
134
|
-
* `/undo [id]`: Revert the last change (or a specific journal ID).
|
|
135
|
-
|
|
136
|
-
### Built-in Prompt Templates
|
|
137
|
-
|
|
138
|
-
Type the command followed by arguments:
|
|
139
|
-
|
|
140
|
-
* **Library** (need library changes on):
|
|
141
|
-
* `/tag-batch [size]`: Tag untagged items using your tag vocabulary.
|
|
142
|
-
* `/clean-tags`: Find irregular tags and reconcile with your vocabulary.
|
|
143
|
-
* `/import-queue [path]`: Import pending references from an inbox note.
|
|
144
|
-
* **Research**:
|
|
145
|
-
* `/lit <question>`: Literature review: the library first, then PubMed, Europe PMC and OpenAlex in one merged search; reads before it summarises; an evidence table, agreement, disagreement and open questions; references checked; one note in `Research/` (Scholar, Author, Editor).
|
|
146
|
-
* `/compare <question or citekeys>`: Source matrix (claim, evidence type, caveats, confidence), agreements and disagreements (Scholar, Author, Editor).
|
|
147
|
-
* `/review <path>`: Critical review of your own manuscript: FATAL, MAJOR and MINOR issues against the reporting guideline that applies (CONSORT, STROBE, PRISMA, STARD, TRIPOD), with quotations and a revision plan. Comments only (Author, Editor).
|
|
148
|
-
* `/digest [days] [topic]`: Digest of the last days (default 7): what the new notes and alerts change, works worth reading, open questions, decisions for you (Scholar, Author, Editor).
|
|
149
|
-
* `/request-copy <citekey, DOI or PMID>`: Draft an email to the corresponding author asking for a copy of a paper that is not open access. The address comes from the PubMed record; you send the email yourself.
|
|
150
|
-
* `/lit-note <citekey>`: Generate an in-depth literature note from item fulltext.
|
|
151
|
-
* `/synthesis <topic>`: Synthesize library findings on a specific topic.
|
|
152
|
-
* `/gaps <topic>`: Identify unanswered questions and literature gaps.
|
|
153
|
-
* `/manuscript <path>`: Cross-check manuscript citations against your library.
|
|
154
|
-
* `/verify <path> [claims]`: Check that each cited work exists, matches its citation and was not retracted (needs the Starbuck add-on). With `claims`, also check whether each source supports the sentence that cites it.
|
|
155
|
-
* `/alert`: Check PubMed and OpenAlex for new publications matching research topics.
|
|
156
|
-
|
|
157
|
-
### Batch Tag Review
|
|
158
|
-
|
|
159
|
-
To preview or apply batch tag reviews generated in your `Inbox/`:
|
|
160
84
|
```sh
|
|
161
|
-
subsub
|
|
162
|
-
subsub
|
|
85
|
+
subsub web # in the browser
|
|
86
|
+
subsub # in the terminal
|
|
87
|
+
subsub --librarian # in the terminal, in the Librarian
|
|
88
|
+
subsub -c # continue the last conversation
|
|
89
|
+
subsub --help # all commands
|
|
163
90
|
```
|
|
164
91
|
|
|
165
|
-
|
|
92
|
+
In the browser view, connect a model provider with the model button. In the terminal, type `/login`.
|
|
166
93
|
|
|
167
|
-
|
|
94
|
+
Commands in Sub-Sub:
|
|
168
95
|
|
|
169
|
-
|
|
96
|
+
| Command | What it does |
|
|
97
|
+
|---|---|
|
|
98
|
+
| `/researcher`, `/librarian` | Switch the mode |
|
|
99
|
+
| `/profile [name]` | Show or change the profile |
|
|
100
|
+
| `/subsub` | Zotero connection, mode, model and library counts |
|
|
101
|
+
| `/history`, `/undo [id]` | Recent library changes; undo the last one or one by its id |
|
|
102
|
+
| `/tag-batch [size]` | Tag items that have no topic, with your tag list |
|
|
103
|
+
| `/clean-tags` | Find tags that are not in your tag list and propose fixes |
|
|
104
|
+
| `/import-queue [path]` | Import the references in the import queue note |
|
|
105
|
+
| `/lit <question>` | Literature review: the library first, then one merged search; an evidence table, agreement, disagreement and open questions; one note in `Research/` |
|
|
106
|
+
| `/compare <question or citekeys>` | A matrix of sources: claim, evidence, caveats, confidence |
|
|
107
|
+
| `/lit-note <citekey>` | A literature note on one item, from its full text |
|
|
108
|
+
| `/synthesis <topic>` | A synthesis of what the library says on a topic |
|
|
109
|
+
| `/gaps <topic>` | Open questions and gaps in the literature |
|
|
110
|
+
| `/manuscript <path>` | Check a manuscript's citations against the library |
|
|
111
|
+
| `/review <path>` | Comments on your own manuscript against the reporting guideline that applies (CONSORT, STROBE, PRISMA, STARD, TRIPOD, CHEERS, SRQR, COREQ). Comments only, next to the manuscript |
|
|
112
|
+
| `/verify <path> [claims]` | Check that each cited work exists, matches its citation and was not retracted; with `claims`, also whether each source supports its sentence (Starbuck add-on) |
|
|
113
|
+
| `/alert` | New publications for your saved searches |
|
|
114
|
+
| `/digest [days] [topic]` | What changed in the last days: new notes, alerts, works worth reading |
|
|
115
|
+
| `/request-copy <citekey, DOI or PMID>` | A draft email to the corresponding author for a paper that is not open access. You send it yourself |
|
|
116
|
+
|
|
117
|
+
The library commands work in both modes; the research commands need the Researcher. Some commands depend on the profile (see the Profiles page).
|
|
118
|
+
|
|
119
|
+
To check or apply a tag review note from `Inbox/` outside Sub-Sub:
|
|
170
120
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
| `about` | string | Brief background context about your research domain | `null` |
|
|
176
|
-
| `language` | string | Response language, or `"auto"` to match your input | `"English"` |
|
|
177
|
-
| `vault` | string | Path to your Sub-Sub folder | `$ZOTERO_VAULT` |
|
|
178
|
-
| `model` | string | The model, as provider/id; `""` to choose it in Sub-Sub | `"opencode-go/mimo-v2.6-pro"` |
|
|
179
|
-
| `libraryChanges` | boolean | Library changes on (each change still needs your Yes) | `true` |
|
|
180
|
-
| `serverDir` | string | Local development path for `zotero-local-mcp` | PyPI package |
|
|
181
|
-
| `look` | boolean| Show header banners and status lines in terminal | `true` |
|
|
182
|
-
| `quotes` | boolean| Display quotes from *Moby-Dick* in terminal banner | `true` |
|
|
183
|
-
| `themes` | string or false | Terminal theme family (`subsub-glauca` or `subsub-try-works`); `false` keeps your pi theme | `"subsub-glauca"` |
|
|
184
|
-
| `addons` | array | Optional servers; `["starbuck"]` adds reference checks | `[]` |
|
|
185
|
-
| `starbuckDir` | string | Local Starbuck folder (used when it has a `pyproject.toml`) | `~/Projects/starbuck` |
|
|
121
|
+
```sh
|
|
122
|
+
subsub review preview 13-31
|
|
123
|
+
subsub review apply 13-31
|
|
124
|
+
```
|
|
186
125
|
|
|
187
|
-
|
|
126
|
+
## Settings
|
|
188
127
|
|
|
189
|
-
|
|
128
|
+
`subsub init` writes `~/.config/subsub/config.json` (or the file in `$SUBSUB_CONFIG`). You can also edit it.
|
|
190
129
|
|
|
191
|
-
|
|
130
|
+
| Setting | Meaning | Default |
|
|
131
|
+
|---|---|---|
|
|
132
|
+
| `profile` | `reader`, `scholar`, `author` or `editor` | `scholar` |
|
|
133
|
+
| `userName`, `about` | Your name and one line about you, for the replies | none |
|
|
134
|
+
| `language` | Language of replies and notes, or `auto` for the language you write in | `English` |
|
|
135
|
+
| `vault` | The Sub-Sub folder | from the server settings |
|
|
136
|
+
| `models` | The model for each mode, as provider/id: `{"librarian": "...", "researcher": "..."}`. `{}` means you choose in Sub-Sub | `opencode-go/mimo-v2.6-flash` and `opencode-go/mimo-v2.6-pro` |
|
|
137
|
+
| `defaultMode` | `researcher` or `librarian` | `researcher` |
|
|
138
|
+
| `addons` | `["starbuck"]` adds reference checks | `[]` |
|
|
139
|
+
| `serverDir` | A local copy of zotero-local-mcp, for development | the PyPI release |
|
|
140
|
+
| `starbuckDir` | A local copy of Starbuck, for development | the pinned release |
|
|
141
|
+
| `look`, `quotes`, `themes` | The terminal header, the Moby-Dick quotations, and the terminal colours (`subsub-glauca`, `subsub-try-works`, or `false` for your pi theme) | on, on, `subsub-glauca` |
|
|
192
142
|
|
|
193
|
-
|
|
143
|
+
The settings of the Zotero server (Sub-Sub folder, tag list, alerts file, contact email) are in `~/.config/zotero-local-mcp/env`.
|
|
194
144
|
|
|
195
|
-
|
|
145
|
+
## Privacy
|
|
196
146
|
|
|
197
|
-
|
|
198
|
-
```json
|
|
199
|
-
"addons": ["starbuck"]
|
|
200
|
-
```
|
|
201
|
-
2. Optional: set `"starbuckDir"` to a local copy of Starbuck. Without it, Sub-Sub runs the pinned Starbuck release with uv.
|
|
202
|
-
3. Start Sub-Sub again and run `subsub doctor`. The line `Starbuck` must show `ok`.
|
|
147
|
+
Your library stays in Zotero; Sub-Sub uses Zotero's local API and never your zotero.org account. The model provider you choose receives your messages and what the tools return (titles, abstracts, tags, and passages of full texts when you ask for them). PubMed, Europe PMC, OpenAlex, Crossref, Unpaywall and Open Library receive identifiers and search terms, with your contact email if you gave one. Sub-Sub sends no usage data. The browser view listens only on 127.0.0.1 and needs the random key in the address that `subsub web` opens. Details: https://subsub.tiagojacinto.eu/privacy/
|
|
203
148
|
|
|
204
|
-
|
|
149
|
+
## Papers that are not open access
|
|
205
150
|
|
|
206
|
-
|
|
151
|
+
Sub-Sub finds open-access copies through Unpaywall and Europe PMC. For other papers, use Sub-Sub on your institution's network, where the DOI link opens the publisher's version through the library's subscriptions, or use `/request-copy`. Sub-Sub does not use unlicensed sources.
|
|
207
152
|
|
|
208
|
-
##
|
|
153
|
+
## Reference checks (Starbuck)
|
|
209
154
|
|
|
210
|
-
|
|
155
|
+
[Starbuck](https://github.com/tiagojct/starbuck) is an optional add-on. It checks that each cited work exists, that its title, first author and year match the citation, and that it was not retracted or corrected. On request, it also checks whether the source supports the sentence that cites it; Sub-Sub's model judges, and Starbuck checks that every quoted passage is in the source.
|
|
211
156
|
|
|
212
|
-
|
|
213
|
-
subsub-bench prepare # Sample realistic test tasks from your library
|
|
214
|
-
subsub-bench run # Run models in parallel against safety-isolated sandbox
|
|
215
|
-
subsub-bench score # Generate objective evaluation scorecard (results.md)
|
|
216
|
-
```
|
|
157
|
+
Turn it on in `subsub init`, with the switch in the browser view, or with `"addons": ["starbuck"]` in the settings. Then `subsub doctor` must show Starbuck ok. Starbuck writes its report in a `_starbuck` folder next to the manuscript.
|
|
217
158
|
|
|
218
|
-
|
|
159
|
+
## Model test
|
|
219
160
|
|
|
220
|
-
|
|
161
|
+
`subsub-bench` runs several models on the same tasks against your own library and scores them. Nothing in the library changes. See [docs/model-test.md](https://github.com/tiagojct/subsub/blob/main/docs/model-test.md) and the [Models page](https://subsub.tiagojacinto.eu/models/) for the latest results.
|
|
221
162
|
|
|
222
|
-
## Development
|
|
163
|
+
## Development
|
|
223
164
|
|
|
224
165
|
```sh
|
|
225
166
|
git clone https://github.com/tiagojct/subsub.git
|
|
@@ -229,13 +170,8 @@ npm test
|
|
|
229
170
|
npm run build
|
|
230
171
|
```
|
|
231
172
|
|
|
232
|
-
|
|
233
|
-
```sh
|
|
234
|
-
ZLM_DIR=/path/to/zotero-local-mcp npm run test:e2e
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
---
|
|
173
|
+
End-to-end tests (real pi and Python servers, a fake Zotero, a scripted model): `ZLM_DIR=/path/to/zotero-local-mcp npm run test:e2e`.
|
|
238
174
|
|
|
239
|
-
##
|
|
175
|
+
## Licence
|
|
240
176
|
|
|
241
|
-
[MIT](LICENSE)
|
|
177
|
+
[MIT](LICENSE), Tiago Jacinto. The `/lit`, `/compare` and `/review` prompts adapt text from [Feynman](https://github.com/Companion-Inc/feynman) (MIT); see [THIRD_PARTY_NOTICES](THIRD_PARTY_NOTICES). IBM Plex fonts: SIL Open Font License.
|
package/dist/bench.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* subsub-bench: the same tasks for several models, against the real library,
|
|
3
|
-
* with no changes applied. See docs/
|
|
3
|
+
* with no changes applied. See docs/model-test.md.
|
|
4
4
|
*
|
|
5
5
|
* subsub-bench prepare [--seed 7] pick the tasks (read-only)
|
|
6
6
|
* subsub-bench run [--models a,b] [--librarian a,b] [--researcher c,d] [--parallel 3] [--only task]
|
|
@@ -20,8 +20,8 @@ import { expand, loadConfig, starbuckCommand, starbuckEnabled } from "./config.j
|
|
|
20
20
|
import { findUv } from "./subsub.js";
|
|
21
21
|
export const PACKAGE_DIR = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
22
22
|
export const DEFAULT_MODELS = {
|
|
23
|
-
librarian: ["
|
|
24
|
-
researcher: ["mimo-v2.6-pro", "
|
|
23
|
+
librarian: ["mimo-v2.6-flash", "glm-5.3-flash", "qwen3.8-flash", "gpt-5.6-luna", "hy3", "mimo-v2.6-pro"],
|
|
24
|
+
researcher: ["mimo-v2.6-pro", "qwen3.8-flash", "kimi-k3", "glm-5.3", "minimax-m3", "gpt-5.6-luna"],
|
|
25
25
|
};
|
|
26
26
|
export const TASKS = {
|
|
27
27
|
librarian: ["tagging", "facet_fix", "import"],
|
|
@@ -54,7 +54,7 @@ export function promptFor(task, t, code, out) {
|
|
|
54
54
|
case "lit_note":
|
|
55
55
|
return t.lit_note
|
|
56
56
|
? `Make a literature note for ${t.lit_note.citekey}, following the literature-note format in the shared rules. Read the full text. ` +
|
|
57
|
-
`This is a model test: save the note as ${join(out, `${t.lit_note.citekey}.md`)} instead of
|
|
57
|
+
`This is a model test: save the note as ${join(out, `${t.lit_note.citekey}.md`)} instead of Literature/ in the Sub-Sub folder, and do not attach anything to Zotero.`
|
|
58
58
|
: undefined;
|
|
59
59
|
case "synthesis":
|
|
60
60
|
return t.synthesis
|
|
@@ -81,7 +81,8 @@ const KEEP = new Set(["tool_execution_start", "tool_execution_end", "message_end
|
|
|
81
81
|
export function runOne(opts) {
|
|
82
82
|
mkdirSync(opts.out, { recursive: true });
|
|
83
83
|
const args = ["--mode", "rpc", "--no-session", "--provider", opts.provider ?? "opencode-go", "--model", opts.model];
|
|
84
|
-
|
|
84
|
+
if (opts.role === "librarian")
|
|
85
|
+
args.push("--librarian");
|
|
85
86
|
const env = { ...process.env, ...opts.extraEnv, SUBSUB_BENCH_OUT: opts.out, SUBSUB_CONFIG: opts.configFile };
|
|
86
87
|
const proc = spawn(process.execPath, [opts.cli ?? join(PACKAGE_DIR, "bin", "subsub.js"), ...args], { cwd: opts.cwd, env });
|
|
87
88
|
const events = [];
|
|
@@ -557,7 +558,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
557
558
|
if (!prompt)
|
|
558
559
|
return;
|
|
559
560
|
const cf = join(cfgDir, `${j.code}.json`);
|
|
560
|
-
writeFileSync(cf, JSON.stringify({ ...userCfg, profile: "editor",
|
|
561
|
+
writeFileSync(cf, JSON.stringify({ ...userCfg, profile: "editor", models: { librarian: `opencode-go/${j.model}`, researcher: `opencode-go/${j.model}` }, model: undefined, libraryChanges: undefined }));
|
|
561
562
|
const s = await runOne({ ...j, prompt, out, cwd: cfg.vault, configFile: cf, timeoutSec });
|
|
562
563
|
n++;
|
|
563
564
|
console.log(`${n}/${jobs.length} ${j.code} ${j.task} ${s.seconds}s ${s.error ?? (s.settled ? "done" : "?")}`);
|
package/dist/cli.js
CHANGED
|
@@ -143,11 +143,36 @@ export function reviewCommand(args, cfg, env = process.env) {
|
|
|
143
143
|
env: { ...env, ...(cfg.envFile ? { ZOTERO_MCP_ENV: cfg.envFile } : {}) },
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
+
const HELP = `Sub-Sub: your research assistant, working from your own Zotero library.
|
|
147
|
+
|
|
148
|
+
Usage:
|
|
149
|
+
subsub Start Sub-Sub in the terminal
|
|
150
|
+
subsub --librarian Start in the Librarian, which only manages the library
|
|
151
|
+
subsub web Open Sub-Sub in the browser
|
|
152
|
+
subsub init Set up or change the settings (folder, tag list, profile, models)
|
|
153
|
+
subsub doctor Check the set-up; each line marked FIX says what to do
|
|
154
|
+
subsub shortcut Add a Sub-Sub shortcut (--remove takes it away)
|
|
155
|
+
subsub review preview|apply <note>
|
|
156
|
+
Check or apply a tag review note from Inbox/
|
|
157
|
+
subsub --version Show the versions
|
|
158
|
+
|
|
159
|
+
Options:
|
|
160
|
+
--here Work in the current folder, not in the Sub-Sub folder
|
|
161
|
+
|
|
162
|
+
In Sub-Sub, type /subsub for the state, /researcher or /librarian to switch modes,
|
|
163
|
+
/profile to change the profile, /undo to undo the last change, and / for all commands.
|
|
164
|
+
Sub-Sub runs on pi: pi's options (for example --model, --resume) also work.
|
|
165
|
+
|
|
166
|
+
Docs: https://subsub.tiagojacinto.eu`;
|
|
146
167
|
export async function run(argv = process.argv.slice(2)) {
|
|
147
168
|
const env = process.env;
|
|
148
169
|
const home = homedir();
|
|
149
170
|
const here = argv.includes("--here");
|
|
150
171
|
const args = argv.filter((a) => a !== "--here");
|
|
172
|
+
if (args[0] === "--help" || args[0] === "-h" || args[0] === "help") {
|
|
173
|
+
console.log(HELP);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
151
176
|
if (args[0] === "--version" || args[0] === "-v") {
|
|
152
177
|
const piPkg = join(dirname(fileURLToPath(import.meta.resolve("@earendil-works/pi-coding-agent"))), "..");
|
|
153
178
|
console.log(`subsub ${packageVersion()} (pi ${packageVersion(piPkg)})`);
|
|
@@ -182,7 +207,13 @@ export async function run(argv = process.argv.slice(2)) {
|
|
|
182
207
|
return;
|
|
183
208
|
}
|
|
184
209
|
if (isSelfUpdate(args)) {
|
|
185
|
-
|
|
210
|
+
if (PACKAGE_DIR.split(/[\\/]/).includes("node_modules")) {
|
|
211
|
+
console.log("Sub-Sub is not updated with \"update\". To update it, run the installer again (https://subsub.tiagojacinto.eu/install/);");
|
|
212
|
+
console.log("if you installed it with npm, type: npm install -g @tiagojct/subsub");
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
console.log(`Sub-Sub is not updated with "update". Its code is in ${PACKAGE_DIR}; after new code arrives, run "npm install" there.`);
|
|
216
|
+
}
|
|
186
217
|
console.log('To update packages added to Sub-Sub, use "subsub update --extensions".');
|
|
187
218
|
process.exitCode = 1;
|
|
188
219
|
return;
|
|
@@ -215,6 +246,8 @@ export async function run(argv = process.argv.slice(2)) {
|
|
|
215
246
|
env.SUBSUB_CLI = "1";
|
|
216
247
|
// pi's update notice would point to the global pi, not to this copy.
|
|
217
248
|
env.PI_SKIP_VERSION_CHECK ??= "1";
|
|
249
|
+
// pi reports a first install to pi.dev and names itself to some providers; Sub-Sub sends no usage data.
|
|
250
|
+
env.PI_TELEMETRY ??= "0";
|
|
218
251
|
process.argv = [process.argv[0], process.argv[1], ...args];
|
|
219
252
|
const index = fileURLToPath(import.meta.resolve("@earendil-works/pi-coding-agent"));
|
|
220
253
|
await import(__rewriteRelativeImportExtension(pathToFileURL(join(dirname(index), "bundle", "cli.js")).href));
|
package/dist/config.js
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* "profile": "scholar",
|
|
7
7
|
* "userName": "Ana", "about": "a master's student in health informatics", "language": "English",
|
|
8
8
|
* "vault": "~/Documents/Sub-Sub",
|
|
9
|
-
* "
|
|
10
|
-
* "
|
|
9
|
+
* "models": { "librarian": "opencode-go/mimo-v2.6-flash", "researcher": "opencode-go/mimo-v2.6-pro" },
|
|
10
|
+
* "defaultMode": "researcher"
|
|
11
11
|
* }
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* Two modes: the Librarian manages the library; the Researcher does that too,
|
|
14
|
+
* and searches and writes notes. "model" (0.10) sets one model for both;
|
|
15
|
+
* "libraryChanges" (0.10) is no longer used.
|
|
16
16
|
*
|
|
17
17
|
* `subsub init` writes this file. Without "serverDir" (or when that folder does
|
|
18
18
|
* not exist), the Zotero servers run from PyPI with uv.
|
|
@@ -26,8 +26,11 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
26
26
|
import { homedir } from "node:os";
|
|
27
27
|
import { dirname, join, resolve } from "node:path";
|
|
28
28
|
import { isObsidianVault, settingsFile } from "./layout.js";
|
|
29
|
-
/** The tested
|
|
30
|
-
export const
|
|
29
|
+
/** The tested models, one per mode (model test, see bench-results). */
|
|
30
|
+
export const DEFAULT_MODELS = {
|
|
31
|
+
librarian: "opencode-go/mimo-v2.6-flash",
|
|
32
|
+
researcher: "opencode-go/mimo-v2.6-pro",
|
|
33
|
+
};
|
|
31
34
|
export const PROFILES = ["reader", "scholar", "author", "editor"];
|
|
32
35
|
/** The Zotero server release that this Sub-Sub version runs when there is no local server folder. */
|
|
33
36
|
export const SERVER_VERSION = "0.5.1";
|
|
@@ -107,10 +110,15 @@ export function loadConfig(env = process.env) {
|
|
|
107
110
|
const envValues = envFile && existsSync(envFile) ? parseEnvFile(envFile) : {};
|
|
108
111
|
const vaultRaw = user.vault ?? env.ZOTERO_VAULT ?? envValues.ZOTERO_VAULT;
|
|
109
112
|
const vault = vaultRaw ? expand(vaultRaw, home) : undefined;
|
|
110
|
-
//
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
// "models" per mode; "model" (0.10) for both; {} or "" means: the user chooses in pi (/login, /model).
|
|
114
|
+
const one = typeof user.model === "string" ? user.model : undefined;
|
|
115
|
+
const given = user.models && typeof user.models === "object" ? user.models : undefined;
|
|
116
|
+
// Without a settings file (no subsub init yet), the user chooses in pi: no default that may lack a key.
|
|
117
|
+
const fallback = existsSync(file) ? { ...DEFAULT_MODELS } : {};
|
|
118
|
+
const models = given ?? (one !== undefined ? { librarian: one || undefined, researcher: one || undefined } : fallback);
|
|
119
|
+
for (const k of Object.keys(models))
|
|
120
|
+
if (!models[k])
|
|
121
|
+
delete models[k];
|
|
114
122
|
const themes = user.themes === false ? false : typeof user.themes === "string" ? user.themes : user.themes?.researcher;
|
|
115
123
|
return {
|
|
116
124
|
configFile: file,
|
|
@@ -122,8 +130,8 @@ export function loadConfig(env = process.env) {
|
|
|
122
130
|
serverDir: expand(user.serverDir ?? "~/Projects/zotero-local-mcp", home),
|
|
123
131
|
envFile,
|
|
124
132
|
vault,
|
|
125
|
-
|
|
126
|
-
|
|
133
|
+
models,
|
|
134
|
+
defaultMode: user.defaultMode === "librarian" ? "librarian" : "researcher",
|
|
127
135
|
// A Sub-Sub folder inside an Obsidian vault also reads the vault's context file.
|
|
128
136
|
vaultContext: (user.vaultContext ??
|
|
129
137
|
(vault ? [join(vault, ".claude", "CLAUDE.md"), ...(isObsidianVault(dirname(vault)) ? [join(dirname(vault), ".claude", "CLAUDE.md")] : [])] : [])).map((p) => expand(p, home)),
|
package/dist/doctor.js
CHANGED
|
@@ -80,7 +80,8 @@ export function runChecks(cfg, env, deps = {}) {
|
|
|
80
80
|
: { name: "Zotero", ok: false, detail: String(st.error ?? "not reachable"), fix: `Start Zotero 10 or later. ${ZOTERO_SETTING}` });
|
|
81
81
|
const v = st.vocabulary ?? {};
|
|
82
82
|
if (v.loaded === false || !v.tags) {
|
|
83
|
-
|
|
83
|
+
const path = v.path && v.path !== "None" ? v.path : undefined; // the server writes Python's None when unset
|
|
84
|
+
out.push({ name: "Tag list", ok: false, detail: path ? `cannot read ${path}` : "not set", fix: "Type subsub init: it creates a starter tag list." });
|
|
84
85
|
}
|
|
85
86
|
else {
|
|
86
87
|
const noTopics = Array.isArray(v.facets) && !v.facets.includes("topic");
|
|
@@ -104,7 +105,7 @@ export function runChecks(cfg, env, deps = {}) {
|
|
|
104
105
|
out.push(starbuckCheck(cfg, env, run));
|
|
105
106
|
const agentDir = deps.agentDir ?? (env.SUBSUB_AGENT_DIR ? env.SUBSUB_AGENT_DIR : join(homedir(), ".subsub", "agent"));
|
|
106
107
|
out.push(hasLogin(agentDir)
|
|
107
|
-
? { name: "Model login", ok: true, detail: cfg.
|
|
108
|
+
? { name: "Model login", ok: true, detail: Object.keys(cfg.models).length ? Object.entries(cfg.models).map(([m, id]) => `${m} ${id}`).join(", ") : "pi's default model" }
|
|
108
109
|
: { name: "Model login", ok: false, detail: "no model provider yet", fix: "Type subsub, then /login." });
|
|
109
110
|
return out;
|
|
110
111
|
}
|