dsh-doctor
asdf17128
Find what your DeepSeek Harness (dsh) patches silently broke — dead patches, config fields dropped by whole-config repla…
PROJECT TOPICS
PROJECT README
A TypeScript compatibility bridge that adapts Pi Coding Agent extensions to DeepSeek DSH, including extension resources, tools, commands, lifecycle hooks, and Pi-style terminal UI rendering in the DSH Web client.
This project is an integration bridge, not a reimplementation of Pi or DSH. It prefers native host capabilities, maps semantics only where the correspondence is reliable, and fails explicitly when a lossless mapping is unavailable.
src/ is authoritative; lib/index.js and lib/client.js are generated runtime bundles.piExtensionUi Typert routes while Pi tools/commands stay session-scoped; revision-driven waitRevision() wakeups avoid recurring snapshot polling while the UI is static.renderCall / renderResult output can render inside DSH tool views.The bridge currently contains environment-oriented defaults for local Pi/DSH roots. Override them through bridge configuration when your installation paths differ.
This repository is currently intended for local DSH plugin development rather than npm publication.
npm install
npm run typecheck
npm run build
The package keeps the runtime export contract:
. → lib/index.js (Host)./client → lib/client.js (Web Client)Mount the package through your DSH/Cordis configuration or scoped preset. The current development setup intentionally keeps the bridge scoped to Pi-style sessions rather than globally changing every DSH session.
# TypeScript correctness gate
npm run typecheck
# Build Host + Client bundles
npm run build
# Build one side only
npm run build:host
npm run build:client
# Syntax-check generated artifacts
node --check lib/index.js
node --check lib/client.js
Do not edit generated files under lib/ directly. Make changes under src/, then rebuild.
Host composition is intentionally small; the large responsibilities live in dedicated modules:
| Module | Responsibility |
|---|---|
src/host/index.ts |
Plugin composition, Host service registration, bridge assembly |
src/host/runtime-bridge.ts |
Pi runtime actions, model/thinking/session adaptation |
src/host/ui-surface.ts |
Terminal surfaces, overlays, ANSI/cursor projection, input routing |
src/host/lifecycle.ts |
Pi lifecycle hooks, prompt and command integration |
src/host/resources.ts |
Extension loading, resources, skills, tools and command adapters |
src/host/messages.ts |
DSH ↔ Pi message/replay conversion |
src/host/ui-protocol.ts |
piExtensionUi Typert wire descriptors |
src/host/ui-registry.ts |
Per-session UI bridge registry |
src/host/config.ts |
Configuration normalization |
src/client/index.ts |
DSH Client module composition and slot registration |
src/client/terminal-layout.ts |
Terminal metrics and overlay geometry |
src/client/types.ts |
Snapshot/frame types |
src/client/errors.ts |
Remote envelope and error decoding |
See Architecture for the data flow and compatibility boundaries.
The browser side treats Pi UI output as terminal frames, not ordinary text:
/snapshot traffic; revision changes wake the Client and trigger the next snapshot fetch.The project aims for explicit compatibility rather than pretending every Pi API has an exact DSH equivalent. Current implementation notes and historical validation evidence live in:
Some host-owned capabilities can only be partially mapped when DSH does not expose an equivalent public primitive. Those cases should remain explicit boundaries instead of being emulated with unsafe global state.
Never restart or replace a user's active DSH Web/TUI process just to test this bridge. Use an isolated port:
dsh --profile web --port 3081
At minimum, validate typecheck/build, generated bundle syntax, Web startup, ANSI styling, custom TUI input, cursor/IME positioning, overlay sizing, and extension shortcut routing.
The TypeScript modularization is complete: the former monolithic Host source has been split by responsibility, the Host entry is now composition-oriented, the Client is TypeScript-based, and the current build/typecheck gates pass. STATE.md is the detailed engineering handoff record.
Keep dependency direction simple: leaf protocol/config/conversion modules should not import the composition entry. Prefer a cohesive module over version-suffixed scratch files. Before submitting changes, run:
npm run typecheck && npm run build
node --check lib/index.js
node --check lib/client.js
No open-source license has been added yet. Public source visibility does not by itself grant reuse rights; add an explicit license if you want to permit redistribution or modification.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。