dsh-better-chat/README.en.md

99 lines
4.5 KiB
Markdown

# dsh-better-chat
Chat enhancements for DeepSeek Harness. Since v0.4.0 the **dsh-better-display
reading view** is merged in: one plugin and one Web client artifact provide the
reader tab plus the approval / permission / plugin-store improvements.
## Install
```sh
dsh plugin --profile desktop add dsh-better-chat
```
From this repository (pin a commit):
```sh
dsh plugin --profile desktop add git+https://git.qyhhh.top/DeepsSeekHarness/dsh-better-chat.git#<commit>
```
The compiled `lib/` is committed, so installation needs no build step. Fully
restart DSH afterwards.
## Feature 1: reading view (merged from dsh-better-display 0.3.12)
Adds a **阅读 / Reading** tab to the conversation: while a turn runs you see the
steps, reasoning and progress; on success the process collapses and the final
answer stays. The native conversation / trajectory views, composer, model picker,
tools and approvals remain.
- The reader column keeps the host ChatView `data-chat-flow` hook, so third-party
skins that hang the composer off that marker still show it.
- ````mcp-app` code blocks in the final answer render as interactive cards inside
`<iframe sandbox="allow-scripts allow-forms">`.
- **Better Display** settings: preview deliverables in the right sidebar, frosted
glass (off by default), auto-fold the process (on by default), and detect
whether the `generative-mcpapps` skill is installed in the host skill roots.
- Upstream design notes, extension points and runbooks live in [`docs/`](docs/).
## Feature 2: Enter approves, Esc rejects on approval cards (v0.1.0, hints and always-allow chord in v0.4.1)
DSH's approval card handles Enter / Esc itself, but only when focus is already
inside the card. This plugin adds:
1. **Auto-focus**: when an approval appears and the user is not typing elsewhere,
focus moves into the card's detail region.
2. **Document-level routing**: with focus outside the card, Enter clicks
"Allow once" (never "Always allow") and Esc clicks "Reject".
3. **Key hint**: the action row shows `Enter Allow once · Ctrl+Enter Always allow
· Esc Reject` keycaps, using the card's real button labels. It disappears once
the card is answered, is not focusable and is not clickable. macOS shows Cmd.
4. **Ctrl+Enter / Cmd+Enter = Always allow**, only when the card has the third
button. The official card ignores modified keys, so this chord is handled here
even while focus is inside the card. It never fires while typing in an input.
It never intercepts while typing, with Shift/Alt, auto-repeat, IME composition,
when Enter lands on another button or link, or when the card is answered.
## Feature 3: permission UI (v0.2.0, tightened in v0.3.1)
- Removes the "Full access / 完全权限" option from the `/permission` popup, the
composer permission menu and the settings default-permission dropdown.
UI-only: the slash command still works.
- Never rewrites existing session permissions on page load, reload or plugin
remount; the default is left to the host's new-session flow.
## Feature 4: plugin-store update button (v0.3.0)
Plugins installed from custom indexes only get an "update available" badge. This
feature adds an "Update to x.y.z" button that calls the host's own
`remote.pluginMarket` / `remote.pluginManager` to overwrite-install the exact
spec from the index. The remote services are injected by a child plugin, so the
feature silently disables itself when the experimental plugin index is off.
## Development
```sh
# Windows: pnpm's default isolated linker overflows on rolldown's native
# binding symlink; use the hoisted layout.
pnpm install --config.node-linker=hoisted
pnpm build # tsdown
pnpm test # vitest
```
- **Single artifact**: `lib/host.js` is the host entry and `lib/client.js` is the
only Web client artifact, registered as `dsh-better-chat`. The reader view and
the chat enhancements meet in `src/client/index.tsx`.
- **Toolchain**: [`tools/client-build.js`](tools/client-build.js) is the dshx
0.9.7 client bundle adapter (MIT, see third-party notices); the target DSH
platform module table is pinned in
`tools/harness/packages/client/web/src/platform.ts` (from dsh-v0.2.2-rc.2).
Set `DSHX_HARNESS` to build against another Harness checkout.
- **Tests**: `tests/chat/` covers the chat enhancements; `tests/*.test.ts` is the
upstream reading-view suite, re-baselined on the merged package layout.
## License
MIT. The reading-view source and docs come from
[dsh-better-display](https://github.com/aa2246740/dsh-better-display) (MIT); see
[`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) and [`licenses/`](licenses/).