rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:zeusxx/dsh-composer-live
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
![]()
Type Markdown, see it rendered live — with a caret-aware source/reading split and theme-following colors.
[English](./README.md) · [简体中文](./README.zh-CN.md)

dsh-composer-live turns the DSH Web input box into an Open-WebUI-style live editor: you type Markdown, it renders as you type — bold, italic, code blocks with syntax highlighting, lists, quotes, tables — while the draft itself stays plain Markdown source, so what you send is exactly what you typed.
Since v0.3.0 it also does what Obsidian's live preview does: the line your caret is on shows the raw Markdown (editable, markers visible), every other line renders in clean reading form — markers hidden, - list items become bullet dots, - [ ] / - [x] tasks become real checkboxes. And all colors now follow your theme/skin via official DSH variables — inline code looks the same while typing as it does after sending.
It is a pure browser-side plugin: zero runtime dependencies, no service injection, no patches to official code. It layers on top of the official 0.1.5+ Lexical composer without touching what DSH already does natively.
Looking for the DSH 0.1.x (textarea composer) version? That's
dsh-composer-md, the predecessor of this plugin — discontinued.
Caret line shows raw markers (with the blinking caret); every other line is reading form — hidden ##/>/**, bullet dots, checkbox tasks, ordered numbers kept.




Obsidian-style live preview: the line your caret/selection is on shows raw Markdown markers (editable), every other line renders in reading form — inline markers (**, `, ~~, []()) and ## / > prefixes are hidden, unordered - becomes a bullet dot, task [ ] / [x] become real checkboxes (checked = green with a tick), ordered lists keep their numbers. Table rows and code fences always stay in source form (they are editing structure). When the composer is not focused, all lines are in reading form — a clean preview.
Hiding is paint-only (color:transparent on the absolutely-positioned render segments; symbols drawn as pseudo-elements on those segments) — character slots are preserved, so caret alignment is unaffected.
No hardcoded palette any more: accents follow --dsw-alias-link, inline-code background follows --dsw-alias-markdown-inline-code (typing and sent-message colors finally match), code-block background follows --dsw-alias-markdown-code-block, syntax tokens follow the official --shiki-token-* theme, markers follow --dsw-alias-label-dimmed, task-done follows the success token, toolbar/toast follow surface tokens. Change skin or theme and the composer follows automatically; on hosts without these variables (DSH 0.1.x) it falls back to the built-in light/dark palette.
**bold**, *italic*, `code` (theme accent capsule), ~~strikethrough~~, [links](url) (whitelisted protocols),  capsules.**, `, ~~, []()) are dimmed but keep their exact width, and bold/headings use paint-only faux-bold — so the rendered line stays character-for-character aligned with the invisible editor text. The caret lands precisely everywhere, including inside formatted spans, with zero drift while typing.- [ ] / - [x] render as checkbox capsules; completed items get struck through.-/*/+ markers kept, ordered markers increment (1. → 2., 3) → 4)), indentation kept. Enter on an empty item exits the list — two Shift+Enter presses end a list.> quote lines continue the same way (>text without a space counts too); Enter on an empty quote item exits.|a|b|, ≥ 2 columns) followed by Enter completes the |---|---| separator row plus a blank line, caret on the blank line.**…**. The bar is a standalone strip directly above the composer card, card-aligned width, taking no space inside the input area — it never overlaps content or image attachments.<b> tags into the draft./ commands and skill-name references are painted in the official reference colour, and the official hover background is disabled (it paints above the render layer and would cover the text).The official composer already provides — and this plugin deliberately does not reimplement: / command menu, @ file mentions, paste-image/file to attachments, Enter-to-send / Shift+Enter newline, IME protection, draft persistence.
| Input | Context | Action |
|---|---|---|
| Enter | plain line | send (official) |
| Shift+Enter | plain line | line break (official) |
| Enter / Shift+Enter | end of list / quote line | continue the marker (ordered increments) |
| Enter / Shift+Enter | empty list / quote item | remove marker, exit the list / quote |
| Enter / Shift+Enter | unclosed fence line | close the block; caret lands inside |
| Enter / Shift+Enter | table header row (≥ 2 cols) | complete separator row + blank line |
| Tab | inside a code block | insert 2 spaces at caret |
| Tab | list/quote marker or leading whitespace | indent line (nested list) |
| Tab | anywhere else | insert 2 spaces at caret |
| Tab / Shift+Tab | multi-line selection | indent / outdent the whole block |
| Shift+Tab | any line | outdent up to 2 spaces (absorbs the key when none) |
| Ctrl+B / Ctrl+I / Ctrl+E | anywhere | wrap selection bold / italic / code, or insert empty markers |
| ↓ | last content line of a closed block | jump below the block |
| Esc | menus open → official · expanded → collapse · generating → stop | context dispatch |
web profile — the plugin targets the 0.1.5 Lexical contenteditable composer.-webkit-text-fill-color.Verified DSH versions — every release runs the full 136-scenario E2E suite on two live instances covering both supported generations:
| DSH version | Status |
|---|---|
| 0.1.5-rc.2 | ✅ E2E tested |
| 0.2.0-rc.2 | ✅ E2E tested |
| 0.2.1-rc.5 | ✅ E2E tested (primary) |
# from npm (recommended)
dsh plugin --profile web add dsh-composer-live
# or from a local checkout (file: installs are physically copied)
dsh plugin --profile web add "file:/path/to/dsh-composer-live"
Restart the web instance after installing. Plugins load from a startup snapshot; refreshing the page alone can leave old and new bundles coexisting.
Running an isolated DSH instance? Point DSH_HOME at it so the plugin installs there instead of the default ~/.dsh:
DSH_HOME=/path/to/your/.dsh dsh plugin --profile web add dsh-composer-live
Everything is on by default — install, restart, and type Markdown in the composer.
Typical flows:
```js, press Shift+Enter — a closed block appears with the caret inside. Code with live highlighting; Tab indents two spaces; press ↓ on the last content line to exit below the block.- item, press Shift+Enter to continue items; press Shift+Enter on an empty item to end the list. Tab nests, Shift+Tab un-nests.The official composer is a Lexical contenteditable editor. This plugin makes its text invisible with -webkit-text-fill-color: transparent (the color property is kept, so the caret and official decorations keep working) and paints its own rendering layer — with every rendered character positioned at the editor's real text coordinates, measured per-character from Range rects.
Because the overlay never does its own layout, alignment bugs (drift, jitter, misplacement) cannot exist by construction: measured deviation is ≤ 0.02px across scenarios, 0.00 per keystroke frame.
The plugin injects no official services. It reads the editor DOM directly and derives a "projection text" (chips → U+FFFC, <br>/paragraph boundaries → newlines), which keeps it immune to client API churn; DOM anchoring uses stable data- attributes instead of hashed CSS-module class names. Draft edits (list continuation, fence completion, indenting…) go through Lexical-native channels — synthetic beforeinput events that preserve the undo stack — never direct DOM mutation.
See docs/architecture.md for the full deep dive.
\n single-text-node draft makes per-line font switching physically impossible).web profile only; Chromium-family browsers only.This plugin focuses purely on the editing experience. Other composer plugins focus on different things — they do not overlap, and can be installed together:
| Plugin | What it does | Overlap with dsh-composer-live |
|---|---|---|
| dsh-composer-live (this one) | Live Markdown rendering, code blocks, lists/quotes/tables, format toolbars, paste handling | — |
| dsh-composer-plus | Model picker, reasoning-effort rail, account display in the composer | none — different layer |
| dsh-client-composer-enter | Swaps Enter/Shift+Enter send behaviour | none — keymap only |
| dsh-prompt-history | ↑ history recall with prefix search | none — recall, not rendering |
node test-live.cjs # 220 unit tests (pure functions, no browser needed)
node e2e/run-e2e.mjs # 136-scenario × 10-invariant E2E suite against a live instance
The E2E runner expects a DSH web instance with this source deployed and derives everything from environment variables: DSH_CL_PORT (default 8124) and DSH_CL_DSH_HOME (defaults to DSH_HOME, then ~/.dsh) locate the deployed copy for a version check; the auth cookie is fetched automatically. See e2e/README.md for the full variable list.
The suite replays six real input channels (literal \n / literal \r\n / line-by-line br / insertParagraph / synthetic paste / refresh-restore multi-paragraph) and cross-checks an independent projection against the plugin's own, character by character.
Version discipline: every change bumps package.json and gets a CHANGELOG.md entry.
Why Chromium-only?
The transparency trick (-webkit-text-fill-color) and several caret behaviors are Chromium-specific. Firefox/Safari would need a different approach.
Does it change what I send? No. The draft is always plain Markdown source; rendering is purely visual.
Is per-character measurement slow?
It is batched per render frame and merged into a few absolutely-positioned spans. The overlay is pointer-events: none and out of flow, so it causes no reflow of the editor. Measured per-keystroke delta is 0; no perceptible input latency.
Will a DSH update break it?
Zero service injection plus data--attribute anchoring make it resilient to routine updates (class-name hash churn, client API refactors). When the official composer architecture itself changes — as 0.1.1 → 0.1.5 did, textarea → Lexical — the plugin needs a port. This plugin is that port: dsh-composer-md was its 0.1.x predecessor and is now discontinued.
Found a bug, a misaligned character, or a DSH version that misbehaves? Please open an issue — screenshots plus your DSH version help a lot. Feature ideas (new shortcuts, highlighting languages, block styles) are equally welcome.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。