rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
LTP414/dsh-btw-marginalia
Read-only /btw side questions for DeepSeek Harness: fork the current session, ask in the margin, keep the main transcript untouched. DeepSeek Harness 的 /btw 只读旁问:fork 当前会话、答案留在页边,不污染主对话。Host + Web Client 插件。
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:LTP414/dsh-btw-marginalia
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Read-only side questions for DeepSeek Harness. Ask in the margin, keep the main thread clean.
marginalia (noun): notes written in the margin of a page. That is what /btw is in
oh-my-pi: a note taken beside the main conversation,
without changing it.
This is a DSH Host + Web Client bundle that implements the practical form of that contract:
/btw useful even before turn/end.
The real /btw slash entry · streaming in the margin, with Stop and insert actions
Topic history with follow-up · light and dark DSH themes
Screenshots are produced by the Playwright screenshot spec (npm run screenshots) against an
isolated Host and a deterministic demo model, not by hand-editing the UI.
>= 0.2.1-rc.1 < 0.3.0-0 (tested against 0.2.1-rc.2)>= 22crypto.randomUUID is restricted to secure contexts, so the plugin uses getRandomValues (or a non-cryptographic identifier fallback) when needed.fork subagent provider and storage-domain for durable history
(both are part of the standard Web profile; the plugin falls back to process memory if the
storage domain is absent)dsh on PATH (or DSH_BIN), pnpm, and Playwright Chromium + Firefoxdsh plugin --profile web add github:LTP414/dsh-btw-marginalia
A git-hosted install builds the bundle once; DSH asks you to approve that build script
(allowBuilds) before it runs. The published package installs prebuilt and skips that step:
dsh plugin --profile web add dsh-btw-marginalia
npm install
npm run check # typecheck + 58 unit tests + build + smoke
npm run test:e2e # 18 browser tests across Chromium/Firefox + dark projects
Then install the workspace directory as a bundle through the Harness plugin manager, or add it to a bundle composition:
- insert:
- id: dsh-marginalia
name: dsh-btw-marginalia
The built package is self-contained: the Host half bundles its only runtime dependency (zod) and
the Client half bundles its Markdown renderer. React and the Harness packages are supplied by the
Host's module table.
| Action | How |
|---|---|
| Ask beside the current session | /btw 刚才为什么选方案 B? |
| Open topic history | /btw with no argument, or the Marginalia button at the left of the composer |
| Follow up in the same topic | The send icon on a finished bubble, or the follow-up box in history |
| Stop a running answer | The stop button on the bubble; the partial answer is kept |
| Copy / insert / retry / delete | Buttons on a bubble, a history turn, or the composer |
| Close the history panel | Esc, the close button, or click the backdrop |
/btw accepts text only. Images and files stay in the composer and the submission is refused, so
the draft is not silently lost.
/btw question
→ Client input trigger claims the line
→ Host btw-ask (authenticated command RPC, lifecycle logging suppressed)
reserve child id → guard the id → fork the parent
append one user-role <btw> prompt
persist a running turn
→ Client retains the child session and follows its Chat target
→ Host stream capture keeps partial text; cancellation persists it
→ Host persists complete/cancelled/error; child is archived best-effort
The public /btw command is contributed by an inputTriggers slash source, not by patching the
official command UI. Bubbles use conversation.input.overlay; history uses shell.overlay; the
toolbar button uses conversation.input.left. The host-side compatibility shims hide the internal
transport commands from the slash directory and drop their command/run/command/done lifecycle
pair, so the main transcript and session log stay clean.
See docs/architecture.md for the full design and
docs/verification.md for what has and has not been exercised.
marginalia, table topics, key ${parentSessionId}:${topicId}.running turns become interrupted; they are never retried automatically.The internal commands are btw-ask, btw-list, btw-get, btw-cancel, btw-delete. They are
hidden from the slash menu and quiet in the session log, but still resolve for the authenticated
RPC. This reuses the existing authenticated carrier without opening an unauthenticated HTTP route;
a native Remote namespace remains the better long-term transport. The quieting shim depends on
CommandRuntime.appendLifecycle; if a future DSH removes it, the plugin logs a warning and falls
back to visible command lifecycle events.
commands.execute RPC.send_message.The Web UI is exercised in Chromium and Firefox. The dark-theme history regression pins the send
label contrast and the scroll/pinned-follow-up layout; Firefox + DSH dark was the original failure
combination.
b behavior of
oh-my-pi is intentionally not imitated.<btw-history> section. Role-level replay would require a direct LLM call and would lose the
fork's system/tools/cache inheritance.real.nightly.spec.ts is skipped unless
DSH_E2E_REAL=1 and DEEPSEEK_API_KEY are set.The browser suite starts a separate DSH_HOME and custom profile per worker, authenticates
through the real launch-token exchange, seeds a workspace, and runs a deterministic fake LLM that
streams tokens, aborts, and forces a tool call. It binds a non-loopback HTTP address by default so
the insecure-context UUID path is exercised for real. Chromium and Firefox run the core eight
specs; both browsers also run a dark-theme history regression against the real ui-theme setting.
Covered specs: slash menu claim, token-level growth, Stop with partial history, follow-up topic,
reload persistence, read-only tool denial with an untouched file, insert-to-composer, a plain-HTTP
origin with crypto.randomUUID === undefined, first-turn context while the main turn is running,
and dark-theme history button/layout behavior.
See docs/e2e.md. Real-preset acceptance stays out of the deterministic suite:
DSH_E2E_REAL=1 DEEPSEEK_API_KEY=... npm run test:e2e:real
npm run typecheck
npm test
npm run build
npm run test:coverage
npm run test:e2e
Layout:
src/index.ts Host entry and wiring
src/shared.ts protocol, limits, prompt, sanitization
src/host/ engine, storage, guard, stream capture, commands
src/client/ trigger source, store, bubble, history, styles
tests/ pure unit and wiring tests
e2e/ isolated Host, fake LLM, Playwright specs
scripts/ build and built-artifact smoke
docs/ design research, architecture, verification, e2e
Apache-2.0. See LICENSE, NOTICE, and
THIRD_PARTY_NOTICES.md. The design is based on the three-way analysis in
docs/three-way-analysis.md.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness、deepseek-harness-plugin。