@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/docs/Subsub.md DELETED
@@ -1,140 +0,0 @@
1
- Sub-Sub is a Zotero librarian and research assistant that runs in pi. It uses the Python servers of zotero-local-mcp for the library: previews, version checks, journal and undo, the tag vocabulary.
2
-
3
- - Code: ~/Projects/subsub (git). Servers: ~/Projects/zotero-local-mcp
4
- - Shared rules: [[Zotero agent]]. Tag vocabulary: [[Zotero tags]]
5
- - Settings: ~/.config/subsub/config.json (written by `subsub init`) and ~/.config/zotero-local-mcp/env (also read by the weekly alerts in launchd)
6
- - Sub-Sub folder: ~/Obsidian/Powerslave/Sub-Sub, with Inbox/, Literature/, Syntheses/, Research/ and Zotero/ (tag list, note formats, alert searches). Sub-Sub writes only there without asking.
7
- - Model: opencode-go/mimo-v2.6-pro (one model since 0.10)
8
- - Public docs: the README in ~/Projects/subsub (source for subsub.tiagojacinto.eu)
9
-
10
- ## Safety
11
-
12
- - Approval is enforced in code. Before any library change, Sub-Sub asks the server for the preview and shows it in a dialog. The change runs only after you select Yes. The model cannot skip this.
13
- - The model does not need to do a dry run first. You see one dialog per change.
14
- - Library tools run one at a time, so each preview includes the effect of earlier changes in the same step.
15
- - With library changes off (`/library off`), Sub-Sub has no library write tools. It can only add a linked note (with a dialog) and add works to the import queue.
16
- - bash is off. File writes outside the Sub-Sub folder, and writes to the rule files, config folders and code folders, need a Yes.
17
-
18
- ## Install
19
-
20
- 1. Make sure that Node is version 22.19 or later: type `node --version`.
21
- 2. Type `cd ~/Projects/subsub && npm install --omit=dev`.
22
- 3. Type `npm link`. This adds the `subsub` command.
23
- 4. Optional: type `pi remove ~/Projects/subsub`. Then plain `pi` stays a plain coding agent without Sub-Sub.
24
- 5. Type `subsub`. If pi has no OpenCode Go key yet, type `/login`, select OpenCode Zen and Go, and paste the key.
25
- 6. Type `/subsub`. Make sure that the result shows "Zotero: reachable" and the model mimo-v2.6-pro.
26
- 7. Type `subsub init` once. Keep the Sub-Sub folder, the tag list, the email and the models. For the profile, select Editor.
27
- 8. Type `subsub doctor`. Make sure that no line shows FIX.
28
-
29
- If you change the Node version with fnm, do step 3 again.
30
-
31
- ## Use
32
-
33
- 1. Start Zotero.
34
- 2. Type `subsub`. From the home folder, Sub-Sub starts in the Sub-Sub folder. From a different folder (for example a manuscript folder), it starts in that folder. To stay in the home folder, type `subsub --here`.
35
- 3. Sub-Sub is one assistant: it reads, searches, writes notes and, with library changes on, changes the library. To turn library changes off or on, type `/library off` or `/library on` (saved). To start with them off for one session, type `subsub --read-only`. `/librarian` and `/researcher` still work: on and off.
36
- 4. After research, ask Sub-Sub to import the works you choose. It imports them in the same conversation, with one preview, and offers to tag them.
37
- 5. When a dialog shows a preview, read it. Select Yes to apply the change, or No to stop it. After No, tell Sub-Sub what to change.
38
- 6. To continue the last session, type `subsub -c`. To select an older session, type `subsub -r`.
39
-
40
- Sub-Sub always replies in English and writes its notes in English. Quotations and titles of works stay in their original language.
41
-
42
- Sub-Sub keeps its pi settings, sessions and packages in ~/.subsub/agent, separate from plain pi (~/.pi/agent).
43
-
44
- Commands:
45
-
46
- - `/subsub`: Zotero connection and library overview
47
- - `/profile`: shows or changes the profile
48
- - `/history`: recent library changes
49
- - `/undo`: shows the last change, asks, and reverts it. `/undo <id>` reverts a specific change from `/history`.
50
-
51
- Templates (type the name, then the argument):
52
-
53
- - Library (need library changes on): `/tag-batch [size]`, `/clean-tags`, `/import-queue [note path]`
54
- - Research: `/lit-note <citekey>`, `/synthesis <topic>`, `/gaps <topic>`, `/manuscript <path>`, `/alert`
55
-
56
- ## Web view
57
-
58
- 1. Type `subsub web`. Sub-Sub opens in the browser, with the same profiles, tools and approvals. The switch Library changes is at the top. The approval dialog shows the server preview; the change runs only after Yes.
59
- 2. To add a shortcut (Applications on macOS), type `subsub shortcut`. To remove it, type `subsub shortcut --remove`.
60
- 3. The server listens only on 127.0.0.1 and needs the random key in the address that `subsub web` opens. A second `subsub web` opens the running one.
61
- 4. The server stops 10 minutes after the last page closes. `subsub web --stay` keeps it running.
62
- 5. The labels are in European Portuguese when the language setting is Portuguese. A theme toggle button in the header switches between light, dark and system themes.
63
- 6. Faster review: in approval dialogs, press `y` to apply or `n` to cancel without using the mouse.
64
- 7. One-click copy buttons appear on every code block and assistant note. The sidebar includes real-time conversation search and an Export button to download the discussion as Markdown.
65
- 8. The model button lists the models and saves an API key for a provider (the same auth.json as `/login`).
66
-
67
- The log is in ~/.subsub/web.log.
68
-
69
- ## Profiles
70
-
71
- The profile sets how much Sub-Sub does. To see the profile, type `/profile`. To change it, type `/profile reader` (or scholar, author, editor). The change is saved.
72
-
73
- - Reader: explains each step. Reading notes are quotes with page numbers, plus questions. No summaries or syntheses. No bulk library changes.
74
- - Scholar: literature notes, syntheses, searches and alerts. All library changes.
75
- - Author: Scholar plus manuscripts: citation check, bibliography, comments on the argument. It does not write the paragraphs.
76
- - Editor: everything, including drafted manuscript text when you ask.
77
-
78
- ## Tag review notes
79
-
80
- Sub-Sub writes proposed tags in review notes in Inbox/ ("Zotero tag review NN.md"). Edit the Proposed tags column. Write skip to leave an item as it is.
81
-
82
- To apply one note, with library changes on, type: apply the tag review Inbox/Zotero tag review NN.md.
83
-
84
- To apply many notes:
85
-
86
- 1. Start Zotero.
87
- 2. Type `subsub review preview 13-31` (the numbers of the notes). This shows what each note will change. Nothing changes.
88
- 3. Type `subsub review apply 13-31`. Read the preview, then type y.
89
- 4. If Zotero asks for permission, select Always Allow.
90
-
91
- Use note numbers, not a pattern such as "*.md": a pattern also takes older notes that have no Applied line, and applying an old note again replaces later tag changes.
92
-
93
- Notes that were already applied are left out. Each applied note gets an "Applied" line with the journal ID. To revert a note, type `/undo <journal ID>` in Sub-Sub. If a note shows "changed since the note was written", the tags of those items changed in Zotero after the note was made; applying the note replaces those changes.
94
-
95
- ## Look
96
-
97
- When you start Sub-Sub with the `subsub` command, it shows a banner, a status line (library changes on or read only, model, Zotero items, items to review) and a line from Moby-Dick. The theme is Glauca, in the dark or light version that matches your terminal (set "themes": "subsub-try-works" for the other one). The theme changes for the session only; your pi theme setting stays.
98
-
99
- To change this, add to ~/.config/subsub/config.json:
100
-
101
- - `"quotes": false`: no Moby-Dick line.
102
- - `"themes": false`: keep your own pi theme.
103
- - `"look": false`: no banner and no themes.
104
-
105
- The themes are in ~/Projects/subsub/themes. To make them again after a change in Gam, see scripts/make-themes.py.
106
-
107
- ## Model test
108
-
109
- The model test runs several models on the same tasks against your library and compares them. Nothing in the library changes: each library change is recorded with its preview and then blocked. Notes go to ~/Projects/subsub/bench-results/<date>/, not to the Sub-Sub folder.
110
-
111
- Tasks:
112
-
113
- - Library tasks: tag 20 items against a blind reference (reference.md shows the items without their tags; the tags go in reference.json); fix the items without topic or status; import identifiers, one of them already in the library.
114
- - Research tasks: a literature note on one item with full text; a synthesis on one topic; a search for recent papers that are not in the library.
115
-
116
- Procedure:
117
-
118
- 1. Start Zotero.
119
- 2. Type `subsub-bench prepare`. This picks the tasks.
120
- 3. Type `caffeinate -i subsub-bench run`. This takes 1 to 2 hours. caffeinate keeps the Mac awake. If the run stops, type the same command again: finished runs are not repeated.
121
- 4. Type `subsub-bench score`. The result is results.md in the results folder.
122
-
123
- Options for `run`: `--models a,b` for all tasks, or `--librarian a,b` and `--researcher c,d` for each group of tasks (OpenCode Go model ids), `--only tagging,import`, `--parallel 3`, `--timeout 900`. Every task runs with library changes on.
124
-
125
- Each model gets a code (for example M417), so the notes can be judged blind. key.json has the codes.
126
-
127
- ## Problems
128
-
129
- - To find a setup problem, type `subsub doctor`. Each line marked FIX says what to do.
130
- - "the zotero server did not start": run `cd ~/Projects/zotero-local-mcp && uv sync`. If pi does not find uv, add `"uvPath": "/path/to/uv"` to ~/.config/subsub/config.json (type `which uv` to see the path).
131
- - "cannot use opencode-go/...": the OpenCode Go key is missing. In Sub-Sub, type `/login` again.
132
- - "command not found: subsub": type `cd ~/Projects/subsub && npm link`.
133
- - To update Sub-Sub after new code arrives, type `cd ~/Projects/subsub && npm install --omit=dev`. Do not use `subsub update`.
134
- - A tool call is refused with "library changes are off": type `/library on`.
135
- - `subsub review` says "No note matches": check the note numbers in Inbox/. A path is written from the Sub-Sub folder, in quotes (for example "Inbox/Zotero tag review 13.md").
136
-
137
- ## Tests
138
-
139
- - `cd ~/Projects/subsub && npm install && npm test`: unit tests.
140
- - `npm run test:e2e`: real pi and the `subsub` command with a scripted model and a fake Zotero.