Codex-style turn folding for the DSH Web UI: keeps final answers visible, groups consecutive reasoning and tool activity, and shows configurable live duration, tool-call, and token metrics with multilingual summaries.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:CH4ACKO3/dsh-turn-fold
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English | 简体中文
A dsh-harmony provider that adds Codex-Desktop-style turn folding to the DSH WebUI conversation.
https://github.com/user-attachments/assets/3c9dfdcf-a454-4750-9edf-76771ed5a9a6
During a turn, the summary bar remains visible while native thinking, notes, commands, and tool calls keep streaming. Consecutive reasoning, context injections, and tool activity share one compact group from the second item onward. When a turn settles, known Agent activity, including context injection, moves into one disclosure immediately before the final answer. Its configurable metrics default to wall time, tool-call count, and input/output tokens, and appear only when the loaded turn contains enough data to calculate them without guessing.
The final answer is located through turn-tail.closing.finalNode, not
finish_reason or DOM position. Completed, stopped, and interrupted turns fold,
with distinct status labels for the latter two. A turn remains expanded when
DSH marks its closing branch unavailable, when any later node follows the
closing answer, or while the user has keyboard focus or an active text selection
inside its activity. Failed, max-token, closing-less, and open turns also stay
expanded so errors and unfinished work are never hidden.
Expanding reuses the original native node renderers, so tool details, copy, and file links keep working. Open turns are remembered per session and turn while the WebUI remains loaded. The disclosure has keyboard-visible focus, accessible state and action labels, responsive wrapping, reduced-motion handling, and a short open/close transition that unmounts the activity after it closes.
How it works
On DSH versions with native message folding, Turn Fold takes over: it removes
the native process disclosure and disables native node folding, leaving the
plugin's turn summary and activity groups in control. Support is detected from
the chat renderer's compactTranscript or usePresentation prop rather than the CLI version.
DSH still renders reasoning, tools, and context. Saved native display preferences
are unchanged, so disabling the plugin restores native folding.
Three shape-guarded Source Patches run in memory against the compiled browser
bundle. For DSH 0.1.0-rc.8 through 0.1.1-rc.2, they target
@deepseek-ai/dsh-client-ui-conversation; for DSH 0.1.2-alpha.5 through the
0.1.7 line (including prereleases), they follow the renderer into @deepseek-ai/dsh-client-ui-chat.
Installed DSH files are never modified. Every selector must still match exactly
once, so an incompatible compiled shape fails closed instead of modifying an
uncertain target.
| Patch | Selector (expect 1) | Effect |
|---|---|---|
inject-turn-fold-runtime |
FunctionDeclaration[name.name="ChatView"], VariableStatement:has(VariableDeclaration[name.name="ChatView"]) |
Injects the fold renderer + disclosure UI into either native or decorated ChatView |
rewrite-node-render-loop |
legacy order.map(...) / 0.1.2 ChatNodeList call |
Replaces the version-specific native node-list seam with the per-turn renderer |
install-turn-fold-services |
VariableStatement:has(VariableDeclaration[name.name="t"][initializer.expression.name.name="bind"]) |
Registers the bundled English and Chinese dictionaries through DSH's native locale service and binds the native settings scope |
Install
dsh plugin --profile web add github:memorax-ai/dsh-turn-fold
dsh harmony status --profile web # all three patches must be `bound`
Test
node test/run.cjs
npm install installs the dependencies required by the test harness. The test
suite applies all three patches to both supported compiled shapes in memory, parses the final browser bundles, and
covers completed, split-activity, post-closing, partial-history, failed,
interrupted, open, accessibility, localization, settings, and state-retention
behavior. A missing target or selector mismatch fails the test; it is never
reported as a skipped pass.
CI and release
GitHub Actions runs the test suite and a package dry run for every pull request
and every push to main. Version tags publish to npm through Trusted Publishing
(OIDC), without a long-lived npm token.
Configure the npm trusted publisher once:
npx npm@^11.15.0 trust github @ch4acko3/dsh-turn-fold \
--repo memorax-ai/dsh-turn-fold \
--file release.yml \
--allow-publish
Then create and push a version tag whose value matches package.json:
npm version patch
git push --follow-tags
Compatibility checks cover the real 0.1.5-rc.2, 0.1.6-alpha.2, and 0.1.7-rc.2 bundles. Run npm test with DSH_TURN_FOLD_UPSTREAM_ROOT pointing to an isolated DSH installation to exercise that chat bundle. Exact selector counts remain required.
DSH 0.2.0-rc.2 is also supported explicitly. Its runtime uses configForms, a Plugins settings tab, live configuration fields, and the renamed native icons. Turn Fold reads the timeline through the native chat hook when the renderer has no local timeline binding, and accepts the native duration formatter's numeric/unit segments. Windows browser checks cover combined startup with Bites, editing metrics, persistence across a Host restart, and replaying a synthetic two-turn session written through native session persistence. Seeking back hides later turns, playback disables input, and exiting restores input. This does not cover real model calls or browser interactions on macOS/Linux. The 0.2 range is limited to this tested release.
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 8567
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 8567
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 4363
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
ccch1mneyyy/dsh-TUI★ 4235
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
omdsh-dev/DSH-better-sidebar★ 4081
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
Devin-AXIS/deepseek-design#deepseek-idesign★ 1441
Visual design studio for websites, app prototypes, posters, cards, reports, and magazines, with templates, direct element editing, selection-aware AI draft handoff, and export.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.