zhangweiii/dsh-tui0

@zhangweiii/dsh-tui

The interactive terminal profile bundle for DeepSeek Harness

包名
@zhangweiii/dsh-tui
版本
0.2.2
许可证
MIT
最近更新
2026年8月16日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:zhangweiii/dsh-tui

Usage

dsh plugin --profile tui add @zhangweiii/dsh-tui
dsh --profile tui
dsh --profile tui "explain this repository"
dsh --profile tui --continue
dsh --profile tui --resume 
dsh --profile tui --cwd 

dsh --profile tui --connect http://127.0.0.1:8080
dsh --profile tui --standalone

The install command pulls the package straight from the npm registry (a local checkout also works with add .). The installed dsh command initializes the tui profile with dsh-base and records this package's declared dsh.bundle; neither the CLI nor its built-in profile templates contain TUI-specific code.

The package requires an installed dsh 0.1.0-rc.6 or compatible host and does not ship a second copy of the DSH core modules.

The profile creates a persisted session by default and attaches it to the workspace for its working directory, creating or reusing that workspace record so Web lists the session in the same group. When the default Web Host is reachable, both clients use that Host's workspace registry and event streams; Web therefore receives the grouping mutation and every later session event live. --connect selects a non-default Web origin, while --standalone skips discovery and forces the isolated in-process Host. An explicit connection failure stops startup; implicit discovery failure falls back locally. A remote new session defaults to the TUI process's current directory rather than the Web process's directory.

Plain HTTP is limited to localhost, *.localhost, 127.0.0.0/8, and [::1]; every other Host must use HTTPS and must be trusted by the user. An unexpectedly closed remote WebSocket reconnects automatically. When the new subscription reports a later durable sequence, the TUI refetches history to recover records committed while disconnected.

Resuming or continuing a stored root session with a recorded directory performs the same idempotent attachment, so an older cwd-only session joins that directory's workspace; a session without a recorded directory remains ungrouped. --continue selects the most recently updated root session and creates one when none exists; --resume selects an exact persisted id. --resume and --continue are mutually exclusive, as are --connect and --standalone. The application requires an interactive TTY.

The composer uses @earendil-works/pi-tui's Editor: Enter queues a message, Alt+Enter steers the active turn, Shift+Enter inserts a newline, Escape clears the draft or cancels the active turn, Backspace/terminal DEL edits before the cursor, Up/Down traverses input history, and Ctrl+C exits. Built-in autocomplete proactively displays matches for a single slash token; Up/Down selects and Tab completes. Sessions, models, presets, subagents, setting namespaces, providers/models, and directory browsing use SelectList with Up/Down and Enter. Approval prompts accept y once or n to reject. Structured questions use a separate editor, preserving the ordinary composer draft; a single-select question with options renders as an arrow-navigable menu (the options are listed once, no separate numbered header) where Up/Down moves the highlight, Enter confirms the highlighted option, and typing any printable character (or selecting the trailing ✎ 其他 / 自定义… entry) opens a free-text editor — Escape returns to the menu. Multi-select and option-less questions instead accept option numbers, comma-separated multi-select numbers, or free text. In every question, Escape cancels the complete request. After the last question the batch moves to a confirmation summary listing each "question → your answer"; Up/Down navigates it, Enter on a question row reopens that single entry for revision, Enter on the trailing 确认提交全部回答 row sends the whole batch, and Escape cancels the request.

TuiAltScreen, VStack, and ScrollView provide the fixed-height layout. pi-tui owns alternate-screen setup, synchronized differential updates, mouse and trackpad scrolling, the scrollbar, text selection, and terminal restoration; this package contains no terminal repaint or scroll-offset algorithm. The mouse wheel and PageUp/PageDown scroll the transcript, Ctrl+Shift+F searches it, Ctrl+Shift+Up/Down jumps between user prompts, and Ctrl+Shift+Home/End moves to its boundaries. Streaming follows the end only while the reader remains there, preserving a manually selected history position until the reader returns to the bottom. Injected context rows (skill catalog, plugin context, workspace instructions, recalls), tool output, compaction, and retry summaries all render folded into a one-line header like the Web disclosure row, so long startup context and verbose tool output do not crowd the transcript; a running row stays unfolded so live output remains readable. Ctrl+Shift+E unfolds the most recent folded row, and pressing it again peels progressively older ones until all are unfolded, at which point the next press folds them back together. Ctrl+T expands or collapses the todo/job activity dock above the composer.