tandem-editor 0.11.2 → 0.13.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.
Files changed (40) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +3 -3
  3. package/CHANGELOG.md +201 -72
  4. package/README.md +141 -238
  5. package/dist/channel/index.js +211 -81
  6. package/dist/channel/index.js.map +1 -1
  7. package/dist/cli/index.js +749 -170
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/client/assets/CoworkSettings-BOYbyKul.js +3 -0
  10. package/dist/client/assets/event-CNdo2oXa.js +1 -0
  11. package/dist/client/assets/index-D8uS4cj7.css +1 -0
  12. package/dist/client/assets/index-Dm_QtxGQ.js +1 -0
  13. package/dist/client/assets/index-g-KwmRn9.js +271 -0
  14. package/dist/client/assets/webview-KiZyy_pC.js +1 -0
  15. package/dist/client/assets/window-DePn7tLG.js +1 -0
  16. package/dist/client/fonts/OFL-Hanuman.txt +93 -0
  17. package/dist/client/fonts/OFL-InterTight.txt +93 -0
  18. package/dist/client/fonts/OFL-JetBrainsMono.txt +93 -0
  19. package/dist/client/fonts/OFL-SNPro.txt +93 -0
  20. package/dist/client/fonts/OFL-Sono.txt +93 -0
  21. package/dist/client/fonts/OFL-SourceSerif4.txt +93 -0
  22. package/dist/client/fonts/hanuman-latin.woff2 +0 -0
  23. package/dist/client/fonts/jetbrains-mono-latin.woff2 +0 -0
  24. package/dist/client/fonts/sn-pro-latin.woff2 +0 -0
  25. package/dist/client/fonts/sono-latin.woff2 +0 -0
  26. package/dist/client/fonts/source-serif-4-latin.woff2 +0 -0
  27. package/dist/client/index.html +206 -17
  28. package/dist/client/logo.png +0 -0
  29. package/dist/monitor/index.js +241 -160
  30. package/dist/monitor/index.js.map +1 -1
  31. package/dist/server/index.js +22828 -19659
  32. package/dist/server/index.js.map +1 -1
  33. package/package.json +12 -4
  34. package/sample/welcome.md +6 -6
  35. package/skills/tandem/SKILL.md +15 -0
  36. package/dist/client/assets/CoworkSettings-DK3jjdwK.js +0 -3
  37. package/dist/client/assets/index-CfT503n4.js +0 -297
  38. package/dist/client/assets/index-DeJe09pn.css +0 -1
  39. package/dist/client/assets/webview-Ben21ZLJ.js +0 -1
  40. package/dist/client/assets/window-BxBvHL5k.js +0 -1
package/README.md CHANGED
@@ -1,310 +1,213 @@
1
1
  <p align="center">
2
- <img src="docs/assets/banner.png" alt="Tandem — Collaborative AI-Human Document Editor" width="800">
2
+ <a href="https://www.npmjs.com/package/tandem-editor"><img src="https://img.shields.io/npm/v/tandem-editor?label=npm" alt="npm version"></a>
3
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-BUSL--1.1-blue" alt="License: BUSL-1.1"></a>
4
+ <a href="https://github.com/bloknayrb/tandem/releases/latest"><img src="https://img.shields.io/github/v/release/bloknayrb/tandem?label=release" alt="Latest release"></a>
3
5
  </p>
4
6
 
5
- Have you ever been working on a piece of writing with an LLM and caught yourself copy-pasting the same paragraph into the chat for the fifth time just so the model knows what you're talking about? That's the friction Tandem eliminates. Open a file directly, or just tell Claude "let's work on my draft in tandem" — the document appears in the editor, and from that point on you highlight text and Claude sees it directly. No pasting, no "here's the paragraph I mean," no losing your place.
7
+ **An editor where you and an AI work on the same document at the same time.**
6
8
 
7
- And because Tandem hooks into Claude as an MCP server, you're not stuck in some stripped-down document-editing silo. It's the full Claude with all its knowledge, your conversation context, and every tool it has access to just now it can also see and edit your document.
9
+ Tandem is a document editor that lets you and an AI work on the same file together. You highlight a passage. The AI sees what you highlighted and can ask about it, comment on it, or propose changes that appear as cards beside your document. You decide what to keep.
8
10
 
9
- ## Why Tandem?
11
+ Tandem is approaching v1.0 and ships continuous improvements. See [CHANGELOG.md](CHANGELOG.md) for what is in the latest release.
10
12
 
11
- - **No more copy-paste ping-pong.** Select text in the editor, and Claude reads your selection directly. Ask "what do you think of this?" or "make this more concise" — Claude knows exactly which text you mean.
12
- - **Your full LLM, not a toy editor.** Tandem connects via MCP, so Claude keeps all its knowledge, all its tools, and your full conversation context. Need it to cross-reference your document against a codebase, a URL, or another file? It can — it's still Claude.
13
- - **Iterate in place.** Claude can suggest rewrites, leave comments, flag issues, and edit text — all appearing as annotations you accept, dismiss, or tweak right in the document.
13
+ ## Contents
14
14
 
15
- ## Quick Start
15
+ - [What Tandem does](#what-tandem-does)
16
+ - [See it in action](#see-it-in-action)
17
+ - [Who Tandem is for](#who-tandem-is-for)
18
+ - [Getting started](#getting-started)
19
+ - [How you work with Tandem](#how-you-work-with-tandem)
20
+ - [Privacy and trust](#privacy-and-trust)
21
+ - [Where Tandem is headed](#where-tandem-is-headed)
22
+ - [Documentation](#documentation)
23
+ - [License](#license)
24
+ - [For developers and contributors](#for-developers-and-contributors)
25
+ - [Architecture overview](#architecture-overview)
26
+ - [The MCP integration policy](#the-mcp-integration-policy)
27
+ - [MCP tools at a glance](#mcp-tools-at-a-glance)
28
+ - [Channel push and real-time updates](#channel-push-and-real-time-updates)
29
+ - [Development setup](#development-setup)
30
+ - [Tech stack](#tech-stack)
31
+ - [How to contribute](#how-to-contribute)
16
32
 
17
- ### Option A: Desktop App
33
+ ## What Tandem does
18
34
 
19
- Download the installer for your platform from the [latest release](https://github.com/bloknayrb/tandem/releases/latest).
35
+ Most people use AI on a document by copying a passage into a chat window, asking a question, and pasting the answer back. Tandem closes that loop. The AI sits beside the document you are editing and reads from it directly.
20
36
 
21
- The desktop app bundles everything no Node.js required. It auto-configures Claude Code on launch, manages the server as a background process, and updates itself automatically. Just install and open.
37
+ When you highlight text, the AI sees the selection as you make it. You can ask it for a rewrite, a summary, a check on tone, or a second opinion. Its suggestions appear as cards next to the document. Accept them, set them aside, or reply to ask for something different.
22
38
 
23
- ### Option B: npm Global Install
39
+ Tandem is built to work with Anthropic's Claude out of the box. Other AI tools can also connect. See [the developer section](#the-mcp-integration-policy) below for the details of which clients work and which are tested first.
24
40
 
25
- Requires **Node.js 22+** ([download](https://nodejs.org)) and **Claude Code** (`npm install -g @anthropic-ai/claude-code`).
41
+ ## See it in action
26
42
 
27
- ```bash
28
- npm install -g tandem-editor
29
- tandem setup # registers MCP tools + installs Claude Code skill
30
- tandem # starts server + opens editor
31
- ```
32
-
33
- `tandem setup` auto-detects Claude Code and Claude Desktop, writes MCP configuration, and installs a skill (`~/.claude/skills/tandem/SKILL.md`) that teaches Claude how to use Tandem's tools effectively. Re-run after upgrading (`npm update -g tandem-editor && tandem setup`).
34
-
35
- ### Quickstart: Claude Code plugin (recommended)
36
-
37
- Install the plugin to expose Tandem's tools and real-time event stream into Claude Desktop chats **and** Cowork VM sessions:
38
-
39
- ```bash
40
- claude plugin marketplace add bloknayrb/tandem
41
- claude plugin install tandem@tandem-editor
42
- ```
43
-
44
- **Tandem must be running on the host before the plugin can do anything.** The plugin spawns two stdio MCP processes (`tandem mcp-stdio` and `tandem channel`) that proxy to `http://localhost:3479`. If the server isn't up they fail fast and log "Tandem server not reachable at …". Start the Tauri desktop app or run `tandem start` on the host first, then open Claude.
45
-
46
- ### Legacy stdio channel shim
47
-
48
- If you can't install the plugin, use the older channel shim:
49
-
50
- ```bash
51
- tandem setup --with-channel-shim
52
- ```
53
-
54
- This writes a `tandem-channel` entry to your Claude Code MCP config. Start Claude Code with:
55
-
56
- ```bash
57
- claude --dangerously-load-development-channels server:tandem-channel
58
- ```
59
-
60
- Don't combine this with the plugin — both subscribe to `/api/events` and you'll get duplicate notifications for every event.
43
+ <p align="center">
44
+ <img src="docs/screenshots/01-editor-overview.png" alt="The Tandem editor with a document open on the left and a panel of AI suggestion cards on the right" width="800">
45
+ </p>
61
46
 
62
- ### Connect Claude Code
47
+ *The main view. Your document fills the left side. The chat panel and any suggestions from the AI sit on the right.*
63
48
 
64
- For the full Tandem experience, start Claude Code with the **channel push** flag:
49
+ <p align="center">
50
+ <img src="docs/screenshots/03-side-panel.png" alt="A close-up of suggestion cards beside the document, including a replacement card showing the original text in red strikethrough and the proposed text in green" width="500">
51
+ </p>
65
52
 
66
- > **Desktop app users:** Claude Code is configured automatically on every launch skip `tandem setup` and just start Claude Code. The `tandem_*` tools will be available immediately.
53
+ *A suggestion from the AI. Your current text and the proposed replacement appear together. Buttons let you accept the change or set it aside.*
67
54
 
68
- ```bash
69
- claude --dangerously-load-development-channels server:tandem-channel
70
- ```
55
+ ## Who Tandem is for
71
56
 
72
- This is the magic-sauce mode — and it's the one I'd recommend you run with. The channel shim pushes events (selections, annotations, chat) to Claude over SSE the moment they happen, so Tandem genuinely feels like there's another person on the other end of the document: someone watching what you highlight, reacting to edits you accept, and chiming in on a paragraph the instant you select it, the way a collaborator on a Google Doc would. The `--dangerously-load-development-channels` flag is an experimental Claude Code feature, which is why it isn't on by default — but turning it on is what makes the whole experience click.
57
+ - If you draft long-form writing and want a second reader for tone and structure.
58
+ - If you review contracts, policies, RFP responses, or compliance filings and want a faster pass.
59
+ - When a colleague hands you a report to mark up.
60
+ - When the AI wrote a draft and you need to decide what to keep.
73
61
 
74
- **Recommended layout:** snap the Claude Code terminal to one side of your screen and the Tandem editor window to the other. You'll be flipping attention between them constantly, and having both visible is what makes the side-by-side-collaborator feeling land.
62
+ ## Getting started
75
63
 
76
- Then try:
64
+ ### System requirements
77
65
 
78
- ```
79
- "Open sample/welcome.md and review it with me"
80
- ```
66
+ Windows 10 version 22H2 or Windows 11. macOS 12 (Monterey) or later. Linux with glibc 2.31 or later (Ubuntu 20.04+, Debian 11+, Fedora 34+). On Windows, the first launch may show a "Windows protected your PC" warning until the installer's signing certificate accumulates SmartScreen reputation. See [docs/troubleshooting.md#windows-smartscreen-warning](docs/troubleshooting.md#windows-smartscreen-warning) for the steps to dismiss it.
81
67
 
82
- Claude calls `tandem_open`, the document appears in the editor, and you're ready to collaborate.
68
+ ### Download the desktop app (recommended)
83
69
 
84
- #### The core loop no copy/paste
70
+ Pick the installer for your platform from the [latest release](https://github.com/bloknayrb/tandem/releases/latest). Windows, macOS, and Linux builds are available.
85
71
 
86
- 1. Highlight a paragraph in the editor.
87
- 2. With channels on, Claude often reacts before you even say anything. Otherwise, just type what you want in the terminal: *"what do you think of this paragraph?"* or *"rewrite this to be more concise"*.
88
- 3. Claude reads your selection directly from the shared Tandem state (via `activity.selectedText` on `tandem_checkInbox`). You never paste the passage into the terminal.
89
- 4. Claude replies in the Tandem chat sidebar (`tandem_reply`) or drops annotations on the document (`tandem_annotate` / `tandem_suggestEdit`), which you can accept, dismiss, or edit in the side panel.
72
+ The desktop app bundles the editor, the server it talks to, and storage for the connection token. Updates land automatically. Double-clicking a `.md`, `.txt`, or `.html` file opens it directly in Tandem.
90
73
 
91
- #### Prefer not to use the experimental flag?
74
+ ### What you get
92
75
 
93
- You don't have to turn on channel push every feature of Tandem works without it. You lose the "Claude reacts on its own" magic, but Claude still sees every selection, annotation, and chat message. Start Claude Code normally:
76
+ - Multiple documents open in tabs, with `.md`, `.txt`, `.html`, and `.docx` support (Word files open in review-only mode).
77
+ - A scratchpad (`Ctrl+N`) for drafts you do not want to save to disk.
78
+ - A command palette (`Ctrl+Shift+P`) for quick actions.
79
+ - Find and replace, including across all open tabs.
80
+ - An outline panel for navigating long documents.
81
+ - Light and dark themes.
82
+ - Keyboard navigation through pending suggestions: `Alt+]` and `Alt+[` to move between them, `Ctrl+Enter` to accept, `Ctrl+Shift+Enter` to dismiss.
94
83
 
95
- ```bash
96
- claude
97
- ```
84
+ ### Other ways to install
98
85
 
99
- Then pick one of two ways to keep the conversation flowing:
86
+ If you use a terminal, you can also install Tandem with `npm install -g tandem-editor`, then run `tandem setup` once and `tandem` to launch. This works the same as the desktop app and is mostly useful if you already have Node.js installed.
100
87
 
101
- 1. **Just chat in the terminal (simplest).** Every time you send Claude a message, it has a chance to call `tandem_checkInbox` and pick up your latest selection, any annotations you accepted or dismissed, and any chat messages from the Tandem sidebar. Zero setup — this is how it works out of the box. With Tandem and the terminal snapped side by side, the loop feels surprisingly natural; Claude just reacts when you nudge it rather than spontaneously.
102
- 2. **Background polling with&#x20;****/loop****&#x20;(hands-off).** Ask Claude to check in on its own using the `/loop` skill:
103
- ```
104
- /loop 30s check tandem inbox and respond to any new messages
105
- ```
106
- Claude polls every 30 seconds — responses lag by up to that interval, but you don't have to prompt it yourself.
88
+ ### Got stuck
107
89
 
108
- Either way, Claude reads the exact same information (selections, annotations, chat) through the same `tandem_checkInbox` tool. The only thing channels change is *when* Claude finds out something happened — not *whether* it can see it.
90
+ See [docs/troubleshooting.md](docs/troubleshooting.md) for common problems and how to resolve them.
109
91
 
110
- ### Verify
92
+ ## How you work with Tandem
111
93
 
112
- ```bash
113
- npm run doctor # checks Node.js, MCP config, server health, ports
114
- ```
94
+ 1. Open a document in Tandem.
95
+ 2. Start Claude. Tandem and Claude connect automatically once you have run setup once.
96
+ 3. Type a question in the chat panel, or highlight text in the document to focus the AI on a passage. The AI sees what you highlight as you highlight it.
97
+ 4. The AI's suggestions appear as cards beside the document. You decide what to accept.
98
+ 5. Save when you are finished.
115
99
 
116
- Or check the raw health endpoint:
100
+ See [docs/workflows.md](docs/workflows.md) for examples of how this looks in daily use.
117
101
 
118
- ```bash
119
- curl http://localhost:3479/health
120
- # → {"status":"ok","version":"0.8.0","transport":"http","hasSession":false}
121
- ```
102
+ ## Privacy and trust
122
103
 
123
- `hasSession` becomes `true` once Claude Code connects.
104
+ - Tandem itself runs on your computer and stores your documents on your disk. We do not operate any servers that hold your files.
105
+ - When you ask the AI to do something, the text you share with it goes to whichever AI service you are using. For example, if you connect Claude, the text goes to Anthropic under their terms. Tandem does not relay or copy your document anywhere else.
106
+ - Tandem includes a private notes feature. Notes you mark as private are stripped from every response the AI sees ([ADR-027](docs/decisions.md)).
107
+ - Tandem does not collect telemetry or analytics.
124
108
 
125
- <details>
126
- <summary><strong>Development Setup</strong> (contributing / building from source)</summary>
109
+ See [docs/security.md](docs/security.md) for the full security model.
127
110
 
128
- ```bash
129
- git clone https://github.com/bloknayrb/tandem.git
130
- cd tandem
131
- npm install
132
- npm run dev:standalone # starts backend (:3478/:3479), editor client (:5173), and monitor
133
- ```
111
+ ## Where Tandem is headed
134
112
 
135
- Open <http://localhost:5173> you'll see `sample/welcome.md` loaded automatically on first run. The `.mcp.json` in the repo configures Claude Code automatically when run from this directory.
113
+ Tandem is on the way to a v1.0 release. Recent releases added support for multiple AI providers and in-app configuration for connections and models. Work still in progress covers improvements to how Word documents round-trip through the editor, turnkey setup on macOS and Linux, and final polish. The full plan lives in [docs/roadmap.md](docs/roadmap.md).
136
114
 
137
- </details>
115
+ ## Documentation
138
116
 
139
- ## Using Tandem
117
+ - [docs/user-guide.md](docs/user-guide.md) for a longer walkthrough of the editor.
118
+ - [docs/workflows.md](docs/workflows.md) for daily usage patterns.
119
+ - [docs/troubleshooting.md](docs/troubleshooting.md) for when something goes wrong.
120
+ - [docs/positioning.md](docs/positioning.md) for the longer story of why Tandem exists.
121
+ - [docs/decisions.md](docs/decisions.md) for design decisions (ADRs).
122
+ - [docs/roadmap.md](docs/roadmap.md) for what is coming.
123
+ - [docs/architecture.md](docs/architecture.md) for diagrams and the file map.
124
+ - [docs/mcp-tools.md](docs/mcp-tools.md) for the MCP tool reference.
125
+ - [docs/security.md](docs/security.md) for the security model.
126
+ - [docs/configuration.md](docs/configuration.md) for advanced configuration.
127
+ - [docs/cli.md](docs/cli.md) for CLI command reference.
128
+ - [CHANGELOG.md](CHANGELOG.md) for release notes.
140
129
 
141
- You point at text, Claude sees it. Here's how that plays out day-to-day:
130
+ ## License
142
131
 
143
- - **Open a document.** Ask Claude (`"let's work on notes.md in tandem"`), drag a file onto the editor, or click the **+** in the tab bar. `.md`, `.txt`, `.html`, and `.docx` (review-only) are supported.
144
- - **Point at what you mean.** Select text in the editor and ask Claude about "this paragraph" in the terminal — or just wait for Claude to react if you have channels on. Claude reads your selection directly, no copy-paste needed. Hold the selection for about a second so it registers (dwell-time gating filters out incidental clicks).
145
- - **Iterate on Claude's response.** Claude's suggestions appear as annotations in the side panel — accept, dismiss, edit, or ask follow-up questions. Each round refines the text without you ever leaving the document. Press **Ctrl+Shift+R** for keyboard review mode: **Tab** to navigate, **Y** accept, **N** dismiss, **E** edit, **Z** undo within a 10-second window.
146
- - **Heads-down vs collaborative.** Toggle **Solo** mode when you want to write without interruptions — Tandem queues non-urgent annotations until you flip back to **Tandem** mode. Both `tandem_status` and `tandem_checkInbox` return the current mode so Claude adapts its behavior automatically.
147
- - **Save.** Ask Claude ("save the file"), press the save button, or let session auto-persistence take over — your documents and annotations survive server restarts either way.
132
+ Tandem is free to use. It is licensed under the Business Source License 1.1 (BUSL-1.1); see [LICENSE](LICENSE) for the terms.
148
133
 
149
- ## Features
134
+ ---
150
135
 
151
- Everything in Tandem is built around one idea: you work in the document, Claude works alongside you, and neither of you has to leave your surface to stay in sync.
136
+ ## For developers and contributors
152
137
 
153
- ### Chat
138
+ ### Architecture overview
154
139
 
155
- Send messages to Claude alongside your document. Select text before sending to attach it as context Claude sees exactly what you mean. Clicking an anchored selection later scrolls back to that passage.
140
+ Three layers: the editor (Tiptap inside a Tauri desktop app or a browser), the Tandem server (Hocuspocus on port 3478 for collaborative edits and an MCP HTTP server on port 3479 for AI tool calls), and the AI client (Claude Code or any other MCP-capable client). The full file map and data flows live in [docs/architecture.md](docs/architecture.md).
156
141
 
157
- ### Annotations
142
+ ### The MCP integration policy
158
143
 
159
- This is how Claude's feedback shows up in the document. Claude adds highlights, comments, suggestions, and flags directly on the text. Suggestion cards show a visual diff original text in red strikethrough, replacement in green. The side panel lists all annotations with filtering by type, author, and status. Accept, dismiss, or edit each one individually — or use bulk actions to process them in batches.
144
+ The [Model Context Protocol](https://modelcontextprotocol.io) (MCP) is an open standard for AI clients to talk to tools and data sources. Tandem exposes its document and annotation surface over MCP, which is how AI clients like Claude read and modify the file you are editing.
160
145
 
161
- ### Review Mode
146
+ The integration policy is set by [ADR-038](docs/decisions.md#adr-038-mcp-first-integration-policy-claude-as-default-integration):
162
147
 
163
- Press **Ctrl+Shift+R** to enter keyboard review mode. Navigate with **Tab**, accept with **Y**, dismiss with **N**, examine with **E**. A 10-second undo window with a visual countdown lets you reverse accidental accepts. Shortcut hints appear below the Review button.
148
+ > Tandem's integration contract is **MCP**. The default integration is **Claude** (Claude Code + Claude Desktop) it's what we recommend, what we test against, and it ships with the channel push, cowork, plugin monitor, and auto-launcher features. Any MCP-capable client can connect to the same MCP HTTP endpoint and use the same 26 tools, but the Claude-specific transports don't apply. Other clients are **best-effort, MCP-contract-compatible, not validated** today.
149
+ >
150
+ > **Integration setup** runs through the integration setup wizard (#477 PR 3). Today's transitional behavior — Tandem auto-writing its MCP entry to Claude's config files on Tauri startup — is **deprecated when the wizard ships**. Going forward, every integration (Claude included) is configured via the wizard, never silently.
164
151
 
165
- ### More
152
+ Client compatibility:
166
153
 
167
- - **Full LLM via MCP** — Claude connects through MCP tools, so it retains all its knowledge, conversation context, and tool access while working on your document
168
- - **Multi-document tabs** — open `.md`, `.txt`, `.html`, `.docx` files side by side; drag to reorder
169
- - **.docx review-only mode** open Word documents for annotation; imported Word comments appear alongside Claude's
170
- - **Session persistence** documents and annotations survive server restarts
171
- - **Solo / Tandem mode** flip to Solo when you want to write heads-down; Tandem queues non-urgent annotations until you're ready
172
- - **Real-time channel push** *(recommended)* with the `--dangerously-load-development-channels` Claude Code flag, selections, annotations, and chat push to Claude instantly, making Tandem feel like a live collaborator watching over your shoulder
173
- - **Keyboard shortcuts** press `?` for the full reference
174
- - **Unsaved-changes indicator** — dot on tab title when a document has pending edits
175
- - **Configurable display name** — set your name so Claude knows who's reviewing
176
- - **Atomic file saves** — write to temp, then rename, preventing partial writes
177
- - **E2E tested** — Playwright tests cover the annotation lifecycle end-to-end
178
- - **Authorship text coloring** — blue for your edits, orange for Claude's, toggled per-document
179
- - **Threaded annotation replies** — back-and-forth conversation on any annotation
180
- - **Auto-save** — documents save on change; Ctrl+S for manual trigger
181
- - **Settings popover** — Light/Dark/System theme, text size (S/M/L), reduce motion, display name (Ctrl+,)
182
- - **Auth tokens for LAN exposure** — bind to `0.0.0.0` with auto-generated tokens; `tandem rotate-token` for rotation
183
- - **Durable annotation persistence** — annotations survive server restarts independently of session files
184
- - **Claude Code plugin** — `tandem mcp-stdio` + `tandem channel` bridge Tandem into Cowork and Claude Desktop
154
+ | AI surface | Status |
155
+ |---|---|
156
+ | **Claude Code** (local CLI) | Default. Validated. Channel push supported. |
157
+ | **Claude Desktop** (local app) | Supported via the Cowork bridge. Channel push N/A. |
158
+ | **claude.ai web chat** | Not supported. Would require exposing the local server publicly via a tunnel, which is outside scope. |
159
+ | **Other MCP-capable clients** (Cursor, Continue.dev, LM Studio, Ollama, …) | Best-effort, MCP-contract-compatible, not validated. |
160
+ | **Non-MCP AIs** (ChatGPT direct, Gemini direct, etc.) | Not supported today. Multi-provider support is in progress via the Agent SDK adapter ([ADR-038 §3](docs/decisions.md#adr-038-mcp-first-integration-policy-claude-as-default-integration)); not yet shippable. |
185
161
 
186
- ## Where Tandem is headed
162
+ ### MCP tools at a glance
187
163
 
188
- Since the v0.4.0 desktop app launch, Tandem has added auth tokens for LAN exposure (v0.7.0), a Claude Code plugin bridge for Cowork and Claude Desktop (v0.6.0+), durable annotation persistence, settings with Light/Dark/System theming, authorship text coloring, and coordinate system correctness fixes with semantic token enforcement (v0.8.0). A few directions on the radar for later releases:
164
+ 26 active tools across five capability areas. Full reference: [docs/mcp-tools.md](docs/mcp-tools.md).
189
165
 
190
- - **High-fidelity .docx round-trip** current `.docx` support is review-only; production export is planned so you can stay in Tandem through the final draft.
191
- - **Exportable annotated documents** PDF (and eventually `.docx`) with annotations baked in, so you can share reviewed drafts outside Tandem.
192
- - **Code editing mode** CodeMirror 6 surface for reviewing code the same way you review prose.
193
- - **Standalone mode** direct Anthropic API connection so Tandem can run without Claude Code in the loop, for users who want a pure standalone experience.
166
+ - **Document.** Open, switch, list, close, and convert documents; read text content and outlines; save back to disk.
167
+ - **Annotation.** Create, resolve, remove, and edit annotations; query the annotation list; export a review report.
168
+ - **Apply.** Edit text ranges directly when an annotation is not the right surface.
169
+ - **Navigation.** Inspect the active selection, jump to ranges, and resolve internal links.
170
+ - **Awareness.** Read user presence and Solo/Tandem mode; check the inbox for selection events, chat messages, and annotation actions; reply in the chat sidebar.
194
171
 
195
- See the full [Roadmap](docs/roadmap.md) and [Known Limitations](docs/roadmap.md#known-limitations-v1) for the complete picture, including items that are explicitly out of scope for v1.
172
+ ### Channel push and real-time updates
196
173
 
197
- ## Documentation
174
+ Channel push delivers events (selections, annotation actions, chat messages) to the AI client over Server-Sent Events the moment they happen, so the AI does not have to poll. Two install options:
198
175
 
199
- - **[User Guide](docs/user-guide.md)** — How to use Tandem: editor UI, annotations, chat, review mode, keyboard shortcuts
200
- - [MCP Tool Reference](docs/mcp-tools.md) — 28 MCP tools (25 active, 3 deprecated stubs) + channel API endpoints
201
- - [Architecture](docs/architecture.md) — System design, data flows, coordinate systems, channel push
202
- - [Workflows](docs/workflows.md) — Claude Code usage patterns: text iteration, cross-referencing, multi-model
203
- - [Roadmap](docs/roadmap.md) — Phase 2+ roadmap, known issues, future extensions
204
- - [Design Decisions](docs/decisions.md) — ADR-001 through ADR-024
205
- - [Lessons Learned](docs/lessons-learned.md) — 48 implementation lessons
206
-
207
- ## CLI Commands
208
-
209
- | Command | What it does |
210
- | ---------------------------------- | ------------------------------------------------------------------ |
211
- | `tandem` | Start server and open editor (global install) |
212
- | `tandem setup` | Register MCP tools with Claude Code / Claude Desktop |
213
- | `tandem setup --force` | Register to default paths regardless of auto-detection |
214
- | `tandem --version` | Show installed version |
215
- | `tandem --help` | Show usage |
216
- | `tandem setup --with-channel-shim` | Also register the stdio channel shim |
217
- | `tandem rotate-token` | Rotate auth token (60-second grace window) |
218
- | `tandem mcp-stdio` | Run as stdio MCP server (proxy to local HTTP, for plugin bridge) |
219
- | `tandem channel` | Run the channel shim (stdio MCP for plugin's tandem-channel entry) |
220
-
221
- ## MCP Configuration
222
-
223
- Tandem registers two MCP connections: **HTTP** for document tools (28 tools including annotation editing — always on), and a **channel shim** for real-time push notifications. The channel shim is what enables the live-collaborator experience described in [Connect Claude Code](#connect-claude-code) and is recommended; it activates when you start Claude Code with `--dangerously-load-development-channels server:tandem-channel`. If you'd rather not pass that experimental flag, the entry sits idle and everything still works through polling on the HTTP connection — you just lose spontaneous reactions.
224
-
225
- **Global install** (`tandem setup`): Automatically writes both entries to `~/.claude/mcp_settings.json` (Claude Code) and/or `claude_desktop_config.json` (Claude Desktop) with absolute paths. No manual configuration needed.
226
-
227
- **Development setup** (`.mcp.json`): The repo includes a `.mcp.json` that configures both entries automatically when Claude Code runs from the repo directory:
228
-
229
- ```json
230
- {
231
- "mcpServers": {
232
- "tandem": {
233
- "type": "http",
234
- "url": "http://localhost:3479/mcp"
235
- },
236
- "tandem-channel": {
237
- "command": "npx",
238
- "args": ["tsx", "src/channel/index.ts"],
239
- "env": { "TANDEM_URL": "http://localhost:3479" }
240
- }
241
- }
242
- }
176
+ ```bash
177
+ tandem setup --with-channel-shim # persistent setup
178
+ claude --dangerously-load-development-channels server:tandem-channel # one-off
243
179
  ```
244
180
 
245
- Both entries are cross-platform no platform-specific configuration needed.
181
+ The `--dangerously-load-development-channels` flag is Claude Code's marker for unstable APIs; it becomes unnecessary when the Channels API stabilizes.
246
182
 
247
- ## Environment Variables
183
+ Without channel push, the AI uses `tandem_checkInbox` to pull the same events on demand. You can also ask Claude to poll periodically with `/loop 30s check tandem inbox and respond to any new messages`.
248
184
 
249
- All optional — defaults work out of the box.
185
+ ### Development setup
250
186
 
251
- | Variable | Default | Description |
252
- | ---------------------------------- | ----------------------- | --------------------------------------------------------------- |
253
- | `TANDEM_PORT` | `3478` | Hocuspocus WebSocket port |
254
- | `TANDEM_MCP_PORT` | `3479` | MCP HTTP + REST API port |
255
- | `TANDEM_URL` | `http://localhost:3479` | Channel shim server URL |
256
- | `TANDEM_TRANSPORT` | `http` | Transport mode (`http` or `stdio`) |
257
- | `TANDEM_NO_SAMPLE` | unset | Set to `1` to skip auto-opening `sample/welcome.md` |
258
- | `TANDEM_CLAUDE_CMD` | `claude` | Claude Code executable name (for `tandem setup` auto-detection) |
259
- | `TANDEM_BIND_HOST` | `127.0.0.1` | Bind address for MCP HTTP (`0.0.0.0` for LAN) |
260
- | `TANDEM_AUTH_TOKEN` | auto-generated | Override auth token (set by Tauri; manual use rare) |
261
- | `TANDEM_ALLOW_UNAUTHENTICATED_LAN` | unset | Set to `1` to skip token requirement on LAN bind |
262
- | `TANDEM_LAN_IP` | auto-detected | Explicit LAN IP for multi-homed machines |
263
- | `TANDEM_REQUEST_TIMEOUT_MS` | `30000` | Per-request timeout in stdio bridge (ms) |
264
- | `TANDEM_APP_DATA_DIR` | platform default | Override app-data root (sessions, auth-token, annotations) |
265
- | `TANDEM_ANNOTATION_STORE` | unset | Set to `off` to disable durable annotation persistence |
266
-
267
- See `.env.example` for a copy-paste template.
268
-
269
- ## Troubleshooting
270
-
271
- Run `npm run doctor` for a quick diagnostic of your setup. It checks Node.js version, `.mcp.json` config, server health, and port status.
272
-
273
- **Claude Code says "MCP failed to connect"**
274
- Start the server first (`tandem` for global install, or `npm run dev:standalone` for dev setup), then open Claude Code. The server must be running before Claude Code probes the MCP URL. If you restart the server, run `/mcp` in Claude Code to reconnect.
275
-
276
- **Port already in use**
277
- Tandem kills stale processes on :3478/:3479 at startup. If another app uses those ports, set `TANDEM_PORT` / `TANDEM_MCP_PORT` to different values and update `TANDEM_URL` to match.
278
-
279
- **Channel shim fails to start**
280
- The `tandem-channel` entry spawns a subprocess. For global installs, `tandem setup` writes absolute paths to the bundled `dist/channel/index.js` — re-run `tandem setup` after upgrading. For dev setup, if you see `MODULE_NOT_FOUND` with a production config (`node dist/channel/index.js`), run `npm run build`. The default dev config uses `npx tsx` and doesn't require a build step.
187
+ ```bash
188
+ git clone https://github.com/bloknayrb/tandem.git
189
+ cd tandem
190
+ npm install
191
+ npm run dev:standalone # backend (:3478, :3479) + frontend (:5173)
192
+ ```
281
193
 
282
- If the shim starts but logs `/api/events timed out after 10000ms`, `SSE inactivity timeout`, or `/api/channel-reply timed out after 5000ms`, the Tandem server accepted a connection but stopped responding on that path. Restart Tandem; the shim reports the timeout instead of hanging silently.
194
+ Open <http://127.0.0.1:5173>. The repo's `.mcp.json` configures Claude Code automatically when run from this directory.
283
195
 
284
- **Editor shows "Cannot reach the Tandem server"**
285
- The editor connects to the server via WebSocket. For global installs, run `tandem` to start the server. For dev setup, use `npm run dev:standalone` (or `npm run dev:server`). The message appears after 3 seconds of failed connection.
196
+ Verify the server is up:
286
197
 
287
- **Empty editor with no document**
288
- On first run, `sample/welcome.md` auto-opens. If you've cleared sessions or deleted the sample file, click the **+** button in the tab bar or drop a file onto the editor.
198
+ ```bash
199
+ curl http://127.0.0.1:3479/health
200
+ # → {"status":"ok","version":"x.y.z","transport":"http","hasSession":false}
201
+ ```
289
202
 
290
- ## Development
203
+ For exposing the server on a LAN, set `TANDEM_BIND_HOST` and use `tandem rotate-token` to rotate the auth token. See [docs/security.md](docs/security.md) for the full network posture.
291
204
 
292
- | Command | What it does |
293
- | ------------------------ | ---------------------------------------------------------------------------------- |
294
- | `npm run dev:standalone` | **Recommended** — frontend + backend + monitor |
295
- | `npm run dev:server` | Backend only: Hocuspocus (:3478) + MCP HTTP (:3479) |
296
- | `npm run dev:client` | Frontend only: Vite dev server (:5173) |
297
- | `npm run build` | Production build (`dist/server/` + `dist/channel/` + `dist/cli/` + `dist/client/`) |
298
- | `npm test` | Run vitest (unit tests) |
299
- | `npm run test:e2e` | Run Playwright E2E tests |
300
- | `npm run test:e2e:ui` | Playwright UI mode |
301
- | `cargo tauri dev` | Tauri desktop app (dev mode with hot-reload) |
302
- | `cargo tauri build` | Tauri production build (installer output) |
205
+ See [docs/cli.md](docs/cli.md#npm-run-scripts-source-checkouts-only) for the full list of npm scripts.
303
206
 
304
- **Tauri development** requires the [Rust toolchain](https://www.rust-lang.org/tools/install) and [Tauri CLI](https://v2.tauri.app/start/prerequisites/). Web-only development (`npm run dev:standalone`) does not require Rust.
207
+ ### Tech stack
305
208
 
306
- **Tech Stack:** Svelte 5, Tiptap, Vite, TypeScript | Node.js, Hocuspocus (Yjs WebSocket), MCP SDK, Express | Yjs (CRDT), y-prosemirror | mammoth.js (.docx), unified/remark (.md)
209
+ Tandem is built on [Tiptap](https://tiptap.dev) and [ProseMirror](https://prosemirror.net) (editor), [Yjs](https://yjs.dev) and [Hocuspocus](https://github.com/ueberdosis/hocuspocus) (CRDT sync), [Tauri 2](https://v2.tauri.app) (desktop), and [Svelte 5](https://svelte.dev) (UI).
307
210
 
308
- ## License
211
+ ### How to contribute
309
212
 
310
- Tandem is licensed under the [Business Source License 1.1](LICENSE). See `LICENSE` for full terms.
213
+ Open an issue first for non-trivial changes; for bug reports and small fixes, a PR is fine. Follow the workflow described in [CLAUDE.md](CLAUDE.md). Run `npm run typecheck` and `npm test` before opening a pull request.