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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tandem-editor",
3
- "version": "0.7.1",
3
+ "version": "0.9.0",
4
4
  "description": "Edit and iterate on documents with Claude — no copy-paste, real-time push via plugin monitor",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "scripts": {
35
35
  "dev": "vite",
36
- "dev:standalone": "concurrently \"vite\" \"tsx watch src/server/index.ts\"",
36
+ "dev:standalone": "concurrently --names client,server,monitor \"vite\" \"tsx watch src/server/index.ts\" \"tsx src/monitor/index.ts\"",
37
37
  "dev:client": "vite",
38
38
  "dev:server": "tsx watch src/server/index.ts",
39
39
  "build": "npm run typecheck && vite build && tsup",
@@ -53,6 +53,7 @@
53
53
  "doctor": "node scripts/doctor.mjs",
54
54
  "dev:tauri": "node scripts/download-node-sidecar.mjs && cargo tauri dev",
55
55
  "build:tauri": "cargo tauri build",
56
+ "check:tokens": "tsx scripts/check-semantic-tokens.ts",
56
57
  "prepare": "husky",
57
58
  "prepublishOnly": "npm run build"
58
59
  },
@@ -64,6 +65,9 @@
64
65
  "eslint --fix",
65
66
  "biome check --write"
66
67
  ],
68
+ "src/client/**/*.{ts,tsx}": [
69
+ "tsx scripts/check-semantic-tokens.ts"
70
+ ],
67
71
  "*.mjs": [
68
72
  "eslint --fix",
69
73
  "biome check --write"
@@ -80,11 +84,6 @@
80
84
  "@hocuspocus/server": "2.15.3",
81
85
  "@modelcontextprotocol/sdk": "^1.12.1",
82
86
  "@tauri-apps/api": "^2.10.1",
83
- "@tauri-apps/plugin-dialog": "^2.7.0",
84
- "@tauri-apps/plugin-fs": "^2.5.0",
85
- "@tauri-apps/plugin-process": "^2.3.1",
86
- "@tauri-apps/plugin-shell": "^2.3.5",
87
- "@tauri-apps/plugin-window-state": "^2.4.1",
88
87
  "@tiptap/core": "^2.11.0",
89
88
  "@tiptap/extension-collaboration": "^2.11.0",
90
89
  "@tiptap/extension-collaboration-cursor": "^2.11.0",
@@ -9,16 +9,16 @@ description: >
9
9
 
10
10
  # Tandem — Collaborative Document Editor
11
11
 
12
- Tandem lets you annotate and edit documents alongside the user in real time. The user sees your changes in a browser editor; you interact via the tandem_* MCP tool suite.
12
+ Tandem lets you annotate and edit documents alongside the user in real time. The user sees your changes in the editor; you interact via the tandem_* MCP tool suite.
13
13
 
14
14
  ## Hard Rules
15
15
 
16
16
  These prevent the most common failures. Follow them always.
17
17
 
18
- 1. **Resolve before mutating.** Call `tandem_resolveRange` (or `tandem_search`) to get offsets before calling `tandem_edit`, `tandem_highlight`, `tandem_comment`, `tandem_suggest`, or `tandem_flag`. Never compute offsets by counting characters in previously-read text — they go stale when the user edits.
18
+ 1. **Resolve before mutating.** Call `tandem_resolveRange` (or `tandem_search`) to get offsets before calling `tandem_edit`, `tandem_highlight`, `tandem_comment`, or `tandem_flag`. Never compute offsets by counting characters in previously-read text — they go stale when the user edits.
19
19
  2. **Pass `textSnapshot`.** Include the matched text as `textSnapshot` on mutations and annotations. If the text moved, the server returns `RANGE_MOVED` with relocated coordinates instead of corrupting the document.
20
- 3. **Use `tandem_getTextContent`, not `tandem_getContent`.** `getContent` returns ProseMirror JSON and burns tokens. Use `getTextContent({ section: "Section Name" })` for targeted reads. The `section` parameter is case-insensitive.
21
- 4. **`tandem_edit` cannot create paragraphs.** Newlines become literal characters. For multi-paragraph changes, use multiple `tandem_edit` calls or `tandem_suggest`.
20
+ 3. **Use `tandem_getTextContent` for document reads.** Use `getTextContent({ section: "Section Name" })` for targeted reads. The `section` parameter is case-insensitive.
21
+ 4. **`tandem_edit` cannot create paragraphs.** Newlines become literal characters. For multi-paragraph changes, use multiple `tandem_edit` calls or `tandem_comment` with `suggestedText`.
22
22
  5. **`.docx` files are read-only.** Use annotations instead of `tandem_edit`. Offer `tandem_convertToMarkdown` if the user wants an editable copy.
23
23
 
24
24
  ## Workflow
@@ -27,7 +27,7 @@ Standard workflow:
27
27
 
28
28
  1. `tandem_status` — check for already-open documents (sessions restore automatically)
29
29
  2. `tandem_getOutline` — understand document structure
30
- 3. `tandem_setStatus("Working on [section]...", { focusParagraph: N })` — show progress (use `index` from outline)
30
+ 3. `tandem_status({ text: "Working on [section]...", focusParagraph: N })` — show progress (use `index` from outline)
31
31
  4. `tandem_getTextContent({ section: "..." })` — read one section at a time
32
32
  5. Annotate or edit as needed (see annotation guide below)
33
33
  6. `tandem_checkInbox` — check for user messages and actions
@@ -38,9 +38,9 @@ Standard workflow:
38
38
 
39
39
  Choose the right type for each finding:
40
40
 
41
- - **`tandem_highlight`** — Visual marker with a short note. Colors (full set): `green` (verified/good), `red` (problem), `yellow` (needs attention), `blue` (informational), `purple` (style/tone). Prefer the first three for review work; `blue`/`purple` are available when a fourth/fifth category is meaningful. Use when the finding is self-evident from the color and a brief note.
41
+ - **`tandem_highlight`** — Visual marker with a short note. Colors: `green` (verified/good), `yellow` (needs attention), `blue` (informational), `pink` (style/tone). Use when the finding is self-evident from the color and a brief note.
42
42
  - **`tandem_comment`** — Observation requiring explanation. Use when you need more than one sentence to convey reasoning.
43
- - **`tandem_suggest`** — Specific text replacement. **Prefer over comment when you can provide replacement text** — the user gets one-click accept/reject. Cannot create new paragraphs.
43
+ - **`tandem_comment` with `suggestedText`** — Specific text replacement. **Prefer over plain comment when you can provide replacement text** — the user gets one-click accept/reject. Cannot create new paragraphs. Pass replacement text as `suggestedText`; the comment text explains the reason.
44
44
  - **`tandem_flag`** — Factual errors, compliance risks, missing required content. Signals a blocking issue the user must address before the document ships.
45
45
 
46
46
  **User questions to Claude.** Users can author a "question" annotation in the UI. The server normalizes it to `type: "comment"` with `directedAt: "claude"` before returning it — so when scanning `tandem_checkInbox` or `tandem_getAnnotations`, match on `type === "comment" && directedAt === "claude" && author === "user"`, not `type === "question"`. Respond with `tandem_reply` for conversational answers, or a new `tandem_comment` on the same range for a textual annotation.
@@ -59,7 +59,7 @@ Selections are **not** sent as standalone events. Instead, when the user sends a
59
59
  ## Collaboration Etiquette
60
60
 
61
61
  - Check `tandem_getActivity()` before annotating near the user's cursor. If `isTyping` is true, wait for typing to stop before annotating that area.
62
- - Use `tandem_setStatus` to show what you're working on — the user sees it in the browser status bar.
62
+ - Use `tandem_status({ text: "..." })` to show what you're working on — the user sees it in the editor status bar.
63
63
  - **Call `tandem_checkInbox` every 2-3 tool calls**, not just at the end of a task. The real-time channel is often not connected; polling is the reliable path.
64
64
  - Reply to chat messages with `tandem_reply`, not annotations.
65
65
 
@@ -67,7 +67,7 @@ Selections are **not** sent as standalone events. Instead, when the user sends a
67
67
 
68
68
  1. `tandem_open` — opens in read-only mode (`readOnly: true`)
69
69
  2. `tandem_getAnnotations({ author: "import" })` — check for imported Word comments; read and act on them
70
- 3. Annotate with findings (highlight, comment, suggest, flag)
70
+ 3. Annotate with findings (highlight, comment, comment with suggestedText, flag)
71
71
  4. `tandem_exportAnnotations` — generate a review summary the user can share
72
72
  5. If the user wants editable text, offer `tandem_convertToMarkdown`
73
73