@ne-ilyxa/dsh-session-drafts
Cursor-style New Session: every click creates a fresh blank draft session (persisted before the first message) instead of reusing the workspace's single one, plus a sidebar Drafts switcher to keep several empty chats open at once.
Install
dsh plugin --profile web add @ne-ilyxa/dsh-session-drafts
Sandbox test results
| Stage | Result |
|---|---|
| 1 install | ✓ |
| 2 list | ✓ |
| 3 mount | ✓ |
| 4 boot | — |
Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).
README
dsh-session-drafts

Cursor-style draft chats for DeepSeek Harness (DSH): New Session reuses the empty draft — and only mints a fresh one when every draft has unsent text — so empty placeholders never stack, exactly like Cursor's (or Telegram's) chat list. Every draft lives in the sidebar tree as an ordinary row: unsent-text preview title, creation time, a pencil mark and a gray tint, persistent across page reloads and host restarts. No popup, no drafts menu.
The stock web shell reuses a workspace's single blank session regardless of typed text (one empty chat per workspace, silently discarding your draft), and hides every other blank from the tree. This plugin replaces both behaviors.
What it does
1. Never stack empty drafts — on every mint path. Since the harness 0.2 refactor the mint flow lives on the uiWorkspace navigation service, and uiWorkspace.connectWorkspace is the funnel every New Session surface goes through (the sidebar button, the folder +, Ctrl+Alt+N, the hero workspace picker, the boot initial selection) — so that is the seat the rule patches. Connect first jumps to the workspace's existing EMPTY draft (a session the host says has no sent turn and whose composer carries no unsent text) and only mints a fresh durable session (session.create) when every draft is occupied. The stock method is replaced — not wrapped — because its blank-reuse scan reuses the workspace's blank regardless of typed text (one empty chat per workspace, silently discarding the draft you were writing). The per-workspace in-flight dedupe survives in the patch (a rapid double-click collapses into ONE connect), a never-engaged placeholder is adopted through the stock create handshake, and a session/writer-held refusal falls through to the fresh mint. Typed drafts stay put as their own chats; empty placeholders never multiply.
2. Drafts as tree rows. The stock tree hides blank sessions other than the current one, so the plugin overlays the data: sessions.list.getSnapshot is shadowed on the live store object (identity-stable, HMR-safe) to project every draft with blank: false and a draft title. The stock tree then renders each draft as a first-class row under its workspace — creation time in the trailing cell, click to open. "Draft" follows the host's own truth (sessionListMetadata.blank — the folded prefix contains no turn), which survives the 0.2 semantic change where opening a session flips the client blank bit: an opened-but-never-prompted draft keeps its row, its preview and its ×. The first sent message ends the draft state and the row becomes an ordinary chat, untouched by the overlay. The projection is idempotent over its own output (rows it produced are branded), so a re-captured snapshot face can never freeze a title.
3. One affordance: ×. A draft is a placeholder, not a chat — every stock row control (the ⋯ menu, the row-level archive/pin buttons) is muted, and the only trailing control is a × in the same hover cell: hidden until the row is hovered, gray, 16px, and one click discards the draft (workspace archive — the row disappears, the session log remains; the main selection clears when it was the open draft). After the first sent message the row graduates into an ordinary chat and its stock controls return.
4. Live preview titles. A draft's row title is its unsent composer text (Telegram-style, whitespace-collapsed, 60 chars), read live through conversation.input and mirrored to localStorage so previews survive reloads; an empty composer shows the localized New Session. The title is written to both summary faces the tree consumes — title (the renderer's row label) and displayTitle (archive-confirm and hover-copy) — and overlay-only changes wake the store's raw subscribers, so the tree retitles on every keystroke.
5. Visual draft identity. Draft rows get a gray title (theme-aware design token — gray-next-to-white in dark, muted-next-to-black in light) and a pencil icon in the row's empty status slot, painted by a MutationObserver marker. Rows are identified by the explicit data-row-key="session:<id>" attribute the 0.2 renderer stamps, with the React-fiber walk as the fallback — never by text, which can collide with a graduated chat's title. The gray tint targets the title span itself (the stock row CSS carries an explicit title color since 0.2). Purely cosmetic and self-healing: if the DOM shape drifts, the rows keep working and only lose the tint.
6. Zero core edits. Instance-level property shadowing guarded by Symbol.for markers (idempotent across HMR), restored on plugin unload, falling back to the stock behavior on any synchronous failure. No harness files are modified — install the plugin and it works.
Install
dsh plugin --profile web add link:/path/to/dsh-session-drafts # or from a published copy: dsh plugin --profile web add @ne-ilyxa/dsh-session-drafts
Then restart the DSH web host (a profile boot composes the client bundle into the boot graph; hot activation is not attempted by this plugin).
Release channels
- npm —
@ne-ilyxa/dsh-session-drafts; published manually by the maintainer (npm login && npm publish --access public—prepackbuilds the package). CI never touches the registry. - Prebuilt tarball — pushing a
v*tag runs [release.yml](.github/workflows/release.yml): checks →pnpm pack→dsh-session-drafts.tgzattached to the GitHub Release. Installable without npm and without pnpm'sallowBuildsbuild approval; this is the artifact storefronts prefer.
Keyboard shortcuts
Shortcut · Action
Ctrl+Alt+N · New Session from anywhere — same rule as the button: jump to the empty draft, mint only when all are
…(truncated)
Rendered from the README published on npm. Formatted only, not edited.
Versions
Published on npm::5,最后更新 2026-10-04