tandem-editor 0.7.1 → 0.9.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tandem",
3
- "version": "0.6.2",
3
+ "version": "0.8.0",
4
4
  "description": "Edit and iterate on documents with Claude — no copy-paste, real-time push via plugin monitor",
5
5
  "author": {
6
6
  "name": "Tandem"
@@ -23,5 +23,12 @@
23
23
  "TANDEM_URL": "http://localhost:3479"
24
24
  }
25
25
  }
26
- }
26
+ },
27
+ "monitors": [
28
+ {
29
+ "name": "tandem-events",
30
+ "command": "node ${CLAUDE_PLUGIN_ROOT}/dist/monitor/index.js",
31
+ "description": "Tandem real-time document events (annotations, chat, selections)"
32
+ }
33
+ ]
27
34
  }
package/CHANGELOG.md CHANGED
@@ -7,362 +7,124 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## \[Unreleased]
9
9
 
10
- ## \[0.7.0] - 2026-04-20
11
-
12
- ### Added
13
-
14
- - **Auth token storage** — on first boot the server generates a 32-byte base64url token and persists it to the platform data directory (`%LOCALAPPDATA%\tandem\Data\auth-token` on Windows, `~/.local/share/tandem/auth-token` on Linux, `~/Library/Application Support/tandem/auth-token` on macOS). Subsequent boots reuse the token. First-boot race is protected by `O_EXCL` file creation. Tauri mode receives the token via `TANDEM_AUTH_TOKEN` env before sidecar spawn and never regenerates.
15
- - **Auth middleware** — non-loopback MCP and API requests require `Authorization: Bearer <token>`. Loopback connections (`127.0.0.1`, `::1`, `::ffff:127.0.0.1`) remain exempt, preserving zero-config Claude Code usage. Token comparison uses SHA-256 on both sides before `crypto.timingSafeEqual` to eliminate the length oracle. Rate-limiting (5 attempts / 60 s) keyed by IPv4 address or IPv6 `/64` prefix with LRU eviction; Authorization headers are redacted from all rejection logs.
16
- - **`TANDEM_BIND_HOST` bind-mode selection** — MCP HTTP server binds to `127.0.0.1` by default; set `TANDEM_BIND_HOST=0.0.0.0` (or a specific LAN IP) to expose Tandem on the local network. Hocuspocus WebSocket always stays loopback. Non-loopback bind without a token file exits 1 with guidance; `TANDEM_ALLOW_UNAUTHENTICATED_LAN=1` is the escape hatch. Multi-homed machines require `TANDEM_LAN_IP` to be set explicitly.
17
- - **`tandem rotate-token`** — new CLI subcommand that atomically regenerates the auth token, notifies the running server to open a 60-second grace window for in-flight sessions, and re-runs `tandem setup` across all detected MCP config files. Prints old and new token fingerprints (first 8 hex chars of SHA-256). Refuses rotation when `TANDEM_AUTH_TOKEN` is set in the environment (Tauri mode).
18
- - **Token forwarding in stdio bridge, monitor, and channel sidecars** — `tandem mcp-stdio`, `tandem monitor`, and the channel sidecar now forward `TANDEM_AUTH_TOKEN` as `Authorization: Bearer` on upstream HTTP calls. Malformed tokens (empty, `Bearer`-prefixed, < 32 chars, non-URL-safe) exit 1 with a specific message.
19
- - **OAuth protected-resource metadata** — `/.well-known/oauth-protected-resource/mcp` now declares `bearer_methods_supported: ["header"]` and a literal-`localhost` `resource` field per RFC 9728.
20
- - **`/health` session-presence guard** — `hasSession` is omitted from `/health` responses on non-loopback requests, preventing session-presence leakage on LAN binds.
21
-
22
- ### Security
23
-
24
- - Loopback detection keys off `req.socket.remoteAddress` exclusively — `Host` header is never trusted for the loopback bypass decision.
25
- - Fail-closed on LAN bind: `TANDEM_BIND_HOST=0.0.0.0` without a token file exits 1; the server never auto-generates a token and proceeds silently.
26
- - `crypto.randomBytes` failure or non-writable data directory → server exits 1; no silent fallback.
27
-
28
- ## \[0.6.4] - 2026-04-20
29
-
30
- ### Fixed
10
+ ## \[0.9.0] - 2026-04-28
31
11
 
32
- - **Flaky layout-switch E2E test (#281)** — `toHaveCount` assertions on resize-handle locators lacked explicit timeouts, causing intermittent CI failures under load when React re-renders were slower than the default 5 s expectation. All 8 assertions now carry `{ timeout: 10_000 }`, and the missing `right-panel-resize-handle` absence assertion in the tabbed-layout block has been added.
33
- - **Silent crashes in CLI entry points (#336)** — `src/cli/index.ts` and `src/channel/index.ts` lacked `process.once("uncaughtException")` / `process.once("unhandledRejection")` handlers. Uncaught throws in `tandem start`, `tandem setup`, and the Tauri channel sidecar exited silently with code 0, surfacing as "tools never appear" with no diagnostics. Both entries now write a labelled message to stderr and exit 1. The `uncaughtException` handler uses `err: unknown` with an `instanceof Error` guard so non-Error throws (strings, plain objects) produce the actual thrown value rather than `"undefined"`.
34
-
35
- ## \[0.6.3] - 2026-04-19
12
+ ### Breaking Changes (MCP)
36
13
 
37
- ### Fixed
14
+ This is the last breaking-change window before semver lock. MCP tool count: 31 → 28.
38
15
 
39
- - **Annotation GC race on startup (#334)** — `cleanupOrphanedAnnotationFiles` previously ran as a `.then()` chain during boot, racing the boot-path doc opens. On upgrade paths where `sample/welcome.md` or `CHANGELOG.md` hadn't been opened in 30+ days, the GC could unlink the annotation file between read intent and the actual read, silently returning an empty doc. Now `await`-ed before all boot-path opens.
40
- - **Settings Popover extends out of view (#306)** — centered the popover in the viewport with `transform: translate(-50%, -50%)` and added `maxHeight: calc(100vh - 32px)` + `overflowY: auto` so it is always fully visible and internally scrollable on short screens.
41
- - **Dark-mode&#x20;****\*-bg****&#x20;tokens inconsistent (#307)** — `--tandem-success-bg` and `--tandem-warning-bg` in dark mode were hand-coded hex while `--tandem-error-bg` used `color-mix`. All three now use `color-mix(in srgb, var(--tandem-<semantic>) 15%, var(--tandem-surface))` for consistency with light-mode behavior.
42
- - **stdio bridge silent-failure paths (#336 partial)** — three paths in `src/cli/mcp-stdio.ts` (preflight exit, `http.onclose`, `http.start()` TOCTOU) previously closed stdio without writing a JSON-RPC error, producing "tools never appear in Cowork" with no diagnostics. All three now synthesize `-32000` for any in-flight request ID before exit. Remaining #336 items (channel-shim tests, Windows npx smoke, nits) carry to v0.7.0.
43
-
44
- ### Changed
45
-
46
- - **Annotation module internals** — extracted `mergeMap<T>` helper (#324), promoted `UPLOAD_PREFIX` to shared constants (#327), centralized app-data dir resolution in `platform.ts` (#328), extracted `ReplyAuthorSchema`, trimmed module headers, and dropped unused `docContexts` map (#332). No user-facing behavior changes.
47
- - **Annotation serialization upgrades legacy&#x20;****type****&#x20;values on write** (#329) — records with non-canonical `type` (`"suggestion"` / `"question"` / anything outside `highlight` / `comment` / `flag`) are now routed through `sanitizeAnnotation` during snapshot serialization, which rewrites them to `"comment"`. **One-way lossy migration:** users with legacy-type annotations will see `type` flip to `"comment"` on the next durable write for that document — the original distinction between `suggestion` and `question` is not recoverable.
48
- - **migrateToV1****&#x20;reports drop counts** (#330) — `migrateToV1(raw)` now returns `{ doc, droppedAnnotations, droppedReplies }` so future production callers can surface lossy upgrades to users rather than silently discarding malformed records. No production caller exists yet; a follow-up will wire drop counts to `npm run doctor` or a toast when the first caller lands.
49
-
50
- ### Internal
51
-
52
- - Test coverage: `pickWinner`, `SerializedRelPos` edges, UNC paths, upload-path edges (#331); `wireAnnotationStore` perf baseline at 500/1000/5000 annotations (#335).
53
- - Test sweep: stale hex color refs cleaned up post-PR #303 (#309).
54
- - Accessibility: forced-colors fallback audit on PR #303 annotation surfaces (#311).
55
- - CI: typecheck / lint / tests now gate on all PRs regardless of base branch; dropped unused `baseUrl` from `tsconfig.server.json` (#310).
56
-
57
- ## \[0.6.2] - 2026-04-16
58
-
59
- ### Fixed
60
-
61
- - **Plugin stdio entries crash-loop on Windows** — `tandem-editor@0.6.1`'s published `package.json` shipped `"workspaces": ["packages/*"]`, a dev-only field for the vestigial `packages/tandem-doc/` alias stub. On Windows with Node 24 + npm 11, the presence of `workspaces` in an installed consumer package caused `npx -y tandem-editor …` to fail with `ERR_UNSUPPORTED_ESM_URL_SCHEME` (the bin path was handed to the ESM loader as a raw `c:\…` string instead of a `file://` URL). Claude Desktop's plugin loader spawns the stdio entries via `npx -y`, so both `tandem` and `tandem-channel` crash-exited before any user code ran, manifesting in Cowork sessions as entries that flapped "connecting → gone" and never surfaced `tandem_*` tools. Removed the unused `packages/tandem-doc/` directory and the `workspaces` field; direct `node dist/cli/index.js` invocation was never affected, so the Tauri desktop app's bundled sidecar was fine and only the npm-tarball/`npx` path needed the fix.
62
-
63
- ## \[0.6.1] - 2026-04-15
64
-
65
- ### Fixed
66
-
67
- - **Tauri desktop app fails to start** — `src/cli/skill-content.ts` reads `skills/tandem/SKILL.md` at module-init via `readFileSync`, and `src/server/mcp/api-routes.ts` transitively imports it, so the bundled sidecar server crashed on startup with `ENOENT: skills/tandem/SKILL.md`. The `skills/` directory was never declared in `src-tauri/tauri.conf.json` bundle resources (latent since the v0.5.1 refactor to read SKILL.md at runtime). Add `"../skills/": "skills/"` so the sidecar's relative path resolution matches the npm-install layout. npm-published 0.6.0 was unaffected because `skills/` ships in the npm tarball via `package.json` `files`.
68
-
69
- ## \[0.6.0] - 2026-04-15
16
+ - **`tandem_suggest` deprecated (#259)** — returns a structured error stub pointing to `tandem_comment` with `suggestedText`. Hard-remove in v0.10.0.
17
+ - **`tandem_getContent` removed (#259)** — superseded by `tandem_getTextContent`.
18
+ - **`tandem_getSelections` removed (#259)** — superseded by `tandem_checkInbox`.
19
+ - **`tandem_setStatus` merged into `tandem_status` (#259)** — `tandem_status` now accepts optional write params (`text`, `focusParagraph`, `focusOffset`). When params are present it writes to awareness; when absent it reads.
70
20
 
71
21
  ### Added
72
22
 
73
- - **Plugin bridge to Cowork** — new `tandem mcp-stdio` subcommand is a stdio ↔ HTTP JSON-RPC proxy so Claude Desktop's plugin loader surfaces the full `tandem_*` tool surface into Cowork VM sessions. Verified empirically that plugin-loaded HTTP MCP entries don't bridge to Cowork but plugin-loaded stdio entries do. The plugin's `.claude-plugin/plugin.json` now declares stdio entries for both `tandem` (proxy) and `tandem-channel` (existing shim re-exposed as `tandem channel` subcommand), invoked via `npx -y tandem-editor …` so the plugin cache never needs dev dependencies. Both subcommands share a strict preflight in `src/cli/preflight.ts` that fails fast with a single clear message when the Tandem server isn't running on `localhost:3479`.
74
- - `tandem channel` CLI subcommandnpm-delivered entry for the plugin's `tandem-channel` MCP server; shares runtime with the standalone `src/channel/index.ts` binary via the new `src/channel/run.ts` extraction.
75
- - **Settings expansion** — Settings popover grows from layout/dwell/authorship into a fuller preferences surface:
76
- - Ctrl+, / Cmd+, hotkey (AZERTY/QWERTZ/IME-safe, survives non-QWERTY layouts)
77
- - Display Name field, synced live with the StatusBar via a shared `useUserName` hook
78
- - Reduce Motion toggle (JS-gates all autoscroll paths; defaults to `prefers-reduced-motion`)
79
- - Text Size S/M/L for editor reading density (browser zoom remains the WCAG 1.4.4 path)
80
- - Theme Light/Dark/System (CSS custom-property token system on `<html data-theme>` with `forced-colors` support for Windows High Contrast)
81
- - Tier 0 accessibility prerequisites on SettingsPopover: `role="dialog"` + `aria-modal`, focus trap, Escape-to-close, pointerdown outside-dismiss, radiogroup semantics, 24×24 hit targets, focus-return on close
82
-
83
- ### Changed
84
-
85
- - Repo's project-level `.mcp.json` renamed to `.mcp.json.example` and gitignored so it no longer ships inside plugin installs. The plugin's own `.claude-plugin/plugin.json` is authoritative for MCP wiring. Developers who clone the repo should copy the example to `.mcp.json` (gitignored) if they want Claude Code to auto-connect locally.
86
- - Settings heading renamed "Layout Settings" → "Settings"
87
- - Settings popover hardcoded hex values swapped to CSS tokens (remaining components will migrate in a follow-up)
88
- - `shutdownForTests` renamed to `shutdownMonitor` (test-only alias kept for backward compatibility)
89
- - `refreshMode` IIFE now wrapped in an outer `.catch` to keep future synchronous throws off the hot path
23
+ - **`/api/info` endpoint (#441)** returns app version, MCP SDK version, tool count, data directory, and platform. Serves the Settings panel About footer.
24
+ - **Tabbed-left layout variant (#445)**new `"tabbed-left"` layout mode places the side panel on the left and editor on the right. Three layout modes total: `tabbed`, `tabbed-left`, `three-panel`.
25
+ - **App version in Settings (#435)** — `useAppInfo` hook fetches `/api/info` and displays version + MCP SDK version in the Settings popover footer.
26
+ - **View Changelog button (#437)** — Settings panel button opens `CHANGELOG.md` as a read-only document tab via `POST /api/open` with `readOnly: true`.
27
+ - **Authorship `data-tandem-author` attributes (#443)** authorship decorations switched from CSS classes (`.tandem-authorship--user`) to data attributes (`[data-tandem-author="user"]`), per ADR-026. Enables future attribute-based styling without class proliferation.
28
+ - **Schema foundations (#440, #442, #444, #450)** — `heldInSolo` field on `AnnotationBase`; 7 new `TandemSettings` fields (`accentHue`, `editorFont`, `density`, `defaultMode`, `highContrast`, `annotationPatterns`, `selectionToolbar`); `showAuthorship` default flipped to `true`; editor width minimum lowered from 50% to 40%.
29
+ - **Highlight palette migration (#450)** — palette switched from 5 colors to 4 (yellow/green/blue/pink). `LEGACY_COLOR_MAP` migrates `red` `yellow`, `purple` `blue` on annotation load.
30
+ - **CI stdio smoke test (#341)** GitHub Actions step validates the Cowork stdio bridge (`scripts/ci/stdio-smoke.mjs`) on every push.
31
+ - **`__MCP_SDK_VERSION__` build-time injection** tsup reads the real SDK version from the package root (not the CJS type marker) and injects it at build time.
90
32
 
91
33
  ### Fixed
92
34
 
93
- - **Monitor preserves last-known&#x20;****documentId** doc-less events (e.g. `chat:message`) no longer blank out the tracked document, so the shutdown awareness clear always targets a valid document.
94
- - **Monitor exits 1 on shutdown awareness failure** — if the final `clearAwareness` POST fails during SIGINT/SIGTERM, the monitor exits with a non-zero status rather than silently succeeding.
95
- - **/api/setup****&#x20;returns accurate status codes** — 207 on partial failure (some targets configured, some failed) and 500 on total failure, instead of always returning 200.
96
- - **Checkpoint after stdout write** — `lastEventId` is only advanced after `process.stdout.write` returns, so EPIPE on a closed pipe no longer silently skips an event on reconnect.
97
- - **Async EPIPE surfaces as exit(1)** — `process.stdout.on('error')` listener now catches asynchronous EPIPE (plugin host closes pipe mid-stream); monitor exits 1 instead of silently advancing `lastEventId` past lost events.
98
- - **Defensive exit on monitor fallthrough** — the retry loop exits 1 if it ever terminates without hitting the explicit exhaustion path.
99
-
100
- ## \[0.5.1] - 2026-04-13
101
-
102
- ### Added
103
-
104
- - **Claude Code plugin support** — monitor-based event push (`src/monitor/index.ts`) gives real-time notifications without polling or the channel shim. Install via `claude plugin marketplace add bloknayrb/tandem`.
105
- - **--with-channel-shim****&#x20;opt-in** — `tandem setup --with-channel-shim` writes the legacy `tandem-channel` MCP entry for setups that can't install the plugin.
106
-
107
- ### Changed
108
-
109
- - `tandem setup` no longer writes the `tandem-channel` MCP entry by default — running the plugin and the shim simultaneously produces duplicate event notifications. The shim is now opt-in only via `--with-channel-shim`.
110
-
111
- ### Fixed
112
-
113
- - **Windows update failure** — sidecar is now killed before the NSIS installer runs, preventing "Error opening file for writing: node-sidecar.exe" during updates
114
- - **Mode check fails closed** — `/api/mode` errors now fall back to "solo" at startup (privacy signal, not a permissive default) while the hot-path background refresh keeps the last known good value to avoid mid-session suppression.
115
- - **Retry counter resets on stable uptime** — retry count now resets only after 60s of continuous uptime, not on every delivered event; prevents infinite reconnect loops when the server crashes after each event.
116
- - **Exponential backoff on reconnect** — monitor reconnects use 2s/4s/8s/16s/30s backoff instead of a fixed 2s delay.
117
- - **SIGINT/SIGTERM clears awareness** — monitor posts a final `clearAwareness` before exit so the "Claude is active" indicator doesn't hang in the browser.
118
- - **Per-route fetch timeouts** — `AbortSignal.timeout` enforces budgets per route (connect 10s, mode 2s, awareness 5s, error report 3s) to prevent hung SSE connects or mode lookups from stalling the monitor.
119
- - **SSE parse errors don't advance&#x20;****lastEventId** — JSON parse failures and schema validation errors are logged with event ID + frame tail but do not advance `lastEventId`, so bad events are re-delivered on reconnect rather than silently dropped.
120
- - **SKILL.md corrected** — `question` annotation guidance now uses `type === 'comment' && directedAt === 'claude' && author === 'user'`; all 5 highlight colors listed (yellow, red, green, blue, purple).
121
-
122
- ## \[0.5.0] - 2026-04-13
123
-
124
- ### Added
125
-
126
- - **Authorship tracking** — Y.Map overlay marks text as user-written or Claude-written, with text-color styling (blue for user, orange for Claude) (#190)
127
- - **Threaded annotation replies** — reply to annotations with back-and-forth conversation threads (#187)
128
- - **Claude cursor decoration** — character-level cursor shows where Claude is editing in real time (#209)
129
- - **Auto-save** — documents save automatically on change; Ctrl+S triggers immediate manual save (#272)
130
- - **Text zoom** — keyboard shortcuts (Ctrl+=/Ctrl+-) for adjusting text size in the Tauri desktop app (#273)
131
- - **Three-panel default layout** — editor, side panel, and chat visible by default (#264)
132
- - **Selection event suppression** — selection events only fire after a chat message is sent, reducing noise (#270)
133
- - V1.0 release plan added to roadmap (#279)
134
-
135
- ### Fixed
136
-
137
- - Session persistence, tab bar horizontal scrollbar, and tab cycling keyboard shortcuts (#278)
138
- - Authorship styling uses text color instead of background highlight; reopen sync corrected
139
- - Annotation replies renamed from Acknowledge/Dismiss to Accept/Reject for clarity
140
-
141
- ### Changed
142
-
143
- - Pinned Hocuspocus and Y.js dependency versions to prevent upstream breakage (#271)
144
- - EOL normalizer added to lint-staged for .yml and .md files (#263)
145
- - Lessons learned applied to codebase and tooling (#280)
146
-
147
- ## \[0.4.0] - 2026-04-12
148
-
149
- ### Added
150
-
151
- - Tauri v2 desktop app wrapping the existing web editor (macOS, Linux, Windows)
152
- - System tray with menu: Open Editor, Setup Claude, Check for Updates, About, Quit
153
- - Single-instance detection — second launch focuses the existing window instead of opening a duplicate
154
- - Node.js sidecar lifecycle: auto-spawn on startup, health polling, crash restart with exponential backoff
155
- - Auto-updater checks on launch and every 8h; manual check available via tray menu "Check for Updates"
156
- - Cross-platform CI release workflow (macOS arm64/x64, Linux x64, Windows x64) with GitHub Releases
157
- - Window state persistence — position and size remembered across sessions
158
- - Sample file copied to writable data directory on first run (supports read-only app bundles)
159
- - Self-signed code signing for Windows builds in CI
160
- - MCP setup auto-configuration on launch — writes Claude Code/Desktop config without manual `tandem setup`
161
-
162
- ### Fixed
163
-
164
- - Accept `tauri.localhost` origin in WebSocket and CORS checks so the production WebView can connect
165
- - Strip Windows `\\?\` extended-length path prefix returned by Tauri path APIs before passing to Node
166
- - Sidecar binary name resolution corrected for Tauri's platform-specific naming convention
167
- - Self-contained JS bundles via tsup `noExternal` so Tauri doesn't require `node_modules` at runtime
168
- - Poll for port release before restarting after update install, preventing a startup race condition
169
- - Surface last HTTP error in health-poll timeout diagnostics for easier debugging
170
-
171
- ### Changed
172
-
173
- - Updater-unavailable log downgraded from error to debug (reduces noise in dev builds without updater keys)
174
- - Unhandled sidecar events are now logged instead of silently dropped
175
- - Warn when `sample/` directory is missing in release builds
176
- - CI: fail build when updater signing key secret is absent
177
- - CI: summary job catches partial platform build failures rather than reporting false success
178
-
179
- ## \[0.3.2] - 2026-04-12
35
+ - **Cross-element edit merging (#456)** canonical Y.js length + delta-walking merge for edits spanning multiple inline elements.
36
+ - **Annotation decoration initial-sync race** — Y.Map observers firing before y-prosemirror sync no longer produce empty decoration sets.
37
+ - **Channel checkpoint timing** — checkpoint advances after MCP notification delivery, not before, preventing event loss on reconnect.
38
+ - **Auto-save spurious tab switches** — auto-save no longer triggers `document:switched` events that confuse tab state.
39
+ - **Annotation recovery guard hardening** — narrowed guard scope for edge cases in session restore.
40
+ - **Event-bridge error handling** — uncaught errors in SSE delivery no longer crash the event loop.
41
+ - **MCP SDK version resolution** — `require("@modelcontextprotocol/sdk/package.json")` resolves to `dist/cjs/package.json` (a CJS type marker without `version`); build now walks back past `dist/` to find the real version.
180
42
 
181
43
  ### Changed
182
44
 
183
- - **Annotation type unification:** Three semantically identical types (`comment`, `suggestion`, `question`) collapsed into a single `comment` type with optional `suggestedText` and `directedAt` fields. `AnnotationTypeSchema` reduced from 5 values to 3: `highlight`, `comment`, `flag`. (#193, #245, #255)
184
- - **Toolbar:** Three annotation buttons (Comment, Suggest, Ask Claude) replaced with a single Comment button with "Replace" and "@Claude" toggles (#193)
185
- - **Side panel filters:** "Suggestions" → "With replacement", "Questions" → "For Claude" (#193)
186
- - **sanitizeAnnotation()****&#x20;moved to&#x20;****src/shared/sanitize.ts** — now available to both server and client code. Client-side Y.Map reads are sanitized to handle legacy session data. (#255)
187
-
188
- ### Added
189
-
190
- - Link (Ctrl+K), Horizontal Rule, and Code Block buttons in the formatting toolbar (#204)
191
- - Replacement cards show a visual diff — original text in red strikethrough → replacement in green (#195)
192
- - Undo countdown progress bar — a shrinking indicator shows the 10-second undo window (#196)
193
- - Review mode shortcut hints (Y / N / ↑↓ / Z) shown below the Review button (#200)
194
- - Chat anchor previews expand on hover to show full text (#198)
195
- - `disabledTitle` prop on toolbar buttons — annotation buttons show "Select text first" when no text is selected (#197)
196
- - Explicit ✕ close button on the highlight color picker (#203)
197
- - `tandem_comment` now accepts optional `suggestedText` and `directedAt` parameters (#193)
198
- - `sanitizeAnnotation()` normalizes legacy `suggestion`/`question` entries at read boundaries — permanent migration for historical session data (#193)
199
- - Exhaustive type switch in `buildDecorations` catches unhandled annotation types at compile time (#255)
200
- - 8 new tests covering MCP tool params, sanitization edge cases, and legacy migration paths (#255)
201
-
202
- ### Fixed
203
-
204
- - Toolbar wraps to a second row on narrow windows instead of overflowing; inline inputs shrink responsively (#192)
205
- - Edit button on annotation cards now shows a visible "✎ Edit" label instead of icon-only (#201)
206
- - Client-side legacy annotations (from pre-0.3.2 sessions) no longer render as invisible decorations or display raw JSON (#255)
207
- - `sanitizeAnnotation` no longer drops `textSnapshot: ""` or `editedAt: 0` via falsy-check bug (#255)
208
- - Event queue observer no longer silently dies if `sanitizeAnnotation` throws (#255)
209
- - `handleEdit` catch-block no longer corrupts annotation data on JSON parse failure (#255)
210
-
211
- ### Deprecated
212
-
213
- - `tandem_suggest` MCP tool — use `tandem_comment` with `suggestedText` parameter instead (#193)
45
+ - **Redesign gap audit resolved (#439)** 7 product decisions documented in ADR-026. Design response prompt at `docs/claude-design-response-prompt.md`.
46
+ - **Distribution items deferred** #316 (macOS/Linux Cowork auto-setup), #317 (cross-platform firewall scoping), #322 (network-type detection) moved to v0.13.0. Requires macOS/Linux validation hardware.
214
47
 
215
- ### Removed
48
+ ### Internal
216
49
 
217
- - **MCP wire change:** Removed unused `"overlay"` annotation kind from `AnnotationTypeSchema`. External clients sending `type: "overlay"` will now receive a Zod validation error. (#249)
218
- - **MCP wire change:** `suggestion` and `question` annotation types removed from `AnnotationTypeSchema`. Use `comment` with `suggestedText` or `directedAt` fields. Legacy data is migrated automatically via `sanitizeAnnotation()`. (#193)
50
+ - Annotation schema Zod validation with `LEGACY_COLOR_MAP` migration path.
51
+ - `ResizeHandle` and `TabbedPanelContainer` shared components extracted for layout code reuse.
52
+ - `useAppInfo` hook with exponential backoff retry for `/api/info` fetch.
53
+ - `file-opener` read-only mode support for changelog viewing.
54
+ - 900+ lines of new test coverage: authorship decorations, annotation decorations, panel layout, app info hook, settings fields, schema migration, info route, document edit edge cases.
219
55
 
220
- ## \[0.3.0] - 2026-04-07
221
-
222
- ### Wave 4: Notification & Interruption Redesign
223
-
224
- - **Solo/Tandem mode** replaces All/Urgent/Paused interruption controls (#207, #226)
225
- - **Dwell-time selection events** — selections fire after 1s hold (#188)
226
- - **Configurable layout** — tabbed or three-panel, with settings popover (#206)
227
- - **Click-to-navigate** — click annotated text to jump to annotation card
228
- - **Tab badges** — notification counts on inactive panel tabs
229
- - **Skill-directed response routing** — Claude responds in chat panel, not terminal
230
- - Review banner replaced with per-annotation toasts (#208, landed earlier)
231
- - `Y_MAP_MODE` constant, Zod validation for mode reads, error logging in channel event bridge
232
- - 894 tests passing
233
-
234
- ## \[0.2.12] - 2026-04-06
56
+ ## \[0.8.0] - 2026-04-26
235
57
 
236
58
  ### Added
237
59
 
238
- - Undo/redo toolbar buttons powered by Y.js UndoManager tracks document edits with proper CRDT-aware undo scoping (#189, #210)
239
- - Adjustable editor content width toggle — switch between comfortable and full-width layouts, preference persists in localStorage (#185, #205)
240
- - SVG icons for unordered list, ordered list, and blockquote toolbar buttons, replacing plain text labels (#194)
241
- - Automated npm publishing via GitHub Actions with OIDC trusted publisher (tokenless)
60
+ - **NSIS pre-install sidecar kill (#434)** the NSIS installer now kills the running `node-sidecar.exe` process before file replacement, preventing "Error opening file for writing" failures during upgrade installs. Uses `nsis_tauri_utils::KillProcessCurrentUser` for user-scoped process termination. Tauri's built-in `CheckIfAppIsRunning` already handles the main binary.
242
61
 
243
- ### Fixed
244
-
245
- - Guard all localStorage access with try-catch for private/disabled browser storage modes; reset scroll position on annotation filter clear (#212, #202)
246
-
247
- ## \[0.2.11] - 2026-04-06
248
-
249
- ### Added
250
-
251
- - Auto-reload documents when files change on disk — Tandem detects external edits (e.g., Claude's Edit tool) via `fs.watch`, reloads content, and preserves existing annotations (#175)
252
- - File watcher module with 500ms debounce and self-write suppression (prevents reload loops when Tandem saves)
253
- - Toast notification when a document is reloaded from disk
254
- - Runtime warning when `onDocSwapped` callback is missing during Hocuspocus doc swap (defensive guard for #178 audit)
255
- - 28 new tests: observer reattachment, CTRL\_ROOM lifecycle, buffer cap, file watcher debounce/suppress, annotation-preserving reload
62
+ - **Semantic token lint enforcement (#356)** — `npm run check:tokens` scans `src/client/` for raw hex and non-neutral `rgba()` violations. Runs on pre-commit via lint-staged, blocking merges that introduce unsanctioned color literals.
63
+ - **`--tandem-suggestion-*` token family (#340)** — violet semantic tokens for replacement/suggestion annotations (`--tandem-suggestion`, `-fg-strong`, `-bg`, `-border`), visually distinct from the indigo accent family.
64
+ - **Annotation drop count surfacing (#351)** `normalizeAnnotation` now returns drop counts in snapshot metadata so callers can detect lossy session migrations.
65
+ - **Plugin monitor declaration (#376)** — `plugin.json` now declares the `monitor` entry, closing the event push gap where Claude Code plugin installs didn't receive real-time notifications.
66
+ - **Persistent annotation undo (#415)** — undo state survives panel switches and scrolling; persists until page reload instead of clearing on the next render cycle.
67
+ - **Diagnostic position tests (#377)** — regression test suite for flat-offset resolution across headings, inline marks, nested lists, and blockquotes.
256
68
 
257
69
  ### Fixed
258
70
 
259
- - Dead CRDT `relRange` handling`refreshRange` now strips broken CRDT anchors and re-anchors from flat offsets instead of leaving annotations permanently stuck with non-functional RelativePositions (#175)
260
- - Buffer cap test was previously a no-op (empty loop body) now actually exercises the event queue buffer (#178)
71
+ - **Three compounding coordinate system bugs (#260)** inline markup (bold, italic, code) inflated character offsets; nested block structures (list items, blockquotes) lacked separators; and list item text extraction omitted `\n` between siblings. All three bugs compounded silently — a bold word inside a nested list could shift annotation placement by 10+ characters. Fixed in `getElementText()` and `extractText()` with full encapsulation of the position module behind `resolveToElement()`.
72
+ - **Flash animation alpha wash (#308)** accept/dismiss flash used opaque background that hid annotation text; now uses `color-mix` with translucent blend against the surface.
73
+ - **Dark mode scrollbar styling (#369)** — scrollbars in the editor and side panel now respect the active theme.
74
+ - **Biome format check (#424)** — expanded a single-expression `useEffect` arrow that Biome 2.x reformatted differently than the original.
261
75
 
262
76
  ### Changed
263
77
 
264
- - CLAUDE.md gotcha for Hocuspocus doc replacement updated to document the automatic `onDocSwapped` callback lifecycle (#178)
265
-
266
- ## \[0.2.10] - 2026-04-05
267
-
268
- ### Added
269
-
270
- - Resizable side panel — drag to resize between 200–600px, width persists in localStorage
271
- - Accessibility: ARIA labels on annotation highlights (type-specific), annotation cards (`role="listitem"`, `aria-current`), annotation list (`role="list"`), review mode button (`aria-pressed`), live region for pending count and review progress
78
+ - **User annotations simplified (#381)** — user-authored annotations show Edit and Remove only; Accept/Reject reserved for Claude and imported annotations. Reduces cognitive load user notes are notes, not proposals.
79
+ - **Toolbar streamlined (#382)** — removed Replace and @Claude checkboxes from the annotation creation toolbar. These features remain available via MCP tools (`tandem_suggest`, `tandem_comment` with `directedAt`).
272
80
 
273
- ### Fixed
81
+ ### Refactored
274
82
 
275
- - Flaky session tests each test file now uses an isolated temp directory via `vi.mock`, eliminating cross-file race conditions (#177)
276
- - Session file writes use atomic rename with retry on Windows EPERM/EACCES (#173)
83
+ - **Codebase audit remediation (Phases 1–4)** 8 god-files decomposed across 4 phases:
84
+ - **Phase 1** (PRs #384–#389): wire-protocol types to `shared/`, token-store extraction, `awareness.ts` semantic tokens, Editor CSS extraction, tsconfig tightening, dead Tauri JS deps removed.
85
+ - **Phase 2** (PRs #391, #392): `api-routes.ts` split into per-route handler modules; `file-opener.ts` decomposed into phased helpers with lifecycle tests.
86
+ - **Phase 3** (PR #398, tests #399/408): event queue observer split — monolithic `queue.ts` broken into focused observer modules per Y.Map.
87
+ - **Phase 4** (PRs #409–#413): `App.tsx` hooks extracted, `SidePanel.tsx` decomposed, `Toolbar.tsx`/`SettingsPopover.tsx` split, `AnnotationCard.tsx` broken into 3 sub-components.
88
+ - **Zero-arg handler factory simplification (#393)** — reduced boilerplate in MCP handler registrations.
89
+ - **Shared annotation test fixtures (#344)** — extracted reusable test helpers for annotation creation.
90
+ - **HTTP API silent failure surfacing (#396)** — API routes that swallowed errors now return proper status codes.
277
91
 
278
- ### Changed
92
+ ### Internal
279
93
 
280
- - `atomicWrite()` extracted as shared helper in session manager — consolidates duplicate write-tmp-rename logic with exponential backoff retry
94
+ - Mixed-partial `/api/setup` 207 test (#292).
95
+ - `@xmldom/xmldom` dependency bump (#390).
96
+ - CI: typecheck/lint/test gates on all PR base branches.
281
97
 
282
- ## \[0.2.9] - 2026-04-05
98
+ ## \[0.7.1] - 2026-04-20
283
99
 
284
100
  ### Fixed
285
101
 
286
- - Changelog tab no longer disappears after upgrade version check and sample/welcome.md now open before servers start, preventing CRDT merge races with stale browser tabs
287
- - Tutorial annotation injection errors now get their own log message instead of being misattributed as file-open failures
102
+ - **MSIX Claude Desktop detection** `tandem setup` now detects Claude Desktop installed via MSIX (Microsoft Store) and generates stdio MCP entries for it (#372)
288
103
 
289
- ## \[0.2.8] - 2026-04-05
290
-
291
- ### Added
292
-
293
- - CHANGELOG.md opens as the active tab on first startup after an npm update
294
- - `checkVersionChange` helper tracks version transitions via `last-seen-version` file
295
- - CHANGELOG.md now ships in the npm package
296
-
297
- ## \[0.2.7] - 2026-04-05
298
-
299
- ### Fixed
300
-
301
- - Force-reload (`tandem_open` with `force: true`) now clears Y.Doc in-place instead of destroying the Hocuspocus room — sidebar, observers, and connections survive
302
- - TOCTOU fix: session deletion moved after successful reload transaction
303
- - Observer ownership table corrected in architecture docs
104
+ ## \[0.7.0] - 2026-04-20
304
105
 
305
106
  ### Added
306
107
 
307
- - 4 new tests for force-reload (annotation clearing, awareness clearing, .txt reload, metadata)
308
-
309
- ## \[0.2.6] - 2026-04-05
310
-
311
- ### Fixed
312
-
313
- - Demo script rewritten to be self-referential for recording
314
- - Observer ownership documentation added to architecture.md
315
-
316
- ## \[0.2.5] - 2026-04-05
317
-
318
- ### Fixed
319
-
320
- - `tandem setup` Claude Code MCP config path updated
321
-
322
- ## \[0.2.4] - 2026-04-05
323
-
324
- ### Fixed
325
-
326
- - Security audit findings (DNS rebinding, CORS, input validation)
327
-
328
- ## \[0.2.3] - 2026-04-05
329
-
330
- ### Fixed
331
-
332
- - `tandem setup` now writes Claude Code MCP config to `~/.claude.json` instead of `~/.claude/mcp_settings.json`, which Claude Code no longer reads
333
-
334
- ## \[0.2.2] - 2025-04-05
108
+ - **Auth token storage** on first boot the server generates a 32-byte base64url token and persists it to the platform data directory (`%LOCALAPPDATA%\tandem\Data\auth-token` on Windows, `~/.local/share/tandem/auth-token` on Linux, `~/Library/Application Support/tandem/auth-token` on macOS). Subsequent boots reuse the token. First-boot race is protected by `O_EXCL` file creation. Tauri mode receives the token via `TANDEM_AUTH_TOKEN` env before sidecar spawn and never regenerates.
109
+ - **Auth middleware** — non-loopback MCP and API requests require `Authorization: Bearer <token>`. Loopback connections (`127.0.0.1`, `::1`, `::ffff:127.0.0.1`) remain exempt, preserving zero-config Claude Code usage. Token comparison uses SHA-256 on both sides before `crypto.timingSafeEqual` to eliminate the length oracle. Rate-limiting (5 attempts / 60 s) keyed by IPv4 address or IPv6 `/64` prefix with LRU eviction; Authorization headers are redacted from all rejection logs.
110
+ - **`TANDEM_BIND_HOST` bind-mode selection** — MCP HTTP server binds to `127.0.0.1` by default; set `TANDEM_BIND_HOST=0.0.0.0` (or a specific LAN IP) to expose Tandem on the local network. Hocuspocus WebSocket always stays loopback. Non-loopback bind without a token file exits 1 with guidance; `TANDEM_ALLOW_UNAUTHENTICATED_LAN=1` is the escape hatch. Multi-homed machines require `TANDEM_LAN_IP` to be set explicitly.
111
+ - **`tandem rotate-token`** — new CLI subcommand that atomically regenerates the auth token, notifies the running server to open a 60-second grace window for in-flight sessions, and re-runs `tandem setup` across all detected MCP config files. Prints old and new token fingerprints (first 8 hex chars of SHA-256). Refuses rotation when `TANDEM_AUTH_TOKEN` is set in the environment (Tauri mode).
112
+ - **Token forwarding in stdio bridge, monitor, and channel sidecars** — `tandem mcp-stdio`, `tandem monitor`, and the channel sidecar now forward `TANDEM_AUTH_TOKEN` as `Authorization: Bearer` on upstream HTTP calls. Malformed tokens (empty, `Bearer`-prefixed, < 32 chars, non-URL-safe) exit 1 with a specific message.
113
+ - **OAuth protected-resource metadata** — `/.well-known/oauth-protected-resource/mcp` now declares `bearer_methods_supported: ["header"]` and a literal-`localhost` `resource` field per RFC 9728.
114
+ - **`/health` session-presence guard** `hasSession` is omitted from `/health` responses on non-loopback requests, preventing session-presence leakage on LAN binds.
335
115
 
336
- ### Fixed
116
+ ### Security
337
117
 
338
- - Silent failure review findings
118
+ - Loopback detection keys off `req.socket.remoteAddress` exclusively — `Host` header is never trusted for the loopback bypass decision.
119
+ - Fail-closed on LAN bind: `TANDEM_BIND_HOST=0.0.0.0` without a token file exits 1; the server never auto-generates a token and proceeds silently.
120
+ - `crypto.randomBytes` failure or non-writable data directory → server exits 1; no silent fallback.
339
121
 
340
- ## \[0.2.1] - 2025-04-05
122
+ ## \[0.6.4] - 2026-04-20
341
123
 
342
124
  ### Fixed
343
125
 
344
- - Full security audit25 findings across 7 categories (#172)
345
-
346
- ## \[0.2.0] - 2025-04-04
347
-
348
- ### Added
349
-
350
- - Initial public release on npm as `tandem-editor`
351
- - 30 MCP tools for collaborative document editing
352
- - Multi-document tabs with CRDT-anchored annotations
353
- - Chat sidebar with real-time channel push
354
- - Support for .md, .docx, .txt, .html files
355
- - `tandem` CLI with `setup` and `start` commands
356
- - Claude Code skill auto-installation
357
-
358
- # Changelog
359
-
360
- All notable changes to Tandem will be documented in this file.
361
-
362
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
363
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
364
-
365
- ## \[Unreleased]
126
+ - **Flaky layout-switch E2E test (#281)** `toHaveCount` assertions on resize-handle locators lacked explicit timeouts, causing intermittent CI failures under load when React re-renders were slower than the default 5 s expectation. All 8 assertions now carry `{ timeout: 10_000 }`, and the missing `right-panel-resize-handle` absence assertion in the tabbed-layout block has been added.
127
+ - **Silent crashes in CLI entry points (#336)** — `src/cli/index.ts` and `src/channel/index.ts` lacked `process.once("uncaughtException")` / `process.once("unhandledRejection")` handlers. Uncaught throws in `tandem start`, `tandem setup`, and the Tauri channel sidecar exited silently with code 0, surfacing as "tools never appear" with no diagnostics. Both entries now write a labelled message to stderr and exit 1. The `uncaughtException` handler uses `err: unknown` with an `instanceof Error` guard so non-Error throws (strings, plain objects) produce the actual thrown value rather than `"undefined"`.
366
128
 
367
129
  ## \[0.6.3] - 2026-04-19
368
130