diff --git a/README.md b/README.md index 2de2741..826a03c 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,13 @@ phrase and word can be opened further. The first levels are written ahead of tim instantly; past them, a model writes the expansion on request. Everything is editable, by you or by a model, and the tree is versioned like git. -Everything is a node of one library: a single versioned tree whose root is the library itself. +Everything is a node of a library: a single versioned tree whose root is the library itself. Any node, with everything under it, can be moved under any other, copied, saved to a file, or given a file's tree under it, and reading goes from one place to the next without closing -anything. The first tree is this project describing itself, grown from the prompt that started it; -a set of starter trees (`library/*.md`) comes with it. +anything. There can be several libraries, each a tree of its own: nothing in one links to, moves +into or is found from another. The first tree of the first library is this project describing +itself, grown from the prompt that started it; a set of starter trees (`library/*.md`) comes with +it. ## Run it @@ -33,8 +35,8 @@ use on their own machine. | `CLAUDE_CODE_OAUTH_TOKEN` | unset | A subscription token, used when no API key is set. A token put in `ANTHROPIC_API_KEY` by mistake is moved here. | | `IE_MODEL` | `claude-opus-5-5` | Model for every call. | | `IE_LLM` | `claude` with a key, `subscription` with a token, else `off` | `mock`: a deterministic stand-in (the tests). | -| `IE_DATA` | `.data` | Where the library and its caches are kept. Delete it to start again from the seed and the starter trees. | -| `IE_LIBRARY` | `library` | Starter trees (`.md` files in the text format), each imported once. | +| `IE_DATA` | `.data` | Where the libraries and their caches are kept. Delete it to start again from the seed and the starter trees. | +| `IE_LIBRARY` | `library` | Starter trees (`.md` files in the text format), written into the first library when `IE_DATA` is empty. | | `IE_USER` | your login name | The name on commits the server makes for you (the page lets you change yours with `/user`). | | `IE_WIKI` | `live` | `mock`: built-in test articles, no network (the browser tests); `off`: every `/api/wiki/*` route answers 503. | | `IE_HOSTS` | (none) | Extra host names the dev server answers to, comma-separated. `localhost` and `*.ts.net` (Tailscale) are always allowed. | @@ -97,6 +99,12 @@ Press `?` for every key. The short version: mark, `[` `]` up and down a column (a click on a pane does it), and the commands typed at `:` that no menu lists (`/branch`, `/switch`, `/merge`, `/user`, `/link`, …), which the menu's Command line… opens for typing. +- **Libraries.** `:/library` lists the libraries, `:/library name` opens one and `:/library new + name` makes one (its root alone) and opens it. Each library is a page of its own, at its own + address (`/l/`); opening another loads the page. `/` opens the library last used in this + browser. A library's name is its root's title (`r` on the root renames it). Nothing crosses + between libraries: links, the jump box, Related, the link scanner and reviewer, and the editor + agent see only the library they are in; export then import carries a tree across. - On a window 900 px wide or more, a laptop's too, the page opens as panes side by side, after Andy Matuschak's notes: the library, then each open node in a pane of its own. `v` switches between panes and the single column, `/view auto|column|panes` sets it. @@ -289,10 +297,12 @@ What is sent where: nodes, anchors and finding them again in a new revision; an article's HTML as text to select in. - **`src/core/format.ts`, `seed.ts`, `address.ts`** The text format, writing a parsed tree into the library under any node (an import), and a node's address. -- **`server/`** Relays updates between replicas and persists them (`library.ts`), proxies model - calls (`claude.ts`, `subscription.ts`, `usage.ts`, `web.ts`), Wikipedia (`wiki.ts`, `wikiHtml.ts`, - `wikiRoutes.ts`, `wikiMock.ts`), local embeddings (`embed.ts`), link discovery and its model reviewer (`links/`), and - migrates data from older layouts (`migrate.ts`). +- **`server/`** Keeps the libraries (`libraries.ts`, each library on disk in `library.ts`, and + per library its routes, notices, link discovery and reviewer in `bundle.ts`), relays updates + between replicas and persists them, proxies model calls (`claude.ts`, `subscription.ts`, + `usage.ts`, `web.ts`), Wikipedia (`wiki.ts`, `wikiHtml.ts`, `wikiRoutes.ts`, `wikiMock.ts`), local + embeddings (`embed.ts`), link discovery and its model reviewer (`links/`), and brings data from the + single-library layout over when asked (`migrateLibraries.ts`, `npm run migrate`). - **`src/ui/`** The browser's replica of the library (`session.ts`, kept in IndexedDB), the store and keymap, and the page. The mouse acts through the keymap: `actions.ts` builds what the selection bar and the menus offer for each kind of target, every item pressing its key @@ -300,37 +310,71 @@ What is sent where: the store's `trail` is its focused branch); `stack.ts` is the stacking shared by the strip and its columns, `lanes.ts` orders the curves' lanes. -## The library +## The libraries On disk: ``` -IE_DATA/library/.loro the library, one Loro snapshot per branch -IE_DATA/library.json starter files already imported -IE_DATA/links/pending.json link suggestions, the reviewer's verdicts and your decisions (derived) -IE_DATA/vectors/nodes.* the library's sections as vectors (derived) -IE_DATA/wiki-cache/ Wikipedia answers (derived) -IE_DATA/models/ the embedding model +IE_DATA/libraries/index.json the libraries, in order: id, title, when made, whether deleted +IE_DATA/libraries//.loro a library, one Loro snapshot per branch +IE_DATA/libraries//links/pending.json its link suggestions, the reviewer's verdicts and your decisions (derived) +IE_DATA/libraries//vectors/nodes.* its sections as vectors (derived) +IE_DATA/libraries/.deleted/-