Перейти к основному содержимому
M

dsh-composer-ease

mengge237/dsh-composer-ease

Composer for the DeepSeek Harness Web GUI: bracket and quote pairing, wrap-on-selection, closer skipping, empty-pair backspace, and a completion popup over draft words, language tables, workspace files and model ids. Full-width brackets typed through a Ch

Установка

dsh plugin --profile web add github:mengge237/dsh-composer-ease

README


description: "Composer for the DeepSeek Harness Web GUI: bracket and quote pairing, wrap-on-selection, closer skipping, empty-pair backspace, and a completion popup over draft words, language tables, workspace files and model ids. Full-width brackets typed through a Chinese IME are converted to half-width ()." kind: "package-reference"

dsh-composer-ease

English | 中文

Summary

dsh-composer-ease is a DSH bundle plugin that adds a completion popup to the DSH Web composer, with bracket and quote pairing: brackets and quotes pair up, typing an opener over a selection wraps it, a closer over an existing closer is skipped, backspace removes an empty pair, and a completion popup opens after two characters. The browser half is plain DOM; the server half exposes two read-only loopback routes and writes nothing.

overview

Table of Contents

Install

dsh plugin --profile web add https://github.com/mengge237/dsh-composer-ease
dsh plugin --profile web remove dsh-composer-ease

Desktop (Electron) uses its own plugin manager; dsh plugin --profile desktop is rejected by the CLI. When developing, the browser half is read from disk on every request (refresh applies), while the server half needs a dsh web restart.

Use this package

ActionKey / triggerBehaviour
Auto pair( [ { " ' backtick, full-width familycaret between the pair; no pairing after a path/identifier character, or when text follows the caret
Wrap selectiontype any opener over a selectiontext becomes (text); single-line selections only (see boundaries)
Type-over / delete empty paircloser already to the right / backspace inside ()no duplicate; both sides removed
Completetwo characters, or Ctrl+Spacepopup: draft words, language tables, workspace files, model ids, snippets
Accept / navigateTab or click / ↑ ↓Enter stays the send key; ← → Home End dismiss the popup and only move the caret
DismissEscShift+Enter still inserts a newline

Completion follows the context: a fenced block selects the language table, otherwise the draft and the visible conversation vote, then the language you have been accepting candidates from.

Understand the implementation

  • lib/index.js — server half: /dsh-composer-ease/words and /config.json, both behind a loopback trust fence; ranking uses lib/fuzzy.js (VS Code's fuzzyScore, copied verbatim).
  • lib/client/*.js — browser half, nine fragments concatenated into lib/client.js by tools/build-client.mjs (the host loads exactly one file).
  • Chinese candidates come from the dictionary (lib/cjk-lexicon.js) only: the prefix is matched against the word list, so word length follows the data instead of a fixed cap.
  • The popup is plain DOM anchored to the caret; it never touches the host editor's data model.

Boundaries and known limits

See docs/boundaries-and-implementation.md for the measured list (multiline wrapping, insertion limits, IME behaviour, squiggle geometry) and the reason behind each.

Development and tests

npm run build          # fragments → lib/client.js
npm test               # five offline suites, 185 items, zero network
npm run check:all      # structure, duplicates, refactor budget, docs, privacy, prose, copies
node test/real/matrix.mjs "http://127.0.0.1:3081/?token=…" 3 --verbose   # live matrix, 49 cases per round

The host composer is Lexical: it ignores sel.modify(...), ignores beforeinput's preventDefault, and does not guarantee an input event — selection work uses flattened offsets plus explicit Ranges and cross-frame verification.

Sources and licenses

  • Interaction design follows Visual Studio Code (MIT); no source copied except lib/fuzzy.js (verbatim, see THIRD-PARTY.md).
  • Word-table data comes from monaco-editor, codemirror/lang-html, codemirror/lang-css, MDN browser-compat-data and jieba's dictionary; each entry in THIRD-PARTY.md records repo, commit, files and the full license text.
  • This plugin: MIT (see LICENSE).

Dev note

  • Change lib/client/*.js, then npm run build; never edit lib/client.js.
  • Every convention has a runnable check under tools/check-*.mjs; CI only runs them (.github/workflows/checks.yml, ubuntu + windows, one run per branch via concurrency).
  • Release: bump package.json, add a CHANGELOG entry with the commit sha, then npm run check:all.

Похожие плагины