@karimsa/mdxserve 0.5.0 → 0.6.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/client/DocView.tsx +3 -8
- package/client/ListingView.tsx +3 -3
- package/client/Settings.tsx +26 -21
- package/client/app.css +20 -0
- package/client/comments/CommentsPanel.tsx +163 -0
- package/client/comments/CommentsPopover.tsx +197 -0
- package/client/comments/CommentsSheet.tsx +63 -0
- package/client/comments/CommentsSidebar.tsx +18 -0
- package/client/comments/CtlButton.tsx +33 -0
- package/client/comments/DraftThread.tsx +83 -0
- package/client/comments/GutterCounters.tsx +113 -0
- package/client/comments/ReplyField.tsx +98 -0
- package/client/comments/SelectionButton.tsx +142 -0
- package/client/comments/Thread.tsx +278 -0
- package/client/comments/anchor.ts +204 -0
- package/client/comments/data.ts +98 -0
- package/client/comments/dom.ts +212 -0
- package/client/comments/drafts.ts +36 -0
- package/client/comments/highlights.ts +83 -0
- package/client/comments/model.ts +241 -0
- package/client/comments/pins.ts +37 -0
- package/client/comments/self-writes.ts +22 -0
- package/client/comments/state.ts +60 -0
- package/client/comments/time.ts +21 -0
- package/client/hooks.ts +19 -0
- package/client/platform.ts +8 -0
- package/client/router.ts +5 -0
- package/client/shell/AppShell.tsx +60 -14
- package/client/shell/StandaloneShell.tsx +3 -2
- package/client/shell/TopBar.tsx +25 -0
- package/client/ui/ConfirmDeleteDialog.tsx +1 -1
- package/client/ui/Toast.tsx +5 -1
- package/client/ui/icon-set.ts +10 -0
- package/dist/cli.js +891 -230
- package/package.json +1 -1
- package/skills/mdxserve/SKILL.md +86 -0
package/package.json
CHANGED
package/skills/mdxserve/SKILL.md
CHANGED
|
@@ -195,6 +195,92 @@ Plans are read in mdxserve and in plain text. Use headings for phases, a task li
|
|
|
195
195
|
a table for files-to-change, and at most one mermaid diagram (the architecture or the main
|
|
196
196
|
flow, never a chart). Skip components in plans unless the user views plans only in mdxserve.
|
|
197
197
|
|
|
198
|
+
## Comments
|
|
199
|
+
|
|
200
|
+
Comments belong to the reader. A person opens the doc in mdxserve, highlights text, and leaves
|
|
201
|
+
a threaded comment on it; then they ask you to deal with the comments. Threads are stored in
|
|
202
|
+
the doc's own leading YAML frontmatter under `comments`, not in the body.
|
|
203
|
+
|
|
204
|
+
### When the user asks you to look at the comments
|
|
205
|
+
|
|
206
|
+
"Look at my comments", "address the feedback on the doc", "I left notes in mdxserve" all mean
|
|
207
|
+
this:
|
|
208
|
+
|
|
209
|
+
1. **Read the whole file, frontmatter included.** The threads are in the `comments` list at
|
|
210
|
+
the top. They are not in the rendered page text, and a search of the body will not find
|
|
211
|
+
them.
|
|
212
|
+
2. **Take the open threads**: entries with `resolved: false` or no `resolved` key. Skip
|
|
213
|
+
resolved ones.
|
|
214
|
+
3. **Find what each one is about.** `anchor.heading` is the section, `anchor.block` is the
|
|
215
|
+
paragraph or list item, `anchor.quote` is the exact words the person highlighted. The last
|
|
216
|
+
`human` message in `messages` is what to act on.
|
|
217
|
+
4. **Do what it asks.** Edit the body for a change request. For a question, answer it in the
|
|
218
|
+
thread and leave the body alone unless the answer belongs in the doc.
|
|
219
|
+
5. **Reply in the thread** with one short message saying what you changed or the answer.
|
|
220
|
+
Append it to that thread's `messages` with `author: agent`.
|
|
221
|
+
6. **Repair the anchor** if your edit changed or moved the commented text (see below).
|
|
222
|
+
7. **Leave `resolved` alone.** The person resolves a thread when they are satisfied. Set
|
|
223
|
+
`resolved: true` only when told to.
|
|
224
|
+
8. Run `mdxserve validate <absolute path>` and fix every comment warning it reports.
|
|
225
|
+
|
|
226
|
+
### Do not start threads on your own
|
|
227
|
+
|
|
228
|
+
When you write or edit a doc, put content in the body and raise questions in the chat. Start a
|
|
229
|
+
thread only when the user explicitly asks you to review a doc by leaving comments on it. Never
|
|
230
|
+
remove or rewrite a `human` message.
|
|
231
|
+
|
|
232
|
+
### Format
|
|
233
|
+
|
|
234
|
+
```yaml
|
|
235
|
+
---
|
|
236
|
+
title: Getting started
|
|
237
|
+
comments:
|
|
238
|
+
- id: k3J9xQ2a
|
|
239
|
+
anchor:
|
|
240
|
+
heading: Installation
|
|
241
|
+
block: Run the installer, then restart your shell so the new PATH entry is picked up.
|
|
242
|
+
quote: restart your shell
|
|
243
|
+
resolved: false
|
|
244
|
+
messages:
|
|
245
|
+
- id: Zp41mD0c
|
|
246
|
+
author: human
|
|
247
|
+
body: Is a restart still needed on fish?
|
|
248
|
+
createdAt: 2026-11-24T19:02:11.000Z
|
|
249
|
+
- id: m2
|
|
250
|
+
author: agent
|
|
251
|
+
body: No. Fish reads conf.d on each prompt. I removed the restart step for fish.
|
|
252
|
+
createdAt: 2026-11-24T19:05:40.000Z
|
|
253
|
+
---
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
- **A reply** is a new entry at the end of `messages`: `author: agent`, a `body` of 1 to 4000
|
|
257
|
+
characters, and an `id` unique in that thread (`m2`, `m3`, …; letters, digits, `_` and `-`,
|
|
258
|
+
up to 64). `createdAt` is optional ISO 8601 UTC. A thread holds up to 100 messages.
|
|
259
|
+
- **A new thread** (review requests only) is a new entry at the end of `comments` with a
|
|
260
|
+
unique `id`, an `anchor`, and one message.
|
|
261
|
+
- **Anchor values are rendered text, not Markdown source**: no `**`, backticks, link syntax or
|
|
262
|
+
list markers, and whitespace runs collapsed to one space. `heading` is the plain text of the
|
|
263
|
+
nearest heading above the block (the block itself when it is a heading), or `null` before the
|
|
264
|
+
first heading. `block` is the plain text of the paragraph, list item, table cell or other
|
|
265
|
+
block, and only its last 500 characters when longer. `quote` is the exact visible words
|
|
266
|
+
inside that block, at most 500 characters.
|
|
267
|
+
- **Repairing an anchor**: set `heading`, `block` and `quote` to the text as it reads now. If
|
|
268
|
+
the commented words are gone, anchor to the sentence that replaced them. A thread whose
|
|
269
|
+
block no longer matches shows on its section heading; one whose heading is gone shows as
|
|
270
|
+
detached.
|
|
271
|
+
- **Keep the frontmatter valid YAML.** One YAML error hides the page metadata and every
|
|
272
|
+
thread, and the server refuses to add comments until it is fixed. Leave other keys alone.
|
|
273
|
+
|
|
274
|
+
### What `mdxserve validate` checks
|
|
275
|
+
|
|
276
|
+
`validate` checks comments on every run, with or without a server. Both codes are warnings:
|
|
277
|
+
|
|
278
|
+
- `frontmatter-comments`: a thread or message does not match the format (bad `id`, unknown
|
|
279
|
+
`author`, empty `body`, missing `anchor`, duplicate ids). The entry is skipped in the
|
|
280
|
+
browser, so the person cannot see it. Fix the entry on the line named.
|
|
281
|
+
- `comment-anchor`: an open thread's `heading` or `block` text is not in the doc, usually
|
|
282
|
+
because the text was edited. Repair the anchor.
|
|
283
|
+
|
|
198
284
|
## After writing
|
|
199
285
|
|
|
200
286
|
After saving any `.md`/`.mdx` file, run `mdxserve validate <absolute path>`. It works even when
|